@hmcts/media-viewer 2.7.19 → 2.7.21

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.
Files changed (24) hide show
  1. package/assets/sass/rectangle.scss +1 -4
  2. package/bundles/hmcts-media-viewer.umd.js +33 -9
  3. package/bundles/hmcts-media-viewer.umd.js.map +1 -1
  4. package/bundles/hmcts-media-viewer.umd.min.js +1 -1
  5. package/bundles/hmcts-media-viewer.umd.min.js.map +1 -1
  6. package/esm2015/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.directive.js +14 -4
  7. package/esm2015/lib/toolbar/search-bar/search-bar.component.js +13 -2
  8. package/esm2015/lib/viewers/image-viewer/image-viewer.component.js +2 -2
  9. package/esm2015/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.js +5 -3
  10. package/esm2015/lib/viewers/pdf-viewer/side-bar/side-bar.component.js +2 -2
  11. package/esm5/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.directive.js +19 -5
  12. package/esm5/lib/toolbar/search-bar/search-bar.component.js +14 -2
  13. package/esm5/lib/viewers/image-viewer/image-viewer.component.js +2 -2
  14. package/esm5/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.js +5 -3
  15. package/esm5/lib/viewers/pdf-viewer/side-bar/side-bar.component.js +2 -2
  16. package/fesm2015/hmcts-media-viewer.js +29 -8
  17. package/fesm2015/hmcts-media-viewer.js.map +1 -1
  18. package/fesm5/hmcts-media-viewer.js +35 -9
  19. package/fesm5/hmcts-media-viewer.js.map +1 -1
  20. package/hmcts-media-viewer-v2.7.21.tgz +0 -0
  21. package/hmcts-media-viewer.metadata.json +1 -1
  22. package/lib/toolbar/search-bar/search-bar.component.d.ts +1 -0
  23. package/package.json +1 -1
  24. package/hmcts-media-viewer-v2.7.19.tgz +0 -0
