@hmcts/media-viewer 4.2.40-frozen-screen → 4.2.40
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/.yarn/cache/moment-timezone-npm-0.6.5-1746b59ce3-2ab437fa7a.zip +0 -0
- package/.yarn/install-state.gz +0 -0
- package/fesm2022/hmcts-media-viewer.mjs +15 -16
- package/fesm2022/hmcts-media-viewer.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/package.tgz +0 -0
- package/.yarn/cache/moment-timezone-npm-0.6.4-78ea3bd92a-efa60fc46c.zip +0 -0
|
Binary file
|
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
|
@@ -2065,8 +2065,8 @@ class HighlightCreateDirective {
|
|
|
2065
2065
|
}
|
|
2066
2066
|
this.setPageProperties(page);
|
|
2067
2067
|
const range = selection.getRangeAt(0).cloneRange();
|
|
2068
|
-
const
|
|
2069
|
-
if (!
|
|
2068
|
+
const selectionRects = this.getSelectionRectangles(range);
|
|
2069
|
+
if (!selectionRects || selectionRects.length === 0) {
|
|
2070
2070
|
return [];
|
|
2071
2071
|
}
|
|
2072
2072
|
let textLayerElement = range.startContainer;
|
|
@@ -2078,7 +2078,7 @@ class HighlightCreateDirective {
|
|
|
2078
2078
|
return [];
|
|
2079
2079
|
}
|
|
2080
2080
|
this.removeEnhancedTextModeStyling(textLayerElement);
|
|
2081
|
-
return this.processClientRects(
|
|
2081
|
+
return this.processClientRects(selectionRects, textLayer);
|
|
2082
2082
|
}
|
|
2083
2083
|
onPdfViewerClick(event) {
|
|
2084
2084
|
this.store.dispatch(new SelectedAnnotation({
|
|
@@ -2096,14 +2096,17 @@ class HighlightCreateDirective {
|
|
|
2096
2096
|
this.removeEnhancedTextModeStyling(localElement);
|
|
2097
2097
|
if (selection.rangeCount && !selection.isCollapsed) {
|
|
2098
2098
|
const range = selection.getRangeAt(0).cloneRange();
|
|
2099
|
-
const
|
|
2100
|
-
if (
|
|
2099
|
+
const selectionRects = this.getSelectionRectangles(range);
|
|
2100
|
+
if (selectionRects) {
|
|
2101
2101
|
const textLayer = localElement.closest(".textLayer");
|
|
2102
|
-
return this.processClientRects(
|
|
2102
|
+
return this.processClientRects(selectionRects, textLayer);
|
|
2103
2103
|
}
|
|
2104
2104
|
}
|
|
2105
2105
|
}
|
|
2106
2106
|
}
|
|
2107
|
+
getSelectionRectangles(range) {
|
|
2108
|
+
return range.getClientRects();
|
|
2109
|
+
}
|
|
2107
2110
|
createTextRectangle(rect, parentRect) {
|
|
2108
2111
|
const height = rect.bottom - rect.top;
|
|
2109
2112
|
const width = rect.right - rect.left;
|
|
@@ -2136,7 +2139,10 @@ class HighlightCreateDirective {
|
|
|
2136
2139
|
const selectionRectangles = [];
|
|
2137
2140
|
for (let i = 0; i < clientRects.length; i++) {
|
|
2138
2141
|
const selectionRectangle = this.createTextRectangle(clientRects[i], parentRect);
|
|
2139
|
-
const findSelectionRectangle = selectionRectangles.find((rect) => rect.width === selectionRectangle.width
|
|
2142
|
+
const findSelectionRectangle = selectionRectangles.find((rect) => rect.width === selectionRectangle.width
|
|
2143
|
+
&& rect.height === selectionRectangle.height
|
|
2144
|
+
&& rect.x === selectionRectangle.x
|
|
2145
|
+
&& rect.y === selectionRectangle.y);
|
|
2140
2146
|
if (!findSelectionRectangle) {
|
|
2141
2147
|
selectionRectangles.push(selectionRectangle);
|
|
2142
2148
|
}
|
|
@@ -3083,13 +3089,6 @@ class RedactionSearchBarComponent {
|
|
|
3083
3089
|
onCloseSearchModal() {
|
|
3084
3090
|
this.toolbarEvents.openRedactionSearch.next({ isOpen: false, modeType: this.searchType });
|
|
3085
3091
|
}
|
|
3086
|
-
onSearchTextChange(value) {
|
|
3087
|
-
this.searchText = value;
|
|
3088
|
-
if (!value?.trim()) {
|
|
3089
|
-
this.resultCount = 0;
|
|
3090
|
-
this.resultsText = '';
|
|
3091
|
-
}
|
|
3092
|
-
}
|
|
3093
3092
|
setSearchResultsCount(results) {
|
|
3094
3093
|
this.resultCount = results.total;
|
|
3095
3094
|
this.resultsText = this.resultCount > 0
|
|
@@ -3198,11 +3197,11 @@ class RedactionSearchBarComponent {
|
|
|
3198
3197
|
return rectangle;
|
|
3199
3198
|
}
|
|
3200
3199
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.31", ngImport: i0, type: RedactionSearchBarComponent, deps: [{ token: i1.Store }, { token: ToolbarButtonVisibilityService }, { token: ToolbarEventService }, { token: HighlightCreateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3201
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.31", type: RedactionSearchBarComponent, isStandalone: false, selector: "mv-redaction-search-bar", host: { listeners: { "window:keydown": "onWindowKeyDown($event)" } }, viewQueries: [{ propertyName: "findInput", first: true, predicate: ["findInput"], descendants: true, static: true }], ngImport: i0, 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 [attr.aria-label]=\"'Close Search' | rpxTranslate\"\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=\"Redact from search\"\n #findInput\n title=\"Redact from search\"\n placeholder=\"{{ titleText + ' from search...' | rpxTranslate }}\"\n data-l10n-id=\"search_input\"\n [ngModel]=\"searchText\"\n (ngModelChange)=\"
|
|
3200
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.31", type: RedactionSearchBarComponent, isStandalone: false, selector: "mv-redaction-search-bar", host: { listeners: { "window:keydown": "onWindowKeyDown($event)" } }, viewQueries: [{ propertyName: "findInput", first: true, predicate: ["findInput"], descendants: true, static: true }], ngImport: i0, 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 [attr.aria-label]=\"'Close Search' | rpxTranslate\"\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=\"Redact from search\"\n #findInput\n title=\"Redact from search\"\n placeholder=\"{{ titleText + ' from search...' | rpxTranslate }}\"\n data-l10n-id=\"search_input\"\n [ngModel]=\"searchText\"\n (ngModelChange)=\"searchText = $event\"\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\" | rpxTranslate }}\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 || resultCount <= 0\"\n >\n {{ titleText + \" all\" | rpxTranslate }}\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 {{ inProgressText + \" in progress\" | rpxTranslate }}\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", 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}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: i5.RpxTranslatePipe, name: "rpxTranslate" }] }); }
|
|
3202
3201
|
}
|
|
3203
3202
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.31", ngImport: i0, type: RedactionSearchBarComponent, decorators: [{
|
|
3204
3203
|
type: Component,
|
|
3205
|
-
args: [{ selector: 'mv-redaction-search-bar', standalone: false, 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 [attr.aria-label]=\"'Close Search' | rpxTranslate\"\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=\"Redact from search\"\n #findInput\n title=\"Redact from search\"\n placeholder=\"{{ titleText + ' from search...' | rpxTranslate }}\"\n data-l10n-id=\"search_input\"\n [ngModel]=\"searchText\"\n (ngModelChange)=\"
|
|
3204
|
+
args: [{ selector: 'mv-redaction-search-bar', standalone: false, 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 [attr.aria-label]=\"'Close Search' | rpxTranslate\"\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=\"Redact from search\"\n #findInput\n title=\"Redact from search\"\n placeholder=\"{{ titleText + ' from search...' | rpxTranslate }}\"\n data-l10n-id=\"search_input\"\n [ngModel]=\"searchText\"\n (ngModelChange)=\"searchText = $event\"\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\" | rpxTranslate }}\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 || resultCount <= 0\"\n >\n {{ titleText + \" all\" | rpxTranslate }}\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 {{ inProgressText + \" in progress\" | rpxTranslate }}\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", 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}\n"] }]
|
|
3206
3205
|
}], ctorParameters: () => [{ type: i1.Store }, { type: ToolbarButtonVisibilityService }, { type: ToolbarEventService }, { type: HighlightCreateService }], propDecorators: { findInput: [{
|
|
3207
3206
|
type: ViewChild,
|
|
3208
3207
|
args: ['findInput', { static: true }]
|