@akanjs/next 0.9.58-canary.0 → 0.9.58-canary.2

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/cjs/bootCsr.js CHANGED
@@ -71,7 +71,16 @@ const bootCsr = async (context, registerClient) => {
71
71
  })
72
72
  );
73
73
  const getPageState = (csrConfig) => {
74
- const { transition, safeArea, topInset, bottomInset, gesture, cache } = csrConfig ?? {};
74
+ const {
75
+ transition,
76
+ safeArea,
77
+ topInset,
78
+ bottomInset,
79
+ gesture,
80
+ cache,
81
+ topSafeAreaColor,
82
+ bottomSafeAreaColor
83
+ } = csrConfig ?? {};
75
84
  const pageState = {
76
85
  transition: transition ?? "none",
77
86
  topSafeArea: safeArea === false || safeArea === "bottom" || import_client.device.info.platform === "android" ? 0 : import_client.device.topSafeArea,
@@ -79,7 +88,9 @@ const bootCsr = async (context, registerClient) => {
79
88
  topInset: topInset === true ? import_client2.DEFAULT_TOP_INSET : topInset === false ? 0 : topInset ?? 0,
80
89
  bottomInset: bottomInset === true ? import_client2.DEFAULT_BOTTOM_INSET : bottomInset === false ? 0 : bottomInset ?? 0,
81
90
  gesture: gesture ?? true,
82
- cache: cache ?? false
91
+ cache: cache ?? false,
92
+ topSafeAreaColor,
93
+ bottomSafeAreaColor
83
94
  };
84
95
  return pageState;
85
96
  };
package/cjs/index.js CHANGED
@@ -32,7 +32,6 @@ __export(next_exports, {
32
32
  useHistory: () => import_useHistory.useHistory,
33
33
  useInterval: () => import_useInterval.useInterval,
34
34
  useLocation: () => import_useLocation.useLocation,
35
- usePurchase: () => import_usePurchase.usePurchase,
36
35
  usePushNoti: () => import_usePushNoti.usePushNoti,
37
36
  useThrottle: () => import_useThrottle.useThrottle
38
37
  });
@@ -47,7 +46,6 @@ var import_useContact = require("./useContact");
47
46
  var import_usePushNoti = require("./usePushNoti");
48
47
  var import_useGeoLocation = require("./useGeoLocation");
49
48
  var import_useCodepush = require("./useCodepush");
50
- var import_usePurchase = require("./usePurchase");
51
49
  var import_useCsrValues = require("./useCsrValues");
52
50
  var import_createRobotPage = require("./createRobotPage");
53
51
  var import_createSitemapPage = require("./createSitemapPage");
@@ -37,7 +37,7 @@ var import_device = require("@capacitor/device");
37
37
  var import_capacitor_updater = require("@capgo/capacitor-updater");
38
38
  var import_axios = __toESM(require("axios"));
39
39
  var import_react = require("react");
40
- const useCodepush = ({ serverUrl, branch }) => {
40
+ const useCodepush = ({ serverUrl }) => {
41
41
  const [update, setUpdate] = (0, import_react.useState)(false);
42
42
  const [version, setVersion] = (0, import_react.useState)("");
43
43
  const initialize = async () => {
@@ -64,7 +64,7 @@ currennt.native:${native}`
64
64
  appName,
65
65
  deviceId,
66
66
  platform,
67
- branch,
67
+ branch: process.env.NEXT_PUBLIC_ENV ?? "debug",
68
68
  isEmulator: info.isVirtual,
69
69
  major: parseInt(major),
70
70
  minor: parseInt(minor),
@@ -83,10 +83,10 @@ currennt.native:${native}`
83
83
  return { release, bundleFile: file };
84
84
  };
85
85
  const codepush = async () => {
86
- const isNewRelease = await checkNewRelease();
87
- if (!isNewRelease)
86
+ const newRelease = await checkNewRelease();
87
+ if (!newRelease)
88
88
  return;
89
- const { release, bundleFile } = isNewRelease;
89
+ const { release, bundleFile } = newRelease;
90
90
  setUpdate(true);
91
91
  const bundle = await import_capacitor_updater.CapacitorUpdater.download({
92
92
  url: bundleFile.url,
@@ -39,11 +39,13 @@ const useNoneTrans = ({ clientHeight, location, prevLocation }) => {
39
39
  const csrTranstionStyles = {
40
40
  topSafeArea: {
41
41
  containerStyle: {
42
+ backgroundColor: pageState.topSafeAreaColor,
42
43
  height: pageState.topSafeArea
43
44
  }
44
45
  },
45
46
  bottomSafeArea: {
46
47
  containerStyle: {
48
+ backgroundColor: pageState.bottomSafeAreaColor,
47
49
  top: clientHeight - pageState.bottomSafeArea,
48
50
  height: pageState.bottomSafeArea
49
51
  }
@@ -638,13 +640,15 @@ const useCsrValues = (rootRouteGuide, pathRoutes) => {
638
640
  pageContentRef.current.scrollTop = getScrollTop(location);
639
641
  if (prevPageContentRef.current)
640
642
  prevPageContentRef.current.scrollTop = prevLocation ? getScrollTop(prevLocation) : 0;
643
+ }, [location.href]);
644
+ (0, import_react2.useEffect)(() => {
641
645
  void import_app.App.addListener("backButton", () => {
642
646
  router2.back();
643
647
  });
644
648
  return () => {
645
649
  void import_app.App.removeAllListeners();
646
650
  };
647
- }, [location.href]);
651
+ }, []);
648
652
  return {
649
653
  ...routeState,
650
654
  ...useCsrTransitionMap[location.pathRoute.pageState.transition]
@@ -21,10 +21,10 @@ __export(useGeoLocation_exports, {
21
21
  useGeoLocation: () => useGeoLocation
22
22
  });
23
23
  module.exports = __toCommonJS(useGeoLocation_exports);
24
- var import_geolocation = require("@capacitor/geolocation");
25
24
  const useGeoLocation = () => {
25
+ const { Geolocation } = require("@capacitor/geolocation");
26
26
  const checkPermission = async () => {
27
- const { location: geolocation, coarseLocation } = await import_geolocation.Geolocation.requestPermissions();
27
+ const { location: geolocation, coarseLocation } = await Geolocation.requestPermissions();
28
28
  return { geolocation, coarseLocation };
29
29
  };
30
30
  const getPosition = async () => {
@@ -33,7 +33,7 @@ const useGeoLocation = () => {
33
33
  location.assign("app-settings:");
34
34
  return;
35
35
  }
36
- const coordinates = await import_geolocation.Geolocation.getCurrentPosition();
36
+ const coordinates = await Geolocation.getCurrentPosition();
37
37
  return coordinates;
38
38
  };
39
39
  return { checkPermission, getPosition };
@@ -24,6 +24,7 @@ module.exports = __toCommonJS(usePurchase_exports);
24
24
  var import_store = require("cordova-plugin-purchase/www/store");
25
25
  var import_app = require("@capacitor/app");
26
26
  var import_react = require("react");
27
+ //! deprecated, @revenuecat/purchases-capacitor로 대체 필요
27
28
  const usePurchase = ({
28
29
  platform,
29
30
  productInfo,
package/esm/bootCsr.js CHANGED
@@ -44,7 +44,16 @@ const bootCsr = async (context, registerClient) => {
44
44
  })
45
45
  );
46
46
  const getPageState = (csrConfig) => {
47
- const { transition, safeArea, topInset, bottomInset, gesture, cache } = csrConfig ?? {};
47
+ const {
48
+ transition,
49
+ safeArea,
50
+ topInset,
51
+ bottomInset,
52
+ gesture,
53
+ cache,
54
+ topSafeAreaColor,
55
+ bottomSafeAreaColor
56
+ } = csrConfig ?? {};
48
57
  const pageState = {
49
58
  transition: transition ?? "none",
50
59
  topSafeArea: safeArea === false || safeArea === "bottom" || device.info.platform === "android" ? 0 : device.topSafeArea,
@@ -52,7 +61,9 @@ const bootCsr = async (context, registerClient) => {
52
61
  topInset: topInset === true ? DEFAULT_TOP_INSET : topInset === false ? 0 : topInset ?? 0,
53
62
  bottomInset: bottomInset === true ? DEFAULT_BOTTOM_INSET : bottomInset === false ? 0 : bottomInset ?? 0,
54
63
  gesture: gesture ?? true,
55
- cache: cache ?? false
64
+ cache: cache ?? false,
65
+ topSafeAreaColor,
66
+ bottomSafeAreaColor
56
67
  };
57
68
  return pageState;
58
69
  };
package/esm/index.js CHANGED
@@ -8,7 +8,6 @@ import { useContact } from "./useContact";
8
8
  import { usePushNoti } from "./usePushNoti";
9
9
  import { useGeoLocation } from "./useGeoLocation";
10
10
  import { useCodepush } from "./useCodepush";
11
- import { usePurchase } from "./usePurchase";
12
11
  import { useCsrValues } from "./useCsrValues";
13
12
  import { createRobotPage } from "./createRobotPage";
14
13
  import { createSitemapPage } from "./createSitemapPage";
@@ -33,7 +32,6 @@ export {
33
32
  useHistory,
34
33
  useInterval,
35
34
  useLocation,
36
- usePurchase,
37
35
  usePushNoti,
38
36
  useThrottle
39
37
  };
@@ -5,7 +5,7 @@ import { Device } from "@capacitor/device";
5
5
  import { CapacitorUpdater } from "@capgo/capacitor-updater";
6
6
  import axios from "axios";
7
7
  import { useState } from "react";
8
- const useCodepush = ({ serverUrl, branch }) => {
8
+ const useCodepush = ({ serverUrl }) => {
9
9
  const [update, setUpdate] = useState(false);
10
10
  const [version, setVersion] = useState("");
11
11
  const initialize = async () => {
@@ -32,7 +32,7 @@ currennt.native:${native}`
32
32
  appName,
33
33
  deviceId,
34
34
  platform,
35
- branch,
35
+ branch: process.env.NEXT_PUBLIC_ENV ?? "debug",
36
36
  isEmulator: info.isVirtual,
37
37
  major: parseInt(major),
38
38
  minor: parseInt(minor),
@@ -51,10 +51,10 @@ currennt.native:${native}`
51
51
  return { release, bundleFile: file };
52
52
  };
53
53
  const codepush = async () => {
54
- const isNewRelease = await checkNewRelease();
55
- if (!isNewRelease)
54
+ const newRelease = await checkNewRelease();
55
+ if (!newRelease)
56
56
  return;
57
- const { release, bundleFile } = isNewRelease;
57
+ const { release, bundleFile } = newRelease;
58
58
  setUpdate(true);
59
59
  const bundle = await CapacitorUpdater.download({
60
60
  url: bundleFile.url,
@@ -21,11 +21,13 @@ const useNoneTrans = ({ clientHeight, location, prevLocation }) => {
21
21
  const csrTranstionStyles = {
22
22
  topSafeArea: {
23
23
  containerStyle: {
24
+ backgroundColor: pageState.topSafeAreaColor,
24
25
  height: pageState.topSafeArea
25
26
  }
26
27
  },
27
28
  bottomSafeArea: {
28
29
  containerStyle: {
30
+ backgroundColor: pageState.bottomSafeAreaColor,
29
31
  top: clientHeight - pageState.bottomSafeArea,
30
32
  height: pageState.bottomSafeArea
31
33
  }
@@ -620,13 +622,15 @@ const useCsrValues = (rootRouteGuide, pathRoutes) => {
620
622
  pageContentRef.current.scrollTop = getScrollTop(location);
621
623
  if (prevPageContentRef.current)
622
624
  prevPageContentRef.current.scrollTop = prevLocation ? getScrollTop(prevLocation) : 0;
625
+ }, [location.href]);
626
+ useEffect(() => {
623
627
  void App.addListener("backButton", () => {
624
628
  router2.back();
625
629
  });
626
630
  return () => {
627
631
  void App.removeAllListeners();
628
632
  };
629
- }, [location.href]);
633
+ }, []);
630
634
  return {
631
635
  ...routeState,
632
636
  ...useCsrTransitionMap[location.pathRoute.pageState.transition]
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { Geolocation } from "@capacitor/geolocation";
3
2
  const useGeoLocation = () => {
3
+ const { Geolocation } = require("@capacitor/geolocation");
4
4
  const checkPermission = async () => {
5
5
  const { location: geolocation, coarseLocation } = await Geolocation.requestPermissions();
6
6
  return { geolocation, coarseLocation };
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ //! deprecated, @revenuecat/purchases-capacitor로 대체 필요
2
3
  import "cordova-plugin-purchase/www/store";
3
4
  import { App } from "@capacitor/app";
4
5
  import { useEffect, useRef, useState } from "react";
package/index.d.ts CHANGED
@@ -9,7 +9,6 @@ export { useContact } from "./useContact";
9
9
  export { usePushNoti } from "./usePushNoti";
10
10
  export { useGeoLocation } from "./useGeoLocation";
11
11
  export { useCodepush } from "./useCodepush";
12
- export { usePurchase, type PlatformType, type ProductType, type CdvProductType } from "./usePurchase";
13
12
  export { useCsrValues } from "./useCsrValues";
14
13
  export { createRobotPage } from "./createRobotPage";
15
14
  export { createSitemapPage } from "./createSitemapPage";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/next",
3
- "version": "0.9.58-canary.0",
3
+ "version": "0.9.58-canary.2",
4
4
  "sourceType": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -29,10 +29,10 @@
29
29
  "axios": "^1.7.9",
30
30
  "cordova-plugin-purchase": "^13.12.1",
31
31
  "negotiator": "^1.0.0",
32
- "next": "15.3.2",
33
- "react": "19.1.1",
32
+ "next": "16.0.3",
33
+ "react": "19.2.0",
34
34
  "react-device-detect": "^2.2.3",
35
- "react-dom": "19.1.1"
35
+ "react-dom": "19.2.0"
36
36
  },
37
37
  "exports": {
38
38
  ".": {
package/useCodepush.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import type { ProtoAppInfo, ProtoFile } from "@akanjs/constant";
2
- export declare const useCodepush: ({ serverUrl, branch }: {
2
+ export declare const useCodepush: ({ serverUrl }: {
3
3
  serverUrl: string;
4
- branch: "debug" | "develop" | "main";
5
4
  }) => {
6
5
  update: boolean;
7
6
  version: string;