nuxeo-development-framework 5.0.2 → 5.0.3
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/nuxeo-development-framework.umd.js +25 -22
- package/bundles/nuxeo-development-framework.umd.js.map +1 -1
- package/esm2015/lib/components/pdf-tron/pdftron/pdftron.component.js +5 -2
- package/fesm2015/nuxeo-development-framework.js +4 -1
- package/fesm2015/nuxeo-development-framework.js.map +1 -1
- package/lib/components/pdf-tron/pdftron/pdftron.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -30133,10 +30133,10 @@
|
|
|
30133
30133
|
}
|
|
30134
30134
|
PdftronComponent.prototype.ngOnInit = function () {
|
|
30135
30135
|
return __awaiter(this, void 0, void 0, function () {
|
|
30136
|
-
var
|
|
30136
|
+
var _c;
|
|
30137
30137
|
var _this = this;
|
|
30138
|
-
return __generator(this, function (
|
|
30139
|
-
switch (
|
|
30138
|
+
return __generator(this, function (_d) {
|
|
30139
|
+
switch (_d.label) {
|
|
30140
30140
|
case 0:
|
|
30141
30141
|
this.transelationSubscrition = this.translationService.isArabic.subscribe(function (res) {
|
|
30142
30142
|
_this.isArabic = res;
|
|
@@ -30159,8 +30159,10 @@
|
|
|
30159
30159
|
if (!this.silentPdfTronService.isEnabled) return [3 /*break*/, 2];
|
|
30160
30160
|
return [4 /*yield*/, this.silentPdfTronService.getWebViewer()];
|
|
30161
30161
|
case 1:
|
|
30162
|
-
|
|
30162
|
+
_c = __read.apply(void 0, [_d.sent(), 2]), this.silentPdfTron = _c[0], this.webViewerInstance = _c[1];
|
|
30163
30163
|
__classPrivateFieldGet(this, _PdftronComponent_instances, "m", _PdftronComponent_afterLoadWebViewer).call(this, this.webViewerInstance);
|
|
30164
|
+
this.mutationObserver = new MutationObserver(function () { return __classPrivateFieldGet(_this, _PdftronComponent_instances, "m", _PdftronComponent_updateSilentPdfTron).call(_this); });
|
|
30165
|
+
this.mutationObserver.observe(document.body, { childList: true, subtree: true });
|
|
30164
30166
|
this.resizeObserver = new ResizeObserver(function () { return __classPrivateFieldGet(_this, _PdftronComponent_instances, "m", _PdftronComponent_updateSilentPdfTron).call(_this); });
|
|
30165
30167
|
this.resizeObserver.observe(this.viewerRef.nativeElement);
|
|
30166
30168
|
__classPrivateFieldGet(this, _PdftronComponent_instances, "m", _PdftronComponent_updateSilentPdfTron).call(this);
|
|
@@ -30177,12 +30179,12 @@
|
|
|
30177
30179
|
annotationUser: this.nuxeo.nuxeoClient.user.properties.firstName + ' ' + this.nuxeo.nuxeoClient.user.properties.lastName,
|
|
30178
30180
|
disabledElements: ['downloadButton', 'printButton']
|
|
30179
30181
|
}, this.viewerRef.nativeElement).then(function (instance) { return __awaiter(_this, void 0, void 0, function () {
|
|
30180
|
-
return __generator(this, function (
|
|
30182
|
+
return __generator(this, function (_c) {
|
|
30181
30183
|
__classPrivateFieldGet(this, _PdftronComponent_instances, "m", _PdftronComponent_afterLoadWebViewer).call(this, instance);
|
|
30182
30184
|
return [2 /*return*/];
|
|
30183
30185
|
});
|
|
30184
30186
|
}); });
|
|
30185
|
-
|
|
30187
|
+
_d.label = 3;
|
|
30186
30188
|
case 3: return [2 /*return*/];
|
|
30187
30189
|
}
|
|
30188
30190
|
});
|
|
@@ -30203,8 +30205,8 @@
|
|
|
30203
30205
|
// exctract all anotations on the file and send it out side to be saved and leave the file as it is without any anotations on it
|
|
30204
30206
|
PdftronComponent.prototype.exportAnotationsToOutside = function () {
|
|
30205
30207
|
var _this = this;
|
|
30206
|
-
this.webViewerInstance.annotManager.on('annotationChanged', function (annotations, action,
|
|
30207
|
-
var imported =
|
|
30208
|
+
this.webViewerInstance.annotManager.on('annotationChanged', function (annotations, action, _c) {
|
|
30209
|
+
var imported = _c.imported;
|
|
30208
30210
|
if (imported)
|
|
30209
30211
|
return;
|
|
30210
30212
|
_this.webViewerInstance.annotManager.exportAnnotations().then(function (exctractedAnotations) {
|
|
@@ -30271,7 +30273,7 @@
|
|
|
30271
30273
|
return __awaiter(this, void 0, void 0, function () {
|
|
30272
30274
|
var canvas, pageMatrix, ctx;
|
|
30273
30275
|
var _this = this;
|
|
30274
|
-
return __generator(this, function (
|
|
30276
|
+
return __generator(this, function (_c) {
|
|
30275
30277
|
canvas = document.createElement('canvas');
|
|
30276
30278
|
pageMatrix = docViewer.getDocument().getPageMatrix(annotation.PageNumber);
|
|
30277
30279
|
// Set the height & width of the canvas to madeleteSavedSignaturetch the annotation
|
|
@@ -30315,9 +30317,9 @@
|
|
|
30315
30317
|
img: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-file-earmark-arrow-down" viewBox="0 0 16 16"> <path d="M8.5 6.5a.5.5 0 0 0-1 0v3.793L6.354 9.146a.5.5 0 1 0-.708.708l2 2a.5.5 0 0 0 .708 0l2-2a.5.5 0 0 0-.708-.708L8.5 10.293V6.5z"/> <path d="M14 14V4.5L9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2zM9.5 3A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5v2z"/></svg>',
|
|
30316
30318
|
title: _this.isArabic ? 'تنزيل' : 'Download',
|
|
30317
30319
|
onClick: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
30318
|
-
var
|
|
30319
|
-
return __generator(this, function (
|
|
30320
|
-
|
|
30320
|
+
var _c, DocumentViewer, AnnotationManager, SaveOptions, saveOptions, options;
|
|
30321
|
+
return __generator(this, function (_d) {
|
|
30322
|
+
_c = this.webViewerInstance.CoreControls, DocumentViewer = _c.DocumentViewer, AnnotationManager = _c.AnnotationManager, SaveOptions = _c.SaveOptions;
|
|
30321
30323
|
saveOptions = SaveOptions;
|
|
30322
30324
|
options = {
|
|
30323
30325
|
filename: this.correspondance.title ? this.correspondance.title : 'myDocument.pdf',
|
|
@@ -30368,7 +30370,7 @@
|
|
|
30368
30370
|
if (!this.webViewerInstance || (!this.fileData && !this.fileURL)) {
|
|
30369
30371
|
return;
|
|
30370
30372
|
}
|
|
30371
|
-
var
|
|
30373
|
+
var _c = this.webViewerInstance, docViewer = _c.docViewer, annotManager = _c.annotManager, Annotations = _c.Annotations;
|
|
30372
30374
|
docViewer.on('documentLoaded', __classPrivateFieldGet(this, _PdftronComponent_docLoaded, "f"));
|
|
30373
30375
|
if (!this.editMode) {
|
|
30374
30376
|
this.webViewerInstance.annotManager.setReadOnly(true);
|
|
@@ -30410,19 +30412,19 @@
|
|
|
30410
30412
|
PdftronComponent.prototype.exportAsBlob = function () {
|
|
30411
30413
|
return __awaiter(this, void 0, void 0, function () {
|
|
30412
30414
|
var doc, xfdfString, data, arr, blob;
|
|
30413
|
-
return __generator(this, function (
|
|
30414
|
-
switch (
|
|
30415
|
+
return __generator(this, function (_c) {
|
|
30416
|
+
switch (_c.label) {
|
|
30415
30417
|
case 0:
|
|
30416
30418
|
doc = this.webViewerInstance.docViewer.getDocument();
|
|
30417
30419
|
return [4 /*yield*/, this.webViewerInstance.annotManager.exportAnnotations()];
|
|
30418
30420
|
case 1:
|
|
30419
|
-
xfdfString =
|
|
30421
|
+
xfdfString = _c.sent();
|
|
30420
30422
|
return [4 /*yield*/, doc.getFileData({
|
|
30421
30423
|
// saves the document with annotations in it
|
|
30422
30424
|
xfdfString: xfdfString
|
|
30423
30425
|
})];
|
|
30424
30426
|
case 2:
|
|
30425
|
-
data =
|
|
30427
|
+
data = _c.sent();
|
|
30426
30428
|
arr = new Uint8Array(data);
|
|
30427
30429
|
blob = new Blob([arr], { type: this.DOCUMENT_TYPE });
|
|
30428
30430
|
return [2 /*return*/, Promise.resolve(blob)];
|
|
@@ -30490,9 +30492,9 @@
|
|
|
30490
30492
|
// adding search lisner to lisen to internal search from ui and without ocr
|
|
30491
30493
|
PdftronComponent.prototype.addSearchListner = function () {
|
|
30492
30494
|
var _this = this;
|
|
30493
|
-
var
|
|
30495
|
+
var _c = this.webViewerInstance, annotManager = _c.annotManager, docViewer = _c.docViewer, Annotations = _c.Annotations;
|
|
30494
30496
|
var searchListener = function (searchPattern, options, results) {
|
|
30495
|
-
var
|
|
30497
|
+
var _c;
|
|
30496
30498
|
_this.mySearchStringResults = [];
|
|
30497
30499
|
if (_this.savedAnotations.length > 0) {
|
|
30498
30500
|
_this.savedAnotations.map(function (annotation) {
|
|
@@ -30512,7 +30514,7 @@
|
|
|
30512
30514
|
annotation.Author = _this.webViewerInstance.annotManager.getCurrentUser();
|
|
30513
30515
|
return annotation;
|
|
30514
30516
|
});
|
|
30515
|
-
(
|
|
30517
|
+
(_c = _this.savedAnotations).push.apply(_c, __spreadArray([], __read(_this.newAnnotations)));
|
|
30516
30518
|
annotManager.addAnnotations(_this.newAnnotations);
|
|
30517
30519
|
annotManager.drawAnnotationsFromList(_this.newAnnotations);
|
|
30518
30520
|
}
|
|
@@ -30527,7 +30529,7 @@
|
|
|
30527
30529
|
// perform automatic search when intering the page
|
|
30528
30530
|
PdftronComponent.prototype.automaticSearch = function (searchTextArray) {
|
|
30529
30531
|
var _this = this;
|
|
30530
|
-
var
|
|
30532
|
+
var _c = this.webViewerInstance, annotManager = _c.annotManager, docViewer = _c.docViewer, Annotations = _c.Annotations;
|
|
30531
30533
|
var searchOptions;
|
|
30532
30534
|
this.webViewerInstance.openElements(['searchPanel']);
|
|
30533
30535
|
docViewer.on('documentLoaded', function () {
|
|
@@ -30778,7 +30780,7 @@
|
|
|
30778
30780
|
}
|
|
30779
30781
|
this.loadDocument();
|
|
30780
30782
|
}, _PdftronComponent_reset = function _PdftronComponent_reset() {
|
|
30781
|
-
var _a;
|
|
30783
|
+
var _a, _b;
|
|
30782
30784
|
this.webViewerInstance.closeDocument().then(function () {
|
|
30783
30785
|
console.log('document closed!');
|
|
30784
30786
|
});
|
|
@@ -30786,6 +30788,7 @@
|
|
|
30786
30788
|
this.transelationSubscrition ? this.transelationSubscrition.unsubscribe() : null;
|
|
30787
30789
|
this.silentPdfTron.style.display = 'none';
|
|
30788
30790
|
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
30791
|
+
(_b = this.mutationObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
|
30789
30792
|
this.webViewerInstance.setHeaderItems(function (header) {
|
|
30790
30793
|
header.headers.default = header.headers.default.filter(function (q) { var _a; return !((_a = q.img) === null || _a === void 0 ? void 0 : _a.includes('<svg')); });
|
|
30791
30794
|
});
|