Socket
Socket
Sign inDemoInstall

svelte-motion

Package Overview
Dependencies
29
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.12.0 to 0.12.1

.vscode/settings.json

11

package.json
{
"name": "svelte-motion",
"version": "0.12.0",
"version": "0.12.1",
"description": "Svelte animation library based on the React library framer-motion.",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "vitest --typecheck.only",
"build": "rollup -c"

@@ -24,6 +24,9 @@ },

"@tsconfig/svelte": "^5.0.2",
"rollup": "^4.0.0",
"rollup": "^4.9.2",
"rollup-plugin-css-porter": "^1.0.2",
"rollup-plugin-svelte": "^7.1.6",
"svelte-preprocess": "^5.1.1"
"svelte-preprocess": "^5.1.1",
"tsc": "^2.0.4",
"typescript": "^5.3.3",
"vitest": "^1.1.1"
},

@@ -30,0 +33,0 @@ "peerDependencies": {

@@ -5,3 +5,3 @@ import svelte from 'rollup-plugin-svelte'

import replace from "@rollup/plugin-replace";
import pkg from './package.json'
import pkg from './package.json' assert { type: 'json'}

@@ -8,0 +8,0 @@ const name = pkg.name

@@ -6,2 +6,3 @@ /**

import { __assign } from 'tslib';
import { isKeyframesTarget } from './is-keyframes-target.js';

@@ -58,5 +59,5 @@

}
return Object.assign({ to: to }, transitionFactory(to));
return __assign({ to: to }, transitionFactory(to));
};
export { criticallyDampedSpring, getDefaultTransition, linearTween, underDampedSpring };

@@ -6,3 +6,3 @@ /**

import {fixed} from '../../utils/fix-process-env';
import { __rest, __spreadArray, __read } from 'tslib';
import { __assign, __rest, __spreadArray, __read } from 'tslib';
import { inertia, animate } from 'popmotion';

@@ -31,3 +31,3 @@ import { secondsToMilliseconds } from '../../utils/time-conversion.js';

var ease = _a.ease, times = _a.times, yoyo = _a.yoyo, flip = _a.flip, loop = _a.loop, transition = __rest(_a, ["ease", "times", "yoyo", "flip", "loop"]);
var options = Object.assign({}, transition);
var options = __assign({}, transition);
if (times)

@@ -106,5 +106,5 @@ options["offset"] = times;

if (!isTransitionDefined(transition)) {
transition = Object.assign(Object.assign({}, transition), getDefaultTransition(key, options.to));
transition = __assign(__assign({}, transition), getDefaultTransition(key, options.to));
}
return Object.assign(Object.assign({}, options), convertTransitionToAnimationOptions(transition));
return __assign(__assign({}, options), convertTransitionToAnimationOptions(transition));
}

@@ -146,4 +146,4 @@ /**

valueTransition.type === "decay"
? inertia(Object.assign(Object.assign({}, options), valueTransition))
: animate(Object.assign(Object.assign({}, getPopmotionAnimationOptions(valueTransition, options, key)), { onUpdate: function (v) {
? inertia(__assign(__assign({}, options), valueTransition))
: animate(__assign(__assign({}, getPopmotionAnimationOptions(valueTransition, options, key)), { onUpdate: function (v) {
var _a;

@@ -150,0 +150,0 @@ options.onUpdate(v);

@@ -6,2 +6,3 @@ /**

import {fixed} from '../../../utils/fix-process-env';
import { __assign } from 'tslib';
import sync, { getFrameData } from 'framesync';

@@ -24,3 +25,3 @@ import { mix, progress, linear, mixColor, circOut } from 'popmotion';

};
var prevOptions = Object.assign({}, options);
var prevOptions = __assign({}, options);
var leadState = {};

@@ -59,3 +60,3 @@ var followState = {};

transition = transition && getValueTransition(transition, "crossfade");
return animate(progress, target, Object.assign(Object.assign({}, transition), { onUpdate: onUpdate, onComplete: function () {
return animate(progress, target, __assign(__assign({}, transition), { onUpdate: onUpdate, onComplete: function () {
if (!hasUpdated) {

@@ -62,0 +63,0 @@ progress.set(target);

@@ -6,2 +6,3 @@ /**

import { __assign } from 'tslib';
import { Presence } from '../types.js';

@@ -14,3 +15,3 @@ import { elementDragControls } from '../../../gestures/drag/VisualElementDragControls.js';

var state = { leadIsExiting: false };
var prevState = Object.assign({}, state);
var prevState = __assign({}, state);
var prevValues;

@@ -61,3 +62,3 @@ var prevViewportBox;

var _a;
prevState = Object.assign({}, state);
prevState = __assign({}, state);
var lead;

@@ -64,0 +65,0 @@ var follow;

@@ -6,3 +6,3 @@ /**

import {fixed} from '../../utils/fix-process-env';
import { __rest, __spreadArray, __read } from 'tslib';
import { __rest, __assign, __spreadArray, __read } from 'tslib';
import { invariant } from 'hey-listen';

@@ -368,3 +368,3 @@ import { PanSession } from '../PanSession.js';

var _b = _a.drag, drag = _b === void 0 ? false : _b, _c = _a.dragDirectionLock, dragDirectionLock = _c === void 0 ? false : _c, _d = _a.dragPropagation, dragPropagation = _d === void 0 ? false : _d, _e = _a.dragConstraints, dragConstraints = _e === void 0 ? false : _e, _f = _a.dragElastic, dragElastic = _f === void 0 ? defaultElastic : _f, _g = _a.dragMomentum, dragMomentum = _g === void 0 ? true : _g, remainingProps = __rest(_a, ["drag", "dragDirectionLock", "dragPropagation", "dragConstraints", "dragElastic", "dragMomentum"]);
this.props = Object.assign({ drag: drag,
this.props = __assign({ drag: drag,
dragDirectionLock: dragDirectionLock,

@@ -443,3 +443,3 @@ dragPropagation: dragPropagation,

var bounceDamping = dragElastic ? 40 : 10000000;
var inertia = Object.assign(Object.assign({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness: bounceStiffness,
var inertia = __assign(__assign({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness: bounceStiffness,
bounceDamping: bounceDamping, timeConstant: 750, restDelta: 1, restSpeed: 10 }, dragTransition), transition);

@@ -446,0 +446,0 @@ // If we're not animating on an externally-provided `MotionValue` we can use the

@@ -6,2 +6,3 @@ /**

import {fixed} from '../utils/fix-process-env';
import { __assign } from 'tslib';
import { isMouseEvent, isTouchEvent } from './utils/event-type.js';

@@ -50,3 +51,3 @@ import { extractEventInfo } from '../events/event-info.js';

var timestamp = getFrameData().timestamp;
_this.history.push(Object.assign(Object.assign({}, point), { timestamp: timestamp }));
_this.history.push(__assign(__assign({}, point), { timestamp: timestamp }));
var _a = _this.handlers, onStart = _a.onStart, onMove = _a.onMove;

@@ -88,3 +89,3 @@ if (!isPanStarted) {

var timestamp = getFrameData().timestamp;
this.history = [Object.assign(Object.assign({}, point), { timestamp: timestamp })];
this.history = [__assign(__assign({}, point), { timestamp: timestamp })];
var onSessionStart = handlers.onSessionStart;

@@ -91,0 +92,0 @@ onSessionStart &&

@@ -6,2 +6,3 @@ /**

import {fixed} from '../../../utils/fix-process-env';
import { __assign } from 'tslib';
import { complex, px } from 'style-value-types';

@@ -97,3 +98,3 @@ import { mix } from 'popmotion';

var defaultScaleCorrectors = {
borderRadius: Object.assign(Object.assign({}, borderCorrectionDefinition), { applyTo: [
borderRadius: __assign(__assign({}, borderCorrectionDefinition), { applyTo: [
"borderTopLeftRadius",

@@ -100,0 +101,0 @@ "borderTopRightRadius",

@@ -5,2 +5,3 @@ /**

*/
import { __assign } from 'tslib';
import { isSVGComponent } from './is-svg-component.js';

@@ -16,3 +17,3 @@ import { createUseRender } from '../use-render.js';

: htmlMotionConfig;
return Object.assign(Object.assign({}, baseConfig), { preloadedFeatures: preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement: createVisualElement,
return __assign(__assign({}, baseConfig), { preloadedFeatures: preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement: createVisualElement,
Component: Component });

@@ -19,0 +20,0 @@ }

@@ -5,3 +5,3 @@ /**

*/
import { __rest, __read } from 'tslib';
import { __rest, __assign, __read } from 'tslib';
//import { invariant } from 'hey-listen';

@@ -64,3 +64,3 @@

if (transitionEnd) {
transitionEnd = Object.assign({}, transitionEnd);
transitionEnd = __assign({}, transitionEnd);
}

@@ -67,0 +67,0 @@ // Go through existing `MotionValue`s and ensure any existing CSS variables are resolved

@@ -6,3 +6,3 @@ /**

import {fixed} from '../../../utils/fix-process-env';
import { __read } from 'tslib';
import { __assign, __read } from 'tslib';
import { number, px } from 'style-value-types';

@@ -141,4 +141,4 @@ import { isKeyframesTarget } from '../../../animation/utils/is-keyframes-target.js';

if (transitionEnd === void 0) { transitionEnd = {}; }
target = Object.assign({}, target);
transitionEnd = Object.assign({}, transitionEnd);
target = __assign({}, target);
transitionEnd = __assign({}, transitionEnd);
var targetPositionalKeys = Object.keys(target).filter(isPositionalKey);

@@ -145,0 +145,0 @@ // We want to remove any transform values that could affect the element's bounding box before

@@ -6,2 +6,3 @@ /**

import {fixed} from '../../../utils/fix-process-env';
import { __assign } from 'tslib';
import { color, filter } from 'style-value-types';

@@ -13,3 +14,3 @@ import { numberValueTypes } from './number.js';

*/
var defaultValueTypes = Object.assign(Object.assign({}, numberValueTypes), {
var defaultValueTypes = __assign(__assign({}, numberValueTypes), {
// Color props

@@ -16,0 +17,0 @@ color: color, backgroundColor: color, outlineColor: color, fill: color, stroke: color,

@@ -6,6 +6,7 @@ /**

import {fixed} from '../../../utils/fix-process-env';
import { __assign } from 'tslib';
import { number } from 'style-value-types';
var int = Object.assign(Object.assign({}, number), { transform: Math.round });
var int = __assign(__assign({}, number), { transform: Math.round });
export { int };

@@ -5,3 +5,3 @@ /**

*/
import { __rest} from 'tslib';
import { __rest, __assign } from 'tslib';
import { visualElement } from '../index.js';

@@ -101,3 +101,3 @@ import { getOrigin, checkTargetForNewValues } from '../utils/setters.js';

}
return Object.assign({ transition: transition,
return __assign({ transition: transition,
transitionEnd: transitionEnd }, target);

@@ -104,0 +104,0 @@ },

@@ -6,3 +6,3 @@ /**

import {fixed} from '../utils/fix-process-env';
import { __spreadArray, __read } from 'tslib';
import { __assign, __spreadArray, __read } from 'tslib';
import sync, { cancelSync } from 'framesync';

@@ -112,3 +112,3 @@ import { pipe } from 'popmotion';

*/
var baseTarget = Object.assign({}, latestValues);
var baseTarget = __assign({}, latestValues);
// Internal methods ========================

@@ -215,3 +215,3 @@ /**

var isVariantNode = checkIfVariantNode(props);
var element = Object.assign(Object.assign({ treeType: treeType,
var element = __assign(__assign({ treeType: treeType,
/**

@@ -218,0 +218,0 @@ * This is a mirror of the internal instance prop, which keeps

@@ -5,6 +5,7 @@ /**

*/
import { __assign } from 'tslib';
import { createHtmlRenderState } from '../../html/utils/create-render-state.js';
var createSvgRenderState = function () { return (Object.assign(Object.assign({}, createHtmlRenderState()), { attrs: {} })); };
var createSvgRenderState = function () { return (__assign(__assign({}, createHtmlRenderState()), { attrs: {} })); };
export { createSvgRenderState };

@@ -5,2 +5,3 @@ /**

*/
import { __assign } from 'tslib';
import { visualElement } from '../index.js';

@@ -17,3 +18,3 @@ import { scrapeMotionValuesFromProps } from './utils/scrape-motion-values.js';

var svgVisualElement = visualElement(Object.assign(Object.assign({}, htmlConfig), { getBaseTarget: function (props, key) {
var svgVisualElement = visualElement(__assign(__assign({}, htmlConfig), { getBaseTarget: function (props, key) {
return props[key];

@@ -20,0 +21,0 @@ },

@@ -5,3 +5,3 @@ /**

*/
import { __spreadArray, __read, __rest } from 'tslib';
import { __spreadArray, __read, __assign, __rest } from 'tslib';
import { isAnimationControls } from '../../animation/utils/is-animation-controls.js';

@@ -45,3 +45,3 @@ import { isKeyframesTarget } from '../../animation/utils/is-keyframes-target.js';

resolved.transition; var transitionEnd = resolved.transitionEnd, target = __rest(resolved, ["transition", "transitionEnd"]);
acc = Object.assign(Object.assign(Object.assign({}, acc), target), transitionEnd);
acc = __assign(__assign(__assign({}, acc), target), transitionEnd);
}

@@ -126,3 +126,3 @@ return acc;

*/
typeState.protectedKeys = Object.assign({}, encounteredKeys);
typeState.protectedKeys = __assign({}, encounteredKeys);
// Check if we can skip analysing this prop early

@@ -174,3 +174,3 @@ if (

var _b = typeState.prevResolvedValues, prevResolvedValues = _b === void 0 ? {} : _b;
var allKeys = Object.assign(Object.assign({}, prevResolvedValues), resolvedValues);
var allKeys = __assign(__assign({}, prevResolvedValues), resolvedValues);
var markToAnimate = function (key) {

@@ -241,3 +241,3 @@ shouldAnimateType = true;

if (typeState.isActive) {
encounteredKeys = Object.assign(Object.assign({}, encounteredKeys), resolvedValues);
encounteredKeys = __assign(__assign({}, encounteredKeys), resolvedValues);
}

@@ -255,3 +255,3 @@ if (isInitialRender && visualElement.blockInitialAnimation) {

animation: animation,
options: Object.assign({ type: type }, options),
options: __assign({ type: type }, options),
}); }))));

@@ -269,3 +269,3 @@ }

}
allAnimatedKeys = Object.assign({}, encounteredKeys);
allAnimatedKeys = __assign({}, encounteredKeys);
/**

@@ -272,0 +272,0 @@ * If there are some removed value that haven't been dealt with,

@@ -5,3 +5,3 @@ /**

*/
import { __read, __rest} from 'tslib';
import { __read, __rest, __assign } from 'tslib';
import { startAnimation } from '../../animation/utils/transitions.js';

@@ -98,3 +98,3 @@ import { setTarget } from './setters.js';

}
var animation = startAnimation(key, value, valueTarget, Object.assign({ delay: delay }, transition));
var animation = startAnimation(key, value, valueTarget, __assign({ delay: delay }, transition));
animations.push(animation);

@@ -124,3 +124,3 @@ }

.forEach(function (child, i) {
animations.push(animateVariant(child, variant, Object.assign(Object.assign({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function () { return child.notifyAnimationComplete(variant); }));
animations.push(animateVariant(child, variant, __assign(__assign({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function () { return child.notifyAnimationComplete(variant); }));
});

@@ -127,0 +127,0 @@ return Promise.all(animations);

@@ -6,3 +6,3 @@ /**

import {fixed} from '../../utils/fix-process-env';
import { __rest, __spreadArray, __read } from 'tslib';
import { __rest, __assign, __spreadArray, __read } from 'tslib';
import { complex } from 'style-value-types';

@@ -33,3 +33,3 @@ import { isNumericalString } from '../../utils/is-numerical-string.js';

: {}, _b = _a.transitionEnd, transitionEnd = _b === void 0 ? {} : _b; _a.transition; var target = __rest(_a, ["transitionEnd", "transition"]);
target = Object.assign(Object.assign({}, target), transitionEnd);
target = __assign(__assign({}, target), transitionEnd);
for (var key in target) {

@@ -36,0 +36,0 @@ var value = resolveFinalValueInKeyframes(target[key]);

@@ -5,2 +5,3 @@ /**

*/
import { __assign } from 'tslib';
import { noop } from '../noop.js';

@@ -54,4 +55,4 @@

return {
x: Object.assign({}, box.x),
y: Object.assign({}, box.y),
x: __assign({}, box.x),
y: __assign({}, box.y),
};

@@ -70,4 +71,4 @@ }

return {
x: Object.assign({}, zeroDelta),
y: Object.assign({}, zeroDelta),
x: __assign({}, zeroDelta),
y: __assign({}, zeroDelta),
};

@@ -74,0 +75,0 @@ }

@@ -6,2 +6,3 @@ /**

import {fixed} from './fix-process-env';
import { __assign } from 'tslib';
import { interpolate } from 'popmotion';

@@ -24,3 +25,3 @@

var options = args[3 + argOffset];
var interpolator = interpolate(inputRange, outputRange, Object.assign({ mixer: getMixer(outputRange[0]) }, options));
var interpolator = interpolate(inputRange, outputRange, __assign({ mixer: getMixer(outputRange[0]) }, options));
return useImmediate ? interpolator(inputValue) : interpolator;

@@ -27,0 +28,0 @@ }

@@ -5,3 +5,3 @@ /**

*/
import { SvelteComponentTyped } from "svelte";
import { SvelteComponent } from "svelte";
import { AnimatePresenceProps } from "./types";

@@ -47,2 +47,2 @@ /**

type ConditionalGeneric<T> = T extends {key:any} ? T : { key: 1}; // Better handling of defaults and the optional list prop
export declare type AnimatePresence<T extends {key:any}> = SvelteComponentTyped<AnimatePresenceProps<T>, {}, {default:{ item: ConditionalGeneric<T> }}>
export declare class AnimatePresence<T extends {key:any}> extends SvelteComponent<AnimatePresenceProps<T>, {}, {default:{ item: ConditionalGeneric<T> }}>{}

@@ -7,3 +7,3 @@ /**

import { SharedLayoutProps } from "./types";
import { SvelteComponentTyped } from "svelte";
import { SvelteComponent } from "svelte";
/**

@@ -13,3 +13,3 @@ * Wrap several [#Motion] components with the \`layout\` or \`layoutId\` prop with this component, so that all react smoothly to the change of a single component.

*/
export declare class AnimateSharedLayout extends SvelteComponentTyped<SharedLayoutProps, {}, {default:{}}> {
export declare class AnimateSharedLayout extends SvelteComponent<SharedLayoutProps, {}, {default:{}}> {
}

@@ -5,3 +5,3 @@ /**

*/
import { SvelteComponentTyped } from "svelte";
import { SvelteComponent } from "svelte";
import { MotionConfigContextObject } from "../../context/MotionConfigContext";

@@ -22,3 +22,3 @@ export declare type MotionConfigProps = Partial<MotionConfigContextObject>

*/
export declare class MotionConfig extends SvelteComponentTyped<MotionConfigProps,{},{default:{}}> { }
export declare class MotionConfig extends SvelteComponent<MotionConfigProps,{},{default:{}}> { }

@@ -5,3 +5,3 @@ /**

*/
import { SvelteComponentTyped } from "svelte";
import { SvelteComponent } from "svelte";
import { VisualElement } from "..";

@@ -50,3 +50,3 @@ export declare function addDomEvent(target: EventTarget, eventName: string, handler: EventListener, options?: AddEventListenerOptions): () => void;

*/
export declare class UseDomEvent extends SvelteComponentTyped<UseDomEventProps,{},{default:{}}>{}
export declare class UseDomEvent extends SvelteComponent<UseDomEventProps,{},{default:{}}>{}

@@ -5,3 +5,3 @@ /**

*/
import { SvelteComponentTyped } from "svelte";
import { SvelteComponent } from "svelte";
import { DOMMotionComponents } from "./types";

@@ -21,3 +21,3 @@ import { CustomMotionComponentConfig} from './motion-proxy'

*/
export declare class Motion extends SvelteComponentTyped<
export declare class Motion extends SvelteComponent<
CustomMotionComponentConfig & MotionProps & IsSVG,

@@ -37,3 +37,3 @@ {},

*/
motion: (node)=>void };
motion: import('svelte/action').Action };
}

@@ -40,0 +40,0 @@ >{}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc