@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.
@@ -3602,12 +3602,13 @@
3602
3602
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3603
3603
  */
3604
3604
  var ImageViewerComponent = /** @class */ (function () {
3605
- function ImageViewerComponent(store$$1, printService, viewerUtilService, toolbarEvents, toolbarButtons) {
3605
+ function ImageViewerComponent(store$$1, printService, viewerUtilService, toolbarEvents, toolbarButtons, viewerEvents) {
3606
3606
  this.store = store$$1;
3607
3607
  this.printService = printService;
3608
3608
  this.viewerUtilService = viewerUtilService;
3609
3609
  this.toolbarEvents = toolbarEvents;
3610
3610
  this.toolbarButtons = toolbarButtons;
3611
+ this.viewerEvents = viewerEvents;
3611
3612
  this.mediaLoadStatus = new i0.EventEmitter();
3612
3613
  this.imageViewerException = new i0.EventEmitter();
3613
3614
  this.rotation = 0;
@@ -3644,6 +3645,26 @@
3644
3645
  * @return {?}
3645
3646
  */function (toggle) { return _this.showCommentsPanel = toggle; })));
3646
3647
  };
3648
+ /**
3649
+ * @param {?} event
3650
+ * @return {?}
3651
+ */
3652
+ ImageViewerComponent.prototype.onImageViewerClick = /**
3653
+ * @param {?} event
3654
+ * @return {?}
3655
+ */
3656
+ function (event) {
3657
+ /** @type {?} */
3658
+ var classNme = (( /** @type {?} */(event.target))).className;
3659
+ if (classNme.startsWith('pageContainer')) {
3660
+ this.store.dispatch(new SelectedAnnotation({
3661
+ annotationId: '',
3662
+ selected: false,
3663
+ editable: false,
3664
+ }));
3665
+ this.viewerEvents.clearCtxToolbar();
3666
+ }
3667
+ };
3647
3668
  /**
3648
3669
  * @return {?}
3649
3670
  */
@@ -3887,7 +3908,7 @@
3887
3908
  ImageViewerComponent.decorators = [
3888
3909
  { type: i0.Component, args: [{
3889
3910
  selector: 'mv-image-viewer',
3890
- 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"
3911
+ 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"
3891
3912
  }] }
3892
3913
  ];
3893
3914
  /** @nocollapse */
@@ -3897,7 +3918,8 @@
3897
3918
  { type: PrintService },
3898
3919
  { type: ViewerUtilService },
3899
3920
  { type: ToolbarEventService },
3900
- { type: ToolbarButtonVisibilityService }
3921
+ { type: ToolbarButtonVisibilityService },
3922
+ { type: ViewerEventService }
3901
3923
  ];
3902
3924
  };
3903
3925
  ImageViewerComponent.propDecorators = {
@@ -3908,7 +3930,8 @@
3908
3930
  height: [{ type: i0.Input }],
3909
3931
  mediaLoadStatus: [{ type: i0.Output }],
3910
3932
  imageViewerException: [{ type: i0.Output }],
3911
- img: [{ type: i0.ViewChild, args: ['img',] }]
3933
+ img: [{ type: i0.ViewChild, args: ['img',] }],
3934
+ onImageViewerClick: [{ type: i0.HostListener, args: ['mousedown', ['$event'],] }]
3912
3935
  };
3913
3936
  return ImageViewerComponent;
3914
3937
  }());