@flemo/core 2.4.0 → 2.5.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/dist/dom/attributes.d.ts +1 -7
- package/dist/index.d.ts +1 -2
- package/dist/index.mjs +1547 -1375
- package/dist/morph/morphSheet.d.ts +9 -0
- package/dist/morph/morphSwipe.d.ts +3 -3
- package/dist/transition/gestureScrub.d.ts +83 -0
- package/dist/transition/partTransition/createPartTransition.d.ts +2 -1
- package/package.json +4 -4
- package/dist/core/engine/__tests__/compositorWarmUp.test.d.ts +0 -1
- package/dist/core/engine/compositorWarmUp.d.ts +0 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DeclaredFrame } from '../transition/gestureScrub';
|
|
1
2
|
/**
|
|
2
3
|
* Insert one flight's rules and return the disposer that removes exactly them.
|
|
3
4
|
*
|
|
@@ -16,3 +17,11 @@ export declare const insertMorphRules: (rules: string[]) => (() => void);
|
|
|
16
17
|
* A part that leads the rest of its flight is a flaw; one that jumps is a break.
|
|
17
18
|
*/
|
|
18
19
|
export declare const ensurePinnedPoses: () => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* One flight's compiled path, as its emitter wrote it.
|
|
22
|
+
*
|
|
23
|
+
* `null` when the rules are not this sheet's to read — an animation from
|
|
24
|
+
* somewhere else, or a flight whose rules have already been dropped — and the
|
|
25
|
+
* caller falls back to what the animation itself reports.
|
|
26
|
+
*/
|
|
27
|
+
export declare const declaredMorphKeyframes: (animation: Animation) => DeclaredFrame[] | null;
|
|
@@ -6,9 +6,9 @@ export interface MorphSwipe {
|
|
|
6
6
|
* Hand the flights back to the browser.
|
|
7
7
|
*
|
|
8
8
|
* `commit` plays them out to the arrival — the gesture became a navigation.
|
|
9
|
-
* Otherwise they run
|
|
10
|
-
*
|
|
11
|
-
* the
|
|
9
|
+
* Otherwise they run their RETURN, the same path walked the other way, and
|
|
10
|
+
* the elements go home: a flight that is merely stopped leaves the element in
|
|
11
|
+
* the layer, outside the tree its consumer wrote.
|
|
12
12
|
*/
|
|
13
13
|
settle: (commit: boolean, seconds: number) => void;
|
|
14
14
|
/** Whether anything is actually flying (a screen pair with no shared element is not). */
|
|
@@ -31,3 +31,86 @@ export declare const scrubTo: (animations: readonly Animation[], clock: ScrubClo
|
|
|
31
31
|
* explicitly instead.
|
|
32
32
|
*/
|
|
33
33
|
export declare const settleScrubbed: (animations: readonly Animation[], clock: ScrubClock, commit: boolean, seconds: number, onReverseFinish?: () => void) => void;
|
|
34
|
+
/**
|
|
35
|
+
* A time before the active interval, where `fill: forwards` contributes
|
|
36
|
+
* nothing. A leg parked here is staged, composited and inert; seeking it into
|
|
37
|
+
* range is what makes it the motion on screen.
|
|
38
|
+
*/
|
|
39
|
+
export declare const PARKED_MS = -1;
|
|
40
|
+
type Pose = Record<string, string | number | null | undefined>;
|
|
41
|
+
export interface DeclaredFrame {
|
|
42
|
+
/** Where along the animation's own clock this pose sits, 0 to 1. */
|
|
43
|
+
readonly offset: number;
|
|
44
|
+
/** The curve carried by the segment that LEAVES this frame. */
|
|
45
|
+
readonly easing: string;
|
|
46
|
+
readonly pose: Pose;
|
|
47
|
+
}
|
|
48
|
+
export interface ReturnLeg {
|
|
49
|
+
/** Staged with the drag, parked out of effect until the release seeks it. */
|
|
50
|
+
readonly animation: Animation;
|
|
51
|
+
/** The leg's own clock, in milliseconds: its zero is the flight's arrival. */
|
|
52
|
+
readonly duration: number;
|
|
53
|
+
/** The stretch of that clock the poses actually travel over. */
|
|
54
|
+
readonly travel: {
|
|
55
|
+
readonly start: number;
|
|
56
|
+
readonly end: number;
|
|
57
|
+
};
|
|
58
|
+
/** The curve that stretch carries, which the release inverts to seek by pose. */
|
|
59
|
+
readonly ease: AnimationOptions["ease"];
|
|
60
|
+
/** The same stretch on the SOURCE's clock, for reading where the finger left it. */
|
|
61
|
+
readonly source: {
|
|
62
|
+
readonly start: number;
|
|
63
|
+
readonly end: number;
|
|
64
|
+
readonly delay: number;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Stage the return of a running animation: its own path, walked the other way.
|
|
69
|
+
*
|
|
70
|
+
* The poses come back off the animation, so whatever a consumer declared —
|
|
71
|
+
* including its stops — is what the return runs. Offsets mirror, so a stop a
|
|
72
|
+
* third of the way out is a stop two thirds of the way home, and each segment
|
|
73
|
+
* keeps the curve it was given, pointing FORWARD: reversing a path must not
|
|
74
|
+
* reverse its speed, or the return would leave slowly and arrive at full tilt.
|
|
75
|
+
*
|
|
76
|
+
* The flat lead-in a flight spends before it moves is dropped from the end of
|
|
77
|
+
* the leg, so the leg finishes when the travel does rather than holding the
|
|
78
|
+
* landed pose for the length of a head nobody is waiting through.
|
|
79
|
+
*
|
|
80
|
+
* `declared` is the path as its author wrote it, for a caller that can read it
|
|
81
|
+
* back — a compiled animation must pass one, because what an engine reports
|
|
82
|
+
* through `getKeyframes` is not always all of it: Chromium answers a CSS
|
|
83
|
+
* animation with the offsets and the curves and NONE of the custom properties,
|
|
84
|
+
* and a morph's whole box travels through registered custom properties. The
|
|
85
|
+
* animation's own keyframes are the fallback, and enough for anything staged
|
|
86
|
+
* through `element.animate`.
|
|
87
|
+
*
|
|
88
|
+
* `null` when there is nothing faithful to stage — a stepped channel, which is
|
|
89
|
+
* a handover rather than a motion; a host that drops a property the source
|
|
90
|
+
* animates; an animation that never moves. Those are handed back the way they
|
|
91
|
+
* always were, by playing them backwards.
|
|
92
|
+
*/
|
|
93
|
+
export declare const stageReturnLeg: (source: Animation, declared?: readonly DeclaredFrame[] | null) => ReturnLeg | null;
|
|
94
|
+
/**
|
|
95
|
+
* Where on the leg the pose already on screen sits, and what is left of it.
|
|
96
|
+
*
|
|
97
|
+
* The leg's path is the source's reversed, so the pose the finger left at a
|
|
98
|
+
* fraction `q` of the travel sits at `1 - q` along it — through the curve,
|
|
99
|
+
* which is why this inverts rather than mirrors the time.
|
|
100
|
+
*
|
|
101
|
+
* `null` when there is nothing left to fly.
|
|
102
|
+
*/
|
|
103
|
+
export declare const returnLegSeek: (leg: ReturnLeg, source: Animation) => {
|
|
104
|
+
at: number;
|
|
105
|
+
remaining: number;
|
|
106
|
+
} | null;
|
|
107
|
+
/**
|
|
108
|
+
* Put a staged leg at the pose already on screen and let it run.
|
|
109
|
+
*
|
|
110
|
+
* `remaining` of the leg's own clock covers the release's `seconds`, which is
|
|
111
|
+
* what makes a leg staged for the flight's length land in the time the release
|
|
112
|
+
* settled on. Nothing here builds or reshapes an effect — the leg was staged
|
|
113
|
+
* with the drag — so the frame the finger lifts has no animation to commit.
|
|
114
|
+
*/
|
|
115
|
+
export declare const placeLeg: (leg: Animation, at: number, remaining: number, seconds: number) => void;
|
|
116
|
+
export {};
|
|
@@ -6,7 +6,8 @@ interface CreatePartProps {
|
|
|
6
6
|
idle: PartVariantValue;
|
|
7
7
|
enter: PartVariantValue;
|
|
8
8
|
exit: PartVariantValue;
|
|
9
|
+
dismiss?: PartVariantValue;
|
|
9
10
|
options?: PartTransitionOptions;
|
|
10
11
|
}
|
|
11
|
-
export default function createPartTransition({ name, initial, idle, enter, exit, options }: CreatePartProps): PartTransition;
|
|
12
|
+
export default function createPartTransition({ name, initial, idle, enter, exit, dismiss, options }: CreatePartProps): PartTransition;
|
|
12
13
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flemo/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.1",
|
|
4
4
|
"description": "Framework-agnostic primitives for flemo: history, navigation, transitions, task manager.",
|
|
5
5
|
"main": "./dist/index.mjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"@flemo/eslint-config": "0.0.0",
|
|
40
40
|
"@flemo/tsconfig": "0.0.0",
|
|
41
41
|
"@types/node": "^24.13.1",
|
|
42
|
-
"@vitest/coverage-v8": "^
|
|
42
|
+
"@vitest/coverage-v8": "^5.0.0",
|
|
43
43
|
"csstype": "^3.2.3",
|
|
44
44
|
"eslint": "^9.39.5",
|
|
45
|
-
"jsdom": "^
|
|
45
|
+
"jsdom": "^30.0.1",
|
|
46
46
|
"typescript": "^6.0.3",
|
|
47
47
|
"vite": "^8.2.2",
|
|
48
48
|
"vite-plugin-dts": "^5.1.0",
|
|
49
|
-
"vitest": "^
|
|
49
|
+
"vitest": "^5.0.0"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|