@worktile/theia 1.2.8 → 1.2.12
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 +793 -158
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/components/column-resize/column-resize.directive.d.ts +3 -3
- package/components/inline-toolbar/inline-toolbar.component.d.ts +24 -0
- package/components/inline-toolbar/inline-toolbar.component.scss +19 -0
- package/components/nav-split-line/nav-split-line.component.d.ts +6 -1
- package/components/toolbar/toolbar.component.d.ts +2 -1
- package/components/toolbar-dropdown/toolbar-dropdown.component.scss +3 -0
- package/components/toolbar-item/toolbar-item.component.d.ts +14 -5
- package/constants/node-types.d.ts +0 -1
- package/constants/toolbar.d.ts +6 -2
- package/custom-types.d.ts +3 -0
- package/editor.component.d.ts +7 -4
- package/editor.module.d.ts +59 -52
- package/esm2015/components/color-select/color-select.component.js +3 -2
- package/esm2015/components/column-resize/column-resize.directive.js +1 -1
- package/esm2015/components/inline-toolbar/inline-toolbar.component.js +136 -0
- package/esm2015/components/nav-split-line/nav-split-line.component.js +26 -5
- package/esm2015/components/toolbar/toolbar.component.js +7 -6
- package/esm2015/components/toolbar-base-item/toolbar-base-item.component.js +3 -2
- package/esm2015/components/toolbar-group/toolbar-group.component.js +1 -1
- package/esm2015/components/toolbar-item/toolbar-item.component.js +70 -24
- package/esm2015/constants/node-types.js +1 -2
- package/esm2015/constants/toolbar.js +37 -5
- package/esm2015/custom-types.js +1 -1
- package/esm2015/editor.component.js +23 -15
- package/esm2015/editor.module.js +15 -6
- package/esm2015/interfaces/toolbar.js +1 -1
- package/esm2015/plugins/deserializers/deserialize-html.plugin.js +12 -3
- package/esm2015/plugins/deserializers/deserialize-md.plugin.js +2 -2
- package/esm2015/plugins/image/image.plugin.js +1 -2
- package/esm2015/plugins/index.js +8 -4
- package/esm2015/plugins/link/link.plugin.js +7 -2
- package/esm2015/plugins/list/list.plugin.js +7 -7
- package/esm2015/plugins/list/queries/get-start-list-item.js +9 -2
- package/esm2015/plugins/list/queries/is-selection-in-same-list-item.js +17 -0
- package/esm2015/plugins/paint-format/options.js +54 -0
- package/esm2015/plugins/paint-format/paint-format.editor.js +67 -0
- package/esm2015/plugins/placeholder/placeholder.component.js +76 -0
- package/esm2015/plugins/public-api.js +2 -1
- package/esm2015/plugins/quick-insert/components/quick-insert.component.js +76 -0
- package/esm2015/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.js +75 -0
- package/esm2015/plugins/quick-insert/quick-insert.editor.js +61 -0
- package/esm2015/plugins/quick-insert/quick-insert.plugint.js +38 -0
- package/esm2015/plugins/table/components/row/row.component.js +3 -1
- package/esm2015/plugins/table/components/table.component.js +6 -3
- package/esm2015/plugins/table/components/td/td.component.js +2 -1
- package/esm2015/plugins/table/components/toolbar/table-toolbar.component.js +1 -1
- package/esm2015/plugins/table/table.types.js +1 -1
- package/esm2015/plugins/vertical-align/toolbar-item.component.js +11 -6
- package/esm2015/public-api.js +2 -1
- package/esm2015/queries/is-container-type.js +2 -2
- package/esm2015/services/context.service.js +2 -2
- package/esm2015/services/toolbar.service.js +5 -5
- package/esm2015/transforms/index.js +2 -3
- package/esm2015/utils/auto-focus.js +2 -2
- package/esm2015/utils/fragment.js +20 -1
- package/esm2015/utils/is-clean-empty-paragraph.js +32 -0
- package/esm2015/utils/weak-maps.js +2 -1
- package/fesm2015/worktile-theia.js +778 -164
- package/fesm2015/worktile-theia.js.map +1 -1
- package/interfaces/toolbar.d.ts +3 -2
- package/package.json +1 -1
- package/plugins/list/queries/get-start-list-item.d.ts +8 -2
- package/plugins/list/queries/is-selection-in-same-list-item.d.ts +5 -0
- package/plugins/paint-format/options.d.ts +2 -0
- package/plugins/paint-format/paint-format.editor.d.ts +7 -0
- package/{components → plugins}/placeholder/placeholder.component.d.ts +5 -6
- package/{components → plugins}/placeholder/placeholder.component.scss +0 -0
- package/plugins/public-api.d.ts +1 -0
- package/plugins/quick-insert/components/quick-insert.component.d.ts +25 -0
- package/plugins/quick-insert/components/quick-insert.component.scss +21 -0
- package/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.d.ts +29 -0
- package/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.scss +21 -0
- package/plugins/quick-insert/quick-insert.editor.d.ts +8 -0
- package/plugins/quick-insert/quick-insert.plugint.d.ts +2 -0
- package/plugins/table/components/table.component.d.ts +1 -0
- package/plugins/table/table.types.d.ts +7 -0
- package/plugins/vertical-align/toolbar-item.component.d.ts +1 -0
- package/public-api.d.ts +1 -0
- package/services/toolbar.service.d.ts +1 -1
- package/styles/editor.scss +41 -15
- package/styles/index.scss +5 -2
- package/transforms/index.d.ts +1 -2
- package/utils/fragment.d.ts +5 -0
- package/utils/is-clean-empty-paragraph.d.ts +8 -0
- package/utils/weak-maps.d.ts +1 -0
- package/esm2015/components/placeholder/placeholder.component.js +0 -88
- package/esm2015/transforms/insert-elements.js +0 -22
- package/transforms/insert-elements.d.ts +0 -2
|
@@ -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('lodash'), require('marked'), require('@atinc/selene'), require('ngx-tethys/popover'), require('@angular/cdk/overlay'), require('ngx-tethys/alert'), require('rxjs/operators'), require('ngx-tethys/uploader'), require('@angular/platform-browser'), require('rxjs'), require('ngx-tethys/progress'), require('ngx-tethys/icon'), require('ngx-tethys/input'), require('ngx-tethys/nav'), require('ngx-tethys/tooltip'), require('ng-codemirror'), require('ngx-tethys/notify'), require('ngx-tethys/action-menu'), 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/
|
|
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', 'lodash', 'marked', '@atinc/selene', 'ngx-tethys/popover', '@angular/cdk/overlay', 'ngx-tethys/alert', 'rxjs/operators', 'ngx-tethys/uploader', '@angular/platform-browser', 'rxjs', 'ngx-tethys/progress', 'ngx-tethys/icon', 'ngx-tethys/input', 'ngx-tethys/nav', 'ngx-tethys/tooltip', 'ng-codemirror', 'ngx-tethys/notify', 'ngx-tethys/action-menu', 'is-url', 'ngx-tethys/button', 'ngx-tethys/form', 'ngx-tethys/shared', 'ngx-tethys', '@angular/cdk/coercion', '@angular/cdk/portal', 'ngx-tethys/
|
|
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._lodash, global.marked, global.selene, global.i1$2, global.ng.cdk.overlay, global.i1$1, global.rxjs.operators, global.uploader, global.ng.platformBrowser, global.rxjs, global.i4, global.i4$1, global.i5, global.i2$1, global.i7, global.i5$2, global.i1$4, global.i5$1, global.isUrl, global.i1$5, global.i2$2, global.i5$3, global.i1$6, global.ng.cdk.coercion, global.ng.cdk.portal, global.
|
|
5
|
-
})(this, (function (exports, i0, i6, i4$2, i1, core, isHotkey, slate, slateHistory, _lodash, marked, selene, i1$2, i2, i1$1, operators, uploader, i1$3, rxjs, i4, i4$1, i5, i2$1, i7, i5$2, i1$4, i5$1, isUrl, i1$5, i2$2, i5$3, i1$6, coercion, portal, autocomplete, avatar,
|
|
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('lodash'), require('marked'), require('@atinc/selene'), require('ngx-tethys/popover'), require('@angular/cdk/overlay'), require('ngx-tethys/alert'), require('rxjs/operators'), require('ngx-tethys/uploader'), require('@angular/platform-browser'), require('rxjs'), require('ngx-tethys/progress'), require('ngx-tethys/icon'), require('ngx-tethys/input'), require('ngx-tethys/nav'), require('ngx-tethys/tooltip'), require('ng-codemirror'), require('ngx-tethys/notify'), require('ngx-tethys/action-menu'), 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', 'lodash', 'marked', '@atinc/selene', 'ngx-tethys/popover', '@angular/cdk/overlay', 'ngx-tethys/alert', 'rxjs/operators', 'ngx-tethys/uploader', '@angular/platform-browser', 'rxjs', 'ngx-tethys/progress', 'ngx-tethys/icon', 'ngx-tethys/input', 'ngx-tethys/nav', 'ngx-tethys/tooltip', 'ng-codemirror', 'ngx-tethys/notify', 'ngx-tethys/action-menu', '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._lodash, global.marked, global.selene, global.i1$2, global.ng.cdk.overlay, global.i1$1, global.rxjs.operators, global.uploader, global.ng.platformBrowser, global.rxjs, global.i4, global.i4$1, global.i5, global.i2$1, global.i7, global.i5$2, global.i1$4, global.i5$1, global.isUrl, global.i1$5, global.i2$2, global.i5$3, 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, i6, i4$2, i1, core, isHotkey, slate, slateHistory, _lodash, marked, selene, i1$2, i2, i1$1, operators, uploader, i1$3, rxjs, i4, i4$1, i5, i2$1, i7, i5$2, i1$4, i5$1, isUrl, i1$5, i2$2, i5$3, 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
|
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
var i2__namespace$2 = /*#__PURE__*/_interopNamespace(i2$2);
|
|
49
49
|
var i5__namespace$3 = /*#__PURE__*/_interopNamespace(i5$3);
|
|
50
50
|
var i1__namespace$6 = /*#__PURE__*/_interopNamespace(i1$6);
|
|
51
|
+
var i2__namespace$3 = /*#__PURE__*/_interopNamespace(i2$3);
|
|
51
52
|
|
|
52
53
|
/*! *****************************************************************************
|
|
53
54
|
Copyright (c) Microsoft Corporation.
|
|
@@ -433,7 +434,6 @@
|
|
|
433
434
|
exports.ToolbarActionTypes = void 0;
|
|
434
435
|
(function (ToolbarActionTypes) {
|
|
435
436
|
ToolbarActionTypes["split"] = "split";
|
|
436
|
-
ToolbarActionTypes["save"] = "save";
|
|
437
437
|
ToolbarActionTypes["undo"] = "undo";
|
|
438
438
|
ToolbarActionTypes["redo"] = "redo";
|
|
439
439
|
ToolbarActionTypes["paintformat"] = "paintformat";
|
|
@@ -475,12 +475,17 @@
|
|
|
475
475
|
var BLOCK_DELETEBACKWARD_TYPES = [exports.ElementKinds.tableCell];
|
|
476
476
|
|
|
477
477
|
var TheToolbarGroupToken = new i0.InjectionToken('the-toolbar-group-token');
|
|
478
|
-
var
|
|
478
|
+
var QUICK_TOOLBAR_HOTKEY = '/';
|
|
479
479
|
exports.DropdownMode = void 0;
|
|
480
480
|
(function (DropdownMode) {
|
|
481
481
|
DropdownMode["icon"] = "icon-mode";
|
|
482
482
|
DropdownMode["text"] = "text-mode";
|
|
483
483
|
})(exports.DropdownMode || (exports.DropdownMode = {}));
|
|
484
|
+
exports.ToolbarItemMode = void 0;
|
|
485
|
+
(function (ToolbarItemMode) {
|
|
486
|
+
ToolbarItemMode[ToolbarItemMode["horizontal"] = 0] = "horizontal";
|
|
487
|
+
ToolbarItemMode[ToolbarItemMode["vertical"] = 1] = "vertical";
|
|
488
|
+
})(exports.ToolbarItemMode || (exports.ToolbarItemMode = {}));
|
|
484
489
|
var DefaultGlobalToolbarDefinition = [
|
|
485
490
|
exports.ElementKinds.headingList,
|
|
486
491
|
exports.ToolbarActionTypes.split,
|
|
@@ -505,8 +510,34 @@
|
|
|
505
510
|
exports.ElementKinds.blockquote,
|
|
506
511
|
exports.ElementKinds.code
|
|
507
512
|
];
|
|
508
|
-
var DefaultInlineToolbarDefinition = [
|
|
509
|
-
|
|
513
|
+
var DefaultInlineToolbarDefinition = [
|
|
514
|
+
exports.ToolbarActionTypes.clean,
|
|
515
|
+
exports.ToolbarActionTypes.split,
|
|
516
|
+
exports.MarkTypes.bold,
|
|
517
|
+
exports.MarkTypes.italic,
|
|
518
|
+
exports.MarkTypes.underline,
|
|
519
|
+
exports.MarkTypes.strike,
|
|
520
|
+
exports.MarkTypes.codeLine,
|
|
521
|
+
exports.MarkTypes.color,
|
|
522
|
+
exports.MarkTypes.backgroundColor,
|
|
523
|
+
exports.ToolbarActionTypes.split,
|
|
524
|
+
exports.ToolbarActionTypes.alignType,
|
|
525
|
+
exports.ToolbarActionTypes.split,
|
|
526
|
+
exports.ElementKinds.link
|
|
527
|
+
];
|
|
528
|
+
var DefaultQuickToolbarDefinition = __spreadArray(__spreadArray([], __read(STANDARD_HEADING_TYPES)), [
|
|
529
|
+
exports.ToolbarActionTypes.split,
|
|
530
|
+
exports.ElementKinds.numberedList,
|
|
531
|
+
exports.ElementKinds.bulletedList,
|
|
532
|
+
exports.ElementKinds.checkItem,
|
|
533
|
+
exports.ToolbarActionTypes.split,
|
|
534
|
+
exports.ElementKinds.link,
|
|
535
|
+
exports.ElementKinds.image,
|
|
536
|
+
exports.ElementKinds.table,
|
|
537
|
+
exports.ElementKinds.blockquote,
|
|
538
|
+
exports.ElementKinds.hr,
|
|
539
|
+
exports.ElementKinds.code
|
|
540
|
+
]);
|
|
510
541
|
var ToolbarMoreGroup = {
|
|
511
542
|
key: 'more',
|
|
512
543
|
icon: 'more'
|
|
@@ -1409,6 +1440,25 @@
|
|
|
1409
1440
|
});
|
|
1410
1441
|
return nodes;
|
|
1411
1442
|
}
|
|
1443
|
+
/**
|
|
1444
|
+
* 删除 text 节点的 颜色/背景色
|
|
1445
|
+
* @param node
|
|
1446
|
+
*/
|
|
1447
|
+
function deleteColorAndBackgroundColorOfText(node) {
|
|
1448
|
+
node.children.forEach(function (child) {
|
|
1449
|
+
if (slate.Text.isText(child)) {
|
|
1450
|
+
if (child['color']) {
|
|
1451
|
+
delete child['color'];
|
|
1452
|
+
}
|
|
1453
|
+
if (child['background-color']) {
|
|
1454
|
+
delete child['background-color'];
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
else {
|
|
1458
|
+
deleteColorAndBackgroundColorOfText(child);
|
|
1459
|
+
}
|
|
1460
|
+
});
|
|
1461
|
+
}
|
|
1412
1462
|
|
|
1413
1463
|
var isAcrossBlocks = function (editor, fragment) {
|
|
1414
1464
|
var startBlock = getStartBlock(editor, fragment[0]);
|
|
@@ -1538,7 +1588,7 @@
|
|
|
1538
1588
|
return marks;
|
|
1539
1589
|
};
|
|
1540
1590
|
|
|
1541
|
-
var isContainer = function (editor, value) { return slate.Element.isElement(value) && editor.isContainer(value); };
|
|
1591
|
+
var isContainer = function (editor, value) { return slate.Element.isElement(value) && editor.isContainer && editor.isContainer(value); };
|
|
1542
1592
|
|
|
1543
1593
|
var getContainerBlocks = function (editor) {
|
|
1544
1594
|
var containerNode = slate.Editor.above(editor, {
|
|
@@ -1814,28 +1864,9 @@
|
|
|
1814
1864
|
i1.AngularEditor.focus(editor);
|
|
1815
1865
|
};
|
|
1816
1866
|
|
|
1817
|
-
var insertTheElements = function (editor, nodes) {
|
|
1818
|
-
if (slate.Range.isExpanded(editor.selection)) {
|
|
1819
|
-
slate.Editor.deleteFragment(editor);
|
|
1820
|
-
}
|
|
1821
|
-
var isEmptyParagraph$1 = isEmptyParagraph(editor, editor.selection.anchor);
|
|
1822
|
-
var parentPath = slate.Path.parent(editor.selection.anchor.path);
|
|
1823
|
-
slate.Editor.withoutNormalizing(editor, function () {
|
|
1824
|
-
slate.Transforms.insertNodes(editor, nodes);
|
|
1825
|
-
if (parentPath.length && isEmptyParagraph$1) {
|
|
1826
|
-
slate.Transforms.delete(editor, { at: parentPath });
|
|
1827
|
-
var lastPath = parentPath.pop();
|
|
1828
|
-
slate.Transforms.select(editor, slate.Editor.end(editor, __spreadArray(__spreadArray([], __read(parentPath)), [lastPath + nodes.length - 1])));
|
|
1829
|
-
}
|
|
1830
|
-
else {
|
|
1831
|
-
var lastPath = parentPath.pop();
|
|
1832
|
-
slate.Transforms.select(editor, slate.Editor.end(editor, __spreadArray(__spreadArray([], __read(parentPath)), [lastPath + nodes.length])));
|
|
1833
|
-
}
|
|
1834
|
-
});
|
|
1835
|
-
};
|
|
1836
|
-
|
|
1837
1867
|
var THE_EDITOR_UUID = new WeakMap();
|
|
1838
1868
|
var THE_EDITOR_CONVERSION_HINT_REF = new WeakMap();
|
|
1869
|
+
var THE_EDITOR_QUICK_TOOLBAR_REF = new WeakMap();
|
|
1839
1870
|
|
|
1840
1871
|
var closeConversionHint = function (editor) {
|
|
1841
1872
|
var hintRef = THE_EDITOR_CONVERSION_HINT_REF.get(editor);
|
|
@@ -1897,7 +1928,6 @@
|
|
|
1897
1928
|
splitNode: splitNode,
|
|
1898
1929
|
deleteElement: deleteElement,
|
|
1899
1930
|
setEndSelection: setEndSelection,
|
|
1900
|
-
insertTheElements: insertTheElements,
|
|
1901
1931
|
closeConversionHint: closeConversionHint,
|
|
1902
1932
|
handleContinualDeleteBackward: handleContinualDeleteBackward,
|
|
1903
1933
|
handleContinualInsertBreak: handleContinualInsertBreak
|
|
@@ -2380,7 +2410,7 @@
|
|
|
2380
2410
|
editor.undo();
|
|
2381
2411
|
setTimeout(function () {
|
|
2382
2412
|
slate.Transforms.select(editor, oldRange);
|
|
2383
|
-
|
|
2413
|
+
slate.Transforms.insertFragment(editor, fragment_1);
|
|
2384
2414
|
i1.AngularEditor.focus(editor);
|
|
2385
2415
|
});
|
|
2386
2416
|
return;
|
|
@@ -2622,7 +2652,7 @@
|
|
|
2622
2652
|
};
|
|
2623
2653
|
TheContextService.prototype.getOptions = function () {
|
|
2624
2654
|
if (!this.options.width) {
|
|
2625
|
-
this.options.width = this.options.nativeElement.querySelector('.slate-editable-container').offsetWidth
|
|
2655
|
+
this.options.width = this.options.nativeElement.querySelector('.slate-editable-container').firstElementChild.offsetWidth;
|
|
2626
2656
|
}
|
|
2627
2657
|
return this.options;
|
|
2628
2658
|
};
|
|
@@ -2923,7 +2953,6 @@
|
|
|
2923
2953
|
};
|
|
2924
2954
|
editor.insertData = function (data) {
|
|
2925
2955
|
var e_1, _a;
|
|
2926
|
-
// TODO:: 底层有点问题,粘贴多张图片时只能识别一张
|
|
2927
2956
|
if (data.files.length) {
|
|
2928
2957
|
var imageFiles = [];
|
|
2929
2958
|
try {
|
|
@@ -3063,13 +3092,19 @@
|
|
|
3063
3092
|
return [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList];
|
|
3064
3093
|
};
|
|
3065
3094
|
|
|
3095
|
+
/**
|
|
3096
|
+
* 获取 List 中 ListItems,过滤掉空列表嵌套
|
|
3097
|
+
* @param node
|
|
3098
|
+
* @param initialValue
|
|
3099
|
+
* @returns
|
|
3100
|
+
*/
|
|
3066
3101
|
var getStartListItem = function (node, initialValue) {
|
|
3067
3102
|
if (!initialValue) {
|
|
3068
3103
|
initialValue = [];
|
|
3069
3104
|
}
|
|
3070
3105
|
if (node) {
|
|
3071
3106
|
return node.reduce(function (result, current) {
|
|
3072
|
-
if (current.type
|
|
3107
|
+
if ((current.type === exports.ElementKinds.listItem && !getListTypes().includes(current.children[0].type))) {
|
|
3073
3108
|
result.push(current);
|
|
3074
3109
|
}
|
|
3075
3110
|
else {
|
|
@@ -3759,6 +3794,20 @@
|
|
|
3759
3794
|
}]
|
|
3760
3795
|
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }]; } });
|
|
3761
3796
|
|
|
3797
|
+
/**
|
|
3798
|
+
* Is the selection in same li
|
|
3799
|
+
*/
|
|
3800
|
+
var isSelectionInSameListItem = function (editor) {
|
|
3801
|
+
var selection = editor.selection;
|
|
3802
|
+
if (!selection) {
|
|
3803
|
+
return false;
|
|
3804
|
+
}
|
|
3805
|
+
var _a = __read(slate.Range.edges(selection), 2), start = _a[0], end = _a[1];
|
|
3806
|
+
var startListItemEntry = getAboveByType(editor, exports.ElementKinds.listItem, { at: start.path });
|
|
3807
|
+
var endListItemEntry = getAboveByType(editor, exports.ElementKinds.listItem, { at: end.path });
|
|
3808
|
+
return startListItemEntry && endListItemEntry && slate.Path.equals(startListItemEntry[1], endListItemEntry[1]);
|
|
3809
|
+
};
|
|
3810
|
+
|
|
3762
3811
|
var withList = function (_a) {
|
|
3763
3812
|
var _b = _a === void 0 ? {} : _a, validLiChildrenTypes = _b.validLiChildrenTypes;
|
|
3764
3813
|
return function (editor) {
|
|
@@ -3843,15 +3892,14 @@
|
|
|
3843
3892
|
var fragmentElement = fragmentData[0];
|
|
3844
3893
|
if (getListTypes().includes(fragmentElement.type)) {
|
|
3845
3894
|
var startNodes = getStartListItem([fragmentElement.children[0]]);
|
|
3846
|
-
// 复制列表中的图片时startNodes长度为零
|
|
3847
|
-
if (startNodes.length === 0) {
|
|
3848
|
-
setFragmentData(unit);
|
|
3849
|
-
return;
|
|
3850
|
-
}
|
|
3851
3895
|
var children = startNodes.concat(fragmentElement.children.slice(1));
|
|
3852
3896
|
var fragmentNodes = [
|
|
3853
3897
|
Object.assign(Object.assign({}, fragmentElement), { children: children })
|
|
3854
3898
|
];
|
|
3899
|
+
if (isSelectionInSameListItem(editor)) {
|
|
3900
|
+
// 仅仅复制列表中的内容
|
|
3901
|
+
fragmentNodes = children[0].children;
|
|
3902
|
+
}
|
|
3855
3903
|
var fragment = fragmentNodes.concat(fragmentData.slice(1));
|
|
3856
3904
|
var domRange = i1.AngularEditor.toDOMRange(editor, selection);
|
|
3857
3905
|
var contents = domRange.cloneContents();
|
|
@@ -6199,6 +6247,7 @@
|
|
|
6199
6247
|
}
|
|
6200
6248
|
};
|
|
6201
6249
|
TheColorSelectComponent.prototype._selectColor = function (event, color) {
|
|
6250
|
+
event.preventDefault();
|
|
6202
6251
|
event.stopPropagation();
|
|
6203
6252
|
if (this.option.specialColor && color === this.option.specialColor) {
|
|
6204
6253
|
color = '';
|
|
@@ -6230,7 +6279,7 @@
|
|
|
6230
6279
|
return TheColorSelectComponent;
|
|
6231
6280
|
}());
|
|
6232
6281
|
TheColorSelectComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheColorSelectComponent, deps: [{ token: i1__namespace$3.ThyPopoverRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
6233
|
-
TheColorSelectComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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
|
|
6282
|
+
TheColorSelectComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace$2.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.ThyInputDirective, selector: "[thyInput]", inputs: ["thySize", "thyAutocomplete"] }, { type: i4__namespace$2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { type: i4__namespace$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
6234
6283
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheColorSelectComponent, decorators: [{
|
|
6235
6284
|
type: i0.Component,
|
|
6236
6285
|
args: [{
|
|
@@ -6353,9 +6402,10 @@
|
|
|
6353
6402
|
function TheToolbarBaseItemComponent() {
|
|
6354
6403
|
}
|
|
6355
6404
|
TheToolbarBaseItemComponent.prototype.execute = function (event) {
|
|
6405
|
+
var _a;
|
|
6356
6406
|
event.preventDefault();
|
|
6357
6407
|
event.stopPropagation();
|
|
6358
|
-
if (!this.itemMousedownHandle && !this.editor.selection) {
|
|
6408
|
+
if (!this.itemMousedownHandle && !((_a = this.editor) === null || _a === void 0 ? void 0 : _a.selection)) {
|
|
6359
6409
|
var lastNode = getLastNode(this.editor, 1);
|
|
6360
6410
|
var end = slate.Editor.end(this.editor, lastNode[1]);
|
|
6361
6411
|
slate.Transforms.select(this.editor, end);
|
|
@@ -7328,6 +7378,7 @@
|
|
|
7328
7378
|
editor.insertText = function (text) {
|
|
7329
7379
|
if (text && isUrl__default["default"](text)) {
|
|
7330
7380
|
LinkEditor.wrapLink(editor, text, text);
|
|
7381
|
+
slate.Transforms.move(editor, { distance: 1, unit: "offset" });
|
|
7331
7382
|
}
|
|
7332
7383
|
else {
|
|
7333
7384
|
insertText(text);
|
|
@@ -7335,8 +7386,10 @@
|
|
|
7335
7386
|
};
|
|
7336
7387
|
editor.insertData = function (data) {
|
|
7337
7388
|
var text = data.getData('text/plain');
|
|
7338
|
-
|
|
7389
|
+
var fragment = data.getData("application/" + CLIPBOARD_FORMAT_KEY);
|
|
7390
|
+
if (text && isUrl__default["default"](text) && !fragment) {
|
|
7339
7391
|
LinkEditor.wrapLink(editor, text, text);
|
|
7392
|
+
slate.Transforms.move(editor, { distance: 1, unit: "offset" });
|
|
7340
7393
|
}
|
|
7341
7394
|
else {
|
|
7342
7395
|
insertData(data);
|
|
@@ -8226,19 +8279,46 @@
|
|
|
8226
8279
|
|
|
8227
8280
|
var NavSplitLineComponent = /** @class */ (function () {
|
|
8228
8281
|
function NavSplitLineComponent() {
|
|
8282
|
+
this.mode = exports.ToolbarItemMode.vertical;
|
|
8283
|
+
this.theNavSplitLine = true;
|
|
8229
8284
|
}
|
|
8285
|
+
Object.defineProperty(NavSplitLineComponent.prototype, "horizontal", {
|
|
8286
|
+
get: function () {
|
|
8287
|
+
return this.mode === exports.ToolbarItemMode.horizontal;
|
|
8288
|
+
},
|
|
8289
|
+
enumerable: false,
|
|
8290
|
+
configurable: true
|
|
8291
|
+
});
|
|
8292
|
+
Object.defineProperty(NavSplitLineComponent.prototype, "vertical", {
|
|
8293
|
+
get: function () {
|
|
8294
|
+
return this.mode === exports.ToolbarItemMode.vertical;
|
|
8295
|
+
},
|
|
8296
|
+
enumerable: false,
|
|
8297
|
+
configurable: true
|
|
8298
|
+
});
|
|
8230
8299
|
NavSplitLineComponent.prototype.ngOnInit = function () { };
|
|
8231
8300
|
return NavSplitLineComponent;
|
|
8232
8301
|
}());
|
|
8233
8302
|
NavSplitLineComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: NavSplitLineComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
8234
|
-
NavSplitLineComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: NavSplitLineComponent, selector: "nav-split-line", ngImport: i0__namespace, template: '', isInline: true });
|
|
8303
|
+
NavSplitLineComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: NavSplitLineComponent, selector: "nav-split-line", inputs: { mode: "mode" }, host: { properties: { "class.the-nav-split-line": "this.theNavSplitLine", "class.horizontal": "this.horizontal", "class.vertical": "this.vertical" } }, ngImport: i0__namespace, template: '', isInline: true });
|
|
8235
8304
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: NavSplitLineComponent, decorators: [{
|
|
8236
8305
|
type: i0.Component,
|
|
8237
8306
|
args: [{
|
|
8238
8307
|
selector: 'nav-split-line',
|
|
8239
8308
|
template: ''
|
|
8240
8309
|
}]
|
|
8241
|
-
}], ctorParameters: function () { return []; }
|
|
8310
|
+
}], ctorParameters: function () { return []; }, propDecorators: { mode: [{
|
|
8311
|
+
type: i0.Input
|
|
8312
|
+
}], theNavSplitLine: [{
|
|
8313
|
+
type: i0.HostBinding,
|
|
8314
|
+
args: ['class.the-nav-split-line']
|
|
8315
|
+
}], horizontal: [{
|
|
8316
|
+
type: i0.HostBinding,
|
|
8317
|
+
args: ['class.horizontal']
|
|
8318
|
+
}], vertical: [{
|
|
8319
|
+
type: i0.HostBinding,
|
|
8320
|
+
args: ['class.vertical']
|
|
8321
|
+
}] } });
|
|
8242
8322
|
|
|
8243
8323
|
var TheTableToolbarComponent = /** @class */ (function () {
|
|
8244
8324
|
function TheTableToolbarComponent(ngZone, colorSelectService, popoverRef) {
|
|
@@ -8361,7 +8441,7 @@
|
|
|
8361
8441
|
return TheTableToolbarComponent;
|
|
8362
8442
|
}());
|
|
8363
8443
|
TheTableToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheTableToolbarComponent, deps: [{ token: i0__namespace.NgZone }, { token: TheColorSelectService }, { token: i1__namespace$3.ThyPopoverRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
8364
|
-
TheTableToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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: i2__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: NavSplitLineComponent, selector: "nav-split-line" }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
8444
|
+
TheTableToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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: i2__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
8365
8445
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheTableToolbarComponent, decorators: [{
|
|
8366
8446
|
type: i0.Component,
|
|
8367
8447
|
args: [{
|
|
@@ -9070,9 +9150,12 @@
|
|
|
9070
9150
|
TheTableComponent.prototype.useRowControls = function () {
|
|
9071
9151
|
if (this.selection) {
|
|
9072
9152
|
this.rowControls = this.calculateRowControls();
|
|
9073
|
-
this.cdr.
|
|
9153
|
+
this.cdr.markForCheck();
|
|
9074
9154
|
}
|
|
9075
9155
|
};
|
|
9156
|
+
TheTableComponent.prototype.detectChanges = function () {
|
|
9157
|
+
this.cdr.detectChanges();
|
|
9158
|
+
};
|
|
9076
9159
|
TheTableComponent.prototype.calculateMinRowSpanCellForRows = function () {
|
|
9077
9160
|
var table = this.element;
|
|
9078
9161
|
var cells = table.children.map(function (row, index) {
|
|
@@ -9341,7 +9424,7 @@
|
|
|
9341
9424
|
provide: TheTableToken,
|
|
9342
9425
|
useExisting: TheTableComponent
|
|
9343
9426
|
}
|
|
9344
|
-
], 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 class=\"the-table-row-controls-wrapper\" *ngIf=\"!readonly\">\n <div>\n <div\n class=\"the-table-corner-controls\"\n [ngClass]=\"{ active: isSelectedAllCell, dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0 }\"\n >\n <button type=\"button\" class=\"the-table-corner-button\" (mousedown)=\"onSelectTable($event)\"></button>\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 <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 <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>\n <div class=\"the-table-wrapper\" #tableWrapper>\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 (mousedown)=\"onColMouseDown($event, i)\"\n *ngFor=\"let control of colControls; let i = index; trackBy: trackByFnColCotrols\"\n >\n <the-table-insert-mark\n *ngIf=\"isInTable\"\n type=\"column\"\n [at]=\"i + 1\"\n [tableStore]=\"tableStore\"\n ></the-table-insert-mark>\n <div\n class=\"the-table-col-controls-inner\"\n [ngClass]=\"{\n active: tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0\n }\"\n ></div>\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: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
9427
|
+
], 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 class=\"the-table-row-controls-wrapper\" *ngIf=\"!readonly && isInTable\">\n <div>\n <div\n class=\"the-table-corner-controls\"\n [ngClass]=\"{ active: isSelectedAllCell, dangerous: tableStore.isSelectedTable && tableStore.dangerousCells.length > 0 }\"\n >\n <button type=\"button\" class=\"the-table-corner-button\" (mousedown)=\"onSelectTable($event)\"></button>\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 <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 <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>\n <div class=\"the-table-wrapper\" #tableWrapper>\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 (mousedown)=\"onColMouseDown($event, i)\"\n *ngFor=\"let control of colControls; let i = index; trackBy: trackByFnColCotrols\"\n >\n <the-table-insert-mark\n *ngIf=\"isInTable\"\n type=\"column\"\n [at]=\"i + 1\"\n [tableStore]=\"tableStore\"\n ></the-table-insert-mark>\n <div\n class=\"the-table-col-controls-inner\"\n [ngClass]=\"{\n active: tableStore.selectedColumnsIndex.includes(i),\n dangerous: tableStore.dangerousColumnsIndex.includes(i) && tableStore.dangerousCells.length > 0\n }\"\n ></div>\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: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
9345
9428
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheTableComponent, decorators: [{
|
|
9346
9429
|
type: i0.Component,
|
|
9347
9430
|
args: [{
|
|
@@ -9429,11 +9512,13 @@
|
|
|
9429
9512
|
_super.prototype.onContextChange.call(this);
|
|
9430
9513
|
if (this.initialized) {
|
|
9431
9514
|
this.useBackground();
|
|
9515
|
+
this.useHeight();
|
|
9432
9516
|
}
|
|
9433
9517
|
};
|
|
9434
9518
|
TheTableRowComponent.prototype.ngOnInit = function () {
|
|
9435
9519
|
_super.prototype.ngOnInit.call(this);
|
|
9436
9520
|
this.useBackground();
|
|
9521
|
+
this.useHeight();
|
|
9437
9522
|
};
|
|
9438
9523
|
TheTableRowComponent.prototype.useBackground = function () {
|
|
9439
9524
|
if (this.element.header && !this.backgroundColor) {
|
|
@@ -10256,6 +10341,7 @@
|
|
|
10256
10341
|
this.applyRowSize(deltaSize);
|
|
10257
10342
|
}
|
|
10258
10343
|
this.tableComponent.useRowControls();
|
|
10344
|
+
this.tableComponent.detectChanges();
|
|
10259
10345
|
this.updateOverlayHandleSizeAndOffset();
|
|
10260
10346
|
};
|
|
10261
10347
|
TheTdComponent.prototype._createOverlayForHandle = function () {
|
|
@@ -10927,7 +11013,14 @@
|
|
|
10927
11013
|
if (html && !slateFragment) {
|
|
10928
11014
|
var htmlDom = new DOMParser().parseFromString(html, 'text/html');
|
|
10929
11015
|
var fragment = selene.TheiaConverter.convertToTheia(Array.from(htmlDom.body.children));
|
|
10930
|
-
|
|
11016
|
+
// 无法识别HTML内容时后退一下:识别纯文本
|
|
11017
|
+
if (fragment.length === 1 && slate.Editor.isEmpty(editor, fragment[0]) && fragment[0].type === exports.ElementKinds.paragraph) {
|
|
11018
|
+
insertData(data);
|
|
11019
|
+
return;
|
|
11020
|
+
}
|
|
11021
|
+
// 过滤 text 节点的 color/background-color 属性
|
|
11022
|
+
fragment.forEach(function (node) { return deleteColorAndBackgroundColorOfText(node); });
|
|
11023
|
+
slate.Transforms.insertFragment(editor, fragment);
|
|
10931
11024
|
return;
|
|
10932
11025
|
}
|
|
10933
11026
|
insertData(data);
|
|
@@ -10968,14 +11061,16 @@
|
|
|
10968
11061
|
enumerable: false,
|
|
10969
11062
|
configurable: true
|
|
10970
11063
|
});
|
|
11064
|
+
TheVerticalToolbarItemComponent.prototype.handleDocumentMouseDown = function (event) {
|
|
11065
|
+
if (!this.elementRef.nativeElement.contains(event.target)) {
|
|
11066
|
+
this.close();
|
|
11067
|
+
}
|
|
11068
|
+
};
|
|
10971
11069
|
TheVerticalToolbarItemComponent.prototype.ngOnInit = function () { };
|
|
10972
11070
|
TheVerticalToolbarItemComponent.prototype.statusChange = function (editor) {
|
|
10973
11071
|
var _a, _b;
|
|
10974
11072
|
this.active = ((_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.active) ? (_b = this.toolbarItem) === null || _b === void 0 ? void 0 : _b.active(editor) : false;
|
|
10975
11073
|
this.activeMenu = this.menusActive(editor);
|
|
10976
|
-
if (!this.active) {
|
|
10977
|
-
this.close();
|
|
10978
|
-
}
|
|
10979
11074
|
};
|
|
10980
11075
|
TheVerticalToolbarItemComponent.prototype.menusActive = function (editor) {
|
|
10981
11076
|
var _this = this;
|
|
@@ -11023,7 +11118,7 @@
|
|
|
11023
11118
|
return TheVerticalToolbarItemComponent;
|
|
11024
11119
|
}(TheToolbarBaseItemComponent));
|
|
11025
11120
|
TheVerticalToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheVerticalToolbarItemComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$6.ThyPopover }, { token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
11026
|
-
TheVerticalToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheVerticalToolbarItemComponent, selector: "the-toolbar-vertical-align-item", inputs: { item: "item", menus: "menus", editor: "editor", toolbarItem: "toolbarItem" }, host: { 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 [ngStyle]=\"menu?.styles\"\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: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5__namespace$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5__namespace$1.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
11121
|
+
TheVerticalToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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 [ngStyle]=\"menu?.styles\"\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: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5__namespace$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5__namespace$1.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
11027
11122
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheVerticalToolbarItemComponent, decorators: [{
|
|
11028
11123
|
type: i0.Component,
|
|
11029
11124
|
args: [{
|
|
@@ -11045,6 +11140,9 @@
|
|
|
11045
11140
|
}], template: [{
|
|
11046
11141
|
type: i0.ViewChild,
|
|
11047
11142
|
args: ['VerticalAlignItems', { read: i0.TemplateRef, static: true }]
|
|
11143
|
+
}], handleDocumentMouseDown: [{
|
|
11144
|
+
type: i0.HostListener,
|
|
11145
|
+
args: ['document: mousedown', ['$event']]
|
|
11048
11146
|
}] } });
|
|
11049
11147
|
|
|
11050
11148
|
var VerticalAlignOptions = [
|
|
@@ -11080,6 +11178,377 @@
|
|
|
11080
11178
|
}
|
|
11081
11179
|
];
|
|
11082
11180
|
|
|
11181
|
+
var PaintFormatEditor = {
|
|
11182
|
+
formatBrush: function (editor) {
|
|
11183
|
+
var e_1, _a;
|
|
11184
|
+
var contextService = editor.injector.get(TheContextService);
|
|
11185
|
+
var obj = {};
|
|
11186
|
+
try {
|
|
11187
|
+
for (var MarkProps_1 = __values(MarkProps), MarkProps_1_1 = MarkProps_1.next(); !MarkProps_1_1.done; MarkProps_1_1 = MarkProps_1.next()) {
|
|
11188
|
+
var key = MarkProps_1_1.value;
|
|
11189
|
+
var k = contextService.paintFormatStatus.marks[key];
|
|
11190
|
+
obj[key] = k || null;
|
|
11191
|
+
}
|
|
11192
|
+
}
|
|
11193
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
11194
|
+
finally {
|
|
11195
|
+
try {
|
|
11196
|
+
if (MarkProps_1_1 && !MarkProps_1_1.done && (_a = MarkProps_1.return)) _a.call(MarkProps_1);
|
|
11197
|
+
}
|
|
11198
|
+
finally { if (e_1) throw e_1.error; }
|
|
11199
|
+
}
|
|
11200
|
+
var block = anchorBlock(editor);
|
|
11201
|
+
if (block && slate.Range.isCollapsed(editor.selection)) {
|
|
11202
|
+
// TODO:: 在撤销时有bug, 临时使用withoutSaving处理
|
|
11203
|
+
slateHistory.HistoryEditor.withoutSaving(editor, function () {
|
|
11204
|
+
var path = TheEditor.findPath(editor, block);
|
|
11205
|
+
setMarks(editor, obj, path);
|
|
11206
|
+
});
|
|
11207
|
+
}
|
|
11208
|
+
else {
|
|
11209
|
+
setMarks(editor, obj);
|
|
11210
|
+
}
|
|
11211
|
+
PaintFormatEditor.cancelFormatBrushStatus(editor);
|
|
11212
|
+
},
|
|
11213
|
+
isActive: function (editor) {
|
|
11214
|
+
var contextService = editor.injector.get(TheContextService);
|
|
11215
|
+
var res = contextService.paintFormatStatus.isActive;
|
|
11216
|
+
return res;
|
|
11217
|
+
},
|
|
11218
|
+
enableFormatBrush: function (editor) {
|
|
11219
|
+
var contextService = editor.injector.get(TheContextService);
|
|
11220
|
+
if (contextService.paintFormatStatus.isActive) {
|
|
11221
|
+
return PaintFormatEditor.cancelFormatBrushStatus(editor);
|
|
11222
|
+
}
|
|
11223
|
+
contextService.paintFormatStatus = {
|
|
11224
|
+
isActive: true,
|
|
11225
|
+
marks: getSelectionMarks(editor)
|
|
11226
|
+
};
|
|
11227
|
+
var element = i1.EDITOR_TO_ELEMENT.get(editor);
|
|
11228
|
+
element.classList.add('pointer-paint');
|
|
11229
|
+
contextService.onMouseUp$
|
|
11230
|
+
.pipe(operators.skip(1), operators.filter(function (event) { return element.contains(event.target); }), operators.take(1))
|
|
11231
|
+
.subscribe(function (event) {
|
|
11232
|
+
if (contextService.paintFormatStatus.isActive) {
|
|
11233
|
+
PaintFormatEditor.formatBrush(editor);
|
|
11234
|
+
}
|
|
11235
|
+
});
|
|
11236
|
+
editor.onChange();
|
|
11237
|
+
},
|
|
11238
|
+
cancelFormatBrushStatus: function (editor) {
|
|
11239
|
+
var contextService = editor.injector.get(TheContextService);
|
|
11240
|
+
contextService.paintFormatStatus = {
|
|
11241
|
+
isActive: false,
|
|
11242
|
+
marks: {}
|
|
11243
|
+
};
|
|
11244
|
+
var element = i1.EDITOR_TO_ELEMENT.get(editor);
|
|
11245
|
+
element.classList.remove('pointer-paint');
|
|
11246
|
+
editor.onChange();
|
|
11247
|
+
}
|
|
11248
|
+
};
|
|
11249
|
+
|
|
11250
|
+
var PaintFormatOptions = [
|
|
11251
|
+
{
|
|
11252
|
+
key: exports.ToolbarActionTypes.undo,
|
|
11253
|
+
icon: 'undo',
|
|
11254
|
+
name: '撤销',
|
|
11255
|
+
execute: function (editor) { return editor.undo(); }
|
|
11256
|
+
},
|
|
11257
|
+
{
|
|
11258
|
+
key: exports.ToolbarActionTypes.redo,
|
|
11259
|
+
icon: 'redo',
|
|
11260
|
+
name: '重做',
|
|
11261
|
+
execute: function (editor) { return editor.redo(); }
|
|
11262
|
+
},
|
|
11263
|
+
{
|
|
11264
|
+
key: exports.ToolbarActionTypes.paintformat,
|
|
11265
|
+
icon: 'paintformat',
|
|
11266
|
+
name: '格式刷',
|
|
11267
|
+
execute: PaintFormatEditor.enableFormatBrush,
|
|
11268
|
+
active: PaintFormatEditor.isActive
|
|
11269
|
+
},
|
|
11270
|
+
{
|
|
11271
|
+
key: exports.ToolbarActionTypes.clean,
|
|
11272
|
+
icon: 'clean',
|
|
11273
|
+
name: '清除格式',
|
|
11274
|
+
execute: function (editor) {
|
|
11275
|
+
var e_1, _a;
|
|
11276
|
+
var selection = editor.selection;
|
|
11277
|
+
if (!selection) {
|
|
11278
|
+
return;
|
|
11279
|
+
}
|
|
11280
|
+
if (TableEditor.clearMark(editor)) {
|
|
11281
|
+
return;
|
|
11282
|
+
}
|
|
11283
|
+
if (slate.Range.isCollapsed(selection)) {
|
|
11284
|
+
var marks = slate.Editor.marks(editor);
|
|
11285
|
+
try {
|
|
11286
|
+
for (var _b = __values(Object.keys(marks)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
11287
|
+
var key = _c.value;
|
|
11288
|
+
slate.Editor.removeMark(editor, key);
|
|
11289
|
+
}
|
|
11290
|
+
}
|
|
11291
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
11292
|
+
finally {
|
|
11293
|
+
try {
|
|
11294
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
11295
|
+
}
|
|
11296
|
+
finally { if (e_1) throw e_1.error; }
|
|
11297
|
+
}
|
|
11298
|
+
}
|
|
11299
|
+
else {
|
|
11300
|
+
var unsetMarks_1 = {};
|
|
11301
|
+
MarkProps.forEach(function (key) {
|
|
11302
|
+
unsetMarks_1[key] = null;
|
|
11303
|
+
});
|
|
11304
|
+
setMarks(editor, unsetMarks_1);
|
|
11305
|
+
}
|
|
11306
|
+
}
|
|
11307
|
+
}
|
|
11308
|
+
];
|
|
11309
|
+
|
|
11310
|
+
/**
|
|
11311
|
+
* whether the current node is a clean paragraph
|
|
11312
|
+
* @param editor
|
|
11313
|
+
* @param text
|
|
11314
|
+
* @returns boolean
|
|
11315
|
+
*/
|
|
11316
|
+
var isCleanEmptyParagraph = function (editor) {
|
|
11317
|
+
var isCollapsedCursor = TheEditor.isFocused(editor) && editor.selection && slate.Range.isCollapsed(editor.selection);
|
|
11318
|
+
if (!isCollapsedCursor) {
|
|
11319
|
+
return false;
|
|
11320
|
+
}
|
|
11321
|
+
var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
|
|
11322
|
+
var textIndent = 'textIndent';
|
|
11323
|
+
var align = 'align';
|
|
11324
|
+
var hasTextIndent = block[textIndent];
|
|
11325
|
+
var hasAlign = block[align];
|
|
11326
|
+
if (slate.Node.string(block) === '' &&
|
|
11327
|
+
slate.Element.isElement(block) &&
|
|
11328
|
+
block.type === exports.ElementKinds.paragraph &&
|
|
11329
|
+
block.children.length === 1 &&
|
|
11330
|
+
slate.Text.isText(block.children[0]) &&
|
|
11331
|
+
!slate.Editor.isVoid(editor, block) &&
|
|
11332
|
+
!hasTextIndent &&
|
|
11333
|
+
!hasAlign) {
|
|
11334
|
+
return true;
|
|
11335
|
+
}
|
|
11336
|
+
return false;
|
|
11337
|
+
};
|
|
11338
|
+
|
|
11339
|
+
var TheToolbarItemComponent = /** @class */ (function (_super) {
|
|
11340
|
+
__extends(TheToolbarItemComponent, _super);
|
|
11341
|
+
function TheToolbarItemComponent(ngZone, cfr) {
|
|
11342
|
+
var _this = _super.call(this) || this;
|
|
11343
|
+
_this.ngZone = ngZone;
|
|
11344
|
+
_this.cfr = cfr;
|
|
11345
|
+
_this.itemMode = exports.ToolbarItemMode.horizontal;
|
|
11346
|
+
_this.ToolbarItemMode = exports.ToolbarItemMode;
|
|
11347
|
+
_this.active = false;
|
|
11348
|
+
return _this;
|
|
11349
|
+
}
|
|
11350
|
+
TheToolbarItemComponent.prototype.ngOnInit = function () {
|
|
11351
|
+
var _a, _b;
|
|
11352
|
+
if (((_a = this.item) === null || _a === void 0 ? void 0 : _a.quickItemComponent) && i1.isComponentType((_b = this.item) === null || _b === void 0 ? void 0 : _b.quickItemComponent)) {
|
|
11353
|
+
this.renderToolbarItem();
|
|
11354
|
+
}
|
|
11355
|
+
};
|
|
11356
|
+
TheToolbarItemComponent.prototype.statusChange = function (editor) {
|
|
11357
|
+
var _a, _b;
|
|
11358
|
+
this.active = ((_a = this.item) === null || _a === void 0 ? void 0 : _a.active) ? (_b = this.item) === null || _b === void 0 ? void 0 : _b.active(editor) : false;
|
|
11359
|
+
};
|
|
11360
|
+
TheToolbarItemComponent.prototype.execute = function (event) {
|
|
11361
|
+
var _a, _b, _c;
|
|
11362
|
+
_super.prototype.execute.call(this, event);
|
|
11363
|
+
if (!((_a = this.item) === null || _a === void 0 ? void 0 : _a.execute) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
|
|
11364
|
+
return;
|
|
11365
|
+
}
|
|
11366
|
+
(_c = this.item) === null || _c === void 0 ? void 0 : _c.execute(this.editor);
|
|
11367
|
+
};
|
|
11368
|
+
TheToolbarItemComponent.prototype.renderToolbarItem = function () {
|
|
11369
|
+
var _this = this;
|
|
11370
|
+
this.ngZone.run(function () {
|
|
11371
|
+
var toolbarItemFactory = _this.cfr.resolveComponentFactory(_this.item.quickItemComponent);
|
|
11372
|
+
var tollbarItemRef = _this.toolbarContainer.createComponent(toolbarItemFactory);
|
|
11373
|
+
tollbarItemRef.instance.editor = _this.editor;
|
|
11374
|
+
tollbarItemRef.instance.item = _this.item;
|
|
11375
|
+
tollbarItemRef.instance.itemMode = exports.ToolbarItemMode.vertical;
|
|
11376
|
+
});
|
|
11377
|
+
};
|
|
11378
|
+
return TheToolbarItemComponent;
|
|
11379
|
+
}(TheToolbarBaseItemComponent));
|
|
11380
|
+
TheToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarItemComponent, deps: [{ token: i0__namespace.NgZone }, { token: i0__namespace.ComponentFactoryResolver }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
11381
|
+
TheToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { item: "item", editor: "editor", itemMode: "itemMode" }, host: { classAttribute: "the-toolbar-item" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: i0.ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "\n <ng-container *ngIf=\"itemMode === ToolbarItemMode.horizontal; else selectionItem\">\n <a\n thyIconNavLink\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n ></a>\n </ng-container>\n <ng-template #selectionItem>\n <ng-container *ngIf=\"!item?.quickItemComponent\">\n <thy-icon [thyIconName]=\"item?.icon\" [thyIconRotate]=\"0\" class=\"quick-toolbar-icon\"></thy-icon>\n <span class=\"quick-toolbar-name\">{{ item?.name }}</span>\n </ng-container>\n </ng-template>\n <ng-container #toolbarContainer></ng-container>\n ", isInline: true, components: [{ type: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
11382
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarItemComponent, decorators: [{
|
|
11383
|
+
type: i0.Component,
|
|
11384
|
+
args: [{
|
|
11385
|
+
selector: 'the-toolbar-item',
|
|
11386
|
+
template: "\n <ng-container *ngIf=\"itemMode === ToolbarItemMode.horizontal; else selectionItem\">\n <a\n thyIconNavLink\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n ></a>\n </ng-container>\n <ng-template #selectionItem>\n <ng-container *ngIf=\"!item?.quickItemComponent\">\n <thy-icon [thyIconName]=\"item?.icon\" [thyIconRotate]=\"0\" class=\"quick-toolbar-icon\"></thy-icon>\n <span class=\"quick-toolbar-name\">{{ item?.name }}</span>\n </ng-container>\n </ng-template>\n <ng-container #toolbarContainer></ng-container>\n ",
|
|
11387
|
+
host: {
|
|
11388
|
+
class: 'the-toolbar-item'
|
|
11389
|
+
}
|
|
11390
|
+
}]
|
|
11391
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.NgZone }, { type: i0__namespace.ComponentFactoryResolver }]; }, propDecorators: { item: [{
|
|
11392
|
+
type: i0.Input
|
|
11393
|
+
}], editor: [{
|
|
11394
|
+
type: i0.Input
|
|
11395
|
+
}], itemMode: [{
|
|
11396
|
+
type: i0.Input
|
|
11397
|
+
}], toolbarContainer: [{
|
|
11398
|
+
type: i0.ViewChild,
|
|
11399
|
+
args: ['toolbarContainer', { read: i0.ViewContainerRef, static: true }]
|
|
11400
|
+
}] } });
|
|
11401
|
+
|
|
11402
|
+
var TheQuickToolbarComponent = /** @class */ (function (_super) {
|
|
11403
|
+
__extends(TheQuickToolbarComponent, _super);
|
|
11404
|
+
function TheQuickToolbarComponent(popoverRef, elementRef) {
|
|
11405
|
+
var _this = _super.call(this) || this;
|
|
11406
|
+
_this.popoverRef = popoverRef;
|
|
11407
|
+
_this.elementRef = elementRef;
|
|
11408
|
+
_this.ToolbarItemMode = exports.ToolbarItemMode;
|
|
11409
|
+
_this.ToolbarActionTypes = exports.ToolbarActionTypes;
|
|
11410
|
+
return _this;
|
|
11411
|
+
}
|
|
11412
|
+
TheQuickToolbarComponent.prototype.handleMouseDown = function (event) {
|
|
11413
|
+
if (!this.elementRef.nativeElement.contains(event.target)) {
|
|
11414
|
+
this.popoverRef.close();
|
|
11415
|
+
}
|
|
11416
|
+
else {
|
|
11417
|
+
event.preventDefault();
|
|
11418
|
+
}
|
|
11419
|
+
};
|
|
11420
|
+
TheQuickToolbarComponent.prototype.handleEnter = function () {
|
|
11421
|
+
this.popoverRef.close();
|
|
11422
|
+
};
|
|
11423
|
+
TheQuickToolbarComponent.prototype.ngOnInit = function () {
|
|
11424
|
+
this.editorElement = i1.AngularEditor.toDOMNode(this.editor, this.editor);
|
|
11425
|
+
};
|
|
11426
|
+
TheQuickToolbarComponent.prototype.stopPropagation = function (event) {
|
|
11427
|
+
event.preventDefault();
|
|
11428
|
+
};
|
|
11429
|
+
TheQuickToolbarComponent.prototype.selectionChange = function (event) {
|
|
11430
|
+
this.removeHotKey();
|
|
11431
|
+
var toolbarItem = this.quickToolbarItems.find(function (item) { return item.key === event.value; });
|
|
11432
|
+
if (toolbarItem === null || toolbarItem === void 0 ? void 0 : toolbarItem.execute) {
|
|
11433
|
+
toolbarItem.execute(this.editor);
|
|
11434
|
+
}
|
|
11435
|
+
};
|
|
11436
|
+
TheQuickToolbarComponent.prototype.removeHotKey = function () {
|
|
11437
|
+
var node = slate.Node.get(this.editor, this.editor.selection.anchor.path);
|
|
11438
|
+
if (node && slate.Text.equals({ text: QUICK_TOOLBAR_HOTKEY }, node)) {
|
|
11439
|
+
slate.Editor.deleteBackward(this.editor);
|
|
11440
|
+
}
|
|
11441
|
+
};
|
|
11442
|
+
TheQuickToolbarComponent.prototype.ngOnDestroy = function () {
|
|
11443
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
11444
|
+
};
|
|
11445
|
+
return TheQuickToolbarComponent;
|
|
11446
|
+
}(core.mixinUnsubscribe(core.MixinBase)));
|
|
11447
|
+
TheQuickToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheQuickToolbarComponent, deps: [{ token: i1__namespace$3.ThyPopoverRef }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
11448
|
+
TheQuickToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheQuickToolbarComponent, selector: "the-quick-toolbar", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems" }, host: { listeners: { "document: mousedown": "handleMouseDown($event)", "document: keydown.enter": "handleEnter()" } }, 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$3.ThyListOptionComponent, selector: "thy-list-option,[thy-list-option]", inputs: ["id", "thyValue", "thyDisabled"] }, { type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: ["item", "editor", "itemMode"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }], directives: [{ type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
11449
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheQuickToolbarComponent, decorators: [{
|
|
11450
|
+
type: i0.Component,
|
|
11451
|
+
args: [{
|
|
11452
|
+
selector: 'the-quick-toolbar',
|
|
11453
|
+
templateUrl: 'quick-toolbar.component.html'
|
|
11454
|
+
}]
|
|
11455
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$3.ThyPopoverRef }, { type: i0__namespace.ElementRef }]; }, propDecorators: { editor: [{
|
|
11456
|
+
type: i0.Input
|
|
11457
|
+
}], quickToolbarItems: [{
|
|
11458
|
+
type: i0.Input
|
|
11459
|
+
}], handleMouseDown: [{
|
|
11460
|
+
type: i0.HostListener,
|
|
11461
|
+
args: ['document: mousedown', ['$event']]
|
|
11462
|
+
}], handleEnter: [{
|
|
11463
|
+
type: i0.HostListener,
|
|
11464
|
+
args: ['document: keydown.enter']
|
|
11465
|
+
}] } });
|
|
11466
|
+
|
|
11467
|
+
var OperationTypes = ['insert_text', 'remove_node', 'merge_node'];
|
|
11468
|
+
var QuickInsertEditor = {
|
|
11469
|
+
openQuickToolbar: function (editor, toolbarItems, origin) {
|
|
11470
|
+
var overlay = editor.injector.get(i2.Overlay);
|
|
11471
|
+
var viewContainerRef = editor.injector.get(i0.ViewContainerRef);
|
|
11472
|
+
var thyPopover = editor.injector.get(i1$2.ThyPopover);
|
|
11473
|
+
var quickToolbarRef = thyPopover.open(TheQuickToolbarComponent, {
|
|
11474
|
+
initialState: {
|
|
11475
|
+
editor: editor,
|
|
11476
|
+
quickToolbarItems: toolbarItems
|
|
11477
|
+
},
|
|
11478
|
+
origin: origin,
|
|
11479
|
+
viewContainerRef: viewContainerRef,
|
|
11480
|
+
backdropClosable: true,
|
|
11481
|
+
placement: 'bottomLeft',
|
|
11482
|
+
offset: 4,
|
|
11483
|
+
hasBackdrop: false,
|
|
11484
|
+
insideClosable: true,
|
|
11485
|
+
panelClass: 'the-quick-toolbar-container',
|
|
11486
|
+
scrollStrategy: overlay.scrollStrategies.reposition(),
|
|
11487
|
+
manualClosure: true
|
|
11488
|
+
});
|
|
11489
|
+
THE_EDITOR_QUICK_TOOLBAR_REF.set(editor, quickToolbarRef);
|
|
11490
|
+
},
|
|
11491
|
+
closeQuickToolbar: function (editor) {
|
|
11492
|
+
var quickToolbarRef = THE_EDITOR_QUICK_TOOLBAR_REF.get(editor);
|
|
11493
|
+
if (quickToolbarRef) {
|
|
11494
|
+
quickToolbarRef.close();
|
|
11495
|
+
THE_EDITOR_QUICK_TOOLBAR_REF.set(editor, null);
|
|
11496
|
+
}
|
|
11497
|
+
},
|
|
11498
|
+
isOpenToolbar: function (editor, opTypes) {
|
|
11499
|
+
if (opTypes === void 0) { opTypes = OperationTypes; }
|
|
11500
|
+
var isCollapsedCursor = TheEditor.isFocused(editor) && editor.selection && slate.Range.isCollapsed(editor.selection);
|
|
11501
|
+
if (!isCollapsedCursor) {
|
|
11502
|
+
return false;
|
|
11503
|
+
}
|
|
11504
|
+
var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
|
|
11505
|
+
var undos = editor.history.undos;
|
|
11506
|
+
var lastBatch = undos[undos.length - 1];
|
|
11507
|
+
var lastOp = lastBatch && lastBatch[lastBatch.length - 1];
|
|
11508
|
+
if (lastOp &&
|
|
11509
|
+
block.children.length === 1 &&
|
|
11510
|
+
block.type === exports.ElementKinds.paragraph &&
|
|
11511
|
+
slate.Node.string(block) === QUICK_TOOLBAR_HOTKEY &&
|
|
11512
|
+
opTypes.includes(lastOp.type) &&
|
|
11513
|
+
(lastOp.text === QUICK_TOOLBAR_HOTKEY || lastOp.text === undefined)) {
|
|
11514
|
+
return true;
|
|
11515
|
+
}
|
|
11516
|
+
return false;
|
|
11517
|
+
}
|
|
11518
|
+
};
|
|
11519
|
+
|
|
11520
|
+
var withQuickInsert = function (editor) {
|
|
11521
|
+
var onKeydown = editor.onKeydown, deleteBackward = editor.deleteBackward, onChange = editor.onChange;
|
|
11522
|
+
editor.onKeydown = function (event) {
|
|
11523
|
+
if (event.key === QUICK_TOOLBAR_HOTKEY && isCleanEmptyParagraph(editor)) {
|
|
11524
|
+
var rootNode = i1.AngularEditor.toDOMNode(editor, slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]));
|
|
11525
|
+
var theEditorComponent = editor.injector.get(TheEditorComponent);
|
|
11526
|
+
var quickToolbars = theEditorComponent.quickToolbarItems;
|
|
11527
|
+
QuickInsertEditor.openQuickToolbar(editor, quickToolbars, rootNode);
|
|
11528
|
+
}
|
|
11529
|
+
onKeydown(event);
|
|
11530
|
+
};
|
|
11531
|
+
editor.deleteBackward = function (unit) {
|
|
11532
|
+
if (!QuickInsertEditor.isOpenToolbar(editor, ['remove_text'])) {
|
|
11533
|
+
QuickInsertEditor.closeQuickToolbar(editor);
|
|
11534
|
+
}
|
|
11535
|
+
deleteBackward(unit);
|
|
11536
|
+
};
|
|
11537
|
+
editor.onChange = function () {
|
|
11538
|
+
var _a;
|
|
11539
|
+
onChange();
|
|
11540
|
+
if (editor.selection) {
|
|
11541
|
+
var editorComponent = editor.injector.get(TheEditorComponent);
|
|
11542
|
+
(_a = editorComponent.quickInsertInstance) === null || _a === void 0 ? void 0 : _a.checkStatus();
|
|
11543
|
+
var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
|
|
11544
|
+
if (!isCleanEmptyParagraph(editor) && slate.Node.string(block) !== QUICK_TOOLBAR_HOTKEY) {
|
|
11545
|
+
QuickInsertEditor.closeQuickToolbar(editor);
|
|
11546
|
+
}
|
|
11547
|
+
}
|
|
11548
|
+
};
|
|
11549
|
+
return editor;
|
|
11550
|
+
};
|
|
11551
|
+
|
|
11083
11552
|
var internalPlugins = [
|
|
11084
11553
|
withTheHistory,
|
|
11085
11554
|
withAutoInsertData(),
|
|
@@ -11087,7 +11556,6 @@
|
|
|
11087
11556
|
withRemoveVoid,
|
|
11088
11557
|
withBlockCard,
|
|
11089
11558
|
withResetType,
|
|
11090
|
-
withImage,
|
|
11091
11559
|
withIndent(__spreadArray([exports.ElementKinds.checkItem, exports.ElementKinds.numberedList, exports.ElementKinds.bulletedList, exports.ElementKinds.paragraph], __read(HEADING_TYPES))),
|
|
11092
11560
|
withList({ validLiChildrenTypes: [exports.ElementKinds.image] }),
|
|
11093
11561
|
withLink,
|
|
@@ -11107,9 +11575,11 @@
|
|
|
11107
11575
|
withInsertParagraphNodes(),
|
|
11108
11576
|
withGetFragment(),
|
|
11109
11577
|
withDeserializeHMTL,
|
|
11110
|
-
withDeserializeMd()
|
|
11578
|
+
withDeserializeMd(),
|
|
11579
|
+
withImage,
|
|
11580
|
+
withQuickInsert
|
|
11111
11581
|
];
|
|
11112
|
-
var internalToolbarItems = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(AlignOptions)), __read(MarkOptions)), __read(ColorOptions)), __read(HeadingOptions)), __read(TodoItemOptions)), __read(ListOptions)), __read(ImageOptions)), __read(HrOptions)), __read(BlockquoteOptions)), __read(CodeOptions)), __read(LinkOptions)), __read(TableOptions)), __read(VerticalAlignOptions));
|
|
11582
|
+
var internalToolbarItems = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(AlignOptions)), __read(MarkOptions)), __read(ColorOptions)), __read(HeadingOptions)), __read(TodoItemOptions)), __read(ListOptions)), __read(ImageOptions)), __read(HrOptions)), __read(BlockquoteOptions)), __read(CodeOptions)), __read(LinkOptions)), __read(TableOptions)), __read(VerticalAlignOptions)), __read(PaintFormatOptions));
|
|
11113
11583
|
var toolbarCompose = function (toolbarItems) {
|
|
11114
11584
|
if (toolbarItems === void 0) { toolbarItems = []; }
|
|
11115
11585
|
return __spreadArray(__spreadArray([], __read(internalToolbarItems)), __read(toolbarItems));
|
|
@@ -11150,14 +11620,14 @@
|
|
|
11150
11620
|
var TheToolbarService = /** @class */ (function () {
|
|
11151
11621
|
function TheToolbarService() {
|
|
11152
11622
|
}
|
|
11153
|
-
TheToolbarService.prototype.initialize = function (toolbarItems, global, inline,
|
|
11623
|
+
TheToolbarService.prototype.initialize = function (toolbarItems, global, inline, quick) {
|
|
11154
11624
|
if (global === void 0) { global = DefaultGlobalToolbarDefinition; }
|
|
11155
11625
|
if (inline === void 0) { inline = DefaultInlineToolbarDefinition; }
|
|
11156
|
-
if (
|
|
11626
|
+
if (quick === void 0) { quick = DefaultQuickToolbarDefinition; }
|
|
11157
11627
|
var toolbarDefinition = {
|
|
11158
11628
|
global: global,
|
|
11159
|
-
|
|
11160
|
-
|
|
11629
|
+
inline: inline,
|
|
11630
|
+
quick: quick
|
|
11161
11631
|
};
|
|
11162
11632
|
var toolbarOperations = new Map();
|
|
11163
11633
|
toolbarItems.forEach(function (i) { return toolbarOperations.set(i.key, i); });
|
|
@@ -11201,7 +11671,7 @@
|
|
|
11201
11671
|
|
|
11202
11672
|
var autoFocus = function (editor, isFocus) {
|
|
11203
11673
|
setTimeout(function () {
|
|
11204
|
-
if (editor && isFocus) {
|
|
11674
|
+
if (editor && editor.children.length > 0 && isFocus) {
|
|
11205
11675
|
slateHistory.HistoryEditor.withoutMerging(editor, function () {
|
|
11206
11676
|
i1.AngularEditor.focus(editor);
|
|
11207
11677
|
slate.Transforms.select(editor, slate.Editor.start(editor, [0]));
|
|
@@ -11238,44 +11708,6 @@
|
|
|
11238
11708
|
previousHeight = currentHeight;
|
|
11239
11709
|
};
|
|
11240
11710
|
|
|
11241
|
-
var TheToolbarItemComponent = /** @class */ (function (_super) {
|
|
11242
|
-
__extends(TheToolbarItemComponent, _super);
|
|
11243
|
-
function TheToolbarItemComponent() {
|
|
11244
|
-
var _this = _super.call(this) || this;
|
|
11245
|
-
_this.active = false;
|
|
11246
|
-
return _this;
|
|
11247
|
-
}
|
|
11248
|
-
TheToolbarItemComponent.prototype.statusChange = function (editor) {
|
|
11249
|
-
var _a, _b;
|
|
11250
|
-
this.active = ((_a = this.item) === null || _a === void 0 ? void 0 : _a.active) ? (_b = this.item) === null || _b === void 0 ? void 0 : _b.active(editor) : false;
|
|
11251
|
-
};
|
|
11252
|
-
TheToolbarItemComponent.prototype.execute = function (event) {
|
|
11253
|
-
var _a, _b, _c;
|
|
11254
|
-
_super.prototype.execute.call(this, event);
|
|
11255
|
-
if (!((_a = this.item) === null || _a === void 0 ? void 0 : _a.execute) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.disabled)) {
|
|
11256
|
-
return;
|
|
11257
|
-
}
|
|
11258
|
-
(_c = this.item) === null || _c === void 0 ? void 0 : _c.execute(this.editor);
|
|
11259
|
-
};
|
|
11260
|
-
return TheToolbarItemComponent;
|
|
11261
|
-
}(TheToolbarBaseItemComponent));
|
|
11262
|
-
TheToolbarItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarItemComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
11263
|
-
TheToolbarItemComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { item: "item", editor: "editor" }, host: { classAttribute: "the-toolbar-item" }, usesInheritance: true, ngImport: i0__namespace, template: "\n <a\n thyIconNavLink\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n ></a>\n ", isInline: true, components: [{ type: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }], directives: [{ type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
11264
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarItemComponent, decorators: [{
|
|
11265
|
-
type: i0.Component,
|
|
11266
|
-
args: [{
|
|
11267
|
-
selector: 'the-toolbar-item',
|
|
11268
|
-
template: "\n <a\n thyIconNavLink\n [thyIconNavLinkIcon]=\"item.icon\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n [thyIconNavLinkActive]=\"active\"\n (mousedown)=\"execute($event)\"\n ></a>\n ",
|
|
11269
|
-
host: {
|
|
11270
|
-
class: 'the-toolbar-item'
|
|
11271
|
-
}
|
|
11272
|
-
}]
|
|
11273
|
-
}], ctorParameters: function () { return []; }, propDecorators: { item: [{
|
|
11274
|
-
type: i0.Input
|
|
11275
|
-
}], editor: [{
|
|
11276
|
-
type: i0.Input
|
|
11277
|
-
}] } });
|
|
11278
|
-
|
|
11279
11711
|
var TheToolbarComponent = /** @class */ (function () {
|
|
11280
11712
|
function TheToolbarComponent(cfr, elementRef, ngZone, toolbarGroupComponent) {
|
|
11281
11713
|
this.cfr = cfr;
|
|
@@ -11283,6 +11715,7 @@
|
|
|
11283
11715
|
this.ngZone = ngZone;
|
|
11284
11716
|
this.toolbarGroupComponent = toolbarGroupComponent;
|
|
11285
11717
|
this.toolbarItems = [];
|
|
11718
|
+
this.containerClass = [];
|
|
11286
11719
|
this.isMore = true;
|
|
11287
11720
|
this.components = new Map();
|
|
11288
11721
|
this.moreGroupMenu = ToolbarMoreGroup;
|
|
@@ -11308,9 +11741,9 @@
|
|
|
11308
11741
|
}
|
|
11309
11742
|
};
|
|
11310
11743
|
TheToolbarComponent.prototype.setToolbarClass = function () {
|
|
11311
|
-
|
|
11312
|
-
|
|
11313
|
-
this.elementRef.nativeElement.classList.add(
|
|
11744
|
+
var _a;
|
|
11745
|
+
if (this.editor && !!this.containerClass.length) {
|
|
11746
|
+
(_a = this.elementRef.nativeElement.classList).add.apply(_a, __spreadArray([], __read(this.containerClass)));
|
|
11314
11747
|
}
|
|
11315
11748
|
};
|
|
11316
11749
|
TheToolbarComponent.prototype.resizeElement = function () {
|
|
@@ -11538,7 +11971,7 @@
|
|
|
11538
11971
|
return TheToolbarComponent;
|
|
11539
11972
|
}());
|
|
11540
11973
|
TheToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarComponent, deps: [{ token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ElementRef }, { token: i0__namespace.NgZone }, { token: TheToolbarGroupToken }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
11541
|
-
TheToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarComponent, selector: "the-toolbar", inputs: { editor: "editor", toolbarItems: "toolbarItems", align: "align", 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: i2__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
11974
|
+
TheToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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: i2__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
11542
11975
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarComponent, decorators: [{
|
|
11543
11976
|
type: i0.Component,
|
|
11544
11977
|
args: [{
|
|
@@ -11559,6 +11992,8 @@
|
|
|
11559
11992
|
type: i0.Input
|
|
11560
11993
|
}], align: [{
|
|
11561
11994
|
type: i0.Input
|
|
11995
|
+
}], containerClass: [{
|
|
11996
|
+
type: i0.Input
|
|
11562
11997
|
}], isMore: [{
|
|
11563
11998
|
type: i0.Input
|
|
11564
11999
|
}], afterTemplate: [{
|
|
@@ -11568,56 +12003,240 @@
|
|
|
11568
12003
|
args: ['toolbarContainer', { read: i0.ViewContainerRef, static: true }]
|
|
11569
12004
|
}] } });
|
|
11570
12005
|
|
|
12006
|
+
var TheInlineToolbarComponent = /** @class */ (function () {
|
|
12007
|
+
function TheInlineToolbarComponent(elementRef, scrollDispatcher, cdr, ngZone) {
|
|
12008
|
+
this.elementRef = elementRef;
|
|
12009
|
+
this.scrollDispatcher = scrollDispatcher;
|
|
12010
|
+
this.cdr = cdr;
|
|
12011
|
+
this.ngZone = ngZone;
|
|
12012
|
+
this.destroy$ = new rxjs.Subject();
|
|
12013
|
+
}
|
|
12014
|
+
TheInlineToolbarComponent.prototype.ngOnInit = function () {
|
|
12015
|
+
var _this = this;
|
|
12016
|
+
this.scrollDispatcher
|
|
12017
|
+
.scrolled()
|
|
12018
|
+
.pipe(operators.takeUntil(this.destroy$))
|
|
12019
|
+
.subscribe(function () {
|
|
12020
|
+
_this.updateInlineToolbar();
|
|
12021
|
+
_this.cdr.detectChanges();
|
|
12022
|
+
});
|
|
12023
|
+
this.ngZone.runOutsideAngular(function () {
|
|
12024
|
+
rxjs.merge(rxjs.fromEvent(document, 'mouseup').pipe(operators.filter(function (e) { return e.button !== 2; })), rxjs.fromEvent(document, 'keyup').pipe(operators.filter(function (e) { return !e.shiftKey; })))
|
|
12025
|
+
.pipe(operators.debounceTime(200), operators.takeUntil(_this.destroy$))
|
|
12026
|
+
.subscribe(function () {
|
|
12027
|
+
var _a;
|
|
12028
|
+
_this.updateInlineToolbar();
|
|
12029
|
+
(_a = _this.inlineToolbar) === null || _a === void 0 ? void 0 : _a.statusChange(_this.editor);
|
|
12030
|
+
_this.cdr.detectChanges();
|
|
12031
|
+
});
|
|
12032
|
+
});
|
|
12033
|
+
};
|
|
12034
|
+
TheInlineToolbarComponent.prototype.updateInlineToolbar = function () {
|
|
12035
|
+
var inlineToolbar = this.elementRef.nativeElement.firstElementChild;
|
|
12036
|
+
if (!this.editor.selection) {
|
|
12037
|
+
inlineToolbar.removeAttribute('style');
|
|
12038
|
+
return;
|
|
12039
|
+
}
|
|
12040
|
+
var anchorBlock$1 = anchorBlock(this.editor);
|
|
12041
|
+
if (!inlineToolbar || !anchorBlock$1) {
|
|
12042
|
+
return;
|
|
12043
|
+
}
|
|
12044
|
+
var editor = this.editor;
|
|
12045
|
+
var selection = editor.selection;
|
|
12046
|
+
if (!selection ||
|
|
12047
|
+
!i1.AngularEditor.isFocused(editor) ||
|
|
12048
|
+
slate.Range.isCollapsed(selection) ||
|
|
12049
|
+
slate.Editor.string(editor, selection) === '') {
|
|
12050
|
+
inlineToolbar.removeAttribute('style');
|
|
12051
|
+
return;
|
|
12052
|
+
}
|
|
12053
|
+
if (!THE_INLINE_TOOLBAR_TYPES.includes(anchorBlock$1.type)) {
|
|
12054
|
+
return;
|
|
12055
|
+
}
|
|
12056
|
+
var native = window.getSelection();
|
|
12057
|
+
if (native.type !== 'None') {
|
|
12058
|
+
var range = native.getRangeAt(0);
|
|
12059
|
+
this.updatePosition(inlineToolbar, range);
|
|
12060
|
+
}
|
|
12061
|
+
};
|
|
12062
|
+
TheInlineToolbarComponent.prototype.updatePosition = function (toolbarElement, range) {
|
|
12063
|
+
var e_1, _b;
|
|
12064
|
+
var boundary = range.getBoundingClientRect();
|
|
12065
|
+
if (!boundary || (boundary.height === 0 && boundary.width === 0 && range.startContainer === range.endContainer)) {
|
|
12066
|
+
if (range.startContainer.nodeType === 1 && range.startContainer.querySelector('img')) {
|
|
12067
|
+
boundary = range.startContainer.querySelector('img').getBoundingClientRect();
|
|
12068
|
+
}
|
|
12069
|
+
else {
|
|
12070
|
+
boundary = range.startContainer.getBoundingClientRect();
|
|
12071
|
+
}
|
|
12072
|
+
}
|
|
12073
|
+
var editableRect = document.querySelector('.the-editor-typo').getBoundingClientRect();
|
|
12074
|
+
var toolbarHeight = toolbarElement.offsetHeight;
|
|
12075
|
+
var toolbarWidth = toolbarElement.offsetWidth;
|
|
12076
|
+
var halfOffsetWidth = toolbarWidth / 2;
|
|
12077
|
+
var defaultLeft = -halfOffsetWidth;
|
|
12078
|
+
var offsetLeft = boundary.left - editableRect.left;
|
|
12079
|
+
var isTopLeft = offsetLeft - 30 > halfOffsetWidth; // 30: editable padding left
|
|
12080
|
+
var isTopRight = editableRect.width - offsetLeft - boundary.width / 2 < halfOffsetWidth;
|
|
12081
|
+
var positions = {};
|
|
12082
|
+
positions.top = boundary.top - toolbarHeight;
|
|
12083
|
+
positions.right = 'initial';
|
|
12084
|
+
positions.left = boundary.left;
|
|
12085
|
+
if (isTopLeft) {
|
|
12086
|
+
positions.left = boundary.left + boundary.width / 2 + defaultLeft;
|
|
12087
|
+
}
|
|
12088
|
+
if (isTopRight) {
|
|
12089
|
+
positions.left = boundary.right - toolbarWidth;
|
|
12090
|
+
}
|
|
12091
|
+
try {
|
|
12092
|
+
for (var _c = __values(Object.keys(positions)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
12093
|
+
var key = _d.value;
|
|
12094
|
+
toolbarElement.style[key] = positions[key] + (isNaN(positions[key]) ? '' : 'px');
|
|
12095
|
+
}
|
|
12096
|
+
}
|
|
12097
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
12098
|
+
finally {
|
|
12099
|
+
try {
|
|
12100
|
+
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
12101
|
+
}
|
|
12102
|
+
finally { if (e_1) throw e_1.error; }
|
|
12103
|
+
}
|
|
12104
|
+
toolbarElement.style.opacity = '1';
|
|
12105
|
+
};
|
|
12106
|
+
TheInlineToolbarComponent.prototype.ngOnDestroy = function () {
|
|
12107
|
+
this.destroy$.next();
|
|
12108
|
+
this.destroy$.complete();
|
|
12109
|
+
};
|
|
12110
|
+
return TheInlineToolbarComponent;
|
|
12111
|
+
}());
|
|
12112
|
+
TheInlineToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheInlineToolbarComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i2__namespace$1.ScrollDispatcher }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12113
|
+
TheInlineToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: { editor: "editor", toolbarItems: "toolbarItems" }, host: { properties: { "class.hide": "toolbarItems.length === 0" } }, viewQueries: [{ propertyName: "inlineToolbar", first: true, predicate: ["inlineToolbar"], descendants: true }], ngImport: i0__namespace, template: "<the-toolbar\n #inlineToolbar\n class=\"the-inline-toolbar\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarItems\"\n [isMore]=\"false\"\n ></the-toolbar> ", isInline: true, components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
12114
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheInlineToolbarComponent, decorators: [{
|
|
12115
|
+
type: i0.Component,
|
|
12116
|
+
args: [{
|
|
12117
|
+
selector: 'the-inline-toolbar',
|
|
12118
|
+
template: "<the-toolbar\n #inlineToolbar\n class=\"the-inline-toolbar\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarItems\"\n [isMore]=\"false\"\n ></the-toolbar> ",
|
|
12119
|
+
host: {
|
|
12120
|
+
'[class.hide]': 'toolbarItems.length === 0'
|
|
12121
|
+
},
|
|
12122
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
12123
|
+
}]
|
|
12124
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i2__namespace$1.ScrollDispatcher }, { type: i0__namespace.ChangeDetectorRef }, { type: i0__namespace.NgZone }]; }, propDecorators: { editor: [{
|
|
12125
|
+
type: i0.Input
|
|
12126
|
+
}], toolbarItems: [{
|
|
12127
|
+
type: i0.Input
|
|
12128
|
+
}], inlineToolbar: [{
|
|
12129
|
+
type: i0.ViewChild,
|
|
12130
|
+
args: ['inlineToolbar']
|
|
12131
|
+
}] } });
|
|
12132
|
+
|
|
12133
|
+
var TheQuickInsertComponent = /** @class */ (function () {
|
|
12134
|
+
function TheQuickInsertComponent(renderer, elementRef, cdr) {
|
|
12135
|
+
this.renderer = renderer;
|
|
12136
|
+
this.elementRef = elementRef;
|
|
12137
|
+
this.cdr = cdr;
|
|
12138
|
+
this.isHide = true;
|
|
12139
|
+
this.defaultIconName = 'plus-circle-thin';
|
|
12140
|
+
this.iconNameFill = 'plus-circle-thin-fill';
|
|
12141
|
+
this.displayIconName = this.defaultIconName;
|
|
12142
|
+
}
|
|
12143
|
+
TheQuickInsertComponent.prototype.handleMousedownNativeElement = function (event) {
|
|
12144
|
+
event.preventDefault();
|
|
12145
|
+
event.stopPropagation();
|
|
12146
|
+
};
|
|
12147
|
+
TheQuickInsertComponent.prototype.checkStatus = function () {
|
|
12148
|
+
var _a;
|
|
12149
|
+
var editor = this.editor;
|
|
12150
|
+
if (isCleanEmptyParagraph(editor)) {
|
|
12151
|
+
var block = slate.Node.ancestor(editor, [(_a = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path[0]]);
|
|
12152
|
+
var rootNode = i1.AngularEditor.toDOMNode(editor, block);
|
|
12153
|
+
this.isHide = false;
|
|
12154
|
+
this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
|
|
12155
|
+
return;
|
|
12156
|
+
}
|
|
12157
|
+
this.isHide = true;
|
|
12158
|
+
};
|
|
12159
|
+
TheQuickInsertComponent.prototype.updatePosition = function (left, top) {
|
|
12160
|
+
this.isHide = false;
|
|
12161
|
+
this.renderer.setStyle(this.elementRef.nativeElement, 'top', top + "px");
|
|
12162
|
+
this.renderer.setStyle(this.elementRef.nativeElement, 'left', left + "px");
|
|
12163
|
+
};
|
|
12164
|
+
TheQuickInsertComponent.prototype.mouseEnter = function (event) {
|
|
12165
|
+
this.displayIconName = this.iconNameFill;
|
|
12166
|
+
this.cdr.markForCheck();
|
|
12167
|
+
};
|
|
12168
|
+
TheQuickInsertComponent.prototype.mouseLeave = function (event) {
|
|
12169
|
+
this.displayIconName = this.defaultIconName;
|
|
12170
|
+
this.cdr.markForCheck();
|
|
12171
|
+
};
|
|
12172
|
+
TheQuickInsertComponent.prototype.handleClick = function (event) {
|
|
12173
|
+
event.stopPropagation();
|
|
12174
|
+
event.preventDefault();
|
|
12175
|
+
QuickInsertEditor.openQuickToolbar(this.editor, this.quickToolbarItems, this.iconElement.nativeElement);
|
|
12176
|
+
};
|
|
12177
|
+
return TheQuickInsertComponent;
|
|
12178
|
+
}());
|
|
12179
|
+
TheQuickInsertComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheQuickInsertComponent, deps: [{ token: i0__namespace.Renderer2 }, { token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12180
|
+
TheQuickInsertComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems" }, 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: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }] });
|
|
12181
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheQuickInsertComponent, decorators: [{
|
|
12182
|
+
type: i0.Component,
|
|
12183
|
+
args: [{
|
|
12184
|
+
selector: '[theQuickInsert]',
|
|
12185
|
+
templateUrl: './quick-insert.component.html',
|
|
12186
|
+
host: {
|
|
12187
|
+
class: 'the-quick-insert',
|
|
12188
|
+
'[class.hide]': 'isHide'
|
|
12189
|
+
}
|
|
12190
|
+
}]
|
|
12191
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.Renderer2 }, { type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }]; }, propDecorators: { editor: [{
|
|
12192
|
+
type: i0.Input
|
|
12193
|
+
}], quickToolbarItems: [{
|
|
12194
|
+
type: i0.Input
|
|
12195
|
+
}], iconElement: [{
|
|
12196
|
+
type: i0.ViewChild,
|
|
12197
|
+
args: ['iconElement', { read: i0.ElementRef, static: false }]
|
|
12198
|
+
}], handleMousedownNativeElement: [{
|
|
12199
|
+
type: i0.HostListener,
|
|
12200
|
+
args: ['mousedown', ['$event']]
|
|
12201
|
+
}] } });
|
|
12202
|
+
|
|
11571
12203
|
var ThePlaceholderComponent = /** @class */ (function () {
|
|
11572
12204
|
function ThePlaceholderComponent(renderer, elementRef) {
|
|
11573
12205
|
this.renderer = renderer;
|
|
11574
12206
|
this.elementRef = elementRef;
|
|
11575
12207
|
this.isHide = true;
|
|
11576
12208
|
}
|
|
11577
|
-
Object.defineProperty(ThePlaceholderComponent.prototype, "selection", {
|
|
11578
|
-
get: function () {
|
|
11579
|
-
return this.editor.selection;
|
|
11580
|
-
},
|
|
11581
|
-
enumerable: false,
|
|
11582
|
-
configurable: true
|
|
11583
|
-
});
|
|
11584
12209
|
ThePlaceholderComponent.prototype.handleCompositionStart = function () {
|
|
11585
|
-
|
|
12210
|
+
var _a;
|
|
12211
|
+
if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.selection) {
|
|
12212
|
+
this.hide();
|
|
12213
|
+
}
|
|
11586
12214
|
};
|
|
11587
12215
|
ThePlaceholderComponent.prototype.handleCompositionEnd = function (event) {
|
|
11588
12216
|
if (!event.data) {
|
|
11589
12217
|
this.checkStatus();
|
|
11590
12218
|
}
|
|
11591
12219
|
};
|
|
11592
|
-
ThePlaceholderComponent.prototype.checkStatus = function (
|
|
12220
|
+
ThePlaceholderComponent.prototype.checkStatus = function () {
|
|
12221
|
+
var _this = this;
|
|
12222
|
+
var _a, _b;
|
|
11593
12223
|
var editor = this.editor;
|
|
11594
|
-
var children = value ? value : editor.children;
|
|
11595
12224
|
// empty content and no selection processing
|
|
11596
|
-
if (
|
|
11597
|
-
|
|
11598
|
-
this.
|
|
12225
|
+
if (!(editor === null || editor === void 0 ? void 0 : editor.selection) && isEmptyContent(editor.children)) {
|
|
12226
|
+
// normal top is 28, but margin-top: -41px is set when maxHeight is set, so top is 69
|
|
12227
|
+
var firstTop = ((_a = this.options) === null || _a === void 0 ? void 0 : _a.maxHeight) ? 69 : 28;
|
|
12228
|
+
this.updatePosition(30, firstTop);
|
|
11599
12229
|
return;
|
|
11600
12230
|
}
|
|
11601
|
-
if (
|
|
11602
|
-
var block = slate.Node.ancestor(editor, [
|
|
11603
|
-
var
|
|
11604
|
-
|
|
11605
|
-
|
|
11606
|
-
|
|
11607
|
-
|
|
11608
|
-
slate.Element.isElement(block) &&
|
|
11609
|
-
block.type === exports.ElementKinds.paragraph &&
|
|
11610
|
-
block.children.length === 1 &&
|
|
11611
|
-
slate.Text.isText(block.children[0]) &&
|
|
11612
|
-
!slate.Editor.isVoid(editor, block) &&
|
|
11613
|
-
!hasTextIndent &&
|
|
11614
|
-
!hasAlign) {
|
|
11615
|
-
var rootNode = i1.AngularEditor.toDOMNode(this.editor, block);
|
|
11616
|
-
this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
|
|
11617
|
-
return;
|
|
11618
|
-
}
|
|
12231
|
+
if (isCleanEmptyParagraph(editor)) {
|
|
12232
|
+
var block = slate.Node.ancestor(editor, [(_b = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _b === void 0 ? void 0 : _b.anchor.path[0]]);
|
|
12233
|
+
var rootNode_1 = i1.AngularEditor.toDOMNode(editor, block);
|
|
12234
|
+
setTimeout(function () {
|
|
12235
|
+
_this.updatePosition(rootNode_1.offsetLeft, rootNode_1.offsetTop);
|
|
12236
|
+
});
|
|
12237
|
+
return;
|
|
11619
12238
|
}
|
|
11620
|
-
this.
|
|
12239
|
+
this.isHide = true;
|
|
11621
12240
|
};
|
|
11622
12241
|
ThePlaceholderComponent.prototype.updatePosition = function (left, top) {
|
|
11623
12242
|
this.isHide = false;
|
|
@@ -11630,12 +12249,12 @@
|
|
|
11630
12249
|
return ThePlaceholderComponent;
|
|
11631
12250
|
}());
|
|
11632
12251
|
ThePlaceholderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: ThePlaceholderComponent, deps: [{ token: i0__namespace.Renderer2 }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
11633
|
-
ThePlaceholderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: { editor: "editor",
|
|
12252
|
+
ThePlaceholderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: { editor: "editor", options: "options" }, host: { listeners: { "document:compositionstart": "handleCompositionStart()", "document:compositionend": "handleCompositionEnd($event)" }, properties: { "class.hide": "isHide" }, classAttribute: "the-placeholder" }, ngImport: i0__namespace, template: "{{ options?.placeholder }}", isInline: true });
|
|
11634
12253
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: ThePlaceholderComponent, decorators: [{
|
|
11635
12254
|
type: i0.Component,
|
|
11636
12255
|
args: [{
|
|
11637
12256
|
selector: 'div[thePlaceholder]',
|
|
11638
|
-
template: "{{ placeholder }}",
|
|
12257
|
+
template: "{{ options?.placeholder }}",
|
|
11639
12258
|
host: {
|
|
11640
12259
|
class: 'the-placeholder',
|
|
11641
12260
|
'[class.hide]': 'isHide'
|
|
@@ -11643,9 +12262,7 @@
|
|
|
11643
12262
|
}]
|
|
11644
12263
|
}], ctorParameters: function () { return [{ type: i0__namespace.Renderer2 }, { type: i0__namespace.ElementRef }]; }, propDecorators: { editor: [{
|
|
11645
12264
|
type: i0.Input
|
|
11646
|
-
}],
|
|
11647
|
-
type: i0.Input
|
|
11648
|
-
}], placeholder: [{
|
|
12265
|
+
}], options: [{
|
|
11649
12266
|
type: i0.Input
|
|
11650
12267
|
}], handleCompositionStart: [{
|
|
11651
12268
|
type: i0.HostListener,
|
|
@@ -11731,7 +12348,6 @@
|
|
|
11731
12348
|
_this.theOnDOMEvent = new i0.EventEmitter();
|
|
11732
12349
|
_this.theEditorCreated = new i0.EventEmitter();
|
|
11733
12350
|
_this._plugins = [];
|
|
11734
|
-
_this.globalToolbarItems = [];
|
|
11735
12351
|
_this.autoScrollView = _.debounce(function (editor, scrollContainer) {
|
|
11736
12352
|
return autoScrollViewHandle(editor, scrollContainer);
|
|
11737
12353
|
}, 80);
|
|
@@ -11822,9 +12438,6 @@
|
|
|
11822
12438
|
_this.onSlaCompositionEnd = function (event) { };
|
|
11823
12439
|
_this.onSlaDragStart = function (event) { };
|
|
11824
12440
|
_this.onSlaDragOver = function (event) { };
|
|
11825
|
-
_this.trackBy = function (element) {
|
|
11826
|
-
return element.key;
|
|
11827
|
-
};
|
|
11828
12441
|
return _this;
|
|
11829
12442
|
}
|
|
11830
12443
|
Object.defineProperty(TheEditorComponent.prototype, "theGlobalToolbarInstance", {
|
|
@@ -11842,6 +12455,14 @@
|
|
|
11842
12455
|
enumerable: false,
|
|
11843
12456
|
configurable: true
|
|
11844
12457
|
});
|
|
12458
|
+
Object.defineProperty(TheEditorComponent.prototype, "quickToolbarItems", {
|
|
12459
|
+
get: function () {
|
|
12460
|
+
var _a;
|
|
12461
|
+
return (_a = this.toolbarEntity) === null || _a === void 0 ? void 0 : _a.quick;
|
|
12462
|
+
},
|
|
12463
|
+
enumerable: false,
|
|
12464
|
+
configurable: true
|
|
12465
|
+
});
|
|
11845
12466
|
TheEditorComponent.prototype.ngOnInit = function () {
|
|
11846
12467
|
this.initialize();
|
|
11847
12468
|
this.onErrorHandler();
|
|
@@ -11898,22 +12519,23 @@
|
|
|
11898
12519
|
var _a;
|
|
11899
12520
|
var toolbar = (_a = this === null || this === void 0 ? void 0 : this.theOptions) === null || _a === void 0 ? void 0 : _a.toolbar;
|
|
11900
12521
|
var toolbarItems = toolbarCompose(toolbar === null || toolbar === void 0 ? void 0 : toolbar.toolbarItems);
|
|
11901
|
-
var toolbarOption = this.toolbarService.initialize(toolbarItems, toolbar === null || toolbar === void 0 ? void 0 : toolbar.global, toolbar === null || toolbar === void 0 ? void 0 : toolbar.
|
|
11902
|
-
this.
|
|
12522
|
+
var toolbarOption = this.toolbarService.initialize(toolbarItems, toolbar === null || toolbar === void 0 ? void 0 : toolbar.global, toolbar === null || toolbar === void 0 ? void 0 : toolbar.inline, toolbar === null || toolbar === void 0 ? void 0 : toolbar.quick);
|
|
12523
|
+
this.globalToolbarClass = ['the-global-toolbar', getToolbarClass(this.editor)];
|
|
12524
|
+
this.toolbarEntity = toolbarOption.toolbarEntity;
|
|
11903
12525
|
if (this.theGlobalToolbar) {
|
|
11904
12526
|
this.theGlobalToolbarInstance.editor = this.editor;
|
|
11905
12527
|
this.theGlobalToolbarInstance.toolbarItems = toolbarOption.toolbarEntity.global;
|
|
12528
|
+
this.theGlobalToolbarInstance.containerClass = this.globalToolbarClass;
|
|
11906
12529
|
this.theGlobalToolbarInstance.align = toolbar === null || toolbar === void 0 ? void 0 : toolbar.align;
|
|
11907
12530
|
this.theGlobalToolbarInstance.setToolbarClass();
|
|
11908
12531
|
this.theGlobalToolbarInstance.renderToolbarView();
|
|
11909
12532
|
}
|
|
11910
12533
|
};
|
|
11911
12534
|
TheEditorComponent.prototype.writeValue = function (value) {
|
|
11912
|
-
var _a
|
|
12535
|
+
var _a;
|
|
11913
12536
|
var data = dataDeserialize((_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.mode, value);
|
|
11914
12537
|
// data-deserialize
|
|
11915
12538
|
this.editorValue = data;
|
|
11916
|
-
(_b = this.placeholderInstance) === null || _b === void 0 ? void 0 : _b.checkStatus(data);
|
|
11917
12539
|
};
|
|
11918
12540
|
TheEditorComponent.prototype.registerOnChange = function (fn) {
|
|
11919
12541
|
this.onChangeCallback = fn;
|
|
@@ -11924,7 +12546,8 @@
|
|
|
11924
12546
|
TheEditorComponent.prototype.valueChange = function (value) {
|
|
11925
12547
|
var _a, _b, _c, _d, _e;
|
|
11926
12548
|
(_a = this.theGlobalToolbarInstance) === null || _a === void 0 ? void 0 : _a.statusChange(this.editor);
|
|
11927
|
-
(_b = this.
|
|
12549
|
+
(_b = this.quickInsertInstance) === null || _b === void 0 ? void 0 : _b.checkStatus();
|
|
12550
|
+
this.placeholderInstance.checkStatus();
|
|
11928
12551
|
// auto scroll view
|
|
11929
12552
|
var scrollContainer = (_c = this.theOptions) === null || _c === void 0 ? void 0 : _c.scrollContainer;
|
|
11930
12553
|
var maxHeight = (_d = this.theOptions) === null || _d === void 0 ? void 0 : _d.maxHeight;
|
|
@@ -12058,7 +12681,7 @@
|
|
|
12058
12681
|
useExisting: i0.forwardRef(function () { return TheEditorComponent; }),
|
|
12059
12682
|
multi: true
|
|
12060
12683
|
}
|
|
12061
|
-
], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }, { propertyName: "placeholderInstance", first: true, predicate: ["placeholder"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"
|
|
12684
|
+
], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }, { propertyName: "quickInsertInstance", first: true, predicate: ["quickInsert"], descendants: true, static: true }, { propertyName: "placeholderInstance", first: true, predicate: ["placeholder"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n [ngClass]=\"{\n 'the-editor-disabled': theOptions?.disabled,\n 'max-height': maxHeight\n }\"\n [ngStyle]=\"{ 'max-height': maxHeight }\"\n>\n <slate-editable\n class=\"the-editor-typo\"\n [editor]=\"editor\"\n [ngModel]=\"editorValue\"\n (ngModelChange)=\"valueChange($event)\"\n [decorate]=\"decorate\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar *ngIf=\"!theOptions?.readonly\" [editor]=\"editor\" [toolbarItems]=\"toolbarEntity.inline\"></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [quickToolbarItems]=\"quickToolbarItems\"></div>\n <div #placeholder thePlaceholder [editor]=\"editor\" [options]=\"theOptions\"></div>\n <the-template #templateInstance></the-template>\n</div>\n", components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }, { type: i1__namespace.SlateEditableComponent, selector: "slate-editable", inputs: ["editor", "renderElement", "renderLeaf", "renderText", "decorate", "isStrictDecorate", "trackBy", "readonly", "beforeInput", "blur", "click", "compositionEnd", "compositionStart", "copy", "cut", "dragOver", "dragStart", "dragEnd", "drop", "focus", "keydown", "paste", "spellCheck", "autoCorrect", "autoCapitalize"] }, { type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: ["editor", "toolbarItems"] }, { type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: ["editor", "quickToolbarItems"] }, { type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: ["editor", "options"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4__namespace$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
12062
12685
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheEditorComponent, decorators: [{
|
|
12063
12686
|
type: i0.Component,
|
|
12064
12687
|
args: [{
|
|
@@ -12101,6 +12724,9 @@
|
|
|
12101
12724
|
}], globalToolbarInstance: [{
|
|
12102
12725
|
type: i0.ViewChild,
|
|
12103
12726
|
args: ['globalToolbar']
|
|
12727
|
+
}], quickInsertInstance: [{
|
|
12728
|
+
type: i0.ViewChild,
|
|
12729
|
+
args: ['quickInsert', { static: true }]
|
|
12104
12730
|
}], placeholderInstance: [{
|
|
12105
12731
|
type: i0.ViewChild,
|
|
12106
12732
|
args: ['placeholder']
|
|
@@ -12236,7 +12862,7 @@
|
|
|
12236
12862
|
return TheToolbarGroupComponent;
|
|
12237
12863
|
}());
|
|
12238
12864
|
TheToolbarGroupComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarGroupComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$3.ThyPopover }, { token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12239
|
-
TheToolbarGroupComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "isMore", "afterTemplate"] }], directives: [{ type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
12865
|
+
TheToolbarGroupComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", 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: i2__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], directives: [{ type: i7__namespace.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
12240
12866
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarGroupComponent, decorators: [{
|
|
12241
12867
|
type: i0.Component,
|
|
12242
12868
|
args: [{
|
|
@@ -12267,7 +12893,7 @@
|
|
|
12267
12893
|
i2$1.ThyNavModule,
|
|
12268
12894
|
i2$2.ThyFormModule,
|
|
12269
12895
|
i5$3.ThySharedModule,
|
|
12270
|
-
|
|
12896
|
+
i2$3.ThyListModule,
|
|
12271
12897
|
i7.ThyTooltipModule,
|
|
12272
12898
|
i4.ThyProgressModule,
|
|
12273
12899
|
autocomplete.ThyAutocompleteModule,
|
|
@@ -12283,10 +12909,12 @@
|
|
|
12283
12909
|
TheToolbarDropdownComponent,
|
|
12284
12910
|
TheToolbarGroupComponent,
|
|
12285
12911
|
TheToolbarItemComponent,
|
|
12912
|
+
TheInlineToolbarComponent,
|
|
12286
12913
|
NavSplitLineComponent,
|
|
12287
12914
|
TheTextComponent,
|
|
12288
12915
|
TheDefaultElementComponent,
|
|
12289
|
-
|
|
12916
|
+
TheQuickInsertComponent,
|
|
12917
|
+
TheQuickToolbarComponent,
|
|
12290
12918
|
TheColorSelectComponent,
|
|
12291
12919
|
TheColorToolbarItemComponent,
|
|
12292
12920
|
TheContextMenuComponent,
|
|
@@ -12313,7 +12941,8 @@
|
|
|
12313
12941
|
TheTableToolbarComponent,
|
|
12314
12942
|
TheTableComponent,
|
|
12315
12943
|
TheTableRowComponent,
|
|
12316
|
-
TheTdComponent
|
|
12944
|
+
TheTdComponent,
|
|
12945
|
+
ThePlaceholderComponent
|
|
12317
12946
|
];
|
|
12318
12947
|
var PIPES = [ElementStylePipe, ElementClassPipe];
|
|
12319
12948
|
var TheEditorModule = /** @class */ (function () {
|
|
@@ -12326,10 +12955,12 @@
|
|
|
12326
12955
|
TheToolbarDropdownComponent,
|
|
12327
12956
|
TheToolbarGroupComponent,
|
|
12328
12957
|
TheToolbarItemComponent,
|
|
12958
|
+
TheInlineToolbarComponent,
|
|
12329
12959
|
NavSplitLineComponent,
|
|
12330
12960
|
TheTextComponent,
|
|
12331
12961
|
TheDefaultElementComponent,
|
|
12332
|
-
|
|
12962
|
+
TheQuickInsertComponent,
|
|
12963
|
+
TheQuickToolbarComponent,
|
|
12333
12964
|
TheColorSelectComponent,
|
|
12334
12965
|
TheColorToolbarItemComponent,
|
|
12335
12966
|
TheContextMenuComponent,
|
|
@@ -12353,12 +12984,13 @@
|
|
|
12353
12984
|
TheTableToolbarComponent,
|
|
12354
12985
|
TheTableComponent,
|
|
12355
12986
|
TheTableRowComponent,
|
|
12356
|
-
TheTdComponent
|
|
12987
|
+
TheTdComponent,
|
|
12988
|
+
ThePlaceholderComponent], imports: [i6.CommonModule, i1.SlateModule, i4$2.FormsModule, i4$1.ThyIconModule,
|
|
12357
12989
|
avatar.ThyAvatarModule,
|
|
12358
12990
|
i2$1.ThyNavModule,
|
|
12359
12991
|
i2$2.ThyFormModule,
|
|
12360
12992
|
i5$3.ThySharedModule,
|
|
12361
|
-
|
|
12993
|
+
i2$3.ThyListModule,
|
|
12362
12994
|
i7.ThyTooltipModule,
|
|
12363
12995
|
i4.ThyProgressModule,
|
|
12364
12996
|
autocomplete.ThyAutocompleteModule,
|
|
@@ -12405,7 +13037,6 @@
|
|
|
12405
13037
|
exports.AlignEditor = AlignEditor;
|
|
12406
13038
|
exports.BLOCK_DELETEBACKWARD_TYPES = BLOCK_DELETEBACKWARD_TYPES;
|
|
12407
13039
|
exports.BLOCK_INSERT_ORIGIN = BLOCK_INSERT_ORIGIN;
|
|
12408
|
-
exports.BLOCK_TOOLBAR_HOTKEY = BLOCK_TOOLBAR_HOTKEY;
|
|
12409
13040
|
exports.BlockquoteEditor = BlockquoteEditor;
|
|
12410
13041
|
exports.CLIPBOARD_FORMAT_KEY = CLIPBOARD_FORMAT_KEY;
|
|
12411
13042
|
exports.CODEMIRROR_PADDING_TOP = CODEMIRROR_PADDING_TOP;
|
|
@@ -12417,10 +13048,10 @@
|
|
|
12417
13048
|
exports.ColorEditor = ColorEditor;
|
|
12418
13049
|
exports.DEFAULT_LANGUAGE = DEFAULT_LANGUAGE;
|
|
12419
13050
|
exports.DEFAULT_SCROLL_CONTAINER = DEFAULT_SCROLL_CONTAINER;
|
|
12420
|
-
exports.DefaultBlockToolbarDefinition = DefaultBlockToolbarDefinition;
|
|
12421
13051
|
exports.DefaultElementOptions = DefaultElementOptions;
|
|
12422
13052
|
exports.DefaultGlobalToolbarDefinition = DefaultGlobalToolbarDefinition;
|
|
12423
13053
|
exports.DefaultInlineToolbarDefinition = DefaultInlineToolbarDefinition;
|
|
13054
|
+
exports.DefaultQuickToolbarDefinition = DefaultQuickToolbarDefinition;
|
|
12424
13055
|
exports.ELEMENT_UNIQUE_ID = ELEMENT_UNIQUE_ID;
|
|
12425
13056
|
exports.HEADING_TYPES = HEADING_TYPES;
|
|
12426
13057
|
exports.HeadingEditor = HeadingEditor;
|
|
@@ -12435,11 +13066,14 @@
|
|
|
12435
13066
|
exports.PICTURE_ACCEPTED_UPLOAD_MIME = PICTURE_ACCEPTED_UPLOAD_MIME;
|
|
12436
13067
|
exports.PICTURE_ACCEPTED_UPLOAD_SIZE = PICTURE_ACCEPTED_UPLOAD_SIZE;
|
|
12437
13068
|
exports.PLUGIN_COMPONENTS = PLUGIN_COMPONENTS;
|
|
13069
|
+
exports.QUICK_TOOLBAR_HOTKEY = QUICK_TOOLBAR_HOTKEY;
|
|
13070
|
+
exports.QuickInsertEditor = QuickInsertEditor;
|
|
12438
13071
|
exports.STANDARD_HEADING_TYPES = STANDARD_HEADING_TYPES;
|
|
12439
13072
|
exports.TAB_SPACE = TAB_SPACE;
|
|
12440
13073
|
exports.THE_CODE_MODE_PROVIDER = THE_CODE_MODE_PROVIDER;
|
|
12441
13074
|
exports.THE_CODE_MODE_TOKEN = THE_CODE_MODE_TOKEN;
|
|
12442
13075
|
exports.THE_EDITOR_CONVERSION_HINT_REF = THE_EDITOR_CONVERSION_HINT_REF;
|
|
13076
|
+
exports.THE_EDITOR_QUICK_TOOLBAR_REF = THE_EDITOR_QUICK_TOOLBAR_REF;
|
|
12443
13077
|
exports.THE_EDITOR_UUID = THE_EDITOR_UUID;
|
|
12444
13078
|
exports.THE_INLINE_TOOLBAR_TYPES = THE_INLINE_TOOLBAR_TYPES;
|
|
12445
13079
|
exports.THE_UPLOAD_SERVICE_TOKEN = THE_UPLOAD_SERVICE_TOKEN;
|
|
@@ -12453,6 +13087,7 @@
|
|
|
12453
13087
|
exports.TheEditorModule = TheEditorModule;
|
|
12454
13088
|
exports.TheImageComponent = TheImageComponent;
|
|
12455
13089
|
exports.TheQueries = index$1;
|
|
13090
|
+
exports.TheToolbarBaseItemComponent = TheToolbarBaseItemComponent;
|
|
12456
13091
|
exports.TheToolbarComponent = TheToolbarComponent;
|
|
12457
13092
|
exports.TheToolbarDropdownComponent = TheToolbarDropdownComponent;
|
|
12458
13093
|
exports.TheToolbarGroupComponent = TheToolbarGroupComponent;
|