@worktile/theia 1.2.12 → 1.2.16
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/bundles/worktile-theia.umd.js +312 -127
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/components/inline-toolbar/inline-toolbar.component.d.ts +3 -1
- package/constants/default.d.ts +0 -1
- package/editor.component.d.ts +1 -0
- package/esm2015/components/inline-toolbar/inline-toolbar.component.js +10 -7
- package/esm2015/components/toolbar-item/toolbar-item.component.js +7 -3
- package/esm2015/constants/default.js +1 -2
- package/esm2015/editor.component.js +23 -12
- package/esm2015/interfaces/editor.js +1 -1
- package/esm2015/interfaces/toolbar.js +1 -1
- package/esm2015/plugins/code/code.component.js +4 -1
- package/esm2015/plugins/common/block-card.plugin.js +51 -5
- package/esm2015/plugins/deserializers/deserialize-html.plugin.js +7 -1
- package/esm2015/plugins/deserializers/deserialize-md.plugin.js +7 -2
- package/esm2015/plugins/index.js +14 -2
- package/esm2015/plugins/mark/options.js +6 -1
- package/esm2015/plugins/paint-format/options.js +4 -1
- package/esm2015/plugins/placeholder/placeholder.component.js +19 -12
- package/esm2015/plugins/quick-insert/components/quick-insert.component.js +7 -6
- package/esm2015/plugins/soft-break/soft-break.plugin.js +18 -0
- package/esm2015/plugins/soft-break/soft-break.types.js +2 -0
- package/esm2015/plugins/table/table.editor.js +10 -2
- package/esm2015/plugins/table/table.plugin.js +84 -71
- package/esm2015/plugins/table/utils/calc-span.js +2 -2
- package/esm2015/plugins/table/utils/normalize-table.js +31 -0
- package/esm2015/plugins/table/utils/table-position.js +5 -2
- package/esm2015/queries/is-empty-paragraph.js +6 -2
- package/esm2015/services/context.service.js +10 -2
- package/esm2015/utils/auto-focus.js +2 -2
- package/esm2015/utils/common.js +3 -0
- package/esm2015/utils/fragment.js +5 -2
- package/esm2015/utils/index.js +2 -1
- package/fesm2015/worktile-theia.js +300 -114
- package/fesm2015/worktile-theia.js.map +1 -1
- package/interfaces/editor.d.ts +2 -0
- package/interfaces/toolbar.d.ts +1 -0
- package/package.json +1 -1
- package/plugins/image/image.component.scss +172 -168
- package/plugins/placeholder/placeholder.component.d.ts +4 -2
- package/plugins/soft-break/soft-break.plugin.d.ts +4 -0
- package/plugins/soft-break/soft-break.types.d.ts +8 -0
- package/plugins/table/table.editor.d.ts +2 -0
- package/plugins/table/utils/calc-span.d.ts +1 -1
- package/plugins/table/utils/normalize-table.d.ts +2 -0
- package/services/context.service.d.ts +2 -0
- package/styles/editor.scss +3 -3
- package/styles/typo.scss +5 -2
- package/utils/common.d.ts +2 -0
- package/utils/index.d.ts +1 -0
|
@@ -376,7 +376,6 @@
|
|
|
376
376
|
var ZERO_WIDTH_CHAR = '\u200B';
|
|
377
377
|
var CLIPBOARD_FORMAT_KEY = 'x-theia-fragment';
|
|
378
378
|
var DEFAULT_SCROLL_CONTAINER = '.the-editable-container';
|
|
379
|
-
var BLOCK_INSERT_ORIGIN = 'block-insert';
|
|
380
379
|
var ELEMENT_UNIQUE_ID = 'key';
|
|
381
380
|
exports.TheMode = void 0;
|
|
382
381
|
(function (TheMode) {
|
|
@@ -829,7 +828,11 @@
|
|
|
829
828
|
};
|
|
830
829
|
|
|
831
830
|
var isEmptyParagraph = function (editor, at) {
|
|
832
|
-
var
|
|
831
|
+
var entry = getAnchorBlockEntry(editor, at);
|
|
832
|
+
if (!entry) {
|
|
833
|
+
return false;
|
|
834
|
+
}
|
|
835
|
+
var _a = __read(entry, 1), block = _a[0];
|
|
833
836
|
return slate.Editor.isEmpty(editor, block) && block.type === exports.ElementKinds.paragraph;
|
|
834
837
|
};
|
|
835
838
|
|
|
@@ -1421,6 +1424,9 @@
|
|
|
1421
1424
|
if (fragment) {
|
|
1422
1425
|
var decoded = decodeURIComponent(window.atob(fragment));
|
|
1423
1426
|
var nodes = JSON.parse(decoded);
|
|
1427
|
+
if (!Array.isArray(nodes)) {
|
|
1428
|
+
nodes = [nodes];
|
|
1429
|
+
}
|
|
1424
1430
|
// delete key to avoid duplicate keys
|
|
1425
1431
|
if (deleteKey) {
|
|
1426
1432
|
deleteElementKey(nodes, deleteKey);
|
|
@@ -2375,6 +2381,9 @@
|
|
|
2375
2381
|
return "the-toolbar-" + uuid;
|
|
2376
2382
|
};
|
|
2377
2383
|
|
|
2384
|
+
var IS_MAC = typeof window != 'undefined' && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
|
|
2385
|
+
var CONTROL_KEY = IS_MAC ? '⌘' : 'Ctrl';
|
|
2386
|
+
|
|
2378
2387
|
var withDeserializeMd = function (options) { return function (editor) {
|
|
2379
2388
|
var insertData = editor.insertData, onKeydown = editor.onKeydown;
|
|
2380
2389
|
editor.onKeydown = function (event) {
|
|
@@ -2415,8 +2424,13 @@
|
|
|
2415
2424
|
});
|
|
2416
2425
|
return;
|
|
2417
2426
|
}
|
|
2427
|
+
else {
|
|
2428
|
+
closeConversionHint(editor);
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
catch (error) {
|
|
2432
|
+
closeConversionHint(editor);
|
|
2418
2433
|
}
|
|
2419
|
-
catch (error) { }
|
|
2420
2434
|
}
|
|
2421
2435
|
},
|
|
2422
2436
|
origin: origin,
|
|
@@ -2652,10 +2666,18 @@
|
|
|
2652
2666
|
};
|
|
2653
2667
|
TheContextService.prototype.getOptions = function () {
|
|
2654
2668
|
if (!this.options.width) {
|
|
2655
|
-
|
|
2669
|
+
var firstElementChild = this.getFirstElementChild();
|
|
2670
|
+
this.options.width = firstElementChild.offsetWidth;
|
|
2656
2671
|
}
|
|
2657
2672
|
return this.options;
|
|
2658
2673
|
};
|
|
2674
|
+
TheContextService.prototype.getEditableElement = function () {
|
|
2675
|
+
return this.options.nativeElement.querySelector('.the-editor-typo');
|
|
2676
|
+
};
|
|
2677
|
+
TheContextService.prototype.getFirstElementChild = function () {
|
|
2678
|
+
var editableElement = this.getEditableElement();
|
|
2679
|
+
return editableElement === null || editableElement === void 0 ? void 0 : editableElement.firstElementChild;
|
|
2680
|
+
};
|
|
2659
2681
|
TheContextService.prototype.setUploadFileList = function (file) {
|
|
2660
2682
|
this.fileList.push(file);
|
|
2661
2683
|
};
|
|
@@ -4709,20 +4731,66 @@
|
|
|
4709
4731
|
// block card cursor
|
|
4710
4732
|
if (anchorNode && i1.hasBlockCard(domSelection)) {
|
|
4711
4733
|
var isCardLeftCursor = i1.isCardLeft(anchorNode);
|
|
4712
|
-
|
|
4713
|
-
if ((isMoveDown && isCardLeftCursor) || (isMoveForward && !isCardLeftCursor)) {
|
|
4714
|
-
nativeEvent.preventDefault();
|
|
4734
|
+
if (isMoveUp) {
|
|
4715
4735
|
var _a = __read(i1.AngularEditor.toSlateCardEntry(editor, anchorNode), 2), path = _a[1];
|
|
4736
|
+
var previousPath = slate.Path.hasPrevious(path) && slate.Path.previous(path);
|
|
4737
|
+
var previousNode = previousPath && getNode(editor, previousPath);
|
|
4738
|
+
if (previousNode && editor.isBlockCard(previousNode)) {
|
|
4739
|
+
i1.AngularEditor.moveBlockCard(editor, previousNode, { direction: isCardLeftCursor ? 'left' : 'right' });
|
|
4740
|
+
}
|
|
4741
|
+
else {
|
|
4742
|
+
var before = slate.Editor.before(editor, path);
|
|
4743
|
+
if (before) {
|
|
4744
|
+
slate.Transforms.select(editor, before);
|
|
4745
|
+
}
|
|
4746
|
+
}
|
|
4747
|
+
nativeEvent.preventDefault();
|
|
4748
|
+
return;
|
|
4749
|
+
}
|
|
4750
|
+
if (isMoveDown) {
|
|
4751
|
+
var _b = __read(i1.AngularEditor.toSlateCardEntry(editor, anchorNode), 2), path = _b[1];
|
|
4752
|
+
var nextPath = slate.Path.next(path);
|
|
4753
|
+
var nextNode = getNode(editor, nextPath);
|
|
4754
|
+
if (nextNode && editor.isBlockCard(nextNode)) {
|
|
4755
|
+
i1.AngularEditor.moveBlockCard(editor, nextNode, { direction: isCardLeftCursor ? 'left' : 'right' });
|
|
4756
|
+
}
|
|
4757
|
+
else {
|
|
4758
|
+
var after = slate.Editor.after(editor, path);
|
|
4759
|
+
if (after) {
|
|
4760
|
+
slate.Transforms.select(editor, slate.Editor.after(editor, path));
|
|
4761
|
+
}
|
|
4762
|
+
}
|
|
4763
|
+
nativeEvent.preventDefault();
|
|
4764
|
+
return;
|
|
4765
|
+
}
|
|
4766
|
+
// → + right-block-card
|
|
4767
|
+
if ((isMoveForward && !isCardLeftCursor)) {
|
|
4768
|
+
nativeEvent.preventDefault();
|
|
4769
|
+
var _c = __read(i1.AngularEditor.toSlateCardEntry(editor, anchorNode), 2), path = _c[1];
|
|
4770
|
+
var nextPath = slate.Path.next(path);
|
|
4771
|
+
var nextNode = getNode(editor, nextPath);
|
|
4772
|
+
if (nextNode && editor.isBlockCard(nextNode)) {
|
|
4773
|
+
event.preventDefault();
|
|
4774
|
+
i1.AngularEditor.moveBlockCard(editor, nextNode, { direction: 'left' });
|
|
4775
|
+
return;
|
|
4776
|
+
}
|
|
4716
4777
|
var after = slate.Editor.after(editor, path);
|
|
4717
4778
|
if (after) {
|
|
4718
4779
|
slate.Transforms.select(editor, slate.Editor.after(editor, path));
|
|
4719
4780
|
}
|
|
4720
4781
|
return;
|
|
4721
4782
|
}
|
|
4722
|
-
//
|
|
4723
|
-
if (
|
|
4783
|
+
// ← + left-block-card
|
|
4784
|
+
if (isMoveBackward && isCardLeftCursor) {
|
|
4724
4785
|
nativeEvent.preventDefault();
|
|
4725
|
-
var
|
|
4786
|
+
var _d = __read(i1.AngularEditor.toSlateCardEntry(editor, anchorNode), 2), path = _d[1];
|
|
4787
|
+
var previousPath = slate.Path.hasPrevious(path) && slate.Path.previous(path);
|
|
4788
|
+
var previousNode = previousPath && getNode(editor, previousPath);
|
|
4789
|
+
if (previousNode && editor.isBlockCard(previousNode)) {
|
|
4790
|
+
event.preventDefault();
|
|
4791
|
+
i1.AngularEditor.moveBlockCard(editor, previousNode, { direction: 'right' });
|
|
4792
|
+
return;
|
|
4793
|
+
}
|
|
4726
4794
|
var before = slate.Editor.before(editor, path);
|
|
4727
4795
|
if (before) {
|
|
4728
4796
|
slate.Transforms.select(editor, before);
|
|
@@ -4732,14 +4800,14 @@
|
|
|
4732
4800
|
// move to card center
|
|
4733
4801
|
if ((isCardLeftCursor && isMoveForward) || (!isCardLeftCursor && isMoveBackward)) {
|
|
4734
4802
|
nativeEvent.preventDefault();
|
|
4735
|
-
var
|
|
4803
|
+
var _e = __read(i1.AngularEditor.toSlateCardEntry(editor, anchorNode), 2), path = _e[1];
|
|
4736
4804
|
slate.Transforms.select(editor, isCardLeftCursor ? slate.Editor.start(editor, path) : slate.Editor.end(editor, path));
|
|
4737
4805
|
return;
|
|
4738
4806
|
}
|
|
4739
4807
|
}
|
|
4740
4808
|
// block card center
|
|
4741
4809
|
if (isCollapsed && (isMoveUp || isMoveDown) && anchorEntry) {
|
|
4742
|
-
var
|
|
4810
|
+
var _f = __read(anchorEntry, 2), block = _f[0], path = _f[1];
|
|
4743
4811
|
if (editor.isBlockCard(block)) {
|
|
4744
4812
|
event.preventDefault();
|
|
4745
4813
|
slate.Transforms.select(editor, isMoveUp ? slate.Editor.before(editor, path) : slate.Editor.after(editor, path));
|
|
@@ -4747,7 +4815,7 @@
|
|
|
4747
4815
|
}
|
|
4748
4816
|
}
|
|
4749
4817
|
if (isCollapsed && (isMoveBackward || isMoveForward) && anchorEntry) {
|
|
4750
|
-
var
|
|
4818
|
+
var _g = __read(anchorEntry, 1), block = _g[0];
|
|
4751
4819
|
if (editor.isBlockCard(block)) {
|
|
4752
4820
|
event.preventDefault();
|
|
4753
4821
|
i1.AngularEditor.moveBlockCard(editor, block, { direction: isMoveBackward ? 'left' : 'right' });
|
|
@@ -5133,11 +5201,14 @@
|
|
|
5133
5201
|
columnIndex++;
|
|
5134
5202
|
nextCell = this.table.children[rowIndex].children[columnIndex];
|
|
5135
5203
|
}
|
|
5136
|
-
else {
|
|
5204
|
+
else if (rowIndex + 1 < this.getHeight()) {
|
|
5137
5205
|
columnIndex = 0;
|
|
5138
5206
|
rowIndex++;
|
|
5139
5207
|
nextCell = this.table.children[rowIndex].children[columnIndex];
|
|
5140
5208
|
}
|
|
5209
|
+
else {
|
|
5210
|
+
nextCell = null;
|
|
5211
|
+
}
|
|
5141
5212
|
}
|
|
5142
5213
|
return nextCell;
|
|
5143
5214
|
};
|
|
@@ -5289,7 +5360,7 @@
|
|
|
5289
5360
|
return rowspans.some(function (rowspan) { return isInside(rowspan, rowIndx, targetIndex); });
|
|
5290
5361
|
});
|
|
5291
5362
|
}
|
|
5292
|
-
function
|
|
5363
|
+
function getOriginCell(table, targetRowIndex, targetColumnIndex) {
|
|
5293
5364
|
var _loop_1 = function (rowIndex) {
|
|
5294
5365
|
var row = table.children[rowIndex];
|
|
5295
5366
|
var originCell = row.children
|
|
@@ -5812,6 +5883,13 @@
|
|
|
5812
5883
|
isActiveHeader: function (editor) {
|
|
5813
5884
|
var _a = __read(slate.Editor.nodes(editor, { match: function (n) { return n.type === exports.ElementKinds.tableRow; } }), 1), tableRowEntry = _a[0];
|
|
5814
5885
|
return tableRowEntry && tableRowEntry[0] && tableRowEntry[0].header;
|
|
5886
|
+
},
|
|
5887
|
+
selectOriginCell: function (editor, table, rowIndex, columnIndex, isStart) {
|
|
5888
|
+
var origin = getOriginCell(table, rowIndex, columnIndex);
|
|
5889
|
+
if (origin) {
|
|
5890
|
+
var path = i1.AngularEditor.findPath(editor, origin);
|
|
5891
|
+
slate.Transforms.select(editor, isStart ? slate.Editor.start(editor, path) : slate.Editor.end(editor, path));
|
|
5892
|
+
}
|
|
5815
5893
|
}
|
|
5816
5894
|
};
|
|
5817
5895
|
|
|
@@ -5847,6 +5925,7 @@
|
|
|
5847
5925
|
key: exports.MarkTypes.bold,
|
|
5848
5926
|
icon: 'bold',
|
|
5849
5927
|
name: '加粗',
|
|
5928
|
+
shortcutKey: CONTROL_KEY + "+B",
|
|
5850
5929
|
execute: function (editor) { return MarkEditor.toggleMark(editor, exports.MarkTypes.bold); },
|
|
5851
5930
|
active: function (editor) { return MarkEditor.isMarkActive(editor, exports.MarkTypes.bold); }
|
|
5852
5931
|
},
|
|
@@ -5854,6 +5933,7 @@
|
|
|
5854
5933
|
key: exports.MarkTypes.italic,
|
|
5855
5934
|
icon: 'italic',
|
|
5856
5935
|
name: '斜体',
|
|
5936
|
+
shortcutKey: CONTROL_KEY + "+I",
|
|
5857
5937
|
execute: function (editor) { return MarkEditor.toggleMark(editor, exports.MarkTypes.italic); },
|
|
5858
5938
|
active: function (editor) { return MarkEditor.isMarkActive(editor, exports.MarkTypes.italic); }
|
|
5859
5939
|
},
|
|
@@ -5868,6 +5948,7 @@
|
|
|
5868
5948
|
key: exports.MarkTypes.underline,
|
|
5869
5949
|
icon: 'underline',
|
|
5870
5950
|
name: '下划线',
|
|
5951
|
+
shortcutKey: CONTROL_KEY + "+U",
|
|
5871
5952
|
execute: function (editor) { return MarkEditor.toggleMark(editor, exports.MarkTypes.underline); },
|
|
5872
5953
|
active: function (editor) { return MarkEditor.isMarkActive(editor, exports.MarkTypes.underline); }
|
|
5873
5954
|
},
|
|
@@ -5875,6 +5956,7 @@
|
|
|
5875
5956
|
key: exports.MarkTypes.codeLine,
|
|
5876
5957
|
icon: 'code',
|
|
5877
5958
|
name: '行内代码',
|
|
5959
|
+
shortcutKey: CONTROL_KEY + "+E",
|
|
5878
5960
|
execute: function (editor) { return MarkEditor.toggleMark(editor, exports.MarkTypes.codeLine); },
|
|
5879
5961
|
active: function (editor) { return MarkEditor.isMarkActive(editor, exports.MarkTypes.codeLine); }
|
|
5880
5962
|
}
|
|
@@ -6840,6 +6922,9 @@
|
|
|
6840
6922
|
if (this.options.mode !== this.element.language) {
|
|
6841
6923
|
this.useMode();
|
|
6842
6924
|
}
|
|
6925
|
+
if (!this.readonly && this.isCollapsed) {
|
|
6926
|
+
this.initializeCodemirrorFocus();
|
|
6927
|
+
}
|
|
6843
6928
|
}
|
|
6844
6929
|
};
|
|
6845
6930
|
TheCodeComponent.prototype.ngOnInit = function () {
|
|
@@ -10599,8 +10684,38 @@
|
|
|
10599
10684
|
args: ['cellInner', { static: true }]
|
|
10600
10685
|
}] } });
|
|
10601
10686
|
|
|
10687
|
+
var normalizeTable = function (table) {
|
|
10688
|
+
var normalizedNodes = [];
|
|
10689
|
+
var rowHeight = table.children.length;
|
|
10690
|
+
var columnWidth = table.children[0].children.length;
|
|
10691
|
+
table.children.forEach(function (row, rowIndex) {
|
|
10692
|
+
row.children.forEach(function (cell, columnIndex) {
|
|
10693
|
+
// case 1
|
|
10694
|
+
if (cell.colspan || cell.rowspan) {
|
|
10695
|
+
var rowspan = cell.rowspan || 1;
|
|
10696
|
+
var colspan = cell.colspan || 1;
|
|
10697
|
+
if (rowspan > rowHeight - rowIndex) {
|
|
10698
|
+
cell.rowspan = rowHeight - rowIndex;
|
|
10699
|
+
}
|
|
10700
|
+
if (colspan > columnWidth - columnIndex) {
|
|
10701
|
+
cell.colspan = columnWidth - columnIndex;
|
|
10702
|
+
}
|
|
10703
|
+
return;
|
|
10704
|
+
}
|
|
10705
|
+
// case 2
|
|
10706
|
+
if (cell.hidden && !normalizedNodes.includes(cell)) {
|
|
10707
|
+
var origin = getOriginCell(table, rowIndex, columnIndex);
|
|
10708
|
+
if (!origin) {
|
|
10709
|
+
delete table.children[rowIndex].children[columnIndex].hidden;
|
|
10710
|
+
}
|
|
10711
|
+
}
|
|
10712
|
+
});
|
|
10713
|
+
});
|
|
10714
|
+
return table;
|
|
10715
|
+
};
|
|
10716
|
+
|
|
10602
10717
|
var withTable = function (editor) {
|
|
10603
|
-
var deleteBackward = editor.deleteBackward, deleteForward = editor.deleteForward, onKeydown = editor.onKeydown, setFragmentData = editor.setFragmentData, insertData = editor.insertData, normalizeNode = editor.normalizeNode, isBlockCard = editor.isBlockCard, renderElement = editor.renderElement, deleteCutData = editor.deleteCutData, isContainer = editor.isContainer;
|
|
10718
|
+
var deleteBackward = editor.deleteBackward, deleteForward = editor.deleteForward, onKeydown = editor.onKeydown, setFragmentData = editor.setFragmentData, insertData = editor.insertData, normalizeNode = editor.normalizeNode, isBlockCard = editor.isBlockCard, renderElement = editor.renderElement, deleteCutData = editor.deleteCutData, isContainer = editor.isContainer, onChange = editor.onChange;
|
|
10604
10719
|
editor.deleteBackward = function (unit) {
|
|
10605
10720
|
var opts = new TableOptions$1();
|
|
10606
10721
|
if (!isSelectionInTable(opts, editor)) {
|
|
@@ -10671,13 +10786,11 @@
|
|
|
10671
10786
|
var aboveCell = aboveRow && aboveRow.children[startPosition.getColumnIndex()];
|
|
10672
10787
|
if (aboveCell) {
|
|
10673
10788
|
if (aboveCell.hidden) {
|
|
10674
|
-
|
|
10675
|
-
|
|
10676
|
-
at = slate.Editor.start(editor, TheEditor.findPath(editor, originSpan));
|
|
10677
|
-
}
|
|
10789
|
+
TableEditor.selectOriginCell(editor, startPosition.table, startPosition.getRowIndex() - 1, startPosition.getColumnIndex(), false);
|
|
10790
|
+
return;
|
|
10678
10791
|
}
|
|
10679
10792
|
else {
|
|
10680
|
-
at = slate.Editor.
|
|
10793
|
+
at = slate.Editor.end(editor, TheEditor.findPath(editor, aboveCell));
|
|
10681
10794
|
}
|
|
10682
10795
|
}
|
|
10683
10796
|
else {
|
|
@@ -10706,10 +10819,8 @@
|
|
|
10706
10819
|
var belowCell = belowRow && belowRow.children[startPosition.getColumnIndex()];
|
|
10707
10820
|
if (belowCell) {
|
|
10708
10821
|
if (belowCell.hidden) {
|
|
10709
|
-
|
|
10710
|
-
|
|
10711
|
-
at = slate.Editor.start(editor, TheEditor.findPath(editor, originSpan));
|
|
10712
|
-
}
|
|
10822
|
+
TableEditor.selectOriginCell(editor, startPosition.table, startPosition.getRowIndex() + 1, startPosition.getColumnIndex(), true);
|
|
10823
|
+
return;
|
|
10713
10824
|
}
|
|
10714
10825
|
else {
|
|
10715
10826
|
at = slate.Editor.start(editor, TheEditor.findPath(editor, belowCell));
|
|
@@ -10728,18 +10839,27 @@
|
|
|
10728
10839
|
var beforePoint = slate.Editor.before(editor, editor.selection);
|
|
10729
10840
|
var beforePosition = beforePoint && TablePosition.create(opts, editor, beforePoint.path);
|
|
10730
10841
|
if (beforePosition && beforePosition.cell && beforePosition.cell.hidden) {
|
|
10842
|
+
event.preventDefault();
|
|
10731
10843
|
var at = slate.Editor.end(editor, TheEditor.findPath(editor, beforePosition.findPrevious()));
|
|
10732
10844
|
slate.Transforms.select(editor, at);
|
|
10733
|
-
event.preventDefault();
|
|
10734
10845
|
}
|
|
10735
10846
|
}
|
|
10736
10847
|
if (isMoveForward) {
|
|
10737
10848
|
var afterPoint = slate.Editor.after(editor, editor.selection);
|
|
10738
10849
|
var afterPosition = afterPoint && TablePosition.create(opts, editor, afterPoint.path);
|
|
10739
10850
|
if (afterPosition.cell && afterPosition.cell.hidden) {
|
|
10740
|
-
var at = slate.Editor.start(editor, TheEditor.findPath(editor, afterPosition.findNext()));
|
|
10741
|
-
slate.Transforms.select(editor, at);
|
|
10742
10851
|
event.preventDefault();
|
|
10852
|
+
var nextCell = afterPosition.findNext();
|
|
10853
|
+
if (nextCell) {
|
|
10854
|
+
var at = slate.Editor.start(editor, TheEditor.findPath(editor, afterPosition.findNext()));
|
|
10855
|
+
slate.Transforms.select(editor, at);
|
|
10856
|
+
event.preventDefault();
|
|
10857
|
+
}
|
|
10858
|
+
else {
|
|
10859
|
+
i1.AngularEditor.moveBlockCard(editor, startPosition.tableEntry[0], { direction: 'right' });
|
|
10860
|
+
event.preventDefault();
|
|
10861
|
+
}
|
|
10862
|
+
return;
|
|
10743
10863
|
}
|
|
10744
10864
|
}
|
|
10745
10865
|
// Prevent deleting cells in the table
|
|
@@ -10777,49 +10897,26 @@
|
|
|
10777
10897
|
return;
|
|
10778
10898
|
}
|
|
10779
10899
|
var selection = editor.selection;
|
|
10780
|
-
var
|
|
10781
|
-
var tableComponent = i1.ELEMENT_TO_COMPONENT.get(
|
|
10900
|
+
var tablePosition = TablePosition.create(opts, editor, selection.anchor.path);
|
|
10901
|
+
var tableComponent = i1.ELEMENT_TO_COMPONENT.get(tablePosition.table);
|
|
10782
10902
|
var cells = tableComponent.tableStore.selectedCells;
|
|
10783
|
-
var
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
var
|
|
10790
|
-
var selectedRowsIndex = tableComponent.tableStore.selectedRowsIndex || [];
|
|
10791
|
-
var _loop_1 = function (cell) {
|
|
10792
|
-
var row = cell.row, col = cell.col;
|
|
10793
|
-
var cellPath = __spreadArray(__spreadArray([], __read(element.tableEntry[1])), [row, col]);
|
|
10794
|
-
cellNode = slate.Node.get(editor, cellPath);
|
|
10795
|
-
var cellRange = slate.Editor.range(editor, cellPath);
|
|
10796
|
-
var domRange = i1.AngularEditor.toDOMRange(editor, cellRange);
|
|
10797
|
-
if (!contents) {
|
|
10798
|
-
contents = domRange.cloneContents();
|
|
10799
|
-
}
|
|
10800
|
-
else {
|
|
10801
|
-
contents.append(domRange.cloneContents());
|
|
10802
|
-
}
|
|
10803
|
-
if ((selectedColumnsIndex.length === 1 && cellNode.colspan > 1) ||
|
|
10804
|
-
(selectedRowsIndex.length === 1 && cellNode.rowspan > 1)) {
|
|
10805
|
-
cellNode = Object.assign(Object.assign({}, cellNode), { colspan: selectedColumnsIndex.length === 1 ? null : cellNode.colspan, rowspan: selectedRowsIndex.length === 1 ? null : cellNode.rowspan });
|
|
10806
|
-
}
|
|
10807
|
-
if (cellNode.hidden) {
|
|
10808
|
-
var origin_1 = calcOriginSpan(element.table, row, col);
|
|
10809
|
-
var selectedOrigin = origin_1 && selectNodes.filter(function (item) { return item.node.key === origin_1.key; });
|
|
10810
|
-
if (!selectedOrigin || !selectedOrigin.length) {
|
|
10811
|
-
cellNode = Object.assign(Object.assign({}, cellNode), { hidden: null });
|
|
10812
|
-
}
|
|
10813
|
-
}
|
|
10814
|
-
if (!tableContent[row]) {
|
|
10815
|
-
tableContent[row] = [];
|
|
10816
|
-
}
|
|
10817
|
-
tableContent[row].push(cellNode);
|
|
10818
|
-
};
|
|
10903
|
+
var tableFragment = null;
|
|
10904
|
+
if (tableComponent.tableStore.selectedRowsIndex.length > 0) {
|
|
10905
|
+
var rows = tablePosition.table.children.slice(tableComponent.tableStore.selectedRowsIndex[0], tableComponent.tableStore.selectedRowsIndex[tableComponent.tableStore.selectedRowsIndex.length - 1] + 1);
|
|
10906
|
+
tableFragment = Object.assign(Object.assign({}, tablePosition.table), { children: rows });
|
|
10907
|
+
}
|
|
10908
|
+
else if (cells.length > 0) {
|
|
10909
|
+
var tempRows = {};
|
|
10819
10910
|
try {
|
|
10820
10911
|
for (var cells_1 = __values(cells), cells_1_1 = cells_1.next(); !cells_1_1.done; cells_1_1 = cells_1.next()) {
|
|
10821
10912
|
var cell = cells_1_1.value;
|
|
10822
|
-
|
|
10913
|
+
var row = cell.row, col = cell.col;
|
|
10914
|
+
var cellPath = __spreadArray(__spreadArray([], __read(tablePosition.tableEntry[1])), [row, col]);
|
|
10915
|
+
var cellNode = slate.Node.get(editor, cellPath);
|
|
10916
|
+
if (!tempRows[row]) {
|
|
10917
|
+
tempRows[row] = [];
|
|
10918
|
+
}
|
|
10919
|
+
tempRows[row].push(cellNode);
|
|
10823
10920
|
}
|
|
10824
10921
|
}
|
|
10825
10922
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -10829,28 +10926,26 @@
|
|
|
10829
10926
|
}
|
|
10830
10927
|
finally { if (e_1) throw e_1.error; }
|
|
10831
10928
|
}
|
|
10832
|
-
var
|
|
10929
|
+
var rows = Object.values(tempRows).map(function (item) {
|
|
10930
|
+
return {
|
|
10931
|
+
type: exports.ElementKinds.tableRow,
|
|
10932
|
+
children: item
|
|
10933
|
+
};
|
|
10934
|
+
});
|
|
10935
|
+
tableFragment =
|
|
10833
10936
|
{
|
|
10834
10937
|
type: exports.ElementKinds.table,
|
|
10835
|
-
children:
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
fragment = tableFragment;
|
|
10844
|
-
var stringObj = JSON.stringify(fragment);
|
|
10938
|
+
children: rows
|
|
10939
|
+
};
|
|
10940
|
+
}
|
|
10941
|
+
if (tableFragment) {
|
|
10942
|
+
tableFragment = normalizeTable(_.cloneDeep(tableFragment));
|
|
10943
|
+
var plainText = slate.Node.string(tableFragment);
|
|
10944
|
+
tableFragment = [tableFragment];
|
|
10945
|
+
var stringObj = JSON.stringify(tableFragment);
|
|
10845
10946
|
var encoded = window.btoa(encodeURIComponent(stringObj));
|
|
10846
10947
|
unit.setData("application/" + CLIPBOARD_FORMAT_KEY, encoded);
|
|
10847
|
-
|
|
10848
|
-
div.appendChild(contents);
|
|
10849
|
-
div.setAttribute('hidden', 'true');
|
|
10850
|
-
document.body.appendChild(div);
|
|
10851
|
-
unit.setData('text/html', div.innerHTML);
|
|
10852
|
-
unit.setData('text/plain', i1.getPlainText(div));
|
|
10853
|
-
document.body.removeChild(div);
|
|
10948
|
+
unit.setData('text/plain', plainText);
|
|
10854
10949
|
return;
|
|
10855
10950
|
}
|
|
10856
10951
|
setFragmentData(unit);
|
|
@@ -10875,7 +10970,7 @@
|
|
|
10875
10970
|
for (var j = selectColIndex_1; j <= lastColIndex_1; j++) {
|
|
10876
10971
|
var row = tablePosition_1.table.children[i];
|
|
10877
10972
|
if (row && row.children[j]) {
|
|
10878
|
-
var originCell =
|
|
10973
|
+
var originCell = getOriginCell(tablePosition_1.table, i, j);
|
|
10879
10974
|
if (originCell && (originCell.colspan || originCell.rowspan)) {
|
|
10880
10975
|
var path = TheEditor.findPath(editor, originCell).slice(-2);
|
|
10881
10976
|
resetTableCell(editor, tablePosition_1.table, originCell, path[0], path[1]);
|
|
@@ -10933,6 +11028,21 @@
|
|
|
10933
11028
|
slate.Transforms.setNodes(editor, { columns: columns }, { at: entry[1] });
|
|
10934
11029
|
}
|
|
10935
11030
|
}
|
|
11031
|
+
// adjust selection when selection is in hidden cell
|
|
11032
|
+
if (slate.Element.isElement(entry[0]) && entry[0].type === exports.ElementKinds.tableCell && entry[0].hidden) {
|
|
11033
|
+
if (editor.selection && slate.Range.isCollapsed(editor.selection) && slate.Path.isAncestor(entry[1], editor.selection.anchor.path)) {
|
|
11034
|
+
setTimeout(function () {
|
|
11035
|
+
var opts = new TableOptions$1();
|
|
11036
|
+
var tablePosition = TablePosition.create(opts, editor, editor.selection.anchor.path);
|
|
11037
|
+
var origin = getOriginCell(tablePosition.table, tablePosition.getRowIndex(), tablePosition.getColumnIndex());
|
|
11038
|
+
if (origin) {
|
|
11039
|
+
var path = i1.AngularEditor.findPath(editor, origin);
|
|
11040
|
+
slate.Transforms.select(editor, slate.Editor.end(editor, path));
|
|
11041
|
+
}
|
|
11042
|
+
}, 0);
|
|
11043
|
+
return;
|
|
11044
|
+
}
|
|
11045
|
+
}
|
|
10936
11046
|
normalizeNode(entry);
|
|
10937
11047
|
};
|
|
10938
11048
|
editor.isBlockCard = function (element) {
|
|
@@ -10980,6 +11090,20 @@
|
|
|
10980
11090
|
editor.isContainer = function (element) {
|
|
10981
11091
|
return element.type === exports.ElementKinds.tableCell ? true : isContainer(element);
|
|
10982
11092
|
};
|
|
11093
|
+
editor.onChange = function () {
|
|
11094
|
+
onChange();
|
|
11095
|
+
// adujst selection when selection is in hidden cell
|
|
11096
|
+
// just hook set_selection
|
|
11097
|
+
var isCollapsed = editor.selection && slate.Range.isCollapsed(editor.selection);
|
|
11098
|
+
var isSelectionOperation = editor.operations.every(function (op) { return slate.Operation.isSelectionOperation(op); });
|
|
11099
|
+
if (isCollapsed && isSelectionOperation) {
|
|
11100
|
+
var opts = new TableOptions$1();
|
|
11101
|
+
var tablePosition = TablePosition.create(opts, editor, editor.selection.anchor.path);
|
|
11102
|
+
if (tablePosition.isInTable() && tablePosition.cell.hidden) {
|
|
11103
|
+
TableEditor.selectOriginCell(editor, tablePosition.table, tablePosition.getRowIndex(), tablePosition.getColumnIndex(), false);
|
|
11104
|
+
}
|
|
11105
|
+
}
|
|
11106
|
+
};
|
|
10983
11107
|
return editor;
|
|
10984
11108
|
};
|
|
10985
11109
|
|
|
@@ -11018,6 +11142,12 @@
|
|
|
11018
11142
|
insertData(data);
|
|
11019
11143
|
return;
|
|
11020
11144
|
}
|
|
11145
|
+
// 识出纯图片并且粘贴板中存在文件则不进行处理, hook 直接右键复制图片的场景,流转到上传图片流程
|
|
11146
|
+
// 后续需要做识别html图片后自动上传处理
|
|
11147
|
+
if (fragment.length === 1 && fragment[0].type === exports.ElementKinds.image && data.files.length > 0) {
|
|
11148
|
+
insertData(data);
|
|
11149
|
+
return;
|
|
11150
|
+
}
|
|
11021
11151
|
// 过滤 text 节点的 color/background-color 属性
|
|
11022
11152
|
fragment.forEach(function (node) { return deleteColorAndBackgroundColorOfText(node); });
|
|
11023
11153
|
slate.Transforms.insertFragment(editor, fragment);
|
|
@@ -11252,12 +11382,14 @@
|
|
|
11252
11382
|
key: exports.ToolbarActionTypes.undo,
|
|
11253
11383
|
icon: 'undo',
|
|
11254
11384
|
name: '撤销',
|
|
11385
|
+
shortcutKey: CONTROL_KEY + "+Z",
|
|
11255
11386
|
execute: function (editor) { return editor.undo(); }
|
|
11256
11387
|
},
|
|
11257
11388
|
{
|
|
11258
11389
|
key: exports.ToolbarActionTypes.redo,
|
|
11259
11390
|
icon: 'redo',
|
|
11260
11391
|
name: '重做',
|
|
11392
|
+
shortcutKey: CONTROL_KEY + "+Shift+Z",
|
|
11261
11393
|
execute: function (editor) { return editor.redo(); }
|
|
11262
11394
|
},
|
|
11263
11395
|
{
|
|
@@ -11378,12 +11510,12 @@
|
|
|
11378
11510
|
return TheToolbarItemComponent;
|
|
11379
11511
|
}(TheToolbarBaseItemComponent));
|
|
11380
11512
|
TheToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarItemComponent, deps: [{ token: i0__namespace.NgZone }, { token: i0__namespace.ComponentFactoryResolver }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
11381
|
-
TheToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { item: "item", editor: "editor", itemMode: "itemMode" }, host: { classAttribute: "the-toolbar-item" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: i0.ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "\n <ng-container *ngIf=\"itemMode === ToolbarItemMode.horizontal; else selectionItem\">\n <a\n thyIconNavLink\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n ></a>\n </ng-container>\n <ng-template #selectionItem>\n <ng-container *ngIf=\"!item?.quickItemComponent\">\n <thy-icon [thyIconName]=\"item?.icon\" [thyIconRotate]=\"0\" class=\"quick-toolbar-icon\"></thy-icon>\n <span class=\"quick-toolbar-name\">{{ item?.name }}</span>\n </ng-container>\n </ng-template>\n <ng-container #toolbarContainer></ng-container>\n ", isInline: true, components: [{ type: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
11513
|
+
TheToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { item: "item", editor: "editor", itemMode: "itemMode" }, host: { classAttribute: "the-toolbar-item" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: i0.ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "\n <ng-container *ngIf=\"itemMode === ToolbarItemMode.horizontal; else selectionItem\">\n <a\n thyIconNavLink\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"tooltip\"\n [thyTooltipTemplateContext]=\"{ name: item.name, shortcutKey: item.shortcutKey }\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n ></a>\n </ng-container>\n <ng-template #selectionItem>\n <ng-container *ngIf=\"!item?.quickItemComponent\">\n <thy-icon [thyIconName]=\"item?.icon\" [thyIconRotate]=\"0\" class=\"quick-toolbar-icon\"></thy-icon>\n <span class=\"quick-toolbar-name\">{{ item?.name }}</span>\n </ng-container>\n </ng-template>\n <ng-template #tooltip let-data> {{ data.name }} {{ data.shortcutKey }} </ng-template>\n <ng-container #toolbarContainer></ng-container>\n ", isInline: true, components: [{ type: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
11382
11514
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarItemComponent, decorators: [{
|
|
11383
11515
|
type: i0.Component,
|
|
11384
11516
|
args: [{
|
|
11385
11517
|
selector: 'the-toolbar-item',
|
|
11386
|
-
template: "\n <ng-container *ngIf=\"itemMode === ToolbarItemMode.horizontal; else selectionItem\">\n <a\n thyIconNavLink\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n ></a>\n </ng-container>\n <ng-template #selectionItem>\n <ng-container *ngIf=\"!item?.quickItemComponent\">\n <thy-icon [thyIconName]=\"item?.icon\" [thyIconRotate]=\"0\" class=\"quick-toolbar-icon\"></thy-icon>\n <span class=\"quick-toolbar-name\">{{ item?.name }}</span>\n </ng-container>\n </ng-template>\n <ng-container #toolbarContainer></ng-container>\n ",
|
|
11518
|
+
template: "\n <ng-container *ngIf=\"itemMode === ToolbarItemMode.horizontal; else selectionItem\">\n <a\n thyIconNavLink\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"tooltip\"\n [thyTooltipTemplateContext]=\"{ name: item.name, shortcutKey: item.shortcutKey }\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n ></a>\n </ng-container>\n <ng-template #selectionItem>\n <ng-container *ngIf=\"!item?.quickItemComponent\">\n <thy-icon [thyIconName]=\"item?.icon\" [thyIconRotate]=\"0\" class=\"quick-toolbar-icon\"></thy-icon>\n <span class=\"quick-toolbar-name\">{{ item?.name }}</span>\n </ng-container>\n </ng-template>\n <ng-template #tooltip let-data> {{ data.name }} {{ data.shortcutKey }} </ng-template>\n <ng-container #toolbarContainer></ng-container>\n ",
|
|
11387
11519
|
host: {
|
|
11388
11520
|
class: 'the-toolbar-item'
|
|
11389
11521
|
}
|
|
@@ -11549,6 +11681,26 @@
|
|
|
11549
11681
|
return editor;
|
|
11550
11682
|
};
|
|
11551
11683
|
|
|
11684
|
+
var withSoftBreak = function (options) {
|
|
11685
|
+
if (options === void 0) { options = { rules: [{ hotkey: 'shift+enter' }] }; }
|
|
11686
|
+
return function (editor) {
|
|
11687
|
+
var onKeydown = editor.onKeydown;
|
|
11688
|
+
editor.onKeydown = function (event) {
|
|
11689
|
+
var rules = options.rules;
|
|
11690
|
+
var entry = getBlockAbove(editor);
|
|
11691
|
+
rules.forEach(function (_a) {
|
|
11692
|
+
var hotkey = _a.hotkey, query = _a.query;
|
|
11693
|
+
if (isHotkey__default["default"](hotkey, event) && isNodeType(entry, query)) {
|
|
11694
|
+
event.preventDefault();
|
|
11695
|
+
editor.insertText('\n');
|
|
11696
|
+
}
|
|
11697
|
+
});
|
|
11698
|
+
onKeydown(event);
|
|
11699
|
+
};
|
|
11700
|
+
return editor;
|
|
11701
|
+
};
|
|
11702
|
+
};
|
|
11703
|
+
|
|
11552
11704
|
var internalPlugins = [
|
|
11553
11705
|
withTheHistory,
|
|
11554
11706
|
withAutoInsertData(),
|
|
@@ -11566,6 +11718,17 @@
|
|
|
11566
11718
|
withCode,
|
|
11567
11719
|
withHeading,
|
|
11568
11720
|
withMark(),
|
|
11721
|
+
withSoftBreak({
|
|
11722
|
+
rules: [
|
|
11723
|
+
{ hotkey: 'shift+enter' },
|
|
11724
|
+
{
|
|
11725
|
+
hotkey: 'enter',
|
|
11726
|
+
query: {
|
|
11727
|
+
allow: [exports.ElementKinds.blockquote]
|
|
11728
|
+
}
|
|
11729
|
+
}
|
|
11730
|
+
]
|
|
11731
|
+
}),
|
|
11569
11732
|
withBlockquote,
|
|
11570
11733
|
withNodeID({ idKey: ELEMENT_UNIQUE_ID, idCreator: idCreator }),
|
|
11571
11734
|
withAutoFormat({ rules: autoFormatRules }),
|
|
@@ -11574,9 +11737,9 @@
|
|
|
11574
11737
|
withMoveSelection,
|
|
11575
11738
|
withInsertParagraphNodes(),
|
|
11576
11739
|
withGetFragment(),
|
|
11740
|
+
withImage,
|
|
11577
11741
|
withDeserializeHMTL,
|
|
11578
11742
|
withDeserializeMd(),
|
|
11579
|
-
withImage,
|
|
11580
11743
|
withQuickInsert
|
|
11581
11744
|
];
|
|
11582
11745
|
var internalToolbarItems = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(AlignOptions)), __read(MarkOptions)), __read(ColorOptions)), __read(HeadingOptions)), __read(TodoItemOptions)), __read(ListOptions)), __read(ImageOptions)), __read(HrOptions)), __read(BlockquoteOptions)), __read(CodeOptions)), __read(LinkOptions)), __read(TableOptions)), __read(VerticalAlignOptions)), __read(PaintFormatOptions));
|
|
@@ -11673,8 +11836,8 @@
|
|
|
11673
11836
|
setTimeout(function () {
|
|
11674
11837
|
if (editor && editor.children.length > 0 && isFocus) {
|
|
11675
11838
|
slateHistory.HistoryEditor.withoutMerging(editor, function () {
|
|
11676
|
-
i1.AngularEditor.focus(editor);
|
|
11677
11839
|
slate.Transforms.select(editor, slate.Editor.start(editor, [0]));
|
|
11840
|
+
i1.AngularEditor.focus(editor);
|
|
11678
11841
|
});
|
|
11679
11842
|
}
|
|
11680
11843
|
});
|
|
@@ -12004,11 +12167,12 @@
|
|
|
12004
12167
|
}] } });
|
|
12005
12168
|
|
|
12006
12169
|
var TheInlineToolbarComponent = /** @class */ (function () {
|
|
12007
|
-
function TheInlineToolbarComponent(elementRef, scrollDispatcher, cdr, ngZone) {
|
|
12170
|
+
function TheInlineToolbarComponent(elementRef, scrollDispatcher, cdr, ngZone, contextService) {
|
|
12008
12171
|
this.elementRef = elementRef;
|
|
12009
12172
|
this.scrollDispatcher = scrollDispatcher;
|
|
12010
12173
|
this.cdr = cdr;
|
|
12011
12174
|
this.ngZone = ngZone;
|
|
12175
|
+
this.contextService = contextService;
|
|
12012
12176
|
this.destroy$ = new rxjs.Subject();
|
|
12013
12177
|
}
|
|
12014
12178
|
TheInlineToolbarComponent.prototype.ngOnInit = function () {
|
|
@@ -12070,7 +12234,8 @@
|
|
|
12070
12234
|
boundary = range.startContainer.getBoundingClientRect();
|
|
12071
12235
|
}
|
|
12072
12236
|
}
|
|
12073
|
-
var
|
|
12237
|
+
var editableElement = this.contextService.getEditableElement();
|
|
12238
|
+
var editableRect = editableElement.getBoundingClientRect();
|
|
12074
12239
|
var toolbarHeight = toolbarElement.offsetHeight;
|
|
12075
12240
|
var toolbarWidth = toolbarElement.offsetWidth;
|
|
12076
12241
|
var halfOffsetWidth = toolbarWidth / 2;
|
|
@@ -12109,7 +12274,7 @@
|
|
|
12109
12274
|
};
|
|
12110
12275
|
return TheInlineToolbarComponent;
|
|
12111
12276
|
}());
|
|
12112
|
-
TheInlineToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheInlineToolbarComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i2__namespace$1.ScrollDispatcher }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12277
|
+
TheInlineToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheInlineToolbarComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i2__namespace$1.ScrollDispatcher }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.NgZone }, { token: TheContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12113
12278
|
TheInlineToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: { editor: "editor", toolbarItems: "toolbarItems" }, host: { properties: { "class.hide": "toolbarItems.length === 0" } }, viewQueries: [{ propertyName: "inlineToolbar", first: true, predicate: ["inlineToolbar"], descendants: true }], ngImport: i0__namespace, template: "<the-toolbar\n #inlineToolbar\n class=\"the-inline-toolbar\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarItems\"\n [isMore]=\"false\"\n ></the-toolbar> ", isInline: true, components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
12114
12279
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheInlineToolbarComponent, decorators: [{
|
|
12115
12280
|
type: i0.Component,
|
|
@@ -12121,7 +12286,7 @@
|
|
|
12121
12286
|
},
|
|
12122
12287
|
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
12123
12288
|
}]
|
|
12124
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i2__namespace$1.ScrollDispatcher }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.NgZone }]; }, propDecorators: { editor: [{
|
|
12289
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i2__namespace$1.ScrollDispatcher }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.NgZone }, { type: TheContextService }]; }, propDecorators: { editor: [{
|
|
12125
12290
|
type: i0.Input
|
|
12126
12291
|
}], toolbarItems: [{
|
|
12127
12292
|
type: i0.Input
|
|
@@ -12145,13 +12310,15 @@
|
|
|
12145
12310
|
event.stopPropagation();
|
|
12146
12311
|
};
|
|
12147
12312
|
TheQuickInsertComponent.prototype.checkStatus = function () {
|
|
12148
|
-
var
|
|
12313
|
+
var _this = this;
|
|
12149
12314
|
var editor = this.editor;
|
|
12150
12315
|
if (isCleanEmptyParagraph(editor)) {
|
|
12151
|
-
|
|
12152
|
-
|
|
12153
|
-
|
|
12154
|
-
|
|
12316
|
+
setTimeout(function () {
|
|
12317
|
+
var _a;
|
|
12318
|
+
var block = slate.Node.ancestor(editor, [(_a = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path[0]]);
|
|
12319
|
+
var rootNode = i1.AngularEditor.toDOMNode(editor, block);
|
|
12320
|
+
_this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
|
|
12321
|
+
});
|
|
12155
12322
|
return;
|
|
12156
12323
|
}
|
|
12157
12324
|
this.isHide = true;
|
|
@@ -12201,9 +12368,10 @@
|
|
|
12201
12368
|
}] } });
|
|
12202
12369
|
|
|
12203
12370
|
var ThePlaceholderComponent = /** @class */ (function () {
|
|
12204
|
-
function ThePlaceholderComponent(renderer, elementRef) {
|
|
12371
|
+
function ThePlaceholderComponent(renderer, elementRef, contextService) {
|
|
12205
12372
|
this.renderer = renderer;
|
|
12206
12373
|
this.elementRef = elementRef;
|
|
12374
|
+
this.contextService = contextService;
|
|
12207
12375
|
this.isHide = true;
|
|
12208
12376
|
}
|
|
12209
12377
|
ThePlaceholderComponent.prototype.handleCompositionStart = function () {
|
|
@@ -12219,20 +12387,25 @@
|
|
|
12219
12387
|
};
|
|
12220
12388
|
ThePlaceholderComponent.prototype.checkStatus = function () {
|
|
12221
12389
|
var _this = this;
|
|
12222
|
-
var _a, _b;
|
|
12390
|
+
var _a, _b, _c;
|
|
12223
12391
|
var editor = this.editor;
|
|
12392
|
+
var isEmptyShow = typeof ((_a = this.options) === null || _a === void 0 ? void 0 : _a.isEmptyShowPlaceholder) === 'undefined' ? true : this.options.isEmptyShowPlaceholder;
|
|
12393
|
+
var isMustShow = (_b = this.options) === null || _b === void 0 ? void 0 : _b.isMustShowPlaceholder;
|
|
12394
|
+
var isReadonly = (_c = this.options) === null || _c === void 0 ? void 0 : _c.readonly;
|
|
12224
12395
|
// empty content and no selection processing
|
|
12225
|
-
if (!
|
|
12226
|
-
|
|
12227
|
-
var
|
|
12228
|
-
|
|
12396
|
+
if (!isReadonly && isEmptyShow && isEmptyContent(editor.children)) {
|
|
12397
|
+
var firstElementChild = this.contextService.getFirstElementChild();
|
|
12398
|
+
var offsetTop = firstElementChild.offsetTop;
|
|
12399
|
+
var offsetLeft = firstElementChild.offsetLeft;
|
|
12400
|
+
this.updatePosition(offsetLeft, offsetTop);
|
|
12229
12401
|
return;
|
|
12230
12402
|
}
|
|
12231
|
-
if (isCleanEmptyParagraph(editor)) {
|
|
12232
|
-
var block = slate.Node.ancestor(editor, [(_b = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _b === void 0 ? void 0 : _b.anchor.path[0]]);
|
|
12233
|
-
var rootNode_1 = i1.AngularEditor.toDOMNode(editor, block);
|
|
12403
|
+
if (isMustShow && isCleanEmptyParagraph(editor)) {
|
|
12234
12404
|
setTimeout(function () {
|
|
12235
|
-
|
|
12405
|
+
var _a;
|
|
12406
|
+
var block = slate.Node.ancestor(editor, [(_a = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path[0]]);
|
|
12407
|
+
var rootNode = i1.AngularEditor.toDOMNode(editor, block);
|
|
12408
|
+
_this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
|
|
12236
12409
|
});
|
|
12237
12410
|
return;
|
|
12238
12411
|
}
|
|
@@ -12248,7 +12421,7 @@
|
|
|
12248
12421
|
};
|
|
12249
12422
|
return ThePlaceholderComponent;
|
|
12250
12423
|
}());
|
|
12251
|
-
ThePlaceholderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: ThePlaceholderComponent, deps: [{ token: i0__namespace.Renderer2 }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12424
|
+
ThePlaceholderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: ThePlaceholderComponent, deps: [{ token: i0__namespace.Renderer2 }, { token: i0__namespace.ElementRef }, { token: TheContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12252
12425
|
ThePlaceholderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: { editor: "editor", options: "options" }, host: { listeners: { "document:compositionstart": "handleCompositionStart()", "document:compositionend": "handleCompositionEnd($event)" }, properties: { "class.hide": "isHide" }, classAttribute: "the-placeholder" }, ngImport: i0__namespace, template: "{{ options?.placeholder }}", isInline: true });
|
|
12253
12426
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: ThePlaceholderComponent, decorators: [{
|
|
12254
12427
|
type: i0.Component,
|
|
@@ -12260,7 +12433,7 @@
|
|
|
12260
12433
|
'[class.hide]': 'isHide'
|
|
12261
12434
|
}
|
|
12262
12435
|
}]
|
|
12263
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.Renderer2 }, { type: i0__namespace.ElementRef }]; }, propDecorators: { editor: [{
|
|
12436
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.Renderer2 }, { type: i0__namespace.ElementRef }, { type: TheContextService }]; }, propDecorators: { editor: [{
|
|
12264
12437
|
type: i0.Input
|
|
12265
12438
|
}], options: [{
|
|
12266
12439
|
type: i0.Input
|
|
@@ -12438,6 +12611,12 @@
|
|
|
12438
12611
|
_this.onSlaCompositionEnd = function (event) { };
|
|
12439
12612
|
_this.onSlaDragStart = function (event) { };
|
|
12440
12613
|
_this.onSlaDragOver = function (event) { };
|
|
12614
|
+
_this.onDrop = function (event) {
|
|
12615
|
+
event.stopPropagation();
|
|
12616
|
+
_this.theOnDOMEvent.emit({
|
|
12617
|
+
nativeEvent: event
|
|
12618
|
+
});
|
|
12619
|
+
};
|
|
12441
12620
|
return _this;
|
|
12442
12621
|
}
|
|
12443
12622
|
Object.defineProperty(TheEditorComponent.prototype, "theGlobalToolbarInstance", {
|
|
@@ -12468,15 +12647,18 @@
|
|
|
12468
12647
|
this.onErrorHandler();
|
|
12469
12648
|
};
|
|
12470
12649
|
TheEditorComponent.prototype.ngOnChanges = function (changes) {
|
|
12471
|
-
var _a, _b, _c;
|
|
12650
|
+
var _a, _b, _c, _d, _e;
|
|
12472
12651
|
var options = changes.theOptions;
|
|
12473
12652
|
if (options) {
|
|
12474
12653
|
this.initializeOptions();
|
|
12475
12654
|
}
|
|
12655
|
+
if (options && ((_a = options.currentValue) === null || _a === void 0 ? void 0 : _a.readonly) !== ((_b = options.previousValue) === null || _b === void 0 ? void 0 : _b.readonly)) {
|
|
12656
|
+
this.applyAutoFocus();
|
|
12657
|
+
}
|
|
12476
12658
|
if (changes['theDecorate']) {
|
|
12477
12659
|
this.generateDecorate();
|
|
12478
12660
|
}
|
|
12479
|
-
if (((
|
|
12661
|
+
if (((_c = this.editor) === null || _c === void 0 ? void 0 : _c.selection) && (((_d = options === null || options === void 0 ? void 0 : options.currentValue) === null || _d === void 0 ? void 0 : _d.readonly) || ((_e = options === null || options === void 0 ? void 0 : options.currentValue) === null || _e === void 0 ? void 0 : _e.disabled))) {
|
|
12480
12662
|
slate.Transforms.deselect(this.editor);
|
|
12481
12663
|
}
|
|
12482
12664
|
};
|
|
@@ -12494,7 +12676,9 @@
|
|
|
12494
12676
|
this.theContextService.initialize({ nativeElement: this.elementRef.nativeElement, viewContainerRef: this.viewContainerRef });
|
|
12495
12677
|
this.toolbarCalculate();
|
|
12496
12678
|
setTimeout(function () {
|
|
12679
|
+
var _a;
|
|
12497
12680
|
_this.theEditorCreated.emit(_this.editor);
|
|
12681
|
+
(_a = _this.placeholderInstance) === null || _a === void 0 ? void 0 : _a.checkStatus();
|
|
12498
12682
|
_this.applyAutoFocus();
|
|
12499
12683
|
});
|
|
12500
12684
|
};
|
|
@@ -12510,9 +12694,9 @@
|
|
|
12510
12694
|
}
|
|
12511
12695
|
};
|
|
12512
12696
|
TheEditorComponent.prototype.applyAutoFocus = function () {
|
|
12513
|
-
var _a, _b, _c
|
|
12514
|
-
if (((_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.
|
|
12515
|
-
autoFocus(this.editor, (
|
|
12697
|
+
var _a, _b, _c;
|
|
12698
|
+
if (!((_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.disabled) && !((_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.readonly)) {
|
|
12699
|
+
autoFocus(this.editor, (_c = this.theOptions) === null || _c === void 0 ? void 0 : _c.autoFocus);
|
|
12516
12700
|
}
|
|
12517
12701
|
};
|
|
12518
12702
|
TheEditorComponent.prototype.toolbarCalculate = function () {
|
|
@@ -12544,14 +12728,14 @@
|
|
|
12544
12728
|
this.onTouchedCallback = fn;
|
|
12545
12729
|
};
|
|
12546
12730
|
TheEditorComponent.prototype.valueChange = function (value) {
|
|
12547
|
-
var _a, _b, _c, _d, _e;
|
|
12731
|
+
var _a, _b, _c, _d, _e, _f;
|
|
12548
12732
|
(_a = this.theGlobalToolbarInstance) === null || _a === void 0 ? void 0 : _a.statusChange(this.editor);
|
|
12549
12733
|
(_b = this.quickInsertInstance) === null || _b === void 0 ? void 0 : _b.checkStatus();
|
|
12550
|
-
this.placeholderInstance.checkStatus();
|
|
12734
|
+
(_c = this.placeholderInstance) === null || _c === void 0 ? void 0 : _c.checkStatus();
|
|
12551
12735
|
// auto scroll view
|
|
12552
|
-
var scrollContainer = (
|
|
12553
|
-
var maxHeight = (
|
|
12554
|
-
if (!((
|
|
12736
|
+
var scrollContainer = (_d = this.theOptions) === null || _d === void 0 ? void 0 : _d.scrollContainer;
|
|
12737
|
+
var maxHeight = (_e = this.theOptions) === null || _e === void 0 ? void 0 : _e.maxHeight;
|
|
12738
|
+
if (!((_f = this.theOptions) === null || _f === void 0 ? void 0 : _f.readonly) && (scrollContainer || maxHeight)) {
|
|
12555
12739
|
var container = maxHeight ? DEFAULT_SCROLL_CONTAINER : scrollContainer;
|
|
12556
12740
|
this.autoScrollView(this.editor, container);
|
|
12557
12741
|
}
|
|
@@ -12627,18 +12811,18 @@
|
|
|
12627
12811
|
}
|
|
12628
12812
|
};
|
|
12629
12813
|
TheEditorComponent.prototype.handleSelectAll = function () {
|
|
12630
|
-
var
|
|
12814
|
+
var _g;
|
|
12631
12815
|
var node;
|
|
12632
12816
|
if (!this.editor.selection) {
|
|
12633
12817
|
setEndSelection(this.editor);
|
|
12634
12818
|
}
|
|
12635
|
-
var
|
|
12819
|
+
var _h = __read(slate.Range.edges(this.editor.selection), 2), start = _h[0], end = _h[1];
|
|
12636
12820
|
var selectionRange = slate.Editor.range(this.editor, start, end);
|
|
12637
12821
|
var containerBlocks = getContainerBlocks(this.editor);
|
|
12638
12822
|
for (var i = 0; i < containerBlocks.length; i++) {
|
|
12639
|
-
|
|
12823
|
+
_g = __read(getNodesByType(this.editor, containerBlocks[i]), 1), node = _g[0];
|
|
12640
12824
|
if (node) {
|
|
12641
|
-
var
|
|
12825
|
+
var _j = __read(node, 2), path = _j[1];
|
|
12642
12826
|
var isStartParent = slate.Path.equals(path, start.path.slice(0, path.length));
|
|
12643
12827
|
var isEndParent = slate.Path.equals(path, end.path.slice(0, path.length));
|
|
12644
12828
|
if (isStartParent && isEndParent) {
|
|
@@ -12681,7 +12865,7 @@
|
|
|
12681
12865
|
useExisting: i0.forwardRef(function () { return TheEditorComponent; }),
|
|
12682
12866
|
multi: true
|
|
12683
12867
|
}
|
|
12684
|
-
], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }, { propertyName: "quickInsertInstance", first: true, predicate: ["quickInsert"], descendants: true, static: true }, { propertyName: "placeholderInstance", first: true, predicate: ["placeholder"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n [ngClass]=\"{\n 'the-editor-disabled': theOptions?.disabled,\n 'max-height': maxHeight\n }\"\n [ngStyle]=\"{ 'max-height': maxHeight }\"\n>\n <slate-editable\n class=\"the-editor-typo\"\n [editor]=\"editor\"\n [ngModel]=\"editorValue\"\n (ngModelChange)=\"valueChange($event)\"\n [decorate]=\"decorate\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar *ngIf=\"!theOptions?.readonly\" [editor]=\"editor\" [toolbarItems]=\"toolbarEntity.inline\"></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [quickToolbarItems]=\"quickToolbarItems\"></div>\n <div #placeholder thePlaceholder [editor]=\"editor\" [options]=\"theOptions\"></div>\n <the-template #templateInstance></the-template>\n</div>\n", components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }, { type: i1__namespace.SlateEditableComponent, selector: "slate-editable", inputs: ["editor", "renderElement", "renderLeaf", "renderText", "decorate", "isStrictDecorate", "trackBy", "readonly", "beforeInput", "blur", "click", "compositionEnd", "compositionStart", "copy", "cut", "dragOver", "dragStart", "dragEnd", "drop", "focus", "keydown", "paste", "spellCheck", "autoCorrect", "autoCapitalize"] }, { type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: ["editor", "toolbarItems"] }, { type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: ["editor", "quickToolbarItems"] }, { type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: ["editor", "options"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4__namespace$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
12868
|
+
], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }, { propertyName: "quickInsertInstance", first: true, predicate: ["quickInsert"], descendants: true, static: true }, { propertyName: "placeholderInstance", first: true, predicate: ["placeholder"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n [ngClass]=\"{\n 'the-editor-disabled': theOptions?.disabled,\n 'max-height': maxHeight\n }\"\n [ngStyle]=\"{ 'max-height': maxHeight }\"\n>\n <slate-editable\n class=\"the-editor-typo\"\n [editor]=\"editor\"\n [ngModel]=\"editorValue\"\n (ngModelChange)=\"valueChange($event)\"\n [decorate]=\"decorate\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar *ngIf=\"!theOptions?.readonly\" [editor]=\"editor\" [toolbarItems]=\"toolbarEntity.inline\"></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [quickToolbarItems]=\"quickToolbarItems\"></div>\n <div #placeholder thePlaceholder [editor]=\"editor\" [options]=\"theOptions\"></div>\n <the-template #templateInstance></the-template>\n</div>\n", components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }, { type: i1__namespace.SlateEditableComponent, selector: "slate-editable", inputs: ["editor", "renderElement", "renderLeaf", "renderText", "decorate", "isStrictDecorate", "trackBy", "readonly", "beforeInput", "blur", "click", "compositionEnd", "compositionStart", "copy", "cut", "dragOver", "dragStart", "dragEnd", "drop", "focus", "keydown", "paste", "spellCheck", "autoCorrect", "autoCapitalize"] }, { type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: ["editor", "toolbarItems"] }, { type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: ["editor", "quickToolbarItems"] }, { type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: ["editor", "options"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4__namespace$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
12685
12869
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheEditorComponent, decorators: [{
|
|
12686
12870
|
type: i0.Component,
|
|
12687
12871
|
args: [{
|
|
@@ -13036,13 +13220,13 @@
|
|
|
13036
13220
|
exports.A_TAG_REL_ATTR = A_TAG_REL_ATTR;
|
|
13037
13221
|
exports.AlignEditor = AlignEditor;
|
|
13038
13222
|
exports.BLOCK_DELETEBACKWARD_TYPES = BLOCK_DELETEBACKWARD_TYPES;
|
|
13039
|
-
exports.BLOCK_INSERT_ORIGIN = BLOCK_INSERT_ORIGIN;
|
|
13040
13223
|
exports.BlockquoteEditor = BlockquoteEditor;
|
|
13041
13224
|
exports.CLIPBOARD_FORMAT_KEY = CLIPBOARD_FORMAT_KEY;
|
|
13042
13225
|
exports.CODEMIRROR_PADDING_TOP = CODEMIRROR_PADDING_TOP;
|
|
13043
13226
|
exports.CODE_MODES = CODE_MODES;
|
|
13044
13227
|
exports.COMPONENTS = COMPONENTS;
|
|
13045
13228
|
exports.CONTAINER_BLOCKS = CONTAINER_BLOCKS;
|
|
13229
|
+
exports.CONTROL_KEY = CONTROL_KEY;
|
|
13046
13230
|
exports.CodeEditor = CodeEditor;
|
|
13047
13231
|
exports.CodeMode = CodeMode;
|
|
13048
13232
|
exports.ColorEditor = ColorEditor;
|
|
@@ -13056,6 +13240,7 @@
|
|
|
13056
13240
|
exports.HEADING_TYPES = HEADING_TYPES;
|
|
13057
13241
|
exports.HeadingEditor = HeadingEditor;
|
|
13058
13242
|
exports.HrEditor = HrEditor;
|
|
13243
|
+
exports.IS_MAC = IS_MAC;
|
|
13059
13244
|
exports.ImageEditor = ImageEditor;
|
|
13060
13245
|
exports.LINK_DEFAULT_TEXT = LINK_DEFAULT_TEXT;
|
|
13061
13246
|
exports.LIST_BLOCK_TYPES = LIST_BLOCK_TYPES;
|