@hmcts/media-viewer 2.7.23 → 2.7.24
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/outline-attachment.scss +6 -1
- package/bundles/hmcts-media-viewer.umd.js +211 -20
- package/bundles/hmcts-media-viewer.umd.js.map +1 -1
- package/bundles/hmcts-media-viewer.umd.min.js +1 -1
- package/bundles/hmcts-media-viewer.umd.min.js.map +1 -1
- package/esm2015/lib/store/selectors/annotation.selectors.js +10 -2
- package/esm2015/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.js +56 -2
- package/esm2015/lib/viewers/pdf-viewer/pdf-viewer.component.js +8 -2
- package/esm2015/lib/viewers/pdf-viewer/side-bar/outline-item/outline-item.component.js +33 -2
- package/esm2015/lib/viewers/pdf-viewer/side-bar/outline-item/outline.model.js +3 -1
- package/esm2015/lib/viewers/pdf-viewer/side-bar/side-bar.component.js +22 -3
- package/esm5/lib/store/selectors/annotation.selectors.js +10 -2
- package/esm5/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.js +126 -16
- package/esm5/lib/viewers/pdf-viewer/pdf-viewer.component.js +11 -2
- package/esm5/lib/viewers/pdf-viewer/side-bar/outline-item/outline-item.component.js +45 -2
- package/esm5/lib/viewers/pdf-viewer/side-bar/outline-item/outline.model.js +3 -1
- package/esm5/lib/viewers/pdf-viewer/side-bar/side-bar.component.js +31 -3
- package/fesm2015/hmcts-media-viewer.js +116 -6
- package/fesm2015/hmcts-media-viewer.js.map +1 -1
- package/fesm5/hmcts-media-viewer.js +210 -20
- package/fesm5/hmcts-media-viewer.js.map +1 -1
- package/hmcts-media-viewer-v2.7.24.tgz +0 -0
- package/hmcts-media-viewer.metadata.json +1 -1
- package/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.d.ts +3 -0
- package/lib/viewers/pdf-viewer/pdf-viewer.component.d.ts +1 -0
- package/lib/viewers/pdf-viewer/side-bar/outline-item/outline-item.component.d.ts +6 -0
- package/lib/viewers/pdf-viewer/side-bar/outline-item/outline.model.d.ts +2 -1
- package/lib/viewers/pdf-viewer/side-bar/side-bar.component.d.ts +3 -0
- package/package.json +1 -1
- package/hmcts-media-viewer-v2.7.23.tgz +0 -0
|
@@ -32,7 +32,7 @@ html[dir='rtl'] .outlineItem > .outlineItems {
|
|
|
32
32
|
.attachmentsItem > button {
|
|
33
33
|
text-decoration: none;
|
|
34
34
|
display:inline-block;
|
|
35
|
-
width: calc(100% -
|
|
35
|
+
width: calc(100% - 1.5em); /* Subtract the right padding (left, in RTL mode)
|
|
36
36
|
of the container. */
|
|
37
37
|
height: auto;
|
|
38
38
|
margin-bottom: 1px;
|
|
@@ -47,6 +47,11 @@ html[dir='rtl'] .outlineItem > .outlineItems {
|
|
|
47
47
|
white-space: normal;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
.highlightedOutlineItem {
|
|
51
|
+
background-color: white;
|
|
52
|
+
color: rgba(0, 0, 0, 0.8);
|
|
53
|
+
}
|
|
54
|
+
|
|
50
55
|
.attachmentsItem > button {
|
|
51
56
|
border: 0 none;
|
|
52
57
|
background: none;
|
|
@@ -302,10 +302,10 @@
|
|
|
302
302
|
*/
|
|
303
303
|
function (documentUrl) {
|
|
304
304
|
return __awaiter(this, void 0, void 0, function () {
|
|
305
|
-
var loadingTask, pdfDocument,
|
|
305
|
+
var loadingTask, pdfDocument, outline, pdfMetaData, e_1;
|
|
306
306
|
var _this = this;
|
|
307
|
-
return __generator(this, function (
|
|
308
|
-
switch (
|
|
307
|
+
return __generator(this, function (_a) {
|
|
308
|
+
switch (_a.label) {
|
|
309
309
|
case 0:
|
|
310
310
|
loadingTask = pdfjsLib.getDocument({
|
|
311
311
|
url: documentUrl,
|
|
@@ -321,31 +321,143 @@
|
|
|
321
321
|
_this.documentLoadProgress.next({ loaded: loaded, total: total });
|
|
322
322
|
});
|
|
323
323
|
this.documentLoadInit.next(documentUrl);
|
|
324
|
-
|
|
324
|
+
_a.label = 1;
|
|
325
325
|
case 1:
|
|
326
|
-
|
|
326
|
+
_a.trys.push([1, 6, , 7]);
|
|
327
327
|
return [4 /*yield*/, loadingTask.promise];
|
|
328
328
|
case 2:
|
|
329
|
-
pdfDocument =
|
|
329
|
+
pdfDocument = _a.sent();
|
|
330
330
|
this.documentLoaded.next(pdfDocument);
|
|
331
331
|
this.toolbarEvents.pageCountSubject.next(pdfDocument.numPages);
|
|
332
332
|
this.pdfViewer.setDocument(pdfDocument);
|
|
333
333
|
this.pdfViewer.linkService.setDocument(pdfDocument, null);
|
|
334
|
-
_a = this;
|
|
335
334
|
return [4 /*yield*/, pdfDocument.getOutline()];
|
|
336
335
|
case 3:
|
|
337
|
-
|
|
336
|
+
outline = _a.sent();
|
|
337
|
+
return [4 /*yield*/, this.setOutlinePageNumbers(pdfDocument, outline)];
|
|
338
|
+
case 4:
|
|
339
|
+
_a.sent();
|
|
340
|
+
this.documentOutline = outline;
|
|
338
341
|
this.outlineLoaded.next(this.documentOutline);
|
|
339
342
|
return [4 /*yield*/, pdfDocument.getMetadata()];
|
|
340
|
-
case 4:
|
|
341
|
-
pdfMetaData = _b.sent();
|
|
342
|
-
this.setCurrentPDFTitle(pdfMetaData.info.Title);
|
|
343
|
-
return [3 /*break*/, 6];
|
|
344
343
|
case 5:
|
|
345
|
-
|
|
344
|
+
pdfMetaData = _a.sent();
|
|
345
|
+
this.setCurrentPDFTitle(pdfMetaData.info.Title);
|
|
346
|
+
return [3 /*break*/, 7];
|
|
347
|
+
case 6:
|
|
348
|
+
e_1 = _a.sent();
|
|
346
349
|
this.documentLoadFailed.next(e_1);
|
|
347
|
-
return [3 /*break*/,
|
|
348
|
-
case
|
|
350
|
+
return [3 /*break*/, 7];
|
|
351
|
+
case 7: return [2 /*return*/];
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
});
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* @private
|
|
358
|
+
* @param {?} pdfDocument
|
|
359
|
+
* @param {?} outlineArray
|
|
360
|
+
* @return {?}
|
|
361
|
+
*/
|
|
362
|
+
PdfJsWrapper.prototype.setOutlinePageNumbers = /**
|
|
363
|
+
* @private
|
|
364
|
+
* @param {?} pdfDocument
|
|
365
|
+
* @param {?} outlineArray
|
|
366
|
+
* @return {?}
|
|
367
|
+
*/
|
|
368
|
+
function (pdfDocument, outlineArray) {
|
|
369
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
370
|
+
var _this = this;
|
|
371
|
+
return __generator(this, function (_a) {
|
|
372
|
+
outlineArray.forEach(( /**
|
|
373
|
+
* @param {?} outline
|
|
374
|
+
* @return {?}
|
|
375
|
+
*/function (outline) {
|
|
376
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
377
|
+
return __generator(this, function (_a) {
|
|
378
|
+
switch (_a.label) {
|
|
379
|
+
case 0: return [4 /*yield*/, this.setNestedOutlinePageNumbers(pdfDocument, outline)];
|
|
380
|
+
case 1:
|
|
381
|
+
_a.sent();
|
|
382
|
+
return [2 /*return*/];
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
});
|
|
386
|
+
}));
|
|
387
|
+
return [2 /*return*/];
|
|
388
|
+
});
|
|
389
|
+
});
|
|
390
|
+
};
|
|
391
|
+
/**
|
|
392
|
+
* @private
|
|
393
|
+
* @param {?} pdfDocument
|
|
394
|
+
* @param {?} outline
|
|
395
|
+
* @return {?}
|
|
396
|
+
*/
|
|
397
|
+
PdfJsWrapper.prototype.setNestedOutlinePageNumbers = /**
|
|
398
|
+
* @private
|
|
399
|
+
* @param {?} pdfDocument
|
|
400
|
+
* @param {?} outline
|
|
401
|
+
* @return {?}
|
|
402
|
+
*/
|
|
403
|
+
function (pdfDocument, outline) {
|
|
404
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
405
|
+
var _a;
|
|
406
|
+
var _this = this;
|
|
407
|
+
return __generator(this, function (_b) {
|
|
408
|
+
switch (_b.label) {
|
|
409
|
+
case 0:
|
|
410
|
+
_a = outline;
|
|
411
|
+
return [4 /*yield*/, this.getOutlinePageNumber(pdfDocument, outline)];
|
|
412
|
+
case 1:
|
|
413
|
+
_a.pageNumber = _b.sent();
|
|
414
|
+
outline.items.forEach(( /**
|
|
415
|
+
* @param {?} outlineItem
|
|
416
|
+
* @return {?}
|
|
417
|
+
*/function (outlineItem) {
|
|
418
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
419
|
+
var _a;
|
|
420
|
+
return __generator(this, function (_b) {
|
|
421
|
+
switch (_b.label) {
|
|
422
|
+
case 0:
|
|
423
|
+
_a = outlineItem;
|
|
424
|
+
return [4 /*yield*/, this.getOutlinePageNumber(pdfDocument, outlineItem)];
|
|
425
|
+
case 1:
|
|
426
|
+
_a.pageNumber = _b.sent();
|
|
427
|
+
this.setNestedOutlinePageNumbers(pdfDocument, outlineItem);
|
|
428
|
+
return [2 /*return*/];
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
});
|
|
432
|
+
}));
|
|
433
|
+
return [2 /*return*/];
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
});
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* @private
|
|
440
|
+
* @param {?} pdfDocument
|
|
441
|
+
* @param {?} outline
|
|
442
|
+
* @return {?}
|
|
443
|
+
*/
|
|
444
|
+
PdfJsWrapper.prototype.getOutlinePageNumber = /**
|
|
445
|
+
* @private
|
|
446
|
+
* @param {?} pdfDocument
|
|
447
|
+
* @param {?} outline
|
|
448
|
+
* @return {?}
|
|
449
|
+
*/
|
|
450
|
+
function (pdfDocument, outline) {
|
|
451
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
452
|
+
var dest, pageIndex;
|
|
453
|
+
return __generator(this, function (_a) {
|
|
454
|
+
switch (_a.label) {
|
|
455
|
+
case 0:
|
|
456
|
+
dest = outline.dest;
|
|
457
|
+
return [4 /*yield*/, pdfDocument.getPageIndex(dest[0])];
|
|
458
|
+
case 1:
|
|
459
|
+
pageIndex = _a.sent();
|
|
460
|
+
return [2 /*return*/, Number(pageIndex) + 1];
|
|
349
461
|
}
|
|
350
462
|
});
|
|
351
463
|
});
|
|
@@ -4318,10 +4430,19 @@
|
|
|
4318
4430
|
function (destination) {
|
|
4319
4431
|
this.pdfWrapper.navigateTo(destination);
|
|
4320
4432
|
};
|
|
4433
|
+
/**
|
|
4434
|
+
* @return {?}
|
|
4435
|
+
*/
|
|
4436
|
+
PdfViewerComponent.prototype.getCurrentPageNumber = /**
|
|
4437
|
+
* @return {?}
|
|
4438
|
+
*/
|
|
4439
|
+
function () {
|
|
4440
|
+
return this.pdfWrapper.getPageNumber();
|
|
4441
|
+
};
|
|
4321
4442
|
PdfViewerComponent.decorators = [
|
|
4322
4443
|
{ type: i0.Component, args: [{
|
|
4323
4444
|
selector: 'mv-pdf-viewer',
|
|
4324
|
-
template: "<mv-side-bar *ngIf=\"toolbarEvents.sidebarOpen\"\n id=\"sidebarContainer\"\n [url]=\"url\"\n [zoom]=\"zoom\"\n [rotate]=\"rotation\"\n [outline]=\"documentOutline\"\n [annotationsEnabled]=\"enableAnnotations\">\n</mv-side-bar>\n<mv-comment-set-header\n *ngIf=\"enableAnnotations\"\n [ngClass]=\"{'show-comments-panel': showCommentsPanel}\"\n [showCommentSummary]=\"toolbarButtons.showCommentSummary\"\n (showCommentSummaryDialog)=\"toggleCommentsSummary()\">\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 <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]=\"(showCommentsPanel || showIcpParticipantsList) && !(toolbarEvents.redactionMode | async)\"\n [class.grabNDrag]=\"enableGrabNDrag\">\n <div #pdfViewer\n class=\"pdfViewer\"\n mvCreateTextHighlight\n [ngClass]=\"{ hidden: loadingDocument, highlightMode: highlightMode | async, drawMode: drawMode | async }\">\n </div>\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\n *ngIf=\"enableAnnotations && annotationSet\"\n [zoom]=\"zoom\"\n [rotate]=\"rotation\">\n </mv-metadata-layer>\n <mv-bookmark-icons [zoom]=\"zoom\"\n [rotate]=\"rotation\">\n </mv-bookmark-icons>\n </ng-template>\n </div>\n <mv-comment-set [contentScrollTop]=\"viewerContainer.scrollTop\"\n *ngIf=\"enableAnnotations && annotationSet && !(toolbarEvents.redactionMode | async)\"\n [annotationSet]=\"annotationSet\"\n [zoom]=\"zoom\"\n [rotate]=\"rotation\"\n [height]=\"pdfViewer.offsetHeight\"\n [pageHeights]=\"pageHeights\">\n </mv-comment-set>\n <div class=\"loadingMessage\" *ngIf=\"loadingDocument\">\n <h3 class=\"govuk-heading-m\">Loading...{{ loadingDocumentProgress ? loadingDocumentProgress + '%' : '' }}</h3>\n </div>\n</div>\n",
|
|
4445
|
+
template: "<mv-side-bar *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</mv-side-bar>\n<mv-comment-set-header\n *ngIf=\"enableAnnotations\"\n [ngClass]=\"{'show-comments-panel': showCommentsPanel}\"\n [showCommentSummary]=\"toolbarButtons.showCommentSummary\"\n (showCommentSummaryDialog)=\"toggleCommentsSummary()\">\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 <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]=\"(showCommentsPanel || showIcpParticipantsList) && !(toolbarEvents.redactionMode | async)\"\n [class.grabNDrag]=\"enableGrabNDrag\">\n <div #pdfViewer\n class=\"pdfViewer\"\n mvCreateTextHighlight\n [ngClass]=\"{ hidden: loadingDocument, highlightMode: highlightMode | async, drawMode: drawMode | async }\">\n </div>\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\n *ngIf=\"enableAnnotations && annotationSet\"\n [zoom]=\"zoom\"\n [rotate]=\"rotation\">\n </mv-metadata-layer>\n <mv-bookmark-icons [zoom]=\"zoom\"\n [rotate]=\"rotation\">\n </mv-bookmark-icons>\n </ng-template>\n </div>\n <mv-comment-set [contentScrollTop]=\"viewerContainer.scrollTop\"\n *ngIf=\"enableAnnotations && annotationSet && !(toolbarEvents.redactionMode | async)\"\n [annotationSet]=\"annotationSet\"\n [zoom]=\"zoom\"\n [rotate]=\"rotation\"\n [height]=\"pdfViewer.offsetHeight\"\n [pageHeights]=\"pageHeights\">\n </mv-comment-set>\n <div class=\"loadingMessage\" *ngIf=\"loadingDocument\">\n <h3 class=\"govuk-heading-m\">Loading...{{ loadingDocumentProgress ? loadingDocumentProgress + '%' : '' }}</h3>\n </div>\n</div>\n",
|
|
4325
4446
|
encapsulation: i0.ViewEncapsulation.None
|
|
4326
4447
|
}] }
|
|
4327
4448
|
];
|
|
@@ -5235,7 +5356,14 @@
|
|
|
5235
5356
|
/** @type {?} */
|
|
5236
5357
|
var comments = StoreUtils.filterCommentsSummary(commentSummary, filters.filters);
|
|
5237
5358
|
if (comments.length) {
|
|
5238
|
-
|
|
5359
|
+
/** @type {?} */
|
|
5360
|
+
var savedComments = comments.filter(( /**
|
|
5361
|
+
* @param {?} comment
|
|
5362
|
+
* @return {?}
|
|
5363
|
+
*/function (comment) {
|
|
5364
|
+
return comment.createdByDetails !== undefined;
|
|
5365
|
+
}));
|
|
5366
|
+
return savedComments.map(( /**
|
|
5239
5367
|
* @param {?} comment
|
|
5240
5368
|
* @return {?}
|
|
5241
5369
|
*/function (comment) {
|
|
@@ -9790,10 +9918,35 @@
|
|
|
9790
9918
|
_this.store.dispatch(new CreateBookmark(( /** @type {?} */(__assign({}, bookmarkInfo, { name: '', id: uuid$1__default() })))));
|
|
9791
9919
|
}));
|
|
9792
9920
|
};
|
|
9921
|
+
/**
|
|
9922
|
+
* @param {?} current
|
|
9923
|
+
* @param {?} next
|
|
9924
|
+
* @return {?}
|
|
9925
|
+
*/
|
|
9926
|
+
SideBarComponent.prototype.isViewedItem = /**
|
|
9927
|
+
* @param {?} current
|
|
9928
|
+
* @param {?} next
|
|
9929
|
+
* @return {?}
|
|
9930
|
+
*/
|
|
9931
|
+
function (current, next) {
|
|
9932
|
+
return next === undefined ? current.pageNumber <= this.currentPageNumber :
|
|
9933
|
+
current.pageNumber <= this.currentPageNumber && (next.pageNumber > this.currentPageNumber);
|
|
9934
|
+
};
|
|
9935
|
+
/**
|
|
9936
|
+
* @param {?} next
|
|
9937
|
+
* @return {?}
|
|
9938
|
+
*/
|
|
9939
|
+
SideBarComponent.prototype.findEndPage = /**
|
|
9940
|
+
* @param {?} next
|
|
9941
|
+
* @return {?}
|
|
9942
|
+
*/
|
|
9943
|
+
function (next) {
|
|
9944
|
+
return next === undefined ? Number.MAX_SAFE_INTEGER : next.pageNumber;
|
|
9945
|
+
};
|
|
9793
9946
|
SideBarComponent.decorators = [
|
|
9794
9947
|
{ type: i0.Component, args: [{
|
|
9795
9948
|
selector: 'mv-side-bar',
|
|
9796
|
-
template: "<div id=\"toolbarSidebar\">\n <div class=\"splitToolbarButton toggled\">\n <button id=\"viewOutline\"\n [ngClass]=\"{ 'toolbarButton': true, 'toggled': selectedView === 'outline' }\"\n (click)=\"toggleSidebarView('outline')\"\n title=\"Show Document Outline\" tabindex=\"1\" data-l10n-id=\"document_outline\">\n <span data-l10n-id=\"document_outline_label\">Document Outline</span>\n </button>\n <button *ngIf=\"annotationsEnabled\"\n id=\"viewBookmark\" class=\"toolbarButton bookmark\"\n [ngClass]=\"{ toggled: selectedView === 'bookmarks' }\"\n (click)=\"toggleSidebarView('bookmarks')\"\n title=\"Show Bookmarks\" tabindex=\"2\" data-l10n-id=\"bookmarks\">\n <span data-l10n-id=\"bookmarks_label\">Bookmarks</span>\n </button>\n </div>\n <div class=\"splitToolbarButtonSeparator\"></div>\n <div *ngIf=\"annotationsEnabled\"\n class=\"splitToolbarButton right\">\n <button id=\"addBookmark\"\n class=\"toolbarButton addBookmark\"\n (click)=\"onAddBookmarkClick()\"\n title=\"Add bookmark\" tabindex=\"3\" data-l10n-id=\"addBookmark\">\n <span data-l10n-id=\"addBookmark_label\">Add bookmark</span>\n </button>\n </div>\n</div>\n<div id=\"sidebarContent\">\n <div id=\"outlineView\" class=\"outlineWithDeepNesting\">\n <div class=\"outlineItem\" *ngIf=\"selectedView === 'outline'\">\n <mv-outline-item *ngFor=\"let outlineItem of outline\"\n [outline]=\"outlineItem\"\n (navigationEvent)=\"goToDestination($event)\"></mv-outline-item>\n </div>\n <div *ngIf=\"annotationsEnabled && selectedView === 'bookmarks'\"\n id=\"bookmarkContainer\">\n <mv-bookmarks [bookmarkNodes]=\"bookmarkNodes$ | async\"\n [zoom]=\"zoom\" [rotate]=\"rotate\"\n (goToDestination)=\"goToDestination($event)\"></mv-bookmarks>\n </div>\n </div>\n</div>\n"
|
|
9949
|
+
template: "<div id=\"toolbarSidebar\">\n <div class=\"splitToolbarButton toggled\">\n <button id=\"viewOutline\"\n [ngClass]=\"{ 'toolbarButton': true, 'toggled': selectedView === 'outline' }\"\n (click)=\"toggleSidebarView('outline')\"\n title=\"Show Document Outline\" tabindex=\"1\" data-l10n-id=\"document_outline\">\n <span data-l10n-id=\"document_outline_label\">Document Outline</span>\n </button>\n <button *ngIf=\"annotationsEnabled\"\n id=\"viewBookmark\" class=\"toolbarButton bookmark\"\n [ngClass]=\"{ toggled: selectedView === 'bookmarks' }\"\n (click)=\"toggleSidebarView('bookmarks')\"\n title=\"Show Bookmarks\" tabindex=\"2\" data-l10n-id=\"bookmarks\">\n <span data-l10n-id=\"bookmarks_label\">Bookmarks</span>\n </button>\n </div>\n <div class=\"splitToolbarButtonSeparator\"></div>\n <div *ngIf=\"annotationsEnabled\"\n class=\"splitToolbarButton right\">\n <button id=\"addBookmark\"\n class=\"toolbarButton addBookmark\"\n (click)=\"onAddBookmarkClick()\"\n title=\"Add bookmark\" tabindex=\"3\" data-l10n-id=\"addBookmark\">\n <span data-l10n-id=\"addBookmark_label\">Add bookmark</span>\n </button>\n </div>\n</div>\n<div id=\"sidebarContent\">\n <div id=\"outlineView\" class=\"outlineWithDeepNesting\">\n <div class=\"outlineItem\" *ngIf=\"selectedView === 'outline'\">\n <mv-outline-item *ngFor=\"let outlineItem of outline; index as i\"\n [outline]=\"outlineItem\"\n [currentPageNumber]=\"currentPageNumber\"\n [isCurrentSection]= \"isViewedItem(outlineItem, outline[i+1])\"\n [endPage]=\"findEndPage(outline[i+1])\"\n (navigationEvent)=\"goToDestination($event)\"></mv-outline-item>\n </div>\n <div *ngIf=\"annotationsEnabled && selectedView === 'bookmarks'\"\n id=\"bookmarkContainer\">\n <mv-bookmarks [bookmarkNodes]=\"bookmarkNodes$ | async\"\n [zoom]=\"zoom\" [rotate]=\"rotate\"\n (goToDestination)=\"goToDestination($event)\"></mv-bookmarks>\n </div>\n </div>\n</div>\n"
|
|
9797
9950
|
}] }
|
|
9798
9951
|
];
|
|
9799
9952
|
/** @nocollapse */
|
|
@@ -9808,7 +9961,8 @@
|
|
|
9808
9961
|
outline: [{ type: i0.Input }],
|
|
9809
9962
|
url: [{ type: i0.Input }],
|
|
9810
9963
|
zoom: [{ type: i0.Input }],
|
|
9811
|
-
rotate: [{ type: i0.Input }]
|
|
9964
|
+
rotate: [{ type: i0.Input }],
|
|
9965
|
+
currentPageNumber: [{ type: i0.Input }]
|
|
9812
9966
|
};
|
|
9813
9967
|
return SideBarComponent;
|
|
9814
9968
|
}());
|
|
@@ -9852,14 +10006,51 @@
|
|
|
9852
10006
|
function () {
|
|
9853
10007
|
this.showOutlineItems = !this.showOutlineItems;
|
|
9854
10008
|
};
|
|
10009
|
+
/**
|
|
10010
|
+
* @param {?} current
|
|
10011
|
+
* @param {?} next
|
|
10012
|
+
* @return {?}
|
|
10013
|
+
*/
|
|
10014
|
+
OutlineItemComponent.prototype.isViewedItem = /**
|
|
10015
|
+
* @param {?} current
|
|
10016
|
+
* @param {?} next
|
|
10017
|
+
* @return {?}
|
|
10018
|
+
*/
|
|
10019
|
+
function (current, next) {
|
|
10020
|
+
return next === undefined ? current.pageNumber <= this.currentPageNumber && this.endPage > this.currentPageNumber :
|
|
10021
|
+
current.pageNumber <= this.currentPageNumber && (next.pageNumber > this.currentPageNumber);
|
|
10022
|
+
};
|
|
10023
|
+
/**
|
|
10024
|
+
* @param {?} next
|
|
10025
|
+
* @return {?}
|
|
10026
|
+
*/
|
|
10027
|
+
OutlineItemComponent.prototype.findEndPage = /**
|
|
10028
|
+
* @param {?} next
|
|
10029
|
+
* @return {?}
|
|
10030
|
+
*/
|
|
10031
|
+
function (next) {
|
|
10032
|
+
return next === undefined ? Number.MAX_SAFE_INTEGER : next.pageNumber;
|
|
10033
|
+
};
|
|
10034
|
+
/**
|
|
10035
|
+
* @return {?}
|
|
10036
|
+
*/
|
|
10037
|
+
OutlineItemComponent.prototype.showHighlightOutlineCss = /**
|
|
10038
|
+
* @return {?}
|
|
10039
|
+
*/
|
|
10040
|
+
function () {
|
|
10041
|
+
return this.isCurrentSection ? 'highlightedOutlineItem' : 'outlineItem';
|
|
10042
|
+
};
|
|
9855
10043
|
OutlineItemComponent.decorators = [
|
|
9856
10044
|
{ type: i0.Component, args: [{
|
|
9857
10045
|
selector: 'mv-outline-item',
|
|
9858
|
-
template: "<div class=\"outlineItem\">\n <div *ngIf=\"outline.items.length > 0\"\n [ngClass]=\"{ 'outlineItemToggler': true, 'outlineItemsHidden': !showOutlineItems }\"\n (click)=\"toggleOutline()\"\n (keyup.enter)=\"toggleOutline()\" tabindex=\"0\"></div>\n <a (click)=\"goToDestination(outline?.dest)\"\n (keyup.enter)=\"goToDestination(outline?.dest)\"\n [style.font-weight]=\"outline.bold ? 'bold' : ''\"\n [style.font-style]=\"outline.italic ? 'italic' : ''\"\n tabindex=\"0\">\n {{ outline.title }}\n </a>\n <div *ngIf=\"outline.items.length > 0\" class=\"outlineItems\">\n <div *ngFor=\"let
|
|
10046
|
+
template: "<div class=\"outlineItem\">\n <div *ngIf=\"outline.items.length > 0\"\n [ngClass]=\"{ 'outlineItemToggler': true, 'outlineItemsHidden': !showOutlineItems }\"\n (click)=\"toggleOutline()\"\n (keyup.enter)=\"toggleOutline()\" tabindex=\"0\"></div>\n <a (click)=\"goToDestination(outline?.dest)\"\n (keyup.enter)=\"goToDestination(outline?.dest)\"\n [style.font-weight]=\"outline.bold ? 'bold' : ''\"\n [style.font-style]=\"outline.italic ? 'italic' : ''\"\n [ngClass]=\"showHighlightOutlineCss()\"\n tabindex=\"0\">\n <div style=\"text-align:left;\" [ngClass]=\"showHighlightOutlineCss()\">\n {{ outline.title }}\n <span style=\"float:right;\">\n {{ outline.pageNumber }}\n </span>\n </div>\n </a>\n \n <div *ngIf=\"outline.items.length > 0\" class=\"outlineItems\">\n <div *ngFor=\"let outlineItem of outline.items; index as i\">\n <mv-outline-item\n [outline]=\"outlineItem\" \n [currentPageNumber]= \"currentPageNumber\" \n [isCurrentSection]= \"isViewedItem(outlineItem, outline.items[i+1])\"\n [endPage]=\"findEndPage(outline.items[i+1])\"\n (navigationEvent)=\"goToDestination($event)\">\n </mv-outline-item>\n </div>\n </div>\n</div>\n\n"
|
|
9859
10047
|
}] }
|
|
9860
10048
|
];
|
|
9861
10049
|
OutlineItemComponent.propDecorators = {
|
|
9862
10050
|
outline: [{ type: i0.Input }],
|
|
10051
|
+
currentPageNumber: [{ type: i0.Input }],
|
|
10052
|
+
isCurrentSection: [{ type: i0.Input }],
|
|
10053
|
+
endPage: [{ type: i0.Input }],
|
|
9863
10054
|
navigationEvent: [{ type: i0.Output }]
|
|
9864
10055
|
};
|
|
9865
10056
|
return OutlineItemComponent;
|