@symbo.ls/atoms
Advanced tools
Comparing version 2.10.257 to 2.10.258
{ | ||
"name": "@symbo.ls/atoms", | ||
"version": "2.10.257", | ||
"version": "2.10.258", | ||
"main": "index.js", | ||
"license": "MIT", | ||
"gitHead": "3c16c123fa0b6cf00a16e2178bbbfd1049d4c0cc", | ||
"gitHead": "988320990c3bd3a293df5c9dce5419ef4551d29e", | ||
"dependencies": { | ||
@@ -8,0 +8,0 @@ "@domql/utils": "latest", |
'use strict' | ||
import { isString } from '@domql/utils' | ||
import { getTimingByKey, getTimingFunction } from '@symbo.ls/scratch' | ||
import { | ||
getTimingFunction, | ||
splitTransition, | ||
transformDuration | ||
} from '@symbo.ls/scratch' | ||
export const transformTransition = transition => { | ||
const arr = transition.split(' ') | ||
if (!arr.length) return transition | ||
return arr.map(v => { | ||
if (v.slice(0, 2) === '--') return `var(${v})` | ||
if (v.length < 3 || v.includes('ms')) { | ||
const mapWithSequence = getTimingByKey(v) | ||
return mapWithSequence.timing || v | ||
} | ||
if (getTimingFunction(v)) return getTimingFunction(v) | ||
return v | ||
}).join(' ') | ||
} | ||
export const transformDuration = (duration, props, propertyName) => { | ||
if (!isString(duration)) return | ||
return duration.split(',').map(v => getTimingByKey(v).timing || v).join(',') | ||
} | ||
export const splitTransition = transition => { | ||
const arr = transition.split(',') | ||
if (!arr.length) return | ||
return arr.map(transformTransition).join(',') | ||
} | ||
export const Timing = { | ||
@@ -34,0 +10,0 @@ class: { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39467
1076