@windoc/core 0.3.3 → 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.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +239 -135
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +239 -135
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1084,7 +1084,12 @@ interface ILineBreakOption {
|
|
|
1084
1084
|
lineWidth?: number;
|
|
1085
1085
|
}
|
|
1086
1086
|
|
|
1087
|
-
type IMargin = [
|
|
1087
|
+
type IMargin = [
|
|
1088
|
+
top: number,
|
|
1089
|
+
right: number,
|
|
1090
|
+
bottom: number,
|
|
1091
|
+
left: number
|
|
1092
|
+
];
|
|
1088
1093
|
|
|
1089
1094
|
interface IPageBreak {
|
|
1090
1095
|
font?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1084,7 +1084,12 @@ interface ILineBreakOption {
|
|
|
1084
1084
|
lineWidth?: number;
|
|
1085
1085
|
}
|
|
1086
1086
|
|
|
1087
|
-
type IMargin = [
|
|
1087
|
+
type IMargin = [
|
|
1088
|
+
top: number,
|
|
1089
|
+
right: number,
|
|
1090
|
+
bottom: number,
|
|
1091
|
+
left: number
|
|
1092
|
+
];
|
|
1088
1093
|
|
|
1089
1094
|
interface IPageBreak {
|
|
1090
1095
|
font?: string;
|
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.
|
|
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 */]: [
|
|
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: "
|
|
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(
|
|
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(
|
|
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(
|
|
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({
|
|
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({
|
|
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
|
}
|
|
@@ -9493,7 +9514,10 @@ var Position = class {
|
|
|
9493
9514
|
startRowIndex += rowList.length;
|
|
9494
9515
|
}
|
|
9495
9516
|
} else {
|
|
9496
|
-
const {
|
|
9517
|
+
const {
|
|
9518
|
+
column: { gap },
|
|
9519
|
+
scale
|
|
9520
|
+
} = this.options;
|
|
9497
9521
|
for (let i = 0; i < pageRowList.length; i++) {
|
|
9498
9522
|
const rowList = pageRowList[i];
|
|
9499
9523
|
if (!rowList?.length) continue;
|
|
@@ -10564,7 +10588,13 @@ var Background = class {
|
|
|
10564
10588
|
const repeatYCount = background.repeat === "repeat" /* REPEAT */ || background.repeat === "repeat-y" /* REPEAT_Y */ ? Math.ceil(height * scale / imageHeight) : 1;
|
|
10565
10589
|
for (let x = 0; x < repeatXCount; x++) {
|
|
10566
10590
|
for (let y = 0; y < repeatYCount; y++) {
|
|
10567
|
-
ctx.drawImage(
|
|
10591
|
+
ctx.drawImage(
|
|
10592
|
+
imageElement,
|
|
10593
|
+
startX,
|
|
10594
|
+
startY,
|
|
10595
|
+
imageWidth,
|
|
10596
|
+
imageHeight
|
|
10597
|
+
);
|
|
10568
10598
|
startY += imageHeight;
|
|
10569
10599
|
}
|
|
10570
10600
|
startY = 0;
|
|
@@ -11425,7 +11455,10 @@ var ScrollObserver = class {
|
|
|
11425
11455
|
let bottomBound;
|
|
11426
11456
|
if (this.scrollContainer === document) {
|
|
11427
11457
|
topBound = 0;
|
|
11428
|
-
bottomBound = Math.max(
|
|
11458
|
+
bottomBound = Math.max(
|
|
11459
|
+
document.documentElement.clientHeight,
|
|
11460
|
+
window.innerHeight
|
|
11461
|
+
);
|
|
11429
11462
|
} else {
|
|
11430
11463
|
const containerRect = this.scrollContainer.getBoundingClientRect();
|
|
11431
11464
|
topBound = containerRect.top;
|
|
@@ -12818,7 +12851,17 @@ var Watermark = class {
|
|
|
12818
12851
|
}
|
|
12819
12852
|
renderText(ctx, pageNo) {
|
|
12820
12853
|
const {
|
|
12821
|
-
watermark: {
|
|
12854
|
+
watermark: {
|
|
12855
|
+
data: data2,
|
|
12856
|
+
opacity,
|
|
12857
|
+
font,
|
|
12858
|
+
size,
|
|
12859
|
+
color,
|
|
12860
|
+
repeat,
|
|
12861
|
+
gap,
|
|
12862
|
+
numberType,
|
|
12863
|
+
rotation
|
|
12864
|
+
},
|
|
12822
12865
|
scale
|
|
12823
12866
|
} = this.options;
|
|
12824
12867
|
const width = this.draw.getWidth();
|
|
@@ -13232,7 +13275,11 @@ var SelectControl = class {
|
|
|
13232
13275
|
const { startIndex, endIndex } = range;
|
|
13233
13276
|
const draw = this.control.getDraw();
|
|
13234
13277
|
if (startIndex !== endIndex) {
|
|
13235
|
-
draw.spliceElementList(
|
|
13278
|
+
draw.spliceElementList(
|
|
13279
|
+
elementList,
|
|
13280
|
+
startIndex + 1,
|
|
13281
|
+
endIndex - startIndex
|
|
13282
|
+
);
|
|
13236
13283
|
} else {
|
|
13237
13284
|
this.control.removePlaceholder(startIndex, context);
|
|
13238
13285
|
}
|
|
@@ -14251,7 +14298,11 @@ var DateControl = class {
|
|
|
14251
14298
|
const { startIndex, endIndex } = range;
|
|
14252
14299
|
const draw = this.control.getDraw();
|
|
14253
14300
|
if (startIndex !== endIndex) {
|
|
14254
|
-
draw.spliceElementList(
|
|
14301
|
+
draw.spliceElementList(
|
|
14302
|
+
elementList,
|
|
14303
|
+
startIndex + 1,
|
|
14304
|
+
endIndex - startIndex
|
|
14305
|
+
);
|
|
14255
14306
|
} else {
|
|
14256
14307
|
this.control.removePlaceholder(startIndex, context);
|
|
14257
14308
|
}
|
|
@@ -16349,7 +16400,11 @@ function computeCatalog(elementList, positionList) {
|
|
|
16349
16400
|
return { position, titleElement };
|
|
16350
16401
|
};
|
|
16351
16402
|
if (element.titleId) {
|
|
16352
|
-
const { position, titleElement } = getElementInfo(
|
|
16403
|
+
const { position, titleElement } = getElementInfo(
|
|
16404
|
+
element,
|
|
16405
|
+
elementList,
|
|
16406
|
+
t
|
|
16407
|
+
);
|
|
16353
16408
|
t = position;
|
|
16354
16409
|
titleElementList.push(titleElement);
|
|
16355
16410
|
}
|
|
@@ -17350,100 +17405,6 @@ var BlockParticle = class {
|
|
|
17350
17405
|
}
|
|
17351
17406
|
};
|
|
17352
17407
|
|
|
17353
|
-
// src/core/i18n/lang/zh-CN.json
|
|
17354
|
-
var zh_CN_default = {
|
|
17355
|
-
contextmenu: {
|
|
17356
|
-
global: {
|
|
17357
|
-
cut: "Cut",
|
|
17358
|
-
copy: "Copy",
|
|
17359
|
-
paste: "Paste",
|
|
17360
|
-
selectAll: "Select All",
|
|
17361
|
-
print: "Print"
|
|
17362
|
-
},
|
|
17363
|
-
control: {
|
|
17364
|
-
delete: "Delete Control"
|
|
17365
|
-
},
|
|
17366
|
-
hyperlink: {
|
|
17367
|
-
delete: "Delete Hyperlink",
|
|
17368
|
-
cancel: "Cancel Hyperlink",
|
|
17369
|
-
edit: "Edit Hyperlink"
|
|
17370
|
-
},
|
|
17371
|
-
image: {
|
|
17372
|
-
change: "Change Image",
|
|
17373
|
-
saveAs: "Save As Image",
|
|
17374
|
-
textWrap: "Text Wrapping",
|
|
17375
|
-
textWrapType: {
|
|
17376
|
-
embed: "Inline",
|
|
17377
|
-
upDown: "Top and Bottom",
|
|
17378
|
-
surround: "Square",
|
|
17379
|
-
floatTop: "Float Over Text",
|
|
17380
|
-
floatBottom: "Float Below Text"
|
|
17381
|
-
}
|
|
17382
|
-
},
|
|
17383
|
-
table: {
|
|
17384
|
-
insertRowCol: "Insert Row/Column",
|
|
17385
|
-
insertTopRow: "Insert Row Above",
|
|
17386
|
-
insertBottomRow: "Insert Row Below",
|
|
17387
|
-
insertLeftCol: "Insert Column Left",
|
|
17388
|
-
insertRightCol: "Insert Column Right",
|
|
17389
|
-
deleteRowCol: "Delete Row/Column",
|
|
17390
|
-
deleteRow: "Delete Row",
|
|
17391
|
-
deleteCol: "Delete Column",
|
|
17392
|
-
deleteTable: "Delete Table",
|
|
17393
|
-
mergeCell: "Merge Cells",
|
|
17394
|
-
mergeCancelCell: "Cancel Merge",
|
|
17395
|
-
verticalAlign: "Vertical Alignment",
|
|
17396
|
-
verticalAlignTop: "Align Top",
|
|
17397
|
-
verticalAlignMiddle: "Align Middle",
|
|
17398
|
-
verticalAlignBottom: "Align Bottom",
|
|
17399
|
-
border: "Table Border",
|
|
17400
|
-
borderAll: "All Borders",
|
|
17401
|
-
borderEmpty: "No Border",
|
|
17402
|
-
borderDash: "Dashed Border",
|
|
17403
|
-
borderExternal: "Outer Border",
|
|
17404
|
-
borderInternal: "Inner Border",
|
|
17405
|
-
borderTd: "Cell Border",
|
|
17406
|
-
borderTdTop: "Top Border",
|
|
17407
|
-
borderTdRight: "Right Border",
|
|
17408
|
-
borderTdBottom: "Bottom Border",
|
|
17409
|
-
borderTdLeft: "Left Border",
|
|
17410
|
-
borderTdForward: "Forward Slash",
|
|
17411
|
-
borderTdBack: "Back Slash"
|
|
17412
|
-
}
|
|
17413
|
-
},
|
|
17414
|
-
datePicker: {
|
|
17415
|
-
now: "Now",
|
|
17416
|
-
confirm: "Confirm",
|
|
17417
|
-
return: "Return Date",
|
|
17418
|
-
timeSelect: "Time Select",
|
|
17419
|
-
weeks: {
|
|
17420
|
-
sun: "Sun",
|
|
17421
|
-
mon: "Mon",
|
|
17422
|
-
tue: "Tue",
|
|
17423
|
-
wed: "Wed",
|
|
17424
|
-
thu: "Thu",
|
|
17425
|
-
fri: "Fri",
|
|
17426
|
-
sat: "Sat"
|
|
17427
|
-
},
|
|
17428
|
-
year: "Year",
|
|
17429
|
-
month: "Month",
|
|
17430
|
-
hour: "Hour",
|
|
17431
|
-
minute: "Minute",
|
|
17432
|
-
second: "Second"
|
|
17433
|
-
},
|
|
17434
|
-
frame: {
|
|
17435
|
-
header: "Header",
|
|
17436
|
-
footer: "Footer"
|
|
17437
|
-
},
|
|
17438
|
-
pageBreak: {
|
|
17439
|
-
displayName: "Page Break"
|
|
17440
|
-
},
|
|
17441
|
-
zone: {
|
|
17442
|
-
headerTip: "Double-click to edit header",
|
|
17443
|
-
footerTip: "Double-click to edit footer"
|
|
17444
|
-
}
|
|
17445
|
-
};
|
|
17446
|
-
|
|
17447
17408
|
// src/core/i18n/lang/en.json
|
|
17448
17409
|
var en_default = {
|
|
17449
17410
|
contextmenu: {
|
|
@@ -17538,18 +17499,115 @@ var en_default = {
|
|
|
17538
17499
|
}
|
|
17539
17500
|
};
|
|
17540
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
|
+
|
|
17541
17596
|
// src/core/i18n/I18n.ts
|
|
17542
17597
|
var I18n = class {
|
|
17543
17598
|
constructor(locale) {
|
|
17544
17599
|
this.langMap = /* @__PURE__ */ new Map([
|
|
17545
|
-
["
|
|
17546
|
-
["
|
|
17600
|
+
["en", en_default],
|
|
17601
|
+
["id", id_default]
|
|
17547
17602
|
]);
|
|
17548
17603
|
this.currentLocale = locale;
|
|
17549
17604
|
}
|
|
17550
17605
|
registerLangMap(locale, lang) {
|
|
17551
17606
|
const sourceLang = this.langMap.get(locale);
|
|
17552
|
-
this.langMap.set(
|
|
17607
|
+
this.langMap.set(
|
|
17608
|
+
locale,
|
|
17609
|
+
mergeObject(sourceLang || this.langMap.get("en"), lang)
|
|
17610
|
+
);
|
|
17553
17611
|
}
|
|
17554
17612
|
getLocale() {
|
|
17555
17613
|
return this.currentLocale;
|
|
@@ -17558,7 +17616,7 @@ var I18n = class {
|
|
|
17558
17616
|
this.currentLocale = locale;
|
|
17559
17617
|
}
|
|
17560
17618
|
getLang() {
|
|
17561
|
-
return this.langMap.get(this.currentLocale) ||
|
|
17619
|
+
return this.langMap.get(this.currentLocale) || this.langMap.get("en");
|
|
17562
17620
|
}
|
|
17563
17621
|
t(path) {
|
|
17564
17622
|
const keyList = path.split(".");
|
|
@@ -17996,7 +18054,9 @@ var Zone = class {
|
|
|
17996
18054
|
dropdown.append(addItem);
|
|
17997
18055
|
} else {
|
|
17998
18056
|
const formatItem = document.createElement("div");
|
|
17999
|
-
formatItem.classList.add(
|
|
18057
|
+
formatItem.classList.add(
|
|
18058
|
+
`${EDITOR_PREFIX}-zone-indicator-dropdown__item`
|
|
18059
|
+
);
|
|
18000
18060
|
formatItem.textContent = isHeaderActive ? "Header Format" : "Footer Format";
|
|
18001
18061
|
formatItem.onclick = (e) => {
|
|
18002
18062
|
e.stopPropagation();
|
|
@@ -18010,7 +18070,9 @@ var Zone = class {
|
|
|
18010
18070
|
);
|
|
18011
18071
|
dropdown.append(separator);
|
|
18012
18072
|
const removeItem = document.createElement("div");
|
|
18013
|
-
removeItem.classList.add(
|
|
18073
|
+
removeItem.classList.add(
|
|
18074
|
+
`${EDITOR_PREFIX}-zone-indicator-dropdown__item`
|
|
18075
|
+
);
|
|
18014
18076
|
removeItem.textContent = isHeaderActive ? "Remove Header" : "Remove Footer";
|
|
18015
18077
|
removeItem.onclick = (e) => {
|
|
18016
18078
|
e.stopPropagation();
|
|
@@ -18898,7 +18960,10 @@ var MouseObserver = class {
|
|
|
18898
18960
|
this.draw = draw;
|
|
18899
18961
|
this.eventBus = this.draw.getEventBus();
|
|
18900
18962
|
this.pageContainer = this.draw.getPageContainer();
|
|
18901
|
-
this.pageContainer.addEventListener(
|
|
18963
|
+
this.pageContainer.addEventListener(
|
|
18964
|
+
"mousemove",
|
|
18965
|
+
this._mousemove.bind(this)
|
|
18966
|
+
);
|
|
18902
18967
|
this.pageContainer.addEventListener(
|
|
18903
18968
|
"mouseenter",
|
|
18904
18969
|
this._mouseenter.bind(this)
|
|
@@ -18907,7 +18972,10 @@ var MouseObserver = class {
|
|
|
18907
18972
|
"mouseleave",
|
|
18908
18973
|
this._mouseleave.bind(this)
|
|
18909
18974
|
);
|
|
18910
|
-
this.pageContainer.addEventListener(
|
|
18975
|
+
this.pageContainer.addEventListener(
|
|
18976
|
+
"mousedown",
|
|
18977
|
+
this._mousedown.bind(this)
|
|
18978
|
+
);
|
|
18911
18979
|
this.pageContainer.addEventListener("mouseup", this._mouseup.bind(this));
|
|
18912
18980
|
this.pageContainer.addEventListener("click", this._click.bind(this));
|
|
18913
18981
|
}
|
|
@@ -19772,7 +19840,9 @@ var TableOperate = class {
|
|
|
19772
19840
|
if (!td.borderTypes) {
|
|
19773
19841
|
td.borderTypes = [];
|
|
19774
19842
|
}
|
|
19775
|
-
const borderTypeIndex = td.borderTypes.findIndex(
|
|
19843
|
+
const borderTypeIndex = td.borderTypes.findIndex(
|
|
19844
|
+
(type) => type === payload
|
|
19845
|
+
);
|
|
19776
19846
|
if (isSetBorderType) {
|
|
19777
19847
|
if (!~borderTypeIndex) {
|
|
19778
19848
|
td.borderTypes.push(payload);
|
|
@@ -20439,7 +20509,10 @@ var Draw = class {
|
|
|
20439
20509
|
const nextElement = elementList[startIndex + 1];
|
|
20440
20510
|
return !!(startElement?.title?.disabled && nextElement?.title?.disabled && startElement.titleId === nextElement.titleId || startElement?.control?.disabled && nextElement?.control?.disabled && startElement.controlId === nextElement.controlId);
|
|
20441
20511
|
}
|
|
20442
|
-
const selectionElementList = elementList.slice(
|
|
20512
|
+
const selectionElementList = elementList.slice(
|
|
20513
|
+
startIndex + 1,
|
|
20514
|
+
endIndex + 1
|
|
20515
|
+
);
|
|
20443
20516
|
return selectionElementList.some(
|
|
20444
20517
|
(element) => element.title?.disabled || element.control?.disabled
|
|
20445
20518
|
);
|
|
@@ -21436,7 +21509,10 @@ var Draw = class {
|
|
|
21436
21509
|
isFromTable: true,
|
|
21437
21510
|
isPagingMode
|
|
21438
21511
|
});
|
|
21439
|
-
const rowHeight = tdRowList.reduce(
|
|
21512
|
+
const rowHeight = tdRowList.reduce(
|
|
21513
|
+
(pre, cur) => pre + cur.height,
|
|
21514
|
+
0
|
|
21515
|
+
);
|
|
21440
21516
|
td.rowList = tdRowList;
|
|
21441
21517
|
const curTdHeight = rowHeight / scale + tdPaddingHeight;
|
|
21442
21518
|
if (td.height < curTdHeight) {
|
|
@@ -21721,10 +21797,16 @@ var Draw = class {
|
|
|
21721
21797
|
listLevelIndex.delete(lvl);
|
|
21722
21798
|
}
|
|
21723
21799
|
}
|
|
21724
|
-
listLevelIndex.set(
|
|
21800
|
+
listLevelIndex.set(
|
|
21801
|
+
curLevel,
|
|
21802
|
+
(listLevelIndex.get(curLevel) ?? -1) + 1
|
|
21803
|
+
);
|
|
21725
21804
|
}
|
|
21726
21805
|
} else {
|
|
21727
|
-
listLevelIndex.set(
|
|
21806
|
+
listLevelIndex.set(
|
|
21807
|
+
curLevel,
|
|
21808
|
+
(listLevelIndex.get(curLevel) ?? -1) + 1
|
|
21809
|
+
);
|
|
21728
21810
|
}
|
|
21729
21811
|
listIndex = listLevelIndex.get(curLevel) ?? 0;
|
|
21730
21812
|
prevListLevel = curLevel;
|
|
@@ -22105,7 +22187,12 @@ var Draw = class {
|
|
|
22105
22187
|
this.lineBreakParticle.render(ctx, element, x, y + curRow.height / 2);
|
|
22106
22188
|
}
|
|
22107
22189
|
if (isDrawWhiteSpace && WHITE_SPACE_REG.test(element.value)) {
|
|
22108
|
-
this.whiteSpaceParticle.render(
|
|
22190
|
+
this.whiteSpaceParticle.render(
|
|
22191
|
+
ctx,
|
|
22192
|
+
element,
|
|
22193
|
+
x,
|
|
22194
|
+
y + curRow.height / 2
|
|
22195
|
+
);
|
|
22109
22196
|
}
|
|
22110
22197
|
if (element.control?.border) {
|
|
22111
22198
|
if (preElement?.control?.border && preElement.controlId !== element.controlId) {
|
|
@@ -22159,7 +22246,14 @@ var Draw = class {
|
|
|
22159
22246
|
} else if (element.type === "superscript" /* SUPERSCRIPT */) {
|
|
22160
22247
|
adjustY += this.superscriptParticle.getOffsetY(element);
|
|
22161
22248
|
}
|
|
22162
|
-
this.strikeout.recordFillInfo(
|
|
22249
|
+
this.strikeout.recordFillInfo(
|
|
22250
|
+
ctx,
|
|
22251
|
+
x,
|
|
22252
|
+
adjustY,
|
|
22253
|
+
metrics.width,
|
|
22254
|
+
0,
|
|
22255
|
+
element.color
|
|
22256
|
+
);
|
|
22163
22257
|
}
|
|
22164
22258
|
} else if (preElement?.strikeout) {
|
|
22165
22259
|
this.strikeout.render(ctx);
|
|
@@ -22195,7 +22289,13 @@ var Draw = class {
|
|
|
22195
22289
|
}
|
|
22196
22290
|
}
|
|
22197
22291
|
if (!group2.disabled && element.groupIds) {
|
|
22198
|
-
this.group.recordFillInfo(
|
|
22292
|
+
this.group.recordFillInfo(
|
|
22293
|
+
element,
|
|
22294
|
+
x,
|
|
22295
|
+
y,
|
|
22296
|
+
metrics.width,
|
|
22297
|
+
curRow.height
|
|
22298
|
+
);
|
|
22199
22299
|
}
|
|
22200
22300
|
index++;
|
|
22201
22301
|
if (element.type === "table" /* TABLE */ && !element.hide) {
|
|
@@ -25785,7 +25885,9 @@ var ContextMenu = class {
|
|
|
25785
25885
|
}
|
|
25786
25886
|
_createContextMenuContainer() {
|
|
25787
25887
|
const contextMenuContainer = document.createElement("div");
|
|
25788
|
-
contextMenuContainer.classList.add(
|
|
25888
|
+
contextMenuContainer.classList.add(
|
|
25889
|
+
`${EDITOR_PREFIX}-contextmenu-container`
|
|
25890
|
+
);
|
|
25789
25891
|
contextMenuContainer.setAttribute(
|
|
25790
25892
|
EDITOR_COMPONENT,
|
|
25791
25893
|
"contextmenu" /* CONTEXTMENU */
|
|
@@ -25818,7 +25920,9 @@ var ContextMenu = class {
|
|
|
25818
25920
|
menuItem.classList.add(`${EDITOR_PREFIX}-contextmenu-item`);
|
|
25819
25921
|
if (menu.childMenus) {
|
|
25820
25922
|
const childMenus = this._filterMenuList(menu.childMenus);
|
|
25821
|
-
const isRegisterContextMenu = childMenus.some(
|
|
25923
|
+
const isRegisterContextMenu = childMenus.some(
|
|
25924
|
+
(menu2) => !menu2.isDivider
|
|
25925
|
+
);
|
|
25822
25926
|
if (isRegisterContextMenu) {
|
|
25823
25927
|
menuItem.classList.add(`${EDITOR_PREFIX}-contextmenu-sub-item`);
|
|
25824
25928
|
menuItem.onmouseenter = () => {
|