Comparing version 6.0.1-alpha.4 to 6.0.1-alpha.5
@@ -1,2 +0,1 @@ | ||
import { __assign } from 'tslib'; | ||
import { convertToBezierString } from '../utils/bezier-string.js'; | ||
@@ -6,16 +5,26 @@ import { secondsToMilliseconds } from '../utils/convert-time.js'; | ||
function animate(elements, keyframes, options) { | ||
if (typeof elements === "string") { | ||
elements = document.querySelectorAll(elements); | ||
} | ||
if (Array.isArray(elements) || elements instanceof NodeList) { | ||
var _a = options.stagger, stagger_1 = _a === void 0 ? 0 : _a, _b = options.delay, delay_1 = _b === void 0 ? 0 : _b; | ||
return Array.from(elements).map(function (element, i) { | ||
animate(element, keyframes, __assign(__assign({}, options), { delay: delay_1 + stagger_1 * i })); | ||
}); | ||
} | ||
var element = elements; | ||
var _c = options.delay, delay = _c === void 0 ? 0 : _c, _d = options.duration, duration = _d === void 0 ? 0.3 : _d, _e = options.repeat, repeat = _e === void 0 ? 0 : _e, iterationStart = options.initialProgress, easing = options.easing; | ||
function animate(element, | ||
// elements: Element | Element[] | NodeListOf<Element> | string, | ||
keyframes, options) { | ||
// if (typeof elements === "string") { | ||
// elements = document.querySelectorAll(elements) | ||
// } | ||
if (options === void 0) { options = {}; } | ||
// if (Array.isArray(elements) || elements instanceof NodeList) { | ||
// const { stagger = 0, delay = 0 } = options | ||
// return Array.from(elements).map((element, i) => { | ||
// animate(element, keyframes, { ...options, delay: delay + stagger * i }) | ||
// }) | ||
// } | ||
// const element = elements as HTMLElement | ||
var _a = options.delay, delay = _a === void 0 ? 0 : _a, _b = options.duration, duration = _b === void 0 ? 0.3 : _b, _c = options.repeat, repeat = _c === void 0 ? 0 : _c, _d = options.initialProgress, iterationStart = _d === void 0 ? 0 : _d, _e = options.easing, easing = _e === void 0 ? "linear" : _e; | ||
delay = secondsToMilliseconds(delay); | ||
duration = secondsToMilliseconds(duration); | ||
console.log({ | ||
delay: delay, | ||
duration: duration, | ||
easing: Array.isArray(easing) ? convertToBezierString(easing) : easing, | ||
iterations: repeat + 1, | ||
iterationStart: iterationStart, | ||
}); | ||
function onComplete() { | ||
@@ -22,0 +31,0 @@ Object.assign(element.style, getTargetKeyframe(keyframes)); |
export { animate } from './dom/animate.js'; | ||
export { animated, useAnimation } from './dom/react/index.js'; |
{ | ||
"name": "motion", | ||
"version": "6.0.1-alpha.4", | ||
"version": "6.0.1-alpha.5", | ||
"description": "The Motion library for the web", | ||
@@ -5,0 +5,0 @@ "author": "Matt Perry", |
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1
44189
68
812