@limble/limble-tree 0.13.0 → 1.0.0-alpha.2

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.
Files changed (163) hide show
  1. package/README.md +418 -96
  2. package/esm2020/lib/components/branch/branch.component.mjs +79 -0
  3. package/esm2020/lib/components/dropzone/dropzone.component.mjs +35 -0
  4. package/esm2020/lib/components/host-component.interface.mjs +2 -0
  5. package/esm2020/lib/components/node-component.interface.mjs +2 -0
  6. package/esm2020/lib/components/root/root.component.mjs +36 -0
  7. package/esm2020/lib/core/branch-options.interface.mjs +2 -0
  8. package/esm2020/lib/core/configuration/configuration.mjs +17 -0
  9. package/esm2020/lib/core/configuration/tree-options.interface.mjs +2 -0
  10. package/esm2020/lib/core/index.mjs +6 -0
  11. package/esm2020/lib/core/relationship.interface.mjs +2 -0
  12. package/esm2020/lib/core/tree-branch/branch-controller.mjs +99 -0
  13. package/esm2020/lib/core/tree-branch/tree-branch.mjs +224 -0
  14. package/esm2020/lib/core/tree-node-base.mjs +69 -0
  15. package/esm2020/lib/core/tree-root/root-controller.mjs +42 -0
  16. package/esm2020/lib/core/tree-root/tree-root.mjs +85 -0
  17. package/esm2020/lib/core/tree-service/tree.service.mjs +19 -0
  18. package/esm2020/lib/errors/index.mjs +2 -0
  19. package/esm2020/lib/errors/tree-error.mjs +3 -0
  20. package/esm2020/lib/events/drag/drag-end-event.mjs +28 -0
  21. package/esm2020/lib/events/drag/drag-start-event.mjs +12 -0
  22. package/esm2020/lib/events/drag/drop-event.mjs +20 -0
  23. package/esm2020/lib/events/drag/index.mjs +4 -0
  24. package/esm2020/lib/events/general/destruction-event.mjs +12 -0
  25. package/esm2020/lib/events/general/index.mjs +2 -0
  26. package/esm2020/lib/events/index.mjs +4 -0
  27. package/esm2020/lib/events/relational/graft-event.mjs +24 -0
  28. package/esm2020/lib/events/relational/index.mjs +4 -0
  29. package/esm2020/lib/events/relational/prune-event.mjs +24 -0
  30. package/esm2020/lib/events/relational/relational-tree-event.interface.mjs +2 -0
  31. package/esm2020/lib/extras/collapse/collapse.mjs +33 -0
  32. package/esm2020/lib/extras/collapse/collapse.module.mjs +15 -0
  33. package/esm2020/lib/extras/collapse/collapse.service.mjs +20 -0
  34. package/esm2020/lib/extras/collapse/index.mjs +3 -0
  35. package/esm2020/lib/extras/drag-and-drop/drag-and-drop.mjs +85 -0
  36. package/esm2020/lib/extras/drag-and-drop/drag-and-drop.module.mjs +19 -0
  37. package/esm2020/lib/extras/drag-and-drop/drag-and-drop.service.mjs +28 -0
  38. package/esm2020/lib/extras/drag-and-drop/drag-state.mjs +47 -0
  39. package/esm2020/lib/extras/drag-and-drop/draggable.directive.mjs +30 -0
  40. package/esm2020/lib/extras/drag-and-drop/dragover-no-change-detect.mjs +40 -0
  41. package/esm2020/lib/extras/drag-and-drop/dropzone-renderer.mjs +178 -0
  42. package/esm2020/lib/extras/drag-and-drop/index.mjs +5 -0
  43. package/esm2020/lib/legacy/index.mjs +7 -0
  44. package/esm2020/lib/legacy/legacy-component-obj.interface.mjs +2 -0
  45. package/esm2020/lib/legacy/legacy-tree-data.interface.mjs +2 -0
  46. package/esm2020/lib/legacy/legacy-tree-options.interface.mjs +2 -0
  47. package/esm2020/lib/legacy/legacy-tree.mjs +73 -0
  48. package/esm2020/lib/legacy/limble-tree-legacy.module.mjs +20 -0
  49. package/esm2020/lib/legacy/limble-tree-root/limble-tree-root.component.mjs +78 -0
  50. package/esm2020/lib/limble-tree.module.mjs +21 -47
  51. package/esm2020/lib/structure/branchable.interface.mjs +2 -0
  52. package/esm2020/lib/structure/component-container.interface.mjs +2 -0
  53. package/esm2020/lib/structure/event-conduit.interface.mjs +2 -0
  54. package/esm2020/lib/structure/graftable.interface.mjs +2 -0
  55. package/esm2020/lib/structure/index.mjs +10 -0
  56. package/esm2020/lib/structure/tree-branch-node.interface.mjs +2 -0
  57. package/esm2020/lib/structure/tree-event.interface.mjs +2 -0
  58. package/esm2020/lib/structure/tree-node.interface.mjs +2 -0
  59. package/esm2020/lib/structure/tree-plot.mjs +2 -0
  60. package/esm2020/lib/structure/tree-relationship.interface.mjs +2 -0
  61. package/esm2020/limble-limble-tree.mjs +4 -4
  62. package/esm2020/public-api.mjs +12 -6
  63. package/esm2020/shared/assert.mjs +7 -0
  64. package/fesm2015/limble-limble-tree.mjs +1404 -2226
  65. package/fesm2015/limble-limble-tree.mjs.map +1 -1
  66. package/fesm2020/limble-limble-tree.mjs +1396 -2132
  67. package/fesm2020/limble-limble-tree.mjs.map +1 -1
  68. package/index.d.ts +5 -5
  69. package/lib/components/branch/branch.component.d.ts +26 -0
  70. package/lib/components/dropzone/dropzone.component.d.ts +13 -0
  71. package/lib/components/host-component.interface.d.ts +6 -0
  72. package/lib/components/node-component.interface.d.ts +5 -0
  73. package/lib/components/root/root.component.d.ts +14 -0
  74. package/lib/core/branch-options.interface.d.ts +14 -0
  75. package/lib/core/configuration/configuration.d.ts +11 -0
  76. package/lib/core/configuration/tree-options.interface.d.ts +32 -0
  77. package/lib/core/index.d.ts +5 -0
  78. package/lib/core/relationship.interface.d.ts +5 -0
  79. package/lib/core/tree-branch/branch-controller.d.ts +25 -0
  80. package/lib/core/tree-branch/tree-branch.d.ts +44 -0
  81. package/lib/core/tree-node-base.d.ts +25 -0
  82. package/lib/core/tree-root/root-controller.d.ts +19 -0
  83. package/lib/core/tree-root/tree-root.d.ts +30 -0
  84. package/lib/core/tree-service/tree.service.d.ts +9 -0
  85. package/lib/errors/index.d.ts +1 -0
  86. package/lib/errors/tree-error.d.ts +2 -0
  87. package/lib/events/drag/drag-end-event.d.ts +24 -0
  88. package/lib/events/drag/drag-start-event.d.ts +8 -0
  89. package/lib/events/drag/drop-event.d.ts +13 -0
  90. package/lib/events/drag/index.d.ts +3 -0
  91. package/lib/events/general/destruction-event.d.ts +8 -0
  92. package/lib/events/general/index.d.ts +1 -0
  93. package/lib/events/index.d.ts +3 -0
  94. package/lib/events/relational/graft-event.d.ts +15 -0
  95. package/lib/events/relational/index.d.ts +3 -0
  96. package/lib/events/relational/prune-event.d.ts +15 -0
  97. package/lib/events/relational/relational-tree-event.interface.d.ts +6 -0
  98. package/lib/extras/collapse/collapse.d.ts +11 -0
  99. package/lib/extras/collapse/collapse.module.d.ts +6 -0
  100. package/lib/extras/collapse/collapse.service.d.ts +9 -0
  101. package/lib/extras/collapse/index.d.ts +2 -0
  102. package/lib/extras/drag-and-drop/drag-and-drop.d.ts +16 -0
  103. package/lib/extras/drag-and-drop/drag-and-drop.module.d.ts +8 -0
  104. package/lib/extras/drag-and-drop/drag-and-drop.service.d.ts +16 -0
  105. package/lib/extras/drag-and-drop/drag-state.d.ts +23 -0
  106. package/lib/extras/drag-and-drop/draggable.directive.d.ts +12 -0
  107. package/lib/{custom-event-bindings/dragover-no-change-detect.directive.d.ts → extras/drag-and-drop/dragover-no-change-detect.d.ts} +14 -14
  108. package/lib/extras/drag-and-drop/dropzone-renderer.d.ts +28 -0
  109. package/lib/extras/drag-and-drop/index.d.ts +4 -0
  110. package/lib/legacy/index.d.ts +6 -0
  111. package/lib/legacy/legacy-component-obj.interface.d.ts +13 -0
  112. package/lib/legacy/legacy-tree-data.interface.d.ts +18 -0
  113. package/lib/legacy/legacy-tree-options.interface.d.ts +34 -0
  114. package/lib/legacy/legacy-tree.d.ts +14 -0
  115. package/lib/legacy/limble-tree-legacy.module.d.ts +8 -0
  116. package/lib/legacy/limble-tree-root/limble-tree-root.component.d.ts +28 -0
  117. package/lib/limble-tree.module.d.ts +9 -14
  118. package/lib/structure/branchable.interface.d.ts +4 -0
  119. package/lib/structure/component-container.interface.d.ts +8 -0
  120. package/lib/structure/event-conduit.interface.d.ts +6 -0
  121. package/lib/structure/graftable.interface.d.ts +6 -0
  122. package/lib/structure/index.d.ts +9 -0
  123. package/lib/structure/tree-branch-node.interface.d.ts +5 -0
  124. package/lib/structure/tree-event.interface.d.ts +5 -0
  125. package/lib/structure/tree-node.interface.d.ts +11 -0
  126. package/lib/structure/tree-plot.d.ts +1 -0
  127. package/lib/structure/tree-relationship.interface.d.ts +7 -0
  128. package/package.json +6 -14
  129. package/public-api.d.ts +8 -3
  130. package/shared/assert.d.ts +1 -0
  131. package/esm2020/lib/classes/Branch.mjs +0 -153
  132. package/esm2020/lib/classes/DropZone.mjs +0 -71
  133. package/esm2020/lib/classes/DropZoneLocation.mjs +0 -16
  134. package/esm2020/lib/custom-event-bindings/dragleave-no-change-detect.directive.mjs +0 -33
  135. package/esm2020/lib/custom-event-bindings/dragover-no-change-detect.directive.mjs +0 -39
  136. package/esm2020/lib/drop-zone/drop-zone.component.mjs +0 -75
  137. package/esm2020/lib/limble-tree-branch/limble-tree-branch.component.mjs +0 -110
  138. package/esm2020/lib/limble-tree-node/limble-tree-node.component.mjs +0 -467
  139. package/esm2020/lib/limble-tree-placeholder/limble-tree-placeholder.component.mjs +0 -70
  140. package/esm2020/lib/limble-tree-root/drop-zone.service.mjs +0 -376
  141. package/esm2020/lib/limble-tree-root/limble-tree-root.component.mjs +0 -172
  142. package/esm2020/lib/limble-tree-root/tree-construction-status.service.mjs +0 -33
  143. package/esm2020/lib/limble-tree-root/tree.service.mjs +0 -297
  144. package/esm2020/lib/singletons/component-creator.service.mjs +0 -19
  145. package/esm2020/lib/singletons/drag-state.service.mjs +0 -63
  146. package/esm2020/lib/singletons/global-events.service.mjs +0 -136
  147. package/esm2020/lib/util.mjs +0 -74
  148. package/lib/classes/Branch.d.ts +0 -26
  149. package/lib/classes/DropZone.d.ts +0 -27
  150. package/lib/classes/DropZoneLocation.d.ts +0 -9
  151. package/lib/custom-event-bindings/dragleave-no-change-detect.directive.d.ts +0 -13
  152. package/lib/drop-zone/drop-zone.component.d.ts +0 -18
  153. package/lib/limble-tree-branch/limble-tree-branch.component.d.ts +0 -28
  154. package/lib/limble-tree-node/limble-tree-node.component.d.ts +0 -53
  155. package/lib/limble-tree-placeholder/limble-tree-placeholder.component.d.ts +0 -21
  156. package/lib/limble-tree-root/drop-zone.service.d.ts +0 -62
  157. package/lib/limble-tree-root/limble-tree-root.component.d.ts +0 -37
  158. package/lib/limble-tree-root/tree-construction-status.service.d.ts +0 -15
  159. package/lib/limble-tree-root/tree.service.d.ts +0 -132
  160. package/lib/singletons/component-creator.service.d.ts +0 -9
  161. package/lib/singletons/drag-state.service.d.ts +0 -35
  162. package/lib/singletons/global-events.service.d.ts +0 -13
  163. package/lib/util.d.ts +0 -13
