@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.
@@ -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 * as i3 from '@circlon/angular-tree-component';
31
- import { TreeComponent, TreeModule } from '@circlon/angular-tree-component';
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';
@@ -1560,7 +1563,7 @@ class PdfJsWrapper {
1560
1563
  this.pdfViewer.setDocument(pdfDocument);
1561
1564
  this.pdfViewer.linkService.setDocument(pdfDocument, null);
1562
1565
  const outlineNode = await pdfDocument.getOutline();
1563
- const outline = outlineNode.map(x => {
1566
+ const outline = outlineNode ? outlineNode.map(x => {
1564
1567
  return {
1565
1568
  bold: x.bold,
1566
1569
  color: x.color,
@@ -1573,7 +1576,7 @@ class PdfJsWrapper {
1573
1576
  unsafeUrl: x.unsafeUrl,
1574
1577
  url: x.url
1575
1578
  };
1576
- });
1579
+ }) : null;
1577
1580
  if (outline) {
1578
1581
  await this.setOutlinePageNumbers(pdfDocument, outline);
1579
1582
  }
@@ -1950,10 +1953,6 @@ class PrintService {
1950
1953
  printWindow.focus();
1951
1954
  setTimeout((printer) => {
1952
1955
  printer.print();
1953
- printer.onafterprint = () => {
1954
- printer.close();
1955
- window.close();
1956
- };
1957
1956
  }, 3000, printWindow);
1958
1957
  }
1959
1958
  printElementNatively(element, width, height) {
@@ -4767,17 +4766,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
4767
4766
  }] } });
4768
4767
 
4769
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
+ ;
4770
4780
  constructor(store) {
4771
4781
  this.store = store;
4772
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;
4773
4788
  this.pageLookup = {};
4774
4789
  this.BOOKMARK_CHAR_LIMIT = 30;
4790
+ this.dragNodeExpandOverWaitTimeMs = 300;
4775
4791
  this.options = {
4776
4792
  allowDrag: true,
4777
4793
  allowDrop: true
4778
4794
  };
4779
4795
  this._customSort = 'CUSTOM';
4780
4796
  this._positionSort = 'POSITION';
4797
+ this.hasChild = (_, node) => {
4798
+ return node.children && node.children.length > 0;
4799
+ };
4781
4800
  }
4782
4801
  ngOnInit() {
4783
4802
  this.sortMode = this.customSort;
@@ -4790,11 +4809,6 @@ class BookmarksComponent {
4790
4809
  });
4791
4810
  }));
4792
4811
  }
4793
- ngOnChanges(changes) {
4794
- if (changes.bookmarkNodes && this.sortMode !== this.customSort) {
4795
- this.sortBookmarks();
4796
- }
4797
- }
4798
4812
  ngOnDestroy() {
4799
4813
  this.$subscription.unsubscribe();
4800
4814
  }
@@ -4809,37 +4823,18 @@ class BookmarksComponent {
4809
4823
  }));
4810
4824
  });
4811
4825
  }
