@worktile/theia 3.0.5 → 3.0.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.
Files changed (36) hide show
  1. package/bundles/worktile-theia.umd.js +64 -27
  2. package/bundles/worktile-theia.umd.js.map +1 -1
  3. package/editor.component.d.ts +2 -1
  4. package/esm2015/components/toolbar-dropdown/toolbar-dropdown.component.js +3 -2
  5. package/esm2015/components/toolbar-group/toolbar-group.component.js +2 -1
  6. package/esm2015/core/toolbar-item/base-toolbar-item.js +4 -4
  7. package/esm2015/editor.component.js +15 -2
  8. package/esm2015/interfaces/toolbar.js +1 -1
  9. package/esm2015/plugins/code/code.component.js +6 -3
  10. package/esm2015/plugins/color/toolbar-item.component.js +2 -1
  11. package/esm2015/plugins/deserializers/deserialize-md.plugin.js +2 -1
  12. package/esm2015/plugins/image/image.component.js +13 -8
  13. package/esm2015/plugins/image/image.editor.js +3 -5
  14. package/esm2015/plugins/link/link.component.js +3 -1
  15. package/esm2015/plugins/quick-insert/quick-insert.editor.js +2 -1
  16. package/esm2015/plugins/table/components/toolbar/table-toolbar.component.js +2 -1
  17. package/esm2015/plugins/table/table.service.js +2 -1
  18. package/esm2015/plugins/table/toolbar-item.component.js +2 -1
  19. package/esm2015/plugins/vertical-align/toolbar-item.component.js +2 -1
  20. package/esm2015/queries/get-plugin-by-toolbar.js +13 -0
  21. package/esm2015/queries/get-toolbar-disabled.js +1 -1
  22. package/esm2015/queries/index.js +3 -3
  23. package/esm2015/services/color-select.service.js +2 -1
  24. package/esm2015/services/context.service.js +7 -6
  25. package/esm2015/services/table-contextmenu.service.js +2 -1
  26. package/fesm2015/worktile-theia.js +64 -28
  27. package/fesm2015/worktile-theia.js.map +1 -1
  28. package/interfaces/toolbar.d.ts +2 -0
  29. package/package.json +1 -1
  30. package/plugins/image/image.component.d.ts +4 -1
  31. package/queries/get-plugin-by-toolbar.d.ts +3 -0
  32. package/queries/get-toolbar-disabled.d.ts +2 -2
  33. package/queries/index.d.ts +2 -2
  34. package/services/context.service.d.ts +8 -4
  35. package/esm2015/queries/get-plugin-key-by-toolbar-key.js +0 -10
  36. package/queries/get-plugin-key-by-toolbar-key.d.ts +0 -3
@@ -901,11 +901,12 @@
901
901
  function TheContextService(ngZone) {
902
902
  var _this = this;
903
903
  this.ngZone = ngZone;
904
- this.fileList = [];
904
+ this.uploadingFiles = [];
905
905
  this.paintFormatStatus = {
906
906
  isActive: false,
907
907
  marks: {}
908
908
  };
909
+ this.uploadingStatus$ = new rxjs.Subject();
909
910
  this.ngZone.runOutsideAngular(function () {
910
911
  _this.onMouseUp$ = rxjs.fromEvent(window, "mouseup");
911
912
  _this.onMouseMove$ = rxjs.fromEvent(window, "mousemove");
@@ -940,11 +941,11 @@
940
941
  var firstElementChild = this.getFirstElementChild();
941
942
  return 0.48 * firstElementChild.clientWidth;
942
943
  };
943
- TheContextService.prototype.setUploadFileList = function (file) {
944
- this.fileList.push(file);
944
+ TheContextService.prototype.addUploadingFiles = function (file) {
945
+ this.uploadingFiles.push(file);
945
946
  };
946
947
  TheContextService.prototype.removeUploadImage = function (file) {
947
- this.fileList.splice(this.fileList.findIndex(function (item) { return item.file === file; }), 1);
948
+ this.uploadingFiles.splice(this.uploadingFiles.findIndex(function (item) { return item.url === file.url; }), 1);
948
949
  };
949
950
  return TheContextService;
950
951
  }());
@@ -1092,6 +1093,7 @@
1092
1093
  option: option
1093
1094
  },
1094
1095
  origin: origin,
1096
+ minWidth: 0,
1095
1097
  backdropClosable: this.backdropClosable,
