<commit_before>import { Directive, HostBinding, Input, HostListener } from '@angular/core';

export interface DraggableData {
  data?: any;
}

@Directive({
  selector: '[ngDraggable]',
})
export class DraggableDirective {
  @HostBinding('draggable')
  get draggable() {
    return true
  }

  @Input()
  set ngDraggable(data: DraggableData) {
    if (data) {
      this.draggableData.data = data
    }
  }

  @HostListener('dragstart', ['$event'])
  private onDragStart(event: DragEvent) {

    const {data} = this.draggableData

    event.dataTransfer.setData('Text', JSON.stringify(data))
  }

  private draggableData: DraggableData = {}
}
<commit_msg>Drag&Drop background indicator of active drag item<commit_after>import { Directive, HostBinding, Input, HostListener } from '@angular/core';

export interface DraggableData {
  data?: any;
}

@Directive({
  selector: '[ngDraggable]',
})
export class DraggableDirective {
  @HostBinding('draggable')
  get draggable() {
    return true
  }

  @HostBinding('style.backgroundColor')
  private backgroundColor

  @Input()
  set ngDraggable(data: DraggableData) {
    if (data) {
      this.draggableData.data = data
    }
  }

  @HostListener('dragstart', ['$event'])
  private onDragStart(event: DragEvent) {

    this.backgroundColor = '#5bc0de'

    const {data} = this.draggableData

    event.dataTransfer.setData('Text', JSON.stringify(data))
  }

  @HostListener('dragend', ['$event'])
  private onDragEnd(event: DragEvent) {
    this.backgroundColor = undefined
  }

  private draggableData: DraggableData = {}
}

{'fraction_non_alphanumeric': 0.13239974538510502, 'fraction_numerical': 0.001273074474856779, 'mean_word_length': 4.222591362126246, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1448266', 'n_tokens_mistral': 528, 'n_tokens_neox': 514, 'n_words': 106}