@@ -3815,7 +3815,7 @@ var ImageViewerComponent = /** @class */ (function () {
3815
3815
  ImageViewerComponent.decorators = [
3816
3816
  { type: Component, args: [{
3817
3817
  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 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"
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"
3819
3819
  }] }
3820
3820
  ];
3821
3821
  /** @nocollapse */
@@ -5222,10 +5222,19 @@ var SearchBarComponent = /** @class */ (function () {
5222
5222
  * @return {?}
5223
5223
  */
5224
5224
  function (results) {
5225
+ var _this = this;
5225
5226
  this.resultCount = results.total;
5226
5227
  this.resultsText = this.resultCount > 0
5227
5228
  ? "Found " + results.current + " of " + results.total
5228
5229
  : 'No results found';
5230
+ if (this.resultCount && this.resultCount > 0) {
5231
+ setTimeout((/**
5232
+ * @return {?}
5233
+ */
5234
+ function () {
5235
+ _this.findNext.nativeElement.focus();
5236
+ }), 200);
5237
+ }
5229
5238
  };
5230
5239
  /**
5231
5240
  * @param {?} e
@@ -5270,7 +5279,7 @@ var SearchBarComponent = /** @class */ (function () {
5270
5279
  SearchBarComponent.decorators = [
5271
5280
  { type: Component, args: [{
5272
5281
  selector: 'mv-search-bar',
5273
- template: "<div class=\"searchbar govuk-!-padding-3\" [hidden]=\"toolbarEvents.searchBarHidden | async\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <input class=\"govuk-input govuk-!-display-inline-block govuk-!-width-three-quarters govuk-!-margin-bottom-5 govuk-!-margin-top-5\"\n type=\"text\" aria-label=\"Find in document\" #findInput [(ngModel)]=\"searchText\" (keydown.escape)=\"onEscapeKeyPress($event)\" (keydown.enter)=\"onEnterKeyPress($event)\" title=\"Find in document\"\n placeholder=\"Find in document\u2026\" tabindex=\"0\" data-l10n-id=\"find_input\" />\n <button class=\"govuk-button govuk-!-display-inline-block govuk-!-margin-bottom-4\" data-module=\"govuk-button\"\n (click)=\"search()\" style=\" position: absolute; top: 40px; right: 10px; \">\n Search\n </button>\n <button id=\"mvCloseBtn\" #mvCloseBtn class=\"mv-button searchbar-button--close\" title=\"Close Search\" data-l10n-id=\"mvRedactBtn\"\n (click)=\"toggleSearchBar()\">\n </button>\n </div>\n </div>\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-three-quarters\">\n <span id=\"findResultsCount\" class=\"govuk-!-display-inline-block govuk-!-margin-right-4\">{{resultsText}}</span>\n <a *ngIf=\"resultCount > 0\" [routerLink]=\"\" class=\"govuk-link govuk-link--no-visited-state govuk-!-margin-right-2\"\n (click)=\"searchPrev()\" title=\"Find the previous occurrence of the phrase\" data-l10n-id=\"find_previous\">Prev</a>\n <a *ngIf=\"resultCount > 0\" [routerLink]=\"\" class=\"govuk-link govuk-link--no-visited-state\" (click)=\"searchNext()\"\n title=\"Find the next occurrence of the phrase\" data-l10n-id=\"find_next\">Next</a>\n </div>\n <div class=\"govuk-grid-column-one-quarter\">\n <a [routerLink]=\"\" class=\"govuk-link govuk-link--no-visited-state\" (click)=\"toggleAdvancedSearch()\" title=\"Advanced\"\n data-l10n-id=\"find_advanced\" style=\" position: absolute; top: 95px; right: 15px; \">Advanced</a>\n </div>\n </div>\n\n <div class=\"govuk-grid-row\" *ngIf=\"advancedSearchVisible\">\n <div class=\"govuk-grid-column-full\">\n <div class=\"govuk-form-group govuk-!-margin-top-3 govuk-!-margin-bottom-1\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"advanced\">\n <div class=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"findHighlightAll\" name=\"findHighlightAll\" type=\"checkbox\"\n (change)=\"highlightAll = !highlightAll; search()\" [checked]=\"highlightAll\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"findHighlightAll\" data-l10n-id=\"find_highlight\">\n Highlight all\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"findMatchCase\" name=\"findMatchCase\" type=\"checkbox\"\n (change)=\"matchCase = !matchCase; search()\" [checked]=\"matchCase\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"findMatchCase\"\n data-l10n-id=\"find_match_case_label\">\n Match text (exact case)\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"findEntireWord\" name=\"findMatchCase\" type=\"checkbox\"\n (change)=\"wholeWord = !wholeWord; search()\" [checked]=\"wholeWord\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"findEntireWord\"\n data-l10n-id=\"find_entire_word_label\">\n Match whole words or sentences\n </label>\n </div>\n </div>\n </fieldset>\n </div>\n </div>\n </div>\n</div>\n"
5282
+ template: "<div class=\"searchbar govuk-!-padding-3\" [hidden]=\"toolbarEvents.searchBarHidden | async\">\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <input class=\"govuk-input govuk-!-display-inline-block govuk-!-width-three-quarters govuk-!-margin-bottom-5 govuk-!-margin-top-5\"\n type=\"text\" aria-label=\"Find in document\" #findInput [(ngModel)]=\"searchText\" (keydown.escape)=\"onEscapeKeyPress($event)\" (keydown.enter)=\"onEnterKeyPress($event)\" title=\"Find in document\"\n placeholder=\"Find in document\u2026\" tabindex=\"0\" data-l10n-id=\"find_input\" />\n <button class=\"govuk-button govuk-!-display-inline-block govuk-!-margin-bottom-4\" data-module=\"govuk-button\"\n (click)=\"search()\" style=\" position: absolute; top: 40px; right: 10px; \">\n Search\n </button>\n <button id=\"mvCloseBtn\" #mvCloseBtn class=\"mv-button searchbar-button--close\" title=\"Close Search\" data-l10n-id=\"mvRedactBtn\"\n (click)=\"toggleSearchBar()\">\n </button>\n </div>\n </div>\n\n <div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-three-quarters\">\n <span id=\"findResultsCount\" class=\"govuk-!-display-inline-block govuk-!-margin-right-4\">{{resultsText}}</span>\n <a *ngIf=\"resultCount > 0\" [routerLink]=\"\" class=\"govuk-link govuk-link--no-visited-state govuk-!-margin-right-2\"\n (click)=\"searchPrev()\" title=\"Find the previous occurrence of the phrase\" data-l10n-id=\"find_previous\">Prev</a>\n <a *ngIf=\"resultCount > 0\" [routerLink]=\"\" #findNext class=\"govuk-link govuk-link--no-visited-state\" (click)=\"searchNext()\"\n title=\"Find the next occurrence of the phrase\" data-l10n-id=\"find_next\">Next</a>\n </div>\n <div class=\"govuk-grid-column-one-quarter\">\n <a [routerLink]=\"\" class=\"govuk-link govuk-link--no-visited-state\" (click)=\"toggleAdvancedSearch()\" title=\"Advanced\"\n data-l10n-id=\"find_advanced\" style=\" position: absolute; top: 95px; right: 15px; \">Advanced</a>\n </div>\n </div>\n\n <div class=\"govuk-grid-row\" *ngIf=\"advancedSearchVisible\">\n <div class=\"govuk-grid-column-full\">\n <div class=\"govuk-form-group govuk-!-margin-top-3 govuk-!-margin-bottom-1\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"advanced\">\n <div class=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"findHighlightAll\" name=\"findHighlightAll\" type=\"checkbox\"\n (change)=\"highlightAll = !highlightAll; search()\" [checked]=\"highlightAll\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"findHighlightAll\" data-l10n-id=\"find_highlight\">\n Highlight all\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"findMatchCase\" name=\"findMatchCase\" type=\"checkbox\"\n (change)=\"matchCase = !matchCase; search()\" [checked]=\"matchCase\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"findMatchCase\"\n data-l10n-id=\"find_match_case_label\">\n Match text (exact case)\n </label>\n </div>\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" id=\"findEntireWord\" name=\"findMatchCase\" type=\"checkbox\"\n (change)=\"wholeWord = !wholeWord; search()\" [checked]=\"wholeWord\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"findEntireWord\"\n data-l10n-id=\"find_entire_word_label\">\n Match whole words or sentences\n </label>\n </div>\n </div>\n </fieldset>\n </div>\n </div>\n </div>\n</div>\n"
5274
5283
  }] }
5275
5284
  ];
5276
5285
  /** @nocollapse */
@@ -5280,6 +5289,7 @@ var SearchBarComponent = /** @class */ (function () {
5280
5289
  ]; };
5281
5290
  SearchBarComponent.propDecorators = {
5282
5291
  findInput: [{ type: ViewChild, args: ['findInput',] }],
5292
+ findNext: [{ type: ViewChild, args: ['findNext',] }],
5283
5293
  onWindowKeyDown: [{ type: HostListener, args: ['window:keydown', ['$event'],] }]
5284
5294
  };
5285
5295
  return SearchBarComponent;
@@ -8955,7 +8965,7 @@ var SideBarComponent = /** @class */ (function () {
8955
8965
  * @return {?}
8956
8966
  */
8957
8967
  function (bookmarkInfo) {
8958
- _this.store.dispatch(new CreateBookmark((/** @type {?} */ (__assign({}, bookmarkInfo, { name: 'new bookmark', id: uuid$1() })))));
8968
+ _this.store.dispatch(new CreateBookmark((/** @type {?} */ (__assign({}, bookmarkInfo, { name: '', id: uuid$1() })))));
8959
8969
  }));
8960
8970
  };
8961
8971
  SideBarComponent.decorators = [
@@ -10863,8 +10873,10 @@ var BookmarksComponent = /** @class */ (function () {
10863
10873
  function (bookmark, name) {
10864
10874
  /** @type {?} */
10865
10875
  var editedBookmark = __assign({}, bookmark, { name: name });
10866
- this.store.dispatch(new UpdateBookmark(editedBookmark));
10867
- this.editableBookmark = undefined;
10876
+ if (name) {
10877
+ this.store.dispatch(new UpdateBookmark(editedBookmark));
10878
+ this.editableBookmark = undefined;
10879
+ }
10868
10880
  };
10869
10881
  /**
10870
10882
  * @param {?} bookmark
@@ -11408,7 +11420,9 @@ var HighlightCreateDirective = /** @class */ (function () {
11408
11420
  */
11409
11421
  function (event) {
11410
11422
  this.store.dispatch(new SelectedAnnotation({
11411
- annotationId: '', selected: false, editable: false
11423
+ annotationId: '',
11424
+ selected: false,
11425
+ editable: false,
11412
11426
  }));
11413
11427
  this.viewerEvents.clearCtxToolbar();
11414
11428
  };
@@ -11445,10 +11459,22 @@ var HighlightCreateDirective = /** @class */ (function () {
11445
11459
  var parentRect = localElement.parentElement.getBoundingClientRect();
11446
11460
  /** @type {?} */
11447
11461
  var selectionRectangles = [];
11448
- for (var i = 0; i < clientRects.length; i++) {
11462
+ var _loop_1 = function (i) {
11449
11463
  /** @type {?} */
11450
- var selectionRectangle = this.createTextRectangle(clientRects[i], parentRect);
11451
- selectionRectangles.push(selectionRectangle);
11464
+ var selectionRectangle = this_1.createTextRectangle(clientRects[i], parentRect);
11465
+ /** @type {?} */
11466
+ var findSelecttionRectangle = selectionRectangles.find((/**
11467
+ * @param {?} rect
11468
+ * @return {?}
11469
+ */
11470
+ function (rect) { return rect.width === selectionRectangle.width && rect.x === selectionRectangle.x; }));
11471
+ if (!findSelecttionRectangle) {
11472
+ selectionRectangles.push(selectionRectangle);
11473
+ }
11474
+ };
11475
+ var this_1 = this;
11476
+ for (var i = 0; i < clientRects.length; i++) {
11477
+ _loop_1(i);
11452
11478
  }
11453
11479
  return selectionRectangles;
11454
11480
  }