1096
1098
  placement: placement || this.placement,
1097
1099
  offset: offset !== null ? offset : this.offset,
@@ -2461,14 +2463,17 @@
2461
2463
  }
2462
2464
  };
2463
2465
 
2464
- var getPluginKeyByToolbarKey = function (editor, toolbarKey) {
2466
+ var getPluginByToolbarItem = function (editor, toolbarItem) {
2467
+ var pluginKey = toolbarItem.pluginKey;
2468
+ if (pluginKey) {
2469
+ return editor.pluginsByKey[pluginKey];
2470
+ }
2465
2471
  for (var key in editor.pluginsByKey) {
2466
2472
  var toolbarItems = editor.pluginsByKey[key].toolbarItems;
2467
- if (toolbarItems && toolbarItems.some(function (item) { return item.key === toolbarKey; })) {
2468
- toolbarKey = key;
2473
+ if (toolbarItems && toolbarItems.some(function (item) { return item.key === toolbarItem.key; })) {
2474
+ return editor.pluginsByKey[key];
2469
2475
  }
2470
2476
  }
2471
- return toolbarKey;
2472
2477
  };
2473
2478
 
2474
2479
  var index$1 = /*#__PURE__*/Object.freeze({
@@ -2529,7 +2534,7 @@
2529
2534
  findDescendant: findDescendant,
2530
2535
  someNode: someNode,
2531
2536
  getToolbarItemDisabled: getToolbarItemDisabled,
2532
- getPluginKeyByToolbarKey: getPluginKeyByToolbarKey
2537
+ getPluginByToolbarItem: getPluginByToolbarItem
2533
2538
  });
2534
2539
 
2535
2540
  var insertElements = function (editor, elements) {
@@ -2881,6 +2886,7 @@
2881
2886
  viewContainerRef: viewContainerRef,
2882
2887
  placement: placement,
2883
2888
  offset: -100,
2889
+ minWidth: 0,
2884
2890
  hasBackdrop: false,
2885
2891
  backdropClosable: false,
2886
2892
  closeOnNavigation: false,
@@ -3094,6 +3100,7 @@
3094
3100
  var inputFile = document.createElement('input');
3095
3101
  inputFile.setAttribute('type', 'file');
3096
3102
  inputFile.setAttribute('accept', 'image/*');
3103
+ inputFile.setAttribute('multiple', 'true');
3097
3104
  inputFile.onchange = function (event) {
3098
3105
  ImageEditor.insertImages(editor, event.target.files);
3099
3106
  };
@@ -3110,10 +3117,7 @@
3110
3117
  var verify = ImageEditor.verifyImage(editor, image);
3111
3118
  if (verify) {
3112
3119
  var url = URL.createObjectURL(image);
3113
- contextService.setUploadFileList({
3114
- url: url,
3115
- file: image
3116
- });
3120
+ contextService.addUploadingFiles({ url: url, file: image });
3117
3121
  imageNodes.push({ type: exports.ElementKinds.image, url: url, children: [text] });
3118
3122
  }
3119
3123
  }
@@ -3285,9 +3289,9 @@
3285
3289
  var _this = this;
3286
3290
  var _a;
3287
3291
  this.layoutDefaultWidth = this.theContextService.layoutDefaultWidth();
3288
- this.file = (_a = this.theContextService.fileList.find(function (item) { return item.url === _this.element.url; })) === null || _a === void 0 ? void 0 : _a.file;
3289
- if (this.file && this.file instanceof File) {
3290
- this.uploadImage(this.file);
3292
+ this.fileItem = this.theContextService.uploadingFiles.find(function (item) { return item.url === _this.element.url; });
3293
+ if (((_a = this.fileItem) === null || _a === void 0 ? void 0 : _a.file) && this.fileItem.file instanceof File) {
3294
+ this.uploadImage(this.fileItem.file);
3291
3295
  }
3292
3296
  _super.prototype.ngOnInit.call(this);
3293
3297
  };
@@ -3312,16 +3316,19 @@
3312
3316
  this.mouseUpSubscription = this.theContextService.onMouseUp$.subscribe(function (e) { return _this.endDrag(e); });
3313
3317
  this.uploadingSubscription = this.imageUploaderService
3314
3318
  .getUploadingItems$()
3315
- .pipe(operators.map(function (fileUploadingItem) { return _this.file && fileUploadingItem.find(function (item) { return item.file === _this.file; }); }))
3319
+ .pipe(operators.map(function (fileUploadingItem) { var _a; return ((_a = _this.fileItem) === null || _a === void 0 ? void 0 : _a.file) && fileUploadingItem.find(function (item) { var _a; return item.file === ((_a = _this.fileItem) === null || _a === void 0 ? void 0 : _a.file); }); }))
3316
3320
  .subscribe(function (uploadingItem) {
3317
3321
  if (!uploadingItem || !uploadingItem.result) {
3318
3322
  return;
3319
3323
  }
3320
3324
  _this.percentage = uploadingItem.result.uploadFile.progress.percentage;
3321
- var _b = uploadingItem.result, status = _b.status, uploadFile = _b.uploadFile;
3322
- if (status === uploader.ThyUploadStatus.done && uploadFile.response && uploadFile.responseStatus === 200) {
3323
- _this.uploading = false;
3325
+ var status = uploadingItem.result.status;
3326
+ // 成功和失败都要上传结束
3327
+ if (status === uploader.ThyUploadStatus.done) {
3324
3328
  _this.uploadingSubscription.unsubscribe();
3329
+ _this.uploading = false;
3330
+ _this.theContextService.removeUploadImage(_this.fileItem);
3331
+ _this.theContextService.uploadingStatus$.next(false);
3325
3332
  }
3326
3333
  _this.cdr.detectChanges();
3327
3334
  });
@@ -3342,6 +3349,7 @@
3342
3349
  thumbUrl: this.sanitizer.bypassSecurityTrustResourceUrl(URL.createObjectURL(file))
3343
3350
  };
3344
3351
  this.uploading = true;
3352
+ this.theContextService.uploadingStatus$.next(true);
3345
3353
  return [4 /*yield*/, this.imageUploaderService.uploadFileHandle([file]).toPromise()];
3346
3354
  case 2:
3347
3355
  _c = __read.apply(void 0, [_d.sent(), 1]), uploadFileEntity = _c[0];
@@ -3479,6 +3487,7 @@
3479
3487
  backdropClosable: true,
3480
3488
  hasBackdrop: false,
3481
3489
  offset: 10,
3490
+ minWidth: 0,
3482
3491
  viewContainerRef: this.viewContainerRef,
3483
3492
  scrollStrategy: this.overlay.scrollStrategies.reposition()
3484
3493
  });
