@hmcts/media-viewer 3.0.4 → 3.1.1
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/assets/sass/toolbar/side-bar.scss +2 -1
- package/esm2020/lib/media-viewer.module.mjs +10 -6
- package/esm2020/lib/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.mjs +217 -55
- package/fesm2015/hmcts-media-viewer.mjs +220 -53
- package/fesm2015/hmcts-media-viewer.mjs.map +1 -1
- package/fesm2020/hmcts-media-viewer.mjs +223 -57
- 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/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.d.ts +36 -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';
|
|
@@ -4458,17 +4461,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4458
4461
|
}] } });
|
|
4459
4462
|
|
|
4460
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
|
+
;
|
|
4461
4475
|
constructor(store) {
|
|
4462
4476
|
this.store = store;
|
|
4463
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;
|
|
4464
4483
|
this.pageLookup = {};
|
|
4465
4484
|
this.BOOKMARK_CHAR_LIMIT = 30;
|
|
4485
|
+
this.dragNodeExpandOverWaitTimeMs = 300;
|
|
4466
4486
|
this.options = {
|
|
4467
4487
|
allowDrag: true,
|
|
4468
4488
|
allowDrop: true
|
|
4469
4489
|
};
|
|
4470
4490
|
this._customSort = 'CUSTOM';
|
|
4471
4491
|
this._positionSort = 'POSITION';
|
|
4492
|
+
this.hasChild = (_, node) => {
|
|
4493
|
+
return node.children && node.children.length > 0;
|
|
4494
|
+
};
|
|
4472
4495
|
}
|
|
4473
4496
|
ngOnInit() {
|
|
4474
4497
|
this.sortMode = this.customSort;
|
|
@@ -4481,11 +4504,6 @@ class BookmarksComponent {
|
|
|
4481
4504
|
});
|
|
4482
4505
|
}));
|
|
4483
4506
|
}
|
|
4484
|
-
ngOnChanges(changes) {
|
|
4485
|
-
if (changes.bookmarkNodes && this.sortMode !== this.customSort) {
|
|
4486
|
-
this.sortBookmarks();
|
|
4487
|
-
}
|
|
4488
|
-
}
|
|
4489
4507
|
ngOnDestroy() {
|
|
4490
4508
|
this.$subscription.unsubscribe();
|
|
4491
4509
|
}
|
|
@@ -4498,33 +4516,18 @@ class BookmarksComponent {
|
|
|
4498
4516
|
this.store.dispatch(new CreateBookmark(Object.assign(Object.assign({}, bookmarkInfo), { name: '', id: uuid$1() })));
|
|
4499
4517
|
});
|
|
4500
4518
|
}
|
|
4501
|
-
|
|
4502
|
-
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 })];
|
|
4503
|
-
let fromNext = this.getSibling(from, from.index);
|
|
4504
|
-
fromNext = fromNext && fromNext.id === node.previous ? this.getSibling(from, from.index + 1) : fromNext;
|
|
4505
|
-
if (fromNext) {
|
|
4506
|
-
movedBookmarks = [...movedBookmarks, Object.assign(Object.assign({}, fromNext), { previous: node.previous })];
|
|
4507
|
-
}
|
|
4508
|
-
const toNext = this.getSibling(to, to.index + 1);
|
|
4509
|
-
if (toNext) {
|
|
4510
|
-
movedBookmarks = [...movedBookmarks, Object.assign(Object.assign({}, toNext), { previous: node.id })];
|
|
4511
|
-
}
|
|
4512
|
-
this.store.dispatch(new MoveBookmark(movedBookmarks));
|
|
4513
|
-
}
|
|
4514
|
-
deleteBookmark(node) {
|
|
4519
|
+
deleteBookmark2(node) {
|
|
4515
4520
|
this.customSortBookmarks();
|
|
4516
4521
|
let next;
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
if (siblings.length > node.index + 1) {
|
|
4523
|
-
next = siblings[node.index + 1].data;
|
|
4524
|
-
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;
|
|
4525
4527
|
}
|
|
4528
|
+
const toDelete = [node.id, ...getBookmarkChildren(node.children)];
|
|
4526
4529
|
this.store.dispatch(new DeleteBookmark({
|
|
4527
|
-
deleted:
|
|
4530
|
+
deleted: toDelete, updated: next
|
|
4528
4531
|
}));
|
|
4529
4532
|
}
|
|
4530
4533
|
updateBookmark(bookmark, name) {
|
|
@@ -4587,33 +4590,197 @@ class BookmarksComponent {
|
|
|
4587
4590
|
}
|
|
4588
4591
|
positionSortBookmarks() {
|
|
4589
4592
|
this.bookmarkNodes.sort((a, b) => a.pageNumber === b.pageNumber ? a.yCoordinate - b.yCoordinate : a.pageNumber - b.pageNumber);
|
|
4590
|
-
this.
|
|
4591
|
-
this.setDragNDrop(false);
|
|
4593
|
+
this.rebuildTreeForData(this.bookmarkNodes);
|
|
4592
4594
|
}
|
|
4593
4595
|
customSortBookmarks() {
|
|
4594
|
-
this.bookmarkNodes.
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
setDragNDrop(enabled) {
|
|
4599
|
-
this.options = {
|
|
4600
|
-
allowDrag: enabled,
|
|
4601
|
-
allowDrop: enabled
|
|
4602
|
-
};
|
|
4603
|
-
}
|
|
4604
|
-
getSibling(node, index) {
|
|
4605
|
-
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);
|
|
4606
4600
|
}
|
|
4607
4601
|
scaledY(yCoordinate, height, page) {
|
|
4608
4602
|
const viewportScale = page.viewportScale / this.zoom;
|
|
4609
4603
|
return ((height / this.zoom) - yCoordinate) / viewportScale;
|
|
4610
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 bookmarkNodesString = JSON.stringify(this._bookmarkNodes);
|
|
4624
|
+
const changedData = JSON.parse(bookmarkNodesString);
|
|
4625
|
+
const visibleNodes = this.visibleNodes(this._bookmarkNodes);
|
|
4626
|
+
const toNode = visibleNodes[event.currentIndex];
|
|
4627
|
+
const toNodeSiblings = this.findNodeSiblings(changedData, toNode.id);
|
|
4628
|
+
const toNodeParent = toNodeSiblings[0].parent;
|
|
4629
|
+
const toIndex = toNodeSiblings.findIndex(s => s.id === toNode.id);
|
|
4630
|
+
const fromNode = event.item.data;
|
|
4631
|
+
const fromNodeSiblings = this.findNodeSiblings(changedData, fromNode.id);
|
|
4632
|
+
const fromIndex = fromNodeSiblings.findIndex(n => n.id === fromNode.id);
|
|
4633
|
+
if (this.isToNodeChildOfFromNode(fromNode === null || fromNode === void 0 ? void 0 : fromNode.children, toNode))
|
|
4634
|
+
return;
|
|
4635
|
+
if (this.dragNodeInsertToParent) {
|
|
4636
|
+
const indexOfParent = toNodeSiblings.findIndex(element => element.id === toNode.id);
|
|
4637
|
+
const parentNode = toNodeSiblings[indexOfParent];
|
|
4638
|
+
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;
|
|
4639
|
+
let movedBookmarksWithParent = [Object.assign(Object.assign({}, fromNode), { parent: parentNode.id, previous: null })];
|
|
4640
|
+
if (firstChild) {
|
|
4641
|
+
movedBookmarksWithParent = [...movedBookmarksWithParent, Object.assign(Object.assign({}, firstChild), { previous: fromNode.id })];
|
|
4642
|
+
}
|
|
4643
|
+
let fromNodeSibling = this.getSiblingFromAllSibliings(fromNodeSiblings, fromIndex + 1);
|
|
4644
|
+
const nextFromindexforParent = fromIndex + 1;
|
|
4645
|
+
fromNodeSibling = fromNodeSibling && fromNodeSibling.id === fromNode.previous ? this.getSiblingFromAllSibliings(fromNodeSiblings, nextFromindexforParent + 1) : fromNodeSibling;
|
|
4646
|
+
if (fromNodeSibling && fromNodeSibling.id !== parentNode.id) {
|
|
4647
|
+
movedBookmarksWithParent = [...movedBookmarksWithParent, Object.assign(Object.assign({}, fromNodeSibling), { previous: fromNode.previous })];
|
|
4648
|
+
}
|
|
4649
|
+
let previousSiblingForParentIndex = toIndex - 1;
|
|
4650
|
+
let parentNodeSibling = this.getSiblingFromAllSibliings(toNodeSiblings, previousSiblingForParentIndex);
|
|
4651
|
+
if (parentNodeSibling && parentNodeSibling.id == fromNode.id) {
|
|
4652
|
+
previousSiblingForParentIndex = previousSiblingForParentIndex - 1;
|
|
4653
|
+
if (previousSiblingForParentIndex >= 0) {
|
|
4654
|
+
parentNodeSibling = this.getSiblingFromAllSibliings(toNodeSiblings, previousSiblingForParentIndex);
|
|
4655
|
+
}
|
|
4656
|
+
else {
|
|
4657
|
+
parentNodeSibling = null;
|
|
4658
|
+
}
|
|
4659
|
+
}
|
|
4660
|
+
movedBookmarksWithParent = [...movedBookmarksWithParent, Object.assign(Object.assign({}, parentNode), { previous: parentNodeSibling === null || parentNodeSibling === void 0 ? void 0 : parentNodeSibling.id })];
|
|
4661
|
+
const hasParentDups = movedBookmarksWithParent.map(x => x.id).some(function (value, index, array) {
|
|
4662
|
+
return array.indexOf(value) !== array.lastIndexOf(value); // comparing first and last indexes of the same value
|
|
4663
|
+
});
|
|
4664
|
+
if (hasParentDups || movedBookmarksWithParent && movedBookmarksWithParent.length <= 1)
|
|
4665
|
+
return;
|
|
4666
|
+
this.store.dispatch(new MoveBookmark(movedBookmarksWithParent));
|
|
4667
|
+
return;
|
|
4668
|
+
}
|
|
4669
|
+
if (!toNodeSiblings)
|
|
4670
|
+
return;
|
|
4671
|
+
const fromNodePrevious = hasMovedUpTheTree ? toNode.previous : toNode.id;
|
|
4672
|
+
let movedBookmarks = [Object.assign(Object.assign({}, fromNode), { previous: toNode.index > 0 ? fromNodePrevious : undefined, parent: toNodeParent })];
|
|
4673
|
+
let fromNodeSibling = this.getSiblingFromAllSibliings(fromNodeSiblings, fromIndex + 1);
|
|
4674
|
+
const nextFromindex = fromIndex + 1;
|
|
4675
|
+
fromNodeSibling = fromNodeSibling && fromNodeSibling.id === fromNode.previous ? this.getSiblingFromAllSibliings(fromNodeSiblings, nextFromindex + 1) : fromNodeSibling;
|
|
4676
|
+
if (fromNodeSibling) {
|
|
4677
|
+
movedBookmarks = [...movedBookmarks, Object.assign(Object.assign({}, fromNodeSibling), { previous: fromNode.previous })];
|
|
4678
|
+
}
|
|
4679
|
+
let toNodeSiblingIndex = hasMovedUpTheTree ? toIndex : toIndex + 1;
|
|
4680
|
+
let toNodeSibling = this.getSiblingFromAllSibliings(toNodeSiblings, toNodeSiblingIndex);
|
|
4681
|
+
if (toNodeSibling) {
|
|
4682
|
+
movedBookmarks = [...movedBookmarks, Object.assign(Object.assign({}, toNodeSibling), { previous: fromNode.id })];
|
|
4683
|
+
}
|
|
4684
|
+
const hasDups = movedBookmarks.map(x => x.id).some(function (value, index, array) {
|
|
4685
|
+
return array.indexOf(value) !== array.lastIndexOf(value); // comparing first and last indexes of the same value
|
|
4686
|
+
});
|
|
4687
|
+
if (hasDups || movedBookmarks && movedBookmarks.length <= 1)
|
|
4688
|
+
return;
|
|
4689
|
+
this.store.dispatch(new MoveBookmark(movedBookmarks));
|
|
4690
|
+
}
|
|
4691
|
+
getSiblingFromAllSibliings(sibling, index) {
|
|
4692
|
+
return sibling.length > index ? sibling[index] : undefined;
|
|
4693
|
+
}
|
|
4694
|
+
dragStart() {
|
|
4695
|
+
this.dragNodeInsertToParent = false;
|
|
4696
|
+
this.hoveredNode = null;
|
|
4697
|
+
this.dragging = true;
|
|
4698
|
+
}
|
|
4699
|
+
dragEnd() {
|
|
4700
|
+
this.dragging = false;
|
|
4701
|
+
}
|
|
4702
|
+
dragHover(event, node) {
|
|
4703
|
+
if (this.dragging) {
|
|
4704
|
+
const newEvent = event;
|
|
4705
|
+
const percentageX = newEvent.offsetX / newEvent.target.clientWidth;
|
|
4706
|
+
if (percentageX > .55) {
|
|
4707
|
+
this.hoveredNode = node;
|
|
4708
|
+
this.dragNodeInsertToParent = true;
|
|
4709
|
+
}
|
|
4710
|
+
else {
|
|
4711
|
+
this.hoveredNode = null;
|
|
4712
|
+
this.dragNodeInsertToParent = false;
|
|
4713
|
+
}
|
|
4714
|
+
clearTimeout(this.expandTimeout);
|
|
4715
|
+
this.expandTimeout = setTimeout(() => {
|
|
4716
|
+
this.treeControl.expand(node);
|
|
4717
|
+
}, this.expandDelay);
|
|
4718
|
+
}
|
|
4719
|
+
}
|
|
4720
|
+
dragHoverEnd(event, node) {
|
|
4721
|
+
var _a;
|
|
4722
|
+
if (this.dragging) {
|
|
4723
|
+
if (!node || ((_a = this.hoveredNode) === null || _a === void 0 ? void 0 : _a.id) !== node.id) {
|
|
4724
|
+
this.dragNodeInsertToParent = false;
|
|
4725
|
+
this.hoveredNode = null;
|
|
4726
|
+
}
|
|
4727
|
+
clearTimeout(this.expandTimeout);
|
|
4728
|
+
}
|
|
4729
|
+
}
|
|
4730
|
+
onNodeExpand(node) {
|
|
4731
|
+
const isExpanded = this.treeControl.isExpanded(node);
|
|
4732
|
+
return isExpanded ? "toggle-children-wrapper-expanded" : "toggle-children-wrapper-collapsed";
|
|
4733
|
+
}
|
|
4734
|
+
visibleNodes(bookmarks) {
|
|
4735
|
+
const result = [];
|
|
4736
|
+
function addExpandedChildren(node, expanded) {
|
|
4737
|
+
result.push(node);
|
|
4738
|
+
if (expanded.some(bookmark => bookmark && bookmark.id === node.id) && node.children) {
|
|
4739
|
+
node.children.map((child) => addExpandedChildren(child, expanded));
|
|
4740
|
+
}
|
|
4741
|
+
}
|
|
4742
|
+
bookmarks.forEach((node) => {
|
|
4743
|
+
addExpandedChildren(node, this.treeControl.expansionModel.selected);
|
|
4744
|
+
});
|
|
4745
|
+
return result;
|
|
4746
|
+
}
|
|
4747
|
+
findNodeSiblings(arr, id) {
|
|
4748
|
+
let result, subResult;
|
|
4749
|
+
arr.forEach((item, i) => {
|
|
4750
|
+
if (item.id === id) {
|
|
4751
|
+
result = arr;
|
|
4752
|
+
}
|
|
4753
|
+
else if (item === null || item === void 0 ? void 0 : item.children) {
|
|
4754
|
+
subResult = this.findNodeSiblings(item.children, id);
|
|
4755
|
+
if (subResult)
|
|
4756
|
+
result = subResult;
|
|
4757
|
+
}
|
|
4758
|
+
});
|
|
4759
|
+
return result;
|
|
4760
|
+
}
|
|
4761
|
+
rebuildTreeForData(data) {
|
|
4762
|
+
this._bookmarkNodes = data !== null && data !== void 0 ? data : [];
|
|
4763
|
+
this.datasource = new ArrayDataSource(this._bookmarkNodes);
|
|
4764
|
+
this.treeControl = new NestedTreeControl(node => node.children);
|
|
4765
|
+
this.treeControl.dataNodes = this._bookmarkNodes;
|
|
4766
|
+
this.expansionModel.selected.forEach((bookmark) => {
|
|
4767
|
+
const node = this.treeControl.dataNodes.find((n) => n.id === bookmark.id);
|
|
4768
|
+
this.treeControl.expand(node);
|
|
4769
|
+
});
|
|
4770
|
+
}
|
|
4771
|
+
isToNodeChildOfFromNode(fromNodeChildren, toNode) {
|
|
4772
|
+
if (!fromNodeChildren) {
|
|
4773
|
+
return false;
|
|
4774
|
+
}
|
|
4775
|
+
const result = this.getNode(fromNodeChildren, toNode.id);
|
|
4776
|
+
return result ? true : false;
|
|
4777
|
+
}
|
|
4611
4778
|
}
|
|
4612
4779
|
/** @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 });
|
|
4613
|
-
/** @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" },
|
|
4780
|
+
/** @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"] }] });
|
|
4614
4781
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BookmarksComponent, decorators: [{
|
|
4615
4782
|
type: Component,
|
|
4616
|
-
args: [{ selector: 'mv-bookmarks', template: "<a *ngIf=\"bookmarkNodes?.length === 0\" class=\"highlightedOutlineItem\">No bookmarks created yet</a>\n<tree-
|
|
4783
|
+
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" }]
|
|
4617
4784
|
}], ctorParameters: function () { return [{ type: i1.Store }]; }, propDecorators: { bookmarkNodes: [{
|
|
4618
4785
|
type: Input
|
|
4619
4786
|
}], zoom: [{
|
|
@@ -4622,9 +4789,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4622
4789
|
type: Input
|
|
4623
4790
|
}], goToDestination: [{
|
|
4624
4791
|
type: Output
|
|
4625
|
-
}], tree: [{
|
|
4626
|
-
type: ViewChild,
|
|
4627
|
-
args: [TreeComponent]
|
|
4628
4792
|
}] } });
|
|
4629
4793
|
|
|
4630
4794
|
class OutlineItemComponent {
|
|
@@ -6685,8 +6849,9 @@ class MediaViewerModule {
|
|
|
6685
6849
|
TagInputModule,
|
|
6686
6850
|
FormsModule,
|
|
6687
6851
|
ReactiveFormsModule,
|
|
6688
|
-
RouterModule, i1.StoreFeatureModule, i1$2.EffectsFeatureModule,
|
|
6689
|
-
|
|
6852
|
+
RouterModule, i1.StoreFeatureModule, i1$2.EffectsFeatureModule, MutableDivModule,
|
|
6853
|
+
CdkTreeModule,
|
|
6854
|
+
DragDropModule, i5.RpxTranslationModule], exports: [MediaViewerComponent] });
|
|
6690
6855
|
/** @nocollapse */ MediaViewerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MediaViewerModule, providers: [
|
|
6691
6856
|
PdfJsWrapperFactory,
|
|
6692
6857
|
CommentService,
|
|
@@ -6710,8 +6875,9 @@ class MediaViewerModule {
|
|
|
6710
6875
|
RouterModule,
|
|
6711
6876
|
StoreModule.forFeature('media-viewer', reducers),
|
|
6712
6877
|
EffectsModule.forFeature(effects),
|
|
6713
|
-
TreeModule,
|
|
6714
6878
|
MutableDivModule,
|
|
6879
|
+
CdkTreeModule,
|
|
6880
|
+
DragDropModule,
|
|
6715
6881
|
RpxTranslationModule.forChild()] });
|
|
6716
6882
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MediaViewerModule, decorators: [{
|
|
6717
6883
|
type: NgModule,
|
|
@@ -6727,8 +6893,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
6727
6893
|
RouterModule,
|
|
6728
6894
|
StoreModule.forFeature('media-viewer', reducers),
|
|
6729
6895
|
EffectsModule.forFeature(effects),
|
|
6730
|
-
TreeModule,
|
|
6731
6896
|
MutableDivModule,
|
|
6897
|
+
CdkTreeModule,
|
|
6898
|
+
DragDropModule,
|
|
6732
6899
|
RpxTranslationModule.forChild()
|
|
6733
6900
|
],
|
|
6734
6901
|
declarations: [
|