@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
|
@@ -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,175 @@ 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 changedData = JSON.parse(JSON.stringify(this.bookmarkNodes));
|
|
4624
|
+
const visibleNodes = this.visibleNodes(this._bookmarkNodes);
|
|
4625
|
+
const toNode = visibleNodes[event.currentIndex];
|
|
4626
|
+
const toNodeSiblings = this.findNodeSiblings(changedData, toNode.id);
|
|
4627
|
+
const toNodeParent = toNodeSiblings[0].parent;
|
|
4628
|
+
const toIndex = toNodeSiblings.findIndex(s => s.id === toNode.id);
|
|
4629
|
+
const fromNode = event.item.data;
|
|
4630
|
+
const fromNodeSiblings = this.findNodeSiblings(changedData, fromNode.id);
|
|
4631
|
+
const fromIndex = fromNodeSiblings.findIndex(n => n.id === fromNode.id);
|
|
4632
|
+
if (this.dragNodeInsertToParent) {
|
|
4633
|
+
const indexOfParent = toNodeSiblings.findIndex(element => element.id === toNode.id);
|
|
4634
|
+
const parentNode = toNodeSiblings[indexOfParent];
|
|
4635
|
+
const firstChild = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.children) && (parentNode === null || parentNode === void 0 ? void 0 : parentNode.children.length) > 0 ? parentNode.children[0] : null;
|
|
4636
|
+
let movedBookmarksWithParent = [Object.assign(Object.assign({}, fromNode), { parent: parentNode.id, previous: null })];
|
|
4637
|
+
if (firstChild) {
|
|
4638
|
+
movedBookmarksWithParent = [...movedBookmarksWithParent, Object.assign(Object.assign({}, firstChild), { previous: fromNode.id })];
|
|
4639
|
+
}
|
|
4640
|
+
let previousSiblingForParentIndex = toIndex - 1;
|
|
4641
|
+
let parentNodeSibling = this.getSiblingFromAllSibliings(fromNodeSiblings, previousSiblingForParentIndex);
|
|
4642
|
+
if (parentNodeSibling.id == fromNode.id) {
|
|
4643
|
+
previousSiblingForParentIndex = previousSiblingForParentIndex - 1;
|
|
4644
|
+
if (previousSiblingForParentIndex > 0) {
|
|
4645
|
+
parentNodeSibling = this.getSiblingFromAllSibliings(fromNodeSiblings, previousSiblingForParentIndex);
|
|
4646
|
+
}
|
|
4647
|
+
else {
|
|
4648
|
+
parentNodeSibling = null;
|
|
4649
|
+
}
|
|
4650
|
+
}
|
|
4651
|
+
movedBookmarksWithParent = [...movedBookmarksWithParent, Object.assign(Object.assign({}, parentNode), { previous: parentNodeSibling === null || parentNodeSibling === void 0 ? void 0 : parentNodeSibling.id })];
|
|
4652
|
+
this.store.dispatch(new MoveBookmark(movedBookmarksWithParent));
|
|
4653
|
+
return;
|
|
4654
|
+
}
|
|
4655
|
+
if (!toNodeSiblings)
|
|
4656
|
+
return;
|
|
4657
|
+
const fromNodePrevious = hasMovedUpTheTree ? toNode.previous : toNode.id;
|
|
4658
|
+
let movedBookmarks = [Object.assign(Object.assign({}, fromNode), { previous: toNode.index > 0 ? fromNodePrevious : undefined, parent: toNodeParent })];
|
|
4659
|
+
let fromNodeSibling = this.getSiblingFromAllSibliings(fromNodeSiblings, fromIndex + 1);
|
|
4660
|
+
fromNodeSibling = fromNodeSibling && fromNodeSibling.id === fromNode.previous ? this.getSiblingFromAllSibliings(fromNodeSiblings, fromIndex + 1) : fromNodeSibling;
|
|
4661
|
+
if (fromNodeSibling) {
|
|
4662
|
+
movedBookmarks = [...movedBookmarks, Object.assign(Object.assign({}, fromNodeSibling), { previous: fromNode.previous })];
|
|
4663
|
+
}
|
|
4664
|
+
let toNodeSiblingIndex = hasMovedUpTheTree ? toIndex : toIndex + 1;
|
|
4665
|
+
let toNodeSibling = this.getSiblingFromAllSibliings(toNodeSiblings, toNodeSiblingIndex);
|
|
4666
|
+
if (toNodeSibling) {
|
|
4667
|
+
movedBookmarks = [...movedBookmarks, Object.assign(Object.assign({}, toNodeSibling), { previous: fromNode.id })];
|
|
4668
|
+
}
|
|
4669
|
+
const hasDups = movedBookmarks.map(x => x.id).some(function (value, index, array) {
|
|
4670
|
+
return array.indexOf(value) !== array.lastIndexOf(value); // comparing first and last indexes of the same value
|
|
4671
|
+
});
|
|
4672
|
+
if (hasDups || movedBookmarks && movedBookmarks.length <= 1)
|
|
4673
|
+
return;
|
|
4674
|
+
this.store.dispatch(new MoveBookmark(movedBookmarks));
|
|
4675
|
+
}
|
|
4676
|
+
getSiblingFromAllSibliings(sibling, index) {
|
|
4677
|
+
return sibling.length > index ? sibling[index] : undefined;
|
|
4678
|
+
}
|
|
4679
|
+
dragStart() {
|
|
4680
|
+
this.dragNodeInsertToParent = false;
|
|
4681
|
+
this.hoveredNode = null;
|
|
4682
|
+
this.dragging = true;
|
|
4683
|
+
}
|
|
4684
|
+
dragEnd() {
|
|
4685
|
+
this.dragging = false;
|
|
4686
|
+
}
|
|
4687
|
+
dragHover(event, node) {
|
|
4688
|
+
if (this.dragging) {
|
|
4689
|
+
const newEvent = event;
|
|
4690
|
+
const percentageX = newEvent.offsetX / newEvent.target.clientWidth;
|
|
4691
|
+
if (percentageX > .55) {
|
|
4692
|
+
this.hoveredNode = node;
|
|
4693
|
+
this.dragNodeInsertToParent = true;
|
|
4694
|
+
}
|
|
4695
|
+
else {
|
|
4696
|
+
this.hoveredNode = null;
|
|
4697
|
+
this.dragNodeInsertToParent = false;
|
|
4698
|
+
}
|
|
4699
|
+
clearTimeout(this.expandTimeout);
|
|
4700
|
+
this.expandTimeout = setTimeout(() => {
|
|
4701
|
+
this.treeControl.expand(node);
|
|
4702
|
+
}, this.expandDelay);
|
|
4703
|
+
}
|
|
4704
|
+
}
|
|
4705
|
+
dragHoverEnd(event, node) {
|
|
4706
|
+
var _a;
|
|
4707
|
+
if (this.dragging) {
|
|
4708
|
+
if (!node || ((_a = this.hoveredNode) === null || _a === void 0 ? void 0 : _a.id) !== node.id) {
|
|
4709
|
+
this.dragNodeInsertToParent = false;
|
|
4710
|
+
this.hoveredNode = null;
|
|
4711
|
+
}
|
|
4712
|
+
clearTimeout(this.expandTimeout);
|
|
4713
|
+
}
|
|
4714
|
+
}
|
|
4715
|
+
onNodeExpand(node) {
|
|
4716
|
+
const isExpanded = this.treeControl.isExpanded(node);
|
|
4717
|
+
return isExpanded ? "toggle-children-wrapper-expanded" : "toggle-children-wrapper-collapsed";
|
|
4718
|
+
}
|
|
4719
|
+
visibleNodes(bookmarks) {
|
|
4720
|
+
const result = [];
|
|
4721
|
+
function addExpandedChildren(node, expanded) {
|
|
4722
|
+
result.push(node);
|
|
4723
|
+
if (expanded.some(bookmark => bookmark && bookmark.id === node.id) && node.children) {
|
|
4724
|
+
node.children.map((child) => addExpandedChildren(child, expanded));
|
|
4725
|
+
}
|
|
4726
|
+
}
|
|
4727
|
+
bookmarks.forEach((node) => {
|
|
4728
|
+
addExpandedChildren(node, this.treeControl.expansionModel.selected);
|
|
4729
|
+
});
|
|
4730
|
+
return result;
|
|
4731
|
+
}
|
|
4732
|
+
findNodeSiblings(arr, id) {
|
|
4733
|
+
let result, subResult;
|
|
4734
|
+
arr.forEach((item, i) => {
|
|
4735
|
+
if (item.id === id) {
|
|
4736
|
+
result = arr;
|
|
4737
|
+
}
|
|
4738
|
+
else if (item.children) {
|
|
4739
|
+
subResult = this.findNodeSiblings(item.children, id);
|
|
4740
|
+
if (subResult)
|
|
4741
|
+
result = subResult;
|
|
4742
|
+
}
|
|
4743
|
+
});
|
|
4744
|
+
return result;
|
|
4745
|
+
}
|
|
4746
|
+
rebuildTreeForData(data) {
|
|
4747
|
+
this._bookmarkNodes = data !== null && data !== void 0 ? data : [];
|
|
4748
|
+
this.datasource = new ArrayDataSource(this._bookmarkNodes);
|
|
4749
|
+
this.treeControl = new NestedTreeControl(node => node.children);
|
|
4750
|
+
this.treeControl.dataNodes = this._bookmarkNodes;
|
|
4751
|
+
this.expansionModel.selected.forEach((bookmark) => {
|
|
4752
|
+
const node = this.treeControl.dataNodes.find((n) => n.id === bookmark.id);
|
|
4753
|
+
this.treeControl.expand(node);
|
|
4754
|
+
});
|
|
4755
|
+
}
|
|
4611
4756
|
}
|
|
4612
4757
|
/** @nocollapse */ BookmarksComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BookmarksComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component });
|
|
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" },
|
|
4758
|
+
/** @nocollapse */ BookmarksComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: BookmarksComponent, selector: "mv-bookmarks", inputs: { bookmarkNodes: "bookmarkNodes", zoom: "zoom", rotate: "rotate" }, outputs: { goToDestination: "goToDestination" }, ngImport: i0, template: "<a *ngIf=\"bookmarkNodes?.length === 0\" class=\"highlightedOutlineItem\"\n >No bookmarks created yet</a\n>\n<cdk-tree\n cdkDropList\n class=\"bookmarks-tree\"\n *ngIf=\"datasource\"\n [dataSource]=\"datasource\"\n [treeControl]=\"treeControl\"\n (cdkDropListDropped)=\"drop($event)\"\n>\n <!-- This is the tree node template for leaf nodes -->\n <cdk-nested-tree-node class=\"node-wrapper\" *cdkTreeNodeDef=\"let node\">\n <div *ngIf=\"node.id !== editableBookmark; else inputBookmark\">\n <div\n class=\"node-content-wrapper nested-tree-node\"\n cdkDrag\n [cdkDragData]=\"node\"\n (mouseenter)=\"dragHover($event, node)\"\n (mouseleave)=\"dragHoverEnd($event, node)\"\n (cdkDragStarted)=\"dragStart()\"\n (cdkDragReleased)=\"dragEnd()\"\n >\n <div class=\"outlineItem\">\n <a (click)=\"goToBookmark(node)\">\n {{ node.name }}\n </a>\n </div>\n <button\n class=\"bookmark__rename\"\n (click)=\"editBookmark(node.id)\"\n ></button>\n <button\n class=\"bookmark__delete\"\n (click)=\"deleteBookmark2(node)\"\n ></button>\n </div>\n <div class=\"node-drop-slot\"></div>\n </div>\n <ng-template #inputBookmark>\n <input\n #bookmarkName\n class=\"bookmark__input\"\n [value]=\"node.name\"\n [maxLength]=\"BOOKMARK_CHAR_LIMIT\"\n />\n <button\n class=\"bookmark__save\"\n (click)=\"updateBookmark(node, bookmarkName.value)\"\n ></button>\n </ng-template>\n </cdk-nested-tree-node>\n <!-- This is the tree node template for expandable nodes -->\n <cdk-nested-tree-node\n class=\"node-wrapper\"\n *cdkTreeNodeDef=\"let node; when: hasChild\"\n >\n <div *ngIf=\"node.id !== editableBookmark; else inputBookmark2\">\n <div\n class=\"node-content-wrapper nested-tree-node\"\n cdkDrag\n [cdkDragData]=\"node\"\n (mouseenter)=\"dragHover($event, node)\"\n (mouseleave)=\"dragHoverEnd($event, node)\"\n (cdkDragStarted)=\"dragStart()\"\n (cdkDragReleased)=\"dragEnd()\"\n >\n <div class=\"outlineItem\">\n <span\n cdkTreeNodeToggle\n class=\"toggle-children-wrapper\"\n [ngClass]=\"onNodeExpand(node)\"\n ><span class=\"toggle-children\"></span\n ></span>\n <a (click)=\"goToBookmark(node)\">\n {{ node.name }}\n </a>\n </div>\n <button\n class=\"bookmark__rename\"\n (click)=\"editBookmark(node.id)\"\n ></button>\n <button\n class=\"bookmark__delete\"\n (click)=\"deleteBookmark2(node)\"\n ></button>\n </div>\n <div class=\"node-drop-slot\"></div>\n </div>\n <ng-template #inputBookmark2>\n <input\n #bookmarkName\n class=\"bookmark__input\"\n [value]=\"node.name\"\n [maxLength]=\"BOOKMARK_CHAR_LIMIT\"\n />\n <button\n class=\"bookmark__save\"\n (click)=\"updateBookmark(node, bookmarkName.value)\"\n ></button>\n </ng-template>\n <div class=\"nested-tree-node-children\" *ngIf=\"treeControl.isExpanded(node)\">\n <ng-container cdkTreeNodeOutlet></ng-container>\n </div>\n </cdk-nested-tree-node>\n</cdk-tree>\n", dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.CdkNestedTreeNode, selector: "cdk-nested-tree-node", inputs: ["role", "disabled", "tabIndex"], exportAs: ["cdkNestedTreeNode"] }, { kind: "directive", type: i3.CdkTreeNodeDef, selector: "[cdkTreeNodeDef]", inputs: ["cdkTreeNodeDefWhen"] }, { kind: "directive", type: i3.CdkTreeNodeToggle, selector: "[cdkTreeNodeToggle]", inputs: ["cdkTreeNodeToggleRecursive"] }, { kind: "component", type: i3.CdkTree, selector: "cdk-tree", inputs: ["dataSource", "treeControl", "trackBy"], exportAs: ["cdkTree"] }, { kind: "directive", type: i3.CdkTreeNodeOutlet, selector: "[cdkTreeNodeOutlet]" }, { kind: "directive", type: i4$3.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i4$3.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }] });
|
|
4614
4759
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: BookmarksComponent, decorators: [{
|
|
4615
4760
|
type: Component,
|
|
4616
|
-
args: [{ selector: 'mv-bookmarks', template: "<a *ngIf=\"bookmarkNodes?.length === 0\" class=\"highlightedOutlineItem\">No bookmarks created yet</a>\n<tree-
|
|
4761
|
+
args: [{ selector: 'mv-bookmarks', template: "<a *ngIf=\"bookmarkNodes?.length === 0\" class=\"highlightedOutlineItem\"\n >No bookmarks created yet</a\n>\n<cdk-tree\n cdkDropList\n class=\"bookmarks-tree\"\n *ngIf=\"datasource\"\n [dataSource]=\"datasource\"\n [treeControl]=\"treeControl\"\n (cdkDropListDropped)=\"drop($event)\"\n>\n <!-- This is the tree node template for leaf nodes -->\n <cdk-nested-tree-node class=\"node-wrapper\" *cdkTreeNodeDef=\"let node\">\n <div *ngIf=\"node.id !== editableBookmark; else inputBookmark\">\n <div\n class=\"node-content-wrapper nested-tree-node\"\n cdkDrag\n [cdkDragData]=\"node\"\n (mouseenter)=\"dragHover($event, node)\"\n (mouseleave)=\"dragHoverEnd($event, node)\"\n (cdkDragStarted)=\"dragStart()\"\n (cdkDragReleased)=\"dragEnd()\"\n >\n <div class=\"outlineItem\">\n <a (click)=\"goToBookmark(node)\">\n {{ node.name }}\n </a>\n </div>\n <button\n class=\"bookmark__rename\"\n (click)=\"editBookmark(node.id)\"\n ></button>\n <button\n class=\"bookmark__delete\"\n (click)=\"deleteBookmark2(node)\"\n ></button>\n </div>\n <div class=\"node-drop-slot\"></div>\n </div>\n <ng-template #inputBookmark>\n <input\n #bookmarkName\n class=\"bookmark__input\"\n [value]=\"node.name\"\n [maxLength]=\"BOOKMARK_CHAR_LIMIT\"\n />\n <button\n class=\"bookmark__save\"\n (click)=\"updateBookmark(node, bookmarkName.value)\"\n ></button>\n </ng-template>\n </cdk-nested-tree-node>\n <!-- This is the tree node template for expandable nodes -->\n <cdk-nested-tree-node\n class=\"node-wrapper\"\n *cdkTreeNodeDef=\"let node; when: hasChild\"\n >\n <div *ngIf=\"node.id !== editableBookmark; else inputBookmark2\">\n <div\n class=\"node-content-wrapper nested-tree-node\"\n cdkDrag\n [cdkDragData]=\"node\"\n (mouseenter)=\"dragHover($event, node)\"\n (mouseleave)=\"dragHoverEnd($event, node)\"\n (cdkDragStarted)=\"dragStart()\"\n (cdkDragReleased)=\"dragEnd()\"\n >\n <div class=\"outlineItem\">\n <span\n cdkTreeNodeToggle\n class=\"toggle-children-wrapper\"\n [ngClass]=\"onNodeExpand(node)\"\n ><span class=\"toggle-children\"></span\n ></span>\n <a (click)=\"goToBookmark(node)\">\n {{ node.name }}\n </a>\n </div>\n <button\n class=\"bookmark__rename\"\n (click)=\"editBookmark(node.id)\"\n ></button>\n <button\n class=\"bookmark__delete\"\n (click)=\"deleteBookmark2(node)\"\n ></button>\n </div>\n <div class=\"node-drop-slot\"></div>\n </div>\n <ng-template #inputBookmark2>\n <input\n #bookmarkName\n class=\"bookmark__input\"\n [value]=\"node.name\"\n [maxLength]=\"BOOKMARK_CHAR_LIMIT\"\n />\n <button\n class=\"bookmark__save\"\n (click)=\"updateBookmark(node, bookmarkName.value)\"\n ></button>\n </ng-template>\n <div class=\"nested-tree-node-children\" *ngIf=\"treeControl.isExpanded(node)\">\n <ng-container cdkTreeNodeOutlet></ng-container>\n </div>\n </cdk-nested-tree-node>\n</cdk-tree>\n" }]
|
|
4617
4762
|
}], ctorParameters: function () { return [{ type: i1.Store }]; }, propDecorators: { bookmarkNodes: [{
|
|
4618
4763
|
type: Input
|
|
4619
4764
|
}], zoom: [{
|
|
@@ -4622,9 +4767,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
4622
4767
|
type: Input
|
|
4623
4768
|
}], goToDestination: [{
|
|
4624
4769
|
type: Output
|
|
4625
|
-
}], tree: [{
|
|
4626
|
-
type: ViewChild,
|
|
4627
|
-
args: [TreeComponent]
|
|
4628
4770
|
}] } });
|
|
4629
4771
|
|
|
4630
4772
|
class OutlineItemComponent {
|
|
@@ -6685,8 +6827,9 @@ class MediaViewerModule {
|
|
|
6685
6827
|
TagInputModule,
|
|
6686
6828
|
FormsModule,
|
|
6687
6829
|
ReactiveFormsModule,
|
|
6688
|
-
RouterModule, i1.StoreFeatureModule, i1$2.EffectsFeatureModule,
|
|
6689
|
-
|
|
6830
|
+
RouterModule, i1.StoreFeatureModule, i1$2.EffectsFeatureModule, MutableDivModule,
|
|
6831
|
+
CdkTreeModule,
|
|
6832
|
+
DragDropModule, i5.RpxTranslationModule], exports: [MediaViewerComponent] });
|
|
6690
6833
|
/** @nocollapse */ MediaViewerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MediaViewerModule, providers: [
|
|
6691
6834
|
PdfJsWrapperFactory,
|
|
6692
6835
|
CommentService,
|
|
@@ -6710,8 +6853,9 @@ class MediaViewerModule {
|
|
|
6710
6853
|
RouterModule,
|
|
6711
6854
|
StoreModule.forFeature('media-viewer', reducers),
|
|
6712
6855
|
EffectsModule.forFeature(effects),
|
|
6713
|
-
TreeModule,
|
|
6714
6856
|
MutableDivModule,
|
|
6857
|
+
CdkTreeModule,
|
|
6858
|
+
DragDropModule,
|
|
6715
6859
|
RpxTranslationModule.forChild()] });
|
|
6716
6860
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: MediaViewerModule, decorators: [{
|
|
6717
6861
|
type: NgModule,
|
|
@@ -6727,8 +6871,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
6727
6871
|
RouterModule,
|
|
6728
6872
|
StoreModule.forFeature('media-viewer', reducers),
|
|
6729
6873
|
EffectsModule.forFeature(effects),
|
|
6730
|
-
TreeModule,
|
|
6731
6874
|
MutableDivModule,
|
|
6875
|
+
CdkTreeModule,
|
|
6876
|
+
DragDropModule,
|
|
6732
6877
|
RpxTranslationModule.forChild()
|
|
6733
6878
|
],
|
|
6734
6879
|
declarations: [
|