@worktile/theia 2.3.3 → 2.4.2
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 +1087 -997
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/components/column-resize/column-resize.directive.d.ts +2 -2
- package/components/column-resize/column-resize.scss +6 -0
- package/components/column-resize/event-dispatcher.d.ts +7 -1
- package/components/column-resize/resize-ref.d.ts +3 -0
- package/constants/auto-format-rules.d.ts +1 -1
- package/constants/default.d.ts +0 -1
- package/custom-types.d.ts +2 -1
- package/editor.module.d.ts +45 -43
- package/esm2015/components/column-resize/column-resize.directive.js +26 -33
- package/esm2015/components/column-resize/event-dispatcher.js +8 -1
- package/esm2015/components/column-resize/overlay-handle.component.js +3 -3
- package/esm2015/components/column-resize/resize-ref.js +4 -1
- package/esm2015/constants/auto-format-rules.js +3 -2
- package/esm2015/constants/default.js +1 -1
- package/esm2015/custom-types.js +1 -1
- package/esm2015/editor.component.js +3 -2
- package/esm2015/editor.module.js +7 -6
- package/esm2015/interfaces/auto-format.js +1 -1
- package/esm2015/interfaces/editor.js +1 -1
- package/esm2015/plugins/autoformat/autoformat.plugin.js +23 -6
- package/esm2015/plugins/index.js +2 -3
- package/esm2015/plugins/inline-code/inline-code.component.js +7 -7
- package/esm2015/plugins/link/link.component.js +11 -24
- package/esm2015/plugins/link/link.plugin.js +3 -4
- package/esm2015/plugins/table/components/insert-mark/insert-mark.component.js +7 -2
- package/esm2015/plugins/table/components/table.component.js +10 -4
- package/esm2015/plugins/table/components/td/td.component.js +59 -37
- package/esm2015/plugins/table/components/toolbar/table-options.component.js +90 -0
- package/esm2015/plugins/table/components/toolbar/table-toolbar.component.js +26 -7
- package/esm2015/plugins/table/table.service.js +2 -2
- package/esm2015/plugins/table/table.store.js +13 -3
- package/esm2015/plugins/table/table.types.js +1 -1
- package/esm2015/plugins/todo-item/todo-item.component.js +3 -3
- package/esm2015/services/table-contextmenu.service.js +1 -1
- package/esm2015/utils/dom.js +2 -42
- package/fesm2015/worktile-theia.js +1039 -927
- package/fesm2015/worktile-theia.js.map +1 -1
- package/interfaces/auto-format.d.ts +1 -0
- package/interfaces/editor.d.ts +3 -0
- package/package.json +1 -1
- package/plugins/autoformat/autoformat.plugin.d.ts +1 -2
- package/plugins/link/link.component.d.ts +2 -8
- package/plugins/link/link.component.scss +0 -2
- package/plugins/table/components/table.component.scss +142 -105
- package/plugins/table/components/td/td.component.d.ts +3 -2
- package/plugins/table/components/toolbar/table-options.component.d.ts +20 -0
- package/plugins/table/components/toolbar/table-toolbar.component.d.ts +4 -2
- package/plugins/table/table.store.d.ts +3 -1
- package/plugins/table/table.types.d.ts +10 -0
- package/styles/editor.scss +6 -1
- package/utils/dom.d.ts +1 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('slate-angular'), require('ngx-tethys/core'), require('is-hotkey'), require('slate'), require('slate-history'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@worktile/theia', ['exports', '@angular/core', '@angular/common', '@angular/forms', 'slate-angular', 'ngx-tethys/core', 'is-hotkey', 'slate', 'slate-history', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.worktile = global.worktile || {}, global.worktile.theia = {}), global.ng.core, global.ng.common, global.ng.forms, global.i1, global.core, global.isHotkey, global.slate, global.slateHistory, global.
|
|
5
|
-
})(this, (function (exports, i0, i10, i4
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('slate-angular'), require('ngx-tethys/core'), require('is-hotkey'), require('slate'), require('slate-history'), require('marked'), require('@atinc/selene'), require('ngx-tethys/popover'), require('lodash'), require('@angular/cdk/overlay'), require('ngx-tethys/alert'), require('rxjs/operators'), require('ngx-tethys/uploader'), require('rxjs'), require('@angular/platform-browser'), require('ngx-tethys/progress'), require('ngx-tethys/icon'), require('ngx-tethys/nav'), require('ngx-tethys/tooltip'), require('ngx-tethys/input'), require('ng-codemirror'), require('ngx-tethys/notify'), require('ngx-tethys/action-menu'), require('ngx-tethys/switch'), require('ngx-tethys/resizable'), require('is-url'), require('ngx-tethys/button'), require('ngx-tethys/form'), require('ngx-tethys/shared'), require('ngx-tethys'), require('@angular/cdk/coercion'), require('@angular/cdk/portal'), require('ngx-tethys/list'), require('ngx-tethys/autocomplete'), require('ngx-tethys/avatar'), require('ngx-tethys/select')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@worktile/theia', ['exports', '@angular/core', '@angular/common', '@angular/forms', 'slate-angular', 'ngx-tethys/core', 'is-hotkey', 'slate', 'slate-history', 'marked', '@atinc/selene', 'ngx-tethys/popover', 'lodash', '@angular/cdk/overlay', 'ngx-tethys/alert', 'rxjs/operators', 'ngx-tethys/uploader', 'rxjs', '@angular/platform-browser', 'ngx-tethys/progress', 'ngx-tethys/icon', 'ngx-tethys/nav', 'ngx-tethys/tooltip', 'ngx-tethys/input', 'ng-codemirror', 'ngx-tethys/notify', 'ngx-tethys/action-menu', 'ngx-tethys/switch', 'ngx-tethys/resizable', 'is-url', 'ngx-tethys/button', 'ngx-tethys/form', 'ngx-tethys/shared', 'ngx-tethys', '@angular/cdk/coercion', '@angular/cdk/portal', 'ngx-tethys/list', 'ngx-tethys/autocomplete', 'ngx-tethys/avatar', 'ngx-tethys/select'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.worktile = global.worktile || {}, global.worktile.theia = {}), global.ng.core, global.ng.common, global.ng.forms, global.i1, global.core, global.isHotkey, global.slate, global.slateHistory, global.marked, global.selene, global.i1$2, global._lodash, global.ng.cdk.overlay, global.i1$1, global.rxjs.operators, global.uploader, global.rxjs, global.ng.platformBrowser, global.i6, global.i3, global.i3$1, global.i5, global.i5$1, global.i8, global.i1$4, global.i2$1, global.i6$1, global.i9, global.isUrl, global.i1$5, global.i2$2, global.i5$2, global.i1$6, global.ng.cdk.coercion, global.ng.cdk.portal, global.i2$3, global.autocomplete, global.avatar, global.select));
|
|
5
|
+
})(this, (function (exports, i0, i10, i4, i1, core, isHotkey, slate, slateHistory, marked, selene, i1$2, _lodash, i2, i1$1, operators, uploader, rxjs, i1$3, i6, i3, i3$1, i5, i5$1, i8, i1$4, i2$1, i6$1, i9, isUrl, i1$5, i2$2, i5$2, i1$6, coercion, portal, i2$3, autocomplete, avatar, select) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -26,31 +26,31 @@
|
|
|
26
26
|
|
|
27
27
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
28
|
var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
|
|
29
|
-
var i4__namespace
|
|
29
|
+
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
30
30
|
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
31
31
|
var isHotkey__default = /*#__PURE__*/_interopDefaultLegacy(isHotkey);
|
|
32
|
-
var _lodash__namespace = /*#__PURE__*/_interopNamespace(_lodash);
|
|
33
32
|
var marked__default = /*#__PURE__*/_interopDefaultLegacy(marked);
|
|
34
33
|
var i1__namespace$3 = /*#__PURE__*/_interopNamespace(i1$2);
|
|
34
|
+
var _lodash__namespace = /*#__PURE__*/_interopNamespace(_lodash);
|
|
35
35
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
36
36
|
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
37
37
|
var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$3);
|
|
38
38
|
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
39
|
-
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
40
39
|
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
40
|
+
var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
|
|
41
41
|
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
42
42
|
var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
|
|
43
43
|
var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
|
|
44
44
|
var i1__namespace$4 = /*#__PURE__*/_interopNamespace(i1$4);
|
|
45
|
-
var
|
|
45
|
+
var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
|
|
46
46
|
var i6__namespace$1 = /*#__PURE__*/_interopNamespace(i6$1);
|
|
47
47
|
var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
|
|
48
48
|
var isUrl__default = /*#__PURE__*/_interopDefaultLegacy(isUrl);
|
|
49
49
|
var i1__namespace$5 = /*#__PURE__*/_interopNamespace(i1$5);
|
|
50
|
-
var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
|
|
51
|
-
var i5__namespace$3 = /*#__PURE__*/_interopNamespace(i5$3);
|
|
52
|
-
var i1__namespace$6 = /*#__PURE__*/_interopNamespace(i1$6);
|
|
53
50
|
var i2__namespace$2 = /*#__PURE__*/_interopNamespace(i2$2);
|
|
51
|
+
var i5__namespace$2 = /*#__PURE__*/_interopNamespace(i5$2);
|
|
52
|
+
var i1__namespace$6 = /*#__PURE__*/_interopNamespace(i1$6);
|
|
53
|
+
var i2__namespace$3 = /*#__PURE__*/_interopNamespace(i2$3);
|
|
54
54
|
|
|
55
55
|
/*! *****************************************************************************
|
|
56
56
|
Copyright (c) Microsoft Corporation.
|
|
@@ -853,6 +853,61 @@
|
|
|
853
853
|
return key;
|
|
854
854
|
}
|
|
855
855
|
|
|
856
|
+
var UNDOING = new WeakMap();
|
|
857
|
+
var REDOING = new WeakMap();
|
|
858
|
+
var withTheHistory = function (editor) {
|
|
859
|
+
var undo = editor.undo, redo = editor.redo;
|
|
860
|
+
editor.undo = function () {
|
|
861
|
+
UNDOING.set(editor, true);
|
|
862
|
+
undo();
|
|
863
|
+
UNDOING.set(editor, false);
|
|
864
|
+
};
|
|
865
|
+
editor.redo = function () {
|
|
866
|
+
REDOING.set(editor, true);
|
|
867
|
+
redo();
|
|
868
|
+
REDOING.set(editor, false);
|
|
869
|
+
};
|
|
870
|
+
return editor;
|
|
871
|
+
};
|
|
872
|
+
var TheHistoryEditor = {
|
|
873
|
+
isUndoing: function (editor) {
|
|
874
|
+
return UNDOING.get(editor);
|
|
875
|
+
},
|
|
876
|
+
isRedoing: function (editor) {
|
|
877
|
+
return REDOING.get(editor);
|
|
878
|
+
}
|
|
879
|
+
};
|
|
880
|
+
|
|
881
|
+
var setMarks = function (editor, marks, at) {
|
|
882
|
+
slate.Transforms.setNodes(editor, marks, {
|
|
883
|
+
at: at,
|
|
884
|
+
match: slate.Text.isText,
|
|
885
|
+
split: true
|
|
886
|
+
});
|
|
887
|
+
};
|
|
888
|
+
|
|
889
|
+
var clearMarks = function (editor) {
|
|
890
|
+
var selection = editor.selection;
|
|
891
|
+
if (!selection) {
|
|
892
|
+
return;
|
|
893
|
+
}
|
|
894
|
+
if (slate.Range.isCollapsed(selection)) {
|
|
895
|
+
var marks = slate.Editor.marks(editor);
|
|
896
|
+
for (var key in marks) {
|
|
897
|
+
slate.Editor.removeMark(editor, key);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
else {
|
|
901
|
+
var unsetMarks_1 = {};
|
|
902
|
+
MarkProps.forEach(function (key) {
|
|
903
|
+
unsetMarks_1[key] = null;
|
|
904
|
+
});
|
|
905
|
+
setMarks(editor, unsetMarks_1);
|
|
906
|
+
}
|
|
907
|
+
};
|
|
908
|
+
|
|
909
|
+
var insertElement = function (editor, element) { return editor.insertElement(element); };
|
|
910
|
+
|
|
856
911
|
var isAncestor = function (node) { return slate.Element.isElement(node) || slate.Editor.isEditor(node); };
|
|
857
912
|
|
|
858
913
|
var getLastChild$1 = function (node, level) {
|
|
@@ -1720,36 +1775,6 @@
|
|
|
1720
1775
|
someNode: someNode
|
|
1721
1776
|
});
|
|
1722
1777
|
|
|
1723
|
-
var setMarks = function (editor, marks, at) {
|
|
1724
|
-
slate.Transforms.setNodes(editor, marks, {
|
|
1725
|
-
at: at,
|
|
1726
|
-
match: slate.Text.isText,
|
|
1727
|
-
split: true
|
|
1728
|
-
});
|
|
1729
|
-
};
|
|
1730
|
-
|
|
1731
|
-
var clearMarks = function (editor) {
|
|
1732
|
-
var selection = editor.selection;
|
|
1733
|
-
if (!selection) {
|
|
1734
|
-
return;
|
|
1735
|
-
}
|
|
1736
|
-
if (slate.Range.isCollapsed(selection)) {
|
|
1737
|
-
var marks = slate.Editor.marks(editor);
|
|
1738
|
-
for (var key in marks) {
|
|
1739
|
-
slate.Editor.removeMark(editor, key);
|
|
1740
|
-
}
|
|
1741
|
-
}
|
|
1742
|
-
else {
|
|
1743
|
-
var unsetMarks_1 = {};
|
|
1744
|
-
MarkProps.forEach(function (key) {
|
|
1745
|
-
unsetMarks_1[key] = null;
|
|
1746
|
-
});
|
|
1747
|
-
setMarks(editor, unsetMarks_1);
|
|
1748
|
-
}
|
|
1749
|
-
};
|
|
1750
|
-
|
|
1751
|
-
var insertElement = function (editor, element) { return editor.insertElement(element); };
|
|
1752
|
-
|
|
1753
1778
|
var insertElementNext = function (editor, node) {
|
|
1754
1779
|
if (slate.Range.isExpanded(editor.selection)) {
|
|
1755
1780
|
slate.Editor.deleteFragment(editor);
|
|
@@ -1992,614 +2017,177 @@
|
|
|
1992
2017
|
handleContinualInsertBreak: handleContinualInsertBreak
|
|
1993
2018
|
});
|
|
1994
2019
|
|
|
1995
|
-
var
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
toggleList: function (editor, type, startIndex) {
|
|
2004
|
-
var _this = this;
|
|
2005
|
-
if (!editor.selection) {
|
|
2006
|
-
return;
|
|
2020
|
+
var TheConversionHintComponent = /** @class */ (function () {
|
|
2021
|
+
function TheConversionHintComponent() {
|
|
2022
|
+
this.duration = 10000;
|
|
2023
|
+
this.pauseOnHover = true;
|
|
2024
|
+
}
|
|
2025
|
+
TheConversionHintComponent.prototype.mouseenter = function () {
|
|
2026
|
+
if (this.pauseOnHover) {
|
|
2027
|
+
this.clearCloseTimer();
|
|
2007
2028
|
}
|
|
2008
|
-
|
|
2009
|
-
|
|
2029
|
+
};
|
|
2030
|
+
TheConversionHintComponent.prototype.mouseleave = function () {
|
|
2031
|
+
if (this.pauseOnHover) {
|
|
2032
|
+
this.creatCloseTimer();
|
|
2010
2033
|
}
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
}
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2034
|
+
};
|
|
2035
|
+
TheConversionHintComponent.prototype.ngOnInit = function () {
|
|
2036
|
+
this.creatCloseTimer();
|
|
2037
|
+
};
|
|
2038
|
+
TheConversionHintComponent.prototype.ngOnDestroy = function () {
|
|
2039
|
+
this.clearCloseTimer();
|
|
2040
|
+
};
|
|
2041
|
+
TheConversionHintComponent.prototype.creatCloseTimer = function () {
|
|
2042
|
+
var _this = this;
|
|
2043
|
+
this.closeTimer = setInterval(function () {
|
|
2044
|
+
clearInterval(_this.closeTimer);
|
|
2045
|
+
closeConversionHint(_this.editor);
|
|
2046
|
+
}, this.duration);
|
|
2047
|
+
};
|
|
2048
|
+
TheConversionHintComponent.prototype.clearCloseTimer = function () {
|
|
2049
|
+
clearInterval(this.closeTimer);
|
|
2050
|
+
};
|
|
2051
|
+
return TheConversionHintComponent;
|
|
2052
|
+
}());
|
|
2053
|
+
TheConversionHintComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheConversionHintComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2054
|
+
TheConversionHintComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheConversionHintComponent, selector: "the-conversion-hint", inputs: { editor: "editor", conversion: "conversion" }, host: { listeners: { "mouseenter": "mouseenter()", "mouseleave": "mouseleave()" }, classAttribute: "the-conversion-hint" }, ngImport: i0__namespace, template: "<ng-container>\n <thy-alert\n thyType=\"primary-weak\"\n thyIcon=\"info-circle-fill\"\n thyCloseable=\"true\"\n thyMessage=\"\u68C0\u6D4B\u5230\u7C98\u8D34\u5185\u5BB9\u7B26\u5408Markdown\u8BED\u6CD5\"\n >\n <ng-template #operation>\n <a href=\"javascript:;\" thyAlertActionItem (click)=\"conversion()\">\n \u7ACB\u5373\u8F6C\u6362\n </a>\n </ng-template>\n </thy-alert>\n</ng-container>\n", components: [{ type: i1__namespace$1.ThyAlertComponent, selector: "thy-alert", inputs: ["thyType", "thyMessage", "thyIcon", "thyCloseable"] }], directives: [{ type: i1__namespace$1.ThyAlertActionItemDirective, selector: "[thyAlertActionItem]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
2055
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheConversionHintComponent, decorators: [{
|
|
2056
|
+
type: i0.Component,
|
|
2057
|
+
args: [{
|
|
2058
|
+
selector: 'the-conversion-hint',
|
|
2059
|
+
templateUrl: 'conversion-hint.component.html',
|
|
2060
|
+
host: {
|
|
2061
|
+
class: 'the-conversion-hint'
|
|
2062
|
+
},
|
|
2063
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
2064
|
+
}]
|
|
2065
|
+
}], propDecorators: { editor: [{
|
|
2066
|
+
type: i0.Input
|
|
2067
|
+
}], conversion: [{
|
|
2068
|
+
type: i0.Input
|
|
2069
|
+
}], mouseenter: [{
|
|
2070
|
+
type: i0.HostListener,
|
|
2071
|
+
args: ['mouseenter']
|
|
2072
|
+
}], mouseleave: [{
|
|
2073
|
+
type: i0.HostListener,
|
|
2074
|
+
args: ['mouseleave']
|
|
2075
|
+
}] } });
|
|
2076
|
+
|
|
2077
|
+
function plainToTheia(text) {
|
|
2078
|
+
if (typeof text !== 'string') {
|
|
2079
|
+
return text;
|
|
2080
|
+
}
|
|
2081
|
+
return text.split('\n').map(function (i) {
|
|
2082
|
+
return {
|
|
2083
|
+
type: exports.ElementKinds.paragraph,
|
|
2084
|
+
children: [
|
|
2085
|
+
{
|
|
2086
|
+
text: i
|
|
2045
2087
|
}
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
unwrapNodesByType(editor, [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList], { split: true, mode: 'all' });
|
|
2065
|
-
unwrapNodesByType(editor, [exports.ElementKinds.listItem], { split: true, mode: 'all' });
|
|
2066
|
-
});
|
|
2067
|
-
},
|
|
2068
|
-
wrapList: function (editor, type) {
|
|
2069
|
-
slate.Editor.withoutNormalizing(editor, function () {
|
|
2070
|
-
var listItem = {
|
|
2071
|
-
type: exports.ElementKinds.listItem,
|
|
2072
|
-
children: []
|
|
2073
|
-
};
|
|
2074
|
-
var list = {
|
|
2075
|
-
type: type,
|
|
2076
|
-
children: []
|
|
2077
|
-
};
|
|
2078
|
-
slate.Transforms.wrapNodes(editor, list, { split: true });
|
|
2079
|
-
slate.Transforms.wrapNodes(editor, listItem, { split: true });
|
|
2080
|
-
});
|
|
2081
|
-
},
|
|
2082
|
-
isActive: function (editor, type) {
|
|
2083
|
-
var _a = __read(getNodesByType(editor, type), 1), match = _a[0];
|
|
2084
|
-
return !!match;
|
|
2085
|
-
},
|
|
2086
|
-
getActiveList: function (editor) {
|
|
2087
|
-
var _a = __read(getNodesByType(editor, LIST_BLOCK_TYPES), 1), match = _a[0];
|
|
2088
|
-
return match;
|
|
2089
|
-
},
|
|
2090
|
-
buildListItem: function (editor) {
|
|
2091
|
-
var e_1, _a;
|
|
2092
|
-
var nodes = slate.Editor.nodes(editor, {
|
|
2093
|
-
match: function (node) { return slate.Editor.isBlock(editor, node); },
|
|
2094
|
-
mode: 'lowest'
|
|
2095
|
-
});
|
|
2096
|
-
try {
|
|
2097
|
-
for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
|
|
2098
|
-
var _b = __read(nodes_1_1.value, 2), node = _b[0], path = _b[1];
|
|
2099
|
-
if (!slate.Editor.isVoid(editor, node) && slate.Element.isElement(node) && node.type !== exports.ElementKinds.paragraph) {
|
|
2100
|
-
slate.Transforms.setNodes(editor, { type: exports.ElementKinds.paragraph, checked: undefined }, // todo remove checked
|
|
2101
|
-
{ at: path });
|
|
2102
|
-
}
|
|
2103
|
-
else if (slate.Element.isElement(node) && node.type === exports.ElementKinds.paragraph) {
|
|
2104
|
-
var textIndent = node.textIndent;
|
|
2105
|
-
if (textIndent) {
|
|
2106
|
-
slate.Transforms.setNodes(editor, { textIndent: undefined, indent: undefined }, // remove indent
|
|
2107
|
-
{ at: path });
|
|
2108
|
-
}
|
|
2109
|
-
}
|
|
2110
|
-
if (slate.Node.parent(editor, path).type !== exports.ElementKinds.listItem) {
|
|
2111
|
-
slate.Transforms.wrapNodes(editor, { type: exports.ElementKinds.listItem, children: [] }, {
|
|
2112
|
-
at: path,
|
|
2113
|
-
split: true
|
|
2114
|
-
});
|
|
2115
|
-
}
|
|
2116
|
-
}
|
|
2117
|
-
}
|
|
2118
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
2119
|
-
finally {
|
|
2120
|
-
try {
|
|
2121
|
-
if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) _a.call(nodes_1);
|
|
2122
|
-
}
|
|
2123
|
-
finally { if (e_1) throw e_1.error; }
|
|
2088
|
+
]
|
|
2089
|
+
};
|
|
2090
|
+
});
|
|
2091
|
+
}
|
|
2092
|
+
function htmlToTheia(value) {
|
|
2093
|
+
if (typeof value === 'string') {
|
|
2094
|
+
var htmlDom = new DOMParser().parseFromString(value, 'text/html');
|
|
2095
|
+
return selene.TheiaConverter.convertToTheia(Array.from(htmlDom.body.children));
|
|
2096
|
+
}
|
|
2097
|
+
return value;
|
|
2098
|
+
}
|
|
2099
|
+
function dataDeserialize(mode, value) {
|
|
2100
|
+
if (!value) {
|
|
2101
|
+
return [createEmptyParagraph()];
|
|
2102
|
+
}
|
|
2103
|
+
if (mode === exports.TheDataMode.html) {
|
|
2104
|
+
if (typeof value !== 'string') {
|
|
2105
|
+
return value;
|
|
2124
2106
|
}
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
var children = node.children;
|
|
2128
|
-
var listItem = children[0];
|
|
2129
|
-
if (isNodeTypeList(node) && slate.Element.isElement(listItem) && listItem.children[0].type === exports.ElementKinds.paragraph) {
|
|
2130
|
-
return node;
|
|
2107
|
+
if (/<[^>]+>/.test(value)) {
|
|
2108
|
+
return htmlToTheia(value);
|
|
2131
2109
|
}
|
|
2132
|
-
return
|
|
2110
|
+
return plainToTheia(value);
|
|
2111
|
+
}
|
|
2112
|
+
return value || [createEmptyParagraph()];
|
|
2113
|
+
}
|
|
2114
|
+
function dataSerializing(mode, value) {
|
|
2115
|
+
if (mode === exports.TheDataMode.html) {
|
|
2116
|
+
return selene.TheiaConverter.convertToHtml(value);
|
|
2133
2117
|
}
|
|
2118
|
+
return value;
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
var getEditorUUID = function (editor) {
|
|
2122
|
+
return THE_EDITOR_UUID.get(editor);
|
|
2123
|
+
};
|
|
2124
|
+
var setEditorUUID = function (editor, uuid) {
|
|
2125
|
+
THE_EDITOR_UUID.set(editor, uuid);
|
|
2134
2126
|
};
|
|
2135
2127
|
|
|
2136
|
-
var
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
return !!match;
|
|
2140
|
-
},
|
|
2141
|
-
insertTodoItem: function (editor) {
|
|
2142
|
-
if (!editor.selection) {
|
|
2143
|
-
return;
|
|
2144
|
-
}
|
|
2145
|
-
var isActive = this.isActive(editor);
|
|
2146
|
-
var isNumberedList = ListEditor.isActive(editor, exports.ElementKinds.numberedList);
|
|
2147
|
-
var isBulletedList = ListEditor.isActive(editor, exports.ElementKinds.bulletedList);
|
|
2148
|
-
if (isActive) {
|
|
2149
|
-
slate.Transforms.setNodes(editor, {
|
|
2150
|
-
type: exports.ElementKinds.paragraph
|
|
2151
|
-
});
|
|
2152
|
-
}
|
|
2153
|
-
else {
|
|
2154
|
-
if (isNumberedList || isBulletedList) {
|
|
2155
|
-
ListEditor.unwrapList(editor);
|
|
2156
|
-
}
|
|
2157
|
-
slate.Transforms.setNodes(editor, {
|
|
2158
|
-
type: exports.ElementKinds.checkItem
|
|
2159
|
-
});
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
2128
|
+
var getToolbarClass = function (editor) {
|
|
2129
|
+
var uuid = getEditorUUID(editor);
|
|
2130
|
+
return "the-toolbar-" + uuid;
|
|
2162
2131
|
};
|
|
2163
2132
|
|
|
2164
|
-
var
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2133
|
+
var IS_MAC = typeof window != 'undefined' && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
|
|
2134
|
+
var CONTROL_KEY = IS_MAC ? '⌘' : 'Ctrl';
|
|
2135
|
+
|
|
2136
|
+
/**
|
|
2137
|
+
* whether the current node is a clean paragraph
|
|
2138
|
+
* @param editor
|
|
2139
|
+
* @param text
|
|
2140
|
+
* @returns boolean
|
|
2141
|
+
*/
|
|
2142
|
+
var isCleanEmptyParagraph = function (editor) {
|
|
2143
|
+
var isCollapsedCursor = TheEditor.isFocused(editor) && editor.selection && slate.Range.isCollapsed(editor.selection);
|
|
2144
|
+
if (!isCollapsedCursor) {
|
|
2145
|
+
return false;
|
|
2146
|
+
}
|
|
2147
|
+
var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
|
|
2148
|
+
var textIndent = 'textIndent';
|
|
2149
|
+
var align = 'align';
|
|
2150
|
+
var hasTextIndent = block[textIndent];
|
|
2151
|
+
var alignValue = block[align];
|
|
2152
|
+
var hasIndent = block[exports.ElementKinds.indent];
|
|
2153
|
+
if (slate.Node.string(block) === '' &&
|
|
2154
|
+
slate.Element.isElement(block) &&
|
|
2155
|
+
block.type === exports.ElementKinds.paragraph &&
|
|
2156
|
+
block.children.length === 1 &&
|
|
2157
|
+
slate.Text.isText(block.children[0]) &&
|
|
2158
|
+
!slate.Editor.isVoid(editor, block) &&
|
|
2159
|
+
!hasIndent &&
|
|
2160
|
+
!hasTextIndent &&
|
|
2161
|
+
(!alignValue || alignValue === exports.Alignment.left)) {
|
|
2162
|
+
return true;
|
|
2186
2163
|
}
|
|
2164
|
+
return false;
|
|
2187
2165
|
};
|
|
2188
2166
|
|
|
2189
|
-
var
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
var selectText = slate.Node.string(selectNode);
|
|
2203
|
-
InlineCodeEditor.wrapInlineCode(editor, selectText);
|
|
2204
|
-
}
|
|
2205
|
-
},
|
|
2206
|
-
wrapInlineCode: function (editor, text) {
|
|
2207
|
-
if (text === void 0) { text = ''; }
|
|
2208
|
-
if (InlineCodeEditor.isInlineCodeActive(editor)) {
|
|
2209
|
-
InlineCodeEditor.unwrapInlineCode(editor);
|
|
2210
|
-
}
|
|
2211
|
-
var selection = editor.selection;
|
|
2212
|
-
var isCollapsed = selection && slate.Range.isCollapsed(selection);
|
|
2213
|
-
var inlineCode = {
|
|
2214
|
-
type: exports.ElementKinds.inlineCode,
|
|
2215
|
-
children: isCollapsed ? [{ text: text ? text : ZERO_WIDTH_CHAR }] : []
|
|
2216
|
-
};
|
|
2217
|
-
if (isCollapsed) {
|
|
2218
|
-
slate.Transforms.insertNodes(editor, inlineCode);
|
|
2219
|
-
}
|
|
2220
|
-
else {
|
|
2221
|
-
slate.Transforms.wrapNodes(editor, inlineCode, { split: true });
|
|
2167
|
+
var mergeElementOptions = function (elementOptions) {
|
|
2168
|
+
elementOptions = elementOptions.filter(function (item) { return item.inValidChildrenTypes.length > 0; });
|
|
2169
|
+
var combinationData = __spreadArray(__spreadArray([], __read(DefaultElementOptions)), __read(elementOptions));
|
|
2170
|
+
var dataInfo = {};
|
|
2171
|
+
combinationData.forEach(function (item) {
|
|
2172
|
+
var type = item.type, inValidChildrenTypes = item.inValidChildrenTypes, isIndivisible = item.isIndivisible, isSecondaryContainer = item.isSecondaryContainer;
|
|
2173
|
+
if (!dataInfo[type]) {
|
|
2174
|
+
dataInfo[type] = {
|
|
2175
|
+
type: type,
|
|
2176
|
+
inValidChildrenTypes: inValidChildrenTypes,
|
|
2177
|
+
isIndivisible: isIndivisible,
|
|
2178
|
+
isSecondaryContainer: isSecondaryContainer
|
|
2179
|
+
};
|
|
2222
2180
|
}
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
},
|
|
2227
|
-
isInlineCodeActive: function (editor, path) {
|
|
2228
|
-
var _a;
|
|
2229
|
-
var _b = __read(slate.Editor.nodes(editor, {
|
|
2230
|
-
at: path ? path : (_a = editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path,
|
|
2231
|
-
match: function (n) { return slate.Element.isElement(n) && n.type === exports.ElementKinds.inlineCode; }
|
|
2232
|
-
}), 1), inlineCode = _b[0];
|
|
2233
|
-
return !!inlineCode;
|
|
2234
|
-
}
|
|
2181
|
+
dataInfo[type].inValidChildrenTypes = Array.from(new Set(__spreadArray(__spreadArray([], __read(inValidChildrenTypes)), __read(dataInfo[type].inValidChildrenTypes))));
|
|
2182
|
+
});
|
|
2183
|
+
return dataInfo;
|
|
2235
2184
|
};
|
|
2236
2185
|
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
slate.Transforms.unwrapNodes(editor, {
|
|
2243
|
-
at: editor.selection,
|
|
2244
|
-
match: function (n) { return slate.Element.isElement(n) && types.includes(n.type); },
|
|
2245
|
-
mode: 'all',
|
|
2246
|
-
split: true
|
|
2247
|
-
});
|
|
2248
|
-
slate.Transforms.setNodes(editor, { type: heading });
|
|
2249
|
-
var entry = anchorBlockEntry(editor);
|
|
2250
|
-
var unMarks = (_a = {},
|
|
2251
|
-
_a[exports.MarkTypes.fontSize] = null,
|
|
2252
|
-
_a);
|
|
2253
|
-
if (entry) {
|
|
2254
|
-
setMarks(editor, unMarks, entry[1]);
|
|
2255
|
-
return;
|
|
2256
|
-
}
|
|
2257
|
-
setMarks(editor, unMarks, editor.selection);
|
|
2258
|
-
});
|
|
2259
|
-
},
|
|
2260
|
-
isHeadingActive: function (editor, heading) {
|
|
2261
|
-
var _a = __read(slate.Editor.nodes(editor, {
|
|
2262
|
-
match: function (n) { return slate.Element.isElement(n) && n.type === heading; },
|
|
2263
|
-
universal: true
|
|
2264
|
-
}), 1), match = _a[0];
|
|
2265
|
-
return !!match;
|
|
2266
|
-
}
|
|
2267
|
-
};
|
|
2268
|
-
|
|
2269
|
-
var autoFormatRules = [
|
|
2270
|
-
{
|
|
2271
|
-
type: exports.ElementKinds.heading_1,
|
|
2272
|
-
markup: '#',
|
|
2273
|
-
format: function (editor) {
|
|
2274
|
-
HeadingEditor.setHeading(editor, exports.ElementKinds.heading_1);
|
|
2275
|
-
}
|
|
2276
|
-
},
|
|
2277
|
-
{
|
|
2278
|
-
type: exports.ElementKinds.heading_2,
|
|
2279
|
-
markup: '##',
|
|
2280
|
-
format: function (editor) {
|
|
2281
|
-
HeadingEditor.setHeading(editor, exports.ElementKinds.heading_2);
|
|
2282
|
-
}
|
|
2283
|
-
},
|
|
2284
|
-
{
|
|
2285
|
-
type: exports.ElementKinds.heading_3,
|
|
2286
|
-
markup: '###',
|
|
2287
|
-
format: function (editor) {
|
|
2288
|
-
HeadingEditor.setHeading(editor, exports.ElementKinds.heading_3);
|
|
2289
|
-
}
|
|
2290
|
-
},
|
|
2291
|
-
{
|
|
2292
|
-
type: exports.ElementKinds.heading_4,
|
|
2293
|
-
markup: '####',
|
|
2294
|
-
format: function (editor) {
|
|
2295
|
-
HeadingEditor.setHeading(editor, exports.ElementKinds.heading_4);
|
|
2296
|
-
}
|
|
2297
|
-
},
|
|
2298
|
-
{
|
|
2299
|
-
type: exports.ElementKinds.heading_5,
|
|
2300
|
-
markup: '#####',
|
|
2301
|
-
format: function (editor) {
|
|
2302
|
-
HeadingEditor.setHeading(editor, exports.ElementKinds.heading_5);
|
|
2303
|
-
}
|
|
2304
|
-
},
|
|
2305
|
-
{
|
|
2306
|
-
type: exports.ElementKinds.heading_6,
|
|
2307
|
-
markup: '######',
|
|
2308
|
-
format: function (editor) {
|
|
2309
|
-
HeadingEditor.setHeading(editor, exports.ElementKinds.heading_6);
|
|
2310
|
-
}
|
|
2311
|
-
},
|
|
2312
|
-
{
|
|
2313
|
-
type: exports.ElementKinds.blockquote,
|
|
2314
|
-
markup: ['>'],
|
|
2315
|
-
format: function (editor) {
|
|
2316
|
-
BlockquoteEditor.toggleBlockquote(editor);
|
|
2317
|
-
}
|
|
2318
|
-
},
|
|
2319
|
-
{
|
|
2320
|
-
type: exports.MarkTypes.bold,
|
|
2321
|
-
between: ['**', '**'],
|
|
2322
|
-
mode: 'inline',
|
|
2323
|
-
insertTrigger: true
|
|
2324
|
-
},
|
|
2325
|
-
{
|
|
2326
|
-
type: exports.MarkTypes.bold,
|
|
2327
|
-
between: ['__', '__'],
|
|
2328
|
-
mode: 'inline',
|
|
2329
|
-
insertTrigger: true
|
|
2330
|
-
},
|
|
2331
|
-
{
|
|
2332
|
-
type: exports.MarkTypes.italic,
|
|
2333
|
-
between: ['*', '*'],
|
|
2334
|
-
mode: 'inline',
|
|
2335
|
-
insertTrigger: true
|
|
2336
|
-
},
|
|
2337
|
-
{
|
|
2338
|
-
type: exports.MarkTypes.italic,
|
|
2339
|
-
between: ['_', '_'],
|
|
2340
|
-
mode: 'inline',
|
|
2341
|
-
insertTrigger: true
|
|
2342
|
-
},
|
|
2343
|
-
{
|
|
2344
|
-
type: exports.ElementKinds.inlineCode,
|
|
2345
|
-
between: ['`', '`'],
|
|
2346
|
-
mode: 'inline',
|
|
2347
|
-
format: function (editor, text) {
|
|
2348
|
-
InlineCodeEditor.toggleInlineCode(editor, text);
|
|
2349
|
-
slate.Transforms.select(editor, slate.Editor.after(editor, editor.selection));
|
|
2350
|
-
}
|
|
2351
|
-
},
|
|
2352
|
-
{
|
|
2353
|
-
type: exports.MarkTypes.strike,
|
|
2354
|
-
between: ['~~', '~~'],
|
|
2355
|
-
mode: 'inline',
|
|
2356
|
-
insertTrigger: true
|
|
2357
|
-
},
|
|
2358
|
-
{
|
|
2359
|
-
type: exports.ElementKinds.code,
|
|
2360
|
-
markup: '```',
|
|
2361
|
-
insertTrigger: true
|
|
2362
|
-
},
|
|
2363
|
-
{
|
|
2364
|
-
type: exports.ElementKinds.listItem,
|
|
2365
|
-
markup: [],
|
|
2366
|
-
match: function (editor) {
|
|
2367
|
-
return isParagraph(editor) ? ['*', '-', '+'] : [];
|
|
2368
|
-
},
|
|
2369
|
-
format: function (editor) {
|
|
2370
|
-
ListEditor.toggleList(editor, exports.ElementKinds.bulletedList);
|
|
2371
|
-
}
|
|
2372
|
-
},
|
|
2373
|
-
{
|
|
2374
|
-
type: exports.ElementKinds.listItem,
|
|
2375
|
-
markup: [],
|
|
2376
|
-
match: function (editor, textFromBlockStart) {
|
|
2377
|
-
return isParagraph(editor) && /^-?\d+(\.|\))$/.test(textFromBlockStart) ? [textFromBlockStart] : [];
|
|
2378
|
-
},
|
|
2379
|
-
format: function (editor, markup) {
|
|
2380
|
-
var startIndex = 1;
|
|
2381
|
-
if (markup) {
|
|
2382
|
-
startIndex = markup[0].split('.')[0];
|
|
2383
|
-
if (startIndex === 0) {
|
|
2384
|
-
startIndex = 1;
|
|
2385
|
-
}
|
|
2386
|
-
}
|
|
2387
|
-
ListEditor.toggleList(editor, exports.ElementKinds.numberedList, startIndex);
|
|
2388
|
-
}
|
|
2389
|
-
},
|
|
2390
|
-
{
|
|
2391
|
-
type: exports.ElementKinds.checkItem,
|
|
2392
|
-
markup: [],
|
|
2393
|
-
match: function (editor) {
|
|
2394
|
-
return isParagraph(editor) ? ['[]'] : [];
|
|
2395
|
-
},
|
|
2396
|
-
format: function (editor) {
|
|
2397
|
-
TodoItemEditor.insertTodoItem(editor);
|
|
2398
|
-
}
|
|
2399
|
-
},
|
|
2400
|
-
{
|
|
2401
|
-
type: exports.ElementKinds.hr,
|
|
2402
|
-
markup: '---',
|
|
2403
|
-
insertTrigger: true
|
|
2404
|
-
}
|
|
2405
|
-
];
|
|
2406
|
-
|
|
2407
|
-
var UNDOING = new WeakMap();
|
|
2408
|
-
var REDOING = new WeakMap();
|
|
2409
|
-
var withTheHistory = function (editor) {
|
|
2410
|
-
var undo = editor.undo, redo = editor.redo;
|
|
2411
|
-
editor.undo = function () {
|
|
2412
|
-
UNDOING.set(editor, true);
|
|
2413
|
-
undo();
|
|
2414
|
-
UNDOING.set(editor, false);
|
|
2415
|
-
};
|
|
2416
|
-
editor.redo = function () {
|
|
2417
|
-
REDOING.set(editor, true);
|
|
2418
|
-
redo();
|
|
2419
|
-
REDOING.set(editor, false);
|
|
2420
|
-
};
|
|
2421
|
-
return editor;
|
|
2422
|
-
};
|
|
2423
|
-
var TheHistoryEditor = {
|
|
2424
|
-
isUndoing: function (editor) {
|
|
2425
|
-
return UNDOING.get(editor);
|
|
2426
|
-
},
|
|
2427
|
-
isRedoing: function (editor) {
|
|
2428
|
-
return REDOING.get(editor);
|
|
2429
|
-
}
|
|
2430
|
-
};
|
|
2431
|
-
|
|
2432
|
-
var TheConversionHintComponent = /** @class */ (function () {
|
|
2433
|
-
function TheConversionHintComponent() {
|
|
2434
|
-
this.duration = 10000;
|
|
2435
|
-
this.pauseOnHover = true;
|
|
2436
|
-
}
|
|
2437
|
-
TheConversionHintComponent.prototype.mouseenter = function () {
|
|
2438
|
-
if (this.pauseOnHover) {
|
|
2439
|
-
this.clearCloseTimer();
|
|
2440
|
-
}
|
|
2441
|
-
};
|
|
2442
|
-
TheConversionHintComponent.prototype.mouseleave = function () {
|
|
2443
|
-
if (this.pauseOnHover) {
|
|
2444
|
-
this.creatCloseTimer();
|
|
2445
|
-
}
|
|
2446
|
-
};
|
|
2447
|
-
TheConversionHintComponent.prototype.ngOnInit = function () {
|
|
2448
|
-
this.creatCloseTimer();
|
|
2449
|
-
};
|
|
2450
|
-
TheConversionHintComponent.prototype.ngOnDestroy = function () {
|
|
2451
|
-
this.clearCloseTimer();
|
|
2452
|
-
};
|
|
2453
|
-
TheConversionHintComponent.prototype.creatCloseTimer = function () {
|
|
2454
|
-
var _this = this;
|
|
2455
|
-
this.closeTimer = setInterval(function () {
|
|
2456
|
-
clearInterval(_this.closeTimer);
|
|
2457
|
-
closeConversionHint(_this.editor);
|
|
2458
|
-
}, this.duration);
|
|
2459
|
-
};
|
|
2460
|
-
TheConversionHintComponent.prototype.clearCloseTimer = function () {
|
|
2461
|
-
clearInterval(this.closeTimer);
|
|
2462
|
-
};
|
|
2463
|
-
return TheConversionHintComponent;
|
|
2464
|
-
}());
|
|
2465
|
-
TheConversionHintComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheConversionHintComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
2466
|
-
TheConversionHintComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheConversionHintComponent, selector: "the-conversion-hint", inputs: { editor: "editor", conversion: "conversion" }, host: { listeners: { "mouseenter": "mouseenter()", "mouseleave": "mouseleave()" }, classAttribute: "the-conversion-hint" }, ngImport: i0__namespace, template: "<ng-container>\n <thy-alert\n thyType=\"primary-weak\"\n thyIcon=\"info-circle-fill\"\n thyCloseable=\"true\"\n thyMessage=\"\u68C0\u6D4B\u5230\u7C98\u8D34\u5185\u5BB9\u7B26\u5408Markdown\u8BED\u6CD5\"\n >\n <ng-template #operation>\n <a href=\"javascript:;\" thyAlertActionItem (click)=\"conversion()\">\n \u7ACB\u5373\u8F6C\u6362\n </a>\n </ng-template>\n </thy-alert>\n</ng-container>\n", components: [{ type: i1__namespace$1.ThyAlertComponent, selector: "thy-alert", inputs: ["thyType", "thyMessage", "thyIcon", "thyCloseable"] }], directives: [{ type: i1__namespace$1.ThyAlertActionItemDirective, selector: "[thyAlertActionItem]" }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
2467
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheConversionHintComponent, decorators: [{
|
|
2468
|
-
type: i0.Component,
|
|
2469
|
-
args: [{
|
|
2470
|
-
selector: 'the-conversion-hint',
|
|
2471
|
-
templateUrl: 'conversion-hint.component.html',
|
|
2472
|
-
host: {
|
|
2473
|
-
class: 'the-conversion-hint'
|
|
2474
|
-
},
|
|
2475
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
2476
|
-
}]
|
|
2477
|
-
}], propDecorators: { editor: [{
|
|
2478
|
-
type: i0.Input
|
|
2479
|
-
}], conversion: [{
|
|
2480
|
-
type: i0.Input
|
|
2481
|
-
}], mouseenter: [{
|
|
2482
|
-
type: i0.HostListener,
|
|
2483
|
-
args: ['mouseenter']
|
|
2484
|
-
}], mouseleave: [{
|
|
2485
|
-
type: i0.HostListener,
|
|
2486
|
-
args: ['mouseleave']
|
|
2487
|
-
}] } });
|
|
2488
|
-
|
|
2489
|
-
function plainToTheia(text) {
|
|
2490
|
-
if (typeof text !== 'string') {
|
|
2491
|
-
return text;
|
|
2492
|
-
}
|
|
2493
|
-
return text.split('\n').map(function (i) {
|
|
2494
|
-
return {
|
|
2495
|
-
type: exports.ElementKinds.paragraph,
|
|
2496
|
-
children: [
|
|
2497
|
-
{
|
|
2498
|
-
text: i
|
|
2499
|
-
}
|
|
2500
|
-
]
|
|
2501
|
-
};
|
|
2502
|
-
});
|
|
2503
|
-
}
|
|
2504
|
-
function htmlToTheia(value) {
|
|
2505
|
-
if (typeof value === 'string') {
|
|
2506
|
-
var htmlDom = new DOMParser().parseFromString(value, 'text/html');
|
|
2507
|
-
return selene.TheiaConverter.convertToTheia(Array.from(htmlDom.body.children));
|
|
2508
|
-
}
|
|
2509
|
-
return value;
|
|
2510
|
-
}
|
|
2511
|
-
function dataDeserialize(mode, value) {
|
|
2512
|
-
if (!value) {
|
|
2513
|
-
return [createEmptyParagraph()];
|
|
2514
|
-
}
|
|
2515
|
-
if (mode === exports.TheDataMode.html) {
|
|
2516
|
-
if (typeof value !== 'string') {
|
|
2517
|
-
return value;
|
|
2518
|
-
}
|
|
2519
|
-
if (/<[^>]+>/.test(value)) {
|
|
2520
|
-
return htmlToTheia(value);
|
|
2521
|
-
}
|
|
2522
|
-
return plainToTheia(value);
|
|
2523
|
-
}
|
|
2524
|
-
return value || [createEmptyParagraph()];
|
|
2525
|
-
}
|
|
2526
|
-
function dataSerializing(mode, value) {
|
|
2527
|
-
if (mode === exports.TheDataMode.html) {
|
|
2528
|
-
return selene.TheiaConverter.convertToHtml(value);
|
|
2529
|
-
}
|
|
2530
|
-
return value;
|
|
2531
|
-
}
|
|
2532
|
-
|
|
2533
|
-
var getEditorUUID = function (editor) {
|
|
2534
|
-
return THE_EDITOR_UUID.get(editor);
|
|
2535
|
-
};
|
|
2536
|
-
var setEditorUUID = function (editor, uuid) {
|
|
2537
|
-
THE_EDITOR_UUID.set(editor, uuid);
|
|
2538
|
-
};
|
|
2539
|
-
|
|
2540
|
-
var getToolbarClass = function (editor) {
|
|
2541
|
-
var uuid = getEditorUUID(editor);
|
|
2542
|
-
return "the-toolbar-" + uuid;
|
|
2543
|
-
};
|
|
2544
|
-
|
|
2545
|
-
var IS_MAC = typeof window != 'undefined' && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
|
|
2546
|
-
var CONTROL_KEY = IS_MAC ? '⌘' : 'Ctrl';
|
|
2547
|
-
|
|
2548
|
-
/**
|
|
2549
|
-
* whether the current node is a clean paragraph
|
|
2550
|
-
* @param editor
|
|
2551
|
-
* @param text
|
|
2552
|
-
* @returns boolean
|
|
2553
|
-
*/
|
|
2554
|
-
var isCleanEmptyParagraph = function (editor) {
|
|
2555
|
-
var isCollapsedCursor = TheEditor.isFocused(editor) && editor.selection && slate.Range.isCollapsed(editor.selection);
|
|
2556
|
-
if (!isCollapsedCursor) {
|
|
2557
|
-
return false;
|
|
2558
|
-
}
|
|
2559
|
-
var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
|
|
2560
|
-
var textIndent = 'textIndent';
|
|
2561
|
-
var align = 'align';
|
|
2562
|
-
var hasTextIndent = block[textIndent];
|
|
2563
|
-
var alignValue = block[align];
|
|
2564
|
-
var hasIndent = block[exports.ElementKinds.indent];
|
|
2565
|
-
if (slate.Node.string(block) === '' &&
|
|
2566
|
-
slate.Element.isElement(block) &&
|
|
2567
|
-
block.type === exports.ElementKinds.paragraph &&
|
|
2568
|
-
block.children.length === 1 &&
|
|
2569
|
-
slate.Text.isText(block.children[0]) &&
|
|
2570
|
-
!slate.Editor.isVoid(editor, block) &&
|
|
2571
|
-
!hasIndent &&
|
|
2572
|
-
!hasTextIndent &&
|
|
2573
|
-
(!alignValue || alignValue === exports.Alignment.left)) {
|
|
2574
|
-
return true;
|
|
2575
|
-
}
|
|
2576
|
-
return false;
|
|
2577
|
-
};
|
|
2578
|
-
|
|
2579
|
-
var mergeElementOptions = function (elementOptions) {
|
|
2580
|
-
elementOptions = elementOptions.filter(function (item) { return item.inValidChildrenTypes.length > 0; });
|
|
2581
|
-
var combinationData = __spreadArray(__spreadArray([], __read(DefaultElementOptions)), __read(elementOptions));
|
|
2582
|
-
var dataInfo = {};
|
|
2583
|
-
combinationData.forEach(function (item) {
|
|
2584
|
-
var type = item.type, inValidChildrenTypes = item.inValidChildrenTypes, isIndivisible = item.isIndivisible, isSecondaryContainer = item.isSecondaryContainer;
|
|
2585
|
-
if (!dataInfo[type]) {
|
|
2586
|
-
dataInfo[type] = {
|
|
2587
|
-
type: type,
|
|
2588
|
-
inValidChildrenTypes: inValidChildrenTypes,
|
|
2589
|
-
isIndivisible: isIndivisible,
|
|
2590
|
-
isSecondaryContainer: isSecondaryContainer
|
|
2591
|
-
};
|
|
2592
|
-
}
|
|
2593
|
-
dataInfo[type].inValidChildrenTypes = Array.from(new Set(__spreadArray(__spreadArray([], __read(inValidChildrenTypes)), __read(dataInfo[type].inValidChildrenTypes))));
|
|
2594
|
-
});
|
|
2595
|
-
return dataInfo;
|
|
2596
|
-
};
|
|
2597
|
-
|
|
2598
|
-
/** Converts CSS pixel values to numbers, eg "123px" to 123. Returns NaN for non pixel values. */
|
|
2599
|
-
function coercePixelsFromCssValue(cssValue) {
|
|
2600
|
-
var match = cssValue.match(/(\d+(\.\d+)?)px/);
|
|
2601
|
-
if (match) {
|
|
2602
|
-
return Number(match[1]);
|
|
2186
|
+
/** Converts CSS pixel values to numbers, eg "123px" to 123. Returns NaN for non pixel values. */
|
|
2187
|
+
function coercePixelsFromCssValue(cssValue) {
|
|
2188
|
+
var match = cssValue.match(/(\d+(\.\d+)?)px/);
|
|
2189
|
+
if (match) {
|
|
2190
|
+
return Number(match[1]);
|
|
2603
2191
|
}
|
|
2604
2192
|
}
|
|
2605
2193
|
function getElementWidth(element) {
|
|
@@ -2608,7 +2196,7 @@
|
|
|
2608
2196
|
return coercePixelsFromCssValue(element.style.width) || element.offsetWidth;
|
|
2609
2197
|
}
|
|
2610
2198
|
function getElementHeight(element) {
|
|
2611
|
-
return
|
|
2199
|
+
return element.getBoundingClientRect().height;
|
|
2612
2200
|
}
|
|
2613
2201
|
function getColsTotalWidth(cols) {
|
|
2614
2202
|
return cols.reduce(function (total, col) {
|
|
@@ -2640,45 +2228,6 @@
|
|
|
2640
2228
|
});
|
|
2641
2229
|
return matchClass;
|
|
2642
2230
|
}
|
|
2643
|
-
function findRelativeElementByPoint(editor, x, y, mode) {
|
|
2644
|
-
var editableElement = i1.EDITOR_TO_ELEMENT.get(editor);
|
|
2645
|
-
var rectEditable = editableElement.getBoundingClientRect();
|
|
2646
|
-
if (x > rectEditable.x && x < rectEditable.x + rectEditable.width) {
|
|
2647
|
-
var paddingLeft = window.getComputedStyle(editableElement, null).paddingLeft;
|
|
2648
|
-
var paddingLeftPixels = coercePixelsFromCssValue(paddingLeft);
|
|
2649
|
-
var startX = rectEditable.left + paddingLeftPixels;
|
|
2650
|
-
var relativeElement = document.elementFromPoint(mode === 'highest' ? startX : x, y);
|
|
2651
|
-
return relativeElement;
|
|
2652
|
-
}
|
|
2653
|
-
return null;
|
|
2654
|
-
}
|
|
2655
|
-
function findNodeEntryByPoint(editor, x, y, mode) {
|
|
2656
|
-
var editableElement = i1.EDITOR_TO_ELEMENT.get(editor);
|
|
2657
|
-
var rootElement = null;
|
|
2658
|
-
var relativeElement = findRelativeElementByPoint(editor, x, y, mode);
|
|
2659
|
-
// 获取最顶层的DOM
|
|
2660
|
-
if (mode === 'highest') {
|
|
2661
|
-
while (relativeElement && editableElement.contains(relativeElement)) {
|
|
2662
|
-
relativeElement = relativeElement.closest('[data-slate-node="element"]');
|
|
2663
|
-
if (relativeElement) {
|
|
2664
|
-
rootElement = relativeElement;
|
|
2665
|
-
relativeElement = relativeElement.parentElement;
|
|
2666
|
-
}
|
|
2667
|
-
}
|
|
2668
|
-
}
|
|
2669
|
-
if (!mode) {
|
|
2670
|
-
if (relativeElement && editableElement.contains(relativeElement)) {
|
|
2671
|
-
relativeElement = relativeElement.closest('[data-slate-node="element"]');
|
|
2672
|
-
rootElement = relativeElement;
|
|
2673
|
-
}
|
|
2674
|
-
}
|
|
2675
|
-
if (rootElement) {
|
|
2676
|
-
var node = i1.AngularEditor.toSlateNode(editor, rootElement);
|
|
2677
|
-
var path = i1.AngularEditor.findPath(editor, node);
|
|
2678
|
-
return [node, path];
|
|
2679
|
-
}
|
|
2680
|
-
return null;
|
|
2681
|
-
}
|
|
2682
2231
|
|
|
2683
2232
|
var withDeserializeMd = function (options) { return function (editor) {
|
|
2684
2233
|
var insertData = editor.insertData, onKeydown = editor.onKeydown;
|
|
@@ -3438,7 +2987,7 @@
|
|
|
3438
2987
|
return TheImageComponent;
|
|
3439
2988
|
}(TheBaseElementComponent));
|
|
3440
2989
|
TheImageComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheImageComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$2.DomSanitizer }, { token: THE_UPLOAD_SERVICE_TOKEN }, { token: i0__namespace.ChangeDetectorRef }, { token: TheContextService }, { token: i1__namespace$3.ThyPopover }, { token: i2__namespace.Overlay }, { token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
3441
|
-
TheImageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheImageComponent, selector: "the-image, [theImage]", viewQueries: [{ propertyName: "imageContent", first: true, predicate: ["imageContent"], descendants: true }, { propertyName: "img", first: true, predicate: ["img"], descendants: true }, { propertyName: "layoutToolbar", first: true, predicate: ["layoutToolbar"], descendants: true, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div\n #imageContent\n *ngIf=\"imageEntry.thumbUrl\"\n class=\"image-content\"\n [class.pointer]=\"!selection\"\n [ngStyle]=\"{\n 'width.px':\n imageEntry?.layout && imageEntry?.width > layoutDefaultWidth && !imageEntry?.reSized\n ? layoutDefaultWidth\n : imageEntry.width,\n 'height.px': imageEntry.height\n }\"\n >\n <img #img class=\"main-image\" [src]=\"imageEntry.thumbUrl\" [alt]=\"imageEntry.name\" />\n <div *ngIf=\"selection\" class=\"image-profile\" [class.outline]=\"selection\">\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left bottom\"></span>\n </div>\n <div *ngIf=\"uploading\" class=\"uploading\">\n <div class=\"uploading-percentage\">\n <thy-progress thyType=\"primary\" [thyValue]=\"percentage\" thySize=\"sm\"></thy-progress>\n <thy-icon (click)=\"cancelUpload($event)\" thyIconName=\"close-circle-bold-fill\" thyIconLegging=\"true\"></thy-icon>\n </div>\n </div>\n <div *ngIf=\"!uploading\" class=\"layer\" (mousedown)=\"preview($event)\" [class.readonly]=\"readonly\"></div>\n </div>\n <div *ngIf=\"!imageEntry.thumbUrl\" class=\"image-loading\" contenteditable=\"false\">\n <thy-icon thyIconName=\"image\"></thy-icon>\n </div>\n</div>\n\n<ng-template #layoutToolbar>\n <div class=\"the-block-toolbar-popover\" contenteditable=\"false\">\n <thy-icon-nav>\n <ng-container *ngFor=\"let item of layoutOptions\">\n <a\n *ngIf=\"item.key !== 'split'\"\n href=\"javascript:;\"\n thyIconNavLink\n [ngClass]=\"{ 'remove-link': item.key === 'remove' }\"\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n [thyIconNavLinkActive]=\"layoutActive(item.key)\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"item?.handle($event, item.key)\"\n ></a>\n <nav-split-line *ngIf=\"item.key === 'split'\"></nav-split-line>\n </ng-container>\n </thy-icon-nav>\n </div>\n</ng-template>\n", components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i6__namespace.ThyProgressComponent, selector: "thy-progress", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips"] }, { type:
|
|
2990
|
+
TheImageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheImageComponent, selector: "the-image, [theImage]", viewQueries: [{ propertyName: "imageContent", first: true, predicate: ["imageContent"], descendants: true }, { propertyName: "img", first: true, predicate: ["img"], descendants: true }, { propertyName: "layoutToolbar", first: true, predicate: ["layoutToolbar"], descendants: true, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div\n #imageContent\n *ngIf=\"imageEntry.thumbUrl\"\n class=\"image-content\"\n [class.pointer]=\"!selection\"\n [ngStyle]=\"{\n 'width.px':\n imageEntry?.layout && imageEntry?.width > layoutDefaultWidth && !imageEntry?.reSized\n ? layoutDefaultWidth\n : imageEntry.width,\n 'height.px': imageEntry.height\n }\"\n >\n <img #img class=\"main-image\" [src]=\"imageEntry.thumbUrl\" [alt]=\"imageEntry.name\" />\n <div *ngIf=\"selection\" class=\"image-profile\" [class.outline]=\"selection\">\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span *ngIf=\"isCollapsed\" (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left bottom\"></span>\n </div>\n <div *ngIf=\"uploading\" class=\"uploading\">\n <div class=\"uploading-percentage\">\n <thy-progress thyType=\"primary\" [thyValue]=\"percentage\" thySize=\"sm\"></thy-progress>\n <thy-icon (click)=\"cancelUpload($event)\" thyIconName=\"close-circle-bold-fill\" thyIconLegging=\"true\"></thy-icon>\n </div>\n </div>\n <div *ngIf=\"!uploading\" class=\"layer\" (mousedown)=\"preview($event)\" [class.readonly]=\"readonly\"></div>\n </div>\n <div *ngIf=\"!imageEntry.thumbUrl\" class=\"image-loading\" contenteditable=\"false\">\n <thy-icon thyIconName=\"image\"></thy-icon>\n </div>\n</div>\n\n<ng-template #layoutToolbar>\n <div class=\"the-block-toolbar-popover\" contenteditable=\"false\">\n <thy-icon-nav>\n <ng-container *ngFor=\"let item of layoutOptions\">\n <a\n *ngIf=\"item.key !== 'split'\"\n href=\"javascript:;\"\n thyIconNavLink\n [ngClass]=\"{ 'remove-link': item.key === 'remove' }\"\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n [thyIconNavLinkActive]=\"layoutActive(item.key)\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"item?.handle($event, item.key)\"\n ></a>\n <nav-split-line *ngIf=\"item.key === 'split'\"></nav-split-line>\n </ng-container>\n </thy-icon-nav>\n </div>\n</ng-template>\n", components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i6__namespace.ThyProgressComponent, selector: "thy-progress", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips"] }, { type: i3__namespace.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i3__namespace$1.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: i3__namespace$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }], directives: [{ type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
3442
2991
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheImageComponent, decorators: [{
|
|
3443
2992
|
type: i0.Component,
|
|
3444
2993
|
args: [{
|
|
@@ -3576,6 +3125,10 @@
|
|
|
3576
3125
|
return listItemNode.children.length === 1 && type === exports.ElementKinds.paragraph;
|
|
3577
3126
|
};
|
|
3578
3127
|
|
|
3128
|
+
var isNodeTypeList = function (n) {
|
|
3129
|
+
return [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList].includes(n.type);
|
|
3130
|
+
};
|
|
3131
|
+
|
|
3579
3132
|
/**
|
|
3580
3133
|
* list 中 是否是单个listItem,且listItem没有子列表
|
|
3581
3134
|
*/
|
|
@@ -4518,12 +4071,12 @@
|
|
|
4518
4071
|
return TheTodoItemComponent;
|
|
4519
4072
|
}(TheBaseElementComponent));
|
|
4520
4073
|
TheTodoItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTodoItemComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
4521
|
-
TheTodoItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTodoItemComponent, selector: "div[theTodoItem]", host: { properties: { "class.the-check-item": "this.checkItemClass", "attr.the-level": "this.level" } }, usesInheritance: true, ngImport: i0__namespace, template: "\n <span contenteditable=\"false\" class=\"todo-item-status\">\n <input #checkbox type=\"checkbox\" [checked]=\"element.checked\" (click)=\"onCheck(checkbox.checked)\" />\n </span>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n ", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
|
|
4074
|
+
TheTodoItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTodoItemComponent, selector: "div[theTodoItem]", host: { properties: { "class.the-check-item": "this.checkItemClass", "attr.the-level": "this.level" } }, usesInheritance: true, ngImport: i0__namespace, template: "\n <span contenteditable=\"false\" class=\"todo-item-status\">\n <input #checkbox type=\"checkbox\" [checked]=\"element.checked\" (click)=\"onCheck(checkbox.checked)\" />\n </span>\n <span><slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children></span>\n ", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
|
|
4522
4075
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTodoItemComponent, decorators: [{
|
|
4523
4076
|
type: i0.Component,
|
|
4524
4077
|
args: [{
|
|
4525
4078
|
selector: 'div[theTodoItem]',
|
|
4526
|
-
template: "\n <span contenteditable=\"false\" class=\"todo-item-status\">\n <input #checkbox type=\"checkbox\" [checked]=\"element.checked\" (click)=\"onCheck(checkbox.checked)\" />\n </span>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n "
|
|
4079
|
+
template: "\n <span contenteditable=\"false\" class=\"todo-item-status\">\n <input #checkbox type=\"checkbox\" [checked]=\"element.checked\" (click)=\"onCheck(checkbox.checked)\" />\n </span>\n <span><slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children></span>\n "
|
|
4527
4080
|
}]
|
|
4528
4081
|
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { checkItemClass: [{
|
|
4529
4082
|
type: i0.HostBinding,
|
|
@@ -4783,205 +4336,627 @@
|
|
|
4783
4336
|
if (operation.type === 'merge_node' && (!filterText || operation.properties.type)) {
|
|
4784
4337
|
editor.removedIDs.add(operation.properties[idKey]);
|
|
4785
4338
|
}
|
|
4786
|
-
return apply(operation);
|
|
4787
|
-
};
|
|
4788
|
-
editor.getFragment = function () {
|
|
4789
|
-
var fragment = _.cloneDeep(getFragment());
|
|
4790
|
-
return deleteElementKey(fragment, idKey);
|
|
4791
|
-
};
|
|
4792
|
-
return editor;
|
|
4793
|
-
};
|
|
4339
|
+
return apply(operation);
|
|
4340
|
+
};
|
|
4341
|
+
editor.getFragment = function () {
|
|
4342
|
+
var fragment = _.cloneDeep(getFragment());
|
|
4343
|
+
return deleteElementKey(fragment, idKey);
|
|
4344
|
+
};
|
|
4345
|
+
return editor;
|
|
4346
|
+
};
|
|
4347
|
+
};
|
|
4348
|
+
|
|
4349
|
+
var autoFormatBlock = function (editor, type, at, _a, markups) {
|
|
4350
|
+
var preFormat = _a.preFormat, format = _a.format;
|
|
4351
|
+
slate.Transforms.delete(editor, { at: at });
|
|
4352
|
+
if (preFormat) {
|
|
4353
|
+
preFormat(editor);
|
|
4354
|
+
}
|
|
4355
|
+
if (!format) {
|
|
4356
|
+
slate.Transforms.setNodes(editor, { type: type }, { match: function (n) { return slate.Editor.isBlock(editor, n); } });
|
|
4357
|
+
}
|
|
4358
|
+
else {
|
|
4359
|
+
format(editor, markups);
|
|
4360
|
+
}
|
|
4361
|
+
};
|
|
4362
|
+
|
|
4363
|
+
var autoFormatInline = function (editor, _a) {
|
|
4364
|
+
var type = _a.type, between = _a.between, markup = _a.markup, ignoreTrim = _a.ignoreTrim, format = _a.format;
|
|
4365
|
+
var selection = editor.selection;
|
|
4366
|
+
var startMarkup = between ? between[0] : markup;
|
|
4367
|
+
var endMarkup = between ? between[1] : '';
|
|
4368
|
+
var endMarkupPointBefore = selection.anchor;
|
|
4369
|
+
if (endMarkup) {
|
|
4370
|
+
endMarkupPointBefore = getPointBefore(editor, selection, {
|
|
4371
|
+
matchString: endMarkup
|
|
4372
|
+
});
|
|
4373
|
+
if (!endMarkupPointBefore) {
|
|
4374
|
+
return false;
|
|
4375
|
+
}
|
|
4376
|
+
}
|
|
4377
|
+
var startMarkupPointAfter = getPointBefore(editor, endMarkupPointBefore, {
|
|
4378
|
+
matchString: startMarkup,
|
|
4379
|
+
skipInvalid: true,
|
|
4380
|
+
afterMatch: true
|
|
4381
|
+
});
|
|
4382
|
+
if (!startMarkupPointAfter) {
|
|
4383
|
+
return false;
|
|
4384
|
+
}
|
|
4385
|
+
// found
|
|
4386
|
+
var markupRange = {
|
|
4387
|
+
anchor: startMarkupPointAfter,
|
|
4388
|
+
focus: endMarkupPointBefore
|
|
4389
|
+
};
|
|
4390
|
+
if (!ignoreTrim) {
|
|
4391
|
+
var markupText = getText(editor, markupRange);
|
|
4392
|
+
if (markupText.trim() !== markupText) {
|
|
4393
|
+
return false;
|
|
4394
|
+
}
|
|
4395
|
+
}
|
|
4396
|
+
// delete end markup
|
|
4397
|
+
if (endMarkup) {
|
|
4398
|
+
endMarkupPointBefore = getPointBefore(editor, selection, {
|
|
4399
|
+
matchString: endMarkup
|
|
4400
|
+
});
|
|
4401
|
+
slate.Transforms.delete(editor, {
|
|
4402
|
+
at: {
|
|
4403
|
+
anchor: endMarkupPointBefore,
|
|
4404
|
+
focus: selection.anchor
|
|
4405
|
+
}
|
|
4406
|
+
});
|
|
4407
|
+
}
|
|
4408
|
+
var startMarkupPointBefore = getPointBefore(editor, selection, {
|
|
4409
|
+
matchString: startMarkup,
|
|
4410
|
+
skipInvalid: true
|
|
4411
|
+
});
|
|
4412
|
+
if (format) {
|
|
4413
|
+
var markupText = getText(editor, markupRange);
|
|
4414
|
+
format(editor, markupText);
|
|
4415
|
+
// delete start to end selection
|
|
4416
|
+
slate.Transforms.delete(editor, {
|
|
4417
|
+
at: {
|
|
4418
|
+
anchor: startMarkupPointBefore,
|
|
4419
|
+
focus: selection.anchor
|
|
4420
|
+
}
|
|
4421
|
+
});
|
|
4422
|
+
}
|
|
4423
|
+
else {
|
|
4424
|
+
// add mark to the text between the markups
|
|
4425
|
+
slate.Transforms.select(editor, markupRange);
|
|
4426
|
+
editor.addMark(type, true);
|
|
4427
|
+
slate.Transforms.collapse(editor, { edge: 'end' });
|
|
4428
|
+
editor.removeMark(type, false);
|
|
4429
|
+
// delete start markup
|
|
4430
|
+
slate.Transforms.delete(editor, {
|
|
4431
|
+
at: {
|
|
4432
|
+
anchor: startMarkupPointBefore,
|
|
4433
|
+
focus: startMarkupPointAfter
|
|
4434
|
+
}
|
|
4435
|
+
});
|
|
4436
|
+
}
|
|
4437
|
+
return true;
|
|
4438
|
+
};
|
|
4439
|
+
|
|
4440
|
+
var ListEditor = {
|
|
4441
|
+
isList: function (editor, element, type) {
|
|
4442
|
+
return slate.Editor.isBlock(editor, element) && element.type === type;
|
|
4443
|
+
},
|
|
4444
|
+
toggleList: function (editor, type, startIndex) {
|
|
4445
|
+
var _this = this;
|
|
4446
|
+
if (!editor.selection) {
|
|
4447
|
+
return;
|
|
4448
|
+
}
|
|
4449
|
+
if (!startIndex) {
|
|
4450
|
+
startIndex = 1;
|
|
4451
|
+
}
|
|
4452
|
+
var types = [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList];
|
|
4453
|
+
slate.Editor.withoutNormalizing(editor, function () {
|
|
4454
|
+
var _a = __read(slate.Editor.nodes(editor, {
|
|
4455
|
+
match: function (node) { return slate.Element.isElement(node) && node.type === exports.ElementKinds.listItem; },
|
|
4456
|
+
mode: 'lowest'
|
|
4457
|
+
})), listItems = _a.slice(0);
|
|
4458
|
+
var firstListItemPath = listItems.length && listItems[0][1];
|
|
4459
|
+
var activeListPath = listItems.length && slate.Path.parent(firstListItemPath);
|
|
4460
|
+
var activeListNode = listItems.length && slate.Node.get(editor, activeListPath);
|
|
4461
|
+
// 同级且类型相同:unwrap
|
|
4462
|
+
var isLowestActive = listItems.length &&
|
|
4463
|
+
listItems.every(function (_a) {
|
|
4464
|
+
var _b = __read(_a, 2), path = _b[1];
|
|
4465
|
+
return activeListNode.type === type && (slate.Path.isSibling(firstListItemPath, path) || slate.Path.equals(firstListItemPath, path));
|
|
4466
|
+
});
|
|
4467
|
+
if (isLowestActive) {
|
|
4468
|
+
var upListItem = slate.Path.parent(activeListPath);
|
|
4469
|
+
slate.Transforms.unwrapNodes(editor, {
|
|
4470
|
+
at: editor.selection,
|
|
4471
|
+
match: function (node) { return node === activeListNode; },
|
|
4472
|
+
split: true,
|
|
4473
|
+
mode: 'lowest'
|
|
4474
|
+
});
|
|
4475
|
+
if (upListItem && slate.Node.get(editor, upListItem).type === exports.ElementKinds.listItem) {
|
|
4476
|
+
slate.Transforms.moveNodes(editor, {
|
|
4477
|
+
at: editor.selection,
|
|
4478
|
+
to: slate.Path.next(upListItem),
|
|
4479
|
+
match: function (node) { return slate.Element.isElement(node) && node.type === exports.ElementKinds.listItem; }
|
|
4480
|
+
});
|
|
4481
|
+
}
|
|
4482
|
+
else {
|
|
4483
|
+
slate.Transforms.unwrapNodes(editor, {
|
|
4484
|
+
match: function (node) { return slate.Element.isElement(node) && node.type === exports.ElementKinds.listItem; }
|
|
4485
|
+
});
|
|
4486
|
+
}
|
|
4487
|
+
return;
|
|
4488
|
+
}
|
|
4489
|
+
// 跨级、同级且类型不同
|
|
4490
|
+
if (activeListNode && types.includes(activeListNode.type)) {
|
|
4491
|
+
slate.Transforms.setNodes(editor, { type: type }, { match: function (node) { return slate.Element.isElement(node) && node.type !== type && types.includes(node.type); } });
|
|
4492
|
+
return;
|
|
4493
|
+
}
|
|
4494
|
+
// wrap
|
|
4495
|
+
_this.buildListItem(editor);
|
|
4496
|
+
// Todo: types
|
|
4497
|
+
slate.Transforms.wrapNodes(editor, { type: type, children: [], start: startIndex }, {
|
|
4498
|
+
at: editor.selection,
|
|
4499
|
+
match: function (node) { return slate.Element.isElement(node) && node.type === exports.ElementKinds.listItem; }
|
|
4500
|
+
});
|
|
4501
|
+
});
|
|
4502
|
+
},
|
|
4503
|
+
unwrapList: function (editor) {
|
|
4504
|
+
slate.Editor.withoutNormalizing(editor, function () {
|
|
4505
|
+
unwrapNodesByType(editor, [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList], { split: true, mode: 'all' });
|
|
4506
|
+
unwrapNodesByType(editor, [exports.ElementKinds.listItem], { split: true, mode: 'all' });
|
|
4507
|
+
});
|
|
4508
|
+
},
|
|
4509
|
+
wrapList: function (editor, type) {
|
|
4510
|
+
slate.Editor.withoutNormalizing(editor, function () {
|
|
4511
|
+
var listItem = {
|
|
4512
|
+
type: exports.ElementKinds.listItem,
|
|
4513
|
+
children: []
|
|
4514
|
+
};
|
|
4515
|
+
var list = {
|
|
4516
|
+
type: type,
|
|
4517
|
+
children: []
|
|
4518
|
+
};
|
|
4519
|
+
slate.Transforms.wrapNodes(editor, list, { split: true });
|
|
4520
|
+
slate.Transforms.wrapNodes(editor, listItem, { split: true });
|
|
4521
|
+
});
|
|
4522
|
+
},
|
|
4523
|
+
isActive: function (editor, type) {
|
|
4524
|
+
var _a = __read(getNodesByType(editor, type), 1), match = _a[0];
|
|
4525
|
+
return !!match;
|
|
4526
|
+
},
|
|
4527
|
+
getActiveList: function (editor) {
|
|
4528
|
+
var _a = __read(getNodesByType(editor, LIST_BLOCK_TYPES), 1), match = _a[0];
|
|
4529
|
+
return match;
|
|
4530
|
+
},
|
|
4531
|
+
buildListItem: function (editor) {
|
|
4532
|
+
var e_1, _a;
|
|
4533
|
+
var nodes = slate.Editor.nodes(editor, {
|
|
4534
|
+
match: function (node) { return slate.Editor.isBlock(editor, node); },
|
|
4535
|
+
mode: 'lowest'
|
|
4536
|
+
});
|
|
4537
|
+
try {
|
|
4538
|
+
for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
|
|
4539
|
+
var _b = __read(nodes_1_1.value, 2), node = _b[0], path = _b[1];
|
|
4540
|
+
if (!slate.Editor.isVoid(editor, node) && slate.Element.isElement(node) && node.type !== exports.ElementKinds.paragraph) {
|
|
4541
|
+
slate.Transforms.setNodes(editor, { type: exports.ElementKinds.paragraph, checked: undefined }, // todo remove checked
|
|
4542
|
+
{ at: path });
|
|
4543
|
+
}
|
|
4544
|
+
else if (slate.Element.isElement(node) && node.type === exports.ElementKinds.paragraph) {
|
|
4545
|
+
var textIndent = node.textIndent;
|
|
4546
|
+
if (textIndent) {
|
|
4547
|
+
slate.Transforms.setNodes(editor, { textIndent: undefined, indent: undefined }, // remove indent
|
|
4548
|
+
{ at: path });
|
|
4549
|
+
}
|
|
4550
|
+
}
|
|
4551
|
+
if (slate.Node.parent(editor, path).type !== exports.ElementKinds.listItem) {
|
|
4552
|
+
slate.Transforms.wrapNodes(editor, { type: exports.ElementKinds.listItem, children: [] }, {
|
|
4553
|
+
at: path,
|
|
4554
|
+
split: true
|
|
4555
|
+
});
|
|
4556
|
+
}
|
|
4557
|
+
}
|
|
4558
|
+
}
|
|
4559
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
4560
|
+
finally {
|
|
4561
|
+
try {
|
|
4562
|
+
if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) _a.call(nodes_1);
|
|
4563
|
+
}
|
|
4564
|
+
finally { if (e_1) throw e_1.error; }
|
|
4565
|
+
}
|
|
4566
|
+
},
|
|
4567
|
+
buildInsertDataChildren: function (node) {
|
|
4568
|
+
var children = node.children;
|
|
4569
|
+
var listItem = children[0];
|
|
4570
|
+
if (isNodeTypeList(node) && slate.Element.isElement(listItem) && listItem.children[0].type === exports.ElementKinds.paragraph) {
|
|
4571
|
+
return node;
|
|
4572
|
+
}
|
|
4573
|
+
return this.buildInsertDataChildren(listItem);
|
|
4574
|
+
}
|
|
4794
4575
|
};
|
|
4795
4576
|
|
|
4796
|
-
var
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4577
|
+
var TodoItemEditor = {
|
|
4578
|
+
isActive: function (editor) {
|
|
4579
|
+
var _a = __read(getNodesByType(editor, exports.ElementKinds.checkItem), 1), match = _a[0];
|
|
4580
|
+
return !!match;
|
|
4581
|
+
},
|
|
4582
|
+
insertTodoItem: function (editor) {
|
|
4583
|
+
if (!editor.selection) {
|
|
4584
|
+
return;
|
|
4585
|
+
}
|
|
4586
|
+
var isActive = this.isActive(editor);
|
|
4587
|
+
var isNumberedList = ListEditor.isActive(editor, exports.ElementKinds.numberedList);
|
|
4588
|
+
var isBulletedList = ListEditor.isActive(editor, exports.ElementKinds.bulletedList);
|
|
4589
|
+
if (isActive) {
|
|
4590
|
+
slate.Transforms.setNodes(editor, {
|
|
4591
|
+
type: exports.ElementKinds.paragraph
|
|
4592
|
+
});
|
|
4593
|
+
}
|
|
4594
|
+
else {
|
|
4595
|
+
if (isNumberedList || isBulletedList) {
|
|
4596
|
+
ListEditor.unwrapList(editor);
|
|
4597
|
+
}
|
|
4598
|
+
slate.Transforms.setNodes(editor, {
|
|
4599
|
+
type: exports.ElementKinds.checkItem
|
|
4600
|
+
});
|
|
4601
|
+
}
|
|
4804
4602
|
}
|
|
4805
|
-
|
|
4806
|
-
|
|
4603
|
+
};
|
|
4604
|
+
|
|
4605
|
+
var BlockquoteEditor = {
|
|
4606
|
+
toggleBlockquote: function (editor) {
|
|
4607
|
+
if (!isParagraph(editor)) {
|
|
4608
|
+
slate.Transforms.insertNodes(editor, {
|
|
4609
|
+
type: exports.ElementKinds.paragraph,
|
|
4610
|
+
mode: 'text',
|
|
4611
|
+
children: [
|
|
4612
|
+
{
|
|
4613
|
+
text: ''
|
|
4614
|
+
}
|
|
4615
|
+
]
|
|
4616
|
+
});
|
|
4617
|
+
}
|
|
4618
|
+
var isActive = isBlockActive(editor, exports.ElementKinds.blockquote);
|
|
4619
|
+
if (!isActive) {
|
|
4620
|
+
slate.Transforms.wrapNodes(editor, { type: exports.ElementKinds.blockquote, children: [] }, {
|
|
4621
|
+
mode: 'lowest'
|
|
4622
|
+
});
|
|
4623
|
+
}
|
|
4624
|
+
else {
|
|
4625
|
+
slate.Transforms.unwrapNodes(editor, { match: function (n) { return slate.Element.isElement(n) && n.type === exports.ElementKinds.blockquote; } });
|
|
4626
|
+
}
|
|
4807
4627
|
}
|
|
4808
4628
|
};
|
|
4809
4629
|
|
|
4810
|
-
var
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
}
|
|
4820
|
-
|
|
4821
|
-
|
|
4630
|
+
var InlineCodeEditor = {
|
|
4631
|
+
toggleInlineCode: function (editor, text) {
|
|
4632
|
+
var isActive = InlineCodeEditor.isInlineCodeActive(editor);
|
|
4633
|
+
if (isActive) {
|
|
4634
|
+
InlineCodeEditor.unwrapInlineCode(editor);
|
|
4635
|
+
return;
|
|
4636
|
+
}
|
|
4637
|
+
if (slate.Range.isCollapsed(editor.selection)) {
|
|
4638
|
+
InlineCodeEditor.wrapInlineCode(editor, text);
|
|
4639
|
+
}
|
|
4640
|
+
else {
|
|
4641
|
+
var fragment = slate.Node.fragment(editor, editor.selection)[0];
|
|
4642
|
+
var selectNode = slate.Node.get(fragment, []);
|
|
4643
|
+
var selectText = slate.Node.string(selectNode);
|
|
4644
|
+
InlineCodeEditor.wrapInlineCode(editor, selectText);
|
|
4645
|
+
}
|
|
4646
|
+
},
|
|
4647
|
+
wrapInlineCode: function (editor, text) {
|
|
4648
|
+
if (text === void 0) { text = ''; }
|
|
4649
|
+
if (InlineCodeEditor.isInlineCodeActive(editor)) {
|
|
4650
|
+
InlineCodeEditor.unwrapInlineCode(editor);
|
|
4651
|
+
}
|
|
4652
|
+
var selection = editor.selection;
|
|
4653
|
+
var isCollapsed = selection && slate.Range.isCollapsed(selection);
|
|
4654
|
+
var inlineCode = {
|
|
4655
|
+
type: exports.ElementKinds.inlineCode,
|
|
4656
|
+
children: isCollapsed ? [{ text: text ? text : ZERO_WIDTH_CHAR }] : []
|
|
4657
|
+
};
|
|
4658
|
+
if (isCollapsed) {
|
|
4659
|
+
slate.Transforms.insertNodes(editor, inlineCode);
|
|
4660
|
+
}
|
|
4661
|
+
else {
|
|
4662
|
+
slate.Transforms.wrapNodes(editor, inlineCode, { split: true });
|
|
4822
4663
|
}
|
|
4664
|
+
},
|
|
4665
|
+
unwrapInlineCode: function (editor) {
|
|
4666
|
+
slate.Transforms.unwrapNodes(editor, { match: function (n) { return slate.Element.isElement(n) && n.type === exports.ElementKinds.inlineCode; } });
|
|
4667
|
+
},
|
|
4668
|
+
isInlineCodeActive: function (editor, path) {
|
|
4669
|
+
var _a;
|
|
4670
|
+
var _b = __read(slate.Editor.nodes(editor, {
|
|
4671
|
+
at: path ? path : (_a = editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path,
|
|
4672
|
+
match: function (n) { return slate.Element.isElement(n) && n.type === exports.ElementKinds.inlineCode; }
|
|
4673
|
+
}), 1), inlineCode = _b[0];
|
|
4674
|
+
return !!inlineCode;
|
|
4823
4675
|
}
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4676
|
+
};
|
|
4677
|
+
|
|
4678
|
+
var HeadingEditor = {
|
|
4679
|
+
setHeading: function (editor, heading) {
|
|
4680
|
+
slate.Editor.withoutNormalizing(editor, function () {
|
|
4681
|
+
var _a;
|
|
4682
|
+
var types = [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList, exports.ElementKinds.listItem];
|
|
4683
|
+
slate.Transforms.unwrapNodes(editor, {
|
|
4684
|
+
at: editor.selection,
|
|
4685
|
+
match: function (n) { return slate.Element.isElement(n) && types.includes(n.type); },
|
|
4686
|
+
mode: 'all',
|
|
4687
|
+
split: true
|
|
4688
|
+
});
|
|
4689
|
+
slate.Transforms.setNodes(editor, { type: heading });
|
|
4690
|
+
var entry = anchorBlockEntry(editor);
|
|
4691
|
+
var unMarks = (_a = {},
|
|
4692
|
+
_a[exports.MarkTypes.fontSize] = null,
|
|
4693
|
+
_a);
|
|
4694
|
+
if (entry) {
|
|
4695
|
+
setMarks(editor, unMarks, entry[1]);
|
|
4696
|
+
return;
|
|
4697
|
+
}
|
|
4698
|
+
setMarks(editor, unMarks, editor.selection);
|
|
4699
|
+
});
|
|
4700
|
+
},
|
|
4701
|
+
isHeadingActive: function (editor, heading) {
|
|
4702
|
+
var _a = __read(slate.Editor.nodes(editor, {
|
|
4703
|
+
match: function (n) { return slate.Element.isElement(n) && n.type === heading; },
|
|
4704
|
+
universal: true
|
|
4705
|
+
}), 1), match = _a[0];
|
|
4706
|
+
return !!match;
|
|
4831
4707
|
}
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4708
|
+
};
|
|
4709
|
+
|
|
4710
|
+
var defaultAutoFormatRules = [
|
|
4711
|
+
{
|
|
4712
|
+
type: exports.ElementKinds.heading_1,
|
|
4713
|
+
markup: '#',
|
|
4714
|
+
format: function (editor) {
|
|
4715
|
+
HeadingEditor.setHeading(editor, exports.ElementKinds.heading_1);
|
|
4716
|
+
}
|
|
4717
|
+
},
|
|
4718
|
+
{
|
|
4719
|
+
type: exports.ElementKinds.heading_2,
|
|
4720
|
+
markup: '##',
|
|
4721
|
+
format: function (editor) {
|
|
4722
|
+
HeadingEditor.setHeading(editor, exports.ElementKinds.heading_2);
|
|
4723
|
+
}
|
|
4724
|
+
},
|
|
4725
|
+
{
|
|
4726
|
+
type: exports.ElementKinds.heading_3,
|
|
4727
|
+
markup: '###',
|
|
4728
|
+
format: function (editor) {
|
|
4729
|
+
HeadingEditor.setHeading(editor, exports.ElementKinds.heading_3);
|
|
4730
|
+
}
|
|
4731
|
+
},
|
|
4732
|
+
{
|
|
4733
|
+
type: exports.ElementKinds.heading_4,
|
|
4734
|
+
markup: '####',
|
|
4735
|
+
format: function (editor) {
|
|
4736
|
+
HeadingEditor.setHeading(editor, exports.ElementKinds.heading_4);
|
|
4737
|
+
}
|
|
4738
|
+
},
|
|
4739
|
+
{
|
|
4740
|
+
type: exports.ElementKinds.heading_5,
|
|
4741
|
+
markup: '#####',
|
|
4742
|
+
format: function (editor) {
|
|
4743
|
+
HeadingEditor.setHeading(editor, exports.ElementKinds.heading_5);
|
|
4744
|
+
}
|
|
4745
|
+
},
|
|
4746
|
+
{
|
|
4747
|
+
type: exports.ElementKinds.heading_6,
|
|
4748
|
+
markup: '######',
|
|
4749
|
+
format: function (editor) {
|
|
4750
|
+
HeadingEditor.setHeading(editor, exports.ElementKinds.heading_6);
|
|
4751
|
+
}
|
|
4752
|
+
},
|
|
4753
|
+
{
|
|
4754
|
+
type: exports.ElementKinds.blockquote,
|
|
4755
|
+
markup: ['>'],
|
|
4756
|
+
format: function (editor) {
|
|
4757
|
+
BlockquoteEditor.toggleBlockquote(editor);
|
|
4758
|
+
}
|
|
4759
|
+
},
|
|
4760
|
+
{
|
|
4761
|
+
type: exports.MarkTypes.bold,
|
|
4762
|
+
between: ['**', '**'],
|
|
4763
|
+
mode: 'inline',
|
|
4764
|
+
insertTrigger: true
|
|
4765
|
+
},
|
|
4766
|
+
{
|
|
4767
|
+
type: exports.MarkTypes.bold,
|
|
4768
|
+
between: ['__', '__'],
|
|
4769
|
+
mode: 'inline',
|
|
4770
|
+
insertTrigger: true
|
|
4771
|
+
},
|
|
4772
|
+
{
|
|
4773
|
+
type: exports.MarkTypes.italic,
|
|
4774
|
+
between: ['*', '*'],
|
|
4775
|
+
mode: 'inline',
|
|
4776
|
+
insertTrigger: true
|
|
4777
|
+
},
|
|
4778
|
+
{
|
|
4779
|
+
type: exports.MarkTypes.italic,
|
|
4780
|
+
between: ['_', '_'],
|
|
4781
|
+
mode: 'inline',
|
|
4782
|
+
insertTrigger: true
|
|
4783
|
+
},
|
|
4784
|
+
{
|
|
4785
|
+
type: exports.ElementKinds.inlineCode,
|
|
4786
|
+
between: ['`', '`'],
|
|
4787
|
+
mode: 'inline',
|
|
4788
|
+
format: function (editor, text) {
|
|
4789
|
+
InlineCodeEditor.toggleInlineCode(editor, text);
|
|
4790
|
+
slate.Transforms.select(editor, slate.Editor.after(editor, editor.selection));
|
|
4841
4791
|
}
|
|
4842
|
-
}
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
at: {
|
|
4879
|
-
anchor: startMarkupPointBefore,
|
|
4880
|
-
focus: startMarkupPointAfter
|
|
4792
|
+
},
|
|
4793
|
+
{
|
|
4794
|
+
type: exports.MarkTypes.strike,
|
|
4795
|
+
between: ['~~', '~~'],
|
|
4796
|
+
mode: 'inline',
|
|
4797
|
+
insertTrigger: true
|
|
4798
|
+
},
|
|
4799
|
+
{
|
|
4800
|
+
type: exports.ElementKinds.code,
|
|
4801
|
+
markup: '```',
|
|
4802
|
+
insertTrigger: true
|
|
4803
|
+
},
|
|
4804
|
+
{
|
|
4805
|
+
type: exports.ElementKinds.listItem,
|
|
4806
|
+
markup: [],
|
|
4807
|
+
match: function (editor) {
|
|
4808
|
+
return isParagraph(editor) ? ['*', '-', '+'] : [];
|
|
4809
|
+
},
|
|
4810
|
+
format: function (editor) {
|
|
4811
|
+
ListEditor.toggleList(editor, exports.ElementKinds.bulletedList);
|
|
4812
|
+
}
|
|
4813
|
+
},
|
|
4814
|
+
{
|
|
4815
|
+
type: exports.ElementKinds.listItem,
|
|
4816
|
+
key: exports.ElementKinds.numberedList,
|
|
4817
|
+
markup: [],
|
|
4818
|
+
match: function (editor, textFromBlockStart) {
|
|
4819
|
+
return isParagraph(editor) && /^-?\d+(\.|\))$/.test(textFromBlockStart) ? [textFromBlockStart] : [];
|
|
4820
|
+
},
|
|
4821
|
+
format: function (editor, markup) {
|
|
4822
|
+
var startIndex = 1;
|
|
4823
|
+
if (markup) {
|
|
4824
|
+
startIndex = markup[0].split('.')[0];
|
|
4825
|
+
if (startIndex === 0) {
|
|
4826
|
+
startIndex = 1;
|
|
4827
|
+
}
|
|
4881
4828
|
}
|
|
4882
|
-
|
|
4829
|
+
ListEditor.toggleList(editor, exports.ElementKinds.numberedList, startIndex);
|
|
4830
|
+
}
|
|
4831
|
+
},
|
|
4832
|
+
{
|
|
4833
|
+
type: exports.ElementKinds.checkItem,
|
|
4834
|
+
markup: [],
|
|
4835
|
+
match: function (editor) {
|
|
4836
|
+
return isParagraph(editor) ? ['[]'] : [];
|
|
4837
|
+
},
|
|
4838
|
+
format: function (editor) {
|
|
4839
|
+
TodoItemEditor.insertTodoItem(editor);
|
|
4840
|
+
}
|
|
4841
|
+
},
|
|
4842
|
+
{
|
|
4843
|
+
type: exports.ElementKinds.hr,
|
|
4844
|
+
markup: '---',
|
|
4845
|
+
insertTrigger: true
|
|
4883
4846
|
}
|
|
4884
|
-
|
|
4885
|
-
};
|
|
4847
|
+
];
|
|
4886
4848
|
|
|
4887
|
-
var withAutoFormat = function (
|
|
4888
|
-
var
|
|
4889
|
-
|
|
4890
|
-
var
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
}
|
|
4926
|
-
else {
|
|
4927
|
-
markupRange = getRangeBefore(editor, editor.selection, {
|
|
4928
|
-
matchString: markup,
|
|
4929
|
-
skipInvalid: true
|
|
4930
|
-
});
|
|
4931
|
-
if (!markupRange)
|
|
4932
|
-
return "continue";
|
|
4933
|
-
var blockAbovePath = (_a = getBlockAbove(editor)) === null || _a === void 0 ? void 0 : _a[1];
|
|
4934
|
-
if (!blockAbovePath)
|
|
4935
|
-
return "continue";
|
|
4936
|
-
// If the markup is not at the start, insert break before autoformatting.
|
|
4937
|
-
if (!slate.Editor.isStart(editor, markupRange.anchor, blockAbovePath)) {
|
|
4938
|
-
editor.insertBreak();
|
|
4939
|
-
}
|
|
4940
|
-
}
|
|
4941
|
-
if (!allowSameTypeAbove) {
|
|
4942
|
-
// Don't autoformat if already in a block of the same type.
|
|
4943
|
-
var isBelowSameBlockType = someNode(editor, { match: { type: type } });
|
|
4944
|
-
if (isBelowSameBlockType)
|
|
4945
|
-
return "continue";
|
|
4849
|
+
var withAutoFormat = function () { return function (editor) {
|
|
4850
|
+
var insertText = editor.insertText;
|
|
4851
|
+
editor.insertText = function (text) {
|
|
4852
|
+
var e_1, _d;
|
|
4853
|
+
var _a, _b;
|
|
4854
|
+
var autoFormatRules = defaultAutoFormatRules;
|
|
4855
|
+
if ((_a = editor.extraAutoFormatRules) === null || _a === void 0 ? void 0 : _a.length) {
|
|
4856
|
+
var extraRules = mergAutoFormateRules(editor.extraAutoFormatRules);
|
|
4857
|
+
autoFormatRules = Object.values(extraRules);
|
|
4858
|
+
}
|
|
4859
|
+
if (!isCollapsed(editor.selection)) {
|
|
4860
|
+
return insertText(text);
|
|
4861
|
+
}
|
|
4862
|
+
var _loop_1 = function (_c) {
|
|
4863
|
+
var query = _c.query, rule = __rest(_c, ["query"]);
|
|
4864
|
+
var _e = rule.trigger, trigger = _e === void 0 ? ' ' : _e, _f = rule.mode, mode = _f === void 0 ? 'block' : _f, type = rule.type, markup = rule.markup, preFormat = rule.preFormat, format = rule.format, match = rule.match, between = rule.between, ignoreTrim = rule.ignoreTrim, insertTrigger = rule.insertTrigger, _g = rule.allowSameTypeAbove, allowSameTypeAbove = _g === void 0 ? false : _g, _h = rule.triggerAtBlockStart, triggerAtBlockStart = _h === void 0 ? true : _h;
|
|
4865
|
+
if (query && !query(editor, rule))
|
|
4866
|
+
return "continue";
|
|
4867
|
+
var triggers = castArray(trigger);
|
|
4868
|
+
// Check trigger
|
|
4869
|
+
if (!triggers.includes(text))
|
|
4870
|
+
return "continue";
|
|
4871
|
+
var valid = function () { return insertTrigger && insertText(text); };
|
|
4872
|
+
if (mode === 'block') {
|
|
4873
|
+
var markups = castArray(markup);
|
|
4874
|
+
var markupRange = void 0;
|
|
4875
|
+
if (triggerAtBlockStart) {
|
|
4876
|
+
markupRange = getRangeFromBlockStart(editor);
|
|
4877
|
+
// Don't autoformat if there is void nodes.
|
|
4878
|
+
var hasVoidNode = someNode(editor, {
|
|
4879
|
+
at: markupRange,
|
|
4880
|
+
match: function (n) { return slate.Editor.isVoid(editor, n); }
|
|
4881
|
+
});
|
|
4882
|
+
if (hasVoidNode)
|
|
4883
|
+
return "continue";
|
|
4884
|
+
var textFromBlockStart = getText(editor, markupRange);
|
|
4885
|
+
if (match) {
|
|
4886
|
+
markups = match(editor, textFromBlockStart);
|
|
4946
4887
|
}
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
preFormat: preFormat,
|
|
4950
|
-
format: format
|
|
4951
|
-
}, markups);
|
|
4952
|
-
return { value: valid() };
|
|
4888
|
+
if (!markups.includes(textFromBlockStart))
|
|
4889
|
+
return "continue";
|
|
4953
4890
|
}
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4891
|
+
else {
|
|
4892
|
+
markupRange = getRangeBefore(editor, editor.selection, {
|
|
4893
|
+
matchString: markup,
|
|
4894
|
+
skipInvalid: true
|
|
4895
|
+
});
|
|
4896
|
+
if (!markupRange)
|
|
4897
|
+
return "continue";
|
|
4898
|
+
var blockAbovePath = (_b = getBlockAbove(editor)) === null || _b === void 0 ? void 0 : _b[1];
|
|
4899
|
+
if (!blockAbovePath)
|
|
4900
|
+
return "continue";
|
|
4901
|
+
// If the markup is not at the start, insert break before autoformatting.
|
|
4902
|
+
if (!slate.Editor.isStart(editor, markupRange.anchor, blockAbovePath)) {
|
|
4903
|
+
editor.insertBreak();
|
|
4963
4904
|
}
|
|
4964
4905
|
}
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4906
|
+
if (!allowSameTypeAbove) {
|
|
4907
|
+
// Don't autoformat if already in a block of the same type.
|
|
4908
|
+
var isBelowSameBlockType = someNode(editor, { match: { type: type } });
|
|
4909
|
+
if (isBelowSameBlockType)
|
|
4910
|
+
return "continue";
|
|
4911
|
+
}
|
|
4912
|
+
// Start of the block
|
|
4913
|
+
autoFormatBlock(editor, type, markupRange, {
|
|
4914
|
+
preFormat: preFormat,
|
|
4915
|
+
format: format
|
|
4916
|
+
}, markups);
|
|
4917
|
+
return { value: valid() };
|
|
4918
|
+
}
|
|
4919
|
+
if (mode === 'inline') {
|
|
4920
|
+
if (autoFormatInline(editor, {
|
|
4921
|
+
type: type,
|
|
4922
|
+
between: between,
|
|
4923
|
+
ignoreTrim: ignoreTrim,
|
|
4924
|
+
format: format,
|
|
4925
|
+
markup: Array.isArray(markup) ? markup[0] : markup
|
|
4926
|
+
})) {
|
|
4927
|
+
return { value: valid() };
|
|
4978
4928
|
}
|
|
4979
|
-
finally { if (e_1) throw e_1.error; }
|
|
4980
4929
|
}
|
|
4981
|
-
insertText(text);
|
|
4982
4930
|
};
|
|
4983
|
-
|
|
4931
|
+
try {
|
|
4932
|
+
for (var autoFormatRules_1 = __values(autoFormatRules), autoFormatRules_1_1 = autoFormatRules_1.next(); !autoFormatRules_1_1.done; autoFormatRules_1_1 = autoFormatRules_1.next()) {
|
|
4933
|
+
var _c = autoFormatRules_1_1.value;
|
|
4934
|
+
var state_1 = _loop_1(_c);
|
|
4935
|
+
if (typeof state_1 === "object")
|
|
4936
|
+
return state_1.value;
|
|
4937
|
+
}
|
|
4938
|
+
}
|
|
4939
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
4940
|
+
finally {
|
|
4941
|
+
try {
|
|
4942
|
+
if (autoFormatRules_1_1 && !autoFormatRules_1_1.done && (_d = autoFormatRules_1.return)) _d.call(autoFormatRules_1);
|
|
4943
|
+
}
|
|
4944
|
+
finally { if (e_1) throw e_1.error; }
|
|
4945
|
+
}
|
|
4946
|
+
insertText(text);
|
|
4984
4947
|
};
|
|
4948
|
+
return editor;
|
|
4949
|
+
}; };
|
|
4950
|
+
var mergAutoFormateRules = function (extraAutoFormatRules) {
|
|
4951
|
+
var combinationData = __spreadArray(__spreadArray([], __read(defaultAutoFormatRules)), __read(extraAutoFormatRules));
|
|
4952
|
+
var dataInfo = {};
|
|
4953
|
+
combinationData.forEach(function (item) {
|
|
4954
|
+
if (!dataInfo[item.type + item.key]) {
|
|
4955
|
+
dataInfo[item.type + item.key] = Object.assign({}, item);
|
|
4956
|
+
}
|
|
4957
|
+
dataInfo[item.type + item.key] = Object.assign(Object.assign({}, dataInfo[item.type + item.key]), item);
|
|
4958
|
+
});
|
|
4959
|
+
return dataInfo;
|
|
4985
4960
|
};
|
|
4986
4961
|
|
|
4987
4962
|
var withTransforms = function () { return function (editor) {
|
|
@@ -6803,7 +6778,7 @@
|
|
|
6803
6778
|
return TheColorSelectComponent;
|
|
6804
6779
|
}());
|
|
6805
6780
|
TheColorSelectComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheColorSelectComponent, deps: [{ token: i1__namespace$3.ThyPopoverRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6806
|
-
TheColorSelectComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheColorSelectComponent, selector: "the-color-select", inputs: { selectedColor: "selectedColor", selectAction: "selectAction", showCustom: "showCustom", colors: "colors", option: "option" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)", "mousedown": "handleMouseDown($event)", "keydown": "handleKeydown($event)" } }, ngImport: i0__namespace, template: "<div class=\"color-container\">\n <div class=\"colors\">\n <div *ngFor=\"let row of selectColors; let rowIndex = index\">\n <span\n class=\"color-item\"\n *ngFor=\"let _color of row.rowValue; let i = index\"\n [ngClass]=\"_color.classMaps\"\n (mousedown)=\"_selectColor($event, _color.value)\"\n >\n <span [ngStyle]=\"{ background: _color.value }\">\n <thy-icon thyIconName=\"check\" [ngStyle]=\"{ color: row.tickColor }\"></thy-icon>\n </span>\n </span>\n </div>\n </div>\n <div *ngIf=\"option.showCustom\" class=\"select-color\">\n <span class=\"color\" [ngStyle]=\"{ background: selectedColor }\"></span>\n #\n <input\n thyInput\n maxlength=\"6\"\n (keydown.enter)=\"customInputColorEnter($event)\"\n onkeyup=\"value=value.replace(/[^0-9A-Fa-f]/g,'')\"\n class=\"value\"\n [(ngModel)]=\"customColor\"\n (ngModelChange)=\"colorChange(false)\"\n />\n </div>\n</div>\n", components: [{ type:
|
|
6781
|
+
TheColorSelectComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheColorSelectComponent, selector: "the-color-select", inputs: { selectedColor: "selectedColor", selectAction: "selectAction", showCustom: "showCustom", colors: "colors", option: "option" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)", "mousedown": "handleMouseDown($event)", "keydown": "handleKeydown($event)" } }, ngImport: i0__namespace, template: "<div class=\"color-container\">\n <div class=\"colors\">\n <div *ngFor=\"let row of selectColors; let rowIndex = index\">\n <span\n class=\"color-item\"\n *ngFor=\"let _color of row.rowValue; let i = index\"\n [ngClass]=\"_color.classMaps\"\n (mousedown)=\"_selectColor($event, _color.value)\"\n >\n <span [ngStyle]=\"{ background: _color.value }\">\n <thy-icon thyIconName=\"check\" [ngStyle]=\"{ color: row.tickColor }\"></thy-icon>\n </span>\n </span>\n </div>\n </div>\n <div *ngIf=\"option.showCustom\" class=\"select-color\">\n <span class=\"color\" [ngStyle]=\"{ background: selectedColor }\"></span>\n #\n <input\n thyInput\n maxlength=\"6\"\n (keydown.enter)=\"customInputColorEnter($event)\"\n onkeyup=\"value=value.replace(/[^0-9A-Fa-f]/g,'')\"\n class=\"value\"\n [(ngModel)]=\"customColor\"\n (ngModelChange)=\"colorChange(false)\"\n />\n </div>\n</div>\n", components: [{ type: i3__namespace.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5__namespace$1.ThyInputDirective, selector: "[thyInput]", inputs: ["thySize", "thyAutocomplete"] }, { type: i4__namespace.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i4__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
6807
6782
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheColorSelectComponent, decorators: [{
|
|
6808
6783
|
type: i0.Component,
|
|
6809
6784
|
args: [{
|
|
@@ -7011,7 +6986,7 @@
|
|
|
7011
6986
|
return TheColorToolbarItemComponent;
|
|
7012
6987
|
}(TheToolbarBaseItemComponent));
|
|
7013
6988
|
TheColorToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheColorToolbarItemComponent, deps: [{ token: i1__namespace$3.ThyPopover }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7014
|
-
TheColorToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheColorToolbarItemComponent, selector: "the-color-toolbar-item", inputs: { item: "item", editor: "editor" }, host: { classAttribute: "the-toolbar-item" }, usesInheritance: true, ngImport: i0__namespace, template: "\n <a\n class=\"link-width-down\"\n thyIconNavLink\n [ngStyle]=\"{\n width: item.key === 'color' ? '42px' : 'auto'\n }\"\n [thyTooltip]=\"item.name\"\n [thyIconNavLinkActive]=\"active\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n >\n <thy-icon [thyIconName]=\"item.icon\" thyIconType=\"twotone\" [thyTwotoneColor]=\"active\"></thy-icon>\n <thy-icon\n [ngClass]=\"{\n 'link-down-icon': true,\n 'font-size-sm': true,\n 'text-desc': true\n }\"\n thyIconName=\"caret-down\"\n ></thy-icon>\n </a>\n ", isInline: true, components: [{ type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type:
|
|
6989
|
+
TheColorToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheColorToolbarItemComponent, selector: "the-color-toolbar-item", inputs: { item: "item", editor: "editor" }, host: { classAttribute: "the-toolbar-item" }, usesInheritance: true, ngImport: i0__namespace, template: "\n <a\n class=\"link-width-down\"\n thyIconNavLink\n [ngStyle]=\"{\n width: item.key === 'color' ? '42px' : 'auto'\n }\"\n [thyTooltip]=\"item.name\"\n [thyIconNavLinkActive]=\"active\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n >\n <thy-icon [thyIconName]=\"item.icon\" thyIconType=\"twotone\" [thyTwotoneColor]=\"active\"></thy-icon>\n <thy-icon\n [ngClass]=\"{\n 'link-down-icon': true,\n 'font-size-sm': true,\n 'text-desc': true\n }\"\n thyIconName=\"caret-down\"\n ></thy-icon>\n </a>\n ", isInline: true, components: [{ type: i3__namespace$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3__namespace.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i5__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i10__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
7015
6990
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheColorToolbarItemComponent, decorators: [{
|
|
7016
6991
|
type: i0.Component,
|
|
7017
6992
|
args: [{
|
|
@@ -7282,7 +7257,7 @@
|
|
|
7282
7257
|
return TheToolbarDropdownComponent;
|
|
7283
7258
|
}(TheToolbarBaseItemComponent));
|
|
7284
7259
|
TheToolbarDropdownComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheToolbarDropdownComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$3.ThyPopover }, { token: i0__namespace.ViewContainerRef }, { token: i2__namespace.Overlay }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7285
|
-
TheToolbarDropdownComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item", itemMousedownHandle: "itemMousedownHandle" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.disabled": "this.disabledState" }, classAttribute: "the-toolbar-dropdown-container" }, viewQueries: [{ propertyName: "iconModeTemplate", first: true, predicate: ["iconModeTemplate"], descendants: true, static: true }, { propertyName: "textModeTemplate", first: true, predicate: ["textModeTemplate"], descendants: true, static: true }, { propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n\n<ng-template #iconModeTemplate>\n <a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #textModeTemplate>\n <a thyIconNavLink class=\"text-mode\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <span class=\"show-text\">{{ activeMenu?.name }}</span>\n <thy-icon class=\"text-caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenu.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n [ngStyle]=\"menu?.styles\"\n >\n <span *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu.icon\"></thy-icon>\n </span>\n <span *ngIf=\"menu.name\" thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n <thy-action-menu-divider *ngIf=\"menu.key === 'split'\"></thy-action-menu-divider>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type:
|
|
7260
|
+
TheToolbarDropdownComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item", itemMousedownHandle: "itemMousedownHandle" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.disabled": "this.disabledState" }, classAttribute: "the-toolbar-dropdown-container" }, viewQueries: [{ propertyName: "iconModeTemplate", first: true, predicate: ["iconModeTemplate"], descendants: true, static: true }, { propertyName: "textModeTemplate", first: true, predicate: ["textModeTemplate"], descendants: true, static: true }, { propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n\n<ng-template #iconModeTemplate>\n <a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #textModeTemplate>\n <a thyIconNavLink class=\"text-mode\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <span class=\"show-text\">{{ activeMenu?.name }}</span>\n <thy-icon class=\"text-caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenu.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n [ngStyle]=\"menu?.styles\"\n >\n <span *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu.icon\"></thy-icon>\n </span>\n <span *ngIf=\"menu.name\" thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n <thy-action-menu-divider *ngIf=\"menu.key === 'split'\"></thy-action-menu-divider>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3__namespace$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3__namespace.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i2__namespace$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i2__namespace$1.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i10__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i2__namespace$1.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2__namespace$1.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i2__namespace$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
7286
7261
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheToolbarDropdownComponent, decorators: [{
|
|
7287
7262
|
type: i0.Component,
|
|
7288
7263
|
args: [{
|
|
@@ -7536,7 +7511,7 @@
|
|
|
7536
7511
|
return TheCodeComponent;
|
|
7537
7512
|
}(TheBaseElementComponent));
|
|
7538
7513
|
TheCodeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheCodeComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i1__namespace$4.ThyNotifyService }, { token: TheContextService }, { token: i0__namespace.NgZone }, { token: THE_CODE_MODE_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7539
|
-
TheCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: i8.CodeMirrorComponent }], usesInheritance: true, ngImport: i0__namespace, template: "<div contenteditable=\"false\" class=\"the-code-block-operation\" *ngIf=\"isCollapsed && codemirror && !options.readOnly\">\n <thy-icon-nav>\n <the-toolbar-dropdown [menus]=\"menus\" [item]=\"actives\" [itemMousedownHandle]=\"onChangeLangulage\"> </the-toolbar-dropdown>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"copy\"\n thyTooltip=\"\u590D\u5236\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onCopy($event)\"\n ></a>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n class=\"remove-link\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onDelete($event)\"\n ></a>\n <nav-split-line [mode]=\"ToolbarItemMode.vertical\"></nav-split-line>\n <span class=\"auto-wrap d-flex align-items-center\">\n <span>\u81EA\u52A8\u6362\u884C</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n </thy-icon-nav>\n</div>\n\n<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsed, readonly: options.readOnly, active: isHightLight && isCollapsed }\"\n>\n <ng-codemirror\n *ngIf=\"startRenderCodemirror\"\n #codemirror\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options\"\n [ngModel]=\"code\"\n [delayRefreshTime]=\"300\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n [autoMaxHeight]=\"maxHeight\"\n >\n </ng-codemirror>\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\" *ngIf=\"isCollapsed && !options.readOnly\"></thy-resize-handle>\n</div>\n", components: [{ type: i3__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["toolbarItem", "menus", "mode", "item", "itemMousedownHandle"] }, { type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }, { type: i6__namespace$1.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i8__namespace.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "delayRefreshTime", "options"], outputs: ["focusChange"] }, { type: i9__namespace.ThyResizeHandleComponent, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }], directives: [{ type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i4__namespace
|
|
7514
|
+
TheCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: i8.CodeMirrorComponent }], usesInheritance: true, ngImport: i0__namespace, template: "<div contenteditable=\"false\" class=\"the-code-block-operation\" *ngIf=\"isCollapsed && codemirror && !options.readOnly\">\n <thy-icon-nav>\n <the-toolbar-dropdown [menus]=\"menus\" [item]=\"actives\" [itemMousedownHandle]=\"onChangeLangulage\"> </the-toolbar-dropdown>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"copy\"\n thyTooltip=\"\u590D\u5236\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onCopy($event)\"\n ></a>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n class=\"remove-link\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onDelete($event)\"\n ></a>\n <nav-split-line [mode]=\"ToolbarItemMode.vertical\"></nav-split-line>\n <span class=\"auto-wrap d-flex align-items-center\">\n <span>\u81EA\u52A8\u6362\u884C</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n </thy-icon-nav>\n</div>\n\n<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsed, readonly: options.readOnly, active: isHightLight && isCollapsed }\"\n>\n <ng-codemirror\n *ngIf=\"startRenderCodemirror\"\n #codemirror\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options\"\n [ngModel]=\"code\"\n [delayRefreshTime]=\"300\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n [autoMaxHeight]=\"maxHeight\"\n >\n </ng-codemirror>\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\" *ngIf=\"isCollapsed && !options.readOnly\"></thy-resize-handle>\n</div>\n", components: [{ type: i3__namespace$1.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["toolbarItem", "menus", "mode", "item", "itemMousedownHandle"] }, { type: i3__namespace$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }, { type: i6__namespace$1.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i8__namespace.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "delayRefreshTime", "options"], outputs: ["focusChange"] }, { type: i9__namespace.ThyResizeHandleComponent, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }], directives: [{ type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i4__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9__namespace.ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeEnd", "thyResizeStart"] }, { type: i10__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
7540
7515
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheCodeComponent, decorators: [{
|
|
7541
7516
|
type: i0.Component,
|
|
7542
7517
|
args: [{
|
|
@@ -7765,7 +7740,7 @@
|
|
|
7765
7740
|
return TheLinkEditComponent;
|
|
7766
7741
|
}());
|
|
7767
7742
|
TheLinkEditComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheLinkEditComponent, deps: [{ token: i1__namespace$3.ThyPopoverRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7768
|
-
TheLinkEditComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheLinkEditComponent, selector: "the-link-edit", inputs: { tag: "tag", node: "node", link: "link", text: "text", originSelection: "originSelection" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class": "this.className" } }, ngImport: i0__namespace, template: "<form\n thyForm\n #linkForm=\"thyForm\"\n [thyFormValidatorConfig]=\"validatorConfig\"\n name=\"linkForm\"\n>\n <thy-form-group thyLabelText=\"\u6587\u672C\">\n <input\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u6587\u672C\"\n required\n name=\"text\"\n [(ngModel)]=\"text\"\n thyAutofocus\n type=\"text\"\n />\n </thy-form-group>\n <thy-form-group thyLabelText=\"\u94FE\u63A5\">\n <input\n name=\"link\"\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u94FE\u63A5\"\n required\n type=\"text\"\n #linkControl=\"ngModel\"\n [(ngModel)]=\"link\"\n />\n </thy-form-group>\n <thy-form-group-footer>\n <div class=\"btn-pair\">\n <button\n thyButton=\"link-secondary\"\n thySize=\"sm\"\n (click)=\"closePopover()\"\n >\u53D6\u6D88</button>\n <button\n thyButton=\"primary-square\"\n thySize=\"sm\"\n (thyFormSubmit)=\"applyLink(linkForm)\"\n >\u5E94\u7528</button>\n </div>\n </thy-form-group-footer>\n</form>\n", components: [{ type: i2__namespace$
|
|
7743
|
+
TheLinkEditComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheLinkEditComponent, selector: "the-link-edit", inputs: { tag: "tag", node: "node", link: "link", text: "text", originSelection: "originSelection" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class": "this.className" } }, ngImport: i0__namespace, template: "<form\n thyForm\n #linkForm=\"thyForm\"\n [thyFormValidatorConfig]=\"validatorConfig\"\n name=\"linkForm\"\n>\n <thy-form-group thyLabelText=\"\u6587\u672C\">\n <input\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u6587\u672C\"\n required\n name=\"text\"\n [(ngModel)]=\"text\"\n thyAutofocus\n type=\"text\"\n />\n </thy-form-group>\n <thy-form-group thyLabelText=\"\u94FE\u63A5\">\n <input\n name=\"link\"\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u94FE\u63A5\"\n required\n type=\"text\"\n #linkControl=\"ngModel\"\n [(ngModel)]=\"link\"\n />\n </thy-form-group>\n <thy-form-group-footer>\n <div class=\"btn-pair\">\n <button\n thyButton=\"link-secondary\"\n thySize=\"sm\"\n (click)=\"closePopover()\"\n >\u53D6\u6D88</button>\n <button\n thyButton=\"primary-square\"\n thySize=\"sm\"\n (thyFormSubmit)=\"applyLink(linkForm)\"\n >\u5E94\u7528</button>\n </div>\n </thy-form-group-footer>\n</form>\n", components: [{ type: i2__namespace$2.ThyFormGroupComponent, selector: "thy-form-group", inputs: ["thyLabelText", "thyLabelTextTranslateKey", "thyLabelRequired", "thyLabelPaddingTopClear", "thyFeedbackIcon", "thyTipsMode", "thyTips", "thyTipsTranslateKey", "thyRowFill"] }, { type: i2__namespace$2.ThyFormGroupFooterComponent, selector: "thy-form-group-footer", inputs: ["thyAlign"] }, { type: i1__namespace$5.ThyButtonComponent, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thySquare", "thyBlock"] }], directives: [{ type: i4__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4__namespace.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2__namespace$2.ThyFormDirective, selector: "[thyForm],[thy-form]", inputs: ["thyLayout", "thyEnterKeyMode", "thyFormValidatorConfig"], exportAs: ["thyForm"] }, { type: i5__namespace$2.ThyAutofocusDirective, selector: "input[thyAutofocus],textarea[thyAutofocus]", inputs: ["thyAutoSelect", "thyAutofocus"] }, { type: i4__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i5__namespace$1.ThyInputDirective, selector: "[thyInput]", inputs: ["thySize", "thyAutocomplete"] }, { type: i4__namespace.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i4__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2__namespace$2.ThyFormSubmitDirective, selector: "[thyFormSubmit],[thy-form-submit]", outputs: ["thyFormSubmit"] }] });
|
|
7769
7744
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheLinkEditComponent, decorators: [{
|
|
7770
7745
|
type: i0.Component,
|
|
7771
7746
|
args: [{
|
|
@@ -7792,14 +7767,13 @@
|
|
|
7792
7767
|
|
|
7793
7768
|
var TheBaseLinkComponent = /** @class */ (function (_super) {
|
|
7794
7769
|
__extends(TheBaseLinkComponent, _super);
|
|
7795
|
-
function TheBaseLinkComponent(elementRef, cdr, thyPopover, overlay, viewContainerRef
|
|
7770
|
+
function TheBaseLinkComponent(elementRef, cdr, thyPopover, overlay, viewContainerRef) {
|
|
7796
7771
|
var _this = _super.call(this, elementRef, cdr) || this;
|
|
7797
7772
|
_this.elementRef = elementRef;
|
|
7798
7773
|
_this.cdr = cdr;
|
|
7799
7774
|
_this.thyPopover = thyPopover;
|
|
7800
7775
|
_this.overlay = overlay;
|
|
7801
7776
|
_this.viewContainerRef = viewContainerRef;
|
|
7802
|
-
_this.thyClickDispatcher = thyClickDispatcher;
|
|
7803
7777
|
_this.beforeContextChange = function (value) {
|
|
7804
7778
|
if (_this.thyPopoverEditRef && _this.thyPopoverEditRef.componentInstance) {
|
|
7805
7779
|
var originText = _this.thyPopoverEditRef.componentInstance.originText;
|
|
@@ -7920,7 +7894,7 @@
|
|
|
7920
7894
|
};
|
|
7921
7895
|
return TheBaseLinkComponent;
|
|
7922
7896
|
}(TheBaseElementComponent));
|
|
7923
|
-
TheBaseLinkComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheBaseLinkComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i1__namespace$3.ThyPopover }, { token: i2__namespace.Overlay }, { token: i0__namespace.ViewContainerRef }
|
|
7897
|
+
TheBaseLinkComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheBaseLinkComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i1__namespace$3.ThyPopover }, { token: i2__namespace.Overlay }, { token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7924
7898
|
TheBaseLinkComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheBaseLinkComponent, selector: "[TheBaseLinkComponent]", host: { listeners: { "click": "mousedownHandle($event)" } }, usesInheritance: true, ngImport: i0__namespace, template: '', isInline: true });
|
|
7925
7899
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheBaseLinkComponent, decorators: [{
|
|
7926
7900
|
type: i0.Component,
|
|
@@ -7928,7 +7902,7 @@
|
|
|
7928
7902
|
selector: '[TheBaseLinkComponent]',
|
|
7929
7903
|
template: ''
|
|
7930
7904
|
}]
|
|
7931
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: i1__namespace$3.ThyPopover }, { type: i2__namespace.Overlay }, { type: i0__namespace.ViewContainerRef }
|
|
7905
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }, { type: i1__namespace$3.ThyPopover }, { type: i2__namespace.Overlay }, { type: i0__namespace.ViewContainerRef }]; }, propDecorators: { mousedownHandle: [{
|
|
7932
7906
|
type: i0.HostListener,
|
|
7933
7907
|
args: ['click', ['$event']]
|
|
7934
7908
|
}] } });
|
|
@@ -7944,28 +7918,12 @@
|
|
|
7944
7918
|
return TheLinkComponent;
|
|
7945
7919
|
}(TheBaseLinkComponent));
|
|
7946
7920
|
TheLinkComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheLinkComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7947
|
-
TheLinkComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheLinkComponent, selector: "
|
|
7921
|
+
TheLinkComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheLinkComponent, selector: "a[theLink]", host: { attributes: { "target": "_blank" }, properties: { "attr.href": "element.url" } }, usesInheritance: true, ngImport: i0__namespace, template: " <span contenteditable=\"false\" class=\"the-break-char\">{{ inlineChromiumBugfix }}</span>\n <span><slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children></span>\n <span contenteditable=\"false\" class=\"the-break-char\">{{ inlineChromiumBugfix }}</span>", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
|
|
7948
7922
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheLinkComponent, decorators: [{
|
|
7949
|
-
type: i0.Component,
|
|
7950
|
-
args: [{
|
|
7951
|
-
selector: 'span[theLink]',
|
|
7952
|
-
template: " <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>"
|
|
7953
|
-
}]
|
|
7954
|
-
}] });
|
|
7955
|
-
var TheReadonlyLinkComponent = /** @class */ (function (_super) {
|
|
7956
|
-
__extends(TheReadonlyLinkComponent, _super);
|
|
7957
|
-
function TheReadonlyLinkComponent() {
|
|
7958
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
7959
|
-
}
|
|
7960
|
-
return TheReadonlyLinkComponent;
|
|
7961
|
-
}(TheBaseLinkComponent));
|
|
7962
|
-
TheReadonlyLinkComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheReadonlyLinkComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7963
|
-
TheReadonlyLinkComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheReadonlyLinkComponent, selector: "a[theLink]", host: { attributes: { "target": "_blank" }, properties: { "attr.href": "element.url" } }, usesInheritance: true, ngImport: i0__namespace, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
|
|
7964
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheReadonlyLinkComponent, decorators: [{
|
|
7965
7923
|
type: i0.Component,
|
|
7966
7924
|
args: [{
|
|
7967
7925
|
selector: 'a[theLink]',
|
|
7968
|
-
template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>",
|
|
7926
|
+
template: " <span contenteditable=\"false\" class=\"the-break-char\">{{ inlineChromiumBugfix }}</span>\n <span><slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children></span>\n <span contenteditable=\"false\" class=\"the-break-char\">{{ inlineChromiumBugfix }}</span>",
|
|
7969
7927
|
host: {
|
|
7970
7928
|
'[attr.href]': 'element.url',
|
|
7971
7929
|
target: '_blank'
|
|
@@ -8017,7 +7975,7 @@
|
|
|
8017
7975
|
};
|
|
8018
7976
|
editor.renderElement = function (element) {
|
|
8019
7977
|
if (element.type === exports.ElementKinds.link) {
|
|
8020
|
-
return
|
|
7978
|
+
return TheLinkComponent;
|
|
8021
7979
|
}
|
|
8022
7980
|
return renderElement(element);
|
|
8023
7981
|
};
|
|
@@ -8125,7 +8083,7 @@
|
|
|
8125
8083
|
return TheTableToolbarItemComponent;
|
|
8126
8084
|
}(TheToolbarBaseItemComponent));
|
|
8127
8085
|
TheTableToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTableToolbarItemComponent, deps: [{ token: i1__namespace$6.ThyPopover }, { token: i2__namespace.Overlay }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
8128
|
-
TheTableToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTableToolbarItemComponent, selector: "the-table-toolbar-item", inputs: { item: "item", editor: "editor" }, host: { classAttribute: "the-toolbar-dropdown-container" }, usesInheritance: true, ngImport: i0__namespace, template: "\n <a\n thyIconNavLink\n class=\"link-with-down\"\n [thyTooltip]=\"item?.name\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n >\n <thy-icon [thyIconName]=\"item.icon\"></thy-icon>\n <thy-icon class=\"link-down-icon font-size-sm text-desc table-down-icon\" thyIconName=\"caret-down\"> </thy-icon>\n </a>\n ", isInline: true, components: [{ type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type:
|
|
8086
|
+
TheTableToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTableToolbarItemComponent, selector: "the-table-toolbar-item", inputs: { item: "item", editor: "editor" }, host: { classAttribute: "the-toolbar-dropdown-container" }, usesInheritance: true, ngImport: i0__namespace, template: "\n <a\n thyIconNavLink\n class=\"link-with-down\"\n [thyTooltip]=\"item?.name\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n >\n <thy-icon [thyIconName]=\"item.icon\"></thy-icon>\n <thy-icon class=\"link-down-icon font-size-sm text-desc table-down-icon\" thyIconName=\"caret-down\"> </thy-icon>\n </a>\n ", isInline: true, components: [{ type: i3__namespace$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3__namespace.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i5__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
8129
8087
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTableToolbarItemComponent, decorators: [{
|
|
8130
8088
|
type: i0.Component,
|
|
8131
8089
|
args: [{
|
|
@@ -8181,6 +8139,13 @@
|
|
|
8181
8139
|
type: i0.Injectable
|
|
8182
8140
|
}] });
|
|
8183
8141
|
|
|
8142
|
+
var Position;
|
|
8143
|
+
(function (Position) {
|
|
8144
|
+
Position["top"] = "top";
|
|
8145
|
+
Position["right"] = "right";
|
|
8146
|
+
Position["bottom"] = "bottom";
|
|
8147
|
+
Position["left"] = "left";
|
|
8148
|
+
})(Position || (Position = {}));
|
|
8184
8149
|
var HoveredCellInfo = /** @class */ (function () {
|
|
8185
8150
|
function HoveredCellInfo() {
|
|
8186
8151
|
}
|
|
@@ -8361,11 +8326,15 @@
|
|
|
8361
8326
|
enumerable: false,
|
|
8362
8327
|
configurable: true
|
|
8363
8328
|
});
|
|
8364
|
-
TableStore.prototype.
|
|
8329
|
+
TableStore.prototype.getTableEntry = function (editor) {
|
|
8365
8330
|
var selection = editor.selection;
|
|
8366
8331
|
var path = selection.anchor.path;
|
|
8367
8332
|
var opts = new TableOptions$1();
|
|
8368
|
-
return TablePosition.create(opts, editor, path).tableEntry
|
|
8333
|
+
return TablePosition.create(opts, editor, path).tableEntry;
|
|
8334
|
+
};
|
|
8335
|
+
TableStore.prototype.getTablePath = function (editor) {
|
|
8336
|
+
var tableEntry = this.getTableEntry(editor);
|
|
8337
|
+
return tableEntry[1];
|
|
8369
8338
|
};
|
|
8370
8339
|
TableStore.prototype.getTablePosition = function (editor) {
|
|
8371
8340
|
var selection = editor.selection;
|
|
@@ -8632,6 +8601,7 @@
|
|
|
8632
8601
|
};
|
|
8633
8602
|
TableStore.prototype.focusCell = function (editor, path) {
|
|
8634
8603
|
var at = slate.Editor.start(editor, path);
|
|
8604
|
+
TheEditor.focus(this.editor);
|
|
8635
8605
|
slate.Transforms.select(editor, at);
|
|
8636
8606
|
};
|
|
8637
8607
|
TableStore.prototype.dangerousCellsChange = function () {
|
|
@@ -8791,6 +8761,10 @@
|
|
|
8791
8761
|
TableStore.prototype.mergeCell = function (editor) {
|
|
8792
8762
|
mergeCell(editor, this.selectedCells);
|
|
8793
8763
|
};
|
|
8764
|
+
TableStore.prototype.setTableOptions = function (editor, options) {
|
|
8765
|
+
var tablePath = this.getTablePath(this.editor);
|
|
8766
|
+
slate.Transforms.setNodes(editor, { options: options }, { at: tablePath });
|
|
8767
|
+
};
|
|
8794
8768
|
TableStore.prototype.removeDangerousColumns = function () {
|
|
8795
8769
|
var _this = this;
|
|
8796
8770
|
var _a = this, dangerousColumnsIndex = _a.dangerousColumnsIndex, isSelectedTable = _a.isSelectedTable;
|
|
@@ -8897,11 +8871,80 @@
|
|
|
8897
8871
|
});
|
|
8898
8872
|
}
|
|
8899
8873
|
|
|
8874
|
+
var TheTableOptionsComponent = /** @class */ (function () {
|
|
8875
|
+
function TheTableOptionsComponent(popoverRef) {
|
|
8876
|
+
this.popoverRef = popoverRef;
|
|
8877
|
+
this.tableDropdownList = [
|
|
8878
|
+
// {
|
|
8879
|
+
// name: '表头行',
|
|
8880
|
+
// key: 'headerRow'
|
|
8881
|
+
// },
|
|
8882
|
+
// {
|
|
8883
|
+
// name: '表头列',
|
|
8884
|
+
// key: 'headerColumn'
|
|
8885
|
+
// },
|
|
8886
|
+
{
|
|
8887
|
+
name: '序号列',
|
|
8888
|
+
key: 'numberedColumn'
|
|
8889
|
+
}
|
|
8890
|
+
];
|
|
8891
|
+
}
|
|
8892
|
+
Object.defineProperty(TheTableOptionsComponent.prototype, "table", {
|
|
8893
|
+
get: function () {
|
|
8894
|
+
return this.tableStore && this.tableStore.getTableEntry(this.editor)[0];
|
|
8895
|
+
},
|
|
8896
|
+
enumerable: false,
|
|
8897
|
+
configurable: true
|
|
8898
|
+
});
|
|
8899
|
+
TheTableOptionsComponent.prototype.handleDocumentMouseDown = function (event) {
|
|
8900
|
+
if (this.popoverRef && !document.querySelector('.table-options-pannel').contains(event.target)) {
|
|
8901
|
+
this.popoverRef.close();
|
|
8902
|
+
}
|
|
8903
|
+
};
|
|
8904
|
+
TheTableOptionsComponent.prototype.ngOnInit = function () {
|
|
8905
|
+
this.setColumnOptions();
|
|
8906
|
+
};
|
|
8907
|
+
TheTableOptionsComponent.prototype.setColumnOptions = function () {
|
|
8908
|
+
var _this = this;
|
|
8909
|
+
this.tableDropdownList.forEach(function (item) {
|
|
8910
|
+
item.isActive = (_this.table.options && _this.table.options[item.key]) || false;
|
|
8911
|
+
});
|
|
8912
|
+
};
|
|
8913
|
+
TheTableOptionsComponent.prototype.setTableOptions = function (event, option) {
|
|
8914
|
+
event.preventDefault();
|
|
8915
|
+
event.stopPropagation();
|
|
8916
|
+
var currentOption = this.tableDropdownList.find(function (item) { return item.key === option.key; });
|
|
8917
|
+
currentOption.isActive = !option.isActive;
|
|
8918
|
+
var tableOption = {};
|
|
8919
|
+
tableOption[option.key] = currentOption.isActive || null;
|
|
8920
|
+
this.tableStore.setTableOptions(this.editor, Object.assign(Object.assign({}, this.table.options), tableOption));
|
|
8921
|
+
this.popoverRef.close();
|
|
8922
|
+
};
|
|
8923
|
+
return TheTableOptionsComponent;
|
|
8924
|
+
}());
|
|
8925
|
+
TheTableOptionsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTableOptionsComponent, deps: [{ token: i1__namespace$6.ThyPopoverRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
8926
|
+
TheTableOptionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTableOptionsComponent, selector: "the-table-options", inputs: { tableStore: "tableStore", editor: "editor" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" } }, ngImport: i0__namespace, template: "\n <thy-action-menu class=\"table-drop-menu\">\n <ng-container *ngFor=\"let option of tableDropdownList\">\n <a thyActionMenuItem href=\"javascript:;\" (mousedown)=\"setTableOptions($event, option)\">\n <span thyActionMenuItemName>{{ option.name }}</span>\n <span thyActionMenuItemExtendIcon class=\"text-primary\" *ngIf=\"option.isActive\">\n <thy-icon thyIconName=\"check\"></thy-icon>\n </span>\n </a>\n </ng-container>\n </thy-action-menu>\n ", isInline: true, components: [{ type: i2__namespace$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i3__namespace.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i2__namespace$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace$1.ThyActionMenuItemExtendIconDirective, selector: "[thyActionMenuItemExtendIcon]" }] });
|
|
8927
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTableOptionsComponent, decorators: [{
|
|
8928
|
+
type: i0.Component,
|
|
8929
|
+
args: [{
|
|
8930
|
+
selector: 'the-table-options',
|
|
8931
|
+
template: "\n <thy-action-menu class=\"table-drop-menu\">\n <ng-container *ngFor=\"let option of tableDropdownList\">\n <a thyActionMenuItem href=\"javascript:;\" (mousedown)=\"setTableOptions($event, option)\">\n <span thyActionMenuItemName>{{ option.name }}</span>\n <span thyActionMenuItemExtendIcon class=\"text-primary\" *ngIf=\"option.isActive\">\n <thy-icon thyIconName=\"check\"></thy-icon>\n </span>\n </a>\n </ng-container>\n </thy-action-menu>\n "
|
|
8932
|
+
}]
|
|
8933
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$6.ThyPopoverRef }]; }, propDecorators: { tableStore: [{
|
|
8934
|
+
type: i0.Input
|
|
8935
|
+
}], editor: [{
|
|
8936
|
+
type: i0.Input
|
|
8937
|
+
}], handleDocumentMouseDown: [{
|
|
8938
|
+
type: i0.HostListener,
|
|
8939
|
+
args: ['document: mousedown', ['$event']]
|
|
8940
|
+
}] } });
|
|
8941
|
+
|
|
8900
8942
|
var TheTableToolbarComponent = /** @class */ (function () {
|
|
8901
|
-
function TheTableToolbarComponent(ngZone, colorSelectService, popoverRef) {
|
|
8943
|
+
function TheTableToolbarComponent(ngZone, colorSelectService, thyPopover, popoverRef) {
|
|
8902
8944
|
var _this = this;
|
|
8903
8945
|
this.ngZone = ngZone;
|
|
8904
8946
|
this.colorSelectService = colorSelectService;
|
|
8947
|
+
this.thyPopover = thyPopover;
|
|
8905
8948
|
this.popoverRef = popoverRef;
|
|
8906
8949
|
this.cellMenuList = [
|
|
8907
8950
|
{
|
|
@@ -9015,17 +9058,33 @@
|
|
|
9015
9058
|
});
|
|
9016
9059
|
});
|
|
9017
9060
|
};
|
|
9061
|
+
TheTableToolbarComponent.prototype.openTableOptionMenu = function (event) {
|
|
9062
|
+
event.preventDefault();
|
|
9063
|
+
event.stopPropagation();
|
|
9064
|
+
this.thyPopover.open(TheTableOptionsComponent, {
|
|
9065
|
+
origin: event.currentTarget,
|
|
9066
|
+
initialState: {
|
|
9067
|
+
tableStore: this.tableStore,
|
|
9068
|
+
editor: this.editor
|
|
9069
|
+
},
|
|
9070
|
+
insideClosable: false,
|
|
9071
|
+
hasBackdrop: false,
|
|
9072
|
+
placement: 'bottomLeft',
|
|
9073
|
+
originActiveClass: 'table-options-active',
|
|
9074
|
+
panelClass: 'table-options-pannel'
|
|
9075
|
+
});
|
|
9076
|
+
};
|
|
9018
9077
|
return TheTableToolbarComponent;
|
|
9019
9078
|
}());
|
|
9020
|
-
TheTableToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTableToolbarComponent, deps: [{ token: i0__namespace.NgZone }, { token: TheColorSelectService }, { token: i1__namespace$3.ThyPopoverRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
9021
|
-
TheTableToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTableToolbarComponent, selector: "the-table-toolbar", inputs: { tableStore: "tableStore", isActiveSelect: "isActiveSelect" }, ngImport: i0__namespace, template: "<thy-icon-nav>\n <ng-container *ngFor=\"let item of cellMenuList\">\n <a href=\"javascript:;\" thyIconNavLink *ngIf=\"!item.invisibility\" [thyTooltip]=\"item.name\" (mousedown)=\"item.actionHandle()\">\n <thy-icon [thyIconName]=\"item.icon\"></thy-icon>\n </a>\n </ng-container>\n <nav-split-line *ngIf=\"!isActiveSelect && isShowSplitLine\"></nav-split-line>\n <a href=\"javascript:;\" thyIconNavLink thyTooltip=\"\u5355\u5143\u683C\u80CC\u666F\" (mousedown)=\"openSelectColor($event)\">\n <thy-icon thyIconName=\"background-tt\" thyIconType=\"twotone\" [thyTwotoneColor]=\"selectedColor\"></thy-icon>\n </a>\n <nav-split-line *ngIf=\"deleteIcon\"></nav-split-line>\n <a\n *ngIf=\"deleteIcon\"\n href=\"javascript:;\"\n thyIconNavLink\n [thyTooltip]=\"iconName\"\n class=\"danger\"\n [thyIconNavLinkIcon]=\"deleteIcon\"\n (mousedown)=\"onDelete($event)\"\n (mouseenter)=\"onEnterDelete($event)\"\n (mouseleave)=\"onLeaveDelete($event)\"\n ></a>\n</thy-icon-nav>\n", components: [{ type: i3__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type:
|
|
9079
|
+
TheTableToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTableToolbarComponent, deps: [{ token: i0__namespace.NgZone }, { token: TheColorSelectService }, { token: i1__namespace$3.ThyPopover }, { token: i1__namespace$3.ThyPopoverRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
9080
|
+
TheTableToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTableToolbarComponent, selector: "the-table-toolbar", inputs: { tableStore: "tableStore", isActiveSelect: "isActiveSelect" }, ngImport: i0__namespace, template: "<thy-icon-nav>\n <ng-container *ngFor=\"let item of cellMenuList\">\n <a href=\"javascript:;\" thyIconNavLink *ngIf=\"!item.invisibility\" [thyTooltip]=\"item.name\" (mousedown)=\"item.actionHandle()\">\n <thy-icon [thyIconName]=\"item.icon\"></thy-icon>\n </a>\n </ng-container>\n <nav-split-line *ngIf=\"!isActiveSelect && isShowSplitLine\"></nav-split-line>\n <a href=\"javascript:;\" thyIconNavLink thyTooltip=\"\u5355\u5143\u683C\u80CC\u666F\" (mousedown)=\"openSelectColor($event)\">\n <thy-icon thyIconName=\"background-tt\" thyIconType=\"twotone\" [thyTwotoneColor]=\"selectedColor\"></thy-icon>\n </a>\n <nav-split-line *ngIf=\"tableStore.isSelectedTable\"></nav-split-line>\n <button\n thyButton=\"default\"\n *ngIf=\"tableStore.isSelectedTable\"\n class=\"mr-2\"\n thySize=\"md\"\n class=\"table-options\"\n (mousedown)=\"openTableOptionMenu($event)\"\n >\n <span>\u8868\u683C\u9009\u9879</span>\n <thy-icon thyIconName=\"caret-down\"></thy-icon>\n </button>\n <nav-split-line *ngIf=\"deleteIcon\"></nav-split-line>\n <a\n *ngIf=\"deleteIcon\"\n href=\"javascript:;\"\n thyIconNavLink\n [thyTooltip]=\"iconName\"\n class=\"danger\"\n [thyIconNavLinkIcon]=\"deleteIcon\"\n (mousedown)=\"onDelete($event)\"\n (mouseenter)=\"onEnterDelete($event)\"\n (mouseleave)=\"onLeaveDelete($event)\"\n ></a>\n</thy-icon-nav>\n", components: [{ type: i3__namespace$1.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: i3__namespace$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3__namespace.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }, { type: i1__namespace$5.ThyButtonComponent, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thySquare", "thyBlock"] }], directives: [{ type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
9022
9081
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTableToolbarComponent, decorators: [{
|
|
9023
9082
|
type: i0.Component,
|
|
9024
9083
|
args: [{
|
|
9025
9084
|
selector: 'the-table-toolbar',
|
|
9026
9085
|
templateUrl: 'table-toolbar.component.html'
|
|
9027
9086
|
}]
|
|
9028
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.NgZone }, { type: TheColorSelectService }, { type: i1__namespace$3.ThyPopoverRef }]; }, propDecorators: { tableStore: [{
|
|
9087
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.NgZone }, { type: TheColorSelectService }, { type: i1__namespace$3.ThyPopover }, { type: i1__namespace$3.ThyPopoverRef }]; }, propDecorators: { tableStore: [{
|
|
9029
9088
|
type: i0.Input
|
|
9030
9089
|
}], isActiveSelect: [{
|
|
9031
9090
|
type: i0.Input
|
|
@@ -9082,7 +9141,7 @@
|
|
|
9082
9141
|
return TheContextMenuComponent;
|
|
9083
9142
|
}());
|
|
9084
9143
|
TheContextMenuComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheContextMenuComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$3.ThyPopoverRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
9085
|
-
TheContextMenuComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheContextMenuComponent, selector: "the-contextmenu", inputs: { menuEntities: "menuEntities", actionHandle: "actionHandle", activeHandle: "activeHandle", deactiveHandle: "deactiveHandle" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)", "mousedown": "handleMouseDown($event)" }, properties: { "class.the-overlay-menu-wrap": "this.wrap" } }, ngImport: i0__namespace, template: "<thy-action-menu>\n <ng-container *ngFor=\"let menuItem of menuEntities\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n *ngIf=\"!menuItem.invisibility\"\n (mousedown)=\"itemMousedown($event, menuItem)\"\n (mouseenter)=\"itemMouseenter($event, menuItem)\"\n (mouseleave)=\"itemMouseleave($event, menuItem)\"\n >\n <span thyActionMenuItemIcon>\n <thy-icon\n *ngIf=\"menuItem.backgroundColor; else elseIcon\"\n [thyIconName]=\"menuItem.icon\"\n thyIconType=\"twotone\"\n [thyTwotoneColor]=\"menuItem.backgroundColor\"\n ></thy-icon>\n <ng-template #elseIcon>\n <thy-icon [thyIconName]=\"menuItem.icon\"></thy-icon>\n </ng-template>\n </span>\n <span thyActionMenuItemName>{{ menuItem.name }}</span>\n <span *ngIf=\"menuItem.extendIcon\" thyActionMenuItemExtendIcon>\n <thy-icon thyIconName=\"{{ menuItem.extendIcon }}\"></thy-icon>\n </span>\n </a>\n <thy-action-menu-divider *ngIf=\"menuItem.divider\"></thy-action-menu-divider>\n </ng-container>\n</thy-action-menu>\n", components: [{ type:
|
|
9144
|
+
TheContextMenuComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheContextMenuComponent, selector: "the-contextmenu", inputs: { menuEntities: "menuEntities", actionHandle: "actionHandle", activeHandle: "activeHandle", deactiveHandle: "deactiveHandle" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)", "mousedown": "handleMouseDown($event)" }, properties: { "class.the-overlay-menu-wrap": "this.wrap" } }, ngImport: i0__namespace, template: "<thy-action-menu>\n <ng-container *ngFor=\"let menuItem of menuEntities\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n *ngIf=\"!menuItem.invisibility\"\n (mousedown)=\"itemMousedown($event, menuItem)\"\n (mouseenter)=\"itemMouseenter($event, menuItem)\"\n (mouseleave)=\"itemMouseleave($event, menuItem)\"\n >\n <span thyActionMenuItemIcon>\n <thy-icon\n *ngIf=\"menuItem.backgroundColor; else elseIcon\"\n [thyIconName]=\"menuItem.icon\"\n thyIconType=\"twotone\"\n [thyTwotoneColor]=\"menuItem.backgroundColor\"\n ></thy-icon>\n <ng-template #elseIcon>\n <thy-icon [thyIconName]=\"menuItem.icon\"></thy-icon>\n </ng-template>\n </span>\n <span thyActionMenuItemName>{{ menuItem.name }}</span>\n <span *ngIf=\"menuItem.extendIcon\" thyActionMenuItemExtendIcon>\n <thy-icon thyIconName=\"{{ menuItem.extendIcon }}\"></thy-icon>\n </span>\n </a>\n <thy-action-menu-divider *ngIf=\"menuItem.divider\"></thy-action-menu-divider>\n </ng-container>\n</thy-action-menu>\n", components: [{ type: i2__namespace$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i3__namespace.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i2__namespace$1.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i2__namespace$1.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i2__namespace$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }, { type: i2__namespace$1.ThyActionMenuItemExtendIconDirective, selector: "[thyActionMenuItemExtendIcon]" }] });
|
|
9086
9145
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheContextMenuComponent, decorators: [{
|
|
9087
9146
|
type: i0.Component,
|
|
9088
9147
|
args: [{
|
|
@@ -9357,7 +9416,7 @@
|
|
|
9357
9416
|
return tableElement.querySelector('.the-table-corner-controls');
|
|
9358
9417
|
}
|
|
9359
9418
|
if (selectedColumnsIndex.length > 0 && row === 0) {
|
|
9360
|
-
return tableElement.querySelectorAll('.the-table-col-controls
|
|
9419
|
+
return tableElement.querySelectorAll('.the-table-col-controls')[col];
|
|
9361
9420
|
}
|
|
9362
9421
|
if (selectedRowsIndex.length > 0 && col === 0) {
|
|
9363
9422
|
return tableElement.querySelectorAll('.the-table-row-controls-button-wrap')[row];
|
|
@@ -9472,8 +9531,13 @@
|
|
|
9472
9531
|
var tableWrapper = tableComponent.tableWrapper.nativeElement;
|
|
9473
9532
|
var tableElement = tableComponent.theTableElement.nativeElement;
|
|
9474
9533
|
var result = 0;
|
|
9534
|
+
var rowControl = tableComponent.nativeElement.querySelector('.the-table-row-controls');
|
|
9535
|
+
var rowControlWidth = 11;
|
|
9536
|
+
if (rowControl) {
|
|
9537
|
+
rowControlWidth = rowControl.getBoundingClientRect().width;
|
|
9538
|
+
}
|
|
9475
9539
|
if (this.type === 'row') {
|
|
9476
|
-
result = tableWrapper.offsetWidth +
|
|
9540
|
+
result = tableWrapper.offsetWidth + rowControlWidth;
|
|
9477
9541
|
}
|
|
9478
9542
|
else {
|
|
9479
9543
|
result = tableElement.offsetHeight - 1;
|
|
@@ -9524,41 +9588,23 @@
|
|
|
9524
9588
|
var _this = this;
|
|
9525
9589
|
this.ngZone.runOutsideAngular(function () {
|
|
9526
9590
|
var element = _this.elementRef.nativeElement;
|
|
9527
|
-
var previous = { x: 0, y: 0 };
|
|
9528
9591
|
rxjs.fromEvent(element, 'mousemove') // mouseover to mousemove 增加灵敏性
|
|
9529
|
-
.pipe(operators.
|
|
9530
|
-
operators.map(function (event) {
|
|
9592
|
+
.pipe(operators.map(function (event) {
|
|
9531
9593
|
if (!_this.theTableComponent.isCollapsed) {
|
|
9532
9594
|
return null;
|
|
9533
9595
|
}
|
|
9534
9596
|
var cell = event.target.closest(SLA_TABLE_CELL_SELECTOR);
|
|
9535
|
-
var
|
|
9536
|
-
var position;
|
|
9597
|
+
var positions = [Position.top, Position.right, Position.bottom, Position.left];
|
|
9537
9598
|
if (cell) {
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
if (Math.abs(deltaY) > Math.abs(deltaX) && deltaY !== 0) {
|
|
9548
|
-
_this.isXAxis = false;
|
|
9549
|
-
var centerCellY = rectCell.y + rectCell.height / 2;
|
|
9550
|
-
position = event.y > centerCellY ? 'top' : 'bottom';
|
|
9551
|
-
}
|
|
9552
|
-
hoveredInfo = {
|
|
9553
|
-
cell: cell,
|
|
9554
|
-
position: position
|
|
9555
|
-
};
|
|
9556
|
-
}
|
|
9557
|
-
previous = {
|
|
9558
|
-
x: event.clientX,
|
|
9559
|
-
y: event.clientY
|
|
9560
|
-
};
|
|
9561
|
-
return position ? hoveredInfo : null;
|
|
9599
|
+
var rectCell = cell.getBoundingClientRect();
|
|
9600
|
+
var topOffset = event.clientY - rectCell.y;
|
|
9601
|
+
var rightOffset = rectCell.right - event.clientX;
|
|
9602
|
+
var bottomOffset = rectCell.bottom - event.clientY;
|
|
9603
|
+
var leftOffset = event.clientX - rectCell.x;
|
|
9604
|
+
var positionOffsets = [topOffset, rightOffset, bottomOffset, leftOffset];
|
|
9605
|
+
var minIndex = positionOffsets.indexOf(Math.min.apply(Math, __spreadArray([], __read(positionOffsets))));
|
|
9606
|
+
_this.position = positions[minIndex];
|
|
9607
|
+
return { cell: cell, position: _this.position };
|
|
9562
9608
|
}
|
|
9563
9609
|
return null;
|
|
9564
9610
|
}), operators.takeUntil(_this.destroyed))
|
|
@@ -9573,13 +9619,23 @@
|
|
|
9573
9619
|
TheColumnResizeDirective.prototype._listenStartDrag = function () {
|
|
9574
9620
|
var _this = this;
|
|
9575
9621
|
this.resizeNotifier.resizeStarted.pipe(operators.takeUntil(this.destroyed)).subscribe(function () {
|
|
9576
|
-
_this.
|
|
9622
|
+
if (_this.position === Position.left || _this.position === Position.right) {
|
|
9623
|
+
_this.theTableComponent.initializeColumns();
|
|
9624
|
+
}
|
|
9625
|
+
else {
|
|
9626
|
+
_this.theTableComponent.initializeRows();
|
|
9627
|
+
}
|
|
9577
9628
|
});
|
|
9578
9629
|
};
|
|
9579
9630
|
TheColumnResizeDirective.prototype._listenEndDrag = function () {
|
|
9580
9631
|
var _this = this;
|
|
9581
9632
|
this.resizeNotifier.resizeCompleted.pipe(operators.takeUntil(this.destroyed)).subscribe(function () {
|
|
9582
|
-
_this.
|
|
9633
|
+
if (_this.position === Position.left || _this.position === Position.right) {
|
|
9634
|
+
_this.theTableComponent.transformColumnsWidth();
|
|
9635
|
+
}
|
|
9636
|
+
else {
|
|
9637
|
+
_this.theTableComponent.transformRowHeight();
|
|
9638
|
+
}
|
|
9583
9639
|
});
|
|
9584
9640
|
};
|
|
9585
9641
|
TheColumnResizeDirective.prototype.ngOnDestroy = function () {
|
|
@@ -9725,7 +9781,8 @@
|
|
|
9725
9781
|
});
|
|
9726
9782
|
};
|
|
9727
9783
|
TheTableComponent.prototype.useRowControls = function () {
|
|
9728
|
-
|
|
9784
|
+
var _a;
|
|
9785
|
+
if (this.selection || ((_a = this.element.options) === null || _a === void 0 ? void 0 : _a.numberedColumn)) {
|
|
9729
9786
|
this.rowControls = this.calculateRowControls();
|
|
9730
9787
|
this.cdr.markForCheck();
|
|
9731
9788
|
}
|
|
@@ -9919,8 +9976,13 @@
|
|
|
9919
9976
|
setNode(this.editor, { columns: columns }, this.element);
|
|
9920
9977
|
};
|
|
9921
9978
|
TheTableComponent.prototype.onRowMouseDown = function (event, index) {
|
|
9979
|
+
if (this.readonly)
|
|
9980
|
+
return;
|
|
9922
9981
|
event.stopPropagation();
|
|
9923
|
-
|
|
9982
|
+
if (!this.isInTable) {
|
|
9983
|
+
var path = TheEditor.findPath(this.editor, this.element);
|
|
9984
|
+
slate.Transforms.select(this.editor, path);
|
|
9985
|
+
}
|
|
9924
9986
|
this.tableStore.selectRow(this.editor, index);
|
|
9925
9987
|
this.tableService.openToolbar(event.target, true);
|
|
9926
9988
|
};
|
|
@@ -10001,7 +10063,7 @@
|
|
|
10001
10063
|
provide: TheTableToken,
|
|
10002
10064
|
useExisting: TheTableComponent
|
|
10003
10065
|
}
|
|
10004
|
-
], viewQueries: [{ propertyName: "tableWrapper", first: true, predicate: ["tableWrapper"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "theTableElement", first: true, predicate: ["theTable"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "tbodyElement", first: true, predicate: ["tbody"], descendants: true, read: i0.ElementRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<div\n class=\"the-table-container\"\n theColumnResize\n [ngClass]=\"{\n 'the-table-with-controls': isInTable,\n 'the-table-selection-hide': tableStore.isCellSelecting || tableStore.isRightClicking\n }\"\n>\n <div
|
|
10066
|
+
], viewQueries: [{ propertyName: "tableWrapper", first: true, predicate: ["tableWrapper"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "theTableElement", first: true, predicate: ["theTable"], descendants: true, read: i0.ElementRef, static: true }, { propertyName: "tbodyElement", first: true, predicate: ["tbody"], descendants: true, read: i0.ElementRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<div\n class=\"the-table-container\"\n theColumnResize\n [ngClass]=\"{\n 'the-table-with-controls': isInTable,\n 'the-numbered-column-container': element?.options?.numberedColumn,\n 'the-table-selection-hide': tableStore.isCellSelecting || tableStore.isRightClicking\n }\"\n>\n <div\n class=\"the-table-row-controls-wrapper\"\n [ngClass]=\"{\n 'the-table-focus': isInTable\n }\"\n >\n <div\n class=\"the-table-corner-controls\"\n [ngClass]=\"{\n visible: !readonly && isInTable,\n active: isSelectedAllCell,\n dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0\n }\"\n >\n <div class=\"the-table-corner-button\" (mousedown)=\"onSelectTable($event)\"></div>\n <div class=\"the-table-corner-controls-insert-row-marker\">\n <the-table-insert-mark type=\"row\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n <div class=\"the-table-corner-controls-insert-column-marker\">\n <the-table-insert-mark type=\"column\" [at]=\"0\" [tableStore]=\"tableStore\"></the-table-insert-mark>\n </div>\n </div>\n <div class=\"the-table-row-controls\">\n <div class=\"the-table-row-controls-inner\">\n <div\n class=\"the-table-row-controls-button-wrap\"\n *ngFor=\"let control of rowControls; let i = index; trackBy: trackByFnRowCotrols\"\n [ngClass]=\"{\n active: tableStore.selectedRowsIndex.includes(control.rowIndex),\n dangerous: tableStore.dangerousRowsIndex.includes(control.rowIndex) && tableStore.dangerousCells.length > 0\n }\"\n >\n <ng-container *ngIf=\"!readonly && isInTable && !element?.options?.numberedColumn\">\n <button\n (mousedown)=\"onRowMouseDown($event, control.rowIndex)\"\n type=\"button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n class=\"the-table-row-controls-button the-table-controls-button\"\n ></button>\n </ng-container>\n <ng-container *ngIf=\"element?.options?.numberedColumn\">\n <div\n [contentEditable]=\"false\"\n contenteditable=\"false\"\n (mousedown)=\"onRowMouseDown($event, control.rowIndex)\"\n class=\"the-table-numbered-controls-button\"\n [ngStyle]=\"{ height: control.height + 1 + 'px' }\"\n >\n <p class=\"row-number d-flex align-items-center\">{{ i + 1 }}</p>\n </div>\n </ng-container>\n <the-table-insert-mark type=\"row\" [at]=\"control.rowIndex + 1\" [tableStore]=\"tableStore\"> </the-table-insert-mark>\n </div>\n </div>\n </div>\n </div>\n <div class=\"the-table-wrapper\" #tableWrapper [ngClass]=\"{ 'the-table-numbered': element?.options?.numberedColumn }\">\n <table class=\"the-table\" #theTable [ngClass]=\"{ 'the-table-with-controls': isInTable }\">\n <colgroup *ngIf=\"columns\">\n <col *ngFor=\"let col of columns\" [ngStyle]=\"{ width: col.width + 'px' }\" />\n </colgroup>\n <thead>\n <tr class=\"the-table-col-controls-wrapper\">\n <th\n class=\"the-table-col-controls\"\n [ngClass]=\"{\n active: tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0\n }\"\n (mousedown)=\"onColMouseDown($event, i)\"\n *ngFor=\"let control of colControls; let i = index; trackBy: trackByFnColCotrols\"\n >\n <the-table-insert-mark *ngIf=\"isInTable\" type=\"column\" [at]=\"i + 1\" [tableStore]=\"tableStore\">\n </the-table-insert-mark>\n </th>\n </tr>\n </thead>\n <tbody #tbody>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"> </slate-children>\n </tbody>\n </table>\n </div>\n</div>\n", components: [{ type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: ["type", "at", "tableStore"] }, { type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }], directives: [{ type: TheColumnResizeDirective, selector: "div[theColumnResize]" }, { type: i10__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
10005
10067
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheTableComponent, decorators: [{
|
|
10006
10068
|
type: i0.Component,
|
|
10007
10069
|
args: [{
|
|
@@ -10305,6 +10367,9 @@
|
|
|
10305
10367
|
ResizeRef.prototype.setDirection = function (direction) {
|
|
10306
10368
|
this.direction = direction;
|
|
10307
10369
|
};
|
|
10370
|
+
ResizeRef.prototype.setPosition = function (position) {
|
|
10371
|
+
this.position = position;
|
|
10372
|
+
};
|
|
10308
10373
|
return ResizeRef;
|
|
10309
10374
|
}());
|
|
10310
10375
|
|
|
@@ -10330,7 +10395,7 @@
|
|
|
10330
10395
|
rxjs.fromEvent(_this.elementRef.nativeElement, 'mouseenter')
|
|
10331
10396
|
.pipe(takeUntilDestroyed, operators.mapTo(_this.resizeRef.origin.nativeElement))
|
|
10332
10397
|
.subscribe(function (cell) {
|
|
10333
|
-
_this.eventDispatcher.tableCellHovered.next({ cell: cell });
|
|
10398
|
+
_this.eventDispatcher.tableCellHovered.next({ cell: cell, position: _this.resizeRef.position });
|
|
10334
10399
|
_this.resizeRef.updateSizeAndOffset();
|
|
10335
10400
|
});
|
|
10336
10401
|
rxjs.fromEvent(_this.elementRef.nativeElement, 'mousedown')
|
|
@@ -10388,7 +10453,7 @@
|
|
|
10388
10453
|
});
|
|
10389
10454
|
};
|
|
10390
10455
|
TheColumnResizeOverlayHandleComponent.prototype.updateResizeActive = function (active) {
|
|
10391
|
-
this.eventDispatcher.overlayHandleActiveForCell.next(active ? { cell: this.resizeRef.origin.nativeElement } : null);
|
|
10456
|
+
this.eventDispatcher.overlayHandleActiveForCell.next(active ? { cell: this.resizeRef.origin.nativeElement, position: this.resizeRef.position } : null);
|
|
10392
10457
|
};
|
|
10393
10458
|
TheColumnResizeOverlayHandleComponent.prototype._isXAxis = function () {
|
|
10394
10459
|
return this.resizeRef.direction === 'X';
|
|
@@ -10476,13 +10541,13 @@
|
|
|
10476
10541
|
var POSITION_MAP = {
|
|
10477
10542
|
top: {
|
|
10478
10543
|
originX: 'start',
|
|
10479
|
-
originY: '
|
|
10544
|
+
originY: 'top',
|
|
10480
10545
|
overlayX: 'start',
|
|
10481
10546
|
overlayY: 'center'
|
|
10482
10547
|
},
|
|
10483
10548
|
bottom: {
|
|
10484
10549
|
originX: 'start',
|
|
10485
|
-
originY: '
|
|
10550
|
+
originY: 'bottom',
|
|
10486
10551
|
overlayX: 'start',
|
|
10487
10552
|
overlayY: 'center'
|
|
10488
10553
|
},
|
|
@@ -10547,7 +10612,9 @@
|
|
|
10547
10612
|
});
|
|
10548
10613
|
Object.defineProperty(TheTdComponent.prototype, "theTableWrapperWidth", {
|
|
10549
10614
|
get: function () {
|
|
10550
|
-
|
|
10615
|
+
var tableContainer = this.tableComponent.nativeElement.firstChild;
|
|
10616
|
+
var paddingLeft = coercePixelsFromCssValue(window.getComputedStyle(tableContainer)['paddingLeft']);
|
|
10617
|
+
return this.tableComponent.theTableWrapperWidth - paddingLeft;
|
|
10551
10618
|
},
|
|
10552
10619
|
enumerable: false,
|
|
10553
10620
|
configurable: true
|
|
@@ -10579,7 +10646,18 @@
|
|
|
10579
10646
|
});
|
|
10580
10647
|
Object.defineProperty(TheTdComponent.prototype, "isXAxisHover", {
|
|
10581
10648
|
get: function () {
|
|
10582
|
-
return [
|
|
10649
|
+
return [Position.left, Position.right].includes(this.hoverdDirection);
|
|
10650
|
+
},
|
|
10651
|
+
enumerable: false,
|
|
10652
|
+
configurable: true
|
|
10653
|
+
});
|
|
10654
|
+
Object.defineProperty(TheTdComponent.prototype, "rowResizeClass", {
|
|
10655
|
+
get: function () {
|
|
10656
|
+
var _a;
|
|
10657
|
+
return [
|
|
10658
|
+
'the-row-resize-handle-panel',
|
|
10659
|
+
this.tablePosition.table && ((_a = this.tablePosition.table.options) === null || _a === void 0 ? void 0 : _a.numberedColumn) ? 'the-numbered-resize-handle-panel' : ''
|
|
10660
|
+
];
|
|
10583
10661
|
},
|
|
10584
10662
|
enumerable: false,
|
|
10585
10663
|
configurable: true
|
|
@@ -10810,20 +10888,27 @@
|
|
|
10810
10888
|
var element = this.elementRef.nativeElement;
|
|
10811
10889
|
this.eventDispatcher
|
|
10812
10890
|
.resizeOverlayVisibleForTableCell(element)
|
|
10813
|
-
.pipe(operators.takeUntil(this.destroy$))
|
|
10891
|
+
.pipe(operators.takeUntil(this.destroy$), operators.map(function (value) {
|
|
10892
|
+
// 禁止第一列左侧
|
|
10893
|
+
if (value && value.position === Position.left && _this.tablePosition.getColumnIndex() === 0) {
|
|
10894
|
+
return null;
|
|
10895
|
+
}
|
|
10896
|
+
// 禁止第一行顶部
|
|
10897
|
+
if (value && value.position === Position.top && _this.tablePosition.getRowIndex() === 0) {
|
|
10898
|
+
return null;
|
|
10899
|
+
}
|
|
10900
|
+
return value;
|
|
10901
|
+
}))
|
|
10814
10902
|
.subscribe(function (hoveredCellInfo) {
|
|
10815
10903
|
if (hoveredCellInfo && hoveredCellInfo.position) {
|
|
10816
10904
|
_this.hoverdDirection = hoveredCellInfo.position;
|
|
10817
10905
|
}
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
return;
|
|
10821
|
-
}
|
|
10822
|
-
if (!_this.isXAxisHover && _this.hoverdDirection === 'bottom' && _this.tablePosition.getRowIndex() === 0) {
|
|
10823
|
-
return;
|
|
10906
|
+
else {
|
|
10907
|
+
_this.hoverdDirection = null;
|
|
10824
10908
|
}
|
|
10825
10909
|
if (hoveredCellInfo) {
|
|
10826
|
-
|
|
10910
|
+
_this.hoverdDirection = hoveredCellInfo.position;
|
|
10911
|
+
if (!_this.overlayRef || !_this.overlayRef.hasAttached()) {
|
|
10827
10912
|
_this.overlayRef = _this._createOverlayForHandle();
|
|
10828
10913
|
_this._showHandleOverlay();
|
|
10829
10914
|
}
|
|
@@ -10834,7 +10919,6 @@
|
|
|
10834
10919
|
}
|
|
10835
10920
|
else if (_this.overlayRef) {
|
|
10836
10921
|
_this.overlayRef.detach();
|
|
10837
|
-
_this.overlayRef = null;
|
|
10838
10922
|
}
|
|
10839
10923
|
});
|
|
10840
10924
|
};
|
|
@@ -10847,21 +10931,23 @@
|
|
|
10847
10931
|
var deltaSize = _c.deltaSize, previousSize = _c.previousSize, completeImmediately = _c.completeImmediately;
|
|
10848
10932
|
var _d = _this.elementRef.nativeElement.getBoundingClientRect(), top = _d.top, left = _d.left, height = _d.height, width = _d.width;
|
|
10849
10933
|
var clientY = event.clientY, clientX = event.clientX;
|
|
10850
|
-
var
|
|
10934
|
+
var isPreventApplySize = false;
|
|
10935
|
+
// 向下,或者向右移动(deltaSize > 0),鼠标位置不在当前单元格拖拽线上,阻止应用拖拽尺寸
|
|
10851
10936
|
if (_this.isXAxisHover) {
|
|
10852
|
-
var cellWidth = _this.hoverdDirection ===
|
|
10853
|
-
|
|
10937
|
+
var cellWidth = _this.hoverdDirection === Position.left ? 0 : width;
|
|
10938
|
+
isPreventApplySize = deltaSize > 0 && left + cellWidth - clientX > 0;
|
|
10854
10939
|
}
|
|
10855
10940
|
else {
|
|
10856
|
-
var cellHeight = _this.hoverdDirection ===
|
|
10857
|
-
|
|
10941
|
+
var cellHeight = _this.hoverdDirection === Position.top ? 0 : height;
|
|
10942
|
+
isPreventApplySize = deltaSize > 0 && top + cellHeight - clientY > 0;
|
|
10858
10943
|
}
|
|
10859
|
-
if (
|
|
10860
|
-
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10944
|
+
if (isPreventApplySize) {
|
|
10945
|
+
return;
|
|
10946
|
+
}
|
|
10947
|
+
_this.elementRef.nativeElement.classList.add(OVERLAY_ACTIVE_CLASS);
|
|
10948
|
+
_this.applySize(deltaSize, previousSize);
|
|
10949
|
+
if (completeImmediately) {
|
|
10950
|
+
_this._completeResizeOperation();
|
|
10865
10951
|
}
|
|
10866
10952
|
});
|
|
10867
10953
|
rxjs.merge(this.resizeNotifier.resizeCanceled, this.resizeNotifier.resizeCompleted)
|
|
@@ -10888,7 +10974,6 @@
|
|
|
10888
10974
|
this.resizeRef = new ResizeRef(this.elementRef, this.overlayRef, this.tableOptions.minWidthPx, this.tableOptions.maxWidthPx, this.tableOptions.minHeightPx, this.tableOptions.maxHeightPx, function () {
|
|
10889
10975
|
_this.updateOverlayHandleSizeAndOffset();
|
|
10890
10976
|
});
|
|
10891
|
-
this.resizeRef.setDirection(this.isXAxisHover ? 'X' : 'Y');
|
|
10892
10977
|
customTokens.set(ResizeRef, this.resizeRef);
|
|
10893
10978
|
customTokens.set(TableCellEventDispatcher, this.eventDispatcher);
|
|
10894
10979
|
customTokens.set(ColumnResizeNotifierSource, this.resizeNotifier);
|
|
@@ -10901,9 +10986,11 @@
|
|
|
10901
10986
|
};
|
|
10902
10987
|
TheTdComponent.prototype.updateOverlayHandleSizeAndOffset = function () {
|
|
10903
10988
|
var _a, _b;
|
|
10904
|
-
(_a = this.overlayRef) === null || _a === void 0 ? void 0 : _a.removePanelClass(['the-column-resize-handle-panel',
|
|
10989
|
+
(_a = this.overlayRef) === null || _a === void 0 ? void 0 : _a.removePanelClass(__spreadArray(['the-column-resize-handle-panel'], __read(this.rowResizeClass)));
|
|
10905
10990
|
this.isXAxisHover ? this.updateOverlayHandleColumnSize() : this.updateOverlayHandleRowSize();
|
|
10906
10991
|
(_b = this.overlayRef) === null || _b === void 0 ? void 0 : _b.updatePositionStrategy(this.createPositionStrategy());
|
|
10992
|
+
this.resizeRef.setDirection(this.isXAxisHover ? 'X' : 'Y');
|
|
10993
|
+
this.resizeRef.setPosition(this.hoverdDirection);
|
|
10907
10994
|
};
|
|
10908
10995
|
TheTdComponent.prototype.updateOverlayHandleColumnSize = function () {
|
|
10909
10996
|
var height = 0;
|
|
@@ -10918,8 +11005,14 @@
|
|
|
10918
11005
|
this.overlayRef.updateSize({ height: height, width: OVERLAY_INIT_SIZE });
|
|
10919
11006
|
};
|
|
10920
11007
|
TheTdComponent.prototype.updateOverlayHandleRowSize = function () {
|
|
10921
|
-
var
|
|
10922
|
-
|
|
11008
|
+
var tableElement = this.tableComponent.nativeElement;
|
|
11009
|
+
var rowControl = tableElement.querySelector('.the-table-row-controls');
|
|
11010
|
+
var rowControlWidth = 11;
|
|
11011
|
+
if (rowControl) {
|
|
11012
|
+
rowControlWidth = rowControl.getBoundingClientRect().width;
|
|
11013
|
+
}
|
|
11014
|
+
var width = this.tableComponent.tableWrapper.nativeElement.offsetWidth + rowControlWidth;
|
|
11015
|
+
this.overlayRef.addPanelClass(this.rowResizeClass);
|
|
10923
11016
|
this.overlayRef.updateSize({ width: width, height: OVERLAY_INIT_SIZE });
|
|
10924
11017
|
};
|
|
10925
11018
|
TheTdComponent.prototype.applySize = function (deltaSize, previousSize) {
|
|
@@ -10945,7 +11038,7 @@
|
|
|
10945
11038
|
}
|
|
10946
11039
|
: {
|
|
10947
11040
|
height: OVERLAY_INIT_SIZE + 'px',
|
|
10948
|
-
panelClass:
|
|
11041
|
+
panelClass: this.rowResizeClass
|
|
10949
11042
|
};
|
|
10950
11043
|
return this.overlay.create(Object.assign({
|
|
10951
11044
|
// Always position the overlay based on left-indexed coordinates.
|
|
@@ -11078,15 +11171,13 @@
|
|
|
11078
11171
|
this.resizingStore.storeTableHeight(rows);
|
|
11079
11172
|
this.resizingStore.initDirection(deltaY, this.isXAxisHover);
|
|
11080
11173
|
var rowIndex = this.elementRef.nativeElement.parentElement.rowIndex - 1; // subtract thead's tr
|
|
11081
|
-
if (this.hoverdDirection ===
|
|
11174
|
+
if (this.hoverdDirection === Position.top) {
|
|
11082
11175
|
rowIndex = rowIndex - 1;
|
|
11083
11176
|
}
|
|
11084
|
-
|
|
11085
|
-
|
|
11086
|
-
rowIndex = rowIndex + cellRowpsan - 1;
|
|
11087
|
-
}
|
|
11177
|
+
var rowSpan = this.elementRef.nativeElement.rowSpan;
|
|
11178
|
+
var bottomRowIndex = rowIndex + (rowSpan - 1) + 1;
|
|
11088
11179
|
if (deltaY > 0) {
|
|
11089
|
-
this.applyBottomRows(rows, deltaY,
|
|
11180
|
+
this.applyBottomRows(rows, deltaY, bottomRowIndex);
|
|
11090
11181
|
if (this.resizingStore.isRestoring(deltaY, this.isXAxisHover)) {
|
|
11091
11182
|
deltaY = this.resizingStore.restoreTopRows(deltaY);
|
|
11092
11183
|
}
|
|
@@ -11753,7 +11844,7 @@
|
|
|
11753
11844
|
return TheVerticalToolbarItemComponent;
|
|
11754
11845
|
}(TheToolbarBaseItemComponent));
|
|
11755
11846
|
TheVerticalToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheVerticalToolbarItemComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$6.ThyPopover }, { token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
11756
|
-
TheVerticalToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheVerticalToolbarItemComponent, selector: "the-toolbar-vertical-align-item", inputs: { item: "item", menus: "menus", editor: "editor", toolbarItem: "toolbarItem" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.hide": "!active" }, classAttribute: "the-toolbar-dropdown-container verticalAlign" }, viewQueries: [{ propertyName: "template", first: true, predicate: ["VerticalAlignItems"], descendants: true, read: i0.TemplateRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<a\n thyIconNavLink\n class=\"icon-mode link-with-down\"\n [thyTooltip]=\"toolbarItem?.name\"\n [thyIconNavLinkActive]=\"isOpened\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n>\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #VerticalAlignItems>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of toolbarItem?.includes\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenu?.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <span *ngIf=\"menu.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu?.icon\"></thy-icon>\n </span>\n <span thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type:
|
|
11847
|
+
TheVerticalToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheVerticalToolbarItemComponent, selector: "the-toolbar-vertical-align-item", inputs: { item: "item", menus: "menus", editor: "editor", toolbarItem: "toolbarItem" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.hide": "!active" }, classAttribute: "the-toolbar-dropdown-container verticalAlign" }, viewQueries: [{ propertyName: "template", first: true, predicate: ["VerticalAlignItems"], descendants: true, read: i0.TemplateRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<a\n thyIconNavLink\n class=\"icon-mode link-with-down\"\n [thyTooltip]=\"toolbarItem?.name\"\n [thyIconNavLinkActive]=\"isOpened\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"execute($event)\"\n>\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #VerticalAlignItems>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of toolbarItem?.includes\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenu?.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <span *ngIf=\"menu.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu?.icon\"></thy-icon>\n </span>\n <span thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3__namespace$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3__namespace.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i2__namespace$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i2__namespace$1.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace$1.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i2__namespace$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
11757
11848
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheVerticalToolbarItemComponent, decorators: [{
|
|
11758
11849
|
type: i0.Component,
|
|
11759
11850
|
args: [{
|
|
@@ -11998,7 +12089,7 @@
|
|
|
11998
12089
|
return TheToolbarItemComponent;
|
|
11999
12090
|
}(TheToolbarBaseItemComponent));
|
|
12000
12091
|
TheToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheToolbarItemComponent, deps: [{ token: i0__namespace.NgZone }, { token: i0__namespace.ComponentFactoryResolver }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12001
|
-
TheToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { editor: "editor", item: "item", itemMode: "itemMode" }, host: { listeners: { "mousedown": "toggleDropdown($event)" }, properties: { "class.disabled": "this.disabledState" }, 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: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type:
|
|
12092
|
+
TheToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { editor: "editor", item: "item", itemMode: "itemMode" }, host: { listeners: { "mousedown": "toggleDropdown($event)" }, properties: { "class.disabled": "this.disabledState" }, 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: i3__namespace$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3__namespace.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
12002
12093
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheToolbarItemComponent, decorators: [{
|
|
12003
12094
|
type: i0.Component,
|
|
12004
12095
|
args: [{
|
|
@@ -12074,7 +12165,7 @@
|
|
|
12074
12165
|
return TheQuickToolbarComponent;
|
|
12075
12166
|
}(core.mixinUnsubscribe(core.MixinBase)));
|
|
12076
12167
|
TheQuickToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheQuickToolbarComponent, deps: [{ token: i1__namespace$3.ThyPopoverRef }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12077
|
-
TheQuickToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheQuickToolbarComponent, selector: "the-quick-toolbar", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems" }, host: { listeners: { "document: mousedown": "handleMouseDown($event)", "document: keydown.enter": "handleEnter()", "document: keydown.escape": "handleEsc()" } }, usesInheritance: true, ngImport: i0__namespace, template: "<thy-selection-list\n class=\"the-quick-toolbar\"\n [thyBindKeyEventContainer]=\"editorElement\"\n (thySelectionChange)=\"selectionChange($event)\"\n [thyMultiple]=\"false\"\n>\n <ng-container *ngFor=\"let item of quickToolbarItems\">\n <ng-container *ngIf=\"item.key !== ToolbarActionTypes.split; else splitLine\">\n <thy-list-option [thyValue]=\"item?.key\" (mousedown)=\"stopPropagation($event)\">\n <the-toolbar-item [editor]=\"editor\" [item]=\"item\" [itemMode]=\"ToolbarItemMode.vertical\"></the-toolbar-item>\n </thy-list-option>\n </ng-container>\n </ng-container>\n</thy-selection-list>\n\n<ng-template #splitLine>\n <nav-split-line [mode]=\"ToolbarItemMode.horizontal\"></nav-split-line>\n</ng-template>\n", components: [{ type: i2__namespace$
|
|
12168
|
+
TheQuickToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheQuickToolbarComponent, selector: "the-quick-toolbar", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems" }, host: { listeners: { "document: mousedown": "handleMouseDown($event)", "document: keydown.enter": "handleEnter()", "document: keydown.escape": "handleEsc()" } }, usesInheritance: true, ngImport: i0__namespace, template: "<thy-selection-list\n class=\"the-quick-toolbar\"\n [thyBindKeyEventContainer]=\"editorElement\"\n (thySelectionChange)=\"selectionChange($event)\"\n [thyMultiple]=\"false\"\n>\n <ng-container *ngFor=\"let item of quickToolbarItems\">\n <ng-container *ngIf=\"item.key !== ToolbarActionTypes.split; else splitLine\">\n <thy-list-option [thyValue]=\"item?.key\" (mousedown)=\"stopPropagation($event)\">\n <the-toolbar-item [editor]=\"editor\" [item]=\"item\" [itemMode]=\"ToolbarItemMode.vertical\"></the-toolbar-item>\n </thy-list-option>\n </ng-container>\n </ng-container>\n</thy-selection-list>\n\n<ng-template #splitLine>\n <nav-split-line [mode]=\"ToolbarItemMode.horizontal\"></nav-split-line>\n</ng-template>\n", components: [{ type: i2__namespace$3.ThySelectionListComponent, selector: "thy-selection-list,[thy-selection-list]", inputs: ["thyMultiple", "thyBindKeyEventContainer", "thyScrollContainer", "thyBeforeKeydown", "thyUniqueKey", "thyCompareWith", "thyLayout", "thyAutoActiveFirstItem", "thySize", "thySpaceKeyEnabled"], outputs: ["thySelectionChange"] }, { type: i5__namespace$2.ThyListOptionComponent, selector: "thy-list-option,[thy-list-option]", inputs: ["id", "thyValue", "thyDisabled"] }, { type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: ["editor", "item", "itemMode"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }], directives: [{ type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
12078
12169
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheQuickToolbarComponent, decorators: [{
|
|
12079
12170
|
type: i0.Component,
|
|
12080
12171
|
args: [{
|
|
@@ -12320,12 +12411,12 @@
|
|
|
12320
12411
|
return TheInlineCodeComponent;
|
|
12321
12412
|
}(TheBaseElementComponent));
|
|
12322
12413
|
TheInlineCodeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheInlineCodeComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12323
|
-
TheInlineCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheInlineCodeComponent, selector: "span[theInlineCode]", usesInheritance: true, ngImport: i0__namespace, template: "<span contenteditable=\"false\"
|
|
12414
|
+
TheInlineCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheInlineCodeComponent, selector: "span[theInlineCode]", usesInheritance: true, ngImport: i0__namespace, template: "<span contenteditable=\"false\" class=\"the-break-char\">{{ inlineChromiumBugfix }}</span>\n <span><slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children></span>\n <span contenteditable=\"false\" class=\"the-break-char\">{{ inlineChromiumBugfix }}</span>", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
|
|
12324
12415
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheInlineCodeComponent, decorators: [{
|
|
12325
12416
|
type: i0.Component,
|
|
12326
12417
|
args: [{
|
|
12327
12418
|
selector: 'span[theInlineCode]',
|
|
12328
|
-
template: "<span contenteditable=\"false\"
|
|
12419
|
+
template: "<span contenteditable=\"false\" class=\"the-break-char\">{{ inlineChromiumBugfix }}</span>\n <span><slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children></span>\n <span contenteditable=\"false\" class=\"the-break-char\">{{ inlineChromiumBugfix }}</span>"
|
|
12329
12420
|
}]
|
|
12330
12421
|
}] });
|
|
12331
12422
|
|
|
@@ -12453,7 +12544,7 @@
|
|
|
12453
12544
|
return TheIndentToolbarComponent;
|
|
12454
12545
|
}(TheToolbarBaseItemComponent));
|
|
12455
12546
|
TheIndentToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheIndentToolbarComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$3.ThyPopover }, { token: i0__namespace.ViewContainerRef }, { token: i2__namespace.Overlay }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12456
|
-
TheIndentToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheIndentToolbarComponent, selector: "the-indent-toolbar-item", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.disabled": "this.disabledState" }, classAttribute: "the-toolbar-dropdown-container" }, viewQueries: [{ propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown-menu\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyTooltip]=\"tooltip\"\n [thyTooltipTemplateContext]=\"{ name: menu.name, shortcutKey: menu.shortcutKey }\"\n thyTooltipPlacement=\"right\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <span thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu.icon\"></thy-icon>\n </span>\n <span thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n\n<ng-template #tooltip let-data>{{ data?.shortcutKey }}</ng-template>\n", components: [{ type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type:
|
|
12547
|
+
TheIndentToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheIndentToolbarComponent, selector: "the-indent-toolbar-item", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.disabled": "this.disabledState" }, classAttribute: "the-toolbar-dropdown-container" }, viewQueries: [{ propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown-menu\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyTooltip]=\"tooltip\"\n [thyTooltipTemplateContext]=\"{ name: menu.name, shortcutKey: menu.shortcutKey }\"\n thyTooltipPlacement=\"right\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <span thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu.icon\"></thy-icon>\n </span>\n <span thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n\n<ng-template #tooltip let-data>{{ data?.shortcutKey }}</ng-template>\n", components: [{ type: i3__namespace$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3__namespace.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i2__namespace$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i2__namespace$1.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i2__namespace$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
12457
12548
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheIndentToolbarComponent, decorators: [{
|
|
12458
12549
|
type: i0.Component,
|
|
12459
12550
|
args: [{
|
|
@@ -12682,7 +12773,7 @@
|
|
|
12682
12773
|
}),
|
|
12683
12774
|
withBlockquote,
|
|
12684
12775
|
withNodeID({ idKey: ELEMENT_UNIQUE_ID, idCreator: idCreator }),
|
|
12685
|
-
withAutoFormat(
|
|
12776
|
+
withAutoFormat(),
|
|
12686
12777
|
withTransforms(),
|
|
12687
12778
|
withTrailingNode({ type: exports.ElementKinds.paragraph, level: 0 }),
|
|
12688
12779
|
withMoveSelection,
|
|
@@ -13105,7 +13196,7 @@
|
|
|
13105
13196
|
return TheToolbarComponent;
|
|
13106
13197
|
}());
|
|
13107
13198
|
TheToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheToolbarComponent, deps: [{ token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.ElementRef }, { token: i0__namespace.NgZone }, { token: TheToolbarGroupToken }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
13108
|
-
TheToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarComponent, selector: "the-toolbar", inputs: { editor: "editor", toolbarItems: "toolbarItems", align: "align", containerClass: "containerClass", isMore: "isMore", afterTemplate: "afterTemplate" }, host: { classAttribute: "the-toolbar-container" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: i0.ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<thy-icon-nav [style.justifyContent]=\"align\">\n <ng-container #toolbarContainer></ng-container>\n <ng-content></ng-content>\n <ng-template *ngIf=\"afterTemplate\" [ngTemplateOutlet]=\"afterTemplate\"></ng-template>\n</thy-icon-nav>\n", components: [{ type: i3__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }], directives: [{ type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
13199
|
+
TheToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarComponent, selector: "the-toolbar", inputs: { editor: "editor", toolbarItems: "toolbarItems", align: "align", containerClass: "containerClass", isMore: "isMore", afterTemplate: "afterTemplate" }, host: { classAttribute: "the-toolbar-container" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: i0.ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<thy-icon-nav [style.justifyContent]=\"align\">\n <ng-container #toolbarContainer></ng-container>\n <ng-content></ng-content>\n <ng-template *ngIf=\"afterTemplate\" [ngTemplateOutlet]=\"afterTemplate\"></ng-template>\n</thy-icon-nav>\n", components: [{ type: i3__namespace$1.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }], directives: [{ type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
13109
13200
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheToolbarComponent, decorators: [{
|
|
13110
13201
|
type: i0.Component,
|
|
13111
13202
|
args: [{
|
|
@@ -13331,7 +13422,7 @@
|
|
|
13331
13422
|
return TheQuickInsertComponent;
|
|
13332
13423
|
}());
|
|
13333
13424
|
TheQuickInsertComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheQuickInsertComponent, deps: [{ token: i0__namespace.Renderer2 }, { token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
13334
|
-
TheQuickInsertComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems", isVisible: "isVisible" }, host: { listeners: { "mousedown": "handleMousedownNativeElement($event)" }, properties: { "class.hide": "isHide" }, classAttribute: "the-quick-insert" }, viewQueries: [{ propertyName: "iconElement", first: true, predicate: ["iconElement"], descendants: true, read: i0.ElementRef }], ngImport: i0__namespace, template: "<thy-icon\n #iconElement\n [thyIconName]=\"displayIconName\"\n class=\"quick-insert-icon text-desc font-size-xlg\"\n (mouseenter)=\"mouseEnter($event)\"\n (mouseleave)=\"mouseLeave($event)\"\n (mousedown)=\"handleClick($event)\"\n></thy-icon>\n", components: [{ type:
|
|
13425
|
+
TheQuickInsertComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems", isVisible: "isVisible" }, host: { listeners: { "mousedown": "handleMousedownNativeElement($event)" }, properties: { "class.hide": "isHide" }, classAttribute: "the-quick-insert" }, viewQueries: [{ propertyName: "iconElement", first: true, predicate: ["iconElement"], descendants: true, read: i0.ElementRef }], ngImport: i0__namespace, template: "<thy-icon\n #iconElement\n [thyIconName]=\"displayIconName\"\n class=\"quick-insert-icon text-desc font-size-xlg\"\n (mouseenter)=\"mouseEnter($event)\"\n (mouseleave)=\"mouseLeave($event)\"\n (mousedown)=\"handleClick($event)\"\n></thy-icon>\n", components: [{ type: i3__namespace.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }] });
|
|
13335
13426
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheQuickInsertComponent, decorators: [{
|
|
13336
13427
|
type: i0.Component,
|
|
13337
13428
|
args: [{
|
|
@@ -13623,11 +13714,12 @@
|
|
|
13623
13714
|
};
|
|
13624
13715
|
TheEditorComponent.prototype.initialize = function () {
|
|
13625
13716
|
var _this = this;
|
|
13626
|
-
var _a, _b;
|
|
13717
|
+
var _a, _b, _c;
|
|
13627
13718
|
this.editor = withTheEditor(this.thePlugins, slateHistory.withHistory(i1.withAngular(slate.createEditor(), CLIPBOARD_FORMAT_KEY)));
|
|
13628
13719
|
this.generateDecorate();
|
|
13629
13720
|
this.editor.disabled = (_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.disabled;
|
|
13630
13721
|
this.editor.extraElementOptions = (_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.extraElementOptions;
|
|
13722
|
+
this.editor.extraAutoFormatRules = (_c = this.theOptions) === null || _c === void 0 ? void 0 : _c.extraAutoFormatRules;
|
|
13631
13723
|
setEditorUUID(this.editor, idCreator());
|
|
13632
13724
|
this.theContextService.initialize({
|
|
13633
13725
|
theOptions: this.theOptions,
|
|
@@ -13838,11 +13930,11 @@
|
|
|
13838
13930
|
TheContextService,
|
|
13839
13931
|
TheColorSelectService,
|
|
13840
13932
|
{
|
|
13841
|
-
provide: i4
|
|
13933
|
+
provide: i4.NG_VALUE_ACCESSOR,
|
|
13842
13934
|
useExisting: i0.forwardRef(function () { return TheEditorComponent; }),
|
|
13843
13935
|
multi: true
|
|
13844
13936
|
}
|
|
13845
|
-
], 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 }], 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 [placeholder]=\"theOptions?.placeholder\"\n [placeholderDecorate]=\"theOptions?.placeholderDecorate ? theOptions?.placeholderDecorate : null\"\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\n *ngIf=\"!theOptions?.readonly && theOptions?.inlineToobarVisible\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.inline\"\n ></the-inline-toolbar>\n <div\n #quickInsert\n theQuickInsert\n [editor]=\"editor\"\n [quickToolbarItems]=\"quickToolbarItems\"\n [isVisible]=\"theOptions?.quickInsertVisible\"\n ></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", "placeholderDecorate", "isStrictDecorate", "trackBy", "readonly", "placeholder", "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", "isVisible"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4__namespace
|
|
13937
|
+
], 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 }], 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 [placeholder]=\"theOptions?.placeholder\"\n [placeholderDecorate]=\"theOptions?.placeholderDecorate ? theOptions?.placeholderDecorate : null\"\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\n *ngIf=\"!theOptions?.readonly && theOptions?.inlineToobarVisible\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.inline\"\n ></the-inline-toolbar>\n <div\n #quickInsert\n theQuickInsert\n [editor]=\"editor\"\n [quickToolbarItems]=\"quickToolbarItems\"\n [isVisible]=\"theOptions?.quickInsertVisible\"\n ></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", "placeholderDecorate", "isStrictDecorate", "trackBy", "readonly", "placeholder", "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", "isVisible"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
13846
13938
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheEditorComponent, decorators: [{
|
|
13847
13939
|
type: i0.Component,
|
|
13848
13940
|
args: [{
|
|
@@ -13854,7 +13946,7 @@
|
|
|
13854
13946
|
TheContextService,
|
|
13855
13947
|
TheColorSelectService,
|
|
13856
13948
|
{
|
|
13857
|
-
provide: i4
|
|
13949
|
+
provide: i4.NG_VALUE_ACCESSOR,
|
|
13858
13950
|
useExisting: i0.forwardRef(function () { return TheEditorComponent; }),
|
|
13859
13951
|
multi: true
|
|
13860
13952
|
}
|
|
@@ -14021,7 +14113,7 @@
|
|
|
14021
14113
|
return TheToolbarGroupComponent;
|
|
14022
14114
|
}());
|
|
14023
14115
|
TheToolbarGroupComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheToolbarGroupComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$3.ThyPopover }, { token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
14024
|
-
TheToolbarGroupComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarGroupComponent, selector: "the-toolbar-group", inputs: { menus: "menus", item: "item" }, host: { listeners: { "mousedown": "mousedownHandler($event)", "click": "clickHandle($event)" }, classAttribute: "the-toolbar-group" }, viewQueries: [{ propertyName: "groupTemplate", first: true, predicate: ["groupTemplate"], descendants: true, read: i0.TemplateRef, static: true }], ngImport: i0__namespace, template: "<a thyIconNavLink [thyIconNavLinkIcon]=\"item.icon\" [thyTooltip]=\"item?.name\" thyTooltipPlacement=\"top\" [thyIconNavLinkActive]=\"active\"></a>\n\n<ng-template #groupTemplate>\n <the-toolbar class=\"group\" [editor]=\"editor\" [toolbarItems]=\"menus\" [isMore]=\"false\"></the-toolbar>\n</ng-template>\n", components: [{ type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], directives: [{ type: i5__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
14116
|
+
TheToolbarGroupComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarGroupComponent, selector: "the-toolbar-group", inputs: { menus: "menus", item: "item" }, host: { listeners: { "mousedown": "mousedownHandler($event)", "click": "clickHandle($event)" }, classAttribute: "the-toolbar-group" }, viewQueries: [{ propertyName: "groupTemplate", first: true, predicate: ["groupTemplate"], descendants: true, read: i0.TemplateRef, static: true }], ngImport: i0__namespace, template: "<a thyIconNavLink [thyIconNavLinkIcon]=\"item.icon\" [thyTooltip]=\"item?.name\" thyTooltipPlacement=\"top\" [thyIconNavLinkActive]=\"active\"></a>\n\n<ng-template #groupTemplate>\n <the-toolbar class=\"group\" [editor]=\"editor\" [toolbarItems]=\"menus\" [isMore]=\"false\"></the-toolbar>\n</ng-template>\n", components: [{ type: i3__namespace$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], directives: [{ type: i5__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
14025
14117
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheToolbarGroupComponent, decorators: [{
|
|
14026
14118
|
type: i0.Component,
|
|
14027
14119
|
args: [{
|
|
@@ -14047,16 +14139,16 @@
|
|
|
14047
14139
|
}] } });
|
|
14048
14140
|
|
|
14049
14141
|
var TETHYS = [
|
|
14050
|
-
|
|
14142
|
+
i3.ThyIconModule,
|
|
14051
14143
|
avatar.ThyAvatarModule,
|
|
14052
|
-
i3.ThyNavModule,
|
|
14053
|
-
i2$
|
|
14054
|
-
i5$
|
|
14055
|
-
i2$
|
|
14144
|
+
i3$1.ThyNavModule,
|
|
14145
|
+
i2$2.ThyFormModule,
|
|
14146
|
+
i5$2.ThySharedModule,
|
|
14147
|
+
i2$3.ThyListModule,
|
|
14056
14148
|
i5.ThyTooltipModule,
|
|
14057
14149
|
i6.ThyProgressModule,
|
|
14058
14150
|
autocomplete.ThyAutocompleteModule,
|
|
14059
|
-
|
|
14151
|
+
i2$1.ThyActionMenuModule,
|
|
14060
14152
|
i5$1.ThyInputModule,
|
|
14061
14153
|
select.ThySelectModule,
|
|
14062
14154
|
i1$5.ThyButtonModule,
|
|
@@ -14084,7 +14176,8 @@
|
|
|
14084
14176
|
TheTableToolbarItemComponent,
|
|
14085
14177
|
TheConversionHintComponent,
|
|
14086
14178
|
TheVerticalToolbarItemComponent,
|
|
14087
|
-
TheIndentToolbarComponent
|
|
14179
|
+
TheIndentToolbarComponent,
|
|
14180
|
+
TheTableOptionsComponent
|
|
14088
14181
|
];
|
|
14089
14182
|
var PLUGIN_COMPONENTS = [
|
|
14090
14183
|
TheImageComponent,
|
|
@@ -14097,7 +14190,6 @@
|
|
|
14097
14190
|
TheNumberedListComponent,
|
|
14098
14191
|
TheCodeComponent,
|
|
14099
14192
|
TheLinkComponent,
|
|
14100
|
-
TheReadonlyLinkComponent,
|
|
14101
14193
|
TheLinkEditComponent,
|
|
14102
14194
|
TheLinkHoverComponent,
|
|
14103
14195
|
TheTableToolbarComponent,
|
|
@@ -14131,7 +14223,8 @@
|
|
|
14131
14223
|
TheTableToolbarItemComponent,
|
|
14132
14224
|
TheConversionHintComponent,
|
|
14133
14225
|
TheVerticalToolbarItemComponent,
|
|
14134
|
-
TheIndentToolbarComponent,
|
|
14226
|
+
TheIndentToolbarComponent,
|
|
14227
|
+
TheTableOptionsComponent, TheImageComponent,
|
|
14135
14228
|
TheTemplateComponent,
|
|
14136
14229
|
TheHrComponent,
|
|
14137
14230
|
TheBlockquoteComponent,
|
|
@@ -14141,23 +14234,22 @@
|
|
|
14141
14234
|
TheNumberedListComponent,
|
|
14142
14235
|
TheCodeComponent,
|
|
14143
14236
|
TheLinkComponent,
|
|
14144
|
-
TheReadonlyLinkComponent,
|
|
14145
14237
|
TheLinkEditComponent,
|
|
14146
14238
|
TheLinkHoverComponent,
|
|
14147
14239
|
TheTableToolbarComponent,
|
|
14148
14240
|
TheTableComponent,
|
|
14149
14241
|
TheTableRowComponent,
|
|
14150
14242
|
TheTdComponent,
|
|
14151
|
-
TheInlineCodeComponent], imports: [i10.CommonModule, i1.SlateModule, i4
|
|
14243
|
+
TheInlineCodeComponent], imports: [i10.CommonModule, i1.SlateModule, i4.FormsModule, i3.ThyIconModule,
|
|
14152
14244
|
avatar.ThyAvatarModule,
|
|
14153
|
-
i3.ThyNavModule,
|
|
14154
|
-
i2$
|
|
14155
|
-
i5$
|
|
14156
|
-
i2$
|
|
14245
|
+
i3$1.ThyNavModule,
|
|
14246
|
+
i2$2.ThyFormModule,
|
|
14247
|
+
i5$2.ThySharedModule,
|
|
14248
|
+
i2$3.ThyListModule,
|
|
14157
14249
|
i5.ThyTooltipModule,
|
|
14158
14250
|
i6.ThyProgressModule,
|
|
14159
14251
|
autocomplete.ThyAutocompleteModule,
|
|
14160
|
-
|
|
14252
|
+
i2$1.ThyActionMenuModule,
|
|
14161
14253
|
i5$1.ThyInputModule,
|
|
14162
14254
|
select.ThySelectModule,
|
|
14163
14255
|
i1$5.ThyButtonModule,
|
|
@@ -14171,12 +14263,12 @@
|
|
|
14171
14263
|
useValue: TheToolbarGroupComponent
|
|
14172
14264
|
},
|
|
14173
14265
|
THE_CODE_MODE_PROVIDER
|
|
14174
|
-
], imports: [__spreadArray(__spreadArray([i10.CommonModule, i1.SlateModule, i4
|
|
14266
|
+
], imports: [__spreadArray(__spreadArray([i10.CommonModule, i1.SlateModule, i4.FormsModule], __read(TETHYS)), [i8.CodemirrorModule, TheColumnSizeModule])] });
|
|
14175
14267
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheEditorModule, decorators: [{
|
|
14176
14268
|
type: i0.NgModule,
|
|
14177
14269
|
args: [{
|
|
14178
14270
|
declarations: __spreadArray(__spreadArray(__spreadArray([TheEditorComponent], __read(PIPES)), __read(COMPONENTS)), __read(PLUGIN_COMPONENTS)),
|
|
14179
|
-
imports: __spreadArray(__spreadArray([i10.CommonModule, i1.SlateModule, i4
|
|
14271
|
+
imports: __spreadArray(__spreadArray([i10.CommonModule, i1.SlateModule, i4.FormsModule], __read(TETHYS)), [i8.CodemirrorModule, TheColumnSizeModule]),
|
|
14180
14272
|
exports: [TheEditorComponent, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarItemComponent, TheDefaultElementComponent],
|
|
14181
14273
|
entryComponents: __spreadArray(__spreadArray([], __read(COMPONENTS)), __read(PLUGIN_COMPONENTS)),
|
|
14182
14274
|
providers: [
|
|
@@ -14271,8 +14363,6 @@
|
|
|
14271
14363
|
exports.createEmptyParagraph = createEmptyParagraph;
|
|
14272
14364
|
exports.dataDeserialize = dataDeserialize;
|
|
14273
14365
|
exports.dataSerializing = dataSerializing;
|
|
14274
|
-
exports.findNodeEntryByPoint = findNodeEntryByPoint;
|
|
14275
|
-
exports.findRelativeElementByPoint = findRelativeElementByPoint;
|
|
14276
14366
|
exports.getColsTotalWidth = getColsTotalWidth;
|
|
14277
14367
|
exports.getElementClassByPrefix = getElementClassByPrefix;
|
|
14278
14368
|
exports.getElementHeight = getElementHeight;
|