<commit_before>import Vue from 'vue'

const transitionsKeys = [
  'name',
  'mode',
  'css',
  'type',
  'duration',
  'enterClass',
  'leaveClass',
  'enterActiveClass',
  'enterActiveClass',
  'leaveActiveClass',
  'enterToClass',
  'leaveToClass'
]
const listenersKeys = [
  'beforeEnter',
  'enter',
  'afterEnter',
  'enterCancelled',
  'beforeLeave',
  'leave',
  'afterLeave',
  'leaveCancelled'
]

export default {
  name: 'nuxt-child',
  functional: true,
  render (h, { parent, data }) {
    data.nuxtChild = true

    const transitions = parent.$nuxt.nuxt.transitions
    const defaultTransition = parent.$nuxt.nuxt.defaultTransition
    let depth = 0
    while (parent) {
      if (parent.$vnode && parent.$vnode.data.nuxtChild) {
        depth++
      }
      parent = parent.$parent
    }
    data.nuxtChildDepth = depth
    const transition = transitions[depth] || defaultTransition
    let transitionProps = {}
    transitionsKeys.forEach((key) => {
      if (typeof transition[key] !== 'undefined') {
        transitionProps[key] = transition[key]
      }
    })
    let listeners = {}
    listenersKeys.forEach((key) => {
      if (typeof transition[key] === 'function') {
        listeners[key] = transition[key]
      }
    })
    return h('transition', {
      props: transitionProps,
      on: listeners
    }, [
      h('router-view', data)
    ])
  }
}
<commit_msg>feat(nuxt-child): bind transition calls to parent<commit_after>import Vue from 'vue'

const transitionsKeys = [
  'name',
  'mode',
  'css',
  'type',
  'duration',
  'enterClass',
  'leaveClass',
  'enterActiveClass',
  'enterActiveClass',
  'leaveActiveClass',
  'enterToClass',
  'leaveToClass'
]
const listenersKeys = [
  'beforeEnter',
  'enter',
  'afterEnter',
  'enterCancelled',
  'beforeLeave',
  'leave',
  'afterLeave',
  'leaveCancelled'
]

export default {
  name: 'nuxt-child',
  functional: true,
  render (h, { parent, data }) {
    data.nuxtChild = true
    const _parent = parent
    const transitions = parent.$nuxt.nuxt.transitions
    const defaultTransition = parent.$nuxt.nuxt.defaultTransition
    let depth = 0
    while (parent) {
      if (parent.$vnode && parent.$vnode.data.nuxtChild) {
        depth++
      }
      parent = parent.$parent
    }
    data.nuxtChildDepth = depth
    const transition = transitions[depth] || defaultTransition
    let transitionProps = {}
    transitionsKeys.forEach((key) => {
      if (typeof transition[key] !== 'undefined') {
        transitionProps[key] = transition[key]
      }
    })
    let listeners = {}
    listenersKeys.forEach((key) => {
      if (typeof transition[key] === 'function') {
        listeners[key] = transition[key].bind(_parent)
      }
    })
    return h('transition', {
      props: transitionProps,
      on: listeners
    }, [
      h('router-view', data)
    ])
  }
}

{'fraction_non_alphanumeric': 0.14435879467414156, 'fraction_numerical': 0.000700770847932726, 'mean_word_length': 2.9270976616231086, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6590990', 'n_tokens_mistral': 908, 'n_tokens_neox': 910, 'n_words': 186}