<commit_before>library dragula;

import 'dart:html';
import 'package:js/js.dart';

/// By default, `dragula` will allow the user to drag an element in any of the
/// [containers] and drop it in any other container in the list. If the element
/// is dropped anywhere that's not one of the [containers], the event will be
/// gracefully cancelled according to the [revertOnSpill] and [removeOnSpill]
/// options.
///
/// Note that dragging is only triggered on left clicks, and only if no meta keys
/// are pressed.
///
/// The example below allows the user to drag elements from `left` into `right`,
/// and from `right` into `left`.
///
///     dragula([document.querySelector('#left'), document.querySelector('#right')]);
///
/// You can also provide optional parameters. Here's an **overview of the default values**.
///
///     dragula(containers,
///       isContainer: (Element el) {
///         return false; // only elements in drake.containers will be taken into account
///       },
///       moves: (Element el, Element source, Element handle, Element sibling) {
///         return true; // elements are always draggable by default
///       },
///       accepts: (Element el, Element target, Element source, Element sibling) {
///         return true; // elements can be dropped in any of the `containers` by default
///       },
///       invalid: (Element el, Element target) {
///         return false; // don't prevent any drags from initiating by default
///       },
///       direction: 'vertical',             // Y axis is considered when determining where an element would be dropped
///       copy: false,                       // elements are moved by default, not copied
///       copySortSource: false,             // elements in copy-source containers can be reordered
///       revertOnSpill: false,              // spilling will put the element back where it was dragged from, if this is true
///       removeOnSpill: false,              // spilling will `.remove` the element, if this is true
///       mirrorContainer: document.body,    // set the element that gets mirror elements appended
///       ignoreInputTextSelection: true     // allows users to select input text, see details below
///     );
///
Drake dragula(List<Element> containers,
    {String direction: 'vertical',
    dynamic /*bool|Function*/ copy: false,
    bool invalid(Element el, target),
    bool copySortSource: false,
    bool revertOnSpill: false,
    bool removeOnSpill: false,
    dynamic /*bool|num*/ delay,
    Element mirrorContainer /*: *document.body*/,
    ignoreInputTextSelection: true,
    bool isContainer(Element el),
    bool moves(Element el, Element source, Element handling, Element sibling),
    bool accepts(Element el, Element target, Element source, Element ref)}) {
  moves ??= allowInterop((Element el, Element source, Element handling, Element sibling) {
    return true;
  });
  accepts ??= allowInterop((Element el, Element target, Element source, Element reference) {
    return true;
  });
  invalid ??= allowInterop((Element el, target) => false);
  isContainer ??= allowInterop((Element el) => false);
  mirrorContainer ??= document.body;

  return _dragula(
      containers,
      new DragulaOptions(
          direction: direction,
          isContainer: isContainer,
          moves: moves,
          accepts: accepts,
          invalid: invalid,
          copy: copy,
          copySortSource: copySortSource,
          revertOnSpill: revertOnSpill,
          removeOnSpill: removeOnSpill,
          delay: delay,
          mirrorContainer: mirrorContainer,
          ignoreInputTextSelection: ignoreInputTextSelection));
}

movesDefault() {

}

/// The dragula method returns a tiny object with a concise API.
@JS()
class Drake {
  /// This property contains the collection of containers that was passed to
  /// `dragula` when building this `drake` instance. You can `push` more
  /// containers and `splice` old containers at will.
  List<Element> containers;

  /// This property will be `true` whenever an element is being dragged.
  external bool get dragging;

  /// Enter drag mode **without a shadow**. This method is most useful when
  /// providing complementary keyboard shortcuts to an existing drag and drop
  /// solution. Even though a shadow won't be created at first, the user will
  /// get one as soon as they click on `item` and start dragging it around.
  /// Note that if they click and drag something else, `.end` will be called
  /// before picking up the new item.
  external void start(Element item);

