motion-start 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +0 -0
- package/README.md +0 -0
- package/dist/components/AnimatePresence/PresenceChild/PresenceChild.svelte +22 -16
- package/dist/components/AnimatePresence/PresenceChild/PresenceChild.svelte.d.ts +1 -26
- package/dist/components/AnimatePresence/PresenceChild/PresenceChild.svelte.d.ts.map +1 -1
- package/dist/components/AnimatePresence/PresenceChild/types.d.ts +3 -1
- package/dist/components/AnimatePresence/PresenceChild/types.d.ts.map +1 -1
- package/dist/components/AnimateSharedLayout/AnimateSharedLayout.svelte +1 -1
- package/dist/components/AnimateSharedLayout/types.d.ts.map +1 -1
- package/dist/events/UseDomEvent.svelte +23 -9
- package/dist/events/UseDomEvent.svelte.d.ts +4 -26
- package/dist/events/UseDomEvent.svelte.d.ts.map +1 -1
- package/dist/gestures/drag/UseDrag.svelte +8 -14
- package/dist/gestures/drag/UseDrag.svelte.d.ts +6 -30
- package/dist/gestures/drag/UseDrag.svelte.d.ts.map +1 -1
- package/dist/gestures/drag/VisualElementDragControls.d.ts.map +1 -1
- package/dist/gestures/drag/VisualElementDragControls.js +7 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/motion/features/Exit.svelte +10 -9
- package/dist/motion/features/Exit.svelte.d.ts +6 -30
- package/dist/motion/features/Exit.svelte.d.ts.map +1 -1
- package/dist/motion/features/layout/Animate.svelte +26 -22
- package/dist/motion/features/layout/Animate.svelte.d.ts +2 -1
- package/dist/motion/features/layout/Animate.svelte.d.ts.map +1 -1
- package/dist/motion/features/types.d.ts +2 -1
- package/dist/motion/features/types.d.ts.map +1 -1
- package/dist/motion/types.d.ts +1 -1
- package/dist/motion/types.d.ts.map +1 -1
- package/dist/render/dom/M-type.spec-d.js +2 -2
- package/dist/render/dom/Motion-Proxy.svelte +1 -2
- package/dist/render/dom/Motion-Proxy.svelte.d.ts.map +1 -1
- package/dist/render/dom/Motion-type.spec-d.js +2 -2
- package/dist/render/dom/UseRender.svelte +3 -2
- package/dist/render/dom/UseRender.svelte.d.ts.map +1 -1
- package/dist/render/dom/motion-minimal.d.ts +10 -2
- package/dist/render/dom/motion-minimal.d.ts.map +1 -1
- package/dist/render/dom/motion-minimal.js +3 -3
- package/dist/render/dom/motion.d.ts +10 -2
- package/dist/render/dom/motion.d.ts.map +1 -1
- package/dist/render/dom/motion.js +1 -1
- package/dist/render/html/UseHTMLProps.svelte +13 -18
- package/dist/render/html/UseHTMLProps.svelte.d.ts +37 -0
- package/dist/render/html/UseHTMLProps.svelte.d.ts.map +1 -0
- package/dist/render/html/UseInitialMotionValues.svelte +6 -5
- package/dist/render/html/UseInitialMotionValues.svelte.d.ts +6 -34
- package/dist/render/html/UseInitialMotionValues.svelte.d.ts.map +1 -1
- package/dist/render/html/UseStyle.svelte +4 -2
- package/dist/render/html/UseStyle.svelte.d.ts.map +1 -1
- package/dist/render/html/types.d.ts +9 -0
- package/dist/render/html/types.d.ts.map +1 -1
- package/dist/render/html/use-props.d.ts +6 -4
- package/dist/render/html/use-props.d.ts.map +1 -1
- package/dist/render/html/use-props.js +4 -2
- package/dist/render/html/visual-element.d.ts +9 -3
- package/dist/render/html/visual-element.d.ts.map +1 -1
- package/dist/render/svg/UseSVGProps.svelte +13 -9
- package/dist/render/svg/UseSVGProps.svelte.d.ts +5 -37
- package/dist/render/svg/UseSVGProps.svelte.d.ts.map +1 -1
- package/dist/render/utils/lifecycles.d.ts +1 -1
- package/dist/render/utils/lifecycles.d.ts.map +1 -1
- package/dist/render/utils/lifecycles.js +5 -5
- package/dist/render/utils/state.d.ts.map +1 -1
- package/dist/utils/subscription-manager.d.ts +1 -1
- package/dist/utils/subscription-manager.d.ts.map +1 -1
- package/dist/utils/subscription-manager.js +1 -1
- package/dist/value/use-spring.d.ts +2 -2
- package/dist/value/use-spring.d.ts.map +1 -1
- package/dist/value/use-spring.js +7 -12
- package/package.json +91 -94
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<!-- based on framer-motion@4.0.3,
|
|
2
2
|
Copyright (c) 2018 Framer B.V. -->
|
|
3
|
+
<svelte:options runes />
|
|
3
4
|
|
|
4
5
|
<script lang="ts">
|
|
5
6
|
import { copyRawValuesOnly } from "../html/use-props.js";
|
|
6
7
|
import { buildSVGAttrs } from "./utils/build-attrs.js";
|
|
7
8
|
import { createSvgRenderState } from "./utils/create-render-state.js";
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
let { visualState, props, children } = $props();
|
|
11
|
+
|
|
12
|
+
let memo = (variantLabelsAsDependency?: string | boolean | undefined) => {
|
|
11
13
|
const state = createSvgRenderState();
|
|
12
14
|
buildSVGAttrs(
|
|
13
15
|
state,
|
|
@@ -22,13 +24,15 @@ Copyright (c) 2018 Framer B.V. -->
|
|
|
22
24
|
style: { ...state.style },
|
|
23
25
|
};
|
|
24
26
|
};
|
|
25
|
-
|
|
27
|
+
const visualProps = $derived(memo(visualState));
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
$effect(() => {
|
|
30
|
+
if (props.style) {
|
|
31
|
+
const rawStyles = {};
|
|
32
|
+
copyRawValuesOnly(rawStyles, props.style, props);
|
|
33
|
+
visualProps.style = { ...rawStyles, ...visualProps.style };
|
|
34
|
+
}
|
|
35
|
+
});
|
|
32
36
|
</script>
|
|
33
37
|
|
|
34
|
-
|
|
38
|
+
{@render children?.(visualProps)}
|
|
@@ -1,39 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
-
default: any;
|
|
16
|
-
} ? Props extends Record<string, never> ? any : {
|
|
17
|
-
children?: any;
|
|
18
|
-
} : {});
|
|
19
|
-
declare const UseSvgProps: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
-
visualState: any;
|
|
21
|
-
props: any;
|
|
22
|
-
}, {
|
|
23
|
-
default: {
|
|
24
|
-
visualProps: {
|
|
25
|
-
style: {};
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
}>, {
|
|
29
|
-
[evt: string]: CustomEvent<any>;
|
|
30
|
-
}, {
|
|
31
|
-
default: {
|
|
32
|
-
visualProps: {
|
|
33
|
-
style: {};
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
}, {}, string>;
|
|
37
|
-
type UseSvgProps = InstanceType<typeof UseSvgProps>;
|
|
1
|
+
declare const UseSvgProps: import("svelte").Component<{
|
|
2
|
+
visualState: unknown;
|
|
3
|
+
props: unknown;
|
|
4
|
+
children: unknown;
|
|
5
|
+
}, {}, "">;
|
|
38
6
|
export default UseSvgProps;
|
|
39
7
|
//# sourceMappingURL=UseSVGProps.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UseSVGProps.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/lib/motion-start/render/svg/UseSVGProps.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UseSVGProps.svelte.d.ts","sourceRoot":"","sources":["../../../../../src/lib/motion-start/render/svg/UseSVGProps.svelte.ts"],"names":[],"mappings":"AA+CA,QAAA,MAAM,WAAW;iBArC2C,OAAO;WAAS,OAAO;cAAY,OAAO;UAqC/C,CAAC;AACxD,eAAe,WAAW,CAAC"}
|
|
@@ -117,6 +117,6 @@ export interface LifecycleManager {
|
|
|
117
117
|
clearAllListeners: () => void;
|
|
118
118
|
updatePropListeners: (props: MotionProps) => void;
|
|
119
119
|
}
|
|
120
|
-
declare function createLifecycles(
|
|
120
|
+
declare function createLifecycles(): any;
|
|
121
121
|
export { createLifecycles };
|
|
122
122
|
//# sourceMappingURL=lifecycles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycles.d.ts","sourceRoot":"","sources":["../../../../../src/lib/motion-start/render/utils/lifecycles.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAC9F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,MAAM,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,KAAK,IAAI,CAAC;AACvF,MAAM,MAAM,2BAA2B,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;AACtE,MAAM,MAAM,oBAAoB,GAAG,CAClC,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,SAAS,EACrB,MAAM,CAAC,EAAE,2BAA2B,KAChC,IAAI,CAAC;AACV,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;AAC9D,MAAM,MAAM,sBAAsB,GAAG,MAAM,IAAI,CAAC;AAChD,MAAM,MAAM,yBAAyB,GAAG,CAAC,UAAU,EAAE,mBAAmB,KAAK,IAAI,CAAC;AAClF,MAAM,MAAM,+BAA+B,GAAG,MAAM,IAAI,CAAC;AACzD,MAAM,MAAM,qBAAqB,GAAG,MAAM,IAAI,CAAC;AAC/C,MAAM,MAAM,cAAc,GAAG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,EAAE,cAAc,KAAK,MAAM,IAAI,CAAC;IACnD,YAAY,EAAE,cAAc,CAAC;IAC7B,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;IAChD,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,mBAAmB,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CAClD;AAqBD,iBAAS,gBAAgB,QAyBxB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -16,7 +16,7 @@ var names = [
|
|
|
16
16
|
'SetAxisTarget',
|
|
17
17
|
'Unmount',
|
|
18
18
|
];
|
|
19
|
-
function createLifecycles(
|
|
19
|
+
function createLifecycles() {
|
|
20
20
|
var managers = names.map(() => new SubscriptionManager());
|
|
21
21
|
var propSubscriptions = {};
|
|
22
22
|
var lifecycles = {
|
|
@@ -27,16 +27,16 @@ function createLifecycles(...args) {
|
|
|
27
27
|
(_a = propSubscriptions[name]) === null || _a === void 0 ? void 0 : _a.call(propSubscriptions);
|
|
28
28
|
var on = 'on' + name;
|
|
29
29
|
var propListener = props[on];
|
|
30
|
-
if (propListener) {
|
|
30
|
+
if (propListener) {
|
|
31
|
+
// @ts-expect-error
|
|
31
32
|
propSubscriptions[name] = lifecycles[on](propListener);
|
|
32
33
|
}
|
|
33
34
|
}),
|
|
34
35
|
};
|
|
35
36
|
managers.forEach((manager, i) => {
|
|
36
37
|
lifecycles['on' + names[i]] = (handler) => manager.add(handler);
|
|
37
|
-
lifecycles['notify' + names[i]] = () => {
|
|
38
|
-
|
|
39
|
-
return manager.notify.apply(manager, [arg1, arg2, arg3]);
|
|
38
|
+
lifecycles['notify' + names[i]] = (...args) => {
|
|
39
|
+
return manager.notify.apply(manager, args);
|
|
40
40
|
};
|
|
41
41
|
});
|
|
42
42
|
return lifecycles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../src/lib/motion-start/render/utils/state.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC5E;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,WAAW,EAAE,SAAS,CAAC;CAC1B;AACD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACxB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,MAAM,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,eAAe,EAAE,SAAS,CAAC;IAC3B;;;;;;OAMG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,KAAK,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,UAAU,EAAE,QAAQ,CAAC;IACrB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;CAC1B;AASD,QAAA,IAAI,qBAAqB,
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../src/lib/motion-start/render/utils/state.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC5E;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,MAAM,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,WAAW,EAAE,SAAS,CAAC;CAC1B;AACD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACxB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,MAAM,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,eAAe,EAAE,SAAS,CAAC;IAC3B;;;;;;OAMG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,KAAK,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,UAAU,EAAE,QAAQ,CAAC;IACrB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;CAC1B;AASD,QAAA,IAAI,qBAAqB,QAKpB,gBAAoB,CAAC;AAC1B,iBAAS,iBAAiB,IASjB,WAAW,CACnB;AACD,QAAA,IAAI,UAAU,aAAsB,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -6,7 +6,7 @@ type GenericHandler = (...args: any) => void;
|
|
|
6
6
|
declare class SubscriptionManager<Handler extends GenericHandler> {
|
|
7
7
|
private subscriptions;
|
|
8
8
|
add: (handler: Handler) => () => void;
|
|
9
|
-
notify: (a
|
|
9
|
+
notify: (...[a, b, c]: Parameters<Handler>) => void;
|
|
10
10
|
getSize: () => number;
|
|
11
11
|
clear: () => void;
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-manager.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/utils/subscription-manager.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,KAAK,cAAc,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;AAC7C,cAAM,mBAAmB,CAAC,OAAO,SAAS,cAAc;IACvD,OAAO,CAAC,aAAa,CAA+C;IACpE,GAAG,YAAa,OAAO,gBAKrB;IACF,MAAM,
|
|
1
|
+
{"version":3,"file":"subscription-manager.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/utils/subscription-manager.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,KAAK,cAAc,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;AAC7C,cAAM,mBAAmB,CAAC,OAAO,SAAS,cAAc;IACvD,OAAO,CAAC,aAAa,CAA+C;IACpE,GAAG,YAAa,OAAO,gBAKrB;IACF,MAAM,iBAAkB,UAAU,CAAC,OAAO,CAAC,UAkBzC;IACF,OAAO,eAEL;IACF,KAAK,aAEH;CACF;AAQD,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
based on framer-motion@4.1.17,
|
|
3
3
|
Copyright (c) 2018 Framer B.V.
|
|
4
4
|
*/
|
|
5
|
-
import type { SpringOptions } from
|
|
6
|
-
import { MotionValue } from
|
|
5
|
+
import type { SpringOptions } from 'popmotion';
|
|
6
|
+
import type { MotionValue } from '.';
|
|
7
7
|
/**
|
|
8
8
|
* Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.
|
|
9
9
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-spring.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/value/use-spring.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"use-spring.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/value/use-spring.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC;AAerC;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,SAAS,WAAY,WAAW,GAAG,MAAM,WAAU,aAAa;WAMpE,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,KAAK,IAAI;CAgC/C,CAAC"}
|
package/dist/value/use-spring.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { MotionValue } from ".";
|
|
2
1
|
/**
|
|
3
2
|
based on framer-motion@4.1.16,
|
|
4
3
|
Copyright (c) 2018 Framer B.V.
|
|
5
4
|
*/
|
|
6
5
|
import { fixed } from '../utils/fix-process-env';
|
|
7
|
-
import { getContext } from
|
|
8
|
-
import { MotionConfigContext } from
|
|
6
|
+
import { getContext } from 'svelte';
|
|
7
|
+
import { MotionConfigContext } from '../context/MotionConfigContext';
|
|
9
8
|
import { get } from 'svelte/store';
|
|
10
|
-
import { useMotionValue } from
|
|
11
|
-
import { isMotionValue } from
|
|
12
|
-
import { animate } from
|
|
9
|
+
import { useMotionValue } from './use-motion-value';
|
|
10
|
+
import { isMotionValue } from './utils/is-motion-value';
|
|
11
|
+
import { animate } from 'popmotion';
|
|
13
12
|
/**
|
|
14
13
|
* Creates a `MotionValue` that, when `set`, will use a spring animation to animate to its new state.
|
|
15
14
|
*
|
|
@@ -32,8 +31,7 @@ import { animate } from "popmotion";
|
|
|
32
31
|
export const useSpring = (source, config = {}, isCustom = false) => {
|
|
33
32
|
const mcc = getContext(MotionConfigContext) || MotionConfigContext(isCustom);
|
|
34
33
|
let activeSpringAnimation = null;
|
|
35
|
-
|
|
36
|
-
let cleanup;
|
|
34
|
+
const value = useMotionValue(isMotionValue(source) ? source.get() : source);
|
|
37
35
|
const update = (_source, _config) => {
|
|
38
36
|
value.attach((v, set) => {
|
|
39
37
|
const { isStatic } = get(mcc);
|
|
@@ -52,10 +50,7 @@ export const useSpring = (source, config = {}, isCustom = false) => {
|
|
|
52
50
|
});
|
|
53
51
|
return value.get();
|
|
54
52
|
});
|
|
55
|
-
|
|
56
|
-
return isMotionValue(_source) ?
|
|
57
|
-
_source.onChange(v => value.set(parseFloat(v))) :
|
|
58
|
-
undefined;
|
|
53
|
+
return isMotionValue(_source) ? _source.onChange((v) => value.set(Number.parseFloat(v))) : undefined;
|
|
59
54
|
};
|
|
60
55
|
update(source, config);
|
|
61
56
|
value.reset = update;
|
package/package.json
CHANGED
|
@@ -1,95 +1,92 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"ci:publish": "pnpm build && changeset publish"
|
|
94
|
-
}
|
|
95
|
-
}
|
|
2
|
+
"name": "motion-start",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Svelte animation library inspired by the React library framer-motion.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "JonathonRP",
|
|
8
|
+
"url": "https://github.com/JonathonRP"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"ur": "https://github.com/JonathonRP/motion-start.git"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"bin": "./dist/index.js",
|
|
20
|
+
"svelte": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"exports": "./dist/index.js",
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dev": "vite dev",
|
|
25
|
+
"build": "vite build && bun --bun package",
|
|
26
|
+
"package": "svelte-kit sync && svelte-package --input ./src/lib/motion-start && publint --strict",
|
|
27
|
+
"preview": "vite preview",
|
|
28
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
29
|
+
"lint": "biome check",
|
|
30
|
+
"test": "vitest",
|
|
31
|
+
"test:types": "vitest --typecheck.only",
|
|
32
|
+
"test:ui": "vitest --ui",
|
|
33
|
+
"test:types:ui": "vitest --ui",
|
|
34
|
+
"release": "bun --bun run build && bun --bun changeset publish"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"bits-ui": "^0.21.16",
|
|
38
|
+
"class-variance-authority": "^0.7.1",
|
|
39
|
+
"clsx": "^2.1.1",
|
|
40
|
+
"framesync": "^6.1.2",
|
|
41
|
+
"lucide-svelte": "^0.453.0",
|
|
42
|
+
"mode-watcher": "^0.5.0",
|
|
43
|
+
"popmotion": "^11.0.5",
|
|
44
|
+
"style-value-types": "5.1.2",
|
|
45
|
+
"tailwind-merge": "^2.5.5",
|
|
46
|
+
"tailwind-variants": "^0.2.1"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@changesets/cli": "^2.27.10",
|
|
50
|
+
"@biomejs/biome": "^1.9.4",
|
|
51
|
+
"@emotion/is-prop-valid": "^1.3.1",
|
|
52
|
+
"@sveltejs/package": "^2.3.7",
|
|
53
|
+
"@sveltejs/vite-plugin-svelte": "^4.0.2",
|
|
54
|
+
"svelte-check": "^4.1.1",
|
|
55
|
+
"@tsconfig/svelte": "^5.0.4",
|
|
56
|
+
"@types/node": "^20.17.9",
|
|
57
|
+
"@vitest/ui": "latest",
|
|
58
|
+
"csstype": "^3.1.3",
|
|
59
|
+
"publint": "^0.2.12",
|
|
60
|
+
"typescript": "^5.7.2",
|
|
61
|
+
"vite": "5.4.11",
|
|
62
|
+
"vitest": "latest",
|
|
63
|
+
"@sveltejs/adapter-auto": "^3.3.1",
|
|
64
|
+
"@sveltejs/kit": "2.7.1",
|
|
65
|
+
"@tailwindcss/typography": "^0.5.15",
|
|
66
|
+
"@tailwindcss/vite": "^4.0.0-alpha.28",
|
|
67
|
+
"tailwindcss": "^4.0.0-alpha.28"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"svelte": "^5.5.3"
|
|
71
|
+
},
|
|
72
|
+
"engines": {
|
|
73
|
+
"bun": ">=1.0.0",
|
|
74
|
+
"node": ">=20"
|
|
75
|
+
},
|
|
76
|
+
"sideEffects": false,
|
|
77
|
+
"keywords": [
|
|
78
|
+
"svelte animation",
|
|
79
|
+
"svelte",
|
|
80
|
+
"animation",
|
|
81
|
+
"gestures",
|
|
82
|
+
"drag",
|
|
83
|
+
"spring",
|
|
84
|
+
"popmotion",
|
|
85
|
+
"framer-motion"
|
|
86
|
+
],
|
|
87
|
+
"trustedDependencies": [
|
|
88
|
+
"@biomejs/biome",
|
|
89
|
+
"@sveltejs/kit",
|
|
90
|
+
"esbuild"
|
|
91
|
+
]
|
|
92
|
+
}
|