@windoc/core 0.3.2 → 0.3.4

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.js CHANGED
@@ -78,7 +78,7 @@ __export(index_exports, {
78
78
  module.exports = __toCommonJS(index_exports);
79
79
 
80
80
  // src/version.ts
81
- var version = "0.9.47";
81
+ var version = "0.3.4";
82
82
 
83
83
  // src/dataset/enum/Common.ts
84
84
  var MaxHeightRatio = /* @__PURE__ */ ((MaxHeightRatio2) => {
@@ -118,14 +118,7 @@ var ZERO = "\u200B";
118
118
  var WRAP = "\n";
119
119
  var NBSP = " ";
120
120
  var NON_BREAKING_SPACE = " ";
121
- var PUNCTUATION_LIST = [
122
- ":",
123
- ",",
124
- ".",
125
- ";",
126
- "?",
127
- "!"
128
- ];
121
+ var PUNCTUATION_LIST = [":", ",", ".", ";", "?", "!"];
129
122
  var maxHeightRadioMapping = {
130
123
  ["half" /* HALF */]: 1 / 2,
131
124
  ["one-third" /* ONE_THIRD */]: 1 / 3,
@@ -3958,7 +3951,11 @@ var listStyleCSSMapping = {
3958
3951
  };
3959
3952
  var olPresetCycles = {
3960
3953
  ["olDefault" /* DEFAULT */]: ["decimal", "lowerAlpha", "lowerRoman"],
3961
- ["olParen" /* PARENTHESIS */]: ["decimalParen", "lowerAlphaParen", "lowerRomanParen"],
3954
+ ["olParen" /* PARENTHESIS */]: [
3955
+ "decimalParen",
3956
+ "lowerAlphaParen",
3957
+ "lowerRomanParen"
3958
+ ],
3962
3959
  ["olOutline" /* OUTLINE */]: ["outline", "outline", "outline"],
3963
3960
  ["olUpperA" /* UPPER_ALPHA */]: ["upperAlpha", "lowerAlpha", "lowerRoman"],
3964
3961
  ["olRoman" /* ROMAN */]: ["upperRoman", "upperAlpha", "decimal"],
@@ -4482,7 +4479,7 @@ function mergeOption(options = {}) {
4482
4479
  };
4483
4480
  return {
4484
4481
  mode: "edit" /* EDIT */,
4485
- locale: "zhCN",
4482
+ locale: "en",
4486
4483
  defaultType: "TEXT",
4487
4484
  defaultColor: "#000000",
4488
4485
  defaultFont: "Arial",
@@ -4575,6 +4572,7 @@ function formatElementList(elementList, options) {
4575
4572
  const startElement = elementList[0];
4576
4573
  if (isForceCompensation || isHandleFirstElement && startElement?.type !== "list" /* LIST */ && (startElement?.type && startElement.type !== "text" /* TEXT */ || !START_LINE_BREAK_REG.test(startElement?.value))) {
4577
4574
  elementList.unshift({
4575
+ type: "text" /* TEXT */,
4578
4576
  value: ZERO
4579
4577
  });
4580
4578
  }
@@ -7191,7 +7189,12 @@ function mouseup(evt, host) {
7191
7189
  rangeEnd = activeControl.setValue(replaceElementList);
7192
7190
  rangeStart = rangeEnd - replaceLength;
7193
7191
  } else {
7194
- draw.spliceElementList(elementList, rangeStart + 1, 0, replaceElementList);
7192
+ draw.spliceElementList(
7193
+ elementList,
7194
+ rangeStart + 1,
7195
+ 0,
7196
+ replaceElementList
7197
+ );
7195
7198
  }
7196
7199
  if (!~rangeEnd) {
7197
7200
  draw.render({
@@ -7510,7 +7513,11 @@ function backspace(evt, host) {
7510
7513
  }
7511
7514
  }
7512
7515
  if (!isCollapsed) {
7513
- draw.spliceElementList(elementList, startIndex + 1, endIndex - startIndex);
7516
+ draw.spliceElementList(
7517
+ elementList,
7518
+ startIndex + 1,
7519
+ endIndex - startIndex
7520
+ );
7514
7521
  curIndex = startIndex;
7515
7522
  } else if (evt.altKey) {
7516
7523
  const LETTER_REG = draw.getLetterReg();
@@ -7525,7 +7532,11 @@ function backspace(evt, host) {
7525
7532
  i--;
7526
7533
  }
7527
7534
  if (deleteCount > 0) {
7528
- draw.spliceElementList(elementList, index - deleteCount + 1, deleteCount);
7535
+ draw.spliceElementList(
7536
+ elementList,
7537
+ index - deleteCount + 1,
7538
+ deleteCount
7539
+ );
7529
7540
  }
7530
7541
  curIndex = index - deleteCount;
7531
7542
  evt.preventDefault();
@@ -7804,7 +7815,12 @@ function left(evt, host) {
7804
7815
  }
7805
7816
  if (!isCollapsed && !evt.shiftKey) {
7806
7817
  rangeManager.setRange(startIndex, startIndex);
7807
- draw.render({ curIndex: startIndex, isSetCursor: true, isSubmitHistory: false, isCompute: false });
7818
+ draw.render({
7819
+ curIndex: startIndex,
7820
+ isSetCursor: true,
7821
+ isSubmitHistory: false,
7822
+ isCompute: false
7823
+ });
7808
7824
  evt.preventDefault();
7809
7825
  return;
7810
7826
  }
@@ -7946,7 +7962,12 @@ function right(evt, host) {
7946
7962
  }
7947
7963
  if (!isCollapsed && !evt.shiftKey) {
7948
7964
  rangeManager.setRange(endIndex, endIndex);
7949
- draw.render({ curIndex: endIndex, isSetCursor: true, isSubmitHistory: false, isCompute: false });
7965
+ draw.render({
7966
+ curIndex: endIndex,
7967
+ isSetCursor: true,
7968
+ isSubmitHistory: false,
7969
+ isCompute: false
7970
+ });
7950
7971
  evt.preventDefault();
7951
7972
  return;
7952
7973
  }
@@ -8516,9 +8537,11 @@ function input(data2, host) {
8516
8537
  }
8517
8538
  if (~curIndex) {
8518
8539
  rangeManager.setRange(curIndex, curIndex);
8540
+ const isWordBoundary = !isComposing && /[\s\p{P}]/u.test(data2);
8519
8541
  draw.render({
8520
8542
  curIndex,
8521
- isSubmitHistory: !isComposing
8543
+ isSubmitHistory: !isComposing,
8544
+ isInputHistory: !isComposing && !isWordBoundary
8522
8545
  });
8523
8546
  }
8524
8547
  if (isComposing && ~curIndex) {
@@ -9189,10 +9212,12 @@ var GlobalEvent = class {
9189
9212
  };
9190
9213
 
9191
9214
  // src/core/history/HistoryManager.ts
9215
+ var INPUT_GROUP_INTERVAL = 1e3;
9192
9216
  var HistoryManager = class {
9193
9217
  constructor(draw) {
9194
9218
  this.undoStack = [];
9195
9219
  this.redoStack = [];
9220
+ this.lastInputTime = 0;
9196
9221
  this.maxRecordCount = draw.getOptions().historyMaxRecordCount + 1;
9197
9222
  }
9198
9223
  undo() {
@@ -9220,6 +9245,25 @@ var HistoryManager = class {
9220
9245
  this.undoStack.shift();
9221
9246
  }
9222
9247
  }
9248
+ replaceLatest(fn) {
9249
+ if (this.undoStack.length > 0) {
9250
+ this.undoStack[this.undoStack.length - 1] = fn;
9251
+ } else {
9252
+ this.execute(fn);
9253
+ }
9254
+ if (this.redoStack.length) {
9255
+ this.redoStack = [];
9256
+ }
9257
+ }
9258
+ isInputGroupable() {
9259
+ return Date.now() - this.lastInputTime < INPUT_GROUP_INTERVAL;
9260
+ }
9261
+ recordInputTime() {
9262
+ this.lastInputTime = Date.now();
9263
+ }
9264
+ resetInputTime() {
9265
+ this.lastInputTime = 0;
9266
+ }
9223
9267
  isCanUndo() {
9224
9268
  return this.undoStack.length > 1;
9225
9269
  }
@@ -9470,7 +9514,10 @@ var Position = class {
9470
9514
  startRowIndex += rowList.length;
9471
9515
  }
9472
9516
  } else {
9473
- const { column: { gap }, scale } = this.options;
9517
+ const {
9518
+ column: { gap },
9519
+ scale
9520
+ } = this.options;
9474
9521
  for (let i = 0; i < pageRowList.length; i++) {
9475
9522
  const rowList = pageRowList[i];
9476
9523
  if (!rowList?.length) continue;
@@ -10541,7 +10588,13 @@ var Background = class {
10541
10588
  const repeatYCount = background.repeat === "repeat" /* REPEAT */ || background.repeat === "repeat-y" /* REPEAT_Y */ ? Math.ceil(height * scale / imageHeight) : 1;
10542
10589
  for (let x = 0; x < repeatXCount; x++) {
10543
10590
  for (let y = 0; y < repeatYCount; y++) {
10544
- ctx.drawImage(imageElement, startX, startY, imageWidth, imageHeight);
10591
+ ctx.drawImage(
10592
+ imageElement,
10593
+ startX,
10594
+ startY,
10595
+ imageWidth,
10596
+ imageHeight
10597
+ );
10545
10598
  startY += imageHeight;
10546
10599
  }
10547
10600
  startY = 0;
@@ -11402,7 +11455,10 @@ var ScrollObserver = class {
11402
11455
  let bottomBound;
11403
11456
  if (this.scrollContainer === document) {
11404
11457
  topBound = 0;
11405
- bottomBound = Math.max(document.documentElement.clientHeight, window.innerHeight);
11458
+ bottomBound = Math.max(
11459
+ document.documentElement.clientHeight,
11460
+ window.innerHeight
11461
+ );
11406
11462
  } else {
11407
11463
  const containerRect = this.scrollContainer.getBoundingClientRect();
11408
11464
  topBound = containerRect.top;
@@ -12795,7 +12851,17 @@ var Watermark = class {
12795
12851
  }
12796
12852
  renderText(ctx, pageNo) {
12797
12853
  const {
12798
- watermark: { data: data2, opacity, font, size, color, repeat, gap, numberType, rotation },
12854
+ watermark: {
12855
+ data: data2,
12856
+ opacity,
12857
+ font,
12858
+ size,
12859
+ color,
12860
+ repeat,
12861
+ gap,
12862
+ numberType,
12863
+ rotation
12864
+ },
12799
12865
  scale
12800
12866
  } = this.options;
12801
12867
  const width = this.draw.getWidth();
@@ -13209,7 +13275,11 @@ var SelectControl = class {
13209
13275
  const { startIndex, endIndex } = range;
13210
13276
  const draw = this.control.getDraw();
13211
13277
  if (startIndex !== endIndex) {
13212
- draw.spliceElementList(elementList, startIndex + 1, endIndex - startIndex);
13278
+ draw.spliceElementList(
13279
+ elementList,
13280
+ startIndex + 1,
13281
+ endIndex - startIndex
13282
+ );
13213
13283
  } else {
13214
13284
  this.control.removePlaceholder(startIndex, context);
13215
13285
  }
@@ -14228,7 +14298,11 @@ var DateControl = class {
14228
14298
  const { startIndex, endIndex } = range;
14229
14299
  const draw = this.control.getDraw();
14230
14300
  if (startIndex !== endIndex) {
14231
- draw.spliceElementList(elementList, startIndex + 1, endIndex - startIndex);
14301
+ draw.spliceElementList(
14302
+ elementList,
14303
+ startIndex + 1,
14304
+ endIndex - startIndex
14305
+ );
14232
14306
  } else {
14233
14307
  this.control.removePlaceholder(startIndex, context);
14234
14308
  }
@@ -16326,7 +16400,11 @@ function computeCatalog(elementList, positionList) {
16326
16400
  return { position, titleElement };
16327
16401
  };
16328
16402
  if (element.titleId) {
16329
- const { position, titleElement } = getElementInfo(element, elementList, t);
16403
+ const { position, titleElement } = getElementInfo(
16404
+ element,
16405
+ elementList,
16406
+ t
16407
+ );
16330
16408
  t = position;
16331
16409
  titleElementList.push(titleElement);
16332
16410
  }
@@ -17327,100 +17405,6 @@ var BlockParticle = class {
17327
17405
  }
17328
17406
  };
17329
17407
 
17330
- // src/core/i18n/lang/zh-CN.json
17331
- var zh_CN_default = {
17332
- contextmenu: {
17333
- global: {
17334
- cut: "Cut",
17335
- copy: "Copy",
17336
- paste: "Paste",
17337
- selectAll: "Select All",
17338
- print: "Print"
17339
- },
17340
- control: {
17341
- delete: "Delete Control"
17342
- },
17343
- hyperlink: {
17344
- delete: "Delete Hyperlink",
17345
- cancel: "Cancel Hyperlink",
17346
- edit: "Edit Hyperlink"
17347
- },
17348
- image: {
17349
- change: "Change Image",
17350
- saveAs: "Save As Image",
17351
- textWrap: "Text Wrapping",
17352
- textWrapType: {
17353
- embed: "Inline",
17354
- upDown: "Top and Bottom",
17355
- surround: "Square",
17356
- floatTop: "Float Over Text",
17357
- floatBottom: "Float Below Text"
17358
- }
17359
- },
17360
- table: {
17361
- insertRowCol: "Insert Row/Column",
17362
- insertTopRow: "Insert Row Above",
17363
- insertBottomRow: "Insert Row Below",
17364
- insertLeftCol: "Insert Column Left",
17365
- insertRightCol: "Insert Column Right",
17366
- deleteRowCol: "Delete Row/Column",
17367
- deleteRow: "Delete Row",
17368
- deleteCol: "Delete Column",
17369
- deleteTable: "Delete Table",
17370
- mergeCell: "Merge Cells",
17371
- mergeCancelCell: "Cancel Merge",
17372
- verticalAlign: "Vertical Alignment",
17373
- verticalAlignTop: "Align Top",
17374
- verticalAlignMiddle: "Align Middle",
17375
- verticalAlignBottom: "Align Bottom",
17376
- border: "Table Border",
17377
- borderAll: "All Borders",
17378
- borderEmpty: "No Border",
17379
- borderDash: "Dashed Border",
17380
- borderExternal: "Outer Border",
17381
- borderInternal: "Inner Border",
17382
- borderTd: "Cell Border",
17383
- borderTdTop: "Top Border",
17384
- borderTdRight: "Right Border",
17385
- borderTdBottom: "Bottom Border",
17386
- borderTdLeft: "Left Border",
17387
- borderTdForward: "Forward Slash",
17388
- borderTdBack: "Back Slash"
17389
- }
17390
- },
17391
- datePicker: {
17392
- now: "Now",
17393
- confirm: "Confirm",
17394
- return: "Return Date",
17395
- timeSelect: "Time Select",
17396
- weeks: {
17397
- sun: "Sun",
17398
- mon: "Mon",
17399
- tue: "Tue",
17400
- wed: "Wed",
17401
- thu: "Thu",
17402
- fri: "Fri",
17403
- sat: "Sat"
17404
- },
17405
- year: "Year",
17406
- month: "Month",
17407
- hour: "Hour",
17408
- minute: "Minute",
17409
- second: "Second"
17410
- },
17411
- frame: {
17412
- header: "Header",
17413
- footer: "Footer"
17414
- },
17415
- pageBreak: {
17416
- displayName: "Page Break"
17417
- },
17418
- zone: {
17419
- headerTip: "Double-click to edit header",
17420
- footerTip: "Double-click to edit footer"
17421
- }
17422
- };
17423
-
17424
17408
  // src/core/i18n/lang/en.json
17425
17409
  var en_default = {
17426
17410
  contextmenu: {
@@ -17515,18 +17499,115 @@ var en_default = {
17515
17499
  }
17516
17500
  };
17517
17501
 
17502
+ // src/core/i18n/lang/id.json
17503
+ var id_default = {
17504
+ contextmenu: {
17505
+ global: {
17506
+ cut: "Potong",
17507
+ copy: "Salin",
17508
+ paste: "Tempel",
17509
+ selectAll: "Pilih semua",
17510
+ print: "Cetak"
17511
+ },
17512
+ control: {
17513
+ delete: "Hapus kontrol"
17514
+ },
17515
+ hyperlink: {
17516
+ delete: "Hapus tautan",
17517
+ cancel: "Batal tautan",
17518
+ edit: "Edit tautan"
17519
+ },
17520
+ image: {
17521
+ change: "Ubah gambar",
17522
+ saveAs: "Simpan sebagai gambar",
17523
+ textWrap: "Pembungkus teks",
17524
+ textWrapType: {
17525
+ embed: "Sematkan",
17526
+ upDown: "Atas bawah",
17527
+ surround: "Mengelilingi",
17528
+ floatTop: "Mengapung di atas teks",
17529
+ floatBottom: "Mengapung di bawah teks"
17530
+ }
17531
+ },
17532
+ table: {
17533
+ insertRowCol: "Sisipkan baris/kolom",
17534
+ insertTopRow: "Sisipkan 1 baris atas",
17535
+ insertBottomRow: "Sisipkan 1 baris bawah",
17536
+ insertLeftCol: "Sisipkan 1 kolom kiri",
17537
+ insertRightCol: "Sisipkan 1 kolom kanan",
17538
+ deleteRowCol: "Hapus baris/kolom",
17539
+ deleteRow: "Hapus 1 baris",
17540
+ deleteCol: "Hapus 1 kolom",
17541
+ deleteTable: "Hapus tabel",
17542
+ mergeCell: "Gabung sel",
17543
+ mergeCancelCell: "Batal gabung sel",
17544
+ verticalAlign: "Perataan vertikal",
17545
+ verticalAlignTop: "Atas",
17546
+ verticalAlignMiddle: "Tengah",
17547
+ verticalAlignBottom: "Bawah",
17548
+ border: "Batas tabel",
17549
+ borderAll: "Semua",
17550
+ borderEmpty: "Kosong",
17551
+ borderDash: "Putus-putus",
17552
+ borderExternal: "Eksternal",
17553
+ borderInternal: "Internal",
17554
+ borderTd: "Batas sel tabel",
17555
+ borderTdTop: "Atas",
17556
+ borderTdRight: "Kanan",
17557
+ borderTdBottom: "Bawah",
17558
+ borderTdLeft: "Kiri",
17559
+ borderTdForward: "Maju",
17560
+ borderTdBack: "Mundur"
17561
+ }
17562
+ },
17563
+ datePicker: {
17564
+ now: "Sekarang",
17565
+ confirm: "Konfirmasi",
17566
+ return: "Kembali",
17567
+ timeSelect: "Pilih waktu",
17568
+ weeks: {
17569
+ sun: "Min",
17570
+ mon: "Sen",
17571
+ tue: "Sel",
17572
+ wed: "Rab",
17573
+ thu: "Kam",
17574
+ fri: "Jum",
17575
+ sat: "Sab"
17576
+ },
17577
+ year: " ",
17578
+ month: " ",
17579
+ hour: "Jam",
17580
+ minute: "Menit",
17581
+ second: "Detik"
17582
+ },
17583
+ frame: {
17584
+ header: "Header",
17585
+ footer: "Footer"
17586
+ },
17587
+ pageBreak: {
17588
+ displayName: "Henti Halaman"
17589
+ },
17590
+ zone: {
17591
+ headerTip: "Klik dua kali untuk edit header",
17592
+ footerTip: "Klik dua kali untuk edit footer"
17593
+ }
17594
+ };
17595
+
17518
17596
  // src/core/i18n/I18n.ts
17519
17597
  var I18n = class {
17520
17598
  constructor(locale) {
17521
17599
  this.langMap = /* @__PURE__ */ new Map([
17522
- ["zhCN", zh_CN_default],
17523
- ["en", en_default]
17600
+ ["en", en_default],
17601
+ ["id", id_default]
17524
17602
  ]);
17525
17603
  this.currentLocale = locale;
17526
17604
  }
17527
17605
  registerLangMap(locale, lang) {
17528
17606
  const sourceLang = this.langMap.get(locale);
17529
- this.langMap.set(locale, mergeObject(sourceLang || zh_CN_default, lang));
17607
+ this.langMap.set(
17608
+ locale,
17609
+ mergeObject(sourceLang || this.langMap.get("en"), lang)
17610
+ );
17530
17611
  }
17531
17612
  getLocale() {
17532
17613
  return this.currentLocale;
@@ -17535,7 +17616,7 @@ var I18n = class {
17535
17616
  this.currentLocale = locale;
17536
17617
  }
17537
17618
  getLang() {
17538
- return this.langMap.get(this.currentLocale) || zh_CN_default;
17619
+ return this.langMap.get(this.currentLocale) || this.langMap.get("en");
17539
17620
  }
17540
17621
  t(path) {
17541
17622
  const keyList = path.split(".");
@@ -17973,7 +18054,9 @@ var Zone = class {
17973
18054
  dropdown.append(addItem);
17974
18055
  } else {
17975
18056
  const formatItem = document.createElement("div");
17976
- formatItem.classList.add(`${EDITOR_PREFIX}-zone-indicator-dropdown__item`);
18057
+ formatItem.classList.add(
18058
+ `${EDITOR_PREFIX}-zone-indicator-dropdown__item`
18059
+ );
17977
18060
  formatItem.textContent = isHeaderActive ? "Header Format" : "Footer Format";
17978
18061
  formatItem.onclick = (e) => {
17979
18062
  e.stopPropagation();
@@ -17987,7 +18070,9 @@ var Zone = class {
17987
18070
  );
17988
18071
  dropdown.append(separator);
17989
18072
  const removeItem = document.createElement("div");
17990
- removeItem.classList.add(`${EDITOR_PREFIX}-zone-indicator-dropdown__item`);
18073
+ removeItem.classList.add(
18074
+ `${EDITOR_PREFIX}-zone-indicator-dropdown__item`
18075
+ );
17991
18076
  removeItem.textContent = isHeaderActive ? "Remove Header" : "Remove Footer";
17992
18077
  removeItem.onclick = (e) => {
17993
18078
  e.stopPropagation();
@@ -18875,7 +18960,10 @@ var MouseObserver = class {
18875
18960
  this.draw = draw;
18876
18961
  this.eventBus = this.draw.getEventBus();
18877
18962
  this.pageContainer = this.draw.getPageContainer();
18878
- this.pageContainer.addEventListener("mousemove", this._mousemove.bind(this));
18963
+ this.pageContainer.addEventListener(
18964
+ "mousemove",
18965
+ this._mousemove.bind(this)
18966
+ );
18879
18967
  this.pageContainer.addEventListener(
18880
18968
  "mouseenter",
18881
18969
  this._mouseenter.bind(this)
@@ -18884,7 +18972,10 @@ var MouseObserver = class {
18884
18972
  "mouseleave",
18885
18973
  this._mouseleave.bind(this)
18886
18974
  );
18887
- this.pageContainer.addEventListener("mousedown", this._mousedown.bind(this));
18975
+ this.pageContainer.addEventListener(
18976
+ "mousedown",
18977
+ this._mousedown.bind(this)
18978
+ );
18888
18979
  this.pageContainer.addEventListener("mouseup", this._mouseup.bind(this));
18889
18980
  this.pageContainer.addEventListener("click", this._click.bind(this));
18890
18981
  }
@@ -19749,7 +19840,9 @@ var TableOperate = class {
19749
19840
  if (!td.borderTypes) {
19750
19841
  td.borderTypes = [];
19751
19842
  }
19752
- const borderTypeIndex = td.borderTypes.findIndex((type) => type === payload);
19843
+ const borderTypeIndex = td.borderTypes.findIndex(
19844
+ (type) => type === payload
19845
+ );
19753
19846
  if (isSetBorderType) {
19754
19847
  if (!~borderTypeIndex) {
19755
19848
  td.borderTypes.push(payload);
@@ -20416,7 +20509,10 @@ var Draw = class {
20416
20509
  const nextElement = elementList[startIndex + 1];
20417
20510
  return !!(startElement?.title?.disabled && nextElement?.title?.disabled && startElement.titleId === nextElement.titleId || startElement?.control?.disabled && nextElement?.control?.disabled && startElement.controlId === nextElement.controlId);
20418
20511
  }
20419
- const selectionElementList = elementList.slice(startIndex + 1, endIndex + 1);
20512
+ const selectionElementList = elementList.slice(
20513
+ startIndex + 1,
20514
+ endIndex + 1
20515
+ );
20420
20516
  return selectionElementList.some(
20421
20517
  (element) => element.title?.disabled || element.control?.disabled
20422
20518
  );
@@ -21413,7 +21509,10 @@ var Draw = class {
21413
21509
  isFromTable: true,
21414
21510
  isPagingMode
21415
21511
  });
21416
- const rowHeight = tdRowList.reduce((pre, cur) => pre + cur.height, 0);
21512
+ const rowHeight = tdRowList.reduce(
21513
+ (pre, cur) => pre + cur.height,
21514
+ 0
21515
+ );
21417
21516
  td.rowList = tdRowList;
21418
21517
  const curTdHeight = rowHeight / scale + tdPaddingHeight;
21419
21518
  if (td.height < curTdHeight) {
@@ -21698,10 +21797,16 @@ var Draw = class {
21698
21797
  listLevelIndex.delete(lvl);
21699
21798
  }
21700
21799
  }
21701
- listLevelIndex.set(curLevel, (listLevelIndex.get(curLevel) ?? -1) + 1);
21800
+ listLevelIndex.set(
21801
+ curLevel,
21802
+ (listLevelIndex.get(curLevel) ?? -1) + 1
21803
+ );
21702
21804
  }
21703
21805
  } else {
21704
- listLevelIndex.set(curLevel, (listLevelIndex.get(curLevel) ?? -1) + 1);
21806
+ listLevelIndex.set(
21807
+ curLevel,
21808
+ (listLevelIndex.get(curLevel) ?? -1) + 1
21809
+ );
21705
21810
  }
21706
21811
  listIndex = listLevelIndex.get(curLevel) ?? 0;
21707
21812
  prevListLevel = curLevel;
@@ -22082,7 +22187,12 @@ var Draw = class {
22082
22187
  this.lineBreakParticle.render(ctx, element, x, y + curRow.height / 2);
22083
22188
  }
22084
22189
  if (isDrawWhiteSpace && WHITE_SPACE_REG.test(element.value)) {
22085
- this.whiteSpaceParticle.render(ctx, element, x, y + curRow.height / 2);
22190
+ this.whiteSpaceParticle.render(
22191
+ ctx,
22192
+ element,
22193
+ x,
22194
+ y + curRow.height / 2
22195
+ );
22086
22196
  }
22087
22197
  if (element.control?.border) {
22088
22198
  if (preElement?.control?.border && preElement.controlId !== element.controlId) {
@@ -22136,7 +22246,14 @@ var Draw = class {
22136
22246
  } else if (element.type === "superscript" /* SUPERSCRIPT */) {
22137
22247
  adjustY += this.superscriptParticle.getOffsetY(element);
22138
22248
  }
22139
- this.strikeout.recordFillInfo(ctx, x, adjustY, metrics.width, 0, element.color);
22249
+ this.strikeout.recordFillInfo(
22250
+ ctx,
22251
+ x,
22252
+ adjustY,
22253
+ metrics.width,
22254
+ 0,
22255
+ element.color
22256
+ );
22140
22257
  }
22141
22258
  } else if (preElement?.strikeout) {
22142
22259
  this.strikeout.render(ctx);
@@ -22172,7 +22289,13 @@ var Draw = class {
22172
22289
  }
22173
22290
  }
22174
22291
  if (!group2.disabled && element.groupIds) {
22175
- this.group.recordFillInfo(element, x, y, metrics.width, curRow.height);
22292
+ this.group.recordFillInfo(
22293
+ element,
22294
+ x,
22295
+ y,
22296
+ metrics.width,
22297
+ curRow.height
22298
+ );
22176
22299
  }
22177
22300
  index++;
22178
22301
  if (element.type === "table" /* TABLE */ && !element.hide) {
@@ -22400,6 +22523,7 @@ var Draw = class {
22400
22523
  const { header, footer } = this.options;
22401
22524
  const {
22402
22525
  isSubmitHistory = true,
22526
+ isInputHistory = false,
22403
22527
  isSetCursor = true,
22404
22528
  isCompute = true,
22405
22529
  isLazy = true,
@@ -22479,7 +22603,7 @@ var Draw = class {
22479
22603
  this.cursor.focus();
22480
22604
  }
22481
22605
  if (isSubmitHistory && !isFirstRender || curIndex !== void 0 && this.historyManager.isStackEmpty()) {
22482
- this.submitHistory(curIndex);
22606
+ this.submitHistory(curIndex, isInputHistory);
22483
22607
  }
22484
22608
  nextTick(() => {
22485
22609
  this.range.setRangeStyle();
@@ -22542,7 +22666,7 @@ var Draw = class {
22542
22666
  });
22543
22667
  return curIndex;
22544
22668
  }
22545
- submitHistory(curIndex) {
22669
+ submitHistory(curIndex, isInput = false) {
22546
22670
  const positionContext = this.position.getPositionContext();
22547
22671
  const oldElementList = getSlimCloneElementList(this.elementList);
22548
22672
  const oldHeaderElementList = getSlimCloneElementList(
@@ -22555,7 +22679,7 @@ var Draw = class {
22555
22679
  const pageNo = this.pageNo;
22556
22680
  const oldPositionContext = deepClone(positionContext);
22557
22681
  const zone = this.zone.getZone();
22558
- this.historyManager.execute(() => {
22682
+ const fn = () => {
22559
22683
  this.zone.setZone(zone);
22560
22684
  this.setPageNo(pageNo);
22561
22685
  this.position.setPositionContext(deepClone(oldPositionContext));
@@ -22568,7 +22692,17 @@ var Draw = class {
22568
22692
  isSubmitHistory: false,
22569
22693
  isSourceHistory: true
22570
22694
  });
22571
- });
22695
+ };
22696
+ if (isInput && this.historyManager.isInputGroupable()) {
22697
+ this.historyManager.replaceLatest(fn);
22698
+ } else {
22699
+ this.historyManager.execute(fn);
22700
+ }
22701
+ if (isInput) {
22702
+ this.historyManager.recordInputTime();
22703
+ } else {
22704
+ this.historyManager.resetInputTime();
22705
+ }
22572
22706
  }
22573
22707
  destroy() {
22574
22708
  this.container.remove();
@@ -25751,7 +25885,9 @@ var ContextMenu = class {
25751
25885
  }
25752
25886
  _createContextMenuContainer() {
25753
25887
  const contextMenuContainer = document.createElement("div");
25754
- contextMenuContainer.classList.add(`${EDITOR_PREFIX}-contextmenu-container`);
25888
+ contextMenuContainer.classList.add(
25889
+ `${EDITOR_PREFIX}-contextmenu-container`
25890
+ );
25755
25891
  contextMenuContainer.setAttribute(
25756
25892
  EDITOR_COMPONENT,
25757
25893
  "contextmenu" /* CONTEXTMENU */
@@ -25784,7 +25920,9 @@ var ContextMenu = class {
25784
25920
  menuItem.classList.add(`${EDITOR_PREFIX}-contextmenu-item`);
25785
25921
  if (menu.childMenus) {
25786
25922
  const childMenus = this._filterMenuList(menu.childMenus);
25787
- const isRegisterContextMenu = childMenus.some((menu2) => !menu2.isDivider);
25923
+ const isRegisterContextMenu = childMenus.some(
25924
+ (menu2) => !menu2.isDivider
25925
+ );
25788
25926
  if (isRegisterContextMenu) {
25789
25927
  menuItem.classList.add(`${EDITOR_PREFIX}-contextmenu-sub-item`);
25790
25928
  menuItem.onmouseenter = () => {