@flemo/core 1.30.0 → 2.0.0

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.
Files changed (48) hide show
  1. package/dist/core/engine/__tests__/createSwipeController.dragHooks.test.d.ts +1 -0
  2. package/dist/core/engine/__tests__/createSwipeController.layerRelease.test.d.ts +1 -0
  3. package/dist/core/engine/__tests__/layerRiders.test.d.ts +1 -0
  4. package/dist/core/engine/createSwipeController.d.ts +5 -0
  5. package/dist/core/engine/diagnosticFlags.d.ts +1 -0
  6. package/dist/core/engine/flightRouting.d.ts +21 -0
  7. package/dist/core/engine/layerRiders.d.ts +21 -0
  8. package/dist/core/engine/types.d.ts +1 -0
  9. package/dist/dom/__tests__/stacking.test.d.ts +1 -0
  10. package/dist/dom/attributes.d.ts +126 -2
  11. package/dist/dom/stacking.d.ts +28 -0
  12. package/dist/history/store.d.ts +0 -1
  13. package/dist/index.d.ts +13 -1
  14. package/dist/index.mjs +2228 -1014
  15. package/dist/morph/__tests__/attachMorph.test.d.ts +1 -0
  16. package/dist/morph/__tests__/morphAnimations.test.d.ts +1 -0
  17. package/dist/morph/__tests__/morphClip.test.d.ts +1 -0
  18. package/dist/morph/__tests__/morphGeometry.test.d.ts +1 -0
  19. package/dist/morph/__tests__/morphKeyframes.test.d.ts +1 -0
  20. package/dist/morph/__tests__/morphLayer.test.d.ts +1 -0
  21. package/dist/morph/__tests__/morphPaint.test.d.ts +1 -0
  22. package/dist/morph/__tests__/morphPose.test.d.ts +1 -0
  23. package/dist/morph/__tests__/morphSheet.test.d.ts +1 -0
  24. package/dist/morph/__tests__/morphSide.test.d.ts +1 -0
  25. package/dist/morph/__tests__/morphSwipe.test.d.ts +1 -0
  26. package/dist/morph/attachMorph.d.ts +59 -0
  27. package/dist/morph/morphAnimations.d.ts +2 -0
  28. package/dist/morph/morphClip.d.ts +31 -0
  29. package/dist/morph/morphGeometry.d.ts +111 -0
  30. package/dist/morph/morphKeyframes.d.ts +190 -0
  31. package/dist/morph/morphLayer.d.ts +14 -0
  32. package/dist/morph/morphPaint.d.ts +31 -0
  33. package/dist/morph/morphPose.d.ts +44 -0
  34. package/dist/morph/morphSheet.d.ts +9 -0
  35. package/dist/morph/morphSide.d.ts +43 -0
  36. package/dist/morph/morphSwipe.d.ts +24 -0
  37. package/dist/navigate/createNavigationController.d.ts +0 -1
  38. package/dist/transition/cubicBezier.d.ts +17 -0
  39. package/dist/transition/morphTransition/__tests__/createMorphTransition.test.d.ts +1 -0
  40. package/dist/transition/morphTransition/createMorphTransition.d.ts +13 -0
  41. package/dist/transition/morphTransition/createRawMorphTransition.d.ts +17 -0
  42. package/dist/transition/morphTransition/morphTransition.d.ts +2 -0
  43. package/dist/transition/morphTransition/shared.d.ts +2 -0
  44. package/dist/transition/morphTransition/text.d.ts +2 -0
  45. package/dist/transition/morphTransition/typing.d.ts +72 -0
  46. package/dist/transition/morphTransition/zoom.d.ts +2 -0
  47. package/dist/transition/registerTransitionDefinitions.d.ts +2 -1
  48. package/package.json +7 -7
