@worktile/theia 2.4.5 → 2.4.8

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.
@@ -69,11 +69,6 @@ const CLIPBOARD_FORMAT_KEY = 'x-theia-fragment';
69
69
  const DEFAULT_SCROLL_CONTAINER = '.the-editable-container';
70
70
  const ELEMENT_UNIQUE_ID = 'key';
71
71
  const ZERO_WIDTH_CHAR = '\u200B';
72
- var TheMode;
73
- (function (TheMode) {
74
- TheMode["fullMode"] = "full";
75
- TheMode["liteMode"] = "lite";
76
- })(TheMode || (TheMode = {}));
77
72
 
78
73
  var ElementKinds;
79
74
  (function (ElementKinds) {
@@ -281,19 +276,6 @@ const CODE_MODES = [
281
276
  value: 'htmlmixed'
282
277
  }
283
278
  ];
284
- const CodeMode = {
285
- default: 'default',
286
- print: 'print'
287
- };
288
- class TheCodeConfig {
289
- }
290
- const THE_CODE_MODE_TOKEN = new InjectionToken('the-code-mode');
291
- const THE_CODE_MODE_PROVIDER = {
292
- provide: THE_CODE_MODE_TOKEN,
293
- useValue: {
294
- mode: CodeMode.default
295
- }
296
- };
297
279
  const CODEMIRROR_PADDING_TOP = 10;
298
280
 
299
281
  const TheToolbarGroupToken = new InjectionToken('the-toolbar-group-token');
@@ -461,6 +443,20 @@ var TheDataMode;
461
443
  TheDataMode["json"] = "json";
462
444
  TheDataMode["html"] = "html";
463
445
  })(TheDataMode || (TheDataMode = {}));
446
+ var TheMode;
447
+ (function (TheMode) {
448
+ TheMode["default"] = "default";
449
+ TheMode["print"] = "print";
450
+ })(TheMode || (TheMode = {}));
451
+ class TheModeConfig {
452
+ }
453
+ const THE_MODE_TOKEN = new InjectionToken('the-mode');
454
+ const THE_MODE_PROVIDER = {
455
+ provide: THE_MODE_TOKEN,
456
+ useValue: {
457
+ mode: TheMode.default
458
+ }
459
+ };
464
460
 
465
461
  var ToolbarItemType;
466
462
  (function (ToolbarItemType) {
@@ -3587,6 +3583,7 @@ class TheTodoItemComponent extends TheBaseElementComponent {
3587
3583
  this.elementRef = elementRef;
3588
3584
  this.cdr = cdr;
3589
3585
  this.ctxService = ctxService;
3586
+ // 类名 the-temp-*: 临时解决因受portal影响样式问题,后期改回the-
3590
3587
  this.checkItemClass = true;
3591
3588
  }
3592
3589
  get level() {
@@ -3609,7 +3606,7 @@ class TheTodoItemComponent extends TheBaseElementComponent {
3609
3606
  }
3610
3607
  }
3611
3608
  TheTodoItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheTodoItemComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: TheContextService }], target: i0.ɵɵFactoryTarget.Component });
3612
- TheTodoItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTodoItemComponent, selector: "div[theTodoItem]", host: { properties: { "class.the-check-item": "this.checkItemClass", "attr.the-level": "this.level" } }, usesInheritance: true, ngImport: i0, template: `
3609
+ TheTodoItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheTodoItemComponent, selector: "div[theTodoItem]", host: { properties: { "class.the-temp-check-item": "this.checkItemClass", "attr.the-level": "this.level" } }, usesInheritance: true, ngImport: i0, template: `
3613
3610
  <span contenteditable="false" class="todo-item-status">
3614
3611
  <input #checkbox type="checkbox" [checked]="element.checked" (click)="onCheck(checkbox.checked)" />
3615
3612
  </span>
@@ -3628,7 +3625,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
3628
3625
  }]
