@hmcts/media-viewer 2.7.21 → 2.7.22

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.
@@ -3522,12 +3522,13 @@ var ViewerUtilService = /** @class */ (function () {
3522
3522
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3523
3523
  */
3524
3524
  var ImageViewerComponent = /** @class */ (function () {
3525
- function ImageViewerComponent(store, printService, viewerUtilService, toolbarEvents, toolbarButtons) {
3525
+ function ImageViewerComponent(store, printService, viewerUtilService, toolbarEvents, toolbarButtons, viewerEvents) {
3526
3526
  this.store = store;
3527
3527
  this.printService = printService;
3528
3528
  this.viewerUtilService = viewerUtilService;
3529
3529
  this.toolbarEvents = toolbarEvents;
3530
3530
  this.toolbarButtons = toolbarButtons;
3531
+ this.viewerEvents = viewerEvents;
3531
3532
  this.mediaLoadStatus = new EventEmitter();
3532
3533
  this.imageViewerException = new EventEmitter();
3533
3534
  this.rotation = 0;
@@ -3571,6 +3572,26 @@ var ImageViewerComponent = /** @class */ (function () {
3571
3572
  */
3572
3573
  function (toggle) { return _this.showCommentsPanel = toggle; })));
3573
3574
  };
3575
+ /**
3576
+ * @param {?} event
3577
+ * @return {?}
3578
+ */
3579
+ ImageViewerComponent.prototype.onImageViewerClick = /**
3580
+ * @param {?} event
3581
+ * @return {?}
3582
+ */
3583
+ function (event) {
3584
+ /** @type {?} */
3585
+ var classNme = ((/** @type {?} */ (event.target))).className;
3586
+ if (classNme.startsWith('pageContainer')) {
3587
+ this.store.dispatch(new SelectedAnnotation({
3588
+ annotationId: '',
3589
+ selected: false,
3590
+ editable: false,
3591
+ }));
3592
+ this.viewerEvents.clearCtxToolbar();
3593
+ }
3594
+ };
3574
3595
  /**
3575
3596
  * @return {?}
3576
3597
  */
@@ -3815,7 +3836,7 @@ var ImageViewerComponent = /** @class */ (function () {
3815
3836
  ImageViewerComponent.decorators = [
3816
3837
  { type: Component, args: [{
3817
3838
  selector: 'mv-image-viewer',
3818
- template: "<mv-comment-set-header [ngClass]=\"{'show-comments-panel': showCommentsPanel}\"\n [showCommentSummary]=\"toolbarButtons.showCommentSummary\"\n (showCommentSummaryDialog)=\"toggleCommentsSummary()\">\n</mv-comment-set-header>\n<div mvGrabNDrag [dragX]=\"imageContainer\" [dragEnabled]=\"enableGrabNDrag\"\n id=\"viewer-wrapper\"\n [ngStyle]=\"{ height: height }\"\n [ngClass]=\"{ 'grabNDrag': enableGrabNDrag }\"\n *ngIf=\"url && !errorMessage\">\n <div #imageContainer mvCreateTextHighlight id=\"image-container\"\n [ngClass]=\"{ 'image-container': true, 'annotations': enableAnnotations, 'show-comments-panel': showCommentsPanel }\"\n [style.height.px]=\"imageHeight\">\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 <div class=\"comments\" [style.height.px]=\"imageHeight\">\n <mv-comment-set *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</div>\n"
3839
+ template: "<mv-comment-set-header [ngClass]=\"{'show-comments-panel': showCommentsPanel}\"\n [showCommentSummary]=\"toolbarButtons.showCommentSummary\"\n (showCommentSummaryDialog)=\"toggleCommentsSummary()\">\n</mv-comment-set-header>\n<div mvGrabNDrag [dragX]=\"imageContainer\" [dragEnabled]=\"enableGrabNDrag\"\n id=\"viewer-wrapper\"\n [ngStyle]=\"{ height: height }\"\n [ngClass]=\"{ 'grabNDrag': enableGrabNDrag }\"\n *ngIf=\"url && !errorMessage\">\n <div #imageContainer id=\"image-container\"\n [ngClass]=\"{ 'image-container': true, 'annotations': enableAnnotations, 'show-comments-panel': showCommentsPanel }\"\n [style.height.px]=\"imageHeight\">\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 <div class=\"comments\" [style.height.px]=\"imageHeight\">\n <mv-comment-set *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</div>\n"
3819
3840
  }] }
3820
3841
  ];
3821
3842
  /** @nocollapse */
@@ -3824,7 +3845,8 @@ var ImageViewerComponent = /** @class */ (function () {
3824
3845
  { type: PrintService },
3825
3846
  { type: ViewerUtilService },
3826
3847
  { type: ToolbarEventService },
3827
- { type: ToolbarButtonVisibilityService }
3848
+ { type: ToolbarButtonVisibilityService },
3849
+ { type: ViewerEventService }
3828
3850
  ]; };
3829
3851
  ImageViewerComponent.propDecorators = {
3830
3852
  url: [{ type: Input }],
@@ -3834,7 +3856,8 @@ var ImageViewerComponent = /** @class */ (function () {
3834
3856
  height: [{ type: Input }],
3835
3857
  mediaLoadStatus: [{ type: Output }],
3836
3858
  imageViewerException: [{ type: Output }],
3837
- img: [{ type: ViewChild, args: ['img',] }]
3859
+ img: [{ type: ViewChild, args: ['img',] }],
3860
+ onImageViewerClick: [{ type: HostListener, args: ['mousedown', ['$event'],] }]
3838
3861
  };
3839
3862
  return ImageViewerComponent;
3840
3863
  }());