<commit_before><!--
Aspect which maps direction semantics (goLeft, goRight, etc.) to selection
semantics (selectPrevious, selectNext, etc.).

@element basic-direction-selection
-->

<link rel="import" href="../basic-aspect/basic-aspect.html">

<script>
window.Basic = window.Basic || {};

window.Basic.DirectionSelection = {

  contribute: {

    goDown: function() {
      return this.collective.selectNext();
    },

    goEnd: function() {
      return this.collective.selectLast();
    },

    goLeft: function() {
      return this.collective.selectPrevious();
    },

    goRight: function() {
      return this.collective.selectNext();
    },

    goStart: function() {
      return this.collective.selectFirst();
    },

    goUp: function() {
      return this.collective.selectPrevious();
    },

    // Default implementations. These will typically be handled by other aspects
    // in the collective.
    selectFirst: function() {},
    selectLast: function() {},
    selectNext: function() {},
    selectPrevious: function() {}

  },

  name: 'DirectionSelection'

  // TODO: Need to find home for this DOM-specific navigation code.
  // This handles moving in lists where items arranged horizontally.
  //
  // Return true if the selected control is displayed inline.
  // _selectedItemIsInline: function() {
  //   var selectedItem = this.collective.selectedItem;
  //   if (!selectedItem) {
  //     return false;
  //   }
  //   var style = getComputedStyle(selectedItem);
  //   var inlineDisplayValues = ['inline', 'inline-block', 'inline-table'];
  //   var itemIsInline = (inlineDisplayValues.indexOf(style.display) >= 0);
  //   return itemIsInline;
  // }
<commit_msg>Updated from consolidated repo<commit_after><!--
Aspect which maps direction semantics (goLeft, goRight, etc.) to selection
semantics (selectPrevious, selectNext, etc.).

@element basic-direction-selection
-->

<link rel="import" href="../basic-aspect/basic-aspect.html">

<script>
window.Basic = window.Basic || {};

window.Basic.DirectionSelection = {

  contribute: {

    goDown: function() {
      return this.collective.selectNext();
    },

    goEnd: function() {
      return this.collective.selectLast();
    },

    goLeft: function() {
      return this.collective.selectPrevious();
    },

    goRight: function() {
      return this.collective.selectNext();
    },

    goStart: function() {
      return this.collective.selectFirst();
    },

    goUp: function() {
      return this.collective.selectPrevious();
    },

    // Default implementations. These will typically be handled by other aspects
    // in the collective.
    selectFirst: Basic.Collective.defaultMethod,
    selectLast: Basic.Collective.defaultMethod,
    selectNext: Basic.Collective.defaultMethod,
    selectPrevious: Basic.Collective.defaultMethod

  },

  name: 'DirectionSelection'

  // TODO: Need to find home for this DOM-specific navigation code.
  // This handles moving in lists where items arranged horizontally.
  //
  // Return true if the selected control is displayed inline.
  // _selectedItemIsInline: function() {
  //   var selectedItem = this.collective.selectedItem;
  //   if (!selectedItem) {
  //     return false;
  //   }
  //   var style = getComputedStyle(selectedItem);
  //   var inlineDisplayValues = ['inline', 'inline-block', 'inline-table'];
  //   var itemIsInline = (inlineDisplayValues.indexOf(style.display) >= 0);
  //   return itemIsInline;
  // }

{'fraction_non_alphanumeric': 0.13144998558662438, 'fraction_numerical': 0.0005765350245027386, 'mean_word_length': 3.063231850117096, 'pattern_counts': {'":': 0, '<': 9, '<?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': '7195788', 'n_tokens_mistral': 996, 'n_tokens_neox': 966, 'n_words': 249}