@worktile/theia 2.1.2 → 2.1.6
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 +426 -221
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/components/toolbar/toolbar.component.d.ts +1 -3
- package/constants/default.d.ts +1 -1
- package/constants/node-types.d.ts +4 -3
- package/custom-types.d.ts +4 -1
- package/editor.component.d.ts +0 -2
- package/editor.module.d.ts +4 -5
- package/esm2015/components/inline-toolbar/inline-toolbar.component.js +1 -1
- package/esm2015/components/toolbar/toolbar.component.js +9 -8
- package/esm2015/components/toolbar-group/toolbar-group.component.js +1 -1
- package/esm2015/constants/auto-format-rules.js +8 -3
- package/esm2015/constants/default.js +2 -2
- package/esm2015/constants/node-types.js +5 -4
- package/esm2015/constants/toolbar.js +5 -5
- package/esm2015/custom-types.js +1 -1
- package/esm2015/editor.component.js +24 -22
- package/esm2015/editor.module.js +4 -4
- package/esm2015/interfaces/auto-format.js +1 -1
- package/esm2015/interfaces/editor.js +1 -1
- package/esm2015/interfaces/element.js +1 -1
- package/esm2015/plugins/autoformat/autoformat.plugin.js +2 -1
- package/esm2015/plugins/autoformat/transforms/auto-format-inline.js +27 -14
- package/esm2015/plugins/code/code.component.js +26 -10
- package/esm2015/plugins/deserializers/deserialize-md.plugin.js +2 -2
- package/esm2015/plugins/font-size/font-size.editor.js +35 -1
- package/esm2015/plugins/heading/heading.editor.js +3 -1
- package/esm2015/plugins/index.js +7 -3
- package/esm2015/plugins/inline-code/inline-code.component.js +27 -0
- package/esm2015/plugins/inline-code/inline-code.editor.js +45 -0
- package/esm2015/plugins/inline-code/inline-code.plugin.js +46 -0
- package/esm2015/plugins/inline-code/options.js +14 -0
- package/esm2015/plugins/link/link.component.js +4 -2
- package/esm2015/plugins/list/components/list-item.component.js +69 -1
- package/esm2015/plugins/list/transforms/insert-list-item.js +11 -7
- package/esm2015/plugins/mark/mark.plugin.js +15 -10
- package/esm2015/plugins/mark/options.js +1 -9
- package/esm2015/plugins/quick-insert/components/quick-insert.component.js +10 -9
- package/esm2015/services/context.service.js +9 -1
- package/esm2015/shortcuts/mark.js +10 -4
- package/esm2015/transforms/handle-continual-insert-break.js +1 -4
- package/esm2015/utils/index.js +2 -1
- package/fesm2015/worktile-theia.js +395 -204
- package/fesm2015/worktile-theia.js.map +1 -1
- package/interfaces/auto-format.d.ts +1 -1
- package/interfaces/editor.d.ts +3 -3
- package/interfaces/element.d.ts +1 -1
- package/package.json +1 -1
- package/plugins/autoformat/transforms/auto-format-inline.d.ts +3 -1
- package/plugins/code/code.component.d.ts +6 -3
- package/plugins/code/code.component.scss +17 -0
- package/plugins/font-size/font-size.editor.d.ts +2 -0
- package/plugins/inline-code/inline-code.component.d.ts +14 -0
- package/plugins/inline-code/inline-code.component.scss +13 -0
- package/plugins/inline-code/inline-code.editor.d.ts +7 -0
- package/plugins/inline-code/inline-code.plugin.d.ts +2 -0
- package/plugins/inline-code/options.d.ts +2 -0
- package/plugins/list/components/list-item.component.d.ts +7 -0
- package/plugins/quick-insert/components/quick-insert.component.d.ts +2 -1
- package/queries/get-container-blocks.d.ts +1 -1
- package/queries/get-selection-marks.d.ts +1 -1
- package/services/context.service.d.ts +5 -1
- package/styles/editor.scss +20 -1
- package/styles/index.scss +1 -1
- package/transforms/set-marks.d.ts +1 -1
- package/utils/index.d.ts +1 -0
- package/esm2015/plugins/placeholder/placeholder.component.js +0 -83
- package/plugins/placeholder/placeholder.component.d.ts +0 -21
- package/plugins/placeholder/placeholder.component.scss +0 -10
|
@@ -375,10 +375,10 @@
|
|
|
375
375
|
var A_TAG_REL_ATTR = 'noopener noreferrer nofollow external ugc';
|
|
376
376
|
var LINK_DEFAULT_TEXT = '链接';
|
|
377
377
|
var TAB_SPACE = ' ';
|
|
378
|
-
var ZERO_WIDTH_CHAR = '\u200B';
|
|
379
378
|
var CLIPBOARD_FORMAT_KEY = 'x-theia-fragment';
|
|
380
379
|
var DEFAULT_SCROLL_CONTAINER = '.the-editable-container';
|
|
381
380
|
var ELEMENT_UNIQUE_ID = 'key';
|
|
381
|
+
var ZERO_WIDTH_CHAR = '\u200B';
|
|
382
382
|
exports.TheMode = void 0;
|
|
383
383
|
(function (TheMode) {
|
|
384
384
|
TheMode["fullMode"] = "full";
|
|
@@ -409,6 +409,7 @@
|
|
|
409
409
|
ElementKinds["hr"] = "hr";
|
|
410
410
|
ElementKinds["link"] = "link";
|
|
411
411
|
ElementKinds["default"] = "paragraph";
|
|
412
|
+
ElementKinds["inlineCode"] = "inline-code";
|
|
412
413
|
})(exports.ElementKinds || (exports.ElementKinds = {}));
|
|
413
414
|
exports.Alignment = void 0;
|
|
414
415
|
(function (Alignment) {
|
|
@@ -458,8 +459,8 @@
|
|
|
458
459
|
MarkTypes["strike"] = "strike";
|
|
459
460
|
MarkTypes["color"] = "color";
|
|
460
461
|
MarkTypes["backgroundColor"] = "background-color";
|
|
461
|
-
MarkTypes["codeLine"] = "code-line";
|
|
462
462
|
MarkTypes["fontSize"] = "font-size";
|
|
463
|
+
MarkTypes["codeLine"] = "code-line";
|
|
463
464
|
})(exports.MarkTypes || (exports.MarkTypes = {}));
|
|
464
465
|
exports.ToolbarActionTypes = void 0;
|
|
465
466
|
(function (ToolbarActionTypes) {
|
|
@@ -484,12 +485,12 @@
|
|
|
484
485
|
var MarkProps = [
|
|
485
486
|
exports.MarkTypes.backgroundColor,
|
|
486
487
|
exports.MarkTypes.bold,
|
|
487
|
-
exports.MarkTypes.codeLine,
|
|
488
488
|
exports.MarkTypes.color,
|
|
489
489
|
exports.MarkTypes.italic,
|
|
490
490
|
exports.MarkTypes.strike,
|
|
491
491
|
exports.MarkTypes.underline,
|
|
492
|
-
exports.MarkTypes.fontSize
|
|
492
|
+
exports.MarkTypes.fontSize,
|
|
493
|
+
exports.MarkTypes.codeLine
|
|
493
494
|
];
|
|
494
495
|
var THE_INLINE_TOOLBAR_TYPES = [exports.ElementKinds.default, exports.ElementKinds.listItem, exports.ElementKinds.checkItem];
|
|
495
496
|
var STANDARD_HEADING_TYPES = [
|
|
@@ -525,7 +526,7 @@
|
|
|
525
526
|
exports.MarkTypes.italic,
|
|
526
527
|
exports.MarkTypes.underline,
|
|
527
528
|
exports.MarkTypes.strike,
|
|
528
|
-
exports.
|
|
529
|
+
exports.ElementKinds.inlineCode,
|
|
529
530
|
exports.MarkTypes.color,
|
|
530
531
|
exports.MarkTypes.backgroundColor,
|
|
531
532
|
exports.ToolbarActionTypes.split,
|
|
@@ -534,7 +535,7 @@
|
|
|
534
535
|
exports.ToolbarActionTypes.split,
|
|
535
536
|
exports.ElementKinds.numberedList,
|
|
536
537
|
exports.ElementKinds.bulletedList,
|
|
537
|
-
|
|
538
|
+
// ElementKinds.checkItem,
|
|
538
539
|
exports.ToolbarActionTypes.split,
|
|
539
540
|
exports.ElementKinds.link,
|
|
540
541
|
exports.ElementKinds.image,
|
|
@@ -549,7 +550,7 @@
|
|
|
549
550
|
exports.MarkTypes.italic,
|
|
550
551
|
exports.MarkTypes.underline,
|
|
551
552
|
exports.MarkTypes.strike,
|
|
552
|
-
exports.
|
|
553
|
+
exports.ElementKinds.inlineCode,
|
|
553
554
|
exports.MarkTypes.color,
|
|
554
555
|
exports.MarkTypes.backgroundColor,
|
|
555
556
|
exports.ToolbarActionTypes.split,
|
|
@@ -561,7 +562,7 @@
|
|
|
561
562
|
exports.ToolbarActionTypes.split,
|
|
562
563
|
exports.ElementKinds.numberedList,
|
|
563
564
|
exports.ElementKinds.bulletedList,
|
|
564
|
-
|
|
565
|
+
// ElementKinds.checkItem,
|
|
565
566
|
exports.ToolbarActionTypes.split,
|
|
566
567
|
exports.ElementKinds.link,
|
|
567
568
|
exports.ElementKinds.image,
|
|
@@ -1940,9 +1941,6 @@
|
|
|
1940
1941
|
var aboveResult = slate.Editor.above(editor, {
|
|
1941
1942
|
match: function (n) { return slate.Editor.isBlock(editor, n) && n.type === type; }
|
|
1942
1943
|
});
|
|
1943
|
-
if (isEnd) {
|
|
1944
|
-
editor.marks = {};
|
|
1945
|
-
}
|
|
1946
1944
|
if (aboveResult && aboveResult[0] && isEnd && isEmpty) {
|
|
1947
1945
|
var wrapBlock = aboveResult[0];
|
|
1948
1946
|
if (wrapBlock.type === type) {
|
|
@@ -2164,6 +2162,50 @@
|
|
|
2164
2162
|
}
|
|
2165
2163
|
};
|
|
2166
2164
|
|
|
2165
|
+
var InlineCodeEditor = {
|
|
2166
|
+
toggleInlineCode: function (editor, text) {
|
|
2167
|
+
var isActive = InlineCodeEditor.isInlineCodeActive(editor);
|
|
2168
|
+
if (isActive) {
|
|
2169
|
+
InlineCodeEditor.unwrapInlineCode(editor);
|
|
2170
|
+
return;
|
|
2171
|
+
}
|
|
2172
|
+
if (slate.Range.isCollapsed(editor.selection)) {
|
|
2173
|
+
InlineCodeEditor.wrapInlineCode(editor, text);
|
|
2174
|
+
}
|
|
2175
|
+
else {
|
|
2176
|
+
var fragment = slate.Node.fragment(editor, editor.selection)[0];
|
|
2177
|
+
var selectNode = slate.Node.get(fragment, []);
|
|
2178
|
+
var selectText = slate.Node.string(selectNode);
|
|
2179
|
+
InlineCodeEditor.wrapInlineCode(editor, selectText);
|
|
2180
|
+
}
|
|
2181
|
+
},
|
|
2182
|
+
wrapInlineCode: function (editor, text) {
|
|
2183
|
+
if (text === void 0) { text = ''; }
|
|
2184
|
+
if (InlineCodeEditor.isInlineCodeActive(editor)) {
|
|
2185
|
+
InlineCodeEditor.unwrapInlineCode(editor);
|
|
2186
|
+
}
|
|
2187
|
+
var selection = editor.selection;
|
|
2188
|
+
var isCollapsed = selection && slate.Range.isCollapsed(selection);
|
|
2189
|
+
var inlineCode = {
|
|
2190
|
+
type: exports.ElementKinds.inlineCode,
|
|
2191
|
+
children: isCollapsed ? [{ text: text ? text : ZERO_WIDTH_CHAR }] : []
|
|
2192
|
+
};
|
|
2193
|
+
if (isCollapsed) {
|
|
2194
|
+
slate.Transforms.insertNodes(editor, inlineCode);
|
|
2195
|
+
}
|
|
2196
|
+
else {
|
|
2197
|
+
slate.Transforms.wrapNodes(editor, inlineCode, { split: true });
|
|
2198
|
+
}
|
|
2199
|
+
},
|
|
2200
|
+
unwrapInlineCode: function (editor) {
|
|
2201
|
+
slate.Transforms.unwrapNodes(editor, { match: function (n) { return slate.Element.isElement(n) && n.type === exports.ElementKinds.inlineCode; } });
|
|
2202
|
+
},
|
|
2203
|
+
isInlineCodeActive: function (editor) {
|
|
2204
|
+
var _a = __read(slate.Editor.nodes(editor, { match: function (n) { return slate.Element.isElement(n) && n.type === exports.ElementKinds.inlineCode; } }), 1), inlineCode = _a[0];
|
|
2205
|
+
return !!inlineCode;
|
|
2206
|
+
}
|
|
2207
|
+
};
|
|
2208
|
+
|
|
2167
2209
|
var autoFormatRules = [
|
|
2168
2210
|
{
|
|
2169
2211
|
type: exports.ElementKinds.heading_1,
|
|
@@ -2221,10 +2263,13 @@
|
|
|
2221
2263
|
insertTrigger: true
|
|
2222
2264
|
},
|
|
2223
2265
|
{
|
|
2224
|
-
type: exports.
|
|
2266
|
+
type: exports.ElementKinds.inlineCode,
|
|
2225
2267
|
between: ['`', '`'],
|
|
2226
2268
|
mode: 'inline',
|
|
2227
|
-
|
|
2269
|
+
format: function (editor, text) {
|
|
2270
|
+
InlineCodeEditor.toggleInlineCode(editor, text);
|
|
2271
|
+
slate.Transforms.select(editor, slate.Editor.after(editor, editor.selection));
|
|
2272
|
+
}
|
|
2228
2273
|
},
|
|
2229
2274
|
{
|
|
2230
2275
|
type: exports.MarkTypes.strike,
|
|
@@ -2422,6 +2467,35 @@
|
|
|
2422
2467
|
var IS_MAC = typeof window != 'undefined' && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
|
|
2423
2468
|
var CONTROL_KEY = IS_MAC ? '⌘' : 'Ctrl';
|
|
2424
2469
|
|
|
2470
|
+
/**
|
|
2471
|
+
* whether the current node is a clean paragraph
|
|
2472
|
+
* @param editor
|
|
2473
|
+
* @param text
|
|
2474
|
+
* @returns boolean
|
|
2475
|
+
*/
|
|
2476
|
+
var isCleanEmptyParagraph = function (editor) {
|
|
2477
|
+
var isCollapsedCursor = TheEditor.isFocused(editor) && editor.selection && slate.Range.isCollapsed(editor.selection);
|
|
2478
|
+
if (!isCollapsedCursor) {
|
|
2479
|
+
return false;
|
|
2480
|
+
}
|
|
2481
|
+
var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
|
|
2482
|
+
var textIndent = 'textIndent';
|
|
2483
|
+
var align = 'align';
|
|
2484
|
+
var hasTextIndent = block[textIndent];
|
|
2485
|
+
var hasAlign = block[align];
|
|
2486
|
+
if (slate.Node.string(block) === '' &&
|
|
2487
|
+
slate.Element.isElement(block) &&
|
|
2488
|
+
block.type === exports.ElementKinds.paragraph &&
|
|
2489
|
+
block.children.length === 1 &&
|
|
2490
|
+
slate.Text.isText(block.children[0]) &&
|
|
2491
|
+
!slate.Editor.isVoid(editor, block) &&
|
|
2492
|
+
!hasTextIndent &&
|
|
2493
|
+
!hasAlign) {
|
|
2494
|
+
return true;
|
|
2495
|
+
}
|
|
2496
|
+
return false;
|
|
2497
|
+
};
|
|
2498
|
+
|
|
2425
2499
|
var withDeserializeMd = function (options) { return function (editor) {
|
|
2426
2500
|
var insertData = editor.insertData, onKeydown = editor.onKeydown;
|
|
2427
2501
|
editor.onKeydown = function (event) {
|
|
@@ -2449,7 +2523,7 @@
|
|
|
2449
2523
|
editor: editor,
|
|
2450
2524
|
conversion: function () {
|
|
2451
2525
|
try {
|
|
2452
|
-
var html = marked__default["default"](plainFragment, { gfm: true });
|
|
2526
|
+
var html = marked__default["default"](plainFragment.replace(/\n```/g, "\n\n```"), { gfm: true });
|
|
2453
2527
|
var htmlDom = new DOMParser().parseFromString(html, 'text/html');
|
|
2454
2528
|
var fragment_1 = selene.TheiaConverter.convertToTheia(Array.from(htmlDom.body.children));
|
|
2455
2529
|
if (!isUnformatted(fragment_1)) {
|
|
@@ -2709,6 +2783,13 @@
|
|
|
2709
2783
|
}
|
|
2710
2784
|
return this.options;
|
|
2711
2785
|
};
|
|
2786
|
+
TheContextService.prototype.getTheOptions = function () {
|
|
2787
|
+
return this.options.theOptions;
|
|
2788
|
+
};
|
|
2789
|
+
TheContextService.prototype.getDefaultFontSize = function () {
|
|
2790
|
+
var _a;
|
|
2791
|
+
return ((_a = this.options.theOptions) === null || _a === void 0 ? void 0 : _a.fontSize) || exports.FontSizes.fontSize14;
|
|
2792
|
+
};
|
|
2712
2793
|
TheContextService.prototype.getEditableElement = function () {
|
|
2713
2794
|
return this.options.nativeElement.querySelector('.the-editor-typo');
|
|
2714
2795
|
};
|
|
@@ -3429,14 +3510,17 @@
|
|
|
3429
3510
|
}
|
|
3430
3511
|
else {
|
|
3431
3512
|
/**
|
|
3432
|
-
* If end,
|
|
3513
|
+
* If end, split nodes
|
|
3433
3514
|
*/
|
|
3434
3515
|
slate.Editor.withoutNormalizing(editor, function () {
|
|
3435
|
-
slate.Transforms.
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3516
|
+
slate.Transforms.splitNodes(editor, {
|
|
3517
|
+
always: true,
|
|
3518
|
+
mode: 'highest',
|
|
3519
|
+
match: function (node) {
|
|
3520
|
+
var path = node && TheEditor.findPath(editor, node);
|
|
3521
|
+
return path && path.length === nextListItemPath_1.length;
|
|
3522
|
+
}
|
|
3523
|
+
});
|
|
3440
3524
|
});
|
|
3441
3525
|
}
|
|
3442
3526
|
/**
|
|
@@ -3839,9 +3923,84 @@
|
|
|
3839
3923
|
TheListItemComponent.prototype.ngOnInit = function () {
|
|
3840
3924
|
_super.prototype.ngOnInit.call(this);
|
|
3841
3925
|
};
|
|
3926
|
+
TheListItemComponent.prototype.onContextChange = function () {
|
|
3927
|
+
_super.prototype.onContextChange.call(this);
|
|
3928
|
+
this.addFontSize();
|
|
3929
|
+
this.addMultiDigit();
|
|
3930
|
+
};
|
|
3842
3931
|
TheListItemComponent.prototype.ngOnDestroy = function () {
|
|
3843
3932
|
_super.prototype.ngOnDestroy.call(this);
|
|
3844
3933
|
};
|
|
3934
|
+
TheListItemComponent.prototype.addFontSize = function () {
|
|
3935
|
+
var e_1, _c;
|
|
3936
|
+
var _a, _b;
|
|
3937
|
+
var firstText;
|
|
3938
|
+
try {
|
|
3939
|
+
for (var _d = __values(slate.Node.descendants(this.element)), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
3940
|
+
var entry = _e.value;
|
|
3941
|
+
var node = entry[0];
|
|
3942
|
+
if (slate.Text.isText(node) && !firstText) {
|
|
3943
|
+
firstText = node;
|
|
3944
|
+
break;
|
|
3945
|
+
}
|
|
3946
|
+
}
|
|
3947
|
+
}
|
|
3948
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
3949
|
+
finally {
|
|
3950
|
+
try {
|
|
3951
|
+
if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
|
|
3952
|
+
}
|
|
3953
|
+
finally { if (e_1) throw e_1.error; }
|
|
3954
|
+
}
|
|
3955
|
+
if (!firstText) {
|
|
3956
|
+
return;
|
|
3957
|
+
}
|
|
3958
|
+
var text = firstText.text, rest = __rest(firstText, ["text"]);
|
|
3959
|
+
var size = rest[exports.MarkTypes.fontSize];
|
|
3960
|
+
if (size) {
|
|
3961
|
+
var sizeClass = "font-size-" + size;
|
|
3962
|
+
var isContains = (_b = (_a = this.elementRef.nativeElement) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.contains(sizeClass);
|
|
3963
|
+
if (isContains) {
|
|
3964
|
+
return;
|
|
3965
|
+
}
|
|
3966
|
+
this.clearFontSize();
|
|
3967
|
+
this.elementRef.nativeElement.classList.add(sizeClass);
|
|
3968
|
+
this.fontSizeClass = sizeClass;
|
|
3969
|
+
}
|
|
3970
|
+
else {
|
|
3971
|
+
this.clearFontSize();
|
|
3972
|
+
}
|
|
3973
|
+
};
|
|
3974
|
+
TheListItemComponent.prototype.clearFontSize = function () {
|
|
3975
|
+
if (this.fontSizeClass) {
|
|
3976
|
+
this.elementRef.nativeElement.classList.remove(this.fontSizeClass);
|
|
3977
|
+
this.fontSizeClass = null;
|
|
3978
|
+
}
|
|
3979
|
+
};
|
|
3980
|
+
TheListItemComponent.prototype.getStart = function () {
|
|
3981
|
+
var parent = this.elementRef.nativeElement.closest('.slate-element-numbered-list');
|
|
3982
|
+
var start = (parent === null || parent === void 0 ? void 0 : parent.getAttribute('start')) || 1;
|
|
3983
|
+
return Number(start);
|
|
3984
|
+
};
|
|
3985
|
+
TheListItemComponent.prototype.getLiIndex = function () {
|
|
3986
|
+
var path = findPath(this.editor, this.element);
|
|
3987
|
+
var index = path[path.length - 1];
|
|
3988
|
+
return index || 0;
|
|
3989
|
+
};
|
|
3990
|
+
TheListItemComponent.prototype.addMultiDigit = function () {
|
|
3991
|
+
var start = this.getStart();
|
|
3992
|
+
var index = this.getLiIndex();
|
|
3993
|
+
var multiDigit = 'data-multi-digit';
|
|
3994
|
+
// start number + index
|
|
3995
|
+
// when it is greater than 9, it is a multi-digit serial number
|
|
3996
|
+
// exclude Font size >= 20
|
|
3997
|
+
if (start + index > 9) {
|
|
3998
|
+
this.elementRef.nativeElement.setAttribute(multiDigit, true);
|
|
3999
|
+
}
|
|
4000
|
+
else {
|
|
4001
|
+
this.elementRef.nativeElement.removeAttribute(multiDigit);
|
|
4002
|
+
}
|
|
4003
|
+
};
|
|
3845
4004
|
return TheListItemComponent;
|
|
3846
4005
|
}(TheBaseElementComponent));
|
|
3847
4006
|
TheListItemComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheListItemComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
@@ -4350,11 +4509,14 @@
|
|
|
4350
4509
|
delete marks[key];
|
|
4351
4510
|
editor.marks = marks;
|
|
4352
4511
|
var text = slate.Editor.string(e, selection.anchor.path);
|
|
4353
|
-
if (text
|
|
4354
|
-
slate.
|
|
4512
|
+
if (text !== '') {
|
|
4513
|
+
slate.Editor.setNormalizing(editor, false);
|
|
4514
|
+
e.insertText('');
|
|
4515
|
+
editor.marks = marks;
|
|
4516
|
+
slate.Editor.setNormalizing(editor, true);
|
|
4355
4517
|
}
|
|
4356
|
-
|
|
4357
|
-
e.
|
|
4518
|
+
else {
|
|
4519
|
+
slate.Transforms.unsetNodes(e, key, { at: selection.anchor.path });
|
|
4358
4520
|
}
|
|
4359
4521
|
if (shouldChange) {
|
|
4360
4522
|
editor.onChange();
|
|
@@ -4373,11 +4535,14 @@
|
|
|
4373
4535
|
var marks = Object.assign(Object.assign({}, (slate.Editor.marks(e) || {})), (_b = {}, _b[key] = value, _b));
|
|
4374
4536
|
editor.marks = marks;
|
|
4375
4537
|
var text = slate.Editor.string(e, selection.anchor.path);
|
|
4376
|
-
if (text
|
|
4377
|
-
slate.
|
|
4538
|
+
if (text !== '') {
|
|
4539
|
+
slate.Editor.setNormalizing(editor, false);
|
|
4540
|
+
e.insertText('');
|
|
4541
|
+
editor.marks = marks;
|
|
4542
|
+
slate.Editor.setNormalizing(editor, true);
|
|
4378
4543
|
}
|
|
4379
|
-
|
|
4380
|
-
|
|
4544
|
+
else {
|
|
4545
|
+
slate.Transforms.setNodes(e, (_c = {}, _c[key] = value, _c), { at: selection.anchor.path });
|
|
4381
4546
|
}
|
|
4382
4547
|
}
|
|
4383
4548
|
}
|
|
@@ -4455,7 +4620,7 @@
|
|
|
4455
4620
|
};
|
|
4456
4621
|
|
|
4457
4622
|
var autoFormatInline = function (editor, _a) {
|
|
4458
|
-
var type = _a.type, between = _a.between, markup = _a.markup, ignoreTrim = _a.ignoreTrim;
|
|
4623
|
+
var type = _a.type, between = _a.between, markup = _a.markup, ignoreTrim = _a.ignoreTrim, format = _a.format;
|
|
4459
4624
|
var selection = editor.selection;
|
|
4460
4625
|
var startMarkup = between ? between[0] : markup;
|
|
4461
4626
|
var endMarkup = between ? between[1] : '';
|
|
@@ -4499,22 +4664,35 @@
|
|
|
4499
4664
|
}
|
|
4500
4665
|
});
|
|
4501
4666
|
}
|
|
4502
|
-
// add mark to the text between the markups
|
|
4503
|
-
slate.Transforms.select(editor, markupRange);
|
|
4504
|
-
editor.addMark(type, true);
|
|
4505
|
-
slate.Transforms.collapse(editor, { edge: 'end' });
|
|
4506
|
-
editor.removeMark(type, false);
|
|
4507
|
-
// delete start markup
|
|
4508
4667
|
var startMarkupPointBefore = getPointBefore(editor, selection, {
|
|
4509
4668
|
matchString: startMarkup,
|
|
4510
4669
|
skipInvalid: true
|
|
4511
4670
|
});
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4671
|
+
if (format) {
|
|
4672
|
+
var markupText = getText(editor, markupRange);
|
|
4673
|
+
format(editor, markupText);
|
|
4674
|
+
// delete start to end selection
|
|
4675
|
+
slate.Transforms.delete(editor, {
|
|
4676
|
+
at: {
|
|
4677
|
+
anchor: startMarkupPointBefore,
|
|
4678
|
+
focus: selection.anchor
|
|
4679
|
+
}
|
|
4680
|
+
});
|
|
4681
|
+
}
|
|
4682
|
+
else {
|
|
4683
|
+
// add mark to the text between the markups
|
|
4684
|
+
slate.Transforms.select(editor, markupRange);
|
|
4685
|
+
editor.addMark(type, true);
|
|
4686
|
+
slate.Transforms.collapse(editor, { edge: 'end' });
|
|
4687
|
+
editor.removeMark(type, false);
|
|
4688
|
+
// delete start markup
|
|
4689
|
+
slate.Transforms.delete(editor, {
|
|
4690
|
+
at: {
|
|
4691
|
+
anchor: startMarkupPointBefore,
|
|
4692
|
+
focus: startMarkupPointAfter
|
|
4693
|
+
}
|
|
4694
|
+
});
|
|
4695
|
+
}
|
|
4518
4696
|
return true;
|
|
4519
4697
|
};
|
|
4520
4698
|
|
|
@@ -4590,6 +4768,7 @@
|
|
|
4590
4768
|
type: type,
|
|
4591
4769
|
between: between,
|
|
4592
4770
|
ignoreTrim: ignoreTrim,
|
|
4771
|
+
format: format,
|
|
4593
4772
|
markup: Array.isArray(markup) ? markup[0] : markup
|
|
4594
4773
|
})) {
|
|
4595
4774
|
return { value: valid() };
|
|
@@ -5989,14 +6168,6 @@
|
|
|
5989
6168
|
shortcutKey: CONTROL_KEY + "+U",
|
|
5990
6169
|
execute: function (editor) { return MarkEditor.toggleMark(editor, exports.MarkTypes.underline); },
|
|
5991
6170
|
active: function (editor) { return MarkEditor.isMarkActive(editor, exports.MarkTypes.underline); }
|
|
5992
|
-
},
|
|
5993
|
-
{
|
|
5994
|
-
key: exports.MarkTypes.codeLine,
|
|
5995
|
-
icon: 'code',
|
|
5996
|
-
name: '行内代码',
|
|
5997
|
-
shortcutKey: CONTROL_KEY + "+E",
|
|
5998
|
-
execute: function (editor) { return MarkEditor.toggleMark(editor, exports.MarkTypes.codeLine); },
|
|
5999
|
-
active: function (editor) { return MarkEditor.isMarkActive(editor, exports.MarkTypes.codeLine); }
|
|
6000
6171
|
}
|
|
6001
6172
|
];
|
|
6002
6173
|
|
|
@@ -6061,7 +6232,9 @@
|
|
|
6061
6232
|
_a);
|
|
6062
6233
|
if (entry) {
|
|
6063
6234
|
setMarks(editor, unMarks, entry[1]);
|
|
6235
|
+
return;
|
|
6064
6236
|
}
|
|
6237
|
+
setMarks(editor, unMarks, editor.selection);
|
|
6065
6238
|
});
|
|
6066
6239
|
},
|
|
6067
6240
|
isHeadingActive: function (editor, heading) {
|
|
@@ -6987,8 +7160,9 @@
|
|
|
6987
7160
|
_this.menus = CODE_MODES.map(function (item) {
|
|
6988
7161
|
return { key: item.value, name: item.showName };
|
|
6989
7162
|
});
|
|
7163
|
+
_this.destroy$ = new rxjs.Subject();
|
|
6990
7164
|
_this.ToolbarItemMode = exports.ToolbarItemMode;
|
|
6991
|
-
_this.
|
|
7165
|
+
_this.isHightLight = false;
|
|
6992
7166
|
_this.resizeHeight = null;
|
|
6993
7167
|
_this.options = {
|
|
6994
7168
|
mode: _this.menus[0].key,
|
|
@@ -7030,13 +7204,22 @@
|
|
|
7030
7204
|
if (this.resizeHeight !== this.element.height) {
|
|
7031
7205
|
this.useHeight();
|
|
7032
7206
|
}
|
|
7033
|
-
if (!this.isCollapsed) {
|
|
7034
|
-
this.isFocusCode = false;
|
|
7035
|
-
}
|
|
7036
7207
|
}
|
|
7037
7208
|
};
|
|
7038
7209
|
TheCodeComponent.prototype.ngOnInit = function () {
|
|
7210
|
+
var _this = this;
|
|
7039
7211
|
_super.prototype.ngOnInit.call(this);
|
|
7212
|
+
this.ngZone.runOutsideAngular(function () {
|
|
7213
|
+
rxjs.fromEvent(_this.nativeElement, 'mousedown')
|
|
7214
|
+
.pipe(operators.takeUntil(_this.destroy$))
|
|
7215
|
+
.subscribe(function (event) {
|
|
7216
|
+
event.stopPropagation();
|
|
7217
|
+
var isBlockOperation = _this.isCollapsed &&
|
|
7218
|
+
_this.nativeElement.querySelector('.the-code-block-operation').contains(event.target);
|
|
7219
|
+
var isCodemirror = _this.nativeElement.querySelector('.ng-codemirror').contains(event.target);
|
|
7220
|
+
_this.isHightLight = !isCodemirror && !isBlockOperation;
|
|
7221
|
+
});
|
|
7222
|
+
});
|
|
7040
7223
|
this.elementRef.nativeElement.classList.add('the-code-container');
|
|
7041
7224
|
};
|
|
7042
7225
|
TheCodeComponent.prototype.ngAfterViewInit = function () {
|
|
@@ -7080,11 +7263,11 @@
|
|
|
7080
7263
|
}
|
|
7081
7264
|
};
|
|
7082
7265
|
TheCodeComponent.prototype.codeChange = function ($event) {
|
|
7266
|
+
this.isHightLight = false;
|
|
7083
7267
|
CodeEditor.setCodeAttribute(this.editor, this.element, { content: $event });
|
|
7084
7268
|
};
|
|
7085
7269
|
TheCodeComponent.prototype.onDelete = function (event) {
|
|
7086
7270
|
event.preventDefault();
|
|
7087
|
-
this.isFocusCode = false;
|
|
7088
7271
|
deleteElement(this.editor, this.element);
|
|
7089
7272
|
};
|
|
7090
7273
|
TheCodeComponent.prototype.onCopy = function (event) {
|
|
@@ -7102,8 +7285,9 @@
|
|
|
7102
7285
|
i1.AngularEditor.deselect(this.editor);
|
|
7103
7286
|
};
|
|
7104
7287
|
TheCodeComponent.prototype.focusChange = function (codeMirrorFocused) {
|
|
7105
|
-
if (codeMirrorFocused)
|
|
7106
|
-
this.
|
|
7288
|
+
if (codeMirrorFocused) {
|
|
7289
|
+
this.isHightLight = false;
|
|
7290
|
+
}
|
|
7107
7291
|
};
|
|
7108
7292
|
TheCodeComponent.prototype.useMode = function () {
|
|
7109
7293
|
var _this = this;
|
|
@@ -7132,13 +7316,18 @@
|
|
|
7132
7316
|
CodeEditor.setCodeAttribute(this.editor, this.element, { height: this.resizeHeight });
|
|
7133
7317
|
};
|
|
7134
7318
|
TheCodeComponent.prototype.onChangeWrap = function (value) {
|
|
7319
|
+
this.isHightLight = false;
|
|
7135
7320
|
this.options = Object.assign(Object.assign({}, this.options), { lineWrapping: value || false });
|
|
7136
7321
|
CodeEditor.setCodeAttribute(this.editor, this.element, { autoWrap: value ? value : null });
|
|
7137
7322
|
};
|
|
7323
|
+
TheCodeComponent.prototype.ngOnDestroy = function () {
|
|
7324
|
+
this.destroy$.next();
|
|
7325
|
+
this.destroy$.complete();
|
|
7326
|
+
};
|
|
7138
7327
|
return TheCodeComponent;
|
|
7139
7328
|
}(TheBaseElementComponent));
|
|
7140
7329
|
TheCodeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheCodeComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i1__namespace$4.ThyNotifyService }, { token: TheContextService }, { token: i0__namespace.NgZone }, { token: THE_CODE_MODE_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
7141
|
-
TheCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: i8.CodeMirrorComponent }], usesInheritance: true, ngImport: i0__namespace, template: "<div contenteditable=\"false\" class=\"the-code-block-operation\" *ngIf=\"
|
|
7330
|
+
TheCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: i8.CodeMirrorComponent }], usesInheritance: true, ngImport: i0__namespace, template: "<div contenteditable=\"false\" class=\"the-code-block-operation\" *ngIf=\"isCollapsed && codemirror && !options.readOnly\">\n <thy-icon-nav>\n <the-toolbar-dropdown [menus]=\"menus\" [item]=\"actives\" [itemMousedownHandle]=\"onChangeLangulage\"> </the-toolbar-dropdown>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"copy\"\n thyTooltip=\"\u590D\u5236\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onCopy($event)\"\n ></a>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n class=\"remove-link\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onDelete($event)\"\n ></a>\n <nav-split-line [mode]=\"ToolbarItemMode.vertical\"></nav-split-line>\n <span class=\"auto-wrap d-flex align-items-center\">\n <span>\u81EA\u52A8\u6362\u884C</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n </thy-icon-nav>\n</div>\n\n<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsed, readonly: options.readOnly, active: isHightLight && isCollapsed }\"\n>\n <ng-codemirror\n *ngIf=\"startRenderCodemirror\"\n #codemirror\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options\"\n [ngModel]=\"code\"\n [delayRefreshTime]=\"300\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n [autoMaxHeight]=\"maxHeight\"\n >\n </ng-codemirror>\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\" *ngIf=\"isCollapsed && !options.readOnly\"></thy-resize-handle>\n</div>\n", components: [{ type: i3__namespace.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["toolbarItem", "menus", "mode", "item", "itemMousedownHandle"] }, { type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }, { type: i6__namespace$1.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i8__namespace.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "delayRefreshTime", "options"], outputs: ["focusChange"] }, { type: i9__namespace.ThyResizeHandleComponent, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { 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"] }, { type: i9__namespace.ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeEnd", "thyResizeStart"] }, { type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
7142
7331
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheCodeComponent, decorators: [{
|
|
7143
7332
|
type: i0.Component,
|
|
7144
7333
|
args: [{
|
|
@@ -7435,7 +7624,9 @@
|
|
|
7435
7624
|
}
|
|
7436
7625
|
};
|
|
7437
7626
|
TheBaseLinkComponent.prototype.mousedownHandle = function (event) {
|
|
7438
|
-
this.
|
|
7627
|
+
if (!this.readonly && !this.editor.disabled) {
|
|
7628
|
+
this.openLinkHover();
|
|
7629
|
+
}
|
|
7439
7630
|
};
|
|
7440
7631
|
TheBaseLinkComponent.prototype.openLinkEdit = function (tag) {
|
|
7441
7632
|
var _this = this;
|
|
@@ -11527,35 +11718,6 @@
|
|
|
11527
11718
|
}
|
|
11528
11719
|
];
|
|
11529
11720
|
|
|
11530
|
-
/**
|
|
11531
|
-
* whether the current node is a clean paragraph
|
|
11532
|
-
* @param editor
|
|
11533
|
-
* @param text
|
|
11534
|
-
* @returns boolean
|
|
11535
|
-
*/
|
|
11536
|
-
var isCleanEmptyParagraph = function (editor) {
|
|
11537
|
-
var isCollapsedCursor = TheEditor.isFocused(editor) && editor.selection && slate.Range.isCollapsed(editor.selection);
|
|
11538
|
-
if (!isCollapsedCursor) {
|
|
11539
|
-
return false;
|
|
11540
|
-
}
|
|
11541
|
-
var block = slate.Node.ancestor(editor, [editor.selection.anchor.path[0]]);
|
|
11542
|
-
var textIndent = 'textIndent';
|
|
11543
|
-
var align = 'align';
|
|
11544
|
-
var hasTextIndent = block[textIndent];
|
|
11545
|
-
var hasAlign = block[align];
|
|
11546
|
-
if (slate.Node.string(block) === '' &&
|
|
11547
|
-
slate.Element.isElement(block) &&
|
|
11548
|
-
block.type === exports.ElementKinds.paragraph &&
|
|
11549
|
-
block.children.length === 1 &&
|
|
11550
|
-
slate.Text.isText(block.children[0]) &&
|
|
11551
|
-
!slate.Editor.isVoid(editor, block) &&
|
|
11552
|
-
!hasTextIndent &&
|
|
11553
|
-
!hasAlign) {
|
|
11554
|
-
return true;
|
|
11555
|
-
}
|
|
11556
|
-
return false;
|
|
11557
|
-
};
|
|
11558
|
-
|
|
11559
11721
|
var TheToolbarItemComponent = /** @class */ (function (_super) {
|
|
11560
11722
|
__extends(TheToolbarItemComponent, _super);
|
|
11561
11723
|
function TheToolbarItemComponent(ngZone, cfr) {
|
|
@@ -11809,11 +11971,44 @@
|
|
|
11809
11971
|
|
|
11810
11972
|
var FontSizeEditor = {
|
|
11811
11973
|
setFontSize: function (editor, size) {
|
|
11974
|
+
var contextService = editor.injector.get(TheContextService);
|
|
11975
|
+
var defaultFontSize = contextService.getDefaultFontSize();
|
|
11976
|
+
var marks = getSelectionMarks(editor);
|
|
11977
|
+
var fontSizeMark = marks[exports.MarkTypes.fontSize];
|
|
11978
|
+
var isDefaultFontSize = size === defaultFontSize;
|
|
11979
|
+
if (!fontSizeMark && isDefaultFontSize) {
|
|
11980
|
+
return;
|
|
11981
|
+
}
|
|
11982
|
+
// unset fontSize
|
|
11983
|
+
if (FontSizeEditor.unsetFontSize(editor, size, fontSizeMark, isDefaultFontSize)) {
|
|
11984
|
+
return;
|
|
11985
|
+
}
|
|
11986
|
+
FontSizeEditor.setFontSizeMark(editor, size);
|
|
11987
|
+
},
|
|
11988
|
+
setFontSizeMark: function (editor, size) {
|
|
11989
|
+
// set Table selectedCells fontSize
|
|
11812
11990
|
if (TableEditor.toggleMark(editor, false, exports.MarkTypes.fontSize, Number(size))) {
|
|
11813
11991
|
return;
|
|
11814
11992
|
}
|
|
11993
|
+
// set paragraph text fontSize
|
|
11815
11994
|
slate.Editor.addMark(editor, exports.MarkTypes.fontSize, Number(size));
|
|
11816
11995
|
},
|
|
11996
|
+
unsetFontSize: function (editor, size, fontSizeMark, isDefaultFontSize) {
|
|
11997
|
+
var _a;
|
|
11998
|
+
var isTable = TableEditor.isActive(editor);
|
|
11999
|
+
if (fontSizeMark && isDefaultFontSize) {
|
|
12000
|
+
// unset Table selectedCells fontSize
|
|
12001
|
+
if (isTable && TableEditor.toggleMark(editor, true, exports.MarkTypes.fontSize, Number(size))) {
|
|
12002
|
+
return true;
|
|
12003
|
+
}
|
|
12004
|
+
// unset paragraph text fontSize
|
|
12005
|
+
setMarks(editor, (_a = {},
|
|
12006
|
+
_a[exports.MarkTypes.fontSize] = null,
|
|
12007
|
+
_a), editor.selection);
|
|
12008
|
+
return true;
|
|
12009
|
+
}
|
|
12010
|
+
return false;
|
|
12011
|
+
},
|
|
11817
12012
|
isFontSizeActive: function (editor, size) {
|
|
11818
12013
|
if (editor.selection) {
|
|
11819
12014
|
var anchorBlock$1 = anchorBlock(editor);
|
|
@@ -11871,6 +12066,84 @@
|
|
|
11871
12066
|
}
|
|
11872
12067
|
], __read(sizeOptions()));
|
|
11873
12068
|
|
|
12069
|
+
var InlineCodeOptions = [
|
|
12070
|
+
{
|
|
12071
|
+
key: exports.ElementKinds.inlineCode,
|
|
12072
|
+
icon: 'code',
|
|
12073
|
+
name: '行内代码',
|
|
12074
|
+
shortcutKey: CONTROL_KEY + "+E",
|
|
12075
|
+
execute: function (editor) { return InlineCodeEditor.toggleInlineCode(editor); },
|
|
12076
|
+
active: function (editor) { return InlineCodeEditor.isInlineCodeActive(editor); }
|
|
12077
|
+
}
|
|
12078
|
+
];
|
|
12079
|
+
|
|
12080
|
+
var TheInlineCodeComponent = /** @class */ (function (_super) {
|
|
12081
|
+
__extends(TheInlineCodeComponent, _super);
|
|
12082
|
+
function TheInlineCodeComponent(elementRef, cdr) {
|
|
12083
|
+
var _this = _super.call(this, elementRef, cdr) || this;
|
|
12084
|
+
_this.elementRef = elementRef;
|
|
12085
|
+
_this.cdr = cdr;
|
|
12086
|
+
return _this;
|
|
12087
|
+
}
|
|
12088
|
+
TheInlineCodeComponent.prototype.ngOnInit = function () {
|
|
12089
|
+
_super.prototype.ngOnInit.call(this);
|
|
12090
|
+
};
|
|
12091
|
+
TheInlineCodeComponent.prototype.ngOnDestroy = function () {
|
|
12092
|
+
_super.prototype.ngOnDestroy.call(this);
|
|
12093
|
+
};
|
|
12094
|
+
return TheInlineCodeComponent;
|
|
12095
|
+
}(TheBaseElementComponent));
|
|
12096
|
+
TheInlineCodeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheInlineCodeComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12097
|
+
TheInlineCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheInlineCodeComponent, selector: "span[theInlineCode]", usesInheritance: true, ngImport: i0__namespace, template: '<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>', isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
|
|
12098
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheInlineCodeComponent, decorators: [{
|
|
12099
|
+
type: i0.Component,
|
|
12100
|
+
args: [{
|
|
12101
|
+
selector: 'span[theInlineCode]',
|
|
12102
|
+
template: '<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>'
|
|
12103
|
+
}]
|
|
12104
|
+
}], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.ChangeDetectorRef }]; } });
|
|
12105
|
+
|
|
12106
|
+
var withInlineCode = function (editor) {
|
|
12107
|
+
var isInline = editor.isInline, renderElement = editor.renderElement, insertText = editor.insertText;
|
|
12108
|
+
editor.isInline = function (element) {
|
|
12109
|
+
return element.type === exports.ElementKinds.inlineCode ? true : isInline(element);
|
|
12110
|
+
};
|
|
12111
|
+
editor.renderElement = function (element) {
|
|
12112
|
+
if (element.type === exports.ElementKinds.inlineCode) {
|
|
12113
|
+
return TheInlineCodeComponent;
|
|
12114
|
+
}
|
|
12115
|
+
return renderElement(element);
|
|
12116
|
+
};
|
|
12117
|
+
editor.insertText = function (text) {
|
|
12118
|
+
if (text && InlineCodeEditor.isInlineCodeActive(editor)) {
|
|
12119
|
+
var selection = editor.selection;
|
|
12120
|
+
var currentNodeText = slate.Editor.string(editor, editor.selection.anchor.path);
|
|
12121
|
+
insertText(text);
|
|
12122
|
+
if (currentNodeText == ZERO_WIDTH_CHAR) {
|
|
12123
|
+
var inlineCodePath = slate.Editor.path(editor, editor.selection);
|
|
12124
|
+
var range = {
|
|
12125
|
+
anchor: slate.Editor.before(editor, selection.anchor),
|
|
12126
|
+
focus: selection.anchor
|
|
12127
|
+
};
|
|
12128
|
+
if (slate.Editor.isStart(editor, selection.anchor, inlineCodePath)) {
|
|
12129
|
+
range = {
|
|
12130
|
+
anchor: editor.selection.anchor,
|
|
12131
|
+
focus: slate.Editor.after(editor, editor.selection)
|
|
12132
|
+
};
|
|
12133
|
+
}
|
|
12134
|
+
slate.Transforms.delete(editor, {
|
|
12135
|
+
at: range
|
|
12136
|
+
});
|
|
12137
|
+
}
|
|
12138
|
+
}
|
|
12139
|
+
else {
|
|
12140
|
+
insertText(text);
|
|
12141
|
+
}
|
|
12142
|
+
};
|
|
12143
|
+
editor = withRemoveEmptyNodes({ type: exports.ElementKinds.inlineCode })(editor);
|
|
12144
|
+
return editor;
|
|
12145
|
+
};
|
|
12146
|
+
|
|
11874
12147
|
var internalPlugins = [
|
|
11875
12148
|
withTheHistory,
|
|
11876
12149
|
withAutoInsertData(),
|
|
@@ -11910,9 +12183,10 @@
|
|
|
11910
12183
|
withImage,
|
|
11911
12184
|
withDeserializeHMTL,
|
|
11912
12185
|
withDeserializeMd(),
|
|
11913
|
-
withQuickInsert
|
|
12186
|
+
withQuickInsert,
|
|
12187
|
+
withInlineCode
|
|
11914
12188
|
];
|
|
11915
|
-
var internalToolbarItems = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(AlignOptions)), __read(MarkOptions)), __read(ColorOptions)), __read(HeadingOptions)), __read(FontSizeOptions)), __read(TodoItemOptions)), __read(ListOptions)), __read(ImageOptions)), __read(HrOptions)), __read(BlockquoteOptions)), __read(CodeOptions)), __read(LinkOptions)), __read(TableOptions)), __read(VerticalAlignOptions)), __read(PaintFormatOptions));
|
|
12189
|
+
var internalToolbarItems = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(AlignOptions)), __read(MarkOptions)), __read(ColorOptions)), __read(HeadingOptions)), __read(FontSizeOptions)), __read(TodoItemOptions)), __read(ListOptions)), __read(ImageOptions)), __read(HrOptions)), __read(BlockquoteOptions)), __read(CodeOptions)), __read(LinkOptions)), __read(TableOptions)), __read(VerticalAlignOptions)), __read(PaintFormatOptions)), __read(InlineCodeOptions));
|
|
11916
12190
|
var toolbarCompose = function (toolbarItems) {
|
|
11917
12191
|
if (toolbarItems === void 0) { toolbarItems = []; }
|
|
11918
12192
|
return __spreadArray(__spreadArray([], __read(internalToolbarItems)), __read(toolbarItems));
|
|
@@ -11934,14 +12208,19 @@
|
|
|
11934
12208
|
'mod+b': exports.MarkTypes.bold,
|
|
11935
12209
|
'mod+i': exports.MarkTypes.italic,
|
|
11936
12210
|
'mod+u': exports.MarkTypes.underline,
|
|
11937
|
-
'mod+e': exports.
|
|
12211
|
+
'mod+e': exports.ElementKinds.inlineCode
|
|
11938
12212
|
};
|
|
11939
12213
|
var markShortcuts = function (editor, event) {
|
|
11940
12214
|
for (var hotkey in HOTKEYS) {
|
|
11941
12215
|
if (isHotkey__default["default"](hotkey, event)) {
|
|
11942
12216
|
event.preventDefault();
|
|
11943
12217
|
var mark = HOTKEYS[hotkey];
|
|
11944
|
-
|
|
12218
|
+
if (mark === exports.ElementKinds.inlineCode) {
|
|
12219
|
+
InlineCodeEditor.toggleInlineCode(editor);
|
|
12220
|
+
}
|
|
12221
|
+
else {
|
|
12222
|
+
MarkEditor.toggleMark(editor, mark);
|
|
12223
|
+
}
|
|
11945
12224
|
}
|
|
11946
12225
|
}
|
|
11947
12226
|
};
|
|
@@ -12074,9 +12353,9 @@
|
|
|
12074
12353
|
}
|
|
12075
12354
|
};
|
|
12076
12355
|
TheToolbarComponent.prototype.setToolbarClass = function () {
|
|
12077
|
-
var
|
|
12356
|
+
var _d;
|
|
12078
12357
|
if (this.editor && !!this.containerClass.length) {
|
|
12079
|
-
(
|
|
12358
|
+
(_d = this.elementRef.nativeElement.classList).add.apply(_d, __spreadArray([], __read(this.containerClass)));
|
|
12080
12359
|
}
|
|
12081
12360
|
};
|
|
12082
12361
|
TheToolbarComponent.prototype.resizeElement = function () {
|
|
@@ -12084,7 +12363,7 @@
|
|
|
12084
12363
|
var editableElement = this.elementRef.nativeElement;
|
|
12085
12364
|
// @ts-ignore
|
|
12086
12365
|
this.resizeObserver = new ResizeObserver(function (entries) {
|
|
12087
|
-
var e_1,
|
|
12366
|
+
var e_1, _d;
|
|
12088
12367
|
try {
|
|
12089
12368
|
for (var entries_1 = __values(entries), entries_1_1 = entries_1.next(); !entries_1_1.done; entries_1_1 = entries_1.next()) {
|
|
12090
12369
|
var entry = entries_1_1.value;
|
|
@@ -12098,7 +12377,7 @@
|
|
|
12098
12377
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
12099
12378
|
finally {
|
|
12100
12379
|
try {
|
|
12101
|
-
if (entries_1_1 && !entries_1_1.done && (
|
|
12380
|
+
if (entries_1_1 && !entries_1_1.done && (_d = entries_1.return)) _d.call(entries_1);
|
|
12102
12381
|
}
|
|
12103
12382
|
finally { if (e_1) throw e_1.error; }
|
|
12104
12383
|
}
|
|
@@ -12106,7 +12385,7 @@
|
|
|
12106
12385
|
this.resizeObserver.observe(editableElement);
|
|
12107
12386
|
};
|
|
12108
12387
|
TheToolbarComponent.prototype.statusChange = function (editor) {
|
|
12109
|
-
var e_2,
|
|
12388
|
+
var e_2, _d;
|
|
12110
12389
|
var toolbarItems = __spreadArray(__spreadArray([], __read(this.toolbarItems)), [this.moreGroupMenu]);
|
|
12111
12390
|
try {
|
|
12112
12391
|
for (var toolbarItems_1 = __values(toolbarItems), toolbarItems_1_1 = toolbarItems_1.next(); !toolbarItems_1_1.done; toolbarItems_1_1 = toolbarItems_1.next()) {
|
|
@@ -12122,7 +12401,7 @@
|
|
|
12122
12401
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
12123
12402
|
finally {
|
|
12124
12403
|
try {
|
|
12125
|
-
if (toolbarItems_1_1 && !toolbarItems_1_1.done && (
|
|
12404
|
+
if (toolbarItems_1_1 && !toolbarItems_1_1.done && (_d = toolbarItems_1.return)) _d.call(toolbarItems_1);
|
|
12126
12405
|
}
|
|
12127
12406
|
finally { if (e_2) throw e_2.error; }
|
|
12128
12407
|
}
|
|
@@ -12134,7 +12413,7 @@
|
|
|
12134
12413
|
var toolbarItems = this.toolbarItemsCompose();
|
|
12135
12414
|
var items = toolbarItems.items, group = toolbarItems.group;
|
|
12136
12415
|
this.ngZone.run(function () {
|
|
12137
|
-
var e_3,
|
|
12416
|
+
var e_3, _d;
|
|
12138
12417
|
try {
|
|
12139
12418
|
for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {
|
|
12140
12419
|
var item = items_1_1.value;
|
|
@@ -12148,7 +12427,7 @@
|
|
|
12148
12427
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
12149
12428
|
finally {
|
|
12150
12429
|
try {
|
|
12151
|
-
if (items_1_1 && !items_1_1.done && (
|
|
12430
|
+
if (items_1_1 && !items_1_1.done && (_d = items_1.return)) _d.call(items_1);
|
|
12152
12431
|
}
|
|
12153
12432
|
finally { if (e_3) throw e_3.error; }
|
|
12154
12433
|
}
|
|
@@ -12171,7 +12450,7 @@
|
|
|
12171
12450
|
* set aside 50px
|
|
12172
12451
|
*/
|
|
12173
12452
|
TheToolbarComponent.prototype.toolbarItemsCompose = function () {
|
|
12174
|
-
var e_4,
|
|
12453
|
+
var e_4, _d;
|
|
12175
12454
|
var elementWidth = this.isMore ? this.elementWidth : null;
|
|
12176
12455
|
var maxItemWidth = 50;
|
|
12177
12456
|
var defaultItemWidth = 35;
|
|
@@ -12181,8 +12460,8 @@
|
|
|
12181
12460
|
var items = [];
|
|
12182
12461
|
var group = [];
|
|
12183
12462
|
try {
|
|
12184
|
-
for (var
|
|
12185
|
-
var item =
|
|
12463
|
+
for (var _e = __values(this.toolbarItems), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
12464
|
+
var item = _f.value;
|
|
12186
12465
|
if (!this.isMore) {
|
|
12187
12466
|
items.push(item);
|
|
12188
12467
|
continue;
|
|
@@ -12211,7 +12490,7 @@
|
|
|
12211
12490
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
12212
12491
|
finally {
|
|
12213
12492
|
try {
|
|
12214
|
-
if (
|
|
12493
|
+
if (_f && !_f.done && (_d = _e.return)) _d.call(_e);
|
|
12215
12494
|
}
|
|
12216
12495
|
finally { if (e_4) throw e_4.error; }
|
|
12217
12496
|
}
|
|
@@ -12224,12 +12503,12 @@
|
|
|
12224
12503
|
* externally designated more group
|
|
12225
12504
|
*/
|
|
12226
12505
|
TheToolbarComponent.prototype.toolbarItemsAndMoreCompose = function () {
|
|
12227
|
-
var e_5,
|
|
12506
|
+
var e_5, _d;
|
|
12228
12507
|
var items = [];
|
|
12229
12508
|
var group = [];
|
|
12230
12509
|
try {
|
|
12231
|
-
for (var
|
|
12232
|
-
var item =
|
|
12510
|
+
for (var _e = __values(this.toolbarItems), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
12511
|
+
var item = _f.value;
|
|
12233
12512
|
if (item.key === exports.ToolbarActionTypes.split) {
|
|
12234
12513
|
items.push(item);
|
|
12235
12514
|
continue;
|
|
@@ -12240,7 +12519,7 @@
|
|
|
12240
12519
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
12241
12520
|
finally {
|
|
12242
12521
|
try {
|
|
12243
|
-
if (
|
|
12522
|
+
if (_f && !_f.done && (_d = _e.return)) _d.call(_e);
|
|
12244
12523
|
}
|
|
12245
12524
|
finally { if (e_5) throw e_5.error; }
|
|
12246
12525
|
}
|
|
@@ -12303,18 +12582,20 @@
|
|
|
12303
12582
|
return TheToolbarItemComponent;
|
|
12304
12583
|
};
|
|
12305
12584
|
TheToolbarComponent.prototype.getDropdownItem = function (item) {
|
|
12306
|
-
var _a;
|
|
12585
|
+
var _a, _b, _c;
|
|
12307
12586
|
var dropdownKey = item === null || item === void 0 ? void 0 : item.dropdownItemKey;
|
|
12308
12587
|
// modify the fontsize option externally
|
|
12309
|
-
|
|
12310
|
-
|
|
12588
|
+
var contextService = (_b = (_a = this.editor) === null || _a === void 0 ? void 0 : _a.injector) === null || _b === void 0 ? void 0 : _b.get(TheContextService);
|
|
12589
|
+
var fontSize = contextService === null || contextService === void 0 ? void 0 : contextService.getDefaultFontSize();
|
|
12590
|
+
if (contextService && item.key === exports.MarkTypes.fontSize && fontSize) {
|
|
12591
|
+
dropdownKey = fontSize;
|
|
12311
12592
|
}
|
|
12312
|
-
return (
|
|
12593
|
+
return (_c = item === null || item === void 0 ? void 0 : item.includes) === null || _c === void 0 ? void 0 : _c.find(function (item) { return item.key === dropdownKey; });
|
|
12313
12594
|
};
|
|
12314
12595
|
return TheToolbarComponent;
|
|
12315
12596
|
}());
|
|
12316
12597
|
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 });
|
|
12317
|
-
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",
|
|
12598
|
+
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: i3__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"] }] });
|
|
12318
12599
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarComponent, decorators: [{
|
|
12319
12600
|
type: i0.Component,
|
|
12320
12601
|
args: [{
|
|
@@ -12335,8 +12616,6 @@
|
|
|
12335
12616
|
type: i0.Input
|
|
12336
12617
|
}], align: [{
|
|
12337
12618
|
type: i0.Input
|
|
12338
|
-
}], fontSize: [{
|
|
12339
|
-
type: i0.Input
|
|
12340
12619
|
}], containerClass: [{
|
|
12341
12620
|
type: i0.Input
|
|
12342
12621
|
}], isMore: [{
|
|
@@ -12457,7 +12736,7 @@
|
|
|
12457
12736
|
return TheInlineToolbarComponent;
|
|
12458
12737
|
}());
|
|
12459
12738
|
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.ScrollDispatcher }, { token: i0__namespace.ChangeDetectorRef }, { token: i0__namespace.NgZone }, { token: TheContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12460
|
-
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", "
|
|
12739
|
+
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 });
|
|
12461
12740
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheInlineToolbarComponent, decorators: [{
|
|
12462
12741
|
type: i0.Component,
|
|
12463
12742
|
args: [{
|
|
@@ -12482,6 +12761,7 @@
|
|
|
12482
12761
|
this.renderer = renderer;
|
|
12483
12762
|
this.elementRef = elementRef;
|
|
12484
12763
|
this.cdr = cdr;
|
|
12764
|
+
this.isVisible = false;
|
|
12485
12765
|
this.isHide = true;
|
|
12486
12766
|
this.defaultIconName = 'plus-circle-thin';
|
|
12487
12767
|
this.iconNameFill = 'plus-circle-thin-fill';
|
|
@@ -12492,15 +12772,12 @@
|
|
|
12492
12772
|
event.stopPropagation();
|
|
12493
12773
|
};
|
|
12494
12774
|
TheQuickInsertComponent.prototype.checkStatus = function () {
|
|
12495
|
-
var
|
|
12775
|
+
var _a;
|
|
12496
12776
|
var editor = this.editor;
|
|
12497
|
-
if (isCleanEmptyParagraph(editor)) {
|
|
12498
|
-
|
|
12499
|
-
|
|
12500
|
-
|
|
12501
|
-
var rootNode = i1.AngularEditor.toDOMNode(editor, block);
|
|
12502
|
-
_this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
|
|
12503
|
-
});
|
|
12777
|
+
if (this.isVisible && isCleanEmptyParagraph(editor)) {
|
|
12778
|
+
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]]);
|
|
12779
|
+
var rootNode = i1.AngularEditor.toDOMNode(editor, block);
|
|
12780
|
+
this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
|
|
12504
12781
|
return;
|
|
12505
12782
|
}
|
|
12506
12783
|
this.isHide = true;
|
|
@@ -12526,7 +12803,7 @@
|
|
|
12526
12803
|
return TheQuickInsertComponent;
|
|
12527
12804
|
}());
|
|
12528
12805
|
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 });
|
|
12529
|
-
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"] }] });
|
|
12806
|
+
TheQuickInsertComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems", isVisible: "isVisible" }, host: { listeners: { "mousedown": "handleMousedownNativeElement($event)" }, properties: { "class.hide": "isHide" }, classAttribute: "the-quick-insert" }, viewQueries: [{ propertyName: "iconElement", first: true, predicate: ["iconElement"], descendants: true, read: i0.ElementRef }], ngImport: i0__namespace, template: "<thy-icon\n #iconElement\n [thyIconName]=\"displayIconName\"\n class=\"quick-insert-icon text-desc font-size-xlg\"\n (mouseenter)=\"mouseEnter($event)\"\n (mouseleave)=\"mouseLeave($event)\"\n (mousedown)=\"handleClick($event)\"\n></thy-icon>\n", components: [{ type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }] });
|
|
12530
12807
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheQuickInsertComponent, decorators: [{
|
|
12531
12808
|
type: i0.Component,
|
|
12532
12809
|
args: [{
|
|
@@ -12541,6 +12818,8 @@
|
|
|
12541
12818
|
type: i0.Input
|
|
12542
12819
|
}], quickToolbarItems: [{
|
|
12543
12820
|
type: i0.Input
|
|
12821
|
+
}], isVisible: [{
|
|
12822
|
+
type: i0.Input
|
|
12544
12823
|
}], iconElement: [{
|
|
12545
12824
|
type: i0.ViewChild,
|
|
12546
12825
|
args: ['iconElement', { read: i0.ElementRef, static: false }]
|
|
@@ -12549,84 +12828,6 @@
|
|
|
12549
12828
|
args: ['mousedown', ['$event']]
|
|
12550
12829
|
}] } });
|
|
12551
12830
|
|
|
12552
|
-
var ThePlaceholderComponent = /** @class */ (function () {
|
|
12553
|
-
function ThePlaceholderComponent(renderer, elementRef, contextService) {
|
|
12554
|
-
this.renderer = renderer;
|
|
12555
|
-
this.elementRef = elementRef;
|
|
12556
|
-
this.contextService = contextService;
|
|
12557
|
-
this.isHide = true;
|
|
12558
|
-
}
|
|
12559
|
-
ThePlaceholderComponent.prototype.handleCompositionStart = function () {
|
|
12560
|
-
var _a;
|
|
12561
|
-
if ((_a = this.editor) === null || _a === void 0 ? void 0 : _a.selection) {
|
|
12562
|
-
this.hide();
|
|
12563
|
-
}
|
|
12564
|
-
};
|
|
12565
|
-
ThePlaceholderComponent.prototype.handleCompositionEnd = function (event) {
|
|
12566
|
-
if (!event.data) {
|
|
12567
|
-
this.checkStatus();
|
|
12568
|
-
}
|
|
12569
|
-
};
|
|
12570
|
-
ThePlaceholderComponent.prototype.checkStatus = function () {
|
|
12571
|
-
var _this = this;
|
|
12572
|
-
var _a, _b, _c;
|
|
12573
|
-
var editor = this.editor;
|
|
12574
|
-
var isEmptyShow = typeof ((_a = this.options) === null || _a === void 0 ? void 0 : _a.isEmptyShowPlaceholder) === 'undefined' ? true : this.options.isEmptyShowPlaceholder;
|
|
12575
|
-
var isMustShow = (_b = this.options) === null || _b === void 0 ? void 0 : _b.isMustShowPlaceholder;
|
|
12576
|
-
var isReadonly = (_c = this.options) === null || _c === void 0 ? void 0 : _c.readonly;
|
|
12577
|
-
// empty content and no selection processing
|
|
12578
|
-
if (!isReadonly && isEmptyShow && isEmptyContent(editor.children)) {
|
|
12579
|
-
var firstElementChild = this.contextService.getFirstElementChild();
|
|
12580
|
-
var offsetTop = firstElementChild.offsetTop;
|
|
12581
|
-
var offsetLeft = firstElementChild.offsetLeft;
|
|
12582
|
-
this.updatePosition(offsetLeft, offsetTop);
|
|
12583
|
-
return;
|
|
12584
|
-
}
|
|
12585
|
-
if (isMustShow && isCleanEmptyParagraph(editor)) {
|
|
12586
|
-
setTimeout(function () {
|
|
12587
|
-
var _a;
|
|
12588
|
-
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]]);
|
|
12589
|
-
var rootNode = i1.AngularEditor.toDOMNode(editor, block);
|
|
12590
|
-
_this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
|
|
12591
|
-
});
|
|
12592
|
-
return;
|
|
12593
|
-
}
|
|
12594
|
-
this.isHide = true;
|
|
12595
|
-
};
|
|
12596
|
-
ThePlaceholderComponent.prototype.updatePosition = function (left, top) {
|
|
12597
|
-
this.isHide = false;
|
|
12598
|
-
this.renderer.setStyle(this.elementRef.nativeElement, 'top', top + "px");
|
|
12599
|
-
this.renderer.setStyle(this.elementRef.nativeElement, 'left', left + "px");
|
|
12600
|
-
};
|
|
12601
|
-
ThePlaceholderComponent.prototype.hide = function () {
|
|
12602
|
-
this.isHide = true;
|
|
12603
|
-
};
|
|
12604
|
-
return ThePlaceholderComponent;
|
|
12605
|
-
}());
|
|
12606
|
-
ThePlaceholderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: ThePlaceholderComponent, deps: [{ token: i0__namespace.Renderer2 }, { token: i0__namespace.ElementRef }, { token: TheContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12607
|
-
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 });
|
|
12608
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: ThePlaceholderComponent, decorators: [{
|
|
12609
|
-
type: i0.Component,
|
|
12610
|
-
args: [{
|
|
12611
|
-
selector: 'div[thePlaceholder]',
|
|
12612
|
-
template: "{{ options?.placeholder }}",
|
|
12613
|
-
host: {
|
|
12614
|
-
class: 'the-placeholder',
|
|
12615
|
-
'[class.hide]': 'isHide'
|
|
12616
|
-
}
|
|
12617
|
-
}]
|
|
12618
|
-
}], ctorParameters: function () { return [{ type: i0__namespace.Renderer2 }, { type: i0__namespace.ElementRef }, { type: TheContextService }]; }, propDecorators: { editor: [{
|
|
12619
|
-
type: i0.Input
|
|
12620
|
-
}], options: [{
|
|
12621
|
-
type: i0.Input
|
|
12622
|
-
}], handleCompositionStart: [{
|
|
12623
|
-
type: i0.HostListener,
|
|
12624
|
-
args: ['document:compositionstart']
|
|
12625
|
-
}], handleCompositionEnd: [{
|
|
12626
|
-
type: i0.HostListener,
|
|
12627
|
-
args: ['document:compositionend', ['$event']]
|
|
12628
|
-
}] } });
|
|
12629
|
-
|
|
12630
12831
|
var TheTemplateComponent = /** @class */ (function () {
|
|
12631
12832
|
function TheTemplateComponent() {
|
|
12632
12833
|
var _this = this;
|
|
@@ -12719,14 +12920,14 @@
|
|
|
12719
12920
|
return leaf ? leaf : null;
|
|
12720
12921
|
};
|
|
12721
12922
|
_this.renderText = function (text) {
|
|
12722
|
-
if (text.text.length === 0) {
|
|
12723
|
-
return;
|
|
12724
|
-
}
|
|
12725
12923
|
for (var key in exports.MarkTypes) {
|
|
12726
12924
|
if (text[exports.MarkTypes[key]]) {
|
|
12727
12925
|
return TheTextComponent;
|
|
12728
12926
|
}
|
|
12729
12927
|
}
|
|
12928
|
+
if (text.text.length === 0) {
|
|
12929
|
+
return;
|
|
12930
|
+
}
|
|
12730
12931
|
};
|
|
12731
12932
|
_this.onKeyDown = function (event) {
|
|
12732
12933
|
shortcuts(_this.editor, event);
|
|
@@ -12855,12 +13056,14 @@
|
|
|
12855
13056
|
this.editor.disabled = (_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.disabled;
|
|
12856
13057
|
this.editor.extraElementOptions = (_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.extraElementOptions;
|
|
12857
13058
|
setEditorUUID(this.editor, idCreator());
|
|
12858
|
-
this.theContextService.initialize({
|
|
13059
|
+
this.theContextService.initialize({
|
|
13060
|
+
theOptions: this.theOptions,
|
|
13061
|
+
nativeElement: this.elementRef.nativeElement,
|
|
13062
|
+
viewContainerRef: this.viewContainerRef
|
|
13063
|
+
});
|
|
12859
13064
|
this.toolbarCalculate();
|
|
12860
13065
|
setTimeout(function () {
|
|
12861
|
-
var _a;
|
|
12862
13066
|
_this.theEditorCreated.emit(_this.editor);
|
|
12863
|
-
(_a = _this.placeholderInstance) === null || _a === void 0 ? void 0 : _a.checkStatus();
|
|
12864
13067
|
_this.applyAutoFocus();
|
|
12865
13068
|
});
|
|
12866
13069
|
};
|
|
@@ -12911,13 +13114,16 @@
|
|
|
12911
13114
|
};
|
|
12912
13115
|
TheEditorComponent.prototype.valueChange = function (value) {
|
|
12913
13116
|
var _a, _b, _c, _d, _e, _f;
|
|
12914
|
-
(_a = this.
|
|
12915
|
-
(
|
|
12916
|
-
|
|
13117
|
+
var isEditable = !((_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.readonly) && !((_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.disabled);
|
|
13118
|
+
(_c = this.theGlobalToolbarInstance) === null || _c === void 0 ? void 0 : _c.statusChange(this.editor);
|
|
13119
|
+
// quick insert button
|
|
13120
|
+
if (isEditable) {
|
|
13121
|
+
(_d = this.quickInsertInstance) === null || _d === void 0 ? void 0 : _d.checkStatus();
|
|
13122
|
+
}
|
|
12917
13123
|
// auto scroll view
|
|
12918
|
-
var scrollContainer = (
|
|
12919
|
-
var maxHeight = (
|
|
12920
|
-
if (
|
|
13124
|
+
var scrollContainer = (_e = this.theOptions) === null || _e === void 0 ? void 0 : _e.scrollContainer;
|
|
13125
|
+
var maxHeight = (_f = this.theOptions) === null || _f === void 0 ? void 0 : _f.maxHeight;
|
|
13126
|
+
if (isEditable && (scrollContainer || maxHeight)) {
|
|
12921
13127
|
var container = maxHeight ? DEFAULT_SCROLL_CONTAINER : scrollContainer;
|
|
12922
13128
|
this.autoScrollView(this.editor, container);
|
|
12923
13129
|
}
|
|
@@ -13047,12 +13253,13 @@
|
|
|
13047
13253
|
useExisting: i0.forwardRef(function () { return TheEditorComponent; }),
|
|
13048
13254
|
multi: true
|
|
13049
13255
|
}
|
|
13050
|
-
], 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 }
|
|
13256
|
+
], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }, { propertyName: "quickInsertInstance", first: true, predicate: ["quickInsert"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0__namespace, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n [ngClass]=\"{\n 'the-editor-disabled': theOptions?.disabled,\n 'max-height': maxHeight\n }\"\n [ngStyle]=\"{ 'max-height': maxHeight }\"\n>\n <slate-editable\n class=\"the-editor-typo\"\n [editor]=\"editor\"\n [ngModel]=\"editorValue\"\n (ngModelChange)=\"valueChange($event)\"\n [decorate]=\"decorate\"\n [placeholder]=\"theOptions?.placeholder\"\n [placeholderDecorate]=\"theOptions?.placeholderDecorate ? theOptions?.placeholderDecorate : null\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar *ngIf=\"!theOptions?.readonly\" [editor]=\"editor\" [toolbarItems]=\"toolbarEntity.inline\"></the-inline-toolbar>\n <div\n #quickInsert\n theQuickInsert\n [editor]=\"editor\"\n [quickToolbarItems]=\"quickToolbarItems\"\n [isVisible]=\"theOptions?.quickInsertVisible\"\n ></div>\n <the-template #templateInstance></the-template>\n</div>\n", components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }, { type: i1__namespace.SlateEditableComponent, selector: "slate-editable", inputs: ["editor", "renderElement", "renderLeaf", "renderText", "decorate", "placeholderDecorate", "isStrictDecorate", "trackBy", "readonly", "placeholder", "beforeInput", "blur", "click", "compositionEnd", "compositionStart", "copy", "cut", "dragOver", "dragStart", "dragEnd", "drop", "focus", "keydown", "paste", "spellCheck", "autoCorrect", "autoCapitalize"] }, { type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: ["editor", "toolbarItems"] }, { type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: ["editor", "quickToolbarItems", "isVisible"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: 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"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
13051
13257
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheEditorComponent, decorators: [{
|
|
13052
13258
|
type: i0.Component,
|
|
13053
13259
|
args: [{
|
|
13054
13260
|
selector: 'the-editor, theEditor',
|
|
13055
13261
|
templateUrl: 'editor.component.html',
|
|
13262
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
13056
13263
|
providers: [
|
|
13057
13264
|
TheToolbarService,
|
|
13058
13265
|
TheContextService,
|
|
@@ -13093,9 +13300,6 @@
|
|
|
13093
13300
|
}], quickInsertInstance: [{
|
|
13094
13301
|
type: i0.ViewChild,
|
|
13095
13302
|
args: ['quickInsert', { static: true }]
|
|
13096
|
-
}], placeholderInstance: [{
|
|
13097
|
-
type: i0.ViewChild,
|
|
13098
|
-
args: ['placeholder']
|
|
13099
13303
|
}] } });
|
|
13100
13304
|
|
|
13101
13305
|
var ENTRY_COMMON_COMPONENTS = [TheColumnResizeOverlayHandleComponent];
|
|
@@ -13228,7 +13432,7 @@
|
|
|
13228
13432
|
return TheToolbarGroupComponent;
|
|
13229
13433
|
}());
|
|
13230
13434
|
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 });
|
|
13231
|
-
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: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "
|
|
13435
|
+
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: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], directives: [{ type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
13232
13436
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0__namespace, type: TheToolbarGroupComponent, decorators: [{
|
|
13233
13437
|
type: i0.Component,
|
|
13234
13438
|
args: [{
|
|
@@ -13310,7 +13514,7 @@
|
|
|
13310
13514
|
TheTableComponent,
|
|
13311
13515
|
TheTableRowComponent,
|
|
13312
13516
|
TheTdComponent,
|
|
13313
|
-
|
|
13517
|
+
TheInlineCodeComponent
|
|
13314
13518
|
];
|
|
13315
13519
|
var PIPES = [ElementStylePipe, ElementClassPipe];
|
|
13316
13520
|
var TheEditorModule = /** @class */ (function () {
|
|
@@ -13353,7 +13557,7 @@
|
|
|
13353
13557
|
TheTableComponent,
|
|
13354
13558
|
TheTableRowComponent,
|
|
13355
13559
|
TheTdComponent,
|
|
13356
|
-
|
|
13560
|
+
TheInlineCodeComponent], imports: [i6.CommonModule, i1.SlateModule, i4$2.FormsModule, i4$1.ThyIconModule,
|
|
13357
13561
|
avatar.ThyAvatarModule,
|
|
13358
13562
|
i3.ThyNavModule,
|
|
13359
13563
|
i2$1.ThyFormModule,
|
|
@@ -13478,6 +13682,7 @@
|
|
|
13478
13682
|
exports.getToolbarClass = getToolbarClass;
|
|
13479
13683
|
exports.htmlToTheia = htmlToTheia;
|
|
13480
13684
|
exports.inValidTypes = inValidTypes;
|
|
13685
|
+
exports.isCleanEmptyParagraph = isCleanEmptyParagraph;
|
|
13481
13686
|
exports.plainToTheia = plainToTheia;
|
|
13482
13687
|
exports.toolbarCompose = toolbarCompose;
|
|
13483
13688
|
exports.withTheEditor = withTheEditor;
|