@@ -1 +1 @@
1
- {"version":3,"file":"limble-limble-tree.mjs","sources":["../../../projects/limble-tree/src/lib/util.ts","../../../projects/limble-tree/src/lib/classes/DropZoneLocation.ts","../../../projects/limble-tree/src/lib/classes/DropZone.ts","../../../projects/limble-tree/src/lib/singletons/drag-state.service.ts","../../../projects/limble-tree/src/lib/limble-tree-root/tree-construction-status.service.ts","../../../projects/limble-tree/src/lib/limble-tree-root/drop-zone.service.ts","../../../projects/limble-tree/src/lib/classes/Branch.ts","../../../projects/limble-tree/src/lib/drop-zone/drop-zone.component.html","../../../projects/limble-tree/src/lib/drop-zone/drop-zone.component.ts","../../../projects/limble-tree/src/lib/limble-tree-branch/limble-tree-branch.component.html","../../../projects/limble-tree/src/lib/limble-tree-branch/limble-tree-branch.component.ts","../../../projects/limble-tree/src/lib/singletons/component-creator.service.ts","../../../projects/limble-tree/src/lib/singletons/global-events.service.ts","../../../projects/limble-tree/src/lib/limble-tree-node/limble-tree-node.component.html","../../../projects/limble-tree/src/lib/limble-tree-node/limble-tree-node.component.ts","../../../projects/limble-tree/src/lib/limble-tree-root/tree.service.ts","../../../projects/limble-tree/src/lib/custom-event-bindings/dragover-no-change-detect.directive.ts","../../../projects/limble-tree/src/lib/limble-tree-placeholder/limble-tree-placeholder.component.ts","../../../projects/limble-tree/src/lib/limble-tree-placeholder/limble-tree-placeholder.component.html","../../../projects/limble-tree/src/lib/custom-event-bindings/dragleave-no-change-detect.directive.ts","../../../projects/limble-tree/src/lib/limble-tree-root/limble-tree-root.component.html","../../../projects/limble-tree/src/lib/limble-tree-root/limble-tree-root.component.ts","../../../projects/limble-tree/src/lib/limble-tree.module.ts","../../../projects/limble-tree/src/public-api.ts","../../../projects/limble-tree/src/limble-limble-tree.ts"],"sourcesContent":["import type {\n LimbleTreeNode,\n ProcessedOptions\n} from \"./limble-tree-root/tree.service\";\n\nexport function arraysAreEqual(\n array1: Array<unknown>,\n array2: Array<unknown>\n): boolean {\n if (array1.length !== array2.length) {\n return false;\n }\n for (const [index, value1] of array1.entries()) {\n const value2 = array2[index];\n if (value1 instanceof Array && value2 instanceof Array) {\n if (!arraysAreEqual(value1, value2)) {\n return false;\n }\n } else if (value1 !== value2) {\n return false;\n }\n }\n return true;\n}\n\nexport function isElementDescendant(\n potentialAncestor: Node,\n potentialDescendant: Node\n): boolean | undefined {\n if (potentialAncestor === potentialDescendant) {\n return true;\n }\n let cursor = potentialDescendant.parentNode;\n while (cursor !== document) {\n if (cursor === null) {\n //Did not reach `document` or ancestor. potentialDescendant is not part of the DOM.\n return undefined;\n }\n if (cursor === potentialAncestor) {\n return true;\n }\n cursor = cursor.parentNode;\n }\n return false;\n}\n\nexport function isNestingAllowed(\n options?: ProcessedOptions,\n nodeData?: LimbleTreeNode\n): boolean {\n return (\n options !== undefined &&\n (options.allowNesting === true ||\n (typeof options.allowNesting === \"function\" &&\n nodeData !== undefined &&\n options.allowNesting(nodeData) === true))\n );\n}\n\nexport function isDraggingAllowed(\n options?: ProcessedOptions,\n nodeData?: LimbleTreeNode\n): boolean {\n return (\n options !== undefined &&\n (options.allowDragging === true ||\n (typeof options.allowDragging === \"function\" &&\n nodeData !== undefined &&\n options.allowDragging(nodeData) === true))\n );\n}\n\nexport function isFirefox(): boolean {\n return navigator.userAgent.includes(\"Firefox\");\n}\n\n/** Because drop zones can disappear when the mouse moves, sometimes\n * moving the mouse just a little bit inside the tree causes the tree to\n * shrink such that the mouse is no longer over the tree. In this case,\n * a dragleave event may not fire, and we can't clear the drop zones. This\n * function is used to catch this edge case.\n */\nexport function suddenTreeExit(event: DragEvent): boolean {\n if (event.target === null || !(event.target instanceof Element)) {\n throw new Error(\"failed to get event target element\");\n }\n const treeEventHost = event.target.closest(\".tree-event-host\");\n if (treeEventHost === null) {\n console.log(event.target);\n throw new Error(\"failed to find treeEventHost\");\n }\n const rect = treeEventHost.getBoundingClientRect();\n const clientY = event.clientY;\n if (clientY > rect.bottom || clientY < rect.top) {\n return true;\n }\n return false;\n}\n","import { BranchCoordinates } from \"./Branch\";\n\nexport class DropZoneLocation {\n public parentCoordinates: BranchCoordinates;\n public insertIndex: number;\n\n constructor(parentCoordinates: BranchCoordinates, insertIndex: number) {\n this.parentCoordinates = parentCoordinates;\n this.insertIndex = insertIndex;\n }\n\n public getFullInsertCoordinates() {\n return [...this.parentCoordinates, this.insertIndex];\n }\n\n public setParentCoordinates(coordinates: BranchCoordinates) {\n this.parentCoordinates = coordinates;\n }\n\n public setInsertIndex(index: number) {\n this.insertIndex = index;\n }\n}\n","import { BranchCoordinates } from \"./Branch\";\nimport { DropZoneFamily } from \"../limble-tree-root/drop-zone.service\";\nimport { arraysAreEqual } from \"../util\";\nimport { Subject } from \"rxjs\";\nimport { DropZoneLocation } from \"./DropZoneLocation\";\nimport { ViewContainerRef } from \"@angular/core\";\n\nexport type CommMessage = \"checkActive\" | \"checkVisible\" | \"checkRendered\";\n\nexport class DropZone {\n public static dropZoneLocationsAreEqual(\n valueA: DropZone | DropZoneLocation,\n valueB: DropZone | DropZoneLocation\n ) {\n return arraysAreEqual(\n valueA.getFullInsertCoordinates(),\n valueB.getFullInsertCoordinates()\n );\n }\n\n private host: ViewContainerRef | undefined;\n private readonly location: DropZoneLocation;\n private visible: boolean;\n private active: boolean;\n private rendered: boolean;\n private family: DropZoneFamily | undefined;\n private readonly commChannel: Subject<CommMessage>;\n\n public constructor(\n parentCoordinates: BranchCoordinates,\n insertIndex: number\n ) {\n this.location = new DropZoneLocation(parentCoordinates, insertIndex);\n this.rendered = false;\n this.visible = false;\n this.active = false;\n this.commChannel = new Subject();\n }\n\n public isRendered(\n set: boolean | undefined = undefined\n ): DropZone[\"rendered\"] {\n if (set !== undefined) {\n this.rendered = set;\n if (this.commChannel !== undefined) {\n this.commChannel.next(\"checkRendered\");\n }\n if (this.rendered === false) {\n this.isVisible(false);\n }\n }\n return this.rendered;\n }\n\n public isVisible(set: boolean | undefined = undefined): DropZone[\"visible\"] {\n if (set !== undefined) {\n this.visible = set;\n if (this.commChannel !== undefined) {\n this.commChannel.next(\"checkVisible\");\n }\n if (this.visible === false) {\n this.isActive(false);\n }\n }\n return this.visible;\n }\n\n public isActive(set: boolean | undefined = undefined): DropZone[\"active\"] {\n if (set !== undefined) {\n this.active = set;\n if (this.commChannel !== undefined) {\n this.commChannel.next(\"checkActive\");\n }\n }\n return this.active;\n }\n\n public getLocation(): DropZone[\"location\"] {\n return this.location;\n }\n\n public getFamily(): DropZone[\"family\"] {\n return this.family;\n }\n\n public setFamily(family: DropZoneFamily): void {\n this.family = family;\n }\n\n public getCommChannel(): Subject<CommMessage> {\n return this.commChannel;\n }\n\n public getFullInsertCoordinates() {\n return this.location.getFullInsertCoordinates();\n }\n\n public setHost(host: ViewContainerRef | undefined) {\n this.host = host;\n return this.host;\n }\n\n public getHost() {\n return this.host;\n }\n}\n","import { Injectable, ViewContainerRef } from \"@angular/core\";\nimport { BehaviorSubject } from \"rxjs\";\nimport type { Branch } from \"../classes/Branch\";\n\nexport type DragState = \"idle\" | \"dragging\" | \"droppable\" | \"captured\";\n\ninterface TempData {\n branch: Branch<any>;\n parentContainer: ViewContainerRef;\n}\n\n@Injectable()\nexport class DragStateService {\n /** pushes the new state whenever the state changes */\n public state$: BehaviorSubject<DragState>;\n\n /** holds data about the thing being dragged */\n private _tempData: TempData | undefined;\n\n /** the current state of the drag process */\n private state: DragState;\n\n constructor() {\n this.state = \"idle\";\n this.state$ = new BehaviorSubject<DragState>(this.state);\n }\n\n /** Called to indicate that something is being dragged. Stores that something for later. */\n public dragging(branch: Branch<any>, parentContainer: ViewContainerRef) {\n this._tempData = {\n branch: branch,\n parentContainer: parentContainer\n };\n this.state = \"dragging\";\n this.state$.next(this.state);\n }\n\n /** Called to indicate that there is a valid active drop zone. Drop is now possible. */\n public droppable() {\n if (this.state !== \"dragging\") {\n throw new Error(\"Can only call `droppable` when state is `dragging`\");\n }\n this.state = \"droppable\";\n this.state$.next(this.state);\n }\n\n /** Called to indicate that there is no longer a valid active drop zone. Drop is no longer possible. */\n public notDroppable() {\n if (this.state !== \"droppable\") {\n throw new Error(\n \"Can only call `notDroppable` when state is `droppable`\"\n );\n }\n this.state = \"dragging\";\n this.state$.next(this.state);\n }\n\n /** Called to indicate that a drop into a valid drop zone has occurred. Returns the item that was dropped. */\n public capture() {\n if (this.state !== \"droppable\") {\n throw new Error(\n \"Can only move to `captured` state from `droppable` state\"\n );\n }\n this.state = \"captured\";\n this.state$.next(this.state);\n return this._tempData?.branch;\n }\n\n /** Called to reset the service for future drags */\n public release() {\n this._tempData = undefined;\n this.state = \"idle\";\n this.state$.next(this.state);\n }\n\n /** gets the current thing being dragged, if any. */\n public getData() {\n return this._tempData;\n }\n\n /** gets the current state */\n public getState() {\n return this.state;\n }\n}\n","import { Injectable } from \"@angular/core\";\nimport { BehaviorSubject } from \"rxjs\";\n\n@Injectable()\nexport class TreeConstructionStatus {\n private beingBuilt: number;\n private isReady: boolean;\n public readonly stable$: BehaviorSubject<boolean>;\n\n public constructor() {\n this.beingBuilt = 0;\n this.isReady = false;\n this.stable$ = new BehaviorSubject(this.treeIsStable());\n }\n\n public constructing(): void {\n this.beingBuilt++;\n this.emit();\n }\n\n public doneConstructing(): void {\n this.beingBuilt--;\n this.emit();\n }\n\n public treeIsStable(): boolean {\n return this.isReady === true && this.beingBuilt === 0;\n }\n\n public ready(val: boolean): void {\n this.isReady = val;\n }\n\n public emit(): void {\n this.stable$.next(this.treeIsStable());\n }\n}\n","import { Injectable } from \"@angular/core\";\nimport { Branch, BranchCoordinates } from \"../classes/Branch\";\nimport { DragStateService } from \"../singletons/drag-state.service\";\nimport type { LimbleTreeNode, ProcessedOptions } from \"./tree.service\";\nimport { arraysAreEqual, isNestingAllowed } from \"../util\";\nimport { DropZone } from \"../classes/DropZone\";\nimport { DropZoneLocation } from \"../classes/DropZoneLocation\";\nimport { Subject } from \"rxjs\";\nimport { TreeConstructionStatus } from \"./tree-construction-status.service\";\nimport { debounce, filter, tap } from \"rxjs/operators\";\n\nexport interface DropZoneFamily {\n /** The deepest member of the family */\n founder: DropZone;\n /** All the drop zones that belong to this family */\n members: Array<DropZone>;\n}\n\nfunction sortFamily(memberA: DropZone, memberB: DropZone) {\n const aCoordinates = memberA.getFullInsertCoordinates();\n const bCoordinates = memberB.getFullInsertCoordinates();\n if (aCoordinates.length > bCoordinates.length) {\n return -1;\n }\n if (aCoordinates.length < bCoordinates.length) {\n return 1;\n }\n return 0;\n}\n\n@Injectable()\nexport class DropZoneService {\n private readonly dropZoneArchive: Set<DropZone>;\n private readonly dropZoneInventory: Array<DropZone>;\n private readonly dropZoneFamilies: Array<DropZoneFamily>;\n private visibleFamily: DropZoneFamily | null;\n private activeDropZone: DropZone | null;\n private tree: Branch<any> | undefined;\n private treeOptions: ProcessedOptions | undefined;\n private tempFamilies:\n | readonly [DropZoneFamily, DropZoneFamily | null]\n | readonly [];\n private readonly update$: Subject<null>;\n\n constructor(\n private readonly dragStateService: DragStateService,\n treeConstructionStatus: TreeConstructionStatus\n ) {\n this.dropZoneArchive = new Set();\n this.dropZoneInventory = [];\n this.dropZoneFamilies = [];\n this.visibleFamily = null;\n this.activeDropZone = null;\n this.tempFamilies = [];\n this.setActiveDropZone(null);\n let treeIsStable = false;\n const treeIsStable$ = treeConstructionStatus.stable$.pipe(\n tap((value) => {\n treeIsStable = value;\n }),\n filter((value) => value === true)\n );\n this.update$ = new Subject();\n this.update$\n .pipe(\n debounce(() => {\n if (treeIsStable === true) {\n //If tree is stable, continue right away\n return Promise.resolve();\n }\n //If tree is not stable, wait for it to become so.\n return treeIsStable$;\n })\n )\n .subscribe(() => {\n setTimeout(() => {\n this.updateDropZones();\n });\n });\n }\n\n public addDropZone(newDropZone: DropZone): void {\n this.dropZoneArchive.add(newDropZone);\n }\n\n /** hides all drop zones */\n public clearVisibleZones(): void {\n if (this.visibleFamily !== null) {\n for (const member of this.visibleFamily.members) {\n member.isVisible(false);\n }\n this.visibleFamily = null;\n }\n this.setActiveDropZone(null);\n }\n\n public getActiveDropZone(): DropZoneService[\"activeDropZone\"] {\n return this.activeDropZone;\n }\n\n public getDropZone(coordinates: BranchCoordinates): DropZone | undefined {\n const parent = [...coordinates];\n parent.pop();\n const index = coordinates[coordinates.length - 1];\n const location = new DropZoneLocation(parent, index);\n return this.dropZoneInventory.find((dropZone) =>\n DropZone.dropZoneLocationsAreEqual(dropZone, location)\n );\n }\n\n public init(tree: Branch<any>, treeOptions: ProcessedOptions): void {\n this.tree = tree;\n this.treeOptions = treeOptions;\n this.update();\n }\n\n public removeDropZone(dropZone: DropZone) {\n this.dropZoneArchive.delete(dropZone);\n }\n\n /** hides all drop zones, deletes all the family assignments,\n * and empties the dropZoneInventory\n */\n public reset(): void {\n this.clearVisibleZones();\n this.dropZoneFamilies.length = 0;\n this.dropZoneInventory.length = 0;\n }\n\n /**\n * Restores the service to its initial state: hides all drop zones,\n * deletes all the family assignments, and empties the dropZoneInventory\n * and dropZoneArchive.\n */\n public restart(): void {\n this.reset();\n this.dropZoneArchive.clear();\n }\n\n public restoreFamilies(): void {\n if (this.tempFamilies.length === 2) {\n this.dropZoneFamilies.pop();\n this.dropZoneFamilies.push(this.tempFamilies[0]);\n for (const member of this.tempFamilies[0].members) {\n member.setFamily(this.tempFamilies[0]);\n }\n if (this.tempFamilies[1] !== null) {\n this.dropZoneFamilies.push(this.tempFamilies[1]);\n for (const member of this.tempFamilies[1].members) {\n member.setFamily(this.tempFamilies[1]);\n }\n }\n this.tempFamilies = [];\n }\n }\n\n /**\n * Shows the drop zone family of the drop zone indicated by `coordinates`.\n */\n public showDropZoneFamily(\n /** Note: this drop zone may not exist in the dropZoneInventory; we have to search the inventory based on its location */\n dropZone: DropZone,\n options: {\n joinFamilies?: boolean;\n activateLowestInsteadOfFounder?: boolean;\n } = { joinFamilies: false, activateLowestInsteadOfFounder: false }\n ): void {\n if (\n this.activeDropZone !== null &&\n DropZone.dropZoneLocationsAreEqual(this.activeDropZone, dropZone)\n ) {\n //Already showing the family with the appropriate active drop zone\n return;\n }\n if (this.visibleFamily !== null || this.activeDropZone !== null) {\n this.clearVisibleZones();\n }\n const target = this.dropZoneInventory.find((zone) =>\n DropZone.dropZoneLocationsAreEqual(zone, dropZone)\n );\n if (target === undefined) {\n throw new Error(\n `Could not find drop zone to show. location: ${JSON.stringify(\n dropZone.getLocation()\n )}`\n );\n }\n const family = target.getFamily();\n if (options.joinFamilies === true) {\n const location1 = dropZone.getLocation();\n const location2 = new DropZoneLocation(\n [...location1.parentCoordinates],\n location1.insertIndex + 1\n );\n const target2 = this.dropZoneInventory.find((zone) =>\n DropZone.dropZoneLocationsAreEqual(zone, location2)\n );\n if (target2 === undefined) {\n throw new Error(\"Could not find drop zone to show\");\n }\n const family2 = target2.getFamily();\n if (family === undefined || family2 === undefined) {\n throw new Error(\"No family\");\n }\n const newFamily = {\n founder: family.founder,\n members: [...family.members]\n };\n this.showDropZone(family.founder, true);\n for (const member of family.members.sort(sortFamily)) {\n member.setFamily(newFamily);\n if (member !== family.founder) {\n if (this.activeDropZone === null) {\n //Failed to activate a zone so far, so activate this one instead\n this.showDropZone(member, true);\n } else {\n this.showDropZone(member);\n }\n }\n }\n for (const member of family2.members) {\n member.setFamily(newFamily);\n if (\n member.getLocation().parentCoordinates.length <\n target2.getLocation().parentCoordinates.length\n ) {\n newFamily.members.push(member);\n this.showDropZone(member);\n }\n }\n //Temporarily store the old families\n this.tempFamilies = [family, family2];\n //Remove the old families\n const familyIndex = this.dropZoneFamilies.indexOf(family);\n this.dropZoneFamilies.splice(familyIndex, 1);\n const family2Index = this.dropZoneFamilies.indexOf(family2);\n this.dropZoneFamilies.splice(family2Index, 1);\n //Add the new family\n this.dropZoneFamilies.push(newFamily);\n this.visibleFamily = newFamily;\n } else {\n if (family === undefined) {\n throw new Error(\"No family\");\n }\n this.visibleFamily = family;\n this.showDropZone(family.founder, true);\n if (family.members.length > 1) {\n for (const member of family.members.sort(sortFamily)) {\n if (member !== family.founder) {\n if (this.activeDropZone === null) {\n //Failed to activate a zone so far, so activate this one instead\n this.showDropZone(member, true);\n } else {\n this.showDropZone(member);\n }\n }\n }\n }\n }\n if (\n options.activateLowestInsteadOfFounder === true &&\n this.visibleFamily.members.length > 1\n ) {\n const lowestMember = [...this.visibleFamily.members]\n .sort(sortFamily)\n .pop();\n if (lowestMember === undefined) {\n throw new Error(\"Could not get lowest member\");\n }\n this.swapActiveDropZone(lowestMember);\n }\n }\n\n public swapActiveDropZone(newActiveDropZone: DropZone): void {\n if (this.visibleFamily === null) {\n throw new Error(\"No visible family available for swapping\");\n }\n const index = this.visibleFamily.members.findIndex(\n (dropZone) => dropZone === newActiveDropZone\n );\n if (index === -1) {\n throw new Error(\"failed to swap active drop zone\");\n }\n this.setActiveDropZone(newActiveDropZone);\n }\n\n public update(): void {\n this.update$.next(null);\n }\n\n private assignFamilies(): void {\n const orphanZones = [...this.dropZoneInventory];\n const deepestMembers = orphanZones\n .filter((zone) => {\n const location = zone.getLocation();\n return (\n location.insertIndex === 0 &&\n location.parentCoordinates.length > 0\n );\n })\n .sort((valueA, valueB) => {\n const aCoordinates = valueA.getFullInsertCoordinates();\n const bCoordinates = valueB.getFullInsertCoordinates();\n const length = Math.max(aCoordinates.length, bCoordinates.length);\n for (let index = 0; index < length; index++) {\n if ((aCoordinates[index] ?? -1) > (bCoordinates[index] ?? -1)) {\n return -1;\n } else if (\n (aCoordinates[index] ?? -1) < (bCoordinates[index] ?? -1)\n ) {\n return 1;\n }\n }\n return 0;\n });\n for (const dropZone of deepestMembers) {\n if (!orphanZones.includes(dropZone)) {\n continue;\n }\n const family: DropZoneFamily = {\n founder: dropZone,\n members: []\n };\n dropZone.setFamily(family);\n //See if there are any orphans that belong to this family and claim them.\n const cursor = [...dropZone.getFullInsertCoordinates()];\n while (cursor.length > 0) {\n const familyMemberIndex = orphanZones.findIndex((zone) =>\n arraysAreEqual(zone.getFullInsertCoordinates(), cursor)\n );\n if (familyMemberIndex !== -1) {\n const familyMember = orphanZones.splice(familyMemberIndex, 1)[0];\n family.members.push(familyMember);\n familyMember.setFamily(family);\n }\n cursor.pop();\n cursor[cursor.length - 1]++;\n }\n this.dropZoneFamilies.push(family);\n }\n for (const dropZone of orphanZones.filter(\n (zone) => zone.getFullInsertCoordinates().length === 1\n )) {\n const family: DropZoneFamily = {\n founder: dropZone,\n members: [dropZone]\n };\n dropZone.setFamily(family);\n this.dropZoneFamilies.push(family);\n orphanZones.splice(orphanZones.indexOf(dropZone), 1);\n }\n if (orphanZones.length !== 0) {\n let orphans = \"\";\n for (const zone of orphanZones) {\n orphans += `${JSON.stringify(zone.getLocation())}, `;\n }\n orphans = orphans.slice(0, orphans.length - 2);\n throw new Error(\n `Some zones were not assigned to a family. The orphan zones have the following locations: ${orphans}`\n );\n }\n }\n\n private buildInventory() {\n //We do this funky string array because it is faster than doing direct array comparisons\n const inventoryCoordinates: Array<string> = [];\n for (const dropZone of this.dropZoneArchive) {\n const coordinates = dropZone.getFullInsertCoordinates().join(\",\");\n if (inventoryCoordinates.includes(coordinates)) {\n dropZone.isRendered(false);\n } else {\n this.dropZoneInventory.push(dropZone);\n inventoryCoordinates.push(coordinates);\n dropZone.isRendered(true);\n }\n }\n }\n\n private setActiveDropZone(dropZone: DropZone | null): void {\n if (this.activeDropZone !== null) {\n this.activeDropZone.isActive(false);\n }\n this.activeDropZone = dropZone;\n if (\n this.activeDropZone !== null &&\n this.dragStateService.getState() !== \"droppable\"\n ) {\n this.dragStateService.droppable();\n } else if (\n this.activeDropZone === null &&\n this.dragStateService.getState() === \"droppable\"\n ) {\n this.dragStateService.notDroppable();\n }\n if (this.activeDropZone !== null) {\n this.activeDropZone.isActive(true);\n }\n }\n\n private showDropZone(dropZone: DropZone, active = false): boolean {\n if (this.tree === undefined) {\n throw new Error(\"DropZoneService not initialized\");\n }\n if (!this.zoneIsAllowed(dropZone)) {\n //User settings indicate to skip this drop zone\n return false;\n }\n const parent = this.tree.findByCoordinates(\n dropZone.getLocation().parentCoordinates\n );\n if (parent === undefined) {\n throw new Error(\"Bad family member\");\n }\n dropZone.isVisible(true);\n if (active === true) {\n this.setActiveDropZone(dropZone);\n }\n return true;\n }\n\n private updateDropZones(): void {\n this.reset();\n this.buildInventory();\n this.assignFamilies();\n }\n\n private zoneIsAllowed(dropZone: DropZone): boolean {\n if (this.treeOptions === undefined || this.tree === undefined) {\n throw new Error(\"dropZoneService not initialized\");\n }\n const data = this.dragStateService.getData();\n if (data === undefined) {\n throw new Error(\"Can't get dragged node\");\n }\n const parentCoordinates = dropZone.getLocation().parentCoordinates;\n const dropZoneParent = this.tree.findByCoordinates(parentCoordinates);\n if (dropZoneParent === undefined) {\n throw new Error(\"Could not get drop zone parent\");\n }\n if (\n parentCoordinates.length > 0 &&\n !isNestingAllowed(\n this.treeOptions,\n dropZoneParent.data as LimbleTreeNode\n )\n ) {\n return false;\n }\n const dropZoneIndex = dropZone.getLocation().insertIndex;\n if (dropZoneIndex === undefined) {\n throw new Error(\"Could not get drop zone index\");\n }\n const draggedNode = data.branch;\n if (\n !this.treeOptions.allowDrop(\n draggedNode.data,\n dropZoneParent.data as LimbleTreeNode,\n dropZoneIndex\n )\n ) {\n return false;\n }\n return true;\n }\n}\n","/** An object indicating a location within a tree */\nexport type BranchCoordinates = Array<number>;\n\nexport class Branch<T> {\n public data: T;\n protected children: Array<Branch<T>>;\n protected parent: Branch<unknown> | null;\n\n public constructor(data: T) {\n this.data = data;\n this.children = [];\n this.parent = null;\n }\n\n public isRoot(): boolean {\n return this.parent === null;\n }\n\n public getParent(): Branch<unknown> | null {\n return this.parent;\n }\n\n public setParent<U>(parent: Branch<U> | null) {\n this.parent = parent;\n }\n\n public findByCoordinates(\n relativeCoordinates: BranchCoordinates\n ): Branch<unknown> | undefined {\n let cursor: Branch<T> | undefined = this;\n for (const index of relativeCoordinates.values()) {\n cursor = cursor.getChild(index);\n if (cursor === undefined) {\n return undefined;\n }\n }\n return cursor;\n }\n\n public getCoordinates(): BranchCoordinates {\n const coordinates: BranchCoordinates = [];\n let cursor: Branch<unknown> = this;\n while (cursor.parent !== null) {\n const cursorIndex = cursor.getIndex();\n if (cursorIndex === undefined || cursorIndex === null) {\n throw new Error(\"Could not get cursor index\");\n }\n coordinates.unshift(cursorIndex);\n cursor = cursor.parent;\n }\n return coordinates;\n }\n\n public getChild(index: number): Branch<T> | undefined {\n return this.children[index];\n }\n\n public getChildren(): Array<Branch<T>> {\n return this.children;\n }\n\n public clearChildren(): void {\n for (const child of this.children) {\n child.setParent(null);\n }\n this.children.length = 0;\n }\n\n public getIndex(): number | null | undefined {\n if (this.parent === null) {\n return null;\n }\n const index = this.parent.children.findIndex((branch) => branch === this);\n if (index === -1) {\n return undefined;\n }\n return index;\n }\n\n public getDescendant(\n relativeCoordinates: BranchCoordinates\n ): Branch<T> | undefined {\n let cursor: Branch<T> = this;\n for (const index of relativeCoordinates) {\n cursor = cursor.children[index];\n if (cursor === undefined) {\n return undefined;\n }\n }\n return cursor;\n }\n\n public findDescendant(\n predicate: (data: T) => boolean\n ): Branch<T> | undefined {\n if (predicate(this.data) === true) {\n return this;\n }\n if (this.children.length > 0) {\n for (const child of this.children) {\n const foundDeeper = child.findDescendant(predicate);\n if (foundDeeper !== undefined) {\n return foundDeeper;\n }\n }\n }\n return undefined;\n }\n\n public getAncestors(): Array<Branch<unknown>> {\n const result: Array<Branch<unknown>> = [];\n let cursor: Branch<unknown> = this;\n while (cursor.parent !== null) {\n result.push(cursor.parent);\n cursor = cursor.parent;\n }\n return result;\n }\n\n public appendChild(child: Branch<T>): Branch<T> {\n if (child.getParent() !== null) {\n child.remove();\n }\n child.setParent(this);\n this.children.push(child);\n return child;\n }\n\n public insertChild(child: Branch<T>, index: number): Branch<T> {\n const isOwnChild = this.children.indexOf(child);\n if (isOwnChild === -1) {\n if (child.getParent() !== null) {\n child.remove();\n }\n child.setParent(this);\n this.children.splice(index, 0, child);\n } else {\n if (index > isOwnChild) {\n //Insert first, then remove\n this.children.splice(index, 0, child);\n this.removeChild(isOwnChild);\n child.setParent(this);\n } else {\n //remove first, then insert\n child.remove();\n this.children.splice(index, 0, child);\n child.setParent(this);\n }\n }\n return child;\n }\n\n public removeChild(index: number): Branch<T> {\n const target = this.children.splice(index, 1)[0];\n target.setParent(null);\n return target;\n }\n\n public remove(): Branch<T> {\n const index = this.getIndex();\n if (this.parent === null || index === undefined || index === null) {\n throw new Error(\"can't remove root\");\n }\n return this.parent.removeChild(index) as Branch<T>;\n }\n\n public copy(): Branch<T> {\n const copy = this.copyHelper();\n copy.setParent(null);\n return copy;\n }\n\n protected copyHelper(): Branch<T> {\n const copy = new Branch(this.data);\n for (const child of this.children) {\n const newChild = copy.appendChild(child.copyHelper());\n newChild.parent = copy;\n }\n return copy;\n }\n}\n","<div class=\"dropZoneContainer\" (dragenter)=\"dragenterHandler()\" *ngIf=\"visible\">\n <div [ngClass]=\"{ active: active, related: !active }\"></div>\n</div>\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Input,\n OnDestroy,\n OnInit\n} from \"@angular/core\";\nimport { Subscription } from \"rxjs\";\nimport { DropZone } from \"../classes/DropZone\";\nimport { DropZoneService } from \"../limble-tree-root/drop-zone.service\";\n\n@Component({\n selector: \"drop-zone\",\n templateUrl: \"./drop-zone.component.html\",\n styleUrls: [\"./drop-zone.component.scss\"],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DropZoneComponent implements OnInit, OnDestroy {\n @Input() dropZone: DropZone | undefined;\n private commSubscription: Subscription | undefined;\n public visible: boolean;\n public active: boolean;\n\n constructor(\n private readonly dropZoneService: DropZoneService,\n private readonly changeDetectorRef: ChangeDetectorRef\n ) {\n this.visible = false;\n this.active = false;\n }\n\n public dragenterHandler() {\n if (this.dropZone === undefined || this.active === true) {\n return;\n }\n this.dropZoneService.swapActiveDropZone(this.dropZone);\n }\n\n public ngOnInit() {\n if (this.dropZone === undefined) {\n throw new Error(\"No drop zone object at component initialization\");\n }\n this.commSubscription = this.dropZone\n .getCommChannel()\n .subscribe((message) => {\n switch (message) {\n case \"checkVisible\": {\n this.visible = this.dropZone?.isVisible() ?? false;\n break;\n }\n case \"checkActive\": {\n this.active = this.dropZone?.isActive() ?? false;\n break;\n }\n case \"checkRendered\": {\n //Do nothing. This message is for other subscribers\n break;\n }\n default: {\n throw new Error(\"unhandled comm message\");\n }\n }\n this.changeDetectorRef.detectChanges();\n });\n }\n\n public ngOnDestroy() {\n if (this.commSubscription !== undefined) {\n this.commSubscription.unsubscribe();\n }\n }\n}\n","<div [style.marginLeft.px]=\"indent\">\n <drop-zone\n *ngIf=\"renderDropZoneInside\"\n [dropZone]=\"dropZoneInside\"\n ></drop-zone>\n <span [hidden]=\"branch && branch.data.collapsed\" class=\"limble-child-nodes\">\n <ng-template #children></ng-template>\n </span>\n</div>\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n ViewChild,\n ViewContainerRef\n} from \"@angular/core\";\nimport { TreeService } from \"../limble-tree-root/tree.service\";\nimport type { Branch } from \"../classes/Branch\";\nimport { DropZone } from \"../classes/DropZone\";\nimport { filter } from \"rxjs/operators\";\nimport { isNestingAllowed } from \"../util\";\nimport { DropZoneService } from \"../limble-tree-root/drop-zone.service\";\nimport { TreeConstructionStatus } from \"../limble-tree-root/tree-construction-status.service\";\n\n@Component({\n selector: \"limble-tree-branch\",\n templateUrl: \"./limble-tree-branch.component.html\",\n styleUrls: [\"./limble-tree-branch.component.scss\"]\n})\nexport class LimbleTreeBranchComponent\n implements AfterViewInit, OnInit, OnDestroy {\n @Input() branch: Branch<any> | undefined;\n\n @ViewChild(\"children\", { read: ViewContainerRef }) children:\n | ViewContainerRef\n | undefined;\n\n public dropZoneInside: DropZone | undefined;\n public renderDropZoneInside: boolean;\n\n public readonly indent;\n\n constructor(\n private treeService: TreeService,\n private readonly changeDetectorRef: ChangeDetectorRef,\n private readonly dropZoneService: DropZoneService,\n private readonly treeConstructionStatus: TreeConstructionStatus,\n private readonly ngZone: NgZone\n ) {\n this.treeConstructionStatus.constructing();\n this.indent = this.treeService.treeOptions?.indent;\n this.renderDropZoneInside = false;\n }\n\n public ngOnInit() {\n this.addDropZoneInside();\n this.ngZone.runOutsideAngular(() => {\n if (this.dropZoneInside === undefined) {\n throw new Error(\"drop zone inside is not defined\");\n }\n this.dropZoneInside\n .getCommChannel()\n .pipe(filter((message) => message === \"checkRendered\"))\n .subscribe(() => {\n if (\n this.dropZoneInside === undefined ||\n this.branch === undefined\n ) {\n throw new Error(\"Zones not registered\");\n }\n if (\n isNestingAllowed(\n this.treeService.treeOptions,\n this.branch.data\n )\n ) {\n this.renderDropZoneInside = this.dropZoneInside.isRendered();\n }\n });\n });\n }\n\n public ngAfterViewInit() {\n this.reRender();\n this.setDropZoneHost();\n this.treeConstructionStatus.doneConstructing();\n this.changeDetectorRef.detectChanges();\n }\n\n public ngOnDestroy() {\n if (this.dropZoneInside !== undefined) {\n this.dropZoneService.removeDropZone(this.dropZoneInside);\n }\n this.treeService.cleanupSignal$.next(true);\n }\n\n private addDropZoneInside() {\n if (this.branch === undefined) {\n throw new Error(\"failed to register drop zone inside\");\n }\n this.dropZoneInside = new DropZone([...this.branch.getCoordinates()], 0);\n this.dropZoneService.addDropZone(this.dropZoneInside);\n }\n\n public reRender() {\n if (this.children === undefined || this.branch === undefined) {\n throw new Error(\"Failed to render limble tree branch\");\n }\n this.treeService.renderBranch(this.children, this.branch);\n }\n\n private setDropZoneHost() {\n if (this.children === undefined || this.dropZoneInside === undefined) {\n throw new Error(\"Failed to add drop zone host\");\n }\n this.dropZoneInside.setHost(this.children);\n }\n}\n","import {\n ComponentFactoryResolver,\n Injectable,\n Type,\n ViewContainerRef\n} from \"@angular/core\";\n\n@Injectable()\nexport class ComponentCreatorService {\n constructor(private readonly factoryResolver: ComponentFactoryResolver) {\n this.factoryResolver = factoryResolver;\n }\n\n appendComponent<T = unknown>(\n component: Type<T>,\n viewContainerRef: ViewContainerRef,\n index: number | undefined = undefined\n ) {\n const componentFactory = this.factoryResolver.resolveComponentFactory(\n component\n );\n const componentRef = viewContainerRef.createComponent<T>(\n componentFactory,\n index\n );\n return componentRef;\n }\n}\n","import { Injectable, NgZone } from \"@angular/core\";\nimport { fromEvent, Observable, Subscription } from \"rxjs\";\nimport { filter, throttleTime } from \"rxjs/operators\";\n\nfunction getScrollParent(element: HTMLElement): HTMLElement {\n const regex = /(auto|scroll)/;\n const parents = (\n _node: HTMLElement | null,\n parentList: Array<HTMLElement>\n ): Array<HTMLElement> => {\n if (_node === null || _node.parentNode === null) {\n return parentList;\n }\n return parents(_node.parentElement, parentList.concat([_node]));\n };\n\n const style = (_node: HTMLElement, prop: string) =>\n getComputedStyle(_node, null).getPropertyValue(prop);\n const overflow = (_node: HTMLElement) =>\n style(_node, \"overflow\") +\n style(_node, \"overflow-y\") +\n style(_node, \"overflow-x\");\n const scroll = (_node: HTMLElement) => regex.test(overflow(_node));\n\n const parentList = parents(element.parentElement, []);\n for (const parent of parentList) {\n if (scroll(parent)) {\n return parent;\n }\n }\n return (\n (document.scrollingElement as HTMLElement) ?? document.documentElement\n );\n}\n\n@Injectable()\nexport class GlobalEventsService {\n private globalDrag$: Observable<DragEvent> | undefined;\n private globalDragSubscription: Subscription | undefined;\n public scrolling: boolean;\n\n constructor(private readonly ngZone: NgZone) {\n this.ngZone.runOutsideAngular(() => {\n this.globalDrag$ = fromEvent<DragEvent>(document, \"drag\");\n });\n this.scrolling = false;\n }\n\n public addScrolling() {\n this.ngZone.runOutsideAngular(() => {\n if (this.globalDragSubscription !== undefined) {\n return;\n }\n if (this.globalDrag$ === undefined) {\n throw new Error(\"Could not get observable\");\n }\n let viewPortHeight: number;\n let scrollAreaSize: number;\n let edgeTop: number;\n let edgeBottom: number;\n let isInTopScrollArea: boolean;\n let isInBottomScrollArea: boolean;\n let timer: ReturnType<typeof setTimeout>;\n let scrollableDiv: HTMLElement | null;\n let relativeY: number;\n this.globalDragSubscription = this.globalDrag$\n .pipe(\n throttleTime(25),\n filter((event) => {\n if (!event.target) {\n return false;\n }\n scrollableDiv = getScrollParent(event.target as HTMLElement);\n viewPortHeight = scrollableDiv.clientHeight;\n const viewPortWidth = scrollableDiv.clientWidth;\n let relativeX: number;\n if (\n window\n .getComputedStyle(scrollableDiv)\n .getPropertyValue(\"position\")\n .toLowerCase() === \"fixed\"\n ) {\n relativeX = event.clientX;\n relativeY = event.clientY;\n } else {\n const boundingRect = scrollableDiv.getBoundingClientRect();\n const scrollableDivAncestor = getScrollParent(\n scrollableDiv\n );\n relativeX =\n event.clientX -\n (boundingRect.left + scrollableDivAncestor.scrollLeft);\n relativeY =\n event.clientY -\n (boundingRect.top + scrollableDivAncestor.scrollTop);\n }\n if (\n relativeX < 0 ||\n relativeX > viewPortWidth ||\n relativeY < 0 ||\n relativeY > viewPortHeight\n ) {\n //Outside of scrollable div\n return false;\n }\n scrollAreaSize = Math.max(viewPortHeight * 0.1, 100);\n edgeTop = scrollAreaSize;\n edgeBottom = viewPortHeight - scrollAreaSize;\n isInTopScrollArea = relativeY < edgeTop;\n isInBottomScrollArea = relativeY > edgeBottom;\n return isInTopScrollArea || isInBottomScrollArea;\n })\n )\n .subscribe(() => {\n if (scrollableDiv === null) {\n return;\n }\n const height = scrollableDiv.scrollHeight;\n const maxScrollY = height - viewPortHeight;\n const currentScrollY = scrollableDiv.scrollTop;\n const canScrollUp = currentScrollY > 0;\n const canScrollDown = currentScrollY < maxScrollY;\n let nextScrollY: number;\n const maxStep = 75;\n if (isInTopScrollArea && canScrollUp) {\n const intensity = (edgeTop - relativeY) / scrollAreaSize;\n nextScrollY = currentScrollY - maxStep * intensity;\n } else if (isInBottomScrollArea && canScrollDown) {\n const intensity = (relativeY - edgeBottom) / scrollAreaSize;\n nextScrollY = currentScrollY + maxStep * intensity;\n } else {\n return;\n }\n nextScrollY = Math.max(0, Math.min(maxScrollY, nextScrollY));\n if (nextScrollY !== currentScrollY) {\n scrollableDiv.scrollTo({ top: nextScrollY });\n this.scrolling = true;\n clearTimeout(timer);\n timer = setTimeout(() => {\n this.scrolling = false;\n }, 100);\n }\n });\n });\n }\n\n public removeScrolling() {\n if (this.globalDragSubscription !== undefined) {\n this.globalDragSubscription.unsubscribe();\n }\n }\n}\n","<drop-zone\n *ngIf=\"renderDropZoneAbove === true\"\n [dropZone]=\"dropZoneAbove\"\n></drop-zone>\n<div\n (dragstart)=\"dragstartHandler($event)\"\n (dragend)=\"dragendHandler($event)\"\n class=\"limble-parent-container\"\n #draggableDiv\n>\n <div\n class=\"node-host-container\"\n (dragoverNoChangeDetect)=\"dragoverHandler($event)\"\n [dragoverEventThrottle]=\"10\"\n #nodeHostContainer\n >\n <ng-template #nodeHost></ng-template>\n </div>\n <limble-tree-branch\n *ngIf=\"branch !== undefined && renderInnerBranch === true\"\n [branch]=\"branch\"\n #innerBranch\n ></limble-tree-branch>\n</div>\n<drop-zone\n *ngIf=\"renderDropZoneBelow === true\"\n [dropZone]=\"dropZoneBelow\"\n></drop-zone>\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n ViewChild,\n ViewContainerRef\n} from \"@angular/core\";\nimport { ComponentCreatorService } from \"../singletons/component-creator.service\";\nimport { DropZoneService } from \"../limble-tree-root/drop-zone.service\";\nimport { DragStateService } from \"../singletons/drag-state.service\";\nimport { LimbleTreeNode, TreeService } from \"../limble-tree-root/tree.service\";\nimport { Branch, BranchCoordinates } from \"../classes/Branch\";\nimport {\n arraysAreEqual,\n isDraggingAllowed,\n isNestingAllowed,\n suddenTreeExit\n} from \"../util\";\nimport { filter, first, skip, skipUntil } from \"rxjs/operators\";\nimport { GlobalEventsService } from \"../singletons/global-events.service\";\nimport { DropZone } from \"../classes/DropZone\";\nimport { fromEvent, merge, Subscription } from \"rxjs\";\nimport { LimbleTreeBranchComponent } from \"../limble-tree-branch/limble-tree-branch.component\";\nimport { TreeConstructionStatus } from \"../limble-tree-root/tree-construction-status.service\";\n\n@Component({\n selector: \"limble-tree-node\",\n templateUrl: \"./limble-tree-node.component.html\",\n styleUrls: [\"./limble-tree-node.component.scss\"]\n})\nexport class LimbleTreeNodeComponent\n implements OnInit, AfterViewInit, OnDestroy\n{\n @Input() branch: Branch<any> | undefined;\n @ViewChild(\"nodeHost\", { read: ViewContainerRef }) private nodeHost:\n | ViewContainerRef\n | undefined;\n public dropZoneAbove: DropZone | undefined;\n public renderDropZoneAbove: boolean;\n public dropZoneBelow: DropZone | undefined;\n public renderDropZoneBelow: boolean;\n public renderInnerBranch: Boolean;\n @ViewChild(\"draggableDiv\", { read: ElementRef }) private draggableDiv:\n | ElementRef<HTMLElement>\n | undefined;\n @ViewChild(\"nodeHostContainer\", { read: ElementRef })\n private nodeHostContainer: ElementRef<HTMLElement> | undefined;\n private currentBranchCoordinates: BranchCoordinates | undefined;\n private readonly treeChangeSubscription: Subscription;\n @Input() parentHost: ViewContainerRef | undefined;\n @ViewChild(\"innerBranch\", { read: LimbleTreeBranchComponent })\n private innerBranch: LimbleTreeBranchComponent | undefined;\n\n constructor(\n private readonly componentCreatorService: ComponentCreatorService,\n private readonly changeDetectorRef: ChangeDetectorRef,\n private readonly dragStateService: DragStateService,\n private readonly dropZoneService: DropZoneService,\n private readonly treeService: TreeService,\n private readonly globalEventsService: GlobalEventsService,\n private readonly ngZone: NgZone,\n private readonly treeConstructionStatus: TreeConstructionStatus\n ) {\n this.treeConstructionStatus.constructing();\n if (\n this.treeService.treeOptions !== undefined &&\n this.treeService.treeOptions.listMode !== true\n ) {\n this.renderInnerBranch = true;\n } else {\n this.renderInnerBranch = false;\n }\n this.renderDropZoneBelow = false;\n this.renderDropZoneAbove = false;\n this.treeChangeSubscription = this.treeService.changes$\n .pipe(\n //The first one is the initial tree render, which we can ignore\n skip(1)\n )\n .subscribe(() => {\n this.treeChangeHandler();\n });\n }\n\n private treeChangeHandler() {\n if (\n this.branch !== undefined &&\n this.currentBranchCoordinates !== undefined &&\n !arraysAreEqual(\n this.branch.getCoordinates(),\n this.currentBranchCoordinates\n )\n ) {\n this.updateDropZones();\n }\n }\n\n ngOnInit() {\n if (this.treeService.treeOptions?.allowDragging === false) {\n return;\n }\n const parent = this.branch?.getParent();\n if (parent?.data !== null) {\n const parentData = parent?.data as LimbleTreeNode;\n if (!isNestingAllowed(this.treeService.treeOptions, parentData)) {\n this.renderInnerBranch = false;\n return;\n }\n }\n this.registerDropZones();\n this.currentBranchCoordinates = this.branch?.getCoordinates();\n this.ngZone.runOutsideAngular(() => {\n if (\n this.dropZoneAbove === undefined ||\n this.dropZoneBelow === undefined\n ) {\n throw new Error(\"Zones not registered\");\n }\n merge(\n this.dropZoneAbove.getCommChannel(),\n this.dropZoneBelow.getCommChannel()\n )\n .pipe(filter((message) => message === \"checkRendered\"))\n .subscribe(() => {\n if (\n this.dropZoneAbove === undefined ||\n this.dropZoneBelow === undefined ||\n this.branch === undefined\n ) {\n throw new Error(\"Zones not registered\");\n }\n this.renderDropZoneAbove = this.dropZoneAbove.isRendered();\n this.renderDropZoneBelow = this.dropZoneBelow.isRendered();\n });\n });\n }\n\n ngAfterViewInit() {\n this.renderNode();\n this.setDropZoneHosts();\n this.checkForHandle();\n this.treeConstructionStatus.doneConstructing();\n this.changeDetectorRef.detectChanges();\n }\n\n ngOnDestroy() {\n this.treeChangeSubscription.unsubscribe();\n if (this.dropZoneAbove !== undefined) {\n this.dropZoneService.removeDropZone(this.dropZoneAbove);\n }\n if (this.dropZoneBelow !== undefined) {\n this.dropZoneService.removeDropZone(this.dropZoneBelow);\n }\n this.treeService.cleanupSignal$.next(true);\n }\n\n public dragstartHandler(event: DragEvent): void {\n event.stopPropagation();\n if (\n event.dataTransfer === null ||\n this.branch === undefined ||\n this.parentHost === undefined\n ) {\n throw new Error(\"failed to run dragstartHandler\");\n }\n const draggedElement = event.target as HTMLElement;\n if (draggedElement.parentElement?.tagName !== \"LIMBLE-TREE-NODE\") {\n //Don't drag stuff that isn't part of the tree\n event.preventDefault();\n return;\n }\n event.dataTransfer.effectAllowed = \"move\";\n this.dragStateService.dragging(this.branch, this.parentHost);\n const treeElement = draggedElement.closest(\"limble-tree-root\");\n if (treeElement === null) {\n throw new Error(\"could not get root of tree\");\n }\n this.ngZone.runOutsideAngular(() => {\n //We have to use a setTimeout due to a bug in chrome: https://stackoverflow.com/a/20733870/8796651\n setTimeout(() => {\n draggedElement.classList.add(\"dragging\");\n if (\n this.treeService.treeData?.length === 1 &&\n this.branch?.getCoordinates().length === 1\n ) {\n //We are dragging the only element in the tree, so we have to use the placeholder system\n this.treeService.placeholder$.next(true);\n }\n });\n //We use this weird subscription/timeout combo in order to avoid a strange bug where the dragleave event\n //does not fire if the user drags out of the tree too quickly. This issue would make the drop zone\n //remain in the UI, potentially causing drop zones to appear in multiple trees at a time. This subscription\n //waits for the dragover event on the tree to fire before rendering any drop zones. If the dragover\n //event does not fire within a half second, we know the mouse left the tree too quickly, and we won't\n //render the drop zone at all.\n const dragSubscription = fromEvent(treeElement, \"dragover\")\n .pipe(first())\n .subscribe((dragoverEvent) => {\n dragoverEvent.stopPropagation();\n if (this.branch === undefined) {\n throw new Error(\"Could not show surrounding drop zones\");\n }\n const parent = this.branch.getParent();\n let parentData: LimbleTreeNode;\n let parentNestingAllowed = true;\n if (parent?.data !== null) {\n parentData = parent?.data as LimbleTreeNode;\n parentNestingAllowed = isNestingAllowed(\n this.treeService.treeOptions,\n parentData\n );\n }\n if (this.dropZoneAbove !== undefined && parentNestingAllowed) {\n this.dropZoneService.showDropZoneFamily(this.dropZoneAbove, {\n joinFamilies: true\n });\n }\n });\n setTimeout(() => {\n if (!dragSubscription.closed) {\n dragSubscription.unsubscribe();\n }\n }, 500);\n });\n }\n\n public dragendHandler(event?: DragEvent): void {\n event?.stopPropagation();\n if (this.draggableDiv === undefined) {\n throw new Error(\"could not get draggable div\");\n }\n this.draggableDiv.nativeElement.classList.remove(\"dragging\");\n if (this.dragStateService.getState() === \"captured\") {\n if (this.treeService.captured === false) {\n //Dropped in a different tree. Remove the one in this tree\n if (this.branch === undefined) {\n throw new Error(\"could not get branch in dragendHandler\");\n }\n this.treeService.cleanupSignal$.next(true);\n this.treeService.captured = false;\n }\n this.dragStateService.release();\n } else {\n //Wasn't dropped into a valid tree, so reset for next drag and\n //don't do anything else.\n this.dragStateService.release();\n this.dropZoneService.clearVisibleZones();\n this.dropZoneService.restoreFamilies();\n if (\n this.treeService.treeData?.length === 1 &&\n this.branch?.getCoordinates().length === 1\n ) {\n //We were dragging the only element in the tree, so we have to\n //remove the placeholder that we added in the dragstart\n this.treeService.placeholder$.next(false);\n }\n }\n }\n\n public dragoverHandler(event: DragEvent) {\n if (this.globalEventsService.scrolling === true) {\n return;\n }\n if (this.branch === undefined) {\n throw new Error(\"Can't get current branch during dragover event\");\n }\n const data = this.dragStateService.getData();\n if (data === undefined) {\n //They might be dragging something that isn't a node. Just ignore it.\n return;\n }\n const sourceBranch = data.branch;\n //If trying to drop on self, return.\n if (\n sourceBranch === this.branch ||\n this.branch.getAncestors().includes(sourceBranch)\n ) {\n return;\n }\n const target = (event.currentTarget as HTMLElement).closest(\n \".node-host-container\"\n );\n if (!(target instanceof HTMLElement)) {\n throw new Error(\"Failed to find node host container while dragging\");\n }\n let topLine: number;\n let bottomLine: number;\n if (this.innerBranch?.renderDropZoneInside === false) {\n topLine = target.offsetHeight / 2 - 6;\n bottomLine = topLine;\n } else {\n topLine = target.offsetHeight / 3 - 3; //an imaginary line 1/3 of the way down from the top of the element;\n bottomLine = topLine * 2; //an imaginary line 1/3 of the way up from the bottom of the element;\n }\n const parent = this.branch.getParent();\n let parentData: LimbleTreeNode;\n let parentNestingAllowed = true;\n if (parent?.data !== null) {\n parentData = parent?.data as LimbleTreeNode;\n parentNestingAllowed = isNestingAllowed(\n this.treeService.treeOptions,\n parentData\n );\n }\n /** The y-coordinates of the mouse in relation to the node it is hovering over */\n const offsetY = event.clientY - target.getBoundingClientRect().top;\n const activeDropZone = this.dropZoneService.getActiveDropZone();\n if (\n offsetY < topLine &&\n this.dropZoneAbove !== undefined &&\n parentNestingAllowed &&\n (activeDropZone === null ||\n !DropZone.dropZoneLocationsAreEqual(\n activeDropZone,\n this.dropZoneAbove\n ))\n ) {\n const index = this.branch.getIndex();\n if (index === undefined || index === null) {\n throw new Error(\"can't get branch index\");\n }\n this.dropZoneService.showDropZoneFamily(this.dropZoneAbove, {\n activateLowestInsteadOfFounder: true\n });\n if (suddenTreeExit(event)) {\n this.dropZoneService.clearVisibleZones();\n }\n } else if (\n offsetY < bottomLine &&\n offsetY > topLine &&\n this.innerBranch?.renderDropZoneInside === true &&\n this.innerBranch?.dropZoneInside !== undefined &&\n (activeDropZone === null ||\n !DropZone.dropZoneLocationsAreEqual(\n activeDropZone,\n this.innerBranch.dropZoneInside\n ))\n ) {\n this.dropZoneService.showDropZoneFamily(\n this.innerBranch.dropZoneInside\n );\n if (suddenTreeExit(event)) {\n this.dropZoneService.clearVisibleZones();\n }\n } else if (\n offsetY >= bottomLine &&\n this.dropZoneBelow !== undefined &&\n parentNestingAllowed &&\n (activeDropZone === null ||\n !DropZone.dropZoneLocationsAreEqual(\n activeDropZone,\n this.dropZoneBelow\n )) &&\n this.branch.getChildren().length === 0\n ) {\n const index = this.branch.getIndex();\n if (index === undefined || index === null) {\n throw new Error(\"can't get branch index\");\n }\n this.dropZoneService.showDropZoneFamily(this.dropZoneBelow);\n if (suddenTreeExit(event)) {\n this.dropZoneService.clearVisibleZones();\n }\n }\n }\n\n private renderNode() {\n if (this.nodeHost === undefined || this.branch === undefined) {\n throw new Error(\"Failed to render tree node\");\n }\n let component = this.branch.data.component;\n if (component === undefined) {\n component = this.treeService.treeOptions?.defaultComponent;\n }\n if (component === undefined) {\n throw new Error(\"limbleTree requires a component to render\");\n }\n const componentRef = this.componentCreatorService.appendComponent<any>(\n component.class,\n this.nodeHost\n );\n componentRef.instance.nodeData = this.branch.data;\n for (const binding in component.bindings) {\n componentRef.instance[binding] = component.bindings[binding];\n }\n }\n\n private registerDropZones(): void {\n this.addDropZoneAbove();\n this.addDropZoneBelow();\n }\n\n private addDropZoneAbove(): void {\n if (this.branch === undefined) {\n throw new Error(\"failed to register drop zone above\");\n }\n const parent = this.branch.getParent();\n const currentCoordinates = this.branch.getCoordinates();\n const index = currentCoordinates[currentCoordinates.length - 1];\n this.dropZoneAbove = new DropZone(\n [...(parent?.getCoordinates() ?? [])],\n index\n );\n this.dropZoneService.addDropZone(this.dropZoneAbove);\n }\n\n private addDropZoneBelow(): void {\n if (this.branch === undefined) {\n throw new Error(\"failed to register drop zone below\");\n }\n const parent = this.branch.getParent();\n const currentCoordinates = this.branch.getCoordinates();\n const index = currentCoordinates[currentCoordinates.length - 1];\n this.dropZoneBelow = new DropZone(\n [...(parent?.getCoordinates() ?? [])],\n index + 1\n );\n this.dropZoneService.addDropZone(this.dropZoneBelow);\n }\n\n private updateDropZones(): void {\n this.currentBranchCoordinates = this.branch?.getCoordinates();\n this.updateDropZoneAbove();\n this.updateDropZoneBelow();\n this.updateDropZoneInside();\n this.setDropZoneHosts();\n }\n\n private updateDropZoneAbove(): void {\n if (this.branch === undefined || this.dropZoneAbove === undefined) {\n throw new Error(\"failed to update drop zone above\");\n }\n const parent = this.branch.getParent();\n const currentCoordinates = this.branch.getCoordinates();\n const index = currentCoordinates[currentCoordinates.length - 1];\n const location = this.dropZoneAbove.getLocation();\n location.setParentCoordinates([...(parent?.getCoordinates() ?? [])]);\n location.setInsertIndex(index);\n }\n\n private updateDropZoneBelow(): void {\n if (this.branch === undefined || this.dropZoneBelow === undefined) {\n throw new Error(\"failed to update drop zone below\");\n }\n const parent = this.branch.getParent();\n const currentCoordinates = this.branch.getCoordinates();\n const index = currentCoordinates[currentCoordinates.length - 1];\n const location = this.dropZoneBelow.getLocation();\n location.setParentCoordinates([...(parent?.getCoordinates() ?? [])]);\n location.setInsertIndex(index + 1);\n }\n\n private updateDropZoneInside(): void {\n if (this.innerBranch?.dropZoneInside === undefined) {\n return;\n }\n if (this.branch === undefined) {\n throw new Error(\"failed to update drop zone inside\");\n }\n const location = this.innerBranch.dropZoneInside.getLocation();\n location.setParentCoordinates([...this.branch.getCoordinates()]);\n }\n\n private setDropZoneHosts() {\n if (\n this.dropZoneAbove === undefined ||\n this.dropZoneBelow === undefined\n ) {\n return;\n }\n this.dropZoneAbove.setHost(this.parentHost);\n this.dropZoneBelow.setHost(this.parentHost);\n }\n\n private checkForHandle(): void {\n if (\n this.nodeHostContainer === undefined ||\n this.draggableDiv === undefined\n ) {\n return;\n }\n const nodeHostContainerElement = this.nodeHostContainer.nativeElement;\n const handle = nodeHostContainerElement.querySelector(\n \".limble-tree-handle\"\n );\n const draggableDivElement = this.draggableDiv.nativeElement;\n if (!isDraggingAllowed(this.treeService.treeOptions, this.branch?.data)) {\n draggableDivElement.setAttribute(\"draggable\", \"false\");\n } else if (handle === null) {\n draggableDivElement.setAttribute(\"draggable\", \"true\");\n } else {\n handle.addEventListener(\"mousedown\", () => {\n draggableDivElement.setAttribute(\"draggable\", \"true\");\n //For some reason mouseup doesn't fire after a drag, so we use this observable sequence instead.\n const dragging = this.dragStateService.state$.pipe(\n filter((state) => state === \"dragging\"),\n first()\n );\n this.dragStateService.state$\n .pipe(\n skipUntil(dragging),\n filter((state) => state === \"idle\"),\n first()\n )\n .subscribe(() => {\n draggableDivElement.setAttribute(\"draggable\", \"false\");\n });\n });\n }\n }\n}\n","import { Injectable, Type, ViewContainerRef } from \"@angular/core\";\nimport { ComponentCreatorService } from \"../singletons/component-creator.service\";\nimport { DropZoneService } from \"./drop-zone.service\";\nimport { Branch, BranchCoordinates } from \"../classes/Branch\";\nimport { LimbleTreeNodeComponent } from \"../limble-tree-node/limble-tree-node.component\";\nimport { DragStateService } from \"../singletons/drag-state.service\";\nimport { BehaviorSubject, EMPTY, Subject } from \"rxjs\";\nimport { arraysAreEqual } from \"../util\";\nimport { debounce, debounceTime, filter, tap } from \"rxjs/operators\";\nimport { TreeConstructionStatus } from \"./tree-construction-status.service\";\n\n/** An object describing a node of the tree */\nexport interface LimbleTreeNode {\n /** A list of nodes to be rendered \"under\" this one, one level deeper in the tree. */\n nodes?: LimbleTreeData;\n // /** A custom data object that will be passed into the component as an `Input()` binding called `nodeData` */\n // data: unknown;\n /** An object that describes the component which will represent this node in the visual tree */\n component?: ComponentObj;\n collapsed?: boolean;\n [index: string]: unknown;\n}\n\n/** An object that the limble-tree-root component uses to build the tree */\nexport type LimbleTreeData = Array<LimbleTreeNode>;\n\n/** A group of settings for changing the functionality of the tree */\nexport interface LimbleTreeOptions {\n /** The component object to use if one is not specified for a particular node */\n defaultComponent?: ComponentObj;\n /** The number of pixels to indent each level of the tree. Defaults to 45 */\n indent?: number;\n /**\n * Whether to allow \"nesting\" (placing a node one level deeper than currently exists on the branch).\n * When this is a boolean, it applies to all nodes. When this is a function, the node in question\n * is passed in. Defaults to true.\n */\n allowNesting?: boolean | ((nodeData: LimbleTreeNode) => boolean);\n /**\n * Whether to allow a node to be dragged. When this is a boolean, it applies to all nodes. When this\n * is a function, the node in question is passed in. Defaults to true.\n */\n allowDragging?: boolean | ((nodeData: LimbleTreeNode) => boolean);\n /** A callback to determine whether a sourceNode can be dropped at a particular location. */\n allowDrop?: (\n sourceNode: LimbleTreeNode,\n proposedParent: LimbleTreeNode | null,\n proposedIndex: number\n ) => boolean;\n /** When set to true, list mode will enforce a flat tree structure, meaning there\n * can only be one level of the tree. `allowNesting` is automatically set to `false`\n * and any children will be deleted.\n *\n * This mode can be used when the same dynamic drag and drop functionality of\n * the tree is desired, but the tree structure itself is not necessary. This\n * also opens up the pagination API on the limble-tree-root component. See the\n * README for details on pagination.\n */\n listMode?: boolean;\n}\n\n/** An object that references the component to be rendered and its bindings */\nexport interface ComponentObj {\n /** The component class */\n class: Type<unknown>;\n /** The bindings (inputs and outputs) of the class */\n bindings?: {\n [index: string]: unknown;\n };\n}\n\n/** The default value for the `indent` option */\nexport const INDENT = 45;\n\n/** An options object with default values loaded where applicable */\nexport interface ProcessedOptionsBase extends LimbleTreeOptions {\n defaultComponent?: ComponentObj;\n indent: number;\n allowNesting: boolean | ((nodeData: LimbleTreeNode) => boolean);\n allowDragging: boolean | ((nodeData: LimbleTreeNode) => boolean);\n allowDrop: (\n sourceNode: LimbleTreeNode,\n proposedParent: LimbleTreeNode | null,\n proposedIndex: number\n ) => boolean;\n listMode: boolean;\n itemsPerPage: number | undefined;\n page: number | undefined;\n}\n\nexport interface ProcessedOptionsWithPagination extends ProcessedOptionsBase {\n listMode: true;\n itemsPerPage: number;\n page: number;\n}\n\nexport interface ProcessedOptionsWithoutPagination\n extends ProcessedOptionsBase {\n listMode: false;\n itemsPerPage: undefined;\n page: undefined;\n}\n\nexport type ProcessedOptions =\n | ProcessedOptionsWithPagination\n | ProcessedOptionsWithoutPagination;\n\n/** the value emitted from the root component after a node is dropped */\nexport interface TreeDrop {\n /** The node that was dropped */\n target: LimbleTreeNode;\n /** the target's parent before the drag and drop, or null if it was a top-level node */\n oldParent: LimbleTreeNode | null;\n /** the index of the node before the drag and drop relative to its old siblings */\n oldIndex: number;\n /** the target's parent after the drag and drop, or null if it is now a top-level node */\n newParent: LimbleTreeNode | null;\n /** the index of the node after the drag and drop relative to its new siblings */\n newIndex: number;\n}\n\n@Injectable()\nexport class TreeService {\n public readonly changes$: Subject<null>;\n public readonly drops$: Subject<TreeDrop>;\n public host: ViewContainerRef | undefined;\n public treeData: LimbleTreeData | undefined;\n /** This should never be reassigned. It is assigned in init() and no where else. We need to keep the reference from breaking. */\n private originalData: LimbleTreeData | undefined;\n public treeOptions: ProcessedOptions | undefined;\n public treeModel: Branch<any>;\n private placeholder: boolean;\n public captured: boolean;\n public readonly cleanupSignal$: Subject<boolean>;\n public placeholder$: BehaviorSubject<boolean>;\n\n constructor(\n private readonly componentCreatorService: ComponentCreatorService,\n private readonly dropZoneService: DropZoneService,\n private readonly dragStateService: DragStateService,\n private readonly treeConstructionStatus: TreeConstructionStatus\n ) {\n this.changes$ = new Subject();\n this.drops$ = new Subject();\n this.treeModel = new Branch(null);\n this.placeholder = false;\n this.captured = false;\n this.cleanupSignal$ = new Subject();\n let rebuild = false;\n let treeIsStable = false;\n const treeIsStable$ = this.treeConstructionStatus.stable$.pipe(\n tap((value) => {\n treeIsStable = value;\n }),\n filter((value) => value === true)\n );\n this.cleanupSignal$\n .pipe(\n tap((value) => {\n rebuild = value;\n }),\n debounce(() => {\n if (treeIsStable === true) {\n //If tree is stable, continue right away\n return EMPTY;\n }\n //If tree is not stable, wait for it to become so.\n return treeIsStable$;\n }),\n //We use this timed debounce to throttle chained destruction of components\n debounceTime(5)\n )\n .subscribe(() => {\n this.cleanup(rebuild);\n rebuild = false;\n });\n this.placeholder$ = new BehaviorSubject<boolean>(false);\n this.placeholder$.subscribe((value) => {\n this.placeholder = value;\n });\n }\n\n public drop(source: Branch<any>, targetCoordinates: BranchCoordinates) {\n //prep\n const sourceParent = source.getParent();\n if (sourceParent === null) {\n throw new Error(\"can't drop root of tree\");\n }\n const sourceIndex = source.getIndex();\n if (sourceIndex === undefined || sourceIndex === null) {\n throw new Error(\"Cannot move the hidden root node\");\n }\n let targetParentCoordinates: BranchCoordinates;\n let newIndex: number | undefined;\n if (this.placeholder === true) {\n targetParentCoordinates = [];\n newIndex = 0;\n } else {\n targetParentCoordinates = [...targetCoordinates];\n newIndex = targetParentCoordinates.pop();\n }\n if (newIndex === undefined) {\n throw new Error(\"target coordinates are empty\");\n }\n const targetParent = this.treeModel.getDescendant(\n targetParentCoordinates\n );\n if (targetParent === undefined) {\n throw new Error(\"could not get to target\");\n }\n const target = this.dropZoneService.getDropZone(targetCoordinates);\n const targetIndex = target?.getLocation().insertIndex;\n const targetHost = target?.getHost();\n const sourceHost = this.dragStateService.getData()?.parentContainer;\n if (this.placeholder === true) {\n this.placeholder$.next(false);\n }\n //Change the treeModel\n targetParent.insertChild(source, newIndex);\n //Prepare to update the view\n if (\n targetHost === undefined ||\n sourceHost === undefined ||\n targetIndex === undefined\n ) {\n //Hitting this means there is a bug, but not a fatal one.\n //Just render the whole tree again.\n console.warn(\n \"Could not perform a precise update. Re-rendering the entire tree instead\"\n );\n this.render();\n this.changes$.next(null);\n return;\n }\n //Update the view\n const nodesInSource = sourceHost.length;\n const componentRef = this.componentCreatorService.appendComponent(\n LimbleTreeNodeComponent,\n targetHost,\n newIndex\n );\n componentRef.instance.branch = source;\n componentRef.instance.parentHost = targetHost;\n if (\n targetIndex < sourceIndex &&\n sourceHost.length > nodesInSource &&\n arraysAreEqual(sourceParent.getCoordinates(), targetParentCoordinates)\n ) {\n sourceHost.remove(sourceIndex + 1);\n } else {\n sourceHost.remove(sourceIndex);\n }\n //Update the tree data\n this.rebuildTreeData();\n //Publish drop data\n this.drops$.next({\n target: source.data,\n oldParent: sourceParent.data as LimbleTreeNode,\n oldIndex: sourceIndex,\n newParent: targetParent.data,\n newIndex: newIndex\n });\n this.cleanupSignal$.next(false);\n }\n\n /** Initializes the service and renders the tree.\n * @param host - The ViewContainerRef into which the tree will be rendered.\n * @param data - The data array that was passed in to LimbleTreeRoot, which is\n * the users' representation of the tree\n * @param options - The options object that was passed in to LimbleTreeRoot\n */\n public init(\n host: ViewContainerRef,\n data: LimbleTreeData,\n options?: LimbleTreeOptions,\n itemsPerPage?: number,\n page?: number\n ): void {\n this.host = host;\n this.originalData = data;\n this.treeOptions = this.processOptions(options, itemsPerPage, page);\n if (this.treeOptions.listMode === true) {\n let start =\n this.treeOptions.itemsPerPage * (this.treeOptions.page - 1);\n if (isNaN(start)) {\n //This catches the case where itemsPerPage was not passed by the user,\n //causing `start` to equal infinity*0, which is NaN.\n start = 0;\n }\n const end = start + this.treeOptions.itemsPerPage;\n this.treeData = this.originalData.slice(start, end);\n } else {\n this.treeData = [...this.originalData];\n }\n this.render();\n }\n\n private cleanup(rebuild = false): void {\n if (rebuild) {\n this.rebuildTreeData();\n }\n if (this.treeData?.length === 0) {\n //We do a full render here because it isn't actually any slower\n //when there are no nodes, and it is a little more straightforward\n this.render();\n } else {\n this.changes$.next(null);\n this.dropZoneService.update();\n }\n }\n\n /** Renders the entire tree from root to leaves */\n private render() {\n if (\n this.host === undefined ||\n this.treeData === undefined ||\n this.treeOptions === undefined\n ) {\n throw new Error(\"TreeModel not initialized\");\n }\n this.treeConstructionStatus.ready(false);\n this.host.clear();\n this.dropZoneService.restart();\n this.placeholder$.next(false);\n this.treeModel = new Branch(null);\n if (this.treeData.length === 0) {\n //Tree is empty, but we have to to have something there so other trees' items can be dropped into it\n this.placeholder$.next(true);\n } else {\n for (const node of this.treeData) {\n const branch = new Branch(node);\n this.treeModel.appendChild(branch);\n }\n for (const branch of this.treeModel.getChildren()) {\n const componentRef = this.componentCreatorService.appendComponent<LimbleTreeNodeComponent>(\n LimbleTreeNodeComponent,\n this.host\n );\n componentRef.instance.branch = branch;\n componentRef.instance.parentHost = this.host;\n //The LimbleTreeNodeComponent will (indirectly) call the `renderBranch` method of this service to render\n //its own children\n }\n }\n this.treeConstructionStatus.ready(true);\n this.changes$.next(null);\n this.dropZoneService.init(this.treeModel, this.treeOptions);\n }\n\n /** Renders a branch of the tree and all of its descendants */\n public renderBranch(host: ViewContainerRef, branch: Branch<any>) {\n if (this.treeModel === undefined) {\n throw new Error(\"TreeModel not initialized\");\n }\n host.clear();\n branch.clearChildren();\n for (const node of branch.data?.nodes ?? []) {\n const newBranch = new Branch(node);\n branch.appendChild(newBranch);\n const componentRef = this.componentCreatorService.appendComponent<LimbleTreeNodeComponent>(\n LimbleTreeNodeComponent,\n host\n );\n componentRef.instance.branch = newBranch;\n componentRef.instance.parentHost = host;\n //The LimbleTreeNodeComponent will (indirectly) call the `renderBranch` method of this service to render\n //its own children\n }\n }\n\n private processOptions(\n options: LimbleTreeOptions = {},\n itemsPerPage: number = Infinity,\n page: number = 1\n ): ProcessedOptions {\n if (\n options.listMode === true &&\n options.allowNesting !== undefined &&\n options.allowNesting !== false\n ) {\n console.warn(\n \"The value of `allowNesting` will be ignored; it must be false when `listMode` is true\"\n );\n }\n const result: ProcessedOptionsBase = {\n defaultComponent: options.defaultComponent,\n indent: options.indent ?? INDENT,\n allowNesting:\n options.listMode !== true && (options.allowNesting ?? true),\n allowDragging: options.allowDragging ?? true,\n allowDrop: options.allowDrop ?? (() => true),\n listMode: options.listMode ?? false,\n itemsPerPage: options.listMode ? itemsPerPage : undefined,\n page: options.listMode ? page : undefined\n };\n return result as ProcessedOptions;\n }\n\n private rebuildTreeData(): void {\n if (\n this.originalData === undefined ||\n this.treeData === undefined ||\n this.treeOptions === undefined ||\n this.host === undefined\n ) {\n throw new Error(\"Tree data not initialized\");\n }\n this.treeData = [];\n for (const branch of this.treeModel.getChildren()) {\n this.treeData.push(this.rebuildBranch(branch));\n }\n if (\n this.treeOptions.listMode === true &&\n this.treeOptions.itemsPerPage < Infinity\n ) {\n const itemsPerPage = this.treeOptions.itemsPerPage;\n const start = itemsPerPage * (this.treeOptions.page - 1);\n this.originalData.splice(start, itemsPerPage, ...this.treeData);\n if (this.treeData.length !== itemsPerPage) {\n let action = false;\n if (\n this.treeData.length < itemsPerPage &&\n start + itemsPerPage <= this.originalData.length\n ) {\n //The current page does not have enough nodes. Add some to the view from the next page.\n const count = itemsPerPage - this.treeData.length;\n for (\n let index = itemsPerPage - 1;\n index < itemsPerPage + count - 1;\n index++\n ) {\n const branch = new Branch(this.originalData[start + index]);\n this.treeModel.appendChild(branch);\n const componentRef = this.componentCreatorService.appendComponent<LimbleTreeNodeComponent>(\n LimbleTreeNodeComponent,\n this.host\n );\n componentRef.instance.branch = branch;\n componentRef.instance.parentHost = this.host;\n }\n action = true;\n } else if (this.treeData.length > itemsPerPage) {\n //The current page has too many nodes. Remove some of them from the view.\n const count = this.treeData.length - itemsPerPage;\n for (\n let index = itemsPerPage + count - 1;\n index >= itemsPerPage;\n index--\n ) {\n this.treeModel.removeChild(index);\n this.host.remove(index);\n }\n action = true;\n }\n if (action === true) {\n const end = start + itemsPerPage;\n this.treeData = this.originalData.slice(start, end);\n }\n }\n } else {\n this.originalData.length = 0;\n this.originalData.push(...this.treeData);\n }\n }\n\n private rebuildBranch(branch: Branch<any>): LimbleTreeNode {\n const temp: LimbleTreeNode = branch.data;\n temp.nodes = [];\n for (const child of branch.getChildren()) {\n temp.nodes.push(this.rebuildBranch(child));\n }\n return temp;\n }\n}\n","import {\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n Output\n} from \"@angular/core\";\nimport { fromEvent, Subscription } from \"rxjs\";\nimport { throttleTime } from \"rxjs/operators\";\n\n@Directive({\n selector: \"[dragoverNoChangeDetect]\"\n})\nexport class DragoverNoChangeDetectDirective implements OnInit, OnDestroy {\n @Input() dragoverEventThrottle: number;\n @Output() readonly dragoverNoChangeDetect: EventEmitter<DragEvent>;\n private eventSubscription: Subscription | undefined;\n\n constructor(\n private readonly ngZone: NgZone,\n private readonly el: ElementRef<Element>\n ) {\n this.dragoverNoChangeDetect = new EventEmitter<DragEvent>();\n this.dragoverEventThrottle = 25;\n }\n\n ngOnInit() {\n this.ngZone.runOutsideAngular(() => {\n this.eventSubscription = fromEvent<DragEvent>(\n this.el.nativeElement,\n \"dragover\"\n )\n .pipe(throttleTime(this.dragoverEventThrottle))\n .subscribe(($event) => {\n this.dragoverNoChangeDetect.emit($event);\n });\n });\n }\n\n ngOnDestroy() {\n if (this.eventSubscription !== undefined) {\n this.eventSubscription.unsubscribe();\n }\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n OnDestroy,\n OnInit\n} from \"@angular/core\";\nimport { Subscription } from \"rxjs\";\nimport { DropZone } from \"../classes/DropZone\";\nimport { DropZoneService } from \"../limble-tree-root/drop-zone.service\";\nimport { TreeConstructionStatus } from \"../limble-tree-root/tree-construction-status.service\";\nimport { TreeService } from \"../limble-tree-root/tree.service\";\n\n@Component({\n selector: \"limble-tree-placeholder\",\n templateUrl: \"./limble-tree-placeholder.component.html\",\n styleUrls: [\"./limble-tree-placeholder.component.scss\"],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class LimbleTreePlaceholderComponent\n implements OnInit, AfterViewInit, OnDestroy {\n public dropZone: DropZone | undefined;\n private readonly placeholderSubscription: Subscription;\n\n public constructor(\n private readonly dropZoneService: DropZoneService,\n private readonly changeDetectorRef: ChangeDetectorRef,\n private readonly treeService: TreeService,\n private readonly treeConstructionStatus: TreeConstructionStatus\n ) {\n this.treeConstructionStatus.constructing();\n //This logic is very similar to what the lifecycle hooks of this component do.\n //We use this subscription because sometimes we can't wait for the lifecycle hooks:\n //Specifically, the drop zone registration and deregistration sometimes can't happen\n //asynchronously without causing bugs. So we handle it synchronously here as well.\n this.placeholderSubscription = this.treeService.placeholder$.subscribe(\n (value) => {\n if (this.dropZone === undefined) {\n return;\n }\n this.dropZoneService.removeDropZone(this.dropZone);\n if (value === true) {\n this.dropZoneService.addDropZone(this.dropZone);\n this.dropZone.setHost(this.treeService.host);\n }\n }\n );\n }\n\n public ngOnInit() {\n this.dropZone = new DropZone([], 0);\n this.dropZoneService.addDropZone(this.dropZone);\n }\n\n public ngAfterViewInit() {\n if (this.dropZone === undefined) {\n throw new Error(\"placeholder drop zone is not defined\");\n }\n this.dropZone.setHost(this.treeService.host);\n this.treeConstructionStatus.doneConstructing();\n this.changeDetectorRef.detectChanges();\n }\n\n public dragoverHandler() {\n if (this.dropZone === undefined) {\n return;\n }\n this.dropZoneService.showDropZoneFamily(this.dropZone);\n }\n\n public ngOnDestroy() {\n this.placeholderSubscription.unsubscribe();\n if (this.dropZone === undefined) {\n throw new Error(\"could not remove placeholder drop zone\");\n }\n this.dropZoneService.removeDropZone(this.dropZone);\n }\n}\n","<drop-zone [dropZone]=\"dropZone\"></drop-zone>\n<div class=\"placeholder\" (dragoverNoChangeDetect)=\"dragoverHandler()\"></div>\n","import {\n Directive,\n ElementRef,\n EventEmitter,\n NgZone,\n OnDestroy,\n OnInit,\n Output\n} from \"@angular/core\";\nimport { fromEvent, Subscription } from \"rxjs\";\n\n@Directive({\n selector: \"[dragleaveNoChangeDetect]\"\n})\nexport class DragleaveNoChangeDetectDirective implements OnInit, OnDestroy {\n @Output() readonly dragleaveNoChangeDetect: EventEmitter<DragEvent>;\n private eventSubscription: Subscription | undefined;\n\n constructor(\n private readonly ngZone: NgZone,\n private readonly el: ElementRef<Element>\n ) {\n this.dragleaveNoChangeDetect = new EventEmitter<DragEvent>();\n }\n\n ngOnInit() {\n this.ngZone.runOutsideAngular(() => {\n this.eventSubscription = fromEvent<DragEvent>(\n this.el.nativeElement,\n \"dragleave\"\n ).subscribe(($event) => {\n this.dragleaveNoChangeDetect.emit($event);\n });\n });\n }\n\n ngOnDestroy() {\n if (this.eventSubscription !== undefined) {\n this.eventSubscription.unsubscribe();\n }\n }\n}\n","<div\n (dragoverNoChangeDetect)=\"dragoverHandler($event)\"\n (dragleaveNoChangeDetect)=\"dragleaveHandler($event)\"\n (drop)=\"dropHandler($event)\"\n class=\"tree-event-host\"\n>\n <limble-tree-placeholder\n *ngIf=\"placeholder === true\"\n ></limble-tree-placeholder>\n <ng-template #host></ng-template>\n</div>\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n Output,\n ViewChild,\n ViewContainerRef\n} from \"@angular/core\";\nimport { Subscription } from \"rxjs\";\nimport { DropZoneService } from \"./drop-zone.service\";\nimport {\n LimbleTreeData,\n LimbleTreeOptions,\n TreeDrop\n} from \"../limble-tree-root/tree.service\";\nimport { TreeService } from \"./tree.service\";\nimport { isElementDescendant, isFirefox } from \"../util\";\nimport { DragStateService } from \"../singletons/drag-state.service\";\nimport { GlobalEventsService } from \"../singletons/global-events.service\";\nimport { first } from \"rxjs/operators\";\nimport { TreeConstructionStatus } from \"./tree-construction-status.service\";\n\n@Component({\n selector: \"limble-tree-root\",\n templateUrl: \"./limble-tree-root.component.html\",\n styleUrls: [\"./limble-tree-root.component.scss\"],\n providers: [TreeService, DropZoneService, TreeConstructionStatus]\n})\nexport class LimbleTreeRootComponent\n implements AfterViewInit, OnChanges, OnDestroy\n{\n @Input() data: LimbleTreeData | undefined;\n @Input() options: LimbleTreeOptions | undefined;\n @Input() itemsPerPage: number | undefined;\n @Input() page: number | undefined;\n\n @ViewChild(\"host\", { read: ViewContainerRef }) private host:\n | ViewContainerRef\n | undefined;\n\n @Output() readonly treeChange = new EventEmitter<null>();\n\n @Output() readonly treeDrop = new EventEmitter<TreeDrop>();\n\n private readonly changesSubscription: Subscription;\n private readonly dropSubscription: Subscription;\n public placeholder: boolean;\n\n constructor(\n private readonly treeService: TreeService,\n private readonly dropZoneService: DropZoneService,\n private readonly dragStateService: DragStateService,\n private readonly globalEventsService: GlobalEventsService,\n private readonly ngZone: NgZone,\n private readonly changeDetectorRef: ChangeDetectorRef,\n private readonly el: ElementRef<Element>\n ) {\n this.changesSubscription = this.treeService.changes$.subscribe(() => {\n //\"In dev mode, Angular performs an additional check after each change\n //detection run, to ensure the bindings haven’t changed.\" We use a timeout here\n //to preclude the possibility of causing a binding to update in the parent\n //component after change detection runs but before the additional check.\n //See https://angular.io/errors/NG0100 for details.\n setTimeout(() => {\n this.treeChange.emit();\n });\n });\n this.dropSubscription = this.treeService.drops$.subscribe((drop) => {\n setTimeout(() => {\n this.treeDrop.emit(drop);\n });\n });\n this.placeholder = false;\n this.treeService.placeholder$.subscribe((value) => {\n this.placeholder = value;\n if (!NgZone.isInAngularZone()) {\n this.changeDetectorRef.detectChanges();\n }\n });\n }\n\n ngAfterViewInit() {\n if (\n this.options?.listMode !== true &&\n (this.itemsPerPage !== undefined || this.page !== undefined)\n ) {\n console.warn(\n \"pagination is only allowed in listMode; `itemsPerPage` and `page` inputs will be ignored\"\n );\n }\n this.update();\n this.changeDetectorRef.detectChanges();\n\n this.ngZone.runOutsideAngular(() => {\n //this is for mac os - without this dragover handler drop events aren't firing correctly\n this.el.nativeElement.addEventListener(\"dragover\", (event) => {\n event.preventDefault();\n });\n });\n }\n\n ngOnChanges() {\n if (this.host !== undefined && this.data !== undefined) {\n this.update();\n }\n }\n\n /** Rebuild the tree */\n public update() {\n if (this.host === undefined) {\n throw new Error(\n \"Failed to render limble tree. Failure occurred at root.\"\n );\n }\n if (this.data === undefined) {\n throw new Error(`limbleTree requires a data object`);\n }\n this.treeService.init(\n this.host,\n this.data,\n this.options,\n this.itemsPerPage,\n this.page\n );\n //We check for firefox here because there is a bug in Firefox that causes the\n //custom scrolling to break. See https://bugzilla.mozilla.org/show_bug.cgi?id=505521#c80\n if (!isFirefox()) {\n this.globalEventsService.addScrolling();\n }\n }\n\n public dragoverHandler(event: DragEvent) {\n if (event.dataTransfer === null) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n event.dataTransfer.dropEffect = \"move\";\n }\n\n public dragleaveHandler(event: DragEvent) {\n const currentTarget = event.currentTarget;\n const relatedTarget = event.relatedTarget;\n if (\n !(currentTarget instanceof Node) ||\n !(relatedTarget instanceof Node) ||\n isElementDescendant(currentTarget, relatedTarget) !== false\n ) {\n //event came from deeper in the tree. Ignore it.\n return;\n }\n //Mouse has left the tree, so clear the drop zones\n this.dropZoneService.clearVisibleZones();\n this.changeDetectorRef.detectChanges();\n }\n\n public dropHandler(event: DragEvent) {\n event.stopPropagation();\n if (this.dragStateService.getState() !== \"droppable\") {\n return;\n }\n const sourceBranch = this.dragStateService.capture();\n if (sourceBranch === undefined) {\n throw new Error(\"failed to get current branch in dragendHandler\");\n }\n const dropZone = this.dropZoneService.getActiveDropZone();\n if (dropZone === null) {\n throw new Error(\"failed to get active drop zone at drop handler\");\n }\n this.treeService.captured = true;\n this.dragStateService.state$\n .pipe(first((message) => message === \"idle\"))\n .subscribe(() => {\n this.treeService.captured = false;\n });\n this.dropZoneService.clearVisibleZones();\n this.treeService.drop(sourceBranch, dropZone.getFullInsertCoordinates());\n }\n\n ngOnDestroy() {\n this.changesSubscription.unsubscribe();\n this.dropSubscription.unsubscribe();\n }\n}\n","import { NgModule } from \"@angular/core\";\nimport { ComponentCreatorService } from \"./singletons/component-creator.service\";\nimport { DropZoneComponent } from \"./drop-zone/drop-zone.component\";\nimport { LimbleTreeBranchComponent } from \"./limble-tree-branch/limble-tree-branch.component\";\nimport { CommonModule } from \"@angular/common\";\nimport { LimbleTreeNodeComponent } from \"./limble-tree-node/limble-tree-node.component\";\nimport { DragStateService } from \"./singletons/drag-state.service\";\nimport { LimbleTreeRootComponent } from \"./limble-tree-root/limble-tree-root.component\";\nimport { LimbleTreePlaceholderComponent } from \"./limble-tree-placeholder/limble-tree-placeholder.component\";\nimport { GlobalEventsService } from \"./singletons/global-events.service\";\nimport { DragoverNoChangeDetectDirective } from \"./custom-event-bindings/dragover-no-change-detect.directive\";\nimport { DragleaveNoChangeDetectDirective } from \"./custom-event-bindings/dragleave-no-change-detect.directive\";\n\n@NgModule({\n declarations: [\n LimbleTreeBranchComponent,\n DropZoneComponent,\n LimbleTreeNodeComponent,\n LimbleTreeRootComponent,\n LimbleTreePlaceholderComponent,\n DragoverNoChangeDetectDirective,\n DragleaveNoChangeDetectDirective\n ],\n imports: [CommonModule],\n exports: [LimbleTreeRootComponent],\n providers: [ComponentCreatorService, DragStateService, GlobalEventsService]\n})\nexport class LimbleTreeModule {}\n","/*\n * Public API Surface of limble-tree\n */\n\nexport {\n LimbleTreeNode,\n LimbleTreeData,\n LimbleTreeOptions,\n ComponentObj,\n TreeDrop\n} from \"./lib/limble-tree-root/tree.service\";\nexport { LimbleTreeRootComponent } from \"./lib/limble-tree-root/limble-tree-root.component\";\nexport { LimbleTreeModule } from \"./lib/limble-tree.module\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.DragStateService","i2.TreeConstructionStatus","_c0","i1.DropZoneService","i1.TreeService","i2.DropZoneService","i3.TreeConstructionStatus","i1.ComponentCreatorService","i2.DragStateService","i3.DropZoneService","i4.TreeService","i5.GlobalEventsService","i6.TreeConstructionStatus","i3.DragStateService","i4.TreeConstructionStatus","i2.TreeService","i4.GlobalEventsService"],"mappings":";;;;;;;AAKgB,SAAA,cAAc,CAC3B,MAAsB,EACtB,MAAsB,EAAA;AAEtB,IAAA,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE;AAClC,QAAA,OAAO,KAAK,CAAC;AACf,KAAA;IACD,KAAK,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE;AAC7C,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC7B,QAAA,IAAI,MAAM,YAAY,KAAK,IAAI,MAAM,YAAY,KAAK,EAAE;AACrD,YAAA,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE;AAClC,gBAAA,OAAO,KAAK,CAAC;AACf,aAAA;AACH,SAAA;aAAM,IAAI,MAAM,KAAK,MAAM,EAAE;AAC3B,YAAA,OAAO,KAAK,CAAC;AACf,SAAA;AACH,KAAA;AACD,IAAA,OAAO,IAAI,CAAC;AACf,CAAC;AAEe,SAAA,mBAAmB,CAChC,iBAAuB,EACvB,mBAAyB,EAAA;IAEzB,IAAI,iBAAiB,KAAK,mBAAmB,EAAE;AAC5C,QAAA,OAAO,IAAI,CAAC;AACd,KAAA;AACD,IAAA,IAAI,MAAM,GAAG,mBAAmB,CAAC,UAAU,CAAC;IAC5C,OAAO,MAAM,KAAK,QAAQ,EAAE;QACzB,IAAI,MAAM,KAAK,IAAI,EAAE;;AAElB,YAAA,OAAO,SAAS,CAAC;AACnB,SAAA;QACD,IAAI,MAAM,KAAK,iBAAiB,EAAE;AAC/B,YAAA,OAAO,IAAI,CAAC;AACd,SAAA;AACD,QAAA,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC;AAC7B,KAAA;AACD,IAAA,OAAO,KAAK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;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"limble-limble-tree.mjs","sources":["../../../projects/limble-tree/src/lib/extras/collapse/collapse.ts","../../../projects/limble-tree/src/lib/extras/collapse/collapse.service.ts","../../../projects/limble-tree/src/lib/extras/collapse/collapse.module.ts","../../../projects/limble-tree/src/lib/core/configuration/configuration.ts","../../../projects/limble-tree/src/lib/errors/tree-error.ts","../../../projects/limble-tree/src/lib/events/drag/drag-end-event.ts","../../../projects/limble-tree/src/lib/events/drag/drag-start-event.ts","../../../projects/limble-tree/src/shared/assert.ts","../../../projects/limble-tree/src/lib/extras/drag-and-drop/drag-state.ts","../../../projects/limble-tree/src/lib/events/drag/drop-event.ts","../../../projects/limble-tree/src/lib/extras/drag-and-drop/drag-and-drop.ts","../../../projects/limble-tree/src/lib/extras/drag-and-drop/dragover-no-change-detect.ts","../../../projects/limble-tree/src/lib/components/dropzone/dropzone.component.ts","../../../projects/limble-tree/src/lib/components/dropzone/dropzone.component.html","../../../projects/limble-tree/src/lib/components/branch/branch.component.ts","../../../projects/limble-tree/src/lib/components/branch/branch.component.html","../../../projects/limble-tree/src/lib/events/relational/graft-event.ts","../../../projects/limble-tree/src/lib/events/relational/prune-event.ts","../../../projects/limble-tree/src/lib/core/tree-node-base.ts","../../../projects/limble-tree/src/lib/events/general/destruction-event.ts","../../../projects/limble-tree/src/lib/components/root/root.component.ts","../../../projects/limble-tree/src/lib/components/root/root.component.html","../../../projects/limble-tree/src/lib/core/tree-root/root-controller.ts","../../../projects/limble-tree/src/lib/core/tree-root/tree-root.ts","../../../projects/limble-tree/src/lib/core/tree-service/tree.service.ts","../../../projects/limble-tree/src/lib/core/tree-branch/branch-controller.ts","../../../projects/limble-tree/src/lib/core/tree-branch/tree-branch.ts","../../../projects/limble-tree/src/lib/extras/drag-and-drop/dropzone-renderer.ts","../../../projects/limble-tree/src/lib/extras/drag-and-drop/drag-and-drop.service.ts","../../../projects/limble-tree/src/lib/extras/drag-and-drop/draggable.directive.ts","../../../projects/limble-tree/src/lib/extras/drag-and-drop/drag-and-drop.module.ts","../../../projects/limble-tree/src/lib/legacy/legacy-tree.ts","../../../projects/limble-tree/src/lib/legacy/limble-tree-root/limble-tree-root.component.ts","../../../projects/limble-tree/src/lib/legacy/limble-tree-root/limble-tree-root.component.html","../../../projects/limble-tree/src/lib/legacy/limble-tree-legacy.module.ts","../../../projects/limble-tree/src/lib/limble-tree.module.ts","../../../projects/limble-tree/src/public-api.ts","../../../projects/limble-tree/src/limble-limble-tree.ts"],"sourcesContent":["import { TreeBranch } from \"../../core\";\n\nclass TreeCollapser {\n private readonly tempStorage: Map<TreeBranch<any>, Array<TreeBranch<any>>>;\n\n public constructor() {\n this.tempStorage = new Map();\n }\n\n public collapse<T>(treeBranch: TreeBranch<T>): void {\n if (treeBranch.branches().length === 0) return;\n const branches: Array<TreeBranch<T>> = [];\n this.tempStorage.set(treeBranch, branches);\n treeBranch.branches().forEach((branch) => {\n branch.prune();\n branches.push(branch);\n });\n }\n\n public expand<T>(treeBranch: TreeBranch<T>): void {\n const branches = this.tempStorage.get(treeBranch);\n if (branches === undefined) return;\n branches.forEach((branch) => {\n branch.graftTo(treeBranch);\n });\n this.tempStorage.delete(treeBranch);\n treeBranch.detectChanges();\n }\n\n public isCollapsed<T>(treeBranch: TreeBranch<T>): boolean {\n return this.tempStorage.has(treeBranch);\n }\n\n public storePrecollapsedNode<T>(\n parent: TreeBranch<T>,\n branch: TreeBranch<T>\n ): void {\n this.tempStorage.set(\n parent,\n (this.tempStorage.get(parent) ?? []).concat(branch)\n );\n }\n}\n\nexport const treeCollapser = new TreeCollapser();\n","import { Injectable } from \"@angular/core\";\nimport { TreeBranch } from \"../../core\";\nimport { treeCollapser } from \"./collapse\";\n\n@Injectable()\nexport class TreeCollapseService {\n public collapse<T>(treeBranch: TreeBranch<T>): void {\n treeCollapser.collapse(treeBranch);\n }\n\n public expand<T>(treeBranch: TreeBranch<T>): void {\n treeCollapser.expand(treeBranch);\n }\n\n public isCollapsed<T>(treeBranch: TreeBranch<T>): boolean {\n return treeCollapser.isCollapsed(treeBranch);\n }\n}\n","import { NgModule } from \"@angular/core\";\nimport { TreeCollapseService } from \"./collapse.service\";\n\n@NgModule({\n providers: [TreeCollapseService]\n})\nexport class TreeCollapseModule {}\n","import { TreeRoot } from \"../tree-root/tree-root\";\nimport { TreeOptions } from \"./tree-options.interface\";\n\nclass Configuration {\n private readonly configStorage = new Map<TreeRoot<any>, TreeOptions>();\n\n public constructor() {\n this.configStorage = new Map();\n }\n\n public setConfig<T>(root: TreeRoot<T>, options: TreeOptions): void {\n this.configStorage.set(root, options);\n }\n\n public getConfig(root: any): TreeOptions | undefined {\n return this.configStorage.get(root);\n }\n\n public delete(root: any): void {\n this.configStorage.delete(root);\n }\n}\n\nexport const config = new Configuration();\n","export class TreeError extends Error {}\n","import { NodeComponent } from \"../../components/node-component.interface\";\nimport { TreeBranch } from \"../../core\";\nimport { TreeNode } from \"../../structure\";\nimport { EventConduit } from \"../../structure/event-conduit.interface\";\nimport { TreeEvent } from \"../../structure/tree-event.interface\";\n\nexport class DragEndEvent<T> implements TreeEvent {\n private readonly _source: EventConduit;\n private readonly _newParent: TreeNode<TreeBranch<T>, NodeComponent>;\n private readonly _newIndex: number;\n private readonly _oldParent: TreeNode<TreeBranch<T>, NodeComponent>;\n private readonly _oldIndex: number;\n\n public constructor(\n source: EventConduit,\n endpoints: {\n oldParent: TreeNode<TreeBranch<T>, NodeComponent>;\n oldIndex: number;\n newParent: TreeNode<TreeBranch<T>, NodeComponent>;\n newIndex: number;\n }\n ) {\n this._source = source;\n this._oldParent = endpoints.oldParent;\n this._oldIndex = endpoints.oldIndex;\n this._newParent = endpoints.newParent;\n this._newIndex = endpoints.newIndex;\n }\n\n public type(): \"drag end\" {\n return \"drag end\";\n }\n\n public source(): EventConduit {\n return this._source;\n }\n\n public newIndex(): number {\n return this._newIndex;\n }\n\n public newParent(): TreeNode<TreeBranch<T>, NodeComponent> {\n return this._newParent;\n }\n\n public oldIndex(): number {\n return this._oldIndex;\n }\n\n public oldParent(): TreeNode<TreeBranch<T>, NodeComponent> {\n return this._oldParent;\n }\n}\n","import { EventConduit } from \"../../structure/event-conduit.interface\";\nimport { TreeEvent } from \"../../structure/tree-event.interface\";\n\nexport class DragStartEvent implements TreeEvent {\n private readonly _source: EventConduit;\n\n public constructor(source: EventConduit) {\n this._source = source;\n }\n\n public type(): \"drag start\" {\n return \"drag start\";\n }\n\n public source(): EventConduit {\n return this._source;\n }\n}\n","export function assert(condition: unknown): asserts condition {\n if (condition) {\n return;\n }\n throw new Error(\"Assertion Failed!\");\n}\n","import { assert } from \"../../../shared/assert\";\nimport { BehaviorSubject, Observable } from \"rxjs\";\nimport { TreeBranch } from \"../../core\";\n\nexport enum DragStates {\n Idle = 0,\n Starting = 1,\n Dragging = 2,\n Dropped = 3\n}\n\nclass DragState {\n private dragData: TreeBranch<any> | undefined;\n private _state: DragStates = DragStates.Idle;\n private readonly state$: BehaviorSubject<DragStates>;\n\n public constructor() {\n this.state$ = new BehaviorSubject<DragStates>(DragStates.Idle);\n this.state$.subscribe((state) => {\n this._state = state;\n });\n this.dragData = undefined;\n }\n\n public getDragData<T>(): TreeBranch<T> | undefined {\n return this.dragData;\n }\n\n public starting<T>(treeBranch: TreeBranch<T>): void {\n assert(this._state === DragStates.Idle);\n this.dragData = treeBranch;\n this.state$.next(DragStates.Starting);\n }\n\n public dragging(): void {\n assert(this._state === DragStates.Starting);\n this.state$.next(DragStates.Dragging);\n }\n\n public dropped(): void {\n assert(this._state === DragStates.Dragging);\n this.state$.next(DragStates.Dropped);\n }\n\n public restart(): void {\n this.dragData = undefined;\n this.state$.next(DragStates.Idle);\n }\n\n public events(): Observable<DragStates> {\n return this.state$;\n }\n\n public state(): DragStates {\n return this._state;\n }\n}\n\nexport const dragState = new DragState();\n","import { NodeComponent } from \"../../components/node-component.interface\";\nimport { TreeBranch } from \"../../core\";\nimport { TreeNode, EventConduit, TreeEvent } from \"../../structure\";\n\nexport class DropEvent<T> implements TreeEvent {\n private readonly _source: EventConduit;\n private readonly _parent: TreeNode<TreeBranch<T>, NodeComponent>;\n private readonly _index: number;\n\n public constructor(\n source: EventConduit,\n parent: TreeNode<TreeBranch<T>, NodeComponent>,\n index: number\n ) {\n this._source = source;\n this._parent = parent;\n this._index = index;\n }\n\n public type(): \"drag end\" {\n return \"drag end\";\n }\n\n public source(): EventConduit {\n return this._source;\n }\n\n public index(): number {\n return this._index;\n }\n\n public parent(): TreeNode<TreeBranch<T>, NodeComponent> {\n return this._parent;\n }\n}\n","import { Subject } from \"rxjs\";\nimport { NodeComponent } from \"../../components/node-component.interface\";\nimport { TreeBranch } from \"../../core\";\nimport { config } from \"../../core/configuration/configuration\";\nimport { TreeError } from \"../../errors\";\nimport { DragEndEvent } from \"../../events/drag/drag-end-event\";\nimport { DragStartEvent } from \"../../events/drag/drag-start-event\";\nimport { dragState, DragStates } from \"./drag-state\";\nimport { DropEvent } from \"../../events/drag/drop-event\";\nimport { assert } from \"../../../shared/assert\";\nimport { TreeNode } from \"../../structure\";\n\nclass DragAndDrop {\n public readonly dragAborted$ = new Subject<DragEvent>();\n\n public dragStart<T>(treeBranch: TreeBranch<T>, event: DragEvent): void {\n if (!this.draggingAllowed(treeBranch)) {\n event.preventDefault();\n return;\n }\n treeBranch.dispatch(new DragStartEvent(treeBranch));\n this.setDragEffects(treeBranch, event);\n this.watchForDragend(treeBranch, event);\n // We have to do a setTimeout because DOM changes are not allowed during a\n // dragstart event.\n setTimeout(() => {\n dragState.starting(treeBranch);\n treeBranch.prune();\n dragState.dragging();\n });\n }\n\n public drop<T>(\n parent: TreeNode<TreeBranch<T>, NodeComponent>,\n index: number\n ): void {\n const treeBranch = dragState.getDragData<T>();\n if (treeBranch === undefined) {\n throw new TreeError(\"Cannot get dragged branch\");\n }\n this.graftDraggedBranch(treeBranch, parent, index);\n treeBranch.dispatch(new DropEvent(treeBranch, parent, index));\n }\n\n private getDragImageOffsets(\n event: DragEvent,\n element: Element\n ): [number, number] {\n const bounds = element.getBoundingClientRect();\n const xOffset = event.clientX - bounds.left;\n const yOffset = event.clientY - bounds.top;\n return [xOffset, yOffset];\n }\n\n private setDragEffects<T>(\n treeBranch: TreeBranch<T>,\n event: DragEvent\n ): void {\n const dataTransfer = event.dataTransfer;\n assert(dataTransfer instanceof DataTransfer);\n const nativeElement = treeBranch.getNativeElement();\n const [xOffset, yOffset] = this.getDragImageOffsets(event, nativeElement);\n dataTransfer.setDragImage(nativeElement, xOffset, yOffset);\n }\n\n private watchForDragend<T>(\n treeBranch: TreeBranch<T>,\n event: DragEvent\n ): void {\n const oldParent = treeBranch.parent();\n const oldIndex = treeBranch.index();\n assert(oldParent !== undefined && oldIndex !== undefined);\n event.target?.addEventListener(\n \"dragend\",\n (dragend) => {\n if (dragState.state() !== DragStates.Dropped) {\n //The drag ended but a drop never occurred, so put the dragged branch back where it started.\n this.dragAborted$.next(dragend as DragEvent);\n this.graftDraggedBranch(treeBranch, oldParent, oldIndex);\n }\n dragState.restart();\n const newParent = treeBranch.parent();\n assert(newParent !== undefined);\n const newIndex = treeBranch.index();\n assert(newIndex !== undefined);\n treeBranch.dispatch(\n new DragEndEvent(treeBranch, {\n oldParent,\n oldIndex,\n newParent,\n newIndex\n })\n );\n },\n { once: true }\n );\n }\n\n private draggingAllowed<T>(treeBranch: TreeBranch<T>): boolean {\n const allowDragging =\n config.getConfig(treeBranch.root())?.dragAndDrop?.allowDragging ??\n ((): true => true);\n return allowDragging(treeBranch);\n }\n\n private graftDraggedBranch<T>(\n treeBranch: TreeBranch<T>,\n parent: TreeNode<TreeBranch<T>, NodeComponent>,\n index: number\n ): void {\n treeBranch.graftTo(parent, index);\n treeBranch.getNativeElement().style.display = \"block\";\n dragState.dropped();\n }\n}\n\nexport const dragAndDrop = new DragAndDrop();\n","import {\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n Output\n} from \"@angular/core\";\nimport { fromEvent, Subscription } from \"rxjs\";\nimport { throttleTime } from \"rxjs/operators\";\n\n@Directive({\n standalone: true,\n selector: \"[dragoverNoChangeDetect]\"\n})\nexport class DragoverNoChangeDetectDirective implements OnInit, OnDestroy {\n @Input() dragoverEventThrottle: number;\n @Output() readonly dragoverNoChangeDetect: EventEmitter<DragEvent>;\n private eventSubscription: Subscription | undefined;\n\n public constructor(\n private readonly ngZone: NgZone,\n private readonly el: ElementRef<Element>\n ) {\n this.dragoverNoChangeDetect = new EventEmitter<DragEvent>();\n this.dragoverEventThrottle = 25;\n }\n\n public ngOnInit(): void {\n this.ngZone.runOutsideAngular(() => {\n this.eventSubscription = fromEvent<DragEvent>(\n this.el.nativeElement,\n \"dragover\"\n )\n .pipe(throttleTime(this.dragoverEventThrottle))\n .subscribe(($event) => {\n this.dragoverNoChangeDetect.emit($event);\n });\n });\n }\n\n public ngOnDestroy(): void {\n if (this.eventSubscription !== undefined) {\n this.eventSubscription.unsubscribe();\n }\n }\n}\n","import { CommonModule } from \"@angular/common\";\nimport { Component, EventEmitter, Input, Output } from \"@angular/core\";\nimport { DragoverNoChangeDetectDirective } from \"../../extras/drag-and-drop/dragover-no-change-detect\";\n\n@Component({\n standalone: true,\n selector: \"dropzone\",\n templateUrl: \"./dropzone.component.html\",\n styleUrls: [\"./dropzone.component.scss\"],\n imports: [CommonModule, DragoverNoChangeDetectDirective]\n})\nexport class DropzoneComponent {\n @Input() placement?: \"inner\" | \"lateral\";\n @Output() readonly dropped = new EventEmitter<DragEvent>();\n\n protected active: boolean = false;\n\n public dragenterHandler(): void {\n this.active = true;\n }\n\n public dragleaveHandler(): void {\n this.active = false;\n }\n\n public dragoverHandler(event: DragEvent): void {\n event.preventDefault();\n (event.dataTransfer as DataTransfer).dropEffect = \"move\";\n }\n\n public dropHandler(event: DragEvent): void {\n this.dropped.emit(event);\n }\n}\n","<div\n class=\"dropzone\"\n [ngClass]=\"{ active: active }\"\n (dragenter)=\"dragenterHandler()\"\n (dragleave)=\"dragleaveHandler()\"\n (dragoverNoChangeDetect)=\"dragoverHandler($event)\"\n (drop)=\"dropHandler($event)\"\n></div>\n","import { CommonModule } from \"@angular/common\";\nimport {\n AfterViewInit,\n ApplicationRef,\n Component,\n ComponentRef,\n EventEmitter,\n Input,\n NgZone,\n OnDestroy,\n Output,\n QueryList,\n Type,\n ViewChild,\n ViewChildren,\n ViewContainerRef\n} from \"@angular/core\";\nimport { map, merge } from \"rxjs\";\nimport { DropzoneComponent } from \"../dropzone/dropzone.component\";\nimport { HostComponent } from \"../host-component.interface\";\nimport { NodeComponent } from \"../node-component.interface\";\nimport { DragoverNoChangeDetectDirective } from \"../../extras/drag-and-drop/dragover-no-change-detect\";\nimport { assert } from \"../../../shared/assert\";\n\n@Component({\n standalone: true,\n selector: \"branch\",\n templateUrl: \"./branch.component.html\",\n styleUrls: [\"./branch.component.scss\"],\n imports: [CommonModule, DropzoneComponent, DragoverNoChangeDetectDirective]\n})\nexport class BranchComponent<T>\n implements NodeComponent, HostComponent<T>, AfterViewInit, OnDestroy\n{\n @ViewChild(\"branchesContainer\", { read: ViewContainerRef })\n branchesContainer: ViewContainerRef | undefined = undefined;\n @ViewChild(\"contentContainer\", { read: ViewContainerRef })\n contentContainer: ViewContainerRef | undefined = undefined;\n @ViewChildren(DropzoneComponent) dropzones:\n | QueryList<DropzoneComponent>\n | undefined = undefined;\n\n @Input() contentToHost?: Type<T>;\n\n @Output() readonly contentCreated = new EventEmitter<T>();\n @Output() readonly showDropzones = new EventEmitter<\"upper\" | \"lower\">();\n @Output() readonly dropped = new EventEmitter<\"inner\" | \"lateral\">();\n\n public showInnerDropzone: boolean = false;\n public showLateralDropzone: boolean = false;\n\n private hostedContent?: ComponentRef<T>;\n\n public constructor(private readonly appRef: ApplicationRef) {}\n\n public ngAfterViewInit(): void {\n assert(this.contentContainer !== undefined);\n assert(this.contentToHost !== undefined);\n this.hostedContent = this.contentContainer.createComponent(\n this.contentToHost\n );\n this.contentCreated.emit(this.hostedContent.instance);\n assert(this.dropzones !== undefined);\n const inner = this.dropzones.get(0);\n const lateral = this.dropzones.get(1);\n assert(inner !== undefined && lateral !== undefined);\n merge(\n inner.dropped.pipe(map(() => \"inner\" as const)),\n lateral.dropped.pipe(map(() => \"lateral\" as const))\n ).subscribe(this.dropped);\n this.hostedContent.changeDetectorRef.detectChanges();\n }\n\n public getHostedContent(): ComponentRef<T> | undefined {\n return this.hostedContent;\n }\n\n public triggerChangeDetection(): void {\n if (!NgZone.isInAngularZone()) {\n this.appRef.tick();\n }\n }\n\n protected dragoverHandler(event: DragEvent): void {\n const elementHeight = (\n event.currentTarget as HTMLElement\n ).getBoundingClientRect().height;\n if (event.offsetY < elementHeight / 2) {\n this.showDropzones.emit(\"upper\");\n } else {\n this.showDropzones.emit(\"lower\");\n }\n }\n\n public ngOnDestroy(): void {\n //I'm not 100% sure why, but we have to remove any reference to the\n //componentRef otherwise Angular will never release it for garbage\n //collection.\n this.hostedContent = undefined;\n }\n}\n","<div class=\"content\" (dragoverNoChangeDetect)=\"dragoverHandler($event)\">\n <div #contentContainer></div>\n</div>\n<div class=\"branches-container\">\n <dropzone placement=\"inner\" [hidden]=\"!showInnerDropzone\"></dropzone>\n <div #branchesContainer></div>\n</div>\n<dropzone placement=\"lateral\" [hidden]=\"!showLateralDropzone\"></dropzone>\n","import { EventConduit } from \"../../structure/event-conduit.interface\";\nimport { RelationalTreeEvent } from \"./relational-tree-event.interface\";\nimport { TreeRelationship } from \"../../structure/tree-relationship.interface\";\n\nexport class GraftEvent<T extends TreeRelationship<any, any>>\n implements RelationalTreeEvent<T[\"parent\"], T[\"child\"]>\n{\n private readonly _source: EventConduit;\n private readonly _parent: T[\"parent\"];\n private readonly _child: T[\"child\"];\n private readonly _index: number;\n\n public constructor(source: EventConduit, relationship: T) {\n this._source = source;\n this._child = relationship.child;\n this._parent = relationship.parent;\n this._index = relationship.index;\n }\n\n public child(): T[\"child\"] {\n return this._child;\n }\n\n public type(): \"graft\" {\n return \"graft\";\n }\n\n public index(): number {\n return this._index;\n }\n\n public parent(): T[\"parent\"] {\n return this._parent;\n }\n\n public source(): EventConduit {\n return this._source;\n }\n}\n","import { EventConduit } from \"../../structure/event-conduit.interface\";\nimport { RelationalTreeEvent } from \"./relational-tree-event.interface\";\nimport { TreeRelationship } from \"../../structure/tree-relationship.interface\";\n\nexport class PruneEvent<T extends TreeRelationship<any, any>>\n implements RelationalTreeEvent<T[\"parent\"], T[\"child\"]>\n{\n private readonly _source: EventConduit;\n private readonly _parent: T[\"parent\"];\n private readonly _child: T[\"child\"];\n private readonly _index: number;\n\n public constructor(source: EventConduit, relationship: T) {\n this._source = source;\n this._child = relationship.child;\n this._parent = relationship.parent;\n this._index = relationship.index;\n }\n\n public child(): T[\"child\"] {\n return this._child;\n }\n\n public type(): \"prune\" {\n return \"prune\";\n }\n\n public index(): number {\n return this._index;\n }\n\n public parent(): T[\"parent\"] {\n return this._parent;\n }\n\n public source(): EventConduit {\n return this._source;\n }\n}\n","import { filter, Observable, Subject, Subscription } from \"rxjs\";\nimport { NodeComponent } from \"../components/node-component.interface\";\nimport { TreeError } from \"../errors\";\nimport { GraftEvent } from \"../events/relational/graft-event\";\nimport { PruneEvent } from \"../events/relational/prune-event\";\nimport { TreeEvent } from \"../structure/tree-event.interface\";\nimport { TreeNode } from \"../structure/tree-node.interface\";\nimport { TreePlot } from \"../structure/tree-plot\";\nimport { Relationship } from \"./relationship.interface\";\nimport { TreeBranch } from \"./tree-branch/tree-branch\";\n\nexport class TreeNodeBase<UserlandComponent>\n implements Partial<TreeNode<TreeBranch<UserlandComponent>, NodeComponent>>\n{\n private readonly _branches: Array<TreeBranch<UserlandComponent>>;\n private readonly events$: Subject<TreeEvent>;\n private destroyed: boolean = false;\n private readonly subscriptions: Array<Subscription>;\n\n public constructor() {\n this._branches = [];\n this.events$ = new Subject();\n this.subscriptions = [\n this.graftsToSelf().subscribe((event) => {\n this.registerChildRelationship(event.child(), event.index());\n }),\n this.prunesToSelf().subscribe((event) => {\n this.deregisterChildRelationship(event.child());\n })\n ];\n }\n\n public branches(): Array<TreeBranch<UserlandComponent>> {\n return [...this._branches];\n }\n\n public destroy(): void {\n this.branches().forEach((branch) => {\n branch.destroy();\n });\n this.subscriptions.forEach((sub) => {\n sub.unsubscribe();\n });\n this.destroyed = true;\n }\n\n public dispatch(event: TreeEvent): void {\n this.events$.next(event);\n }\n\n public events(): Observable<TreeEvent> {\n return this.events$;\n }\n\n public getBranch(index: number): TreeBranch<UserlandComponent> | undefined {\n return this._branches[index];\n }\n\n public isDestroyed(): boolean {\n return this.destroyed;\n }\n\n public plot(): TreePlot {\n return new Map(\n this.branches().map((branch, index) => [index, branch.plot()])\n );\n }\n\n public traverse(\n callback: (\n node: TreeNode<TreeBranch<UserlandComponent>, NodeComponent>\n ) => void\n ): void {\n this.branches().forEach((branch) => {\n branch.traverse(callback);\n });\n }\n\n private deregisterChildRelationship(\n child: TreeBranch<UserlandComponent>\n ): void {\n const index = this.branches().findIndex((branch) => branch === child);\n this._branches.splice(index, 1);\n }\n\n private graftsToSelf(): Observable<\n GraftEvent<Relationship<UserlandComponent>>\n > {\n return this.events().pipe(\n filter(\n (event): event is GraftEvent<Relationship<UserlandComponent>> =>\n event instanceof GraftEvent\n ),\n filter((event) => event.parent().events() === this.events$)\n );\n }\n\n private prunesToSelf(): Observable<\n PruneEvent<Relationship<UserlandComponent>>\n > {\n return this.events().pipe(\n filter(\n (event): event is PruneEvent<Relationship<UserlandComponent>> =>\n event instanceof PruneEvent\n ),\n filter((event) => event.parent().events() === this.events$)\n );\n }\n\n private registerChildRelationship(\n child: TreeBranch<UserlandComponent>,\n index: number\n ): void {\n const branches = this.branches();\n if (index < 0 || index > branches.length) {\n throw new TreeError(\n `Can't register child at index ${index}. Out of range.`\n );\n }\n this._branches.splice(index, 0, child);\n }\n}\n","import { EventConduit } from \"../../structure/event-conduit.interface\";\nimport { TreeEvent } from \"../../structure/tree-event.interface\";\n\nexport class DestructionEvent implements TreeEvent {\n private readonly _source: EventConduit;\n\n public constructor(source: EventConduit) {\n this._source = source;\n }\n\n public type(): \"destruction\" {\n return \"destruction\";\n }\n\n public source(): EventConduit {\n return this._source;\n }\n}\n","import { CommonModule } from \"@angular/common\";\nimport {\n AfterViewInit,\n Component,\n EventEmitter,\n Output,\n ViewChild,\n ViewContainerRef\n} from \"@angular/core\";\nimport { assert } from \"../../../shared/assert\";\nimport { DropzoneComponent } from \"../dropzone/dropzone.component\";\nimport { NodeComponent } from \"../node-component.interface\";\n\n@Component({\n standalone: true,\n selector: \"root\",\n templateUrl: \"./root.component.html\",\n styleUrls: [\"./root.component.scss\"],\n imports: [CommonModule, DropzoneComponent]\n})\nexport class RootComponent implements NodeComponent, AfterViewInit {\n @ViewChild(\"branchesContainer\", { read: ViewContainerRef })\n branchesContainer: ViewContainerRef | undefined = undefined;\n @ViewChild(DropzoneComponent) dropzone: DropzoneComponent | undefined =\n undefined;\n\n @Output() readonly afterViewInit = new EventEmitter<void>();\n @Output() readonly dropped = new EventEmitter<void>();\n\n public showInnerDropzone: boolean = false;\n\n public ngAfterViewInit(): void {\n this.afterViewInit.emit();\n assert(this.dropzone !== undefined);\n this.dropzone.dropped.subscribe(this.dropped);\n }\n}\n","<div class=\"branches-container\">\n <dropzone placement=\"inner\" [hidden]=\"!showInnerDropzone\"></dropzone>\n <div #branchesContainer></div>\n</div>\n","import { ComponentRef, ViewContainerRef, ViewRef } from \"@angular/core\";\nimport { assert } from \"../../../shared/assert\";\nimport { Subscription } from \"rxjs\";\nimport { RootComponent } from \"../../components/root/root.component\";\nimport { dropzoneRenderer } from \"../../extras/drag-and-drop/dropzone-renderer\";\nimport { ComponentContainer } from \"../../structure\";\nimport { TreeRoot } from \"./tree-root\";\n\n/**\n * A wrapper around the BranchComponent that helps instantiate it and handles its events.\n */\nexport class RootController<T> implements ComponentContainer<RootComponent> {\n private readonly rootComponentRef: ComponentRef<RootComponent>;\n private readonly instanceSubscriptions: Array<Subscription>;\n\n public constructor(\n private readonly treeRoot: TreeRoot<T>,\n viewContainerRef: ViewContainerRef\n ) {\n this.rootComponentRef = viewContainerRef.createComponent(RootComponent);\n const viewInitSub =\n this.rootComponentRef.instance.afterViewInit.subscribe(() => {\n const dropzone = this.rootComponentRef.instance.dropzone;\n assert(dropzone !== undefined);\n dropzoneRenderer.registerDropzone(dropzone, this.treeRoot);\n });\n const droppedSub = this.rootComponentRef.instance.dropped.subscribe(\n () => {\n dropzoneRenderer.handleDrop(this.treeRoot, \"inner\");\n }\n );\n this.instanceSubscriptions = [viewInitSub, droppedSub];\n }\n\n public destroy(): void {\n this.instanceSubscriptions.forEach((sub) => {\n sub.unsubscribe();\n });\n }\n\n public detectChanges(): void {\n this.rootComponentRef.changeDetectorRef.detectChanges();\n }\n\n public getBranchesContainer(): ViewContainerRef | undefined {\n return this.rootComponentRef.instance.branchesContainer;\n }\n\n public getComponentInstance(): RootComponent {\n return this.rootComponentRef.instance;\n }\n\n public getHostView(): ViewRef {\n return this.rootComponentRef.hostView;\n }\n\n public getNativeElement(): HTMLElement {\n return this.rootComponentRef.location.nativeElement;\n }\n}\n","import { TreePlot } from \"../../structure/tree-plot\";\nimport { Observable } from \"rxjs\";\nimport { TreeEvent } from \"../../structure/tree-event.interface\";\nimport { TreeBranch } from \"../tree-branch/tree-branch\";\nimport { Type, ViewContainerRef, ViewRef } from \"@angular/core\";\nimport { RootComponent } from \"../../components/root/root.component\";\nimport { TreeNodeBase } from \"../tree-node-base\";\nimport { NodeComponent } from \"../../components/node-component.interface\";\nimport { BranchOptions } from \"../branch-options.interface\";\nimport { dropzoneRenderer } from \"../../extras/drag-and-drop/dropzone-renderer\";\nimport { config } from \"../configuration/configuration\";\nimport { TreeError } from \"../../errors\";\nimport { DestructionEvent } from \"../../events/general\";\nimport { TreeNode } from \"../../structure\";\nimport { RootController } from \"./root-controller\";\n\nexport class TreeRoot<UserlandComponent>\n implements TreeNode<TreeBranch<UserlandComponent>, RootComponent>\n{\n private readonly rootController: RootController<UserlandComponent>;\n private readonly treeNodeBase: TreeNodeBase<UserlandComponent>;\n\n public constructor(private readonly viewContainerRef: ViewContainerRef) {\n this.treeNodeBase = new TreeNodeBase();\n this.rootController = new RootController(this, viewContainerRef);\n this.detectChanges();\n }\n\n public branches(): Array<TreeBranch<UserlandComponent>> {\n return this.treeNodeBase.branches();\n }\n\n public destroy(): void {\n if (this.isDestroyed()) {\n throw new TreeError(\"Cannot destroy a destroyed tree root\");\n }\n dropzoneRenderer.clearTreeFromRegistry(this);\n this.treeNodeBase.destroy();\n this.rootController.destroy();\n this.viewContainerRef.clear();\n config.delete(this);\n this.dispatch(new DestructionEvent(this));\n }\n\n public detectChanges(): void {\n this.rootController.detectChanges();\n }\n\n public dispatch(event: TreeEvent): void {\n this.treeNodeBase.dispatch(event);\n }\n\n public events(): Observable<TreeEvent> {\n return this.treeNodeBase.events();\n }\n\n public getBranch(index: number): TreeBranch<UserlandComponent> | undefined {\n return this.treeNodeBase.getBranch(index);\n }\n\n public getBranchesContainer(): ViewContainerRef | undefined {\n if (this.isDestroyed()) {\n throw new TreeError(\n \"Cannot get branches container from a destroyed tree root\"\n );\n }\n return this.rootController.getBranchesContainer();\n }\n\n public getComponentInstance(): RootComponent {\n if (this.isDestroyed()) {\n throw new TreeError(\n \"Cannot get component instance from a destroyed tree root\"\n );\n }\n return this.rootController.getComponentInstance();\n }\n\n public getHostView(): ViewRef {\n if (this.isDestroyed()) {\n throw new TreeError(\n \"Cannot get component host view from a destroyed tree root\"\n );\n }\n return this.rootController.getHostView();\n }\n\n public getNativeElement(): HTMLElement {\n if (this.isDestroyed()) {\n throw new TreeError(\n \"Cannot get native element from a destroyed tree root\"\n );\n }\n return this.rootController.getNativeElement();\n }\n\n public grow(\n component: Type<UserlandComponent>,\n options?: BranchOptions<UserlandComponent>\n ): TreeBranch<UserlandComponent> {\n if (this.isDestroyed()) {\n throw new TreeError(\"Cannot grow a branch on a destroyed tree root\");\n }\n return new TreeBranch(this, { component, ...options });\n }\n\n public isDestroyed(): boolean {\n return this.treeNodeBase.isDestroyed();\n }\n\n public plot(): TreePlot {\n return this.treeNodeBase.plot();\n }\n\n public root(): this {\n return this;\n }\n\n public traverse(\n callback: (\n node: TreeNode<TreeBranch<UserlandComponent>, NodeComponent>\n ) => void\n ): void {\n callback(this);\n this.treeNodeBase.traverse(callback);\n }\n}\n","import { Injectable, ViewContainerRef } from \"@angular/core\";\nimport { config } from \"../configuration/configuration\";\nimport { TreeOptions } from \"../configuration/tree-options.interface\";\nimport { TreeRoot } from \"../tree-root/tree-root\";\n\n@Injectable({ providedIn: \"root\" })\nexport class TreeService {\n public createEmptyTree<Component>(\n container: ViewContainerRef,\n options: TreeOptions = {}\n ): TreeRoot<Component> {\n container.clear();\n const root = new TreeRoot<Component>(container);\n config.setConfig(root, options);\n return root;\n }\n}\n","import {\n ComponentRef,\n createComponent,\n EnvironmentInjector,\n ViewContainerRef,\n ViewRef\n} from \"@angular/core\";\nimport { assert } from \"../../../shared/assert\";\nimport { filter, Subscription } from \"rxjs\";\nimport { BranchComponent } from \"../../components/branch/branch.component\";\nimport { dropzoneRenderer } from \"../../extras/drag-and-drop/dropzone-renderer\";\nimport { ComponentContainer } from \"../../structure\";\nimport { TreeBranch } from \"./tree-branch\";\n\n/**\n * A wrapper around the BranchComponent that helps instantiate it and handles its events.\n */\nexport class BranchController<UserlandComponent>\n implements ComponentContainer<BranchComponent<UserlandComponent>>\n{\n private readonly branchComponentRef: ComponentRef<\n BranchComponent<UserlandComponent>\n >;\n private readonly instanceSubscriptions: Array<Subscription>;\n private readonly outputBindingSubscriptions: Array<Subscription>;\n\n public constructor(\n private readonly treeBranch: TreeBranch<UserlandComponent>,\n parentBranchesContainer: ViewContainerRef\n ) {\n this.outputBindingSubscriptions = [];\n this.branchComponentRef = createComponent<\n BranchComponent<UserlandComponent>\n >(BranchComponent, {\n environmentInjector:\n parentBranchesContainer.injector.get(EnvironmentInjector)\n });\n this.branchComponentRef.instance.contentToHost =\n this.treeBranch.branchOptions.component;\n this.instanceSubscriptions = this.getInstanceSubscriptions(\n this.branchComponentRef.instance\n );\n }\n\n public destroy(): void {\n this.instanceSubscriptions.forEach((sub) => {\n sub.unsubscribe();\n });\n this.outputBindingSubscriptions.forEach((sub) => {\n sub.unsubscribe();\n });\n }\n\n public detectChanges(): void {\n this.branchComponentRef.changeDetectorRef.detectChanges();\n }\n\n public getBranchesContainer(): ViewContainerRef | undefined {\n return this.branchComponentRef.instance.branchesContainer;\n }\n\n public getComponentInstance(): BranchComponent<UserlandComponent> {\n return this.branchComponentRef.instance;\n }\n\n public getHostView(): ViewRef {\n return this.branchComponentRef.hostView;\n }\n\n public getNativeElement(): HTMLElement {\n return this.branchComponentRef.location.nativeElement;\n }\n\n public getUserlandComponentRef():\n | ComponentRef<UserlandComponent>\n | undefined {\n return this.branchComponentRef.instance.getHostedContent();\n }\n\n private getContentCreatedSub(\n instance: BranchComponent<UserlandComponent>\n ): Subscription {\n return instance.contentCreated.subscribe((userlandComponentInstance) => {\n const component = userlandComponentInstance as any;\n Object.entries(\n this.treeBranch.branchOptions.inputBindings ?? {}\n ).forEach(([key, value]) => {\n component[key] = value;\n });\n Object.entries(\n this.treeBranch.branchOptions.outputBindings ?? {}\n ).forEach(([key, value]) => {\n this.outputBindingSubscriptions.push(\n component[key].subscribe(value)\n );\n });\n component.treeBranch = this.treeBranch;\n const dropzones = instance.dropzones;\n assert(dropzones !== undefined);\n dropzoneRenderer.registerDropzones(dropzones, this.treeBranch);\n });\n }\n\n private getInstanceSubscriptions(\n instance: BranchComponent<UserlandComponent>\n ): Array<Subscription> {\n const droppedSub = instance.dropped.subscribe((placement) => {\n dropzoneRenderer.handleDrop(this.treeBranch, placement);\n });\n return [\n this.getContentCreatedSub(instance),\n this.getShowLowerZonesSub(instance),\n this.getShowUpperZonesSub(instance),\n droppedSub\n ];\n }\n\n private getShowLowerZonesSub(\n instance: BranchComponent<UserlandComponent>\n ): Subscription {\n return instance.showDropzones\n .pipe(filter((direction) => direction === \"lower\"))\n .subscribe(() => {\n const currentDropzoneDisplayed =\n dropzoneRenderer.getCurrentDisplay();\n if (\n currentDropzoneDisplayed?.treeBranch === this.treeBranch &&\n currentDropzoneDisplayed.direction === \"lower\"\n ) {\n return;\n }\n dropzoneRenderer.showLowerZones(this.treeBranch);\n instance.triggerChangeDetection();\n });\n }\n\n private getShowUpperZonesSub(\n instance: BranchComponent<UserlandComponent>\n ): Subscription {\n return instance.showDropzones\n .pipe(filter((direction) => direction === \"upper\"))\n .subscribe(() => {\n const currentDropzoneDisplayed =\n dropzoneRenderer.getCurrentDisplay();\n if (\n currentDropzoneDisplayed?.treeBranch === this.treeBranch &&\n currentDropzoneDisplayed.direction === \"upper\"\n ) {\n return;\n }\n dropzoneRenderer.showUpperZones(this.treeBranch);\n instance.triggerChangeDetection();\n });\n }\n}\n","import { assert } from \"../../../shared/assert\";\nimport { TreePlot } from \"../../structure/tree-plot\";\nimport { Observable } from \"rxjs\";\nimport { GraftEvent } from \"../../events/relational/graft-event\";\nimport { PruneEvent } from \"../../events/relational/prune-event\";\nimport { TreeEvent } from \"../../structure/tree-event.interface\";\nimport { TreeBranchNode } from \"../../structure/tree-branch-node.interface\";\nimport { ComponentRef, Type, ViewContainerRef, ViewRef } from \"@angular/core\";\nimport { BranchComponent } from \"../../components/branch/branch.component\";\nimport { NodeComponent } from \"../../components/node-component.interface\";\nimport { TreeNodeBase } from \"../tree-node-base\";\nimport { TreeError } from \"../../errors/tree-error\";\nimport { BranchOptions, FullBranchOptions } from \"../branch-options.interface\";\nimport { dropzoneRenderer } from \"../../extras/drag-and-drop/dropzone-renderer\";\nimport { config } from \"../configuration/configuration\";\nimport { TreeRoot } from \"..\";\nimport { treeCollapser } from \"../../extras/collapse/collapse\";\nimport { DestructionEvent } from \"../../events/general\";\nimport { TreeNode } from \"../../structure\";\nimport { BranchController } from \"./branch-controller\";\n\nexport class TreeBranch<UserlandComponent>\n implements\n TreeBranchNode<\n BranchComponent<UserlandComponent>,\n TreeBranch<UserlandComponent>,\n NodeComponent\n >\n{\n private readonly branchController: BranchController<UserlandComponent>;\n private detachedView: ViewRef | null = null;\n private _parent:\n | TreeNode<TreeBranch<UserlandComponent>, NodeComponent>\n | undefined;\n private readonly treeNodeBase: TreeNodeBase<UserlandComponent>;\n\n public constructor(\n parent: TreeNode<TreeBranch<UserlandComponent>, NodeComponent>,\n public readonly branchOptions: FullBranchOptions<UserlandComponent>\n ) {\n this.treeNodeBase = new TreeNodeBase();\n const parentBranchesContainer = parent.getBranchesContainer();\n assert(parentBranchesContainer !== undefined);\n this.branchController = new BranchController(\n this,\n parentBranchesContainer\n );\n this.setIndentation(parent);\n if (\n parent instanceof TreeBranch &&\n parent.branchOptions.defaultCollapsed === true\n ) {\n treeCollapser.storePrecollapsedNode(parent, this);\n this.detachedView = this.branchController.getHostView();\n } else {\n parentBranchesContainer.insert(this.branchController.getHostView());\n this.detectChanges();\n this._parent = parent;\n this.dispatch(\n new GraftEvent(this, {\n parent: this._parent,\n child: this,\n index: this._parent.branches().length\n })\n );\n }\n }\n\n public branches(): Array<TreeBranch<UserlandComponent>> {\n return this.treeNodeBase.branches();\n }\n\n public destroy(): void {\n if (this.isDestroyed()) {\n throw new TreeError(\"Cannot destroy a destroyed tree branch\");\n }\n this.prune();\n treeCollapser.expand(this);\n dropzoneRenderer.clearTreeFromRegistry(this);\n this.branchController.getHostView().destroy();\n this.treeNodeBase.destroy();\n this.branchController.destroy();\n this.dispatch(new DestructionEvent(this));\n }\n\n public detectChanges(): void {\n this.branchController.detectChanges();\n }\n\n public dispatch(event: TreeEvent): void {\n this.treeNodeBase.dispatch(event);\n this._parent?.dispatch(event);\n }\n\n public events(): Observable<TreeEvent> {\n return this.treeNodeBase.events();\n }\n\n public getBranch(index: number): TreeBranch<UserlandComponent> | undefined {\n return this.treeNodeBase.getBranch(index);\n }\n\n public getBranchesContainer(): ViewContainerRef | undefined {\n if (this.isDestroyed()) {\n throw new TreeError(\n \"Cannot get branches container from a destroyed tree branch\"\n );\n }\n return this.branchController.getBranchesContainer();\n }\n\n public getComponentInstance(): BranchComponent<UserlandComponent> {\n if (this.isDestroyed()) {\n throw new TreeError(\n \"Cannot get component instance from a destroyed tree branch\"\n );\n }\n return this.branchController.getComponentInstance();\n }\n\n public getHostView(): ViewRef {\n if (this.isDestroyed()) {\n throw new TreeError(\n \"Cannot get component host view from a destroyed tree branch\"\n );\n }\n return this.branchController.getHostView();\n }\n\n public getNativeElement(): HTMLElement {\n if (this.isDestroyed()) {\n throw new TreeError(\n \"Cannot get native element from a destroyed tree branch\"\n );\n }\n return this.branchController.getNativeElement();\n }\n\n public getUserlandComponentRef():\n | ComponentRef<UserlandComponent>\n | undefined {\n if (this.isDestroyed()) {\n throw new TreeError(\n \"Cannot get userland component from a destroyed tree branch\"\n );\n }\n return this.branchController.getUserlandComponentRef();\n }\n\n public graftTo(\n newParent: TreeNode<TreeBranch<UserlandComponent>, NodeComponent>,\n index?: number\n ): number {\n this.checkGraftLocationValidity(newParent, index);\n const ownIndex = this.index();\n if (ownIndex !== undefined) {\n this.prune();\n }\n this._parent = newParent;\n const newIndex = index ?? newParent.branches().length;\n this.reattachView(newIndex);\n this.dispatch(\n new GraftEvent(this, {\n parent: newParent,\n child: this,\n index: newIndex\n })\n );\n return newIndex;\n }\n\n public grow(\n component: Type<UserlandComponent>,\n options?: BranchOptions<UserlandComponent>\n ): TreeBranch<UserlandComponent> {\n if (this.isDestroyed()) {\n throw new TreeError(\"Cannot grow a branch on a destroyed tree branch\");\n }\n return new TreeBranch(this, { component, ...options });\n }\n\n public index(): number | undefined {\n if (!this._parent) {\n return undefined;\n }\n const index = this._parent\n .branches()\n .findIndex((branch) => branch === this);\n assert(index >= 0);\n return index;\n }\n\n public isDestroyed(): boolean {\n return this.treeNodeBase.isDestroyed();\n }\n\n public meta(): Record<string, any> {\n return this.branchOptions.meta ?? {};\n }\n\n public parent():\n | TreeNode<TreeBranch<UserlandComponent>, NodeComponent>\n | undefined {\n return this._parent;\n }\n\n public plot(): TreePlot {\n return this.treeNodeBase.plot();\n }\n\n public position(): Array<number> {\n const index = this.index();\n if (index === undefined) {\n throw new TreeError(\n \"branch has no parent. Position cannot be determined.\"\n );\n }\n if (this._parent instanceof TreeBranch) {\n const parentPosition = this._parent.position();\n return [...parentPosition, index];\n }\n return [index];\n }\n\n public prune(): this | undefined {\n if (this.isDestroyed()) {\n throw new TreeError(\"Cannot prune a destroyed tree branch\");\n }\n const parent = this._parent;\n const index = this.index();\n if (index === undefined || parent === undefined) return;\n const container = parent.getBranchesContainer();\n assert(container !== undefined);\n this.detachedView = container.detach(index);\n assert(this.detachedView !== null);\n this.detachedView.detach();\n this.dispatch(\n new PruneEvent(this, {\n parent: parent,\n child: this,\n index: index\n })\n );\n this._parent = undefined;\n return this;\n }\n\n public root(): TreeRoot<UserlandComponent> | undefined {\n const parent = this.parent();\n if (parent instanceof TreeBranch) {\n return parent.root();\n }\n assert(parent instanceof TreeRoot || parent === undefined);\n return parent;\n }\n\n public traverse(\n callback: (\n node: TreeNode<TreeBranch<UserlandComponent>, NodeComponent>\n ) => void\n ): void {\n callback(this);\n this.treeNodeBase.traverse(callback);\n }\n\n private checkGraftLocationValidity(\n newParent: TreeNode<TreeBranch<UserlandComponent>, NodeComponent>,\n index?: number\n ): void {\n if (this.isDestroyed()) {\n throw new TreeError(\"Cannot graft a destroyed tree branch\");\n }\n if (newParent.isDestroyed()) {\n throw new TreeError(\"Cannot graft to a destroyed tree branch\");\n }\n if (\n typeof index === \"number\" &&\n this.indexIsOutOfRange(newParent, index)\n ) {\n throw new TreeError(\n `Cannot graft branch at index ${index} of the parent. Out of range.`\n );\n }\n this.traverse((node) => {\n if (node === newParent) {\n throw new TreeError(\n \"Cannot graft a branch to itself or any of its own descendants\"\n );\n }\n });\n }\n\n private indexIsOutOfRange(\n parent: TreeNode<TreeBranch<UserlandComponent>, NodeComponent>,\n index: number\n ): boolean {\n return index < 0 || index > parent.branches().length;\n }\n\n private reattachView(index?: number): void {\n assert(this._parent !== undefined);\n assert(this.detachedView !== null);\n const container = this._parent.getBranchesContainer();\n assert(container !== undefined);\n this.detachedView.reattach();\n container.insert(this.detachedView, index);\n this.detachedView = null;\n }\n\n private setIndentation(\n parent: TreeNode<TreeBranch<UserlandComponent>, NodeComponent>\n ): void {\n const root = parent.root();\n assert(root !== undefined);\n const options = config.getConfig(root);\n const branchesContainerEl = this.branchController\n .getNativeElement()\n .getElementsByClassName(\"branches-container\")\n .item(0);\n assert(branchesContainerEl instanceof HTMLElement);\n branchesContainerEl.style.marginLeft = `${options?.indentation ?? 16}px`;\n }\n}\n","import { assert } from \"../../../shared/assert\";\nimport { BranchComponent } from \"../../components/branch/branch.component\";\nimport { DropzoneComponent } from \"../../components/dropzone/dropzone.component\";\nimport { NodeComponent } from \"../../components/node-component.interface\";\nimport { dragAndDrop } from \"./drag-and-drop\";\nimport { TreeBranch } from \"../../core/tree-branch/tree-branch\";\nimport { TreeRoot } from \"../../core/tree-root/tree-root\";\nimport { dragState, DragStates } from \"./drag-state\";\nimport { filter, first } from \"rxjs\";\nimport { config } from \"../../core/configuration/configuration\";\nimport { PruneEvent } from \"../../events\";\nimport { TreeNode } from \"../../structure\";\n\nclass DropzoneRenderer {\n private currentDisplay: {\n treeBranch: TreeBranch<any> | TreeRoot<any>;\n direction: \"upper\" | \"lower\";\n } | null;\n private readonly registry: Map<\n DropzoneComponent,\n TreeBranch<any> | TreeRoot<any>\n >;\n\n public constructor() {\n this.registry = new Map();\n this.currentDisplay = null;\n dragAndDrop.dragAborted$.subscribe(() => {\n this.clearCurrentDisplay();\n });\n dragState\n .events()\n .pipe(filter((event) => event === DragStates.Starting))\n .subscribe(() => {\n const branch = dragState.getDragData();\n assert(branch !== undefined);\n let cursor = branch.parent()?.getBranch((branch.index() ?? 0) - 1);\n let final = branch.parent();\n while (cursor !== undefined) {\n final = cursor;\n cursor = cursor.branches().at(-1);\n }\n branch\n .events()\n .pipe(\n filter((event) => event instanceof PruneEvent),\n first()\n )\n .subscribe(() => {\n assert(\n final instanceof TreeBranch || final instanceof TreeRoot\n );\n this.showLowerZones(final);\n });\n });\n }\n\n public clearCurrentDisplay(): void {\n if (this.currentDisplay === null) return;\n for (const branch of this.registry.values()) {\n const instance = branch.getComponentInstance();\n instance.showInnerDropzone = false;\n if (instance instanceof BranchComponent) {\n instance.showLateralDropzone = false;\n }\n }\n this.currentDisplay = null;\n }\n\n public clearTreeFromRegistry(tree: TreeRoot<any> | TreeBranch<any>): void {\n const nodes: Array<TreeNode<TreeBranch<any>, NodeComponent>> = [];\n tree.traverse((node) => nodes.push(node));\n for (const [dropzoneComponent, treeNode] of this.registry) {\n if (nodes.includes(treeNode)) {\n this.registry.delete(dropzoneComponent);\n }\n }\n }\n\n public getCurrentDisplay(): {\n treeBranch: TreeBranch<any> | TreeRoot<any>;\n direction: \"upper\" | \"lower\";\n } | null {\n if (this.currentDisplay === null) return null;\n return { ...this.currentDisplay };\n }\n\n public getDropzoneLocation<T>(\n dropzone: DropzoneComponent\n ): [TreeBranch<T> | TreeRoot<T>, \"inner\" | \"lateral\"] {\n const branch = this.registry.get(dropzone);\n const placement = dropzone.placement;\n if (branch === undefined) {\n throw new Error(\"dropzone not found in registry\");\n }\n if (placement === undefined) {\n throw new Error(\"dropzone has an undefined placement\");\n }\n return [branch, placement];\n }\n\n public handleDrop<T>(\n treeNode: TreeBranch<T> | TreeRoot<T>,\n placement: \"inner\" | \"lateral\"\n ): void {\n if (placement === \"inner\") {\n dragAndDrop.drop(treeNode, 0);\n } else if (treeNode instanceof TreeBranch && placement === \"lateral\") {\n const currentParent = treeNode.parent();\n const index = treeNode.index();\n if (currentParent === undefined || index === undefined) {\n throw new Error(\"branch must have a parent\");\n }\n dragAndDrop.drop(currentParent, index + 1);\n }\n this.clearCurrentDisplay();\n }\n\n public registerDropzone<T>(\n dropzone: DropzoneComponent,\n treeNode: TreeBranch<T> | TreeRoot<T>\n ): void {\n this.registry.set(dropzone, treeNode);\n }\n\n public registerDropzones<T>(\n dropzones: Iterable<DropzoneComponent>,\n treeBranch: TreeBranch<T>\n ): void {\n for (const dropzone of dropzones) {\n this.registry.set(dropzone, treeBranch);\n }\n }\n\n public showLowerZones<T>(treeNode: TreeBranch<T> | TreeRoot<T>): void {\n this.clearCurrentDisplay();\n this.showInnerZone(treeNode);\n if (treeNode.branches().length === 0) {\n this.loopThroughLowerZones(treeNode);\n }\n this.currentDisplay = { treeBranch: treeNode, direction: \"lower\" };\n }\n\n public showUpperZones<T>(treeBranch: TreeBranch<T>): void {\n this.clearCurrentDisplay();\n this.loopThroughUpperZones(treeBranch);\n this.currentDisplay = { treeBranch, direction: \"upper\" };\n }\n\n private loopThroughLowerZones<T>(\n treeNode: TreeBranch<T> | TreeRoot<T>\n ): void {\n let cursor: TreeNode<TreeBranch<T>, NodeComponent> | undefined = treeNode;\n while (cursor instanceof TreeBranch) {\n this.showLateralZone(cursor);\n const parent = cursor.parent();\n const index = cursor.index();\n assert(parent !== undefined && index !== undefined);\n if (parent.branches().length > index + 1) {\n return;\n }\n cursor = cursor.parent();\n }\n }\n\n private loopThroughUpperZones<T>(treeBranch: TreeBranch<T>): void {\n let cursor = treeBranch\n .parent()\n ?.getBranch((treeBranch.index() ?? 0) - 1);\n let final = treeBranch.parent();\n while (cursor !== undefined) {\n this.showLateralZone(cursor);\n final = cursor;\n cursor = cursor.branches().at(-1);\n }\n if (\n final !== undefined &&\n (final instanceof TreeRoot || final instanceof TreeBranch)\n ) {\n this.showInnerZone(final);\n }\n }\n\n private nestingAllowed(treeNode: unknown): boolean {\n if (treeNode instanceof TreeRoot) {\n return true;\n }\n if (treeNode instanceof TreeBranch) {\n const allowNesting =\n config.getConfig(treeNode.root())?.dragAndDrop?.allowNesting ??\n ((): true => true);\n return allowNesting(treeNode);\n }\n throw new Error(\"unsupported treeNode type\");\n }\n\n private dropAllowed(parent: unknown, index: number): boolean {\n const sourceNode = dragState.getDragData();\n assert(sourceNode instanceof TreeBranch);\n if (parent instanceof TreeRoot) {\n const allowDrop =\n config.getConfig(parent)?.dragAndDrop?.allowDrop ??\n ((): true => true);\n return allowDrop(sourceNode, parent, index);\n }\n if (parent instanceof TreeBranch) {\n const allowDrop =\n config.getConfig(parent.root())?.dragAndDrop?.allowDrop ??\n ((): true => true);\n return allowDrop(sourceNode, parent, index);\n }\n throw new Error(\"unsupported treeNode type\");\n }\n\n private showInnerZone<T>(treeNode: TreeBranch<T> | TreeRoot<T>): void {\n if (!this.nestingAllowed(treeNode) || !this.dropAllowed(treeNode, 0))\n return;\n treeNode.getComponentInstance().showInnerDropzone = true;\n }\n\n private showLateralZone<T>(treeBranch: TreeBranch<T>): void {\n const index = treeBranch.index();\n assert(index !== undefined);\n if (!this.dropAllowed(treeBranch.parent(), index + 1)) return;\n treeBranch.getComponentInstance().showLateralDropzone = true;\n }\n}\n\nexport const dropzoneRenderer = new DropzoneRenderer();\n","import { Injectable } from \"@angular/core\";\nimport { Observable } from \"rxjs\";\nimport { TreeBranch, TreeRoot } from \"../../core\";\nimport { dragAndDrop } from \"./drag-and-drop\";\nimport { dragState, DragStates } from \"./drag-state\";\nimport { dropzoneRenderer } from \"./dropzone-renderer\";\n\n@Injectable()\nexport class TreeDragAndDropService {\n public clearDropzones(): void {\n dropzoneRenderer.clearCurrentDisplay();\n }\n\n public dragStart<T>(treeBranch: TreeBranch<T>, event: DragEvent): void {\n dragAndDrop.dragStart(treeBranch, event);\n }\n\n public getCurrentlyDisplayedDropzoneFamily(): {\n treeBranch: TreeRoot<any> | TreeBranch<any>;\n direction: \"upper\" | \"lower\";\n } | null {\n return dropzoneRenderer.getCurrentDisplay();\n }\n\n public showRootDropzone<T>(root: TreeRoot<T>): void {\n dropzoneRenderer.showLowerZones(root);\n }\n\n public state(): Observable<DragStates> {\n return dragState.events();\n }\n}\n","import {\n Directive,\n ElementRef,\n HostListener,\n Input,\n Renderer2\n} from \"@angular/core\";\nimport { TreeBranch } from \"../../core\";\nimport { TreeDragAndDropService } from \"./drag-and-drop.service\";\n\n@Directive({\n selector: \"[limbleTreeDraggable]\",\n standalone: true\n})\nexport class DraggableDirective {\n @Input() limbleTreeDraggable?: TreeBranch<any> | undefined;\n\n public constructor(\n private readonly dragAndDropService: TreeDragAndDropService,\n renderer: Renderer2,\n hostElement: ElementRef<HTMLElement>\n ) {\n renderer.setAttribute(hostElement.nativeElement, \"draggable\", \"true\");\n renderer.setStyle(hostElement.nativeElement, \"cursor\", \"grab\");\n }\n\n @HostListener(\"dragstart\", [\"$event\"]) public onDragstart(\n event: DragEvent\n ): void {\n if (this.limbleTreeDraggable === undefined) return;\n this.dragAndDropService.dragStart(this.limbleTreeDraggable, event);\n }\n}\n","import { NgModule } from \"@angular/core\";\nimport { TreeDragAndDropService } from \"./drag-and-drop.service\";\nimport { DraggableDirective } from \"./draggable.directive\";\nimport { DragoverNoChangeDetectDirective } from \"./dragover-no-change-detect\";\n\n@NgModule({\n imports: [DraggableDirective, DragoverNoChangeDetectDirective],\n providers: [TreeDragAndDropService],\n exports: [DraggableDirective, DragoverNoChangeDetectDirective]\n})\nexport class TreeDragAndDropModule {}\n","import { Type, ViewContainerRef } from \"@angular/core\";\nimport { TreeRoot, TreeBranch, TreeOptions, config } from \"../core\";\nimport { LimbleTreeOptions as LegacyLimbleTreeOptions } from \"./legacy-tree-options.interface\";\nimport { LimbleTreeData, LimbleTreeNode } from \"./legacy-tree-data.interface\";\nimport { TreeError } from \"../errors\";\nimport { treeCollapser } from \"../extras/collapse/collapse\";\n\n/**\n * A shim to help with the transition from v0 to v1.\n * @deprecated\n */\nexport class LegacyTree {\n /** Creates a v1 tree structure from a v0 data array and v0 tree options. */\n public createTreeFromLegacyArray<Component>(\n container: ViewContainerRef,\n data: LimbleTreeData,\n treeOptions: LegacyLimbleTreeOptions = {}\n ): TreeRoot<Component> {\n const root = new TreeRoot<Component>(container);\n config.setConfig(root, this.upgradeOptions(treeOptions));\n for (const node of data) {\n this.renderTreeNode(root, node, treeOptions);\n }\n return root;\n }\n\n public upgradeOptions(legacyOptions: LegacyLimbleTreeOptions): TreeOptions {\n return {\n indentation: legacyOptions.indent,\n dragAndDrop: {\n allowNesting: (branch): boolean => {\n if (legacyOptions.listMode === true) {\n return false;\n }\n if (legacyOptions.allowNesting === undefined) {\n return true;\n }\n if (typeof legacyOptions.allowNesting === \"boolean\") {\n return legacyOptions.allowNesting;\n }\n return legacyOptions.allowNesting(branch as any);\n },\n allowDragging: (branch): boolean => {\n if (legacyOptions.allowDragging === undefined) {\n return true;\n }\n if (typeof legacyOptions.allowDragging === \"boolean\") {\n return legacyOptions.allowDragging;\n }\n return legacyOptions.allowDragging(branch as any);\n },\n allowDrop: (source, parent, index): boolean => {\n if (legacyOptions.allowDrop === undefined) {\n return true;\n }\n return legacyOptions.allowDrop(\n source as any,\n parent as any,\n index\n );\n }\n }\n };\n }\n\n private renderTreeNode<T>(\n parent: TreeRoot<T> | TreeBranch<T>,\n node: LimbleTreeNode,\n options: LegacyLimbleTreeOptions\n ): void {\n const component =\n node.component?.class ?? options.defaultComponent?.class;\n if (component === undefined) {\n throw new TreeError(\"A component must be provided\");\n }\n const bindings = (node.component?.bindings ??\n options.defaultComponent?.bindings ??\n {}) as { [K in keyof T]?: T[K] | undefined };\n const nodeData = node;\n const branch = parent.grow(component as Type<T>, {\n inputBindings: bindings,\n meta: { nodeData }\n });\n for (const childNode of node.nodes ?? []) {\n this.renderTreeNode(branch, childNode, options);\n }\n if (node.collapsed === true) {\n treeCollapser.collapse(branch);\n }\n }\n}\n","import {\n AfterViewInit,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n ViewChild,\n ViewContainerRef\n} from \"@angular/core\";\nimport { LegacyTree } from \"../legacy-tree\";\nimport { TreeError } from \"../../errors\";\nimport { LimbleTreeData } from \"../legacy-tree-data.interface\";\nimport { LimbleTreeOptions } from \"../legacy-tree-options.interface\";\nimport { TreeRoot } from \"../../core\";\nimport { filter, Subscription } from \"rxjs\";\nimport { DragEndEvent } from \"../../events\";\nimport { assert } from \"../../../shared/assert\";\n\n/** @deprecated */\n@Component({\n selector: \"limble-tree-root\",\n templateUrl: \"./limble-tree-root.component.html\",\n standalone: true\n})\nexport class LimbleTreeRootComponent\n implements AfterViewInit, OnChanges, OnDestroy\n{\n @Input() data?: LimbleTreeData;\n @Input() options?: LimbleTreeOptions | undefined;\n @Input() itemsPerPage: number = Infinity;\n @Input() page: number = 1;\n\n @ViewChild(\"host\", { read: ViewContainerRef }) host?: ViewContainerRef;\n\n @Output() readonly treeChange = new EventEmitter<TreeRoot<any>>();\n @Output() readonly treeDrop = new EventEmitter<DragEndEvent<any>>();\n\n private dropSubscription?: Subscription;\n private readonly legacyTree: LegacyTree;\n private root?: TreeRoot<any>;\n\n public constructor() {\n this.legacyTree = new LegacyTree();\n }\n\n public ngAfterViewInit(): void {\n this.update();\n }\n\n public ngOnChanges(): void {\n if (this.host !== undefined && this.data !== undefined) {\n this.update();\n }\n }\n\n public ngOnDestroy(): void {\n this.dropSubscription?.unsubscribe();\n this.root?.destroy();\n }\n\n public getRoot(): TreeRoot<any> | undefined {\n return this.root;\n }\n\n public update(): void {\n if (this.data === undefined) {\n throw new TreeError(\n \"LimbleTreeRootComponent's `data` input is required\"\n );\n }\n if (this.host === undefined) {\n throw new TreeError(\n \"LimbleTreeRootComponent's `host` property is not defined\"\n );\n }\n this.root?.destroy();\n this.dropSubscription?.unsubscribe();\n const dataSlice = this.paginatedData();\n this.root = this.legacyTree.createTreeFromLegacyArray(\n this.host,\n dataSlice,\n this.options\n );\n this.dropSubscription = this.root\n .events()\n .pipe(\n filter(\n (event): event is DragEndEvent<any> =>\n event instanceof DragEndEvent\n )\n )\n .subscribe(this.treeDrop);\n this.treeChange.emit(this.root);\n }\n\n private paginatedData(): LimbleTreeData {\n assert(this.data !== undefined);\n if (this.options?.listMode !== true) {\n return this.data;\n }\n return this.data.slice(\n (this.page - 1) * this.itemsPerPage,\n this.page * this.itemsPerPage\n );\n }\n}\n","<div #host></div>\n","import { NgModule } from \"@angular/core\";\nimport { LegacyTree } from \"./legacy-tree\";\nimport { LimbleTreeRootComponent } from \"./limble-tree-root/limble-tree-root.component\";\n\n/** @deprecated */\n@NgModule({\n declarations: [],\n imports: [LimbleTreeRootComponent],\n providers: [LegacyTree],\n exports: [LimbleTreeRootComponent]\n})\nexport class LimbleTreeLegacyModule {}\n","import { NgModule } from \"@angular/core\";\nimport { TreeCollapseModule } from \"./extras/collapse\";\nimport { TreeDragAndDropModule } from \"./extras/drag-and-drop\";\nimport { TreeService } from \"./core/tree-service/tree.service\";\nimport { LimbleTreeLegacyModule } from \"./legacy\";\n\n@NgModule({\n declarations: [],\n imports: [LimbleTreeLegacyModule, TreeCollapseModule, TreeDragAndDropModule],\n providers: [TreeService],\n exports: [LimbleTreeLegacyModule, TreeCollapseModule, TreeDragAndDropModule]\n})\nexport class LimbleTreeModule {}\n","/*\n * Public API Surface of limble-tree\n */\n\nexport * from \"./lib/limble-tree.module\";\nexport * from \"./lib/core\";\nexport * from \"./lib/errors\";\nexport * from \"./lib/events\";\nexport * from \"./lib/structure\";\nexport * from \"./lib/extras/collapse\";\nexport * from \"./lib/extras/drag-and-drop\";\nexport * from \"./lib/legacy\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.TreeDragAndDropService"],"mappings":";;;;;;;AAEA,MAAM,aAAa,CAAA;AAGhB,IAAA,WAAA,GAAA;AACG,QAAA,IAAI,CAAC,WAAW,GAAG,IAAI,GAAG,EAAE,CAAC;KAC/B;AAEM,IAAA,QAAQ,CAAI,UAAyB,EAAA;AACzC,QAAA,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAC/C,MAAM,QAAQ,GAAyB,EAAE,CAAC;QAC1C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC3C,UAAU,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,MAAM,KAAI;YACtC,MAAM,CAAC,KAAK,EAAE,CAAC;AACf,Y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