@hmcts/media-viewer 3.0.3 → 3.1.0
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/angular-tree-component.scss +87 -24
- package/assets/sass/bookmarks.scss +30 -13
- package/esm2020/lib/media-viewer.module.mjs +10 -6
- package/esm2020/lib/print.service.mjs +1 -5
- package/esm2020/lib/viewers/pdf-viewer/pdf-js/pdf-js-wrapper.mjs +3 -3
- package/esm2020/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.mjs +195 -55
- package/fesm2015/hmcts-media-viewer.mjs +200 -59
- package/fesm2015/hmcts-media-viewer.mjs.map +1 -1
- package/fesm2020/hmcts-media-viewer.mjs +203 -63
- package/fesm2020/hmcts-media-viewer.mjs.map +1 -1
- package/lib/media-viewer.module.d.ts +5 -4
- package/lib/media-viewer.module.d.ts.map +1 -1
- package/lib/print.service.d.ts.map +1 -1
- package/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.d.ts +35 -11
- package/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.d.ts.map +1 -1
- package/package.json +2 -3
|
@@ -28,8 +28,11 @@ import * as i6 from '@angular/cdk/overlay';
|
|
|
28
28
|
import { ConnectionPositionPair, OverlayModule } from '@angular/cdk/overlay';
|
|
29
29
|
import * as i4$2 from 'mutable-div';
|
|
30
30
|
import { MutableDivModule } from 'mutable-div';
|
|
31
|
-
import
|
|
32
|
-
import
|
|
31
|
+
import { SelectionModel, ArrayDataSource } from '@angular/cdk/collections';
|
|
32
|
+
import * as i3 from '@angular/cdk/tree';
|
|
33
|
+
import { NestedTreeControl, CdkTreeModule } from '@angular/cdk/tree';
|
|
34
|
+
import * as i4$3 from '@angular/cdk/drag-drop';
|
|
35
|
+
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
33
36
|
import 'hammerjs';
|
|
34
37
|
import * as i5$2 from '@angular/cdk/a11y';
|
|
35
38
|
import { A11yModule } from '@angular/cdk/a11y';
|
|
@@ -1305,7 +1308,7 @@ class PdfJsWrapper {
|
|
|
1305
1308
|
this.pdfViewer.setDocument(pdfDocument);
|
|
1306
1309
|
this.pdfViewer.linkService.setDocument(pdfDocument, null);
|
|
1307
1310
|
const outlineNode = yield pdfDocument.getOutline();
|
|
1308
|
-
const outline = outlineNode.map(x => {
|
|
1311
|
+
const outline = outlineNode ? outlineNode.map(x => {
|
|
1309
1312
|
return {
|
|
1310
1313
|
bold: x.bold,
|
|
1311
1314
|
color: x.color,
|
|
@@ -1318,7 +1321,7 @@ class PdfJsWrapper {
|
|
|
1318
1321
|
unsafeUrl: x.unsafeUrl,
|
|
1319
1322
|
url: x.url
|
|
1320
1323
|
};
|
|
1321
|
-
});
|
|
1324
|
+
}) : null;
|
|
1322
1325
|
if (outline) {
|
|
1323
1326
|
yield this.setOutlinePageNumbers(pdfDocument, outline);
|
|
1324
1327
|
}
|
|
@@ -1702,10 +1705,6 @@ class PrintService {
|
|
|
1702
1705
|
printWindow.focus();
|
|
1703
1706
|
setTimeout((printer) => {
|
|
1704
1707
|
printer.print();
|
|
1705
|
-
printer.onafterprint = () => {
|
|
1706
|
-
printer.close();
|
|
1707
|
-
window.close();
|
|
1708
|
-
};
|
|
1709
1708
|
}, 3000, printWindow);
|
|
1710
1709
|
}
|
|
1711
1710
|
printElementNatively(element, width, height) {
|
|
@@ -4462,17 +4461,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4462
4461
|
}] } });
|
|
4463
4462
|
|
|
4464
4463
|
class BookmarksComponent {
|
|
4464
|
+
set bookmarkNodes(value) {
|
|
4465
|
+
this.rebuildTreeForData(value);
|
|
4466
|
+
if (this._bookmarkNodes && this.sortMode !== this.customSort) {
|
|
4467
|
+
this.sortBookmarks();
|
|
4468
|
+
}
|
|
4469
|
+
}
|
|
4470
|
+
;
|
|
4471
|
+
get bookmarkNodes() {
|
|
4472
|
+
return this._bookmarkNodes;
|
|
4473
|
+
}
|
|
4474
|
+
;
|
|
4465
4475
|
constructor(store) {
|
|
4466
4476
|
this.store = store;
|
|
4467
4477
|
this.goToDestination = new EventEmitter();
|
|
4478
|
+
this._bookmarkNodes = [];
|
|
4479
|
+
// expansion model tracks expansion state
|
|
4480
|
+
this.expansionModel = new SelectionModel(true);
|
|
4481
|
+
this.dragging = false;
|
|
4482
|
+
this.expandDelay = 1000;
|
|
4468
4483
|
this.pageLookup = {};
|
|
4469
4484
|
this.BOOKMARK_CHAR_LIMIT = 30;
|
|
4485
|
+
this.dragNodeExpandOverWaitTimeMs = 300;
|
|
4470
4486
|
this.options = {
|
|
4471
4487
|
allowDrag: true,
|
|
4472
4488
|
allowDrop: true
|
|
4473
4489
|
};
|
|
4474
4490
|
this._customSort = 'CUSTOM';
|
|
4475
4491
|
this._positionSort = 'POSITION';
|
|
4492
|
+
this.hasChild = (_, node) => {
|
|
4493
|
+
return node.children && node.children.length > 0;
|
|
4494
|
+
};
|
|
4476
4495
|
}
|
|
4477
4496
|
ngOnInit() {
|
|
4478
4497
|
this.sortMode = this.customSort;
|
|
@@ -4485,11 +4504,6 @@ class BookmarksComponent {
|
|
|
4485
4504
|
});
|
|
4486
4505
|
}));
|
|
4487
4506
|
}
|
|
4488
|
-
ngOnChanges(changes) {
|
|
4489
|
-
if (changes.bookmarkNodes && this.sortMode !== this.customSort) {
|
|
4490
|
-
this.sortBookmarks();
|
|
4491
|
-
}
|
|
4492
|
-
}
|
|
4493
4507
|
ngOnDestroy() {
|
|
4494
4508
|
this.$subscription.unsubscribe();
|
|
4495
4509
|
}
|
|
@@ -4502,33 +4516,18 @@ class BookmarksComponent {
|
|
|
4502
4516
|
this.store.dispatch(new CreateBookmark(Object.assign(Object.assign({}, bookmarkInfo), { name: '', id: uuid$1() })));
|
|
4503
4517
|
});
|
|
4504
4518
|
}
|
|
4505
|
-
|
|
4506
|
-
let movedBookmarks = [Object.assign(Object.assign({}, node), { previous: to.index > 0 ? to.parent.children[to.index - 1].id : undefined, parent: to.parent.documentId ? to.parent.id : undefined })];
|
|
4507
|
-
let fromNext = this.getSibling(from, from.index);
|
|
4508
|
-
fromNext = fromNext && fromNext.id === node.previous ? this.getSibling(from, from.index + 1) : fromNext;
|
|
4509
|
-
if (fromNext) {
|
|
4510
|
-
movedBookmarks = [...movedBookmarks, Object.assign(Object.assign({}, fromNext), { previous: node.previous })];
|
|
4511
|
-
}
|
|
4512
|
-
const toNext = this.getSibling(to, to.index + 1);
|
|
4513
|
-
if (toNext) {
|
|
4514
|
-
movedBookmarks = [...movedBookmarks, Object.assign(Object.assign({}, toNext), { previous: node.id })];
|
|
4515
|
-
}
|
|
4516
|
-
this.store.dispatch(new MoveBookmark(movedBookmarks));
|
|
4517
|
-
}
|
|
4518
|
-
deleteBookmark(node) {
|
|
4519
|
+
deleteBookmark2(node) {
|
|
4519
4520
|
this.customSortBookmarks();
|
|
4520
4521
|
let next;
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
if (siblings.length > node.index + 1) {
|
|
4527
|
-
next = siblings[node.index + 1].data;
|
|
4528
|
-
next.previous = node.data.previous;
|
|
4522
|
+
const changedData = JSON.parse(JSON.stringify(this.bookmarkNodes));
|
|
4523
|
+
const siblings = this.findNodeSiblings(changedData, node.id);
|
|
4524
|
+
if (siblings && siblings.length > node.index + 1) {
|
|
4525
|
+
next = siblings[node.index + 1];
|
|
4526
|
+
next.previous = node.previous;
|
|
4529
4527
|
}
|
|
4528
|
+
const toDelete = [node.id, ...getBookmarkChildren(node.children)];
|
|
4530
4529
|
this.store.dispatch(new DeleteBookmark({
|
|
4531
|
-
deleted:
|
|
4530
|
+
deleted: toDelete, updated: next
|
|
4532
4531
|
}));
|
|
4533
4532
|
}
|
|
4534
4533
|
updateBookmark(bookmark, name) {
|
|
@@ -4591,33 +4590,175 @@ class BookmarksComponent {
|
|
|
4591
4590
|
}
|
|
4592
4591
|
positionSortBookmarks() {
|
|
4593
4592
|
this.bookmarkNodes.sort((a, b) => a.pageNumber === b.pageNumber ? a.yCoordinate - b.yCoordinate : a.pageNumber - b.pageNumber);
|
|
4594
|
-
this.
|
|
4595
|
-
this.setDragNDrop(false);
|
|
4593
|
+
this.rebuildTreeForData(this.bookmarkNodes);
|
|
4596
4594
|
}
|
|
4597
4595
|
customSortBookmarks() {
|
|
4598
|
-
this.bookmarkNodes.
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
setDragNDrop(enabled) {
|
|
4603
|
-
this.options = {
|
|
4604
|
-
allowDrag: enabled,
|
|
4605
|
-
allowDrop: enabled
|
|
4606
|
-
};
|
|
4607
|
-
}
|
|
4608
|
-
getSibling(node, index) {
|
|
4609
|
-
return node.parent.children.length > index ? node.parent.children[index] : undefined;
|
|
4596
|
+
if (this.bookmarkNodes.length > 1) {
|
|
4597
|
+
this.bookmarkNodes.sort((a, b) => a.index - b.index);
|
|
4598
|
+
}
|
|
4599
|
+
this.rebuildTreeForData(this.bookmarkNodes);
|
|
4610
4600
|
}
|
|
4611
4601
|
scaledY(yCoordinate, height, page) {
|
|
4612
4602
|
const viewportScale = page.viewportScale / this.zoom;
|
|
4613
4603
|
return ((height / this.zoom) - yCoordinate) / viewportScale;
|
|
4614
4604
|
}
|
|
4605
|
+
getNode(bookmarks, parentId) {
|
|
4606
|
+
if (typeof bookmarks !== 'undefined') {
|
|
4607
|
+
for (let i = 0; i < bookmarks.length; i++) {
|
|
4608
|
+
if (bookmarks[i].id === parentId) {
|
|
4609
|
+
return [bookmarks[i]];
|
|
4610
|
+
}
|
|
4611
|
+
const a = this.getNode(bookmarks[i].children, parentId);
|
|
4612
|
+
if (a !== null) {
|
|
4613
|
+
return a;
|
|
4614
|
+
}
|
|
4615
|
+
}
|
|
4616
|
+
}
|
|
4617
|
+
return null;
|
|
4618
|
+
}
|
|
4619
|
+
drop(event) {
|
|
4620
|
+
if (!event.isPointerOverContainer || (event.previousIndex === event.currentIndex))
|
|
4621
|
+
return;
|
|
4622
|
+
const hasMovedUpTheTree = event.previousIndex > event.currentIndex;
|
|
4623
|
+
const changedData = JSON.parse(JSON.stringify(this.bookmarkNodes));
|
|
4624
|
+
const visibleNodes = this.visibleNodes(this._bookmarkNodes);
|
|
4625
|
+
const toNode = visibleNodes[event.currentIndex];
|
|
4626
|
+
const toNodeSiblings = this.findNodeSiblings(changedData, toNode.id);
|
|
4627
|
+
const toNodeParent = toNodeSiblings[0].parent;
|
|
4628
|
+
const toIndex = toNodeSiblings.findIndex(s => s.id === toNode.id);
|
|
4629
|
+
const fromNode = event.item.data;
|
|
4630
|
+
const fromNodeSiblings = this.findNodeSiblings(changedData, fromNode.id);
|
|
4631
|
+
const fromIndex = fromNodeSiblings.findIndex(n => n.id === fromNode.id);
|
|
4632
|
+
if (this.dragNodeInsertToParent) {
|
|
4633
|
+
const indexOfParent = toNodeSiblings.findIndex(element => element.id === toNode.id);
|
|
4634
|
+
const parentNode = toNodeSiblings[indexOfParent];
|
|
4635
|
+
const firstChild = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.children) && (parentNode === null || parentNode === void 0 ? void 0 : parentNode.children.length) > 0 ? parentNode.children[0] : null;
|
|
4636
|
+
let movedBookmarksWithParent = [Object.assign(Object.assign({}, fromNode), { parent: parentNode.id, previous: null })];
|
|
4637
|
+
if (firstChild) {
|
|
4638
|
+
movedBookmarksWithParent = [...movedBookmarksWithParent, Object.assign(Object.assign({}, firstChild), { previous: fromNode.id })];
|
|
4639
|
+
}
|
|
4640
|
+
let previousSiblingForParentIndex = toIndex - 1;
|
|
4641
|
+
let parentNodeSibling = this.getSiblingFromAllSibliings(fromNodeSiblings, previousSiblingForParentIndex);
|
|
4642
|
+
if (parentNodeSibling.id == fromNode.id) {
|
|
4643
|
+
previousSiblingForParentIndex = previousSiblingForParentIndex - 1;
|
|
4644
|
+
if (previousSiblingForParentIndex > 0) {
|
|
4645
|
+
parentNodeSibling = this.getSiblingFromAllSibliings(fromNodeSiblings, previousSiblingForParentIndex);
|
|
4646
|
+
}
|
|
4647
|
+
else {
|
|
4648
|
+
parentNodeSibling = null;
|
|
4649
|
+
}
|
|
4650
|
+
}
|
|
4651
|
+
movedBookmarksWithParent = [...movedBookmarksWithParent, Object.assign(Object.assign({}, parentNode), { previous: parentNodeSibling === null || parentNodeSibling === void 0 ? void 0 : parentNodeSibling.id })];
|
|
4652
|
+
this.store.dispatch(new MoveBookmark(movedBookmarksWithParent));
|
|
4653
|
+
return;
|
|
4654
|
+
}
|
|
4655
|
+
if (!toNodeSiblings)
|
|
4656
|
+
return;
|
|
4657
|
+
const fromNodePrevious = hasMovedUpTheTree ? toNode.previous : toNode.id;
|
|
4658
|
+
let movedBookmarks = [Object.assign(Object.assign({}, fromNode), { previous: toNode.index > 0 ? fromNodePrevious : undefined, parent: toNodeParent })];
|
|
4659
|
+
let fromNodeSibling = this.getSiblingFromAllSibliings(fromNodeSiblings, fromIndex + 1);
|
|
4660
|
+
fromNodeSibling = fromNodeSibling && fromNodeSibling.id === fromNode.previous ? this.getSiblingFromAllSibliings(fromNodeSiblings, fromIndex + 1) : fromNodeSibling;
|
|
4661
|
+
if (fromNodeSibling) {
|
|
4662
|
+
movedBookmarks = [...movedBookmarks, Object.assign(Object.assign({}, fromNodeSibling), { previous: fromNode.previous })];
|
|
4663
|
+
}
|
|
4664
|
+
let toNodeSiblingIndex = hasMovedUpTheTree ? toIndex : toIndex + 1;
|
|
4665
|
+
let toNodeSibling = this.getSiblingFromAllSibliings(toNodeSiblings, toNodeSiblingIndex);
|
|
4666
|
+
if (toNodeSibling) {
|
|
4667
|
+
movedBookmarks = [...movedBookmarks, Object.assign(Object.assign({}, toNodeSibling), { previous: fromNode.id })];
|
|
4668
|
+
}
|
|
4669
|
+
const hasDups = movedBookmarks.map(x => x.id).some(function (value, index, array) {
|
|
4670
|
+
return array.indexOf(value) !== array.lastIndexOf(value); // comparing first and last indexes of the same value
|
|
4671
|
+
});
|
|
4672
|
+
if (hasDups || movedBookmarks && movedBookmarks.length <= 1)
|
|
4673
|
+
return;
|
|
4674
|
+
this.store.dispatch(new MoveBookmark(movedBookmarks));
|
|
4675
|
+
}
|
|
4676
|
+
getSiblingFromAllSibliings(sibling, index) {
|
|
4677
|
+
return sibling.length > index ? sibling[index] : undefined;
|
|
4678
|
+
}
|
|
4679
|
+
dragStart() {
|
|
4680
|
+
this.dragNodeInsertToParent = false;
|
|
4681
|
+
this.hoveredNode = null;
|
|
4682
|
+
this.dragging = true;
|
|
4683
|
+
}
|
|
4684
|
+
dragEnd() {
|
|
4685
|
+
this.dragging = false;
|
|
4686
|
+
}
|
|
4687
|
+
dragHover(event, node) {
|
|
4688
|
+
if (this.dragging) {
|
|
4689
|
+
const newEvent = event;
|
|
4690
|
+
const percentageX = newEvent.offsetX / newEvent.target.clientWidth;
|
|
4691
|
+
if (percentageX > .55) {
|
|
4692
|
+
this.hoveredNode = node;
|
|
4693
|
+
this.dragNodeInsertToParent = true;
|
|
4694
|
+
}
|
|
4695
|
+
else {
|
|
4696
|
+
this.hoveredNode = null;
|
|
4697
|
+
this.dragNodeInsertToParent = false;
|
|
4698
|
+
}
|
|
4699
|
+
clearTimeout(this.expandTimeout);
|
|
4700
|
+
this.expandTimeout = setTimeout(() => {
|
|
4701
|
+
this.treeControl.expand(node);
|
|
4702
|
+
}, this.expandDelay);
|
|
4703
|
+
}
|
|
4704
|
+
}
|
|
4705
|
+
dragHoverEnd(event, node) {
|
|
4706
|
+
var _a;
|
|
4707
|
+
if (this.dragging) {
|
|
4708
|
+
if (!node || ((_a = this.hoveredNode) === null || _a === void 0 ? void 0 : _a.id) !== node.id) {
|
|
4709
|
+
this.dragNodeInsertToParent = false;
|
|
4710
|
+
this.hoveredNode = null;
|
|
4711
|
+
}
|
|
4712
|
+
clearTimeout(this.expandTimeout);
|
|
4713
|
+
}
|
|
4714
|
+
}
|
|
4715
|
+
onNodeExpand(node) {
|
|
4716
|
+
const isExpanded = this.treeControl.isExpanded(node);
|
|
4717
|
+
return isExpanded ? "toggle-children-wrapper-expanded" : "toggle-children-wrapper-collapsed";
|
|
4718
|
+
}
|
|
4719
|
+
visibleNodes(bookmarks) {
|
|
4720
|
+
const result = [];
|
|
4721
|
+
function addExpandedChildren(node, expanded) {
|
|
4722
|
+
result.push(node);
|
|
4723
|
+
if (expanded.some(bookmark => bookmark && bookmark.id === node.id) && node.children) {
|
|
4724
|
+
node.children.map((child) => addExpandedChildren(child, expanded));
|
|
4725
|
+
}
|
|
4726
|
+
}
|
|
4727
|
+
bookmarks.forEach((node) => {
|
|
4728
|
+
addExpandedChildren(node, this.treeControl.expansionModel.selected);
|
|
4729
|
+
});
|
|
4730
|
+
return result;
|
|
4731
|
+
}
|
|
4732
|
+
findNodeSiblings(arr, id) {
|
|
4733
|
+
let result, subResult;
|
|
4734
|
+
arr.forEach((item, i) => {
|
|
4735
|
+
if (item.id === id) {
|
|
4736
|
+
result = arr;
|
|
4737
|
+
}
|
|
4738
|
+
else if (item.children) {
|
|
4739
|
+
subResult = this.findNodeSiblings(item.children, id);
|
|
4740
|
+
if (subResult)
|
|
4741
|
+
result = subResult;
|
|
4742
|
+
}
|
|
4743
|
+
});
|
|
4744
|
+
return result;
|
|
4745
|
+
}
|
|
4746
|
+
rebuildTreeForData(data) {
|
|
4747
|
+
this._bookmarkNodes = data !== null && data !== void 0 ? data : [];
|
|
4748
|
+
this.datasource = new ArrayDataSource(this._bookmarkNodes);
|
|
4749
|
+
this.treeControl = new NestedTreeControl(node => node.children);
|
|
4750
|
+
this.treeControl.dataNodes = this._bookmarkNodes;
|
|
4751
|
+
this.expansionModel.selected.forEach((bookmark) => {
|
|
4752
|
+
const node = this.treeControl.dataNodes.find((n) => n.id === bookmark.id);
|
|
4753
|
+
this.treeControl.expand(node);
|
|
4754
|
+
});
|
|
4755
|
+
}
|
|
4615
4756
|
}
|
|
4616
4757
|
/** @nocollapse */ BookmarksComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BookmarksComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component });
|
|
4617
|
-
/** @nocollapse */ BookmarksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: BookmarksComponent, selector: "mv-bookmarks", inputs: { bookmarkNodes: "bookmarkNodes", zoom: "zoom", rotate: "rotate" }, outputs: { goToDestination: "goToDestination" },
|
|
4758
|
+
/** @nocollapse */ BookmarksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: BookmarksComponent, selector: "mv-bookmarks", inputs: { bookmarkNodes: "bookmarkNodes", zoom: "zoom", rotate: "rotate" }, outputs: { goToDestination: "goToDestination" }, ngImport: i0, template: "<a *ngIf=\"bookmarkNodes?.length === 0\" class=\"highlightedOutlineItem\"\n >No bookmarks created yet</a\n>\n<cdk-tree\n cdkDropList\n class=\"bookmarks-tree\"\n *ngIf=\"datasource\"\n [dataSource]=\"datasource\"\n [treeControl]=\"treeControl\"\n (cdkDropListDropped)=\"drop($event)\"\n>\n <!-- This is the tree node template for leaf nodes -->\n <cdk-nested-tree-node class=\"node-wrapper\" *cdkTreeNodeDef=\"let node\">\n <div *ngIf=\"node.id !== editableBookmark; else inputBookmark\">\n <div\n class=\"node-content-wrapper nested-tree-node\"\n cdkDrag\n [cdkDragData]=\"node\"\n (mouseenter)=\"dragHover($event, node)\"\n (mouseleave)=\"dragHoverEnd($event, node)\"\n (cdkDragStarted)=\"dragStart()\"\n (cdkDragReleased)=\"dragEnd()\"\n >\n <div class=\"outlineItem\">\n <a (click)=\"goToBookmark(node)\">\n {{ node.name }}\n </a>\n </div>\n <button\n class=\"bookmark__rename\"\n (click)=\"editBookmark(node.id)\"\n ></button>\n <button\n class=\"bookmark__delete\"\n (click)=\"deleteBookmark2(node)\"\n ></button>\n </div>\n <div class=\"node-drop-slot\"></div>\n </div>\n <ng-template #inputBookmark>\n <input\n #bookmarkName\n class=\"bookmark__input\"\n [value]=\"node.name\"\n [maxLength]=\"BOOKMARK_CHAR_LIMIT\"\n />\n <button\n class=\"bookmark__save\"\n (click)=\"updateBookmark(node, bookmarkName.value)\"\n ></button>\n </ng-template>\n </cdk-nested-tree-node>\n <!-- This is the tree node template for expandable nodes -->\n <cdk-nested-tree-node\n class=\"node-wrapper\"\n *cdkTreeNodeDef=\"let node; when: hasChild\"\n >\n <div *ngIf=\"node.id !== editableBookmark; else inputBookmark2\">\n <div\n class=\"node-content-wrapper nested-tree-node\"\n cdkDrag\n [cdkDragData]=\"node\"\n (mouseenter)=\"dragHover($event, node)\"\n (mouseleave)=\"dragHoverEnd($event, node)\"\n (cdkDragStarted)=\"dragStart()\"\n (cdkDragReleased)=\"dragEnd()\"\n >\n <div class=\"outlineItem\">\n <span\n cdkTreeNodeToggle\n class=\"toggle-children-wrapper\"\n [ngClass]=\"onNodeExpand(node)\"\n ><span class=\"toggle-children\"></span\n ></span>\n <a (click)=\"goToBookmark(node)\">\n {{ node.name }}\n </a>\n </div>\n <button\n class=\"bookmark__rename\"\n (click)=\"editBookmark(node.id)\"\n ></button>\n <button\n class=\"bookmark__delete\"\n (click)=\"deleteBookmark2(node)\"\n ></button>\n </div>\n <div class=\"node-drop-slot\"></div>\n </div>\n <ng-template #inputBookmark2>\n <input\n #bookmarkName\n class=\"bookmark__input\"\n [value]=\"node.name\"\n [maxLength]=\"BOOKMARK_CHAR_LIMIT\"\n />\n <button\n class=\"bookmark__save\"\n (click)=\"updateBookmark(node, bookmarkName.value)\"\n ></button>\n </ng-template>\n <div class=\"nested-tree-node-children\" *ngIf=\"treeControl.isExpanded(node)\">\n <ng-container cdkTreeNodeOutlet></ng-container>\n </div>\n </cdk-nested-tree-node>\n</cdk-tree>\n", dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.CdkNestedTreeNode, selector: "cdk-nested-tree-node", inputs: ["role", "disabled", "tabIndex"], exportAs: ["cdkNestedTreeNode"] }, { kind: "directive", type: i3.CdkTreeNodeDef, selector: "[cdkTreeNodeDef]", inputs: ["cdkTreeNodeDefWhen"] }, { kind: "directive", type: i3.CdkTreeNodeToggle, selector: "[cdkTreeNodeToggle]", inputs: ["cdkTreeNodeToggleRecursive"] }, { kind: "component", type: i3.CdkTree, selector: "cdk-tree", inputs: ["dataSource", "treeControl", "trackBy"], exportAs: ["cdkTree"] }, { kind: "directive", type: i3.CdkTreeNodeOutlet, selector: "[cdkTreeNodeOutlet]" }, { kind: "directive", type: i4$3.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i4$3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }] });
|
|
4618
4759
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BookmarksComponent, decorators: [{
|
|
4619
4760
|
type: Component,
|
|
4620
|
-
args: [{ selector: 'mv-bookmarks', template: "<a *ngIf=\"bookmarkNodes?.length === 0\" class=\"highlightedOutlineItem\">No bookmarks created yet</a>\n<tree-
|
|
4761
|
+
args: [{ selector: 'mv-bookmarks', template: "<a *ngIf=\"bookmarkNodes?.length === 0\" class=\"highlightedOutlineItem\"\n >No bookmarks created yet</a\n>\n<cdk-tree\n cdkDropList\n class=\"bookmarks-tree\"\n *ngIf=\"datasource\"\n [dataSource]=\"datasource\"\n [treeControl]=\"treeControl\"\n (cdkDropListDropped)=\"drop($event)\"\n>\n <!-- This is the tree node template for leaf nodes -->\n <cdk-nested-tree-node class=\"node-wrapper\" *cdkTreeNodeDef=\"let node\">\n <div *ngIf=\"node.id !== editableBookmark; else inputBookmark\">\n <div\n class=\"node-content-wrapper nested-tree-node\"\n cdkDrag\n [cdkDragData]=\"node\"\n (mouseenter)=\"dragHover($event, node)\"\n (mouseleave)=\"dragHoverEnd($event, node)\"\n (cdkDragStarted)=\"dragStart()\"\n (cdkDragReleased)=\"dragEnd()\"\n >\n <div class=\"outlineItem\">\n <a (click)=\"goToBookmark(node)\">\n {{ node.name }}\n </a>\n </div>\n <button\n class=\"bookmark__rename\"\n (click)=\"editBookmark(node.id)\"\n ></button>\n <button\n class=\"bookmark__delete\"\n (click)=\"deleteBookmark2(node)\"\n ></button>\n </div>\n <div class=\"node-drop-slot\"></div>\n </div>\n <ng-template #inputBookmark>\n <input\n #bookmarkName\n class=\"bookmark__input\"\n [value]=\"node.name\"\n [maxLength]=\"BOOKMARK_CHAR_LIMIT\"\n />\n <button\n class=\"bookmark__save\"\n (click)=\"updateBookmark(node, bookmarkName.value)\"\n ></button>\n </ng-template>\n </cdk-nested-tree-node>\n <!-- This is the tree node template for expandable nodes -->\n <cdk-nested-tree-node\n class=\"node-wrapper\"\n *cdkTreeNodeDef=\"let node; when: hasChild\"\n >\n <div *ngIf=\"node.id !== editableBookmark; else inputBookmark2\">\n <div\n class=\"node-content-wrapper nested-tree-node\"\n cdkDrag\n [cdkDragData]=\"node\"\n (mouseenter)=\"dragHover($event, node)\"\n (mouseleave)=\"dragHoverEnd($event, node)\"\n (cdkDragStarted)=\"dragStart()\"\n (cdkDragReleased)=\"dragEnd()\"\n >\n <div class=\"outlineItem\">\n <span\n cdkTreeNodeToggle\n class=\"toggle-children-wrapper\"\n [ngClass]=\"onNodeExpand(node)\"\n ><span class=\"toggle-children\"></span\n ></span>\n <a (click)=\"goToBookmark(node)\">\n {{ node.name }}\n </a>\n </div>\n <button\n class=\"bookmark__rename\"\n (click)=\"editBookmark(node.id)\"\n ></button>\n <button\n class=\"bookmark__delete\"\n (click)=\"deleteBookmark2(node)\"\n ></button>\n </div>\n <div class=\"node-drop-slot\"></div>\n </div>\n <ng-template #inputBookmark2>\n <input\n #bookmarkName\n class=\"bookmark__input\"\n [value]=\"node.name\"\n [maxLength]=\"BOOKMARK_CHAR_LIMIT\"\n />\n <button\n class=\"bookmark__save\"\n (click)=\"updateBookmark(node, bookmarkName.value)\"\n ></button>\n </ng-template>\n <div class=\"nested-tree-node-children\" *ngIf=\"treeControl.isExpanded(node)\">\n <ng-container cdkTreeNodeOutlet></ng-container>\n </div>\n </cdk-nested-tree-node>\n</cdk-tree>\n" }]
|
|
4621
4762
|
}], ctorParameters: function () { return [{ type: i1.Store }]; }, propDecorators: { bookmarkNodes: [{
|
|
4622
4763
|
type: Input
|
|
4623
4764
|
}], zoom: [{
|
|
@@ -4626,9 +4767,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4626
4767
|
type: Input
|
|
4627
4768
|
}], goToDestination: [{
|
|
4628
4769
|
type: Output
|
|
4629
|
-
}], tree: [{
|
|
4630
|
-
type: ViewChild,
|
|
4631
|
-
args: [TreeComponent]
|
|
4632
4770
|
}] } });
|
|
4633
4771
|
|
|
4634
4772
|
class OutlineItemComponent {
|
|
@@ -6689,8 +6827,9 @@ class MediaViewerModule {
|
|
|
6689
6827
|
TagInputModule,
|
|
6690
6828
|
FormsModule,
|
|
6691
6829
|
ReactiveFormsModule,
|
|
6692
|
-
RouterModule, i1.StoreFeatureModule, i1$2.EffectsFeatureModule,
|
|
6693
|
-
|
|
6830
|
+
RouterModule, i1.StoreFeatureModule, i1$2.EffectsFeatureModule, MutableDivModule,
|
|
6831
|
+
CdkTreeModule,
|
|
6832
|
+
DragDropModule, i5.RpxTranslationModule], exports: [MediaViewerComponent] });
|
|
6694
6833
|
/** @nocollapse */ MediaViewerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MediaViewerModule, providers: [
|
|
6695
6834
|
PdfJsWrapperFactory,
|
|
6696
6835
|
CommentService,
|
|
@@ -6714,8 +6853,9 @@ class MediaViewerModule {
|
|
|
6714
6853
|
RouterModule,
|
|
6715
6854
|
StoreModule.forFeature('media-viewer', reducers),
|
|
6716
6855
|
EffectsModule.forFeature(effects),
|
|
6717
|
-
TreeModule,
|
|
6718
6856
|
MutableDivModule,
|
|
6857
|
+
CdkTreeModule,
|
|
6858
|
+
DragDropModule,
|
|
6719
6859
|
RpxTranslationModule.forChild()] });
|
|
6720
6860
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MediaViewerModule, decorators: [{
|
|
6721
6861
|
type: NgModule,
|
|
@@ -6731,8 +6871,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
6731
6871
|
RouterModule,
|
|
6732
6872
|
StoreModule.forFeature('media-viewer', reducers),
|
|
6733
6873
|
EffectsModule.forFeature(effects),
|
|
6734
|
-
TreeModule,
|
|
6735
6874
|
MutableDivModule,
|
|
6875
|
+
CdkTreeModule,
|
|
6876
|
+
DragDropModule,
|
|
6736
6877
|
RpxTranslationModule.forChild()
|
|
6737
6878
|
],
|
|
6738
6879
|
declarations: [
|