@ones-editor/editor 2.8.13 → 2.8.14-beta.1
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/@ones-editor/table-block/src/commands/adjust-column-widths-evenly.d.ts +2 -0
- package/@ones-editor/table-block/src/commands/table-block-commands.d.ts +1 -1
- package/@ones-editor/table-block/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/table-block/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/table-block/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/toc/src/locale/en-us.d.ts +1 -0
- package/@ones-editor/toc/src/locale/ja-jp.d.ts +1 -0
- package/@ones-editor/toc/src/locale/zh-cn.d.ts +1 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui-base/src/icons/index.d.ts +2 -1
- package/dist/index.js +200 -144
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12978,7 +12978,7 @@ var __publicField = (obj, key, value) => {
|
|
|
12978
12978
|
}
|
|
12979
12979
|
return {};
|
|
12980
12980
|
}
|
|
12981
|
-
function getOptions$
|
|
12981
|
+
function getOptions$a(editor) {
|
|
12982
12982
|
const commandMap = /* @__PURE__ */ new Map();
|
|
12983
12983
|
const insertBlockCommandItems = [];
|
|
12984
12984
|
editor.editorEmbeds.forEach((embedClass) => {
|
|
@@ -13071,7 +13071,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13071
13071
|
convertFrom: convertFrom$9,
|
|
13072
13072
|
convertTo: convertTo$l,
|
|
13073
13073
|
getBlockProperties: getBlockProperties$c,
|
|
13074
|
-
getOptions: getOptions$
|
|
13074
|
+
getOptions: getOptions$a,
|
|
13075
13075
|
handleDeleteBlock: handleDeleteBlock$9,
|
|
13076
13076
|
handleUpdateBlock: handleUpdateBlock$6,
|
|
13077
13077
|
handleDropOver: handleDropOver$2,
|
|
@@ -40623,6 +40623,7 @@ ${codeText}
|
|
|
40623
40623
|
const TabIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14 2L2 2" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M14 6H7" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M2 10.5V5.5L5.5 8L2 10.5Z" fill="#2D2D2E"/>\n<path d="M14 10H7" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M14 14H2" stroke="#2D2D2E" stroke-linejoin="round"/>\n</svg>\n';
|
|
40624
40624
|
const ShiftTabIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M2 2H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M7 6H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M5.5 10.5V5.5L2 8L5.5 10.5Z" fill="#2D2D2E"/>\n<path d="M7 10H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n<path d="M2 14H14" stroke="#2D2D2E" stroke-linejoin="round"/>\n</svg>\n';
|
|
40625
40625
|
const TableEditIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8 14.5H2.5C1.94772 14.5 1.5 14.0523 1.5 13.5V2.5C1.5 1.94772 1.94772 1.5 2.5 1.5H13.5C14.0523 1.5 14.5 1.94772 14.5 2.5V8" stroke="#2D2D2E"/>\n<path d="M1.6 4.8H14.4" stroke="#2D2D2E"/>\n<path d="M1.6 9.6H8.00078" stroke="#2D2D2E"/>\n<path d="M5.6 1.6L5.6 14.4" stroke="#2D2D2E"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M11.5043 8.98727L11.6789 8.22924C11.7097 8.09564 11.8387 8 11.9881 8H12.8119C12.9613 8 13.0903 8.09564 13.1211 8.22924L13.2957 8.98727C13.3177 9.08256 13.3912 9.16027 13.488 9.20102C13.569 9.23514 13.648 9.2726 13.7248 9.31318C13.8018 9.35372 13.877 9.3976 13.95 9.44477C14.037 9.50098 14.1474 9.52034 14.2487 9.49008L15.0543 9.24927C15.1963 9.20683 15.3514 9.26108 15.4261 9.37933L15.9576 10.2206C16.0323 10.3389 16.0062 10.4888 15.895 10.5799L15.2639 11.0972C15.1846 11.1622 15.1477 11.2593 15.1575 11.3562C15.1657 11.4375 15.1698 11.5189 15.1697 11.6C15.1698 11.6811 15.1658 11.7625 15.1576 11.8438C15.1478 11.9407 15.1847 12.0378 15.264 12.1028L15.895 12.62C16.0062 12.7112 16.0324 12.8611 15.9577 12.9793L15.4262 13.8206C15.3515 13.9389 15.1963 13.9931 15.0544 13.9507L14.2487 13.7099C14.1474 13.6796 14.037 13.699 13.95 13.7552C13.877 13.8024 13.8018 13.8463 13.7248 13.8868C13.648 13.9274 13.569 13.9649 13.488 13.999C13.3912 14.0397 13.3177 14.1174 13.2957 14.2127L13.1211 14.9708C13.0903 15.1044 12.9613 15.2 12.8119 15.2H11.9881C11.8387 15.2 11.7097 15.1044 11.6789 14.9708L11.5043 14.2127C11.4823 14.1174 11.4088 14.0397 11.312 13.999C11.231 13.9649 11.152 13.9274 11.0752 13.8868C10.9982 13.8463 10.923 13.8024 10.85 13.7552C10.763 13.699 10.6526 13.6796 10.5513 13.7099L9.74565 13.9507C9.60366 13.9931 9.44854 13.9389 9.37384 13.8206L8.84234 12.9793C8.76764 12.8611 8.79378 12.7112 8.905 12.62L9.53602 12.1028C9.61534 12.0378 9.6522 11.9407 9.64243 11.8438C9.63424 11.7625 9.63023 11.6811 9.63031 11.6C9.63023 11.5189 9.63426 11.4375 9.64247 11.3562C9.65226 11.2593 9.61539 11.1622 9.53607 11.0972L8.90506 10.5799C8.79384 10.4888 8.7677 10.3389 8.8424 10.2206L9.3739 9.37933C9.4486 9.26108 9.60371 9.20683 9.74571 9.24927L10.5514 9.49008C10.6526 9.52034 10.7631 9.50098 10.8501 9.44477C10.923 9.3976 10.9982 9.35372 11.0752 9.31318C11.152 9.2726 11.231 9.23514 11.312 9.20102C11.4088 9.16027 11.4823 9.08256 11.5043 8.98727ZM12.3278 12.5136C12.8866 12.5136 13.3396 12.0996 13.3396 11.5889C13.3396 11.0783 12.8866 10.6643 12.3278 10.6643C11.769 10.6643 11.316 11.0783 11.316 11.5889C11.316 12.0996 11.769 12.5136 12.3278 12.5136Z" fill="#2D2D2E"/>\n</svg>\n';
|
|
40626
|
+
const AdjustWidthIcon = '<svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.10156 13.7031V1.625H8.17188V13.7031H7.10156ZM3.14844 14.4297C2.39323 14.4297 1.82552 14.2422 1.44531 13.8672C1.07031 13.4974 0.882812 12.9401 0.882812 12.1953V3.16406C0.882812 2.41927 1.07031 1.86198 1.44531 1.49219C1.82552 1.11719 2.39323 0.929688 3.14844 0.929688H12.1328C12.888 0.929688 13.4531 1.11719 13.8281 1.49219C14.2031 1.86719 14.3906 2.42448 14.3906 3.16406V12.1953C14.3906 12.9349 14.2031 13.4922 13.8281 13.8672C13.4531 14.2422 12.888 14.4297 12.1328 14.4297H3.14844ZM3.16406 13.3516H12.1172C12.4974 13.3516 12.7917 13.25 13 13.0469C13.2083 12.8438 13.3125 12.5417 13.3125 12.1406V3.21875C13.3125 2.81771 13.2083 2.51562 13 2.3125C12.7917 2.10938 12.4974 2.00781 12.1172 2.00781H3.16406C2.77865 2.00781 2.48177 2.10938 2.27344 2.3125C2.07031 2.51562 1.96875 2.81771 1.96875 3.21875V12.1406C1.96875 12.5417 2.07031 12.8438 2.27344 13.0469C2.48177 13.25 2.77865 13.3516 3.16406 13.3516Z" fill="#2D2D2E"/>\n</svg>\n';
|
|
40626
40627
|
const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
40627
40628
|
__proto__: null,
|
|
40628
40629
|
TableEditIcon,
|
|
@@ -40750,7 +40751,8 @@ ${codeText}
|
|
|
40750
40751
|
SearchIcon,
|
|
40751
40752
|
CalloutIcon: CalloutIcon$1,
|
|
40752
40753
|
LoadingCircleIcon,
|
|
40753
|
-
TextGroupIcon
|
|
40754
|
+
TextGroupIcon,
|
|
40755
|
+
AdjustWidthIcon
|
|
40754
40756
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
40755
40757
|
function createLoading() {
|
|
40756
40758
|
const loading2 = createElement("span", ["editor-loading-icon"], null);
|
|
@@ -44004,6 +44006,9 @@ ${codeText}
|
|
|
44004
44006
|
"insert-emoji": {
|
|
44005
44007
|
shortcut: "/emoji"
|
|
44006
44008
|
},
|
|
44009
|
+
"insert-toc": {
|
|
44010
|
+
shortcut: "/toc"
|
|
44011
|
+
},
|
|
44007
44012
|
...fontShortCuts()
|
|
44008
44013
|
};
|
|
44009
44014
|
function getShortcutById(id) {
|
|
@@ -46553,6 +46558,91 @@ ${codeText}
|
|
|
46553
46558
|
editor.deleteChildContainers(deletedContainers);
|
|
46554
46559
|
});
|
|
46555
46560
|
}
|
|
46561
|
+
var TABLE_CLASS = /* @__PURE__ */ ((TABLE_CLASS2) => {
|
|
46562
|
+
TABLE_CLASS2["COL_TITLE_TABLE"] = "col-title-table";
|
|
46563
|
+
TABLE_CLASS2["COL_TITLE_ITEM"] = "col-title-item";
|
|
46564
|
+
TABLE_CLASS2["STRIPE_STYLE_TABLE"] = "stripe-style-table";
|
|
46565
|
+
TABLE_CLASS2["NO_BORDER"] = "table-no-border";
|
|
46566
|
+
return TABLE_CLASS2;
|
|
46567
|
+
})(TABLE_CLASS || {});
|
|
46568
|
+
const TABLE_BAR_WIDTH = 6;
|
|
46569
|
+
const INSERT_BUTTON_SIZE = 20;
|
|
46570
|
+
const TABLE_CELL_MENU_BUTTON_CLASS = "table-cell-menu-btn";
|
|
46571
|
+
const logger$2r = getLogger("table-resize-gripper");
|
|
46572
|
+
const GRIPPER_SIZE = 7;
|
|
46573
|
+
const GRIPPER_SIZE_HALF = (GRIPPER_SIZE - 1) / 2;
|
|
46574
|
+
const CONTAINER_CELL_DELTA = 3;
|
|
46575
|
+
function getCellFromRightBorder(table, x, y) {
|
|
46576
|
+
const { rows } = table;
|
|
46577
|
+
for (let i = 0; i < rows.length; i++) {
|
|
46578
|
+
const row = rows[i];
|
|
46579
|
+
const cells = Array.from(row.cells);
|
|
46580
|
+
for (let j = 0; j < cells.length; j++) {
|
|
46581
|
+
const cell = cells[j];
|
|
46582
|
+
const rect = cell.getBoundingClientRect();
|
|
46583
|
+
const pos = Math.round(rect.right);
|
|
46584
|
+
if (Math.abs(x - pos) <= GRIPPER_SIZE_HALF && rect.top <= y && y <= rect.bottom) {
|
|
46585
|
+
return cell;
|
|
46586
|
+
}
|
|
46587
|
+
}
|
|
46588
|
+
}
|
|
46589
|
+
return null;
|
|
46590
|
+
}
|
|
46591
|
+
function editorHasExistsResizeGripper(editor) {
|
|
46592
|
+
return !!editor.rootContainer.querySelector(".table-resize-gripper");
|
|
46593
|
+
}
|
|
46594
|
+
function getExistsResizeGripper$1(editor, block) {
|
|
46595
|
+
const tools = getTableTools(editor, block);
|
|
46596
|
+
const gripper = tools.querySelector(".table-resize-gripper");
|
|
46597
|
+
return gripper;
|
|
46598
|
+
}
|
|
46599
|
+
function createResizeGripper$2(editor, block) {
|
|
46600
|
+
const exists = getExistsResizeGripper$1(editor, block);
|
|
46601
|
+
assert(logger$2r, !exists, "resize gripper has already exists");
|
|
46602
|
+
const tools = getTableTools(editor, block);
|
|
46603
|
+
const gripper = createElement("div", ["table-resize-gripper", "table-indicator"], tools);
|
|
46604
|
+
createElement("div", ["table-resize-gripper-indicator"], gripper);
|
|
46605
|
+
return gripper;
|
|
46606
|
+
}
|
|
46607
|
+
function updateResizeGripper$1(editor, block, cell) {
|
|
46608
|
+
let gripper = getExistsResizeGripper$1(editor, block);
|
|
46609
|
+
if (!gripper) {
|
|
46610
|
+
gripper = createResizeGripper$2(editor, block);
|
|
46611
|
+
}
|
|
46612
|
+
const table = getBlockTable(block);
|
|
46613
|
+
const tableRect = table.getBoundingClientRect();
|
|
46614
|
+
const cellRect = cell.getBoundingClientRect();
|
|
46615
|
+
const top = 0;
|
|
46616
|
+
const height = tableRect.height;
|
|
46617
|
+
const scrollContentRect = editor.getCustom(getTableScrollKey(block)).contentElement.getBoundingClientRect();
|
|
46618
|
+
const left = cellRect.right - scrollContentRect.left;
|
|
46619
|
+
gripper.style.left = `${left - GRIPPER_SIZE_HALF - TABLE_BAR_WIDTH - INSERT_BUTTON_SIZE}px`;
|
|
46620
|
+
gripper.style.top = `${top}px`;
|
|
46621
|
+
gripper.style.height = `${height}px`;
|
|
46622
|
+
gripper.style.width = `${GRIPPER_SIZE}px`;
|
|
46623
|
+
}
|
|
46624
|
+
function removeAllResizeGripper(editor) {
|
|
46625
|
+
editor.rootContainer.querySelectorAll(".table-resize-gripper").forEach((gripper) => {
|
|
46626
|
+
gripper.remove();
|
|
46627
|
+
});
|
|
46628
|
+
}
|
|
46629
|
+
function setTableColumnWidths(editor, block, colsWidth) {
|
|
46630
|
+
const oldData = editor.getBlockData(block);
|
|
46631
|
+
const newData = {
|
|
46632
|
+
...oldData,
|
|
46633
|
+
colsWidth
|
|
46634
|
+
};
|
|
46635
|
+
editor.updateBlockData(block, newData, void 0, { noScroll: true });
|
|
46636
|
+
}
|
|
46637
|
+
function adjustColumnWidthsEvenly(editor, tableBlock) {
|
|
46638
|
+
const tableData = editor.getBlockData(tableBlock);
|
|
46639
|
+
const grid = tableData2Grid(tableData);
|
|
46640
|
+
const colCount = grid.colCount;
|
|
46641
|
+
const table = getBlockTable(tableBlock);
|
|
46642
|
+
const tableWidth = table.getBoundingClientRect().width;
|
|
46643
|
+
const colWidth = tableWidth / colCount;
|
|
46644
|
+
setTableColumnWidths(editor, tableBlock, Array(colCount).fill(colWidth));
|
|
46645
|
+
}
|
|
46556
46646
|
const TABLE_COMMAND_GROUP_INDEX = 10;
|
|
46557
46647
|
const TableCommands = [
|
|
46558
46648
|
"table/merge-cells",
|
|
@@ -46561,7 +46651,8 @@ ${codeText}
|
|
|
46561
46651
|
"table/insert-row",
|
|
46562
46652
|
"table/delete-rows",
|
|
46563
46653
|
"table/delete-columns",
|
|
46564
|
-
"table/delete"
|
|
46654
|
+
"table/delete",
|
|
46655
|
+
"table/adjust-column-widths-evenly"
|
|
46565
46656
|
];
|
|
46566
46657
|
class TableBlockCommandProvider {
|
|
46567
46658
|
constructor() {
|
|
@@ -46573,6 +46664,8 @@ ${codeText}
|
|
|
46573
46664
|
return [];
|
|
46574
46665
|
}
|
|
46575
46666
|
const commands = [];
|
|
46667
|
+
const deleteColumns2 = canDeleteColumns(editor, block, range);
|
|
46668
|
+
const deleteRows2 = canDeleteRows(editor, block, range);
|
|
46576
46669
|
if (canMergeCells(editor, block, range)) {
|
|
46577
46670
|
commands.push({
|
|
46578
46671
|
id: "table/merge-cells",
|
|
@@ -46587,8 +46680,6 @@ ${codeText}
|
|
|
46587
46680
|
icon: SplitCellIcon
|
|
46588
46681
|
});
|
|
46589
46682
|
}
|
|
46590
|
-
const deleteColumns2 = canDeleteColumns(editor, block, range);
|
|
46591
|
-
const deleteRows2 = canDeleteRows(editor, block, range);
|
|
46592
46683
|
if (deleteColumns2 && deleteRows2) {
|
|
46593
46684
|
commands.push({
|
|
46594
46685
|
id: "table/delete",
|
|
@@ -46596,6 +46687,14 @@ ${codeText}
|
|
|
46596
46687
|
icon: DeleteTableIcon
|
|
46597
46688
|
});
|
|
46598
46689
|
}
|
|
46690
|
+
const allColumnsSelected = deleteRows2;
|
|
46691
|
+
if (allColumnsSelected) {
|
|
46692
|
+
commands.push({
|
|
46693
|
+
id: "table/adjust-column-widths-evenly",
|
|
46694
|
+
name: i18n$1.t("table.adjustColumnWidthsEvenly"),
|
|
46695
|
+
icon: AdjustWidthIcon
|
|
46696
|
+
});
|
|
46697
|
+
}
|
|
46599
46698
|
return commands;
|
|
46600
46699
|
}
|
|
46601
46700
|
executeCommand(editor, block, range, command, params, result) {
|
|
@@ -46625,19 +46724,13 @@ ${codeText}
|
|
|
46625
46724
|
editor.deleteBlock(block);
|
|
46626
46725
|
return true;
|
|
46627
46726
|
}
|
|
46727
|
+
if (command.id === "table/adjust-column-widths-evenly") {
|
|
46728
|
+
adjustColumnWidthsEvenly(editor, block);
|
|
46729
|
+
return true;
|
|
46730
|
+
}
|
|
46628
46731
|
return false;
|
|
46629
46732
|
}
|
|
46630
46733
|
}
|
|
46631
|
-
var TABLE_CLASS = /* @__PURE__ */ ((TABLE_CLASS2) => {
|
|
46632
|
-
TABLE_CLASS2["COL_TITLE_TABLE"] = "col-title-table";
|
|
46633
|
-
TABLE_CLASS2["COL_TITLE_ITEM"] = "col-title-item";
|
|
46634
|
-
TABLE_CLASS2["STRIPE_STYLE_TABLE"] = "stripe-style-table";
|
|
46635
|
-
TABLE_CLASS2["NO_BORDER"] = "table-no-border";
|
|
46636
|
-
return TABLE_CLASS2;
|
|
46637
|
-
})(TABLE_CLASS || {});
|
|
46638
|
-
const TABLE_BAR_WIDTH = 6;
|
|
46639
|
-
const INSERT_BUTTON_SIZE = 20;
|
|
46640
|
-
const TABLE_CELL_MENU_BUTTON_CLASS = "table-cell-menu-btn";
|
|
46641
46734
|
function setColTitle(editor, tableBlock) {
|
|
46642
46735
|
if (!editor.isBlockWritable(tableBlock)) {
|
|
46643
46736
|
return;
|
|
@@ -46715,26 +46808,26 @@ ${codeText}
|
|
|
46715
46808
|
};
|
|
46716
46809
|
editor.updateBlockData(tableBlock, newBlockData);
|
|
46717
46810
|
}
|
|
46718
|
-
const logger$
|
|
46811
|
+
const logger$2q = getLogger("table-cell-dom");
|
|
46719
46812
|
function getCellElementByChildBlockId(editor, tableBlock, blockId) {
|
|
46720
46813
|
let blockElement = editor.getBlockById(blockId);
|
|
46721
46814
|
while (blockElement) {
|
|
46722
46815
|
const cell = blockElement.closest("td");
|
|
46723
|
-
assert(logger$
|
|
46816
|
+
assert(logger$2q, cell, "no parent cell");
|
|
46724
46817
|
const cellParentBlock = getParentBlock(cell);
|
|
46725
|
-
assert(logger$
|
|
46818
|
+
assert(logger$2q, cellParentBlock, "no parent block");
|
|
46726
46819
|
if (cellParentBlock === tableBlock) {
|
|
46727
46820
|
return cell;
|
|
46728
46821
|
}
|
|
46729
46822
|
blockElement = cellParentBlock;
|
|
46730
46823
|
}
|
|
46731
|
-
assert(logger$
|
|
46824
|
+
assert(logger$2q, false, "filed to get cell by child block id");
|
|
46732
46825
|
return null;
|
|
46733
46826
|
}
|
|
46734
46827
|
function createComplexPosFromBlockPos(editor, tableBlock, blockPosition) {
|
|
46735
46828
|
const blockElement = editor.getBlockById(blockPosition.blockId);
|
|
46736
46829
|
if (blockElement === tableBlock && !blockPosition.isSimple()) {
|
|
46737
|
-
assert(logger$
|
|
46830
|
+
assert(logger$2q, blockPosition.childContainerId, "block position must have childContainerId attribute");
|
|
46738
46831
|
return blockPosition;
|
|
46739
46832
|
}
|
|
46740
46833
|
const cellElement = getCellElementByChildBlockId(editor, tableBlock, blockPosition.blockId);
|
|
@@ -46748,12 +46841,12 @@ ${codeText}
|
|
|
46748
46841
|
return getTableSelectionRange(tableBlock, start, end);
|
|
46749
46842
|
}
|
|
46750
46843
|
function updateBarsDangerStatus(editor, tableBlock, selectedRows, selectedColumns) {
|
|
46751
|
-
assert(logger$
|
|
46844
|
+
assert(logger$2q, isTableBlock(tableBlock), "invalid table block");
|
|
46752
46845
|
const tools = getTableTools(editor, tableBlock);
|
|
46753
46846
|
const blockTools = getBlockTools(tableBlock);
|
|
46754
46847
|
const updateTop = () => {
|
|
46755
46848
|
const exists = tools.querySelector(".table-border-bar-container.top");
|
|
46756
|
-
assert(logger$
|
|
46849
|
+
assert(logger$2q, exists, "no top border bar container");
|
|
46757
46850
|
const cells = exists.querySelectorAll(".table-border-bar-cell.top");
|
|
46758
46851
|
cells.forEach((cell) => {
|
|
46759
46852
|
const colIndex = parseInt(cell.getAttribute("data-top-index") || "0", 10);
|
|
@@ -46766,7 +46859,7 @@ ${codeText}
|
|
|
46766
46859
|
};
|
|
46767
46860
|
const updateLeft = () => {
|
|
46768
46861
|
const left = blockTools.querySelector(".table-border-bar-container.left");
|
|
46769
|
-
assert(logger$
|
|
46862
|
+
assert(logger$2q, left, "no left border bar container");
|
|
46770
46863
|
const cells = left.querySelectorAll(".table-border-bar-cell.left");
|
|
46771
46864
|
cells.forEach((cell) => {
|
|
46772
46865
|
const rowIndex = parseInt(cell.getAttribute("data-left-index") || "0", 10);
|
|
@@ -46802,7 +46895,7 @@ ${codeText}
|
|
|
46802
46895
|
}
|
|
46803
46896
|
}
|
|
46804
46897
|
} catch (error2) {
|
|
46805
|
-
logger$
|
|
46898
|
+
logger$2q.error("update cells danger status failed: ", error2.message);
|
|
46806
46899
|
}
|
|
46807
46900
|
}
|
|
46808
46901
|
function updateCellBarsDangerStatus(editor, tableBlock, isDanger = true, isCol) {
|
|
@@ -46825,7 +46918,7 @@ ${codeText}
|
|
|
46825
46918
|
}
|
|
46826
46919
|
updateBarsDangerStatus(editor, tableBlock, Array.from(selectedRows), Array.from(selectedColumns));
|
|
46827
46920
|
} catch (error2) {
|
|
46828
|
-
logger$
|
|
46921
|
+
logger$2q.error("update cell bars danger status failed: ", error2.message);
|
|
46829
46922
|
}
|
|
46830
46923
|
}
|
|
46831
46924
|
function createEntireRowAndColumnRange(editor, tableBlock, isCol) {
|
|
@@ -46944,14 +47037,14 @@ ${codeText}
|
|
|
46944
47037
|
}
|
|
46945
47038
|
const DEFAULT_COLUMN_WIDTH$1 = 200;
|
|
46946
47039
|
const MIN_COLUMN_WIDTH = 40;
|
|
46947
|
-
const logger$
|
|
47040
|
+
const logger$2p = getLogger("table-insert-column");
|
|
46948
47041
|
function insertColumn(editor, tableBlock, insertIndex) {
|
|
46949
47042
|
editor.undoManager.runInGroup(() => {
|
|
46950
47043
|
var _a;
|
|
46951
47044
|
const table = getBlockTable(tableBlock);
|
|
46952
47045
|
const grid = TableGrid.fromTable(table);
|
|
46953
47046
|
const colCount = grid.colCount;
|
|
46954
|
-
assert(logger$
|
|
47047
|
+
assert(logger$2p, insertIndex >= 0 && insertIndex <= colCount, `insert index ${insertIndex} is out of range [0, ${colCount}]`);
|
|
46955
47048
|
const cells = grid.map((cell) => cell.containerId);
|
|
46956
47049
|
const spannedContainerIds = /* @__PURE__ */ new Set();
|
|
46957
47050
|
editor.doc.beginBatchUpdate();
|
|
@@ -46972,7 +47065,7 @@ ${codeText}
|
|
|
46972
47065
|
spannedContainerIds.forEach((containerId) => {
|
|
46973
47066
|
const key = `${containerId}_colSpan`;
|
|
46974
47067
|
const oldSpan = oldBlockData[key];
|
|
46975
|
-
assert(logger$
|
|
47068
|
+
assert(logger$2p, typeof oldSpan === "number" && oldSpan > 1, `no colSpan for containerId ${containerId}, ${oldSpan}`);
|
|
46976
47069
|
oldBlockData[key] = oldSpan + 1;
|
|
46977
47070
|
});
|
|
46978
47071
|
const colsWidth = ((_a = oldBlockData.colsWidth) == null ? void 0 : _a.concat()) || new Array(oldBlockData.cols).fill(0);
|
|
@@ -46988,13 +47081,13 @@ ${codeText}
|
|
|
46988
47081
|
editor.updateBlockData(tableBlock, newBlockData);
|
|
46989
47082
|
});
|
|
46990
47083
|
}
|
|
46991
|
-
const logger$
|
|
47084
|
+
const logger$2o = getLogger("table-insert-row");
|
|
46992
47085
|
function insertRow(editor, tableBlock, insertIndex) {
|
|
46993
47086
|
editor.undoManager.runInGroup(() => {
|
|
46994
47087
|
const table = getBlockTable(tableBlock);
|
|
46995
47088
|
const grid = TableGrid.fromTable(table);
|
|
46996
47089
|
const rowCount = grid.rowCount;
|
|
46997
|
-
assert(logger$
|
|
47090
|
+
assert(logger$2o, insertIndex >= 0 && insertIndex <= rowCount, `insert index ${insertIndex} is out of range [0, ${rowCount}]`);
|
|
46998
47091
|
const cells = grid.map((cell) => cell.containerId);
|
|
46999
47092
|
const spannedContainerIds = /* @__PURE__ */ new Set();
|
|
47000
47093
|
editor.doc.beginBatchUpdate();
|
|
@@ -47002,12 +47095,12 @@ ${codeText}
|
|
|
47002
47095
|
for (let col = 0; col < grid.colCount; col++) {
|
|
47003
47096
|
const top = insertIndex > 0 && cells[insertIndex - 1][col];
|
|
47004
47097
|
const bottom = insertIndex < grid.rowCount && cells[insertIndex][col];
|
|
47005
|
-
assert(logger$
|
|
47098
|
+
assert(logger$2o, top || bottom, "no top and bottom cell");
|
|
47006
47099
|
if (insertIndex === 0 || insertIndex === grid.rowCount || top !== bottom) {
|
|
47007
47100
|
const newContainerId = createEmptyContainer(editor.doc);
|
|
47008
47101
|
rowData.push(newContainerId);
|
|
47009
47102
|
} else {
|
|
47010
|
-
assert(logger$
|
|
47103
|
+
assert(logger$2o, top, "no top cell");
|
|
47011
47104
|
rowData.push(top);
|
|
47012
47105
|
spannedContainerIds.add(top);
|
|
47013
47106
|
}
|
|
@@ -47018,7 +47111,7 @@ ${codeText}
|
|
|
47018
47111
|
spannedContainerIds.forEach((containerId) => {
|
|
47019
47112
|
const key = `${containerId}_rowSpan`;
|
|
47020
47113
|
const oldSpan = oldBlockData[key];
|
|
47021
|
-
assert(logger$
|
|
47114
|
+
assert(logger$2o, typeof oldSpan === "number" && oldSpan > 1, `no rowSpan for containerId ${containerId}, ${oldSpan}`);
|
|
47022
47115
|
oldBlockData[key] = oldSpan + 1;
|
|
47023
47116
|
});
|
|
47024
47117
|
const newChildren = TableGrid.virtualCellContainersGridToChildren(cells);
|
|
@@ -47031,7 +47124,7 @@ ${codeText}
|
|
|
47031
47124
|
editor.updateBlockData(tableBlock, newBlockData);
|
|
47032
47125
|
});
|
|
47033
47126
|
}
|
|
47034
|
-
const logger$
|
|
47127
|
+
const logger$2n = getLogger("table-chart");
|
|
47035
47128
|
function removeChart(editor, block) {
|
|
47036
47129
|
const tableTools = findExistsTableTools(editor, block);
|
|
47037
47130
|
if (tableTools) {
|
|
@@ -47116,7 +47209,7 @@ ${codeText}
|
|
|
47116
47209
|
chartContainer = createElement("div", ["editor-table-chart"], tableTools);
|
|
47117
47210
|
}
|
|
47118
47211
|
const parent = chartContainer;
|
|
47119
|
-
assert(logger$
|
|
47212
|
+
assert(logger$2n, parent, "no chart container");
|
|
47120
47213
|
const options = editor.getComponentOptions("table");
|
|
47121
47214
|
const cdn = (options == null ? void 0 : options.chartCdn) || "https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js";
|
|
47122
47215
|
try {
|
|
@@ -47160,7 +47253,7 @@ ${codeText}
|
|
|
47160
47253
|
chartContainer.chartObject = chartObject;
|
|
47161
47254
|
}
|
|
47162
47255
|
} catch (err) {
|
|
47163
|
-
logger$
|
|
47256
|
+
logger$2n.error(`failed to resolve chart cdn: ${JSON.stringify(err)}`);
|
|
47164
47257
|
}
|
|
47165
47258
|
}
|
|
47166
47259
|
async function updateChartCore(editor, block) {
|
|
@@ -47317,7 +47410,7 @@ ${codeText}
|
|
|
47317
47410
|
const height = document.documentElement.clientHeight;
|
|
47318
47411
|
return new DOMRect(left, top, width, height);
|
|
47319
47412
|
}
|
|
47320
|
-
const logger$
|
|
47413
|
+
const logger$2m = getLogger("scroll-bar-handle");
|
|
47321
47414
|
const BOTTOM_FLOAT_HEIGHT = 2;
|
|
47322
47415
|
function getScrollbarContainer(scrollContainer) {
|
|
47323
47416
|
const tools = getTools(scrollContainer);
|
|
@@ -47328,7 +47421,7 @@ ${codeText}
|
|
|
47328
47421
|
scrollbarContainer.style.minHeight = "10px";
|
|
47329
47422
|
}
|
|
47330
47423
|
}
|
|
47331
|
-
assert(logger$
|
|
47424
|
+
assert(logger$2m, scrollbarContainer instanceof HTMLDivElement, "invalid child for container tools");
|
|
47332
47425
|
if (!scrollbarContainer.firstElementChild) {
|
|
47333
47426
|
createElement("div", [], scrollbarContainer);
|
|
47334
47427
|
}
|
|
@@ -47344,7 +47437,7 @@ ${codeText}
|
|
|
47344
47437
|
fixScrollWrapRightBoundary(scrollCore, scrollContainer);
|
|
47345
47438
|
fixScrollWrapLeftBoundary(scrollCore, scrollContainer);
|
|
47346
47439
|
const overflowWidth = scrollWidth - clientWidth;
|
|
47347
|
-
assert(logger$
|
|
47440
|
+
assert(logger$2m, scrollbarContainer.firstElementChild instanceof HTMLDivElement, "invalid child for scroll bar");
|
|
47348
47441
|
scrollbarContainer.style.width = `${getSizeAsScale(scrollContainer, originWidth + maxRight - paddingLeft - paddingRight)}px`;
|
|
47349
47442
|
scrollbarContainer.firstElementChild.style.width = `${getSizeAsScale(scrollContainer, originWidth + maxRight + overflowWidth - paddingLeft - paddingRight)}px`;
|
|
47350
47443
|
}
|
|
@@ -47431,7 +47524,7 @@ ${codeText}
|
|
|
47431
47524
|
this.intersectionObserver.disconnect();
|
|
47432
47525
|
}
|
|
47433
47526
|
}
|
|
47434
|
-
const logger$
|
|
47527
|
+
const logger$2l = getLogger("container-scroll-shadow");
|
|
47435
47528
|
function setShadowBottom(shadow, scrollContainer, scrollWrap) {
|
|
47436
47529
|
const elem = shadow;
|
|
47437
47530
|
const contentRect = scrollContainer.getBoundingClientRect();
|
|
@@ -47450,22 +47543,22 @@ ${codeText}
|
|
|
47450
47543
|
}
|
|
47451
47544
|
function showLeftShadow(scrollContainer) {
|
|
47452
47545
|
const targetTools = getTools(scrollContainer);
|
|
47453
|
-
assert(logger$
|
|
47546
|
+
assert(logger$2l, targetTools, "no container tools");
|
|
47454
47547
|
let shadow = targetTools.querySelector(`.${SHADOW_CLASS.LEFT}`);
|
|
47455
47548
|
if (!shadow) {
|
|
47456
47549
|
const scrollWrap = getContainerScrollArea(scrollContainer);
|
|
47457
47550
|
const classes = [SHADOW_CLASS.COMMON, SHADOW_CLASS.LEFT];
|
|
47458
47551
|
shadow = createElement("div", classes, targetTools);
|
|
47459
|
-
assert(logger$
|
|
47552
|
+
assert(logger$2l, shadow instanceof HTMLDivElement, "invalid child for container tools");
|
|
47460
47553
|
setShadowBottom(shadow, scrollContainer, scrollWrap);
|
|
47461
47554
|
}
|
|
47462
|
-
assert(logger$
|
|
47555
|
+
assert(logger$2l, shadow instanceof HTMLElement, "invalid child for container tools");
|
|
47463
47556
|
const container = getContainer(scrollContainer);
|
|
47464
47557
|
const containerRect = container.getBoundingClientRect();
|
|
47465
47558
|
const scrollContainerRect = scrollContainer.getBoundingClientRect();
|
|
47466
47559
|
shadow.style.left = `${getSizeAsScale(scrollContainer, scrollContainerRect.left - containerRect.left)}px`;
|
|
47467
47560
|
const leftRest = getElementScrollSize(scrollContainer).scrollLeft;
|
|
47468
|
-
assert(logger$
|
|
47561
|
+
assert(logger$2l, shadow instanceof HTMLDivElement, "invalid child for container tools");
|
|
47469
47562
|
setShadowWidth(shadow, leftRest);
|
|
47470
47563
|
addClass(shadow, SHADOW_CLASS.ACTIVE);
|
|
47471
47564
|
}
|
|
@@ -47476,17 +47569,17 @@ ${codeText}
|
|
|
47476
47569
|
const scrollWrap = getContainerScrollArea(scrollContainer);
|
|
47477
47570
|
const classes = [SHADOW_CLASS.COMMON, SHADOW_CLASS.RIGHT];
|
|
47478
47571
|
shadow = createElement("div", classes, tools);
|
|
47479
|
-
assert(logger$
|
|
47572
|
+
assert(logger$2l, shadow instanceof HTMLDivElement, "no div, create shadow failed");
|
|
47480
47573
|
setShadowBottom(shadow, scrollContainer, scrollWrap);
|
|
47481
47574
|
}
|
|
47482
|
-
assert(logger$
|
|
47575
|
+
assert(logger$2l, shadow instanceof HTMLElement, "");
|
|
47483
47576
|
const container = getContainer(scrollContainer);
|
|
47484
47577
|
const containerRect = container.getBoundingClientRect();
|
|
47485
47578
|
const scrollContainerRect = scrollContainer.getBoundingClientRect();
|
|
47486
47579
|
shadow.style.right = `${getSizeAsScale(scrollContainer, containerRect.right - scrollContainerRect.right)}px`;
|
|
47487
47580
|
const { scrollWidth, scrollLeft, clientWidth } = getElementScrollSize(scrollContainer);
|
|
47488
47581
|
const rightRest = scrollWidth - scrollLeft - clientWidth;
|
|
47489
|
-
assert(logger$
|
|
47582
|
+
assert(logger$2l, shadow instanceof HTMLDivElement, "no shadow element");
|
|
47490
47583
|
setShadowWidth(shadow, rightRest);
|
|
47491
47584
|
addClass(shadow, SHADOW_CLASS.ACTIVE);
|
|
47492
47585
|
}
|
|
@@ -47559,12 +47652,12 @@ ${codeText}
|
|
|
47559
47652
|
this.resizeObserver.disconnect();
|
|
47560
47653
|
}
|
|
47561
47654
|
}
|
|
47562
|
-
const logger$
|
|
47655
|
+
const logger$2k = getLogger("container-scroll-observer");
|
|
47563
47656
|
class ContainerScrollObserver {
|
|
47564
47657
|
constructor(scrollCore, callback) {
|
|
47565
47658
|
__publicField(this, "handleContentScroll", (e2) => {
|
|
47566
47659
|
const scrollContainer = e2.target;
|
|
47567
|
-
assert(logger$
|
|
47660
|
+
assert(logger$2k, scrollContainer instanceof Element, "invalid target for scroll event");
|
|
47568
47661
|
const scrollbarContainer = getScrollbarContainer(scrollContainer);
|
|
47569
47662
|
scrollbarContainer.removeEventListener("scroll", this.handleScroll);
|
|
47570
47663
|
const needFixScrollbarContainer = true;
|
|
@@ -47575,7 +47668,7 @@ ${codeText}
|
|
|
47575
47668
|
});
|
|
47576
47669
|
__publicField(this, "handleScroll", (e2) => {
|
|
47577
47670
|
const scrollbarContainer = e2.target;
|
|
47578
|
-
assert(logger$
|
|
47671
|
+
assert(logger$2k, scrollbarContainer instanceof HTMLElement, "");
|
|
47579
47672
|
const scrollLeft = scrollbarContainer.scrollLeft;
|
|
47580
47673
|
const needFixScrollbarContainer = false;
|
|
47581
47674
|
const scrollContainer = getScrollContainerByScrollBar(scrollbarContainer);
|
|
@@ -47655,7 +47748,7 @@ ${codeText}
|
|
|
47655
47748
|
this.scrollContainers.clear();
|
|
47656
47749
|
}
|
|
47657
47750
|
}
|
|
47658
|
-
const logger$
|
|
47751
|
+
const logger$2j = getLogger("scroll-wrap-resize-observer");
|
|
47659
47752
|
class ScrollWrapResizeObserve {
|
|
47660
47753
|
constructor(scrollCore) {
|
|
47661
47754
|
__publicField(this, "resizeObserver");
|
|
@@ -47671,7 +47764,7 @@ ${codeText}
|
|
|
47671
47764
|
});
|
|
47672
47765
|
__publicField(this, "handleScrollWrapResizeEntry", (entry) => {
|
|
47673
47766
|
const scrollWrap = entry.target;
|
|
47674
|
-
assert(logger$
|
|
47767
|
+
assert(logger$2j, scrollWrap instanceof HTMLElement, "invalid target for observer entry");
|
|
47675
47768
|
const scrollContainer = getScrollContainer(scrollWrap);
|
|
47676
47769
|
resetScrollbar(this.scrollCore, scrollWrap);
|
|
47677
47770
|
resetScrollWrapShadow(scrollContainer);
|
|
@@ -47876,7 +47969,7 @@ ${codeText}
|
|
|
47876
47969
|
window.removeEventListener("scroll", this.handleWindowEffect);
|
|
47877
47970
|
}
|
|
47878
47971
|
}
|
|
47879
|
-
const logger$
|
|
47972
|
+
const logger$2i = getLogger("scroll-container");
|
|
47880
47973
|
const rootScrollMap = /* @__PURE__ */ new Map();
|
|
47881
47974
|
class ScrollContainer extends tinyTypedEmitter.TypedEmitter {
|
|
47882
47975
|
constructor() {
|
|
@@ -47924,11 +48017,11 @@ ${codeText}
|
|
|
47924
48017
|
return this.scrollContainerElement;
|
|
47925
48018
|
}
|
|
47926
48019
|
get contentElement() {
|
|
47927
|
-
assert(logger$
|
|
48020
|
+
assert(logger$2i, this.scrollContainerElement, "scrollContainerElement cannot be undefined");
|
|
47928
48021
|
return getContainerScrollArea(this.scrollContainerElement);
|
|
47929
48022
|
}
|
|
47930
48023
|
get scrollOptions() {
|
|
47931
|
-
assert(logger$
|
|
48024
|
+
assert(logger$2i, this.options, "options cannot be undefined");
|
|
47932
48025
|
return { ...this.options };
|
|
47933
48026
|
}
|
|
47934
48027
|
handleBaseListenerDestroy(baseListener) {
|
|
@@ -47952,7 +48045,7 @@ ${codeText}
|
|
|
47952
48045
|
function createScrollContainer() {
|
|
47953
48046
|
return new ScrollContainer();
|
|
47954
48047
|
}
|
|
47955
|
-
const logger$
|
|
48048
|
+
const logger$2h = getLogger("column-width");
|
|
47956
48049
|
function setColumnWidth(table, colIndex, width) {
|
|
47957
48050
|
const col = getTableCol(table, colIndex);
|
|
47958
48051
|
col.style.width = `${width}px`;
|
|
@@ -47973,7 +48066,7 @@ ${codeText}
|
|
|
47973
48066
|
cellRightOffsets[colIndex] = cell.cell.getBoundingClientRect().right - left;
|
|
47974
48067
|
}
|
|
47975
48068
|
});
|
|
47976
|
-
logger$
|
|
48069
|
+
logger$2h.debug(`cellRightOffsets1: ${cellRightOffsets.join()}`);
|
|
47977
48070
|
for (let col = 0; col < cellRightOffsets.length; col++) {
|
|
47978
48071
|
const offset = cellRightOffsets[col];
|
|
47979
48072
|
if (offset === -1 || col === 0) {
|
|
@@ -47993,7 +48086,7 @@ ${codeText}
|
|
|
47993
48086
|
cellRightOffsets[i] = prevOffset + averageWidth * (i - prevCol);
|
|
47994
48087
|
}
|
|
47995
48088
|
}
|
|
47996
|
-
logger$
|
|
48089
|
+
logger$2h.debug(`cellRightOffsets2: ${cellRightOffsets.join()}`);
|
|
47997
48090
|
const result = [];
|
|
47998
48091
|
let prev = 0;
|
|
47999
48092
|
for (let col = 0; col < cellRightOffsets.length; col++) {
|
|
@@ -48001,7 +48094,7 @@ ${codeText}
|
|
|
48001
48094
|
result.push(offset - prev);
|
|
48002
48095
|
prev = offset;
|
|
48003
48096
|
}
|
|
48004
|
-
logger$
|
|
48097
|
+
logger$2h.debug(`widths: ${result.join()}`);
|
|
48005
48098
|
return result;
|
|
48006
48099
|
}
|
|
48007
48100
|
function getTableColumnWidths(table) {
|
|
@@ -48009,72 +48102,6 @@ ${codeText}
|
|
|
48009
48102
|
const widths = tableCols.map((col) => col.getBoundingClientRect().width || Number.parseInt(col.style.width, 10));
|
|
48010
48103
|
return widths;
|
|
48011
48104
|
}
|
|
48012
|
-
const logger$2h = getLogger("table-resize-gripper");
|
|
48013
|
-
const GRIPPER_SIZE = 7;
|
|
48014
|
-
const GRIPPER_SIZE_HALF = (GRIPPER_SIZE - 1) / 2;
|
|
48015
|
-
const CONTAINER_CELL_DELTA = 3;
|
|
48016
|
-
function getCellFromRightBorder(table, x, y) {
|
|
48017
|
-
const { rows } = table;
|
|
48018
|
-
for (let i = 0; i < rows.length; i++) {
|
|
48019
|
-
const row = rows[i];
|
|
48020
|
-
const cells = Array.from(row.cells);
|
|
48021
|
-
for (let j = 0; j < cells.length; j++) {
|
|
48022
|
-
const cell = cells[j];
|
|
48023
|
-
const rect = cell.getBoundingClientRect();
|
|
48024
|
-
const pos = Math.round(rect.right);
|
|
48025
|
-
if (Math.abs(x - pos) <= GRIPPER_SIZE_HALF && rect.top <= y && y <= rect.bottom) {
|
|
48026
|
-
return cell;
|
|
48027
|
-
}
|
|
48028
|
-
}
|
|
48029
|
-
}
|
|
48030
|
-
return null;
|
|
48031
|
-
}
|
|
48032
|
-
function editorHasExistsResizeGripper(editor) {
|
|
48033
|
-
return !!editor.rootContainer.querySelector(".table-resize-gripper");
|
|
48034
|
-
}
|
|
48035
|
-
function getExistsResizeGripper$1(editor, block) {
|
|
48036
|
-
const tools = getTableTools(editor, block);
|
|
48037
|
-
const gripper = tools.querySelector(".table-resize-gripper");
|
|
48038
|
-
return gripper;
|
|
48039
|
-
}
|
|
48040
|
-
function createResizeGripper$2(editor, block) {
|
|
48041
|
-
const exists = getExistsResizeGripper$1(editor, block);
|
|
48042
|
-
assert(logger$2h, !exists, "resize gripper has already exists");
|
|
48043
|
-
const tools = getTableTools(editor, block);
|
|
48044
|
-
const gripper = createElement("div", ["table-resize-gripper", "table-indicator"], tools);
|
|
48045
|
-
createElement("div", ["table-resize-gripper-indicator"], gripper);
|
|
48046
|
-
return gripper;
|
|
48047
|
-
}
|
|
48048
|
-
function updateResizeGripper$1(editor, block, cell) {
|
|
48049
|
-
let gripper = getExistsResizeGripper$1(editor, block);
|
|
48050
|
-
if (!gripper) {
|
|
48051
|
-
gripper = createResizeGripper$2(editor, block);
|
|
48052
|
-
}
|
|
48053
|
-
const table = getBlockTable(block);
|
|
48054
|
-
const tableRect = table.getBoundingClientRect();
|
|
48055
|
-
const cellRect = cell.getBoundingClientRect();
|
|
48056
|
-
const top = 0;
|
|
48057
|
-
const height = tableRect.height;
|
|
48058
|
-
const scrollContentRect = editor.getCustom(getTableScrollKey(block)).contentElement.getBoundingClientRect();
|
|
48059
|
-
const left = cellRect.right - scrollContentRect.left;
|
|
48060
|
-
gripper.style.left = `${left - GRIPPER_SIZE_HALF - TABLE_BAR_WIDTH - INSERT_BUTTON_SIZE}px`;
|
|
48061
|
-
gripper.style.top = `${top}px`;
|
|
48062
|
-
gripper.style.height = `${height}px`;
|
|
48063
|
-
gripper.style.width = `${GRIPPER_SIZE}px`;
|
|
48064
|
-
}
|
|
48065
|
-
function removeAllResizeGripper(editor) {
|
|
48066
|
-
editor.rootContainer.querySelectorAll(".table-resize-gripper").forEach((gripper) => {
|
|
48067
|
-
gripper.remove();
|
|
48068
|
-
});
|
|
48069
|
-
}
|
|
48070
|
-
function setTableColumnWidths(editor, block, colsWidth) {
|
|
48071
|
-
const oldData = editor.getBlockData(block);
|
|
48072
|
-
const newData = {
|
|
48073
|
-
...oldData,
|
|
48074
|
-
colsWidth
|
|
48075
|
-
};
|
|
48076
|
-
editor.updateBlockData(block, newData, void 0, { noScroll: true });
|
|
48077
|
-
}
|
|
48078
48105
|
function getTableResizeMinX(editor, draggingRefCell, table, x) {
|
|
48079
48106
|
const cell = draggingRefCell;
|
|
48080
48107
|
const grid = TableGrid.fromTable(table);
|
|
@@ -54753,7 +54780,7 @@ ${codeText}
|
|
|
54753
54780
|
};
|
|
54754
54781
|
return { blockData };
|
|
54755
54782
|
}
|
|
54756
|
-
function getOptions$
|
|
54783
|
+
function getOptions$9(editor) {
|
|
54757
54784
|
return {
|
|
54758
54785
|
name: "Mathjax"
|
|
54759
54786
|
};
|
|
@@ -54785,7 +54812,7 @@ $$${mathData.mathjaxText}$$
|
|
|
54785
54812
|
const MathjaxEmbed = {
|
|
54786
54813
|
embedType: "math",
|
|
54787
54814
|
createEmbedContent: createEmbedContent$9,
|
|
54788
|
-
getOptions: getOptions$
|
|
54815
|
+
getOptions: getOptions$9,
|
|
54789
54816
|
convertFrom: convertFrom$7,
|
|
54790
54817
|
handleDeleteBlock: handleDeleteBlock$7,
|
|
54791
54818
|
convertTo: convertTo$g,
|
|
@@ -65255,7 +65282,7 @@ $$${mathData.mathjaxText}$$
|
|
|
65255
65282
|
editor.focus();
|
|
65256
65283
|
return editor.insertBlock(options.containerId, options.blockIndex, blockData, createBlockSimpleRange(editor, focusBlockId, 0));
|
|
65257
65284
|
}
|
|
65258
|
-
function getOptions$
|
|
65285
|
+
function getOptions$8(editor) {
|
|
65259
65286
|
return {
|
|
65260
65287
|
name: "CodeBlock",
|
|
65261
65288
|
insertBlockCommandItems: [
|
|
@@ -65320,7 +65347,7 @@ ${codeText}
|
|
|
65320
65347
|
getSelectedContainers: getSelectedContainers$2,
|
|
65321
65348
|
convertFrom: convertToCode,
|
|
65322
65349
|
handleBlockElementUpdated,
|
|
65323
|
-
getOptions: getOptions$
|
|
65350
|
+
getOptions: getOptions$8,
|
|
65324
65351
|
getBlockProperties: getBlockProperties$a,
|
|
65325
65352
|
convertTo: convertTo$e,
|
|
65326
65353
|
handleDeleteBlock: handleDeleteBlock$6
|
|
@@ -68297,7 +68324,7 @@ ${codeText}
|
|
|
68297
68324
|
abstract: `${i18n$1.t("image.abstract")}`
|
|
68298
68325
|
};
|
|
68299
68326
|
};
|
|
68300
|
-
function getOptions$
|
|
68327
|
+
function getOptions$7() {
|
|
68301
68328
|
return {
|
|
68302
68329
|
name: "Image",
|
|
68303
68330
|
insertEmbedCommandItems: [{
|
|
@@ -68397,7 +68424,7 @@ ${codeText}
|
|
|
68397
68424
|
convertTo: convertTo$d,
|
|
68398
68425
|
convertFrom: convertFrom$6,
|
|
68399
68426
|
getBlockProperties: getBlockProperties$9,
|
|
68400
|
-
getOptions: getOptions$
|
|
68427
|
+
getOptions: getOptions$7,
|
|
68401
68428
|
handleDrop: handleDrop$1,
|
|
68402
68429
|
handleDropOver: handleDropOver$1,
|
|
68403
68430
|
handleDeleteBlock: handleDeleteBlock$5
|
|
@@ -73214,7 +73241,7 @@ ${codeText}
|
|
|
73214
73241
|
}
|
|
73215
73242
|
return createEmptyTableDataByFirstRowText(editor, editor.getBlockString(srcBlock).trim());
|
|
73216
73243
|
}
|
|
73217
|
-
function getOptions$
|
|
73244
|
+
function getOptions$6(editor) {
|
|
73218
73245
|
return {
|
|
73219
73246
|
name: "TableBlock",
|
|
73220
73247
|
insertBlockCommandItems: [{
|
|
@@ -73291,7 +73318,7 @@ ${codeText}
|
|
|
73291
73318
|
adjustSelectionPos,
|
|
73292
73319
|
getClientRects,
|
|
73293
73320
|
selectionToDoc,
|
|
73294
|
-
getOptions: getOptions$
|
|
73321
|
+
getOptions: getOptions$6,
|
|
73295
73322
|
getTextToolbarReferenceClient: getTextToolbarReferenceClient$1,
|
|
73296
73323
|
handleUpdateBlock: handleUpdateBlock$5,
|
|
73297
73324
|
handleDeleteBlock: handleDeleteBlock$4,
|
|
@@ -73327,6 +73354,7 @@ ${codeText}
|
|
|
73327
73354
|
splitCell: "\u62C6\u5206\u5355\u5143\u683C",
|
|
73328
73355
|
tableConfigKey: "\u8868\u683C\u8BBE\u7F6E",
|
|
73329
73356
|
deleteTable: "\u5220\u9664\u8868\u683C",
|
|
73357
|
+
adjustColumnWidthsEvenly: "\u5E73\u5747\u5206\u914D\u5217\u5BBD",
|
|
73330
73358
|
insertCol: "\u63D2\u5165\u5217",
|
|
73331
73359
|
insertRow: "\u63D2\u5165\u884C",
|
|
73332
73360
|
deleteCol: "\u5220\u9664\u5217",
|
|
@@ -73358,6 +73386,7 @@ ${codeText}
|
|
|
73358
73386
|
splitCell: "Split cell",
|
|
73359
73387
|
tableConfigKey: "Table settings",
|
|
73360
73388
|
deleteTable: "Delete table",
|
|
73389
|
+
adjustColumnWidthsEvenly: "Adjust column widths evenly",
|
|
73361
73390
|
insertCol: "Insert column",
|
|
73362
73391
|
insertRow: "Insert row",
|
|
73363
73392
|
deleteCol: "Delete column",
|
|
@@ -73389,6 +73418,7 @@ ${codeText}
|
|
|
73389
73418
|
splitCell: "\u30BB\u30EB\u306E\u7D50\u5408\u3092\u89E3\u9664",
|
|
73390
73419
|
tableConfigKey: "\u30C6\u30FC\u30D6\u30EB\u8A2D\u5B9A",
|
|
73391
73420
|
deleteTable: "\u30C6\u30FC\u30D6\u30EB\u3092\u524A\u9664",
|
|
73421
|
+
adjustColumnWidthsEvenly: "\u5217\u5E45\u3092\u5747\u7B49\u306B\u8ABF\u6574",
|
|
73392
73422
|
insertCol: "\u5217\u3092\u633F\u5165",
|
|
73393
73423
|
insertRow: "\u884C\u3092\u633F\u5165",
|
|
73394
73424
|
deleteCol: "\u5217\u3092\u524A\u9664",
|
|
@@ -82047,24 +82077,45 @@ ${docStr}
|
|
|
82047
82077
|
};
|
|
82048
82078
|
return { blockData };
|
|
82049
82079
|
}
|
|
82080
|
+
function getOptions$5() {
|
|
82081
|
+
return {
|
|
82082
|
+
name: "toc",
|
|
82083
|
+
insertEmbedCommandItems: [{
|
|
82084
|
+
id: "insert-toc",
|
|
82085
|
+
name: i18n$1.t("toc.name"),
|
|
82086
|
+
icon: DividingLineIcon,
|
|
82087
|
+
order: 510,
|
|
82088
|
+
group: "common",
|
|
82089
|
+
subText: getShortcutById("insert-toc")
|
|
82090
|
+
}],
|
|
82091
|
+
handleInsertEmptyEmbed: async (editor, options) => {
|
|
82092
|
+
const { containerId, blockIndex } = options;
|
|
82093
|
+
return editor.insertEmbed(containerId, blockIndex, "toc", {});
|
|
82094
|
+
}
|
|
82095
|
+
};
|
|
82096
|
+
}
|
|
82050
82097
|
const TocEmbed = {
|
|
82051
82098
|
embedType: "toc",
|
|
82052
82099
|
createEmbedContent: createEmbedContent$6,
|
|
82053
82100
|
convertTo: convertTo$8,
|
|
82054
|
-
convertFrom: convertFrom$4
|
|
82101
|
+
convertFrom: convertFrom$4,
|
|
82102
|
+
getOptions: getOptions$5
|
|
82055
82103
|
};
|
|
82056
82104
|
const zhCN$c = {
|
|
82057
82105
|
toc: {
|
|
82106
|
+
name: "\u6807\u9898\u76EE\u5F55",
|
|
82058
82107
|
empty: "No Toc"
|
|
82059
82108
|
}
|
|
82060
82109
|
};
|
|
82061
82110
|
const enUS$c = {
|
|
82062
82111
|
toc: {
|
|
82112
|
+
name: "Toc",
|
|
82063
82113
|
empty: "No Toc"
|
|
82064
82114
|
}
|
|
82065
82115
|
};
|
|
82066
82116
|
const jaJP$c = {
|
|
82067
82117
|
toc: {
|
|
82118
|
+
name: "Toc",
|
|
82068
82119
|
empty: "No Toc"
|
|
82069
82120
|
}
|
|
82070
82121
|
};
|
|
@@ -84010,13 +84061,17 @@ ${docStr}
|
|
|
84010
84061
|
var _a;
|
|
84011
84062
|
const header = this.block.querySelector(".embed-graph-header");
|
|
84012
84063
|
assert(logger$l, header, "header does not exist");
|
|
84013
|
-
|
|
84014
|
-
|
|
84015
|
-
|
|
84016
|
-
|
|
84017
|
-
|
|
84018
|
-
|
|
84019
|
-
|
|
84064
|
+
try {
|
|
84065
|
+
const data2 = this.editor.getBlockData(this.block);
|
|
84066
|
+
const { flex = DEFAULT_FLEX, code, src, view } = this.getGraphData(data2);
|
|
84067
|
+
header.style.display = editor.readonly || clientType.isMobile ? "none" : "flex";
|
|
84068
|
+
const realView = this.getRealView(view);
|
|
84069
|
+
(_a = this.viewSelect) == null ? void 0 : _a.setSelectedView(realView);
|
|
84070
|
+
this.updateLayout(realView, flex);
|
|
84071
|
+
this.updateDraw(src, code);
|
|
84072
|
+
} catch (err) {
|
|
84073
|
+
logger$l.debug(`handleReadonlyChanged error: ${err}`);
|
|
84074
|
+
}
|
|
84020
84075
|
});
|
|
84021
84076
|
__publicField(this, "updateLayoutData", () => {
|
|
84022
84077
|
var _a;
|
|
@@ -92607,7 +92662,7 @@ ${data2.plantumlText}
|
|
|
92607
92662
|
}
|
|
92608
92663
|
}
|
|
92609
92664
|
});
|
|
92610
|
-
editor.version = "2.8.
|
|
92665
|
+
editor.version = "2.8.14-beta.1";
|
|
92611
92666
|
return editor;
|
|
92612
92667
|
}
|
|
92613
92668
|
function isDoc(doc2) {
|
|
@@ -92720,7 +92775,7 @@ ${data2.plantumlText}
|
|
|
92720
92775
|
}
|
|
92721
92776
|
});
|
|
92722
92777
|
OnesEditorToolbar.register(editor);
|
|
92723
|
-
editor.version = "2.8.
|
|
92778
|
+
editor.version = "2.8.14-beta.1";
|
|
92724
92779
|
return editor;
|
|
92725
92780
|
}
|
|
92726
92781
|
async function showDocVersions(editor, options, serverUrl) {
|
|
@@ -138497,6 +138552,7 @@ ${data2.plantumlText}
|
|
|
138497
138552
|
exports2.AddCommentToOldDocCommandProvider = AddCommentToOldDocCommandProvider;
|
|
138498
138553
|
exports2.AddEmojiIcon = AddEmojiIcon;
|
|
138499
138554
|
exports2.AddIcon = AddIcon;
|
|
138555
|
+
exports2.AdjustWidthIcon = AdjustWidthIcon;
|
|
138500
138556
|
exports2.AlertDialog = AlertDialog;
|
|
138501
138557
|
exports2.AlertEmojiIcon = alterEmoji;
|
|
138502
138558
|
exports2.AlignCenterIcon = AlignCenterIcon;
|