@@ -7465,15 +7474,15 @@
7465
7474
  }
7466
7475
  };
7467
7476
  TheBaseToolbarItem.prototype.selectionChange = function (editor) {
7468
- var _a, _b, _c, _d, _e, _f;
7477
+ var _a, _b, _c, _d, _e;
7469
7478
  if (editor.selection) {
7470
7479
  this.active = ((_a = this._toolbarItem) === null || _a === void 0 ? void 0 : _a.active) ? (_b = this._toolbarItem) === null || _b === void 0 ? void 0 : _b.active(editor) : false;
7471
7480
  if ((_c = this._toolbarItem) === null || _c === void 0 ? void 0 : _c.disable) {
7472
7481
  this.disabled = ((_d = this._toolbarItem) === null || _d === void 0 ? void 0 : _d.disable) ? (_e = this._toolbarItem) === null || _e === void 0 ? void 0 : _e.disable(editor) : false;
7473
7482
  }
7474
7483
  else {
7475
- var pluginKey = getPluginKeyByToolbarKey(editor, (_f = this._toolbarItem) === null || _f === void 0 ? void 0 : _f.key);
7476
- this.disabled = pluginKey && getToolbarItemDisabled(editor, pluginKey);
7484
+ var thePlugin = getPluginByToolbarItem(editor, this._toolbarItem);
7485
+ this.disabled = thePlugin && getToolbarItemDisabled(editor, thePlugin.key);
7477
7486
  }
7478
7487
  }
7479
7488
  };
@@ -7602,6 +7611,7 @@
7602
7611
  backdropClosable: true,
7603
7612
  hasBackdrop: false,
7604
7613
  offset: 10,
7614
+ minWidth: 0,
7605
7615
  viewContainerRef: this.viewContainerRef,
7606
7616
  scrollStrategy: this.overlay.scrollStrategies.reposition()
7607
7617
  });
