@ones-editor/editor 1.2.0-beta.10 → 1.2.0-beta.11
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/core/src/core/containers/root-container.d.ts +1 -1
- package/@ones-editor/core/src/core/selection/select-handler.d.ts +1 -1
- package/@ones-editor/core/src/core/types.d.ts +1 -1
- package/@ones-editor/table-block/src/commands/index.d.ts +2 -0
- package/@ones-editor/table-block/src/index.d.ts +4 -1
- package/@ones-editor/table-block/src/table-block/cell-menu/table-cell-dom.d.ts +6 -0
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/dist/index.js +386 -135
- package/dist/mobile/action.d.ts +1 -0
- package/dist/mobile/command.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2887,6 +2887,10 @@ div[data-command-bar-id=table-row-column-toolbar] .tippy-box .tippy-content butt
|
|
|
2887
2887
|
div[data-command-bar-id=table-cell-menu] .tippy-box .tippy-content .editor-command-bar.menu .command-item.selected[data-id=delete-select-row], div[data-command-bar-id=table-cell-menu] .tippy-box .tippy-content .editor-command-bar.menu .command-item.selected[data-id=delete-select-col] {
|
|
2888
2888
|
color: #eb3723;
|
|
2889
2889
|
background-color: #fff6f5;
|
|
2890
|
+
}
|
|
2891
|
+
.editor-root.mobile [data-type=editor-container].root div[data-type=editor-block].table-block div[data-type=block-tools] .table-border-bar-container .table-border-bar .button-root,
|
|
2892
|
+
.editor-root.mobile [data-type=editor-container].root div[data-type=editor-block].table-block div[data-type=table-tools] .table-border-bar-container .table-border-bar .button-root {
|
|
2893
|
+
display: none;
|
|
2890
2894
|
}.editor-root [data-type=editor-container].root div[data-type=editor-block].code-block {
|
|
2891
2895
|
counter-reset: code-line;
|
|
2892
2896
|
}
|
|
@@ -6107,6 +6111,8 @@ div.editor-root div.editor-content div[data-type=editor-container] div[data-embe
|
|
|
6107
6111
|
}
|
|
6108
6112
|
.command-m-bar .child-layout.card {
|
|
6109
6113
|
flex-wrap: wrap;
|
|
6114
|
+
gap: 15px;
|
|
6115
|
+
justify-content: flex-start;
|
|
6110
6116
|
}
|
|
6111
6117
|
.command-m-bar .child-layout.card .child-item {
|
|
6112
6118
|
width: 80px;
|
|
@@ -10024,6 +10030,8 @@ var __publicField = (obj, key, value) => {
|
|
|
10024
10030
|
if (!clientType.isMobile) {
|
|
10025
10031
|
document.addEventListener("mousemove", this.handleMouseMove);
|
|
10026
10032
|
document.addEventListener("mouseup", this.handleMouseUp);
|
|
10033
|
+
} else {
|
|
10034
|
+
document.addEventListener("touchend", this.handleMouseUp);
|
|
10027
10035
|
}
|
|
10028
10036
|
this.editor.selectionHandler.handleMouseDown(event, { autoScroll: true });
|
|
10029
10037
|
}
|
|
@@ -10041,7 +10049,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10041
10049
|
}
|
|
10042
10050
|
});
|
|
10043
10051
|
__publicField(this, "handleMouseUp", (event) => {
|
|
10044
|
-
if (event.button === 0) {
|
|
10052
|
+
if (ensureIsMobileEvent(event) || event.button === 0) {
|
|
10045
10053
|
this.editor.selectionHandler.handleMouseUp(event);
|
|
10046
10054
|
document.removeEventListener("mousemove", this.handleMouseMove);
|
|
10047
10055
|
document.removeEventListener("mouseup", this.handleMouseUp);
|
|
@@ -41123,6 +41131,26 @@ ${codeText}
|
|
|
41123
41131
|
blockType: getBlockType(block)
|
|
41124
41132
|
};
|
|
41125
41133
|
const commands = [];
|
|
41134
|
+
const { selectedColumns, selectedRows } = getTableSelectedRowsAndColumns(editor, block);
|
|
41135
|
+
if (clientType.isMobile) {
|
|
41136
|
+
if (selectedColumns.size > 0) {
|
|
41137
|
+
commands.push({
|
|
41138
|
+
id: "table/delete-columns",
|
|
41139
|
+
name: i18n$1.t("table.deleteSelectCol"),
|
|
41140
|
+
icon: DeleteColIcon,
|
|
41141
|
+
groupIndex: TABLE_COMMAND_GROUP_INDEX,
|
|
41142
|
+
...ext
|
|
41143
|
+
});
|
|
41144
|
+
} else if (selectedRows.size > 0) {
|
|
41145
|
+
commands.push({
|
|
41146
|
+
id: "table/delete-rows",
|
|
41147
|
+
name: i18n$1.t("table.deleteSelectRow"),
|
|
41148
|
+
icon: DeleteRowIcon,
|
|
41149
|
+
groupIndex: TABLE_COMMAND_GROUP_INDEX,
|
|
41150
|
+
...ext
|
|
41151
|
+
});
|
|
41152
|
+
}
|
|
41153
|
+
}
|
|
41126
41154
|
if (canMergeCells(editor, block, range)) {
|
|
41127
41155
|
commands.push({
|
|
41128
41156
|
id: "table/merge-cells",
|
|
@@ -41490,7 +41518,96 @@ ${codeText}
|
|
|
41490
41518
|
};
|
|
41491
41519
|
editor.updateBlockData(tableBlock, newBlockData);
|
|
41492
41520
|
}
|
|
41493
|
-
const
|
|
41521
|
+
const DEFAULT_COLUMN_WIDTH = 200;
|
|
41522
|
+
const MIN_COLUMN_WIDTH = 40;
|
|
41523
|
+
const logger$1Y = getLogger("table-insert-column");
|
|
41524
|
+
function insertColumn(editor, tableBlock, insertIndex) {
|
|
41525
|
+
editor.undoManager.runInGroup(() => {
|
|
41526
|
+
var _a;
|
|
41527
|
+
const table = getBlockTable(tableBlock);
|
|
41528
|
+
const grid = TableGrid.fromTable(table);
|
|
41529
|
+
const colCount = grid.colCount;
|
|
41530
|
+
assert(logger$1Y, insertIndex >= 0 && insertIndex <= colCount, `insert index ${insertIndex} is out of range [0, ${colCount}]`);
|
|
41531
|
+
const cells = grid.map((cell) => cell.containerId);
|
|
41532
|
+
const spannedContainerIds = /* @__PURE__ */ new Set();
|
|
41533
|
+
editor.doc.beginBatchUpdate();
|
|
41534
|
+
for (let row = 0; row < cells.length; row++) {
|
|
41535
|
+
const rowData = cells[row];
|
|
41536
|
+
const left = rowData[insertIndex - 1];
|
|
41537
|
+
const right = rowData[insertIndex];
|
|
41538
|
+
if (insertIndex === 0 || insertIndex === rowData.length || left !== right) {
|
|
41539
|
+
const newContainerId = createEmptyContainer(editor.doc);
|
|
41540
|
+
rowData.splice(insertIndex, 0, newContainerId);
|
|
41541
|
+
} else {
|
|
41542
|
+
rowData.splice(insertIndex, 0, left);
|
|
41543
|
+
spannedContainerIds.add(left);
|
|
41544
|
+
}
|
|
41545
|
+
}
|
|
41546
|
+
editor.doc.endBatchUpdate();
|
|
41547
|
+
const oldBlockData = cloneDeep__default.default(editor.getBlockData(tableBlock));
|
|
41548
|
+
spannedContainerIds.forEach((containerId) => {
|
|
41549
|
+
const key = `${containerId}_colSpan`;
|
|
41550
|
+
const oldSpan = oldBlockData[key];
|
|
41551
|
+
assert(logger$1Y, typeof oldSpan === "number" && oldSpan > 1, `no colSpan for containerId ${containerId}, ${oldSpan}`);
|
|
41552
|
+
oldBlockData[key] = oldSpan + 1;
|
|
41553
|
+
});
|
|
41554
|
+
const colsWidth = ((_a = oldBlockData.colsWidth) == null ? void 0 : _a.concat()) || new Array(oldBlockData.cols).fill(0);
|
|
41555
|
+
colsWidth.splice(insertIndex, 0, DEFAULT_COLUMN_WIDTH);
|
|
41556
|
+
const newChildren = TableGrid.virtualCellContainersGridToChildren(cells);
|
|
41557
|
+
const newBlockData = {
|
|
41558
|
+
...oldBlockData,
|
|
41559
|
+
cols: oldBlockData.cols + 1,
|
|
41560
|
+
children: newChildren,
|
|
41561
|
+
colsWidth
|
|
41562
|
+
};
|
|
41563
|
+
tableData2Grid(newBlockData);
|
|
41564
|
+
editor.updateBlockData(tableBlock, newBlockData);
|
|
41565
|
+
});
|
|
41566
|
+
}
|
|
41567
|
+
const logger$1X = getLogger("table-insert-row");
|
|
41568
|
+
function insertRow(editor, tableBlock, insertIndex) {
|
|
41569
|
+
editor.undoManager.runInGroup(() => {
|
|
41570
|
+
const table = getBlockTable(tableBlock);
|
|
41571
|
+
const grid = TableGrid.fromTable(table);
|
|
41572
|
+
const rowCount = grid.rowCount;
|
|
41573
|
+
assert(logger$1X, insertIndex >= 0 && insertIndex <= rowCount, `insert index ${insertIndex} is out of range [0, ${rowCount}]`);
|
|
41574
|
+
const cells = grid.map((cell) => cell.containerId);
|
|
41575
|
+
const spannedContainerIds = /* @__PURE__ */ new Set();
|
|
41576
|
+
editor.doc.beginBatchUpdate();
|
|
41577
|
+
const rowData = [];
|
|
41578
|
+
for (let col = 0; col < grid.colCount; col++) {
|
|
41579
|
+
const top = insertIndex > 0 && cells[insertIndex - 1][col];
|
|
41580
|
+
const bottom = insertIndex < grid.rowCount && cells[insertIndex][col];
|
|
41581
|
+
assert(logger$1X, top || bottom, "no top and bottom cell");
|
|
41582
|
+
if (insertIndex === 0 || insertIndex === grid.rowCount || top !== bottom) {
|
|
41583
|
+
const newContainerId = createEmptyContainer(editor.doc);
|
|
41584
|
+
rowData.push(newContainerId);
|
|
41585
|
+
} else {
|
|
41586
|
+
assert(logger$1X, top, "no top cell");
|
|
41587
|
+
rowData.push(top);
|
|
41588
|
+
spannedContainerIds.add(top);
|
|
41589
|
+
}
|
|
41590
|
+
}
|
|
41591
|
+
editor.doc.endBatchUpdate();
|
|
41592
|
+
cells.splice(insertIndex, 0, rowData);
|
|
41593
|
+
const oldBlockData = cloneDeep__default.default(editor.getBlockData(tableBlock));
|
|
41594
|
+
spannedContainerIds.forEach((containerId) => {
|
|
41595
|
+
const key = `${containerId}_rowSpan`;
|
|
41596
|
+
const oldSpan = oldBlockData[key];
|
|
41597
|
+
assert(logger$1X, typeof oldSpan === "number" && oldSpan > 1, `no rowSpan for containerId ${containerId}, ${oldSpan}`);
|
|
41598
|
+
oldBlockData[key] = oldSpan + 1;
|
|
41599
|
+
});
|
|
41600
|
+
const newChildren = TableGrid.virtualCellContainersGridToChildren(cells);
|
|
41601
|
+
const newBlockData = {
|
|
41602
|
+
...oldBlockData,
|
|
41603
|
+
rows: oldBlockData.rows + 1,
|
|
41604
|
+
children: newChildren
|
|
41605
|
+
};
|
|
41606
|
+
tableData2Grid(newBlockData);
|
|
41607
|
+
editor.updateBlockData(tableBlock, newBlockData);
|
|
41608
|
+
});
|
|
41609
|
+
}
|
|
41610
|
+
const logger$1W = getLogger("table-chart");
|
|
41494
41611
|
function removeChart(editor, block) {
|
|
41495
41612
|
const tableTools = findExistsTableTools(editor, block);
|
|
41496
41613
|
if (tableTools) {
|
|
@@ -41575,7 +41692,7 @@ ${codeText}
|
|
|
41575
41692
|
chartContainer = createElement("div", ["editor-table-chart"], tableTools);
|
|
41576
41693
|
}
|
|
41577
41694
|
const parent = chartContainer;
|
|
41578
|
-
assert(logger$
|
|
41695
|
+
assert(logger$1W, parent, "no chart container");
|
|
41579
41696
|
const options = editor.getComponentOptions("table");
|
|
41580
41697
|
const cdn = (options == null ? void 0 : options.chartCdn) || "https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js";
|
|
41581
41698
|
try {
|
|
@@ -41619,7 +41736,7 @@ ${codeText}
|
|
|
41619
41736
|
chartContainer.chartObject = chartObject;
|
|
41620
41737
|
}
|
|
41621
41738
|
} catch (err) {
|
|
41622
|
-
logger$
|
|
41739
|
+
logger$1W.error(`failed to resolve chart cdn: ${JSON.stringify(err)}`);
|
|
41623
41740
|
}
|
|
41624
41741
|
}
|
|
41625
41742
|
async function updateChartCore(editor, block) {
|
|
@@ -41776,7 +41893,7 @@ ${codeText}
|
|
|
41776
41893
|
const height = document.documentElement.clientHeight;
|
|
41777
41894
|
return new DOMRect(left, top, width, height);
|
|
41778
41895
|
}
|
|
41779
|
-
const logger$
|
|
41896
|
+
const logger$1V = getLogger("scroll-bar-handle");
|
|
41780
41897
|
const BOTTOM_FLOAT_HEIGHT = 2;
|
|
41781
41898
|
function getScrollbarContainer(scrollContainer) {
|
|
41782
41899
|
const tools = getTools(scrollContainer);
|
|
@@ -41784,7 +41901,7 @@ ${codeText}
|
|
|
41784
41901
|
if (!scrollbarContainer) {
|
|
41785
41902
|
scrollbarContainer = createElement("div", [SCROLL_BAR_CLASS.SCROLL_BAR], tools);
|
|
41786
41903
|
}
|
|
41787
|
-
assert(logger$
|
|
41904
|
+
assert(logger$1V, scrollbarContainer instanceof HTMLDivElement, "invalid child for container tools");
|
|
41788
41905
|
if (!scrollbarContainer.firstElementChild) {
|
|
41789
41906
|
createElement("div", [], scrollbarContainer);
|
|
41790
41907
|
}
|
|
@@ -41800,7 +41917,7 @@ ${codeText}
|
|
|
41800
41917
|
fixScrollWrapRightBoundary(scrollCore, scrollContainer);
|
|
41801
41918
|
fixScrollWrapLeftBoundary(scrollCore, scrollContainer);
|
|
41802
41919
|
const overflowWidth = scrollWidth - clientWidth;
|
|
41803
|
-
assert(logger$
|
|
41920
|
+
assert(logger$1V, scrollbarContainer.firstElementChild instanceof HTMLDivElement, "invalid child for scroll bar");
|
|
41804
41921
|
scrollbarContainer.style.width = `${getSizeAsScale(scrollContainer, originWidth + maxRight - paddingLeft - paddingRight)}px`;
|
|
41805
41922
|
scrollbarContainer.firstElementChild.style.width = `${getSizeAsScale(scrollContainer, originWidth + maxRight + overflowWidth - paddingLeft - paddingRight)}px`;
|
|
41806
41923
|
}
|
|
@@ -41887,7 +42004,7 @@ ${codeText}
|
|
|
41887
42004
|
this.intersectionObserver.disconnect();
|
|
41888
42005
|
}
|
|
41889
42006
|
}
|
|
41890
|
-
const logger$
|
|
42007
|
+
const logger$1U = getLogger("container-scroll-shadow");
|
|
41891
42008
|
function setShadowBottom(shadow, scrollContainer, scrollWrap) {
|
|
41892
42009
|
const elem = shadow;
|
|
41893
42010
|
const contentRect = scrollContainer.getBoundingClientRect();
|
|
@@ -41906,22 +42023,22 @@ ${codeText}
|
|
|
41906
42023
|
}
|
|
41907
42024
|
function showLeftShadow(scrollContainer) {
|
|
41908
42025
|
const targetTools = getTools(scrollContainer);
|
|
41909
|
-
assert(logger$
|
|
42026
|
+
assert(logger$1U, targetTools, "no container tools");
|
|
41910
42027
|
let shadow = targetTools.querySelector(`.${SHADOW_CLASS.LEFT}`);
|
|
41911
42028
|
if (!shadow) {
|
|
41912
42029
|
const scrollWrap = getContainerScrollArea(scrollContainer);
|
|
41913
42030
|
const classes = [SHADOW_CLASS.COMMON, SHADOW_CLASS.LEFT];
|
|
41914
42031
|
shadow = createElement("div", classes, targetTools);
|
|
41915
|
-
assert(logger$
|
|
42032
|
+
assert(logger$1U, shadow instanceof HTMLDivElement, "invalid child for container tools");
|
|
41916
42033
|
setShadowBottom(shadow, scrollContainer, scrollWrap);
|
|
41917
42034
|
}
|
|
41918
|
-
assert(logger$
|
|
42035
|
+
assert(logger$1U, shadow instanceof HTMLElement, "invalid child for container tools");
|
|
41919
42036
|
const container = getContainer(scrollContainer);
|
|
41920
42037
|
const containerRect = container.getBoundingClientRect();
|
|
41921
42038
|
const scrollContainerRect = scrollContainer.getBoundingClientRect();
|
|
41922
42039
|
shadow.style.left = `${getSizeAsScale(scrollContainer, scrollContainerRect.left - containerRect.left)}px`;
|
|
41923
42040
|
const leftRest = getElementScrollSize(scrollContainer).scrollLeft;
|
|
41924
|
-
assert(logger$
|
|
42041
|
+
assert(logger$1U, shadow instanceof HTMLDivElement, "invalid child for container tools");
|
|
41925
42042
|
setShadowWidth(shadow, leftRest);
|
|
41926
42043
|
addClass(shadow, SHADOW_CLASS.ACTIVE);
|
|
41927
42044
|
}
|
|
@@ -41932,17 +42049,17 @@ ${codeText}
|
|
|
41932
42049
|
const scrollWrap = getContainerScrollArea(scrollContainer);
|
|
41933
42050
|
const classes = [SHADOW_CLASS.COMMON, SHADOW_CLASS.RIGHT];
|
|
41934
42051
|
shadow = createElement("div", classes, tools);
|
|
41935
|
-
assert(logger$
|
|
42052
|
+
assert(logger$1U, shadow instanceof HTMLDivElement, "no div, create shadow failed");
|
|
41936
42053
|
setShadowBottom(shadow, scrollContainer, scrollWrap);
|
|
41937
42054
|
}
|
|
41938
|
-
assert(logger$
|
|
42055
|
+
assert(logger$1U, shadow instanceof HTMLElement, "");
|
|
41939
42056
|
const container = getContainer(scrollContainer);
|
|
41940
42057
|
const containerRect = container.getBoundingClientRect();
|
|
41941
42058
|
const scrollContainerRect = scrollContainer.getBoundingClientRect();
|
|
41942
42059
|
shadow.style.right = `${getSizeAsScale(scrollContainer, containerRect.right - scrollContainerRect.right)}px`;
|
|
41943
42060
|
const { scrollWidth, scrollLeft, clientWidth } = getElementScrollSize(scrollContainer);
|
|
41944
42061
|
const rightRest = scrollWidth - scrollLeft - clientWidth;
|
|
41945
|
-
assert(logger$
|
|
42062
|
+
assert(logger$1U, shadow instanceof HTMLDivElement, "no shadow element");
|
|
41946
42063
|
setShadowWidth(shadow, rightRest);
|
|
41947
42064
|
addClass(shadow, SHADOW_CLASS.ACTIVE);
|
|
41948
42065
|
}
|
|
@@ -42015,12 +42132,12 @@ ${codeText}
|
|
|
42015
42132
|
this.resizeObserver.disconnect();
|
|
42016
42133
|
}
|
|
42017
42134
|
}
|
|
42018
|
-
const logger$
|
|
42135
|
+
const logger$1T = getLogger("container-scroll-observer");
|
|
42019
42136
|
class ContainerScrollObserver {
|
|
42020
42137
|
constructor(scrollCore, callback) {
|
|
42021
42138
|
__publicField(this, "handleContentScroll", (e2) => {
|
|
42022
42139
|
const scrollContainer = e2.target;
|
|
42023
|
-
assert(logger$
|
|
42140
|
+
assert(logger$1T, scrollContainer instanceof Element, "invalid target for scroll event");
|
|
42024
42141
|
const scrollbarContainer = getScrollbarContainer(scrollContainer);
|
|
42025
42142
|
scrollbarContainer.removeEventListener("scroll", this.handleScroll);
|
|
42026
42143
|
const needFixScrollbarContainer = true;
|
|
@@ -42031,7 +42148,7 @@ ${codeText}
|
|
|
42031
42148
|
});
|
|
42032
42149
|
__publicField(this, "handleScroll", (e2) => {
|
|
42033
42150
|
const scrollbarContainer = e2.target;
|
|
42034
|
-
assert(logger$
|
|
42151
|
+
assert(logger$1T, scrollbarContainer instanceof HTMLElement, "");
|
|
42035
42152
|
const scrollLeft = scrollbarContainer.scrollLeft;
|
|
42036
42153
|
const needFixScrollbarContainer = false;
|
|
42037
42154
|
const scrollContainer = getScrollContainerByScrollBar(scrollbarContainer);
|
|
@@ -42111,7 +42228,7 @@ ${codeText}
|
|
|
42111
42228
|
this.scrollContainers.clear();
|
|
42112
42229
|
}
|
|
42113
42230
|
}
|
|
42114
|
-
const logger$
|
|
42231
|
+
const logger$1S = getLogger("scroll-wrap-resize-observer");
|
|
42115
42232
|
class ScrollWrapResizeObserve {
|
|
42116
42233
|
constructor(scrollCore) {
|
|
42117
42234
|
__publicField(this, "resizeObserver");
|
|
@@ -42127,7 +42244,7 @@ ${codeText}
|
|
|
42127
42244
|
});
|
|
42128
42245
|
__publicField(this, "handleScrollWrapResizeEntry", (entry) => {
|
|
42129
42246
|
const scrollWrap = entry.target;
|
|
42130
|
-
assert(logger$
|
|
42247
|
+
assert(logger$1S, scrollWrap instanceof HTMLElement, "invalid target for observer entry");
|
|
42131
42248
|
const scrollContainer = getScrollContainer(scrollWrap);
|
|
42132
42249
|
resetScrollbar(this.scrollCore, scrollWrap);
|
|
42133
42250
|
resetScrollWrapShadow(scrollContainer);
|
|
@@ -42332,7 +42449,7 @@ ${codeText}
|
|
|
42332
42449
|
window.removeEventListener("scroll", this.handleWindowEffect);
|
|
42333
42450
|
}
|
|
42334
42451
|
}
|
|
42335
|
-
const logger$
|
|
42452
|
+
const logger$1R = getLogger("scroll-container");
|
|
42336
42453
|
const rootScrollMap = /* @__PURE__ */ new Map();
|
|
42337
42454
|
class ScrollContainer extends tinyTypedEmitter.TypedEmitter {
|
|
42338
42455
|
constructor() {
|
|
@@ -42380,11 +42497,11 @@ ${codeText}
|
|
|
42380
42497
|
return this.scrollContainerElement;
|
|
42381
42498
|
}
|
|
42382
42499
|
get contentElement() {
|
|
42383
|
-
assert(logger$
|
|
42500
|
+
assert(logger$1R, this.scrollContainerElement, "scrollContainerElement cannot be undefined");
|
|
42384
42501
|
return getContainerScrollArea(this.scrollContainerElement);
|
|
42385
42502
|
}
|
|
42386
42503
|
get scrollOptions() {
|
|
42387
|
-
assert(logger$
|
|
42504
|
+
assert(logger$1R, this.options, "options cannot be undefined");
|
|
42388
42505
|
return { ...this.options };
|
|
42389
42506
|
}
|
|
42390
42507
|
handleBaseListenerDestroy(baseListener) {
|
|
@@ -42408,7 +42525,7 @@ ${codeText}
|
|
|
42408
42525
|
function createScrollContainer() {
|
|
42409
42526
|
return new ScrollContainer();
|
|
42410
42527
|
}
|
|
42411
|
-
const logger$
|
|
42528
|
+
const logger$1Q = getLogger("column-width");
|
|
42412
42529
|
function setColumnWidth(table, colIndex, width) {
|
|
42413
42530
|
const col = getTableCol(table, colIndex);
|
|
42414
42531
|
col.style.width = `${width}px`;
|
|
@@ -42429,7 +42546,7 @@ ${codeText}
|
|
|
42429
42546
|
cellRightOffsets[colIndex] = cell.cell.getBoundingClientRect().right - left;
|
|
42430
42547
|
}
|
|
42431
42548
|
});
|
|
42432
|
-
logger$
|
|
42549
|
+
logger$1Q.debug(`cellRightOffsets1: ${cellRightOffsets.join()}`);
|
|
42433
42550
|
for (let col = 0; col < cellRightOffsets.length; col++) {
|
|
42434
42551
|
const offset = cellRightOffsets[col];
|
|
42435
42552
|
if (offset === -1 || col === 0) {
|
|
@@ -42449,7 +42566,7 @@ ${codeText}
|
|
|
42449
42566
|
cellRightOffsets[i] = prevOffset + averageWidth * (i - prevCol);
|
|
42450
42567
|
}
|
|
42451
42568
|
}
|
|
42452
|
-
logger$
|
|
42569
|
+
logger$1Q.debug(`cellRightOffsets2: ${cellRightOffsets.join()}`);
|
|
42453
42570
|
const result = [];
|
|
42454
42571
|
let prev = 0;
|
|
42455
42572
|
for (let col = 0; col < cellRightOffsets.length; col++) {
|
|
@@ -42457,7 +42574,7 @@ ${codeText}
|
|
|
42457
42574
|
result.push(offset - prev);
|
|
42458
42575
|
prev = offset;
|
|
42459
42576
|
}
|
|
42460
|
-
logger$
|
|
42577
|
+
logger$1Q.debug(`widths: ${result.join()}`);
|
|
42461
42578
|
return result;
|
|
42462
42579
|
}
|
|
42463
42580
|
function getTableColumnWidths(table) {
|
|
@@ -42465,9 +42582,7 @@ ${codeText}
|
|
|
42465
42582
|
const widths = tableCols.map((col) => col.getBoundingClientRect().width || Number.parseInt(col.style.width, 10));
|
|
42466
42583
|
return widths;
|
|
42467
42584
|
}
|
|
42468
|
-
const
|
|
42469
|
-
const MIN_COLUMN_WIDTH = 40;
|
|
42470
|
-
const logger$1R = getLogger("table-resize-gripper");
|
|
42585
|
+
const logger$1P = getLogger("table-resize-gripper");
|
|
42471
42586
|
const GRIPPER_SIZE = 7;
|
|
42472
42587
|
const GRIPPER_SIZE_HALF = (GRIPPER_SIZE - 1) / 2;
|
|
42473
42588
|
const CONTAINER_CELL_DELTA = 3;
|
|
@@ -42497,7 +42612,7 @@ ${codeText}
|
|
|
42497
42612
|
}
|
|
42498
42613
|
function createResizeGripper$1(editor, block) {
|
|
42499
42614
|
const exists = getExistsResizeGripper(editor, block);
|
|
42500
|
-
assert(logger$
|
|
42615
|
+
assert(logger$1P, !exists, "resize gripper has already exists");
|
|
42501
42616
|
const tools = getTableTools(editor, block);
|
|
42502
42617
|
const gripper = createElement("div", ["table-resize-gripper", "table-indicator"], tools);
|
|
42503
42618
|
createElement("div", ["table-resize-gripper-indicator"], gripper);
|
|
@@ -42568,7 +42683,7 @@ ${codeText}
|
|
|
42568
42683
|
}
|
|
42569
42684
|
return minX;
|
|
42570
42685
|
}
|
|
42571
|
-
const logger$
|
|
42686
|
+
const logger$1O = getLogger("table-resize-drag-drop");
|
|
42572
42687
|
class TableResizeDragDrop {
|
|
42573
42688
|
constructor(editor, elem, data, onEnd) {
|
|
42574
42689
|
__publicField(this, "cursor", "col-resize");
|
|
@@ -42583,7 +42698,7 @@ ${codeText}
|
|
|
42583
42698
|
const { table, block, draggingRefCell } = drag.data;
|
|
42584
42699
|
const x = getTableResizeMinX(this.editor, draggingRefCell, table, DragDrop.getEventPosition(event).x - drag.dragOffsetX);
|
|
42585
42700
|
const totalWidth = x - table.getBoundingClientRect().left;
|
|
42586
|
-
assert(logger$
|
|
42701
|
+
assert(logger$1O, draggingRefCell, "no dragging cell");
|
|
42587
42702
|
const grid = TableGrid.fromTable(table);
|
|
42588
42703
|
const cellData = grid.getCellByCellElement(draggingRefCell);
|
|
42589
42704
|
const colIndex = cellData.col + cellData.colSpan - 1;
|
|
@@ -42696,93 +42811,6 @@ ${codeText}
|
|
|
42696
42811
|
function handleTableResizeMouseEvent(editor) {
|
|
42697
42812
|
editor.addCustom("table-mouse-event-handler", (editor2) => new TableMouseEventHandler(editor2));
|
|
42698
42813
|
}
|
|
42699
|
-
const logger$1P = getLogger("table-insert-column");
|
|
42700
|
-
function insertColumn(editor, tableBlock, insertIndex) {
|
|
42701
|
-
editor.undoManager.runInGroup(() => {
|
|
42702
|
-
var _a;
|
|
42703
|
-
const table = getBlockTable(tableBlock);
|
|
42704
|
-
const grid = TableGrid.fromTable(table);
|
|
42705
|
-
const colCount = grid.colCount;
|
|
42706
|
-
assert(logger$1P, insertIndex >= 0 && insertIndex <= colCount, `insert index ${insertIndex} is out of range [0, ${colCount}]`);
|
|
42707
|
-
const cells = grid.map((cell) => cell.containerId);
|
|
42708
|
-
const spannedContainerIds = /* @__PURE__ */ new Set();
|
|
42709
|
-
editor.doc.beginBatchUpdate();
|
|
42710
|
-
for (let row = 0; row < cells.length; row++) {
|
|
42711
|
-
const rowData = cells[row];
|
|
42712
|
-
const left = rowData[insertIndex - 1];
|
|
42713
|
-
const right = rowData[insertIndex];
|
|
42714
|
-
if (insertIndex === 0 || insertIndex === rowData.length || left !== right) {
|
|
42715
|
-
const newContainerId = createEmptyContainer(editor.doc);
|
|
42716
|
-
rowData.splice(insertIndex, 0, newContainerId);
|
|
42717
|
-
} else {
|
|
42718
|
-
rowData.splice(insertIndex, 0, left);
|
|
42719
|
-
spannedContainerIds.add(left);
|
|
42720
|
-
}
|
|
42721
|
-
}
|
|
42722
|
-
editor.doc.endBatchUpdate();
|
|
42723
|
-
const oldBlockData = cloneDeep__default.default(editor.getBlockData(tableBlock));
|
|
42724
|
-
spannedContainerIds.forEach((containerId) => {
|
|
42725
|
-
const key = `${containerId}_colSpan`;
|
|
42726
|
-
const oldSpan = oldBlockData[key];
|
|
42727
|
-
assert(logger$1P, typeof oldSpan === "number" && oldSpan > 1, `no colSpan for containerId ${containerId}, ${oldSpan}`);
|
|
42728
|
-
oldBlockData[key] = oldSpan + 1;
|
|
42729
|
-
});
|
|
42730
|
-
const colsWidth = ((_a = oldBlockData.colsWidth) == null ? void 0 : _a.concat()) || new Array(oldBlockData.cols).fill(0);
|
|
42731
|
-
colsWidth.splice(insertIndex, 0, DEFAULT_COLUMN_WIDTH);
|
|
42732
|
-
const newChildren = TableGrid.virtualCellContainersGridToChildren(cells);
|
|
42733
|
-
const newBlockData = {
|
|
42734
|
-
...oldBlockData,
|
|
42735
|
-
cols: oldBlockData.cols + 1,
|
|
42736
|
-
children: newChildren,
|
|
42737
|
-
colsWidth
|
|
42738
|
-
};
|
|
42739
|
-
tableData2Grid(newBlockData);
|
|
42740
|
-
editor.updateBlockData(tableBlock, newBlockData);
|
|
42741
|
-
});
|
|
42742
|
-
}
|
|
42743
|
-
const logger$1O = getLogger("table-insert-row");
|
|
42744
|
-
function insertRow(editor, tableBlock, insertIndex) {
|
|
42745
|
-
editor.undoManager.runInGroup(() => {
|
|
42746
|
-
const table = getBlockTable(tableBlock);
|
|
42747
|
-
const grid = TableGrid.fromTable(table);
|
|
42748
|
-
const rowCount = grid.rowCount;
|
|
42749
|
-
assert(logger$1O, insertIndex >= 0 && insertIndex <= rowCount, `insert index ${insertIndex} is out of range [0, ${rowCount}]`);
|
|
42750
|
-
const cells = grid.map((cell) => cell.containerId);
|
|
42751
|
-
const spannedContainerIds = /* @__PURE__ */ new Set();
|
|
42752
|
-
editor.doc.beginBatchUpdate();
|
|
42753
|
-
const rowData = [];
|
|
42754
|
-
for (let col = 0; col < grid.colCount; col++) {
|
|
42755
|
-
const top = insertIndex > 0 && cells[insertIndex - 1][col];
|
|
42756
|
-
const bottom = insertIndex < grid.rowCount && cells[insertIndex][col];
|
|
42757
|
-
assert(logger$1O, top || bottom, "no top and bottom cell");
|
|
42758
|
-
if (insertIndex === 0 || insertIndex === grid.rowCount || top !== bottom) {
|
|
42759
|
-
const newContainerId = createEmptyContainer(editor.doc);
|
|
42760
|
-
rowData.push(newContainerId);
|
|
42761
|
-
} else {
|
|
42762
|
-
assert(logger$1O, top, "no top cell");
|
|
42763
|
-
rowData.push(top);
|
|
42764
|
-
spannedContainerIds.add(top);
|
|
42765
|
-
}
|
|
42766
|
-
}
|
|
42767
|
-
editor.doc.endBatchUpdate();
|
|
42768
|
-
cells.splice(insertIndex, 0, rowData);
|
|
42769
|
-
const oldBlockData = cloneDeep__default.default(editor.getBlockData(tableBlock));
|
|
42770
|
-
spannedContainerIds.forEach((containerId) => {
|
|
42771
|
-
const key = `${containerId}_rowSpan`;
|
|
42772
|
-
const oldSpan = oldBlockData[key];
|
|
42773
|
-
assert(logger$1O, typeof oldSpan === "number" && oldSpan > 1, `no rowSpan for containerId ${containerId}, ${oldSpan}`);
|
|
42774
|
-
oldBlockData[key] = oldSpan + 1;
|
|
42775
|
-
});
|
|
42776
|
-
const newChildren = TableGrid.virtualCellContainersGridToChildren(cells);
|
|
42777
|
-
const newBlockData = {
|
|
42778
|
-
...oldBlockData,
|
|
42779
|
-
rows: oldBlockData.rows + 1,
|
|
42780
|
-
children: newChildren
|
|
42781
|
-
};
|
|
42782
|
-
tableData2Grid(newBlockData);
|
|
42783
|
-
editor.updateBlockData(tableBlock, newBlockData);
|
|
42784
|
-
});
|
|
42785
|
-
}
|
|
42786
42814
|
const logger$1N = getLogger("paste-table-in-table-block");
|
|
42787
42815
|
function pasteTableInTableBlock(editor, doc2, tableBlock, destCell, cloneDocResult) {
|
|
42788
42816
|
let grid = TableGrid.fromBlock(tableBlock);
|
|
@@ -53947,7 +53975,7 @@ $$${mathData.mathjaxText}$$
|
|
|
53947
53975
|
this.resizeObserver = new index$d(this.handleTableResize);
|
|
53948
53976
|
this.resizeObserver.observe(getBlockTable(this.tableBlock));
|
|
53949
53977
|
const options = editor.getComponentOptions("table");
|
|
53950
|
-
if (!(options == null ? void 0 : options.hideToolbar)) {
|
|
53978
|
+
if (!(options == null ? void 0 : options.hideToolbar) && !clientType.isMobile) {
|
|
53951
53979
|
this.toolbar = new TableRowColumnToolbar(this.editor, this.tableBlock);
|
|
53952
53980
|
}
|
|
53953
53981
|
this.editor.addListener("readonlyChanged", this.handleReadonlyChanged);
|
|
@@ -54799,7 +54827,7 @@ $$${mathData.mathjaxText}$$
|
|
|
54799
54827
|
handlePasteInTableEvent$1(editor);
|
|
54800
54828
|
handleTableBorderBar(editor, "create");
|
|
54801
54829
|
handleTableDocChanged(editor);
|
|
54802
|
-
if (!(options == null ? void 0 : options.hideCellMenu)) {
|
|
54830
|
+
if (!(options == null ? void 0 : options.hideCellMenu) && !clientType.isMobile) {
|
|
54803
54831
|
handleTableCellMenu(editor);
|
|
54804
54832
|
}
|
|
54805
54833
|
trackChildBlockEvent(editor, handleChartDebounceUpdate);
|
|
@@ -54849,7 +54877,7 @@ $$${mathData.mathjaxText}$$
|
|
|
54849
54877
|
handlePasteInTableEvent$1(editor);
|
|
54850
54878
|
handleTableBorderBar(editor, "update");
|
|
54851
54879
|
handleTableDocChanged(editor);
|
|
54852
|
-
if (!(options == null ? void 0 : options.hideCellMenu)) {
|
|
54880
|
+
if (!(options == null ? void 0 : options.hideCellMenu) && !clientType.isMobile) {
|
|
54853
54881
|
handleTableCellMenu(editor);
|
|
54854
54882
|
}
|
|
54855
54883
|
handleChartDebounceUpdate(editor, void 0, block);
|
|
@@ -55631,17 +55659,15 @@ $$${mathData.mathjaxText}$$
|
|
|
55631
55659
|
return true;
|
|
55632
55660
|
}
|
|
55633
55661
|
function getTextToolbarReferenceClient(editor, complexBlock) {
|
|
55634
|
-
let offset = 0;
|
|
55635
55662
|
const { selectedColumns } = getTableSelectedRowsAndColumns(editor, complexBlock);
|
|
55636
55663
|
if (selectedColumns.size > 0) {
|
|
55637
55664
|
const { fromCol: startCol, toCol: endCol } = getTableSelectionRange(complexBlock, editor.selection.range.start, editor.selection.range.end);
|
|
55638
55665
|
const grid = TableGrid.fromBlock(complexBlock);
|
|
55639
|
-
if (startCol !== 0 || endCol !== grid.colCount - 1)
|
|
55640
|
-
|
|
55641
|
-
}
|
|
55666
|
+
if (startCol !== 0 || endCol !== grid.colCount - 1)
|
|
55667
|
+
;
|
|
55642
55668
|
}
|
|
55643
55669
|
const clientRect = getClientRects(editor, complexBlock, editor.selection.range)[0];
|
|
55644
|
-
return new DOMRect(clientRect.left, clientRect.top
|
|
55670
|
+
return new DOMRect(clientRect.left, clientRect.top, clientRect.width, clientRect.height);
|
|
55645
55671
|
}
|
|
55646
55672
|
function handleDeleteBlock$2(editor, block) {
|
|
55647
55673
|
untrackChildBlockEvent(editor, handleChartDebounceUpdate);
|
|
@@ -75395,13 +75421,13 @@ ${data.flowchartText}
|
|
|
75395
75421
|
this.layout.remove();
|
|
75396
75422
|
}
|
|
75397
75423
|
get isShow() {
|
|
75398
|
-
return this.layout.style.display === "
|
|
75424
|
+
return this.layout.style.display === "flex";
|
|
75399
75425
|
}
|
|
75400
75426
|
hidden() {
|
|
75401
75427
|
this.layout.style.display = "none";
|
|
75402
75428
|
}
|
|
75403
75429
|
show() {
|
|
75404
|
-
this.layout.style.display = "
|
|
75430
|
+
this.layout.style.display = "flex";
|
|
75405
75431
|
}
|
|
75406
75432
|
}
|
|
75407
75433
|
const insertHeading = (editor, num) => {
|
|
@@ -75517,6 +75543,22 @@ ${data.flowchartText}
|
|
|
75517
75543
|
blockIndex: index2 + 1
|
|
75518
75544
|
});
|
|
75519
75545
|
}
|
|
75546
|
+
async function insertTable(editor) {
|
|
75547
|
+
var _a, _b, _c;
|
|
75548
|
+
const block = editor.getFocusedBlock();
|
|
75549
|
+
const index2 = editor.getBlockIndex(block);
|
|
75550
|
+
const container = getParentContainer(block);
|
|
75551
|
+
const containerId = getContainerId(container);
|
|
75552
|
+
const blockClass = editor.editorBlocks.getBlockClass("table");
|
|
75553
|
+
(_c = (_a = blockClass == null ? void 0 : blockClass.getOptions) == null ? void 0 : (_b = _a.call(blockClass, editor)).handleInsertEmptyBlock) == null ? void 0 : _c.call(_b, editor, {
|
|
75554
|
+
item: { id: "table", name: "T" },
|
|
75555
|
+
containerId,
|
|
75556
|
+
blockIndex: index2 + 1
|
|
75557
|
+
});
|
|
75558
|
+
setTimeout(() => {
|
|
75559
|
+
editor.focus();
|
|
75560
|
+
});
|
|
75561
|
+
}
|
|
75520
75562
|
class AlignMenu {
|
|
75521
75563
|
constructor(editor) {
|
|
75522
75564
|
__publicField(this, "menu", null);
|
|
@@ -75589,6 +75631,10 @@ ${data.flowchartText}
|
|
|
75589
75631
|
return layout;
|
|
75590
75632
|
});
|
|
75591
75633
|
__publicField(this, "handleChildTouchStart", (item) => {
|
|
75634
|
+
if (item.handle) {
|
|
75635
|
+
item.handle();
|
|
75636
|
+
return;
|
|
75637
|
+
}
|
|
75592
75638
|
if (item.name.startsWith("\u6807\u9898") && item.name.length === 3) {
|
|
75593
75639
|
insertHeading(this.editor, Number(item.name[2]));
|
|
75594
75640
|
this.showContainer();
|
|
@@ -75608,9 +75654,23 @@ ${data.flowchartText}
|
|
|
75608
75654
|
if (item.name === "\u5F85\u529E") {
|
|
75609
75655
|
insertUncheckedList(this.editor);
|
|
75610
75656
|
}
|
|
75657
|
+
if (item.name === "\u8868\u683C") {
|
|
75658
|
+
insertTable(this.editor);
|
|
75659
|
+
}
|
|
75611
75660
|
const layout = this.layoutMap.get(this.bar);
|
|
75612
75661
|
layout == null ? void 0 : layout.hidden();
|
|
75613
75662
|
});
|
|
75663
|
+
__publicField(this, "scrollIntoView", () => {
|
|
75664
|
+
const scrollContainer = this.editor.scrollContainer;
|
|
75665
|
+
const anchor2 = this.editor.input.inputElement;
|
|
75666
|
+
const virtualViewportHeight = window.visualViewport.height;
|
|
75667
|
+
const offsetBottom = virtualViewportHeight - anchor2.getBoundingClientRect().bottom;
|
|
75668
|
+
if (offsetBottom < 300) {
|
|
75669
|
+
const scrollTop = scrollContainer.scrollTop + (300 - offsetBottom);
|
|
75670
|
+
const maxScrollTop = scrollContainer.scrollHeight - virtualViewportHeight;
|
|
75671
|
+
scrollContainer.scrollTop = Math.min(scrollTop, maxScrollTop);
|
|
75672
|
+
}
|
|
75673
|
+
});
|
|
75614
75674
|
__publicField(this, "handleTouchStart", (event, command) => {
|
|
75615
75675
|
var _a;
|
|
75616
75676
|
console.log("handleTouchStart");
|
|
@@ -75628,11 +75688,13 @@ ${data.flowchartText}
|
|
|
75628
75688
|
setTimeout(() => {
|
|
75629
75689
|
item.show();
|
|
75630
75690
|
this.hideContainer();
|
|
75691
|
+
this.scrollIntoView();
|
|
75631
75692
|
}, 300);
|
|
75632
75693
|
}
|
|
75633
75694
|
});
|
|
75634
75695
|
if (command.id === "add") {
|
|
75635
|
-
|
|
75696
|
+
this.hideContainer();
|
|
75697
|
+
const children = [{ name: "\u6807\u98981" }, { name: "\u6807\u98982" }, { name: "\u6807\u98983" }, { name: "\u5F15\u7528" }, { name: "\u6709\u5E8F\u5217\u8868" }, { name: "\u65E0\u5E8F\u5217\u8868" }, { name: "\u5F85\u529E" }, { name: "\u8868\u683C" }].map((item) => {
|
|
75636
75698
|
const childItem = createElement("div", ["child-item"], null, item.name);
|
|
75637
75699
|
childItem.addEventListener("touchend", () => this.handleChildTouchStart(item));
|
|
75638
75700
|
return childItem;
|
|
@@ -75641,9 +75703,11 @@ ${data.flowchartText}
|
|
|
75641
75703
|
const layout = this.createLayout(parent, children, "menu");
|
|
75642
75704
|
this.layoutMap.set(key, layout);
|
|
75643
75705
|
this.hideContainer();
|
|
75706
|
+
this.scrollIntoView();
|
|
75644
75707
|
}
|
|
75645
75708
|
}
|
|
75646
75709
|
if (command.id === "color") {
|
|
75710
|
+
this.hideContainer();
|
|
75647
75711
|
const children = [{ name: "\u80CC\u666F\u8272" }].map((item) => {
|
|
75648
75712
|
const childItem = createElement("div", ["child-item"], null, item.name);
|
|
75649
75713
|
childItem.addEventListener("touchend", () => this.handleChildTouchStart(item));
|
|
@@ -75653,6 +75717,184 @@ ${data.flowchartText}
|
|
|
75653
75717
|
const layout = this.createLayout(parent, children, "card");
|
|
75654
75718
|
this.layoutMap.set(key, layout);
|
|
75655
75719
|
this.hideContainer();
|
|
75720
|
+
this.scrollIntoView();
|
|
75721
|
+
}
|
|
75722
|
+
}
|
|
75723
|
+
if (command.id === "table-handle") {
|
|
75724
|
+
this.hideContainer();
|
|
75725
|
+
const range = this.editor.selection.range;
|
|
75726
|
+
if (range.isSimple()) {
|
|
75727
|
+
const childBlock = this.editor.getBlockById(range.start.blockId);
|
|
75728
|
+
const parentContainer = getParentContainer(childBlock);
|
|
75729
|
+
getParentBlock(parentContainer);
|
|
75730
|
+
} else {
|
|
75731
|
+
this.editor.getBlockById(range.start.blockId);
|
|
75732
|
+
}
|
|
75733
|
+
const children = [
|
|
75734
|
+
{
|
|
75735
|
+
name: "\u5411\u4E0A\u63D2\u5165\u884C",
|
|
75736
|
+
handle: () => {
|
|
75737
|
+
const range2 = this.editor.selection.range;
|
|
75738
|
+
let block2 = null;
|
|
75739
|
+
if (range2.isSimple()) {
|
|
75740
|
+
const childBlock = this.editor.getBlockById(range2.start.blockId);
|
|
75741
|
+
const parentContainer = getParentContainer(childBlock);
|
|
75742
|
+
block2 = getParentBlock(parentContainer);
|
|
75743
|
+
} else {
|
|
75744
|
+
block2 = this.editor.getBlockById(range2.start.blockId);
|
|
75745
|
+
}
|
|
75746
|
+
const { fromCol, toCol, fromRow, toRow } = getAbstractTableSelectionRange(this.editor, block2);
|
|
75747
|
+
insertRow(this.editor, block2, fromRow);
|
|
75748
|
+
}
|
|
75749
|
+
},
|
|
75750
|
+
{
|
|
75751
|
+
name: "\u5411\u53F3\u63D2\u5165\u5217",
|
|
75752
|
+
handle: () => {
|
|
75753
|
+
const range2 = this.editor.selection.range;
|
|
75754
|
+
let block2 = null;
|
|
75755
|
+
if (range2.isSimple()) {
|
|
75756
|
+
const childBlock = this.editor.getBlockById(range2.start.blockId);
|
|
75757
|
+
const parentContainer = getParentContainer(childBlock);
|
|
75758
|
+
block2 = getParentBlock(parentContainer);
|
|
75759
|
+
} else {
|
|
75760
|
+
block2 = this.editor.getBlockById(range2.start.blockId);
|
|
75761
|
+
}
|
|
75762
|
+
const { fromCol, toCol, fromRow, toRow } = getAbstractTableSelectionRange(this.editor, block2);
|
|
75763
|
+
insertColumn(this.editor, block2, toCol + 1);
|
|
75764
|
+
}
|
|
75765
|
+
},
|
|
75766
|
+
{
|
|
75767
|
+
name: "\u5411\u4E0B\u63D2\u5165\u884C",
|
|
75768
|
+
handle: () => {
|
|
75769
|
+
const range2 = this.editor.selection.range;
|
|
75770
|
+
let block2 = null;
|
|
75771
|
+
if (range2.isSimple()) {
|
|
75772
|
+
const childBlock = this.editor.getBlockById(range2.start.blockId);
|
|
75773
|
+
const parentContainer = getParentContainer(childBlock);
|
|
75774
|
+
block2 = getParentBlock(parentContainer);
|
|
75775
|
+
} else {
|
|
75776
|
+
block2 = this.editor.getBlockById(range2.start.blockId);
|
|
75777
|
+
}
|
|
75778
|
+
const { fromCol, toCol, fromRow, toRow } = getAbstractTableSelectionRange(this.editor, block2);
|
|
75779
|
+
insertRow(this.editor, block2, toRow + 1);
|
|
75780
|
+
}
|
|
75781
|
+
},
|
|
75782
|
+
{
|
|
75783
|
+
name: "\u5411\u5DE6\u63D2\u5165\u5217",
|
|
75784
|
+
handle: () => {
|
|
75785
|
+
const range2 = this.editor.selection.range;
|
|
75786
|
+
let block2 = null;
|
|
75787
|
+
if (range2.isSimple()) {
|
|
75788
|
+
const childBlock = this.editor.getBlockById(range2.start.blockId);
|
|
75789
|
+
const parentContainer = getParentContainer(childBlock);
|
|
75790
|
+
block2 = getParentBlock(parentContainer);
|
|
75791
|
+
} else {
|
|
75792
|
+
block2 = this.editor.getBlockById(range2.start.blockId);
|
|
75793
|
+
}
|
|
75794
|
+
const { fromCol, toCol, fromRow, toRow } = getAbstractTableSelectionRange(this.editor, block2);
|
|
75795
|
+
insertColumn(this.editor, block2, fromCol);
|
|
75796
|
+
}
|
|
75797
|
+
},
|
|
75798
|
+
{
|
|
75799
|
+
name: "\u5220\u9664\u884C",
|
|
75800
|
+
handle: () => {
|
|
75801
|
+
const range2 = this.editor.selection.range;
|
|
75802
|
+
let block2 = null;
|
|
75803
|
+
if (range2.isSimple()) {
|
|
75804
|
+
const childBlock = this.editor.getBlockById(range2.start.blockId);
|
|
75805
|
+
const parentContainer = getParentContainer(childBlock);
|
|
75806
|
+
block2 = getParentBlock(parentContainer);
|
|
75807
|
+
} else {
|
|
75808
|
+
block2 = this.editor.getBlockById(range2.start.blockId);
|
|
75809
|
+
}
|
|
75810
|
+
deleteRows(createEntireRowAndColumnRange(this.editor, block2, false));
|
|
75811
|
+
}
|
|
75812
|
+
},
|
|
75813
|
+
{
|
|
75814
|
+
name: "\u5220\u9664\u5217",
|
|
75815
|
+
handle: () => {
|
|
75816
|
+
const range2 = this.editor.selection.range;
|
|
75817
|
+
let block2 = null;
|
|
75818
|
+
if (range2.isSimple()) {
|
|
75819
|
+
const childBlock = this.editor.getBlockById(range2.start.blockId);
|
|
75820
|
+
const parentContainer = getParentContainer(childBlock);
|
|
75821
|
+
block2 = getParentBlock(parentContainer);
|
|
75822
|
+
} else {
|
|
75823
|
+
block2 = this.editor.getBlockById(range2.start.blockId);
|
|
75824
|
+
}
|
|
75825
|
+
deleteColumns(createEntireRowAndColumnRange(this.editor, block2, true));
|
|
75826
|
+
}
|
|
75827
|
+
},
|
|
75828
|
+
{
|
|
75829
|
+
name: "\u5220\u9664\u8868\u683C",
|
|
75830
|
+
handle: () => {
|
|
75831
|
+
const range2 = this.editor.selection.range;
|
|
75832
|
+
let block2 = null;
|
|
75833
|
+
if (range2.isSimple()) {
|
|
75834
|
+
const childBlock = this.editor.getBlockById(range2.start.blockId);
|
|
75835
|
+
const parentContainer = getParentContainer(childBlock);
|
|
75836
|
+
block2 = getParentBlock(parentContainer);
|
|
75837
|
+
} else {
|
|
75838
|
+
block2 = this.editor.getBlockById(range2.start.blockId);
|
|
75839
|
+
}
|
|
75840
|
+
this.editor.deleteBlock(block2);
|
|
75841
|
+
}
|
|
75842
|
+
},
|
|
75843
|
+
{
|
|
75844
|
+
name: "\u6761\u7EB9\u6837\u5F0F",
|
|
75845
|
+
handle: () => {
|
|
75846
|
+
const range2 = this.editor.selection.range;
|
|
75847
|
+
let block2 = null;
|
|
75848
|
+
if (range2.isSimple()) {
|
|
75849
|
+
const childBlock = this.editor.getBlockById(range2.start.blockId);
|
|
75850
|
+
const parentContainer = getParentContainer(childBlock);
|
|
75851
|
+
block2 = getParentBlock(parentContainer);
|
|
75852
|
+
} else {
|
|
75853
|
+
block2 = this.editor.getBlockById(range2.start.blockId);
|
|
75854
|
+
}
|
|
75855
|
+
setStripeStyle(this.editor, block2);
|
|
75856
|
+
}
|
|
75857
|
+
},
|
|
75858
|
+
{
|
|
75859
|
+
name: "\u8BBE\u7F6E\u884C\u6807\u9898",
|
|
75860
|
+
handle: () => {
|
|
75861
|
+
const range2 = this.editor.selection.range;
|
|
75862
|
+
let block2 = null;
|
|
75863
|
+
if (range2.isSimple()) {
|
|
75864
|
+
const childBlock = this.editor.getBlockById(range2.start.blockId);
|
|
75865
|
+
const parentContainer = getParentContainer(childBlock);
|
|
75866
|
+
block2 = getParentBlock(parentContainer);
|
|
75867
|
+
} else {
|
|
75868
|
+
block2 = this.editor.getBlockById(range2.start.blockId);
|
|
75869
|
+
}
|
|
75870
|
+
setRowTitle(this.editor, block2);
|
|
75871
|
+
}
|
|
75872
|
+
},
|
|
75873
|
+
{
|
|
75874
|
+
name: "\u8BBE\u7F6E\u5217\u6807\u9898",
|
|
75875
|
+
handle: () => {
|
|
75876
|
+
const range2 = this.editor.selection.range;
|
|
75877
|
+
let block2 = null;
|
|
75878
|
+
if (range2.isSimple()) {
|
|
75879
|
+
const childBlock = this.editor.getBlockById(range2.start.blockId);
|
|
75880
|
+
const parentContainer = getParentContainer(childBlock);
|
|
75881
|
+
block2 = getParentBlock(parentContainer);
|
|
75882
|
+
} else {
|
|
75883
|
+
block2 = this.editor.getBlockById(range2.start.blockId);
|
|
75884
|
+
}
|
|
75885
|
+
setColTitle(this.editor, block2);
|
|
75886
|
+
}
|
|
75887
|
+
}
|
|
75888
|
+
].map((item) => {
|
|
75889
|
+
const childItem = createElement("div", ["child-item"], null, item.name);
|
|
75890
|
+
childItem.addEventListener("touchend", () => this.handleChildTouchStart(item));
|
|
75891
|
+
return childItem;
|
|
75892
|
+
});
|
|
75893
|
+
if (!this.layoutMap.has(key)) {
|
|
75894
|
+
const layout = this.createLayout(parent, children, "card");
|
|
75895
|
+
this.layoutMap.set(key, layout);
|
|
75896
|
+
this.hideContainer();
|
|
75897
|
+
this.scrollIntoView();
|
|
75656
75898
|
}
|
|
75657
75899
|
}
|
|
75658
75900
|
if (command.id === "image") {
|
|
@@ -75779,8 +76021,8 @@ ${data.flowchartText}
|
|
|
75779
76021
|
name: "I",
|
|
75780
76022
|
icon: ImageIcon
|
|
75781
76023
|
}, {
|
|
75782
|
-
id: "
|
|
75783
|
-
name: "
|
|
76024
|
+
id: "table-handle",
|
|
76025
|
+
name: "\u8868\u683C\u64CD\u4F5C"
|
|
75784
76026
|
}, {
|
|
75785
76027
|
id: "list",
|
|
75786
76028
|
name: "L"
|
|
@@ -77316,7 +77558,7 @@ ${data.flowchartText}
|
|
|
77316
77558
|
}
|
|
77317
77559
|
}
|
|
77318
77560
|
});
|
|
77319
|
-
editor.version = "1.2.0-beta.
|
|
77561
|
+
editor.version = "1.2.0-beta.11";
|
|
77320
77562
|
if (Logger$2.level === LogLevel.DEBUG) {
|
|
77321
77563
|
window.setReauthFail = (fail) => {
|
|
77322
77564
|
window.isReauthError = fail;
|
|
@@ -77409,7 +77651,7 @@ ${data.flowchartText}
|
|
|
77409
77651
|
});
|
|
77410
77652
|
editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
|
|
77411
77653
|
OnesEditorToolbar.register(editor);
|
|
77412
|
-
editor.version = "1.2.0-beta.
|
|
77654
|
+
editor.version = "1.2.0-beta.11";
|
|
77413
77655
|
return editor;
|
|
77414
77656
|
}
|
|
77415
77657
|
async function showDocVersions(editor, options, serverUrl) {
|
|
@@ -77588,6 +77830,7 @@ ${data.flowchartText}
|
|
|
77588
77830
|
exports2.createEmptyContainer = createEmptyContainer;
|
|
77589
77831
|
exports2.createEmptyDoc = createEmptyDoc$1;
|
|
77590
77832
|
exports2.createEmptyTextBlockData = createEmptyTextBlockData;
|
|
77833
|
+
exports2.createEntireRowAndColumnRange = createEntireRowAndColumnRange;
|
|
77591
77834
|
exports2.createExpandedRange = createExpandedRange;
|
|
77592
77835
|
exports2.createIconButton = createIconButton;
|
|
77593
77836
|
exports2.createImage = createImage;
|
|
@@ -77607,6 +77850,8 @@ ${data.flowchartText}
|
|
|
77607
77850
|
exports2.createTextOp = createTextOp;
|
|
77608
77851
|
exports2.createTextWithReplaceSoftReturn = createTextWithReplaceSoftReturn;
|
|
77609
77852
|
exports2.daysAfter = daysAfter;
|
|
77853
|
+
exports2.deleteColumns = deleteColumns;
|
|
77854
|
+
exports2.deleteRows = deleteRows;
|
|
77610
77855
|
exports2.deleteText = deleteText;
|
|
77611
77856
|
exports2.diffDays = diffDays;
|
|
77612
77857
|
exports2.disablePageScroll = disablePageScroll;
|
|
@@ -77721,6 +77966,7 @@ ${data.flowchartText}
|
|
|
77721
77966
|
exports2.fromNowString = fromNowString;
|
|
77722
77967
|
exports2.genId = genId;
|
|
77723
77968
|
exports2.generateEditorContainerId = generateEditorContainerId;
|
|
77969
|
+
exports2.getAbstractTableSelectionRange = getAbstractTableSelectionRange;
|
|
77724
77970
|
exports2.getAllChildBlocks = getAllChildBlocks;
|
|
77725
77971
|
exports2.getAllQuickMenuItems = getAllQuickMenuItems;
|
|
77726
77972
|
exports2.getAllSelectedBlocks = getAllSelectedBlocks;
|
|
@@ -77831,8 +78077,10 @@ ${data.flowchartText}
|
|
|
77831
78077
|
exports2.injectDocToHtmlFragment = injectDocToHtmlFragment;
|
|
77832
78078
|
exports2.injectStyle = injectStyle;
|
|
77833
78079
|
exports2.inputActions = actions;
|
|
78080
|
+
exports2.insertColumn = insertColumn;
|
|
77834
78081
|
exports2.insertEmptyBlock = insertEmptyBlock$1;
|
|
77835
78082
|
exports2.insertEmptyEmbedBlock = insertEmptyEmbedBlock;
|
|
78083
|
+
exports2.insertRow = insertRow;
|
|
77836
78084
|
exports2.insertText = insertText;
|
|
77837
78085
|
exports2.intersectionCommands = intersectionCommands;
|
|
77838
78086
|
exports2.isBackspace = isBackspace;
|
|
@@ -77943,9 +78191,12 @@ ${data.flowchartText}
|
|
|
77943
78191
|
exports2.setAttributes = setAttributes;
|
|
77944
78192
|
exports2.setClipboardData = setClipboardData;
|
|
77945
78193
|
exports2.setClipboardDataByEvent = setClipboardDataByEvent;
|
|
78194
|
+
exports2.setColTitle = setColTitle;
|
|
77946
78195
|
exports2.setColorToAttributes = setColorToAttributes;
|
|
77947
78196
|
exports2.setDataset = setDataset;
|
|
77948
78197
|
exports2.setDefaultCursor = setDefaultCursor;
|
|
78198
|
+
exports2.setRowTitle = setRowTitle;
|
|
78199
|
+
exports2.setStripeStyle = setStripeStyle;
|
|
77949
78200
|
exports2.setStyles = setStyles;
|
|
77950
78201
|
exports2.shareDBCommentToDocObject = shareDBCommentToDocObject;
|
|
77951
78202
|
exports2.shareDBDocCommentToComment = shareDBDocCommentToComment;
|