@hmcts/media-viewer 2.9.2 → 2.9.4-RC.7
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/assets/images/icon-bookmarks-custom.png +0 -0
- package/assets/images/icon-bookmarks-position.png +0 -0
- package/assets/images/toolbarButton-bookmarkDark.png +0 -0
- package/assets/sass/comment-set-panel.scss +1 -0
- package/assets/sass/comment.scss +4 -6
- package/assets/sass/image-viewer.scss +2 -1
- package/assets/sass/pdf-viewer.scss +4 -0
- package/assets/sass/toolbar/buttons.scss +24 -0
- package/assets/sass/toolbar/main-toolbar.scss +20 -7
- package/assets/sass/toolbar/side-bar.scss +17 -17
- package/bundles/hmcts-media-viewer.umd.js +748 -325
- package/bundles/hmcts-media-viewer.umd.js.map +1 -1
- package/bundles/hmcts-media-viewer.umd.min.js +1 -1
- package/bundles/hmcts-media-viewer.umd.min.js.map +1 -1
- package/esm2015/hmcts-media-viewer.js +53 -52
- package/esm2015/lib/annotations/annotation-set/annotation-create/box-highlight-create/box-highlight-create.component.js +2 -2
- package/esm2015/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.directive.js +2 -2
- package/esm2015/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.service.js +2 -2
- package/esm2015/lib/annotations/annotation-set/annotation-view/annotation-view.component.js +1 -1
- package/esm2015/lib/annotations/annotation-set/metadata-layer/metadata-layer.component.js +3 -2
- package/esm2015/lib/annotations/annotations.module.js +3 -1
- package/esm2015/lib/annotations/comment-set/comment/comment.component.js +3 -2
- package/esm2015/lib/annotations/comment-set/comment/comment.service.js +6 -2
- package/esm2015/lib/annotations/comment-set/comment-set-header/comment-set-header.component.js +13 -2
- package/esm2015/lib/media-viewer.component.js +4 -2
- package/esm2015/lib/print.service.js +4 -2
- package/esm2015/lib/redaction/components/redaction.component.js +2 -2
- package/esm2015/lib/redaction/services/redaction-api.service.js +7 -1
- package/esm2015/lib/redaction/services/redaction.model.js +1 -1
- package/esm2015/lib/store/actions/redaction.actions.js +22 -1
- package/esm2015/lib/store/effects/redaction.effects.js +18 -4
- package/esm2015/lib/store/reducers/bookmarks.reducer.js +3 -2
- package/esm2015/lib/store/reducers/redaction.reducer.js +9 -1
- package/esm2015/lib/store/selectors/bookmark.selectors.js +2 -2
- package/esm2015/lib/toolbar/main-toolbar/main-toolbar.component.js +19 -4
- package/esm2015/lib/toolbar/redaction-search-bar/redaction-search-bar.component.js +201 -0
- package/esm2015/lib/toolbar/redaction-search-bar/redaction-search.model.js +2 -0
- package/esm2015/lib/toolbar/redaction-toolbar/redaction-toolbar.component.js +18 -6
- package/esm2015/lib/toolbar/toolbar-event.service.js +9 -1
- package/esm2015/lib/toolbar/toolbar.module.js +6 -3
- package/esm2015/lib/viewers/image-viewer/image-viewer.component.js +2 -2
- package/esm2015/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.js +18 -5
- package/esm2015/lib/viewers/pdf-viewer/pdf-viewer.component.js +3 -2
- package/esm2015/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.js +70 -5
- package/esm2015/lib/viewers/pdf-viewer/side-bar/outline-item/outline-item.component.js +4 -1
- package/esm2015/lib/viewers/pdf-viewer/side-bar/side-bar.component.js +24 -19
- package/fesm2015/hmcts-media-viewer.js +605 -221
- package/fesm2015/hmcts-media-viewer.js.map +1 -1
- package/hmcts-media-viewer.d.ts +56 -55
- package/hmcts-media-viewer.d.ts.map +1 -1
- package/hmcts-media-viewer.metadata.json +1 -1
- package/lib/annotations/annotation-set/annotation-create/box-highlight-create/box-highlight-create.component.d.ts.map +1 -1
- package/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.service.d.ts.map +1 -1
- package/lib/annotations/annotation-set/annotation-view/annotation-view.component.d.ts.map +1 -1
- package/lib/annotations/annotation-set/metadata-layer/metadata-layer.component.d.ts.map +1 -1
- package/lib/annotations/annotations.module.d.ts.map +1 -1
- package/lib/annotations/comment-set/comment/comment.component.d.ts +2 -0
- package/lib/annotations/comment-set/comment/comment.component.d.ts.map +1 -1
- package/lib/annotations/comment-set/comment/comment.service.d.ts +3 -1
- package/lib/annotations/comment-set/comment/comment.service.d.ts.map +1 -1
- package/lib/annotations/comment-set/comment-set-header/comment-set-header.component.d.ts +4 -1
- package/lib/annotations/comment-set/comment-set-header/comment-set-header.component.d.ts.map +1 -1
- package/lib/media-viewer.component.d.ts +1 -0
- package/lib/media-viewer.component.d.ts.map +1 -1
- package/lib/media-viewer.module.ngfactory.d.ts.map +1 -1
- package/lib/print.service.d.ts.map +1 -1
- package/lib/redaction/components/redaction.component.d.ts.map +1 -1
- package/lib/redaction/services/redaction-api.service.d.ts +3 -1
- package/lib/redaction/services/redaction-api.service.d.ts.map +1 -1
- package/lib/redaction/services/redaction.model.d.ts +3 -0
- package/lib/redaction/services/redaction.model.d.ts.map +1 -1
- package/lib/store/actions/redaction.actions.d.ts +20 -2
- package/lib/store/actions/redaction.actions.d.ts.map +1 -1
- package/lib/store/effects/redaction.effects.d.ts +4 -1
- package/lib/store/effects/redaction.effects.d.ts.map +1 -1
- package/lib/store/reducers/bookmarks.reducer.d.ts.map +1 -1
- package/lib/store/reducers/redaction.reducer.d.ts.map +1 -1
- package/lib/store/selectors/annotation.selectors.d.ts +5 -5
- package/lib/store/selectors/redaction.selectors.d.ts +1 -1
- package/lib/store/selectors/tag.selectors.d.ts +2 -2
- package/lib/toolbar/main-toolbar/main-toolbar.component.d.ts +3 -1
- package/lib/toolbar/main-toolbar/main-toolbar.component.d.ts.map +1 -1
- package/lib/toolbar/redaction-search-bar/redaction-search-bar.component.d.ts +51 -0
- package/lib/toolbar/redaction-search-bar/redaction-search-bar.component.d.ts.map +1 -0
- package/lib/toolbar/redaction-search-bar/redaction-search-bar.component.ngfactory.d.ts.map +1 -0
- package/lib/toolbar/redaction-search-bar/redaction-search-bar.component.scss.shim.ngstyle.d.ts.map +1 -0
- package/lib/toolbar/redaction-search-bar/redaction-search.model.d.ts +12 -0
- package/lib/toolbar/redaction-search-bar/redaction-search.model.d.ts.map +1 -0
- package/lib/toolbar/redaction-toolbar/redaction-toolbar.component.d.ts +4 -2
- package/lib/toolbar/redaction-toolbar/redaction-toolbar.component.d.ts.map +1 -1
- package/lib/toolbar/toolbar-event.service.d.ts +6 -0
- package/lib/toolbar/toolbar-event.service.d.ts.map +1 -1
- package/lib/toolbar/toolbar.module.d.ts.map +1 -1
- package/lib/toolbar/toolbar.module.ngfactory.d.ts.map +1 -1
- package/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.d.ts +1 -0
- package/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.d.ts.map +1 -1
- package/lib/viewers/pdf-viewer/pdf-viewer.component.d.ts +1 -0
- package/lib/viewers/pdf-viewer/pdf-viewer.component.d.ts.map +1 -1
- package/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.d.ts +17 -4
- package/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.d.ts.map +1 -1
- package/lib/viewers/pdf-viewer/side-bar/outline-item/outline-item.component.d.ts.map +1 -1
- package/lib/viewers/pdf-viewer/side-bar/side-bar.component.d.ts +7 -4
- package/lib/viewers/pdf-viewer/side-bar/side-bar.component.d.ts.map +1 -1
- package/package.json +5 -4
- package/hmcts-media-viewer-v2.9.2.tgz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators'), require('@ngrx/store'), require('pdfjs-dist/web/pdf_viewer'), require('pdfjs-dist'), require('pdfjs-dist/build/pdf.worker'), require('uuid/v4'), require('moment-timezone'), require('hammerjs'), require('@angular/cdk/overlay'), require('@angular/router'), require('@angular/cdk/a11y'), require('mutable-div'), require('ngx-chips'), require('@swimlane/ngx-datatable'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@hmcts/media-viewer', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/common/http', 'rxjs', 'rxjs/operators', '@ngrx/store', 'pdfjs-dist/web/pdf_viewer', 'pdfjs-dist', 'pdfjs-dist/build/pdf.worker', 'uuid/v4', 'moment-timezone', 'hammerjs', '@angular/cdk/overlay', '@angular/router', '@angular/cdk/a11y', 'mutable-div', 'ngx-chips', '@swimlane/ngx-datatable', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.hmcts = global.hmcts || {}, global.hmcts["media-viewer"] = {}), global.ng.core, global.ng.common, global.ng.forms, global.ng.common.http, global.rxjs, global.rxjs.operators, global.store, global.pdfjsViewer, global.pdfjsLib, null, global.uuid, global.moment, null, global.ng.cdk.overlay, global.ng.router, global.ng.cdk.a11y, global.mutableDiv, global.ngxChips, global.ngxDatatable, global.
|
|
5
|
-
})(this, (function (exports, i0, common, forms, i1, rxjs, operators, store, pdfjsViewer, pdfjsLib, pdf_worker, uuid, moment, hammerjs, overlay, router, a11y, mutableDiv, ngxChips, ngxDatatable,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators'), require('@ngrx/store'), require('pdfjs-dist/web/pdf_viewer'), require('pdfjs-dist'), require('pdfjs-dist/build/pdf.worker'), require('uuid/v4'), require('moment-timezone'), require('hammerjs'), require('uuid'), require('@angular/cdk/overlay'), require('@angular/router'), require('@angular/cdk/a11y'), require('mutable-div'), require('ngx-chips'), require('@swimlane/ngx-datatable'), require('@circlon/angular-tree-component'), require('@ngrx/effects')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@hmcts/media-viewer', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/common/http', 'rxjs', 'rxjs/operators', '@ngrx/store', 'pdfjs-dist/web/pdf_viewer', 'pdfjs-dist', 'pdfjs-dist/build/pdf.worker', 'uuid/v4', 'moment-timezone', 'hammerjs', 'uuid', '@angular/cdk/overlay', '@angular/router', '@angular/cdk/a11y', 'mutable-div', 'ngx-chips', '@swimlane/ngx-datatable', '@circlon/angular-tree-component', '@ngrx/effects'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.hmcts = global.hmcts || {}, global.hmcts["media-viewer"] = {}), global.ng.core, global.ng.common, global.ng.forms, global.ng.common.http, global.rxjs, global.rxjs.operators, global.store, global.pdfjsViewer, global.pdfjsLib, null, global.uuid, global.moment, null, global.uuid$1, global.ng.cdk.overlay, global.ng.router, global.ng.cdk.a11y, global.mutableDiv, global.ngxChips, global.ngxDatatable, global.angularTreeComponent, global.effects$1));
|
|
5
|
+
})(this, (function (exports, i0, common, forms, i1, rxjs, operators, store, pdfjsViewer, pdfjsLib, pdf_worker, uuid, moment, hammerjs, uuid$1, overlay, router, a11y, mutableDiv, ngxChips, ngxDatatable, angularTreeComponent, effects$1) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -391,15 +391,26 @@
|
|
|
391
391
|
this.pdfViewer.eventBus.on('scalechanging', function (e) { return _this.emitDocumentInfo(e); });
|
|
392
392
|
this.pdfViewer.eventBus.on('rotationchanging', function (e) { return _this.emitDocumentInfo(e); });
|
|
393
393
|
this.pdfViewer.eventBus.on('updatefindcontrolstate', function (event) {
|
|
394
|
-
|
|
395
|
-
_this.toolbarEvents.searchResultsCountSubject.next(event.matchesCount);
|
|
396
|
-
}
|
|
394
|
+
_this.sendSearchDetails(event);
|
|
397
395
|
});
|
|
398
396
|
this.pdfViewer.eventBus.on('updatefindmatchescount', function (event) {
|
|
399
397
|
_this.toolbarEvents.searchResultsCountSubject.next(event.matchesCount);
|
|
400
398
|
});
|
|
401
399
|
this.zoomValue = 1;
|
|
402
400
|
}
|
|
401
|
+
PdfJsWrapper.prototype.sendSearchDetails = function (event) {
|
|
402
|
+
var _a, _b, _c, _d, _e, _f;
|
|
403
|
+
if (event.state !== FindState.PENDING) {
|
|
404
|
+
this.toolbarEvents.searchResultsCountSubject.next(event.matchesCount);
|
|
405
|
+
if (((_b = (_a = event === null || event === void 0 ? void 0 : event.source) === null || _a === void 0 ? void 0 : _a.selected) === null || _b === void 0 ? void 0 : _b.pageIdx) !== -1 && event.matchesCount.total > 0) {
|
|
406
|
+
this.toolbarEvents.redactionSerachSubject.next({
|
|
407
|
+
page: (_d = (_c = event === null || event === void 0 ? void 0 : event.source) === null || _c === void 0 ? void 0 : _c.selected) === null || _d === void 0 ? void 0 : _d.pageIdx,
|
|
408
|
+
matchedIndex: (_f = (_e = event === null || event === void 0 ? void 0 : event.source) === null || _e === void 0 ? void 0 : _e.selected) === null || _f === void 0 ? void 0 : _f.matchIdx,
|
|
409
|
+
matchesCount: event.matchesCount.total
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
};
|
|
403
414
|
PdfJsWrapper.prototype.emitDocumentInfo = function (e) {
|
|
404
415
|
var allPages = __spread(this.pdfViewer._pages).map(function (page) {
|
|
405
416
|
return {
|
|
@@ -416,43 +427,46 @@
|
|
|
416
427
|
return __awaiter(this, void 0, void 0, function () {
|
|
417
428
|
var loadingTask, pdfDocument, outline, pdfMetaData, e_1;
|
|
418
429
|
var _this = this;
|
|
419
|
-
return __generator(this, function (
|
|
420
|
-
switch (
|
|
430
|
+
return __generator(this, function (_g) {
|
|
431
|
+
switch (_g.label) {
|
|
421
432
|
case 0:
|
|
422
433
|
loadingTask = this.createLoadingTask(documentUrl);
|
|
423
|
-
loadingTask.onProgress = function (
|
|
424
|
-
var loaded =
|
|
434
|
+
loadingTask.onProgress = function (_g) {
|
|
435
|
+
var loaded = _g.loaded, total = _g.total;
|
|
425
436
|
_this.documentLoadProgress.next({ loaded: loaded, total: total });
|
|
426
437
|
};
|
|
427
438
|
this.documentLoadInit.next(documentUrl);
|
|
428
|
-
|
|
439
|
+
_g.label = 1;
|
|
429
440
|
case 1:
|
|
430
|
-
|
|
441
|
+
_g.trys.push([1, 7, , 8]);
|
|
431
442
|
return [4 /*yield*/, loadingTask.promise];
|
|
432
443
|
case 2:
|
|
433
|
-
pdfDocument =
|
|
444
|
+
pdfDocument = _g.sent();
|
|
434
445
|
this.documentLoaded.next(pdfDocument);
|
|
435
446
|
this.toolbarEvents.pageCountSubject.next(pdfDocument.numPages);
|
|
436
447
|
this.pdfViewer.setDocument(pdfDocument);
|
|
437
448
|
this.pdfViewer.linkService.setDocument(pdfDocument, null);
|
|
438
449
|
return [4 /*yield*/, pdfDocument.getOutline()];
|
|
439
450
|
case 3:
|
|
440
|
-
outline =
|
|
451
|
+
outline = _g.sent();
|
|
452
|
+
if (!outline) return [3 /*break*/, 5];
|
|
441
453
|
return [4 /*yield*/, this.setOutlinePageNumbers(pdfDocument, outline)];
|
|
442
454
|
case 4:
|
|
443
|
-
|
|
455
|
+
_g.sent();
|
|
456
|
+
_g.label = 5;
|
|
457
|
+
case 5:
|
|
444
458
|
this.documentOutline = outline;
|
|
445
459
|
this.outlineLoaded.next(this.documentOutline);
|
|
446
460
|
return [4 /*yield*/, pdfDocument.getMetadata()];
|
|
447
|
-
case 5:
|
|
448
|
-
pdfMetaData = _a.sent();
|
|
449
|
-
this.setCurrentPDFTitle(pdfMetaData.info.Title);
|
|
450
|
-
return [3 /*break*/, 7];
|
|
451
461
|
case 6:
|
|
452
|
-
|
|
462
|
+
pdfMetaData = _g.sent();
|
|
463
|
+
this.setCurrentPDFTitle(pdfMetaData.info.Title);
|
|
464
|
+
return [3 /*break*/, 8];
|
|
465
|
+
case 7:
|
|
466
|
+
e_1 = _g.sent();
|
|
453
467
|
this.documentLoadFailed.next(e_1);
|
|
454
|
-
return [3 /*break*/,
|
|
455
|
-
case
|
|
468
|
+
return [3 /*break*/, 8];
|
|
469
|
+
case 8: return [2 /*return*/];
|
|
456
470
|
}
|
|
457
471
|
});
|
|
458
472
|
});
|
|
@@ -468,13 +482,13 @@
|
|
|
468
482
|
PdfJsWrapper.prototype.setOutlinePageNumbers = function (pdfDocument, outlineArray) {
|
|
469
483
|
return __awaiter(this, void 0, void 0, function () {
|
|
470
484
|
var _this = this;
|
|
471
|
-
return __generator(this, function (
|
|
485
|
+
return __generator(this, function (_g) {
|
|
472
486
|
outlineArray.forEach(function (outline) { return __awaiter(_this, void 0, void 0, function () {
|
|
473
|
-
return __generator(this, function (
|
|
474
|
-
switch (
|
|
487
|
+
return __generator(this, function (_g) {
|
|
488
|
+
switch (_g.label) {
|
|
475
489
|
case 0: return [4 /*yield*/, this.setNestedOutlinePageNumbers(pdfDocument, outline)];
|
|
476
490
|
case 1:
|
|
477
|
-
|
|
491
|
+
_g.sent();
|
|
478
492
|
return [2 /*return*/];
|
|
479
493
|
}
|
|
480
494
|
});
|
|
@@ -485,24 +499,24 @@
|
|
|
485
499
|
};
|
|
486
500
|
PdfJsWrapper.prototype.setNestedOutlinePageNumbers = function (pdfDocument, outline) {
|
|
487
501
|
return __awaiter(this, void 0, void 0, function () {
|
|
488
|
-
var
|
|
502
|
+
var _g;
|
|
489
503
|
var _this = this;
|
|
490
|
-
return __generator(this, function (
|
|
491
|
-
switch (
|
|
504
|
+
return __generator(this, function (_h) {
|
|
505
|
+
switch (_h.label) {
|
|
492
506
|
case 0:
|
|
493
|
-
|
|
507
|
+
_g = outline;
|
|
494
508
|
return [4 /*yield*/, this.getOutlinePageNumber(pdfDocument, outline)];
|
|
495
509
|
case 1:
|
|
496
|
-
|
|
510
|
+
_g.pageNumber = _h.sent();
|
|
497
511
|
outline.items.forEach(function (outlineItem) { return __awaiter(_this, void 0, void 0, function () {
|
|
498
|
-
var
|
|
499
|
-
return __generator(this, function (
|
|
500
|
-
switch (
|
|
512
|
+
var _g;
|
|
513
|
+
return __generator(this, function (_h) {
|
|
514
|
+
switch (_h.label) {
|
|
501
515
|
case 0:
|
|
502
|
-
|
|
516
|
+
_g = outlineItem;
|
|
503
517
|
return [4 /*yield*/, this.getOutlinePageNumber(pdfDocument, outlineItem)];
|
|
504
518
|
case 1:
|
|
505
|
-
|
|
519
|
+
_g.pageNumber = _h.sent();
|
|
506
520
|
this.setNestedOutlinePageNumbers(pdfDocument, outlineItem);
|
|
507
521
|
return [2 /*return*/];
|
|
508
522
|
}
|
|
@@ -516,13 +530,13 @@
|
|
|
516
530
|
PdfJsWrapper.prototype.getOutlinePageNumber = function (pdfDocument, outline) {
|
|
517
531
|
return __awaiter(this, void 0, void 0, function () {
|
|
518
532
|
var dest, pageIndex;
|
|
519
|
-
return __generator(this, function (
|
|
520
|
-
switch (
|
|
533
|
+
return __generator(this, function (_g) {
|
|
534
|
+
switch (_g.label) {
|
|
521
535
|
case 0:
|
|
522
536
|
dest = outline.dest;
|
|
523
537
|
return [4 /*yield*/, pdfDocument.getPageIndex(dest[0])];
|
|
524
538
|
case 1:
|
|
525
|
-
pageIndex =
|
|
539
|
+
pageIndex = _g.sent();
|
|
526
540
|
return [2 /*return*/, Number(pageIndex) + 1];
|
|
527
541
|
}
|
|
528
542
|
});
|
|
@@ -678,7 +692,11 @@
|
|
|
678
692
|
this.applyRedactToDocument = new rxjs.Subject();
|
|
679
693
|
this.clearAllRedactMarkers = new rxjs.Subject();
|
|
680
694
|
this.redactWholePage = new rxjs.Subject();
|
|
695
|
+
this.redactionSerachSubject = new rxjs.Subject();
|
|
696
|
+
this.redactAllInProgressSubject = new rxjs.BehaviorSubject(false);
|
|
697
|
+
this.openRedactionSearch = new rxjs.Subject();
|
|
681
698
|
this.sidebarOpen = new rxjs.BehaviorSubject(false);
|
|
699
|
+
this.sidebarOutlineView = new rxjs.BehaviorSubject(true);
|
|
682
700
|
this.searchBarHidden = new rxjs.BehaviorSubject(true);
|
|
683
701
|
this.commentsPanelVisible = new rxjs.BehaviorSubject(false);
|
|
684
702
|
this.icp = icpEvents;
|
|
@@ -768,6 +786,9 @@
|
|
|
768
786
|
ToolbarEventService.prototype.toggleSideBar = function (toggle) {
|
|
769
787
|
this.sidebarOpen.next(toggle);
|
|
770
788
|
};
|
|
789
|
+
ToolbarEventService.prototype.toggleSideBarView = function (toggle) {
|
|
790
|
+
this.sidebarOutlineView.next(toggle);
|
|
791
|
+
};
|
|
771
792
|
ToolbarEventService.prototype.toggleRedactionMode = function () {
|
|
772
793
|
if (this.redactionMode.getValue() === false) {
|
|
773
794
|
this.drawModeSubject.next(false);
|
|
@@ -777,6 +798,7 @@
|
|
|
777
798
|
else {
|
|
778
799
|
this.redactionMode.next(false);
|
|
779
800
|
}
|
|
801
|
+
this.openRedactionSearch.next(false);
|
|
780
802
|
};
|
|
781
803
|
ToolbarEventService.prototype.toggleRedactionPreview = function (viewMode) {
|
|
782
804
|
this.redactionPreview.next(viewMode);
|
|
@@ -855,7 +877,9 @@
|
|
|
855
877
|
};
|
|
856
878
|
PrintService.prototype.printElementNatively = function (element, width, height) {
|
|
857
879
|
var printWindow = window.open('', '', "left=0,top=0,width=" + width + ",height=" + height + ",toolbar=0,scrollbars=0,status=0");
|
|
858
|
-
|
|
880
|
+
var documentHead = document.head;
|
|
881
|
+
printWindow.document.body.appendChild(documentHead.cloneNode(true));
|
|
882
|
+
printWindow.document.body.appendChild(element.cloneNode(true));
|
|
859
883
|
printWindow.document.close();
|
|
860
884
|
printWindow.focus();
|
|
861
885
|
printWindow.print();
|
|
@@ -1907,7 +1931,8 @@
|
|
|
1907
1931
|
});
|
|
1908
1932
|
Object.entries(removeBookmarksByPage_1).forEach(function (_a) {
|
|
1909
1933
|
var _b = __read(_a, 2), pageNumber = _b[0], bmrkIds = _b[1];
|
|
1910
|
-
bookmarkPageEntities_1[pageNumber]
|
|
1934
|
+
bookmarkPageEntities_1[pageNumber]
|
|
1935
|
+
= bookmarkPageEntities_1[pageNumber].filter(function (bookmark) { return !bmrkIds.includes(bookmark.id); });
|
|
1911
1936
|
});
|
|
1912
1937
|
return Object.assign(Object.assign({}, state), { bookmarkEntities: bookmarkEntities_2,
|
|
1913
1938
|
bookmarkPageEntities: bookmarkPageEntities_1, loading: false, loaded: true });
|
|
@@ -1936,6 +1961,9 @@
|
|
|
1936
1961
|
var SAVE_REDACTION = '[Redaction] Save Redaction';
|
|
1937
1962
|
var SAVE_REDACTION_SUCCESS = '[Redaction] Save Redaction Success';
|
|
1938
1963
|
var SAVE_REDACTION_FAIL = '[Redaction] Save Redaction Fail';
|
|
1964
|
+
var SAVE_BULK_REDACTION = '[Redaction] Save bulk Redaction';
|
|
1965
|
+
var SAVE_BULK_REDACTION_SUCCESS = '[Redaction] Save bulk Redaction Success';
|
|
1966
|
+
var SAVE_BULK_REDACTION_FAIL = '[Redaction] Save bulk Redaction Fail';
|
|
1939
1967
|
var DELETE_REDACTION = '[Redaction] Delete Redaction';
|
|
1940
1968
|
var DELETE_REDACTION_SUCCESS = '[Redaction] Delete Redaction Success';
|
|
1941
1969
|
var DELETE_REDACTION_FAIL = '[Redaction] Delete Redaction Fail';
|
|
@@ -1988,6 +2016,27 @@
|
|
|
1988
2016
|
}
|
|
1989
2017
|
return SaveRedactionFailure;
|
|
1990
2018
|
}());
|
|
2019
|
+
var SaveBulkRedactionFailure = /** @class */ (function () {
|
|
2020
|
+
function SaveBulkRedactionFailure(payload) {
|
|
2021
|
+
this.payload = payload;
|
|
2022
|
+
this.type = SAVE_BULK_REDACTION_FAIL;
|
|
2023
|
+
}
|
|
2024
|
+
return SaveBulkRedactionFailure;
|
|
2025
|
+
}());
|
|
2026
|
+
var SaveBulkRedaction = /** @class */ (function () {
|
|
2027
|
+
function SaveBulkRedaction(payload) {
|
|
2028
|
+
this.payload = payload;
|
|
2029
|
+
this.type = SAVE_BULK_REDACTION;
|
|
2030
|
+
}
|
|
2031
|
+
return SaveBulkRedaction;
|
|
2032
|
+
}());
|
|
2033
|
+
var SaveBulkRedactionSuccess = /** @class */ (function () {
|
|
2034
|
+
function SaveBulkRedactionSuccess(payload) {
|
|
2035
|
+
this.payload = payload;
|
|
2036
|
+
this.type = SAVE_BULK_REDACTION_SUCCESS;
|
|
2037
|
+
}
|
|
2038
|
+
return SaveBulkRedactionSuccess;
|
|
2039
|
+
}());
|
|
1991
2040
|
var DeleteRedaction = /** @class */ (function () {
|
|
1992
2041
|
function DeleteRedaction(payload) {
|
|
1993
2042
|
this.payload = payload;
|
|
@@ -2089,6 +2138,17 @@
|
|
|
2089
2138
|
return Object.assign(Object.assign({}, state), { redactionEntities: redactionEntities_1,
|
|
2090
2139
|
redactionPageEntities: redactionPageEntities });
|
|
2091
2140
|
}
|
|
2141
|
+
case SAVE_BULK_REDACTION_SUCCESS: {
|
|
2142
|
+
var payloadResult = Object.assign.apply(Object, __spread([{}], action.payload.searchRedactions.map(function (x) {
|
|
2143
|
+
var _a;
|
|
2144
|
+
return (_a = {}, _a[x.redactionId] = x, _a);
|
|
2145
|
+
})));
|
|
2146
|
+
var redactionEntities_2 = Object.assign(Object.assign({}, state.redactionEntities), payloadResult);
|
|
2147
|
+
var redactionArray = Object.keys(redactionEntities_2).map(function (key) { return redactionEntities_2[key]; });
|
|
2148
|
+
var redactionPageEntities = StoreUtils.groupByKeyEntities(redactionArray, 'page');
|
|
2149
|
+
return Object.assign(Object.assign({}, state), { redactionEntities: redactionEntities_2,
|
|
2150
|
+
redactionPageEntities: redactionPageEntities });
|
|
2151
|
+
}
|
|
2092
2152
|
case SELECT_REDACTION:
|
|
2093
2153
|
case SELECT_ANNOTATION: {
|
|
2094
2154
|
return Object.assign(Object.assign({}, state), { selectedRedaction: action.payload });
|
|
@@ -2815,7 +2875,7 @@
|
|
|
2815
2875
|
PdfViewerComponent.decorators = [
|
|
2816
2876
|
{ type: i0.Component, args: [{
|
|
2817
2877
|
selector: 'mv-pdf-viewer',
|
|
2818
|
-
template: "<mv-side-bar
|
|
2878
|
+
template: "<mv-side-bar\n *ngIf=\"toolbarEvents.sidebarOpen\"\n id=\"sidebarContainer\"\n [url]=\"url\"\n [zoom]=\"zoom\"\n [rotate]=\"rotation\"\n [outline]=\"documentOutline\"\n [annotationsEnabled]=\"enableAnnotations\"\n [currentPageNumber]=\"getCurrentPageNumber()\"\n>\n</mv-side-bar>\n<mv-comment-set-header\n *ngIf=\"enableAnnotations\"\n [ngClass]=\"{ 'show-comments-panel': showCommentsPanel }\"\n [showCommentSummary]=\"toolbarButtons.showCommentSummary\"\n (showCommentSummaryDialog)=\"toggleCommentsSummary()\"\n>\n</mv-comment-set-header>\n<mv-participants-list></mv-participants-list>\n<div\n class=\"pdfContainer\"\n [ngStyle]=\"{ height: height }\"\n [ngClass]=\"{ pdfContainer: true, hidden: errorMessage }\"\n>\n <mv-redaction-search-bar></mv-redaction-search-bar>\n <div\n #viewerContainer\n mvGrabNDrag\n [dragX]=\"viewerContainer\"\n [dragEnabled]=\"enableGrabNDrag\"\n id=\"viewerContainer\"\n class=\"viewer-container\"\n [class.annotations]=\"enableAnnotations\"\n [class.show-comments-panel]=\"\n (showCommentsPanel || showIcpParticipantsList) &&\n !(toolbarEvents.redactionMode | async)\n \"\n [class.grabNDrag]=\"enableGrabNDrag\"\n >\n <div\n #pdfViewer\n class=\"pdfViewer\"\n mvCreateTextHighlight\n [ngClass]=\"{\n hidden: loadingDocument,\n highlightMode: highlightMode | async,\n drawMode: drawMode | async\n }\"\n ></div>\n <mv-redactions\n *ngIf=\"toolbarEvents.redactionMode | async; else annotationTemplate\"\n [zoom]=\"zoom\"\n [rotate]=\"rotation\"\n ></mv-redactions>\n <ng-template #annotationTemplate>\n <mv-metadata-layer\n *ngIf=\"enableAnnotations && annotationSet\"\n [zoom]=\"zoom\"\n [rotate]=\"rotation\"\n >\n </mv-metadata-layer>\n <mv-bookmark-icons [zoom]=\"zoom\" [rotate]=\"rotation\"> </mv-bookmark-icons>\n </ng-template>\n </div>\n <mv-comment-set\n [contentScrollTop]=\"viewerContainer.scrollTop\"\n *ngIf=\"\n enableAnnotations &&\n annotationSet &&\n !(toolbarEvents.redactionMode | async)\n \"\n [annotationSet]=\"annotationSet\"\n [zoom]=\"zoom\"\n [rotate]=\"rotation\"\n [height]=\"pdfViewer.offsetHeight\"\n [pageHeights]=\"pageHeights\"\n >\n </mv-comment-set>\n <div class=\"loadingMessage\" *ngIf=\"loadingDocument\">\n <h3 class=\"govuk-heading-m\">\n Loading...{{\n loadingDocumentProgress ? loadingDocumentProgress + \"%\" : \"\"\n }}\n </h3>\n </div>\n</div>\n",
|
|
2819
2879
|
encapsulation: i0.ViewEncapsulation.None
|
|
2820
2880
|
},] }
|
|
2821
2881
|
];
|
|
@@ -2841,6 +2901,7 @@
|
|
|
2841
2901
|
enableRedactions: [{ type: i0.Input }],
|
|
2842
2902
|
enableICP: [{ type: i0.Input }],
|
|
2843
2903
|
annotationSet: [{ type: i0.Input }],
|
|
2904
|
+
enableRedactSearch: [{ type: i0.Input }],
|
|
2844
2905
|
height: [{ type: i0.Input }],
|
|
2845
2906
|
caseId: [{ type: i0.Input }],
|
|
2846
2907
|
viewerContainer: [{ type: i0.ViewChild, args: ['viewerContainer', { static: true },] }],
|
|
@@ -3018,7 +3079,7 @@
|
|
|
3018
3079
|
ImageViewerComponent.decorators = [
|
|
3019
3080
|
{ type: i0.Component, args: [{
|
|
3020
3081
|
selector: 'mv-image-viewer',
|
|
3021
|
-
template: "<mv-comment-set-header [ngClass]=\"{'show-comments-panel': showCommentsPanel}\"\n [showCommentSummary]=\"toolbarButtons.showCommentSummary\"\n (showCommentSummaryDialog)=\"toggleCommentsSummary()\">\n</mv-comment-set-header>\n<div
|
|
3082
|
+
template: "<mv-comment-set-header [ngClass]=\"{'show-comments-panel': showCommentsPanel}\"\n [showCommentSummary]=\"toolbarButtons.showCommentSummary\"\n (showCommentSummaryDialog)=\"toggleCommentsSummary()\">\n</mv-comment-set-header>\n<div id=\"viewer-wrapper\"\n [ngStyle]=\"{ height: height }\"\n [ngClass]=\"{ 'grabNDrag': enableGrabNDrag }\"\n *ngIf=\"url && !errorMessage\">\n <div #imageContainer id=\"image-container\"\n mvGrabNDrag [dragX]=\"imageContainer\" [dragEnabled]=\"enableGrabNDrag\"\n (scroll)=\"$event\"\n [ngClass]=\"{ 'image-container': true, 'annotations': enableAnnotations, 'show-comments-panel': showCommentsPanel }\">\n <img #img\n [src]=\"url\"\n [ngClass]=\"'rot' + rotation\"\n (error)=\"onLoadError(url)\"\n (load)=\"onLoad(img)\"/>\n <mv-redactions *ngIf=\"(toolbarEvents.redactionMode | async);else annotationTemplate\"\n [zoom]=\"zoom\"\n [rotate]=\"rotation\"\n ></mv-redactions>\n <ng-template #annotationTemplate>\n <mv-metadata-layer *ngIf=\"enableAnnotations && annotationSet\"\n [zoom]=\"zoom\"\n [rotate]=\"rotation\">\n </mv-metadata-layer>\n </ng-template>\n </div>\n\n <mv-comment-set [contentScrollTop]=\"imageContainer.scrollTop\"\n *ngIf=\"enableAnnotations && annotationSet && !(toolbarEvents.redactionMode | async)\"\n [annotationSet]=\"annotationSet\"\n [zoom]=\"zoom\"\n [rotate]=\"rotation\"\n [height]=\"imageHeight\">\n </mv-comment-set>\n</div>\n"
|
|
3022
3083
|
},] }
|
|
3023
3084
|
];
|
|
3024
3085
|
/** @nocollapse */
|
|
@@ -3167,6 +3228,7 @@
|
|
|
3167
3228
|
var CommentService = /** @class */ (function () {
|
|
3168
3229
|
function CommentService() {
|
|
3169
3230
|
this.unsavedChanges = new rxjs.Subject();
|
|
3231
|
+
this.marginToCommentEmitter = new rxjs.BehaviorSubject(false);
|
|
3170
3232
|
}
|
|
3171
3233
|
CommentService.prototype.setCommentSet = function (commentSetComponent) {
|
|
3172
3234
|
this.commentSetComponent = commentSetComponent;
|
|
@@ -3199,6 +3261,9 @@
|
|
|
3199
3261
|
CommentService.prototype.allCommentsSaved = function () {
|
|
3200
3262
|
this.onCommentChange(this.commentSetComponent.commentComponents.some(function (comment) { return comment.hasUnsavedChanges === true; }));
|
|
3201
3263
|
};
|
|
3264
|
+
CommentService.prototype.createMarginToCommentEvent = function (margin) {
|
|
3265
|
+
this.marginToCommentEmitter.next(margin);
|
|
3266
|
+
};
|
|
3202
3267
|
return CommentService;
|
|
3203
3268
|
}());
|
|
3204
3269
|
CommentService.decorators = [
|
|
@@ -3334,6 +3399,7 @@
|
|
|
3334
3399
|
this.enableRedactions = false;
|
|
3335
3400
|
this.enableICP = false;
|
|
3336
3401
|
this.multimediaPlayerEnabled = false;
|
|
3402
|
+
this.enableRedactSearch = false;
|
|
3337
3403
|
this.multimediaContent = false;
|
|
3338
3404
|
this.convertibleContent = false;
|
|
3339
3405
|
this.unsupportedContent = false;
|
|
@@ -3459,7 +3525,7 @@
|
|
|
3459
3525
|
MediaViewerComponent.decorators = [
|
|
3460
3526
|
{ type: i0.Component, args: [{
|
|
3461
3527
|
selector: 'mv-media-viewer',
|
|
3462
|
-
template: "<div
|
|
3528
|
+
template: "<div\n id=\"outerContainer\"\n [ngClass]=\"{\n 'has-redact-bar': toolbarEvents.redactionMode | async,\n 'icp-mode': toolbarEvents.icp.enabled | async,\n 'is-redaction-preview': toolbarEvents.redactionPreview | async,\n sidebarOpen: toolbarEvents.sidebarOpen | async,\n 'has-scroll-bar': hasScrollBar,\n 'has-different-page-size': hasDifferentPageSize$ | async\n }\"\n [ngStyle]=\"{ width: width }\"\n>\n <mv-comments-summary\n *ngIf=\"showCommentSummary\"\n [title]=\"documentTitle || 'Comment Summary'\"\n [contentType]=\"contentType\"\n >\n </mv-comments-summary>\n\n <mv-confirm-action\n *ngIf=\"toolbarEvents.icp.leavingSession | async\"\n ></mv-confirm-action>\n\n <div id=\"mainContainer\">\n <mv-main-toolbar\n *ngIf=\"showToolbar\"\n [enableAnnotations]=\"enableAnnotations\"\n [enableICP]=\"enableICP\"\n [enableRedactions]=\"enableRedactions\"\n [contentType]=\"contentType\"\n >\n </mv-main-toolbar>\n <mv-redaction-toolbar\n [showRedactSearch]=\"enableRedactSearch\"\n *ngIf=\"toolbarEvents.redactionMode | async\"\n ></mv-redaction-toolbar>\n <mv-icp-toolbar *ngIf=\"toolbarEvents.icp.enabled | async\"></mv-icp-toolbar>\n\n <div #viewerRef>\n <mv-conversion-viewer\n *ngIf=\"convertibleContent\"\n (documentTitle)=\"onDocumentTitleChange($event)\"\n (mediaLoadStatus)=\"onMediaLoad($event)\"\n (viewerException)=\"onLoadException($event)\"\n [enableAnnotations]=\"enableAnnotations\"\n [enableRedactions]=\"enableRedactions\"\n [annotationSet]=\"enableAnnotations ? (annotationSet$ | async) : null\"\n [originalUrl]=\"url\"\n [downloadFileName]=\"downloadFileName\"\n [height]=\"viewerHeight\"\n mvRotationPersist\n >\n </mv-conversion-viewer>\n <mv-pdf-viewer\n *ngIf=\"contentType === 'pdf'\"\n #pdfViewer\n (mediaLoadStatus)=\"onMediaLoad($event)\"\n (pdfViewerException)=\"onLoadException($event)\"\n (documentTitle)=\"onDocumentTitleChange($event)\"\n [url]=\"url\"\n [enableAnnotations]=\"enableAnnotations\"\n [enableRedactions]=\"enableRedactions\"\n [enableICP]=\"enableICP\"\n [annotationSet]=\"enableAnnotations ? (annotationSet$ | async) : null\"\n [downloadFileName]=\"downloadFileName\"\n [height]=\"viewerHeight\"\n [caseId]=\"caseId\"\n mvRotationPersist\n >\n </mv-pdf-viewer>\n <mv-image-viewer\n *ngIf=\"contentType === 'image'\"\n (mediaLoadStatus)=\"onMediaLoad($event)\"\n (imageViewerException)=\"onLoadException($event)\"\n [url]=\"url\"\n [enableAnnotations]=\"enableAnnotations\"\n [annotationSet]=\"enableAnnotations ? (annotationSet$ | async) : null\"\n [downloadFileName]=\"downloadFileName\"\n [height]=\"viewerHeight\"\n mvRotationPersist\n >\n </mv-image-viewer>\n <mv-multimedia-player\n *ngIf=\"multimediaContent\"\n [multimediaOn]=\"multimediaPlayerEnabled\"\n [url]=\"url\"\n [downloadFileName]=\"downloadFileName\"\n (loadStatus)=\"onMediaLoad($event)\"\n >\n </mv-multimedia-player>\n <mv-unsupported-viewer\n *ngIf=\"unsupportedContent\"\n [url]=\"url\"\n [typeException]=\"typeException\"\n [downloadFileName]=\"downloadFileName\"\n (loadStatus)=\"onMediaLoad($event)\"\n (unsupportedViewerException)=\"onLoadException($event)\"\n >\n </mv-unsupported-viewer>\n </div>\n </div>\n</div>\n",
|
|
3463
3529
|
encapsulation: i0.ViewEncapsulation.None
|
|
3464
3530
|
},] }
|
|
3465
3531
|
];
|
|
@@ -3491,9 +3557,270 @@
|
|
|
3491
3557
|
enableRedactions: [{ type: i0.Input }],
|
|
3492
3558
|
enableICP: [{ type: i0.Input }],
|
|
3493
3559
|
multimediaPlayerEnabled: [{ type: i0.Input }],
|
|
3560
|
+
enableRedactSearch: [{ type: i0.Input }],
|
|
3494
3561
|
caseId: [{ type: i0.Input }]
|
|
3495
3562
|
};
|
|
3496
3563
|
|
|
3564
|
+
var HighlightCreateService = /** @class */ (function () {
|
|
3565
|
+
function HighlightCreateService(toolBarEvents, store) {
|
|
3566
|
+
this.toolBarEvents = toolBarEvents;
|
|
3567
|
+
this.store = store;
|
|
3568
|
+
}
|
|
3569
|
+
HighlightCreateService.prototype.saveAnnotation = function (rectangles, page) {
|
|
3570
|
+
var _this = this;
|
|
3571
|
+
this.store.pipe(store.select(getDocumentIdSetId), operators.take(1)).subscribe(function (anoSetDocId) {
|
|
3572
|
+
var anno = Object.assign(Object.assign({ id: uuid$1.v4(), color: 'FFFF00', comments: [], page: page, rectangles: rectangles, type: 'highlight' }, anoSetDocId), { createdBy: '', createdByDetails: undefined, createdDate: moment__default["default"].utc().tz('Europe/London').toISOString(), lastModifiedBy: '', lastModifiedByDetails: undefined, lastModifiedDate: '', tags: [] });
|
|
3573
|
+
_this.store.dispatch(new SaveAnnotation(anno));
|
|
3574
|
+
});
|
|
3575
|
+
};
|
|
3576
|
+
HighlightCreateService.prototype.applyRotation = function (pageHeight, pageWidth, offsetHeight, offsetWidth, offsetTop, offsetLeft, rotate, zoom) {
|
|
3577
|
+
var _a = {
|
|
3578
|
+
x: +(offsetLeft / zoom).toFixed(2),
|
|
3579
|
+
y: +(offsetTop / zoom).toFixed(2),
|
|
3580
|
+
width: +(offsetWidth / zoom).toFixed(2),
|
|
3581
|
+
height: +(offsetHeight / zoom).toFixed(2)
|
|
3582
|
+
}, x = _a.x, y = _a.y, width = _a.width, height = _a.height;
|
|
3583
|
+
var rectangle = { x: x, y: y, width: width, height: height };
|
|
3584
|
+
switch (rotate) {
|
|
3585
|
+
case 90:
|
|
3586
|
+
rectangle.width = height;
|
|
3587
|
+
rectangle.height = width;
|
|
3588
|
+
rectangle.x = y;
|
|
3589
|
+
rectangle.y = +(pageWidth / zoom - x - width).toFixed(2);
|
|
3590
|
+
break;
|
|
3591
|
+
case 180:
|
|
3592
|
+
rectangle.x = +(pageWidth / zoom - x - width).toFixed(2);
|
|
3593
|
+
rectangle.y = +(pageHeight / zoom - y - height).toFixed(2);
|
|
3594
|
+
break;
|
|
3595
|
+
case 270:
|
|
3596
|
+
rectangle.width = height;
|
|
3597
|
+
rectangle.height = width;
|
|
3598
|
+
rectangle.x = +(pageHeight / zoom - y - height).toFixed(2);
|
|
3599
|
+
rectangle.y = x;
|
|
3600
|
+
break;
|
|
3601
|
+
}
|
|
3602
|
+
return rectangle;
|
|
3603
|
+
};
|
|
3604
|
+
HighlightCreateService.prototype.resetHighlight = function () {
|
|
3605
|
+
window.getSelection().removeAllRanges();
|
|
3606
|
+
this.toolBarEvents.highlightModeSubject.next(false);
|
|
3607
|
+
};
|
|
3608
|
+
return HighlightCreateService;
|
|
3609
|
+
}());
|
|
3610
|
+
HighlightCreateService.decorators = [
|
|
3611
|
+
{ type: i0.Injectable }
|
|
3612
|
+
];
|
|
3613
|
+
/** @nocollapse */
|
|
3614
|
+
HighlightCreateService.ctorParameters = function () { return [
|
|
3615
|
+
{ type: ToolbarEventService },
|
|
3616
|
+
{ type: store.Store }
|
|
3617
|
+
]; };
|
|
3618
|
+
|
|
3619
|
+
var RedactionSearchBarComponent = /** @class */ (function () {
|
|
3620
|
+
function RedactionSearchBarComponent(store, toolbarButtons, toolbarEvents, highlightService) {
|
|
3621
|
+
this.store = store;
|
|
3622
|
+
this.toolbarButtons = toolbarButtons;
|
|
3623
|
+
this.toolbarEvents = toolbarEvents;
|
|
3624
|
+
this.highlightService = highlightService;
|
|
3625
|
+
this.highlightAll = true;
|
|
3626
|
+
this.matchCase = false;
|
|
3627
|
+
this.wholeWord = false;
|
|
3628
|
+
this.resultsText = '';
|
|
3629
|
+
this.searchText = '';
|
|
3630
|
+
this.resultCount = 0;
|
|
3631
|
+
this.redactElements = [];
|
|
3632
|
+
this.advancedSearchVisible = false;
|
|
3633
|
+
}
|
|
3634
|
+
RedactionSearchBarComponent.prototype.ngOnInit = function () {
|
|
3635
|
+
var _this = this;
|
|
3636
|
+
this.subscription = this.toolbarEvents.redactionSerachSubject.subscribe(function (results) { return _this.redactAllSearched(results); });
|
|
3637
|
+
this.subscription.add(this.store.pipe(store.select(getDocumentId)).subscribe(function (docId) { return _this.documentId = docId; }));
|
|
3638
|
+
this.subscription.add(this.store.pipe(store.select(getPages)).subscribe(function (pages) {
|
|
3639
|
+
if (pages[1]) {
|
|
3640
|
+
_this.allPages = pages;
|
|
3641
|
+
}
|
|
3642
|
+
}));
|
|
3643
|
+
this.subscription.add(this.toolbarEvents.searchResultsCountSubject.subscribe(function (results) { return _this.setSearchResultsCount(results); }));
|
|
3644
|
+
this.subscription.add(this.toolbarEvents.openRedactionSearch.subscribe(function (isOpen) { return _this.openSearchModal = isOpen; }));
|
|
3645
|
+
this.subscription.add(this.toolbarEvents.redactAllInProgressSubject
|
|
3646
|
+
.subscribe(function (inProgress) { return _this.redactAllInProgress = inProgress; }));
|
|
3647
|
+
};
|
|
3648
|
+
RedactionSearchBarComponent.prototype.ngOnDestroy = function () {
|
|
3649
|
+
this.subscription.unsubscribe();
|
|
3650
|
+
};
|
|
3651
|
+
RedactionSearchBarComponent.prototype.onWindowKeyDown = function (e) {
|
|
3652
|
+
var _this = this;
|
|
3653
|
+
if (e.code === 'F3' || (e.ctrlKey && e.code === 'KeyF')) {
|
|
3654
|
+
e.preventDefault();
|
|
3655
|
+
this.toolbarEvents.searchBarHidden.next(false);
|
|
3656
|
+
setTimeout(function () { return _this.findInput.nativeElement.focus(); }, 200);
|
|
3657
|
+
}
|
|
3658
|
+
};
|
|
3659
|
+
RedactionSearchBarComponent.prototype.search = function (reset) {
|
|
3660
|
+
if (reset === void 0) { reset = true; }
|
|
3661
|
+
this.redactAll = !reset;
|
|
3662
|
+
if (this.redactAll) {
|
|
3663
|
+
this.toolbarEvents.redactAllInProgressSubject.next(true);
|
|
3664
|
+
}
|
|
3665
|
+
if (reset) {
|
|
3666
|
+
this.redactElements = [];
|
|
3667
|
+
}
|
|
3668
|
+
this.toolbarEvents.search({
|
|
3669
|
+
searchTerm: this.searchText,
|
|
3670
|
+
highlightAll: this.highlightAll,
|
|
3671
|
+
matchCase: this.matchCase,
|
|
3672
|
+
wholeWord: this.wholeWord,
|
|
3673
|
+
previous: false,
|
|
3674
|
+
reset: reset
|
|
3675
|
+
});
|
|
3676
|
+
};
|
|
3677
|
+
RedactionSearchBarComponent.prototype.saveRedaction = function (redactRectangle) {
|
|
3678
|
+
var _this = this;
|
|
3679
|
+
var redaction = redactRectangle.map(function (ele) {
|
|
3680
|
+
return { page: ele.page, rectangles: ele.rectangles, redactionId: uuid__default$1["default"](), documentId: _this.documentId };
|
|
3681
|
+
});
|
|
3682
|
+
this.store.dispatch(new SaveBulkRedaction({ searchRedactions: redaction }));
|
|
3683
|
+
};
|
|
3684
|
+
RedactionSearchBarComponent.prototype.existInRedactElements = function (pageNumber, matechedIndex, rectangles) {
|
|
3685
|
+
if (this.redactElements && this.redactElements.length > 0) {
|
|
3686
|
+
var pagesFound = this.redactElements.find(function (re) { return re.page === pageNumber && re.matchedIndex === matechedIndex; });
|
|
3687
|
+
var pageRectangles = pagesFound === null || pagesFound === void 0 ? void 0 : pagesFound.rectangles;
|
|
3688
|
+
if (!pageRectangles || pageRectangles.length <= 0) {
|
|
3689
|
+
return false;
|
|
3690
|
+
}
|
|
3691
|
+
var matchesRectangles = 0;
|
|
3692
|
+
var _loop_1 = function (rectIndx) {
|
|
3693
|
+
var rectangle = pageRectangles[rectIndx];
|
|
3694
|
+
var foundRectangle = rectangles.find(function (re) { return re.width === rectangle.width &&
|
|
3695
|
+
re.height === rectangle.height && re.x === rectangle.x && re.y === rectangle.y; });
|
|
3696
|
+
if (foundRectangle) {
|
|
3697
|
+
matchesRectangles++;
|
|
3698
|
+
}
|
|
3699
|
+
};
|
|
3700
|
+
for (var rectIndx = 0; rectIndx < pageRectangles.length; rectIndx++) {
|
|
3701
|
+
_loop_1(rectIndx);
|
|
3702
|
+
}
|
|
3703
|
+
return pageRectangles.length === matchesRectangles;
|
|
3704
|
+
}
|
|
3705
|
+
return false;
|
|
3706
|
+
};
|
|
3707
|
+
RedactionSearchBarComponent.prototype.onCloseSearchModal = function () {
|
|
3708
|
+
this.toolbarEvents.openRedactionSearch.next(false);
|
|
3709
|
+
};
|
|
3710
|
+
RedactionSearchBarComponent.prototype.setSearchResultsCount = function (results) {
|
|
3711
|
+
this.resultCount = results.total;
|
|
3712
|
+
this.resultsText = this.resultCount > 0
|
|
3713
|
+
? results.total + " results founds"
|
|
3714
|
+
: 'No results found';
|
|
3715
|
+
};
|
|
3716
|
+
RedactionSearchBarComponent.prototype.redactAllSearched = function (results) {
|
|
3717
|
+
var $this = this;
|
|
3718
|
+
var intervalId = setInterval(function () {
|
|
3719
|
+
var highlightElement = document.getElementsByClassName('highlight selected');
|
|
3720
|
+
if (highlightElement && highlightElement.length > 0) {
|
|
3721
|
+
clearInterval(intervalId);
|
|
3722
|
+
$this.redactAllSearchedTick(results);
|
|
3723
|
+
}
|
|
3724
|
+
}, 100);
|
|
3725
|
+
};
|
|
3726
|
+
RedactionSearchBarComponent.prototype.redactAllSearchedTick = function (results) {
|
|
3727
|
+
var highlightElement = document.getElementsByClassName('highlight selected');
|
|
3728
|
+
if (highlightElement && highlightElement.length > 0) {
|
|
3729
|
+
this.resultCount = results.matchesCount;
|
|
3730
|
+
var pageNumber = results.page + 1;
|
|
3731
|
+
var rectangles = this.getRectangles(pageNumber);
|
|
3732
|
+
if (rectangles && this.redactElements.length <= this.resultCount
|
|
3733
|
+
&& !this.existInRedactElements(pageNumber, results.matchedIndex, rectangles)) {
|
|
3734
|
+
this.redactElements.push({ page: pageNumber, matchedIndex: results === null || results === void 0 ? void 0 : results.matchedIndex, rectangles: rectangles });
|
|
3735
|
+
this.CreateRedactAllText();
|
|
3736
|
+
}
|
|
3737
|
+
if (this.redactAll && this.resultCount && this.resultCount > 0
|
|
3738
|
+
&& rectangles && this.redactElements.length < this.resultCount) {
|
|
3739
|
+
this.search(false);
|
|
3740
|
+
}
|
|
3741
|
+
if (this.redactAll && this.resultCount && this.redactElements.length === this.resultCount) {
|
|
3742
|
+
this.redactAll = false;
|
|
3743
|
+
this.redactAllText = null;
|
|
3744
|
+
this.saveRedaction(this.redactElements);
|
|
3745
|
+
}
|
|
3746
|
+
}
|
|
3747
|
+
};
|
|
3748
|
+
RedactionSearchBarComponent.prototype.CreateRedactAllText = function () {
|
|
3749
|
+
this.redactAllText = this.redactElements.length + " of " + this.resultCount;
|
|
3750
|
+
};
|
|
3751
|
+
RedactionSearchBarComponent.prototype.onEscapeKeyPress = function (e) {
|
|
3752
|
+
this.toolbarEvents.searchBarHidden.next(true);
|
|
3753
|
+
};
|
|
3754
|
+
RedactionSearchBarComponent.prototype.onEnterKeyPress = function (e) {
|
|
3755
|
+
this.search();
|
|
3756
|
+
};
|
|
3757
|
+
RedactionSearchBarComponent.prototype.toggleSearchBar = function () {
|
|
3758
|
+
this.toolbarEvents.searchBarHidden.next(!this.toolbarEvents.searchBarHidden.getValue());
|
|
3759
|
+
};
|
|
3760
|
+
RedactionSearchBarComponent.prototype.getRectangles = function (page) {
|
|
3761
|
+
this.pageHeight = this.allPages[page].styles.height;
|
|
3762
|
+
this.pageWidth = this.allPages[page].styles.width;
|
|
3763
|
+
this.zoom = parseFloat(this.allPages[page].scaleRotation.scale);
|
|
3764
|
+
this.rotate = parseInt(this.allPages[page].scaleRotation.rotation, 10);
|
|
3765
|
+
var selectedHighLightedElements = document.getElementsByClassName('highlight selected');
|
|
3766
|
+
if (selectedHighLightedElements && selectedHighLightedElements.length > 0) {
|
|
3767
|
+
var docRange = document.createRange();
|
|
3768
|
+
docRange.selectNodeContents(selectedHighLightedElements[0]);
|
|
3769
|
+
var selection = window.getSelection();
|
|
3770
|
+
selection === null || selection === void 0 ? void 0 : selection.removeAllRanges();
|
|
3771
|
+
selection === null || selection === void 0 ? void 0 : selection.addRange(docRange);
|
|
3772
|
+
if (selection.rangeCount && !selection.isCollapsed) {
|
|
3773
|
+
var range = selection.getRangeAt(0).cloneRange();
|
|
3774
|
+
var clientRects = range.getClientRects();
|
|
3775
|
+
if (clientRects) {
|
|
3776
|
+
var parentRect = selectedHighLightedElements[0].parentElement.parentElement.getBoundingClientRect();
|
|
3777
|
+
var selectionRectangles = [];
|
|
3778
|
+
var _loop_2 = function (i) {
|
|
3779
|
+
var selectionRectangle = this_1.createTextRectangle(clientRects[i], parentRect);
|
|
3780
|
+
var findSelecttionRectangle = selectionRectangles.find(function (rect) { return rect.width === selectionRectangle.width && rect.x === selectionRectangle.x; });
|
|
3781
|
+
if (!findSelecttionRectangle) {
|
|
3782
|
+
selectionRectangles.push(selectionRectangle);
|
|
3783
|
+
}
|
|
3784
|
+
};
|
|
3785
|
+
var this_1 = this;
|
|
3786
|
+
for (var i = 0; i < clientRects.length; i++) {
|
|
3787
|
+
_loop_2(i);
|
|
3788
|
+
}
|
|
3789
|
+
return selectionRectangles;
|
|
3790
|
+
}
|
|
3791
|
+
}
|
|
3792
|
+
}
|
|
3793
|
+
};
|
|
3794
|
+
RedactionSearchBarComponent.prototype.createTextRectangle = function (rect, parentRect) {
|
|
3795
|
+
var height = rect.bottom - rect.top;
|
|
3796
|
+
var width = rect.right - rect.left;
|
|
3797
|
+
var top = rect.top - parentRect.top;
|
|
3798
|
+
var left = rect.left - parentRect.left;
|
|
3799
|
+
var rectangle = this.highlightService.applyRotation(this.pageHeight, this.pageWidth, height, width, top, left, this.rotate, this.zoom);
|
|
3800
|
+
rectangle = Object.assign({ id: uuid__default$1["default"]() }, rectangle);
|
|
3801
|
+
return rectangle;
|
|
3802
|
+
};
|
|
3803
|
+
return RedactionSearchBarComponent;
|
|
3804
|
+
}());
|
|
3805
|
+
RedactionSearchBarComponent.decorators = [
|
|
3806
|
+
{ type: i0.Component, args: [{
|
|
3807
|
+
selector: 'mv-redaction-search-bar',
|
|
3808
|
+
template: "<div\n *ngIf=\"openSearchModal\"\n class=\"searchbar redaction-search-bar govuk-!-padding-3\"\n>\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full govuk-!-padding-right-0\">\n <div class=\"redaction-search-buttons-area\">\n <button\n id=\"mvCloseBtn\"\n #mvCloseBtn\n class=\"mv-button searchbar-button--close\"\n title=\"Close Search\"\n data-l10n-id=\"mvRedactBtn\"\n (click)=\"onCloseSearchModal()\"\n ></button>\n </div>\n <input\n id=\"search_input\"\n class=\"govuk-input govuk-!-width-three-quarters govuk-!-display-inline-block govuk-!-margin-top-5\"\n type=\"text\"\n aria-label=\"Find in document\"\n #findInput\n title=\"Find in document\"\n placeholder=\"Redact from search...\"\n tabindex=\"0\"\n data-l10n-id=\"search_input\"\n [(ngModel)]=\"searchText\"\n (keydown.escape)=\"onEscapeKeyPress($event)\"\n (keydown.enter)=\"onEnterKeyPress($event)\"\n />\n <div class=\"redaction-search-buttons-area\">\n <button\n id=\"mvSearchAllBtn\"\n class=\"govuk-button govuk-!-margin-bottom-0\"\n data-module=\"govuk-button\"\n (click)=\"search()\"\n [disabled]=\"redactAllInProgress\"\n >\n Search\n </button>\n <button\n id=\"mvRedactAllBtn\"\n class=\"govuk-button govuk-!-margin-left-2 govuk-!-margin-bottom-0\"\n data-module=\"govuk-button\"\n (click)=\"search(false)\"\n [disabled]=\"redactAllInProgress\"\n >\n Redact all\n </button>\n </div>\n <div\n class=\"govuk-grid-column-three-quarters govuk-!-padding-left-0 govuk-!-padding-top-2 redaction-status-text\"\n >\n <span\n id=\"findRedactResultsCount\"\n class=\"govuk-grid-column-full govuk-!-margin-right-4 govuk-!-margin-left-0 govuk-!-padding-left-0\"\n ><h4\n class=\"govuk-!-display-inline-block govuk-!-margin-top-0 govuk-!-margin-bottom-1\"\n *ngIf=\"redactAllInProgress\"\n >\n Redacting in progress\n </h4>\n {{ redactAllInProgress ? \"\" : resultsText }}</span\n >\n <span>\n <h5\n id=\"redactAllInProgressCount\"\n class=\"govuk-!-display-inline-block govuk-!-margin-top-0 govuk-!-margin-bottom-1\"\n >\n {{ redactAllInProgress ? redactAllText : \"\" }}\n </h5>\n </span>\n </div>\n </div>\n </div>\n</div>\n",
|
|
3809
|
+
styles: [".redaction-search-buttons-area{display:flex;flex-direction:row;padding-top:.5rem}.redaction-search-bar{width:20rem;left:73%;top:2%}.redaction-status-text{height:2.6rem}"]
|
|
3810
|
+
},] }
|
|
3811
|
+
];
|
|
3812
|
+
/** @nocollapse */
|
|
3813
|
+
RedactionSearchBarComponent.ctorParameters = function () { return [
|
|
3814
|
+
{ type: store.Store },
|
|
3815
|
+
{ type: ToolbarButtonVisibilityService },
|
|
3816
|
+
{ type: ToolbarEventService },
|
|
3817
|
+
{ type: HighlightCreateService }
|
|
3818
|
+
]; };
|
|
3819
|
+
RedactionSearchBarComponent.propDecorators = {
|
|
3820
|
+
findInput: [{ type: i0.ViewChild, args: ['findInput', { static: true },] }],
|
|
3821
|
+
onWindowKeyDown: [{ type: i0.HostListener, args: ['window:keydown', ['$event'],] }]
|
|
3822
|
+
};
|
|
3823
|
+
|
|
3497
3824
|
/**
|
|
3498
3825
|
* Number Helper Service
|
|
3499
3826
|
* */
|
|
@@ -3556,6 +3883,8 @@
|
|
|
3556
3883
|
}
|
|
3557
3884
|
}), this.toolbarEvents.redactionMode.subscribe(function (enabled) {
|
|
3558
3885
|
_this.redactionEnabled = enabled;
|
|
3886
|
+
}), this.toolbarEvents.redactAllInProgressSubject.subscribe(function (disable) {
|
|
3887
|
+
_this.redactAllInProgress = disable;
|
|
3559
3888
|
}));
|
|
3560
3889
|
};
|
|
3561
3890
|
MainToolbarComponent.prototype.ngOnDestroy = function () {
|
|
@@ -3591,8 +3920,21 @@
|
|
|
3591
3920
|
MainToolbarComponent.prototype.onClickDrawToggle = function () {
|
|
3592
3921
|
this.toolbarEvents.toggleDrawMode();
|
|
3593
3922
|
};
|
|
3594
|
-
MainToolbarComponent.prototype.
|
|
3595
|
-
|
|
3923
|
+
MainToolbarComponent.prototype.toggleIndexSideBar = function () {
|
|
3924
|
+
var sidebarOpen = this.toolbarEvents.sidebarOpen.getValue();
|
|
3925
|
+
var sidebarView = this.toolbarEvents.sidebarOutlineView.getValue();
|
|
3926
|
+
if (!(sidebarOpen && !sidebarView)) {
|
|
3927
|
+
this.toolbarEvents.toggleSideBar(!sidebarOpen);
|
|
3928
|
+
}
|
|
3929
|
+
this.toolbarEvents.toggleSideBarView(true);
|
|
3930
|
+
};
|
|
3931
|
+
MainToolbarComponent.prototype.toggleBookmarksSideBar = function () {
|
|
3932
|
+
var sidebarOpen = this.toolbarEvents.sidebarOpen.getValue();
|
|
3933
|
+
var sidebarView = this.toolbarEvents.sidebarOutlineView.getValue();
|
|
3934
|
+
if (!(sidebarOpen && sidebarView)) {
|
|
3935
|
+
this.toolbarEvents.toggleSideBar(!sidebarOpen);
|
|
3936
|
+
}
|
|
3937
|
+
this.toolbarEvents.toggleSideBarView(false);
|
|
3596
3938
|
};
|
|
3597
3939
|
MainToolbarComponent.prototype.togglePresentBar = function () {
|
|
3598
3940
|
this.toolbarEvents.searchBarHidden.next(true);
|
|
@@ -3661,7 +4003,7 @@
|
|
|
3661
4003
|
MainToolbarComponent.decorators = [
|
|
3662
4004
|
{ type: i0.Component, args: [{
|
|
3663
4005
|
selector: 'mv-main-toolbar',
|
|
3664
|
-
template: "<div class=\"toolbar\">\n <div id=\"toolbarContainer\">\n <div class=\"mv-toolbar__container\">\n <div #mvToolbar class=\"mv-toolbar\" [class.notSupported]=\"!contentType\">\n <!-- The mvToolbarMain div contains all toolbar buttons except the \"More options\" button. This allows for calculation of the available space to display buttons -->\n <div id=\"mvToolbarMain\" class=\"mv-toolbar-main\" #mvToolbarMain>\n <ng-container *ngTemplateOutlet=\"menuItems\"></ng-container>\n </div>\n <!-- The mvToolbarMoreOptions div contains the \"More options\" toolbar button (and the overlay template for the dropdown menu).\n The space occupied by the button (if visible) is excluded from the toolbar space available calculation -->\n <div id=\"mvToolbarMoreOptions\" class=\"mv-toolbar-more-options\">\n <button id=\"mvMoreOptionsBtn\" class=\"mv-button mv-toolbar__menu-button--more-options\"\n [class.mv-toolbar__menu-button--more-options__hidden]=\"mvToolbar.offsetWidth >= allButtonsWidth\" aria-pressed=\"false\"\n (click)=\"toggleMoreOptions()\" cdkOverlayOrigin #trigger=\"cdkOverlayOrigin\">\n <span>More options</span>\n </button>\n <!-- This template displays the overlay content for the dropdown menu and is connected to the \"More options\" button -->\n <ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isDropdownMenuOpen\" [cdkConnectedOverlayPositions]=\"dropdownMenuPositions\">\n <div class=\"dropdown-menu\" #dropdownMenu tabindex=\"0\">\n <ng-container *ngTemplateOutlet=\"menuItems\"></ng-container>\n </div>\n </ng-template>\n </div>\n </div>\n\n <div id=\"mvMenuItems\" #mvMenuItems>\n <ng-template #menuItems>\n\n <button *ngIf=\"toolbarButtons.showSidebar\" id=\"mvIndexBtn\" title=\"Index\" data-l10n-id=\"index\" #mvIndexBtn\n class=\"mv-button mv-toolbar__menu-button--index\"\n [class.button-hidden-on-toolbar]=\"mvToolbarMain.offsetWidth < widthRequiredForBtn['mvIndexBtn']\"\n [class.button-hidden-on-dropdown]=\"mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvIndexBtn']\" aria-pressed=\"false\"\n (click)=\"toggleSideBar(); isDropdownMenuOpen = false\">\n <span>Index</span>\n </button>\n\n <button *ngIf=\"toolbarButtons.showDrawButton\" [disabled]=\"icpEnabled || redactionEnabled\" id=\"mvDrawBtn\"\n #mvDrawBtn class=\"mv-button mv-toolbar__menu-button--draw\" title=\"Draw a box\" tabindex=\"-1\"\n [class.button-hidden-on-toolbar]=\"mvToolbarMain.offsetWidth < widthRequiredForBtn['mvDrawBtn']\"\n [class.button-hidden-on-dropdown]=\"mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvDrawBtn']\"\n [class.toggled]=\"toolbarEvents.drawModeSubject | async\" aria-hidden=\"true\" aria-pressed=\"false\"\n data-l10n-id=\"toggleDrawButton\" (click)=\"onClickDrawToggle(); isDropdownMenuOpen = false\">\n <span data-l10n-id=\"draw_label\">Draw a box</span>\n </button>\n\n <button *ngIf=\"toolbarButtons.showHighlightButton\" [disabled]=\"icpEnabled || redactionEnabled\"\n id=\"mvHighlightBtn\" #mvHighlightBtn class=\"mv-button mv-toolbar__menu-button--highlight\" title=\"Highlight\"\n tabindex=\"-1\" [class.button-hidden-on-toolbar]=\"mvToolbarMain.offsetWidth < widthRequiredForBtn['mvHighlightBtn']\"\n [class.button-hidden-on-dropdown]=\"mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvHighlightBtn']\"\n [class.toggled]=\"toolbarEvents.highlightModeSubject | async\" aria-hidden=\"true\" aria-pressed=\"false\"\n (click)=\"onClickHighlightToggle(); isDropdownMenuOpen = false\" data-l10n-id=\"toggleHighlightButton\">\n <span data-l10n-id=\"highlight_label\">Highlight</span>\n </button>\n\n <ng-container *ngIf=\"toolbarButtons.showNavigation\">\n <div id=\"mvPageBtn\" #mvPageBtn class=\"mv-toolbar__menu-button--page\" aria-pressed=\"false\"\n [class.button-hidden-on-toolbar]=\"mvToolbarMain.offsetWidth < widthRequiredForBtn['mvPageBtn']\"\n [class.button-hidden-on-dropdown]=\"mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvPageBtn']\">\n <span>Page</span>\n\n <button id=\"mvUpBtn\" [disabled]=\"pageNumber === 1\" title=\"Previous Page\"\n class=\"mv-toolbar__menu-button--up button-image\" data-l10n-id=\"previous\"\n (click)=\"decreasePageNumber()\"><span></span></button>\n <button id=\"mvDownBtn\" [disabled]=\"pageNumber === pageCount\" title=\"Next Page\"\n class=\"mv-toolbar__menu-button--down button-image\" data-l10n-id=\"next\"\n (click)=\"increasePageNumber()\"><span></span></button>\n\n <input type=\"number\" id=\"pageNumber\" class=\"hmcts-toolbar-input govuk-input--width-2\" title=\"Page Number\"\n value=\"1\" size=\"4\" min=\"1\" [value]=\"pageNumber\" aria-label=\"page number\" tabindex=\"0\"\n data-l10n-id=\"page\" (change)=\"onPageNumberInputChange(pageNumberInput.value)\" #pageNumberInput>\n <span id=\"numPages\" class=\"toolbarLabel\">/ {{ pageCount }}</span>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"toolbarButtons.showZoom\">\n <div id=\"mvZoomBtn\" #mvZoomBtn class=\"mv-toolbar__menu-button--zoom\" aria-pressed=\"false\"\n [class.button-hidden-on-toolbar]=\"mvToolbarMain.offsetWidth < widthRequiredForBtn['mvZoomBtn']\"\n [class.button-hidden-on-dropdown]=\"mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvZoomBtn']\">\n <button [disabled]=\"toolbarEvents.zoomValueSubject.value == 0.1\" id=\"mvMinusBtn\"\n class=\"mv-toolbar__menu-button--zoom-out button-image\" title=\"Zoom Out\" data-l10n-id=\"zoom_out\"\n (click)=\"stepZoom(-0.1)\"><span></span></button>\n <select id=\"scaleSelect\" class=\"hmcts-toolbar-select\" title=\"Zoom\" tabindex=\"0\" data-l10n-id=\"zoom\"\n (change)=\"zoom($event.target.value)\" aria-label=\"zoom\">\n <option #zoomSelect id=\"customScaleOption\" title=\"\" [value]=\"toolbarEvents.zoomValueSubject.value\">\n {{(toolbarEvents.zoomValueSubject.value) * 100 | number: '1.0-0'}}%</option>\n <option *ngFor=\"let zoomScale of zoomScales\" title=\"\" [value]=\"zoomScale\"\n [attr.data-l10n-id]=\"'page_scale_percent_' + zoomScale*100\">{{ zoomScale *100 }}%\n </option>\n </select>\n\n <button [disabled]=\"toolbarEvents.zoomValueSubject.value == 5\" id=\"mvPlusBtn\"\n class=\"mv-toolbar__menu-button--zoom-in button-image\" (click)=\"stepZoom(0.1)\" title=\"Zoom In\"\n data-l10n-id=\"zoom_in\"><span></span></button>\n </div>\n </ng-container>\n\n <div *ngIf=\"toolbarButtons.showRotate\" id=\"mvRotateBtn\" #mvRotateBtn class=\"mv-toolbar__menu-button--rotate\"\n aria-pressed=\"false\" [class.button-hidden-on-toolbar]=\"mvToolbarMain.offsetWidth < widthRequiredForBtn['mvRotateBtn']\"\n [class.button-hidden-on-dropdown]=\"mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvRotateBtn']\">\n <button id=\"mvRotateLeftBtn\" class=\"mv-toolbar__menu-button--rotate_left button-image\"\n title=\"Rotate Counterclockwise\" data-l10n-id=\"page_rotate_ccw\" (click)=\"rotate(270)\"><span></span>\n </button>\n <button id=\"mvRotateRightBtn\" class=\"mv-toolbar__menu-button--rotate_right button-image\"\n title=\"Rotate Clockwise\" data-l10n-id=\"page_rotate_cw\" (click)=\"rotate(90)\"><span></span>\n </button>\n <span>Rotate</span>\n </div>\n\n <button *ngIf=\"toolbarButtons.showSearchBar\" [disabled]=\"icpEnabled\" id=\"mvSearchBtn\" #mvSearchBtn\n title=\"Search\" data-l10n-id=\"searchbar\" class=\"mv-button mv-toolbar__menu-button--search\"\n [class.button-hidden-on-toolbar]=\"mvToolbarMain.offsetWidth < widthRequiredForBtn['mvSearchBtn']\"\n [class.button-hidden-on-dropdown]=\"mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvSearchBtn']\" aria-pressed=\"false\"\n (click)=\"toggleSearchBar(); isDropdownMenuOpen = false\">\n </button>\n\n <button *ngIf=\"enableICP && toolbarButtons.showPresentationMode && isPdf()\"\n [disabled]=\"icpEnabled || !contentType || redactionEnabled\" id=\"mvPresentBtn\" #mvPresentBtn\n class=\"mv-button mv-toolbar__menu-button--present\" title=\"In-Court Presentation Mode\"\n data-l10n-id=\"icpMode_label\" [class.button-hidden-on-toolbar]=\"mvToolbarMain.offsetWidth < widthRequiredForBtn['mvPresentBtn']\"\n [class.button-hidden-on-dropdown]=\"mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvPresentBtn']\" aria-pressed=\"false\"\n (click)=\"togglePresentBar(); isDropdownMenuOpen = false\"><span data-l10n-id=\"icpMode_label\">Present</span>\n </button>\n\n <button *ngIf=\"enableRedactions && toolbarButtons.showRedact\" [disabled]=\"icpEnabled\" id=\"mvRedactBtn\"\n #mvRedactBtn title=\"Redact\" data-l10n-id=\"redact\" class=\"mv-button mv-toolbar__menu-button--redact\"\n [class.button-hidden-on-toolbar]=\"mvToolbarMain.offsetWidth < widthRequiredForBtn['mvRedactBtn']\"\n [class.button-hidden-on-dropdown]=\"mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvRedactBtn']\" aria-pressed=\"false\"\n (click)=\"toggleRedactBar(); isDropdownMenuOpen = false\">\n <span>Redact</span>\n </button>\n\n <button *ngIf=\"toolbarButtons.showGrabNDragButton\" [disabled]=\"icpEnabled\" id=\"mvGrabBtn\" #mvGrabBtn\n class=\"mv-button mv-toolbar__menu-button--grab\" title=\"Grab and drag\"\n [class.button-hidden-on-toolbar]=\"mvToolbarMain.offsetWidth < widthRequiredForBtn['mvGrabBtn']\"\n [class.button-hidden-on-dropdown]=\"mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvGrabBtn']\" aria-pressed=\"false\"\n (click)=\"toggleGrabNDrag(); isDropdownMenuOpen = false\">\n <span>Grab and drag</span>\n </button>\n\n <button *ngIf=\"toolbarButtons.showDownload\" [disabled]=\"icpEnabled || redactionEnabled\" id=\"mvDownloadBtn\"\n #mvDownloadBtn class=\"mv-button mv-toolbar__menu-button--download\" title=\"Download\" data-l10n-id=\"download\"\n [class.button-hidden-on-toolbar]=\"mvToolbarMain.offsetWidth < widthRequiredForBtn['mvDownloadBtn']\"\n [class.button-hidden-on-dropdown]=\"mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvDownloadBtn']\" aria-pressed=\"false\"\n (click)=\"downloadFile(); isDropdownMenuOpen = false\">\n </button>\n\n <button *ngIf=\"toolbarButtons.showPrint\" [disabled]=\"icpEnabled || redactionEnabled\" id=\"mvPrintBtn\"\n #mvPrintBtn title=\"Print\" data-l10n-id=\"print\" class=\"mv-button mv-toolbar__menu-button--print\"\n [class.button-hidden-on-toolbar]=\"mvToolbarMain.offsetWidth < widthRequiredForBtn['mvPrintBtn']\"\n [class.button-hidden-on-dropdown]=\"mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvPrintBtn']\" aria-pressed=\"false\"\n (click)=\"printFile(); isDropdownMenuOpen = false\">\n </button>\n\n <button *ngIf=\"enableAnnotations && toolbarButtons.showCommentSummary\" [disabled]=\"redactionEnabled\"\n id=\"mvCommentsBtn\" #mvCommentsBtn class=\"mv-button mv-toolbar__menu-button--comments\" title=\"Comments\"\n data-l10n-id=\"comments\" [class.button-hidden-on-toolbar]=\"mvToolbarMain.offsetWidth < widthRequiredForBtn['mvCommentsBtn']\"\n [class.button-hidden-on-dropdown]=\"mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvCommentsBtn']\" aria-pressed=\"false\"\n (click)=\"toggleCommentsPanel(); isDropdownMenuOpen = false\">\n <span>Comments</span>\n </button>\n\n </ng-template>\n </div>\n <mv-search-bar></mv-search-bar>\n </div>\n\n <div id=\"loadingBar\">\n <div class=\"progress\">\n <div class=\"glimmer\">\n </div>\n </div>\n </div>\n </div>\n</div>\n"
|
|
4006
|
+
template: "<div class=\"toolbar\">\n <div id=\"toolbarContainer\">\n <div class=\"mv-toolbar__container\">\n <div #mvToolbar class=\"mv-toolbar\" [class.notSupported]=\"!contentType\">\n <!-- The mvToolbarMain div contains all toolbar buttons except the \"More options\" button. This allows for calculation of the available space to display buttons -->\n <div id=\"mvToolbarMain\" class=\"mv-toolbar-main\" #mvToolbarMain>\n <ng-container *ngTemplateOutlet=\"menuItems\"></ng-container>\n </div>\n <!-- The mvToolbarMoreOptions div contains the \"More options\" toolbar button (and the overlay template for the dropdown menu).\n The space occupied by the button (if visible) is excluded from the toolbar space available calculation -->\n <div id=\"mvToolbarMoreOptions\" class=\"mv-toolbar-more-options\">\n <button\n id=\"mvMoreOptionsBtn\"\n class=\"mv-button mv-toolbar__menu-button--more-options\"\n [class.mv-toolbar__menu-button--more-options__hidden]=\"\n mvToolbar.offsetWidth >= allButtonsWidth\n \"\n aria-pressed=\"false\"\n (click)=\"toggleMoreOptions()\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n [disabled]=\"redactAllInProgress\"\n >\n <span>More options</span>\n </button>\n <!-- This template displays the overlay content for the dropdown menu and is connected to the \"More options\" button -->\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isDropdownMenuOpen\"\n [cdkConnectedOverlayPositions]=\"dropdownMenuPositions\"\n >\n <div class=\"dropdown-menu\" #dropdownMenu tabindex=\"0\">\n <ng-container *ngTemplateOutlet=\"menuItems\"></ng-container>\n </div>\n </ng-template>\n </div>\n </div>\n\n <div id=\"mvMenuItems\" #mvMenuItems>\n <ng-template #menuItems>\n <button\n *ngIf=\"toolbarButtons.showSidebar\"\n id=\"mvIndexBtn\"\n title=\"Index\"\n data-l10n-id=\"index\"\n #mvIndexBtn\n class=\"mv-button mv-toolbar__menu-button--index\"\n [class.button-hidden-on-toolbar]=\"\n mvToolbarMain.offsetWidth < widthRequiredForBtn['mvIndexBtn']\n \"\n [class.button-hidden-on-dropdown]=\"\n mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvIndexBtn']\n \"\n aria-pressed=\"false\"\n [disabled]=\"redactAllInProgress\"\n (click)=\"toggleIndexSideBar(); isDropdownMenuOpen = false\"\n >\n <span>Index</span>\n </button>\n \n <button \n *ngIf=\"toolbarButtons.showSidebar\" \n id=\"mvBookmarksBtn\" \n title=\"Bookmarks\" \n data-l10n-id=\"bookmarks\"\n #mvBookmarksBtn \n [ngClass]=\"{ \n 'mv-button mv-toolbar__menu-button--bookmarks' : true,\n 'button-hidden-on-toolbar': mvToolbarMain.offsetWidth < widthRequiredForBtn['mvBookmarksBtn'],\n 'button-hidden-on-dropdown': mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvBookmarksBtn']\n }\"\n aria-pressed=\"false\"\n [disabled]=\"redactAllInProgress\"\n (click)=\"toggleBookmarksSideBar(); isDropdownMenuOpen = false\"\n >\n <span>Bookmarks</span>\n </button>\n\n <button\n *ngIf=\"toolbarButtons.showDrawButton\"\n [disabled]=\"icpEnabled || redactionEnabled\"\n id=\"mvDrawBtn\"\n #mvDrawBtn\n class=\"mv-button mv-toolbar__menu-button--draw\"\n title=\"Draw a box\"\n tabindex=\"-1\"\n [class.button-hidden-on-toolbar]=\"\n mvToolbarMain.offsetWidth < widthRequiredForBtn['mvDrawBtn']\n \"\n [class.button-hidden-on-dropdown]=\"\n mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvDrawBtn']\n \"\n [class.toggled]=\"toolbarEvents.drawModeSubject | async\"\n aria-hidden=\"true\"\n aria-pressed=\"false\"\n data-l10n-id=\"toggleDrawButton\"\n (click)=\"onClickDrawToggle(); isDropdownMenuOpen = false\"\n >\n <span data-l10n-id=\"draw_label\">Draw a box</span>\n </button>\n\n <button\n *ngIf=\"toolbarButtons.showHighlightButton\"\n [disabled]=\"icpEnabled || redactionEnabled\"\n id=\"mvHighlightBtn\"\n #mvHighlightBtn\n class=\"mv-button mv-toolbar__menu-button--highlight\"\n title=\"Highlight\"\n tabindex=\"-1\"\n [class.button-hidden-on-toolbar]=\"\n mvToolbarMain.offsetWidth < widthRequiredForBtn['mvHighlightBtn']\n \"\n [class.button-hidden-on-dropdown]=\"\n mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvHighlightBtn']\n \"\n [class.toggled]=\"toolbarEvents.highlightModeSubject | async\"\n aria-hidden=\"true\"\n aria-pressed=\"false\"\n (click)=\"onClickHighlightToggle(); isDropdownMenuOpen = false\"\n data-l10n-id=\"toggleHighlightButton\"\n >\n <span data-l10n-id=\"highlight_label\">Highlight</span>\n </button>\n\n <ng-container *ngIf=\"toolbarButtons.showNavigation\">\n <div\n id=\"mvPageBtn\"\n #mvPageBtn\n class=\"mv-toolbar__menu-button--page\"\n aria-pressed=\"false\"\n [class.button-hidden-on-toolbar]=\"\n mvToolbarMain.offsetWidth < widthRequiredForBtn['mvPageBtn']\n \"\n [class.button-hidden-on-dropdown]=\"\n mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvPageBtn']\n \"\n >\n <span>Page</span>\n\n <button\n id=\"mvUpBtn\"\n [disabled]=\"pageNumber === 1 || redactAllInProgress\"\n title=\"Previous Page\"\n class=\"mv-toolbar__menu-button--up button-image\"\n data-l10n-id=\"previous\"\n (click)=\"decreasePageNumber()\"\n [disabled]=\"redactAllInProgress\"\n >\n <span></span>\n </button>\n <button\n id=\"mvDownBtn\"\n [disabled]=\"pageNumber === pageCount || redactAllInProgress\"\n title=\"Next Page\"\n class=\"mv-toolbar__menu-button--down button-image\"\n data-l10n-id=\"next\"\n (click)=\"increasePageNumber()\"\n >\n <span></span>\n </button>\n\n <input\n type=\"number\"\n id=\"pageNumber\"\n class=\"hmcts-toolbar-input govuk-input--width-2\"\n title=\"Page Number\"\n value=\"1\"\n size=\"4\"\n min=\"1\"\n [value]=\"pageNumber\"\n aria-label=\"page number\"\n tabindex=\"0\"\n data-l10n-id=\"page\"\n (change)=\"onPageNumberInputChange(pageNumberInput.value)\"\n [disabled]=\"redactAllInProgress\"\n #pageNumberInput\n />\n <span id=\"numPages\" class=\"toolbarLabel\">/ {{ pageCount }}</span>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"toolbarButtons.showZoom\">\n <div\n id=\"mvZoomBtn\"\n #mvZoomBtn\n class=\"mv-toolbar__menu-button--zoom\"\n aria-pressed=\"false\"\n [class.button-hidden-on-toolbar]=\"\n mvToolbarMain.offsetWidth < widthRequiredForBtn['mvZoomBtn']\n \"\n [class.button-hidden-on-dropdown]=\"\n mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvZoomBtn']\n \"\n >\n <button\n [disabled]=\"\n toolbarEvents.zoomValueSubject.value == 0.1 ||\n redactAllInProgress\n \"\n id=\"mvMinusBtn\"\n class=\"mv-toolbar__menu-button--zoom-out button-image\"\n title=\"Zoom Out\"\n data-l10n-id=\"zoom_out\"\n (click)=\"stepZoom(-0.1)\"\n >\n <span></span>\n </button>\n <select\n id=\"scaleSelect\"\n class=\"hmcts-toolbar-select\"\n title=\"Zoom\"\n tabindex=\"0\"\n data-l10n-id=\"zoom\"\n (change)=\"zoom($event.target.value)\"\n aria-label=\"zoom\"\n [disabled]=\"redactAllInProgress\"\n >\n <option\n #zoomSelect\n id=\"customScaleOption\"\n title=\"\"\n [value]=\"toolbarEvents.zoomValueSubject.value\"\n >\n {{\n toolbarEvents.zoomValueSubject.value * 100\n | number : \"1.0-0\"\n }}%\n </option>\n <option\n *ngFor=\"let zoomScale of zoomScales\"\n title=\"\"\n [value]=\"zoomScale\"\n [attr.data-l10n-id]=\"'page_scale_percent_' + zoomScale * 100\"\n >\n {{ zoomScale * 100 }}%\n </option>\n </select>\n\n <button\n [disabled]=\"\n toolbarEvents.zoomValueSubject.value == 5 ||\n redactAllInProgress\n \"\n id=\"mvPlusBtn\"\n class=\"mv-toolbar__menu-button--zoom-in button-image\"\n (click)=\"stepZoom(0.1)\"\n title=\"Zoom In\"\n data-l10n-id=\"zoom_in\"\n >\n <span></span>\n </button>\n </div>\n </ng-container>\n\n <div\n *ngIf=\"toolbarButtons.showRotate\"\n id=\"mvRotateBtn\"\n #mvRotateBtn\n class=\"mv-toolbar__menu-button--rotate\"\n aria-pressed=\"false\"\n [class.button-hidden-on-toolbar]=\"\n mvToolbarMain.offsetWidth < widthRequiredForBtn['mvRotateBtn']\n \"\n [class.button-hidden-on-dropdown]=\"\n mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvRotateBtn']\n \"\n >\n <button\n id=\"mvRotateLeftBtn\"\n class=\"mv-toolbar__menu-button--rotate_left button-image\"\n title=\"Rotate Counterclockwise\"\n data-l10n-id=\"page_rotate_ccw\"\n (click)=\"rotate(270)\"\n [disabled]=\"redactAllInProgress\"\n >\n <span></span>\n </button>\n <button\n id=\"mvRotateRightBtn\"\n class=\"mv-toolbar__menu-button--rotate_right button-image\"\n title=\"Rotate Clockwise\"\n data-l10n-id=\"page_rotate_cw\"\n (click)=\"rotate(90)\"\n [disabled]=\"redactAllInProgress\"\n >\n <span></span>\n </button>\n <span>Rotate</span>\n </div>\n\n <button\n *ngIf=\"toolbarButtons.showSearchBar\"\n [disabled]=\"icpEnabled || redactAllInProgress\"\n id=\"mvSearchBtn\"\n #mvSearchBtn\n title=\"Search\"\n data-l10n-id=\"searchbar\"\n class=\"mv-button mv-toolbar__menu-button--search\"\n [class.button-hidden-on-toolbar]=\"\n mvToolbarMain.offsetWidth < widthRequiredForBtn['mvSearchBtn']\n \"\n [class.button-hidden-on-dropdown]=\"\n mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvSearchBtn']\n \"\n aria-pressed=\"false\"\n (click)=\"toggleSearchBar(); isDropdownMenuOpen = false\"\n ></button>\n\n <button\n *ngIf=\"enableICP && toolbarButtons.showPresentationMode && isPdf()\"\n [disabled]=\"icpEnabled || !contentType || redactionEnabled\"\n id=\"mvPresentBtn\"\n #mvPresentBtn\n class=\"mv-button mv-toolbar__menu-button--present\"\n title=\"In-Court Presentation Mode\"\n data-l10n-id=\"icpMode_label\"\n [class.button-hidden-on-toolbar]=\"\n mvToolbarMain.offsetWidth < widthRequiredForBtn['mvPresentBtn']\n \"\n [class.button-hidden-on-dropdown]=\"\n mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvPresentBtn']\n \"\n aria-pressed=\"false\"\n (click)=\"togglePresentBar(); isDropdownMenuOpen = false\"\n >\n <span data-l10n-id=\"icpMode_label\">Present</span>\n </button>\n\n <button\n *ngIf=\"enableRedactions && toolbarButtons.showRedact\"\n [disabled]=\"icpEnabled || redactAllInProgress\"\n id=\"mvRedactBtn\"\n #mvRedactBtn\n title=\"Redact\"\n data-l10n-id=\"redact\"\n class=\"mv-button mv-toolbar__menu-button--redact\"\n [class.button-hidden-on-toolbar]=\"\n mvToolbarMain.offsetWidth < widthRequiredForBtn['mvRedactBtn']\n \"\n [class.button-hidden-on-dropdown]=\"\n mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvRedactBtn']\n \"\n aria-pressed=\"false\"\n (click)=\"toggleRedactBar(); isDropdownMenuOpen = false\"\n >\n <span>Redact</span>\n </button>\n\n <button\n *ngIf=\"toolbarButtons.showGrabNDragButton\"\n [disabled]=\"icpEnabled || redactAllInProgress\"\n id=\"mvGrabBtn\"\n #mvGrabBtn\n class=\"mv-button mv-toolbar__menu-button--grab\"\n title=\"Grab and drag\"\n [class.button-hidden-on-toolbar]=\"\n mvToolbarMain.offsetWidth < widthRequiredForBtn['mvGrabBtn']\n \"\n [class.button-hidden-on-dropdown]=\"\n mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvGrabBtn']\n \"\n aria-pressed=\"false\"\n (click)=\"toggleGrabNDrag(); isDropdownMenuOpen = false\"\n >\n <span>Grab and drag</span>\n </button>\n\n <button\n *ngIf=\"toolbarButtons.showDownload\"\n [disabled]=\"icpEnabled || redactionEnabled\"\n id=\"mvDownloadBtn\"\n #mvDownloadBtn\n class=\"mv-button mv-toolbar__menu-button--download\"\n title=\"Download\"\n data-l10n-id=\"download\"\n [class.button-hidden-on-toolbar]=\"\n mvToolbarMain.offsetWidth < widthRequiredForBtn['mvDownloadBtn']\n \"\n [class.button-hidden-on-dropdown]=\"\n mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvDownloadBtn']\n \"\n aria-pressed=\"false\"\n (click)=\"downloadFile(); isDropdownMenuOpen = false\"\n ></button>\n\n <button\n *ngIf=\"toolbarButtons.showPrint\"\n [disabled]=\"icpEnabled || redactionEnabled\"\n id=\"mvPrintBtn\"\n #mvPrintBtn\n title=\"Print\"\n data-l10n-id=\"print\"\n class=\"mv-button mv-toolbar__menu-button--print\"\n [class.button-hidden-on-toolbar]=\"\n mvToolbarMain.offsetWidth < widthRequiredForBtn['mvPrintBtn']\n \"\n [class.button-hidden-on-dropdown]=\"\n mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvPrintBtn']\n \"\n aria-pressed=\"false\"\n (click)=\"printFile(); isDropdownMenuOpen = false\"\n ></button>\n\n <button\n *ngIf=\"enableAnnotations && toolbarButtons.showCommentSummary\"\n [disabled]=\"redactionEnabled\"\n id=\"mvCommentsBtn\"\n #mvCommentsBtn\n class=\"mv-button mv-toolbar__menu-button--comments\"\n title=\"Comments\"\n data-l10n-id=\"comments\"\n [class.button-hidden-on-toolbar]=\"\n mvToolbarMain.offsetWidth < widthRequiredForBtn['mvCommentsBtn']\n \"\n [class.button-hidden-on-dropdown]=\"\n mvToolbarMain.offsetWidth >= widthRequiredForBtn['mvCommentsBtn']\n \"\n aria-pressed=\"false\"\n (click)=\"toggleCommentsPanel(); isDropdownMenuOpen = false\"\n >\n <span>Comments</span>\n </button>\n </ng-template>\n </div>\n <mv-search-bar></mv-search-bar>\n </div>\n\n <div id=\"loadingBar\">\n <div class=\"progress\">\n <div class=\"glimmer\"></div>\n </div>\n </div>\n </div>\n</div>\n"
|
|
3665
4007
|
},] }
|
|
3666
4008
|
];
|
|
3667
4009
|
/** @nocollapse */
|
|
@@ -3828,12 +4170,19 @@
|
|
|
3828
4170
|
this.store = store;
|
|
3829
4171
|
this.preview = false;
|
|
3830
4172
|
this.hasRedactions = false;
|
|
4173
|
+
this.subscriptions = [];
|
|
3831
4174
|
}
|
|
3832
4175
|
RedactionToolbarComponent.prototype.ngOnInit = function () {
|
|
3833
4176
|
var _this = this;
|
|
3834
|
-
this
|
|
4177
|
+
this.subscriptions.push(this.store.pipe(store.select(getRedactionArray)).subscribe(function (redactions) {
|
|
3835
4178
|
_this.hasRedactions = !!redactions.redactions.length;
|
|
3836
|
-
});
|
|
4179
|
+
}));
|
|
4180
|
+
this.subscriptions.push(this.toolbarEventService.redactAllInProgressSubject.subscribe(function (inprogress) {
|
|
4181
|
+
_this.redactionAllInProgress = inprogress;
|
|
4182
|
+
}));
|
|
4183
|
+
};
|
|
4184
|
+
RedactionToolbarComponent.prototype.onRedactAllSearch = function () {
|
|
4185
|
+
this.toolbarEventService.openRedactionSearch.next(true);
|
|
3837
4186
|
};
|
|
3838
4187
|
RedactionToolbarComponent.prototype.toggleTextRedactionMode = function () {
|
|
3839
4188
|
this.toolbarEventService.highlightModeSubject.next(true);
|
|
@@ -3859,14 +4208,27 @@
|
|
|
3859
4208
|
this.toolbarEventService.redactPage();
|
|
3860
4209
|
};
|
|
3861
4210
|
RedactionToolbarComponent.prototype.ngOnDestroy = function () {
|
|
3862
|
-
|
|
4211
|
+
var e_1, _a;
|
|
4212
|
+
try {
|
|
4213
|
+
for (var _b = __values(this.subscriptions), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
4214
|
+
var subscription = _c.value;
|
|
4215
|
+
subscription.unsubscribe();
|
|
4216
|
+
}
|
|
4217
|
+
}
|
|
4218
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
4219
|
+
finally {
|
|
4220
|
+
try {
|
|
4221
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
4222
|
+
}
|
|
4223
|
+
finally { if (e_1) throw e_1.error; }
|
|
4224
|
+
}
|
|
3863
4225
|
};
|
|
3864
4226
|
return RedactionToolbarComponent;
|
|
3865
4227
|
}());
|
|
3866
4228
|
RedactionToolbarComponent.decorators = [
|
|
3867
4229
|
{ type: i0.Component, args: [{
|
|
3868
4230
|
selector: 'mv-redaction-toolbar',
|
|
3869
|
-
template: "<div class=\"redaction\">\n <label class=\"govuk-label redaction-title\" data-l10n-id=\"redaction_options\">Redaction options</label>\n <button
|
|
4231
|
+
template: "<div class=\"redaction\">\n <label class=\"govuk-label redaction-title\" data-l10n-id=\"redaction_options\"\n >Redaction options</label\n >\n <button\n id=\"toggleDrawButton\"\n class=\"mv-button redaction-button--draw\"\n title=\"Draw a box\"\n data-l10n-id=\"toggleDrawButton\"\n (click)=\"toggleDrawMode()\"\n [disabled]=\"redactionAllInProgress\"\n >\n <span data-l10n-id=\"toggleDrawButton_label\">Draw a box</span>\n </button>\n\n <button\n id=\"redactPageButton\"\n class=\"mv-button redaction-button--redact-page\"\n title=\"Redact Page\"\n data-l10n-id=\"redactPageButton\"\n (click)=\"redactPage()\"\n [disabled]=\"redactionAllInProgress\"\n >\n <span data-l10n-id=\"redactPageButton_label\">Redact page</span>\n </button>\n <button\n *ngIf=\"showRedactSearch\"\n id=\"mvRedactFromSearchBtn\"\n title=\"From search\"\n data-l10n-id=\"fromSearchButton\"\n class=\"mv-button redaction-button--search\"\n (click)=\"onRedactAllSearch()\"\n [disabled]=\"redactionAllInProgress\"\n >\n <span style=\"width: 5rem\" data-l10n-id=\"fromSearchButton_label\"\n >From search</span\n >\n </button>\n\n <button\n *ngIf=\"toolbarButtons.showHighlightButton\"\n id=\"toggleHighlightButton\"\n class=\"mv-button redaction-button--redact\"\n aria-pressed=\"false\"\n title=\"Redact text\"\n data-l10n-id=\"toggleTextRedactionButton\"\n (click)=\"toggleTextRedactionMode()\"\n [disabled]=\"redactionAllInProgress\"\n >\n <span data-l10n-id=\"toggleTextRedactionButton_label\">Redact text</span>\n </button>\n\n <button\n [disabled]=\"!hasRedactions || redactionAllInProgress\"\n id=\"mvClearBtn\"\n #mvClearBtn\n class=\"mv-button redaction-button--clear\"\n aria-pressed=\"false\"\n title=\"Clear all\"\n data-l10n-id=\"toggleClearAllButton\"\n (click)=\"unmarkAll()\"\n >\n <span data-l10n-id=\"Clear all\">Clear all</span>\n </button>\n\n <button\n [disabled]=\"!hasRedactions || redactionAllInProgress\"\n id=\"mvPreviewBtn\"\n class=\"mv-button\"\n [class.redaction-button--preview]=\"!preview\"\n [class.redaction-button--hide-preview]=\"preview\"\n redaction-button--preview\n aria-pressed=\"false\"\n title=\"Preview\"\n data-l10n-id=\"togglePreviewButton\"\n (click)=\"togglePreview()\"\n >\n <span *ngIf=\"!preview\" data-l10n-id=\"redaction-preview_label\">Preview</span>\n <span *ngIf=\"preview\" data-l10n-id=\"redaction-hide-preview_label\"\n >Hide preview</span\n >\n </button>\n\n <button\n [disabled]=\"!hasRedactions || redactionAllInProgress\"\n id=\"mvRedactBtn\"\n class=\"mv-button redaction-button--download\"\n aria-pressed=\"false\"\n title=\"Redact\"\n data-l10n-id=\"mvRedactBtn\"\n (click)=\"redact()\"\n >\n <span data-l10n-id=\"Save Document\">Save document</span>\n </button>\n\n <button\n id=\"mvCloseBtn\"\n #mvCloseBtn\n class=\"mv-button redaction-button--close\"\n title=\"Close Redaction\"\n data-l10n-id=\"mvRedactBtn\"\n (click)=\"toggleRedactBar()\"\n [disabled]=\"redactionAllInProgress\"\n >\n <span data-l10n-id=\"Close Redaction\">Close Redaction</span>\n </button>\n</div>\n"
|
|
3870
4232
|
},] }
|
|
3871
4233
|
];
|
|
3872
4234
|
/** @nocollapse */
|
|
@@ -3875,6 +4237,9 @@
|
|
|
3875
4237
|
{ type: ToolbarButtonVisibilityService },
|
|
3876
4238
|
{ type: store.Store }
|
|
3877
4239
|
]; };
|
|
4240
|
+
RedactionToolbarComponent.propDecorators = {
|
|
4241
|
+
showRedactSearch: [{ type: i0.Input }]
|
|
4242
|
+
};
|
|
3878
4243
|
|
|
3879
4244
|
var IcpToolbarComponent = /** @class */ (function () {
|
|
3880
4245
|
function IcpToolbarComponent(toolbarEventService, store) {
|
|
@@ -3928,7 +4293,8 @@
|
|
|
3928
4293
|
SearchBarComponent,
|
|
3929
4294
|
MainToolbarComponent,
|
|
3930
4295
|
RedactionToolbarComponent,
|
|
3931
|
-
IcpToolbarComponent
|
|
4296
|
+
IcpToolbarComponent,
|
|
4297
|
+
RedactionSearchBarComponent
|
|
3932
4298
|
],
|
|
3933
4299
|
providers: [
|
|
3934
4300
|
ToolbarButtonVisibilityService,
|
|
@@ -3938,7 +4304,8 @@
|
|
|
3938
4304
|
MainToolbarComponent,
|
|
3939
4305
|
SearchBarComponent,
|
|
3940
4306
|
RedactionToolbarComponent,
|
|
3941
|
-
IcpToolbarComponent
|
|
4307
|
+
IcpToolbarComponent,
|
|
4308
|
+
RedactionSearchBarComponent
|
|
3942
4309
|
],
|
|
3943
4310
|
imports: [
|
|
3944
4311
|
common.CommonModule,
|
|
@@ -4081,88 +4448,33 @@
|
|
|
4081
4448
|
pageWidth: [{ type: i0.Input }]
|
|
4082
4449
|
};
|
|
4083
4450
|
|
|
4084
|
-
var
|
|
4085
|
-
function
|
|
4086
|
-
this.
|
|
4087
|
-
this.
|
|
4451
|
+
var RectangleComponent = /** @class */ (function () {
|
|
4452
|
+
function RectangleComponent(toolbarEvents, highlightService) {
|
|
4453
|
+
this.toolbarEvents = toolbarEvents;
|
|
4454
|
+
this.highlightService = highlightService;
|
|
4455
|
+
this.select = new i0.EventEmitter();
|
|
4456
|
+
this.update = new i0.EventEmitter();
|
|
4457
|
+
this.subscriptions = [];
|
|
4458
|
+
this.enableGrabNDrag = false;
|
|
4088
4459
|
}
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
rectangle.height = width;
|
|
4108
|
-
rectangle.x = y;
|
|
4109
|
-
rectangle.y = +(pageWidth / zoom - x - width).toFixed(2);
|
|
4110
|
-
break;
|
|
4111
|
-
case 180:
|
|
4112
|
-
rectangle.x = +(pageWidth / zoom - x - width).toFixed(2);
|
|
4113
|
-
rectangle.y = +(pageHeight / zoom - y - height).toFixed(2);
|
|
4114
|
-
break;
|
|
4115
|
-
case 270:
|
|
4116
|
-
rectangle.width = height;
|
|
4117
|
-
rectangle.height = width;
|
|
4118
|
-
rectangle.x = +(pageHeight / zoom - y - height).toFixed(2);
|
|
4119
|
-
rectangle.y = x;
|
|
4120
|
-
break;
|
|
4121
|
-
}
|
|
4122
|
-
return rectangle;
|
|
4123
|
-
};
|
|
4124
|
-
HighlightCreateService.prototype.resetHighlight = function () {
|
|
4125
|
-
window.getSelection().removeAllRanges();
|
|
4126
|
-
this.toolBarEvents.highlightModeSubject.next(false);
|
|
4127
|
-
};
|
|
4128
|
-
return HighlightCreateService;
|
|
4129
|
-
}());
|
|
4130
|
-
HighlightCreateService.decorators = [
|
|
4131
|
-
{ type: i0.Injectable }
|
|
4132
|
-
];
|
|
4133
|
-
/** @nocollapse */
|
|
4134
|
-
HighlightCreateService.ctorParameters = function () { return [
|
|
4135
|
-
{ type: ToolbarEventService },
|
|
4136
|
-
{ type: store.Store }
|
|
4137
|
-
]; };
|
|
4138
|
-
|
|
4139
|
-
var RectangleComponent = /** @class */ (function () {
|
|
4140
|
-
function RectangleComponent(toolbarEvents, highlightService) {
|
|
4141
|
-
this.toolbarEvents = toolbarEvents;
|
|
4142
|
-
this.highlightService = highlightService;
|
|
4143
|
-
this.select = new i0.EventEmitter();
|
|
4144
|
-
this.update = new i0.EventEmitter();
|
|
4145
|
-
this.subscriptions = [];
|
|
4146
|
-
this.enableGrabNDrag = false;
|
|
4147
|
-
}
|
|
4148
|
-
Object.defineProperty(RectangleComponent.prototype, "annoRect", {
|
|
4149
|
-
get: function () {
|
|
4150
|
-
return this._annoRect;
|
|
4151
|
-
},
|
|
4152
|
-
set: function (annoRect) {
|
|
4153
|
-
this._annoRect = Object.assign({}, annoRect);
|
|
4154
|
-
this.height = +(annoRect.height * this.zoom).toFixed(2);
|
|
4155
|
-
this.width = +(annoRect.width * this.zoom).toFixed(2);
|
|
4156
|
-
this.left = +(annoRect.x * this.zoom).toFixed(2);
|
|
4157
|
-
this.top = +(annoRect.y * this.zoom).toFixed(2);
|
|
4158
|
-
},
|
|
4159
|
-
enumerable: false,
|
|
4160
|
-
configurable: true
|
|
4161
|
-
});
|
|
4162
|
-
RectangleComponent.prototype.ngOnChanges = function (changes) {
|
|
4163
|
-
if (changes.rotate) {
|
|
4164
|
-
this.adjustForRotation(this.rotate);
|
|
4165
|
-
}
|
|
4460
|
+
Object.defineProperty(RectangleComponent.prototype, "annoRect", {
|
|
4461
|
+
get: function () {
|
|
4462
|
+
return this._annoRect;
|
|
4463
|
+
},
|
|
4464
|
+
set: function (annoRect) {
|
|
4465
|
+
this._annoRect = Object.assign({}, annoRect);
|
|
4466
|
+
this.height = +(annoRect.height * this.zoom).toFixed(2);
|
|
4467
|
+
this.width = +(annoRect.width * this.zoom).toFixed(2);
|
|
4468
|
+
this.left = +(annoRect.x * this.zoom).toFixed(2);
|
|
4469
|
+
this.top = +(annoRect.y * this.zoom).toFixed(2);
|
|
4470
|
+
},
|
|
4471
|
+
enumerable: false,
|
|
4472
|
+
configurable: true
|
|
4473
|
+
});
|
|
4474
|
+
RectangleComponent.prototype.ngOnChanges = function (changes) {
|
|
4475
|
+
if (changes.rotate) {
|
|
4476
|
+
this.adjustForRotation(this.rotate);
|
|
4477
|
+
}
|
|
4166
4478
|
};
|
|
4167
4479
|
RectangleComponent.prototype.ngAfterViewInit = function () {
|
|
4168
4480
|
var _this = this;
|
|
@@ -4309,6 +4621,7 @@
|
|
|
4309
4621
|
this.subscriptions = this.store.select(getComponentSearchText)
|
|
4310
4622
|
.pipe(operators.distinctUntilChanged()).subscribe(function (searchString) { return _this.searchString = searchString; });
|
|
4311
4623
|
this.reRenderComments();
|
|
4624
|
+
this.marginToComment$ = this.commentService.marginToCommentEmitter.asObservable();
|
|
4312
4625
|
};
|
|
4313
4626
|
CommentComponent.prototype.ngAfterContentInit = function () {
|
|
4314
4627
|
if (this.tagItems && this.tagItems.length) {
|
|
@@ -4440,7 +4753,7 @@
|
|
|
4440
4753
|
CommentComponent.decorators = [
|
|
4441
4754
|
{ type: i0.Component, args: [{
|
|
4442
4755
|
selector: 'mv-anno-comment',
|
|
4443
|
-
template: "<div #form (click)=\"onCommentClick()\" class=\"aui-comment\"\n [style.top.px]=\"commentTop\"\n [style.zIndex]=\"selected ? 100 : 0\">\n <div id=\"detailsWrapper {{index}}\" class=\"aui-comment__header\">\n <span *ngIf=\"author && !editor\" class=\"aui-comment__author\">\n {{ author.forename }} {{ author.surname }}\n </span>\n <span *ngIf=\"editor\" class=\"aui-comment__author\">\n {{ editor.forename }} {{ editor.surname }}\n </span>\n <time [hidden]=\"!selected && !this.editable\" class=\"aui-comment__meta\">\n {{ lastUpdate | momentDate: 'd MMMM y h:mm a' }}\n </time>\n </div>\n <mv-tags\n [tagItems]=\"tagItems\"\n [userId]=\"createdBy\"\n [editable]=\"editable\"\n [annoId]=\"_comment.annotationId\">\n </mv-tags>\n <textarea *ngIf=\"selected && editable\"\n #editableComment\n mvTextAreaAutoExpand\n type=\"text\"\n required\n name=\"content\"\n [maxlength]=\"CHAR_LIMIT\"\n class=\"aui-comment__content form-control mimic-focus edit-mode expanded\"\n [(ngModel)]=\"fullComment\"\n (ngModelChange)=\"reRenderComments(); onCommentChange($event);\"\n aria-label=\"comment\">\n </textarea>\n <p *ngIf=\"!editable\"\n mvTextHighlight class=\"commentText\" [textToHighlight]=\"searchString\">\n {{ fullComment }}\n </p>\n <div *ngIf=\"selected || this.editable || (!fullComment.length && (tagItems && !tagItems.length))\"\n class=\"aui-comment__footer commentBtns\">\n <button class=\"govuk-button\"\n type=\"button\" role=\"button\"\n (click)=\"editOrSave()\">\n {{ !editable ? 'Edit' : 'Save' }}\n </button>\n <button type=\"button\" role=\"button\"\n class=\"govuk-button govuk-button--secondary\"\n (click)=\"deleteOrCancel()\">\n {{ !editable ? 'Delete' : 'Cancel' }}\n </button>\n </div>\n <span class=\"aui-comment__private\">private</span>\n</div>\n"
|
|
4756
|
+
template: "<div #form (click)=\"onCommentClick()\" class=\"aui-comment\"\n [ngClass]=\"{'stylestoggle' : (marginToComment$ | async ) }\"\n [style.top.px]=\"commentTop\"\n [style.zIndex]=\"selected ? 100 : 0\">\n <div id=\"detailsWrapper {{index}}\" class=\"aui-comment__header\">\n <span *ngIf=\"author && !editor\" class=\"aui-comment__author\">\n {{ author.forename }} {{ author.surname }}\n </span>\n <span *ngIf=\"editor\" class=\"aui-comment__author\">\n {{ editor.forename }} {{ editor.surname }}\n </span>\n <time [hidden]=\"!selected && !this.editable\" class=\"aui-comment__meta\">\n {{ lastUpdate | momentDate: 'd MMMM y h:mm a' }}\n </time>\n </div>\n <mv-tags\n [tagItems]=\"tagItems\"\n [userId]=\"createdBy\"\n [editable]=\"editable\"\n [annoId]=\"_comment.annotationId\">\n </mv-tags>\n <textarea *ngIf=\"selected && editable\"\n #editableComment\n mvTextAreaAutoExpand\n type=\"text\"\n required\n name=\"content\"\n [maxlength]=\"CHAR_LIMIT\"\n class=\"aui-comment__content form-control mimic-focus edit-mode expanded\"\n [(ngModel)]=\"fullComment\"\n (ngModelChange)=\"reRenderComments(); onCommentChange($event);\"\n aria-label=\"comment\">\n </textarea>\n <p *ngIf=\"!editable\"\n mvTextHighlight class=\"commentText\" [textToHighlight]=\"searchString\">\n {{ fullComment }}\n </p>\n <div *ngIf=\"selected || this.editable || (!fullComment.length && (tagItems && !tagItems.length))\"\n class=\"aui-comment__footer commentBtns\">\n <button class=\"govuk-button\"\n type=\"button\" role=\"button\"\n (click)=\"editOrSave()\">\n {{ !editable ? 'Edit' : 'Save' }}\n </button>\n <button type=\"button\" role=\"button\"\n class=\"govuk-button govuk-button--secondary\"\n (click)=\"deleteOrCancel()\">\n {{ !editable ? 'Delete' : 'Cancel' }}\n </button>\n </div>\n <span class=\"aui-comment__private\">private</span>\n</div>\n"
|
|
4444
4757
|
},] }
|
|
4445
4758
|
];
|
|
4446
4759
|
/** @nocollapse */
|
|
@@ -4937,7 +5250,7 @@
|
|
|
4937
5250
|
if (this.height / this.zoom > 5 || this.width / this.zoom > 5) {
|
|
4938
5251
|
var rectangle = this.highlightService
|
|
4939
5252
|
.applyRotation(this.pageHeight, this.pageWidth, this.height, this.width, this.top, this.left, this.rotate, this.zoom);
|
|
4940
|
-
rectangle = Object.assign({ id:
|
|
5253
|
+
rectangle = Object.assign({ id: uuid$1.v4() }, rectangle);
|
|
4941
5254
|
this.saveSelection.emit({ rectangles: [rectangle], page: this.page });
|
|
4942
5255
|
this.resetHighlight();
|
|
4943
5256
|
}
|
|
@@ -4982,8 +5295,9 @@
|
|
|
4982
5295
|
};
|
|
4983
5296
|
|
|
4984
5297
|
var CommentSetHeaderComponent = /** @class */ (function () {
|
|
4985
|
-
function CommentSetHeaderComponent(store, toolbarEvents) {
|
|
5298
|
+
function CommentSetHeaderComponent(store, commentService, toolbarEvents) {
|
|
4986
5299
|
this.store = store;
|
|
5300
|
+
this.commentService = commentService;
|
|
4987
5301
|
this.toolbarEvents = toolbarEvents;
|
|
4988
5302
|
this.showCommentSummaryDialog = new i0.EventEmitter();
|
|
4989
5303
|
this.tabs = [];
|
|
@@ -5009,6 +5323,14 @@
|
|
|
5009
5323
|
};
|
|
5010
5324
|
CommentSetHeaderComponent.prototype.selectTab = function (tab) {
|
|
5011
5325
|
this.tabSelected = tab !== this.tabSelected ? tab : undefined;
|
|
5326
|
+
if (this.tabSelected) {
|
|
5327
|
+
this.marginToComment = true;
|
|
5328
|
+
this.commentService.createMarginToCommentEvent(this.marginToComment);
|
|
5329
|
+
}
|
|
5330
|
+
else {
|
|
5331
|
+
this.marginToComment = false;
|
|
5332
|
+
this.commentService.createMarginToCommentEvent(this.marginToComment);
|
|
5333
|
+
}
|
|
5012
5334
|
};
|
|
5013
5335
|
CommentSetHeaderComponent.prototype.toggleCommentsPanel = function () {
|
|
5014
5336
|
this.toolbarEvents.toggleCommentsPanel(!this.toolbarEvents.commentsPanelVisible.getValue());
|
|
@@ -5028,6 +5350,7 @@
|
|
|
5028
5350
|
/** @nocollapse */
|
|
5029
5351
|
CommentSetHeaderComponent.ctorParameters = function () { return [
|
|
5030
5352
|
{ type: store.Store },
|
|
5353
|
+
{ type: CommentService },
|
|
5031
5354
|
{ type: ToolbarEventService }
|
|
5032
5355
|
]; };
|
|
5033
5356
|
CommentSetHeaderComponent.propDecorators = {
|
|
@@ -5611,7 +5934,7 @@
|
|
|
5611
5934
|
pageNumber: pdfPosition.pageNumber - 1,
|
|
5612
5935
|
xCoordinate: pdfPosition.left,
|
|
5613
5936
|
yCoordinate: pages[pdfPosition.pageNumber].styles.height - (pdfPosition.top * pages[pdfPosition.pageNumber].viewportScale),
|
|
5614
|
-
previous: bookmarkNodes.length > 0 ? bookmarkNodes[bookmarkNodes.length - 1].id : undefined,
|
|
5937
|
+
previous: bookmarkNodes.length > 0 ? bookmarkNodes.sort(function (a, b) { return a.index - b.index; })[bookmarkNodes.length - 1].id : undefined,
|
|
5615
5938
|
documentId: docId
|
|
5616
5939
|
};
|
|
5617
5940
|
};
|
|
@@ -5674,8 +5997,9 @@
|
|
|
5674
5997
|
this.store.pipe(store.select(getBookmarkInfo), operators.take(1))
|
|
5675
5998
|
.subscribe(function (bookmarkInfo) {
|
|
5676
5999
|
var selection = window.getSelection().toString();
|
|
5677
|
-
_this.store.dispatch(new CreateBookmark(Object.assign(Object.assign({}, bookmarkInfo), { name: selection.length > 0 ? selection.substr(0, 30) : 'new bookmark', id:
|
|
6000
|
+
_this.store.dispatch(new CreateBookmark(Object.assign(Object.assign({}, bookmarkInfo), { name: selection.length > 0 ? selection.substr(0, 30) : 'new bookmark', id: uuid$1.v4(), pageNumber: _this.highlightPage - 1, xCoordinate: rectangle.x, yCoordinate: rectangle.y })));
|
|
5678
6001
|
_this.toolbarEvents.toggleSideBar(true);
|
|
6002
|
+
_this.toolbarEvents.toggleSideBarView(false);
|
|
5679
6003
|
_this.highlightService.resetHighlight();
|
|
5680
6004
|
_this.rectangles = undefined;
|
|
5681
6005
|
});
|
|
@@ -5755,6 +6079,7 @@
|
|
|
5755
6079
|
BookmarksApiService,
|
|
5756
6080
|
CommentSetRenderService,
|
|
5757
6081
|
HighlightCreateService,
|
|
6082
|
+
CommentService,
|
|
5758
6083
|
TagsServices
|
|
5759
6084
|
],
|
|
5760
6085
|
exports: [
|
|
@@ -5826,17 +6151,205 @@
|
|
|
5826
6151
|
onWindowPointerUp: [{ type: i0.HostListener, args: ['window:pointerup',] }]
|
|
5827
6152
|
};
|
|
5828
6153
|
|
|
6154
|
+
var BookmarksComponent = /** @class */ (function () {
|
|
6155
|
+
function BookmarksComponent(store) {
|
|
6156
|
+
this.store = store;
|
|
6157
|
+
this.goToDestination = new i0.EventEmitter();
|
|
6158
|
+
this.pageLookup = {};
|
|
6159
|
+
this.BOOKMARK_CHAR_LIMIT = 30;
|
|
6160
|
+
this.options = {
|
|
6161
|
+
allowDrag: true,
|
|
6162
|
+
allowDrop: true
|
|
6163
|
+
};
|
|
6164
|
+
this._customSort = 'CUSTOM';
|
|
6165
|
+
this._positionSort = 'POSITION';
|
|
6166
|
+
}
|
|
6167
|
+
BookmarksComponent.prototype.ngOnInit = function () {
|
|
6168
|
+
var _this = this;
|
|
6169
|
+
this.sortMode = this.customSort;
|
|
6170
|
+
this.$subscription = this.store.pipe(store.select(getEditableBookmark))
|
|
6171
|
+
.subscribe(function (editableId) { return _this.editableBookmark = editableId; });
|
|
6172
|
+
this.$subscription.add(this.store.select(getPages)
|
|
6173
|
+
.subscribe(function (pages) {
|
|
6174
|
+
Object.keys(pages).map(function (key) {
|
|
6175
|
+
_this.pageLookup[key] = pages[key];
|
|
6176
|
+
});
|
|
6177
|
+
}));
|
|
6178
|
+
};
|
|
6179
|
+
BookmarksComponent.prototype.ngOnChanges = function (changes) {
|
|
6180
|
+
if (changes.bookmarkNodes && this.sortMode !== this.customSort) {
|
|
6181
|
+
this.sortBookmarks();
|
|
6182
|
+
}
|
|
6183
|
+
};
|
|
6184
|
+
BookmarksComponent.prototype.ngOnDestroy = function () {
|
|
6185
|
+
this.$subscription.unsubscribe();
|
|
6186
|
+
};
|
|
6187
|
+
BookmarksComponent.prototype.editBookmark = function (id) {
|
|
6188
|
+
this.editableBookmark = id;
|
|
6189
|
+
};
|
|
6190
|
+
BookmarksComponent.prototype.onAddBookmarkClick = function () {
|
|
6191
|
+
var _this = this;
|
|
6192
|
+
this.store.pipe(store.select(getBookmarkInfo), operators.take(1))
|
|
6193
|
+
.subscribe(function (bookmarkInfo) {
|
|
6194
|
+
_this.store.dispatch(new CreateBookmark(Object.assign(Object.assign({}, bookmarkInfo), { name: '', id: uuid__default$1["default"]() })));
|
|
6195
|
+
});
|
|
6196
|
+
};
|
|
6197
|
+
BookmarksComponent.prototype.onBookmarkMove = function (_a) {
|
|
6198
|
+
var node = _a.node, from = _a.from, to = _a.to;
|
|
6199
|
+
var movedBookmarks = [Object.assign(Object.assign({}, node), { previous: to.index > 0 ? to.parent.children[to.index - 1].id : undefined, parent: to.parent.documentId ? to.parent.id : undefined })];
|
|
6200
|
+
var fromNext = this.getSibling(from, from.index);
|
|
6201
|
+
fromNext = fromNext && fromNext.id === node.previous ? this.getSibling(from, from.index + 1) : fromNext;
|
|
6202
|
+
if (fromNext) {
|
|
6203
|
+
movedBookmarks = __spread(movedBookmarks, [Object.assign(Object.assign({}, fromNext), { previous: node.previous })]);
|
|
6204
|
+
}
|
|
6205
|
+
var toNext = this.getSibling(to, to.index + 1);
|
|
6206
|
+
if (toNext) {
|
|
6207
|
+
movedBookmarks = __spread(movedBookmarks, [Object.assign(Object.assign({}, toNext), { previous: node.id })]);
|
|
6208
|
+
}
|
|
6209
|
+
this.store.dispatch(new MoveBookmark(movedBookmarks));
|
|
6210
|
+
};
|
|
6211
|
+
BookmarksComponent.prototype.deleteBookmark = function (node) {
|
|
6212
|
+
this.customSortBookmarks();
|
|
6213
|
+
var next;
|
|
6214
|
+
node = this.tree.treeModel.getNodeById(node.id);
|
|
6215
|
+
if (!node.parent) {
|
|
6216
|
+
node.parent = this.tree.treeModel.virtualRoot;
|
|
6217
|
+
}
|
|
6218
|
+
var siblings = node.parent.children;
|
|
6219
|
+
if (siblings.length > node.index + 1) {
|
|
6220
|
+
next = siblings[node.index + 1].data;
|
|
6221
|
+
next.previous = node.data.previous;
|
|
6222
|
+
}
|
|
6223
|
+
this.store.dispatch(new DeleteBookmark({
|
|
6224
|
+
deleted: __spread([node.data.id], getBookmarkChildren(node.data.children)),
|
|
6225
|
+
updated: next
|
|
6226
|
+
}));
|
|
6227
|
+
};
|
|
6228
|
+
BookmarksComponent.prototype.updateBookmark = function (bookmark, name) {
|
|
6229
|
+
var editedBookmark = Object.assign(Object.assign({}, bookmark), { name: name });
|
|
6230
|
+
if (name) {
|
|
6231
|
+
this.store.dispatch(new UpdateBookmark(editedBookmark));
|
|
6232
|
+
this.editableBookmark = undefined;
|
|
6233
|
+
}
|
|
6234
|
+
};
|
|
6235
|
+
BookmarksComponent.prototype.goToBookmark = function (bookmark) {
|
|
6236
|
+
var thisPage = this.pageLookup[bookmark.pageNumber + 1];
|
|
6237
|
+
var defaultHeight = thisPage.styles.height;
|
|
6238
|
+
var defaultScaleY = this.scaledY(bookmark.yCoordinate, defaultHeight, thisPage);
|
|
6239
|
+
var top = 0, left = 0;
|
|
6240
|
+
switch (this.rotate) {
|
|
6241
|
+
case 90:
|
|
6242
|
+
left = -defaultScaleY;
|
|
6243
|
+
break;
|
|
6244
|
+
case 180:
|
|
6245
|
+
top = this.scaledY(bookmark.yCoordinate, (defaultHeight - (24 * this.zoom)), thisPage);
|
|
6246
|
+
break;
|
|
6247
|
+
case 270:
|
|
6248
|
+
left = defaultScaleY;
|
|
6249
|
+
break;
|
|
6250
|
+
default:
|
|
6251
|
+
top = defaultScaleY;
|
|
6252
|
+
}
|
|
6253
|
+
this.goToDestination.emit([
|
|
6254
|
+
bookmark.pageNumber,
|
|
6255
|
+
{ 'name': 'XYZ' },
|
|
6256
|
+
left,
|
|
6257
|
+
top
|
|
6258
|
+
]);
|
|
6259
|
+
};
|
|
6260
|
+
Object.defineProperty(BookmarksComponent.prototype, "customSort", {
|
|
6261
|
+
get: function () {
|
|
6262
|
+
return this._customSort;
|
|
6263
|
+
},
|
|
6264
|
+
enumerable: false,
|
|
6265
|
+
configurable: true
|
|
6266
|
+
});
|
|
6267
|
+
Object.defineProperty(BookmarksComponent.prototype, "positionSort", {
|
|
6268
|
+
get: function () {
|
|
6269
|
+
return this._positionSort;
|
|
6270
|
+
},
|
|
6271
|
+
enumerable: false,
|
|
6272
|
+
configurable: true
|
|
6273
|
+
});
|
|
6274
|
+
BookmarksComponent.prototype.sort = function (mode) {
|
|
6275
|
+
this.sortMode = mode;
|
|
6276
|
+
this.sortBookmarks();
|
|
6277
|
+
};
|
|
6278
|
+
BookmarksComponent.prototype.sortBookmarks = function () {
|
|
6279
|
+
switch (this.sortMode) {
|
|
6280
|
+
case this.customSort: {
|
|
6281
|
+
this.customSortBookmarks();
|
|
6282
|
+
break;
|
|
6283
|
+
}
|
|
6284
|
+
case this.positionSort: {
|
|
6285
|
+
this.positionSortBookmarks();
|
|
6286
|
+
break;
|
|
6287
|
+
}
|
|
6288
|
+
default: {
|
|
6289
|
+
this.customSortBookmarks();
|
|
6290
|
+
break;
|
|
6291
|
+
}
|
|
6292
|
+
}
|
|
6293
|
+
};
|
|
6294
|
+
BookmarksComponent.prototype.positionSortBookmarks = function () {
|
|
6295
|
+
this.bookmarkNodes.sort(function (a, b) { return a.pageNumber === b.pageNumber ? a.yCoordinate - b.yCoordinate : a.pageNumber - b.pageNumber; });
|
|
6296
|
+
this.tree.treeModel.update();
|
|
6297
|
+
this.setDragNDrop(false);
|
|
6298
|
+
};
|
|
6299
|
+
BookmarksComponent.prototype.customSortBookmarks = function () {
|
|
6300
|
+
this.bookmarkNodes.sort(function (a, b) { return a.index - b.index; });
|
|
6301
|
+
this.tree.treeModel.update();
|
|
6302
|
+
this.setDragNDrop(true);
|
|
6303
|
+
};
|
|
6304
|
+
BookmarksComponent.prototype.setDragNDrop = function (enabled) {
|
|
6305
|
+
this.options = {
|
|
6306
|
+
allowDrag: enabled,
|
|
6307
|
+
allowDrop: enabled
|
|
6308
|
+
};
|
|
6309
|
+
};
|
|
6310
|
+
BookmarksComponent.prototype.getSibling = function (node, index) {
|
|
6311
|
+
return node.parent.children.length > index ? node.parent.children[index] : undefined;
|
|
6312
|
+
};
|
|
6313
|
+
BookmarksComponent.prototype.scaledY = function (yCoordinate, height, page) {
|
|
6314
|
+
var viewportScale = page.viewportScale / this.zoom;
|
|
6315
|
+
return ((height / this.zoom) - yCoordinate) / viewportScale;
|
|
6316
|
+
};
|
|
6317
|
+
return BookmarksComponent;
|
|
6318
|
+
}());
|
|
6319
|
+
BookmarksComponent.decorators = [
|
|
6320
|
+
{ type: i0.Component, args: [{
|
|
6321
|
+
selector: 'mv-bookmarks',
|
|
6322
|
+
template: "<a *ngIf=\"bookmarkNodes?.length === 0\" class=\"highlightedOutlineItem\">No bookmarks created yet</a>\n<tree-root [nodes]=\"bookmarkNodes\" class=\"bookmarks-tree\" [options]=\"options\" (moveNode)=\"onBookmarkMove($event)\">\n <ng-template #treeNodeTemplate let-node let-index=\"index\">\n <div class=\"outlineItem\" *ngIf=\"node.data.id !== editableBookmark; else inputBookmark\">\n <a (click)=\"goToBookmark(node.data)\">\n {{ node.data.name }}\n </a>\n <button class=\"bookmark__rename\" (click)=\"editBookmark(node.data.id)\"></button>\n <button class=\"bookmark__delete\" (click)=\"deleteBookmark(node)\"></button>\n </div>\n <ng-template #inputBookmark>\n <input #bookmarkName class=\"bookmark__input\" [value]=\"node.data.name\" [maxLength]=\"BOOKMARK_CHAR_LIMIT\">\n <button class=\"bookmark__save\" (click)=\"updateBookmark(node.data, bookmarkName.value)\"></button>\n </ng-template>\n </ng-template>\n</tree-root>\n"
|
|
6323
|
+
},] }
|
|
6324
|
+
];
|
|
6325
|
+
/** @nocollapse */
|
|
6326
|
+
BookmarksComponent.ctorParameters = function () { return [
|
|
6327
|
+
{ type: store.Store }
|
|
6328
|
+
]; };
|
|
6329
|
+
BookmarksComponent.propDecorators = {
|
|
6330
|
+
bookmarkNodes: [{ type: i0.Input }],
|
|
6331
|
+
zoom: [{ type: i0.Input }],
|
|
6332
|
+
rotate: [{ type: i0.Input }],
|
|
6333
|
+
goToDestination: [{ type: i0.Output }],
|
|
6334
|
+
tree: [{ type: i0.ViewChild, args: [angularTreeComponent.TreeComponent,] }]
|
|
6335
|
+
};
|
|
6336
|
+
|
|
5829
6337
|
var SideBarComponent = /** @class */ (function () {
|
|
5830
|
-
function SideBarComponent(viewerEvents, store) {
|
|
6338
|
+
function SideBarComponent(viewerEvents, store, toolbarEvents) {
|
|
5831
6339
|
this.viewerEvents = viewerEvents;
|
|
5832
6340
|
this.store = store;
|
|
6341
|
+
this.toolbarEvents = toolbarEvents;
|
|
5833
6342
|
this.selectedView = 'outline';
|
|
6343
|
+
this.subscriptions = [];
|
|
5834
6344
|
}
|
|
5835
6345
|
SideBarComponent.prototype.ngOnInit = function () {
|
|
5836
6346
|
var _this = this;
|
|
5837
6347
|
this.bookmarkNodes$ = this.store.pipe(store.select(getBookmarkNodes));
|
|
5838
|
-
this
|
|
5839
|
-
.subscribe(function (editable) { return _this.selectedView = editable ? 'bookmarks' : _this.selectedView; });
|
|
6348
|
+
this.subscriptions.push(this.store.pipe(store.select(getEditableBookmark))
|
|
6349
|
+
.subscribe(function (editable) { return _this.selectedView = editable ? 'bookmarks' : _this.selectedView; }));
|
|
6350
|
+
this.subscriptions.push(this.toolbarEvents.sidebarOutlineView.subscribe(function (toggle) {
|
|
6351
|
+
_this.selectedView = toggle ? 'outline' : 'bookmarks';
|
|
6352
|
+
}));
|
|
5840
6353
|
};
|
|
5841
6354
|
SideBarComponent.prototype.ngOnChanges = function (changes) {
|
|
5842
6355
|
if (changes.url && this.url) {
|
|
@@ -5844,7 +6357,9 @@
|
|
|
5844
6357
|
}
|
|
5845
6358
|
};
|
|
5846
6359
|
SideBarComponent.prototype.ngOnDestroy = function () {
|
|
5847
|
-
this
|
|
6360
|
+
if (this.subscriptions.length > 0) {
|
|
6361
|
+
this.subscriptions.forEach(function (subscription) { return subscription.unsubscribe(); });
|
|
6362
|
+
}
|
|
5848
6363
|
};
|
|
5849
6364
|
SideBarComponent.prototype.goToDestination = function (destination) {
|
|
5850
6365
|
this.viewerEvents.goToDestination(destination);
|
|
@@ -5852,15 +6367,10 @@
|
|
|
5852
6367
|
SideBarComponent.prototype.toggleSidebarView = function (sidebarView) {
|
|
5853
6368
|
this.selectedView = sidebarView;
|
|
5854
6369
|
};
|
|
5855
|
-
SideBarComponent.prototype.onAddBookmarkClick = function () {
|
|
5856
|
-
var _this = this;
|
|
5857
|
-
this.toggleSidebarView('bookmarks');
|
|
5858
|
-
this.store.pipe(store.select(getBookmarkInfo), operators.take(1))
|
|
5859
|
-
.subscribe(function (bookmarkInfo) {
|
|
5860
|
-
_this.store.dispatch(new CreateBookmark(Object.assign(Object.assign({}, bookmarkInfo), { name: '', id: uuid__default$1["default"]() })));
|
|
5861
|
-
});
|
|
5862
|
-
};
|
|
5863
6370
|
SideBarComponent.prototype.isViewedItem = function (current, next) {
|
|
6371
|
+
if (current.pageNumber === this.currentPageNumber) {
|
|
6372
|
+
return true;
|
|
6373
|
+
}
|
|
5864
6374
|
return next === undefined ? current.pageNumber <= this.currentPageNumber :
|
|
5865
6375
|
current.pageNumber <= this.currentPageNumber && (next.pageNumber > this.currentPageNumber);
|
|
5866
6376
|
};
|
|
@@ -5872,13 +6382,14 @@
|
|
|
5872
6382
|
SideBarComponent.decorators = [
|
|
5873
6383
|
{ type: i0.Component, args: [{
|
|
5874
6384
|
selector: 'mv-side-bar',
|
|
5875
|
-
template: "<div id=\"toolbarSidebar\">\n <div class=\"splitToolbarButton toggled\">\n
|
|
6385
|
+
template: "<div id=\"toolbarSidebar\">\n <div *ngIf=\"annotationsEnabled && selectedView == 'bookmarks'\"\n class=\"splitToolbarButton toggled\">\n <button id=\"sortBookmarkPosition\" class=\"splitToolbarButton left bookmark__sort__position\"\n (click)=\"bookmarks.sort(bookmarks.positionSort)\" title=\"Order by place in document\"></button>\n <button id=\"sortBookmarkCustom\" class=\"splitToolbarButton left bookmark__sort__custom\"\n (click)=\"bookmarks.sort(bookmarks.customSort)\" title=\"Order manually\"></button></div>\n <div class=\"splitToolbarButtonSeparator\"></div>\n <div *ngIf=\"annotationsEnabled && selectedView == 'bookmarks'\"\n class=\"splitToolbarButton right\">\n <button id=\"addBookmark\"\n class=\"toolbarButton addBookmark\"\n (click)=\"bookmarks.onAddBookmarkClick()\"\n title=\"Add bookmark\" tabindex=\"3\" data-l10n-id=\"addBookmark\">\n <span data-l10n-id=\"addBookmark_label\">Add bookmark</span>\n </button>\n </div>\n</div>\n<div id=\"sidebarContent\">\n <div id=\"outlineView\" class=\"outlineWithDeepNesting\">\n <div class=\"outlineItem\" *ngIf=\"selectedView === 'outline'\">\n <mv-outline-item *ngFor=\"let outlineItem of outline; index as i\"\n [outline]=\"outlineItem\"\n [currentPageNumber]=\"currentPageNumber\"\n [isCurrentSection]= \"isViewedItem(outlineItem, outline[i+1])\"\n [endPage]=\"findEndPage(outline[i+1])\"\n (navigationEvent)=\"goToDestination($event)\"></mv-outline-item>\n </div>\n <div *ngIf=\"annotationsEnabled && selectedView === 'bookmarks'\"\n id=\"bookmarkContainer\">\n <mv-bookmarks [bookmarkNodes]=\"bookmarkNodes$ | async\"\n [zoom]=\"zoom\" [rotate]=\"rotate\"\n (goToDestination)=\"goToDestination($event)\"></mv-bookmarks>\n </div>\n </div>\n</div>\n"
|
|
5876
6386
|
},] }
|
|
5877
6387
|
];
|
|
5878
6388
|
/** @nocollapse */
|
|
5879
6389
|
SideBarComponent.ctorParameters = function () { return [
|
|
5880
6390
|
{ type: ViewerEventService },
|
|
5881
|
-
{ type: store.Store }
|
|
6391
|
+
{ type: store.Store },
|
|
6392
|
+
{ type: ToolbarEventService }
|
|
5882
6393
|
]; };
|
|
5883
6394
|
SideBarComponent.propDecorators = {
|
|
5884
6395
|
annotationsEnabled: [{ type: i0.Input }],
|
|
@@ -5886,7 +6397,8 @@
|
|
|
5886
6397
|
url: [{ type: i0.Input }],
|
|
5887
6398
|
zoom: [{ type: i0.Input }],
|
|
5888
6399
|
rotate: [{ type: i0.Input }],
|
|
5889
|
-
currentPageNumber: [{ type: i0.Input }]
|
|
6400
|
+
currentPageNumber: [{ type: i0.Input }],
|
|
6401
|
+
bookmarks: [{ type: i0.ViewChild, args: [BookmarksComponent,] }]
|
|
5890
6402
|
};
|
|
5891
6403
|
|
|
5892
6404
|
var OutlineItemComponent = /** @class */ (function () {
|
|
@@ -5905,6 +6417,9 @@
|
|
|
5905
6417
|
this.showOutlineItems = !this.showOutlineItems;
|
|
5906
6418
|
};
|
|
5907
6419
|
OutlineItemComponent.prototype.isViewedItem = function (current, next) {
|
|
6420
|
+
if (current.pageNumber === this.currentPageNumber) {
|
|
6421
|
+
return true;
|
|
6422
|
+
}
|
|
5908
6423
|
return next === undefined ? current.pageNumber <= this.currentPageNumber && this.endPage > this.currentPageNumber :
|
|
5909
6424
|
current.pageNumber <= this.currentPageNumber && (next.pageNumber > this.currentPageNumber);
|
|
5910
6425
|
};
|
|
@@ -5970,7 +6485,7 @@
|
|
|
5970
6485
|
this.toolbarEvents.drawModeSubject.next(false);
|
|
5971
6486
|
};
|
|
5972
6487
|
RedactionComponent.prototype.saveRedaction = function (page, rectangles) {
|
|
5973
|
-
var redaction = { page: page, rectangles: rectangles, redactionId:
|
|
6488
|
+
var redaction = { page: page, rectangles: rectangles, redactionId: uuid$1.v4(), documentId: this.documentId };
|
|
5974
6489
|
this.store.dispatch(new SaveRedaction(redaction));
|
|
5975
6490
|
};
|
|
5976
6491
|
RedactionComponent.prototype.onMarkerDelete = function (event) {
|
|
@@ -6159,6 +6674,7 @@
|
|
|
6159
6674
|
this.httpClient = httpClient;
|
|
6160
6675
|
this.markupsApiUrl = '/api/markups';
|
|
6161
6676
|
this.redactApiUrl = '/api/redaction';
|
|
6677
|
+
this.markupsSearchApiUrl = '/api/markups/search';
|
|
6162
6678
|
}
|
|
6163
6679
|
RedactionApiService.prototype.getRedactions = function (documentId) {
|
|
6164
6680
|
var fixedUrl = this.markupsApiUrl + "/" + documentId;
|
|
@@ -6170,6 +6686,11 @@
|
|
|
6170
6686
|
.post(this.markupsApiUrl, body, { observe: 'response', withCredentials: true })
|
|
6171
6687
|
.pipe(operators.map(function (response) { return response.body; }), operators.catchError(function () { return []; }));
|
|
6172
6688
|
};
|
|
6689
|
+
RedactionApiService.prototype.saveBulkRedaction = function (body) {
|
|
6690
|
+
return this.httpClient
|
|
6691
|
+
.post(this.markupsSearchApiUrl, body, { observe: 'response', withCredentials: true })
|
|
6692
|
+
.pipe(operators.map(function (response) { return response.body; }), operators.catchError(function () { return []; }));
|
|
6693
|
+
};
|
|
6173
6694
|
RedactionApiService.prototype.deleteRedaction = function (payload) {
|
|
6174
6695
|
var url = this.markupsApiUrl + "/" + payload.documentId + "/" + payload.redactionId;
|
|
6175
6696
|
return this.httpClient
|
|
@@ -6198,10 +6719,11 @@
|
|
|
6198
6719
|
]; };
|
|
6199
6720
|
|
|
6200
6721
|
var RedactionEffects = /** @class */ (function () {
|
|
6201
|
-
function RedactionEffects(actions$, redactionApiService) {
|
|
6722
|
+
function RedactionEffects(actions$, redactionApiService, toolbarEvents) {
|
|
6202
6723
|
var _this = this;
|
|
6203
6724
|
this.actions$ = actions$;
|
|
6204
6725
|
this.redactionApiService = redactionApiService;
|
|
6726
|
+
this.toolbarEvents = toolbarEvents;
|
|
6205
6727
|
this.loadRedactions$ = this.actions$.pipe(effects$1.ofType(LOAD_REDACTIONS), operators.map(function (action) { return action.payload; }), operators.switchMap(function (documentId) {
|
|
6206
6728
|
return _this.redactionApiService.getRedactions(documentId).pipe(operators.map(function (resp) {
|
|
6207
6729
|
return new LoadRedactionSuccess(resp.body);
|
|
@@ -6216,6 +6738,13 @@
|
|
|
6216
6738
|
return rxjs.of(new SaveRedactionFailure(error));
|
|
6217
6739
|
}));
|
|
6218
6740
|
}));
|
|
6741
|
+
this.saveBulkRedaction$ = this.actions$.pipe(effects$1.ofType(SAVE_BULK_REDACTION), operators.map(function (action) { return action.payload; }), operators.exhaustMap(function (redaction) {
|
|
6742
|
+
return _this.redactionApiService.saveBulkRedaction(redaction).pipe(operators.tap(function () { return _this.toolbarEvents.redactAllInProgressSubject.next(false); })).pipe(operators.map(function (resp) {
|
|
6743
|
+
return new SaveBulkRedactionSuccess(resp);
|
|
6744
|
+
}), operators.catchError(function (error) {
|
|
6745
|
+
return rxjs.of(new SaveBulkRedactionFailure(error));
|
|
6746
|
+
}));
|
|
6747
|
+
}));
|
|
6219
6748
|
this.deleteRedaction$ = this.actions$.pipe(effects$1.ofType(DELETE_REDACTION), operators.map(function (action) { return action.payload; }), operators.exhaustMap(function (redactionPayload) {
|
|
6220
6749
|
return _this.redactionApiService.deleteRedaction(redactionPayload).pipe(operators.map(function () {
|
|
6221
6750
|
return new DeleteRedactionSuccess(redactionPayload);
|
|
@@ -6249,7 +6778,8 @@
|
|
|
6249
6778
|
/** @nocollapse */
|
|
6250
6779
|
RedactionEffects.ctorParameters = function () { return [
|
|
6251
6780
|
{ type: effects$1.Actions },
|
|
6252
|
-
{ type: RedactionApiService }
|
|
6781
|
+
{ type: RedactionApiService },
|
|
6782
|
+
{ type: ToolbarEventService }
|
|
6253
6783
|
]; };
|
|
6254
6784
|
__decorate([
|
|
6255
6785
|
effects$1.Effect(),
|
|
@@ -6259,6 +6789,10 @@
|
|
|
6259
6789
|
effects$1.Effect(),
|
|
6260
6790
|
__metadata("design:type", Object)
|
|
6261
6791
|
], RedactionEffects.prototype, "saveRedaction$", void 0);
|
|
6792
|
+
__decorate([
|
|
6793
|
+
effects$1.Effect(),
|
|
6794
|
+
__metadata("design:type", Object)
|
|
6795
|
+
], RedactionEffects.prototype, "saveBulkRedaction$", void 0);
|
|
6262
6796
|
__decorate([
|
|
6263
6797
|
effects$1.Effect(),
|
|
6264
6798
|
__metadata("design:type", Object)
|
|
@@ -6404,118 +6938,6 @@
|
|
|
6404
6938
|
|
|
6405
6939
|
var effects = [AnnotationEffects, BookmarksEffects, RedactionEffects, DocumentEffects, IcpEffects];
|
|
6406
6940
|
|
|
6407
|
-
var BookmarksComponent = /** @class */ (function () {
|
|
6408
|
-
function BookmarksComponent(store) {
|
|
6409
|
-
this.store = store;
|
|
6410
|
-
this.goToDestination = new i0.EventEmitter();
|
|
6411
|
-
this.pageLookup = {};
|
|
6412
|
-
this.BOOKMARK_CHAR_LIMIT = 30;
|
|
6413
|
-
this.options = {
|
|
6414
|
-
allowDrag: true,
|
|
6415
|
-
allowDrop: true
|
|
6416
|
-
};
|
|
6417
|
-
}
|
|
6418
|
-
BookmarksComponent.prototype.ngOnInit = function () {
|
|
6419
|
-
var _this = this;
|
|
6420
|
-
this.$subscription = this.store.pipe(store.select(getEditableBookmark))
|
|
6421
|
-
.subscribe(function (editableId) { return _this.editableBookmark = editableId; });
|
|
6422
|
-
this.$subscription.add(this.store.select(getPages)
|
|
6423
|
-
.subscribe(function (pages) {
|
|
6424
|
-
Object.keys(pages).map(function (key) {
|
|
6425
|
-
_this.pageLookup[key] = pages[key];
|
|
6426
|
-
});
|
|
6427
|
-
}));
|
|
6428
|
-
};
|
|
6429
|
-
BookmarksComponent.prototype.ngOnDestroy = function () {
|
|
6430
|
-
this.$subscription.unsubscribe();
|
|
6431
|
-
};
|
|
6432
|
-
BookmarksComponent.prototype.editBookmark = function (id) {
|
|
6433
|
-
this.editableBookmark = id;
|
|
6434
|
-
};
|
|
6435
|
-
BookmarksComponent.prototype.onBookmarkMove = function (_a) {
|
|
6436
|
-
var node = _a.node, from = _a.from, to = _a.to;
|
|
6437
|
-
var movedBookmarks = [Object.assign(Object.assign({}, node), { previous: to.index > 0 ? to.parent.children[to.index - 1].id : undefined, parent: to.parent.documentId ? to.parent.id : undefined })];
|
|
6438
|
-
var fromNext = this.getSibling(from, from.index);
|
|
6439
|
-
fromNext = fromNext && fromNext.id === node.previous ? this.getSibling(from, from.index + 1) : fromNext;
|
|
6440
|
-
if (fromNext) {
|
|
6441
|
-
movedBookmarks = __spread(movedBookmarks, [Object.assign(Object.assign({}, fromNext), { previous: node.previous })]);
|
|
6442
|
-
}
|
|
6443
|
-
var toNext = this.getSibling(to, to.index + 1);
|
|
6444
|
-
if (toNext) {
|
|
6445
|
-
movedBookmarks = __spread(movedBookmarks, [Object.assign(Object.assign({}, toNext), { previous: node.id })]);
|
|
6446
|
-
}
|
|
6447
|
-
this.store.dispatch(new MoveBookmark(movedBookmarks));
|
|
6448
|
-
};
|
|
6449
|
-
BookmarksComponent.prototype.deleteBookmark = function (node) {
|
|
6450
|
-
var next;
|
|
6451
|
-
var siblings = node.parent.children;
|
|
6452
|
-
if (siblings.length > node.index + 1) {
|
|
6453
|
-
next = siblings[node.index + 1].data;
|
|
6454
|
-
next.previous = node.data.previous;
|
|
6455
|
-
}
|
|
6456
|
-
this.store.dispatch(new DeleteBookmark({
|
|
6457
|
-
deleted: __spread([node.data.id], getBookmarkChildren(node.data.children)),
|
|
6458
|
-
updated: next
|
|
6459
|
-
}));
|
|
6460
|
-
};
|
|
6461
|
-
BookmarksComponent.prototype.updateBookmark = function (bookmark, name) {
|
|
6462
|
-
var editedBookmark = Object.assign(Object.assign({}, bookmark), { name: name });
|
|
6463
|
-
if (name) {
|
|
6464
|
-
this.store.dispatch(new UpdateBookmark(editedBookmark));
|
|
6465
|
-
this.editableBookmark = undefined;
|
|
6466
|
-
}
|
|
6467
|
-
};
|
|
6468
|
-
BookmarksComponent.prototype.goToBookmark = function (bookmark) {
|
|
6469
|
-
var thisPage = this.pageLookup[bookmark.pageNumber + 1];
|
|
6470
|
-
var defaultHeight = thisPage.styles.height;
|
|
6471
|
-
var defaultScaleY = this.scaledY(bookmark.yCoordinate, defaultHeight, thisPage);
|
|
6472
|
-
var top = 0, left = 0;
|
|
6473
|
-
switch (this.rotate) {
|
|
6474
|
-
case 90:
|
|
6475
|
-
left = -defaultScaleY;
|
|
6476
|
-
break;
|
|
6477
|
-
case 180:
|
|
6478
|
-
top = this.scaledY(bookmark.yCoordinate, (defaultHeight - (24 * this.zoom)), thisPage);
|
|
6479
|
-
break;
|
|
6480
|
-
case 270:
|
|
6481
|
-
left = defaultScaleY;
|
|
6482
|
-
break;
|
|
6483
|
-
default:
|
|
6484
|
-
top = defaultScaleY;
|
|
6485
|
-
}
|
|
6486
|
-
this.goToDestination.emit([
|
|
6487
|
-
bookmark.pageNumber,
|
|
6488
|
-
{ 'name': 'XYZ' },
|
|
6489
|
-
left,
|
|
6490
|
-
top
|
|
6491
|
-
]);
|
|
6492
|
-
};
|
|
6493
|
-
BookmarksComponent.prototype.getSibling = function (node, index) {
|
|
6494
|
-
return node.parent.children.length > index ? node.parent.children[index] : undefined;
|
|
6495
|
-
};
|
|
6496
|
-
BookmarksComponent.prototype.scaledY = function (yCoordinate, height, page) {
|
|
6497
|
-
var viewportScale = page.viewportScale / this.zoom;
|
|
6498
|
-
return ((height / this.zoom) - yCoordinate) / viewportScale;
|
|
6499
|
-
};
|
|
6500
|
-
return BookmarksComponent;
|
|
6501
|
-
}());
|
|
6502
|
-
BookmarksComponent.decorators = [
|
|
6503
|
-
{ type: i0.Component, args: [{
|
|
6504
|
-
selector: 'mv-bookmarks',
|
|
6505
|
-
template: "<tree-root [nodes]=\"bookmarkNodes\"\n class=\"bookmarks-tree\"\n [options]=\"options\"\n (moveNode)=\"onBookmarkMove($event)\">\n <ng-template #treeNodeTemplate let-node let-index=\"index\">\n <div class=\"outlineItem\" *ngIf=\"node.data.id !== editableBookmark; else inputBookmark\">\n <a (click)=\"goToBookmark(node.data)\">\n {{ node.data.name }}\n </a>\n <button class=\"bookmark__rename\" (click)=\"editBookmark(node.data.id)\" ></button>\n <button class=\"bookmark__delete\" (click)=\"deleteBookmark(node)\"></button>\n </div>\n <ng-template #inputBookmark>\n <input #bookmarkName class=\"bookmark__input\" [value]=\"node.data.name\" [maxLength]=\"BOOKMARK_CHAR_LIMIT\">\n <button class=\"bookmark__save\" (click)=\"updateBookmark(node.data, bookmarkName.value)\"></button>\n </ng-template>\n <a *ngIf=\"bookmarkNodes?.length === 0\" class=\"outlineItem\">No bookmarks created yet</a>\n </ng-template>\n</tree-root>\n"
|
|
6506
|
-
},] }
|
|
6507
|
-
];
|
|
6508
|
-
/** @nocollapse */
|
|
6509
|
-
BookmarksComponent.ctorParameters = function () { return [
|
|
6510
|
-
{ type: store.Store }
|
|
6511
|
-
]; };
|
|
6512
|
-
BookmarksComponent.propDecorators = {
|
|
6513
|
-
bookmarkNodes: [{ type: i0.Input }],
|
|
6514
|
-
zoom: [{ type: i0.Input }],
|
|
6515
|
-
rotate: [{ type: i0.Input }],
|
|
6516
|
-
goToDestination: [{ type: i0.Output }]
|
|
6517
|
-
};
|
|
6518
|
-
|
|
6519
6941
|
var ConvertibleContentViewerComponent = /** @class */ (function () {
|
|
6520
6942
|
function ConvertibleContentViewerComponent(store) {
|
|
6521
6943
|
this.store = store;
|
|
@@ -6798,7 +7220,7 @@
|
|
|
6798
7220
|
var top = rect.top - parentRect.top;
|
|
6799
7221
|
var left = rect.left - parentRect.left;
|
|
6800
7222
|
var rectangle = this.highlightService.applyRotation(this.pageHeight, this.pageWidth, height, width, top, left, this.rotate, this.zoom);
|
|
6801
|
-
rectangle = Object.assign({ id:
|
|
7223
|
+
rectangle = Object.assign({ id: uuid$1.v4() }, rectangle);
|
|
6802
7224
|
return rectangle;
|
|
6803
7225
|
};
|
|
6804
7226
|
HighlightCreateDirective.prototype.removeEnhancedTextModeStyling = function (element) {
|
|
@@ -7045,50 +7467,51 @@
|
|
|
7045
7467
|
exports["ɵ6"] = ɵ6;
|
|
7046
7468
|
exports["ɵ7"] = ɵ7;
|
|
7047
7469
|
exports["ɵa"] = NumberHelperService;
|
|
7048
|
-
exports["ɵba"] =
|
|
7049
|
-
exports["ɵbb"] =
|
|
7050
|
-
exports["ɵbc"] =
|
|
7051
|
-
exports["ɵbd"] =
|
|
7052
|
-
exports["ɵbe"] =
|
|
7053
|
-
exports["ɵbf"] =
|
|
7054
|
-
exports["ɵbg"] =
|
|
7055
|
-
exports["ɵbh"] =
|
|
7056
|
-
exports["ɵbi"] =
|
|
7057
|
-
exports["ɵbj"] =
|
|
7058
|
-
exports["ɵbk"] =
|
|
7059
|
-
exports["ɵbl"] =
|
|
7060
|
-
exports["ɵbm"] =
|
|
7061
|
-
exports["ɵbn"] =
|
|
7062
|
-
exports["ɵbo"] =
|
|
7063
|
-
exports["ɵbp"] =
|
|
7064
|
-
exports["ɵbq"] =
|
|
7065
|
-
exports["ɵbr"] =
|
|
7066
|
-
exports["ɵbs"] =
|
|
7067
|
-
exports["ɵbt"] =
|
|
7068
|
-
exports["ɵbu"] =
|
|
7069
|
-
exports["ɵbv"] =
|
|
7070
|
-
exports["ɵbw"] =
|
|
7071
|
-
exports["ɵbx"] =
|
|
7072
|
-
exports["ɵby"] =
|
|
7073
|
-
exports["ɵbz"] =
|
|
7470
|
+
exports["ɵba"] = TagsServices;
|
|
7471
|
+
exports["ɵbb"] = TextHighlightDirective;
|
|
7472
|
+
exports["ɵbc"] = CtxToolbarComponent;
|
|
7473
|
+
exports["ɵbd"] = CommentSetRenderService;
|
|
7474
|
+
exports["ɵbe"] = CommentsNavigateComponent;
|
|
7475
|
+
exports["ɵbf"] = TextareaAutoExpandDirective;
|
|
7476
|
+
exports["ɵbg"] = PrintService;
|
|
7477
|
+
exports["ɵbh"] = BookmarksApiService;
|
|
7478
|
+
exports["ɵbi"] = effects;
|
|
7479
|
+
exports["ɵbj"] = BookmarksEffects;
|
|
7480
|
+
exports["ɵbk"] = RedactionEffects;
|
|
7481
|
+
exports["ɵbl"] = RedactionApiService;
|
|
7482
|
+
exports["ɵbm"] = DocumentEffects;
|
|
7483
|
+
exports["ɵbn"] = DocumentConversionApiService;
|
|
7484
|
+
exports["ɵbo"] = RotationApiService;
|
|
7485
|
+
exports["ɵbp"] = IcpEffects;
|
|
7486
|
+
exports["ɵbq"] = IcpSessionApiService;
|
|
7487
|
+
exports["ɵbr"] = IcpUpdateService;
|
|
7488
|
+
exports["ɵbs"] = SocketService;
|
|
7489
|
+
exports["ɵbt"] = PdfViewerComponent;
|
|
7490
|
+
exports["ɵbu"] = PdfJsWrapperFactory;
|
|
7491
|
+
exports["ɵbv"] = IcpService;
|
|
7492
|
+
exports["ɵbw"] = IcpPresenterService;
|
|
7493
|
+
exports["ɵbx"] = IcpFollowerService;
|
|
7494
|
+
exports["ɵby"] = SideBarComponent;
|
|
7495
|
+
exports["ɵbz"] = BookmarksComponent;
|
|
7074
7496
|
exports["ɵc"] = reducers;
|
|
7075
|
-
exports["ɵca"] =
|
|
7076
|
-
exports["ɵcb"] =
|
|
7077
|
-
exports["ɵcc"] =
|
|
7078
|
-
exports["ɵcd"] =
|
|
7079
|
-
exports["ɵce"] =
|
|
7080
|
-
exports["ɵcf"] =
|
|
7081
|
-
exports["ɵcg"] =
|
|
7082
|
-
exports["ɵch"] =
|
|
7083
|
-
exports["ɵci"] =
|
|
7084
|
-
exports["ɵcj"] =
|
|
7085
|
-
exports["ɵck"] =
|
|
7086
|
-
exports["ɵcl"] =
|
|
7087
|
-
exports["ɵcm"] =
|
|
7088
|
-
exports["ɵcn"] =
|
|
7089
|
-
exports["ɵco"] =
|
|
7090
|
-
exports["ɵcp"] =
|
|
7091
|
-
exports["ɵcq"] =
|
|
7497
|
+
exports["ɵca"] = OutlineItemComponent;
|
|
7498
|
+
exports["ɵcb"] = ImageViewerComponent;
|
|
7499
|
+
exports["ɵcc"] = ViewerUtilService;
|
|
7500
|
+
exports["ɵcd"] = UnsupportedViewerComponent;
|
|
7501
|
+
exports["ɵce"] = MultimediaPlayerComponent;
|
|
7502
|
+
exports["ɵcf"] = ConvertibleContentViewerComponent;
|
|
7503
|
+
exports["ɵcg"] = GrabNDragDirective;
|
|
7504
|
+
exports["ɵch"] = RotationPersistDirective;
|
|
7505
|
+
exports["ɵci"] = HighlightCreateDirective;
|
|
7506
|
+
exports["ɵcj"] = ConfirmActionDialogComponent;
|
|
7507
|
+
exports["ɵck"] = RedactionComponent;
|
|
7508
|
+
exports["ɵcl"] = BookmarkIconsComponent;
|
|
7509
|
+
exports["ɵcm"] = ParticipantsListComponent;
|
|
7510
|
+
exports["ɵcn"] = getDocumentState;
|
|
7511
|
+
exports["ɵco"] = getPages;
|
|
7512
|
+
exports["ɵcp"] = getTagsRootState;
|
|
7513
|
+
exports["ɵcq"] = getTagFiltered;
|
|
7514
|
+
exports["ɵcr"] = getFilteredPageEntities;
|
|
7092
7515
|
exports["ɵd"] = getMVState;
|
|
7093
7516
|
exports["ɵf"] = docReducer;
|
|
7094
7517
|
exports["ɵg"] = getDocPages;
|
|
@@ -7098,17 +7521,17 @@
|
|
|
7098
7521
|
exports["ɵl"] = bookmarksReducer;
|
|
7099
7522
|
exports["ɵm"] = redactionReducer;
|
|
7100
7523
|
exports["ɵn"] = icpReducer;
|
|
7101
|
-
exports["ɵp"] =
|
|
7102
|
-
exports["ɵq"] =
|
|
7103
|
-
exports["ɵr"] =
|
|
7104
|
-
exports["ɵs"] =
|
|
7105
|
-
exports["ɵt"] =
|
|
7106
|
-
exports["ɵu"] =
|
|
7107
|
-
exports["ɵv"] =
|
|
7108
|
-
exports["ɵw"] =
|
|
7109
|
-
exports["ɵx"] =
|
|
7110
|
-
exports["ɵy"] =
|
|
7111
|
-
exports["ɵz"] =
|
|
7524
|
+
exports["ɵp"] = RedactionSearchBarComponent;
|
|
7525
|
+
exports["ɵq"] = HighlightCreateService;
|
|
7526
|
+
exports["ɵr"] = SharedModule;
|
|
7527
|
+
exports["ɵs"] = GovUkDateComponent;
|
|
7528
|
+
exports["ɵt"] = GovUkErrorMessageComponent;
|
|
7529
|
+
exports["ɵu"] = GovUkFieldsetComponent;
|
|
7530
|
+
exports["ɵv"] = GovUkLabelComponent;
|
|
7531
|
+
exports["ɵw"] = ViewerEventService;
|
|
7532
|
+
exports["ɵx"] = CommentService;
|
|
7533
|
+
exports["ɵy"] = RectangleComponent;
|
|
7534
|
+
exports["ɵz"] = CommentComponent;
|
|
7112
7535
|
|
|
7113
7536
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7114
7537
|
|