@tft/interact 21.0.5 → 21.0.7
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe, InjectionToken, inject, RendererFactory2, NgZone, Injectable, ElementRef, Input, Directive, Renderer2, EventEmitter, Output, HostBinding, TemplateRef, HostListener, ViewContainerRef, DOCUMENT, ContentChild, NgModule } from '@angular/core';
|
|
2
|
+
import { Pipe, InjectionToken, inject, RendererFactory2, NgZone, Injectable, ElementRef, Input, Directive, Renderer2, EventEmitter, Output, HostBinding, TemplateRef, HostListener, ViewContainerRef, DOCUMENT, ContentChild, signal, computed, NgModule } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import interact from 'interactjs';
|
|
5
5
|
import { BehaviorSubject, combineLatest, Subject } from 'rxjs';
|
|
@@ -1087,6 +1087,164 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImpor
|
|
|
1087
1087
|
args: ['style.fontSize']
|
|
1088
1088
|
}] } });
|
|
1089
1089
|
|
|
1090
|
+
/**
|
|
1091
|
+
* Directive that handles lasso (drag-to-select) interaction geometry.
|
|
1092
|
+
* Manages mouse tracking, the visual selection rectangle, and click suppression.
|
|
1093
|
+
* Domain-specific hit-testing (what got selected) is the consumer's responsibility:
|
|
1094
|
+
* listen to `(lassoCommit)` with the viewport-space bounding rect and query your own elements.
|
|
1095
|
+
*
|
|
1096
|
+
* Usage:
|
|
1097
|
+
* ```html
|
|
1098
|
+
* <div tftLasso #lasso="tftLasso" [scale]="scale"
|
|
1099
|
+
* (lassoStart)="onStart()" (lassoCommit)="onCommit($event)">
|
|
1100
|
+
* @if (lasso.lassoDisplayRect(); as r) {
|
|
1101
|
+
* <div class="lasso-rect" [style.left.px]="r.x" [style.top.px]="r.y"
|
|
1102
|
+
* [style.width.px]="r.w" [style.height.px]="r.h"></div>
|
|
1103
|
+
* }
|
|
1104
|
+
* </div>
|
|
1105
|
+
* ```
|
|
1106
|
+
*/
|
|
1107
|
+
class LassoDirective {
|
|
1108
|
+
constructor() {
|
|
1109
|
+
this.host = inject((ElementRef));
|
|
1110
|
+
/** Scale factor applied to the host element — used to convert viewport px to container-local px. */
|
|
1111
|
+
this.scale = 1;
|
|
1112
|
+
/** When true, lasso interaction is disabled. */
|
|
1113
|
+
this.lassoDisabled = false;
|
|
1114
|
+
/** Emitted on mousedown (before any drag). Use to clear previous selection state. */
|
|
1115
|
+
this.lassoStart = new EventEmitter();
|
|
1116
|
+
/**
|
|
1117
|
+
* Emitted on mouseup when the drag exceeded the 5 px threshold.
|
|
1118
|
+
* Rect is in viewport (clientX/Y) space — pass directly to getBoundingClientRect comparisons.
|
|
1119
|
+
*/
|
|
1120
|
+
this.lassoCommit = new EventEmitter();
|
|
1121
|
+
// -------------------------------------------------------------------------
|
|
1122
|
+
// Internal state
|
|
1123
|
+
// -------------------------------------------------------------------------
|
|
1124
|
+
this._startVP = null;
|
|
1125
|
+
this._currentVP = null;
|
|
1126
|
+
this._startLocal = signal(null, ...(ngDevMode ? [{ debugName: "_startLocal" }] : []));
|
|
1127
|
+
this._currentLocal = signal(null, ...(ngDevMode ? [{ debugName: "_currentLocal" }] : []));
|
|
1128
|
+
this._suppressNextClick = false;
|
|
1129
|
+
this._activePointerId = null;
|
|
1130
|
+
/** True while a lasso drag is in progress. */
|
|
1131
|
+
this.isLassoing = signal(false, ...(ngDevMode ? [{ debugName: "isLassoing" }] : []));
|
|
1132
|
+
/**
|
|
1133
|
+
* Rectangle in container-local CSS pixels (pre-divided by scale) — bind directly to
|
|
1134
|
+
* [style.left.px], [style.top.px], [style.width.px], [style.height.px].
|
|
1135
|
+
* Null when no drag is in progress.
|
|
1136
|
+
*/
|
|
1137
|
+
this.lassoDisplayRect = computed(() => {
|
|
1138
|
+
const s = this._startLocal();
|
|
1139
|
+
const c = this._currentLocal();
|
|
1140
|
+
if (!s || !c || !this.isLassoing())
|
|
1141
|
+
return null;
|
|
1142
|
+
return {
|
|
1143
|
+
x: Math.min(s.x, c.x),
|
|
1144
|
+
y: Math.min(s.y, c.y),
|
|
1145
|
+
w: Math.abs(c.x - s.x),
|
|
1146
|
+
h: Math.abs(c.y - s.y),
|
|
1147
|
+
};
|
|
1148
|
+
}, ...(ngDevMode ? [{ debugName: "lassoDisplayRect" }] : []));
|
|
1149
|
+
}
|
|
1150
|
+
toLocal(vpX, vpY) {
|
|
1151
|
+
const rect = this.host.nativeElement.getBoundingClientRect();
|
|
1152
|
+
return {
|
|
1153
|
+
x: (vpX - rect.left) / this.scale,
|
|
1154
|
+
y: (vpY - rect.top) / this.scale,
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
// -------------------------------------------------------------------------
|
|
1158
|
+
// Event handling
|
|
1159
|
+
// -------------------------------------------------------------------------
|
|
1160
|
+
onPointerDown(e) {
|
|
1161
|
+
if (this.lassoDisabled)
|
|
1162
|
+
return;
|
|
1163
|
+
if (e.target !== e.currentTarget)
|
|
1164
|
+
return; // ignore clicks on children
|
|
1165
|
+
this._activePointerId = e.pointerId;
|
|
1166
|
+
this.host.nativeElement.setPointerCapture(e.pointerId); // track movement outside element bounds
|
|
1167
|
+
this._startVP = { x: e.clientX, y: e.clientY };
|
|
1168
|
+
this._currentVP = { x: e.clientX, y: e.clientY };
|
|
1169
|
+
this._startLocal.set(this.toLocal(e.clientX, e.clientY));
|
|
1170
|
+
this._currentLocal.set(this.toLocal(e.clientX, e.clientY));
|
|
1171
|
+
this.isLassoing.set(true);
|
|
1172
|
+
this.lassoStart.emit();
|
|
1173
|
+
e.preventDefault();
|
|
1174
|
+
}
|
|
1175
|
+
onPointerMove(e) {
|
|
1176
|
+
if (!this.isLassoing() || e.pointerId !== this._activePointerId)
|
|
1177
|
+
return;
|
|
1178
|
+
this._currentVP = { x: e.clientX, y: e.clientY };
|
|
1179
|
+
this._currentLocal.set(this.toLocal(e.clientX, e.clientY));
|
|
1180
|
+
}
|
|
1181
|
+
onPointerUp(e) {
|
|
1182
|
+
if (!this.isLassoing() || e.pointerId !== this._activePointerId)
|
|
1183
|
+
return;
|
|
1184
|
+
this.isLassoing.set(false);
|
|
1185
|
+
this._activePointerId = null;
|
|
1186
|
+
const s = this._startVP;
|
|
1187
|
+
const c = this._currentVP;
|
|
1188
|
+
this._startVP = null;
|
|
1189
|
+
this._currentVP = null;
|
|
1190
|
+
this._startLocal.set(null);
|
|
1191
|
+
this._currentLocal.set(null);
|
|
1192
|
+
// Treat tiny drags (< 5 px) as background clicks — clear, don't commit
|
|
1193
|
+
if (Math.abs(c.x - s.x) < 5 && Math.abs(c.y - s.y) < 5)
|
|
1194
|
+
return;
|
|
1195
|
+
this._suppressNextClick = true;
|
|
1196
|
+
this.lassoCommit.emit({
|
|
1197
|
+
left: Math.min(s.x, c.x),
|
|
1198
|
+
right: Math.max(s.x, c.x),
|
|
1199
|
+
top: Math.min(s.y, c.y),
|
|
1200
|
+
bottom: Math.max(s.y, c.y),
|
|
1201
|
+
});
|
|
1202
|
+
}
|
|
1203
|
+
/** Suppresses the click event that fires immediately after a real lasso drag ends. */
|
|
1204
|
+
onClick(e) {
|
|
1205
|
+
if (this._suppressNextClick) {
|
|
1206
|
+
this._suppressNextClick = false;
|
|
1207
|
+
e.stopPropagation();
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: LassoDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1211
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.6", type: LassoDirective, isStandalone: false, selector: "[tftLasso]", inputs: { scale: "scale", lassoDisabled: "lassoDisabled" }, outputs: { lassoStart: "lassoStart", lassoCommit: "lassoCommit" }, host: { listeners: { "pointerdown": "onPointerDown($event)", "pointermove": "onPointerMove($event)", "pointerup": "onPointerUp($event)", "pointercancel": "onPointerUp($event)", "click": "onClick($event)" }, properties: { "style.touch-action": "lassoDisabled ? \"auto\" : \"none\"" } }, exportAs: ["tftLasso"], ngImport: i0 }); }
|
|
1212
|
+
}
|
|
1213
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: LassoDirective, decorators: [{
|
|
1214
|
+
type: Directive,
|
|
1215
|
+
args: [{
|
|
1216
|
+
selector: '[tftLasso]',
|
|
1217
|
+
exportAs: 'tftLasso',
|
|
1218
|
+
standalone: false,
|
|
1219
|
+
host: {
|
|
1220
|
+
'[style.touch-action]': 'lassoDisabled ? "auto" : "none"',
|
|
1221
|
+
},
|
|
1222
|
+
}]
|
|
1223
|
+
}], propDecorators: { scale: [{
|
|
1224
|
+
type: Input
|
|
1225
|
+
}], lassoDisabled: [{
|
|
1226
|
+
type: Input
|
|
1227
|
+
}], lassoStart: [{
|
|
1228
|
+
type: Output
|
|
1229
|
+
}], lassoCommit: [{
|
|
1230
|
+
type: Output
|
|
1231
|
+
}], onPointerDown: [{
|
|
1232
|
+
type: HostListener,
|
|
1233
|
+
args: ['pointerdown', ['$event']]
|
|
1234
|
+
}], onPointerMove: [{
|
|
1235
|
+
type: HostListener,
|
|
1236
|
+
args: ['pointermove', ['$event']]
|
|
1237
|
+
}], onPointerUp: [{
|
|
1238
|
+
type: HostListener,
|
|
1239
|
+
args: ['pointerup', ['$event']]
|
|
1240
|
+
}, {
|
|
1241
|
+
type: HostListener,
|
|
1242
|
+
args: ['pointercancel', ['$event']]
|
|
1243
|
+
}], onClick: [{
|
|
1244
|
+
type: HostListener,
|
|
1245
|
+
args: ['click', ['$event']]
|
|
1246
|
+
}] } });
|
|
1247
|
+
|
|
1090
1248
|
const EXPORTS = [
|
|
1091
1249
|
DraggableDirective,
|
|
1092
1250
|
ResizableDirective,
|
|
@@ -1097,6 +1255,7 @@ const EXPORTS = [
|
|
|
1097
1255
|
AccountForScaleDirective,
|
|
1098
1256
|
ApplyScaleDirective,
|
|
1099
1257
|
DragPreviewDirective,
|
|
1258
|
+
LassoDirective,
|
|
1100
1259
|
ArrayOfNPipe,
|
|
1101
1260
|
];
|
|
1102
1261
|
class InteractModule {
|
|
@@ -1120,6 +1279,7 @@ class InteractModule {
|
|
|
1120
1279
|
AccountForScaleDirective,
|
|
1121
1280
|
ApplyScaleDirective,
|
|
1122
1281
|
DragPreviewDirective,
|
|
1282
|
+
LassoDirective,
|
|
1123
1283
|
ArrayOfNPipe], imports: [CommonModule], exports: [DraggableDirective,
|
|
1124
1284
|
ResizableDirective,
|
|
1125
1285
|
DropzoneDirective,
|
|
@@ -1129,6 +1289,7 @@ class InteractModule {
|
|
|
1129
1289
|
AccountForScaleDirective,
|
|
1130
1290
|
ApplyScaleDirective,
|
|
1131
1291
|
DragPreviewDirective,
|
|
1292
|
+
LassoDirective,
|
|
1132
1293
|
ArrayOfNPipe] }); }
|
|
1133
1294
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: InteractModule, imports: [CommonModule] }); }
|
|
1134
1295
|
}
|
|
@@ -1150,5 +1311,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImpor
|
|
|
1150
1311
|
* Generated bundle index. Do not edit.
|
|
1151
1312
|
*/
|
|
1152
1313
|
|
|
1153
|
-
export { AccountForScaleDirective, ApplyScaleDirective, ArrayOfNPipe, AutoScrollDirective, DEFAULT_REGISTRY_ID, DragPreviewDirective, DragRootDirective, DraggableDirective, DropzoneDirective, GesturableDirective, INTERACT_ROOT_CONFIG, InteractModule, ResizableDirective, TFT_DRAG_PREVIEW, cloneElement$1 as cloneElement, defaultDelta, defaultPosition, defaultSize, getClosestMatchingAncestor, getRootNode };
|
|
1314
|
+
export { AccountForScaleDirective, ApplyScaleDirective, ArrayOfNPipe, AutoScrollDirective, DEFAULT_REGISTRY_ID, DragPreviewDirective, DragRootDirective, DraggableDirective, DropzoneDirective, GesturableDirective, INTERACT_ROOT_CONFIG, InteractModule, LassoDirective, ResizableDirective, TFT_DRAG_PREVIEW, cloneElement$1 as cloneElement, defaultDelta, defaultPosition, defaultSize, getClosestMatchingAncestor, getRootNode };
|
|
1154
1315
|
//# sourceMappingURL=tft-interact.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tft-interact.mjs","sources":["../../../../libs/interact/src/lib/pipes/array-of-n.pipe.ts","../../../../libs/interact/src/lib/models/interact.ts","../../../../libs/interact/src/lib/services/interact.service.ts","../../../../libs/interact/src/lib/directives/account-for-scale.directive.ts","../../../../libs/interact/src/lib/directives/dropzone.directive.ts","../../../../libs/interact/src/lib/directives/drag-preview.directive.ts","../../../../libs/interact/src/lib/utils/helpers.ts","../../../../libs/interact/src/lib/directives/drag-root.directive.ts","../../../../libs/interact/src/lib/directives/auto-scroll.directive.ts","../../../../libs/interact/src/lib/directives/draggable.directive.ts","../../../../libs/interact/src/lib/directives/resizable.directive.ts","../../../../libs/interact/src/lib/directives/gesturable.directive.ts","../../../../libs/interact/src/lib/directives/apply-scale.directive.ts","../../../../libs/interact/src/lib/interact.module.ts","../../../../libs/interact/src/tft-interact.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'arrayOfN',\n standalone: false\n})\nexport class ArrayOfNPipe implements PipeTransform {\n\n /**\n * \n * @param n the number to make an array of \n * @param max the max length of the array (useful for limiting rendering in ngFor loop)\n */\n transform(n: number, max: number): any {\n const length = ((max && max < n) || n === Infinity) ? max : n;\n return new Array(length).fill(length).map((x,i)=> i); \n }\n\n}\n","import { DropzoneDirective, DraggableDirective, GesturableDirective, ResizableDirective } from '../directives';\nimport { Point, DragEvent, ResizeEvent, Interactable, DropEvent, GestureEvent } from '@interactjs/types';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { InjectionToken } from '@angular/core';\n\n\n\nexport type CssDimensionUnit = 'px' | 'em';\nexport interface InteractRootConfig {\n cssDimensionUnit: CssDimensionUnit;\n}\nexport const INTERACT_ROOT_CONFIG = new InjectionToken<InteractRootConfig>('INTERACT_ROOT_CONFIG_PARAMS');\n\nexport const DEFAULT_REGISTRY_ID = 'DEFAULT';\n/**\n * Default initial value for Delta BehaviorSubject\n */\nexport const defaultDelta: Delta = {\n deltaX: 0,\n deltaY: 0,\n targetElement: null\n};\n/**\n * Default initial value for Size BehaviorSubject\n */\nexport const defaultSize: Size = {\n width: null,\n height: null,\n targetElement: null\n}\n/**\n * Default initial value for Position BehaviorSubject\n */\nexport const defaultPosition: Position = {\n x: 0,\n y: 0,\n targetElement: null\n}\n/**\n * The shape of the state/events/behavior system for each dropzone\n * and the DEFAULT_REGISTRY_ID system (for drop components initialized outside\n * of a dropzone).\n */\nexport interface InteractableSystem {\n deltas$: BehaviorSubject<Delta>;\n position$: BehaviorSubject<Position>;\n size$: BehaviorSubject<Size & Delta>;\n\n interactable$: Observable<TftCoords>;\n}\n/**\n * The key map of InteractableSystems. One for the drag components\n * that originated outside of a dropzone, plus one for each dropzone.\n */\nexport interface InteractableRegistry {\n [key: string]: InteractableSystem\n}\n\n/**\n * HTMLElement with helpful drag directives attached to facilitate moving drag data between dropzones\n */\nexport type TftDragElement = HTMLElement & {\n dragRef?: DraggableDirective\n dragOrigin?: DropzoneDirective\n dropTarget?: DropzoneDirective\n}\n\n/**\n * HTMLElement with helpful drag directives attached to facilitate moving drag data between dropzones\n */\n export type TftResizeElement = HTMLElement & {\n resizeRef?: ResizableDirective\n}\n\n/**\n * Extends the interact drop events by adding reference to the dropped components drag\n * directive to the html element. This gives the dropzone access to things like data\n * and parent dropzone of the dropped component.\n */\nexport type NgDropEvent = DropEvent & {\n draggable: Interactable & {\n target: TftDragElement;\n };\n relatedTarget: TftDragElement;\n};\n/**\n * Extends the interact resize events by adding a reference to the dragRef\n * directive to the html element.\n */\nexport type NgResizeEvent = ResizeEvent & {\n draggable: Interactable & {\n target: TftDragElement;\n };\n};\n/**\n * We extend the interact DragEvent a little here, adding to the target element references for:\n * - the component we are dragging (dragRef)\n * - the dropzone component where the drag component originated (dragOrigin)\n * - the dropzone component that it was dropped in (dropTarget)\n * This helps us to pass references to directive classes as events like dragenter and drag exit happens.\n * We use these references to emit a (mostly) consistent event across drag, drop, resize event.\n */\nexport type NgDragEvent = DragEvent & {\n dropzone: { target: HTMLElement},\n target: TftDragElement\n};\n/**\n * Event emitted when resizing, dragging, dropping\n */\nexport interface TftInteractableEvent {\n dragRef: DraggableDirective;\n dragOrigin?: DropzoneDirective;\n dropTarget?: DropzoneDirective;\n positionInDropTarget: Point;\n}\n/**\n * Event emitted on drop\n */\nexport interface TftDropEvent extends TftInteractableEvent {\n interactEvent: NgDropEvent\n}\n/**\n * Event emitted on drag\n */\nexport interface TftDragEvent extends TftInteractableEvent {\n interactEvent: NgDragEvent\n}\n/**\n * Event emitted on resize\n */\nexport interface TftResizeEvent extends TftInteractableEvent {\n interactEvent: ResizeEvent,\n resizeRef: ResizableDirective\n size: {\n width: number;\n height: number;\n }\n}\n\nexport type TftCoords= Delta & Position & Size;\n\nexport interface Delta {\n deltaX: number | null;\n deltaY: number | null;\n targetElement: TftDragElement | null;\n}\n\nexport interface Position {\n x: number | null;\n y: number | null;\n targetElement: TftDragElement | null;\n}\n\nexport interface Size {\n width: number | null;\n height: number | null;\n targetElement: TftResizeElement | null;\n}\n\nexport interface TftGestureEvent {\n gestureRef: GesturableDirective;\n interactEvent: GestureEvent;\n}\n","\nimport { Injectable, Renderer2, RendererFactory2, NgZone, inject } from '@angular/core';\nimport { BehaviorSubject, Observable, combineLatest } from 'rxjs';\nimport { tap, map, shareReplay } from 'rxjs/operators';\nimport {\n TftCoords, Delta, Size, Position, InteractableRegistry,\n defaultPosition, defaultSize, defaultDelta, DEFAULT_REGISTRY_ID, TftDragElement, TftResizeElement, INTERACT_ROOT_CONFIG, InteractRootConfig\n} from '../models';\n\n\n\n@Injectable({providedIn: 'root'})\nexport class InteractService {\n private rendererFactory = inject(RendererFactory2);\n private ngZone = inject(NgZone);\n rootConfig = inject(INTERACT_ROOT_CONFIG, { optional: true });\n\n\n private _interactableIndex = 0;\n private _dropzoneIndex = 0;\n private renderer: Renderer2;\n\n // TODO: consider using Map here\n readonly dragRegistrySystem: { [key: string]: InteractableRegistry } = { };\n private cssUnit = 'px'\n constructor() {\n const rootConfig = this.rootConfig;\n\n this.renderer = this.rendererFactory.createRenderer(null, null);\n this.cssUnit = rootConfig?.cssDimensionUnit || 'px';\n }\n\n addDeltaToPosition(delta: Delta, position: Position) {\n return {\n x: delta.deltaX + position.x,\n y: delta.deltaY + position.y,\n targetElement: position.targetElement || delta.targetElement\n }\n }\n\n addRegistryToSystem(customRegistryId: string | null = null) {\n const registryId = customRegistryId || this.createDropzoneId(this._dropzoneIndex++);\n this.dragRegistrySystem[registryId] = {};\n return registryId;\n }\n\n addDraggableToRegistry(customRegistryId = null, interactableId: string | null = null ) {\n const registryId = customRegistryId || DEFAULT_REGISTRY_ID;\n // if we pass an id to createInteractableId then it is used when creating the interactable\n // and returned, otherwise a new id is created for the draggable.\n const key = this.createInteractableId(interactableId );\n if (!Object.prototype.hasOwnProperty.call(this.dragRegistrySystem, registryId)) {\n this.dragRegistrySystem[registryId] = {};\n }\n this.dragRegistrySystem[registryId][key] = this.createInteractableState(defaultPosition, defaultSize, defaultDelta);\n return key\n }\n\n destroyInteractable(interactableId: string, registryId = DEFAULT_REGISTRY_ID) {\n const interactableSystem =this.dragRegistrySystem[registryId][interactableId];\n if(interactableSystem) {\n // unsubscribe from all the subscriptions if they're subscriptions\n for (const propName in interactableSystem) {\n const prop = interactableSystem[propName];\n if (prop.unsubscribe && typeof prop.unsubscribe === 'function' ) {\n prop.unsubscribe();\n };\n }\n delete this.dragRegistrySystem[registryId][interactableId];\n }\n }\n\n subscribeToInteractable(interactableId: string, registryId = DEFAULT_REGISTRY_ID) {\n return this.dragRegistrySystem[registryId][interactableId];\n }\n\n createInteractableState(initialPosition: Position, initialSize: Size, initialDelta: Delta ) {\n\n const deltas$ = new BehaviorSubject(initialDelta);\n // tracks the size of the element\n const size$ = new BehaviorSubject({...initialSize, ...initialDelta});\n // Stream of positions as they change\n const position$ = new BehaviorSubject(initialPosition);\n\n // All draggable data mapped together\n const interactable$: Observable<TftCoords> = combineLatest([\n size$.pipe(\n // startWith({...initialSize, ...initialDelta}),\n shareReplay(1),\n // filter(resizeEvent => !!resizeEvent.targetElement),\n tap(({deltaX, deltaY, width, height, targetElement}) => {\n this.ngZone.runOutsideAngular(() => {\n this.setElementSize(width, height, targetElement);\n });\n // only reposition if necessary i.e when resizing left or up\n if(deltaX || deltaY) {\n deltas$.next({deltaX, deltaY, targetElement});\n }\n })\n ),\n deltas$.pipe(\n shareReplay(1),\n tap((delta) => {\n const position = position$.value;\n const newPosition = this.addDeltaToPosition(delta, position);\n position$.next(newPosition);\n })\n ),\n position$.pipe(\n shareReplay(1),\n tap( position => {\n this.ngZone.runOutsideAngular(() => {\n this.setElementTransform(position.x, position.y, position);\n })\n })\n )\n ]).pipe(\n shareReplay(1),\n map( ([size, deltas, position]): TftCoords=> {\n return {\n x: position.x,\n y: position.y,\n deltaX: deltas.deltaX,\n deltaY: deltas.deltaY,\n width: size.width,\n height: size.height,\n targetElement: size.targetElement || position.targetElement || deltas.targetElement\n }\n }),\n )\n // TODO: update system to handle only returning interactable$\n return {\n deltas$,\n position$,\n size$,\n interactable$\n }\n }\n\n createInteractableId(customInteractableId: string | null = null) {\n return customInteractableId || `interactable${this._interactableIndex++}`\n }\n\n createDropzoneId(index: number) {\n return `dropzone${index}`\n }\n\n getInteractableState( interactableId: string, registryId = DEFAULT_REGISTRY_ID) {\n return this.dragRegistrySystem[registryId][interactableId].interactable$;\n }\n\n updateDeltas(interactId: string, registryId: string, { deltaX, deltaY }, targetElement) {\n if (!this.interactableExistOnRegistry(interactId, registryId)) return;\n this.dragRegistrySystem[registryId][interactId].deltas$.next({ deltaX, deltaY, targetElement })\n }\n\n updatePosition(interactId: string, registryId: string, { x, y }: {x: number; y: number;}, targetElement) {\n if (!this.interactableExistOnRegistry(interactId, registryId)) return;\n this.dragRegistrySystem[registryId][interactId].position$.next({ x, y, targetElement })\n }\n\n updateSize(interactId: string, registryId: string, { deltaX, deltaY, width, height }, targetElement) {\n if (!this.interactableExistOnRegistry(interactId, registryId)) return\n this.dragRegistrySystem[registryId][interactId].size$.next({deltaX, deltaY, width, height, targetElement});\n }\n\n interactableExistOnRegistry(interactId: string, registryId = DEFAULT_REGISTRY_ID) {\n // eslint-disable-next-line no-prototype-builtins\n return this.dragRegistrySystem.hasOwnProperty(registryId) && this.dragRegistrySystem[registryId].hasOwnProperty(interactId);\n }\n /**\n * Uses renderer to set width and height of angular component\n * @param width the desired width of component\n * @param height the desired height of component\n * @param target the element to transform\n */\n setElementSize(width: number, height: number, target: TftResizeElement) {\n if(!target) return;\n this.renderer.setStyle(target, 'width', `${width}${this.cssUnit}`);\n this.renderer.setStyle(target, 'height', `${height}${this.cssUnit}`);\n }\n /**\n * Uses renderer to set position of angular component\n * @param x position on x axis\n * @param y position on y axis\n * @param target the element to transform\n */\n setElementTransform(x: number, y: number, position: Position ) {\n if(!position?.targetElement) return;\n this.renderer.setStyle(position.targetElement, 'left', `${x}${this.cssUnit}`);\n this.renderer.setStyle(position.targetElement, 'top', `${y}${this.cssUnit}`);\n }\n /**\n * Generates a translate string for the x and y arguments passed to\n * be passed to css transform\n * @param x the position along the x axis\n * @param y the position along the y axis\n */\n createTransformString(x: number, y: number) {\n return `translate3d(${x}${this.cssUnit}, ${y}${this.cssUnit}, 0)`\n }\n\n calculatePositionInElement(zoneElement: Interact.Element, dragElement: TftDragElement, scale?: number) {\n // TODO: this calculation may not cover a lot of scenarios, keep an eye out for possible improvements\n const zoneRect = zoneElement.getBoundingClientRect();\n const dragRect = dragElement.getBoundingClientRect();\n const position = scale\n ? {\n x: (dragRect.left - zoneRect.left) / scale || 1,\n y: (dragRect.top - zoneRect.top) / scale || 1\n } : {\n x: dragRect.left - zoneRect.left,\n y: dragRect.top - zoneRect.top\n };\n // console.log({ y:position.y, drt:dragRect.top, zrt: zoneRect.top})\n return position;\n }\n}\n","import { Directive, ElementRef, HostBinding, Input, OnChanges, SimpleChanges, inject } from '@angular/core';\n\n/**\n * Use to apply scale to the element and tell the drag and resize directives to account for the scale when\n * @example <div tftAccountForScale [scale]=\"2.5\"> <div tftDraggable> </div> </div>\n * @note if `dragRoot` is used this directive should be used on the same element to ensure that the drag\n * element accounts for scale\n */\n@Directive({\n selector: '[tftAccountForScale]',\n standalone: false\n})\nexport class AccountForScaleDirective {\n el = inject(ElementRef);\n\n // this setup allows consumers to set x, y scale independently or just set them both with scale\n @Input() scale = 1;\n}\n","import { Directive, ElementRef, Input, OnInit, Output, EventEmitter, SimpleChanges, OnChanges, Renderer2, HostBinding, inject } from '@angular/core';\nimport interact from 'interactjs';\nimport { DropzoneOptions, Interactable } from '@interactjs/types/index';\nimport { InteractService } from '../services/interact.service';\nimport { NgDropEvent, TftDragElement, TftDropEvent } from '../models';\nimport { AccountForScaleDirective } from './account-for-scale.directive';\n\nexport type PositionOption = 'relative' | 'absolute' | 'fixed' | 'static' | 'sticky' | 'unset' | 'inherit' | 'initial' | 'revert'\n@Directive({\n selector: '[tftDropzone]',\n host: {\n '[id]': 'dropzoneId'\n },\n standalone: false\n})\nexport class DropzoneDirective implements OnInit, OnChanges {\n el = inject(ElementRef);\n private renderer = inject(Renderer2);\n private interactService = inject(InteractService);\n private account_for_scale_dir = inject(AccountForScaleDirective, { optional: true });\n\n\n @Input() dropzoneId: string;\n @Input() dropzoneConfig: DropzoneOptions = {};\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Input() dropzoneData: any;\n\n @Input()\n @HostBinding('style.position') position: PositionOption = 'relative';\n // proxies to pass interact events through to consumer of directive\n @Output() dropActivate = new EventEmitter<TftDropEvent>();\n @Output() dragEnter = new EventEmitter<TftDropEvent>();\n @Output() dragLeave = new EventEmitter<TftDropEvent>();\n @Output() dragDrop = new EventEmitter<TftDropEvent>();\n\n dropzone: Interactable;\n\n get scale(): number {\n return this.account_for_scale_dir?.scale;\n }\n\n ngOnInit() {\n // connects\n this.dropzone = this.connectDropzoneEvents(this.el.nativeElement, this.dropzoneConfig);\n this.dropzoneId = this.interactService.addRegistryToSystem(this.dropzoneId);\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if(!changes.dropzoneConfig || !this.dropzone) return;\n // this.dropzone.unset();\n // this.dropzone = this.connectDropzoneEvents(this.el.nativeElement, this.dropzoneConfig)\n this.dropzone.dropzone(this.dropzoneConfig)\n }\n /**\n * Connects element to interacts dropzone events and returns a reference to the interactable\n * @param nativeElement the element to tie drop events to\n * @param dropzoneConfig the interact configuration to use when connecting\n */\n connectDropzoneEvents(nativeElement, dropzoneConfig: DropzoneOptions) {\n return interact(nativeElement).dropzone(dropzoneConfig)\n // TODO: investigate when this fires in different scenarios\n .on('dropactivate', (event: NgDropEvent) => {\n this.dropActivate.emit(this.mapDropzoneEvent(event));\n })\n .on('dragenter', (event: NgDropEvent) => {\n this.renderer.setProperty(event.relatedTarget, 'dropTarget', this)\n this.dragEnter.emit(this.mapDropzoneEvent(event));\n })\n .on('dragleave', (event: NgDropEvent) => {\n if ( event.relatedTarget.dropTarget === this) {\n this.renderer.setProperty(event.relatedTarget, 'dropTarget', null)\n }\n this.dragLeave.emit(this.mapDropzoneEvent(event));\n })\n .on('drop', (event: NgDropEvent) => {\n this.dragDrop.emit(this.mapDropzoneEvent(event));\n });\n }\n /**\n * Maps the drop event emitted by interact to something a little easier to use\n * @param event the drop event emitted by interact, extended with extra fields we added to\n */\n mapDropzoneEvent(event: NgDropEvent): TftDropEvent {\n const zoneElement = event.target;\n const dragElement = event.relatedTarget?.dragRef?.previewRef as TftDragElement;\n const scale = this.scale;\n const positionInDropTarget = zoneElement && dragElement\n ? this.interactService.calculatePositionInElement(zoneElement, dragElement, scale)\n : null;\n return {\n interactEvent: event,\n dragRef: dragElement.dragRef,\n dragOrigin: dragElement.dragOrigin,\n dropTarget: event.relatedTarget.dropTarget,\n positionInDropTarget\n }\n }\n}\n","import { Directive, InjectionToken, Input, TemplateRef, inject } from '@angular/core';\n\nexport const TFT_DRAG_PREVIEW = new InjectionToken<DragPreviewDirective>('DragPreviewDirective');\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: 'ng-template[tftDragPreview]',\n standalone: false\n})\nexport class DragPreviewDirective<T = any> {\n templateRef = inject<TemplateRef<T>>(TemplateRef);\n\n\n @Input() dragData: T;\n}\n","import { EmbeddedViewRef } from '@angular/core';\n\ninterface IEElement extends HTMLElement {\n msMatchesSelector: (selector: string) => boolean; //\n}\n\n/** Gets the closest ancestor of an element that matches a selector. */\nexport function getClosestMatchingAncestor(element: HTMLElement, selector: string) {\n let currentElement = element.parentElement as HTMLElement | null;\n\n while (currentElement) {\n // IE doesn't support `matches` so we have to fall back to `msMatchesSelector`.\n if (currentElement.matches ? currentElement.matches(selector) :\n (currentElement as IEElement).msMatchesSelector(selector)) {\n return currentElement;\n }\n\n currentElement = currentElement.parentElement;\n }\n\n return null;\n}\n\n\n/**\n * Create a copy of the HTML Element\n */\nexport function cloneElement(element: HTMLElement) {\n\n const clone = element.cloneNode(true) as HTMLElement;\n clone.removeAttribute('id');\n return clone;\n}\n\n/**\n * Gets the root HTML element of an embedded view.\n * If the root is not an HTML element it gets wrapped in one.\n */\nexport function getRootNode(viewRef: EmbeddedViewRef<any>, _document: Document): HTMLElement {\n const rootNodes: Node[] = viewRef.rootNodes;\n\n if (rootNodes.length === 1 && rootNodes[0].nodeType === _document.ELEMENT_NODE) {\n return rootNodes[0] as HTMLElement;\n }\n\n const wrapper = _document.createElement('div');\n rootNodes.forEach(node => wrapper.appendChild(node));\n return wrapper;\n}\n","import { AccountForScaleDirective } from './account-for-scale.directive';\nimport { Directive, ElementRef, inject } from '@angular/core';\n\n/**\n * Use this directive to select which element to attach the element to while dragging\n * @example <div tftDragRoot><div tftDraggable> </div> </div>\n * @note this directive will overwrite any style transformations (e.g. transform: scale(2); )\n */\n@Directive({\n selector: '[tftDragRoot]',\n exportAs: 'tftDragRoot',\n standalone: false\n})\nexport class DragRootDirective {\n el = inject(ElementRef);\n // This is used when passing a dragRoot as in input to a draggable element that not a child of that dragRoot\n // It allows the the interact service to check if the drag root has some scaling applied to it and account for it when the component is dragged\n account_for_scale_dir? = inject(AccountForScaleDirective, { optional: true, self: true });\n}\n","import { Directive, ElementRef, HostListener, Input, inject } from '@angular/core';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { scan, shareReplay } from 'rxjs/operators';\n\ninterface ScrollObject {scrollTop: number, scrollLeft: number};\n/**\n * Use to apply scale to the element and tell the drag and resize directives to account for the scale when\n * @example <div tftAccountForScale [scale]=\"2.5\"> <div tftDraggable> </div> </div>\n * @note if `dragRoot` is used this directive should be used on the same element to ensure that the drag\n * element accounts for scale\n */\n@Directive({\n selector: '[tftAutoScroll]',\n standalone: false\n})\nexport class AutoScrollDirective {\n el = inject(ElementRef);\n\n /**\n * Limit minimum time between scroll events in milliseconds\n */\n @Input() autoScrollConfig = {\n margin: 50,\n distance: 3,\n interval: 50,\n speed: 300,\n enabled: true\n };\n private scrollSubject: BehaviorSubject<ScrollObject>;\n readonly scrollObserver: Observable<ScrollObject>;\n readonly scrollDeltaObserver = new Subject<ScrollObject>();\n // this setup allows consumers to set x, y scale independently or just set them both with scale\n @HostListener('scroll', ['$event']) scroll(scrollEvent: Event) {\n const target = (scrollEvent.target as HTMLElement);\n const { scrollTop, scrollLeft } = target;\n this.scrollSubject.next({scrollTop, scrollLeft})\n }\n\n\n constructor() {\n const el = this.el;\n\n const { scrollTop, scrollLeft } = (el.nativeElement as HTMLElement);\n this.scrollSubject = new BehaviorSubject({scrollTop, scrollLeft});\n this.scrollObserver = this.scrollSubject.pipe(\n scan((previous, current) => {\n const scrollTop = current.scrollTop - previous.scrollTop;\n const scrollLeft = current.scrollLeft - previous.scrollLeft;\n this.scrollDeltaObserver.next({scrollTop, scrollLeft});\n return current;\n }),\n shareReplay(1),\n )\n this.scrollObserver.subscribe();\n }\n\n}\n","import { Directive, ElementRef, Input, OnInit, Output, OnDestroy, EventEmitter, Renderer2, SimpleChanges, OnChanges, ContentChild, ViewContainerRef, AfterViewInit, DOCUMENT, inject } from '@angular/core';\n\nimport interact from 'interactjs';\nimport { InteractService } from '../services/interact.service';\nimport { DraggableOptions, Interactable } from '@interactjs/types/index';\nimport { Subscription, Observable } from 'rxjs';\nimport { DropzoneDirective } from './dropzone.directive';\nimport { NgDragEvent, TftDragEvent, DEFAULT_REGISTRY_ID, TftCoords, TftDragElement} from '../models';\nimport { DragPreviewDirective } from './drag-preview.directive';\nimport { getRootNode } from '../utils';\nimport { DragRootDirective } from './drag-root.directive';\nimport { AccountForScaleDirective } from './account-for-scale.directive';\nimport { AutoScrollDirective } from './auto-scroll.directive';\n\n/** @dynamic */\n@Directive({\n selector: '[tftDraggable]',\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n '[style.touchAction]': 'this.dragDisabled ? \"auto\" : \"none\"',\n '[style.position]': '\"absolute\"',\n '[id]': 'interactableId',\n },\n standalone: false\n})\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class DraggableDirective<D = any> implements OnInit, OnChanges, OnDestroy, AfterViewInit {\n el = inject(ElementRef);\n private interactService = inject(InteractService);\n private renderer = inject(Renderer2);\n private _viewContainerRef = inject(ViewContainerRef);\n private _document = inject<Document>(DOCUMENT);\n account_for_scale_dir? = inject(AccountForScaleDirective, { optional: true });\n dropzone_dir? = inject(DropzoneDirective, { optional: true, skipSelf: true });\n drag_root_dir? = inject(DragRootDirective, { optional: true, skipSelf: true });\n auto_scroll_dir? = inject(AutoScrollDirective, { optional: true, skipSelf: true });\n\n\n\n @Input() x: number;\n @Input() y: number;\n /* zIndex while dragging*/\n @Input() dragZIndex = 10000;\n /** zIndex while at rest */\n @Input() zIndex: number\n @Input() interactableId: string;\n @Input() dragData: D;\n @Input() enableDragDefault = true;\n /**\n * @deprecated replaced by 'dragDisabled' property, please migrate before v13\n */\n @Input() disabled = false;\n @Input() dragDisabled = false;\n @Input() dragConfig: Partial<Interact.OrBoolean<DraggableOptions>>;\n @Input() showPlaceholder = false;\n\n /**\n * The element we want to prepend the drag element to.\n * Use `tftDragRoot` directive on a parent element to set custom root element\n * @default document.body\n */\n @Input() dragRoot: DragRootDirective; // HTMLElement;\n\n private dragRootEl: HTMLElement;\n // pipes all interact events to event emitters\n @Output() dragStart = new EventEmitter<TftDragEvent>();\n @Output() dragMove = new EventEmitter<TftDragEvent>();\n @Output() dragInertiaStart = new EventEmitter<TftDragEvent>();\n @Output() dragEnd = new EventEmitter<TftDragEvent>();\n\n @ContentChild(DragPreviewDirective) _previewTemplate: DragPreviewDirective;\n // dragPreview: Interact.Element;\n interactableState: Observable<TftCoords>;\n interactable: Interactable;\n private registryId: string;\n private interactableSubscription: Subscription;\n private scrollEventsSubscription: Subscription;\n\n // cache holding element to use as drag preview (the element the user sees being dragged around)\n previewRef: TftDragElement;\n // check all the different places for scale\n get scale(): number {\n return this.account_for_scale_dir?.scale || this.drag_root_dir?.account_for_scale_dir?.scale || this.dragRoot?.account_for_scale_dir?.scale || 1;\n }\n\n ngOnInit() {\n this.interactable = this.initiateDragEvents(this.dragConfig, this.el.nativeElement);\n this.dragRootEl = (this.dragRoot?.el?.nativeElement || this.drag_root_dir?.el?.nativeElement) as HTMLElement || this._document.body;\n // register with parent dropzone if it exists, otherwise use default\n // this gives us a place on the registry to store our drag items that don't have a dropzone\n this.registryId = this.dropzone_dir?.dropzoneId || DEFAULT_REGISTRY_ID;\n // add draggable to directory and store its id\n this.interactableId = this.interactService.addDraggableToRegistry(this.registryId, this.interactableId);\n this.alignPositionWithInputs(this.x, this.y);\n // cache subscription to interactable state so we can unsubscribe onDestroy\n this.interactableState = this.interactService\n .getInteractableState(this.interactableId, this.registryId);\n // keep our cached position values in line with our drag state\n this.interactableSubscription = this.interactableState.subscribe((state) => {\n this.y = state.y;\n this.x = state.x;\n });\n this.setDragConfig();\n }\n\n // TODO: watch config here as well and update interactable\n ngOnChanges(changes: SimpleChanges) {\n // we do this here instead of using a setter on the input so that it\n // will only run once when there is a change to x and y\n if(changes.y || changes.x) {\n this.alignPositionWithInputs(this.x, this.y);\n }\n if(changes.dragConfig || changes.disabled || changes.dragDisabled) {\n if(!this.interactable) return;\n this.setDragConfig();\n }\n /**\n * @deprecated remove this in v13\n */\n if (changes.disabled) {\n console.warn(`It looks like your using the 'disabled' input on a tftDraggable directive, it has been deprecated and is replaced with 'dragDisabled', please migrate by v13`)\n }\n }\n\n setDragConfig() {\n const enabled = !(this.disabled || this.dragDisabled)\n const dragConfig = {...this.dragConfig, enabled};\n this.interactable.draggable(dragConfig);\n }\n\n ngAfterViewInit() {\n this.addDragPropertiesToElement(this.el.nativeElement);\n if (!this.dropzone_dir) {\n this.previewRef = this.el.nativeElement;\n }\n }\n\n ngOnDestroy() {\n // clean up state and subscriptions related to destroyed component\n this.interactableSubscription.unsubscribe();\n this.interactService.destroyInteractable(this.interactableId, this.registryId);\n }\n\n dragMoveListener(event: NgDragEvent, element: Interact.Element) {\n const { dx, dy } = event;\n const scale = this.scale;\n const deltaX = scale ? dx / scale : dx;\n const deltaY = scale ? dy / scale : dy;\n\n this.interactService.updateDeltas(\n this.interactableId,\n this.registryId,\n {deltaX, deltaY},\n element\n );\n }\n\n setDragStyles(dragElement: HTMLElement) {\n this.renderer.setStyle(dragElement, 'touch-action', 'none');\n this.renderer.setStyle(dragElement, 'z-index', this.dragZIndex);\n this.renderer.setStyle(dragElement, 'position', 'absolute');\n // Prevents highlighting text if dragging over, which will interrupt the next drag action\n this.renderer.setStyle(dragElement, 'user-select', 'none');\n\n }\n\n addDragPropertiesToElement(nativeElement: TftDragElement) {\n this.renderer.setProperty(nativeElement, 'dropTarget', this.dropzone_dir || null);\n this.renderer.setProperty(nativeElement, 'dragOrigin', this.dropzone_dir || null);\n this.renderer.setProperty(nativeElement, 'dragRef', this);\n }\n\n mapDragEvent(event: NgDragEvent): TftDragEvent {\n const { target, dropzone } = event;\n const dropzoneElement = dropzone?.target || target.dropTarget?.el.nativeElement;\n const scale = this.scale;\n const positionInDropTarget = target && dropzoneElement\n ? this.interactService.calculatePositionInElement(dropzoneElement, this.previewRef, scale)\n : null;\n return {\n interactEvent: event,\n dragRef: this,\n dragOrigin: target.dragOrigin,\n dropTarget: target.dropTarget,\n positionInDropTarget\n }\n }\n\n setPosition(x: number, y: number) {\n this.interactService.updatePosition(\n this.interactableId,\n this.registryId,\n {x, y},\n this.el.nativeElement\n );\n }\n\n alignPositionWithInputs(x: number, y: number) {\n // short circuit if positions aren't numbers or if they haven't changed\n if(!this.isValidPosition(x, y)) return;\n this.interactService.updatePosition(\n this.interactableId,\n this.registryId,\n {x, y},\n this.el.nativeElement\n );\n }\n\n isValidPosition(x: number, y: number) {\n return this.isNumeric(x) && this.isNumeric(y);\n }\n // We use use this instead of isNaN here to try and help performance\n // We should be able to reliably restrict to numbers or falsey values\n isNumeric(num: number) {\n return typeof num === 'number' && !isNaN(num);\n }\n\n initiateDragEvents(dragConfig: Partial<Interact.OrBoolean<DraggableOptions>>, nativeElement: HTMLElement) {\n const defaultDragConfig = {\n ...dragConfig,\n enabled: !(this.disabled || this.dragDisabled),\n ...(this.auto_scroll_dir && {\n autoScroll:\n {\n ...this.auto_scroll_dir.autoScrollConfig,\n container: this.auto_scroll_dir.el.nativeElement as HTMLElement\n }\n }\n )\n };\n return interact(nativeElement).draggable(defaultDragConfig)\n .on('dragstart', (event: NgDragEvent) => {\n const interaction = event.interaction;\n // check if we should append drag element to body\n if ( this.enableDragDefault && interaction.pointerIsDown ) {\n if (this._previewTemplate) {\n const viewRef = this._viewContainerRef.createEmbeddedView(this._previewTemplate.templateRef);\n this.previewRef = getRootNode(viewRef, this._document);\n } else {\n this.previewRef = cloneElement(this.el.nativeElement);\n }\n this.addDragPropertiesToElement(this.previewRef);\n this.setDragStyles(this.previewRef)\n\n this.dragRootEl.prepend(this.previewRef);\n const scale = this.account_for_scale_dir?.scale || this.dragRoot?.account_for_scale_dir?.scale || 1;\n const {x, y} = this.interactService.calculatePositionInElement(this.dragRootEl, nativeElement, scale);\n this.interactService.updatePosition(this.interactableId, this.registryId, {x, y}, this.previewRef);\n if (!this.showPlaceholder) {\n this.renderer.setStyle(this.el.nativeElement, 'display', 'none');\n }\n }\n // subscribe to scroll events if they are there, by only subscribing on dragstart we avoid wasting subscriptions on interactables that aren't be dragged\n if (this.auto_scroll_dir) {\n this.subscribeToScrollEvents();\n }\n this.dragStart.emit(this.mapDragEvent(event));\n })\n .on('dragmove', (event: NgDragEvent) => {\n if (this.enableDragDefault) {\n const dragElement = this.dropzone_dir && this.previewRef || nativeElement\n this.dragMoveListener(event, dragElement);\n }\n const mappedEvent = this.mapDragEvent(event);\n this.dragMove.emit(mappedEvent);\n })\n .on('draginertiastart', (event: NgDragEvent) => {\n this.dragInertiaStart.emit(this.mapDragEvent(event))\n })\n .on('dragend', (event: NgDragEvent) => {\n const mappedEvent = this.mapDragEvent(event)\n if(!!this.dropzone_dir && this.dropzone_dir === event.target.dropTarget) {\n const { x, y} = mappedEvent.positionInDropTarget;\n this.setPosition(x, y);\n }\n this.renderer.setStyle(this.el.nativeElement, 'display', '');\n this.dragEnd.emit(mappedEvent);\n // unsubscribe from scroll events if subscribed\n if (this.auto_scroll_dir) {\n this.scrollEventsSubscription.unsubscribe();\n }\n if ( this.el.nativeElement !== this.previewRef) {\n // we do this in a timeout, so that we don't remove before the dropzone can get the boundingElementRect\n setTimeout(() => {\n this.dragRootEl.removeChild(this.previewRef);\n })\n }\n });\n }\n\n subscribeToScrollEvents() {\n this.scrollEventsSubscription = this.auto_scroll_dir.scrollDeltaObserver.subscribe(({scrollLeft, scrollTop}) => {\n const deltaX = this.scale ? scrollLeft / this.scale : scrollLeft;\n const deltaY = this.scale ? scrollTop / this.scale : scrollTop;\n\n this.interactService.updateDeltas(\n this.interactableId,\n this.registryId,\n {deltaX, deltaY},\n this.previewRef\n );\n });\n\n }\n}\n\n/**\n * Component utils\n */\n// create a clone of the component passed in and add it to the root component\nfunction cloneElement(element: HTMLElement) {\n const clone = element.cloneNode(true) as HTMLElement;\n clone.removeAttribute('id');\n return clone;\n}\nfunction getPreviewInsertionPoint(documentRef: any): HTMLElement {\n // We can't use the body if the user is in fullscreen mode,\n // because the preview will render under the fullscreen element.\n return documentRef.fullscreenElement ||\n documentRef.webkitFullscreenElement ||\n documentRef.mozFullScreenElement ||\n documentRef.msFullscreenElement ||\n documentRef.body;\n}\n","import { Directive, OnInit, OnDestroy, ElementRef, Input, Output, EventEmitter, OnChanges, SimpleChanges, Renderer2, DOCUMENT, inject } from '@angular/core';\n\nimport interact from 'interactjs';\nimport { InteractService } from '../services/interact.service';\nimport { ResizableOptions, ResizeEvent, Interactable } from '@interactjs/types/index';\nimport { Subscription } from 'rxjs';\nimport { DraggableDirective } from './draggable.directive';\nimport { DropzoneDirective } from './dropzone.directive';\nimport { DragRootDirective } from './drag-root.directive';\nimport { AccountForScaleDirective } from './account-for-scale.directive';\nimport { NgResizeEvent, TftResizeEvent, DEFAULT_REGISTRY_ID, TftDragElement } from '../models';\nimport { AutoScrollDirective } from './auto-scroll.directive';\n\ninterface ActiveEdges {\n top: boolean;\n bottom: boolean;\n left: boolean;\n right: boolean;\n}\n/** @dynamic */\n@Directive({\n selector: '[tftResizable]',\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n // prevents touch events from colliding with with mouse events\n // on touch screen\n '[style.touchAction]': 'this.resizeDisabled ? \"auto\" : \"none\"',\n // default to absolute here to accommodate likely use cases\n // consuming component can easily over ride with position input\n '[style.position]': 'position',\n // follows interactjs suggested practices\n '[style.boxSizing]': '\"border-box\"',\n },\n standalone: false\n})\nexport class ResizableDirective implements OnInit, OnDestroy, OnChanges {\n el = inject(ElementRef);\n private _document = inject<Document>(DOCUMENT);\n private interactService = inject(InteractService);\n private renderer = inject(Renderer2);\n private drag_root_dir = inject(DragRootDirective, { optional: true });\n account_for_scale_dir? = inject(AccountForScaleDirective, { optional: true });\n private draggable_dir = inject(DraggableDirective, { optional: true });\n private dropzone_dir = inject(DropzoneDirective, { optional: true, skipSelf: true });\n auto_scroll_dir? = inject(AutoScrollDirective, { optional: true, skipSelf: true });\n\n\n @Input() enableResizeDefault = true;\n // TODO: should this be an input with default or should consuming user set display in styles each time\n @Input() position = 'absolute';\n @Input() resizeConfig: Partial<Interact.OrBoolean<ResizableOptions>>;\n @Input() interactableId: string;\n\n @Input() width: number;\n @Input() height: number;\n @Input() resizeDisabled = false;\n\n @Output() resizeStart = new EventEmitter<TftResizeEvent>();\n @Output() resizeMove = new EventEmitter<TftResizeEvent>();\n @Output() resizeInertiaStart = new EventEmitter<TftResizeEvent>();\n @Output() resizeEnd = new EventEmitter<TftResizeEvent>();\n\n defaultConfig: Partial<Interact.OrBoolean<ResizableOptions>> = {\n edges: { left: true, right: true, bottom: true, top: true }\n };\n registryId: string;\n interactable: Interactable;\n // The\n dragRootEl: HTMLElement;\n\n private activeEdges: ActiveEdges = {left: false, right: false, top: false, bottom: false}\n private interactableSubscription: Subscription;\n private scrollEventsSubscription: Subscription;\n\n get scale(): number {\n return this.account_for_scale_dir?.scale || this.drag_root_dir?.account_for_scale_dir?.scale;\n }\n\n constructor() {\n const drag_root_dir = this.drag_root_dir;\n\n this.dragRootEl = (drag_root_dir?.el?.nativeElement as HTMLElement) || this._document.body;\n }\n\n ngOnInit() {\n this.addResizePropertiesToElement(this.el.nativeElement);\n\n // we check for a dropzone, we use its id as the registry id if there is on\n // otherwise, we use DEFAULT_REGISTRY_ID as a registry id. This allows us to keep our interactable\n // drag state organized by dropzones.\n this.registryId = this.dropzone_dir?.dropzoneId || DEFAULT_REGISTRY_ID;\n\n this.interactableId = this.draggable_dir?.interactableId || this.interactService.addDraggableToRegistry(this.registryId, this.interactableId);\n\n this.interactable = this.initiateResizeEvents(\n {...this.defaultConfig, ...this.resizeConfig },\n this.el.nativeElement\n );\n\n this.alignDimensionsWithInputs(this.width, this.height);\n\n this.interactableSubscription = this.interactService\n .getInteractableState(this.interactableId, this.registryId)\n .subscribe();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if ((changes.resizeConfig || changes.resizeDisabled) && this.interactable) {\n this.interactable.resizable({...this.resizeConfig, enabled: !this.resizeDisabled,});\n }\n if (changes.width || changes.height) {\n this.alignDimensionsWithInputs(this.width, this.height);\n }\n }\n\n ngOnDestroy() {\n this.interactableSubscription.unsubscribe();\n this.interactService.destroyInteractable(this.interactableId, this.registryId);\n }\n\n resizeListener(event: ResizeEvent) {\n const element: TftDragElement = this.el.nativeElement;\n const scale = this.scale;\n const {deltaRect} = event;\n const deltaX = deltaRect.left/scale;\n const deltaY = deltaRect.top/scale;\n // We get the width and height directly from the native element because\n // the event dimension can get out of sync when resizing with autoScroll\n const rect = element.getBoundingClientRect();\n const width = (rect.width + deltaRect.width)/scale;\n const height = (rect.height + deltaRect.height)/scale;\n\n this.interactService.updateSize(\n this.interactableId,\n this.registryId,\n {deltaX, deltaY, width, height},\n this.el.nativeElement\n );\n }\n /**\n * hook elements into interacts resize event listeners\n * we spread the configs so that the consuming component only overwrites the\n * pieces that it explicitly indicates\n * @param resizeConfig\n * @param nativeElement\n */\n initiateResizeEvents(resizeConfig: Partial<Interact.OrBoolean<ResizableOptions>>, nativeElement: TftDragElement) {\n // TODO: This should try and get interactable from tft_draggable if it exists\n const defaultResizeConfig = {\n ...resizeConfig,\n enabled: !this.resizeDisabled,\n ...(this.auto_scroll_dir && {\n autoScroll: {\n ...this.auto_scroll_dir.autoScrollConfig,\n container: this.auto_scroll_dir.el.nativeElement as HTMLElement\n }\n })\n };\n const interactable = this.draggable_dir?.interactable || interact(nativeElement);\n return interactable.resizable(defaultResizeConfig)\n .on('resizestart', (event: NgResizeEvent) => {\n this.activeEdges = event.edges as ActiveEdges;\n if (this.auto_scroll_dir) {\n this.subscribeToScrollEvents();\n }\n this.resizeStart.emit(this.mapResizeEvent(event))\n })\n .on('resizemove', (event: NgResizeEvent) => {\n if (this.enableResizeDefault) {\n this.resizeListener(event)\n }\n const mappedEvent = this.mapResizeEvent(event);\n this.resizeMove.emit(mappedEvent)\n })\n .on('resizeinertiastart', (event: NgResizeEvent) => this.resizeInertiaStart.emit(this.mapResizeEvent(event)))\n .on('resizeend', (event: NgResizeEvent) => {\n if (this.auto_scroll_dir) {\n this.scrollEventsSubscription.unsubscribe();\n }\n this.activeEdges = {left: false, right: false, top: false, bottom: false}\n\n this.resizeEnd.emit(this.mapResizeEvent(event));\n });\n }\n\n mapResizeEvent(event: NgResizeEvent ): TftResizeEvent {\n const target = this.el.nativeElement as TftDragElement;\n const relatedTarget = this.draggable_dir?.dropzone_dir?.el.nativeElement;\n const scale = this.scale;\n const positionInDropTarget = target && relatedTarget\n ? this.interactService.calculatePositionInElement(relatedTarget, target, scale)\n : null;\n return {\n interactEvent: event,\n resizeRef: this,\n dragRef: this.draggable_dir,\n dragOrigin: this.dropzone_dir,\n dropTarget: this.el.nativeElement.dropTarget,\n positionInDropTarget,\n size: {\n width: target.clientWidth / scale,\n height: target.clientHeight / scale\n }\n }\n }\n\n alignDimensionsWithInputs(width: number, height: number) {\n this.interactService.updateSize(\n this.interactableId,\n this.registryId,\n {deltaX: 0, deltaY: 0, width, height},\n this.el.nativeElement\n );\n }\n\n addResizePropertiesToElement(nativeElement: TftDragElement) {\n this.renderer.setProperty(nativeElement, 'resizeRef', this);\n }\n\n subscribeToScrollEvents() {\n this.scrollEventsSubscription = this.auto_scroll_dir.scrollDeltaObserver.subscribe(({scrollLeft, scrollTop}) => {\n const scale = this.scale;\n const target = this.el.nativeElement as HTMLElement;\n const {width: prevWidth, height: prevHeight} = target.getBoundingClientRect();\n\n const deltaHeight = scrollTop * (this.activeEdges.top ? -1 : this.activeEdges.bottom ? 1 : 0);\n const deltaWidth = scrollLeft * (this.activeEdges.left ? -1 : this.activeEdges.right ? 1 : 0);\n\n const height = (prevHeight + deltaHeight) / scale;\n const width = (prevWidth + deltaWidth) / scale;\n const deltaX = this.activeEdges.left ? (scrollLeft / scale) : 0;\n const deltaY = this.activeEdges.top ? (scrollTop / scale) : 0;\n this.interactService.updateSize(\n this.interactableId,\n this.registryId,\n {deltaX, deltaY, width, height},\n this.el.nativeElement as HTMLElement\n );\n });\n }\n}\n","import { Directive, ElementRef, Input, OnInit, Output, EventEmitter, SimpleChanges, OnChanges, inject } from '@angular/core';\nimport interact from 'interactjs';\nimport { DraggableOptions, GesturableOptions, Interactable, GestureEvent } from '@interactjs/types/index';\nimport { Observable } from 'rxjs';\nimport { TftCoords, TftGestureEvent } from '../models';\nimport { DraggableDirective } from '../directives';\n\n/** @dynamic */\n@Directive({\n selector: '[tftGesturable]',\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n // '[style.touchAction]': 'this.gestureDisabled ? \"auto\" : \"none\"',\n '[id]': 'gesturableId',\n },\n standalone: false\n})\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class GesturableDirective<D = any> implements OnInit, OnChanges {\n el = inject(ElementRef);\n private draggable_dir = inject(DraggableDirective, { optional: true });\n\n\n @Input() gesturableId: string;\n @Input() gestureDisabled = false;\n @Input() gestureConfig: Partial<Interact.OrBoolean<DraggableOptions>>;\n // pipes all interact events to event emitters\n @Output() gestureStart = new EventEmitter<TftGestureEvent>();\n @Output() gestureMove = new EventEmitter<TftGestureEvent>();\n @Output() gestureEnd = new EventEmitter<TftGestureEvent>();\n\n interactableState: Observable<TftCoords>;\n interactable: Interactable;\n\n ngOnInit() {\n this.gesturableId = this.draggable_dir?.interactableId || 'id';\n this.interactable = this.initiateGestureEvents(this.gestureConfig, this.el.nativeElement);\n this.setGestureConfig();\n }\n\n // TODO: watch config here as well and update interactable\n ngOnChanges(changes: SimpleChanges) {\n // we do this here instead of using a setter on the input so that it\n // will only run once when there is a change to x and y\n if(changes.gestureConfig || changes.gestureDisabled) {\n if(!this.interactable) return;\n this.setGestureConfig();\n }\n }\n\n setGestureConfig() {\n const enabled = !this.gestureDisabled;\n const gestureConfig = {...this.gestureConfig, enabled};\n this.interactable.gesturable(gestureConfig);\n }\n\n initiateGestureEvents(gestureConfig: Partial<Interact.OrBoolean<GesturableOptions>>, nativeElement: HTMLElement) {\n\n const defaultConfig: GesturableOptions = {\n enabled: !this.gestureDisabled,\n };\n const interactable = this.draggable_dir?.interactable || interact(nativeElement);\n\n return interactable.gesturable({...defaultConfig, ...gestureConfig})\n .on('gesturestart', (event: GestureEvent) => {\n this.gestureStart.emit({gestureRef: this, interactEvent: event})\n })\n .on('gesturemove', (event: GestureEvent) => {\n this.gestureMove.emit({gestureRef: this, interactEvent: event})\n })\n .on('gestureend', (event: GestureEvent) => {\n this.gestureEnd.emit({gestureRef: this, interactEvent: event})\n })\n }\n}\n","import { Directive, ElementRef, HostBinding, Input, inject } from '@angular/core';\n\n@Directive({\n selector: '[tftApplyScale]',\n standalone: false\n})\nexport class ApplyScaleDirective {\n el = inject(ElementRef);\n\n\n _scale = 1;\n // this setup allows consumers to set x, y scale independently or just set them both with scale\n @Input() set scale(val: number){\n this._scale;\n this.fontSize = `${val}px`;\n };\n\n @HostBinding('style.fontSize') fontSize: string;\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ArrayOfNPipe } from './pipes/array-of-n.pipe';\nimport { ApplyScaleDirective, DraggableDirective, DragRootDirective, AutoScrollDirective, AccountForScaleDirective, GesturableDirective, ResizableDirective, DropzoneDirective, DragPreviewDirective } from './directives';\nimport { InteractService } from './services/interact.service';\nimport { InteractRootConfig, INTERACT_ROOT_CONFIG } from './models';\n\n\n\nconst EXPORTS = [\n DraggableDirective,\n ResizableDirective,\n DropzoneDirective,\n GesturableDirective,\n DragRootDirective,\n AutoScrollDirective,\n AccountForScaleDirective,\n ApplyScaleDirective,\n DragPreviewDirective,\n ArrayOfNPipe,\n];\n\n\n@NgModule({\n imports: [CommonModule],\n // providers: [{ provide: INTERACT_ROOT_CONFIG, useValue: 'px' }],\n declarations: [\n ...EXPORTS,\n ],\n exports: [\n ...EXPORTS\n ]\n})\nexport class InteractModule {\n static forRoot(config: InteractRootConfig): ModuleWithProviders<InteractModule> {\n const defaultConfig: InteractRootConfig = {cssDimensionUnit: 'px'}\n return {\n ngModule: InteractModule,\n providers: [\n { provide: INTERACT_ROOT_CONFIG, useValue: {...defaultConfig, ...config} },\n InteractService\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["cloneElement"],"mappings":";;;;;;;MAMa,YAAY,CAAA;AAEvB;;;;AAIG;IACH,SAAS,CAAC,CAAS,EAAE,GAAW,EAAA;QAC9B,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,QAAQ,IAAI,GAAG,GAAG,CAAC;QAC7D,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAC,CAAC,KAAI,CAAC,CAAC;IACtD;8GAVW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAZ,YAAY,EAAA,YAAA,EAAA,KAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,UAAU;AAChB,oBAAA,UAAU,EAAE;AACf,iBAAA;;;MCMY,oBAAoB,GAAG,IAAI,cAAc,CAAqB,6BAA6B;AAEjG,MAAM,mBAAmB,GAAG;AACnC;;AAEG;AACI,MAAM,YAAY,GAAU;AACjC,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,MAAM,EAAE,CAAC;AACT,IAAA,aAAa,EAAE;;AAEj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../../../libs/interact/src/lib/models/interact.ts","../../../../libs/interact/src/lib/services/interact.service.ts","../../../../libs/interact/src/lib/directives/account-for-scale.directive.ts","../../../../libs/interact/src/lib/directives/dropzone.directive.ts","../../../../libs/interact/src/lib/directives/drag-preview.directive.ts","../../../../libs/interact/src/lib/utils/helpers.ts","../../../../libs/interact/src/lib/directives/drag-root.directive.ts","../../../../libs/interact/src/lib/directives/auto-scroll.directive.ts","../../../../libs/interact/src/lib/directives/draggable.directive.ts","../../../../libs/interact/src/lib/directives/resizable.directive.ts","../../../../libs/interact/src/lib/directives/gesturable.directive.ts","../../../../libs/interact/src/lib/directives/apply-scale.directive.ts","../../../../libs/interact/src/lib/directives/lasso.directive.ts","../../../../libs/interact/src/lib/interact.module.ts","../../../../libs/interact/src/tft-interact.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'arrayOfN',\n standalone: false\n})\nexport class ArrayOfNPipe implements PipeTransform {\n\n /**\n * \n * @param n the number to make an array of \n * @param max the max length of the array (useful for limiting rendering in ngFor loop)\n */\n transform(n: number, max: number): any {\n const length = ((max && max < n) || n === Infinity) ? max : n;\n return new Array(length).fill(length).map((x,i)=> i); \n }\n\n}\n","import { DropzoneDirective, DraggableDirective, GesturableDirective, ResizableDirective } from '../directives';\nimport { Point, DragEvent, ResizeEvent, Interactable, DropEvent, GestureEvent } from '@interactjs/types';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { InjectionToken } from '@angular/core';\n\n\n\nexport type CssDimensionUnit = 'px' | 'em';\nexport interface InteractRootConfig {\n cssDimensionUnit: CssDimensionUnit;\n}\nexport const INTERACT_ROOT_CONFIG = new InjectionToken<InteractRootConfig>('INTERACT_ROOT_CONFIG_PARAMS');\n\nexport const DEFAULT_REGISTRY_ID = 'DEFAULT';\n/**\n * Default initial value for Delta BehaviorSubject\n */\nexport const defaultDelta: Delta = {\n deltaX: 0,\n deltaY: 0,\n targetElement: null\n};\n/**\n * Default initial value for Size BehaviorSubject\n */\nexport const defaultSize: Size = {\n width: null,\n height: null,\n targetElement: null\n}\n/**\n * Default initial value for Position BehaviorSubject\n */\nexport const defaultPosition: Position = {\n x: 0,\n y: 0,\n targetElement: null\n}\n/**\n * The shape of the state/events/behavior system for each dropzone\n * and the DEFAULT_REGISTRY_ID system (for drop components initialized outside\n * of a dropzone).\n */\nexport interface InteractableSystem {\n deltas$: BehaviorSubject<Delta>;\n position$: BehaviorSubject<Position>;\n size$: BehaviorSubject<Size & Delta>;\n\n interactable$: Observable<TftCoords>;\n}\n/**\n * The key map of InteractableSystems. One for the drag components\n * that originated outside of a dropzone, plus one for each dropzone.\n */\nexport interface InteractableRegistry {\n [key: string]: InteractableSystem\n}\n\n/**\n * HTMLElement with helpful drag directives attached to facilitate moving drag data between dropzones\n */\nexport type TftDragElement = HTMLElement & {\n dragRef?: DraggableDirective\n dragOrigin?: DropzoneDirective\n dropTarget?: DropzoneDirective\n}\n\n/**\n * HTMLElement with helpful drag directives attached to facilitate moving drag data between dropzones\n */\n export type TftResizeElement = HTMLElement & {\n resizeRef?: ResizableDirective\n}\n\n/**\n * Extends the interact drop events by adding reference to the dropped components drag\n * directive to the html element. This gives the dropzone access to things like data\n * and parent dropzone of the dropped component.\n */\nexport type NgDropEvent = DropEvent & {\n draggable: Interactable & {\n target: TftDragElement;\n };\n relatedTarget: TftDragElement;\n};\n/**\n * Extends the interact resize events by adding a reference to the dragRef\n * directive to the html element.\n */\nexport type NgResizeEvent = ResizeEvent & {\n draggable: Interactable & {\n target: TftDragElement;\n };\n};\n/**\n * We extend the interact DragEvent a little here, adding to the target element references for:\n * - the component we are dragging (dragRef)\n * - the dropzone component where the drag component originated (dragOrigin)\n * - the dropzone component that it was dropped in (dropTarget)\n * This helps us to pass references to directive classes as events like dragenter and drag exit happens.\n * We use these references to emit a (mostly) consistent event across drag, drop, resize event.\n */\nexport type NgDragEvent = DragEvent & {\n dropzone: { target: HTMLElement},\n target: TftDragElement\n};\n/**\n * Event emitted when resizing, dragging, dropping\n */\nexport interface TftInteractableEvent {\n dragRef: DraggableDirective;\n dragOrigin?: DropzoneDirective;\n dropTarget?: DropzoneDirective;\n positionInDropTarget: Point;\n}\n/**\n * Event emitted on drop\n */\nexport interface TftDropEvent extends TftInteractableEvent {\n interactEvent: NgDropEvent\n}\n/**\n * Event emitted on drag\n */\nexport interface TftDragEvent extends TftInteractableEvent {\n interactEvent: NgDragEvent\n}\n/**\n * Event emitted on resize\n */\nexport interface TftResizeEvent extends TftInteractableEvent {\n interactEvent: ResizeEvent,\n resizeRef: ResizableDirective\n size: {\n width: number;\n height: number;\n }\n}\n\nexport type TftCoords= Delta & Position & Size;\n\nexport interface Delta {\n deltaX: number | null;\n deltaY: number | null;\n targetElement: TftDragElement | null;\n}\n\nexport interface Position {\n x: number | null;\n y: number | null;\n targetElement: TftDragElement | null;\n}\n\nexport interface Size {\n width: number | null;\n height: number | null;\n targetElement: TftResizeElement | null;\n}\n\nexport interface TftGestureEvent {\n gestureRef: GesturableDirective;\n interactEvent: GestureEvent;\n}\n","\nimport { Injectable, Renderer2, RendererFactory2, NgZone, inject } from '@angular/core';\nimport { BehaviorSubject, Observable, combineLatest } from 'rxjs';\nimport { tap, map, shareReplay } from 'rxjs/operators';\nimport {\n TftCoords, Delta, Size, Position, InteractableRegistry,\n defaultPosition, defaultSize, defaultDelta, DEFAULT_REGISTRY_ID, TftDragElement, TftResizeElement, INTERACT_ROOT_CONFIG, InteractRootConfig\n} from '../models';\n\n\n\n@Injectable({providedIn: 'root'})\nexport class InteractService {\n private rendererFactory = inject(RendererFactory2);\n private ngZone = inject(NgZone);\n rootConfig = inject(INTERACT_ROOT_CONFIG, { optional: true });\n\n\n private _interactableIndex = 0;\n private _dropzoneIndex = 0;\n private renderer: Renderer2;\n\n // TODO: consider using Map here\n readonly dragRegistrySystem: { [key: string]: InteractableRegistry } = { };\n private cssUnit = 'px'\n constructor() {\n const rootConfig = this.rootConfig;\n\n this.renderer = this.rendererFactory.createRenderer(null, null);\n this.cssUnit = rootConfig?.cssDimensionUnit || 'px';\n }\n\n addDeltaToPosition(delta: Delta, position: Position) {\n return {\n x: delta.deltaX + position.x,\n y: delta.deltaY + position.y,\n targetElement: position.targetElement || delta.targetElement\n }\n }\n\n addRegistryToSystem(customRegistryId: string | null = null) {\n const registryId = customRegistryId || this.createDropzoneId(this._dropzoneIndex++);\n this.dragRegistrySystem[registryId] = {};\n return registryId;\n }\n\n addDraggableToRegistry(customRegistryId = null, interactableId: string | null = null ) {\n const registryId = customRegistryId || DEFAULT_REGISTRY_ID;\n // if we pass an id to createInteractableId then it is used when creating the interactable\n // and returned, otherwise a new id is created for the draggable.\n const key = this.createInteractableId(interactableId );\n if (!Object.prototype.hasOwnProperty.call(this.dragRegistrySystem, registryId)) {\n this.dragRegistrySystem[registryId] = {};\n }\n this.dragRegistrySystem[registryId][key] = this.createInteractableState(defaultPosition, defaultSize, defaultDelta);\n return key\n }\n\n destroyInteractable(interactableId: string, registryId = DEFAULT_REGISTRY_ID) {\n const interactableSystem =this.dragRegistrySystem[registryId][interactableId];\n if(interactableSystem) {\n // unsubscribe from all the subscriptions if they're subscriptions\n for (const propName in interactableSystem) {\n const prop = interactableSystem[propName];\n if (prop.unsubscribe && typeof prop.unsubscribe === 'function' ) {\n prop.unsubscribe();\n };\n }\n delete this.dragRegistrySystem[registryId][interactableId];\n }\n }\n\n subscribeToInteractable(interactableId: string, registryId = DEFAULT_REGISTRY_ID) {\n return this.dragRegistrySystem[registryId][interactableId];\n }\n\n createInteractableState(initialPosition: Position, initialSize: Size, initialDelta: Delta ) {\n\n const deltas$ = new BehaviorSubject(initialDelta);\n // tracks the size of the element\n const size$ = new BehaviorSubject({...initialSize, ...initialDelta});\n // Stream of positions as they change\n const position$ = new BehaviorSubject(initialPosition);\n\n // All draggable data mapped together\n const interactable$: Observable<TftCoords> = combineLatest([\n size$.pipe(\n // startWith({...initialSize, ...initialDelta}),\n shareReplay(1),\n // filter(resizeEvent => !!resizeEvent.targetElement),\n tap(({deltaX, deltaY, width, height, targetElement}) => {\n this.ngZone.runOutsideAngular(() => {\n this.setElementSize(width, height, targetElement);\n });\n // only reposition if necessary i.e when resizing left or up\n if(deltaX || deltaY) {\n deltas$.next({deltaX, deltaY, targetElement});\n }\n })\n ),\n deltas$.pipe(\n shareReplay(1),\n tap((delta) => {\n const position = position$.value;\n const newPosition = this.addDeltaToPosition(delta, position);\n position$.next(newPosition);\n })\n ),\n position$.pipe(\n shareReplay(1),\n tap( position => {\n this.ngZone.runOutsideAngular(() => {\n this.setElementTransform(position.x, position.y, position);\n })\n })\n )\n ]).pipe(\n shareReplay(1),\n map( ([size, deltas, position]): TftCoords=> {\n return {\n x: position.x,\n y: position.y,\n deltaX: deltas.deltaX,\n deltaY: deltas.deltaY,\n width: size.width,\n height: size.height,\n targetElement: size.targetElement || position.targetElement || deltas.targetElement\n }\n }),\n )\n // TODO: update system to handle only returning interactable$\n return {\n deltas$,\n position$,\n size$,\n interactable$\n }\n }\n\n createInteractableId(customInteractableId: string | null = null) {\n return customInteractableId || `interactable${this._interactableIndex++}`\n }\n\n createDropzoneId(index: number) {\n return `dropzone${index}`\n }\n\n getInteractableState( interactableId: string, registryId = DEFAULT_REGISTRY_ID) {\n return this.dragRegistrySystem[registryId][interactableId].interactable$;\n }\n\n updateDeltas(interactId: string, registryId: string, { deltaX, deltaY }, targetElement) {\n if (!this.interactableExistOnRegistry(interactId, registryId)) return;\n this.dragRegistrySystem[registryId][interactId].deltas$.next({ deltaX, deltaY, targetElement })\n }\n\n updatePosition(interactId: string, registryId: string, { x, y }: {x: number; y: number;}, targetElement) {\n if (!this.interactableExistOnRegistry(interactId, registryId)) return;\n this.dragRegistrySystem[registryId][interactId].position$.next({ x, y, targetElement })\n }\n\n updateSize(interactId: string, registryId: string, { deltaX, deltaY, width, height }, targetElement) {\n if (!this.interactableExistOnRegistry(interactId, registryId)) return\n this.dragRegistrySystem[registryId][interactId].size$.next({deltaX, deltaY, width, height, targetElement});\n }\n\n interactableExistOnRegistry(interactId: string, registryId = DEFAULT_REGISTRY_ID) {\n // eslint-disable-next-line no-prototype-builtins\n return this.dragRegistrySystem.hasOwnProperty(registryId) && this.dragRegistrySystem[registryId].hasOwnProperty(interactId);\n }\n /**\n * Uses renderer to set width and height of angular component\n * @param width the desired width of component\n * @param height the desired height of component\n * @param target the element to transform\n */\n setElementSize(width: number, height: number, target: TftResizeElement) {\n if(!target) return;\n this.renderer.setStyle(target, 'width', `${width}${this.cssUnit}`);\n this.renderer.setStyle(target, 'height', `${height}${this.cssUnit}`);\n }\n /**\n * Uses renderer to set position of angular component\n * @param x position on x axis\n * @param y position on y axis\n * @param target the element to transform\n */\n setElementTransform(x: number, y: number, position: Position ) {\n if(!position?.targetElement) return;\n this.renderer.setStyle(position.targetElement, 'left', `${x}${this.cssUnit}`);\n this.renderer.setStyle(position.targetElement, 'top', `${y}${this.cssUnit}`);\n }\n /**\n * Generates a translate string for the x and y arguments passed to\n * be passed to css transform\n * @param x the position along the x axis\n * @param y the position along the y axis\n */\n createTransformString(x: number, y: number) {\n return `translate3d(${x}${this.cssUnit}, ${y}${this.cssUnit}, 0)`\n }\n\n calculatePositionInElement(zoneElement: Interact.Element, dragElement: TftDragElement, scale?: number) {\n // TODO: this calculation may not cover a lot of scenarios, keep an eye out for possible improvements\n const zoneRect = zoneElement.getBoundingClientRect();\n const dragRect = dragElement.getBoundingClientRect();\n const position = scale\n ? {\n x: (dragRect.left - zoneRect.left) / scale || 1,\n y: (dragRect.top - zoneRect.top) / scale || 1\n } : {\n x: dragRect.left - zoneRect.left,\n y: dragRect.top - zoneRect.top\n };\n // console.log({ y:position.y, drt:dragRect.top, zrt: zoneRect.top})\n return position;\n }\n}\n","import { Directive, ElementRef, HostBinding, Input, OnChanges, SimpleChanges, inject } from '@angular/core';\n\n/**\n * Use to apply scale to the element and tell the drag and resize directives to account for the scale when\n * @example <div tftAccountForScale [scale]=\"2.5\"> <div tftDraggable> </div> </div>\n * @note if `dragRoot` is used this directive should be used on the same element to ensure that the drag\n * element accounts for scale\n */\n@Directive({\n selector: '[tftAccountForScale]',\n standalone: false\n})\nexport class AccountForScaleDirective {\n el = inject(ElementRef);\n\n // this setup allows consumers to set x, y scale independently or just set them both with scale\n @Input() scale = 1;\n}\n","import { Directive, ElementRef, Input, OnInit, Output, EventEmitter, SimpleChanges, OnChanges, Renderer2, HostBinding, inject } from '@angular/core';\nimport interact from 'interactjs';\nimport { DropzoneOptions, Interactable } from '@interactjs/types/index';\nimport { InteractService } from '../services/interact.service';\nimport { NgDropEvent, TftDragElement, TftDropEvent } from '../models';\nimport { AccountForScaleDirective } from './account-for-scale.directive';\n\nexport type PositionOption = 'relative' | 'absolute' | 'fixed' | 'static' | 'sticky' | 'unset' | 'inherit' | 'initial' | 'revert'\n@Directive({\n selector: '[tftDropzone]',\n host: {\n '[id]': 'dropzoneId'\n },\n standalone: false\n})\nexport class DropzoneDirective implements OnInit, OnChanges {\n el = inject(ElementRef);\n private renderer = inject(Renderer2);\n private interactService = inject(InteractService);\n private account_for_scale_dir = inject(AccountForScaleDirective, { optional: true });\n\n\n @Input() dropzoneId: string;\n @Input() dropzoneConfig: DropzoneOptions = {};\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Input() dropzoneData: any;\n\n @Input()\n @HostBinding('style.position') position: PositionOption = 'relative';\n // proxies to pass interact events through to consumer of directive\n @Output() dropActivate = new EventEmitter<TftDropEvent>();\n @Output() dragEnter = new EventEmitter<TftDropEvent>();\n @Output() dragLeave = new EventEmitter<TftDropEvent>();\n @Output() dragDrop = new EventEmitter<TftDropEvent>();\n\n dropzone: Interactable;\n\n get scale(): number {\n return this.account_for_scale_dir?.scale;\n }\n\n ngOnInit() {\n // connects\n this.dropzone = this.connectDropzoneEvents(this.el.nativeElement, this.dropzoneConfig);\n this.dropzoneId = this.interactService.addRegistryToSystem(this.dropzoneId);\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if(!changes.dropzoneConfig || !this.dropzone) return;\n // this.dropzone.unset();\n // this.dropzone = this.connectDropzoneEvents(this.el.nativeElement, this.dropzoneConfig)\n this.dropzone.dropzone(this.dropzoneConfig)\n }\n /**\n * Connects element to interacts dropzone events and returns a reference to the interactable\n * @param nativeElement the element to tie drop events to\n * @param dropzoneConfig the interact configuration to use when connecting\n */\n connectDropzoneEvents(nativeElement, dropzoneConfig: DropzoneOptions) {\n return interact(nativeElement).dropzone(dropzoneConfig)\n // TODO: investigate when this fires in different scenarios\n .on('dropactivate', (event: NgDropEvent) => {\n this.dropActivate.emit(this.mapDropzoneEvent(event));\n })\n .on('dragenter', (event: NgDropEvent) => {\n this.renderer.setProperty(event.relatedTarget, 'dropTarget', this)\n this.dragEnter.emit(this.mapDropzoneEvent(event));\n })\n .on('dragleave', (event: NgDropEvent) => {\n if ( event.relatedTarget.dropTarget === this) {\n this.renderer.setProperty(event.relatedTarget, 'dropTarget', null)\n }\n this.dragLeave.emit(this.mapDropzoneEvent(event));\n })\n .on('drop', (event: NgDropEvent) => {\n this.dragDrop.emit(this.mapDropzoneEvent(event));\n });\n }\n /**\n * Maps the drop event emitted by interact to something a little easier to use\n * @param event the drop event emitted by interact, extended with extra fields we added to\n */\n mapDropzoneEvent(event: NgDropEvent): TftDropEvent {\n const zoneElement = event.target;\n const dragElement = event.relatedTarget?.dragRef?.previewRef as TftDragElement;\n const scale = this.scale;\n const positionInDropTarget = zoneElement && dragElement\n ? this.interactService.calculatePositionInElement(zoneElement, dragElement, scale)\n : null;\n return {\n interactEvent: event,\n dragRef: dragElement.dragRef,\n dragOrigin: dragElement.dragOrigin,\n dropTarget: event.relatedTarget.dropTarget,\n positionInDropTarget\n }\n }\n}\n","import { Directive, InjectionToken, Input, TemplateRef, inject } from '@angular/core';\n\nexport const TFT_DRAG_PREVIEW = new InjectionToken<DragPreviewDirective>('DragPreviewDirective');\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: 'ng-template[tftDragPreview]',\n standalone: false\n})\nexport class DragPreviewDirective<T = any> {\n templateRef = inject<TemplateRef<T>>(TemplateRef);\n\n\n @Input() dragData: T;\n}\n","import { EmbeddedViewRef } from '@angular/core';\n\ninterface IEElement extends HTMLElement {\n msMatchesSelector: (selector: string) => boolean; //\n}\n\n/** Gets the closest ancestor of an element that matches a selector. */\nexport function getClosestMatchingAncestor(element: HTMLElement, selector: string) {\n let currentElement = element.parentElement as HTMLElement | null;\n\n while (currentElement) {\n // IE doesn't support `matches` so we have to fall back to `msMatchesSelector`.\n if (currentElement.matches ? currentElement.matches(selector) :\n (currentElement as IEElement).msMatchesSelector(selector)) {\n return currentElement;\n }\n\n currentElement = currentElement.parentElement;\n }\n\n return null;\n}\n\n\n/**\n * Create a copy of the HTML Element\n */\nexport function cloneElement(element: HTMLElement) {\n\n const clone = element.cloneNode(true) as HTMLElement;\n clone.removeAttribute('id');\n return clone;\n}\n\n/**\n * Gets the root HTML element of an embedded view.\n * If the root is not an HTML element it gets wrapped in one.\n */\nexport function getRootNode(viewRef: EmbeddedViewRef<any>, _document: Document): HTMLElement {\n const rootNodes: Node[] = viewRef.rootNodes;\n\n if (rootNodes.length === 1 && rootNodes[0].nodeType === _document.ELEMENT_NODE) {\n return rootNodes[0] as HTMLElement;\n }\n\n const wrapper = _document.createElement('div');\n rootNodes.forEach(node => wrapper.appendChild(node));\n return wrapper;\n}\n","import { AccountForScaleDirective } from './account-for-scale.directive';\nimport { Directive, ElementRef, inject } from '@angular/core';\n\n/**\n * Use this directive to select which element to attach the element to while dragging\n * @example <div tftDragRoot><div tftDraggable> </div> </div>\n * @note this directive will overwrite any style transformations (e.g. transform: scale(2); )\n */\n@Directive({\n selector: '[tftDragRoot]',\n exportAs: 'tftDragRoot',\n standalone: false\n})\nexport class DragRootDirective {\n el = inject(ElementRef);\n // This is used when passing a dragRoot as in input to a draggable element that not a child of that dragRoot\n // It allows the the interact service to check if the drag root has some scaling applied to it and account for it when the component is dragged\n account_for_scale_dir? = inject(AccountForScaleDirective, { optional: true, self: true });\n}\n","import { Directive, ElementRef, HostListener, Input, inject } from '@angular/core';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\nimport { scan, shareReplay } from 'rxjs/operators';\n\ninterface ScrollObject {scrollTop: number, scrollLeft: number};\n/**\n * Use to apply scale to the element and tell the drag and resize directives to account for the scale when\n * @example <div tftAccountForScale [scale]=\"2.5\"> <div tftDraggable> </div> </div>\n * @note if `dragRoot` is used this directive should be used on the same element to ensure that the drag\n * element accounts for scale\n */\n@Directive({\n selector: '[tftAutoScroll]',\n standalone: false\n})\nexport class AutoScrollDirective {\n el = inject(ElementRef);\n\n /**\n * Limit minimum time between scroll events in milliseconds\n */\n @Input() autoScrollConfig = {\n margin: 50,\n distance: 3,\n interval: 50,\n speed: 300,\n enabled: true\n };\n private scrollSubject: BehaviorSubject<ScrollObject>;\n readonly scrollObserver: Observable<ScrollObject>;\n readonly scrollDeltaObserver = new Subject<ScrollObject>();\n // this setup allows consumers to set x, y scale independently or just set them both with scale\n @HostListener('scroll', ['$event']) scroll(scrollEvent: Event) {\n const target = (scrollEvent.target as HTMLElement);\n const { scrollTop, scrollLeft } = target;\n this.scrollSubject.next({scrollTop, scrollLeft})\n }\n\n\n constructor() {\n const el = this.el;\n\n const { scrollTop, scrollLeft } = (el.nativeElement as HTMLElement);\n this.scrollSubject = new BehaviorSubject({scrollTop, scrollLeft});\n this.scrollObserver = this.scrollSubject.pipe(\n scan((previous, current) => {\n const scrollTop = current.scrollTop - previous.scrollTop;\n const scrollLeft = current.scrollLeft - previous.scrollLeft;\n this.scrollDeltaObserver.next({scrollTop, scrollLeft});\n return current;\n }),\n shareReplay(1),\n )\n this.scrollObserver.subscribe();\n }\n\n}\n","import { Directive, ElementRef, Input, OnInit, Output, OnDestroy, EventEmitter, Renderer2, SimpleChanges, OnChanges, ContentChild, ViewContainerRef, AfterViewInit, DOCUMENT, inject } from '@angular/core';\n\nimport interact from 'interactjs';\nimport { InteractService } from '../services/interact.service';\nimport { DraggableOptions, Interactable } from '@interactjs/types/index';\nimport { Subscription, Observable } from 'rxjs';\nimport { DropzoneDirective } from './dropzone.directive';\nimport { NgDragEvent, TftDragEvent, DEFAULT_REGISTRY_ID, TftCoords, TftDragElement} from '../models';\nimport { DragPreviewDirective } from './drag-preview.directive';\nimport { getRootNode } from '../utils';\nimport { DragRootDirective } from './drag-root.directive';\nimport { AccountForScaleDirective } from './account-for-scale.directive';\nimport { AutoScrollDirective } from './auto-scroll.directive';\n\n/** @dynamic */\n@Directive({\n selector: '[tftDraggable]',\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n '[style.touchAction]': 'this.dragDisabled ? \"auto\" : \"none\"',\n '[style.position]': '\"absolute\"',\n '[id]': 'interactableId',\n },\n standalone: false\n})\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class DraggableDirective<D = any> implements OnInit, OnChanges, OnDestroy, AfterViewInit {\n el = inject(ElementRef);\n private interactService = inject(InteractService);\n private renderer = inject(Renderer2);\n private _viewContainerRef = inject(ViewContainerRef);\n private _document = inject<Document>(DOCUMENT);\n account_for_scale_dir? = inject(AccountForScaleDirective, { optional: true });\n dropzone_dir? = inject(DropzoneDirective, { optional: true, skipSelf: true });\n drag_root_dir? = inject(DragRootDirective, { optional: true, skipSelf: true });\n auto_scroll_dir? = inject(AutoScrollDirective, { optional: true, skipSelf: true });\n\n\n\n @Input() x: number;\n @Input() y: number;\n /* zIndex while dragging*/\n @Input() dragZIndex = 10000;\n /** zIndex while at rest */\n @Input() zIndex: number\n @Input() interactableId: string;\n @Input() dragData: D;\n @Input() enableDragDefault = true;\n /**\n * @deprecated replaced by 'dragDisabled' property, please migrate before v13\n */\n @Input() disabled = false;\n @Input() dragDisabled = false;\n @Input() dragConfig: Partial<Interact.OrBoolean<DraggableOptions>>;\n @Input() showPlaceholder = false;\n\n /**\n * The element we want to prepend the drag element to.\n * Use `tftDragRoot` directive on a parent element to set custom root element\n * @default document.body\n */\n @Input() dragRoot: DragRootDirective; // HTMLElement;\n\n private dragRootEl: HTMLElement;\n // pipes all interact events to event emitters\n @Output() dragStart = new EventEmitter<TftDragEvent>();\n @Output() dragMove = new EventEmitter<TftDragEvent>();\n @Output() dragInertiaStart = new EventEmitter<TftDragEvent>();\n @Output() dragEnd = new EventEmitter<TftDragEvent>();\n\n @ContentChild(DragPreviewDirective) _previewTemplate: DragPreviewDirective;\n // dragPreview: Interact.Element;\n interactableState: Observable<TftCoords>;\n interactable: Interactable;\n private registryId: string;\n private interactableSubscription: Subscription;\n private scrollEventsSubscription: Subscription;\n\n // cache holding element to use as drag preview (the element the user sees being dragged around)\n previewRef: TftDragElement;\n // check all the different places for scale\n get scale(): number {\n return this.account_for_scale_dir?.scale || this.drag_root_dir?.account_for_scale_dir?.scale || this.dragRoot?.account_for_scale_dir?.scale || 1;\n }\n\n ngOnInit() {\n this.interactable = this.initiateDragEvents(this.dragConfig, this.el.nativeElement);\n this.dragRootEl = (this.dragRoot?.el?.nativeElement || this.drag_root_dir?.el?.nativeElement) as HTMLElement || this._document.body;\n // register with parent dropzone if it exists, otherwise use default\n // this gives us a place on the registry to store our drag items that don't have a dropzone\n this.registryId = this.dropzone_dir?.dropzoneId || DEFAULT_REGISTRY_ID;\n // add draggable to directory and store its id\n this.interactableId = this.interactService.addDraggableToRegistry(this.registryId, this.interactableId);\n this.alignPositionWithInputs(this.x, this.y);\n // cache subscription to interactable state so we can unsubscribe onDestroy\n this.interactableState = this.interactService\n .getInteractableState(this.interactableId, this.registryId);\n // keep our cached position values in line with our drag state\n this.interactableSubscription = this.interactableState.subscribe((state) => {\n this.y = state.y;\n this.x = state.x;\n });\n this.setDragConfig();\n }\n\n // TODO: watch config here as well and update interactable\n ngOnChanges(changes: SimpleChanges) {\n // we do this here instead of using a setter on the input so that it\n // will only run once when there is a change to x and y\n if(changes.y || changes.x) {\n this.alignPositionWithInputs(this.x, this.y);\n }\n if(changes.dragConfig || changes.disabled || changes.dragDisabled) {\n if(!this.interactable) return;\n this.setDragConfig();\n }\n /**\n * @deprecated remove this in v13\n */\n if (changes.disabled) {\n console.warn(`It looks like your using the 'disabled' input on a tftDraggable directive, it has been deprecated and is replaced with 'dragDisabled', please migrate by v13`)\n }\n }\n\n setDragConfig() {\n const enabled = !(this.disabled || this.dragDisabled)\n const dragConfig = {...this.dragConfig, enabled};\n this.interactable.draggable(dragConfig);\n }\n\n ngAfterViewInit() {\n this.addDragPropertiesToElement(this.el.nativeElement);\n if (!this.dropzone_dir) {\n this.previewRef = this.el.nativeElement;\n }\n }\n\n ngOnDestroy() {\n // clean up state and subscriptions related to destroyed component\n this.interactableSubscription.unsubscribe();\n this.interactService.destroyInteractable(this.interactableId, this.registryId);\n }\n\n dragMoveListener(event: NgDragEvent, element: Interact.Element) {\n const { dx, dy } = event;\n const scale = this.scale;\n const deltaX = scale ? dx / scale : dx;\n const deltaY = scale ? dy / scale : dy;\n\n this.interactService.updateDeltas(\n this.interactableId,\n this.registryId,\n {deltaX, deltaY},\n element\n );\n }\n\n setDragStyles(dragElement: HTMLElement) {\n this.renderer.setStyle(dragElement, 'touch-action', 'none');\n this.renderer.setStyle(dragElement, 'z-index', this.dragZIndex);\n this.renderer.setStyle(dragElement, 'position', 'absolute');\n // Prevents highlighting text if dragging over, which will interrupt the next drag action\n this.renderer.setStyle(dragElement, 'user-select', 'none');\n\n }\n\n addDragPropertiesToElement(nativeElement: TftDragElement) {\n this.renderer.setProperty(nativeElement, 'dropTarget', this.dropzone_dir || null);\n this.renderer.setProperty(nativeElement, 'dragOrigin', this.dropzone_dir || null);\n this.renderer.setProperty(nativeElement, 'dragRef', this);\n }\n\n mapDragEvent(event: NgDragEvent): TftDragEvent {\n const { target, dropzone } = event;\n const dropzoneElement = dropzone?.target || target.dropTarget?.el.nativeElement;\n const scale = this.scale;\n const positionInDropTarget = target && dropzoneElement\n ? this.interactService.calculatePositionInElement(dropzoneElement, this.previewRef, scale)\n : null;\n return {\n interactEvent: event,\n dragRef: this,\n dragOrigin: target.dragOrigin,\n dropTarget: target.dropTarget,\n positionInDropTarget\n }\n }\n\n setPosition(x: number, y: number) {\n this.interactService.updatePosition(\n this.interactableId,\n this.registryId,\n {x, y},\n this.el.nativeElement\n );\n }\n\n alignPositionWithInputs(x: number, y: number) {\n // short circuit if positions aren't numbers or if they haven't changed\n if(!this.isValidPosition(x, y)) return;\n this.interactService.updatePosition(\n this.interactableId,\n this.registryId,\n {x, y},\n this.el.nativeElement\n );\n }\n\n isValidPosition(x: number, y: number) {\n return this.isNumeric(x) && this.isNumeric(y);\n }\n // We use use this instead of isNaN here to try and help performance\n // We should be able to reliably restrict to numbers or falsey values\n isNumeric(num: number) {\n return typeof num === 'number' && !isNaN(num);\n }\n\n initiateDragEvents(dragConfig: Partial<Interact.OrBoolean<DraggableOptions>>, nativeElement: HTMLElement) {\n const defaultDragConfig = {\n ...dragConfig,\n enabled: !(this.disabled || this.dragDisabled),\n ...(this.auto_scroll_dir && {\n autoScroll:\n {\n ...this.auto_scroll_dir.autoScrollConfig,\n container: this.auto_scroll_dir.el.nativeElement as HTMLElement\n }\n }\n )\n };\n return interact(nativeElement).draggable(defaultDragConfig)\n .on('dragstart', (event: NgDragEvent) => {\n const interaction = event.interaction;\n // check if we should append drag element to body\n if ( this.enableDragDefault && interaction.pointerIsDown ) {\n if (this._previewTemplate) {\n const viewRef = this._viewContainerRef.createEmbeddedView(this._previewTemplate.templateRef);\n this.previewRef = getRootNode(viewRef, this._document);\n } else {\n this.previewRef = cloneElement(this.el.nativeElement);\n }\n this.addDragPropertiesToElement(this.previewRef);\n this.setDragStyles(this.previewRef)\n\n this.dragRootEl.prepend(this.previewRef);\n const scale = this.account_for_scale_dir?.scale || this.dragRoot?.account_for_scale_dir?.scale || 1;\n const {x, y} = this.interactService.calculatePositionInElement(this.dragRootEl, nativeElement, scale);\n this.interactService.updatePosition(this.interactableId, this.registryId, {x, y}, this.previewRef);\n if (!this.showPlaceholder) {\n this.renderer.setStyle(this.el.nativeElement, 'display', 'none');\n }\n }\n // subscribe to scroll events if they are there, by only subscribing on dragstart we avoid wasting subscriptions on interactables that aren't be dragged\n if (this.auto_scroll_dir) {\n this.subscribeToScrollEvents();\n }\n this.dragStart.emit(this.mapDragEvent(event));\n })\n .on('dragmove', (event: NgDragEvent) => {\n if (this.enableDragDefault) {\n const dragElement = this.dropzone_dir && this.previewRef || nativeElement\n this.dragMoveListener(event, dragElement);\n }\n const mappedEvent = this.mapDragEvent(event);\n this.dragMove.emit(mappedEvent);\n })\n .on('draginertiastart', (event: NgDragEvent) => {\n this.dragInertiaStart.emit(this.mapDragEvent(event))\n })\n .on('dragend', (event: NgDragEvent) => {\n const mappedEvent = this.mapDragEvent(event)\n if(!!this.dropzone_dir && this.dropzone_dir === event.target.dropTarget) {\n const { x, y} = mappedEvent.positionInDropTarget;\n this.setPosition(x, y);\n }\n this.renderer.setStyle(this.el.nativeElement, 'display', '');\n this.dragEnd.emit(mappedEvent);\n // unsubscribe from scroll events if subscribed\n if (this.auto_scroll_dir) {\n this.scrollEventsSubscription.unsubscribe();\n }\n if ( this.el.nativeElement !== this.previewRef) {\n // we do this in a timeout, so that we don't remove before the dropzone can get the boundingElementRect\n setTimeout(() => {\n this.dragRootEl.removeChild(this.previewRef);\n })\n }\n });\n }\n\n subscribeToScrollEvents() {\n this.scrollEventsSubscription = this.auto_scroll_dir.scrollDeltaObserver.subscribe(({scrollLeft, scrollTop}) => {\n const deltaX = this.scale ? scrollLeft / this.scale : scrollLeft;\n const deltaY = this.scale ? scrollTop / this.scale : scrollTop;\n\n this.interactService.updateDeltas(\n this.interactableId,\n this.registryId,\n {deltaX, deltaY},\n this.previewRef\n );\n });\n\n }\n}\n\n/**\n * Component utils\n */\n// create a clone of the component passed in and add it to the root component\nfunction cloneElement(element: HTMLElement) {\n const clone = element.cloneNode(true) as HTMLElement;\n clone.removeAttribute('id');\n return clone;\n}\nfunction getPreviewInsertionPoint(documentRef: any): HTMLElement {\n // We can't use the body if the user is in fullscreen mode,\n // because the preview will render under the fullscreen element.\n return documentRef.fullscreenElement ||\n documentRef.webkitFullscreenElement ||\n documentRef.mozFullScreenElement ||\n documentRef.msFullscreenElement ||\n documentRef.body;\n}\n","import { Directive, OnInit, OnDestroy, ElementRef, Input, Output, EventEmitter, OnChanges, SimpleChanges, Renderer2, DOCUMENT, inject } from '@angular/core';\n\nimport interact from 'interactjs';\nimport { InteractService } from '../services/interact.service';\nimport { ResizableOptions, ResizeEvent, Interactable } from '@interactjs/types/index';\nimport { Subscription } from 'rxjs';\nimport { DraggableDirective } from './draggable.directive';\nimport { DropzoneDirective } from './dropzone.directive';\nimport { DragRootDirective } from './drag-root.directive';\nimport { AccountForScaleDirective } from './account-for-scale.directive';\nimport { NgResizeEvent, TftResizeEvent, DEFAULT_REGISTRY_ID, TftDragElement } from '../models';\nimport { AutoScrollDirective } from './auto-scroll.directive';\n\ninterface ActiveEdges {\n top: boolean;\n bottom: boolean;\n left: boolean;\n right: boolean;\n}\n/** @dynamic */\n@Directive({\n selector: '[tftResizable]',\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n // prevents touch events from colliding with with mouse events\n // on touch screen\n '[style.touchAction]': 'this.resizeDisabled ? \"auto\" : \"none\"',\n // default to absolute here to accommodate likely use cases\n // consuming component can easily over ride with position input\n '[style.position]': 'position',\n // follows interactjs suggested practices\n '[style.boxSizing]': '\"border-box\"',\n },\n standalone: false\n})\nexport class ResizableDirective implements OnInit, OnDestroy, OnChanges {\n el = inject(ElementRef);\n private _document = inject<Document>(DOCUMENT);\n private interactService = inject(InteractService);\n private renderer = inject(Renderer2);\n private drag_root_dir = inject(DragRootDirective, { optional: true });\n account_for_scale_dir? = inject(AccountForScaleDirective, { optional: true });\n private draggable_dir = inject(DraggableDirective, { optional: true });\n private dropzone_dir = inject(DropzoneDirective, { optional: true, skipSelf: true });\n auto_scroll_dir? = inject(AutoScrollDirective, { optional: true, skipSelf: true });\n\n\n @Input() enableResizeDefault = true;\n // TODO: should this be an input with default or should consuming user set display in styles each time\n @Input() position = 'absolute';\n @Input() resizeConfig: Partial<Interact.OrBoolean<ResizableOptions>>;\n @Input() interactableId: string;\n\n @Input() width: number;\n @Input() height: number;\n @Input() resizeDisabled = false;\n\n @Output() resizeStart = new EventEmitter<TftResizeEvent>();\n @Output() resizeMove = new EventEmitter<TftResizeEvent>();\n @Output() resizeInertiaStart = new EventEmitter<TftResizeEvent>();\n @Output() resizeEnd = new EventEmitter<TftResizeEvent>();\n\n defaultConfig: Partial<Interact.OrBoolean<ResizableOptions>> = {\n edges: { left: true, right: true, bottom: true, top: true }\n };\n registryId: string;\n interactable: Interactable;\n // The\n dragRootEl: HTMLElement;\n\n private activeEdges: ActiveEdges = {left: false, right: false, top: false, bottom: false}\n private interactableSubscription: Subscription;\n private scrollEventsSubscription: Subscription;\n\n get scale(): number {\n return this.account_for_scale_dir?.scale || this.drag_root_dir?.account_for_scale_dir?.scale;\n }\n\n constructor() {\n const drag_root_dir = this.drag_root_dir;\n\n this.dragRootEl = (drag_root_dir?.el?.nativeElement as HTMLElement) || this._document.body;\n }\n\n ngOnInit() {\n this.addResizePropertiesToElement(this.el.nativeElement);\n\n // we check for a dropzone, we use its id as the registry id if there is on\n // otherwise, we use DEFAULT_REGISTRY_ID as a registry id. This allows us to keep our interactable\n // drag state organized by dropzones.\n this.registryId = this.dropzone_dir?.dropzoneId || DEFAULT_REGISTRY_ID;\n\n this.interactableId = this.draggable_dir?.interactableId || this.interactService.addDraggableToRegistry(this.registryId, this.interactableId);\n\n this.interactable = this.initiateResizeEvents(\n {...this.defaultConfig, ...this.resizeConfig },\n this.el.nativeElement\n );\n\n this.alignDimensionsWithInputs(this.width, this.height);\n\n this.interactableSubscription = this.interactService\n .getInteractableState(this.interactableId, this.registryId)\n .subscribe();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if ((changes.resizeConfig || changes.resizeDisabled) && this.interactable) {\n this.interactable.resizable({...this.resizeConfig, enabled: !this.resizeDisabled,});\n }\n if (changes.width || changes.height) {\n this.alignDimensionsWithInputs(this.width, this.height);\n }\n }\n\n ngOnDestroy() {\n this.interactableSubscription.unsubscribe();\n this.interactService.destroyInteractable(this.interactableId, this.registryId);\n }\n\n resizeListener(event: ResizeEvent) {\n const element: TftDragElement = this.el.nativeElement;\n const scale = this.scale;\n const {deltaRect} = event;\n const deltaX = deltaRect.left/scale;\n const deltaY = deltaRect.top/scale;\n // We get the width and height directly from the native element because\n // the event dimension can get out of sync when resizing with autoScroll\n const rect = element.getBoundingClientRect();\n const width = (rect.width + deltaRect.width)/scale;\n const height = (rect.height + deltaRect.height)/scale;\n\n this.interactService.updateSize(\n this.interactableId,\n this.registryId,\n {deltaX, deltaY, width, height},\n this.el.nativeElement\n );\n }\n /**\n * hook elements into interacts resize event listeners\n * we spread the configs so that the consuming component only overwrites the\n * pieces that it explicitly indicates\n * @param resizeConfig\n * @param nativeElement\n */\n initiateResizeEvents(resizeConfig: Partial<Interact.OrBoolean<ResizableOptions>>, nativeElement: TftDragElement) {\n // TODO: This should try and get interactable from tft_draggable if it exists\n const defaultResizeConfig = {\n ...resizeConfig,\n enabled: !this.resizeDisabled,\n ...(this.auto_scroll_dir && {\n autoScroll: {\n ...this.auto_scroll_dir.autoScrollConfig,\n container: this.auto_scroll_dir.el.nativeElement as HTMLElement\n }\n })\n };\n const interactable = this.draggable_dir?.interactable || interact(nativeElement);\n return interactable.resizable(defaultResizeConfig)\n .on('resizestart', (event: NgResizeEvent) => {\n this.activeEdges = event.edges as ActiveEdges;\n if (this.auto_scroll_dir) {\n this.subscribeToScrollEvents();\n }\n this.resizeStart.emit(this.mapResizeEvent(event))\n })\n .on('resizemove', (event: NgResizeEvent) => {\n if (this.enableResizeDefault) {\n this.resizeListener(event)\n }\n const mappedEvent = this.mapResizeEvent(event);\n this.resizeMove.emit(mappedEvent)\n })\n .on('resizeinertiastart', (event: NgResizeEvent) => this.resizeInertiaStart.emit(this.mapResizeEvent(event)))\n .on('resizeend', (event: NgResizeEvent) => {\n if (this.auto_scroll_dir) {\n this.scrollEventsSubscription.unsubscribe();\n }\n this.activeEdges = {left: false, right: false, top: false, bottom: false}\n\n this.resizeEnd.emit(this.mapResizeEvent(event));\n });\n }\n\n mapResizeEvent(event: NgResizeEvent ): TftResizeEvent {\n const target = this.el.nativeElement as TftDragElement;\n const relatedTarget = this.draggable_dir?.dropzone_dir?.el.nativeElement;\n const scale = this.scale;\n const positionInDropTarget = target && relatedTarget\n ? this.interactService.calculatePositionInElement(relatedTarget, target, scale)\n : null;\n return {\n interactEvent: event,\n resizeRef: this,\n dragRef: this.draggable_dir,\n dragOrigin: this.dropzone_dir,\n dropTarget: this.el.nativeElement.dropTarget,\n positionInDropTarget,\n size: {\n width: target.clientWidth / scale,\n height: target.clientHeight / scale\n }\n }\n }\n\n alignDimensionsWithInputs(width: number, height: number) {\n this.interactService.updateSize(\n this.interactableId,\n this.registryId,\n {deltaX: 0, deltaY: 0, width, height},\n this.el.nativeElement\n );\n }\n\n addResizePropertiesToElement(nativeElement: TftDragElement) {\n this.renderer.setProperty(nativeElement, 'resizeRef', this);\n }\n\n subscribeToScrollEvents() {\n this.scrollEventsSubscription = this.auto_scroll_dir.scrollDeltaObserver.subscribe(({scrollLeft, scrollTop}) => {\n const scale = this.scale;\n const target = this.el.nativeElement as HTMLElement;\n const {width: prevWidth, height: prevHeight} = target.getBoundingClientRect();\n\n const deltaHeight = scrollTop * (this.activeEdges.top ? -1 : this.activeEdges.bottom ? 1 : 0);\n const deltaWidth = scrollLeft * (this.activeEdges.left ? -1 : this.activeEdges.right ? 1 : 0);\n\n const height = (prevHeight + deltaHeight) / scale;\n const width = (prevWidth + deltaWidth) / scale;\n const deltaX = this.activeEdges.left ? (scrollLeft / scale) : 0;\n const deltaY = this.activeEdges.top ? (scrollTop / scale) : 0;\n this.interactService.updateSize(\n this.interactableId,\n this.registryId,\n {deltaX, deltaY, width, height},\n this.el.nativeElement as HTMLElement\n );\n });\n }\n}\n","import { Directive, ElementRef, Input, OnInit, Output, EventEmitter, SimpleChanges, OnChanges, inject } from '@angular/core';\nimport interact from 'interactjs';\nimport { DraggableOptions, GesturableOptions, Interactable, GestureEvent } from '@interactjs/types/index';\nimport { Observable } from 'rxjs';\nimport { TftCoords, TftGestureEvent } from '../models';\nimport { DraggableDirective } from '../directives';\n\n/** @dynamic */\n@Directive({\n selector: '[tftGesturable]',\n // eslint-disable-next-line @angular-eslint/no-host-metadata-property\n host: {\n // '[style.touchAction]': 'this.gestureDisabled ? \"auto\" : \"none\"',\n '[id]': 'gesturableId',\n },\n standalone: false\n})\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class GesturableDirective<D = any> implements OnInit, OnChanges {\n el = inject(ElementRef);\n private draggable_dir = inject(DraggableDirective, { optional: true });\n\n\n @Input() gesturableId: string;\n @Input() gestureDisabled = false;\n @Input() gestureConfig: Partial<Interact.OrBoolean<DraggableOptions>>;\n // pipes all interact events to event emitters\n @Output() gestureStart = new EventEmitter<TftGestureEvent>();\n @Output() gestureMove = new EventEmitter<TftGestureEvent>();\n @Output() gestureEnd = new EventEmitter<TftGestureEvent>();\n\n interactableState: Observable<TftCoords>;\n interactable: Interactable;\n\n ngOnInit() {\n this.gesturableId = this.draggable_dir?.interactableId || 'id';\n this.interactable = this.initiateGestureEvents(this.gestureConfig, this.el.nativeElement);\n this.setGestureConfig();\n }\n\n // TODO: watch config here as well and update interactable\n ngOnChanges(changes: SimpleChanges) {\n // we do this here instead of using a setter on the input so that it\n // will only run once when there is a change to x and y\n if(changes.gestureConfig || changes.gestureDisabled) {\n if(!this.interactable) return;\n this.setGestureConfig();\n }\n }\n\n setGestureConfig() {\n const enabled = !this.gestureDisabled;\n const gestureConfig = {...this.gestureConfig, enabled};\n this.interactable.gesturable(gestureConfig);\n }\n\n initiateGestureEvents(gestureConfig: Partial<Interact.OrBoolean<GesturableOptions>>, nativeElement: HTMLElement) {\n\n const defaultConfig: GesturableOptions = {\n enabled: !this.gestureDisabled,\n };\n const interactable = this.draggable_dir?.interactable || interact(nativeElement);\n\n return interactable.gesturable({...defaultConfig, ...gestureConfig})\n .on('gesturestart', (event: GestureEvent) => {\n this.gestureStart.emit({gestureRef: this, interactEvent: event})\n })\n .on('gesturemove', (event: GestureEvent) => {\n this.gestureMove.emit({gestureRef: this, interactEvent: event})\n })\n .on('gestureend', (event: GestureEvent) => {\n this.gestureEnd.emit({gestureRef: this, interactEvent: event})\n })\n }\n}\n","import { Directive, ElementRef, HostBinding, Input, inject } from '@angular/core';\n\n@Directive({\n selector: '[tftApplyScale]',\n standalone: false\n})\nexport class ApplyScaleDirective {\n el = inject(ElementRef);\n\n\n _scale = 1;\n // this setup allows consumers to set x, y scale independently or just set them both with scale\n @Input() set scale(val: number){\n this._scale;\n this.fontSize = `${val}px`;\n };\n\n @HostBinding('style.fontSize') fontSize: string;\n}\n","import {\n computed,\n Directive,\n ElementRef,\n EventEmitter,\n HostListener,\n inject,\n Input,\n Output,\n signal,\n} from '@angular/core';\n\nexport interface LassoRect {\n left: number;\n right: number;\n top: number;\n bottom: number;\n}\n\n/**\n * Directive that handles lasso (drag-to-select) interaction geometry.\n * Manages mouse tracking, the visual selection rectangle, and click suppression.\n * Domain-specific hit-testing (what got selected) is the consumer's responsibility:\n * listen to `(lassoCommit)` with the viewport-space bounding rect and query your own elements.\n *\n * Usage:\n * ```html\n * <div tftLasso #lasso=\"tftLasso\" [scale]=\"scale\"\n * (lassoStart)=\"onStart()\" (lassoCommit)=\"onCommit($event)\">\n * @if (lasso.lassoDisplayRect(); as r) {\n * <div class=\"lasso-rect\" [style.left.px]=\"r.x\" [style.top.px]=\"r.y\"\n * [style.width.px]=\"r.w\" [style.height.px]=\"r.h\"></div>\n * }\n * </div>\n * ```\n */\n@Directive({\n selector: '[tftLasso]',\n exportAs: 'tftLasso',\n standalone: false,\n host: {\n '[style.touch-action]': 'lassoDisabled ? \"auto\" : \"none\"',\n },\n})\nexport class LassoDirective {\n private host = inject(ElementRef<HTMLElement>);\n\n /** Scale factor applied to the host element — used to convert viewport px to container-local px. */\n @Input() scale = 1;\n /** When true, lasso interaction is disabled. */\n @Input() lassoDisabled = false;\n\n /** Emitted on mousedown (before any drag). Use to clear previous selection state. */\n @Output() lassoStart = new EventEmitter<void>();\n /**\n * Emitted on mouseup when the drag exceeded the 5 px threshold.\n * Rect is in viewport (clientX/Y) space — pass directly to getBoundingClientRect comparisons.\n */\n @Output() lassoCommit = new EventEmitter<LassoRect>();\n\n // -------------------------------------------------------------------------\n // Internal state\n // -------------------------------------------------------------------------\n private _startVP: { x: number; y: number } | null = null;\n private _currentVP: { x: number; y: number } | null = null;\n private _startLocal = signal<{ x: number; y: number } | null>(null);\n private _currentLocal = signal<{ x: number; y: number } | null>(null);\n private _suppressNextClick = false;\n private _activePointerId: number | null = null;\n\n /** True while a lasso drag is in progress. */\n isLassoing = signal(false);\n\n /**\n * Rectangle in container-local CSS pixels (pre-divided by scale) — bind directly to\n * [style.left.px], [style.top.px], [style.width.px], [style.height.px].\n * Null when no drag is in progress.\n */\n lassoDisplayRect = computed(\n (): { x: number; y: number; w: number; h: number } | null => {\n const s = this._startLocal();\n const c = this._currentLocal();\n if (!s || !c || !this.isLassoing()) return null;\n return {\n x: Math.min(s.x, c.x),\n y: Math.min(s.y, c.y),\n w: Math.abs(c.x - s.x),\n h: Math.abs(c.y - s.y),\n };\n }\n );\n\n private toLocal(vpX: number, vpY: number): { x: number; y: number } {\n const rect = this.host.nativeElement.getBoundingClientRect();\n return {\n x: (vpX - rect.left) / this.scale,\n y: (vpY - rect.top) / this.scale,\n };\n }\n\n // -------------------------------------------------------------------------\n // Event handling\n // -------------------------------------------------------------------------\n\n @HostListener('pointerdown', ['$event'])\n onPointerDown(e: PointerEvent) {\n if (this.lassoDisabled) return;\n if (e.target !== e.currentTarget) return; // ignore clicks on children\n this._activePointerId = e.pointerId;\n this.host.nativeElement.setPointerCapture(e.pointerId); // track movement outside element bounds\n this._startVP = { x: e.clientX, y: e.clientY };\n this._currentVP = { x: e.clientX, y: e.clientY };\n this._startLocal.set(this.toLocal(e.clientX, e.clientY));\n this._currentLocal.set(this.toLocal(e.clientX, e.clientY));\n this.isLassoing.set(true);\n this.lassoStart.emit();\n e.preventDefault();\n }\n\n @HostListener('pointermove', ['$event'])\n onPointerMove(e: PointerEvent) {\n if (!this.isLassoing() || e.pointerId !== this._activePointerId) return;\n this._currentVP = { x: e.clientX, y: e.clientY };\n this._currentLocal.set(this.toLocal(e.clientX, e.clientY));\n }\n\n @HostListener('pointerup', ['$event'])\n @HostListener('pointercancel', ['$event'])\n onPointerUp(e: PointerEvent) {\n if (!this.isLassoing() || e.pointerId !== this._activePointerId) return;\n this.isLassoing.set(false);\n this._activePointerId = null;\n const s = this._startVP!;\n const c = this._currentVP!;\n this._startVP = null;\n this._currentVP = null;\n this._startLocal.set(null);\n this._currentLocal.set(null);\n\n // Treat tiny drags (< 5 px) as background clicks — clear, don't commit\n if (Math.abs(c.x - s.x) < 5 && Math.abs(c.y - s.y) < 5) return;\n\n this._suppressNextClick = true;\n this.lassoCommit.emit({\n left: Math.min(s.x, c.x),\n right: Math.max(s.x, c.x),\n top: Math.min(s.y, c.y),\n bottom: Math.max(s.y, c.y),\n });\n }\n\n /** Suppresses the click event that fires immediately after a real lasso drag ends. */\n @HostListener('click', ['$event'])\n onClick(e: MouseEvent) {\n if (this._suppressNextClick) {\n this._suppressNextClick = false;\n e.stopPropagation();\n }\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ArrayOfNPipe } from './pipes/array-of-n.pipe';\nimport { ApplyScaleDirective, DraggableDirective, DragRootDirective, AutoScrollDirective, AccountForScaleDirective, GesturableDirective, ResizableDirective, DropzoneDirective, DragPreviewDirective, LassoDirective } from './directives';\nimport { InteractService } from './services/interact.service';\nimport { InteractRootConfig, INTERACT_ROOT_CONFIG } from './models';\n\n\n\nconst EXPORTS = [\n DraggableDirective,\n ResizableDirective,\n DropzoneDirective,\n GesturableDirective,\n DragRootDirective,\n AutoScrollDirective,\n AccountForScaleDirective,\n ApplyScaleDirective,\n DragPreviewDirective,\n LassoDirective,\n ArrayOfNPipe,\n];\n\n\n@NgModule({\n imports: [CommonModule],\n // providers: [{ provide: INTERACT_ROOT_CONFIG, useValue: 'px' }],\n declarations: [\n ...EXPORTS,\n ],\n exports: [\n ...EXPORTS\n ]\n})\nexport class InteractModule {\n static forRoot(config: InteractRootConfig): ModuleWithProviders<InteractModule> {\n const defaultConfig: InteractRootConfig = {cssDimensionUnit: 'px'}\n return {\n ngModule: InteractModule,\n providers: [\n { provide: INTERACT_ROOT_CONFIG, useValue: {...defaultConfig, ...config} },\n InteractService\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["cloneElement"],"mappings":";;;;;;;MAMa,YAAY,CAAA;AAEvB;;;;AAIG;IACH,SAAS,CAAC,CAAS,EAAE,GAAW,EAAA;QAC9B,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,QAAQ,IAAI,GAAG,GAAG,CAAC;QAC7D,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAC,CAAC,KAAI,CAAC,CAAC;IACtD;8GAVW,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAZ,YAAY,EAAA,YAAA,EAAA,KAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACF,oBAAA,IAAI,EAAE,UAAU;AAChB,oBAAA,UAAU,EAAE;AACf,iBAAA;;;MCMY,oBAAoB,GAAG,IAAI,cAAc,CAAqB,6BAA6B;AAEjG,MAAM,mBAAmB,GAAG;AACnC;;AAEG;AACI,MAAM,YAAY,GAAU;AACj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AwB;YACxB,mBAAmB;YACnB,oBAAoB;YACpB,cAAc;YACd,YAAY,CAAA,EAAA,OAAA,EAAA,CAKF,YAAY,CAAA,EAAA,OAAA,EAAA,CAftB,kBAAkB;YAClB,kBAAkB;YAClB,iBAAiB;YACjB,mBAAmB;YACnB,iBAAiB;YACjB,mBAAmB;YACnB,wBAAwB;YACxB,mBAAmB;YACnB,oBAAoB;YACpB,cAAc;YACd,YAAY,CAAA,EAAA,CAAA,CAAA;AAcD,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YATf,YAAY,CAAA,EAAA,CAAA,CAAA;;2FASX,cAAc,EAAA,UAAA,EAAA,CAAA;kBAV1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;;AAEvB,oBAAA,YAAY,EAAE;AACZ,wBAAA,GAAG,OAAO;AACX,qBAAA;AACD,oBAAA,OAAO,EAAE;AACP,wBAAA,GAAG;AACJ;AACF,iBAAA;;;ACjCD;;AAEG;;;;"}
|
package/package.json
CHANGED
package/types/tft-interact.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as _interactjs_core_Interactable from '@interactjs/core/Interactable';
|
|
|
4
4
|
import { DropzoneOptions, Interactable, DraggableOptions, ResizableOptions, ResizeEvent, GesturableOptions } from '@interactjs/types/index';
|
|
5
5
|
import { Observable, Subject, BehaviorSubject } from 'rxjs';
|
|
6
6
|
import { Point, DropEvent, Interactable as Interactable$1, DragEvent, ResizeEvent as ResizeEvent$1, GestureEvent } from '@interactjs/types';
|
|
7
|
-
import * as
|
|
7
|
+
import * as i12 from '@angular/common';
|
|
8
8
|
|
|
9
9
|
type PositionOption = 'relative' | 'absolute' | 'fixed' | 'static' | 'sticky' | 'unset' | 'inherit' | 'initial' | 'revert';
|
|
10
10
|
declare class DropzoneDirective implements OnInit, OnChanges {
|
|
@@ -247,6 +247,71 @@ declare class ApplyScaleDirective {
|
|
|
247
247
|
static ɵdir: i0.ɵɵDirectiveDeclaration<ApplyScaleDirective, "[tftApplyScale]", never, { "scale": { "alias": "scale"; "required": false; }; }, {}, never, never, false, never>;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
+
interface LassoRect {
|
|
251
|
+
left: number;
|
|
252
|
+
right: number;
|
|
253
|
+
top: number;
|
|
254
|
+
bottom: number;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Directive that handles lasso (drag-to-select) interaction geometry.
|
|
258
|
+
* Manages mouse tracking, the visual selection rectangle, and click suppression.
|
|
259
|
+
* Domain-specific hit-testing (what got selected) is the consumer's responsibility:
|
|
260
|
+
* listen to `(lassoCommit)` with the viewport-space bounding rect and query your own elements.
|
|
261
|
+
*
|
|
262
|
+
* Usage:
|
|
263
|
+
* ```html
|
|
264
|
+
* <div tftLasso #lasso="tftLasso" [scale]="scale"
|
|
265
|
+
* (lassoStart)="onStart()" (lassoCommit)="onCommit($event)">
|
|
266
|
+
* @if (lasso.lassoDisplayRect(); as r) {
|
|
267
|
+
* <div class="lasso-rect" [style.left.px]="r.x" [style.top.px]="r.y"
|
|
268
|
+
* [style.width.px]="r.w" [style.height.px]="r.h"></div>
|
|
269
|
+
* }
|
|
270
|
+
* </div>
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
273
|
+
declare class LassoDirective {
|
|
274
|
+
private host;
|
|
275
|
+
/** Scale factor applied to the host element — used to convert viewport px to container-local px. */
|
|
276
|
+
scale: number;
|
|
277
|
+
/** When true, lasso interaction is disabled. */
|
|
278
|
+
lassoDisabled: boolean;
|
|
279
|
+
/** Emitted on mousedown (before any drag). Use to clear previous selection state. */
|
|
280
|
+
lassoStart: EventEmitter<void>;
|
|
281
|
+
/**
|
|
282
|
+
* Emitted on mouseup when the drag exceeded the 5 px threshold.
|
|
283
|
+
* Rect is in viewport (clientX/Y) space — pass directly to getBoundingClientRect comparisons.
|
|
284
|
+
*/
|
|
285
|
+
lassoCommit: EventEmitter<LassoRect>;
|
|
286
|
+
private _startVP;
|
|
287
|
+
private _currentVP;
|
|
288
|
+
private _startLocal;
|
|
289
|
+
private _currentLocal;
|
|
290
|
+
private _suppressNextClick;
|
|
291
|
+
private _activePointerId;
|
|
292
|
+
/** True while a lasso drag is in progress. */
|
|
293
|
+
isLassoing: i0.WritableSignal<boolean>;
|
|
294
|
+
/**
|
|
295
|
+
* Rectangle in container-local CSS pixels (pre-divided by scale) — bind directly to
|
|
296
|
+
* [style.left.px], [style.top.px], [style.width.px], [style.height.px].
|
|
297
|
+
* Null when no drag is in progress.
|
|
298
|
+
*/
|
|
299
|
+
lassoDisplayRect: i0.Signal<{
|
|
300
|
+
x: number;
|
|
301
|
+
y: number;
|
|
302
|
+
w: number;
|
|
303
|
+
h: number;
|
|
304
|
+
}>;
|
|
305
|
+
private toLocal;
|
|
306
|
+
onPointerDown(e: PointerEvent): void;
|
|
307
|
+
onPointerMove(e: PointerEvent): void;
|
|
308
|
+
onPointerUp(e: PointerEvent): void;
|
|
309
|
+
/** Suppresses the click event that fires immediately after a real lasso drag ends. */
|
|
310
|
+
onClick(e: MouseEvent): void;
|
|
311
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LassoDirective, never>;
|
|
312
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<LassoDirective, "[tftLasso]", ["tftLasso"], { "scale": { "alias": "scale"; "required": false; }; "lassoDisabled": { "alias": "lassoDisabled"; "required": false; }; }, { "lassoStart": "lassoStart"; "lassoCommit": "lassoCommit"; }, never, never, false, never>;
|
|
313
|
+
}
|
|
314
|
+
|
|
250
315
|
type CssDimensionUnit = 'px' | 'em';
|
|
251
316
|
interface InteractRootConfig {
|
|
252
317
|
cssDimensionUnit: CssDimensionUnit;
|
|
@@ -398,7 +463,7 @@ declare class ArrayOfNPipe implements PipeTransform {
|
|
|
398
463
|
declare class InteractModule {
|
|
399
464
|
static forRoot(config: InteractRootConfig): ModuleWithProviders<InteractModule>;
|
|
400
465
|
static ɵfac: i0.ɵɵFactoryDeclaration<InteractModule, never>;
|
|
401
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<InteractModule, [typeof DraggableDirective, typeof ResizableDirective, typeof DropzoneDirective, typeof GesturableDirective, typeof DragRootDirective, typeof AutoScrollDirective, typeof AccountForScaleDirective, typeof ApplyScaleDirective, typeof DragPreviewDirective, typeof ArrayOfNPipe], [typeof
|
|
466
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<InteractModule, [typeof DraggableDirective, typeof ResizableDirective, typeof DropzoneDirective, typeof GesturableDirective, typeof DragRootDirective, typeof AutoScrollDirective, typeof AccountForScaleDirective, typeof ApplyScaleDirective, typeof DragPreviewDirective, typeof LassoDirective, typeof ArrayOfNPipe], [typeof i12.CommonModule], [typeof DraggableDirective, typeof ResizableDirective, typeof DropzoneDirective, typeof GesturableDirective, typeof DragRootDirective, typeof AutoScrollDirective, typeof AccountForScaleDirective, typeof ApplyScaleDirective, typeof DragPreviewDirective, typeof LassoDirective, typeof ArrayOfNPipe]>;
|
|
402
467
|
static ɵinj: i0.ɵɵInjectorDeclaration<InteractModule>;
|
|
403
468
|
}
|
|
404
469
|
|
|
@@ -414,5 +479,5 @@ declare function cloneElement(element: HTMLElement): HTMLElement;
|
|
|
414
479
|
*/
|
|
415
480
|
declare function getRootNode(viewRef: EmbeddedViewRef<any>, _document: Document): HTMLElement;
|
|
416
481
|
|
|
417
|
-
export { AccountForScaleDirective, ApplyScaleDirective, ArrayOfNPipe, AutoScrollDirective, DEFAULT_REGISTRY_ID, DragPreviewDirective, DragRootDirective, DraggableDirective, DropzoneDirective, GesturableDirective, INTERACT_ROOT_CONFIG, InteractModule, ResizableDirective, TFT_DRAG_PREVIEW, cloneElement, defaultDelta, defaultPosition, defaultSize, getClosestMatchingAncestor, getRootNode };
|
|
418
|
-
export type { CssDimensionUnit, Delta, InteractRootConfig, InteractableRegistry, InteractableSystem, NgDragEvent, NgDropEvent, NgResizeEvent, Position, PositionOption, Size, TftCoords, TftDragElement, TftDragEvent, TftDropEvent, TftGestureEvent, TftInteractableEvent, TftResizeElement, TftResizeEvent };
|
|
482
|
+
export { AccountForScaleDirective, ApplyScaleDirective, ArrayOfNPipe, AutoScrollDirective, DEFAULT_REGISTRY_ID, DragPreviewDirective, DragRootDirective, DraggableDirective, DropzoneDirective, GesturableDirective, INTERACT_ROOT_CONFIG, InteractModule, LassoDirective, ResizableDirective, TFT_DRAG_PREVIEW, cloneElement, defaultDelta, defaultPosition, defaultSize, getClosestMatchingAncestor, getRootNode };
|
|
483
|
+
export type { CssDimensionUnit, Delta, InteractRootConfig, InteractableRegistry, InteractableSystem, LassoRect, NgDragEvent, NgDropEvent, NgResizeEvent, Position, PositionOption, Size, TftCoords, TftDragElement, TftDragEvent, TftDropEvent, TftGestureEvent, TftInteractableEvent, TftResizeElement, TftResizeEvent };
|