suneditor 3.0.0-beta.1 → 3.0.0-beta.3
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/CONTRIBUTING.md +166 -29
- package/README.md +13 -1
- package/dist/suneditor.min.css +1 -1
- package/dist/suneditor.min.js +1 -1
- package/package.json +13 -5
- package/src/assets/{variables.css → design/color.css} +45 -59
- package/src/assets/design/index.css +3 -0
- package/src/assets/design/size.css +35 -0
- package/src/assets/design/typography.css +37 -0
- package/src/assets/suneditor-contents.css +1 -1
- package/src/assets/suneditor.css +40 -28
- package/src/core/base/eventHandlers/handler_ww_dragDrop.js +4 -2
- package/src/core/base/eventHandlers/handler_ww_key_input.js +16 -16
- package/src/core/base/eventHandlers/handler_ww_mouse.js +1 -1
- package/src/core/base/eventManager.js +75 -32
- package/src/core/class/char.js +3 -2
- package/src/core/class/component.js +38 -14
- package/src/core/class/format.js +13 -2
- package/src/core/class/html.js +58 -26
- package/src/core/class/menu.js +19 -0
- package/src/core/class/selection.js +1 -8
- package/src/core/class/toolbar.js +2 -1
- package/src/core/class/ui.js +3 -1
- package/src/core/editor.js +125 -59
- package/src/core/section/actives.js +73 -10
- package/src/core/section/constructor.js +144 -55
- package/src/core/section/documentType.js +2 -2
- package/src/events.js +25 -1
- package/src/helper/converter.js +23 -1
- package/src/helper/dom/domCheck.js +12 -2
- package/src/modules/Controller.js +25 -5
- package/src/modules/Figure.js +6 -6
- package/src/modules/FileManager.js +1 -1
- package/src/plugins/command/fileUpload.js +3 -3
- package/src/plugins/dropdown/formatBlock.js +4 -13
- package/src/plugins/dropdown/table.js +51 -18
- package/src/plugins/modal/audio.js +2 -2
- package/src/plugins/modal/embed.js +2 -2
- package/src/plugins/modal/image.js +3 -3
- package/src/plugins/modal/math.js +2 -2
- package/src/plugins/modal/video.js +1 -1
- package/src/plugins/popup/anchor.js +1 -1
- package/src/suneditor.js +1 -1
- package/src/themes/dark.css +88 -45
- package/types/core/base/eventManager.d.ts +23 -0
- package/types/core/class/char.d.ts +2 -1
- package/types/core/class/component.d.ts +13 -3
- package/types/core/class/format.d.ts +8 -1
- package/types/core/class/html.d.ts +8 -0
- package/types/core/class/menu.d.ts +8 -0
- package/types/core/class/ui.d.ts +1 -1
- package/types/core/editor.d.ts +7 -2
- package/types/core/section/constructor.d.ts +167 -149
- package/types/events.d.ts +3 -0
- package/types/helper/converter.d.ts +9 -0
- package/types/helper/dom/domCheck.d.ts +7 -0
- package/types/helper/index.d.ts +2 -0
- package/types/index.d.ts +1 -1
- package/types/plugins/dropdown/formatBlock.d.ts +2 -2
- package/types/plugins/dropdown/table.d.ts +1 -0
- package/.eslintignore +0 -7
- package/.eslintrc.json +0 -81
- /package/src/assets/icons/{_default.js → defaultIcons.js} +0 -0
- /package/types/assets/icons/{_default.d.ts → defaultIcons.d.ts} +0 -0
|
@@ -263,6 +263,7 @@ class Table extends EditorInjector {
|
|
|
263
263
|
this._fixedColumn = false;
|
|
264
264
|
this._physical_cellCnt = 0;
|
|
265
265
|
this._logical_cellCnt = 0;
|
|
266
|
+
this._cellCnt = 0;
|
|
266
267
|
this._rowCnt = 0;
|
|
267
268
|
this._rowIndex = 0;
|
|
268
269
|
this._physical_cellIndex = 0;
|
|
@@ -630,22 +631,27 @@ class Table extends EditorInjector {
|
|
|
630
631
|
*/
|
|
631
632
|
onKeyDown({ event, range, line }) {
|
|
632
633
|
this._ref = null;
|
|
633
|
-
|
|
634
|
+
|
|
635
|
+
const keyCode = event.code;
|
|
636
|
+
const isTab = keyCodeMap.isTab(keyCode);
|
|
637
|
+
if (this.editor.selectMenuOn || this._resizing || (!isTab && this.__s) || keyCodeMap.isCtrl(event)) return;
|
|
634
638
|
|
|
635
639
|
if (!this.cellControllerTop) {
|
|
636
640
|
this.controller_cell.hide();
|
|
637
641
|
}
|
|
638
642
|
|
|
639
|
-
|
|
640
|
-
|
|
643
|
+
this.__s = keyCodeMap.isShift(event);
|
|
644
|
+
|
|
641
645
|
// table tabkey
|
|
642
|
-
if (
|
|
646
|
+
if (isTab) {
|
|
643
647
|
this._deleteStyleSelectedCells();
|
|
644
648
|
const tableCell = dom.query.getParentElement(line, dom.check.isTableCell);
|
|
645
649
|
if (tableCell && range.collapsed && dom.check.isEdgePoint(range.startContainer, range.startOffset)) {
|
|
646
650
|
this._closeController();
|
|
647
651
|
|
|
648
|
-
const shift =
|
|
652
|
+
const shift = this.__s;
|
|
653
|
+
this._shift = this.__s = false;
|
|
654
|
+
|
|
649
655
|
/** @type {HTMLTableElement} */
|
|
650
656
|
const table = dom.query.getParentElement(tableCell, 'table');
|
|
651
657
|
/** @type {HTMLTableCellElement[]} */
|
|
@@ -655,7 +661,7 @@ class Table extends EditorInjector {
|
|
|
655
661
|
if (idx === cells.length && !shift) {
|
|
656
662
|
if (!dom.query.getParentElement(tableCell, 'thead')) {
|
|
657
663
|
const rows = table.rows;
|
|
658
|
-
const newRow = this.insertBodyRow(table, rows.length,
|
|
664
|
+
const newRow = this.insertBodyRow(table, rows.length, this._cellCnt);
|
|
659
665
|
const firstTd = newRow.querySelector('td div');
|
|
660
666
|
this.selection.setRange(firstTd, 0, firstTd, 0);
|
|
661
667
|
}
|
|
@@ -666,7 +672,7 @@ class Table extends EditorInjector {
|
|
|
666
672
|
return false;
|
|
667
673
|
}
|
|
668
674
|
|
|
669
|
-
if (idx === -1 && shift) return;
|
|
675
|
+
if (idx === -1 && shift) return false;
|
|
670
676
|
|
|
671
677
|
const moveCell = cells[idx];
|
|
672
678
|
if (!moveCell) return;
|
|
@@ -832,13 +838,13 @@ class Table extends EditorInjector {
|
|
|
832
838
|
this._maxWidth = !this._maxWidth;
|
|
833
839
|
this._setTableStyle('width', false);
|
|
834
840
|
this._historyPush();
|
|
835
|
-
this.component.select(this._element, Table.key, true);
|
|
841
|
+
this.component.select(this._element, Table.key, { isInput: true });
|
|
836
842
|
break;
|
|
837
843
|
case 'layout':
|
|
838
844
|
this._fixedColumn = !this._fixedColumn;
|
|
839
845
|
this._setTableStyle('column', false);
|
|
840
846
|
this._historyPush();
|
|
841
|
-
this.component.select(this._element, Table.key, true);
|
|
847
|
+
this.component.select(this._element, Table.key, { isInput: true });
|
|
842
848
|
break;
|
|
843
849
|
case 'copy':
|
|
844
850
|
this.component.copy(this._figure);
|
|
@@ -979,7 +985,7 @@ class Table extends EditorInjector {
|
|
|
979
985
|
|
|
980
986
|
// cell cnt, physical cell index
|
|
981
987
|
this._physical_cellCnt = this._trElement.cells.length;
|
|
982
|
-
this._logical_cellCnt = cellCnt;
|
|
988
|
+
this._logical_cellCnt = this._cellCnt = cellCnt;
|
|
983
989
|
this._physical_cellIndex = cellIndex;
|
|
984
990
|
|
|
985
991
|
// span
|
|
@@ -1460,15 +1466,43 @@ class Table extends EditorInjector {
|
|
|
1460
1466
|
// --- copy info ---
|
|
1461
1467
|
const copyRows = copyTable.rows;
|
|
1462
1468
|
let rowCnt = 0;
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1469
|
+
const colIndexMap = [];
|
|
1470
|
+
for (let row = 0; row < copyRows.length; row++) {
|
|
1471
|
+
const cells = copyRows[row].cells;
|
|
1472
|
+
let logicalCol = 0;
|
|
1473
|
+
|
|
1474
|
+
for (let i = 0; i < cells.length; i++) {
|
|
1475
|
+
const cell = cells[i];
|
|
1476
|
+
|
|
1477
|
+
while (colIndexMap[row]?.[logicalCol]) {
|
|
1478
|
+
logicalCol++;
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
const rowspan = cell.rowSpan || 1;
|
|
1482
|
+
const colspan = cell.colSpan || 1;
|
|
1483
|
+
|
|
1484
|
+
if (logicalCol === 0) {
|
|
1485
|
+
rowCnt += rowspan;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
// rowspan map
|
|
1489
|
+
for (let r = 0; r < rowspan; r++) {
|
|
1490
|
+
for (let c = 0; c < colspan; c++) {
|
|
1491
|
+
if (!colIndexMap[row + r]) colIndexMap[row + r] = [];
|
|
1492
|
+
colIndexMap[row + r][logicalCol + c] = true;
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
logicalCol += colspan;
|
|
1497
|
+
}
|
|
1466
1498
|
}
|
|
1499
|
+
|
|
1467
1500
|
let logicalColCount = 0;
|
|
1468
1501
|
for (let i = 0, cells = copyRows[0].cells, len = cells.length; i < len; i++) {
|
|
1469
1502
|
const cell = cells[i];
|
|
1470
1503
|
logicalColCount += cell.colSpan || 1;
|
|
1471
1504
|
}
|
|
1505
|
+
|
|
1472
1506
|
const copyInfo = {
|
|
1473
1507
|
rowCnt: rowCnt,
|
|
1474
1508
|
logicalCellCnt: logicalColCount
|
|
@@ -2049,7 +2083,7 @@ class Table extends EditorInjector {
|
|
|
2049
2083
|
if (this._fixedCell === tdElement) dom.utils.addClass(tdElement, 'se-selected-cell-focus');
|
|
2050
2084
|
if (!this._selectedCells?.length) this._selectedCells = [tdElement];
|
|
2051
2085
|
const tableElement = this._selectedTable || this._element || dom.query.getParentElement(tdElement, 'TABLE');
|
|
2052
|
-
this.component.select(tableElement, Table.key, true);
|
|
2086
|
+
this.component.select(tableElement, Table.key, { isInput: true });
|
|
2053
2087
|
}
|
|
2054
2088
|
|
|
2055
2089
|
/**
|
|
@@ -2117,8 +2151,7 @@ class Table extends EditorInjector {
|
|
|
2117
2151
|
() => {
|
|
2118
2152
|
this.__removeGlobalEvents();
|
|
2119
2153
|
this.history.push(true);
|
|
2120
|
-
|
|
2121
|
-
this.component.select(this._element, Table.key, true);
|
|
2154
|
+
this.component.select(this._element, Table.key, { isInput: true });
|
|
2122
2155
|
},
|
|
2123
2156
|
(e) => {
|
|
2124
2157
|
this._stopResize(col, prevValue, 'width', e);
|
|
@@ -2213,7 +2246,7 @@ class Table extends EditorInjector {
|
|
|
2213
2246
|
() => {
|
|
2214
2247
|
this.__removeGlobalEvents();
|
|
2215
2248
|
// figure reopen
|
|
2216
|
-
this.component.select(this._element, Table.key, true);
|
|
2249
|
+
this.component.select(this._element, Table.key, { isInput: true });
|
|
2217
2250
|
},
|
|
2218
2251
|
this._stopResize.bind(this, figure, figure.style.width, 'width')
|
|
2219
2252
|
);
|
|
@@ -2286,7 +2319,7 @@ class Table extends EditorInjector {
|
|
|
2286
2319
|
target.style[styleProp] = prevValue;
|
|
2287
2320
|
// figure reopen
|
|
2288
2321
|
if (styleProp === 'width') {
|
|
2289
|
-
this.component.select(this._element, Table.key, true);
|
|
2322
|
+
this.component.select(this._element, Table.key, { isInput: true });
|
|
2290
2323
|
}
|
|
2291
2324
|
}
|
|
2292
2325
|
|
|
@@ -438,9 +438,9 @@ class Audio_ extends EditorInjector {
|
|
|
438
438
|
this.fileManager.setFileData(element, file);
|
|
439
439
|
if (element && element.src !== src) {
|
|
440
440
|
element.src = src;
|
|
441
|
-
this.component.select(element, Audio_.key
|
|
441
|
+
this.component.select(element, Audio_.key);
|
|
442
442
|
} else {
|
|
443
|
-
this.component.select(element, Audio_.key
|
|
443
|
+
this.component.select(element, Audio_.key);
|
|
444
444
|
return;
|
|
445
445
|
}
|
|
446
446
|
}
|
|
@@ -257,7 +257,7 @@ class Embed extends EditorInjector {
|
|
|
257
257
|
result = await this.submitSRC(this._linkValue);
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
-
if (result) this._w.setTimeout(this.component.select.bind(this.component, this._element,
|
|
260
|
+
if (result) this._w.setTimeout(this.component.select.bind(this.component, this._element, Embed.key), 0);
|
|
261
261
|
|
|
262
262
|
return result;
|
|
263
263
|
}
|
|
@@ -386,7 +386,7 @@ class Embed extends EditorInjector {
|
|
|
386
386
|
const focusEl = container.previousElementSibling || container.nextElementSibling;
|
|
387
387
|
const emptyDiv = container.parentNode;
|
|
388
388
|
|
|
389
|
-
const message = await this.triggerEvent('
|
|
389
|
+
const message = await this.triggerEvent('onEmbedDeleteBefore', { element: targetEl, container, align: this._align, url: this._linkValue });
|
|
390
390
|
if (message === false) return;
|
|
391
391
|
|
|
392
392
|
dom.utils.removeItem(container);
|
|
@@ -946,7 +946,7 @@ class Image_ extends EditorInjector {
|
|
|
946
946
|
_updateSrc(src, element, file) {
|
|
947
947
|
element.src = src;
|
|
948
948
|
this.fileManager.setFileData(element, file);
|
|
949
|
-
this.component.select(element, Image_.key
|
|
949
|
+
this.component.select(element, Image_.key);
|
|
950
950
|
}
|
|
951
951
|
|
|
952
952
|
/**
|
|
@@ -1203,7 +1203,7 @@ class Image_ extends EditorInjector {
|
|
|
1203
1203
|
// svg exception handling
|
|
1204
1204
|
if (oImg.offsetWidth === 0) this._applySize(_svgDefaultSize, '');
|
|
1205
1205
|
if (this.options.get('componentAutoSelect')) {
|
|
1206
|
-
this.component.select(oImg, Image_.key
|
|
1206
|
+
this.component.select(oImg, Image_.key);
|
|
1207
1207
|
} else {
|
|
1208
1208
|
if (!this.component.isInline(container)) {
|
|
1209
1209
|
const line = this.format.addLine(container, null);
|
|
@@ -1213,7 +1213,7 @@ class Image_ extends EditorInjector {
|
|
|
1213
1213
|
if (r) {
|
|
1214
1214
|
this.selection.setRange(r.container, r.offset, r.container, r.offset);
|
|
1215
1215
|
} else {
|
|
1216
|
-
this.component.select(oImg, Image_.key
|
|
1216
|
+
this.component.select(oImg, Image_.key);
|
|
1217
1217
|
}
|
|
1218
1218
|
}
|
|
1219
1219
|
}
|
|
@@ -259,7 +259,7 @@ class Math_ extends EditorInjector {
|
|
|
259
259
|
const containerEl = dom.query.getParentElement(this.controller.currentTarget, '.se-component');
|
|
260
260
|
containerEl.replaceWith(mathEl);
|
|
261
261
|
const compInfo = this.component.get(mathEl);
|
|
262
|
-
this.component.select(compInfo.target, compInfo.pluginName
|
|
262
|
+
this.component.select(compInfo.target, compInfo.pluginName);
|
|
263
263
|
return true;
|
|
264
264
|
}
|
|
265
265
|
|
|
@@ -271,7 +271,7 @@ class Math_ extends EditorInjector {
|
|
|
271
271
|
if (r) {
|
|
272
272
|
this.selection.setRange(r.container, r.offset, r.container, r.offset);
|
|
273
273
|
} else {
|
|
274
|
-
this.component.select(mathEl, Math_.key
|
|
274
|
+
this.component.select(mathEl, Math_.key);
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
return true;
|
|
@@ -285,7 +285,7 @@ class Video extends EditorInjector {
|
|
|
285
285
|
result = await this.submitURL(this._linkValue);
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
-
if (result) this._w.setTimeout(this.component.select.bind(this.component, this._element,
|
|
288
|
+
if (result) this._w.setTimeout(this.component.select.bind(this.component, this._element, Video.key), 0);
|
|
289
289
|
|
|
290
290
|
return result;
|
|
291
291
|
}
|
|
@@ -112,7 +112,7 @@ class Anchor extends EditorInjector {
|
|
|
112
112
|
if (r) {
|
|
113
113
|
this.selection.setRange(r.container, r.offset, r.container, r.offset);
|
|
114
114
|
} else {
|
|
115
|
-
this.component.select(a, Anchor.key
|
|
115
|
+
this.component.select(a, Anchor.key);
|
|
116
116
|
}
|
|
117
117
|
this._init();
|
|
118
118
|
} else {
|
package/src/suneditor.js
CHANGED
package/src/themes/dark.css
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
.sun-editor.se-theme-dark,
|
|
2
2
|
.sun-editor-editable.se-theme-dark {
|
|
3
|
-
/**
|
|
3
|
+
/** --------------------------- content - [colors] ----------- */
|
|
4
|
+
--se-caret-color: #ccc;
|
|
5
|
+
--se-placeholder-color: #64718c;
|
|
4
6
|
--se-edit-font-color: #ccc;
|
|
5
7
|
--se-edit-font-pre: #aaa;
|
|
6
8
|
--se-edit-font-quote: #888;
|
|
7
|
-
--se-edit-background-color: #
|
|
8
|
-
--se-edit-background-pre: #
|
|
9
|
+
--se-edit-background-color: #0f1828;
|
|
10
|
+
--se-edit-background-pre: #364153;
|
|
9
11
|
--se-edit-border-light: #555;
|
|
10
12
|
--se-edit-border-dark: #444;
|
|
11
13
|
--se-edit-border-dark-n1: #555;
|
|
@@ -14,76 +16,117 @@
|
|
|
14
16
|
--se-edit-anchor-on-back: #004cff;
|
|
15
17
|
--se-edit-anchor-on-font: #e8f7ff;
|
|
16
18
|
--se-edit-hr-color: #ccc;
|
|
17
|
-
--se-edit-hr-on-back: #
|
|
19
|
+
--se-edit-hr-on-back: #77aaff;
|
|
18
20
|
--se-edit-active: #77aaff;
|
|
19
21
|
--se-edit-hover: #5599ff;
|
|
20
22
|
--se-edit-outline: #444;
|
|
21
23
|
|
|
22
|
-
/**
|
|
24
|
+
/** --------------------------- layout - [colors] ----------- */
|
|
25
|
+
/** main, common */
|
|
26
|
+
--se-main-font-family: Helvetica Neue;
|
|
23
27
|
--se-main-out-color: #444;
|
|
24
28
|
--se-main-color: #ccc;
|
|
25
29
|
--se-main-color-lighter: #aaa;
|
|
26
|
-
--se-main-background-color: #
|
|
27
|
-
--se-
|
|
28
|
-
--se-main-background-color3: #333;
|
|
30
|
+
--se-main-background-color: #0f1828;
|
|
31
|
+
--se-code-view-color: #030712;
|
|
29
32
|
--se-main-font-color: #ccc;
|
|
30
|
-
--se-
|
|
33
|
+
--se-code-view-background-color: #ddd;
|
|
31
34
|
--se-main-divider-color: #555;
|
|
32
35
|
--se-main-border-color: #666;
|
|
33
36
|
--se-main-outline-color: #444;
|
|
34
37
|
--se-main-shadow-color: #222;
|
|
35
38
|
--se-statusbar-font-color: #aaa;
|
|
36
39
|
--se-overlay-background-color: #111;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
--se-
|
|
40
|
-
--se-
|
|
41
|
-
--se-
|
|
42
|
-
--se-
|
|
43
|
-
--se-
|
|
44
|
-
--se-
|
|
45
|
-
--se-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
--se-active-
|
|
40
|
+
|
|
41
|
+
/* hover */
|
|
42
|
+
--se-hover-color: #0d200c;
|
|
43
|
+
--se-hover-dark-color: #8192a3;
|
|
44
|
+
--se-hover-dark2-color: #738495;
|
|
45
|
+
--se-hover-dark3-color: #667788;
|
|
46
|
+
--se-hover-light-color: #9ab0c5;
|
|
47
|
+
--se-hover-light2-color: #adc2d7;
|
|
48
|
+
--se-hover-light3-color: #c0d3e5;
|
|
49
|
+
|
|
50
|
+
/* active */
|
|
51
|
+
--se-active-color: #5cd2e6;
|
|
52
|
+
--se-active-hover-color: #6de9f5;
|
|
53
|
+
--se-active-dark-color: #3bb9cd;
|
|
54
|
+
--se-active-dark2-color: #2a9fb1;
|
|
55
|
+
--se-active-dark3-color: #5cd2e6;
|
|
56
|
+
--se-active-dark4-color: #3bb9cd;
|
|
57
|
+
--se-active-dark5-color: #197d91;
|
|
58
|
+
--se-active-light-color: #17303a;
|
|
59
|
+
--se-active-light2-color: #1e3f4d;
|
|
60
|
+
--se-active-light3-color: #255e6f;
|
|
61
|
+
--se-active-light4-color: #2c7d91;
|
|
62
|
+
--se-active-light5-color: #33aacc;
|
|
63
|
+
--se-active-light6-color: #3bd1f2;
|
|
64
|
+
|
|
65
|
+
/* [toolbar, menu, modal] layer - shadow */
|
|
66
|
+
--se-shadow-layer-color: rgba(0, 64, 128, 0.25);
|
|
67
|
+
|
|
68
|
+
/* drag */
|
|
49
69
|
--se-drag-over-color: #ffcc00;
|
|
70
|
+
|
|
71
|
+
/* modal, browser, dropdown */
|
|
72
|
+
--se-modal-background-color: #1c202a;
|
|
73
|
+
--se-modal-color: #ececec;
|
|
50
74
|
--se-modal-border-color: #555;
|
|
51
75
|
--se-modal-anchor-color: #77aaff;
|
|
52
76
|
--se-modal-preview-color: #aaa;
|
|
77
|
+
--se-modal-file-input-background-color: #232837;
|
|
53
78
|
--se-modal-input-disabled-color: #666;
|
|
54
79
|
--se-modal-input-disabled-background-color: #333;
|
|
80
|
+
|
|
81
|
+
/* dropdown, selectMenu */
|
|
55
82
|
--se-dropdown-font-color: #ccc;
|
|
83
|
+
|
|
84
|
+
/* controller */
|
|
56
85
|
--se-controller-border-color: #555;
|
|
86
|
+
--se-controller-background-color: #091025;
|
|
87
|
+
--se-controller-color: #ececec;
|
|
88
|
+
--se-shadow-controller-color: rgba(80, 200, 255, 0.2);
|
|
89
|
+
|
|
90
|
+
/* button : input-side */
|
|
57
91
|
--se-input-btn-border-color: #444;
|
|
58
92
|
--se-input-btn-disabled-color: #666;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
--se-success-
|
|
62
|
-
--se-success-
|
|
63
|
-
--se-success-
|
|
64
|
-
--se-success-
|
|
65
|
-
--se-success-
|
|
66
|
-
--se-success-
|
|
67
|
-
--se-success-
|
|
68
|
-
--se-
|
|
69
|
-
--se-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
--se-error-
|
|
73
|
-
--se-error-
|
|
74
|
-
--se-error-
|
|
75
|
-
--se-error-
|
|
76
|
-
--se-error-
|
|
77
|
-
--se-
|
|
78
|
-
--se-
|
|
93
|
+
|
|
94
|
+
/* success */
|
|
95
|
+
--se-success-color: #2cb67d;
|
|
96
|
+
--se-success-dark-color: #1f8f65;
|
|
97
|
+
--se-success-dark2-color: #186f4f;
|
|
98
|
+
--se-success-dark3-color: #125f44;
|
|
99
|
+
--se-success-light-color: #3dd9a5;
|
|
100
|
+
--se-success-light2-color: #57e2b7;
|
|
101
|
+
--se-success-light3-color: #8cf0ce;
|
|
102
|
+
--se-success-light4-color: #c1fae4;
|
|
103
|
+
--se-success-light5-color: #e9fef5;
|
|
104
|
+
|
|
105
|
+
/* error */
|
|
106
|
+
--se-error-color: #ef4444;
|
|
107
|
+
--se-error-dark-color: #991b1b;
|
|
108
|
+
--se-error-dark2-color: #7f1d1d;
|
|
109
|
+
--se-error-dark3-color: #651616;
|
|
110
|
+
--se-error-light-color: #f87171;
|
|
111
|
+
--se-error-light2-color: #fca5a5;
|
|
112
|
+
--se-error-light3-color: #fecaca;
|
|
113
|
+
--se-error-light4-color: #fee2e2;
|
|
114
|
+
--se-error-light5-color: #fef2f2;
|
|
115
|
+
|
|
116
|
+
/* document type */
|
|
117
|
+
--se-doc-background: #344153;
|
|
118
|
+
--se-doc-info-page-font-color: #0f1828;
|
|
79
119
|
--se-doc-info-page-background-color: #cfcfcf;
|
|
80
|
-
|
|
81
|
-
--se-doc-info-
|
|
120
|
+
/* document type - font, active */
|
|
121
|
+
--se-doc-info-font-color: #cfcfcf;
|
|
122
|
+
--se-doc-info-active-color: #5599ff;
|
|
123
|
+
|
|
124
|
+
/* loading */
|
|
82
125
|
--se-loading-color: #77aaff;
|
|
126
|
+
|
|
127
|
+
/* show blocks */
|
|
83
128
|
--se-show-blocks-color: #5599ff;
|
|
84
129
|
--se-show-blocks-li-color: #d539ff;
|
|
85
130
|
--se-show-blocks-pre-color: #27c022;
|
|
86
|
-
--se-shadow-layer-color: rgba(255, 255, 255, 0.5);
|
|
87
|
-
--se-shadow-controller-color: rgba(255, 255, 255, 0.2);
|
|
88
131
|
--se-show-blocks-component-color: #f4b124;
|
|
89
132
|
}
|
|
@@ -375,4 +375,27 @@ declare class EventManager {
|
|
|
375
375
|
* @param {Event} e The keyboard event
|
|
376
376
|
*/
|
|
377
377
|
__enterPrevent(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, e: Event): void;
|
|
378
|
+
/**
|
|
379
|
+
* @private
|
|
380
|
+
* @description Scrolls the editor view to the caret position after pressing Enter. (Ignored on mobile devices)
|
|
381
|
+
* @this {EventManagerThis}
|
|
382
|
+
* @param {*} range Range object
|
|
383
|
+
*/
|
|
384
|
+
__enterScrollTo(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, range: any): void;
|
|
385
|
+
/**
|
|
386
|
+
* @private
|
|
387
|
+
* @description Focus Event Postprocessing
|
|
388
|
+
* @this {EventManagerThis}
|
|
389
|
+
* @param {__se__FrameContext} frameContext - frame context object
|
|
390
|
+
* @param {Event} event - Event object
|
|
391
|
+
*/
|
|
392
|
+
__postFocusEvent(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, frameContext: __se__FrameContext, event: Event): void;
|
|
393
|
+
/**
|
|
394
|
+
* @private
|
|
395
|
+
* @description Blur Event Postprocessing
|
|
396
|
+
* @this {EventManagerThis}
|
|
397
|
+
* @param {__se__FrameContext} frameContext - frame context object
|
|
398
|
+
* @param {Event} event - Event object
|
|
399
|
+
*/
|
|
400
|
+
__postBlurEvent(this: Omit<EventManager & Partial<import('../../editorInjector').default>, 'eventManager'>, frameContext: __se__FrameContext, event: Event): void;
|
|
378
401
|
}
|
|
@@ -46,8 +46,9 @@ declare class Char {
|
|
|
46
46
|
/**
|
|
47
47
|
* @this {CharThis}
|
|
48
48
|
* @description Set the char count to charCounter element textContent.
|
|
49
|
+
* @param {?__se__FrameContext=} fc Frame context
|
|
49
50
|
*/
|
|
50
|
-
display(this: Omit<Char & Partial<import('../../editorInjector').default>, 'char'
|
|
51
|
+
display(this: Omit<Char & Partial<import('../../editorInjector').default>, 'char'>, fc?: (__se__FrameContext | null) | undefined): void;
|
|
51
52
|
/**
|
|
52
53
|
* @this {CharThis}
|
|
53
54
|
* @description Returns false if char count is greater than "frameOptions.get('charCounter_max')" when "inputText" is added to the current editor.
|
|
@@ -67,6 +67,7 @@ declare class Component {
|
|
|
67
67
|
_bindClose_touchstart: __se__GlobalEventInfo | void;
|
|
68
68
|
/** @type {boolean} */
|
|
69
69
|
__selectionSelected: boolean;
|
|
70
|
+
__prevent: boolean;
|
|
70
71
|
/**
|
|
71
72
|
* @this {ComponentThis}
|
|
72
73
|
* @description Inserts an element and returns it. (Used for elements: table, hr, image, video)
|
|
@@ -104,10 +105,19 @@ declare class Component {
|
|
|
104
105
|
* @description The component(media, file component, table, etc) is selected and the resizing module is called.
|
|
105
106
|
* @param {Node} element Target element
|
|
106
107
|
* @param {string} pluginName The plugin name for the selected target.
|
|
107
|
-
* @param {
|
|
108
|
-
* @param {boolean} [
|
|
108
|
+
* @param {Object} [options] Options
|
|
109
|
+
* @param {boolean} [options.isInput=false] Whether the target is an input component.(table)
|
|
109
110
|
*/
|
|
110
|
-
select(
|
|
111
|
+
select(
|
|
112
|
+
this: Omit<Component & Partial<import('../../editorInjector').default>, 'component'>,
|
|
113
|
+
element: Node,
|
|
114
|
+
pluginName: string,
|
|
115
|
+
{
|
|
116
|
+
isInput
|
|
117
|
+
}?: {
|
|
118
|
+
isInput?: boolean;
|
|
119
|
+
}
|
|
120
|
+
): boolean;
|
|
111
121
|
/**
|
|
112
122
|
* @this {ComponentThis}
|
|
113
123
|
* @description Deselects the selected component.
|
|
@@ -49,7 +49,7 @@ declare class Format {
|
|
|
49
49
|
_formatClosureBlockCheck: any;
|
|
50
50
|
_formatClosureBrLineCheck: any;
|
|
51
51
|
_textStyleTagsCheck: RegExp;
|
|
52
|
-
_brLineBreak:
|
|
52
|
+
_brLineBreak: boolean;
|
|
53
53
|
/**
|
|
54
54
|
* @this {FormatThis}
|
|
55
55
|
* @description Replace the line tag of the current selection.
|
|
@@ -613,4 +613,11 @@ declare class Format {
|
|
|
613
613
|
* @param {Array|null} styleArray Refer style array
|
|
614
614
|
*/
|
|
615
615
|
_sn_resetCommonListCell(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, el: Node, styleArray: any[] | null): boolean;
|
|
616
|
+
/**
|
|
617
|
+
* @private
|
|
618
|
+
* @this {FormatThis}
|
|
619
|
+
* @description Reset the line break format.
|
|
620
|
+
* @param {"line"|"br"} breakFormat options.get('defaultLineBreakFormat')
|
|
621
|
+
*/
|
|
622
|
+
__resetBrLineBreak(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, breakFormat: 'line' | 'br'): void;
|
|
616
623
|
}
|
|
@@ -419,4 +419,12 @@ declare class HTML {
|
|
|
419
419
|
* @returns {Node} The cleaned node with redundant styles removed.
|
|
420
420
|
*/
|
|
421
421
|
_dupleCheck(this: Omit<HTML & Partial<import('../../editorInjector').default>, 'html'>, oNode: Node, parentNode: Node): Node;
|
|
422
|
+
/**
|
|
423
|
+
* @private
|
|
424
|
+
* @this {HTMLThis}
|
|
425
|
+
* @description Reset autoStyleify options.
|
|
426
|
+
* @param {Array.<string>} autoStyleify Styles applied automatically on text input.
|
|
427
|
+
* - ex ["bold", "underline", "italic", "strike"]
|
|
428
|
+
*/
|
|
429
|
+
__resetAutoStyleify(this: Omit<HTML & Partial<import('../../editorInjector').default>, 'html'>, autoStyleify: Array<string>): void;
|
|
422
430
|
}
|
|
@@ -46,6 +46,8 @@ declare class Menu {
|
|
|
46
46
|
_bindClose_dropdown_key: any;
|
|
47
47
|
_bindClose_cons_mouse: any;
|
|
48
48
|
currentDropdownPlugin: any;
|
|
49
|
+
__menuBtn: Node;
|
|
50
|
+
__menuContainer: HTMLElement;
|
|
49
51
|
/**
|
|
50
52
|
* @this {MenuThis}
|
|
51
53
|
* @description Method for managing dropdown element.
|
|
@@ -94,6 +96,12 @@ declare class Menu {
|
|
|
94
96
|
* @param {HTMLElement} menu Menu element
|
|
95
97
|
*/
|
|
96
98
|
_setMenuPosition(this: Omit<Menu & Partial<import('../../editorInjector').default>, 'menu'>, element: Node, menu: HTMLElement): void;
|
|
99
|
+
/**
|
|
100
|
+
* @private
|
|
101
|
+
* @this {MenuThis}
|
|
102
|
+
* @description Restore the last menu position using previously stored button and menu elements.
|
|
103
|
+
*/
|
|
104
|
+
_restoreMenuPosition(this: Omit<Menu & Partial<import('../../editorInjector').default>, 'menu'>): void;
|
|
97
105
|
/**
|
|
98
106
|
* @private
|
|
99
107
|
* @this {MenuThis}
|
package/types/core/class/ui.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ declare class UI {
|
|
|
38
38
|
_toastToggle: number;
|
|
39
39
|
/**
|
|
40
40
|
* @this {UIThis}
|
|
41
|
-
* @description
|
|
41
|
+
* @description set editor frame styles.
|
|
42
42
|
* - Define the style of the edit area
|
|
43
43
|
* - It can also be defined with the "setOptions" method, but the "setEditorStyle" method does not render the editor again.
|
|
44
44
|
* @param {string} style Style string
|
package/types/core/editor.d.ts
CHANGED
|
@@ -333,10 +333,15 @@ declare class Editor {
|
|
|
333
333
|
*/
|
|
334
334
|
_notHideToolbar: boolean;
|
|
335
335
|
/**
|
|
336
|
-
* @description Variables for controlling
|
|
336
|
+
* @description Variables for controlling blur events
|
|
337
337
|
* @type {boolean}
|
|
338
338
|
*/
|
|
339
339
|
_preventBlur: boolean;
|
|
340
|
+
/**
|
|
341
|
+
* @description Variables for controlling focus events
|
|
342
|
+
* @type {boolean}
|
|
343
|
+
*/
|
|
344
|
+
_preventFocus: boolean;
|
|
340
345
|
/**
|
|
341
346
|
* @description Variables for controlling selection change events
|
|
342
347
|
*/
|
|
@@ -570,7 +575,7 @@ declare class Editor {
|
|
|
570
575
|
__saveCommandButtons(cmdButtons: Map<string, Element>, tray: Element): void;
|
|
571
576
|
/**
|
|
572
577
|
* @private
|
|
573
|
-
* @description Caches shortcut keys for commands.
|
|
578
|
+
* @description Caches custom(starts with "_") shortcut keys for commands.
|
|
574
579
|
*/
|
|
575
580
|
__cachingShortcuts(): void;
|
|
576
581
|
/**
|