4812
- onBookmarkMove({ node, from, to }) {
4813
- let movedBookmarks = [{
4814
- ...node,
4815
- previous: to.index > 0 ? to.parent.children[to.index - 1].id : undefined,
4816
- parent: to.parent.documentId ? to.parent.id : undefined
4817
- }];
4818
- let fromNext = this.getSibling(from, from.index);
4819
- fromNext = fromNext && fromNext.id === node.previous ? this.getSibling(from, from.index + 1) : fromNext;
4820
- if (fromNext) {
4821
- movedBookmarks = [...movedBookmarks, { ...fromNext, previous: node.previous }];
4822
- }
4823
- const toNext = this.getSibling(to, to.index + 1);
4824
- if (toNext) {
4825
- movedBookmarks = [...movedBookmarks, { ...toNext, previous: node.id }];
4826
- }
4827
- this.store.dispatch(new MoveBookmark(movedBookmarks));
4828
- }
4829
- deleteBookmark(node) {
4826
+ deleteBookmark2(node) {
4830
4827
  this.customSortBookmarks();
4831
4828
  let next;
4832
- node = this.tree.treeModel.getNodeById(node.id);
4833
- if (!node.parent) {
4834
- node.parent = this.tree.treeModel.virtualRoot;
4835
- }
4836
- const siblings = node.parent.children;
4837
- if (siblings.length > node.index + 1) {
4838
- next = siblings[node.index + 1].data;
4839
- 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;
4840
4834
  }
4835
+ const toDelete = [node.id, ...getBookmarkChildren(node.children)];
4841
4836
  this.store.dispatch(new DeleteBookmark({
4842
- deleted: [node.data.id, ...getBookmarkChildren(node.data.children)], updated: next
4837
+ deleted: toDelete, updated: next
4843
4838
  }));
4844
4839
  }
4845
4840
  updateBookmark(bookmark, name) {
@@ -4905,33 +4900,178 @@ class BookmarksComponent {
4905
4900
  }
4906
4901
  positionSortBookmarks() {
4907
4902
  this.bookmarkNodes.sort((a, b) => a.pageNumber === b.pageNumber ? a.yCoordinate - b.yCoordinate : a.pageNumber - b.pageNumber);
4908
- this.tree.treeModel.update();
4909
- this.setDragNDrop(false);
4903
+ this.rebuildTreeForData(this.bookmarkNodes);
4910
4904
  }
4911
4905
  customSortBookmarks() {
4912
- this.bookmarkNodes.sort((a, b) => a.index - b.index);
4913
- this.tree.treeModel.update();
4914
- this.setDragNDrop(true);
4915
- }
4916
- setDragNDrop(enabled) {
4917
- this.options = {
4918
- allowDrag: enabled,
4919
- allowDrop: enabled
4920
- };
4921
- }
4922
- getSibling(node, index) {
4923
- 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);
4924
4910
  }
4925
4911
  scaledY(yCoordinate, height, page) {
4926
4912
  const viewportScale = page.viewportScale / this.zoom;
4927
4913
  return ((height / this.zoom) - yCoordinate) / viewportScale;
4928
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
+ }
4929
5069
  }