@@ -7634,7 +7644,7 @@
7634
7644
  return TheToolbarDropdownComponent;
7635
7645
  }(TheBaseToolbarDropdown));
7636
7646
  TheToolbarDropdownComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheToolbarDropdownComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$1.ThyPopover }, { token: i0__namespace.ViewContainerRef }, { token: i2__namespace.Overlay }], target: i0__namespace.ɵɵFactoryTarget.Component });
7637
- TheToolbarDropdownComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { 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__namespace, template: "<ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n\n<ng-template #iconModeTemplate>\n <a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenuItem?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenuItem?.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]=\"activeMenuItem?.name\" thyTooltipPlacement=\"top\">\n <span class=\"show-text\">{{ activeMenuItem?.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 === activeMenuItem.key && !toolbarItem.dropdownFixedIcon\"\n (mousedown)=\"itemMousedown($event, menu)\"\n [ngStyle]=\"menu?.styles\"\n >\n <span *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu.icon\"></thy-icon>\n </span>\n <span *ngIf=\"menu.name\" thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n <thy-action-menu-divider *ngIf=\"menu.key === 'split'\"></thy-action-menu-divider>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3__namespace$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3__namespace.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i2__namespace$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i2__namespace$1.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i10__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i2__namespace$1.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2__namespace$1.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i2__namespace$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
7647
+ TheToolbarDropdownComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: { 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__namespace, template: "<ng-template [ngTemplateOutlet]=\"template\"></ng-template>\n\n<ng-template #iconModeTemplate>\n <a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenuItem?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenuItem?.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]=\"activeMenuItem?.name\" thyTooltipPlacement=\"top\">\n <span class=\"show-text\">{{ activeMenuItem?.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 === activeMenuItem?.key && !toolbarItem?.dropdownFixedIcon\"\n (mousedown)=\"itemMousedown($event, menu)\"\n [ngStyle]=\"menu?.styles\"\n >\n <span *ngIf=\"menu.icon && mode === dropdownMode.icon\" thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu.icon\"></thy-icon>\n </span>\n <span *ngIf=\"menu.name\" thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n <thy-action-menu-divider *ngIf=\"menu.key === 'split'\"></thy-action-menu-divider>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n", components: [{ type: i3__namespace$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i3__namespace.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i2__namespace$1.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }, { type: i2__namespace$1.ThyActionMenuDividerComponent, selector: "thy-action-menu-divider", inputs: ["thyTitle", "thyType"] }], directives: [{ type: i10__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i10__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace$1.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i2__namespace$1.ThyActionMenuItemActiveDirective, selector: "[thyActionMenuItemActive]", inputs: ["thyActionMenuItemActive"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2__namespace$1.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i2__namespace$1.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
7638
7648
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheToolbarDropdownComponent, decorators: [{
7639
7649
  type: i0.Component,
7640
7650
  args: [{
@@ -7842,7 +7852,10 @@
7842
7852
  TheCodeComponent.prototype.useMode = function () {
7843
7853
  var _this = this;
7844
7854
  this.options = Object.assign(Object.assign({}, this.options), { mode: this.element.language });
7845
- this.activeLanguage = this.menus.find(function (i) { return i.key === _this.element.language; });
7855
+ var menuItem = this.menus.find(function (i) { return i.key === _this.element.language; });
7856
+ if (menuItem) {
7857
+ this.activeLanguage = menuItem;
7858
+ }
7846
7859
  };
7847
7860
  TheCodeComponent.prototype.useAutoWrap = function () {
7848
7861
  this.options = Object.assign(Object.assign({}, this.options), { lineWrapping: this.element.autoWrap || false });
@@ -7877,7 +7890,7 @@
7877
7890
  return TheCodeComponent;
7878
7891
  }(TheBaseElementComponent));
7879
7892
  TheCodeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheCodeComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.ChangeDetectorRef }, { token: i1__namespace$4.ThyNotifyService }, { token: TheContextService }, { token: i0__namespace.NgZone }, { token: THE_MODE_TOKEN }], target: i0__namespace.ɵɵFactoryTarget.Component });
7880
- TheCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: i8.CodeMirrorComponent }], usesInheritance: true, ngImport: i0__namespace, template: "<div contenteditable=\"false\" class=\"the-code-block-operation\" *ngIf=\"isCollapsed && codemirror && !options.readOnly\">\n <thy-icon-nav>\n <the-toolbar-dropdown\n [menus]=\"menus\"\n [toolbarItem]=\"activeLanguage\"\n [dropdownItemKey]=\"activeLanguage.key\"\n [itemMousedownHandle]=\"onChangeLanguage\"\n >\n </the-toolbar-dropdown>\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 <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"copy\"\n thyTooltip=\"\u590D\u5236\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onCopy($event)\"\n ></a>\n <nav-split-line [mode]=\"ToolbarItemMode.vertical\"></nav-split-line>\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 </thy-icon-nav>\n</div>\n\n<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsed, readonly: options.readOnly, active: isHightLight && isCollapsed }\"\n>\n <ng-codemirror\n *ngIf=\"startRenderCodemirror\"\n #codemirror\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options\"\n [ngModel]=\"code\"\n [delayRefreshTime]=\"300\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n [autoMaxHeight]=\"maxHeight\"\n >\n </ng-codemirror>\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\" *ngIf=\"isCollapsed && !options.readOnly\"></thy-resize-handle>\n</div>\n", components: [{ type: i3__namespace$1.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["itemMousedownHandle"] }, { type: i5__namespace$2.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { type: i3__namespace$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }, { type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i8__namespace.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "delayRefreshTime", "options"], outputs: ["focusChange"] }, { type: i9__namespace.ThyResizeHandleComponent, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }], directives: [{ type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i9__namespace.ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeEnd", "thyResizeStart"] }, { type: i10__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
7893
+ TheCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheCodeComponent, selector: "div[theCode]", viewQueries: [{ propertyName: "codemirror", first: true, predicate: ["codemirror"], descendants: true, read: i8.CodeMirrorComponent }], usesInheritance: true, ngImport: i0__namespace, template: "<div contenteditable=\"false\" class=\"the-code-block-operation\" *ngIf=\"isCollapsed && codemirror && !options.readOnly\">\n <thy-icon-nav>\n <the-toolbar-dropdown\n [menus]=\"menus\"\n [toolbarItem]=\"activeLanguage\"\n [dropdownItemKey]=\"activeLanguage?.key\"\n [itemMousedownHandle]=\"onChangeLanguage\"\n >\n </the-toolbar-dropdown>\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 <a\n href=\"javascript:;\"\n thyIconNavLink\n thyIconNavLinkIcon=\"copy\"\n thyTooltip=\"\u590D\u5236\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"onCopy($event)\"\n ></a>\n <nav-split-line [mode]=\"ToolbarItemMode.vertical\"></nav-split-line>\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 </thy-icon-nav>\n</div>\n\n<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<!-- \u53EA\u8BFB\u6A21\u5F0F\u4E0BCodeMirror-sizer\u9AD8\u5EA6\u6BD4\u7F16\u8F91\u6A21\u5F0F\u4E0B\u591A2px\uFF0C\u8BBE\u7F6EthyMinHeight\u4E3A46px\u9632\u6B62\u62D6\u62FD\u5230\u6700\u5C0F\u9AD8\u5EA6\u65F6\u53EA\u8BFB\u6A21\u5F0F\u4E0B\u51FA\u73B0\u6EDA\u52A8\u6761 -->\n<div\n thyResizable\n [thyMinHeight]=\"46\"\n [thyBounds]=\"resizeBounds\"\n [style.height.px]=\"resizeHeight\"\n (thyResize)=\"onResize($event)\"\n (thyResizeEnd)=\"onEndResize()\"\n class=\"resize-code-container\"\n [ngClass]=\"{ focus: isCollapsed, readonly: options.readOnly, active: isHightLight && isCollapsed }\"\n>\n <ng-codemirror\n *ngIf=\"startRenderCodemirror\"\n #codemirror\n contenteditable=\"false\"\n class=\"ng-codemirror-wrapper\"\n [ngStyle]=\"{ maxHeight: maxHeight > 0 ? maxHeight + 'px' : 'auto' }\"\n [options]=\"options\"\n [ngModel]=\"code\"\n [delayRefreshTime]=\"300\"\n (ngModelChange)=\"codeChange($event)\"\n (focusChange)=\"focusChange($event)\"\n [autoMaxHeight]=\"maxHeight\"\n >\n </ng-codemirror>\n <thy-resize-handle thyDirection=\"bottom\" class=\"code-resize-icon\" *ngIf=\"isCollapsed && !options.readOnly\"></thy-resize-handle>\n</div>\n", components: [{ type: i3__namespace$1.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }, { type: TheToolbarDropdownComponent, selector: "the-toolbar-dropdown", inputs: ["itemMousedownHandle"] }, { type: i5__namespace$2.ThySwitchComponent, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled"], outputs: ["thyChange"] }, { type: i3__namespace$1.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }, { type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { type: i8__namespace.CodeMirrorComponent, selector: "ng-codemirror, [ngCodeMirror]", inputs: ["autoMaxHeight", "delayRefreshTime", "options"], outputs: ["focusChange"] }, { type: i9__namespace.ThyResizeHandleComponent, selector: "thy-resize-handle, [thy-resize-handle]", inputs: ["thyDirection"], outputs: ["thyMouseDown"], exportAs: ["thyResizeHandle"] }], directives: [{ type: i10__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i9__namespace.ThyResizableDirective, selector: "[thyResizable]", inputs: ["thyBounds", "thyMaxHeight", "thyMaxWidth", "thyMinHeight", "thyMinWidth", "thyGridColumnCount", "thyMaxColumn", "thyMinColumn", "thyLockAspectRatio", "thyPreview", "thyDisabled"], outputs: ["thyResize", "thyResizeEnd", "thyResizeStart"] }, { type: i10__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i10__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
7881
7894
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheCodeComponent, decorators: [{
7882
7895
  type: i0.Component,
7883
7896
  args: [{
@@ -8242,6 +8255,7 @@
8242
8255
  origin: dom,
8243
8256
  placement: 'bottomLeft',
8244
8257
  offset: 8,
8258
+ minWidth: 0,
8245
8259
  hasBackdrop: false,
8246
8260
  outsideClosable: true,
8247
8261
  viewContainerRef: this.viewContainerRef,
@@ -8261,6 +8275,7 @@
8261
8275
  link: link,
8262
8276
  originSelection: this.editor.selection
8263
8277
  },
8278
+ minWidth: 0,
8264
8279
  origin: this.elementRef.nativeElement,
8265
8280
  backdropClosable: true,
8266
8281
  placement: 'bottomLeft',
@@ -9390,6 +9405,7 @@
9390
9405
  tableStore: this.tableStore,
9391
9406
  editor: this.editor
9392
9407
  },
9408
+ minWidth: 0,
9393
9409
  insideClosable: false,
9394
9410
  hasBackdrop: false,
9395
9411
  placement: 'bottomLeft',
@@ -9658,6 +9674,7 @@
9658
9674
  y: event.y
9659
9675
  },
9660
9676
  hasBackdrop: false,
9677
+ minWidth: 0,
9661
9678
  placement: 'bottomLeft',
9662
9679
  viewContainerRef: _this.theContextService.getOptions().viewContainerRef,
9663
9680
  manualClosure: true,
@@ -9724,6 +9741,7 @@
9724
9741
  offset: this.offset,
9725
9742
  hasBackdrop: this.hasBackdrop,
9726
9743
  insideClosable: this.insideClosable,
9744
+ minWidth: 0,
9727
9745
  panelClass: 'the-temp-table-toolbar-wrap',
9728
9746
  scrollStrategy: this.overlay.scrollStrategies.reposition(),
9729
9747
  manualClosure: true
@@ -11758,6 +11776,7 @@
11758
11776
  editor: this.editor,
11759
11777
  optionsParam: optionsParam
11760
11778
  },
11779
+ minWidth: 0,
11761
11780
  backdropClosable: false,
11762
11781
  hasBackdrop: false,
11763
11782
  insideClosable: false,
@@ -12410,6 +12429,7 @@
12410
12429
  offset: 4,
12411
12430
  hasBackdrop: false,
12412
12431
  insideClosable: true,
12432
+ minWidth: 0,
12413
12433
  panelClass: 'the-quick-toolbar-container',
12414
12434
  scrollStrategy: overlay.scrollStrategies.reposition(),
12415
12435
  manualClosure: true
@@ -12927,6 +12947,7 @@
12927
12947
  panelClass: ['the-toolbar-dropdown-popover', (_a = this.toolbarItem) === null || _a === void 0 ? void 0 : _a.key],
12928
12948
  placement: 'bottomLeft',
12929
12949
  offset: 10,
12950
+ minWidth: 0,
12930
12951
  viewContainerRef: this.viewContainerRef,
12931
12952
  insideClosable: false,
12932
12953
  backdropClosable: false,
@@ -13231,6 +13252,7 @@
13231
13252
  backdropClosable: false,
13232
13253
  placement: 'bottomLeft',
13233
13254
  offset: 10,
13255
+ minWidth: 0,
13234
13256
  hasBackdrop: false,
13235
13257
  insideClosable: false,
13236
13258
  panelClass: 'color-select-container'
@@ -13985,6 +14007,7 @@
13985
14007
  _this.theOnSave = new i0.EventEmitter();
13986
14008
  _this.theOnDOMEvent = new i0.EventEmitter();
13987
14009
  _this.theEditorCreated = new i0.EventEmitter();
14010
+ _this.theUploadingStatus = new i0.EventEmitter(); // true 上传结束 false 上传中
13988
14011
  _this.autoScrollView = _.debounce(function (editor, scrollContainer) {
13989
14012
  return autoScrollViewHandle(editor, scrollContainer);
13990
14013
  }, 80);
@@ -14106,7 +14129,18 @@
14106
14129
  configurable: true
14107
14130
  });
14108
14131
  TheEditorComponent.prototype.ngOnInit = function () {
14132
+ var _this = this;
14109
14133
  this.initialize();
14134
+ this.theContextService.uploadingStatus$.subscribe(function (isUploading) {
14135
+ if (isUploading) {
14136
+ _this.theUploadingStatus.emit(true);
14137
+ }
14138
+ else {
14139
+ if (_this.theContextService.uploadingFiles.length === 0) {
14140
+ _this.theUploadingStatus.emit(false);
14141
+ }
14142
+ }
14143
+ });
14110
14144
  this.onErrorHandler();
14111
14145
  };
14112
14146
  TheEditorComponent.prototype.ngOnChanges = function (changes) {
@@ -14335,7 +14369,7 @@
14335
14369
  return TheEditorComponent;
14336
14370
  }(core.mixinUnsubscribe(core.MixinBase)));
14337
14371
  TheEditorComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheEditorComponent, deps: [{ token: TheContextService }, { token: i0__namespace.ViewContainerRef }, { token: i0__namespace.ElementRef }, { token: i0__namespace.NgZone }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
14338
- TheEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheEditorComponent, selector: "the-editor, theEditor", inputs: { theOptions: "theOptions", thePlugins: "thePlugins", theGlobalToolbar: "theGlobalToolbar", theDecorate: "theDecorate", theOnError: "theOnError" }, outputs: { theOnSave: "theOnSave", theOnDOMEvent: "theOnDOMEvent", theEditorCreated: "theEditorCreated" }, host: { properties: { "class.the-editor-readonly": "theOptions?.readonly" }, classAttribute: "the-editor" }, providers: [
14372
+ TheEditorComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheEditorComponent, selector: "the-editor, theEditor", inputs: { theOptions: "theOptions", thePlugins: "thePlugins", theGlobalToolbar: "theGlobalToolbar", theDecorate: "theDecorate", theOnError: "theOnError" }, outputs: { theOnSave: "theOnSave", theOnDOMEvent: "theOnDOMEvent", theEditorCreated: "theEditorCreated", theUploadingStatus: "theUploadingStatus" }, host: { properties: { "class.the-editor-readonly": "theOptions?.readonly" }, classAttribute: "the-editor" }, providers: [
14339
14373
  TheContextService,
14340
14374
  TheColorSelectService,
14341
14375
  {
@@ -14380,6 +14414,8 @@
14380
14414
  type: i0.Output
14381
14415
  }], theEditorCreated: [{
14382
14416
  type: i0.Output
14417
+ }], theUploadingStatus: [{
14418
+ type: i0.Output
14383
14419
  }], templateInstance: [{
14384
14420
  type: i0.ViewChild,
14385
14421
  args: ['templateInstance', { static: true }]
@@ -14503,6 +14539,7 @@
14503
14539
  this.groupPopoverRef = this.thyPopover.open(this.groupTemplate, {
14504
14540
  panelClass: 'the-toolbar-group-container',
14505
14541
  offset: 10,
14542
+ minWidth: 0,
14506
14543
  placement: 'bottomRight',
14507
14544
  origin: event.currentTarget,
14508
14545
  viewContainerRef: this.viewContainerRef,