Socket
Socket
Sign inDemoInstall

svelte-motion

Package Overview
Dependencies
27
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.12.1 to 0.12.2

svelte.config.js

17

package.json
{
"name": "svelte-motion",
"version": "0.12.1",
"version": "0.12.2",
"description": "Svelte animation library based on the React library framer-motion.",

@@ -8,3 +8,4 @@ "main": "src/index.js",

"test": "vitest --typecheck.only",
"build": "rollup -c"
"build": "rollup -c",
"build:svelte": "svelte-package --input ./src && publint --strict"
},

@@ -24,2 +25,3 @@ "author": "Michael Lucht <micha-lmxt@gradientdescent.de> (https://svelte-motion.gradientdescent.de)",

"@rollup/plugin-replace": "^5.0.5",
"@sveltejs/vite-plugin-svelte": "^3.0.1",
"@tsconfig/svelte": "^5.0.2",

@@ -29,9 +31,12 @@ "rollup": "^4.9.2",

"rollup-plugin-svelte": "^7.1.6",
"svelte": "^5.0.0-next.37",
"svelte-preprocess": "^5.1.1",
"tsc": "^2.0.4",
"typescript": "^5.3.3",
"vitest": "^1.1.1"
"tsc": "2.0.4",
"typescript": "5.3.3",
"vite": "^5.0.12",
"vitest": "1.1.1",
"publint": "^0.2.7"
},
"peerDependencies": {
"svelte": ">=3.35.0"
"svelte": ">=3.35.0 || ^4.0.0 || ^5.0.0 || ^5.0.0-next.0"
},

@@ -38,0 +43,0 @@ "type": "module",

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

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

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

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

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

import {fixed} from '../../utils/fix-process-env';
import { __assign, __rest, __spreadArray, __read } from 'tslib';
import { __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 = __assign({}, transition);
var options = Object.assign({}, transition);
if (times)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

import {fixed} from '../../utils/fix-process-env';
import { __rest, __assign, __spreadArray, __read } from 'tslib';
import { __rest, __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 = __assign({ drag: drag,
this.props = Object.assign({ drag: drag,
dragDirectionLock: dragDirectionLock,

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

var bounceDamping = dragElastic ? 40 : 10000000;
var inertia = __assign(__assign({ type: "inertia", velocity: dragMomentum ? velocity[axis] : 0, bounceStiffness: bounceStiffness,
var inertia = Object.assign(Object.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,3 +6,2 @@ /**

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

if (transitionEnd) {
transitionEnd = __assign({}, transitionEnd);
transitionEnd = Object.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 { __assign, __read } from 'tslib';
import { __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 = __assign({}, target);
transitionEnd = __assign({}, transitionEnd);
target = Object.assign({}, target);
transitionEnd = Object.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,3 +6,2 @@ /**

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

*/
import { __spreadArray, __read, __assign, __rest } from 'tslib';
import { __spreadArray, __read, __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 = __assign(__assign(__assign({}, acc), target), transitionEnd);
acc = Object.assign(Object.assign(Object.assign({}, acc), target), transitionEnd);
}

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

*/
typeState.protectedKeys = __assign({}, encounteredKeys);
typeState.protectedKeys = Object.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 = __assign(__assign({}, prevResolvedValues), resolvedValues);
var allKeys = Object.assign(Object.assign({}, prevResolvedValues), resolvedValues);
var markToAnimate = function (key) {

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

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

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

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

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

}
allAnimatedKeys = __assign({}, encounteredKeys);
allAnimatedKeys = Object.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, __assign } from 'tslib';
import { __read, __rest} from 'tslib';
import { startAnimation } from '../../animation/utils/transitions.js';

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

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

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

.forEach(function (child, i) {
animations.push(animateVariant(child, variant, __assign(__assign({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function () { return child.notifyAnimationComplete(variant); }));
animations.push(animateVariant(child, variant, Object.assign(Object.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, __assign, __spreadArray, __read } from 'tslib';
import { __rest, __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 = __assign(__assign({}, target), transitionEnd);
target = Object.assign(Object.assign({}, target), transitionEnd);
for (var key in target) {

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

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

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

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

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

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

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

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

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

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

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

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

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

@@ -14,3 +14,3 @@ {

/* Language and Environment */
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"target": "ES2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */

@@ -25,9 +25,9 @@ // "jsx": "preserve", /* Specify what JSX code is generated. */

// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
"useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */
"module": "commonjs", /* Specify what module code is generated. */
"module": "NodeNext", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
"moduleResolution": "Node16", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */

@@ -37,3 +37,3 @@ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */

// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
"types": ["vitest/globals"], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */

@@ -58,3 +58,3 @@ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */

// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */

@@ -111,4 +111,6 @@ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */

// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
}
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"include": ["tests/**/*.test-d.ts", "vite.config.ts"],
"exclude": ["../node_modules/**"]
}

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

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

@@ -47,2 +47,2 @@ * `AnimatePresence` enables the animation of components that have been removed from the tree.

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

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

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

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

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

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

import { SvelteComponent } from "svelte";
import { MotionConfigContextObject } from "../../context/MotionConfigContext";
import { MotionConfigContextObject } from "../../context/MotionConfigContext.js";
export declare type MotionConfigProps = Partial<MotionConfigContextObject>

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

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

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

import { SvelteComponent } from "svelte";
import { DOMMotionComponents } from "./types";
import { CustomMotionComponentConfig} from './motion-proxy'
import { MotionProps } from "../../motion/types";
import { DOMMotionComponents } from "./types.js";
import { CustomMotionComponentConfig} from './motion-proxy.js'
import { MotionProps } from "../../motion/types.js";

@@ -23,3 +23,3 @@ export declare interface IsSVG{

CustomMotionComponentConfig & MotionProps & IsSVG,
{},
ATypedSvelteComponent,
{

@@ -56,2 +56,2 @@ default: {

export declare function createDomMotionComponent<T extends keyof DOMMotionComponents>(key: T): DOMMotionComponents[T];
export declare const M : {[key:string] : Motion}
export declare const M : {[key:string] : Motion}

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