@hmcts/media-viewer 3.0.4 → 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/viewers/pdf-viewer/side-bar/bookmarks/bookmarks.component.mjs +195 -55
- package/fesm2015/hmcts-media-viewer.mjs +198 -53
- package/fesm2015/hmcts-media-viewer.mjs.map +1 -1
- package/fesm2020/hmcts-media-viewer.mjs +201 -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 +35 -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,178 @@ 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 changedData = JSON.parse(JSON.stringify(this.bookmarkNodes));
|
|
4934
|
+
const visibleNodes = this.visibleNodes(this._bookmarkNodes);
|
|
4935
|
+
const toNode = visibleNodes[event.currentIndex];
|
|
4936
|
+
const toNodeSiblings = this.findNodeSiblings(changedData, toNode.id);
|
|
4937
|
+
const toNodeParent = toNodeSiblings[0].parent;
|
|
4938
|
+
const toIndex = toNodeSiblings.findIndex(s => s.id === toNode.id);
|
|
4939
|
+
const fromNode = event.item.data;
|
|
4940
|
+
const fromNodeSiblings = this.findNodeSiblings(changedData, fromNode.id);
|
|
4941
|
+
const fromIndex = fromNodeSiblings.findIndex(n => n.id === fromNode.id);
|
|
4942
|
+
if (this.dragNodeInsertToParent) {
|
|
4943
|
+
const indexOfParent = toNodeSiblings.findIndex(element => element.id === toNode.id);
|
|
4944
|
+
const parentNode = toNodeSiblings[indexOfParent];
|
|
4945
|
+
const firstChild = parentNode?.children && parentNode?.children.length > 0 ? parentNode.children[0] : null;
|
|
4946
|
+
let movedBookmarksWithParent = [{ ...fromNode, parent: parentNode.id, previous: null }];
|
|
4947
|
+
if (firstChild) {
|
|
4948
|
+
movedBookmarksWithParent = [...movedBookmarksWithParent, { ...firstChild, previous: fromNode.id }];
|
|
4949
|
+
}
|
|
4950
|
+
let previousSiblingForParentIndex = toIndex - 1;
|
|
4951
|
+
let parentNodeSibling = this.getSiblingFromAllSibliings(fromNodeSiblings, previousSiblingForParentIndex);
|
|
4952
|
+
if (parentNodeSibling.id == fromNode.id) {
|
|
4953
|
+
previousSiblingForParentIndex = previousSiblingForParentIndex - 1;
|
|
4954
|
+
if (previousSiblingForParentIndex > 0) {
|
|
4955
|
+
parentNodeSibling = this.getSiblingFromAllSibliings(fromNodeSiblings, previousSiblingForParentIndex);
|
|
4956
|
+
}
|
|
4957
|
+
else {
|
|
4958
|
+
parentNodeSibling = null;
|
|
4959
|
+
}
|
|
4960
|
+
}
|
|
4961
|
+
movedBookmarksWithParent = [...movedBookmarksWithParent, { ...parentNode, previous: parentNodeSibling?.id }];
|
|
4962
|
+
this.store.dispatch(new MoveBookmark(movedBookmarksWithParent));
|
|
4963
|
+
return;
|
|
4964
|
+
}
|
|
4965
|
+
if (!toNodeSiblings)
|
|
4966
|
+
return;
|
|
4967
|
+
const fromNodePrevious = hasMovedUpTheTree ? toNode.previous : toNode.id;
|
|
4968
|
+
let movedBookmarks = [{
|
|
4969
|
+
...fromNode,
|
|
4970
|
+
previous: toNode.index > 0 ? fromNodePrevious : undefined,
|
|
4971
|
+
parent: toNodeParent
|
|
4972
|
+
}];
|
|
4973
|
+
let fromNodeSibling = this.getSiblingFromAllSibliings(fromNodeSiblings, fromIndex + 1);
|
|
4974
|
+
fromNodeSibling = fromNodeSibling && fromNodeSibling.id === fromNode.previous ? this.getSiblingFromAllSibliings(fromNodeSiblings, fromIndex + 1) : fromNodeSibling;
|
|
4975
|
+
if (fromNodeSibling) {
|
|
4976
|
+
movedBookmarks = [...movedBookmarks, { ...fromNodeSibling, previous: fromNode.previous }];
|
|
4977
|
+
}
|
|
4978
|
+
let toNodeSiblingIndex = hasMovedUpTheTree ? toIndex : toIndex + 1;
|
|
4979
|
+
let toNodeSibling = this.getSiblingFromAllSibliings(toNodeSiblings, toNodeSiblingIndex);
|
|
4980
|
+
if (toNodeSibling) {
|
|
4981
|
+
movedBookmarks = [...movedBookmarks, { ...toNodeSibling, previous: fromNode.id }];
|
|
4982
|
+
}
|
|
4983
|
+
const hasDups = movedBookmarks.map(x => x.id).some(function (value, index, array) {
|
|
4984
|
+
return array.indexOf(value) !== array.lastIndexOf(value); // comparing first and last indexes of the same value
|
|
4985
|
+
});
|
|
4986
|
+
if (hasDups || movedBookmarks && movedBookmarks.length <= 1)
|
|
4987
|
+
return;
|
|
4988
|
+
this.store.dispatch(new MoveBookmark(movedBookmarks));
|
|
4989
|
+
}
|
|
4990
|
+
getSiblingFromAllSibliings(sibling, index) {
|
|
4991
|
+
return sibling.length > index ? sibling[index] : undefined;
|
|
4992
|
+
}
|
|
4993
|
+
dragStart() {
|
|
4994
|
+
this.dragNodeInsertToParent = false;
|
|
4995
|
+
this.hoveredNode = null;
|
|
4996
|
+
this.dragging = true;
|
|
4997
|
+
}
|
|
4998
|
+
dragEnd() {
|
|
4999
|
+
this.dragging = false;
|
|
5000
|
+
}
|
|
5001
|
+
dragHover(event, node) {
|
|
5002
|
+
if (this.dragging) {
|
|
5003
|
+
const newEvent = event;
|
|
5004
|
+
const percentageX = newEvent.offsetX / newEvent.target.clientWidth;
|
|
5005
|
+
if (percentageX > .55) {
|
|
5006
|
+
this.hoveredNode = node;
|
|
5007
|
+
this.dragNodeInsertToParent = true;
|
|
5008
|
+
}
|
|
5009
|
+
else {
|
|
5010
|
+
this.hoveredNode = null;
|
|
5011
|
+
this.dragNodeInsertToParent = false;
|
|
5012
|
+
}
|
|
5013
|
+
clearTimeout(this.expandTimeout);
|
|
5014
|
+
this.expandTimeout = setTimeout(() => {
|
|
5015
|
+
this.treeControl.expand(node);
|
|
5016
|
+
}, this.expandDelay);
|
|
5017
|
+
}
|
|
5018
|
+
}
|
|
5019
|
+
dragHoverEnd(event, node) {
|
|
5020
|
+
if (this.dragging) {
|
|
5021
|
+
if (!node || this.hoveredNode?.id !== node.id) {
|
|
5022
|
+
this.dragNodeInsertToParent = false;
|
|
5023
|
+
this.hoveredNode = null;
|
|
5024
|
+
}
|
|
5025
|
+
clearTimeout(this.expandTimeout);
|
|
5026
|
+
}
|
|
5027
|
+
}
|
|
5028
|
+
onNodeExpand(node) {
|
|
5029
|
+
const isExpanded = this.treeControl.isExpanded(node);
|
|
5030
|
+
return isExpanded ? "toggle-children-wrapper-expanded" : "toggle-children-wrapper-collapsed";
|
|
5031
|
+
}
|
|
5032
|
+
visibleNodes(bookmarks) {
|
|
5033
|
+
const result = [];
|
|
5034
|
+
function addExpandedChildren(node, expanded) {
|
|
5035
|
+
result.push(node);
|
|
5036
|
+
if (expanded.some(bookmark => bookmark && bookmark.id === node.id) && node.children) {
|
|
5037
|
+
node.children.map((child) => addExpandedChildren(child, expanded));
|
|
5038
|
+
}
|
|
5039
|
+
}
|
|
5040
|
+
bookmarks.forEach((node) => {
|
|
5041
|
+
addExpandedChildren(node, this.treeControl.expansionModel.selected);
|
|
5042
|
+
});
|
|
5043
|
+
return result;
|
|
5044
|
+
}
|
|
5045
|
+
findNodeSiblings(arr, id) {
|
|
5046
|
+
let result, subResult;
|
|
5047
|
+
arr.forEach((item, i) => {
|
|
5048
|
+
if (item.id === id) {
|
|
5049
|
+
result = arr;
|
|
5050
|
+
}
|
|
5051
|
+
else if (item.children) {
|
|
5052
|
+
subResult = this.findNodeSiblings(item.children, id);
|
|
5053
|
+
if (subResult)
|
|
5054
|
+
result = subResult;
|
|
5055
|
+
}
|
|
5056
|
+
});
|
|
5057
|
+
return result;
|
|
5058
|
+
}
|
|
5059
|
+
rebuildTreeForData(data) {
|
|
5060
|
+
this._bookmarkNodes = data ?? [];
|
|
5061
|
+
this.datasource = new ArrayDataSource(this._bookmarkNodes);
|
|
5062
|
+
this.treeControl = new NestedTreeControl(node => node.children);
|
|
5063
|
+
this.treeControl.dataNodes = this._bookmarkNodes;
|
|
5064
|
+
this.expansionModel.selected.forEach((bookmark) => {
|
|
5065
|
+
const node = this.treeControl.dataNodes.find((n) => n.id === bookmark.id);
|
|
5066
|
+
this.treeControl.expand(node);
|
|
5067
|
+
});
|
|
5068
|
+
}
|
|
4925
5069
|
}
|
|
4926
5070
|
/** @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" },
|
|
5071
|
+
/** @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
5072
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BookmarksComponent, decorators: [{
|
|
4929
5073
|
type: Component,
|
|
4930
|
-
args: [{ selector: 'mv-bookmarks', template: "<a *ngIf=\"bookmarkNodes?.length === 0\" class=\"highlightedOutlineItem\">No bookmarks created yet</a>\n<tree-
|
|
5074
|
+
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
5075
|
}], ctorParameters: function () { return [{ type: i1.Store }]; }, propDecorators: { bookmarkNodes: [{
|
|
4932
5076
|
type: Input
|
|
4933
5077
|
}], zoom: [{
|
|
@@ -4936,9 +5080,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4936
5080
|
type: Input
|
|
4937
5081
|
}], goToDestination: [{
|
|
4938
5082
|
type: Output
|
|
4939
|
-
}], tree: [{
|
|
4940
|
-
type: ViewChild,
|
|
4941
|
-
args: [TreeComponent]
|
|
4942
5083
|
}] } });
|
|
4943
5084
|
|
|
4944
5085
|
class OutlineItemComponent {
|
|
@@ -7000,8 +7141,9 @@ class MediaViewerModule {
|
|
|
7000
7141
|
TagInputModule,
|
|
7001
7142
|
FormsModule,
|
|
7002
7143
|
ReactiveFormsModule,
|
|
7003
|
-
RouterModule, i1.StoreFeatureModule, i1$2.EffectsFeatureModule,
|
|
7004
|
-
|
|
7144
|
+
RouterModule, i1.StoreFeatureModule, i1$2.EffectsFeatureModule, MutableDivModule,
|
|
7145
|
+
CdkTreeModule,
|
|
7146
|
+
DragDropModule, i5.RpxTranslationModule], exports: [MediaViewerComponent] });
|
|
7005
7147
|
/** @nocollapse */ MediaViewerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MediaViewerModule, providers: [
|
|
7006
7148
|
PdfJsWrapperFactory,
|
|
7007
7149
|
CommentService,
|
|
@@ -7025,8 +7167,9 @@ class MediaViewerModule {
|
|
|
7025
7167
|
RouterModule,
|
|
7026
7168
|
StoreModule.forFeature('media-viewer', reducers),
|
|
7027
7169
|
EffectsModule.forFeature(effects),
|
|
7028
|
-
TreeModule,
|
|
7029
7170
|
MutableDivModule,
|
|
7171
|
+
CdkTreeModule,
|
|
7172
|
+
DragDropModule,
|
|
7030
7173
|
RpxTranslationModule.forChild()] });
|
|
7031
7174
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MediaViewerModule, decorators: [{
|
|
7032
7175
|
type: NgModule,
|
|
@@ -7042,8 +7185,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
7042
7185
|
RouterModule,
|
|
7043
7186
|
StoreModule.forFeature('media-viewer', reducers),
|
|
7044
7187
|
EffectsModule.forFeature(effects),
|
|
7045
|
-
TreeModule,
|
|
7046
7188
|
MutableDivModule,
|
|
7189
|
+
CdkTreeModule,
|
|
7190
|
+
DragDropModule,
|
|
7047
7191
|
RpxTranslationModule.forChild()
|
|
7048
7192
|
],
|
|
7049
7193
|
declarations: [
|