@@ -0,0 +1,17 @@
1
+ import { InitialTarget } from '../cssTypes';
2
+ import { TransitionVariantValue } from '../typing';
3
+ import { MorphTransition, MorphTransitionName, MorphTransitionOptions } from './typing';
4
+ interface CreateRawMorphProps {
5
+ name: MorphTransitionName;
6
+ initial: InitialTarget;
7
+ idle: TransitionVariantValue;
8
+ pushOnEnter: TransitionVariantValue;
9
+ pushOnExit: TransitionVariantValue;
10
+ replaceOnEnter: TransitionVariantValue;
11
+ replaceOnExit: TransitionVariantValue;
12
+ popOnEnter: TransitionVariantValue;
13
+ popOnExit: TransitionVariantValue;
14
+ options?: MorphTransitionOptions;
15
+ }
16
+ export default function createRawMorphTransition({ name, initial, idle, pushOnEnter, pushOnExit, replaceOnEnter, replaceOnExit, popOnEnter, popOnExit, options }: CreateRawMorphProps): MorphTransition;
17
+ export {};
@@ -0,0 +1,2 @@
1
+ import { MorphTransition, MorphTransitionName } from './typing';
2
+ export declare const morphTransitionMap: Map<MorphTransitionName, MorphTransition>;
@@ -0,0 +1,2 @@
1
+ declare const shared: import('./typing').MorphTransition;
2
+ export default shared;
@@ -0,0 +1,2 @@
1
+ declare const text: import('./typing').MorphTransition;
2
+ export default text;
@@ -0,0 +1,72 @@
1
+ import { BaseTransition, TransitionVariant } from '../typing';
2
+ export interface RegisterMorphTransition {
3
+ }
4
+ export type MorphTransitionName = RegisterMorphTransition[keyof RegisterMorphTransition] | "shared" | "text" | "zoom" | (string & {});
5
+ /** The preset every morph falls back to when no name is given. */
6
+ export declare const DEFAULT_MORPH_TRANSITION_NAME = "shared";
7
+ export type MorphTransitionOptions = {
8
+ /**
9
+ * The share of the flight over which the GHOST dissolves — the copy of the
10
+ * element being replaced that the runtime carries inside the flight (0–1,
11
+ * default 0.55).
12
+ *
13
+ * It is what makes a travel show the right thing at both ends: the flight
14
+ * begins as an exact copy of what was on glass and dissolves into the real
15
+ * arriving element while the box moves. Set it to 0 to carry no copy, which
16
+ * cuts straight to the arrival's content on the first frame.
17
+ *
18
+ * The arriving element stays opaque underneath throughout. Fading both would
19
+ * bleed the background through the pair by a(1 - a) — a luminance dip
20
+ * peaking at 25% in the middle of the hand-over.
21
+ *
22
+ * THE WINDOW IS WHAT THE DEPARTURE'S OWN CONTENT LEAVES OVER. This used to be
23
+ * 0.22 — three frames of a short flight — on the reasoning that holding the
24
+ * copy longer let the two layouts drift apart underneath it and print as
25
+ * doubled text. That reasoning was written when the copy painted everything,
26
+ * including the paired elements. It does not now: a paired descendant is
27
+ * already invisible in the copy (the real one is morphing underneath it), so
28
+ * all the copy is holding is content with NO counterpart — a caption, a body
29
+ * paragraph, a button that exists on one side only. Three frames is not that
30
+ * content leaving; it is that content being cut, which is exactly what a pop
31
+ * looked like next to the arrival it was supposed to reverse.
32
+ */
33
+ crossFade?: number;
34
+ /**
35
+ * Interpolate `border-radius` across the flight (default true). Nothing is
36
+ * scaled, so the two ends' own values are the whole story.
37
+ *
38
+ * It rides the CONTENT animation, never the geometry one: a keyframe that
39
+ * lists a property the compositor cannot animate drops that whole animation
40
+ * to the main thread, and the geometry keyframe is the one that must never
41
+ * leave the compositor.
42
+ */
43
+ radius?: boolean;
44
+ /**
45
+ * Move the whole screen with the element, not just the element (default off).
46
+ *
47
+ * A plain morph flies ALONE: the element crosses while the screens do
48
+ * whatever their own transition says, which is right when the element is one
49
+ * thing among many. It is wrong when the element IS the navigation — a grid
50
+ * cell opening into a full-screen view. There the eye reads the tap as
51
+ * "the camera moved to this card", and a grid that stays put underneath
52
+ * reads as the card escaping from it.
53
+ *
54
+ * `"screen"` gives the flight a camera: the screen the element is SMALL on
55
+ * (the grid — the departing screen on a push, the arriving one on a pop) is
56
+ * scaled and translated by exactly the zoom that takes the element from one
57
+ * end to the other, so every other card moves as though the viewport had
58
+ * pushed in on the tapped one. Material calls the pattern a container
59
+ * transform; iOS 18 calls its version a zoom transition.
60
+ *
61
+ * It SUPERSEDES that screen's own transform for the length of the flight —
62
+ * the camera IS the screen's motion here, and two authors of one transform
63
+ * is not a thing CSS can compose. Pair it with a transition that does not
64
+ * move the screen itself (`none`, or an opacity-only one); a slide would be
65
+ * replaced rather than combined.
66
+ */
67
+ carry?: "screen";
68
+ };
69
+ export interface MorphTransition extends Omit<BaseTransition, "name">, MorphTransitionOptions {
70
+ name: MorphTransitionName;
71
+ }
72
+ export declare const MORPH_FROM_VARIANT: Record<TransitionVariant, "initial" | "IDLE-true" | "self">;
@@ -0,0 +1,2 @@
1
+ declare const zoom: import('./typing').MorphTransition;
2
+ export default zoom;
@@ -1,4 +1,5 @@
1
1
  import { Transition } from './typing';
2
2
  import { Decorator } from './decorator/typing';
3
+ import { MorphTransition } from './morphTransition/typing';
3
4
  import { PartTransition } from './partTransition/typing';
4
- export default function registerTransitionDefinitions(transitions: Transition[], decorators: Decorator[], partTransitions?: PartTransition[]): () => void;
5
+ export default function registerTransitionDefinitions(transitions: Transition[], decorators: Decorator[], partTransitions?: PartTransition[], morphTransitions?: MorphTransition[]): () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flemo/core",
3
- "version": "1.30.0",
3
+ "version": "2.0.0",
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",
@@ -33,20 +33,20 @@
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
35
  "path-to-regexp": "^8.4.2",
36
- "zustand": "^5.0.14"
36
+ "zustand": "^5.0.15"
37
37
  },
38
38
  "devDependencies": {
39
+ "@flemo/eslint-config": "0.0.0",
40
+ "@flemo/tsconfig": "0.0.0",
39
41
  "@types/node": "^24.13.1",
40
- "@vitest/coverage-v8": "^4.1.10",
42
+ "@vitest/coverage-v8": "^4.1.11",
41
43
  "csstype": "^3.2.3",
42
44
  "eslint": "^9.39.5",
43
45
  "jsdom": "^29.1.1",
44
46
  "typescript": "^6.0.3",
45
- "vite": "^8.2.1",
47
+ "vite": "^8.2.2",
46
48
  "vite-plugin-dts": "^5.0.3",
47
- "vitest": "^4.1.10",
48
- "@flemo/eslint-config": "0.0.0",
49
- "@flemo/tsconfig": "0.0.0"
49
+ "vitest": "^4.1.11"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public"