  /// Gracefully end the drag event as if using **the last position marked by
  /// the preview shadow** as the drop target. The proper `cancel` or `drop`
  /// event will be fired, depending on whether the item was dropped back where
  /// it was originally lifted from
  /// _(which is essentially a no-op that's treated as a `cancel` event)_.
  external void end();
<commit_msg>remove unused method<commit_after>library dragula;

import 'dart:html';
import 'package:js/js.dart';

/// By default, `dragula` will allow the user to drag an element in any of the
/// [containers] and drop it in any other container in the list. If the element
/// is dropped anywhere that's not one of the [containers], the event will be
/// gracefully cancelled according to the [revertOnSpill] and [removeOnSpill]
/// options.
///
/// Note that dragging is only triggered on left clicks, and only if no meta keys
/// are pressed.
///
/// The example below allows the user to drag elements from `left` into `right`,
/// and from `right` into `left`.
///
///     dragula([document.querySelector('#left'), document.querySelector('#right')]);
///
/// You can also provide optional parameters. Here's an **overview of the default values**.
///
///     dragula(containers,
///       isContainer: (Element el) {
///         return false; // only elements in drake.containers will be taken into account
///       },
///       moves: (Element el, Element source, Element handle, Element sibling) {
///         return true; // elements are always draggable by default
///       },
///       accepts: (Element el, Element target, Element source, Element sibling) {
///         return true; // elements can be dropped in any of the `containers` by default
///       },
///       invalid: (Element el, Element target) {
///         return false; // don't prevent any drags from initiating by default
///       },
///       direction: 'vertical',             // Y axis is considered when determining where an element would be dropped
///       copy: false,                       // elements are moved by default, not copied
///       copySortSource: false,             // elements in copy-source containers can be reordered
///       revertOnSpill: false,              // spilling will put the element back where it was dragged from, if this is true
///       removeOnSpill: false,              // spilling will `.remove` the element, if this is true
///       mirrorContainer: document.body,    // set the element that gets mirror elements appended
///       ignoreInputTextSelection: true     // allows users to select input text, see details below
///     );
///
Drake dragula(List<Element> containers,
    {String direction: 'vertical',
    dynamic /*bool|Function*/ copy: false,
    bool invalid(Element el, target),
    bool copySortSource: false,
    bool revertOnSpill: false,
    bool removeOnSpill: false,
    dynamic /*bool|num*/ delay,
    Element mirrorContainer /*: *document.body*/,
    ignoreInputTextSelection: true,
    bool isContainer(Element el),
    bool moves(Element el, Element source, Element handling, Element sibling),
    bool accepts(Element el, Element target, Element source, Element ref)}) {
  moves ??= allowInterop((Element el, Element source, Element handling, Element sibling) {
    return true;
  });
  accepts ??= allowInterop((Element el, Element target, Element source, Element reference) {
    return true;
  });
  invalid ??= allowInterop((Element el, target) => false);
  isContainer ??= allowInterop((Element el) => false);
  mirrorContainer ??= document.body;

  return _dragula(
      containers,
      new DragulaOptions(
          direction: direction,
          isContainer: isContainer,
          moves: moves,
          accepts: accepts,
          invalid: invalid,
          copy: copy,
          copySortSource: copySortSource,
          revertOnSpill: revertOnSpill,
          removeOnSpill: removeOnSpill,
          delay: delay,
          mirrorContainer: mirrorContainer,
          ignoreInputTextSelection: ignoreInputTextSelection));
}

/// The dragula method returns a tiny object with a concise API.
@JS()
class Drake {
  /// This property contains the collection of containers that was passed to
  /// `dragula` when building this `drake` instance. You can `push` more
  /// containers and `splice` old containers at will.
  List<Element> containers;

  /// This property will be `true` whenever an element is being dragged.
  external bool get dragging;

  /// Enter drag mode **without a shadow**. This method is most useful when
  /// providing complementary keyboard shortcuts to an existing drag and drop
  /// solution. Even though a shadow won't be created at first, the user will
  /// get one as soon as they click on `item` and start dragging it around.
  /// Note that if they click and drag something else, `.end` will be called
  /// before picking up the new item.
  external void start(Element item);

  /// Gracefully end the drag event as if using **the last position marked by
  /// the preview shadow** as the drop target. The proper `cancel` or `drop`
  /// event will be fired, depending on whether the item was dropped back where
  /// it was originally lifted from
  /// _(which is essentially a no-op that's treated as a `cancel` event)_.
  external void end();

{'fraction_non_alphanumeric': 0.1057633973710819, 'fraction_numerical': 0.0, 'mean_word_length': 2.7128378378378377, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '60781', 'n_tokens_mistral': 2513, 'n_tokens_neox': 2480, 'n_words': 1121}