3629
3626
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: TheContextService }]; }, propDecorators: { checkItemClass: [{
3630
3627
  type: HostBinding,
3631
- args: ['class.the-check-item']
3628
+ args: ['class.the-temp-check-item']
3632
3629
  }], level: [{
3633
3630
  type: HostBinding,
3634
3631
  args: ['attr.the-level']
@@ -6765,7 +6762,7 @@ class TheCodeComponent extends TheBaseElementComponent {
6765
6762
  this.config = config;
6766
6763
  this.startRenderCodemirror = false;
6767
6764
  this.dropdownMode = DropdownMode;
6768
- this.maxHeight = this.config.mode === CodeMode.default ? 350 - CODEMIRROR_PADDING_TOP * 2 : 0;
6765
+ this.maxHeight = this.config.mode === TheMode.default ? 350 - CODEMIRROR_PADDING_TOP * 2 : 0;
6769
6766
  this.menus = CODE_MODES.map(item => {
6770
6767
  return { key: item.value, name: item.showName };
6771
6768
  });
@@ -6779,7 +6776,7 @@ class TheCodeComponent extends TheBaseElementComponent {
6779
6776
  readOnly: false,
6780
6777
  autofocus: false,
6781
6778
  lineWiseCopyCut: true,
6782
- lineWrapping: this.config.mode === CodeMode.default ? false : true,
6779
+ lineWrapping: this.config.mode === TheMode.default ? false : true,
6783
6780
  cursorBlinkRate: 500
6784
6781
  };
6785
6782
  this.actives = this.menus[0];
@@ -6955,7 +6952,7 @@ class TheCodeComponent extends TheBaseElementComponent {
6955
6952
  this.destroy$.complete();
6956
6953
  }
6957
6954
  }
6958
- TheCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheCodeComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$4.ThyNotifyService }, { token: TheContextService }, { token: i0.NgZone }, { token: THE_CODE_MODE_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
6955
+ TheCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheCodeComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$4.ThyNotifyService }, { token: TheContextService }, { token: i0.NgZone }, { token: THE_MODE_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
6959
6956
  TheCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", 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-code-block-operation\" *ngIf=\"isCollapsed && codemirror && !options.readOnly\">\n <thy-icon-nav>\n <the-toolbar-dropdown [menus]=\"menus\" [item]=\"actives\" [itemMousedownHandle]=\"onChangeLangulage\"> </the-toolbar-dropdown>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"copy\"\n thyTooltip=\"\u590D\u5236\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onCopy($event)\"\n ></a>\n <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"trash\"\n thyTooltip=\"\u5220\u9664\"\n class=\"remove-link\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onDelete($event)\"\n ></a>\n <nav-split-line [mode]=\"ToolbarItemMode.vertical\"></nav-split-line>\n <span class=\"auto-wrap d-flex align-items-center\">\n <span>\u81EA\u52A8\u6362\u884C</span>\n <thy-switch\n class=\"auto-wrap-btn d-flex\"\n [(ngModel)]=\"options.lineWrapping\"\n (ngModelChange)=\"onChangeWrap($event)\"\n thySize=\"sm\"\n ></thy-switch>\n </span>\n </thy-icon-nav>\n</div>\n\n<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsed, readonly: options.readOnly, active: isHightLight && isCollapsed }\"\n>\n <ng-codemirror\n *ngIf=\"startRenderCodemirror\"\n #codemirror\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options\"\n [ngModel]=\"code\"\n [delayRefreshTime]=\"300\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n [autoMaxHeight]=\"maxHeight\"\n >\n </ng-codemirror>\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\" *ngIf=\"isCollapsed && !options.readOnly\"></thy-resize-handle>\n</div>\n", components: [{ type: i3$1.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["toolbarItem", "menus", "mode", "item", "itemMousedownHandle"] }, { type: i3$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }, { type: i6$1.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i8.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "delayRefreshTime", "options"], outputs: ["focusChange"] }, { type: i9.ThyResizeHandleComponent, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }], directives: [{ type: i10.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i9.ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeEnd", "thyResizeStart"] }, { type: i10.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
6960
6957
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheCodeComponent, decorators: [{
6961
6958
  type: Component,
@@ -6964,9 +6961,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
6964
6961
  templateUrl: './code.component.html',
6965
6962
  changeDetection: ChangeDetectionStrategy.OnPush
6966
6963
  }]
6967
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$4.ThyNotifyService }, { type: TheContextService }, { type: i0.NgZone }, { type: TheCodeConfig, decorators: [{
6964
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$4.ThyNotifyService }, { type: TheContextService }, { type: i0.NgZone }, { type: TheModeConfig, decorators: [{
6968
6965
  type: Inject,
6969
- args: [THE_CODE_MODE_TOKEN]
6966
+ args: [THE_MODE_TOKEN]
6970
6967
  }] }]; }, propDecorators: { codemirror: [{
6971
6968
  type: ViewChild,
6972
6969
  args: ['codemirror', { read: CodeMirrorComponent, static: false }]
@@ -9054,7 +9051,8 @@ class TheTableComponent extends TheBaseElementComponent {
9054
9051
  this.getIsInTable();
9055
9052
  }
9056
9053
  ngAfterViewInit() {
9057
- this.ngZone.onStable.pipe(take(1)).subscribe(() => {
9054
+ this.ngZone.onStable.pipe(take(1)).subscribe(() => __awaiter(this, void 0, void 0, function* () {
9055
+ var _a;
9058
9056
  const blockCardElement = this.nativeElement.closest('slate-block-card');
9059
9057
  if (blockCardElement) {
9060
9058
  blockCardElement.classList.add(`slate-block-card-${this.element.type}`);
@@ -9064,9 +9062,21 @@ class TheTableComponent extends TheBaseElementComponent {
9064
9062
  this.subscribeCellPositionChange();
9065
9063
  this.listenTableContextMenuEvent();
9066
9064
  this.useTableWrapperWidth();
9067
- // need view render complete
9068
- this.useRowControls();
9069
- });
9065
+ if ((_a = this.element.options) === null || _a === void 0 ? void 0 : _a.numberedColumn) {
9066
+ const loadImageDone = yield this.resolveImage();
9067
+ // 等待序号列表格内图片加载完成后再去渲染表格行高度
9068
+ if (loadImageDone) {
9069
+ setTimeout(() => {
9070
+ this.useRowControls();
9071
+ this.cdr.detectChanges();
9072
+ }, 200); // 200ms:通过通知打开页面动画加载时间
9073
+ }
9074
+ }
9075
+ else {
9076
+ this.useRowControls();
9077
+ this.cdr.markForCheck();
9078
+ }
9079
+ }));
9070
9080
  }
9071
9081
  subscribeCellPositionChange() {
9072
9082
  this.tableStore
@@ -9099,7 +9109,6 @@ class TheTableComponent extends TheBaseElementComponent {
9099
9109
  var _a;
9100
9110
  if (this.selection || ((_a = this.element.options) === null || _a === void 0 ? void 0 : _a.numberedColumn)) {
9101
9111
  this.rowControls = this.calculateRowControls();
9102
- this.cdr.markForCheck();
9103
9112
  }
9104
9113
  }
9105
9114
  detectChanges() {
@@ -9201,6 +9210,24 @@ class TheTableComponent extends TheBaseElementComponent {
9201
9210
  });
9202
9211
  return belowRowlHeight;
9203
9212
  }
9213
+ resolveImage() {
9214
+ const imageElements = this.nativeElement.querySelectorAll('img');
9215
+ if (imageElements.length) {
9216
+ const imageResolves = [];
9217
+ imageElements.forEach(item => {
9218
+ const image = new Image();
9219
+ const imageLoad = new Promise(resolve => {
9220
+ image.onload = () => {
9221
+ resolve(true);
9222
+ };
9223
+ image.src = item.getAttribute('src');
9224
+ });
9225
+ imageResolves.push(imageLoad);
9226
+ });
9227
+ return Promise.all(imageResolves);
9228
+ }
9229
+ return Promise.resolve(true);
9230
+ }
9204
9231
  getColControls() {
9205
9232
  var _a, _b;
9206
9233
  this.colControls = ((_b = (_a = this.element) === null || _a === void 0 ? void 0 : _a.children[0]) === null || _b === void 0 ? void 0 : _b.children) || [];
@@ -11782,78 +11809,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
11782
11809
  args: ['class.disabled']
11783
11810
  }] } });
11784
11811
 
11785
- const onKeydownTextIndent = (editor, event, kinds, textIndentDisabled) => {
11786
- const { selection } = editor;
11787
- const isExpanded = Range.isExpanded(selection);
11788
- const nodes = Array.from(Editor.nodes(editor, {
11789
- mode: 'highest',
11790
- match: node => Element$1.isElement(node) && kinds.includes(node.type)
11791
- }));
11792
- const [startBlock] = nodes;
11793
- if (!startBlock) {
11794
- return false;
11795
- }
11796
- const [block, path] = startBlock;
11797
- const isStart = Editor.isStart(editor, selection.anchor, path);
11798
- if (isKeyHotkey('Tab', event)) {
11799
- event.preventDefault();
11800
- if (startBlock && (isExpanded || isStart)) {
11801
- if (!editor.isVoid(block)) {
11802
- let { textIndent, type } = block;
11803
- // do not apply first-line indentation for lists
11804
- if (!textIndent && !textIndentDisabled.includes(type)) {
11805
- IndentEditor.setTextIndent(editor, kinds, 2);
11806
- return true;
11807
- }
11808
- else {
11809
- IndentEditor.setIndent(editor);
11810
- return true;
11811
- }
11812
- }
11813
- }
11814
- else {
11815
- editor.insertText(TAB_SPACE);
11816
- return true;
11817
- }
11818
- }
11819
- if (isKeyHotkey('shift+Tab', event)) {
11820
- if (startBlock && (isExpanded || isStart)) {
11821
- if (!editor.isVoid(block)) {
11822
- return IndentEditor.cancelTextIntent(editor, event, block, kinds);
11823
- }
11824
- }
11825
- }
11826
- if (selection && Range.isCollapsed(selection) && hotkeys.isDeleteBackward(event)) {
11827
- if (startBlock && isStart) {
11828
- return IndentEditor.cancelTextIntent(editor, event, block, kinds);
11829
- }
11830
- }
11831
- return false;
11832
- };
11833
-
11834
- const withIndent = (kinds) => (editor) => {
11835
- const { onKeydown } = editor;
11836
- editor.onKeydown = (event) => {
11837
- var _a, _b, _c, _d;
11838
- let indentTypes = kinds;
11839
- let disableIndentTypes = [ElementKinds.bulletedList, ElementKinds.numberedList, ElementKinds.checkItem];
11840
- if ((_b = (_a = editor.extraIndentOptions) === null || _a === void 0 ? void 0 : _a.indentTypes) === null || _b === void 0 ? void 0 : _b.length) {
11841
- indentTypes = mergIndentTypes(kinds, editor.extraIndentOptions.indentTypes);
11842
- }
11843
- if ((_d = (_c = editor.extraIndentOptions) === null || _c === void 0 ? void 0 : _c.disabledIndentTypes) === null || _d === void 0 ? void 0 : _d.length) {
11844
- disableIndentTypes = mergIndentTypes(disableIndentTypes, editor.extraIndentOptions.disabledIndentTypes);
11845
- }
11846
- const isContinue = !onKeydownTextIndent(editor, event, indentTypes, disableIndentTypes);
11847
- if (isContinue) {
11848
- onKeydown(event);
11849
- }
11850
- };
11851
- return editor;
11852
- };
11853
- const mergIndentTypes = (defaultTypes, indentTypes) => {
11854
- return Array.from(new Set([...defaultTypes, ...indentTypes]));
11855
- };
11856
-
11857
11812
  const MaxIndent = 11;
11858
11813
  const includesIndentTypes = [
11859
11814
  ElementKinds.checkItem,
@@ -11862,15 +11817,11 @@ const includesIndentTypes = [
11862
11817
  ElementKinds.paragraph,
11863
11818
  ...HEADING_TYPES
11864
11819
  ];
11865
- const getIndentTypes = editor => {
11866
- let indentTypes = editor.extraIndentOptions ? editor.extraIndentOptions.indentTypes : [];
11867
- return mergIndentTypes(includesIndentTypes, indentTypes);
11868
- };
11869
11820
  const IndentEditor = {
11870
11821
  setIndent(editor) {
11871
11822
  const nodes = Array.from(Editor.nodes(editor, {
11872
11823
  mode: 'highest',
11873
- match: n => Element$1.isElement(n) && getIndentTypes(editor).includes(n.type)
11824
+ match: n => Element$1.isElement(n) && includesIndentTypes.includes(n.type)
11874
11825
  }));
11875
11826
  const [startBlock] = nodes;
11876
11827
  if (startBlock) {
@@ -11880,7 +11831,7 @@ const IndentEditor = {
11880
11831
  if (indent <= MaxIndent) {
11881
11832
  Transforms.setNodes(editor, { indent }, {
11882
11833
  mode: 'highest',
11883
- match: n => Element$1.isElement(n) && getIndentTypes(editor).includes(n.type)
11834
+ match: n => Element$1.isElement(n) && includesIndentTypes.includes(n.type)
11884
11835
  });
11885
11836
  }
11886
11837
  }
@@ -11888,7 +11839,7 @@ const IndentEditor = {
11888
11839
  cancelIndent(editor) {
11889
11840
  const nodes = Array.from(Editor.nodes(editor, {
11890
11841
  mode: 'highest',
11891
- match: n => Element$1.isElement(n) && getIndentTypes(editor).includes(n.type)
11842
+ match: n => Element$1.isElement(n) && includesIndentTypes.includes(n.type)
11892
11843
  }));
11893
11844
  const [startBlock] = nodes;
11894
11845
  if (startBlock) {
@@ -11896,7 +11847,7 @@ const IndentEditor = {
11896
11847
  indent = indent === 1 ? null : (indent -= 1);
11897
11848
  Transforms.setNodes(editor, { indent }, {
11898
11849
  mode: 'highest',
11899
- match: n => Element$1.isElement(n) && getIndentTypes(editor).includes(n.type)
11850
+ match: n => Element$1.isElement(n) && includesIndentTypes.includes(n.type)
11900
11851
  });
11901
11852
  }
11902
11853
  },
@@ -11929,7 +11880,7 @@ const IndentEditor = {
11929
11880
  isDisabled(editor) {
11930
11881
  if (editor.selection) {
11931
11882
  const anchorBlock$1 = anchorBlock(editor);
11932
- return anchorBlock$1 && !getIndentTypes(editor).includes(anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type);
11883
+ return anchorBlock$1 && !includesIndentTypes.includes(anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type);
11933
11884
  }
11934
11885
  return false;
11935
11886
  }
@@ -11959,6 +11910,71 @@ const IndentOptions = [
11959
11910
  }
11960
11911
  ];
11961
11912
 
11913
+ const onKeydownTextIndent = (editor, event, kinds, textIndentDisabled) => {
11914
+ const { selection } = editor;
11915
+ const isExpanded = Range.isExpanded(selection);
11916
+ const nodes = Array.from(Editor.nodes(editor, {
11917
+ mode: 'highest',
11918
+ match: node => Element$1.isElement(node) && kinds.includes(node.type)
11919
+ }));
11920
+ const [startBlock] = nodes;
11921
+ if (!startBlock) {
11922
+ return false;
11923
+ }
11924
+ const [block, path] = startBlock;
11925
+ const isStart = Editor.isStart(editor, selection.anchor, path);
11926
+ if (isKeyHotkey('Tab', event)) {
11927
+ event.preventDefault();
11928
+ if (startBlock && (isExpanded || isStart)) {
11929
+ if (!editor.isVoid(block)) {
11930
+ let { textIndent, type } = block;
11931
+ // do not apply first-line indentation for lists
11932
+ if (!textIndent && !textIndentDisabled.includes(type)) {
11933
+ IndentEditor.setTextIndent(editor, kinds, 2);
11934
+ return true;
11935
+ }
11936
+ else {
11937
+ IndentEditor.setIndent(editor);
11938
+ return true;
11939
+ }
11940
+ }
11941
+ }
11942
+ else {
11943
+ editor.insertText(TAB_SPACE);
11944
+ return true;
11945
+ }
11946
+ }
11947
+ if (isKeyHotkey('shift+Tab', event)) {
11948
+ if (startBlock && (isExpanded || isStart)) {
11949
+ if (!editor.isVoid(block)) {
11950
+ return IndentEditor.cancelTextIntent(editor, event, block, kinds);
11951
+ }
11952
+ }
11953
+ }
11954
+ if (selection && Range.isCollapsed(selection) && hotkeys.isDeleteBackward(event)) {
11955
+ if (startBlock && isStart) {
11956
+ return IndentEditor.cancelTextIntent(editor, event, block, kinds);
11957
+ }
11958
+ }
11959
+ return false;
11960
+ };
11961
+
11962
+ const withIndent = (kinds) => (editor) => {
11963
+ const { onKeydown } = editor;
11964
+ editor.onKeydown = (event) => {
11965
+ let indentTypes = kinds;
11966
+ let disableIndentTypes = [ElementKinds.bulletedList, ElementKinds.numberedList, ElementKinds.checkItem];
11967
+ const isContinue = !onKeydownTextIndent(editor, event, indentTypes, disableIndentTypes);
11968
+ if (isContinue) {
11969
+ onKeydown(event);
11970
+ }
11971
+ };
11972
+ return editor;
11973
+ };
11974
+ const mergIndentTypes = (defaultTypes, indentTypes) => {
11975
+ return Array.from(new Set([...defaultTypes, ...indentTypes]));
11976
+ };
11977
+
11962
11978
  const internalPlugins = [
11963
11979
  withTheHistory,
11964
11980
  withAutoInsertData(),
@@ -12858,13 +12874,12 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
12858
12874
  super.ngOnDestroy();
12859
12875
  }
12860
12876
  initialize() {
12861
- var _a, _b, _c, _d;
12877
+ var _a, _b, _c;
12862
12878
  this.editor = withTheEditor(this.thePlugins, withHistory(withAngular(createEditor(), CLIPBOARD_FORMAT_KEY)));
12863
12879
  this.generateDecorate();
12864
12880
  this.editor.disabled = (_a = this.theOptions) === null || _a === void 0 ? void 0 : _a.disabled;
12865
12881
  this.editor.extraElementOptions = (_b = this.theOptions) === null || _b === void 0 ? void 0 : _b.extraElementOptions;
12866
12882
  this.editor.extraAutoFormatRules = (_c = this.theOptions) === null || _c === void 0 ? void 0 : _c.extraAutoFormatRules;
12867
- this.editor.extraIndentOptions = (_d = this.theOptions) === null || _d === void 0 ? void 0 : _d.extraIndentOptions;
12868
12883
  this.editor.options = this.theOptions;
12869
12884
  setEditorUUID(this.editor, idCreator());
12870
12885
  this.theContextService.initialize({
@@ -13383,7 +13398,7 @@ TheEditorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version
13383
13398
  provide: TheToolbarGroupToken,
13384
13399
  useValue: TheToolbarGroupComponent
13385
13400
  },
13386
- THE_CODE_MODE_PROVIDER
13401
+ THE_MODE_PROVIDER
13387
13402
  ], imports: [[CommonModule, SlateModule, FormsModule, ...TETHYS, CodemirrorModule, TheColumnSizeModule]] });
13388
13403
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheEditorModule, decorators: [{
13389
13404
  type: NgModule,
@@ -13397,7 +13412,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
13397
13412
  provide: TheToolbarGroupToken,
13398
13413
  useValue: TheToolbarGroupComponent
13399
13414
  },
13400
- THE_CODE_MODE_PROVIDER
13415
+ THE_MODE_PROVIDER
13401
13416
  ]
13402
13417
  }]
13403
13418
  }] });
@@ -13410,5 +13425,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
13410
13425
  * Generated bundle index. Do not edit.
13411
13426
  */
13412
13427
 
13413
- 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, FontSizeTypes, FontSizes, HEADING_TYPES, HeadingEditor, HrEditor, IS_MAC, ImageEditor, Indents, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LayoutTypes, 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, coercePixelsFromCssValue, createEmptyParagraph, dataDeserialize, dataSerializing, getColsTotalWidth, getElementClassByPrefix, getElementHeight, getElementWidth, getRowsTotalHeight, getToolbarClass, htmlToTheia, inValidTypes, isCleanEmptyParagraph, isPureEmptyParagraph, mergeElementOptions, plainToTheia, toolbarCompose, useElementStyle, withTheEditor };
13428
+ 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, ColorEditor, DEFAULT_LANGUAGE, DEFAULT_SCROLL_CONTAINER, DefaultElementOptions, DefaultGlobalToolbarDefinition, DefaultInlineToolbarDefinition, DefaultQuickToolbarDefinition, DropdownMode, ELEMENT_UNIQUE_ID, ElementKinds, ErrorCodes, FontSizeTypes, FontSizes, HEADING_TYPES, HeadingEditor, HrEditor, IS_MAC, ImageEditor, IndentEditor, Indents, LINK_DEFAULT_TEXT, LIST_BLOCK_TYPES, LayoutTypes, 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_EDITOR_CONVERSION_HINT_REF, THE_EDITOR_QUICK_TOOLBAR_REF, THE_EDITOR_UUID, THE_INLINE_TOOLBAR_TYPES, THE_MODE_PROVIDER, THE_MODE_TOKEN, THE_UPLOAD_SERVICE_TOKEN, TableEditor, TheBaseElementComponent, TheContextService, TheDataMode, TheDefaultElementComponent, TheEditor, TheEditorComponent, TheEditorModule, TheImageComponent, TheIndentToolbarComponent, TheMode, TheModeConfig, 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, coercePixelsFromCssValue, createEmptyParagraph, dataDeserialize, dataSerializing, getColsTotalWidth, getElementClassByPrefix, getElementHeight, getElementWidth, getRowsTotalHeight, getToolbarClass, htmlToTheia, inValidTypes, includesIndentTypes, isCleanEmptyParagraph, isPureEmptyParagraph, mergeElementOptions, plainToTheia, toolbarCompose, useElementStyle, withTheEditor };
13414
13429
  //# sourceMappingURL=worktile-theia.js.map