<commit_before>'use strict'
const getParentNode = require('../../render/dom/parent')
const props = require('../../render/nostate').property
const prefix = require('vigour-ua/navigator').prefix
const isNumber = require('vigour-util/is/number')
const transform = prefix + 'Transform'

exports.properties = {
  transform: { // store 0

    type: 'style',
    render (state, type, stamp, subs, tree, pnode) {
      if (!pnode) {
        pnode = getParentNode(this.parent, state, type, stamp, subs, tree)
      }
      const val = state ? this.compute(state.val) : this.compute()
      if (typeof val === 'string') {
        const store = getStore(this.parent, tree)
        store[0] = val
      }

      props(this, type, stamp, subs, tree, pnode) // pass store
    },
    properties: {
      x: { // store 1
        type: 'style',
        render (state, type, stamp, subs, tree, pnode) {
          const val = state ? this.compute(state.val) : this.compute()
          const store = getStore(this.parent, tree)
          store[1] = 'translate3d(' + (isNumber(val) ? val + 'px' : val) + ','
          store[2] = store[2] || '0,0)'
          console.log('x:', store.join(' '))
        }
      },
      y: { // store 2
        type: 'style',
        render (state, type, stamp, subs, tree, pnode) {
          const val = state ? this.compute(state.val) : this.compute()
          const store = getStore(this.parent, tree)
          store[1] = store[1] || 'translate3d(0px,'
          store[2] = (isNumber(val) ? val + 'px' : val) + ', 0)'
          console.log('y:', store.join(' '))
        }
      },
      rotate: { // store 3
        type: 'style',
        render (state, type, stamp, subs, tree, pnode) {
          const val = state ? this.compute(state.val) : this.compute()
          const store = getStore(this.parent, tree)
          store[3] = 'rotate(' + val + 'deg)'
          console.log('rotate:', store.join(' '))
        }
      },
      scale: { // store 4
        type: 'style',
        render (state, type, stamp, subs, tree, pnode) {
          const val = state ? this.compute(state.val) : this.compute()
          const store = getStore(this.parent, tree)
          store[4] = 'scale(' + val + ')'
          console.log('scale:', store.join(' '))
        }
      }
    }
  }
}

function getStore (parent, tree) {
  const uid = parent.uid()
  return tree._[uid] || (tree._[uid] = [])
}<commit_msg>more transform property<commit_after>'use strict'
const getParentNode = require('../../render/dom/parent')
const props = require('../../render/nostate').property
const prefix = require('vigour-ua/navigator').prefix
const isNumber = require('vigour-util/is/number')
const transform = prefix + 'Transform'

exports.properties = {
  transform: { // store 0
    type: 'style',
    render (state, type, stamp, subs, tree, pnode, uid) {
      if (this.noState) {
        const val = this.compute()
        const store = []
        if (typeof val === 'string') {
          store.push(val)
        }
        props(this, type, stamp, subs, tree, store)
        pnode.style[transform] = store.join(' ')
      } else {
        const val = this.compute(state.val)
        const store = tree._[uid] || (tree._[uid] = [])
        if (typeof val === 'string') {
          store.push(val)
        }
        if (!pnode) {
          pnode = getParentNode(this, state, type, stamp, subs, tree)
        }
        props(this, type, stamp, subs, tree, store)
        pnode.style[transform] = store.join(' ')
      }
    },
    properties: {
      x: { // store 1
        type: 'style',
        render (state, type, stamp, subs, tree, store) {
          const val = state ? this.compute(state.val) : this.compute()
          store[1] = 'translate3d(' + (isNumber(val) ? val + 'px' : val) + ','
          store[2] = store[2] || '0,0)'
        }
      },
      y: { // store 2
        type: 'style',
        render (state, type, stamp, subs, tree, store) {
          const val = state ? this.compute(state.val) : this.compute()
          store[1] = store[1] || 'translate3d(0px,'
          store[2] = (isNumber(val) ? val + 'px' : val) + ', 0)'
        }
      },
      rotate: { // store 3
        type: 'style',
        render (state, type, stamp, subs, tree, store) {
          const val = state ? this.compute(state.val) : this.compute()
          store[3] = 'rotate(' + val + 'deg)'
        }
      },
      scale: { // store 4
        type: 'style',
        render (state, type, stamp, subs, tree, store) {
          const val = state ? this.compute(state.val) : this.compute()
          store[4] = 'scale(' + val + ')'
        }
      }
    }
  }
}
{'fraction_non_alphanumeric': 0.1700064641241112, 'fraction_numerical': 0.008403361344537815, 'mean_word_length': 2.0300261096605743, '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': '7534321', 'n_tokens_mistral': 1483, 'n_tokens_neox': 1465, 'n_words': 369}