@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
|
@@ -27,8 +27,11 @@ import * as i6 from '@angular/cdk/overlay';
|
|
|
27
27
|
import { ConnectionPositionPair, OverlayModule } from '@angular/cdk/overlay';
|
|
28
28
|
import * as i4$2 from 'mutable-div';
|
|
29
29
|
import { MutableDivModule } from 'mutable-div';
|
|
30
|
-
import
|
|
31
|
-
import
|
|
30
|
+
import { SelectionModel, ArrayDataSource } from '@angular/cdk/collections';
|
|
31
|
+
import * as i3 from '@angular/cdk/tree';
|
|
32
|
+
import { NestedTreeControl, CdkTreeModule } from '@angular/cdk/tree';
|
|
33
|
+
import * as i4$3 from '@angular/cdk/drag-drop';
|
|
34
|
+
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
32
35
|
import 'hammerjs';
|
|
33
36
|
import * as i5$2 from '@angular/cdk/a11y';
|
|
34
37
|
import { A11yModule } from '@angular/cdk/a11y';
|
|
@@ -4763,17 +4766,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4763
4766
|
}] } });
|
|
4764
4767
|
|
|
4765
4768
|
class BookmarksComponent {
|
|
4769
|
+
set bookmarkNodes(value) {
|
|
4770
|
+
this.rebuildTreeForData(value);
|
|
4771
|
+
if (this._bookmarkNodes && this.sortMode !== this.customSort) {
|
|
4772
|
+
this.sortBookmarks();
|
|
4773
|
+
}
|
|
4774
|
+
}
|
|
4775
|
+
;
|
|
4776
|
+
get bookmarkNodes() {
|
|
4777
|
+
return this._bookmarkNodes;
|
|
4778
|
+
}
|
|
4779
|
+
;
|
|
4766
4780
|
constructor(store) {
|
|
4767
4781
|
this.store = store;
|
|
4768
4782
|
this.goToDestination = new EventEmitter();
|
|
4783
|
+
this._bookmarkNodes = [];
|
|
4784
|
+
// expansion model tracks expansion state
|
|
4785
|
+
this.expansionModel = new SelectionModel(true);
|
|
4786
|
+
this.dragging = false;
|
|
4787
|
+
this.expandDelay = 1000;
|
|
4769
4788
|
this.pageLookup = {};
|
|
4770
4789
|
this.BOOKMARK_CHAR_LIMIT = 30;
|
|
4790
|
+
this.dragNodeExpandOverWaitTimeMs = 300;
|
|
4771
4791
|
this.options = {
|
|
4772
4792
|
allowDrag: true,
|
|
4773
4793
|
allowDrop: true
|
|
4774
4794
|
};
|
|
4775
4795
|
this._customSort = 'CUSTOM';
|
|
4776
4796
|
this._positionSort = 'POSITION';
|
|
4797
|
+
this.hasChild = (_, node) => {
|
|
4798
|
+
return node.children && node.children.length > 0;
|
|
4799
|
+
};
|
|
4777
4800
|
}
|
|
4778
4801
|
ngOnInit() {
|
|
4779
4802
|
this.sortMode = this.customSort;
|
|
@@ -4786,11 +4809,6 @@ class BookmarksComponent {
|
|
|
4786
4809
|
});
|
|
4787
4810
|
}));
|
|
4788
4811
|
}
|
|
4789
|
-
ngOnChanges(changes) {
|
|
4790
|
-
if (changes.bookmarkNodes && this.sortMode !== this.customSort) {
|
|
4791
|
-
this.sortBookmarks();
|
|
4792
|
-
}
|
|
4793
|
-
}
|
|
4794
4812
|
ngOnDestroy() {
|
|
4795
4813
|
this.$subscription.unsubscribe();
|
|
4796
4814
|
}
|
|
@@ -4805,37 +4823,18 @@ class BookmarksComponent {
|
|
|
4805
4823
|
}));
|
|
4806
4824
|
});
|
|
4807
4825
|
}
|
|
4808
|
-
|
|
4809
|
-
let movedBookmarks = [{
|
|
4810
|
-
...node,
|
|
4811
|
-
previous: to.index > 0 ? to.parent.children[to.index - 1].id : undefined,
|
|
4812
|
-
parent: to.parent.documentId ? to.parent.id : undefined
|
|
4813
|
-
}];
|
|
4814
|
-
let fromNext = this.getSibling(from, from.index);
|
|
4815
|
-
fromNext = fromNext && fromNext.id === node.previous ? this.getSibling(from, from.index + 1) : fromNext;
|
|
4816
|
-
if (fromNext) {
|
|
4817
|
-
movedBookmarks = [...movedBookmarks, { ...fromNext, previous: node.previous }];
|
|
4818
|
-
}
|
|
4819
|
-
const toNext = this.getSibling(to, to.index + 1);
|
|
4820
|
-
if (toNext) {
|
|
4821
|
-
movedBookmarks = [...movedBookmarks, { ...toNext, previous: node.id }];
|
|
4822
|
-
}
|
|
4823
|
-
this.store.dispatch(new MoveBookmark(movedBookmarks));
|
|
4824
|
-
}
|
|
4825
|
-
deleteBookmark(node) {
|
|
4826
|
+
deleteBookmark2(node) {
|
|
4826
4827
|
this.customSortBookmarks();
|
|
4827
4828
|
let next;
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
if (siblings.length > node.index + 1) {
|
|
4834
|
-
next = siblings[node.index + 1].data;
|
|
4835
|
-
next.previous = node.data.previous;
|
|
4829
|
+
const changedData = JSON.parse(JSON.stringify(this.bookmarkNodes));
|
|
4830
|
+
const siblings = this.findNodeSiblings(changedData, node.id);
|
|
4831
|
+
if (siblings && siblings.length > node.index + 1) {
|
|
4832
|
+
next = siblings[node.index + 1];
|
|
4833
|
+
next.previous = node.previous;
|
|
4836
4834
|
}
|
|
4835
|
+
const toDelete = [node.id, ...getBookmarkChildren(node.children)];
|
|
4837
4836
|
this.store.dispatch(new DeleteBookmark({
|
|
4838
|
-
deleted:
|
|
4837
|
+
deleted: toDelete, updated: next
|
|
4839
4838
|
}));
|
|
4840
4839
|
}
|
|
4841
4840
|
updateBookmark(bookmark, name) {
|
|
@@ -4901,33 +4900,200 @@ class BookmarksComponent {
|
|
|
4901
4900
|
}
|
|
4902
4901
|
positionSortBookmarks() {
|
|
4903
4902
|
this.bookmarkNodes.sort((a, b) => a.pageNumber === b.pageNumber ? a.yCoordinate - b.yCoordinate : a.pageNumber - b.pageNumber);
|
|
4904
|
-
this.
|
|
4905
|
-
this.setDragNDrop(false);
|
|
4903
|
+
this.rebuildTreeForData(this.bookmarkNodes);
|
|
4906
4904
|
}
|
|
4907
4905
|
customSortBookmarks() {
|
|
4908
|
-
this.bookmarkNodes.
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
setDragNDrop(enabled) {
|
|
4913
|
-
this.options = {
|
|
4914
|
-
allowDrag: enabled,
|
|
4915
|
-
allowDrop: enabled
|
|
4916
|
-
};
|
|
4917
|
-
}
|
|
4918
|
-
getSibling(node, index) {
|
|
4919
|
-
return node.parent.children.length > index ? node.parent.children[index] : undefined;
|
|
4906
|
+
if (this.bookmarkNodes.length > 1) {
|
|
4907
|
+
this.bookmarkNodes.sort((a, b) => a.index - b.index);
|
|
4908
|
+
}
|
|
4909
|
+
this.rebuildTreeForData(this.bookmarkNodes);
|
|
4920
4910
|
}
|
|
4921
4911
|
scaledY(yCoordinate, height, page) {
|
|
4922
4912
|
const viewportScale = page.viewportScale / this.zoom;
|
|
4923
4913
|
return ((height / this.zoom) - yCoordinate) / viewportScale;
|
|
4924
4914
|
}
|
|
4915
|
+
getNode(bookmarks, parentId) {
|
|
4916
|
+
if (typeof bookmarks !== 'undefined') {
|
|
4917
|
+
for (let i = 0; i < bookmarks.length; i++) {
|
|
4918
|
+
if (bookmarks[i].id === parentId) {
|
|
4919
|
+
return [bookmarks[i]];
|
|
4920
|
+
}
|
|
4921
|
+
const a = this.getNode(bookmarks[i].children, parentId);
|
|
4922
|
+
if (a !== null) {
|
|
4923
|
+
return a;
|
|
4924
|
+
}
|
|
4925
|
+
}
|
|
4926
|
+
}
|
|
4927
|
+
return null;
|
|
4928
|
+
}
|
|
4929
|
+
drop(event) {
|
|
4930
|
+
if (!event.isPointerOverContainer || (event.previousIndex === event.currentIndex))
|
|
4931
|
+
return;
|
|
4932
|
+
const hasMovedUpTheTree = event.previousIndex > event.currentIndex;
|
|
4933
|
+
const bookmarkNodesString = JSON.stringify(this._bookmarkNodes);
|
|
4934
|
+
const changedData = JSON.parse(bookmarkNodesString);
|
|
4935
|
+
const visibleNodes = this.visibleNodes(this._bookmarkNodes);
|
|
4936
|
+
const toNode = visibleNodes[event.currentIndex];
|
|
4937
|
+
const toNodeSiblings = this.findNodeSiblings(changedData, toNode.id);
|
|
4938
|
+
const toNodeParent = toNodeSiblings[0].parent;
|
|
4939
|
+
const toIndex = toNodeSiblings.findIndex(s => s.id === toNode.id);
|
|
4940
|
+
const fromNode = event.item.data;
|
|
4941
|
+
const fromNodeSiblings = this.findNodeSiblings(changedData, fromNode.id);
|
|
4942
|
+
const fromIndex = fromNodeSiblings.findIndex(n => n.id === fromNode.id);
|
|
4943
|
+
if (this.isToNodeChildOfFromNode(fromNode?.children, toNode))
|
|
4944
|
+
return;
|
|
4945
|
+
if (this.dragNodeInsertToParent) {
|
|
4946
|
+
const indexOfParent = toNodeSiblings.findIndex(element => element.id === toNode.id);
|
|
4947
|
+
const parentNode = toNodeSiblings[indexOfParent];
|
|
4948
|
+
const firstChild = parentNode?.children && parentNode?.children.length > 0 ? parentNode.children[0] : null;
|
|
4949
|
+
let movedBookmarksWithParent = [{ ...fromNode, parent: parentNode.id, previous: null }];
|
|
4950
|
+
if (firstChild) {
|
|
4951
|
+
movedBookmarksWithParent = [...movedBookmarksWithParent, { ...firstChild, previous: fromNode.id }];
|
|
4952
|
+
}
|
|
4953
|
+
let fromNodeSibling = this.getSiblingFromAllSibliings(fromNodeSiblings, fromIndex + 1);
|
|
4954
|
+
const nextFromindexforParent = fromIndex + 1;
|
|
4955
|
+
fromNodeSibling = fromNodeSibling && fromNodeSibling.id === fromNode.previous ? this.getSiblingFromAllSibliings(fromNodeSiblings, nextFromindexforParent + 1) : fromNodeSibling;
|
|
4956
|
+
if (fromNodeSibling && fromNodeSibling.id !== parentNode.id) {
|
|
4957
|
+
movedBookmarksWithParent = [...movedBookmarksWithParent, { ...fromNodeSibling, previous: fromNode.previous }];
|
|
4958
|
+
}
|
|
4959
|
+
let previousSiblingForParentIndex = toIndex - 1;
|
|
4960
|
+
let parentNodeSibling = this.getSiblingFromAllSibliings(toNodeSiblings, previousSiblingForParentIndex);
|
|
4961
|
+
if (parentNodeSibling && parentNodeSibling.id == fromNode.id) {
|
|
4962
|
+
previousSiblingForParentIndex = previousSiblingForParentIndex - 1;
|
|
4963
|
+
if (previousSiblingForParentIndex >= 0) {
|
|
4964
|
+
parentNodeSibling = this.getSiblingFromAllSibliings(toNodeSiblings, previousSiblingForParentIndex);
|
|
4965
|
+
}
|
|
4966
|
+
else {
|
|
4967
|
+
parentNodeSibling = null;
|
|
4968
|
+
}
|
|
4969
|
+
}
|
|
4970
|
+
movedBookmarksWithParent = [...movedBookmarksWithParent, { ...parentNode, previous: parentNodeSibling?.id }];
|
|
4971
|
+
const hasParentDups = movedBookmarksWithParent.map(x => x.id).some(function (value, index, array) {
|
|
4972
|
+
return array.indexOf(value) !== array.lastIndexOf(value); // comparing first and last indexes of the same value
|
|
4973
|
+
});
|
|
4974
|
+
if (hasParentDups || movedBookmarksWithParent && movedBookmarksWithParent.length <= 1)
|
|
4975
|
+
return;
|
|
4976
|
+
this.store.dispatch(new MoveBookmark(movedBookmarksWithParent));
|
|
4977
|
+
return;
|
|
4978
|
+
}
|
|
4979
|
+
if (!toNodeSiblings)
|
|
4980
|
+
return;
|
|
4981
|
+
const fromNodePrevious = hasMovedUpTheTree ? toNode.previous : toNode.id;
|
|
4982
|
+
let movedBookmarks = [{
|
|
4983
|
+
...fromNode,
|
|
4984
|
+
previous: toNode.index > 0 ? fromNodePrevious : undefined,
|
|
4985
|
+
parent: toNodeParent
|
|
4986
|
+
}];
|
|
4987
|
+
let fromNodeSibling = this.getSiblingFromAllSibliings(fromNodeSiblings, fromIndex + 1);
|
|
4988
|
+
const nextFromindex = fromIndex + 1;
|
|
4989
|
+
fromNodeSibling = fromNodeSibling && fromNodeSibling.id === fromNode.previous ? this.getSiblingFromAllSibliings(fromNodeSiblings, nextFromindex + 1) : fromNodeSibling;
|
|
4990
|
+
if (fromNodeSibling) {
|
|
4991
|
+
movedBookmarks = [...movedBookmarks, { ...fromNodeSibling, previous: fromNode.previous }];
|
|
4992
|
+
}
|
|
4993
|
+
let toNodeSiblingIndex = hasMovedUpTheTree ? toIndex : toIndex + 1;
|
|
4994
|
+
let toNodeSibling = this.getSiblingFromAllSibliings(toNodeSiblings, toNodeSiblingIndex);
|
|
4995
|
+
if (toNodeSibling) {
|
|
4996
|
+
movedBookmarks = [...movedBookmarks, { ...toNodeSibling, previous: fromNode.id }];
|
|
4997
|
+
}
|
|
4998
|
+
const hasDups = movedBookmarks.map(x => x.id).some(function (value, index, array) {
|
|
4999
|
+
return array.indexOf(value) !== array.lastIndexOf(value); // comparing first and last indexes of the same value
|
|
5000
|
+
});
|
|
5001
|
+
if (hasDups || movedBookmarks && movedBookmarks.length <= 1)
|
|
5002
|
+
return;
|
|
5003
|
+
this.store.dispatch(new MoveBookmark(movedBookmarks));
|
|
5004
|
+
}
|
|
5005
|
+
getSiblingFromAllSibliings(sibling, index) {
|
|
5006
|
+
return sibling.length > index ? sibling[index] : undefined;
|
|
5007
|
+
}
|
|
5008
|
+
dragStart() {
|
|
5009
|
+
this.dragNodeInsertToParent = false;
|
|
5010
|
+
this.hoveredNode = null;
|
|
5011
|
+
this.dragging = true;
|
|
5012
|
+
}
|
|
5013
|
+
dragEnd() {
|
|
5014
|
+
this.dragging = false;
|
|
5015
|
+
}
|
|
5016
|
+
dragHover(event, node) {
|
|
5017
|
+
if (this.dragging) {
|
|
5018
|
+
const newEvent = event;
|
|
5019
|
+
const percentageX = newEvent.offsetX / newEvent.target.clientWidth;
|
|
5020
|
+
if (percentageX > .55) {
|
|
5021
|
+
this.hoveredNode = node;
|
|
5022
|
+
this.dragNodeInsertToParent = true;
|
|
5023
|
+
}
|
|
5024
|
+
else {
|
|
5025
|
+
this.hoveredNode = null;
|
|
5026
|
+
this.dragNodeInsertToParent = false;
|
|
5027
|
+
}
|
|
5028
|
+
clearTimeout(this.expandTimeout);
|
|
5029
|
+
this.expandTimeout = setTimeout(() => {
|
|
5030
|
+
this.treeControl.expand(node);
|
|
5031
|
+
}, this.expandDelay);
|
|
5032
|
+
}
|
|
5033
|
+
}
|
|
5034
|
+
dragHoverEnd(event, node) {
|
|
5035
|
+
if (this.dragging) {
|
|
5036
|
+
if (!node || this.hoveredNode?.id !== node.id) {
|
|
5037
|
+
this.dragNodeInsertToParent = false;
|
|
5038
|
+
this.hoveredNode = null;
|
|
5039
|
+
}
|
|
5040
|
+
clearTimeout(this.expandTimeout);
|
|
5041
|
+
}
|
|
5042
|
+
}
|
|
5043
|
+
onNodeExpand(node) {
|
|
5044
|
+
const isExpanded = this.treeControl.isExpanded(node);
|
|
5045
|
+
return isExpanded ? "toggle-children-wrapper-expanded" : "toggle-children-wrapper-collapsed";
|
|
5046
|
+
}
|
|
5047
|
+
visibleNodes(bookmarks) {
|
|
5048
|
+
const result = [];
|
|
5049
|
+
function addExpandedChildren(node, expanded) {
|
|
5050
|
+
result.push(node);
|
|
5051
|
+
if (expanded.some(bookmark => bookmark && bookmark.id === node.id) && node.children) {
|
|
5052
|
+
node.children.map((child) => addExpandedChildren(child, expanded));
|
|
5053
|
+
}
|
|
5054
|
+
}
|
|
5055
|
+
bookmarks.forEach((node) => {
|
|
5056
|
+
addExpandedChildren(node, this.treeControl.expansionModel.selected);
|
|
5057
|
+
});
|
|
5058
|
+
return result;
|
|
5059
|
+
}
|
|
5060
|
+
findNodeSiblings(arr, id) {
|
|
5061
|
+
let result, subResult;
|
|
5062
|
+
arr.forEach((item, i) => {
|
|
5063
|
+
if (item.id === id) {
|
|
5064
|
+
result = arr;
|
|
5065
|
+
}
|
|
5066
|
+
else if (item?.children) {
|
|
5067
|
+
subResult = this.findNodeSiblings(item.children, id);
|
|
5068
|
+
if (subResult)
|
|
5069
|
+
result = subResult;
|
|
5070
|
+
}
|
|
5071
|
+
});
|
|
5072
|
+
return result;
|
|
5073
|
+
}
|
|
5074
|
+
rebuildTreeForData(data) {
|
|
5075
|
+
this._bookmarkNodes = data ?? [];
|
|
5076
|
+
this.datasource = new ArrayDataSource(this._bookmarkNodes);
|
|
5077
|
+
this.treeControl = new NestedTreeControl(node => node.children);
|
|
5078
|
+
this.treeControl.dataNodes = this._bookmarkNodes;
|
|
5079
|
+
this.expansionModel.selected.forEach((bookmark) => {
|
|
5080
|
+
const node = this.treeControl.dataNodes.find((n) => n.id === bookmark.id);
|
|
5081
|
+
this.treeControl.expand(node);
|
|
5082
|
+
});
|
|
5083
|
+
}
|
|
5084
|
+
isToNodeChildOfFromNode(fromNodeChildren, toNode) {
|
|
5085
|
+
if (!fromNodeChildren) {
|
|
5086
|
+
return false;
|
|
5087
|
+
}
|
|
5088
|
+
const result = this.getNode(fromNodeChildren, toNode.id);
|
|
5089
|
+
return result ? true : false;
|
|
5090
|
+
}
|
|
4925
5091
|
}
|
|
4926
5092
|
/** @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 });
|
|
4927
|
-
/** @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" },
|
|
5093
|
+
/** @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"] }] });
|
|
4928
5094
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BookmarksComponent, decorators: [{
|
|
4929
5095
|
type: Component,
|
|
4930
|
-
args: [{ selector: 'mv-bookmarks', template: "<a *ngIf=\"bookmarkNodes?.length === 0\" class=\"highlightedOutlineItem\">No bookmarks created yet</a>\n<tree-
|
|
5096
|
+
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" }]
|
|
4931
5097
|
}], ctorParameters: function () { return [{ type: i1.Store }]; }, propDecorators: { bookmarkNodes: [{
|
|
4932
5098
|
type: Input
|
|
4933
5099
|
}], zoom: [{
|
|
@@ -4936,9 +5102,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4936
5102
|
type: Input
|
|
4937
5103
|
}], goToDestination: [{
|
|
4938
5104
|
type: Output
|
|
4939
|
-
}], tree: [{
|
|
4940
|
-
type: ViewChild,
|
|
4941
|
-
args: [TreeComponent]
|
|
4942
5105
|
}] } });
|
|
4943
5106
|
|
|
4944
5107
|
class OutlineItemComponent {
|
|
@@ -7000,8 +7163,9 @@ class MediaViewerModule {
|
|
|
7000
7163
|
TagInputModule,
|
|
7001
7164
|
FormsModule,
|
|
7002
7165
|
ReactiveFormsModule,
|
|
7003
|
-
RouterModule, i1.StoreFeatureModule, i1$2.EffectsFeatureModule,
|
|
7004
|
-
|
|
7166
|
+
RouterModule, i1.StoreFeatureModule, i1$2.EffectsFeatureModule, MutableDivModule,
|
|
7167
|
+
CdkTreeModule,
|
|
7168
|
+
DragDropModule, i5.RpxTranslationModule], exports: [MediaViewerComponent] });
|
|
7005
7169
|
/** @nocollapse */ MediaViewerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MediaViewerModule, providers: [
|
|
7006
7170
|
PdfJsWrapperFactory,
|
|
7007
7171
|
CommentService,
|
|
@@ -7025,8 +7189,9 @@ class MediaViewerModule {
|
|
|
7025
7189
|
RouterModule,
|
|
7026
7190
|
StoreModule.forFeature('media-viewer', reducers),
|
|
7027
7191
|
EffectsModule.forFeature(effects),
|
|
7028
|
-
TreeModule,
|
|
7029
7192
|
MutableDivModule,
|
|
7193
|
+
CdkTreeModule,
|
|
7194
|
+
DragDropModule,
|
|
7030
7195
|
RpxTranslationModule.forChild()] });
|
|
7031
7196
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MediaViewerModule, decorators: [{
|
|
7032
7197
|
type: NgModule,
|
|
@@ -7042,8 +7207,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
7042
7207
|
RouterModule,
|
|
7043
7208
|
StoreModule.forFeature('media-viewer', reducers),
|
|
7044
7209
|
EffectsModule.forFeature(effects),
|
|
7045
|
-
TreeModule,
|
|
7046
7210
|
MutableDivModule,
|
|
7211
|
+
CdkTreeModule,
|
|
7212
|
+
DragDropModule,
|
|
7047
7213
|
RpxTranslationModule.forChild()
|
|
7048
7214
|
],
|
|
7049
7215
|
declarations: [
|