4930
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 });
4931
- /** @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" }, viewQueries: [{ propertyName: "tree", first: true, predicate: TreeComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<a *ngIf=\"bookmarkNodes?.length === 0\" class=\"highlightedOutlineItem\">No bookmarks created yet</a>\n<tree-root [nodes]=\"bookmarkNodes\" class=\"bookmarks-tree\" [options]=\"options\" (moveNode)=\"onBookmarkMove($event)\">\n <ng-template #treeNodeTemplate let-node let-index=\"index\">\n <div class=\"outlineItem\" *ngIf=\"node.data.id !== editableBookmark; else inputBookmark\">\n <a (click)=\"goToBookmark(node.data)\">\n {{ node.data.name }}\n </a>\n <button class=\"bookmark__rename\" (click)=\"editBookmark(node.data.id)\"></button>\n <button class=\"bookmark__delete\" (click)=\"deleteBookmark(node)\"></button>\n </div>\n <ng-template #inputBookmark>\n <input #bookmarkName class=\"bookmark__input\" [value]=\"node.data.name\" [maxLength]=\"BOOKMARK_CHAR_LIMIT\">\n <button class=\"bookmark__save\" (click)=\"updateBookmark(node.data, bookmarkName.value)\"></button>\n </ng-template>\n </ng-template>\n</tree-root>\n", dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.TreeComponent, selector: "Tree, tree-root", inputs: ["nodes", "options", "focused", "state"], outputs: ["toggleExpanded", "activate", "deactivate", "nodeActivate", "nodeDeactivate", "select", "deselect", "focus", "blur", "updateData", "initialized", "moveNode", "copyNode", "loadNodeChildren", "changeFilter", "event", "stateChange"] }] });
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"] }] });
4932
5072
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BookmarksComponent, decorators: [{
4933
5073
  type: Component,
4934
- args: [{ selector: 'mv-bookmarks', template: "<a *ngIf=\"bookmarkNodes?.length === 0\" class=\"highlightedOutlineItem\">No bookmarks created yet</a>\n<tree-root [nodes]=\"bookmarkNodes\" class=\"bookmarks-tree\" [options]=\"options\" (moveNode)=\"onBookmarkMove($event)\">\n <ng-template #treeNodeTemplate let-node let-index=\"index\">\n <div class=\"outlineItem\" *ngIf=\"node.data.id !== editableBookmark; else inputBookmark\">\n <a (click)=\"goToBookmark(node.data)\">\n {{ node.data.name }}\n </a>\n <button class=\"bookmark__rename\" (click)=\"editBookmark(node.data.id)\"></button>\n <button class=\"bookmark__delete\" (click)=\"deleteBookmark(node)\"></button>\n </div>\n <ng-template #inputBookmark>\n <input #bookmarkName class=\"bookmark__input\" [value]=\"node.data.name\" [maxLength]=\"BOOKMARK_CHAR_LIMIT\">\n <button class=\"bookmark__save\" (click)=\"updateBookmark(node.data, bookmarkName.value)\"></button>\n </ng-template>\n </ng-template>\n</tree-root>\n" }]
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" }]
4935
5075
  }], ctorParameters: function () { return [{ type: i1.Store }]; }, propDecorators: { bookmarkNodes: [{
4936
5076
  type: Input
4937
5077
  }], zoom: [{
@@ -4940,9 +5080,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
4940
5080
  type: Input
4941
5081
  }], goToDestination: [{
4942
5082
  type: Output
4943
- }], tree: [{
4944
- type: ViewChild,
4945
- args: [TreeComponent]
4946
5083
  }] } });
4947
5084
 
4948
5085
  class OutlineItemComponent {
@@ -7004,8 +7141,9 @@ class MediaViewerModule {
7004
7141
  TagInputModule,
7005
7142
  FormsModule,
7006
7143
  ReactiveFormsModule,
7007
- RouterModule, i1.StoreFeatureModule, i1$2.EffectsFeatureModule, TreeModule,
7008
- MutableDivModule, i5.RpxTranslationModule], exports: [MediaViewerComponent] });
7144
+ RouterModule, i1.StoreFeatureModule, i1$2.EffectsFeatureModule, MutableDivModule,
7145
+ CdkTreeModule,
7146
+ DragDropModule, i5.RpxTranslationModule], exports: [MediaViewerComponent] });
7009
7147
  /** @nocollapse */ MediaViewerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MediaViewerModule, providers: [
7010
7148
  PdfJsWrapperFactory,
7011
7149
  CommentService,
@@ -7029,8 +7167,9 @@ class MediaViewerModule {
7029
7167
  RouterModule,
7030
7168
  StoreModule.forFeature('media-viewer', reducers),
7031
7169
  EffectsModule.forFeature(effects),
7032
- TreeModule,
7033
7170
  MutableDivModule,
7171
+ CdkTreeModule,
7172
+ DragDropModule,
7034
7173
  RpxTranslationModule.forChild()] });
7035
7174
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MediaViewerModule, decorators: [{
7036
7175
  type: NgModule,
@@ -7046,8 +7185,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
7046
7185
  RouterModule,
7047
7186
  StoreModule.forFeature('media-viewer', reducers),
7048
7187
  EffectsModule.forFeature(effects),
7049
- TreeModule,
7050
7188
  MutableDivModule,
7189
+ CdkTreeModule,
7190
+ DragDropModule,
7051
7191
  RpxTranslationModule.forChild()
7052
7192
  ],
7053
7193
  declarations: [