motion-start 0.1.19 → 0.1.21
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/dist/animation/utils/is-animatable.d.ts +5 -0
- package/dist/animation/utils/is-animatable.d.ts.map +1 -1
- package/dist/animation/utils/is-animatable.js +1 -1
- package/dist/components/AnimatePresence/AnimatePresence.svelte +221 -188
- package/dist/components/AnimatePresence/AnimatePresence.svelte.d.ts.map +1 -1
- package/dist/components/AnimatePresence/PresenceChild/PresenceChild.svelte +77 -63
- package/dist/components/AnimatePresence/PresenceChild/PresenceChild.svelte.d.ts.map +1 -1
- package/dist/components/AnimatePresence/PresenceChild/types.d.ts +1 -0
- package/dist/components/AnimatePresence/PresenceChild/types.d.ts.map +1 -1
- package/dist/components/AnimatePresence/use-presence.d.ts.map +1 -1
- package/dist/components/AnimatePresence/use-presence.js +15 -12
- package/dist/components/AnimateSharedLayout/utils/crossfader.d.ts +5 -0
- package/dist/components/AnimateSharedLayout/utils/crossfader.d.ts.map +1 -1
- package/dist/components/AnimateSharedLayout/utils/crossfader.js +1 -1
- package/dist/context/LayoutEpochContext.d.ts +9 -0
- package/dist/context/LayoutEpochContext.d.ts.map +1 -0
- package/dist/context/LayoutEpochContext.js +13 -0
- package/dist/context/PresenceContext.d.ts +1 -0
- package/dist/context/PresenceContext.d.ts.map +1 -1
- package/dist/motion/features/Exit.svelte +6 -10
- package/dist/motion/features/Exit.svelte.d.ts +19 -5
- package/dist/motion/features/Exit.svelte.d.ts.map +1 -1
- package/dist/motion/features/layout/Animate.svelte +2 -0
- package/dist/motion/features/layout/Animate.svelte.d.ts.map +1 -1
- package/dist/motion/features/layout/Measure.svelte +144 -100
- package/dist/motion/features/layout/Measure.svelte.d.ts.map +1 -1
- package/dist/motion/features/layout/MeasureContextProvider.svelte +14 -1
- package/dist/motion/features/layout/MeasureContextProvider.svelte.d.ts.map +1 -1
- package/dist/motion/features/layout/utils.d.ts +5 -0
- package/dist/motion/features/layout/utils.d.ts.map +1 -1
- package/dist/motion/features/layout/utils.js +1 -1
- package/dist/motion/utils/UseVisualElement.svelte +10 -6
- package/dist/motion/utils/UseVisualElement.svelte.d.ts.map +1 -1
- package/dist/render/dom/projection/default-scale-correctors.d.ts +5 -0
- package/dist/render/dom/projection/default-scale-correctors.d.ts.map +1 -1
- package/dist/render/dom/projection/default-scale-correctors.js +1 -1
- package/dist/render/dom/utils/unit-conversion.d.ts +5 -0
- package/dist/render/dom/utils/unit-conversion.d.ts.map +1 -1
- package/dist/render/dom/utils/unit-conversion.js +1 -1
- package/dist/render/dom/value-types/animatable-none.d.ts +5 -0
- package/dist/render/dom/value-types/animatable-none.d.ts.map +1 -1
- package/dist/render/dom/value-types/animatable-none.js +1 -1
- package/dist/render/dom/value-types/defaults.d.ts +5 -0
- package/dist/render/dom/value-types/defaults.d.ts.map +1 -1
- package/dist/render/dom/value-types/defaults.js +1 -1
- package/dist/render/dom/value-types/dimensions.d.ts +5 -0
- package/dist/render/dom/value-types/dimensions.d.ts.map +1 -1
- package/dist/render/dom/value-types/dimensions.js +1 -1
- package/dist/render/dom/value-types/find.d.ts +5 -0
- package/dist/render/dom/value-types/find.d.ts.map +1 -1
- package/dist/render/dom/value-types/find.js +1 -1
- package/dist/render/dom/value-types/number.d.ts +5 -0
- package/dist/render/dom/value-types/number.d.ts.map +1 -1
- package/dist/render/dom/value-types/number.js +1 -1
- package/dist/render/dom/value-types/type-int.d.ts +5 -0
- package/dist/render/dom/value-types/type-int.d.ts.map +1 -1
- package/dist/render/dom/value-types/type-int.js +1 -1
- package/dist/render/svg/utils/path.d.ts +5 -0
- package/dist/render/svg/utils/path.d.ts.map +1 -1
- package/dist/render/svg/utils/path.js +1 -1
- package/dist/render/svg/utils/transform-origin.d.ts +5 -0
- package/dist/render/svg/utils/transform-origin.d.ts.map +1 -1
- package/dist/render/svg/utils/transform-origin.js +1 -1
- package/dist/utils/geometry/delta-apply.d.ts +5 -0
- package/dist/utils/geometry/delta-apply.d.ts.map +1 -1
- package/dist/utils/geometry/delta-apply.js +1 -1
- package/dist/utils/geometry/delta-calc.d.ts +5 -0
- package/dist/utils/geometry/delta-calc.d.ts.map +1 -1
- package/dist/utils/geometry/delta-calc.js +1 -1
- package/dist/utils/transform.d.ts +5 -0
- package/dist/utils/transform.d.ts.map +1 -1
- package/dist/utils/transform.js +1 -1
- package/dist/value/index.d.ts +5 -0
- package/dist/value/index.d.ts.map +1 -1
- package/dist/value/index.js +1 -1
- package/dist/value/scroll/use-element-scroll.d.ts +1 -1
- package/dist/value/scroll/use-element-scroll.d.ts.map +1 -1
- package/dist/value/scroll/use-element-scroll.js +2 -2
- package/dist/value/scroll/use-viewport-scroll.d.ts +1 -1
- package/dist/value/scroll/use-viewport-scroll.d.ts.map +1 -1
- package/dist/value/scroll/use-viewport-scroll.js +2 -2
- package/dist/value/use-combine-values.d.ts +1 -1
- package/dist/value/use-combine-values.d.ts.map +1 -1
- package/dist/value/use-combine-values.js +1 -1
- package/dist/value/use-motion-template.d.ts +1 -1
- package/dist/value/use-motion-template.d.ts.map +1 -1
- package/dist/value/use-motion-template.js +2 -2
- package/dist/value/use-spring.d.ts +6 -1
- package/dist/value/use-spring.d.ts.map +1 -1
- package/dist/value/use-spring.js +4 -4
- package/dist/value/use-transform.d.ts +2 -2
- package/dist/value/use-transform.d.ts.map +1 -1
- package/dist/value/use-transform.js +2 -2
- package/dist/value/utils/is-motion-value.d.ts +1 -1
- package/dist/value/utils/is-motion-value.d.ts.map +1 -1
- package/dist/value/utils/resolve-motion-value.d.ts +2 -2
- package/dist/value/utils/resolve-motion-value.d.ts.map +1 -1
- package/dist/value/utils/resolve-motion-value.js +0 -5
- package/package.json +6 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { derived, get, readable } from 'svelte/store';
|
|
2
2
|
import { PresenceContext } from '../../context/PresenceContext.js';
|
|
3
|
-
import { getContext,
|
|
3
|
+
import { getContext, onDestroy } from "svelte";
|
|
4
4
|
let counter = 0;
|
|
5
5
|
const incrementId = () => counter++;
|
|
6
6
|
export function isPresent(context) {
|
|
@@ -54,16 +54,19 @@ export const useIsPresent = (isCustom = false) => {
|
|
|
54
54
|
*/
|
|
55
55
|
export const usePresence = (isCustom = false) => {
|
|
56
56
|
const context = getContext(PresenceContext) || PresenceContext(isCustom);
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
if (get(context) === null) {
|
|
57
|
+
const contextValue = get(context);
|
|
58
|
+
// PresenceChild sets context synchronously before children initialize,
|
|
59
|
+
// so get() always returns the real value here — no subscription needed.
|
|
60
|
+
if (contextValue === null)
|
|
64
61
|
return readable([true, null]);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
const id = incrementId();
|
|
63
|
+
const unregister = contextValue.register(id);
|
|
64
|
+
onDestroy(unregister);
|
|
65
|
+
return derived(context, $v => {
|
|
66
|
+
if ($v === null)
|
|
67
|
+
return [true, null];
|
|
68
|
+
return (!$v.isPresent && $v.onExitComplete) ?
|
|
69
|
+
[false, () => $v.onExitComplete?.(id)] :
|
|
70
|
+
[true];
|
|
71
|
+
});
|
|
69
72
|
};
|
|
@@ -22,6 +22,11 @@ export interface CrossfadeAnimationOptions {
|
|
|
22
22
|
crossfadeOpacity?: boolean;
|
|
23
23
|
preserveFollowOpacity?: boolean;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
based on framer-motion@4.0.3,
|
|
27
|
+
Copyright (c) 2018 Framer B.V.
|
|
28
|
+
*/
|
|
29
|
+
import '../../../utils/fix-process-env.js';
|
|
25
30
|
declare function createCrossfader(): Crossfader;
|
|
26
31
|
export { createCrossfader };
|
|
27
32
|
//# sourceMappingURL=crossfader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crossfader.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/components/AnimateSharedLayout/utils/crossfader.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAUX,UAAU,EAEV,MAAM,gBAAgB,CAAC;AACxB,MAAM,WAAW,UAAU;IAC1B,QAAQ,IAAI,OAAO,CAAC;IACpB,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,CAAC;IACtE,MAAM,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,gBAAgB,CAAC;IAClD,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,gBAAgB,CAAC;IACpD,UAAU,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACrD,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;IACb,eAAe,IAAI,cAAc,CAAC;CAClC;AACD,MAAM,WAAW,yBAAyB;IACzC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qBAAqB,CAAC,EAAE,OAAO,CAAC;CAChC;
|
|
1
|
+
{"version":3,"file":"crossfader.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/components/AnimateSharedLayout/utils/crossfader.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAUX,UAAU,EAEV,MAAM,gBAAgB,CAAC;AACxB,MAAM,WAAW,UAAU;IAC1B,QAAQ,IAAI,OAAO,CAAC;IACpB,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,cAAc,GAAG,SAAS,CAAC;IACtE,MAAM,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,gBAAgB,CAAC;IAClD,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,gBAAgB,CAAC;IACpD,UAAU,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACrD,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;IACb,eAAe,IAAI,cAAc,CAAC;CAClC;AACD,MAAM,WAAW,yBAAyB;IACzC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,qBAAqB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;EAGE;AACF,OAAO,mCAAmC,CAAC;AAQ3C,iBAAS,gBAAgB,IAAI,UAAU,CAuKtC;AAkED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
based on framer-motion@4.0.3,
|
|
3
3
|
Copyright (c) 2018 Framer B.V.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import '../../../utils/fix-process-env.js';
|
|
6
6
|
import sync, { getFrameData } from 'framesync';
|
|
7
7
|
import { mix, progress, linear, mixColor, circOut } from 'popmotion';
|
|
8
8
|
import { animate } from '../../../animation/animate.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type LayoutEpoch = {
|
|
2
|
+
n: number;
|
|
3
|
+
snapshot: boolean;
|
|
4
|
+
};
|
|
5
|
+
/** Used as the setContext / getContext key. */
|
|
6
|
+
export declare const LayoutEpochContext: unique symbol;
|
|
7
|
+
/** Factory — call once per AnimatePresence instance and set in context. */
|
|
8
|
+
export declare const createLayoutEpoch: () => import("svelte/store").Writable<LayoutEpoch>;
|
|
9
|
+
//# sourceMappingURL=LayoutEpochContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayoutEpochContext.d.ts","sourceRoot":"","sources":["../../src/lib/motion-start/context/LayoutEpochContext.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,WAAW,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3D,+CAA+C;AAC/C,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAE/D,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,oDAAyD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Epoch store that AnimatePresence increments whenever its rendered children
|
|
3
|
+
* change. Measure.svelte subscribes synchronously to snapshot positions and
|
|
4
|
+
* MeasureContextProvider reads it reactively to trigger afterU → flush.
|
|
5
|
+
*
|
|
6
|
+
* `snapshot: true` — take a FLIP snapshot AND flush (presenceAffectsLayout=true)
|
|
7
|
+
* `snapshot: false` — flush only for exiting elements, no sibling snapshot
|
|
8
|
+
*/
|
|
9
|
+
import { writable } from 'svelte/store';
|
|
10
|
+
/** Used as the setContext / getContext key. */
|
|
11
|
+
export const LayoutEpochContext = Symbol('LayoutEpochContext');
|
|
12
|
+
/** Factory — call once per AnimatePresence instance and set in context. */
|
|
13
|
+
export const createLayoutEpoch = () => writable({ n: 0, snapshot: false });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresenceContext.d.ts","sourceRoot":"","sources":["../../src/lib/motion-start/context/PresenceContext.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,IAAI,CAAC;IACrC,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,KAAK,GAAG,aAAa,CAAC;IAChC,MAAM,CAAC,EAAE,GAAG,CAAC;CAChB;AAMD;;GAEG;AAEH,eAAO,MAAM,eAAe,GAAI,IAAI,GAAG,KAAG,QAAQ,CAAC,oBAAoB,GAAG,IAAI,CAAmD,CAAC"}
|
|
1
|
+
{"version":3,"file":"PresenceContext.d.ts","sourceRoot":"","sources":["../../src/lib/motion-start/context/PresenceContext.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,IAAI,CAAC;IACrC,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,KAAK,GAAG,aAAa,CAAC;IAChC,MAAM,CAAC,EAAE,GAAG,CAAC;CAChB;AAMD;;GAEG;AAEH,eAAO,MAAM,eAAe,GAAI,IAAI,GAAG,KAAG,QAAQ,CAAC,oBAAoB,GAAG,IAAI,CAAmD,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<!-- based on framer-motion@4.0.3,
|
|
2
2
|
Copyright (c) 2018 Framer B.V. -->
|
|
3
|
-
<svelte:options runes />
|
|
4
3
|
|
|
5
4
|
<script lang="ts">
|
|
6
5
|
import { getContext } from "svelte";
|
|
@@ -17,14 +16,13 @@ Copyright (c) 2018 Framer B.V. -->
|
|
|
17
16
|
import { AnimationType } from "../../render/utils/types.js";
|
|
18
17
|
import type { Writable } from "svelte/store";
|
|
19
18
|
|
|
20
|
-
let
|
|
21
|
-
|
|
19
|
+
export let props: any, visualElement: any, isCustom: boolean;
|
|
20
|
+
$: custom = props?.custom;
|
|
22
21
|
|
|
23
|
-
const presenceContext =
|
|
22
|
+
const presenceContext =
|
|
24
23
|
getContext<Writable<PresenceContextProps>>(PresenceContext) ||
|
|
25
|
-
|
|
26
|
-
);
|
|
27
|
-
const presence = $derived(usePresence(isCustom));
|
|
24
|
+
PresenceContext(isCustom);
|
|
25
|
+
const presence = usePresence(isCustom);
|
|
28
26
|
|
|
29
27
|
const _effect = (pres: AlwaysPresent | Present | NotPresent) => {
|
|
30
28
|
const [isPresent, onExitComplete] = pres;
|
|
@@ -37,7 +35,5 @@ Copyright (c) 2018 Framer B.V. -->
|
|
|
37
35
|
|
|
38
36
|
!isPresent && animation?.then(onExitComplete);
|
|
39
37
|
};
|
|
40
|
-
|
|
38
|
+
$: _effect($presence);
|
|
41
39
|
</script>
|
|
42
|
-
|
|
43
|
-
{@render children?.()}
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const Exit: $$__sveltets_2_IsomorphicComponent<{
|
|
2
15
|
props: any;
|
|
3
16
|
visualElement: any;
|
|
4
|
-
isCustom:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
17
|
+
isCustom: boolean;
|
|
18
|
+
}, {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
}, {}, {}, string>;
|
|
21
|
+
type Exit = InstanceType<typeof Exit>;
|
|
8
22
|
export default Exit;
|
|
9
23
|
//# sourceMappingURL=Exit.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Exit.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/motion-start/motion/features/Exit.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Exit.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/motion-start/motion/features/Exit.svelte.ts"],"names":[],"mappings":"AAkDA,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,IAAI;WAVoF,GAAG;mBAAiB,GAAG;cAAY,OAAO;;;kBAU/C,CAAC;AACxE,KAAK,IAAI,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC;AACxC,eAAe,IAAI,CAAC"}
|
|
@@ -306,7 +306,9 @@ Copyright (c) 2018 Framer B.V. -->
|
|
|
306
306
|
|
|
307
307
|
addScaleCorrection(defaultScaleCorrectors);
|
|
308
308
|
|
|
309
|
+
// The returned function runs when the component is unmounted
|
|
309
310
|
return () => {
|
|
311
|
+
// this should be onmount cleanup function that gets run sync on component unmount
|
|
310
312
|
unsubLayoutReady();
|
|
311
313
|
eachAxis((axis) => stopAxisAnimation[axis]?.());
|
|
312
314
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Animate.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/motion/features/layout/Animate.svelte.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Animate.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/motion/features/layout/Animate.svelte.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AA0S9D,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,OAAO;mBAVmG,aAAa;;;;;kBAUjC,CAAC;AAC3E,KAAK,OAAO,GAAG,YAAY,CAAC,OAAO,OAAO,CAAC,CAAC;AAC9C,eAAe,OAAO,CAAC"}
|
|
@@ -1,100 +1,144 @@
|
|
|
1
|
-
<!-- based on framer-motion@4.1.16,
|
|
2
|
-
Copyright (c) 2018 Framer B.V. -->
|
|
3
|
-
|
|
4
|
-
<script lang="ts">
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
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
|
-
if (
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
1
|
+
<!-- based on framer-motion@4.1.16,
|
|
2
|
+
Copyright (c) 2018 Framer B.V. -->
|
|
3
|
+
|
|
4
|
+
<script lang="ts">
|
|
5
|
+
import {
|
|
6
|
+
afterUpdate,
|
|
7
|
+
beforeUpdate,
|
|
8
|
+
getContext,
|
|
9
|
+
onDestroy,
|
|
10
|
+
onMount,
|
|
11
|
+
} from "svelte";
|
|
12
|
+
import { get, type Writable } from "svelte/store";
|
|
13
|
+
import {
|
|
14
|
+
ScaleCorrectionContext,
|
|
15
|
+
ScaleCorrectionParentContext,
|
|
16
|
+
} from "../../../context/ScaleCorrectionProvider.svelte";
|
|
17
|
+
import { isSharedLayout } from "../../../context/SharedLayoutContext.js";
|
|
18
|
+
import { snapshotViewportBox } from "../../../render/dom/projection/utils.js";
|
|
19
|
+
import {
|
|
20
|
+
LayoutEpochContext,
|
|
21
|
+
type LayoutEpoch,
|
|
22
|
+
} from "../../../context/LayoutEpochContext.js";
|
|
23
|
+
|
|
24
|
+
export let visualElement, syncLayout, framerSyncLayout, update;
|
|
25
|
+
|
|
26
|
+
const scaleCorrectionContext = getContext<Writable<any[]>>(
|
|
27
|
+
ScaleCorrectionContext,
|
|
28
|
+
);
|
|
29
|
+
const scaleCorrectionParentContext = getContext<Writable<any[]>>(
|
|
30
|
+
ScaleCorrectionParentContext,
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
onMount(() => {
|
|
34
|
+
isSharedLayout(syncLayout) && syncLayout.register(visualElement);
|
|
35
|
+
isSharedLayout(framerSyncLayout) &&
|
|
36
|
+
framerSyncLayout.register(visualElement);
|
|
37
|
+
|
|
38
|
+
visualElement.onUnmount(() => {
|
|
39
|
+
if (isSharedLayout(syncLayout)) {
|
|
40
|
+
syncLayout.remove(visualElement);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (isSharedLayout(framerSyncLayout)) {
|
|
44
|
+
framerSyncLayout.remove(visualElement);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* If this is a child of a SyncContext, notify it that it needs to re-render. It will then
|
|
50
|
+
* handle the snapshotting.
|
|
51
|
+
*
|
|
52
|
+
* If it is stand-alone component, add it to the batcher.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
let updated = false;
|
|
56
|
+
const updater = (nc = false) => {
|
|
57
|
+
if (updated) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
updated = true;
|
|
61
|
+
|
|
62
|
+
// in React the updater function is called on children first, in Svelte the child does not call it.
|
|
63
|
+
get(scaleCorrectionContext).forEach((v) => {
|
|
64
|
+
v.updater?.(true);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
if (isSharedLayout(syncLayout)) {
|
|
68
|
+
syncLayout.syncUpdate();
|
|
69
|
+
} else {
|
|
70
|
+
snapshotViewportBox(visualElement, nc);
|
|
71
|
+
syncLayout.add(visualElement);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return null;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
$: update !== undefined && updater(update);
|
|
78
|
+
|
|
79
|
+
if (update === undefined) {
|
|
80
|
+
beforeUpdate(updater);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const afterU = (nc = false) => {
|
|
84
|
+
updated = false;
|
|
85
|
+
/* Second part of the updater calling in child layouts first.*/
|
|
86
|
+
const scc = get(scaleCorrectionContext);
|
|
87
|
+
|
|
88
|
+
scc.forEach((v: any, i) => {
|
|
89
|
+
v.afterU?.(true);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
if (!isSharedLayout(syncLayout)) {
|
|
93
|
+
syncLayout.flush();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* If this axis isn't animating as a result of this render we want to reset the targetBox
|
|
98
|
+
* to the measured box
|
|
99
|
+
*/
|
|
100
|
+
//setCurrentViewportBox(visualElement);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// Subscribe to LayoutEpochContext synchronously (store.update fires subscribers
|
|
104
|
+
// before DOM changes — required for FLIP "before" snapshot timing).
|
|
105
|
+
//
|
|
106
|
+
// snapshot=true (presenceAffectsLayout=true): full updater() — snapshot + add
|
|
107
|
+
// to syncLayout for all elements. MeasureContextProvider's $: epochUpdate
|
|
108
|
+
// triggers a Measure re-render → $: updater(update) guard + afterUpdate(afterU)
|
|
109
|
+
// → syncLayout.flush() after DOM settles.
|
|
110
|
+
//
|
|
111
|
+
// snapshot=false (presenceAffectsLayout=false): for the exiting element only
|
|
112
|
+
// (isPresent=false) add to syncLayout and flush immediately so animateF →
|
|
113
|
+
// safeToRemove fires. Siblings are skipped — they snap to new positions.
|
|
114
|
+
const layoutEpoch = getContext<Writable<LayoutEpoch>>(LayoutEpochContext);
|
|
115
|
+
if (layoutEpoch) {
|
|
116
|
+
let ready = false;
|
|
117
|
+
const unsub = layoutEpoch.subscribe((e) => {
|
|
118
|
+
if (!ready) {
|
|
119
|
+
ready = true;
|
|
120
|
+
return;
|
|
121
|
+
} // skip initial call at subscribe time
|
|
122
|
+
if (e.snapshot) {
|
|
123
|
+
updater();
|
|
124
|
+
} else if (!visualElement.isPresent) {
|
|
125
|
+
if (!isSharedLayout(syncLayout)) {
|
|
126
|
+
snapshotViewportBox(visualElement);
|
|
127
|
+
syncLayout.add(visualElement);
|
|
128
|
+
}
|
|
129
|
+
afterU();
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
onDestroy(unsub);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
scaleCorrectionParentContext.update((v) =>
|
|
136
|
+
v.concat([
|
|
137
|
+
{
|
|
138
|
+
updater,
|
|
139
|
+
afterU,
|
|
140
|
+
},
|
|
141
|
+
]),
|
|
142
|
+
);
|
|
143
|
+
afterUpdate(afterU);
|
|
144
|
+
</script>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Measure.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/motion/features/layout/Measure.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Measure.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/motion/features/layout/Measure.svelte.ts"],"names":[],"mappings":"AA4JA,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,OAAO;;;;;;;kBAA+E,CAAC;AAC3E,KAAK,OAAO,GAAG,YAAY,CAAC,OAAO,OAAO,CAAC,CAAC;AAC9C,eAAe,OAAO,CAAC"}
|
|
@@ -12,11 +12,24 @@ Copyright (c) 2018 Framer B.V. -->
|
|
|
12
12
|
FramerTreeLayoutContext,
|
|
13
13
|
SharedLayoutContext,
|
|
14
14
|
} from "../../../context/SharedLayoutContext.js";
|
|
15
|
+
import {
|
|
16
|
+
LayoutEpochContext,
|
|
17
|
+
type LayoutEpoch,
|
|
18
|
+
} from "../../../context/LayoutEpochContext.js";
|
|
15
19
|
import Measure from "./Measure.svelte";
|
|
16
20
|
|
|
17
21
|
export let visualElement, props, isCustom;
|
|
18
22
|
|
|
19
23
|
$: ({ update } = props);
|
|
24
|
+
|
|
25
|
+
// When snapshot=true AnimatePresence wants a full FLIP snapshot+flush cycle.
|
|
26
|
+
// Pass epochUpdate only then so Measure re-renders → $: updater(update) →
|
|
27
|
+
// afterUpdate(afterU) → syncLayout.flush(). The flush-only (snapshot=false)
|
|
28
|
+
// path is handled directly inside Measure's layoutEpoch subscribe callback.
|
|
29
|
+
const layoutEpoch = getContext<Writable<LayoutEpoch>>(LayoutEpochContext);
|
|
30
|
+
$: epochUpdate =
|
|
31
|
+
layoutEpoch && $layoutEpoch.snapshot ? $layoutEpoch.n : undefined;
|
|
32
|
+
|
|
20
33
|
const syncLayout =
|
|
21
34
|
getContext<Writable<SyncLayoutBatcher | SharedLayoutSyncMethods>>(
|
|
22
35
|
SharedLayoutContext,
|
|
@@ -31,5 +44,5 @@ Copyright (c) 2018 Framer B.V. -->
|
|
|
31
44
|
syncLayout={$syncLayout}
|
|
32
45
|
framerSyncLayout={$framerSyncLayout}
|
|
33
46
|
{visualElement}
|
|
34
|
-
{update}
|
|
47
|
+
update={update ?? epochUpdate}
|
|
35
48
|
/>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MeasureContextProvider.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/motion/features/layout/MeasureContextProvider.svelte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MeasureContextProvider.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/motion/features/layout/MeasureContextProvider.svelte.ts"],"names":[],"mappings":"AAuDA,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,sBAAsB;;;;;;kBAA+E,CAAC;AAC1F,KAAK,sBAAsB,GAAG,YAAY,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC5E,eAAe,sBAAsB,CAAC"}
|
|
@@ -6,6 +6,11 @@ import type { Axis, AxisBox2D } from "../../../types/geometry";
|
|
|
6
6
|
interface WithLayoutId {
|
|
7
7
|
getLayoutId: () => undefined | string;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
based on framer-motion@4.1.11,
|
|
11
|
+
Copyright (c) 2018 Framer B.V.
|
|
12
|
+
*/
|
|
13
|
+
import "../../../utils/fix-process-env";
|
|
9
14
|
declare function tweenAxis(target: Axis, prev: Axis, next: Axis, p: number): void;
|
|
10
15
|
declare function calcRelativeOffsetAxis(parent: Axis, child: Axis): {
|
|
11
16
|
min: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/motion/features/layout/utils.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC/D,UAAU,YAAY;IACpB,WAAW,EAAE,MAAM,SAAS,GAAG,MAAM,CAAC;CACvC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/motion/features/layout/utils.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC/D,UAAU,YAAY;IACpB,WAAW,EAAE,MAAM,SAAS,GAAG,MAAM,CAAC;CACvC;AAED;;;EAGE;AACF,OAAO,gCAAgC,CAAC;AAGxC,iBAAS,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,QAGjE;AACD,iBAAS,sBAAsB,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI;;;EAKxD;AACD,iBAAS,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS;;;;;;;;;EAK9D;AACD,iBAAS,uBAAuB,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,WAItE;AAED,QAAA,MAAM,aAAa;YACT,CAAC,SAAS,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,eAAP,CAAC,KAAK,CAAC;CAGtD,CAAC;AAEF,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,SAAS,EACT,aAAa,GACd,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
based on framer-motion@4.1.11,
|
|
3
3
|
Copyright (c) 2018 Framer B.V.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import "../../../utils/fix-process-env";
|
|
6
6
|
import { mix } from "popmotion";
|
|
7
7
|
function tweenAxis(target, prev, next, p) {
|
|
8
8
|
target.min = mix(prev.min, next.min, p);
|
|
@@ -26,7 +26,7 @@ Copyright (c) 2018 Framer B.V. -->
|
|
|
26
26
|
PresenceContext,
|
|
27
27
|
type PresenceContextProps,
|
|
28
28
|
} from "../../context/PresenceContext.js";
|
|
29
|
-
|
|
29
|
+
import type { VisualElement } from "../../render/types.js";
|
|
30
30
|
|
|
31
31
|
export let createVisualElement = undefined,
|
|
32
32
|
props,
|
|
@@ -35,16 +35,20 @@ Copyright (c) 2018 Framer B.V. -->
|
|
|
35
35
|
isCustom;
|
|
36
36
|
|
|
37
37
|
const config =
|
|
38
|
-
getContext<Writable<MotionConfigContextObject>>(MotionConfigContext) ||
|
|
38
|
+
getContext<Writable<MotionConfigContextObject>>(MotionConfigContext) ||
|
|
39
|
+
MotionConfigContext(isCustom);
|
|
39
40
|
|
|
40
41
|
const presenceContext =
|
|
41
|
-
getContext<Writable<PresenceContextProps>>(PresenceContext) ||
|
|
42
|
+
getContext<Writable<PresenceContextProps>>(PresenceContext) ||
|
|
43
|
+
PresenceContext(isCustom);
|
|
42
44
|
|
|
43
45
|
const lazyContext =
|
|
44
|
-
getContext<Writable<LazyContextProps>>(LazyContext) ||
|
|
46
|
+
getContext<Writable<LazyContextProps>>(LazyContext) ||
|
|
47
|
+
LazyContext(isCustom);
|
|
45
48
|
|
|
46
49
|
const mc =
|
|
47
|
-
getContext<Writable<MotionContextProps>>(MotionContext) ||
|
|
50
|
+
getContext<Writable<MotionContextProps>>(MotionContext) ||
|
|
51
|
+
MotionContext(isCustom);
|
|
48
52
|
|
|
49
53
|
let parent = get(mc).visualElement;
|
|
50
54
|
$: parent = $mc.visualElement;
|
|
@@ -81,7 +85,7 @@ Copyright (c) 2018 Framer B.V. -->
|
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
let visualElement: VisualElement | undefined = visualElementRef;
|
|
84
|
-
$:
|
|
88
|
+
$: visualElement = visualElementRef;
|
|
85
89
|
|
|
86
90
|
$: if (visualElement) {
|
|
87
91
|
visualElement.setProps({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UseVisualElement.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/motion-start/motion/utils/UseVisualElement.svelte.ts"],"names":[],"mappings":"AAGE,eAAO,MAAM,GAAG,QAAQ,CAAC;AAuB3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"UseVisualElement.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/motion-start/motion/utils/UseVisualElement.svelte.ts"],"names":[],"mappings":"AAGE,eAAO,MAAM,GAAG,QAAQ,CAAC;AAuB3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AA2G3D,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AACD,KAAK,gCAAgC,CAAC,KAAK,EAAE,KAAK,IAAI,KAAK,GACvD,CAAC,KAAK,SAAS;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,GACzB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GACnC,GAAG,GACH;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,GAClB,EAAE,CAAC,CAAC;AAId,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;cAAqF,CAAC;AAC1F,KAAK,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAChE,eAAe,gBAAgB,CAAC"}
|
|
@@ -4,6 +4,11 @@ Copyright (c) 2018 Framer B.V.
|
|
|
4
4
|
*/
|
|
5
5
|
import type { Axis } from '../../../types/geometry';
|
|
6
6
|
import type { LayoutState, TargetProjection } from '../../utils/state';
|
|
7
|
+
/**
|
|
8
|
+
based on framer-motion@4.0.3,
|
|
9
|
+
Copyright (c) 2018 Framer B.V.
|
|
10
|
+
*/
|
|
11
|
+
import '../../../utils/fix-process-env.js';
|
|
7
12
|
declare function pixelsToPercent(pixels: number, axis: Axis): number;
|
|
8
13
|
/**
|
|
9
14
|
* We always correct borderRadius as a percentage rather than pixels to reduce paints.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-scale-correctors.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/render/dom/projection/default-scale-correctors.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"default-scale-correctors.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/render/dom/projection/default-scale-correctors.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEvE;;;EAGE;AACF,OAAO,mCAAmC,CAAC;AAK3C,iBAAS,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,UAElD;AACD;;;;;;GAMG;AACH,iBAAS,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,EAAE,gBAAgB,UAmB5G;AAED,iBAAS,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,WAAW,mBAkDnF;AAID,QAAA,IAAI,sBAAsB;;;;;;;;;;;;;;;;;;;;;CA+BzB,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
based on framer-motion@4.0.3,
|
|
3
3
|
Copyright (c) 2018 Framer B.V.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import '../../../utils/fix-process-env.js';
|
|
6
6
|
import { complex, px } from 'style-value-types';
|
|
7
7
|
import { mix } from 'popmotion';
|
|
8
8
|
import { cssVariableRegex } from '../utils/css-variables-conversion.js';
|
|
@@ -12,6 +12,11 @@ declare enum BoundingBoxDimension {
|
|
|
12
12
|
top = "top",
|
|
13
13
|
bottom = "bottom"
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
based on framer-motion@4.0.3,
|
|
17
|
+
Copyright (c) 2018 Framer B.V.
|
|
18
|
+
*/
|
|
19
|
+
import '../../../utils/fix-process-env.js';
|
|
15
20
|
/**
|
|
16
21
|
* Convert value types for x/y/width/height/top/left/bottom/right
|
|
17
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-conversion.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/render/dom/utils/unit-conversion.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAc,MAAM,gBAAgB,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,aAAK,oBAAoB;IACxB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,MAAM,WAAW;CACjB;
|
|
1
|
+
{"version":3,"file":"unit-conversion.d.ts","sourceRoot":"","sources":["../../../../src/lib/motion-start/render/dom/utils/unit-conversion.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAc,MAAM,gBAAgB,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,aAAK,oBAAoB;IACxB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,MAAM,WAAW;CACjB;AAED;;;EAGE;AACF,OAAO,mCAAmC,CAAC;AAwN3C;;;;;;GAMG;AACH,iBAAS,cAAc,CACtB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,mBAAmB,EAC3B,MAAM,CAAC,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,MAAM,GACpB;IACF,MAAM,EAAE,mBAAmB,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB,CAIA;AAED,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,CAAC"}
|