@worktile/theia 3.0.10 → 3.0.11
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 +14 -8
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/esm2015/plugins/image/image.component.js +13 -7
- package/fesm2015/worktile-theia.js +12 -6
- package/fesm2015/worktile-theia.js.map +1 -1
- package/package.json +1 -1
- package/plugins/image/image.component.d.ts +1 -0
|
@@ -3349,15 +3349,20 @@
|
|
|
3349
3349
|
_this.uploadingSubscription.unsubscribe();
|
|
3350
3350
|
_this.uploading = false;
|
|
3351
3351
|
_this.theContextService.removeUploadImage(_this.fileItem);
|
|
3352
|
-
_this.theContextService.uploadingStatus$.next(false);
|
|
3352
|
+
setTimeout(function () { return _this.theContextService.uploadingStatus$.next(false); }, 0);
|
|
3353
3353
|
}
|
|
3354
3354
|
_this.cdr.detectChanges();
|
|
3355
3355
|
});
|
|
3356
3356
|
};
|
|
3357
|
+
TheImageComponent.prototype.setImageNodes = function (imageInfo) {
|
|
3358
|
+
var _this = this;
|
|
3359
|
+
var path = i1.AngularEditor.findPath(this.editor, this.element);
|
|
3360
|
+
var data = Object.assign({ type: exports.ElementKinds.image, url: null }, imageInfo);
|
|
3361
|
+
slateHistory.HistoryEditor.withoutSaving(this.editor, function () { return slate.Transforms.setNodes(_this.editor, data, { at: path }); });
|
|
3362
|
+
};
|
|
3357
3363
|
TheImageComponent.prototype.uploadImage = function (file) {
|
|
3358
3364
|
return __awaiter(this, void 0, void 0, function () {
|
|
3359
|
-
var _b, width, height, _c, uploadFileEntity,
|
|
3360
|
-
var _this = this;
|
|
3365
|
+
var _b, width, height, _c, uploadFileEntity, thumbUrl, originUrl, imageInfo;
|
|
3361
3366
|
return __generator(this, function (_d) {
|
|
3362
3367
|
switch (_d.label) {
|
|
3363
3368
|
case 0: return [4 /*yield*/, this.resolveImageSize(file, this.theContextService.getOptions().width)];
|
|
@@ -3374,7 +3379,6 @@
|
|
|
3374
3379
|
return [4 /*yield*/, this.imageUploaderService.uploadFileHandle([file]).toPromise()];
|
|
3375
3380
|
case 2:
|
|
3376
3381
|
_c = __read.apply(void 0, [_d.sent(), 1]), uploadFileEntity = _c[0];
|
|
3377
|
-
path = i1.AngularEditor.findPath(this.editor, this.element);
|
|
3378
3382
|
thumbUrl = uploadFileEntity.thumbUrl, originUrl = uploadFileEntity.originUrl;
|
|
3379
3383
|
imageInfo = {
|
|
3380
3384
|
name: file.name,
|
|
@@ -3384,7 +3388,7 @@
|
|
|
3384
3388
|
originUrl: originUrl,
|
|
3385
3389
|
align: this.imageEntry.align || exports.Alignment.center
|
|
3386
3390
|
};
|
|
3387
|
-
|
|
3391
|
+
this.setImageNodes(imageInfo);
|
|
3388
3392
|
return [2 /*return*/];
|
|
3389
3393
|
}
|
|
3390
3394
|
});
|
|
@@ -3501,9 +3505,11 @@
|
|
|
3501
3505
|
};
|
|
3502
3506
|
});
|
|
3503
3507
|
var startIndex = previewImages.findIndex(function (item) { return item.key === _this.element.key; });
|
|
3504
|
-
|
|
3505
|
-
startIndex: startIndex
|
|
3506
|
-
|
|
3508
|
+
var config = {
|
|
3509
|
+
startIndex: startIndex,
|
|
3510
|
+
operations: ['zoom-out', 'zoom-in', 'rotate-right', 'download']
|
|
3511
|
+
};
|
|
3512
|
+
this.thyImageService.preview(previewImages, config);
|
|
3507
3513
|
}
|
|
3508
3514
|
$event.stopPropagation();
|
|
3509
3515
|
};
|