@hmcts/media-viewer 4.1.8-exui-2600 → 4.1.8-exui-2489
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/sass/box-highlight.scss +0 -38
- package/esm2022/lib/annotations/annotation-set/annotation-create/box-highlight-create/box-highlight-create.component.mjs +19 -74
- package/esm2022/lib/annotations/annotation-set/annotation-create/highlight-create/highlight-create.service.mjs +4 -4
- package/esm2022/lib/annotations/annotation-set/annotation-view/annotation-view.component.mjs +3 -37
- package/esm2022/lib/annotations/annotation-set/annotation-view/rectangle/rectangle.component.mjs +3 -39
- package/esm2022/lib/annotations/annotation-set/metadata-layer/metadata-layer.component.mjs +3 -3
- package/esm2022/lib/annotations/annotations.module.mjs +3 -9
- package/esm2022/lib/store/actions/annotation.actions.mjs +2 -3
- package/esm2022/lib/store/effects/annotation.effects.mjs +3 -14
- package/esm2022/lib/viewers/pdf-viewer/pdf-viewer.component.mjs +28 -3
- package/fesm2022/hmcts-media-viewer.mjs +60 -546
- package/fesm2022/hmcts-media-viewer.mjs.map +1 -1
- package/lib/annotations/annotation-set/annotation-create/box-highlight-create/box-highlight-create.component.d.ts +2 -16
- 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 +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 +2 -8
- package/lib/annotations/annotation-set/annotation-view/annotation-view.component.d.ts.map +1 -1
- package/lib/annotations/annotation-set/annotation-view/rectangle/rectangle.component.d.ts +1 -10
- package/lib/annotations/annotation-set/annotation-view/rectangle/rectangle.component.d.ts.map +1 -1
- package/lib/annotations/annotation-set/metadata-layer/metadata-layer.component.d.ts +1 -2
- package/lib/annotations/annotation-set/metadata-layer/metadata-layer.component.d.ts.map +1 -1
- package/lib/annotations/annotations.module.d.ts +11 -13
- package/lib/annotations/annotations.module.d.ts.map +1 -1
- package/lib/store/actions/annotation.actions.d.ts +1 -2
- package/lib/store/actions/annotation.actions.d.ts.map +1 -1
- package/lib/store/effects/annotation.effects.d.ts +0 -1
- package/lib/store/effects/annotation.effects.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/package.json +1 -1
- package/esm2022/lib/annotations/annotation-set/annotation-create/box-highlight-create/keyboard-box-draw.directive.mjs +0 -258
- package/esm2022/lib/annotations/annotation-set/annotation-view/rectangle/keyboard-box-move.directive.mjs +0 -122
- package/lib/annotations/annotation-set/annotation-create/box-highlight-create/keyboard-box-draw.directive.d.ts +0 -59
- package/lib/annotations/annotation-set/annotation-create/box-highlight-create/keyboard-box-draw.directive.d.ts.map +0 -1
- package/lib/annotations/annotation-set/annotation-view/rectangle/keyboard-box-move.directive.d.ts +0 -27
- package/lib/annotations/annotation-set/annotation-view/rectangle/keyboard-box-move.directive.d.ts.map +0 -1
|
@@ -8,8 +8,8 @@ import * as i2 from '@angular/forms';
|
|
|
8
8
|
import { UntypedFormControl, FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
import * as i1$1 from '@angular/common/http';
|
|
10
10
|
import { HttpClientModule } from '@angular/common/http';
|
|
11
|
-
import { BehaviorSubject, Subject, of, combineLatest,
|
|
12
|
-
import { take, distinctUntilChanged, filter, auditTime, tap,
|
|
11
|
+
import { BehaviorSubject, Subject, of, combineLatest, asyncScheduler } from 'rxjs';
|
|
12
|
+
import { take, distinctUntilChanged, filter, auditTime, tap, throttleTime, map, catchError, switchMap, concatMap, exhaustMap, withLatestFrom } from 'rxjs/operators';
|
|
13
13
|
import * as i1 from '@ngrx/store';
|
|
14
14
|
import { createFeatureSelector, createSelector, select, StoreModule } from '@ngrx/store';
|
|
15
15
|
import { v4 } from 'uuid';
|
|
@@ -433,9 +433,8 @@ class SaveAnnotationSetFail {
|
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
class SaveAnnotation {
|
|
436
|
-
constructor(payload
|
|
436
|
+
constructor(payload) {
|
|
437
437
|
this.payload = payload;
|
|
438
|
-
this.autoSelect = autoSelect;
|
|
439
438
|
this.type = SAVE_ANNOTATION;
|
|
440
439
|
}
|
|
441
440
|
}
|
|
@@ -2716,10 +2715,10 @@ class HighlightCreateService {
|
|
|
2716
2715
|
this.toolBarEvents = toolBarEvents;
|
|
2717
2716
|
this.store = store;
|
|
2718
2717
|
}
|
|
2719
|
-
saveAnnotation(rectangles, page
|
|
2718
|
+
saveAnnotation(rectangles, page) {
|
|
2720
2719
|
this.store.pipe(select(getDocumentIdSetId), take(1)).subscribe(anoSetDocId => {
|
|
2721
2720
|
const anno = {
|
|
2722
|
-
id:
|
|
2721
|
+
id: v4(),
|
|
2723
2722
|
color: 'FFFF00',
|
|
2724
2723
|
comments: [],
|
|
2725
2724
|
page: page,
|
|
@@ -2734,7 +2733,7 @@ class HighlightCreateService {
|
|
|
2734
2733
|
lastModifiedDate: '',
|
|
2735
2734
|
tags: [],
|
|
2736
2735
|
};
|
|
2737
|
-
this.store.dispatch(new SaveAnnotation(anno
|
|
2736
|
+
this.store.dispatch(new SaveAnnotation(anno));
|
|
2738
2737
|
});
|
|
2739
2738
|
}
|
|
2740
2739
|
saveAnnotationSet(searchRectangles) {
|
|
@@ -3890,262 +3889,6 @@ const getBookmarksPerPage = createSelector(getPages, getBookmarkPages, (pages, p
|
|
|
3890
3889
|
}
|
|
3891
3890
|
});
|
|
3892
3891
|
|
|
3893
|
-
class KeyboardBoxDrawDirective {
|
|
3894
|
-
set enabled(value) {
|
|
3895
|
-
const wasEnabled = this._enabled;
|
|
3896
|
-
this._enabled = value;
|
|
3897
|
-
if (value && !wasEnabled && KeyboardBoxDrawDirective.lastInteractionWasKeyboard && !this.showCursor) {
|
|
3898
|
-
this.initializeCursorForKeyboard();
|
|
3899
|
-
}
|
|
3900
|
-
}
|
|
3901
|
-
get enabled() {
|
|
3902
|
-
return this._enabled;
|
|
3903
|
-
}
|
|
3904
|
-
static { this.lastInteractionWasKeyboard = false; }
|
|
3905
|
-
constructor(elementRef) {
|
|
3906
|
-
this.elementRef = elementRef;
|
|
3907
|
-
this._enabled = false;
|
|
3908
|
-
this.minBoxSize = 10;
|
|
3909
|
-
this.incrementSmall = 1;
|
|
3910
|
-
this.incrementMedium = 5;
|
|
3911
|
-
this.incrementLarge = 10;
|
|
3912
|
-
this.drawingStarted = new EventEmitter();
|
|
3913
|
-
this.drawingUpdated = new EventEmitter();
|
|
3914
|
-
this.drawingConfirmed = new EventEmitter();
|
|
3915
|
-
this.drawingCancelled = new EventEmitter();
|
|
3916
|
-
this.cursorPositionChanged = new EventEmitter();
|
|
3917
|
-
this.isDrawing = false;
|
|
3918
|
-
this.showCursor = false;
|
|
3919
|
-
if (typeof window !== 'undefined') {
|
|
3920
|
-
window.addEventListener('keydown', KeyboardBoxDrawDirective.onGlobalKeyDown, { capture: true });
|
|
3921
|
-
window.addEventListener('mousedown', KeyboardBoxDrawDirective.onGlobalMouseDown, { capture: true });
|
|
3922
|
-
}
|
|
3923
|
-
}
|
|
3924
|
-
static onGlobalKeyDown() {
|
|
3925
|
-
KeyboardBoxDrawDirective.lastInteractionWasKeyboard = true;
|
|
3926
|
-
}
|
|
3927
|
-
static onGlobalMouseDown() {
|
|
3928
|
-
KeyboardBoxDrawDirective.lastInteractionWasKeyboard = false;
|
|
3929
|
-
}
|
|
3930
|
-
ngOnDestroy() {
|
|
3931
|
-
this.cleanup();
|
|
3932
|
-
}
|
|
3933
|
-
initializeCursorForKeyboard() {
|
|
3934
|
-
if (this.enabled && !this.showCursor && !this.isDrawing) {
|
|
3935
|
-
const rect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
3936
|
-
if (rect.width > 0 && rect.height > 0) {
|
|
3937
|
-
this.cursorX = rect.width / 2;
|
|
3938
|
-
this.cursorY = rect.height / 2;
|
|
3939
|
-
this.showCursor = true;
|
|
3940
|
-
this.emitCursorPosition();
|
|
3941
|
-
}
|
|
3942
|
-
}
|
|
3943
|
-
}
|
|
3944
|
-
onKeyDown(event) {
|
|
3945
|
-
if (!this.enabled) {
|
|
3946
|
-
return;
|
|
3947
|
-
}
|
|
3948
|
-
if (event.key === 'Enter') {
|
|
3949
|
-
event.preventDefault();
|
|
3950
|
-
event.stopPropagation();
|
|
3951
|
-
if (!this.isDrawing) {
|
|
3952
|
-
this.startDrawing();
|
|
3953
|
-
}
|
|
3954
|
-
else {
|
|
3955
|
-
this.confirmDrawing();
|
|
3956
|
-
}
|
|
3957
|
-
return;
|
|
3958
|
-
}
|
|
3959
|
-
if (event.key === 'Escape') {
|
|
3960
|
-
event.preventDefault();
|
|
3961
|
-
event.stopPropagation();
|
|
3962
|
-
if (this.isDrawing) {
|
|
3963
|
-
this.cancelDrawing();
|
|
3964
|
-
}
|
|
3965
|
-
else if (this.showCursor) {
|
|
3966
|
-
this.hideCursor();
|
|
3967
|
-
}
|
|
3968
|
-
return;
|
|
3969
|
-
}
|
|
3970
|
-
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(event.key)) {
|
|
3971
|
-
event.preventDefault();
|
|
3972
|
-
event.stopPropagation();
|
|
3973
|
-
if (this.isDrawing) {
|
|
3974
|
-
this.resizeBox(event);
|
|
3975
|
-
}
|
|
3976
|
-
else {
|
|
3977
|
-
this.moveCursor(event);
|
|
3978
|
-
}
|
|
3979
|
-
}
|
|
3980
|
-
}
|
|
3981
|
-
onBlur() {
|
|
3982
|
-
if (this.showCursor && !this.isDrawing) {
|
|
3983
|
-
this.hideCursor();
|
|
3984
|
-
}
|
|
3985
|
-
}
|
|
3986
|
-
moveCursor(event) {
|
|
3987
|
-
const increment = event.shiftKey ? this.incrementLarge : this.incrementMedium;
|
|
3988
|
-
if (!this.showCursor) {
|
|
3989
|
-
const rect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
3990
|
-
this.cursorX = rect.width / 2;
|
|
3991
|
-
this.cursorY = rect.height / 2;
|
|
3992
|
-
this.showCursor = true;
|
|
3993
|
-
this.emitCursorPosition();
|
|
3994
|
-
return;
|
|
3995
|
-
}
|
|
3996
|
-
const rect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
3997
|
-
switch (event.key) {
|
|
3998
|
-
case 'ArrowUp':
|
|
3999
|
-
this.cursorY = Math.max(0, this.cursorY - increment);
|
|
4000
|
-
break;
|
|
4001
|
-
case 'ArrowDown':
|
|
4002
|
-
this.cursorY = Math.min(rect.height, this.cursorY + increment);
|
|
4003
|
-
break;
|
|
4004
|
-
case 'ArrowLeft':
|
|
4005
|
-
this.cursorX = Math.max(0, this.cursorX - increment);
|
|
4006
|
-
break;
|
|
4007
|
-
case 'ArrowRight':
|
|
4008
|
-
this.cursorX = Math.min(rect.width, this.cursorX + increment);
|
|
4009
|
-
break;
|
|
4010
|
-
}
|
|
4011
|
-
this.emitCursorPosition();
|
|
4012
|
-
}
|
|
4013
|
-
startDrawing() {
|
|
4014
|
-
let startX;
|
|
4015
|
-
let startY;
|
|
4016
|
-
if (this.showCursor) {
|
|
4017
|
-
startX = this.cursorX;
|
|
4018
|
-
startY = this.cursorY;
|
|
4019
|
-
this.showCursor = false;
|
|
4020
|
-
this.emitCursorPosition();
|
|
4021
|
-
}
|
|
4022
|
-
else {
|
|
4023
|
-
// default to center
|
|
4024
|
-
const rect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
4025
|
-
startX = rect.width / 2;
|
|
4026
|
-
startY = rect.height / 2;
|
|
4027
|
-
}
|
|
4028
|
-
this.isDrawing = true;
|
|
4029
|
-
this.drawStartX = startX;
|
|
4030
|
-
this.drawStartY = startY;
|
|
4031
|
-
this.currentWidth = this.minBoxSize;
|
|
4032
|
-
this.currentHeight = this.minBoxSize;
|
|
4033
|
-
this.emitDrawingStarted();
|
|
4034
|
-
}
|
|
4035
|
-
resizeBox(event) {
|
|
4036
|
-
const increment = event.shiftKey ? this.incrementLarge : this.incrementSmall;
|
|
4037
|
-
const rect = this.elementRef.nativeElement.getBoundingClientRect();
|
|
4038
|
-
switch (event.key) {
|
|
4039
|
-
case 'ArrowRight':
|
|
4040
|
-
const maxWidth = rect.width - this.drawStartX;
|
|
4041
|
-
this.currentWidth = Math.min(maxWidth, this.currentWidth + increment);
|
|
4042
|
-
break;
|
|
4043
|
-
case 'ArrowLeft':
|
|
4044
|
-
this.currentWidth = Math.max(this.minBoxSize, this.currentWidth - increment);
|
|
4045
|
-
break;
|
|
4046
|
-
case 'ArrowDown':
|
|
4047
|
-
const maxHeight = rect.height - this.drawStartY;
|
|
4048
|
-
this.currentHeight = Math.min(maxHeight, this.currentHeight + increment);
|
|
4049
|
-
break;
|
|
4050
|
-
case 'ArrowUp':
|
|
4051
|
-
this.currentHeight = Math.max(this.minBoxSize, this.currentHeight - increment);
|
|
4052
|
-
break;
|
|
4053
|
-
}
|
|
4054
|
-
this.emitDrawingUpdated();
|
|
4055
|
-
}
|
|
4056
|
-
confirmDrawing() {
|
|
4057
|
-
this.emitDrawingConfirmed();
|
|
4058
|
-
this.cleanup();
|
|
4059
|
-
}
|
|
4060
|
-
cancelDrawing() {
|
|
4061
|
-
this.drawingCancelled.emit();
|
|
4062
|
-
this.cleanup();
|
|
4063
|
-
}
|
|
4064
|
-
hideCursor() {
|
|
4065
|
-
this.showCursor = false;
|
|
4066
|
-
this.emitCursorPosition();
|
|
4067
|
-
}
|
|
4068
|
-
cleanup() {
|
|
4069
|
-
this.isDrawing = false;
|
|
4070
|
-
this.showCursor = false;
|
|
4071
|
-
this.cursorX = undefined;
|
|
4072
|
-
this.cursorY = undefined;
|
|
4073
|
-
this.drawStartX = undefined;
|
|
4074
|
-
this.drawStartY = undefined;
|
|
4075
|
-
this.currentWidth = undefined;
|
|
4076
|
-
this.currentHeight = undefined;
|
|
4077
|
-
}
|
|
4078
|
-
emitCursorPosition() {
|
|
4079
|
-
this.cursorPositionChanged.emit({
|
|
4080
|
-
x: this.cursorX,
|
|
4081
|
-
y: this.cursorY,
|
|
4082
|
-
visible: this.showCursor
|
|
4083
|
-
});
|
|
4084
|
-
}
|
|
4085
|
-
emitDrawingStarted() {
|
|
4086
|
-
this.drawingStarted.emit({
|
|
4087
|
-
startX: this.drawStartX,
|
|
4088
|
-
startY: this.drawStartY,
|
|
4089
|
-
width: this.currentWidth,
|
|
4090
|
-
height: this.currentHeight
|
|
4091
|
-
});
|
|
4092
|
-
}
|
|
4093
|
-
emitDrawingUpdated() {
|
|
4094
|
-
this.drawingUpdated.emit({
|
|
4095
|
-
startX: this.drawStartX,
|
|
4096
|
-
startY: this.drawStartY,
|
|
4097
|
-
width: this.currentWidth,
|
|
4098
|
-
height: this.currentHeight
|
|
4099
|
-
});
|
|
4100
|
-
}
|
|
4101
|
-
emitDrawingConfirmed() {
|
|
4102
|
-
this.drawingConfirmed.emit({
|
|
4103
|
-
startX: this.drawStartX,
|
|
4104
|
-
startY: this.drawStartY,
|
|
4105
|
-
width: this.currentWidth,
|
|
4106
|
-
height: this.currentHeight
|
|
4107
|
-
});
|
|
4108
|
-
}
|
|
4109
|
-
reset() {
|
|
4110
|
-
this.cleanup();
|
|
4111
|
-
this.emitCursorPosition();
|
|
4112
|
-
}
|
|
4113
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: KeyboardBoxDrawDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4114
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: KeyboardBoxDrawDirective, selector: "[mvKeyboardBoxDraw]", inputs: { enabled: "enabled", minBoxSize: "minBoxSize", incrementSmall: "incrementSmall", incrementMedium: "incrementMedium", incrementLarge: "incrementLarge" }, outputs: { drawingStarted: "drawingStarted", drawingUpdated: "drawingUpdated", drawingConfirmed: "drawingConfirmed", drawingCancelled: "drawingCancelled", cursorPositionChanged: "cursorPositionChanged" }, host: { listeners: { "keydown": "onKeyDown($event)", "blur": "onBlur()" } }, ngImport: i0 }); }
|
|
4115
|
-
}
|
|
4116
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: KeyboardBoxDrawDirective, decorators: [{
|
|
4117
|
-
type: Directive,
|
|
4118
|
-
args: [{
|
|
4119
|
-
selector: '[mvKeyboardBoxDraw]'
|
|
4120
|
-
}]
|
|
4121
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { enabled: [{
|
|
4122
|
-
type: Input
|
|
4123
|
-
}], minBoxSize: [{
|
|
4124
|
-
type: Input
|
|
4125
|
-
}], incrementSmall: [{
|
|
4126
|
-
type: Input
|
|
4127
|
-
}], incrementMedium: [{
|
|
4128
|
-
type: Input
|
|
4129
|
-
}], incrementLarge: [{
|
|
4130
|
-
type: Input
|
|
4131
|
-
}], drawingStarted: [{
|
|
4132
|
-
type: Output
|
|
4133
|
-
}], drawingUpdated: [{
|
|
4134
|
-
type: Output
|
|
4135
|
-
}], drawingConfirmed: [{
|
|
4136
|
-
type: Output
|
|
4137
|
-
}], drawingCancelled: [{
|
|
4138
|
-
type: Output
|
|
4139
|
-
}], cursorPositionChanged: [{
|
|
4140
|
-
type: Output
|
|
4141
|
-
}], onKeyDown: [{
|
|
4142
|
-
type: HostListener,
|
|
4143
|
-
args: ['keydown', ['$event']]
|
|
4144
|
-
}], onBlur: [{
|
|
4145
|
-
type: HostListener,
|
|
4146
|
-
args: ['blur']
|
|
4147
|
-
}] } });
|
|
4148
|
-
|
|
4149
3892
|
class BoxHighlightCreateComponent {
|
|
4150
3893
|
constructor(toolbarEvents, highlightService) {
|
|
4151
3894
|
this.toolbarEvents = toolbarEvents;
|
|
@@ -4154,8 +3897,6 @@ class BoxHighlightCreateComponent {
|
|
|
4154
3897
|
this.drawStartX = -1;
|
|
4155
3898
|
this.drawStartY = -1;
|
|
4156
3899
|
this.backgroundColor = 'none';
|
|
4157
|
-
this.keyboardDrawingMode = false;
|
|
4158
|
-
this.showCursor = false;
|
|
4159
3900
|
this.subscriptions = [];
|
|
4160
3901
|
}
|
|
4161
3902
|
ngOnInit() {
|
|
@@ -4163,14 +3904,6 @@ class BoxHighlightCreateComponent {
|
|
|
4163
3904
|
this.toolbarEvents.drawModeSubject.subscribe(drawMode => {
|
|
4164
3905
|
this.defaultHeight = drawMode ? '100%' : '0px';
|
|
4165
3906
|
this.defaultWidth = drawMode ? '100%' : '0px';
|
|
4166
|
-
this.drawMode = drawMode;
|
|
4167
|
-
if (drawMode) {
|
|
4168
|
-
setTimeout(() => {
|
|
4169
|
-
if (this.drawingContainer?.nativeElement && this.isElementInViewport(this.drawingContainer.nativeElement)) {
|
|
4170
|
-
this.drawingContainer.nativeElement.focus();
|
|
4171
|
-
}
|
|
4172
|
-
}, 100);
|
|
4173
|
-
}
|
|
4174
3907
|
}),
|
|
4175
3908
|
this.toolbarEvents.redactWholePage.subscribe(() => {
|
|
4176
3909
|
this.wholePage = true;
|
|
@@ -4182,20 +3915,13 @@ class BoxHighlightCreateComponent {
|
|
|
4182
3915
|
subscription.unsubscribe();
|
|
4183
3916
|
});
|
|
4184
3917
|
}
|
|
4185
|
-
isElementInViewport(el) {
|
|
4186
|
-
const rect = el.getBoundingClientRect();
|
|
4187
|
-
const windowHeight = (window.innerHeight || document.documentElement.clientHeight);
|
|
4188
|
-
const windowWidth = (window.innerWidth || document.documentElement.clientWidth);
|
|
4189
|
-
const verticallyVisible = rect.bottom > 0 && rect.top < windowHeight;
|
|
4190
|
-
const horizontallyVisible = rect.right > 0 && rect.left < windowWidth;
|
|
4191
|
-
return verticallyVisible && horizontallyVisible;
|
|
4192
|
-
}
|
|
4193
3918
|
initHighlight(event) {
|
|
4194
3919
|
if (this.wholePage) {
|
|
4195
3920
|
this.highlightPage();
|
|
4196
3921
|
return;
|
|
4197
3922
|
}
|
|
4198
3923
|
const rect = HtmlTemplatesHelper.getAdjustedBoundingRect(event.target), offsetX = event.clientX - rect.left, offsetY = event.clientY - rect.top;
|
|
3924
|
+
console.log(`initHighlight: rect=${JSON.stringify(rect)}, clientX=${event.clientX}, clientY=${event.clientY}, offsetX=${offsetX}, offsetY=${offsetY}`);
|
|
4199
3925
|
this.position = 'absolute';
|
|
4200
3926
|
this.backgroundColor = 'yellow';
|
|
4201
3927
|
this.drawStartX = offsetX;
|
|
@@ -4205,7 +3931,18 @@ class BoxHighlightCreateComponent {
|
|
|
4205
3931
|
this.width = 50;
|
|
4206
3932
|
this.top = this.drawStartY;
|
|
4207
3933
|
this.left = this.drawStartX;
|
|
4208
|
-
this.
|
|
3934
|
+
switch (this.rotate) {
|
|
3935
|
+
case 90:
|
|
3936
|
+
this.top = this.drawStartY - this.height;
|
|
3937
|
+
break;
|
|
3938
|
+
case 180:
|
|
3939
|
+
this.top = this.drawStartY - this.height;
|
|
3940
|
+
this.left = this.drawStartX - this.width;
|
|
3941
|
+
break;
|
|
3942
|
+
case 270:
|
|
3943
|
+
this.left = this.drawStartX - this.width;
|
|
3944
|
+
break;
|
|
3945
|
+
}
|
|
4209
3946
|
}
|
|
4210
3947
|
updateHighlight(event) {
|
|
4211
3948
|
const rect = HtmlTemplatesHelper.getAdjustedBoundingRect(event.target, false), offsetX = event.clientX - rect.left, offsetY = event.clientY - rect.top;
|
|
@@ -4220,56 +3957,12 @@ class BoxHighlightCreateComponent {
|
|
|
4220
3957
|
if (this.height / this.zoom > 5 || this.width / this.zoom > 5) {
|
|
4221
3958
|
let rectangle = this.highlightService
|
|
4222
3959
|
.applyRotation(this.pageHeight, this.pageWidth, this.height, this.width, this.top, this.left, this.rotate, this.zoom);
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
this.saveSelection.emit({ rectangles: [rectangle], page: this.page
|
|
3960
|
+
rectangle = { id: v4(), ...rectangle };
|
|
3961
|
+
console.log(`createHighlight: rectangle=${JSON.stringify(rectangle)}`);
|
|
3962
|
+
this.saveSelection.emit({ rectangles: [rectangle], page: this.page });
|
|
4226
3963
|
this.resetHighlight();
|
|
4227
3964
|
}
|
|
4228
3965
|
}
|
|
4229
|
-
onCursorPositionChanged(position) {
|
|
4230
|
-
this.cursorX = position.x;
|
|
4231
|
-
this.cursorY = position.y;
|
|
4232
|
-
this.showCursor = position.visible;
|
|
4233
|
-
}
|
|
4234
|
-
onDrawingStarted(event) {
|
|
4235
|
-
this.keyboardDrawingMode = true;
|
|
4236
|
-
this.position = 'absolute';
|
|
4237
|
-
this.backgroundColor = 'yellow';
|
|
4238
|
-
this.display = 'block';
|
|
4239
|
-
this.drawStartX = event.startX;
|
|
4240
|
-
this.drawStartY = event.startY;
|
|
4241
|
-
this.width = event.width;
|
|
4242
|
-
this.height = event.height;
|
|
4243
|
-
this.top = this.drawStartY;
|
|
4244
|
-
this.left = this.drawStartX;
|
|
4245
|
-
this.adjustForRotation();
|
|
4246
|
-
}
|
|
4247
|
-
onDrawingUpdated(event) {
|
|
4248
|
-
this.width = event.width;
|
|
4249
|
-
this.height = event.height;
|
|
4250
|
-
}
|
|
4251
|
-
onDrawingConfirmed(event) {
|
|
4252
|
-
this.keyboardDrawingMode = false;
|
|
4253
|
-
this.createHighlight();
|
|
4254
|
-
}
|
|
4255
|
-
onDrawingCancelled() {
|
|
4256
|
-
this.keyboardDrawingMode = false;
|
|
4257
|
-
this.resetHighlight();
|
|
4258
|
-
}
|
|
4259
|
-
adjustForRotation() {
|
|
4260
|
-
switch (this.rotate) {
|
|
4261
|
-
case 90:
|
|
4262
|
-
this.top = this.drawStartY - this.height;
|
|
4263
|
-
break;
|
|
4264
|
-
case 180:
|
|
4265
|
-
this.top = this.drawStartY - this.height;
|
|
4266
|
-
this.left = this.drawStartX - this.width;
|
|
4267
|
-
break;
|
|
4268
|
-
case 270:
|
|
4269
|
-
this.left = this.drawStartX - this.width;
|
|
4270
|
-
break;
|
|
4271
|
-
}
|
|
4272
|
-
}
|
|
4273
3966
|
resetHighlight() {
|
|
4274
3967
|
this.drawStartX = -1;
|
|
4275
3968
|
this.drawStartY = -1;
|
|
@@ -4288,11 +3981,11 @@ class BoxHighlightCreateComponent {
|
|
|
4288
3981
|
this.createHighlight();
|
|
4289
3982
|
}
|
|
4290
3983
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BoxHighlightCreateComponent, deps: [{ token: ToolbarEventService }, { token: HighlightCreateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4291
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: BoxHighlightCreateComponent, selector: "mv-box-highlight-create", inputs: { page: "page", pageHeight: "pageHeight", pageWidth: "pageWidth", rotate: "rotate", zoom: "zoom", container: "container" }, outputs: { saveSelection: "saveSelection" }, viewQueries: [{ propertyName: "highlight", first: true, predicate: ["boxHighlight"], descendants: true }
|
|
3984
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: BoxHighlightCreateComponent, selector: "mv-box-highlight-create", inputs: { page: "page", pageHeight: "pageHeight", pageWidth: "pageWidth", rotate: "rotate", zoom: "zoom", container: "container" }, outputs: { saveSelection: "saveSelection" }, viewQueries: [{ propertyName: "highlight", first: true, predicate: ["boxHighlight"], descendants: true }], ngImport: i0, template: "<div [style.height]=\"defaultHeight\"\n [style.width]=\"defaultWidth\"\n (mousedown)=\"initHighlight($event)\"\n (mousemove)=\"updateHighlight($event)\"\n (mouseup)=\"createHighlight()\">\n <div #boxHighlight\n class=\"box-highlight\"\n [style.display]=\"display\"\n [style.position]=\"position\"\n [style.background-color]=\"backgroundColor\"\n [style.height]=\"height ? height + 'px' : '100%'\"\n [style.width]=\"width ? width + 'px' : '100%'\"\n [style.top]=\"top + 'px'\"\n [style.left]=\"left + 'px'\">\n </div>\n</div>\n" }); }
|
|
4292
3985
|
}
|
|
4293
3986
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: BoxHighlightCreateComponent, decorators: [{
|
|
4294
3987
|
type: Component,
|
|
4295
|
-
args: [{ selector: 'mv-box-highlight-create', template: "<div
|
|
3988
|
+
args: [{ selector: 'mv-box-highlight-create', template: "<div [style.height]=\"defaultHeight\"\n [style.width]=\"defaultWidth\"\n (mousedown)=\"initHighlight($event)\"\n (mousemove)=\"updateHighlight($event)\"\n (mouseup)=\"createHighlight()\">\n <div #boxHighlight\n class=\"box-highlight\"\n [style.display]=\"display\"\n [style.position]=\"position\"\n [style.background-color]=\"backgroundColor\"\n [style.height]=\"height ? height + 'px' : '100%'\"\n [style.width]=\"width ? width + 'px' : '100%'\"\n [style.top]=\"top + 'px'\"\n [style.left]=\"left + 'px'\">\n </div>\n</div>\n" }]
|
|
4296
3989
|
}], ctorParameters: () => [{ type: ToolbarEventService }, { type: HighlightCreateService }], propDecorators: { page: [{
|
|
4297
3990
|
type: Input
|
|
4298
3991
|
}], pageHeight: [{
|
|
@@ -4310,127 +4003,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
4310
4003
|
}], highlight: [{
|
|
4311
4004
|
type: ViewChild,
|
|
4312
4005
|
args: ['boxHighlight', { static: false }]
|
|
4313
|
-
}], drawingContainer: [{
|
|
4314
|
-
type: ViewChild,
|
|
4315
|
-
args: ['drawingContainer', { static: false }]
|
|
4316
|
-
}] } });
|
|
4317
|
-
|
|
4318
|
-
class KeyboardBoxMoveDirective {
|
|
4319
|
-
constructor(elementRef) {
|
|
4320
|
-
this.elementRef = elementRef;
|
|
4321
|
-
this.enabled = true;
|
|
4322
|
-
this.incrementSmall = 1;
|
|
4323
|
-
this.incrementLarge = 10;
|
|
4324
|
-
this.keyboardMovingChange = new EventEmitter();
|
|
4325
|
-
this.boxDelete = new EventEmitter();
|
|
4326
|
-
this.moveSubject = new Subject();
|
|
4327
|
-
this.isMoving = false;
|
|
4328
|
-
this.moveSubscription = this.moveSubject
|
|
4329
|
-
.pipe(debounceTime(500))
|
|
4330
|
-
.subscribe(() => {
|
|
4331
|
-
this.setMoving(false);
|
|
4332
|
-
this.emitStoppedEvent();
|
|
4333
|
-
});
|
|
4334
|
-
}
|
|
4335
|
-
ngOnDestroy() {
|
|
4336
|
-
if (this.moveSubscription) {
|
|
4337
|
-
this.moveSubscription.unsubscribe();
|
|
4338
|
-
}
|
|
4339
|
-
this.moveSubject.complete();
|
|
4340
|
-
}
|
|
4341
|
-
onKeyDown(event) {
|
|
4342
|
-
if (event.key === 'Delete' || event.key === 'Backspace') {
|
|
4343
|
-
event.preventDefault();
|
|
4344
|
-
event.stopPropagation();
|
|
4345
|
-
this.boxDelete.emit();
|
|
4346
|
-
return;
|
|
4347
|
-
}
|
|
4348
|
-
if (!this.enabled) {
|
|
4349
|
-
return;
|
|
4350
|
-
}
|
|
4351
|
-
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(event.key)) {
|
|
4352
|
-
event.preventDefault();
|
|
4353
|
-
event.stopPropagation();
|
|
4354
|
-
this.moveBox(event);
|
|
4355
|
-
}
|
|
4356
|
-
}
|
|
4357
|
-
moveBox(event) {
|
|
4358
|
-
const element = this.elementRef.nativeElement;
|
|
4359
|
-
const increment = event.shiftKey ? this.incrementLarge : this.incrementSmall;
|
|
4360
|
-
if (!this.isMoving) {
|
|
4361
|
-
this.setMoving(true);
|
|
4362
|
-
}
|
|
4363
|
-
const currentTop = parseFloat(element.style.top) || 0;
|
|
4364
|
-
const currentLeft = parseFloat(element.style.left) || 0;
|
|
4365
|
-
const currentWidth = element.offsetWidth;
|
|
4366
|
-
const currentHeight = element.offsetHeight;
|
|
4367
|
-
let newTop = currentTop;
|
|
4368
|
-
let newLeft = currentLeft;
|
|
4369
|
-
switch (event.key) {
|
|
4370
|
-
case 'ArrowUp':
|
|
4371
|
-
newTop = currentTop - increment;
|
|
4372
|
-
break;
|
|
4373
|
-
case 'ArrowDown':
|
|
4374
|
-
newTop = currentTop + increment;
|
|
4375
|
-
break;
|
|
4376
|
-
case 'ArrowLeft':
|
|
4377
|
-
newLeft = currentLeft - increment;
|
|
4378
|
-
break;
|
|
4379
|
-
case 'ArrowRight':
|
|
4380
|
-
newLeft = currentLeft + increment;
|
|
4381
|
-
break;
|
|
4382
|
-
}
|
|
4383
|
-
if (this.movementBounds) {
|
|
4384
|
-
newTop = Math.max(0, Math.min(newTop, this.movementBounds.containerHeight - currentHeight));
|
|
4385
|
-
newLeft = Math.max(0, Math.min(newLeft, this.movementBounds.containerWidth - currentWidth));
|
|
4386
|
-
}
|
|
4387
|
-
element.style.top = `${newTop}px`;
|
|
4388
|
-
element.style.left = `${newLeft}px`;
|
|
4389
|
-
this.moveSubject.next();
|
|
4390
|
-
}
|
|
4391
|
-
setMoving(moving) {
|
|
4392
|
-
if (this.isMoving !== moving) {
|
|
4393
|
-
this.isMoving = moving;
|
|
4394
|
-
this.keyboardMovingChange.emit(moving);
|
|
4395
|
-
}
|
|
4396
|
-
}
|
|
4397
|
-
emitStoppedEvent() {
|
|
4398
|
-
const element = this.elementRef.nativeElement;
|
|
4399
|
-
const wasFocused = document.activeElement === element;
|
|
4400
|
-
const stoppedEvent = new CustomEvent('stopped', {
|
|
4401
|
-
detail: element,
|
|
4402
|
-
bubbles: true
|
|
4403
|
-
});
|
|
4404
|
-
element.dispatchEvent(stoppedEvent);
|
|
4405
|
-
if (wasFocused) {
|
|
4406
|
-
setTimeout(() => {
|
|
4407
|
-
element.focus();
|
|
4408
|
-
}, 50);
|
|
4409
|
-
}
|
|
4410
|
-
}
|
|
4411
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: KeyboardBoxMoveDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4412
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.13", type: KeyboardBoxMoveDirective, selector: "[mvKeyboardBoxMove]", inputs: { enabled: "enabled", incrementSmall: "incrementSmall", incrementLarge: "incrementLarge", movementBounds: "movementBounds" }, outputs: { keyboardMovingChange: "keyboardMovingChange", boxDelete: "boxDelete" }, host: { listeners: { "keydown": "onKeyDown($event)" } }, ngImport: i0 }); }
|
|
4413
|
-
}
|
|
4414
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: KeyboardBoxMoveDirective, decorators: [{
|
|
4415
|
-
type: Directive,
|
|
4416
|
-
args: [{
|
|
4417
|
-
selector: '[mvKeyboardBoxMove]'
|
|
4418
|
-
}]
|
|
4419
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { enabled: [{
|
|
4420
|
-
type: Input
|
|
4421
|
-
}], incrementSmall: [{
|
|
4422
|
-
type: Input
|
|
4423
|
-
}], incrementLarge: [{
|
|
4424
|
-
type: Input
|
|
4425
|
-
}], movementBounds: [{
|
|
4426
|
-
type: Input
|
|
4427
|
-
}], keyboardMovingChange: [{
|
|
4428
|
-
type: Output
|
|
4429
|
-
}], boxDelete: [{
|
|
4430
|
-
type: Output
|
|
4431
|
-
}], onKeyDown: [{
|
|
4432
|
-
type: HostListener,
|
|
4433
|
-
args: ['keydown', ['$event']]
|
|
4434
4006
|
}] } });
|
|
4435
4007
|
|
|
4436
4008
|
class RectangleComponent {
|
|
@@ -4447,11 +4019,8 @@ class RectangleComponent {
|
|
|
4447
4019
|
constructor(toolbarEvents, highlightService) {
|
|
4448
4020
|
this.toolbarEvents = toolbarEvents;
|
|
4449
4021
|
this.highlightService = highlightService;
|
|
4450
|
-
this.rectangleTabIndex = 0;
|
|
4451
4022
|
this.selectEvent = new EventEmitter();
|
|
4452
4023
|
this.updateEvent = new EventEmitter();
|
|
4453
|
-
this.deleteEvent = new EventEmitter();
|
|
4454
|
-
this.keyboardMovingChange = new EventEmitter();
|
|
4455
4024
|
this.subscriptions = [];
|
|
4456
4025
|
this.enableGrabNDrag = false;
|
|
4457
4026
|
}
|
|
@@ -4459,16 +4028,9 @@ class RectangleComponent {
|
|
|
4459
4028
|
if (changes.rotate) {
|
|
4460
4029
|
this.adjustForRotation(this.rotate);
|
|
4461
4030
|
}
|
|
4462
|
-
if (changes.pageHeight || changes.pageWidth) {
|
|
4463
|
-
this.updateMovementBounds();
|
|
4464
|
-
}
|
|
4465
4031
|
}
|
|
4466
4032
|
ngAfterViewInit() {
|
|
4467
4033
|
this.subscriptions.push(this.toolbarEvents.grabNDrag.subscribe(grabNDrag => this.enableGrabNDrag = grabNDrag));
|
|
4468
|
-
setTimeout(() => this.updateMovementBounds(), 0);
|
|
4469
|
-
if (this._selected && this.viewRect) {
|
|
4470
|
-
this.viewRect.nativeElement.focus();
|
|
4471
|
-
}
|
|
4472
4034
|
}
|
|
4473
4035
|
ngOnDestroy() {
|
|
4474
4036
|
this.subscriptions.filter(subscription => !subscription.closed)
|
|
@@ -4486,9 +4048,6 @@ class RectangleComponent {
|
|
|
4486
4048
|
onClick() {
|
|
4487
4049
|
this.selectEvent.emit(this.annoRect);
|
|
4488
4050
|
}
|
|
4489
|
-
onFocus() {
|
|
4490
|
-
this.selectEvent.emit(this.annoRect);
|
|
4491
|
-
}
|
|
4492
4051
|
onUpdate(viewRect) {
|
|
4493
4052
|
const { offsetHeight, offsetWidth, offsetTop, offsetLeft } = viewRect;
|
|
4494
4053
|
if (this.hasRectangleChanged(viewRect)) {
|
|
@@ -4525,28 +4084,12 @@ class RectangleComponent {
|
|
|
4525
4084
|
Math.round(this.width) !== viewRect.offsetWidth ||
|
|
4526
4085
|
Math.round(this.height) !== viewRect.offsetHeight;
|
|
4527
4086
|
}
|
|
4528
|
-
updateMovementBounds() {
|
|
4529
|
-
if (this.pageHeight && this.pageWidth) {
|
|
4530
|
-
this.movementBounds = {
|
|
4531
|
-
containerHeight: this.pageHeight,
|
|
4532
|
-
containerWidth: this.pageWidth
|
|
4533
|
-
};
|
|
4534
|
-
}
|
|
4535
|
-
}
|
|
4536
|
-
onKeyboardMovingChange(isMoving) {
|
|
4537
|
-
this.keyboardMovingChange.emit(isMoving);
|
|
4538
|
-
}
|
|
4539
|
-
onDelete() {
|
|
4540
|
-
if (this._selected) {
|
|
4541
|
-
this.deleteEvent.emit(this.annoRect);
|
|
4542
|
-
}
|
|
4543
|
-
}
|
|
4544
4087
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RectangleComponent, deps: [{ token: ToolbarEventService }, { token: HighlightCreateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4545
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: RectangleComponent, selector: "mv-anno-rectangle", inputs: { color: "color", zoom: "zoom", rotate: "rotate", editable: "editable", pageHeight: "pageHeight", pageWidth: "pageWidth",
|
|
4088
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: RectangleComponent, selector: "mv-anno-rectangle", inputs: { color: "color", zoom: "zoom", rotate: "rotate", editable: "editable", pageHeight: "pageHeight", pageWidth: "pageWidth", annoRect: "annoRect", selected: "selected" }, outputs: { selectEvent: "selectEvent", updateEvent: "updateEvent" }, viewQueries: [{ propertyName: "viewRect", first: true, predicate: ["rectElement"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"editable; else nonEditable\">\n <div #rectElement\n class=\"rectangle\"\n draggable\n resizable\n [tabindex]=\"annoRect.id\"\n [ngClass]=\"{ 'selected': selected, 'grabNDrag': enableGrabNDrag }\"\n [style.backgroundColor]=\"'#' + color\"\n [style.width]=\"width + 'px'\"\n [style.height]=\"height + 'px'\"\n [style.left]=\"left + 'px'\"\n [style.top]=\"top + 'px'\"\n [rotate]=\"0\"\n [selected]=\"selected\"\n (click)=\"onClick()\"\n (stopped)=\"onUpdate(rectElement)\">\n </div>\n</div>\n<ng-template #nonEditable>\n <div #rectElement\n class=\"rectangle\"\n [tabindex]=\"annoRect.id\"\n [ngClass]=\"{ 'selected': selected }\"\n [style.backgroundColor]=\"'#' + color\"\n [style.width]=\"width + 'px'\"\n [style.height]=\"height+ 'px'\"\n [style.left]=\"left + 'px'\"\n [style.top]=\"top + 'px'\"\n (click)=\"onClick()\">\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4$1.DraggableElementDirective, selector: "[draggable]", inputs: ["rotate"], outputs: ["coordinates", "stopped"] }, { kind: "directive", type: i4$1.ResizableElementDirective, selector: "[resizable]", inputs: ["rotate", "selected"], outputs: ["stopped"] }] }); }
|
|
4546
4089
|
}
|
|
4547
4090
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: RectangleComponent, decorators: [{
|
|
4548
4091
|
type: Component,
|
|
4549
|
-
args: [{ selector: 'mv-anno-rectangle', template: "<div *ngIf=\"editable; else nonEditable\">\n <div #rectElement\n class=\"rectangle\"\n draggable\n resizable\n
|
|
4092
|
+
args: [{ selector: 'mv-anno-rectangle', template: "<div *ngIf=\"editable; else nonEditable\">\n <div #rectElement\n class=\"rectangle\"\n draggable\n resizable\n [tabindex]=\"annoRect.id\"\n [ngClass]=\"{ 'selected': selected, 'grabNDrag': enableGrabNDrag }\"\n [style.backgroundColor]=\"'#' + color\"\n [style.width]=\"width + 'px'\"\n [style.height]=\"height + 'px'\"\n [style.left]=\"left + 'px'\"\n [style.top]=\"top + 'px'\"\n [rotate]=\"0\"\n [selected]=\"selected\"\n (click)=\"onClick()\"\n (stopped)=\"onUpdate(rectElement)\">\n </div>\n</div>\n<ng-template #nonEditable>\n <div #rectElement\n class=\"rectangle\"\n [tabindex]=\"annoRect.id\"\n [ngClass]=\"{ 'selected': selected }\"\n [style.backgroundColor]=\"'#' + color\"\n [style.width]=\"width + 'px'\"\n [style.height]=\"height+ 'px'\"\n [style.left]=\"left + 'px'\"\n [style.top]=\"top + 'px'\"\n (click)=\"onClick()\">\n </div>\n</ng-template>\n" }]
|
|
4550
4093
|
}], ctorParameters: () => [{ type: ToolbarEventService }, { type: HighlightCreateService }], propDecorators: { color: [{
|
|
4551
4094
|
type: Input
|
|
4552
4095
|
}], zoom: [{
|
|
@@ -4559,16 +4102,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
4559
4102
|
type: Input
|
|
4560
4103
|
}], pageWidth: [{
|
|
4561
4104
|
type: Input
|
|
4562
|
-
}], rectangleTabIndex: [{
|
|
4563
|
-
type: Input
|
|
4564
4105
|
}], selectEvent: [{
|
|
4565
4106
|
type: Output
|
|
4566
4107
|
}], updateEvent: [{
|
|
4567
4108
|
type: Output
|
|
4568
|
-
}], deleteEvent: [{
|
|
4569
|
-
type: Output
|
|
4570
|
-
}], keyboardMovingChange: [{
|
|
4571
|
-
type: Output
|
|
4572
4109
|
}], viewRect: [{
|
|
4573
4110
|
type: ViewChild,
|
|
4574
4111
|
args: ['rectElement', { static: false }]
|
|
@@ -4702,41 +4239,18 @@ class AnnotationViewComponent {
|
|
|
4702
4239
|
if (selectedId) {
|
|
4703
4240
|
const id = this.anno.id || this.anno.redactionId; // todo make it unique
|
|
4704
4241
|
this.selected = selectedId.annotationId ? (selectedId.annotationId === id) : false;
|
|
4705
|
-
if (this.selected && !this.isKeyboardMoving) {
|
|
4706
|
-
this.showToolbarSubject.next(true);
|
|
4707
|
-
}
|
|
4708
|
-
else {
|
|
4709
|
-
this.showToolbarSubject.next(false);
|
|
4710
|
-
}
|
|
4711
4242
|
}
|
|
4712
4243
|
}
|
|
4713
4244
|
constructor(toolbarEvents, store) {
|
|
4714
4245
|
this.toolbarEvents = toolbarEvents;
|
|
4715
4246
|
this.store = store;
|
|
4716
|
-
this.isKeyboardMoving = false;
|
|
4717
|
-
this.showToolbar = false;
|
|
4718
|
-
this.showToolbarSubject = new Subject();
|
|
4719
4247
|
this.update = new EventEmitter();
|
|
4720
4248
|
this.delete = new EventEmitter();
|
|
4721
4249
|
this.annotationClick = new EventEmitter();
|
|
4722
|
-
this.showToolbarSubject
|
|
4723
|
-
.pipe(debounceTime$1(300))
|
|
4724
|
-
.subscribe(show => {
|
|
4725
|
-
this.showToolbar = show;
|
|
4726
|
-
});
|
|
4727
|
-
}
|
|
4728
|
-
ngOnDestroy() {
|
|
4729
|
-
this.showToolbarSubject.complete();
|
|
4730
|
-
}
|
|
4731
|
-
setShowToolbar(show) {
|
|
4732
|
-
this.showToolbarSubject.next(show);
|
|
4733
4250
|
}
|
|
4734
4251
|
onSelect() {
|
|
4735
4252
|
const annotationId = this.anno.id || this.anno.redactionId;
|
|
4736
4253
|
this.annotationClick.emit({ annotationId, editable: false, selected: true });
|
|
4737
|
-
if (!this.isKeyboardMoving) {
|
|
4738
|
-
this.setShowToolbar(true);
|
|
4739
|
-
}
|
|
4740
4254
|
}
|
|
4741
4255
|
onRectangleUpdate(rectangle) {
|
|
4742
4256
|
const annotation = { ...this.anno };
|
|
@@ -4772,22 +4286,12 @@ class AnnotationViewComponent {
|
|
|
4772
4286
|
this.annotationClick.emit({ annotationId: this.anno.id, editable: true, selected: true });
|
|
4773
4287
|
this.toolbarEvents.toggleCommentsPanel(true);
|
|
4774
4288
|
}
|
|
4775
|
-
onKeyboardMovingChange(isMoving) {
|
|
4776
|
-
this.isKeyboardMoving = isMoving;
|
|
4777
|
-
if (isMoving) {
|
|
4778
|
-
this.showToolbar = false;
|
|
4779
|
-
this.showToolbarSubject.next(false);
|
|
4780
|
-
}
|
|
4781
|
-
else if (this.selected) {
|
|
4782
|
-
this.setShowToolbar(true);
|
|
4783
|
-
}
|
|
4784
|
-
}
|
|
4785
4289
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AnnotationViewComponent, deps: [{ token: ToolbarEventService }, { token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4786
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AnnotationViewComponent, selector: "mv-annotation", inputs: { annotation: "annotation", zoom: "zoom", rotate: "rotate", selectedAnnoId: "selectedAnnoId", pageHeight: "pageHeight", pageWidth: "pageWidth" }, outputs: { update: "update", delete: "delete", annotationClick: "annotationClick" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], ngImport: i0, template: "<div #container [tabindex]=\"
|
|
4290
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AnnotationViewComponent, selector: "mv-annotation", inputs: { annotation: "annotation", zoom: "zoom", rotate: "rotate", selectedAnnoId: "selectedAnnoId", pageHeight: "pageHeight", pageWidth: "pageWidth" }, outputs: { update: "update", delete: "delete", annotationClick: "annotationClick" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], ngImport: i0, template: "<div #container [tabindex]=\"anno.id\">\n <mv-ctx-toolbar *ngIf=\"selected\"\n [canDelete]=\"true\" [canComment]=\"true\"\n [rectangles]=\"anno.rectangles\"\n [zoom]=\"zoom\"\n [rotate]=\"rotate\"\n [pageHeight]=\"pageHeight\"\n [pageWidth]=\"pageWidth\"\n (deleteHighlightEvent)=\"deleteHighlight()\"\n (addOrEditCommentEvent)=\"addOrEditComment()\">\n </mv-ctx-toolbar>\n <ng-container *ngFor=\"let rectangle of anno.rectangles\">\n <mv-anno-rectangle\n (selectEvent)=\"onSelect()\"\n (updateEvent)=\"onRectangleUpdate($event)\"\n [selected]=\"selected\"\n [zoom]=\"zoom\"\n [rotate]=\"rotate\"\n [pageHeight]=\"pageHeight\"\n [pageWidth]=\"pageWidth\"\n [editable]=\"anno.rectangles.length <= 1\"\n [annoRect]=\"rectangle\"\n [color]=\"anno.color\">\n </mv-anno-rectangle>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: RectangleComponent, selector: "mv-anno-rectangle", inputs: ["color", "zoom", "rotate", "editable", "pageHeight", "pageWidth", "annoRect", "selected"], outputs: ["selectEvent", "updateEvent"] }, { kind: "component", type: CtxToolbarComponent, selector: "mv-ctx-toolbar", inputs: ["zoom", "rotate", "pageHeight", "pageWidth", "canHighlight", "canBookmark", "canComment", "canDelete", "rectangles"], outputs: ["createHighlightEvent", "deleteHighlightEvent", "addOrEditCommentEvent", "createBookmarkEvent"] }] }); }
|
|
4787
4291
|
}
|
|
4788
4292
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AnnotationViewComponent, decorators: [{
|
|
4789
4293
|
type: Component,
|
|
4790
|
-
args: [{ selector: 'mv-annotation', template: "<div #container [tabindex]=\"
|
|
4294
|
+
args: [{ selector: 'mv-annotation', template: "<div #container [tabindex]=\"anno.id\">\n <mv-ctx-toolbar *ngIf=\"selected\"\n [canDelete]=\"true\" [canComment]=\"true\"\n [rectangles]=\"anno.rectangles\"\n [zoom]=\"zoom\"\n [rotate]=\"rotate\"\n [pageHeight]=\"pageHeight\"\n [pageWidth]=\"pageWidth\"\n (deleteHighlightEvent)=\"deleteHighlight()\"\n (addOrEditCommentEvent)=\"addOrEditComment()\">\n </mv-ctx-toolbar>\n <ng-container *ngFor=\"let rectangle of anno.rectangles\">\n <mv-anno-rectangle\n (selectEvent)=\"onSelect()\"\n (updateEvent)=\"onRectangleUpdate($event)\"\n [selected]=\"selected\"\n [zoom]=\"zoom\"\n [rotate]=\"rotate\"\n [pageHeight]=\"pageHeight\"\n [pageWidth]=\"pageWidth\"\n [editable]=\"anno.rectangles.length <= 1\"\n [annoRect]=\"rectangle\"\n [color]=\"anno.color\">\n </mv-anno-rectangle>\n </ng-container>\n</div>\n" }]
|
|
4791
4295
|
}], ctorParameters: () => [{ type: ToolbarEventService }, { type: i1.Store }], propDecorators: { annotation: [{
|
|
4792
4296
|
type: Input
|
|
4793
4297
|
}], zoom: [{
|
|
@@ -4905,8 +4409,8 @@ class MetadataLayerComponent {
|
|
|
4905
4409
|
this.rectangles = undefined;
|
|
4906
4410
|
});
|
|
4907
4411
|
}
|
|
4908
|
-
saveAnnotation({ rectangles, page
|
|
4909
|
-
this.highlightService.saveAnnotation(rectangles, page
|
|
4412
|
+
saveAnnotation({ rectangles, page }) {
|
|
4413
|
+
this.highlightService.saveAnnotation(rectangles, page);
|
|
4910
4414
|
this.toolbarEvents.drawModeSubject.next(false);
|
|
4911
4415
|
}
|
|
4912
4416
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: MetadataLayerComponent, deps: [{ token: i1.Store }, { token: HighlightCreateService }, { token: ToolbarEventService }, { token: ViewerEventService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -5889,12 +5393,37 @@ class PdfViewerComponent {
|
|
|
5889
5393
|
getCurrentPageNumber() {
|
|
5890
5394
|
return this.pdfWrapper.getPageNumber();
|
|
5891
5395
|
}
|
|
5396
|
+
onViewerContainerFocusIn(event) {
|
|
5397
|
+
const elementFrom = event.relatedTarget;
|
|
5398
|
+
const elementTo = event.target;
|
|
5399
|
+
const comingFromSidebar = !!(elementFrom?.closest('#sidebarContainer') ||
|
|
5400
|
+
elementFrom?.closest('#sidebarContent'));
|
|
5401
|
+
const goingToViewer = !!elementTo?.closest('#viewerContainer');
|
|
5402
|
+
if (!comingFromSidebar || !goingToViewer) {
|
|
5403
|
+
return;
|
|
5404
|
+
}
|
|
5405
|
+
const isTextLayer = elementTo?.classList.contains('textLayer');
|
|
5406
|
+
if (isTextLayer) {
|
|
5407
|
+
const focusedPageElement = elementTo.closest('[data-page-number]');
|
|
5408
|
+
const focusedPageNumber = focusedPageElement ? parseInt(focusedPageElement.getAttribute('data-page-number')) : null;
|
|
5409
|
+
const currentPage = this.getCurrentPageNumber();
|
|
5410
|
+
if (focusedPageNumber !== null && focusedPageNumber !== currentPage) {
|
|
5411
|
+
const currentPageElement = this.viewerContainer.nativeElement.querySelector(`[data-page-number='${currentPage}']`);
|
|
5412
|
+
if (currentPageElement) {
|
|
5413
|
+
const currentPageTextLayer = currentPageElement.querySelector('.textLayer');
|
|
5414
|
+
if (currentPageTextLayer) {
|
|
5415
|
+
currentPageTextLayer.focus();
|
|
5416
|
+
}
|
|
5417
|
+
}
|
|
5418
|
+
}
|
|
5419
|
+
}
|
|
5420
|
+
}
|
|
5892
5421
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PdfViewerComponent, deps: [{ token: i1.Store }, { token: i1.Store }, { token: PdfJsWrapperFactory }, { token: PrintService }, { token: ToolbarEventService }, { token: ViewerEventService }, { token: IcpService }, { token: ToolbarButtonVisibilityService }, { token: IcpEventService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5893
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: PdfViewerComponent, selector: "mv-pdf-viewer", inputs: { downloadUrl: "downloadUrl", url: "url", downloadFileName: "downloadFileName", enableAnnotations: "enableAnnotations", enableRedactions: "enableRedactions", enableICP: "enableICP", annotationSet: "annotationSet", enableRedactSearch: "enableRedactSearch", height: "height", caseId: "caseId", searchBarHidden: "searchBarHidden" }, outputs: { mediaLoadStatus: "mediaLoadStatus", pdfViewerException: "pdfViewerException", documentTitle: "documentTitle" }, viewQueries: [{ propertyName: "viewerContainer", first: true, predicate: ["viewerContainer"], descendants: true, static: true }, { propertyName: "pdfViewer", first: true, predicate: ["pdfViewer"], descendants: true }], usesOnChanges: true, ngImport: i0, 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 [isHidden]=\"!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) !== true\n \"\n [class.grabNDrag]=\"enableGrabNDrag\"\n >\n <div\n #pdfViewer\n class=\"pdfViewer\"\n mvCreateTextHighlight\n [ngClass]=\"{\n hidden: false,\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) !== true\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...\" | rpxTranslate}}{{\n loadingDocumentProgress ? loadingDocumentProgress + \"%\" : \"\"\n }}\n </h3>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: RedactionSearchBarComponent, selector: "mv-redaction-search-bar" }, { kind: "component", type: CommentSetComponent, selector: "mv-comment-set", inputs: ["annotationSet", "zoom", "rotate", "height", "pageHeights", "contentScrollTop"] }, { kind: "component", type: CommentSetHeaderComponent, selector: "mv-comment-set-header", inputs: ["showCommentSummary", "isHidden"], outputs: ["showCommentSummaryDialog"] }, { kind: "component", type: MetadataLayerComponent, selector: "mv-metadata-layer", inputs: ["zoom", "rotate"] }, { kind: "component", type: SideBarComponent, selector: "mv-side-bar", inputs: ["annotationsEnabled", "outline", "url", "zoom", "rotate", "currentPageNumber"] }, { kind: "directive", type: GrabNDragDirective, selector: "[mvGrabNDrag]", inputs: ["dragEnabled", "dragX"] }, { kind: "directive", type: HighlightCreateDirective, selector: "[mvCreateTextHighlight]" }, { kind: "component", type: RedactionComponent, selector: "mv-redactions", inputs: ["zoom", "rotate"] }, { kind: "component", type: BookmarkIconsComponent, selector: "mv-bookmark-icons", inputs: ["zoom", "rotate"] }, { kind: "component", type: ParticipantsListComponent, selector: "mv-participants-list" }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i5$1.RpxTranslatePipe, name: "rpxTranslate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
5422
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: PdfViewerComponent, selector: "mv-pdf-viewer", inputs: { downloadUrl: "downloadUrl", url: "url", downloadFileName: "downloadFileName", enableAnnotations: "enableAnnotations", enableRedactions: "enableRedactions", enableICP: "enableICP", annotationSet: "annotationSet", enableRedactSearch: "enableRedactSearch", height: "height", caseId: "caseId", searchBarHidden: "searchBarHidden" }, outputs: { mediaLoadStatus: "mediaLoadStatus", pdfViewerException: "pdfViewerException", documentTitle: "documentTitle" }, viewQueries: [{ propertyName: "viewerContainer", first: true, predicate: ["viewerContainer"], descendants: true, static: true }, { propertyName: "pdfViewer", first: true, predicate: ["pdfViewer"], descendants: true }], usesOnChanges: true, ngImport: i0, 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 [isHidden]=\"!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) !== true\n \"\n [class.grabNDrag]=\"enableGrabNDrag\"\n (focusin)=\"onViewerContainerFocusIn($event)\"\n >\n <div\n #pdfViewer\n class=\"pdfViewer\"\n mvCreateTextHighlight\n [ngClass]=\"{\n hidden: false,\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) !== true\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...\" | rpxTranslate}}{{\n loadingDocumentProgress ? loadingDocumentProgress + \"%\" : \"\"\n }}\n </h3>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: RedactionSearchBarComponent, selector: "mv-redaction-search-bar" }, { kind: "component", type: CommentSetComponent, selector: "mv-comment-set", inputs: ["annotationSet", "zoom", "rotate", "height", "pageHeights", "contentScrollTop"] }, { kind: "component", type: CommentSetHeaderComponent, selector: "mv-comment-set-header", inputs: ["showCommentSummary", "isHidden"], outputs: ["showCommentSummaryDialog"] }, { kind: "component", type: MetadataLayerComponent, selector: "mv-metadata-layer", inputs: ["zoom", "rotate"] }, { kind: "component", type: SideBarComponent, selector: "mv-side-bar", inputs: ["annotationsEnabled", "outline", "url", "zoom", "rotate", "currentPageNumber"] }, { kind: "directive", type: GrabNDragDirective, selector: "[mvGrabNDrag]", inputs: ["dragEnabled", "dragX"] }, { kind: "directive", type: HighlightCreateDirective, selector: "[mvCreateTextHighlight]" }, { kind: "component", type: RedactionComponent, selector: "mv-redactions", inputs: ["zoom", "rotate"] }, { kind: "component", type: BookmarkIconsComponent, selector: "mv-bookmark-icons", inputs: ["zoom", "rotate"] }, { kind: "component", type: ParticipantsListComponent, selector: "mv-participants-list" }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i5$1.RpxTranslatePipe, name: "rpxTranslate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
5894
5423
|
}
|
|
5895
5424
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PdfViewerComponent, decorators: [{
|
|
5896
5425
|
type: Component,
|
|
5897
|
-
args: [{ selector: 'mv-pdf-viewer', encapsulation: ViewEncapsulation.None, 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 [isHidden]=\"!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) !== true\n \"\n [class.grabNDrag]=\"enableGrabNDrag\"\n >\n <div\n #pdfViewer\n class=\"pdfViewer\"\n mvCreateTextHighlight\n [ngClass]=\"{\n hidden: false,\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) !== true\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...\" | rpxTranslate}}{{\n loadingDocumentProgress ? loadingDocumentProgress + \"%\" : \"\"\n }}\n </h3>\n </div>\n</div>\n" }]
|
|
5426
|
+
args: [{ selector: 'mv-pdf-viewer', encapsulation: ViewEncapsulation.None, 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 [isHidden]=\"!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) !== true\n \"\n [class.grabNDrag]=\"enableGrabNDrag\"\n (focusin)=\"onViewerContainerFocusIn($event)\"\n >\n <div\n #pdfViewer\n class=\"pdfViewer\"\n mvCreateTextHighlight\n [ngClass]=\"{\n hidden: false,\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) !== true\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...\" | rpxTranslate}}{{\n loadingDocumentProgress ? loadingDocumentProgress + \"%\" : \"\"\n }}\n </h3>\n </div>\n</div>\n" }]
|
|
5898
5427
|
}], ctorParameters: () => [{ type: i1.Store }, { type: i1.Store }, { type: PdfJsWrapperFactory }, { type: PrintService }, { type: ToolbarEventService }, { type: ViewerEventService }, { type: IcpService }, { type: ToolbarButtonVisibilityService }, { type: IcpEventService }], propDecorators: { mediaLoadStatus: [{
|
|
5899
5428
|
type: Output
|
|
5900
5429
|
}], pdfViewerException: [{
|
|
@@ -7467,9 +6996,7 @@ class AnnotationsModule {
|
|
|
7467
6996
|
MomentDatePipe,
|
|
7468
6997
|
CommentFilterComponent,
|
|
7469
6998
|
FilterPipe,
|
|
7470
|
-
UnsnakePipe,
|
|
7471
|
-
KeyboardBoxDrawDirective,
|
|
7472
|
-
KeyboardBoxMoveDirective], imports: [A11yModule,
|
|
6999
|
+
UnsnakePipe], imports: [A11yModule,
|
|
7473
7000
|
CommonModule,
|
|
7474
7001
|
FormsModule,
|
|
7475
7002
|
HttpClientModule,
|
|
@@ -7545,9 +7072,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
7545
7072
|
MomentDatePipe,
|
|
7546
7073
|
CommentFilterComponent,
|
|
7547
7074
|
FilterPipe,
|
|
7548
|
-
UnsnakePipe
|
|
7549
|
-
KeyboardBoxDrawDirective,
|
|
7550
|
-
KeyboardBoxMoveDirective
|
|
7075
|
+
UnsnakePipe
|
|
7551
7076
|
],
|
|
7552
7077
|
providers: [
|
|
7553
7078
|
AnnotationApiService,
|
|
@@ -7591,11 +7116,7 @@ class AnnotationEffects {
|
|
|
7591
7116
|
})));
|
|
7592
7117
|
this.postAnnotation$ = createEffect(() => this.actions$.pipe(ofType(SAVE_ANNOTATION), concatMap((action) => {
|
|
7593
7118
|
return this.annotationApiService.postAnnotation(action.payload).pipe(map(annotations => {
|
|
7594
|
-
|
|
7595
|
-
successAction.autoSelect = action.autoSelect;
|
|
7596
|
-
successAction.annotationId = action.payload.id;
|
|
7597
|
-
return successAction;
|
|
7598
|
-
// return new annotationsActions.SaveAnnotationSuccess(annotations);
|
|
7119
|
+
return new SaveAnnotationSuccess(annotations);
|
|
7599
7120
|
}), catchError(error => {
|
|
7600
7121
|
return of(new LoadAnnotationSetFail(error));
|
|
7601
7122
|
}));
|
|
@@ -7614,13 +7135,6 @@ class AnnotationEffects {
|
|
|
7614
7135
|
return of(new SaveAnnotationSetFail(error));
|
|
7615
7136
|
}));
|
|
7616
7137
|
})));
|
|
7617
|
-
this.autoSelectAnnotation$ = createEffect(() => this.actions$.pipe(ofType(SAVE_ANNOTATION_SUCCESS), filter((action) => action.autoSelect === true && action.annotationId), map((action) => {
|
|
7618
|
-
return new SelectedAnnotation({
|
|
7619
|
-
annotationId: action.annotationId,
|
|
7620
|
-
editable: false,
|
|
7621
|
-
selected: true
|
|
7622
|
-
});
|
|
7623
|
-
})));
|
|
7624
7138
|
}
|
|
7625
7139
|
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AnnotationEffects, deps: [{ token: i1$2.Actions }, { token: AnnotationApiService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
7626
7140
|
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AnnotationEffects }); }
|