@worktile/theia 1.2.14 → 1.2.19
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 +503 -174
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/constants/code.d.ts +3 -3
- package/constants/default.d.ts +0 -1
- package/constants/node-types.d.ts +2 -1
- package/custom-types.d.ts +3 -1
- package/editor.module.d.ts +43 -39
- package/esm2015/components/text/text.component.js +7 -2
- package/esm2015/components/toolbar-item/toolbar-item.component.js +7 -3
- package/esm2015/constants/code.js +2 -2
- package/esm2015/constants/default.js +1 -2
- package/esm2015/constants/node-types.js +4 -2
- package/esm2015/constants/toolbar.js +2 -1
- package/esm2015/custom-types.js +1 -1
- package/esm2015/editor.component.js +1 -1
- package/esm2015/editor.module.js +14 -5
- package/esm2015/interfaces/toolbar.js +1 -1
- package/esm2015/plugins/code/code.component.js +80 -33
- package/esm2015/plugins/code/code.editor.js +3 -9
- package/esm2015/plugins/common/block-card.plugin.js +51 -5
- package/esm2015/plugins/deserializers/deserialize-md.plugin.js +7 -2
- package/esm2015/plugins/font-size/options.js +11 -0
- package/esm2015/plugins/font-size/toolbar-item.component.js +129 -0
- package/esm2015/plugins/index.js +15 -1
- package/esm2015/plugins/mark/options.js +6 -1
- package/esm2015/plugins/paint-format/options.js +4 -1
- package/esm2015/plugins/placeholder/placeholder.component.js +4 -3
- package/esm2015/plugins/soft-break/soft-break.plugin.js +18 -0
- package/esm2015/plugins/soft-break/soft-break.types.js +2 -0
- package/esm2015/plugins/table/table.editor.js +10 -2
- package/esm2015/plugins/table/table.plugin.js +53 -19
- package/esm2015/plugins/table/utils/calc-span.js +2 -2
- package/esm2015/plugins/table/utils/normalize-table.js +3 -3
- package/esm2015/plugins/table/utils/table-position.js +5 -2
- package/esm2015/queries/is-empty-content.js +2 -2
- package/esm2015/queries/is-empty-paragraph.js +6 -2
- package/esm2015/utils/common.js +3 -0
- package/esm2015/utils/index.js +2 -1
- package/fesm2015/worktile-theia.js +459 -139
- package/fesm2015/worktile-theia.js.map +1 -1
- package/interfaces/toolbar.d.ts +1 -0
- package/package.json +1 -1
- package/plugins/code/code.component.d.ts +17 -5
- package/plugins/code/code.component.scss +46 -7
- package/plugins/code/code.editor.d.ts +3 -2
- package/plugins/font-size/options.d.ts +3 -0
- package/plugins/font-size/toolbar-item.component.d.ts +35 -0
- package/plugins/font-size/toolbar-item.component.scss +13 -0
- package/plugins/image/image.component.scss +172 -168
- package/plugins/soft-break/soft-break.plugin.d.ts +4 -0
- package/plugins/soft-break/soft-break.types.d.ts +8 -0
- package/plugins/table/table.editor.d.ts +2 -0
- package/plugins/table/utils/calc-span.d.ts +1 -1
- package/queries/get-selection-marks.d.ts +1 -0
- package/styles/editor.scss +6 -0
- package/styles/index.scss +1 -0
- package/styles/typo.scss +13 -25
- package/transforms/set-marks.d.ts +1 -0
- package/utils/common.d.ts +2 -0
- package/utils/index.d.ts +1 -0
|
@@ -8,7 +8,7 @@ import * as i1 from 'slate-angular';
|
|
|
8
8
|
import { BaseTextComponent, BaseElementComponent, AngularEditor, NODE_TO_PARENT, NODE_TO_INDEX, IS_SAFARI, hotkeys, getPlainText as getPlainText$1, hasBlockCard, isCardLeft, FAKE_RIGHT_BLOCK_CARD_OFFSET, ELEMENT_TO_COMPONENT, EDITOR_TO_ELEMENT, isComponentType, withAngular, SlateModule } from 'slate-angular';
|
|
9
9
|
import { mixinUnsubscribe, MixinBase } from 'ngx-tethys/core';
|
|
10
10
|
import isHotkey from 'is-hotkey';
|
|
11
|
-
import { Element as Element$1, Editor, Range, Node, Span, Path, Text, Point, Transforms, createEditor } from 'slate';
|
|
11
|
+
import { Element as Element$1, Editor, Range, Node, Span, Path, Text, Point, Transforms, Operation, createEditor } from 'slate';
|
|
12
12
|
import { HistoryEditor, withHistory } from 'slate-history';
|
|
13
13
|
import { __rest, __awaiter } from 'tslib';
|
|
14
14
|
import * as _lodash from 'lodash';
|
|
@@ -16,7 +16,7 @@ import marked from 'marked';
|
|
|
16
16
|
import { TheiaConverter } from '@atinc/selene';
|
|
17
17
|
import * as i1$3 from 'ngx-tethys/popover';
|
|
18
18
|
import { ThyPopover } from 'ngx-tethys/popover';
|
|
19
|
-
import * as i2
|
|
19
|
+
import * as i2 from '@angular/cdk/overlay';
|
|
20
20
|
import { Overlay, OverlayModule } from '@angular/cdk/overlay';
|
|
21
21
|
import * as i1$1 from 'ngx-tethys/alert';
|
|
22
22
|
import { ThyAlertModule } from 'ngx-tethys/alert';
|
|
@@ -30,27 +30,31 @@ import * as i4$1 from 'ngx-tethys/icon';
|
|
|
30
30
|
import { ThyIconModule } from 'ngx-tethys/icon';
|
|
31
31
|
import * as i5 from 'ngx-tethys/input';
|
|
32
32
|
import { ThyInputModule } from 'ngx-tethys/input';
|
|
33
|
-
import * as
|
|
33
|
+
import * as i3 from 'ngx-tethys/nav';
|
|
34
34
|
import { ThyNavModule } from 'ngx-tethys/nav';
|
|
35
|
-
import * as
|
|
35
|
+
import * as i5$1 from 'ngx-tethys/tooltip';
|
|
36
36
|
import { ThyTooltipModule } from 'ngx-tethys/tooltip';
|
|
37
|
-
import * as
|
|
37
|
+
import * as i7 from 'ng-codemirror';
|
|
38
38
|
import { CodeMirrorComponent, CodemirrorModule } from 'ng-codemirror';
|
|
39
39
|
import * as i1$4 from 'ngx-tethys/notify';
|
|
40
40
|
import { ThyNotifyModule } from 'ngx-tethys/notify';
|
|
41
|
-
import * as i5$
|
|
41
|
+
import * as i5$2 from 'ngx-tethys/action-menu';
|
|
42
42
|
import { ThyActionMenuModule } from 'ngx-tethys/action-menu';
|
|
43
|
+
import * as i5$3 from 'ngx-tethys/switch';
|
|
44
|
+
import { ThySwitchModule } from 'ngx-tethys/switch';
|
|
45
|
+
import * as i8 from 'ngx-tethys/resizable';
|
|
46
|
+
import { ThyResizableModule } from 'ngx-tethys/resizable';
|
|
43
47
|
import isUrl from 'is-url';
|
|
44
48
|
import * as i1$5 from 'ngx-tethys/button';
|
|
45
49
|
import { ThyButtonModule } from 'ngx-tethys/button';
|
|
46
|
-
import * as i2$
|
|
50
|
+
import * as i2$1 from 'ngx-tethys/form';
|
|
47
51
|
import { ThyFormModule } from 'ngx-tethys/form';
|
|
48
|
-
import * as i5$
|
|
52
|
+
import * as i5$4 from 'ngx-tethys/shared';
|
|
49
53
|
import { ThySharedModule } from 'ngx-tethys/shared';
|
|
50
54
|
import * as i1$6 from 'ngx-tethys';
|
|
51
55
|
import { coerceCssPixelValue } from '@angular/cdk/coercion';
|
|
52
56
|
import { PortalInjector, ComponentPortal } from '@angular/cdk/portal';
|
|
53
|
-
import * as i2$
|
|
57
|
+
import * as i2$2 from 'ngx-tethys/list';
|
|
54
58
|
import { ThyListModule } from 'ngx-tethys/list';
|
|
55
59
|
import { ThyAutocompleteModule } from 'ngx-tethys/autocomplete';
|
|
56
60
|
import { ThyAvatarModule } from 'ngx-tethys/avatar';
|
|
@@ -64,7 +68,6 @@ const TAB_SPACE = ' ';
|
|
|
64
68
|
const ZERO_WIDTH_CHAR = '\u200B';
|
|
65
69
|
const CLIPBOARD_FORMAT_KEY = 'x-theia-fragment';
|
|
66
70
|
const DEFAULT_SCROLL_CONTAINER = '.the-editable-container';
|
|
67
|
-
const BLOCK_INSERT_ORIGIN = 'block-insert';
|
|
68
71
|
const ELEMENT_UNIQUE_ID = 'key';
|
|
69
72
|
var TheMode;
|
|
70
73
|
(function (TheMode) {
|
|
@@ -118,6 +121,7 @@ var MarkTypes;
|
|
|
118
121
|
MarkTypes["color"] = "color";
|
|
119
122
|
MarkTypes["backgroundColor"] = "background-color";
|
|
120
123
|
MarkTypes["codeLine"] = "code-line";
|
|
124
|
+
MarkTypes["fontSize"] = "font-size";
|
|
121
125
|
})(MarkTypes || (MarkTypes = {}));
|
|
122
126
|
var ToolbarActionTypes;
|
|
123
127
|
(function (ToolbarActionTypes) {
|
|
@@ -146,7 +150,8 @@ const MarkProps = [
|
|
|
146
150
|
MarkTypes.color,
|
|
147
151
|
MarkTypes.italic,
|
|
148
152
|
MarkTypes.strike,
|
|
149
|
-
MarkTypes.underline
|
|
153
|
+
MarkTypes.underline,
|
|
154
|
+
MarkTypes.fontSize
|
|
150
155
|
];
|
|
151
156
|
const THE_INLINE_TOOLBAR_TYPES = [ElementKinds.default, ElementKinds.listItem, ElementKinds.checkItem];
|
|
152
157
|
const STANDARD_HEADING_TYPES = [
|
|
@@ -176,6 +181,7 @@ var ToolbarItemMode;
|
|
|
176
181
|
})(ToolbarItemMode || (ToolbarItemMode = {}));
|
|
177
182
|
const DefaultGlobalToolbarDefinition = [
|
|
178
183
|
ElementKinds.headingList,
|
|
184
|
+
MarkTypes.fontSize,
|
|
179
185
|
ToolbarActionTypes.split,
|
|
180
186
|
MarkTypes.bold,
|
|
181
187
|
MarkTypes.italic,
|
|
@@ -310,7 +316,7 @@ const CodeMode = {
|
|
|
310
316
|
default: 'default',
|
|
311
317
|
print: 'print'
|
|
312
318
|
};
|
|
313
|
-
class
|
|
319
|
+
class TheCodeConfig {
|
|
314
320
|
}
|
|
315
321
|
const THE_CODE_MODE_TOKEN = new InjectionToken('the-code-mode');
|
|
316
322
|
const THE_CODE_MODE_PROVIDER = {
|
|
@@ -326,7 +332,7 @@ class TheTextComponent extends BaseTextComponent {
|
|
|
326
332
|
super(elementRef, cdr);
|
|
327
333
|
this.elementRef = elementRef;
|
|
328
334
|
this.renderer2 = renderer2;
|
|
329
|
-
this.excludes = ['color', 'background-color', 'text'];
|
|
335
|
+
this.excludes = ['color', 'font-size', 'background-color', 'text'];
|
|
330
336
|
this.attributes = [];
|
|
331
337
|
}
|
|
332
338
|
applyTextMark() {
|
|
@@ -341,6 +347,11 @@ class TheTextComponent extends BaseTextComponent {
|
|
|
341
347
|
this.attributes.push(attr);
|
|
342
348
|
}
|
|
343
349
|
}
|
|
350
|
+
const fontSize = this.text[MarkTypes.fontSize];
|
|
351
|
+
if (fontSize) {
|
|
352
|
+
const attr = `the-${MarkTypes.fontSize}`;
|
|
353
|
+
this.renderer2.setAttribute(this.elementRef.nativeElement, attr, fontSize);
|
|
354
|
+
}
|
|
344
355
|
if (this.text[MarkTypes.color]) {
|
|
345
356
|
this.renderer2.setStyle(this.elementRef.nativeElement, 'color', this.text[MarkTypes.color]);
|
|
346
357
|
}
|
|
@@ -500,7 +511,11 @@ const getAnchorBlockEntry = (editor, at) => {
|
|
|
500
511
|
};
|
|
501
512
|
|
|
502
513
|
const isEmptyParagraph = (editor, at) => {
|
|
503
|
-
const
|
|
514
|
+
const entry = getAnchorBlockEntry(editor, at);
|
|
515
|
+
if (!entry) {
|
|
516
|
+
return false;
|
|
517
|
+
}
|
|
518
|
+
const [block] = entry;
|
|
504
519
|
return Editor.isEmpty(editor, block) && block.type === ElementKinds.paragraph;
|
|
505
520
|
};
|
|
506
521
|
|
|
@@ -1145,7 +1160,7 @@ const isEmptyContent = (children) => {
|
|
|
1145
1160
|
}
|
|
1146
1161
|
if (children && children.length === 1) {
|
|
1147
1162
|
const firstNode = children[0];
|
|
1148
|
-
if (firstNode.type === ElementKinds.default && !Node.string(firstNode)) {
|
|
1163
|
+
if (firstNode.type === ElementKinds.default && firstNode.children.length === 1 && !Node.string(firstNode)) {
|
|
1149
1164
|
return true;
|
|
1150
1165
|
}
|
|
1151
1166
|
}
|
|
@@ -1957,6 +1972,9 @@ const getToolbarClass = (editor) => {
|
|
|
1957
1972
|
return `the-toolbar-${uuid}`;
|
|
1958
1973
|
};
|
|
1959
1974
|
|
|
1975
|
+
const IS_MAC = typeof window != 'undefined' && /Mac|iPod|iPhone|iPad/.test(window.navigator.platform);
|
|
1976
|
+
const CONTROL_KEY = IS_MAC ? '⌘' : 'Ctrl';
|
|
1977
|
+
|
|
1960
1978
|
const withDeserializeMd = (options) => (editor) => {
|
|
1961
1979
|
const { insertData, onKeydown } = editor;
|
|
1962
1980
|
editor.onKeydown = (event) => {
|
|
@@ -1997,8 +2015,13 @@ const withDeserializeMd = (options) => (editor) => {
|
|
|
1997
2015
|
});
|
|
1998
2016
|
return;
|
|
1999
2017
|
}
|
|
2018
|
+
else {
|
|
2019
|
+
closeConversionHint(editor);
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
catch (error) {
|
|
2023
|
+
closeConversionHint(editor);
|
|
2000
2024
|
}
|
|
2001
|
-
catch (error) { }
|
|
2002
2025
|
}
|
|
2003
2026
|
},
|
|
2004
2027
|
origin,
|
|
@@ -4197,20 +4220,66 @@ const withBlockCard = (editor) => {
|
|
|
4197
4220
|
// block card cursor
|
|
4198
4221
|
if (anchorNode && hasBlockCard(domSelection)) {
|
|
4199
4222
|
const isCardLeftCursor = isCardLeft(anchorNode);
|
|
4200
|
-
|
|
4201
|
-
|
|
4223
|
+
if (isMoveUp) {
|
|
4224
|
+
const [, path] = AngularEditor.toSlateCardEntry(editor, anchorNode);
|
|
4225
|
+
const previousPath = Path.hasPrevious(path) && Path.previous(path);
|
|
4226
|
+
const previousNode = previousPath && getNode(editor, previousPath);
|
|
4227
|
+
if (previousNode && editor.isBlockCard(previousNode)) {
|
|
4228
|
+
AngularEditor.moveBlockCard(editor, previousNode, { direction: isCardLeftCursor ? 'left' : 'right' });
|
|
4229
|
+
}
|
|
4230
|
+
else {
|
|
4231
|
+
const before = Editor.before(editor, path);
|
|
4232
|
+
if (before) {
|
|
4233
|
+
Transforms.select(editor, before);
|
|
4234
|
+
}
|
|
4235
|
+
}
|
|
4236
|
+
nativeEvent.preventDefault();
|
|
4237
|
+
return;
|
|
4238
|
+
}
|
|
4239
|
+
if (isMoveDown) {
|
|
4240
|
+
const [, path] = AngularEditor.toSlateCardEntry(editor, anchorNode);
|
|
4241
|
+
const nextPath = Path.next(path);
|
|
4242
|
+
const nextNode = getNode(editor, nextPath);
|
|
4243
|
+
if (nextNode && editor.isBlockCard(nextNode)) {
|
|
4244
|
+
AngularEditor.moveBlockCard(editor, nextNode, { direction: isCardLeftCursor ? 'left' : 'right' });
|
|
4245
|
+
}
|
|
4246
|
+
else {
|
|
4247
|
+
const after = Editor.after(editor, path);
|
|
4248
|
+
if (after) {
|
|
4249
|
+
Transforms.select(editor, Editor.after(editor, path));
|
|
4250
|
+
}
|
|
4251
|
+
}
|
|
4252
|
+
nativeEvent.preventDefault();
|
|
4253
|
+
return;
|
|
4254
|
+
}
|
|
4255
|
+
// → + right-block-card
|
|
4256
|
+
if ((isMoveForward && !isCardLeftCursor)) {
|
|
4202
4257
|
nativeEvent.preventDefault();
|
|
4203
4258
|
const [, path] = AngularEditor.toSlateCardEntry(editor, anchorNode);
|
|
4259
|
+
const nextPath = Path.next(path);
|
|
4260
|
+
const nextNode = getNode(editor, nextPath);
|
|
4261
|
+
if (nextNode && editor.isBlockCard(nextNode)) {
|
|
4262
|
+
event.preventDefault();
|
|
4263
|
+
AngularEditor.moveBlockCard(editor, nextNode, { direction: 'left' });
|
|
4264
|
+
return;
|
|
4265
|
+
}
|
|
4204
4266
|
const after = Editor.after(editor, path);
|
|
4205
4267
|
if (after) {
|
|
4206
4268
|
Transforms.select(editor, Editor.after(editor, path));
|
|
4207
4269
|
}
|
|
4208
4270
|
return;
|
|
4209
4271
|
}
|
|
4210
|
-
//
|
|
4211
|
-
if (
|
|
4272
|
+
// ← + left-block-card
|
|
4273
|
+
if (isMoveBackward && isCardLeftCursor) {
|
|
4212
4274
|
nativeEvent.preventDefault();
|
|
4213
4275
|
const [, path] = AngularEditor.toSlateCardEntry(editor, anchorNode);
|
|
4276
|
+
const previousPath = Path.hasPrevious(path) && Path.previous(path);
|
|
4277
|
+
const previousNode = previousPath && getNode(editor, previousPath);
|
|
4278
|
+
if (previousNode && editor.isBlockCard(previousNode)) {
|
|
4279
|
+
event.preventDefault();
|
|
4280
|
+
AngularEditor.moveBlockCard(editor, previousNode, { direction: 'right' });
|
|
4281
|
+
return;
|
|
4282
|
+
}
|
|
4214
4283
|
const before = Editor.before(editor, path);
|
|
4215
4284
|
if (before) {
|
|
4216
4285
|
Transforms.select(editor, before);
|
|
@@ -4592,11 +4661,14 @@ class TablePosition {
|
|
|
4592
4661
|
columnIndex++;
|
|
4593
4662
|
nextCell = this.table.children[rowIndex].children[columnIndex];
|
|
4594
4663
|
}
|
|
4595
|
-
else {
|
|
4664
|
+
else if (rowIndex + 1 < this.getHeight()) {
|
|
4596
4665
|
columnIndex = 0;
|
|
4597
4666
|
rowIndex++;
|
|
4598
4667
|
nextCell = this.table.children[rowIndex].children[columnIndex];
|
|
4599
4668
|
}
|
|
4669
|
+
else {
|
|
4670
|
+
nextCell = null;
|
|
4671
|
+
}
|
|
4600
4672
|
}
|
|
4601
4673
|
return nextCell;
|
|
4602
4674
|
}
|
|
@@ -4747,7 +4819,7 @@ function calcSpanForColumn(table, targetIndex) {
|
|
|
4747
4819
|
return rowspans.some(rowspan => isInside(rowspan, rowIndx, targetIndex));
|
|
4748
4820
|
});
|
|
4749
4821
|
}
|
|
4750
|
-
function
|
|
4822
|
+
function getOriginCell(table, targetRowIndex, targetColumnIndex) {
|
|
4751
4823
|
for (let rowIndex = 0; rowIndex <= targetRowIndex; rowIndex++) {
|
|
4752
4824
|
const row = table.children[rowIndex];
|
|
4753
4825
|
const originCell = row.children
|
|
@@ -5245,6 +5317,13 @@ const TableEditor = {
|
|
|
5245
5317
|
isActiveHeader(editor) {
|
|
5246
5318
|
const [tableRowEntry] = Editor.nodes(editor, { match: (n) => n.type === ElementKinds.tableRow });
|
|
5247
5319
|
return tableRowEntry && tableRowEntry[0] && tableRowEntry[0].header;
|
|
5320
|
+
},
|
|
5321
|
+
selectOriginCell(editor, table, rowIndex, columnIndex, isStart) {
|
|
5322
|
+
const origin = getOriginCell(table, rowIndex, columnIndex);
|
|
5323
|
+
if (origin) {
|
|
5324
|
+
const path = AngularEditor.findPath(editor, origin);
|
|
5325
|
+
Transforms.select(editor, isStart ? Editor.start(editor, path) : Editor.end(editor, path));
|
|
5326
|
+
}
|
|
5248
5327
|
}
|
|
5249
5328
|
};
|
|
5250
5329
|
|
|
@@ -5280,6 +5359,7 @@ const MarkOptions = [
|
|
|
5280
5359
|
key: MarkTypes.bold,
|
|
5281
5360
|
icon: 'bold',
|
|
5282
5361
|
name: '加粗',
|
|
5362
|
+
shortcutKey: `${CONTROL_KEY}+B`,
|
|
5283
5363
|
execute: editor => MarkEditor.toggleMark(editor, MarkTypes.bold),
|
|
5284
5364
|
active: editor => MarkEditor.isMarkActive(editor, MarkTypes.bold)
|
|
5285
5365
|
},
|
|
@@ -5287,6 +5367,7 @@ const MarkOptions = [
|
|
|
5287
5367
|
key: MarkTypes.italic,
|
|
5288
5368
|
icon: 'italic',
|
|
5289
5369
|
name: '斜体',
|
|
5370
|
+
shortcutKey: `${CONTROL_KEY}+I`,
|
|
5290
5371
|
execute: editor => MarkEditor.toggleMark(editor, MarkTypes.italic),
|
|
5291
5372
|
active: editor => MarkEditor.isMarkActive(editor, MarkTypes.italic)
|
|
5292
5373
|
},
|
|
@@ -5301,6 +5382,7 @@ const MarkOptions = [
|
|
|
5301
5382
|
key: MarkTypes.underline,
|
|
5302
5383
|
icon: 'underline',
|
|
5303
5384
|
name: '下划线',
|
|
5385
|
+
shortcutKey: `${CONTROL_KEY}+U`,
|
|
5304
5386
|
execute: editor => MarkEditor.toggleMark(editor, MarkTypes.underline),
|
|
5305
5387
|
active: editor => MarkEditor.isMarkActive(editor, MarkTypes.underline)
|
|
5306
5388
|
},
|
|
@@ -5308,6 +5390,7 @@ const MarkOptions = [
|
|
|
5308
5390
|
key: MarkTypes.codeLine,
|
|
5309
5391
|
icon: 'code',
|
|
5310
5392
|
name: '行内代码',
|
|
5393
|
+
shortcutKey: `${CONTROL_KEY}+E`,
|
|
5311
5394
|
execute: editor => MarkEditor.toggleMark(editor, MarkTypes.codeLine),
|
|
5312
5395
|
active: editor => MarkEditor.isMarkActive(editor, MarkTypes.codeLine)
|
|
5313
5396
|
}
|
|
@@ -5919,7 +6002,7 @@ TheColorToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12
|
|
|
5919
6002
|
thyIconName="caret-down"
|
|
5920
6003
|
></thy-icon>
|
|
5921
6004
|
</a>
|
|
5922
|
-
`, isInline: true, components: [{ type:
|
|
6005
|
+
`, isInline: true, components: [{ type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
5923
6006
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheColorToolbarItemComponent, decorators: [{
|
|
5924
6007
|
type: Component,
|
|
5925
6008
|
args: [{
|
|
@@ -6021,15 +6104,9 @@ const withRemoveVoid = (editor) => {
|
|
|
6021
6104
|
};
|
|
6022
6105
|
|
|
6023
6106
|
const CodeEditor = {
|
|
6024
|
-
|
|
6107
|
+
setCodeAttribute(editor, element, value) {
|
|
6025
6108
|
const at = AngularEditor.findPath(editor, element);
|
|
6026
|
-
Transforms.setNodes(editor,
|
|
6027
|
-
at
|
|
6028
|
-
});
|
|
6029
|
-
},
|
|
6030
|
-
setCodeContent(editor, content, element) {
|
|
6031
|
-
const at = AngularEditor.findPath(editor, element);
|
|
6032
|
-
Transforms.setNodes(editor, { content }, {
|
|
6109
|
+
Transforms.setNodes(editor, value, {
|
|
6033
6110
|
at
|
|
6034
6111
|
});
|
|
6035
6112
|
},
|
|
@@ -6194,8 +6271,8 @@ class TheToolbarDropdownComponent extends TheToolbarBaseItemComponent {
|
|
|
6194
6271
|
.withPositions([bottomPosition, topPosition]);
|
|
6195
6272
|
}
|
|
6196
6273
|
}
|
|
6197
|
-
TheToolbarDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarDropdownComponent, deps: [{ token: i0.ElementRef }, { token: i1$3.ThyPopover }, { token: i0.ViewContainerRef }, { token: i2
|
|
6198
|
-
TheToolbarDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item", itemMousedownHandle: "itemMousedownHandle" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, classAttribute: "the-toolbar-dropdown-container" }, viewQueries: [{ propertyName: "iconModeTemplate", first: true, predicate: ["iconModeTemplate"], descendants: true, static: true }, { propertyName: "textModeTemplate", first: true, predicate: ["textModeTemplate"], descendants: true, static: true }, { propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n\n<ng-template #iconModeTemplate>\n <a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #textModeTemplate>\n <a thyIconNavLink class=\"text-mode\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <span class=\"show-text\">{{ activeMenu?.name }}</span>\n <thy-icon class=\"text-caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenu.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n [ngStyle]=\"menu?.styles\"\n >\n <span *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu.icon\"></thy-icon>\n </span>\n <span *ngIf=\"menu.name\" thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n <thy-action-menu-divider *ngIf=\"menu.key === 'split'\"></thy-action-menu-divider>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type:
|
|
6274
|
+
TheToolbarDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarDropdownComponent, deps: [{ token: i0.ElementRef }, { token: i1$3.ThyPopover }, { token: i0.ViewContainerRef }, { token: i2.Overlay }], target: i0.ɵɵFactoryTarget.Component });
|
|
6275
|
+
TheToolbarDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item", itemMousedownHandle: "itemMousedownHandle" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, classAttribute: "the-toolbar-dropdown-container" }, viewQueries: [{ propertyName: "iconModeTemplate", first: true, predicate: ["iconModeTemplate"], descendants: true, static: true }, { propertyName: "textModeTemplate", first: true, predicate: ["textModeTemplate"], descendants: true, static: true }, { propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n\n<ng-template #iconModeTemplate>\n <a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #textModeTemplate>\n <a thyIconNavLink class=\"text-mode\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <span class=\"show-text\">{{ activeMenu?.name }}</span>\n <thy-icon class=\"text-caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n </a>\n</ng-template>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n *ngIf=\"menu.key !== 'split'\"\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"menu.key === activeMenu.key\"\n (mousedown)=\"itemMousedown($event, menu)\"\n [ngStyle]=\"menu?.styles\"\n >\n <span *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu.icon\"></thy-icon>\n </span>\n <span *ngIf=\"menu.name\" thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n <thy-action-menu-divider *ngIf=\"menu.key === 'split'\"></thy-action-menu-divider>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i5$2.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5$2.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i5$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
6199
6276
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarDropdownComponent, decorators: [{
|
|
6200
6277
|
type: Component,
|
|
6201
6278
|
args: [{
|
|
@@ -6205,7 +6282,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
|
|
|
6205
6282
|
class: 'the-toolbar-dropdown-container'
|
|
6206
6283
|
}
|
|
6207
6284
|
}]
|
|
6208
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$3.ThyPopover }, { type: i0.ViewContainerRef }, { type: i2
|
|
6285
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$3.ThyPopover }, { type: i0.ViewContainerRef }, { type: i2.Overlay }]; }, propDecorators: { toolbarItem: [{
|
|
6209
6286
|
type: Input
|
|
6210
6287
|
}], menus: [{
|
|
6211
6288
|
type: Input
|
|
@@ -6232,40 +6309,83 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
|
|
|
6232
6309
|
args: ['document: mousedown', ['$event']]
|
|
6233
6310
|
}] } });
|
|
6234
6311
|
|
|
6312
|
+
class NavSplitLineComponent {
|
|
6313
|
+
constructor() {
|
|
6314
|
+
this.mode = ToolbarItemMode.vertical;
|
|
6315
|
+
this.theNavSplitLine = true;
|
|
6316
|
+
}
|
|
6317
|
+
get horizontal() {
|
|
6318
|
+
return this.mode === ToolbarItemMode.horizontal;
|
|
6319
|
+
}
|
|
6320
|
+
get vertical() {
|
|
6321
|
+
return this.mode === ToolbarItemMode.vertical;
|
|
6322
|
+
}
|
|
6323
|
+
ngOnInit() { }
|
|
6324
|
+
}
|
|
6325
|
+
NavSplitLineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: NavSplitLineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
6326
|
+
NavSplitLineComponent.ɵcmp = i0.ɵɵ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, template: '', isInline: true });
|
|
6327
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: NavSplitLineComponent, decorators: [{
|
|
6328
|
+
type: Component,
|
|
6329
|
+
args: [{
|
|
6330
|
+
selector: 'nav-split-line',
|
|
6331
|
+
template: ''
|
|
6332
|
+
}]
|
|
6333
|
+
}], ctorParameters: function () { return []; }, propDecorators: { mode: [{
|
|
6334
|
+
type: Input
|
|
6335
|
+
}], theNavSplitLine: [{
|
|
6336
|
+
type: HostBinding,
|
|
6337
|
+
args: ['class.the-nav-split-line']
|
|
6338
|
+
}], horizontal: [{
|
|
6339
|
+
type: HostBinding,
|
|
6340
|
+
args: ['class.horizontal']
|
|
6341
|
+
}], vertical: [{
|
|
6342
|
+
type: HostBinding,
|
|
6343
|
+
args: ['class.vertical']
|
|
6344
|
+
}] } });
|
|
6345
|
+
|
|
6235
6346
|
class TheCodeComponent extends TheBaseElementComponent {
|
|
6236
|
-
constructor(elementRef, cdr, thyNotifyService, ngZone,
|
|
6347
|
+
constructor(elementRef, cdr, thyNotifyService, ngZone, config) {
|
|
6237
6348
|
super(elementRef, cdr);
|
|
6238
6349
|
this.elementRef = elementRef;
|
|
6239
6350
|
this.cdr = cdr;
|
|
6240
6351
|
this.thyNotifyService = thyNotifyService;
|
|
6241
6352
|
this.ngZone = ngZone;
|
|
6242
|
-
this.
|
|
6353
|
+
this.config = config;
|
|
6243
6354
|
this.startRenderCodemirror = false;
|
|
6244
6355
|
this.dropdownMode = DropdownMode;
|
|
6245
|
-
this.maxHeight = this.mode === CodeMode.default ? 350 - CODEMIRROR_PADDING_TOP * 2 : 0;
|
|
6246
6356
|
this.codeMirrorFocused = false;
|
|
6357
|
+
this.maxHeight = this.config.mode === CodeMode.default ? 350 - CODEMIRROR_PADDING_TOP * 2 : 0;
|
|
6247
6358
|
this.menus = CODE_MODES.map(item => {
|
|
6248
6359
|
return { key: item.value, name: item.showName };
|
|
6249
6360
|
});
|
|
6361
|
+
this.ToolbarItemMode = ToolbarItemMode;
|
|
6362
|
+
this.isAutoWrap = false;
|
|
6363
|
+
this.isResizing = false;
|
|
6364
|
+
this.resizeHeight = null;
|
|
6250
6365
|
this.options = {
|
|
6251
6366
|
mode: this.menus[0].key,
|
|
6252
6367
|
lineNumbers: false,
|
|
6253
6368
|
readOnly: false,
|
|
6254
6369
|
autofocus: false,
|
|
6255
6370
|
lineWiseCopyCut: true,
|
|
6256
|
-
lineWrapping: this.mode === CodeMode.default ? false : true,
|
|
6371
|
+
lineWrapping: this.config.mode === CodeMode.default ? false : true,
|
|
6257
6372
|
cursorBlinkRate: 500
|
|
6258
6373
|
};
|
|
6259
6374
|
this.actives = this.menus[0];
|
|
6260
6375
|
this.onChangeLangulage = item => {
|
|
6261
6376
|
this.options = Object.assign(Object.assign({}, this.options), { mode: item.key });
|
|
6262
6377
|
this.actives = item;
|
|
6263
|
-
CodeEditor.
|
|
6378
|
+
CodeEditor.setCodeAttribute(this.editor, this.element, { langulage: item.key });
|
|
6264
6379
|
};
|
|
6265
6380
|
}
|
|
6266
6381
|
get code() {
|
|
6267
6382
|
return this.element.content;
|
|
6268
6383
|
}
|
|
6384
|
+
handleCodeMousedown(event) {
|
|
6385
|
+
if (!(event.target instanceof HTMLElement && this.elementRef.nativeElement.contains(event.target))) {
|
|
6386
|
+
this.codeMirrorFocused = false;
|
|
6387
|
+
}
|
|
6388
|
+
}
|
|
6269
6389
|
onContextChange() {
|
|
6270
6390
|
super.onContextChange();
|
|
6271
6391
|
if (this.initialized) {
|
|
@@ -6275,6 +6395,9 @@ class TheCodeComponent extends TheBaseElementComponent {
|
|
|
6275
6395
|
if (this.options.mode !== this.element.language) {
|
|
6276
6396
|
this.useMode();
|
|
6277
6397
|
}
|
|
6398
|
+
if (!this.readonly && this.isCollapsed) {
|
|
6399
|
+
this.initializeCodemirrorFocus();
|
|
6400
|
+
}
|
|
6278
6401
|
}
|
|
6279
6402
|
}
|
|
6280
6403
|
ngOnInit() {
|
|
@@ -6297,14 +6420,20 @@ class TheCodeComponent extends TheBaseElementComponent {
|
|
|
6297
6420
|
});
|
|
6298
6421
|
}
|
|
6299
6422
|
}
|
|
6423
|
+
focusChange(codeMirrorFocused) {
|
|
6424
|
+
if (codeMirrorFocused)
|
|
6425
|
+
this.codeMirrorFocused = codeMirrorFocused;
|
|
6426
|
+
}
|
|
6300
6427
|
renderCodemirror() {
|
|
6301
6428
|
this.startRenderCodemirror = true;
|
|
6302
6429
|
this.useReadonly();
|
|
6303
6430
|
this.useMode();
|
|
6431
|
+
this.useAutoWrap();
|
|
6432
|
+
this.useHeight();
|
|
6304
6433
|
this.cdr.detectChanges();
|
|
6305
6434
|
}
|
|
6306
6435
|
initializeCodemirrorFocus() {
|
|
6307
|
-
if (this.isCollapsed) {
|
|
6436
|
+
if (this.isCollapsed && !this.isResizing) {
|
|
6308
6437
|
setTimeout(() => {
|
|
6309
6438
|
if (this.isCollapsed && this.codemirror && this.codemirror.editor && !this.codemirror.editor.hasFocus()) {
|
|
6310
6439
|
AngularEditor.blur(this.editor);
|
|
@@ -6315,13 +6444,11 @@ class TheCodeComponent extends TheBaseElementComponent {
|
|
|
6315
6444
|
}
|
|
6316
6445
|
}
|
|
6317
6446
|
codeChange($event) {
|
|
6318
|
-
CodeEditor.
|
|
6319
|
-
}
|
|
6320
|
-
focusChange(codeMirrorFocused) {
|
|
6321
|
-
this.codeMirrorFocused = codeMirrorFocused;
|
|
6447
|
+
CodeEditor.setCodeAttribute(this.editor, this.element, { content: $event });
|
|
6322
6448
|
}
|
|
6323
6449
|
onDelete(event) {
|
|
6324
6450
|
event.preventDefault();
|
|
6451
|
+
this.codeMirrorFocused = false;
|
|
6325
6452
|
deleteElement(this.editor, this.element);
|
|
6326
6453
|
}
|
|
6327
6454
|
onCopy(event) {
|
|
@@ -6332,40 +6459,68 @@ class TheCodeComponent extends TheBaseElementComponent {
|
|
|
6332
6459
|
if (selection.rangeCount > 0) {
|
|
6333
6460
|
selection.removeAllRanges();
|
|
6334
6461
|
}
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
setTimeout(() => {
|
|
6342
|
-
document.execCommand('copy');
|
|
6343
|
-
this.thyNotifyService.success('复制成功');
|
|
6344
|
-
}, 200);
|
|
6462
|
+
AngularEditor.focus(this.editor);
|
|
6463
|
+
Transforms.select(this.editor, AngularEditor.findPath(this.editor, this.element));
|
|
6464
|
+
document.execCommand('copy');
|
|
6465
|
+
this.thyNotifyService.success('复制成功');
|
|
6466
|
+
AngularEditor.deselect(this.editor);
|
|
6467
|
+
this.codeMirrorFocused = false;
|
|
6345
6468
|
}
|
|
6346
6469
|
useMode() {
|
|
6347
6470
|
this.options = Object.assign(Object.assign({}, this.options), { mode: this.element.language });
|
|
6348
6471
|
this.actives = this.menus.find(i => i.key === this.element.language);
|
|
6349
6472
|
}
|
|
6473
|
+
useAutoWrap() {
|
|
6474
|
+
if (this.element.autoWrap) {
|
|
6475
|
+
this.cdr.detectChanges();
|
|
6476
|
+
this.isAutoWrap = this.element.autoWrap;
|
|
6477
|
+
this.codemirror.setOptionIfChanged('lineWrapping', this.element.autoWrap);
|
|
6478
|
+
}
|
|
6479
|
+
}
|
|
6480
|
+
useHeight() {
|
|
6481
|
+
if (this.element.height) {
|
|
6482
|
+
this.resizeHeight = this.element.height;
|
|
6483
|
+
this.maxHeight = this.element.height;
|
|
6484
|
+
}
|
|
6485
|
+
}
|
|
6350
6486
|
useReadonly() {
|
|
6351
6487
|
this.options = Object.assign(Object.assign({}, this.options), { readOnly: this.readonly, cursorBlinkRate: this.readonly ? -1 : 500 });
|
|
6352
6488
|
}
|
|
6489
|
+
onResize({ height }) {
|
|
6490
|
+
this.resizeHeight = height;
|
|
6491
|
+
Transforms.select(this.editor, AngularEditor.findPath(this.editor, this.element));
|
|
6492
|
+
CodeEditor.setCodeAttribute(this.editor, this.element, { height });
|
|
6493
|
+
this.maxHeight = height;
|
|
6494
|
+
}
|
|
6495
|
+
onStartResize() {
|
|
6496
|
+
this.isResizing = true;
|
|
6497
|
+
}
|
|
6498
|
+
onEndResize() {
|
|
6499
|
+
this.isResizing = false;
|
|
6500
|
+
}
|
|
6501
|
+
onChangeWrap(value) {
|
|
6502
|
+
AngularEditor.deselect(this.editor);
|
|
6503
|
+
this.codemirror.setOptionIfChanged('lineWrapping', value);
|
|
6504
|
+
CodeEditor.setCodeAttribute(this.editor, this.element, { autoWrap: value ? value : null });
|
|
6505
|
+
}
|
|
6353
6506
|
}
|
|
6354
6507
|
TheCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheCodeComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$4.ThyNotifyService }, { token: i0.NgZone }, { token: THE_CODE_MODE_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
|
|
6355
|
-
TheCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: CodeMirrorComponent }], usesInheritance: true, ngImport: i0, template: "<div contenteditable=\"false\" class=\"the-block-operation\" *ngIf=\"codeMirrorFocused && !options.readOnly\">\n <thy-icon-nav>\n <the-toolbar-dropdown [menus]=\"menus\" [item]=\"actives\" [itemMousedownHandle]=\"onChangeLangulage\"
|
|
6508
|
+
TheCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheCodeComponent, selector: "div[theCode]", host: { listeners: { "document: mousedown": "handleCodeMousedown($event)" } }, viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: CodeMirrorComponent }], usesInheritance: true, ngImport: i0, template: "<div contenteditable=\"false\" class=\"the-block-operation\" *ngIf=\"codeMirrorFocused && !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)]=\"isAutoWrap\"\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<div\n thyResizable\n [thyMinHeight]=\"42\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeStart)=\"onStartResize()\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\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=\"codeMirrorFocused && !options.readOnly\"></thy-resize-handle>\n</div>\n", components: [{ type: i3.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["toolbarItem", "menus", "mode", "item", "itemMousedownHandle"] }, { type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }, { type: i5$3.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i7.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "delayRefreshTime", "options"], outputs: ["focusChange"] }, { type: i8.ThyResizeHandleComponent, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i8.ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeEnd", "thyResizeStart"] }, { type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
6356
6509
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheCodeComponent, decorators: [{
|
|
6357
6510
|
type: Component,
|
|
6358
6511
|
args: [{
|
|
6359
6512
|
selector: 'div[theCode]',
|
|
6360
|
-
templateUrl: './code.component.html'
|
|
6361
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
6513
|
+
templateUrl: './code.component.html'
|
|
6362
6514
|
}]
|
|
6363
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$4.ThyNotifyService }, { type: i0.NgZone }, { type:
|
|
6515
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$4.ThyNotifyService }, { type: i0.NgZone }, { type: TheCodeConfig, decorators: [{
|
|
6364
6516
|
type: Inject,
|
|
6365
6517
|
args: [THE_CODE_MODE_TOKEN]
|
|
6366
6518
|
}] }]; }, propDecorators: { codemirror: [{
|
|
6367
6519
|
type: ViewChild,
|
|
6368
6520
|
args: ['codemirror', { read: CodeMirrorComponent, static: false }]
|
|
6521
|
+
}], handleCodeMousedown: [{
|
|
6522
|
+
type: HostListener,
|
|
6523
|
+
args: ['document: mousedown', ['$event']]
|
|
6369
6524
|
}] } });
|
|
6370
6525
|
|
|
6371
6526
|
const withCode = (editor) => {
|
|
@@ -6576,7 +6731,7 @@ class TheLinkEditComponent {
|
|
|
6576
6731
|
}
|
|
6577
6732
|
}
|
|
6578
6733
|
TheLinkEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheLinkEditComponent, deps: [{ token: i1$3.ThyPopoverRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
6579
|
-
TheLinkEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheLinkEditComponent, selector: "the-link-edit", inputs: { tag: "tag", node: "node", link: "link", text: "text", originSelection: "originSelection" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class": "this.className" } }, ngImport: i0, template: "<form\n thyForm\n #linkForm=\"thyForm\"\n [thyFormValidatorConfig]=\"validatorConfig\"\n name=\"linkForm\"\n>\n <thy-form-group thyLabelText=\"\u6587\u672C\">\n <input\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u6587\u672C\"\n required\n name=\"text\"\n [(ngModel)]=\"text\"\n thyAutofocus\n type=\"text\"\n />\n </thy-form-group>\n <thy-form-group thyLabelText=\"\u94FE\u63A5\">\n <input\n name=\"link\"\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u94FE\u63A5\"\n required\n type=\"text\"\n #linkControl=\"ngModel\"\n [(ngModel)]=\"link\"\n />\n </thy-form-group>\n <thy-form-group-footer>\n <div class=\"btn-pair\">\n <button\n thyButton=\"link-secondary\"\n thySize=\"sm\"\n (click)=\"closePopover()\"\n >\u53D6\u6D88</button>\n <button\n thyButton=\"primary-square\"\n thySize=\"sm\"\n (thyFormSubmit)=\"applyLink(linkForm)\"\n >\u5E94\u7528</button>\n </div>\n </thy-form-group-footer>\n</form>\n", components: [{ type: i2$
|
|
6734
|
+
TheLinkEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheLinkEditComponent, selector: "the-link-edit", inputs: { tag: "tag", node: "node", link: "link", text: "text", originSelection: "originSelection" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class": "this.className" } }, ngImport: i0, template: "<form\n thyForm\n #linkForm=\"thyForm\"\n [thyFormValidatorConfig]=\"validatorConfig\"\n name=\"linkForm\"\n>\n <thy-form-group thyLabelText=\"\u6587\u672C\">\n <input\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u6587\u672C\"\n required\n name=\"text\"\n [(ngModel)]=\"text\"\n thyAutofocus\n type=\"text\"\n />\n </thy-form-group>\n <thy-form-group thyLabelText=\"\u94FE\u63A5\">\n <input\n name=\"link\"\n thyInput\n placeholder=\"\u8BF7\u8F93\u5165\u94FE\u63A5\"\n required\n type=\"text\"\n #linkControl=\"ngModel\"\n [(ngModel)]=\"link\"\n />\n </thy-form-group>\n <thy-form-group-footer>\n <div class=\"btn-pair\">\n <button\n thyButton=\"link-secondary\"\n thySize=\"sm\"\n (click)=\"closePopover()\"\n >\u53D6\u6D88</button>\n <button\n thyButton=\"primary-square\"\n thySize=\"sm\"\n (thyFormSubmit)=\"applyLink(linkForm)\"\n >\u5E94\u7528</button>\n </div>\n </thy-form-group-footer>\n</form>\n", components: [{ type: i2$1.ThyFormGroupComponent, selector: "thy-form-group", inputs: ["thyLabelText", "thyLabelTextTranslateKey", "thyLabelRequired", "thyLabelPaddingTopClear", "thyFeedbackIcon", "thyTips", "thyTipsTranslateKey", "thyRowFill"] }, { type: i2$1.ThyFormGroupFooterComponent, selector: "thy-form-group-footer", inputs: ["thyAlign"] }, { type: i1$5.ThyButtonComponent, selector: "thy-button,[thy-button],[thyButton]", inputs: ["thyButton", "thyType", "thyLoading", "thyLoadingText", "thySize", "thyIcon", "thySquare", "thyBlock"] }], directives: [{ type: i4$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i4$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4$2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2$1.ThyFormDirective, selector: "[thyForm],[thy-form]", inputs: ["thyLayout", "thyEnterKeyMode", "thyFormValidatorConfig"], exportAs: ["thyForm"] }, { type: i5$4.ThyAutofocusDirective, selector: "input[thyAutofocus],textarea[thyAutofocus]", inputs: ["thyAutoSelect", "thyAutofocus"] }, { type: i4$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.ThyInputDirective, selector: "[thyInput]", inputs: ["thySize", "thyAutocomplete"] }, { type: i4$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i2$1.ThyFormSubmitDirective, selector: "[thyFormSubmit],[thy-form-submit]", outputs: ["thyFormSubmit"] }] });
|
|
6580
6735
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheLinkEditComponent, decorators: [{
|
|
6581
6736
|
type: Component,
|
|
6582
6737
|
args: [{
|
|
@@ -6716,7 +6871,7 @@ class TheBaseLinkComponent extends TheBaseElementComponent {
|
|
|
6716
6871
|
this.close(LinkCloseTypes.destroy);
|
|
6717
6872
|
}
|
|
6718
6873
|
}
|
|
6719
|
-
TheBaseLinkComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheBaseLinkComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$3.ThyPopover }, { token: i2
|
|
6874
|
+
TheBaseLinkComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheBaseLinkComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$3.ThyPopover }, { token: i2.Overlay }, { token: i0.ViewContainerRef }, { token: i1$6.ThyClickDispatcher }], target: i0.ɵɵFactoryTarget.Component });
|
|
6720
6875
|
TheBaseLinkComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheBaseLinkComponent, selector: "[TheBaseLinkComponent]", host: { listeners: { "click": "mousedownHandle($event)" } }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
6721
6876
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheBaseLinkComponent, decorators: [{
|
|
6722
6877
|
type: Component,
|
|
@@ -6724,7 +6879,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
|
|
|
6724
6879
|
selector: '[TheBaseLinkComponent]',
|
|
6725
6880
|
template: ''
|
|
6726
6881
|
}]
|
|
6727
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$3.ThyPopover }, { type: i2
|
|
6882
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$3.ThyPopover }, { type: i2.Overlay }, { type: i0.ViewContainerRef }, { type: i1$6.ThyClickDispatcher }]; }, propDecorators: { mousedownHandle: [{
|
|
6728
6883
|
type: HostListener,
|
|
6729
6884
|
args: ['click', ['$event']]
|
|
6730
6885
|
}] } });
|
|
@@ -6897,7 +7052,7 @@ class TheTableToolbarItemComponent extends TheToolbarBaseItemComponent {
|
|
|
6897
7052
|
return this.tableSelectRef;
|
|
6898
7053
|
}
|
|
6899
7054
|
}
|
|
6900
|
-
TheTableToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheTableToolbarItemComponent, deps: [{ token: i1$6.ThyPopover }, { token: i2
|
|
7055
|
+
TheTableToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheTableToolbarItemComponent, deps: [{ token: i1$6.ThyPopover }, { token: i2.Overlay }], target: i0.ɵɵFactoryTarget.Component });
|
|
6901
7056
|
TheTableToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheTableToolbarItemComponent, selector: "the-table-toolbar-item", inputs: { item: "item", editor: "editor" }, host: { classAttribute: "the-toolbar-dropdown-container" }, usesInheritance: true, ngImport: i0, template: `
|
|
6902
7057
|
<a
|
|
6903
7058
|
thyIconNavLink
|
|
@@ -6910,7 +7065,7 @@ TheTableToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12
|
|
|
6910
7065
|
<thy-icon [thyIconName]="item.icon"></thy-icon>
|
|
6911
7066
|
<thy-icon class="link-down-icon font-size-sm text-desc table-down-icon" thyIconName="caret-down"> </thy-icon>
|
|
6912
7067
|
</a>
|
|
6913
|
-
`, isInline: true, components: [{ type:
|
|
7068
|
+
`, isInline: true, components: [{ type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
6914
7069
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheTableToolbarItemComponent, decorators: [{
|
|
6915
7070
|
type: Component,
|
|
6916
7071
|
args: [{
|
|
@@ -6932,7 +7087,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
|
|
|
6932
7087
|
class: 'the-toolbar-dropdown-container'
|
|
6933
7088
|
}
|
|
6934
7089
|
}]
|
|
6935
|
-
}], ctorParameters: function () { return [{ type: i1$6.ThyPopover }, { type: i2
|
|
7090
|
+
}], ctorParameters: function () { return [{ type: i1$6.ThyPopover }, { type: i2.Overlay }]; }, propDecorators: { item: [{
|
|
6936
7091
|
type: Input
|
|
6937
7092
|
}], editor: [{
|
|
6938
7093
|
type: Input
|
|
@@ -7621,40 +7776,6 @@ function setCellMenuInvisibility(editor, menuList, selectedCells, isActiveSelect
|
|
|
7621
7776
|
});
|
|
7622
7777
|
}
|
|
7623
7778
|
|
|
7624
|
-
class NavSplitLineComponent {
|
|
7625
|
-
constructor() {
|
|
7626
|
-
this.mode = ToolbarItemMode.vertical;
|
|
7627
|
-
this.theNavSplitLine = true;
|
|
7628
|
-
}
|
|
7629
|
-
get horizontal() {
|
|
7630
|
-
return this.mode === ToolbarItemMode.horizontal;
|
|
7631
|
-
}
|
|
7632
|
-
get vertical() {
|
|
7633
|
-
return this.mode === ToolbarItemMode.vertical;
|
|
7634
|
-
}
|
|
7635
|
-
ngOnInit() { }
|
|
7636
|
-
}
|
|
7637
|
-
NavSplitLineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: NavSplitLineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7638
|
-
NavSplitLineComponent.ɵcmp = i0.ɵɵ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, template: '', isInline: true });
|
|
7639
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: NavSplitLineComponent, decorators: [{
|
|
7640
|
-
type: Component,
|
|
7641
|
-
args: [{
|
|
7642
|
-
selector: 'nav-split-line',
|
|
7643
|
-
template: ''
|
|
7644
|
-
}]
|
|
7645
|
-
}], ctorParameters: function () { return []; }, propDecorators: { mode: [{
|
|
7646
|
-
type: Input
|
|
7647
|
-
}], theNavSplitLine: [{
|
|
7648
|
-
type: HostBinding,
|
|
7649
|
-
args: ['class.the-nav-split-line']
|
|
7650
|
-
}], horizontal: [{
|
|
7651
|
-
type: HostBinding,
|
|
7652
|
-
args: ['class.horizontal']
|
|
7653
|
-
}], vertical: [{
|
|
7654
|
-
type: HostBinding,
|
|
7655
|
-
args: ['class.vertical']
|
|
7656
|
-
}] } });
|
|
7657
|
-
|
|
7658
7779
|
class TheTableToolbarComponent {
|
|
7659
7780
|
constructor(ngZone, colorSelectService, popoverRef) {
|
|
7660
7781
|
this.ngZone = ngZone;
|
|
@@ -7765,7 +7886,7 @@ class TheTableToolbarComponent {
|
|
|
7765
7886
|
}
|
|
7766
7887
|
}
|
|
7767
7888
|
TheTableToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheTableToolbarComponent, deps: [{ token: i0.NgZone }, { token: TheColorSelectService }, { token: i1$3.ThyPopoverRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
7768
|
-
TheTableToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheTableToolbarComponent, selector: "the-table-toolbar", inputs: { tableStore: "tableStore", isActiveSelect: "isActiveSelect" }, ngImport: i0, 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:
|
|
7889
|
+
TheTableToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheTableToolbarComponent, selector: "the-table-toolbar", inputs: { tableStore: "tableStore", isActiveSelect: "isActiveSelect" }, ngImport: i0, template: "<thy-icon-nav>\n <ng-container *ngFor=\"let item of cellMenuList\">\n <a href=\"javascript:;\" thyIconNavLink *ngIf=\"!item.invisibility\" [thyTooltip]=\"item.name\" (mousedown)=\"item.actionHandle()\">\n <thy-icon [thyIconName]=\"item.icon\"></thy-icon>\n </a>\n </ng-container>\n <nav-split-line *ngIf=\"!isActiveSelect && isShowSplitLine\"></nav-split-line>\n <a href=\"javascript:;\" thyIconNavLink thyTooltip=\"\u5355\u5143\u683C\u80CC\u666F\" (mousedown)=\"openSelectColor($event)\">\n <thy-icon thyIconName=\"background-tt\" thyIconType=\"twotone\" [thyTwotoneColor]=\"selectedColor\"></thy-icon>\n </a>\n <nav-split-line *ngIf=\"deleteIcon\"></nav-split-line>\n <a\n *ngIf=\"deleteIcon\"\n href=\"javascript:;\"\n thyIconNavLink\n [thyTooltip]=\"iconName\"\n class=\"danger\"\n [thyIconNavLinkIcon]=\"deleteIcon\"\n (mousedown)=\"onDelete($event)\"\n (mouseenter)=\"onEnterDelete($event)\"\n (mouseleave)=\"onLeaveDelete($event)\"\n ></a>\n</thy-icon-nav>\n", components: [{ type: i3.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
7769
7890
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheTableToolbarComponent, decorators: [{
|
|
7770
7891
|
type: Component,
|
|
7771
7892
|
args: [{
|
|
@@ -7828,7 +7949,7 @@ class TheContextMenuComponent {
|
|
|
7828
7949
|
ngOnInit() { }
|
|
7829
7950
|
}
|
|
7830
7951
|
TheContextMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheContextMenuComponent, deps: [{ token: i0.ElementRef }, { token: i1$3.ThyPopoverRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
7831
|
-
TheContextMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheContextMenuComponent, selector: "the-contextmenu", inputs: { menuEntities: "menuEntities", actionHandle: "actionHandle", activeHandle: "activeHandle", deactiveHandle: "deactiveHandle" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)", "mousedown": "handleMouseDown($event)" }, properties: { "class.the-overlay-menu-wrap": "this.wrap" } }, ngImport: i0, template: "<thy-action-menu>\n <ng-container *ngFor=\"let menuItem of menuEntities\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n *ngIf=\"!menuItem.invisibility\"\n (mousedown)=\"itemMousedown($event, menuItem)\"\n (mouseenter)=\"itemMouseenter($event, menuItem)\"\n (mouseleave)=\"itemMouseleave($event, menuItem)\"\n >\n <span thyActionMenuItemIcon>\n <thy-icon\n *ngIf=\"menuItem.backgroundColor; else elseIcon\"\n [thyIconName]=\"menuItem.icon\"\n thyIconType=\"twotone\"\n [thyTwotoneColor]=\"menuItem.backgroundColor\"\n ></thy-icon>\n <ng-template #elseIcon>\n <thy-icon [thyIconName]=\"menuItem.icon\"></thy-icon>\n </ng-template>\n </span>\n <span thyActionMenuItemName>{{ menuItem.name }}</span>\n <span *ngIf=\"menuItem.extendIcon\" thyActionMenuItemExtendIcon>\n <thy-icon thyIconName=\"{{ menuItem.extendIcon }}\"></thy-icon>\n </span>\n </a>\n <thy-action-menu-divider *ngIf=\"menuItem.divider\"></thy-action-menu-divider>\n </ng-container>\n</thy-action-menu>\n", components: [{ type: i5$
|
|
7952
|
+
TheContextMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheContextMenuComponent, selector: "the-contextmenu", inputs: { menuEntities: "menuEntities", actionHandle: "actionHandle", activeHandle: "activeHandle", deactiveHandle: "deactiveHandle" }, host: { listeners: { "document: mousedown": "handleDocumentMouseDown($event)", "mousedown": "handleMouseDown($event)" }, properties: { "class.the-overlay-menu-wrap": "this.wrap" } }, ngImport: i0, template: "<thy-action-menu>\n <ng-container *ngFor=\"let menuItem of menuEntities\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n *ngIf=\"!menuItem.invisibility\"\n (mousedown)=\"itemMousedown($event, menuItem)\"\n (mouseenter)=\"itemMouseenter($event, menuItem)\"\n (mouseleave)=\"itemMouseleave($event, menuItem)\"\n >\n <span thyActionMenuItemIcon>\n <thy-icon\n *ngIf=\"menuItem.backgroundColor; else elseIcon\"\n [thyIconName]=\"menuItem.icon\"\n thyIconType=\"twotone\"\n [thyTwotoneColor]=\"menuItem.backgroundColor\"\n ></thy-icon>\n <ng-template #elseIcon>\n <thy-icon [thyIconName]=\"menuItem.icon\"></thy-icon>\n </ng-template>\n </span>\n <span thyActionMenuItemName>{{ menuItem.name }}</span>\n <span *ngIf=\"menuItem.extendIcon\" thyActionMenuItemExtendIcon>\n <thy-icon thyIconName=\"{{ menuItem.extendIcon }}\"></thy-icon>\n </span>\n </a>\n <thy-action-menu-divider *ngIf=\"menuItem.divider\"></thy-action-menu-divider>\n </ng-container>\n</thy-action-menu>\n", components: [{ type: i5$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i4$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5$2.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }, { type: i5$2.ThyActionMenuItemExtendIconDirective, selector: "[thyActionMenuItemExtendIcon]" }] });
|
|
7832
7953
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheContextMenuComponent, decorators: [{
|
|
7833
7954
|
type: Component,
|
|
7834
7955
|
args: [{
|
|
@@ -8117,11 +8238,11 @@ class TableService {
|
|
|
8117
8238
|
});
|
|
8118
8239
|
}
|
|
8119
8240
|
}
|
|
8120
|
-
TableService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TableService, deps: [{ token: i1$3.ThyPopover }, { token: i2
|
|
8241
|
+
TableService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TableService, deps: [{ token: i1$3.ThyPopover }, { token: i2.Overlay }, { token: TableStore }, { token: TheTableContextMenuService }, { token: i0.NgZone }, { token: TheContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
8121
8242
|
TableService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TableService });
|
|
8122
8243
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TableService, decorators: [{
|
|
8123
8244
|
type: Injectable
|
|
8124
|
-
}], ctorParameters: function () { return [{ type: i1$3.ThyPopover }, { type: i2
|
|
8245
|
+
}], ctorParameters: function () { return [{ type: i1$3.ThyPopover }, { type: i2.Overlay }, { type: TableStore }, { type: TheTableContextMenuService }, { type: i0.NgZone }, { type: TheContextService }]; } });
|
|
8125
8246
|
|
|
8126
8247
|
const SLA_TABLE_SELECTOR = '.slate-element-table';
|
|
8127
8248
|
const SLA_TABLE_CELL_SELECTOR = '.slate-element-table-cell';
|
|
@@ -8200,7 +8321,7 @@ class TheInsertMarkComponent {
|
|
|
8200
8321
|
ngOnDestroy() { }
|
|
8201
8322
|
}
|
|
8202
8323
|
TheInsertMarkComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheInsertMarkComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
8203
|
-
TheInsertMarkComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: { type: "type", at: "at", tableStore: "tableStore" }, ngImport: i0, template: "<div\n [thyTooltip]=\"!disabled && tooltipContent\"\n class=\"the-table-controls-insert-wrapper\"\n [ngClass]=\"{ disabled: disabled }\"\n contenteditable=\"false\"\n (mousedown)=\"onMouseDown($event)\"\n (mouseenter)=\"onMouseEnter($event)\"\n (mouseleave)=\"onMouseLeave($event)\"\n>\n <div\n class=\"the-table-controls-insert-line\"\n *ngIf=\"dotWrapperHovered\"\n [attr.data-dot-type]=\"type\"\n [ngStyle]=\"{ height: type === 'column' && insertLength, width: type === 'row' && insertLength }\"\n ></div>\n</div>\n", directives: [{ type:
|
|
8324
|
+
TheInsertMarkComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheInsertMarkComponent, selector: "the-table-insert-mark", inputs: { type: "type", at: "at", tableStore: "tableStore" }, ngImport: i0, template: "<div\n [thyTooltip]=\"!disabled && tooltipContent\"\n class=\"the-table-controls-insert-wrapper\"\n [ngClass]=\"{ disabled: disabled }\"\n contenteditable=\"false\"\n (mousedown)=\"onMouseDown($event)\"\n (mouseenter)=\"onMouseEnter($event)\"\n (mouseleave)=\"onMouseLeave($event)\"\n>\n <div\n class=\"the-table-controls-insert-line\"\n *ngIf=\"dotWrapperHovered\"\n [attr.data-dot-type]=\"type\"\n [ngStyle]=\"{ height: type === 'column' && insertLength, width: type === 'row' && insertLength }\"\n ></div>\n</div>\n", directives: [{ type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
8204
8325
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheInsertMarkComponent, decorators: [{
|
|
8205
8326
|
type: Component,
|
|
8206
8327
|
args: [{
|
|
@@ -9746,7 +9867,7 @@ class TheTdComponent extends TheBaseElementComponent {
|
|
|
9746
9867
|
this.destroy$.complete();
|
|
9747
9868
|
}
|
|
9748
9869
|
}
|
|
9749
|
-
TheTdComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheTdComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: i0.ViewContainerRef }, { token: i0.NgZone }, { token: i0.Injector }, { token: i2
|
|
9870
|
+
TheTdComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheTdComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: i0.ViewContainerRef }, { token: i0.NgZone }, { token: i0.Injector }, { token: i2.Overlay }, { token: ColumnResizingStore }, { token: i2.ScrollDispatcher }], target: i0.ɵɵFactoryTarget.Component });
|
|
9750
9871
|
TheTdComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheTdComponent, selector: "td[theTd]", host: { properties: { "style.backgroundColor": "this.backgroundColor", "attr.colspan": "this.colspan", "attr.rowspan": "this.rowspan", "style.display": "this.display" } }, providers: [ColumnResizingStore], viewQueries: [{ propertyName: "cellInner", first: true, predicate: ["cellInner"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div #cellInner>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n</div>\n", components: [{ type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
|
|
9751
9872
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheTdComponent, decorators: [{
|
|
9752
9873
|
type: Component,
|
|
@@ -9755,7 +9876,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
|
|
|
9755
9876
|
templateUrl: './td.component.html',
|
|
9756
9877
|
providers: [ColumnResizingStore]
|
|
9757
9878
|
}]
|
|
9758
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i0.NgZone }, { type: i0.Injector }, { type: i2
|
|
9879
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i0.ViewContainerRef }, { type: i0.NgZone }, { type: i0.Injector }, { type: i2.Overlay }, { type: ColumnResizingStore }, { type: i2.ScrollDispatcher }]; }, propDecorators: { backgroundColor: [{
|
|
9759
9880
|
type: HostBinding,
|
|
9760
9881
|
args: ['style.backgroundColor']
|
|
9761
9882
|
}], colspan: [{
|
|
@@ -9792,7 +9913,7 @@ const normalizeTable = (table) => {
|
|
|
9792
9913
|
}
|
|
9793
9914
|
// case 2
|
|
9794
9915
|
if (cell.hidden && !normalizedNodes.includes(cell)) {
|
|
9795
|
-
const origin =
|
|
9916
|
+
const origin = getOriginCell(table, rowIndex, columnIndex);
|
|
9796
9917
|
if (!origin) {
|
|
9797
9918
|
delete table.children[rowIndex].children[columnIndex].hidden;
|
|
9798
9919
|
}
|
|
@@ -9803,7 +9924,7 @@ const normalizeTable = (table) => {
|
|
|
9803
9924
|
};
|
|
9804
9925
|
|
|
9805
9926
|
const withTable = (editor) => {
|
|
9806
|
-
const { deleteBackward, deleteForward, onKeydown, setFragmentData, insertData, normalizeNode, isBlockCard, renderElement, deleteCutData, isContainer } = editor;
|
|
9927
|
+
const { deleteBackward, deleteForward, onKeydown, setFragmentData, insertData, normalizeNode, isBlockCard, renderElement, deleteCutData, isContainer, onChange } = editor;
|
|
9807
9928
|
editor.deleteBackward = unit => {
|
|
9808
9929
|
const opts = new TableOptions$1();
|
|
9809
9930
|
if (!isSelectionInTable(opts, editor)) {
|
|
@@ -9874,13 +9995,11 @@ const withTable = (editor) => {
|
|
|
9874
9995
|
const aboveCell = aboveRow && aboveRow.children[startPosition.getColumnIndex()];
|
|
9875
9996
|
if (aboveCell) {
|
|
9876
9997
|
if (aboveCell.hidden) {
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
at = Editor.start(editor, TheEditor.findPath(editor, originSpan));
|
|
9880
|
-
}
|
|
9998
|
+
TableEditor.selectOriginCell(editor, startPosition.table, startPosition.getRowIndex() - 1, startPosition.getColumnIndex(), false);
|
|
9999
|
+
return;
|
|
9881
10000
|
}
|
|
9882
10001
|
else {
|
|
9883
|
-
at = Editor.
|
|
10002
|
+
at = Editor.end(editor, TheEditor.findPath(editor, aboveCell));
|
|
9884
10003
|
}
|
|
9885
10004
|
}
|
|
9886
10005
|
else {
|
|
@@ -9909,10 +10028,8 @@ const withTable = (editor) => {
|
|
|
9909
10028
|
const belowCell = belowRow && belowRow.children[startPosition.getColumnIndex()];
|
|
9910
10029
|
if (belowCell) {
|
|
9911
10030
|
if (belowCell.hidden) {
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
at = Editor.start(editor, TheEditor.findPath(editor, originSpan));
|
|
9915
|
-
}
|
|
10031
|
+
TableEditor.selectOriginCell(editor, startPosition.table, startPosition.getRowIndex() + 1, startPosition.getColumnIndex(), true);
|
|
10032
|
+
return;
|
|
9916
10033
|
}
|
|
9917
10034
|
else {
|
|
9918
10035
|
at = Editor.start(editor, TheEditor.findPath(editor, belowCell));
|
|
@@ -9931,18 +10048,27 @@ const withTable = (editor) => {
|
|
|
9931
10048
|
const beforePoint = Editor.before(editor, editor.selection);
|
|
9932
10049
|
const beforePosition = beforePoint && TablePosition.create(opts, editor, beforePoint.path);
|
|
9933
10050
|
if (beforePosition && beforePosition.cell && beforePosition.cell.hidden) {
|
|
10051
|
+
event.preventDefault();
|
|
9934
10052
|
const at = Editor.end(editor, TheEditor.findPath(editor, beforePosition.findPrevious()));
|
|
9935
10053
|
Transforms.select(editor, at);
|
|
9936
|
-
event.preventDefault();
|
|
9937
10054
|
}
|
|
9938
10055
|
}
|
|
9939
10056
|
if (isMoveForward) {
|
|
9940
10057
|
const afterPoint = Editor.after(editor, editor.selection);
|
|
9941
10058
|
const afterPosition = afterPoint && TablePosition.create(opts, editor, afterPoint.path);
|
|
9942
10059
|
if (afterPosition.cell && afterPosition.cell.hidden) {
|
|
9943
|
-
const at = Editor.start(editor, TheEditor.findPath(editor, afterPosition.findNext()));
|
|
9944
|
-
Transforms.select(editor, at);
|
|
9945
10060
|
event.preventDefault();
|
|
10061
|
+
const nextCell = afterPosition.findNext();
|
|
10062
|
+
if (nextCell) {
|
|
10063
|
+
const at = Editor.start(editor, TheEditor.findPath(editor, afterPosition.findNext()));
|
|
10064
|
+
Transforms.select(editor, at);
|
|
10065
|
+
event.preventDefault();
|
|
10066
|
+
}
|
|
10067
|
+
else {
|
|
10068
|
+
AngularEditor.moveBlockCard(editor, startPosition.tableEntry[0], { direction: 'right' });
|
|
10069
|
+
event.preventDefault();
|
|
10070
|
+
}
|
|
10071
|
+
return;
|
|
9946
10072
|
}
|
|
9947
10073
|
}
|
|
9948
10074
|
// Prevent deleting cells in the table
|
|
@@ -10012,12 +10138,12 @@ const withTable = (editor) => {
|
|
|
10012
10138
|
}
|
|
10013
10139
|
if (tableFragment) {
|
|
10014
10140
|
tableFragment = normalizeTable(_.cloneDeep(tableFragment));
|
|
10141
|
+
const plainText = Node.string(tableFragment);
|
|
10015
10142
|
tableFragment = [tableFragment];
|
|
10016
10143
|
const stringObj = JSON.stringify(tableFragment);
|
|
10017
10144
|
const encoded = window.btoa(encodeURIComponent(stringObj));
|
|
10018
10145
|
unit.setData(`application/${CLIPBOARD_FORMAT_KEY}`, encoded);
|
|
10019
|
-
|
|
10020
|
-
unit.setData('text/plain', Node.string(tableFragment));
|
|
10146
|
+
unit.setData('text/plain', plainText);
|
|
10021
10147
|
return;
|
|
10022
10148
|
}
|
|
10023
10149
|
setFragmentData(unit);
|
|
@@ -10042,7 +10168,7 @@ const withTable = (editor) => {
|
|
|
10042
10168
|
for (let j = selectColIndex; j <= lastColIndex; j++) {
|
|
10043
10169
|
const row = tablePosition.table.children[i];
|
|
10044
10170
|
if (row && row.children[j]) {
|
|
10045
|
-
const originCell =
|
|
10171
|
+
const originCell = getOriginCell(tablePosition.table, i, j);
|
|
10046
10172
|
if (originCell && (originCell.colspan || originCell.rowspan)) {
|
|
10047
10173
|
const path = TheEditor.findPath(editor, originCell).slice(-2);
|
|
10048
10174
|
resetTableCell(editor, tablePosition.table, originCell, path[0], path[1]);
|
|
@@ -10100,6 +10226,21 @@ const withTable = (editor) => {
|
|
|
10100
10226
|
Transforms.setNodes(editor, { columns }, { at: entry[1] });
|
|
10101
10227
|
}
|
|
10102
10228
|
}
|
|
10229
|
+
// adjust selection when selection is in hidden cell
|
|
10230
|
+
if (Element$1.isElement(entry[0]) && entry[0].type === ElementKinds.tableCell && entry[0].hidden) {
|
|
10231
|
+
if (editor.selection && Range.isCollapsed(editor.selection) && Path.isAncestor(entry[1], editor.selection.anchor.path)) {
|
|
10232
|
+
setTimeout(() => {
|
|
10233
|
+
const opts = new TableOptions$1();
|
|
10234
|
+
const tablePosition = TablePosition.create(opts, editor, editor.selection.anchor.path);
|
|
10235
|
+
const origin = getOriginCell(tablePosition.table, tablePosition.getRowIndex(), tablePosition.getColumnIndex());
|
|
10236
|
+
if (origin) {
|
|
10237
|
+
const path = AngularEditor.findPath(editor, origin);
|
|
10238
|
+
Transforms.select(editor, Editor.end(editor, path));
|
|
10239
|
+
}
|
|
10240
|
+
}, 0);
|
|
10241
|
+
return;
|
|
10242
|
+
}
|
|
10243
|
+
}
|
|
10103
10244
|
normalizeNode(entry);
|
|
10104
10245
|
};
|
|
10105
10246
|
editor.isBlockCard = (element) => {
|
|
@@ -10147,6 +10288,20 @@ const withTable = (editor) => {
|
|
|
10147
10288
|
editor.isContainer = (element) => {
|
|
10148
10289
|
return element.type === ElementKinds.tableCell ? true : isContainer(element);
|
|
10149
10290
|
};
|
|
10291
|
+
editor.onChange = () => {
|
|
10292
|
+
onChange();
|
|
10293
|
+
// adujst selection when selection is in hidden cell
|
|
10294
|
+
// just hook set_selection
|
|
10295
|
+
const isCollapsed = editor.selection && Range.isCollapsed(editor.selection);
|
|
10296
|
+
const isSelectionOperation = editor.operations.every(op => Operation.isSelectionOperation(op));
|
|
10297
|
+
if (isCollapsed && isSelectionOperation) {
|
|
10298
|
+
const opts = new TableOptions$1();
|
|
10299
|
+
const tablePosition = TablePosition.create(opts, editor, editor.selection.anchor.path);
|
|
10300
|
+
if (tablePosition.isInTable() && tablePosition.cell.hidden) {
|
|
10301
|
+
TableEditor.selectOriginCell(editor, tablePosition.table, tablePosition.getRowIndex(), tablePosition.getColumnIndex(), false);
|
|
10302
|
+
}
|
|
10303
|
+
}
|
|
10304
|
+
};
|
|
10150
10305
|
return editor;
|
|
10151
10306
|
};
|
|
10152
10307
|
|
|
@@ -10279,7 +10434,7 @@ class TheVerticalToolbarItemComponent extends TheToolbarBaseItemComponent {
|
|
|
10279
10434
|
}
|
|
10280
10435
|
}
|
|
10281
10436
|
TheVerticalToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheVerticalToolbarItemComponent, deps: [{ token: i0.ElementRef }, { token: i1$6.ThyPopover }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
10282
|
-
TheVerticalToolbarItemComponent.ɵcmp = i0.ɵɵ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: TemplateRef, static: true }], usesInheritance: true, ngImport: i0, 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:
|
|
10437
|
+
TheVerticalToolbarItemComponent.ɵcmp = i0.ɵɵ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: TemplateRef, static: true }], usesInheritance: true, ngImport: i0, 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: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5$2.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
10283
10438
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheVerticalToolbarItemComponent, decorators: [{
|
|
10284
10439
|
type: Component,
|
|
10285
10440
|
args: [{
|
|
@@ -10402,12 +10557,14 @@ const PaintFormatOptions = [
|
|
|
10402
10557
|
key: ToolbarActionTypes.undo,
|
|
10403
10558
|
icon: 'undo',
|
|
10404
10559
|
name: '撤销',
|
|
10560
|
+
shortcutKey: `${CONTROL_KEY}+Z`,
|
|
10405
10561
|
execute: (editor) => editor.undo()
|
|
10406
10562
|
},
|
|
10407
10563
|
{
|
|
10408
10564
|
key: ToolbarActionTypes.redo,
|
|
10409
10565
|
icon: 'redo',
|
|
10410
10566
|
name: '重做',
|
|
10567
|
+
shortcutKey: `${CONTROL_KEY}+Shift+Z`,
|
|
10411
10568
|
execute: (editor) => editor.redo()
|
|
10412
10569
|
},
|
|
10413
10570
|
{
|
|
@@ -10518,7 +10675,8 @@ TheToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
|
|
|
10518
10675
|
<a
|
|
10519
10676
|
thyIconNavLink
|
|
10520
10677
|
[thyIconNavLinkIcon]="item.icon"
|
|
10521
|
-
[thyTooltip]="
|
|
10678
|
+
[thyTooltip]="tooltip"
|
|
10679
|
+
[thyTooltipTemplateContext]="{ name: item.name, shortcutKey: item.shortcutKey }"
|
|
10522
10680
|
thyTooltipPlacement="top"
|
|
10523
10681
|
[thyIconNavLinkActive]="active"
|
|
10524
10682
|
(mousedown)="execute($event)"
|
|
@@ -10530,8 +10688,9 @@ TheToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0"
|
|
|
10530
10688
|
<span class="quick-toolbar-name">{{ item?.name }}</span>
|
|
10531
10689
|
</ng-container>
|
|
10532
10690
|
</ng-template>
|
|
10691
|
+
<ng-template #tooltip let-data> {{ data.name }} {{ data.shortcutKey }} </ng-template>
|
|
10533
10692
|
<ng-container #toolbarContainer></ng-container>
|
|
10534
|
-
`, isInline: true, components: [{ type:
|
|
10693
|
+
`, isInline: true, components: [{ type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
10535
10694
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarItemComponent, decorators: [{
|
|
10536
10695
|
type: Component,
|
|
10537
10696
|
args: [{
|
|
@@ -10541,7 +10700,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
|
|
|
10541
10700
|
<a
|
|
10542
10701
|
thyIconNavLink
|
|
10543
10702
|
[thyIconNavLinkIcon]="item.icon"
|
|
10544
|
-
[thyTooltip]="
|
|
10703
|
+
[thyTooltip]="tooltip"
|
|
10704
|
+
[thyTooltipTemplateContext]="{ name: item.name, shortcutKey: item.shortcutKey }"
|
|
10545
10705
|
thyTooltipPlacement="top"
|
|
10546
10706
|
[thyIconNavLinkActive]="active"
|
|
10547
10707
|
(mousedown)="execute($event)"
|
|
@@ -10553,6 +10713,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
|
|
|
10553
10713
|
<span class="quick-toolbar-name">{{ item?.name }}</span>
|
|
10554
10714
|
</ng-container>
|
|
10555
10715
|
</ng-template>
|
|
10716
|
+
<ng-template #tooltip let-data> {{ data.name }} {{ data.shortcutKey }} </ng-template>
|
|
10556
10717
|
<ng-container #toolbarContainer></ng-container>
|
|
10557
10718
|
`,
|
|
10558
10719
|
host: {
|
|
@@ -10613,7 +10774,7 @@ class TheQuickToolbarComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
10613
10774
|
}
|
|
10614
10775
|
}
|
|
10615
10776
|
TheQuickToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheQuickToolbarComponent, deps: [{ token: i1$3.ThyPopoverRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
10616
|
-
TheQuickToolbarComponent.ɵcmp = i0.ɵɵ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, 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$
|
|
10777
|
+
TheQuickToolbarComponent.ɵcmp = i0.ɵɵ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, 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$2.ThySelectionListComponent, selector: "thy-selection-list,[thy-selection-list]", inputs: ["thyMultiple", "thyBindKeyEventContainer", "thyScrollContainer", "thyBeforeKeydown", "thyUniqueKey", "thyCompareWith", "thyLayout", "thyAutoActiveFirstItem", "thySize", "thySpaceKeyEnabled"], outputs: ["thySelectionChange"] }, { type: i5$4.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.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
10617
10778
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheQuickToolbarComponent, decorators: [{
|
|
10618
10779
|
type: Component,
|
|
10619
10780
|
args: [{
|
|
@@ -10716,6 +10877,146 @@ const withQuickInsert = (editor) => {
|
|
|
10716
10877
|
return editor;
|
|
10717
10878
|
};
|
|
10718
10879
|
|
|
10880
|
+
const withSoftBreak = (options = { rules: [{ hotkey: 'shift+enter' }] }) => (editor) => {
|
|
10881
|
+
const { onKeydown } = editor;
|
|
10882
|
+
editor.onKeydown = (event) => {
|
|
10883
|
+
const { rules } = options;
|
|
10884
|
+
const entry = getBlockAbove(editor);
|
|
10885
|
+
rules.forEach(({ hotkey, query }) => {
|
|
10886
|
+
if (isHotkey(hotkey, event) && isNodeType(entry, query)) {
|
|
10887
|
+
event.preventDefault();
|
|
10888
|
+
editor.insertText('\n');
|
|
10889
|
+
}
|
|
10890
|
+
});
|
|
10891
|
+
onKeydown(event);
|
|
10892
|
+
};
|
|
10893
|
+
return editor;
|
|
10894
|
+
};
|
|
10895
|
+
|
|
10896
|
+
class TheFontSizeToolbarItemComponent extends TheToolbarBaseItemComponent {
|
|
10897
|
+
constructor(elementRef, thyPopover, viewContainerRef, overlay) {
|
|
10898
|
+
super();
|
|
10899
|
+
this.elementRef = elementRef;
|
|
10900
|
+
this.thyPopover = thyPopover;
|
|
10901
|
+
this.viewContainerRef = viewContainerRef;
|
|
10902
|
+
this.overlay = overlay;
|
|
10903
|
+
this.fontSizes = FontSizes;
|
|
10904
|
+
this.disabled = false;
|
|
10905
|
+
this.disableGroup = HEADING_TYPES;
|
|
10906
|
+
this.toolbarItemContainer = true;
|
|
10907
|
+
this.fontSizeToolbarItem = true;
|
|
10908
|
+
}
|
|
10909
|
+
get isOpen() {
|
|
10910
|
+
return this.dropdownPopoverRef && this.dropdownPopoverRef.getOverlayRef() && this.dropdownPopoverRef.getOverlayRef().hasAttached();
|
|
10911
|
+
}
|
|
10912
|
+
get disableClass() {
|
|
10913
|
+
return this.disabled;
|
|
10914
|
+
}
|
|
10915
|
+
toggleDropdown(event) {
|
|
10916
|
+
var _a;
|
|
10917
|
+
super.execute(event);
|
|
10918
|
+
if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || this.disabled) {
|
|
10919
|
+
return;
|
|
10920
|
+
}
|
|
10921
|
+
this.openDropdownPopover();
|
|
10922
|
+
}
|
|
10923
|
+
handleDocumentMouseDown(event) {
|
|
10924
|
+
if (!this.elementRef.nativeElement.contains(event.target)) {
|
|
10925
|
+
this.closeDropdownPopover();
|
|
10926
|
+
}
|
|
10927
|
+
}
|
|
10928
|
+
ngOnInit() {
|
|
10929
|
+
this.activeSize = this.fontSizes[2];
|
|
10930
|
+
}
|
|
10931
|
+
statusChange(editor) {
|
|
10932
|
+
if (editor.selection) {
|
|
10933
|
+
const anchorBlock$1 = anchorBlock(editor);
|
|
10934
|
+
if (anchorBlock$1 && this.disableGroup.includes(anchorBlock$1.type)) {
|
|
10935
|
+
this.activeSize = null;
|
|
10936
|
+
this.disabled = true;
|
|
10937
|
+
return;
|
|
10938
|
+
}
|
|
10939
|
+
const marks = getSelectionMarks(editor);
|
|
10940
|
+
const fontSizeMark = marks[MarkTypes.fontSize];
|
|
10941
|
+
this.activeSize = fontSizeMark ? fontSizeMark : this.fontSizes[2];
|
|
10942
|
+
this.disabled = false;
|
|
10943
|
+
}
|
|
10944
|
+
}
|
|
10945
|
+
itemMousedown(event, size) {
|
|
10946
|
+
var _a, _b;
|
|
10947
|
+
super.execute(event);
|
|
10948
|
+
this.closeDropdownPopover();
|
|
10949
|
+
if (((_a = this.editor) === null || _a === void 0 ? void 0 : _a.disabled) || ((_b = this.editor) === null || _b === void 0 ? void 0 : _b.readOnly)) {
|
|
10950
|
+
return;
|
|
10951
|
+
}
|
|
10952
|
+
const anchorBlock$1 = anchorBlock(this.editor);
|
|
10953
|
+
if (anchorBlock$1 && this.disableGroup.includes(anchorBlock$1.type)) {
|
|
10954
|
+
return;
|
|
10955
|
+
}
|
|
10956
|
+
Editor.addMark(this.editor, MarkTypes.fontSize, size);
|
|
10957
|
+
}
|
|
10958
|
+
openDropdownPopover() {
|
|
10959
|
+
var _a;
|
|
10960
|
+
this.dropdownPopoverRef = this.thyPopover.open(this.dropdownTemplate, {
|
|
10961
|
+
origin: this.elementRef,
|
|
10962
|
+
panelClass: ['the-toolbar-dropdown-popover', (_a = this.item) === null || _a === void 0 ? void 0 : _a.key],
|
|
10963
|
+
placement: 'bottomLeft',
|
|
10964
|
+
insideClosable: false,
|
|
10965
|
+
backdropClosable: true,
|
|
10966
|
+
hasBackdrop: false,
|
|
10967
|
+
offset: 10,
|
|
10968
|
+
viewContainerRef: this.viewContainerRef,
|
|
10969
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition()
|
|
10970
|
+
});
|
|
10971
|
+
}
|
|
10972
|
+
closeDropdownPopover() {
|
|
10973
|
+
var _a;
|
|
10974
|
+
if (this.dropdownPopoverRef) {
|
|
10975
|
+
(_a = this.dropdownPopoverRef) === null || _a === void 0 ? void 0 : _a.close();
|
|
10976
|
+
}
|
|
10977
|
+
}
|
|
10978
|
+
}
|
|
10979
|
+
TheFontSizeToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheFontSizeToolbarItemComponent, deps: [{ token: i0.ElementRef }, { token: i1$3.ThyPopover }, { token: i0.ViewContainerRef }, { token: i2.Overlay }], target: i0.ɵɵFactoryTarget.Component });
|
|
10980
|
+
TheFontSizeToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: TheFontSizeToolbarItemComponent, selector: "the-font-size-toolbar-item", inputs: { editor: "editor", item: "item" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.the-toolbar-dropdown-container": "this.toolbarItemContainer", "class.the-font-size-toolbar-item": "this.fontSizeToolbarItem", "class.disabled": "this.disableClass" } }, viewQueries: [{ propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<a thyIconNavLink class=\"text-mode\" [thyTooltip]=\"item?.name\" thyTooltipPlacement=\"top\">\n <span *ngIf=\"activeSize\" class=\"show-text\">{{ activeSize }}px</span>\n <thy-icon class=\"text-caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown\">\n <ng-container *ngFor=\"let size of fontSizes\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyActionMenuItemActive]=\"size === activeSize\"\n (mousedown)=\"itemMousedown($event, size)\"\n >\n <span thyActionMenuItemName>{{ size }}px</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5$2.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i5$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
10981
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheFontSizeToolbarItemComponent, decorators: [{
|
|
10982
|
+
type: Component,
|
|
10983
|
+
args: [{
|
|
10984
|
+
selector: 'the-font-size-toolbar-item',
|
|
10985
|
+
templateUrl: './toolbar-item.component.html'
|
|
10986
|
+
}]
|
|
10987
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$3.ThyPopover }, { type: i0.ViewContainerRef }, { type: i2.Overlay }]; }, propDecorators: { editor: [{
|
|
10988
|
+
type: Input
|
|
10989
|
+
}], item: [{
|
|
10990
|
+
type: Input
|
|
10991
|
+
}], dropdownTemplate: [{
|
|
10992
|
+
type: ViewChild,
|
|
10993
|
+
args: ['dropdownTemplate', { static: true }]
|
|
10994
|
+
}], toolbarItemContainer: [{
|
|
10995
|
+
type: HostBinding,
|
|
10996
|
+
args: ['class.the-toolbar-dropdown-container']
|
|
10997
|
+
}], fontSizeToolbarItem: [{
|
|
10998
|
+
type: HostBinding,
|
|
10999
|
+
args: ['class.the-font-size-toolbar-item']
|
|
11000
|
+
}], disableClass: [{
|
|
11001
|
+
type: HostBinding,
|
|
11002
|
+
args: ['class.disabled']
|
|
11003
|
+
}], toggleDropdown: [{
|
|
11004
|
+
type: HostListener,
|
|
11005
|
+
args: ['mousedown', ['$event']]
|
|
11006
|
+
}], handleDocumentMouseDown: [{
|
|
11007
|
+
type: HostListener,
|
|
11008
|
+
args: ['document: mousedown', ['$event']]
|
|
11009
|
+
}] } });
|
|
11010
|
+
|
|
11011
|
+
const FontSizes = [12, 13, 14, 15, 16, 19, 22, 24, 29, 32, 40, 48];
|
|
11012
|
+
const FontSizeOptions = [
|
|
11013
|
+
{
|
|
11014
|
+
key: MarkTypes.fontSize,
|
|
11015
|
+
name: '字号',
|
|
11016
|
+
iconComponent: TheFontSizeToolbarItemComponent
|
|
11017
|
+
}
|
|
11018
|
+
];
|
|
11019
|
+
|
|
10719
11020
|
const internalPlugins = [
|
|
10720
11021
|
withTheHistory,
|
|
10721
11022
|
withAutoInsertData(),
|
|
@@ -10733,6 +11034,17 @@ const internalPlugins = [
|
|
|
10733
11034
|
withCode,
|
|
10734
11035
|
withHeading,
|
|
10735
11036
|
withMark(),
|
|
11037
|
+
withSoftBreak({
|
|
11038
|
+
rules: [
|
|
11039
|
+
{ hotkey: 'shift+enter' },
|
|
11040
|
+
{
|
|
11041
|
+
hotkey: 'enter',
|
|
11042
|
+
query: {
|
|
11043
|
+
allow: [ElementKinds.blockquote]
|
|
11044
|
+
}
|
|
11045
|
+
}
|
|
11046
|
+
]
|
|
11047
|
+
}),
|
|
10736
11048
|
withBlockquote,
|
|
10737
11049
|
withNodeID({ idKey: ELEMENT_UNIQUE_ID, idCreator }),
|
|
10738
11050
|
withAutoFormat({ rules: autoFormatRules }),
|
|
@@ -10751,6 +11063,7 @@ const internalToolbarItems = [
|
|
|
10751
11063
|
...MarkOptions,
|
|
10752
11064
|
...ColorOptions,
|
|
10753
11065
|
...HeadingOptions,
|
|
11066
|
+
...FontSizeOptions,
|
|
10754
11067
|
...TodoItemOptions,
|
|
10755
11068
|
...ListOptions,
|
|
10756
11069
|
...ImageOptions,
|
|
@@ -11086,7 +11399,7 @@ class TheToolbarComponent {
|
|
|
11086
11399
|
}
|
|
11087
11400
|
}
|
|
11088
11401
|
TheToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarComponent, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: TheToolbarGroupToken }], target: i0.ɵɵFactoryTarget.Component });
|
|
11089
|
-
TheToolbarComponent.ɵcmp = i0.ɵɵ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: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, 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:
|
|
11402
|
+
TheToolbarComponent.ɵcmp = i0.ɵɵ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: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, 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.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
11090
11403
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarComponent, decorators: [{
|
|
11091
11404
|
type: Component,
|
|
11092
11405
|
args: [{
|
|
@@ -11211,7 +11524,7 @@ class TheInlineToolbarComponent {
|
|
|
11211
11524
|
this.destroy$.complete();
|
|
11212
11525
|
}
|
|
11213
11526
|
}
|
|
11214
|
-
TheInlineToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheInlineToolbarComponent, deps: [{ token: i0.ElementRef }, { token: i2
|
|
11527
|
+
TheInlineToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheInlineToolbarComponent, deps: [{ token: i0.ElementRef }, { token: i2.ScrollDispatcher }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: TheContextService }], target: i0.ɵɵFactoryTarget.Component });
|
|
11215
11528
|
TheInlineToolbarComponent.ɵcmp = i0.ɵɵ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, template: `<the-toolbar
|
|
11216
11529
|
#inlineToolbar
|
|
11217
11530
|
class="the-inline-toolbar"
|
|
@@ -11235,7 +11548,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
|
|
|
11235
11548
|
},
|
|
11236
11549
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
11237
11550
|
}]
|
|
11238
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2
|
|
11551
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2.ScrollDispatcher }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: TheContextService }]; }, propDecorators: { editor: [{
|
|
11239
11552
|
type: Input
|
|
11240
11553
|
}], toolbarItems: [{
|
|
11241
11554
|
type: Input
|
|
@@ -11333,12 +11646,13 @@ class ThePlaceholderComponent {
|
|
|
11333
11646
|
}
|
|
11334
11647
|
}
|
|
11335
11648
|
checkStatus() {
|
|
11336
|
-
var _a, _b;
|
|
11649
|
+
var _a, _b, _c;
|
|
11337
11650
|
const { editor } = this;
|
|
11338
11651
|
const isEmptyShow = typeof ((_a = this.options) === null || _a === void 0 ? void 0 : _a.isEmptyShowPlaceholder) === 'undefined' ? true : this.options.isEmptyShowPlaceholder;
|
|
11339
11652
|
const isMustShow = (_b = this.options) === null || _b === void 0 ? void 0 : _b.isMustShowPlaceholder;
|
|
11653
|
+
const isReadonly = (_c = this.options) === null || _c === void 0 ? void 0 : _c.readonly;
|
|
11340
11654
|
// empty content and no selection processing
|
|
11341
|
-
if (isEmptyShow && isEmptyContent(editor.children)) {
|
|
11655
|
+
if (!isReadonly && isEmptyShow && isEmptyContent(editor.children)) {
|
|
11342
11656
|
const firstElementChild = this.contextService.getFirstElementChild();
|
|
11343
11657
|
const offsetTop = firstElementChild.offsetTop;
|
|
11344
11658
|
const offsetLeft = firstElementChild.offsetLeft;
|
|
@@ -11787,7 +12101,7 @@ TheEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", ver
|
|
|
11787
12101
|
useExisting: forwardRef(() => TheEditorComponent),
|
|
11788
12102
|
multi: true
|
|
11789
12103
|
}
|
|
11790
|
-
], 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, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n [ngClass]=\"{\n 'the-editor-disabled': theOptions?.disabled,\n 'max-height': maxHeight\n }\"\n [ngStyle]=\"{ 'max-height': maxHeight }\"\n>\n <slate-editable\n class=\"the-editor-typo\"\n [editor]=\"editor\"\n [ngModel]=\"editorValue\"\n (ngModelChange)=\"valueChange($event)\"\n [decorate]=\"decorate\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar *ngIf=\"!theOptions?.readonly\" [editor]=\"editor\" [toolbarItems]=\"toolbarEntity.inline\"></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [quickToolbarItems]=\"quickToolbarItems\"></div>\n <div #placeholder thePlaceholder [editor]=\"editor\" [options]=\"theOptions\"></div>\n <the-template #templateInstance></the-template>\n</div>\n", components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }, { type: i1.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.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
12104
|
+
], 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, template: "<the-toolbar\n *ngIf=\"!theOptions?.readonly && !theGlobalToolbar\"\n [ngClass]=\"{\n 'the-toolbar-disabled': theOptions?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"theOptions?.toolbar?.align\"\n></the-toolbar>\n\n<div\n class=\"the-editable-container\"\n [ngClass]=\"{\n 'the-editor-disabled': theOptions?.disabled,\n 'max-height': maxHeight\n }\"\n [ngStyle]=\"{ 'max-height': maxHeight }\"\n>\n <slate-editable\n class=\"the-editor-typo\"\n [editor]=\"editor\"\n [ngModel]=\"editorValue\"\n (ngModelChange)=\"valueChange($event)\"\n [decorate]=\"decorate\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [readonly]=\"theOptions?.readonly || theOptions?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [beforeInput]=\"onSlaBeforeInput\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [isStrictDecorate]=\"false\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n <the-inline-toolbar *ngIf=\"!theOptions?.readonly\" [editor]=\"editor\" [toolbarItems]=\"toolbarEntity.inline\"></the-inline-toolbar>\n <div #quickInsert theQuickInsert [editor]=\"editor\" [quickToolbarItems]=\"quickToolbarItems\"></div>\n <div #placeholder thePlaceholder [editor]=\"editor\" [options]=\"theOptions\"></div>\n <the-template #templateInstance></the-template>\n</div>\n", components: [{ type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }, { type: i1.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"] }, { type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: ["editor", "options"] }, { type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
11791
12105
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheEditorComponent, decorators: [{
|
|
11792
12106
|
type: Component,
|
|
11793
12107
|
args: [{
|
|
@@ -11951,7 +12265,7 @@ class TheToolbarGroupComponent {
|
|
|
11951
12265
|
}
|
|
11952
12266
|
}
|
|
11953
12267
|
TheToolbarGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarGroupComponent, deps: [{ token: i0.ElementRef }, { token: i1$3.ThyPopover }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
11954
|
-
TheToolbarGroupComponent.ɵcmp = i0.ɵɵ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: TemplateRef, static: true }], ngImport: i0, 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:
|
|
12268
|
+
TheToolbarGroupComponent.ɵcmp = i0.ɵɵ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: TemplateRef, static: true }], ngImport: i0, 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.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }], directives: [{ type: i5$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }] });
|
|
11955
12269
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheToolbarGroupComponent, decorators: [{
|
|
11956
12270
|
type: Component,
|
|
11957
12271
|
args: [{
|
|
@@ -11991,7 +12305,9 @@ const TETHYS = [
|
|
|
11991
12305
|
ThySelectModule,
|
|
11992
12306
|
ThyButtonModule,
|
|
11993
12307
|
ThyNotifyModule,
|
|
11994
|
-
ThyAlertModule
|
|
12308
|
+
ThyAlertModule,
|
|
12309
|
+
ThyResizableModule,
|
|
12310
|
+
ThySwitchModule
|
|
11995
12311
|
];
|
|
11996
12312
|
const COMPONENTS = [
|
|
11997
12313
|
TheToolbarComponent,
|
|
@@ -12011,7 +12327,8 @@ const COMPONENTS = [
|
|
|
12011
12327
|
TheTableSelectComponent,
|
|
12012
12328
|
TheTableToolbarItemComponent,
|
|
12013
12329
|
TheConversionHintComponent,
|
|
12014
|
-
TheVerticalToolbarItemComponent
|
|
12330
|
+
TheVerticalToolbarItemComponent,
|
|
12331
|
+
TheFontSizeToolbarItemComponent
|
|
12015
12332
|
];
|
|
12016
12333
|
const PLUGIN_COMPONENTS = [
|
|
12017
12334
|
TheImageComponent,
|
|
@@ -12054,7 +12371,8 @@ TheEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
|
|
|
12054
12371
|
TheTableSelectComponent,
|
|
12055
12372
|
TheTableToolbarItemComponent,
|
|
12056
12373
|
TheConversionHintComponent,
|
|
12057
|
-
TheVerticalToolbarItemComponent,
|
|
12374
|
+
TheVerticalToolbarItemComponent,
|
|
12375
|
+
TheFontSizeToolbarItemComponent, TheImageComponent,
|
|
12058
12376
|
TheTemplateComponent,
|
|
12059
12377
|
TheHrComponent,
|
|
12060
12378
|
TheBlockquoteComponent,
|
|
@@ -12085,7 +12403,9 @@ TheEditorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
|
|
|
12085
12403
|
ThySelectModule,
|
|
12086
12404
|
ThyButtonModule,
|
|
12087
12405
|
ThyNotifyModule,
|
|
12088
|
-
ThyAlertModule,
|
|
12406
|
+
ThyAlertModule,
|
|
12407
|
+
ThyResizableModule,
|
|
12408
|
+
ThySwitchModule, CodemirrorModule, TheColumnSizeModule], exports: [TheEditorComponent, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarItemComponent, TheDefaultElementComponent] });
|
|
12089
12409
|
TheEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: TheEditorModule, providers: [
|
|
12090
12410
|
{
|
|
12091
12411
|
provide: TheToolbarGroupToken,
|
|
@@ -12118,5 +12438,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImpor
|
|
|
12118
12438
|
* Generated bundle index. Do not edit.
|
|
12119
12439
|
*/
|
|
12120
12440
|
|
|
12121
|
-
export { ALIGN_BLOCK_TYPES, A_TAG_REL_ATTR, AlignEditor, Alignment, BLOCK_DELETEBACKWARD_TYPES,
|
|
12441
|
+
export { ALIGN_BLOCK_TYPES, A_TAG_REL_ATTR, AlignEditor, Alignment, BLOCK_DELETEBACKWARD_TYPES, BlockquoteEditor, CLIPBOARD_FORMAT_KEY, CODEMIRROR_PADDING_TOP, CODE_MODES, COMPONENTS, CONTAINER_BLOCKS, CONTROL_KEY, CodeEditor, CodeMode, ColorEditor, DEFAULT_LANGUAGE, DEFAULT_SCROLL_CONTAINER, DefaultElementOptions, DefaultGlobalToolbarDefinition, DefaultInlineToolbarDefinition, DefaultQuickToolbarDefinition, DropdownMode, ELEMENT_UNIQUE_ID, ElementKinds, ErrorCodes, HEADING_TYPES, HeadingEditor, HrEditor, IS_MAC, ImageEditor, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LinkEditor, ListEditor, MarkEditor, MarkProps, MarkTypes, PICTURE_ACCEPTED_UPLOAD_MIME, PICTURE_ACCEPTED_UPLOAD_SIZE, PLUGIN_COMPONENTS, QUICK_TOOLBAR_HOTKEY, QuickInsertEditor, STANDARD_HEADING_TYPES, TAB_SPACE, THE_CODE_MODE_PROVIDER, THE_CODE_MODE_TOKEN, THE_EDITOR_CONVERSION_HINT_REF, THE_EDITOR_QUICK_TOOLBAR_REF, THE_EDITOR_UUID, THE_INLINE_TOOLBAR_TYPES, THE_UPLOAD_SERVICE_TOKEN, TableEditor, TheBaseElementComponent, TheCodeConfig, TheContextService, TheDataMode, TheDefaultElementComponent, TheEditor, TheEditorComponent, TheEditorModule, TheImageComponent, TheMode, index$1 as TheQueries, TheToolbarBaseItemComponent, TheToolbarComponent, TheToolbarDropdownComponent, TheToolbarGroupComponent, TheToolbarGroupToken, TheToolbarItemComponent, TheToolbarService, index as TheTransforms, TodoItemEditor, ToolbarActionTypes, ToolbarAlignment, ToolbarItemMode, ToolbarItemType, ToolbarMoreGroup, VOID_BLOCK_TYPES, VerticalAlignEditor, VerticalAlignment, ZERO_WIDTH_CHAR, createEmptyParagraph, dataDeserialize, dataSerializing, getToolbarClass, htmlToTheia, inValidTypes, plainToTheia, toolbarCompose, withTheEditor };
|
|
12122
12442
|
//# sourceMappingURL=worktile-theia.js.map
|