@flemo/core 1.4.0 → 1.5.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 (35) hide show
  1. package/dist/core/engine/__tests__/barRiding.test.d.ts +1 -0
  2. package/dist/core/engine/__tests__/createSwipeController.test.d.ts +1 -0
  3. package/dist/core/engine/__tests__/createTransitionEngine.test.d.ts +1 -0
  4. package/dist/core/engine/barRiding.d.ts +18 -0
  5. package/dist/core/engine/createSwipeController.d.ts +32 -0
  6. package/dist/core/engine/createTransitionEngine.d.ts +2 -0
  7. package/dist/core/engine/types.d.ts +22 -0
  8. package/dist/history/__tests__/createHistorySync.test.d.ts +1 -0
  9. package/dist/history/__tests__/seedInitialHistory.test.d.ts +1 -0
  10. package/dist/history/createHistorySync.d.ts +9 -0
  11. package/dist/history/ensureWindowHistoryState.d.ts +2 -0
  12. package/dist/history/seedInitialHistory.d.ts +4 -0
  13. package/dist/index.d.ts +18 -0
  14. package/dist/index.mjs +717 -97
  15. package/dist/navigate/__tests__/createNavigationController.test.d.ts +1 -0
  16. package/dist/navigate/createNavigationController.d.ts +31 -0
  17. package/dist/screen/__tests__/computeScreenFreeze.test.d.ts +1 -0
  18. package/dist/screen/__tests__/createScreenSelector.test.d.ts +1 -0
  19. package/dist/screen/__tests__/store.test.d.ts +1 -0
  20. package/dist/screen/computeScreenFreeze.d.ts +11 -0
  21. package/dist/screen/createScreenSelector.d.ts +10 -0
  22. package/dist/screen/store.d.ts +16 -0
  23. package/dist/transition/__tests__/animateInline.test.d.ts +1 -0
  24. package/dist/transition/__tests__/applyTransitionStyles.test.d.ts +1 -0
  25. package/dist/transition/__tests__/compileTransitionStyles.test.d.ts +5 -0
  26. package/dist/transition/animateInline.d.ts +4 -0
  27. package/dist/transition/applyTransitionStyles.d.ts +1 -0
  28. package/dist/transition/compileTransitionStyles.d.ts +3 -2
  29. package/dist/transition/partTransition/__tests__/createPartTransition.test.d.ts +1 -0
  30. package/dist/transition/partTransition/__tests__/createRawPartTransition.test.d.ts +1 -0
  31. package/dist/transition/partTransition/createPartTransition.d.ts +13 -0
  32. package/dist/transition/partTransition/createRawPartTransition.d.ts +19 -0
  33. package/dist/transition/partTransition/partTransition.d.ts +2 -0
  34. package/dist/transition/partTransition/typing.d.ts +24 -0
  35. package/package.json +3 -3
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import { History } from '../../history/store';
2
+ import { NavigateStatus } from '../../navigate/store';
3
+ import { SharedBarPresenceLike } from './createSwipeController';
4
+ export interface BarRidingInput {
5
+ appBar: HTMLElement | null;
6
+ navBar: HTMLElement | null;
7
+ isTopOrTopPrev: boolean;
8
+ isActive: boolean;
9
+ index: number;
10
+ hasAppBar: boolean;
11
+ hasNavBar: boolean;
12
+ getStatus: () => NavigateStatus;
13
+ getHistories: () => History[];
14
+ getSharedBars: () => Record<string, SharedBarPresenceLike | undefined>;
15
+ subscribeStatus: (listener: () => void) => () => void;
16
+ subscribeSharedBars: (listener: () => void) => () => void;
17
+ }
18
+ export default function driveBarRiding(input: BarRidingInput): () => void;
@@ -0,0 +1,32 @@
1
+ import { Transition } from '../../transition/typing';
2
+ import { Decorator } from '../../transition/decorator/typing';
3
+ export interface SharedBarPresenceLike {
4
+ appBar: boolean;
5
+ navigationBar: boolean;
6
+ }
7
+ export interface SwipeControllerElements {
8
+ scope: HTMLElement | null;
9
+ screenContainer: HTMLElement | null;
10
+ decorator: HTMLElement | null;
11
+ sharedAppBar: HTMLElement | null;
12
+ sharedNavigationBar: HTMLElement | null;
13
+ }
14
+ export interface SwipeControllerConfig {
15
+ getTransition: () => Transition;
16
+ getDecorator: () => Decorator | undefined;
17
+ getElements: () => SwipeControllerElements;
18
+ hasSharedAppBar: () => boolean;
19
+ hasSharedNavigationBar: () => boolean;
20
+ getViewportScrollHeight: () => number;
21
+ isReadyForDrag: () => boolean;
22
+ getPartnerBars: () => SharedBarPresenceLike | undefined;
23
+ setDragStatus: (status: "IDLE" | "PENDING") => void;
24
+ back: () => void;
25
+ }
26
+ export interface SwipeController {
27
+ pointerDown: (event: PointerEvent) => void;
28
+ pointerMove: (event: PointerEvent) => void;
29
+ pointerUp: (event: PointerEvent) => void;
30
+ shouldPreventTouch: () => boolean;
31
+ }
32
+ export default function createSwipeController(config: SwipeControllerConfig): SwipeController;
@@ -0,0 +1,2 @@
1
+ import { TransitionEngine, TransitionEngineDeps } from './types';
2
+ export default function createTransitionEngine(deps: TransitionEngineDeps): TransitionEngine;
@@ -0,0 +1,22 @@
1
+ import { NavigateStatus } from '../../navigate/store';
2
+ import { TransitionName } from '../../transition/typing';
3
+ export declare const SKIP_ANIMATION_ATTR = "data-flemo-skip-animation";
4
+ export interface TransitionEngineDeps {
5
+ getTransitionTaskId: () => string | null;
6
+ setDragStatus: (status: "IDLE" | "PENDING") => void;
7
+ setReplaceTransitionStatus: (status: "IDLE" | "PENDING") => void;
8
+ }
9
+ export interface ScreenLifecycleInput {
10
+ getElements: () => {
11
+ scope: HTMLElement | null;
12
+ decorator?: HTMLElement | null;
13
+ bars?: (HTMLElement | null | undefined)[];
14
+ };
15
+ transitionName: TransitionName;
16
+ prevTransitionName: TransitionName;
17
+ status: NavigateStatus;
18
+ isActive: boolean;
19
+ }
20
+ export interface TransitionEngine {
21
+ driveScreenLifecycle: (input: ScreenLifecycleInput) => () => void;
22
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { HistoryStoreApi } from './store';
2
+ import { NavigateStoreApi } from '../navigate/store';
3
+ export interface HistorySyncDeps {
4
+ stores: {
5
+ history: HistoryStoreApi;
6
+ navigate: NavigateStoreApi;
7
+ };
8
+ }
9
+ export default function createHistorySync(deps: HistorySyncDeps): () => void;
@@ -0,0 +1,2 @@
1
+ import { TransitionName } from '../transition/typing';
2
+ export default function ensureWindowHistoryState(defaultTransitionName: TransitionName): void;
@@ -0,0 +1,4 @@
1
+ import { History } from './store';
2
+ import { TransitionName } from '../transition/typing';
3
+ import { Path } from 'path-to-regexp';
4
+ export default function seedInitialHistory(routePaths: Path[], pathname: string, search: string, defaultTransitionName: TransitionName): History;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,14 @@
1
1
  export { default as TaskManger } from './core/TaskManger';
2
2
  export { default as createHistoryStore, type History, type HistoryStore, type HistoryStoreApi } from './history/store';
3
+ export { default as seedInitialHistory } from './history/seedInitialHistory';
4
+ export { default as ensureWindowHistoryState } from './history/ensureWindowHistoryState';
5
+ export { default as createHistorySync, type HistorySyncDeps } from './history/createHistorySync';
3
6
  export { default as createNavigateStore, type NavigateStatus, type NavigateStore, type NavigateStoreApi } from './navigate/store';
4
7
  export { markSelfInducedPop, consumeSelfInducedPop } from './navigate/selfPopGuard';
8
+ export { default as createNavigationController, type NavigationControllerDeps, type DistanceOptions, type NavigateOptions, type PopOptions } from './navigate/createNavigationController';
9
+ export { default as createScreenStore, type ScreenStore, type ScreenStoreApi, type SharedBarPresence } from './screen/store';
10
+ export { default as createScreenSelector, type ScreenSelection } from './screen/createScreenSelector';
11
+ export { default as computeScreenFreeze, type ScreenFreezeInput } from './screen/computeScreenFreeze';
5
12
  export { default as createTransition } from './transition/createTransition';
6
13
  export { default as createRawTransition } from './transition/createRawTransition';
7
14
  export { transitionMap } from './transition/transition';
@@ -9,14 +16,25 @@ export { default as createTransitionStore, type TransitionStore, type Transition
9
16
  export { default as createDecorator } from './transition/decorator/createDecorator';
10
17
  export { default as createRawDecorator } from './transition/decorator/createRawDecorator';
11
18
  export { decoratorMap } from './transition/decorator/decorator';
19
+ export { default as createPartTransition } from './transition/partTransition/createPartTransition';
20
+ export { default as createRawPartTransition } from './transition/partTransition/createRawPartTransition';
21
+ export { partTransitionMap } from './transition/partTransition/partTransition';
12
22
  export { default as cupertino } from './transition/cupertino';
13
23
  export { default as material } from './transition/material';
14
24
  export { default as layout } from './transition/layout';
15
25
  export { default as none } from './transition/none';
16
26
  export { default as overlay } from './transition/decorator/overlay';
17
27
  export { compileTransitionStyles, animationName, variantHasAnimation, targetToDecls, collectAnimatedProperties, easingToCss, type CssDecl } from './transition/compileTransitionStyles';
28
+ export { default as applyTransitionStyles } from './transition/applyTransitionStyles';
29
+ export { default as animateInline, clearInlineAnimation } from './transition/animateInline';
30
+ export { default as createTransitionEngine } from './core/engine/createTransitionEngine';
31
+ export { SKIP_ANIMATION_ATTR, type TransitionEngine, type TransitionEngineDeps, type ScreenLifecycleInput } from './core/engine/types';
32
+ export { default as createSwipeController } from './core/engine/createSwipeController';
33
+ export { type SwipeController, type SwipeControllerConfig, type SwipeControllerElements, type SharedBarPresenceLike } from './core/engine/createSwipeController';
34
+ export { default as driveBarRiding, type BarRidingInput } from './core/engine/barRiding';
18
35
  export type { RegisterTransition, TransitionName, TransitionVariant, TransitionVariantValue, TransitionOptions, BaseTransition, Transition, SwipeInfo, SwipeAnimate } from './transition/typing';
19
36
  export type { RegisterDecorator, DecoratorName, DecoratorOptions, Decorator } from './transition/decorator/typing';
37
+ export type { RegisterPartTransition, PartTransitionName, PartTransitionOptions, PartTransition } from './transition/partTransition/typing';
20
38
  export { default as isServer } from './utils/isServer';
21
39
  export { default as getParams } from './utils/getParams';
22
40
  export { default as getMatchedPathPattern } from './utils/getMatchedPathPattern';