@akanjs/client 0.9.34 → 0.9.36

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.
@@ -1,5 +1,8 @@
1
1
  "use client";
2
- import { createContext, useContext } from "react";
2
+ import {
3
+ createContext,
4
+ useContext
5
+ } from "react";
3
6
  const DEFAULT_TOP_INSET = 48;
4
7
  const DEFAULT_BOTTOM_INSET = 60;
5
8
  const defaultPageState = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/client",
3
- "version": "0.9.34",
3
+ "version": "0.9.36",
4
4
  "sourceType": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -25,7 +25,7 @@
25
25
  "js-cookie": "^3.0.5",
26
26
  "jwt-decode": "^4.0.0",
27
27
  "next": "15.3.2",
28
- "react": "18.3.1",
28
+ "react": "19.1.1",
29
29
  "react-device-detect": "^2.2.3"
30
30
  },
31
31
  "exports": {
package/src/csrTypes.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import type { ReactDOMAttributes } from "@use-gesture/react/dist/declarations/src/types";
2
- import { type ExoticComponent, type MutableRefObject } from "react";
3
- import { ReactNode } from "react";
4
- import type { AnimatedComponent, Interpolation, SpringValue } from "react-spring";
2
+ import { type ForwardRefExoticComponent, MutableRefObject, ReactNode, RefObject } from "react";
3
+ import type { AnimatedComponent, AnimatedProps, Interpolation, SpringValue } from "react-spring";
5
4
  import type { RouterInstance } from "./router";
6
5
  export type TransitionType = "none" | "fade" | "bottomUp" | "stack" | "scaleOut";
7
6
  export interface CsrConfig {
@@ -46,7 +45,8 @@ export interface Route {
46
45
  pageState?: PageState;
47
46
  children: Map<string, Route>;
48
47
  }
49
- export type TransitionStyle = NonNullable<AnimatedComponent<ExoticComponent>["defaultProps"]>["style"];
48
+ export type AnimatedDivProps = AnimatedComponent<"div"> extends ForwardRefExoticComponent<AnimatedProps<infer P>> ? P : never;
49
+ export type TransitionStyle = AnimatedDivProps["style"];
50
50
  export interface SafeAreaTransition {
51
51
  containerStyle: TransitionStyle;
52
52
  }
@@ -110,11 +110,11 @@ export interface RouteState {
110
110
  location: Location;
111
111
  prevLocation: Location | null;
112
112
  history: MutableRefObject<History>;
113
- topSafeAreaRef: MutableRefObject<HTMLDivElement | null>;
114
- bottomSafeAreaRef: MutableRefObject<HTMLDivElement | null>;
115
- prevPageContentRef: MutableRefObject<HTMLDivElement | null>;
116
- pageContentRef: MutableRefObject<HTMLDivElement | null>;
117
- frameRootRef: MutableRefObject<HTMLDivElement | null>;
113
+ topSafeAreaRef: RefObject<HTMLDivElement>;
114
+ bottomSafeAreaRef: RefObject<HTMLDivElement>;
115
+ prevPageContentRef: RefObject<HTMLDivElement>;
116
+ pageContentRef: RefObject<HTMLDivElement>;
117
+ frameRootRef: RefObject<HTMLDivElement>;
118
118
  onBack: MutableRefObject<{
119
119
  [K in TransitionType]?: () => Promise<void>;
120
120
  }>;
package/src/device.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type DeviceInfo } from "@capacitor/device";
2
- import type { MutableRefObject } from "react";
2
+ import type { RefObject } from "react";
3
3
  interface DeviceInitOption {
4
4
  lang?: string;
5
5
  supportLanguages?: string[] | readonly string[];
@@ -12,7 +12,7 @@ declare class Device {
12
12
  bottomSafeArea: number;
13
13
  isMobile: boolean;
14
14
  init({ lang, supportLanguages }?: DeviceInitOption): Promise<void>;
15
- setPageContentRef(pageContentRef: MutableRefObject<HTMLDivElement | null>): void;
15
+ setPageContentRef(pageContentRef: RefObject<HTMLDivElement>): void;
16
16
  showKeyboard(): Promise<void>;
17
17
  hideKeyboard(): Promise<void>;
18
18
  listenKeyboardChanged(onKeyboardChanged: (height: number) => void): void;