@windoc/core 0.3.3 → 0.3.5

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.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var version = "0.9.47";
2
+ var version = "0.3.5";
3
3
 
4
4
  // src/dataset/enum/Common.ts
5
5
  var MaxHeightRatio = /* @__PURE__ */ ((MaxHeightRatio2) => {
@@ -39,14 +39,7 @@ var ZERO = "\u200B";
39
39
  var WRAP = "\n";
40
40
  var NBSP = " ";
41
41
  var NON_BREAKING_SPACE = " ";
42
- var PUNCTUATION_LIST = [
43
- ":",
44
- ",",
45
- ".",
46
- ";",
47
- "?",
48
- "!"
49
- ];
42
+ var PUNCTUATION_LIST = [":", ",", ".", ";", "?", "!"];
50
43
  var maxHeightRadioMapping = {
51
44
  ["half" /* HALF */]: 1 / 2,
52
45
  ["one-third" /* ONE_THIRD */]: 1 / 3,
@@ -3879,7 +3872,11 @@ var listStyleCSSMapping = {
3879
3872
  };
3880
3873
  var olPresetCycles = {
3881
3874
  ["olDefault" /* DEFAULT */]: ["decimal", "lowerAlpha", "lowerRoman"],
3882
- ["olParen" /* PARENTHESIS */]: ["decimalParen", "lowerAlphaParen", "lowerRomanParen"],
3875
+ ["olParen" /* PARENTHESIS */]: [
3876
+ "decimalParen",
3877
+ "lowerAlphaParen",
3878
+ "lowerRomanParen"
3879
+ ],
3883
3880
  ["olOutline" /* OUTLINE */]: ["outline", "outline", "outline"],
3884
3881
  ["olUpperA" /* UPPER_ALPHA */]: ["upperAlpha", "lowerAlpha", "lowerRoman"],
3885
3882
  ["olRoman" /* ROMAN */]: ["upperRoman", "upperAlpha", "decimal"],
@@ -4403,7 +4400,7 @@ function mergeOption(options = {}) {
4403
4400
  };
4404
4401
  return {
4405
4402
  mode: "edit" /* EDIT */,
4406
- locale: "zhCN",
4403
+ locale: "en",
4407
4404
  defaultType: "TEXT",
4408
4405
  defaultColor: "#000000",
4409
4406
  defaultFont: "Arial",
@@ -4496,6 +4493,7 @@ function formatElementList(elementList, options) {
4496
4493
  const startElement = elementList[0];
4497
4494
  if (isForceCompensation || isHandleFirstElement && startElement?.type !== "list" /* LIST */ && (startElement?.type && startElement.type !== "text" /* TEXT */ || !START_LINE_BREAK_REG.test(startElement?.value))) {
4498
4495
  elementList.unshift({
4496
+ type: "text" /* TEXT */,
4499
4497
  value: ZERO
4500
4498
  });
4501
4499
  }
@@ -7112,7 +7110,12 @@ function mouseup(evt, host) {
7112
7110
  rangeEnd = activeControl.setValue(replaceElementList);
7113
7111
  rangeStart = rangeEnd - replaceLength;
7114
7112
  } else {
7115
- draw.spliceElementList(elementList, rangeStart + 1, 0, replaceElementList);
7113
+ draw.spliceElementList(
7114
+ elementList,
7115
+ rangeStart + 1,
7116
+ 0,
7117
+ replaceElementList
7118
+ );
7116
7119
  }
7117
7120
  if (!~rangeEnd) {
7118
7121
  draw.render({
@@ -7431,7 +7434,11 @@ function backspace(evt, host) {
7431
7434
  }
7432
7435
  }
7433
7436
  if (!isCollapsed) {
7434
- draw.spliceElementList(elementList, startIndex + 1, endIndex - startIndex);
7437
+ draw.spliceElementList(
7438
+ elementList,
7439
+ startIndex + 1,
7440
+ endIndex - startIndex
7441
+ );
7435
7442
  curIndex = startIndex;
7436
7443
  } else if (evt.altKey) {
7437
7444
  const LETTER_REG = draw.getLetterReg();
@@ -7446,7 +7453,11 @@ function backspace(evt, host) {
7446
7453
  i--;
7447
7454
  }
7448
7455
  if (deleteCount > 0) {
7449
- draw.spliceElementList(elementList, index - deleteCount + 1, deleteCount);
7456
+ draw.spliceElementList(
7457
+ elementList,
7458
+ index - deleteCount + 1,
7459
+ deleteCount
7460
+ );
7450
7461
  }
7451
7462
  curIndex = index - deleteCount;
7452
7463
  evt.preventDefault();
@@ -7725,7 +7736,12 @@ function left(evt, host) {
7725
7736
  }
7726
7737
  if (!isCollapsed && !evt.shiftKey) {
7727
7738
  rangeManager.setRange(startIndex, startIndex);
7728
- draw.render({ curIndex: startIndex, isSetCursor: true, isSubmitHistory: false, isCompute: false });
7739
+ draw.render({
7740
+ curIndex: startIndex,
7741
+ isSetCursor: true,
7742
+ isSubmitHistory: false,
7743
+ isCompute: false
7744
+ });
7729
7745
  evt.preventDefault();
7730
7746
  return;
7731
7747
  }
@@ -7867,7 +7883,12 @@ function right(evt, host) {
7867
7883
  }
7868
7884
  if (!isCollapsed && !evt.shiftKey) {
7869
7885
  rangeManager.setRange(endIndex, endIndex);
7870
- draw.render({ curIndex: endIndex, isSetCursor: true, isSubmitHistory: false, isCompute: false });
7886
+ draw.render({
7887
+ curIndex: endIndex,
7888
+ isSetCursor: true,
7889
+ isSubmitHistory: false,
7890
+ isCompute: false
7891
+ });
7871
7892
  evt.preventDefault();
7872
7893
  return;
7873
7894
  }
@@ -9414,7 +9435,10 @@ var Position = class {
9414
9435
  startRowIndex += rowList.length;
9415
9436
  }
9416
9437
  } else {
9417
- const { column: { gap }, scale } = this.options;
9438
+ const {
9439
+ column: { gap },
9440
+ scale
9441
+ } = this.options;
9418
9442
  for (let i = 0; i < pageRowList.length; i++) {
9419
9443
  const rowList = pageRowList[i];
9420
9444
  if (!rowList?.length) continue;
@@ -10485,7 +10509,13 @@ var Background = class {
10485
10509
  const repeatYCount = background.repeat === "repeat" /* REPEAT */ || background.repeat === "repeat-y" /* REPEAT_Y */ ? Math.ceil(height * scale / imageHeight) : 1;
10486
10510
  for (let x = 0; x < repeatXCount; x++) {
10487
10511
  for (let y = 0; y < repeatYCount; y++) {
10488
- ctx.drawImage(imageElement, startX, startY, imageWidth, imageHeight);
10512
+ ctx.drawImage(
10513
+ imageElement,
10514
+ startX,
10515
+ startY,
10516
+ imageWidth,
10517
+ imageHeight
10518
+ );
10489
10519
  startY += imageHeight;
10490
10520
  }
10491
10521
  startY = 0;
@@ -11346,7 +11376,10 @@ var ScrollObserver = class {
11346
11376
  let bottomBound;
11347
11377
  if (this.scrollContainer === document) {
11348
11378
  topBound = 0;
11349
- bottomBound = Math.max(document.documentElement.clientHeight, window.innerHeight);
11379
+ bottomBound = Math.max(
11380
+ document.documentElement.clientHeight,
11381
+ window.innerHeight
11382
+ );
11350
11383
  } else {
11351
11384
  const containerRect = this.scrollContainer.getBoundingClientRect();
11352
11385
  topBound = containerRect.top;
@@ -12739,7 +12772,17 @@ var Watermark = class {
12739
12772
  }
12740
12773
  renderText(ctx, pageNo) {
12741
12774
  const {
12742
- watermark: { data: data2, opacity, font, size, color, repeat, gap, numberType, rotation },
12775
+ watermark: {
12776
+ data: data2,
12777
+ opacity,
12778
+ font,
12779
+ size,
12780
+ color,
12781
+ repeat,
12782
+ gap,
12783
+ numberType,
12784
+ rotation
12785
+ },
12743
12786
  scale
12744
12787
  } = this.options;
12745
12788
  const width = this.draw.getWidth();
@@ -13153,7 +13196,11 @@ var SelectControl = class {
13153
13196
  const { startIndex, endIndex } = range;
13154
13197
  const draw = this.control.getDraw();
13155
13198
  if (startIndex !== endIndex) {
13156
- draw.spliceElementList(elementList, startIndex + 1, endIndex - startIndex);
13199
+ draw.spliceElementList(
13200
+ elementList,
13201
+ startIndex + 1,
13202
+ endIndex - startIndex
13203
+ );
13157
13204
  } else {
13158
13205
  this.control.removePlaceholder(startIndex, context);
13159
13206
  }
@@ -14172,7 +14219,11 @@ var DateControl = class {
14172
14219
  const { startIndex, endIndex } = range;
14173
14220
  const draw = this.control.getDraw();
14174
14221
  if (startIndex !== endIndex) {
14175
- draw.spliceElementList(elementList, startIndex + 1, endIndex - startIndex);
14222
+ draw.spliceElementList(
14223
+ elementList,
14224
+ startIndex + 1,
14225
+ endIndex - startIndex
14226
+ );
14176
14227
  } else {
14177
14228
  this.control.removePlaceholder(startIndex, context);
14178
14229
  }
@@ -16270,7 +16321,11 @@ function computeCatalog(elementList, positionList) {
16270
16321
  return { position, titleElement };
16271
16322
  };
16272
16323
  if (element.titleId) {
16273
- const { position, titleElement } = getElementInfo(element, elementList, t);
16324
+ const { position, titleElement } = getElementInfo(
16325
+ element,
16326
+ elementList,
16327
+ t
16328
+ );
16274
16329
  t = position;
16275
16330
  titleElementList.push(titleElement);
16276
16331
  }
@@ -17271,100 +17326,6 @@ var BlockParticle = class {
17271
17326
  }
17272
17327
  };
17273
17328
 
17274
- // src/core/i18n/lang/zh-CN.json
17275
- var zh_CN_default = {
17276
- contextmenu: {
17277
- global: {
17278
- cut: "Cut",
17279
- copy: "Copy",
17280
- paste: "Paste",
17281
- selectAll: "Select All",
17282
- print: "Print"
17283
- },
17284
- control: {
17285
- delete: "Delete Control"
17286
- },
17287
- hyperlink: {
17288
- delete: "Delete Hyperlink",
17289
- cancel: "Cancel Hyperlink",
17290
- edit: "Edit Hyperlink"
17291
- },
17292
- image: {
17293
- change: "Change Image",
17294
- saveAs: "Save As Image",
17295
- textWrap: "Text Wrapping",
17296
- textWrapType: {
17297
- embed: "Inline",
17298
- upDown: "Top and Bottom",
17299
- surround: "Square",
17300
- floatTop: "Float Over Text",
17301
- floatBottom: "Float Below Text"
17302
- }
17303
- },
17304
- table: {
17305
- insertRowCol: "Insert Row/Column",
17306
- insertTopRow: "Insert Row Above",
17307
- insertBottomRow: "Insert Row Below",
17308
- insertLeftCol: "Insert Column Left",
17309
- insertRightCol: "Insert Column Right",
17310
- deleteRowCol: "Delete Row/Column",
17311
- deleteRow: "Delete Row",
17312
- deleteCol: "Delete Column",
17313
- deleteTable: "Delete Table",
17314
- mergeCell: "Merge Cells",
17315
- mergeCancelCell: "Cancel Merge",
17316
- verticalAlign: "Vertical Alignment",
17317
- verticalAlignTop: "Align Top",
17318
- verticalAlignMiddle: "Align Middle",
17319
- verticalAlignBottom: "Align Bottom",
17320
- border: "Table Border",
17321
- borderAll: "All Borders",
17322
- borderEmpty: "No Border",
17323
- borderDash: "Dashed Border",
17324
- borderExternal: "Outer Border",
17325
- borderInternal: "Inner Border",
17326
- borderTd: "Cell Border",
17327
- borderTdTop: "Top Border",
17328
- borderTdRight: "Right Border",
17329
- borderTdBottom: "Bottom Border",
17330
- borderTdLeft: "Left Border",
17331
- borderTdForward: "Forward Slash",
17332
- borderTdBack: "Back Slash"
17333
- }
17334
- },
17335
- datePicker: {
17336
- now: "Now",
17337
- confirm: "Confirm",
17338
- return: "Return Date",
17339
- timeSelect: "Time Select",
17340
- weeks: {
17341
- sun: "Sun",
17342
- mon: "Mon",
17343
- tue: "Tue",
17344
- wed: "Wed",
17345
- thu: "Thu",
17346
- fri: "Fri",
17347
- sat: "Sat"
17348
- },
17349
- year: "Year",
17350
- month: "Month",
17351
- hour: "Hour",
17352
- minute: "Minute",
17353
- second: "Second"
17354
- },
17355
- frame: {
17356
- header: "Header",
17357
- footer: "Footer"
17358
- },
17359
- pageBreak: {
17360
- displayName: "Page Break"
17361
- },
17362
- zone: {
17363
- headerTip: "Double-click to edit header",
17364
- footerTip: "Double-click to edit footer"
17365
- }
17366
- };
17367
-
17368
17329
  // src/core/i18n/lang/en.json
17369
17330
  var en_default = {
17370
17331
  contextmenu: {
@@ -17459,18 +17420,115 @@ var en_default = {
17459
17420
  }
17460
17421
  };
17461
17422
 
17423
+ // src/core/i18n/lang/id.json
17424
+ var id_default = {
17425
+ contextmenu: {
17426
+ global: {
17427
+ cut: "Potong",
17428
+ copy: "Salin",
17429
+ paste: "Tempel",
17430
+ selectAll: "Pilih semua",
17431
+ print: "Cetak"
17432
+ },
17433
+ control: {
17434
+ delete: "Hapus kontrol"
17435
+ },
17436
+ hyperlink: {
17437
+ delete: "Hapus tautan",
17438
+ cancel: "Batal tautan",
17439
+ edit: "Edit tautan"
17440
+ },
17441
+ image: {
17442
+ change: "Ubah gambar",
17443
+ saveAs: "Simpan sebagai gambar",
17444
+ textWrap: "Pembungkus teks",
17445
+ textWrapType: {
17446
+ embed: "Sematkan",
17447
+ upDown: "Atas bawah",
17448
+ surround: "Mengelilingi",
17449
+ floatTop: "Mengapung di atas teks",
17450
+ floatBottom: "Mengapung di bawah teks"
17451
+ }
17452
+ },
17453
+ table: {
17454
+ insertRowCol: "Sisipkan baris/kolom",
17455
+ insertTopRow: "Sisipkan 1 baris atas",
17456
+ insertBottomRow: "Sisipkan 1 baris bawah",
17457
+ insertLeftCol: "Sisipkan 1 kolom kiri",
17458
+ insertRightCol: "Sisipkan 1 kolom kanan",
17459
+ deleteRowCol: "Hapus baris/kolom",
17460
+ deleteRow: "Hapus 1 baris",
17461
+ deleteCol: "Hapus 1 kolom",
17462
+ deleteTable: "Hapus tabel",
17463
+ mergeCell: "Gabung sel",
17464
+ mergeCancelCell: "Batal gabung sel",
17465
+ verticalAlign: "Perataan vertikal",
17466
+ verticalAlignTop: "Atas",
17467
+ verticalAlignMiddle: "Tengah",
17468
+ verticalAlignBottom: "Bawah",
17469
+ border: "Batas tabel",
17470
+ borderAll: "Semua",
17471
+ borderEmpty: "Kosong",
17472
+ borderDash: "Putus-putus",
17473
+ borderExternal: "Eksternal",
17474
+ borderInternal: "Internal",
17475
+ borderTd: "Batas sel tabel",
17476
+ borderTdTop: "Atas",
17477
+ borderTdRight: "Kanan",
17478
+ borderTdBottom: "Bawah",
17479
+ borderTdLeft: "Kiri",
17480
+ borderTdForward: "Maju",
17481
+ borderTdBack: "Mundur"
17482
+ }
17483
+ },
17484
+ datePicker: {
17485
+ now: "Sekarang",
17486
+ confirm: "Konfirmasi",
17487
+ return: "Kembali",
17488
+ timeSelect: "Pilih waktu",
17489
+ weeks: {
17490
+ sun: "Min",
17491
+ mon: "Sen",
17492
+ tue: "Sel",
17493
+ wed: "Rab",
17494
+ thu: "Kam",
17495
+ fri: "Jum",
17496
+ sat: "Sab"
17497
+ },
17498
+ year: " ",
17499
+ month: " ",
17500
+ hour: "Jam",
17501
+ minute: "Menit",
17502
+ second: "Detik"
17503
+ },
17504
+ frame: {
17505
+ header: "Header",
17506
+ footer: "Footer"
17507
+ },
17508
+ pageBreak: {
17509
+ displayName: "Henti Halaman"
17510
+ },
17511
+ zone: {
17512
+ headerTip: "Klik dua kali untuk edit header",
17513
+ footerTip: "Klik dua kali untuk edit footer"
17514
+ }
17515
+ };
17516
+
17462
17517
  // src/core/i18n/I18n.ts
17463
17518
  var I18n = class {
17464
17519
  constructor(locale) {
17465
17520
  this.langMap = /* @__PURE__ */ new Map([
17466
- ["zhCN", zh_CN_default],
17467
- ["en", en_default]
17521
+ ["en", en_default],
17522
+ ["id", id_default]
17468
17523
  ]);
17469
17524
  this.currentLocale = locale;
17470
17525
  }
17471
17526
  registerLangMap(locale, lang) {
17472
17527
  const sourceLang = this.langMap.get(locale);
17473
- this.langMap.set(locale, mergeObject(sourceLang || zh_CN_default, lang));
17528
+ this.langMap.set(
17529
+ locale,
17530
+ mergeObject(sourceLang || this.langMap.get("en"), lang)
17531
+ );
17474
17532
  }
17475
17533
  getLocale() {
17476
17534
  return this.currentLocale;
@@ -17479,7 +17537,7 @@ var I18n = class {
17479
17537
  this.currentLocale = locale;
17480
17538
  }
17481
17539
  getLang() {
17482
- return this.langMap.get(this.currentLocale) || zh_CN_default;
17540
+ return this.langMap.get(this.currentLocale) || this.langMap.get("en");
17483
17541
  }
17484
17542
  t(path) {
17485
17543
  const keyList = path.split(".");
@@ -17917,7 +17975,9 @@ var Zone = class {
17917
17975
  dropdown.append(addItem);
17918
17976
  } else {
17919
17977
  const formatItem = document.createElement("div");
17920
- formatItem.classList.add(`${EDITOR_PREFIX}-zone-indicator-dropdown__item`);
17978
+ formatItem.classList.add(
17979
+ `${EDITOR_PREFIX}-zone-indicator-dropdown__item`
17980
+ );
17921
17981
  formatItem.textContent = isHeaderActive ? "Header Format" : "Footer Format";
17922
17982
  formatItem.onclick = (e) => {
17923
17983
  e.stopPropagation();
@@ -17931,7 +17991,9 @@ var Zone = class {
17931
17991
  );
17932
17992
  dropdown.append(separator);
17933
17993
  const removeItem = document.createElement("div");
17934
- removeItem.classList.add(`${EDITOR_PREFIX}-zone-indicator-dropdown__item`);
17994
+ removeItem.classList.add(
17995
+ `${EDITOR_PREFIX}-zone-indicator-dropdown__item`
17996
+ );
17935
17997
  removeItem.textContent = isHeaderActive ? "Remove Header" : "Remove Footer";
17936
17998
  removeItem.onclick = (e) => {
17937
17999
  e.stopPropagation();
@@ -18819,7 +18881,10 @@ var MouseObserver = class {
18819
18881
  this.draw = draw;
18820
18882
  this.eventBus = this.draw.getEventBus();
18821
18883
  this.pageContainer = this.draw.getPageContainer();
18822
- this.pageContainer.addEventListener("mousemove", this._mousemove.bind(this));
18884
+ this.pageContainer.addEventListener(
18885
+ "mousemove",
18886
+ this._mousemove.bind(this)
18887
+ );
18823
18888
  this.pageContainer.addEventListener(
18824
18889
  "mouseenter",
18825
18890
  this._mouseenter.bind(this)
@@ -18828,7 +18893,10 @@ var MouseObserver = class {
18828
18893
  "mouseleave",
18829
18894
  this._mouseleave.bind(this)
18830
18895
  );
18831
- this.pageContainer.addEventListener("mousedown", this._mousedown.bind(this));
18896
+ this.pageContainer.addEventListener(
18897
+ "mousedown",
18898
+ this._mousedown.bind(this)
18899
+ );
18832
18900
  this.pageContainer.addEventListener("mouseup", this._mouseup.bind(this));
18833
18901
  this.pageContainer.addEventListener("click", this._click.bind(this));
18834
18902
  }
@@ -19693,7 +19761,9 @@ var TableOperate = class {
19693
19761
  if (!td.borderTypes) {
19694
19762
  td.borderTypes = [];
19695
19763
  }
19696
- const borderTypeIndex = td.borderTypes.findIndex((type) => type === payload);
19764
+ const borderTypeIndex = td.borderTypes.findIndex(
19765
+ (type) => type === payload
19766
+ );
19697
19767
  if (isSetBorderType) {
19698
19768
  if (!~borderTypeIndex) {
19699
19769
  td.borderTypes.push(payload);
@@ -20360,7 +20430,10 @@ var Draw = class {
20360
20430
  const nextElement = elementList[startIndex + 1];
20361
20431
  return !!(startElement?.title?.disabled && nextElement?.title?.disabled && startElement.titleId === nextElement.titleId || startElement?.control?.disabled && nextElement?.control?.disabled && startElement.controlId === nextElement.controlId);
20362
20432
  }
20363
- const selectionElementList = elementList.slice(startIndex + 1, endIndex + 1);
20433
+ const selectionElementList = elementList.slice(
20434
+ startIndex + 1,
20435
+ endIndex + 1
20436
+ );
20364
20437
  return selectionElementList.some(
20365
20438
  (element) => element.title?.disabled || element.control?.disabled
20366
20439
  );
@@ -21357,7 +21430,10 @@ var Draw = class {
21357
21430
  isFromTable: true,
21358
21431
  isPagingMode
21359
21432
  });
21360
- const rowHeight = tdRowList.reduce((pre, cur) => pre + cur.height, 0);
21433
+ const rowHeight = tdRowList.reduce(
21434
+ (pre, cur) => pre + cur.height,
21435
+ 0
21436
+ );
21361
21437
  td.rowList = tdRowList;
21362
21438
  const curTdHeight = rowHeight / scale + tdPaddingHeight;
21363
21439
  if (td.height < curTdHeight) {
@@ -21642,10 +21718,16 @@ var Draw = class {
21642
21718
  listLevelIndex.delete(lvl);
21643
21719
  }
21644
21720
  }
21645
- listLevelIndex.set(curLevel, (listLevelIndex.get(curLevel) ?? -1) + 1);
21721
+ listLevelIndex.set(
21722
+ curLevel,
21723
+ (listLevelIndex.get(curLevel) ?? -1) + 1
21724
+ );
21646
21725
  }
21647
21726
  } else {
21648
- listLevelIndex.set(curLevel, (listLevelIndex.get(curLevel) ?? -1) + 1);
21727
+ listLevelIndex.set(
21728
+ curLevel,
21729
+ (listLevelIndex.get(curLevel) ?? -1) + 1
21730
+ );
21649
21731
  }
21650
21732
  listIndex = listLevelIndex.get(curLevel) ?? 0;
21651
21733
  prevListLevel = curLevel;
@@ -22026,7 +22108,12 @@ var Draw = class {
22026
22108
  this.lineBreakParticle.render(ctx, element, x, y + curRow.height / 2);
22027
22109
  }
22028
22110
  if (isDrawWhiteSpace && WHITE_SPACE_REG.test(element.value)) {
22029
- this.whiteSpaceParticle.render(ctx, element, x, y + curRow.height / 2);
22111
+ this.whiteSpaceParticle.render(
22112
+ ctx,
22113
+ element,
22114
+ x,
22115
+ y + curRow.height / 2
22116
+ );
22030
22117
  }
22031
22118
  if (element.control?.border) {
22032
22119
  if (preElement?.control?.border && preElement.controlId !== element.controlId) {
@@ -22080,7 +22167,14 @@ var Draw = class {
22080
22167
  } else if (element.type === "superscript" /* SUPERSCRIPT */) {
22081
22168
  adjustY += this.superscriptParticle.getOffsetY(element);
22082
22169
  }
22083
- this.strikeout.recordFillInfo(ctx, x, adjustY, metrics.width, 0, element.color);
22170
+ this.strikeout.recordFillInfo(
22171
+ ctx,
22172
+ x,
22173
+ adjustY,
22174
+ metrics.width,
22175
+ 0,
22176
+ element.color
22177
+ );
22084
22178
  }
22085
22179
  } else if (preElement?.strikeout) {
22086
22180
  this.strikeout.render(ctx);
@@ -22116,7 +22210,13 @@ var Draw = class {
22116
22210
  }
22117
22211
  }
22118
22212
  if (!group2.disabled && element.groupIds) {
22119
- this.group.recordFillInfo(element, x, y, metrics.width, curRow.height);
22213
+ this.group.recordFillInfo(
22214
+ element,
22215
+ x,
22216
+ y,
22217
+ metrics.width,
22218
+ curRow.height
22219
+ );
22120
22220
  }
22121
22221
  index++;
22122
22222
  if (element.type === "table" /* TABLE */ && !element.hide) {
@@ -23140,10 +23240,11 @@ var CommandAdapt = class {
23140
23240
  const { endIndex } = this.range.getRange();
23141
23241
  const elementList = this.draw.getElementList();
23142
23242
  const enterElement = elementList[endIndex];
23243
+ if (!enterElement) return;
23143
23244
  this.range.setDefaultStyle({
23144
23245
  bold: enterElement.bold ? false : !this.range.getDefaultStyle()?.bold
23145
23246
  });
23146
- if (enterElement?.value === ZERO) {
23247
+ if (enterElement.value === ZERO) {
23147
23248
  enterElement.bold = !enterElement.bold;
23148
23249
  } else {
23149
23250
  isSubmitHistory = false;
@@ -23171,10 +23272,11 @@ var CommandAdapt = class {
23171
23272
  const { endIndex } = this.range.getRange();
23172
23273
  const elementList = this.draw.getElementList();
23173
23274
  const enterElement = elementList[endIndex];
23275
+ if (!enterElement) return;
23174
23276
  this.range.setDefaultStyle({
23175
23277
  italic: enterElement.italic ? false : !this.range.getDefaultStyle()?.italic
23176
23278
  });
23177
- if (enterElement?.value === ZERO) {
23279
+ if (enterElement.value === ZERO) {
23178
23280
  enterElement.italic = !enterElement.italic;
23179
23281
  } else {
23180
23282
  isSubmitHistory = false;
@@ -23212,10 +23314,11 @@ var CommandAdapt = class {
23212
23314
  const { endIndex } = this.range.getRange();
23213
23315
  const elementList = this.draw.getElementList();
23214
23316
  const enterElement = elementList[endIndex];
23317
+ if (!enterElement) return;
23215
23318
  this.range.setDefaultStyle({
23216
- underline: enterElement?.underline ? false : !this.range.getDefaultStyle()?.underline
23319
+ underline: enterElement.underline ? false : !this.range.getDefaultStyle()?.underline
23217
23320
  });
23218
- if (enterElement?.value === ZERO) {
23321
+ if (enterElement.value === ZERO) {
23219
23322
  enterElement.underline = !enterElement.underline;
23220
23323
  } else {
23221
23324
  isSubmitHistory = false;
@@ -23246,10 +23349,11 @@ var CommandAdapt = class {
23246
23349
  const { endIndex } = this.range.getRange();
23247
23350
  const elementList = this.draw.getElementList();
23248
23351
  const enterElement = elementList[endIndex];
23352
+ if (!enterElement) return;
23249
23353
  this.range.setDefaultStyle({
23250
23354
  strikeout: enterElement.strikeout ? false : !this.range.getDefaultStyle()?.strikeout
23251
23355
  });
23252
- if (enterElement?.value === ZERO) {
23356
+ if (enterElement.value === ZERO) {
23253
23357
  enterElement.strikeout = !enterElement.strikeout;
23254
23358
  } else {
23255
23359
  isSubmitHistory = false;
@@ -25706,7 +25810,9 @@ var ContextMenu = class {
25706
25810
  }
25707
25811
  _createContextMenuContainer() {
25708
25812
  const contextMenuContainer = document.createElement("div");
25709
- contextMenuContainer.classList.add(`${EDITOR_PREFIX}-contextmenu-container`);
25813
+ contextMenuContainer.classList.add(
25814
+ `${EDITOR_PREFIX}-contextmenu-container`
25815
+ );
25710
25816
  contextMenuContainer.setAttribute(
25711
25817
  EDITOR_COMPONENT,
25712
25818
  "contextmenu" /* CONTEXTMENU */
@@ -25739,7 +25845,9 @@ var ContextMenu = class {
25739
25845
  menuItem.classList.add(`${EDITOR_PREFIX}-contextmenu-item`);
25740
25846
  if (menu.childMenus) {
25741
25847
  const childMenus = this._filterMenuList(menu.childMenus);
25742
- const isRegisterContextMenu = childMenus.some((menu2) => !menu2.isDivider);
25848
+ const isRegisterContextMenu = childMenus.some(
25849
+ (menu2) => !menu2.isDivider
25850
+ );
25743
25851
  if (isRegisterContextMenu) {
25744
25852
  menuItem.classList.add(`${EDITOR_PREFIX}-contextmenu-sub-item`);
25745
25853
  menuItem.onmouseenter = () => {