@akanjs/next 0.0.4
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/README.md +11 -0
- package/index.d.ts +1 -0
- package/index.js +21 -0
- package/package.json +57 -0
- package/src/bootCsr.d.ts +1 -0
- package/src/capacitor.base.config.d.ts +2 -0
- package/src/capacitor.base.config.js +72 -0
- package/src/createNextMiddleware.d.ts +2 -0
- package/src/createNextMiddleware.js +82 -0
- package/src/createRobotPage.d.ts +2 -0
- package/src/createRobotPage.js +38 -0
- package/src/createSitemapPage.d.ts +2 -0
- package/src/createSitemapPage.js +30 -0
- package/src/index.d.ts +20 -0
- package/src/index.js +82 -0
- package/src/lazy.d.ts +5 -0
- package/src/lazy.js +39 -0
- package/src/makePageProto.d.ts +30 -0
- package/src/types.d.ts +7 -0
- package/src/types.js +15 -0
- package/src/useCamera.d.ts +7 -0
- package/src/useCodepush.d.ts +17 -0
- package/src/useContact.d.ts +6 -0
- package/src/useCsrValues.d.ts +30 -0
- package/src/useCsrValues.js +615 -0
- package/src/useDebounce.d.ts +1 -0
- package/src/useDebounce.js +41 -0
- package/src/useFetch.d.ts +6 -0
- package/src/useFetch.js +46 -0
- package/src/useGeoLocation.d.ts +7 -0
- package/src/useHistory.d.ts +20 -0
- package/src/useHistory.js +69 -0
- package/src/useInterval.d.ts +1 -0
- package/src/useInterval.js +44 -0
- package/src/useLocation.d.ts +8 -0
- package/src/useLocation.js +82 -0
- package/src/usePurchase.d.ts +19 -0
- package/src/usePushNoti.d.ts +6 -0
- package/src/useThrottle.d.ts +1 -0
- package/src/useThrottle.js +43 -0
package/README.md
ADDED
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src";
|
package/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var next_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(next_exports);
|
|
17
|
+
__reExport(next_exports, require("./src"), module.exports);
|
|
18
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
19
|
+
0 && (module.exports = {
|
|
20
|
+
...require("./src")
|
|
21
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@akanjs/next",
|
|
3
|
+
"version": "0.0.4",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/akan-team/akanjs.git",
|
|
11
|
+
"directory": "pkgs/@akanjs/next"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@capacitor-community/contacts": "6.1.1",
|
|
15
|
+
"@capacitor-community/fcm": "6.0.0",
|
|
16
|
+
"@capacitor/app": "6.0.2",
|
|
17
|
+
"@capacitor/camera": "6.1.2",
|
|
18
|
+
"@capacitor/core": "6.2.0",
|
|
19
|
+
"@capacitor/device": "6.0.2",
|
|
20
|
+
"@capacitor/geolocation": "6.1.0",
|
|
21
|
+
"@capacitor/haptics": "6.0.2",
|
|
22
|
+
"@capacitor/keyboard": "6.0.3",
|
|
23
|
+
"@capacitor/preferences": "6.0.3",
|
|
24
|
+
"@capacitor/push-notifications": "6.0.3",
|
|
25
|
+
"@capgo/capacitor-updater": "6.7.7",
|
|
26
|
+
"@formatjs/intl-localematcher": "0.5.10",
|
|
27
|
+
"@react-spring/web": "9.7.5",
|
|
28
|
+
"@urql/core": "5.1.0",
|
|
29
|
+
"@use-gesture/react": "10.3.1",
|
|
30
|
+
"axios": "1.7.9",
|
|
31
|
+
"bull": "4.16.5",
|
|
32
|
+
"capacitor-plugin-safe-area": "3.0.4",
|
|
33
|
+
"clsx": "2.1.1",
|
|
34
|
+
"copy-webpack-plugin": "12.0.2",
|
|
35
|
+
"cordova-plugin-purchase": "13.12.1",
|
|
36
|
+
"dayjs": "1.11.13",
|
|
37
|
+
"express": "4.21.2",
|
|
38
|
+
"immer": "10.1.1",
|
|
39
|
+
"js-cookie": "3.0.5",
|
|
40
|
+
"jwt-decode": "4.0.0",
|
|
41
|
+
"mongoose": "8.9.3",
|
|
42
|
+
"negotiator": "1.0.0",
|
|
43
|
+
"next": "15.1.3",
|
|
44
|
+
"pluralize": "8.0.0",
|
|
45
|
+
"react": "18.2.0",
|
|
46
|
+
"react-device-detect": "2.2.3",
|
|
47
|
+
"react-dom": "18.2.0",
|
|
48
|
+
"react-spring": "9.7.5",
|
|
49
|
+
"reflect-metadata": "0.2.2",
|
|
50
|
+
"socket.io": "4.8.1",
|
|
51
|
+
"socket.io-client": "4.8.1",
|
|
52
|
+
"tunnel-ssh": "5.2.0",
|
|
53
|
+
"vm-browserify": "1.1.2",
|
|
54
|
+
"zustand": "5.0.2"
|
|
55
|
+
},
|
|
56
|
+
"main": "./index.js"
|
|
57
|
+
}
|
package/src/bootCsr.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const bootCsr: (context: any, rootPath: string, entryPath?: string) => Promise<void>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var capacitor_base_config_exports = {};
|
|
29
|
+
__export(capacitor_base_config_exports, {
|
|
30
|
+
withBase: () => withBase
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(capacitor_base_config_exports);
|
|
33
|
+
var import_os = __toESM(require("os"));
|
|
34
|
+
const getLocalIP = () => {
|
|
35
|
+
const interfaces = import_os.default.networkInterfaces();
|
|
36
|
+
for (const interfaceName in interfaces) {
|
|
37
|
+
const iface = interfaces[interfaceName];
|
|
38
|
+
if (!iface)
|
|
39
|
+
continue;
|
|
40
|
+
for (const alias of iface) {
|
|
41
|
+
if (alias.family === "IPv4" && !alias.internal)
|
|
42
|
+
return alias.address;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return "127.0.0.1";
|
|
46
|
+
};
|
|
47
|
+
const withBase = (applyConfig) => {
|
|
48
|
+
const projectName = process.env.NX_TASK_TARGET_PROJECT;
|
|
49
|
+
if (!projectName)
|
|
50
|
+
throw new Error("projectName is not defined, please run with nx command");
|
|
51
|
+
const ip = getLocalIP();
|
|
52
|
+
const baseConfig = {
|
|
53
|
+
appId: `com.${projectName}.app`,
|
|
54
|
+
appName: projectName,
|
|
55
|
+
webDir: `../../dist/apps/${projectName}/csr/`,
|
|
56
|
+
bundledWebRuntime: false,
|
|
57
|
+
server: process.env.APP_OPERATION_MODE !== "release" ? {
|
|
58
|
+
androidScheme: "http",
|
|
59
|
+
url: `http://${ip}:4201`,
|
|
60
|
+
cleartext: true,
|
|
61
|
+
allowNavigation: [`http://${ip}:8080/*`]
|
|
62
|
+
} : void 0,
|
|
63
|
+
plugins: {
|
|
64
|
+
CapacitorCookies: { enabled: true }
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return applyConfig(baseConfig);
|
|
68
|
+
};
|
|
69
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
+
0 && (module.exports = {
|
|
71
|
+
withBase
|
|
72
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var createNextMiddleware_exports = {};
|
|
29
|
+
__export(createNextMiddleware_exports, {
|
|
30
|
+
createNextMiddleware: () => createNextMiddleware
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(createNextMiddleware_exports);
|
|
33
|
+
var import_base = require("@akanjs/base");
|
|
34
|
+
var import_common = require("@akanjs/common");
|
|
35
|
+
var import_intl_localematcher = require("@formatjs/intl-localematcher");
|
|
36
|
+
var import_negotiator = __toESM(require("negotiator"));
|
|
37
|
+
var import_server = require("next/server");
|
|
38
|
+
const i18n = { defaultLocale: "en", locales: ["en", "ko"] };
|
|
39
|
+
const basePaths = process.env.basePaths ? process.env.basePaths.split(",") : [];
|
|
40
|
+
function getLocale(request) {
|
|
41
|
+
if (!request.headers.get("accept-language"))
|
|
42
|
+
return i18n.defaultLocale;
|
|
43
|
+
const negotiatorHeaders = {};
|
|
44
|
+
request.headers.forEach((value, key) => negotiatorHeaders[key] = value);
|
|
45
|
+
try {
|
|
46
|
+
const languages = new import_negotiator.default({ headers: negotiatorHeaders }).languages();
|
|
47
|
+
return (0, import_intl_localematcher.match)(languages, i18n.locales, i18n.defaultLocale);
|
|
48
|
+
} catch (e) {
|
|
49
|
+
return i18n.defaultLocale;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const createNextMiddleware = () => {
|
|
53
|
+
import_common.Logger.rawLog(import_base.logo, "console");
|
|
54
|
+
const middleware = (request) => {
|
|
55
|
+
const pathname = request.nextUrl.pathname;
|
|
56
|
+
const pathnameIsMissingLocale = i18n.locales.every(
|
|
57
|
+
(locale2) => !pathname.startsWith(`/${locale2}/`) && pathname !== `/${locale2}`
|
|
58
|
+
);
|
|
59
|
+
if (pathnameIsMissingLocale)
|
|
60
|
+
return import_server.NextResponse.redirect(
|
|
61
|
+
new URL(`/${getLocale(request)}/${request.nextUrl.href.split("/").slice(3).join("/")}`, request.url)
|
|
62
|
+
);
|
|
63
|
+
const splits = pathname.split("/");
|
|
64
|
+
const locale = splits[1];
|
|
65
|
+
const basePath = basePaths.includes(splits[2]) ? splits[2] : null;
|
|
66
|
+
const headers = new Headers(request.headers);
|
|
67
|
+
const searchParams = new URLSearchParams(request.nextUrl.search);
|
|
68
|
+
const searchParamJwt = searchParams.get("jwt");
|
|
69
|
+
headers.set("x-locale", locale);
|
|
70
|
+
headers.set("x-path", "/" + splits.slice(2).join("/"));
|
|
71
|
+
if (basePath)
|
|
72
|
+
headers.set("x-base-path", basePath);
|
|
73
|
+
if (searchParamJwt)
|
|
74
|
+
headers.set("jwt", searchParamJwt);
|
|
75
|
+
return import_server.NextResponse.next({ request: { headers } });
|
|
76
|
+
};
|
|
77
|
+
return middleware;
|
|
78
|
+
};
|
|
79
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
+
0 && (module.exports = {
|
|
81
|
+
createNextMiddleware
|
|
82
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var createRobotPage_exports = {};
|
|
19
|
+
__export(createRobotPage_exports, {
|
|
20
|
+
createRobotPage: () => createRobotPage
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(createRobotPage_exports);
|
|
23
|
+
const createRobotPage = (clientHttpUri, config) => {
|
|
24
|
+
return {
|
|
25
|
+
...config ?? {},
|
|
26
|
+
rules: {
|
|
27
|
+
userAgent: "*",
|
|
28
|
+
allow: "/",
|
|
29
|
+
disallow: "/admin/",
|
|
30
|
+
...config?.rules ?? {}
|
|
31
|
+
},
|
|
32
|
+
sitemap: `${clientHttpUri}/sitemap.xml`
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
createRobotPage
|
|
38
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var createSitemapPage_exports = {};
|
|
19
|
+
__export(createSitemapPage_exports, {
|
|
20
|
+
createSitemapPage: () => createSitemapPage
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(createSitemapPage_exports);
|
|
23
|
+
const lastModified = /* @__PURE__ */ new Date();
|
|
24
|
+
const createSitemapPage = (clientHttpUri, paths) => {
|
|
25
|
+
return paths.map((path) => ({ url: `${clientHttpUri}${path}`, lastModified }));
|
|
26
|
+
};
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
createSitemapPage
|
|
30
|
+
});
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type * from "./types";
|
|
2
|
+
export { useFetch } from "./useFetch";
|
|
3
|
+
export { lazy } from "./lazy";
|
|
4
|
+
export { makePageProto } from "./makePageProto";
|
|
5
|
+
export { useDebounce } from "./useDebounce";
|
|
6
|
+
export { useInterval } from "./useInterval";
|
|
7
|
+
export { bootCsr } from "./bootCsr";
|
|
8
|
+
export { useCamera } from "./useCamera";
|
|
9
|
+
export { useContact } from "./useContact";
|
|
10
|
+
export { usePushNoti } from "./usePushNoti";
|
|
11
|
+
export { useGeoLocation } from "./useGeoLocation";
|
|
12
|
+
export { useCodepush } from "./useCodepush";
|
|
13
|
+
export { usePurchase, type PlatformType, type ProductType, type CdvProductType } from "./usePurchase";
|
|
14
|
+
export { useCsrValues } from "./useCsrValues";
|
|
15
|
+
export { createRobotPage } from "./createRobotPage";
|
|
16
|
+
export { createSitemapPage } from "./createSitemapPage";
|
|
17
|
+
export { createNextMiddleware } from "./createNextMiddleware";
|
|
18
|
+
export { useThrottle } from "./useThrottle";
|
|
19
|
+
export { useHistory } from "./useHistory";
|
|
20
|
+
export { useLocation } from "./useLocation";
|
package/src/index.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var src_exports = {};
|
|
19
|
+
__export(src_exports, {
|
|
20
|
+
bootCsr: () => import_bootCsr.bootCsr,
|
|
21
|
+
createNextMiddleware: () => import_createNextMiddleware.createNextMiddleware,
|
|
22
|
+
createRobotPage: () => import_createRobotPage.createRobotPage,
|
|
23
|
+
createSitemapPage: () => import_createSitemapPage.createSitemapPage,
|
|
24
|
+
lazy: () => import_lazy.lazy,
|
|
25
|
+
makePageProto: () => import_makePageProto.makePageProto,
|
|
26
|
+
useCamera: () => import_useCamera.useCamera,
|
|
27
|
+
useCodepush: () => import_useCodepush.useCodepush,
|
|
28
|
+
useContact: () => import_useContact.useContact,
|
|
29
|
+
useCsrValues: () => import_useCsrValues.useCsrValues,
|
|
30
|
+
useDebounce: () => import_useDebounce.useDebounce,
|
|
31
|
+
useFetch: () => import_useFetch.useFetch,
|
|
32
|
+
useGeoLocation: () => import_useGeoLocation.useGeoLocation,
|
|
33
|
+
useHistory: () => import_useHistory.useHistory,
|
|
34
|
+
useInterval: () => import_useInterval.useInterval,
|
|
35
|
+
useLocation: () => import_useLocation.useLocation,
|
|
36
|
+
usePurchase: () => import_usePurchase.usePurchase,
|
|
37
|
+
usePushNoti: () => import_usePushNoti.usePushNoti,
|
|
38
|
+
useThrottle: () => import_useThrottle.useThrottle
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(src_exports);
|
|
41
|
+
var import_useFetch = require("./useFetch");
|
|
42
|
+
var import_lazy = require("./lazy");
|
|
43
|
+
var import_makePageProto = require("./makePageProto");
|
|
44
|
+
var import_useDebounce = require("./useDebounce");
|
|
45
|
+
var import_useInterval = require("./useInterval");
|
|
46
|
+
var import_bootCsr = require("./bootCsr");
|
|
47
|
+
var import_useCamera = require("./useCamera");
|
|
48
|
+
var import_useContact = require("./useContact");
|
|
49
|
+
var import_usePushNoti = require("./usePushNoti");
|
|
50
|
+
var import_useGeoLocation = require("./useGeoLocation");
|
|
51
|
+
var import_useCodepush = require("./useCodepush");
|
|
52
|
+
var import_usePurchase = require("./usePurchase");
|
|
53
|
+
var import_useCsrValues = require("./useCsrValues");
|
|
54
|
+
var import_createRobotPage = require("./createRobotPage");
|
|
55
|
+
var import_createSitemapPage = require("./createSitemapPage");
|
|
56
|
+
var import_createNextMiddleware = require("./createNextMiddleware");
|
|
57
|
+
var import_useThrottle = require("./useThrottle");
|
|
58
|
+
var import_useHistory = require("./useHistory");
|
|
59
|
+
var import_useLocation = require("./useLocation");
|
|
60
|
+
//! PageAgent csr에서 말썽 일으킨다
|
|
61
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
+
0 && (module.exports = {
|
|
63
|
+
bootCsr,
|
|
64
|
+
createNextMiddleware,
|
|
65
|
+
createRobotPage,
|
|
66
|
+
createSitemapPage,
|
|
67
|
+
lazy,
|
|
68
|
+
makePageProto,
|
|
69
|
+
useCamera,
|
|
70
|
+
useCodepush,
|
|
71
|
+
useContact,
|
|
72
|
+
useCsrValues,
|
|
73
|
+
useDebounce,
|
|
74
|
+
useFetch,
|
|
75
|
+
useGeoLocation,
|
|
76
|
+
useHistory,
|
|
77
|
+
useInterval,
|
|
78
|
+
useLocation,
|
|
79
|
+
usePurchase,
|
|
80
|
+
usePushNoti,
|
|
81
|
+
useThrottle
|
|
82
|
+
});
|
package/src/lazy.d.ts
ADDED
package/src/lazy.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var lazy_exports = {};
|
|
29
|
+
__export(lazy_exports, {
|
|
30
|
+
lazy: () => lazy
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(lazy_exports);
|
|
33
|
+
var import_dynamic = __toESM(require("next/dynamic"));
|
|
34
|
+
//! next build를 위해서 lint 무시
|
|
35
|
+
const lazy = (loader, option) => (0, import_dynamic.default)(loader, option ?? {});
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
lazy
|
|
39
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Translation, type TransMessage } from "@akanjs/dictionary";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
export declare const makePageProto: <Locale extends {
|
|
4
|
+
[key: string]: {
|
|
5
|
+
[key: string]: Translation;
|
|
6
|
+
};
|
|
7
|
+
}>(locales: Locale[]) => () => {
|
|
8
|
+
path: string;
|
|
9
|
+
l: {
|
|
10
|
+
(key: TransMessage<Locale>, param?: {
|
|
11
|
+
[key: string]: string | number;
|
|
12
|
+
}): string;
|
|
13
|
+
rich(key: TransMessage<Locale>, param?: {
|
|
14
|
+
[key: string]: string | number;
|
|
15
|
+
}): ReactNode;
|
|
16
|
+
field<ModelKey extends keyof Locale>(model: ModelKey, field: keyof Locale[ModelKey]): string;
|
|
17
|
+
desc<ModelKey extends keyof Locale>(model: ModelKey, field: keyof Locale[ModelKey]): string;
|
|
18
|
+
enum<ModelKey extends keyof Locale>(model: ModelKey, field: keyof Locale[ModelKey], value: string): string;
|
|
19
|
+
enumdesc<ModelKey extends keyof Locale>(model: ModelKey, field: keyof Locale[ModelKey], value: string): string;
|
|
20
|
+
api<ModelKey extends keyof Locale>(model: ModelKey, endpoint: keyof Locale[ModelKey]): string;
|
|
21
|
+
apidesc<ModelKey extends keyof Locale>(model: ModelKey, endpoint: keyof Locale[ModelKey]): string;
|
|
22
|
+
arg<ModelKey extends keyof Locale>(model: ModelKey, endpoint: keyof Locale[ModelKey], arg: string): string;
|
|
23
|
+
argdesc<ModelKey extends keyof Locale>(model: ModelKey, endpoint: keyof Locale[ModelKey], arg: string): string;
|
|
24
|
+
qry<ModelKey extends keyof Locale>(model: ModelKey, queryKey: keyof Locale[ModelKey]): string;
|
|
25
|
+
qrydesc<ModelKey extends keyof Locale>(model: ModelKey, queryKey: keyof Locale[ModelKey]): string;
|
|
26
|
+
qarg<ModelKey extends keyof Locale>(model: ModelKey, queryKey: keyof Locale[ModelKey], arg: string): string;
|
|
27
|
+
qargdesc<ModelKey extends keyof Locale>(model: ModelKey, queryKey: keyof Locale[ModelKey], arg: string): string;
|
|
28
|
+
};
|
|
29
|
+
lang: string;
|
|
30
|
+
};
|
package/src/types.d.ts
ADDED
package/src/types.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var types_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PermissionStatus } from "@capacitor/camera";
|
|
2
|
+
export declare const useCamera: () => {
|
|
3
|
+
permissions: PermissionStatus;
|
|
4
|
+
getPhoto: (src?: "prompt" | "camera" | "photos") => Promise<import("@capacitor/camera").Photo | undefined>;
|
|
5
|
+
pickImage: () => Promise<import("@capacitor/camera").GalleryPhotos>;
|
|
6
|
+
checkPermission: (type: "photos" | "camera" | "all") => Promise<void>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ProtoAppInfo, ProtoFile } from "@akanjs/constant";
|
|
2
|
+
export declare const useCodepush: ({ serverUrl, branch }: {
|
|
3
|
+
serverUrl: string;
|
|
4
|
+
branch: "debug" | "develop" | "main";
|
|
5
|
+
}) => {
|
|
6
|
+
update: boolean;
|
|
7
|
+
version: string;
|
|
8
|
+
initialize: () => Promise<void>;
|
|
9
|
+
checkNewRelease: () => Promise<{
|
|
10
|
+
release: ProtoAppInfo & {
|
|
11
|
+
appBuild: string;
|
|
12
|
+
};
|
|
13
|
+
bundleFile: ProtoFile;
|
|
14
|
+
} | undefined>;
|
|
15
|
+
codepush: () => Promise<void>;
|
|
16
|
+
statManager: () => Promise<void>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PermissionStatus } from "@capacitor-community/contacts";
|
|
2
|
+
export declare const useContact: () => {
|
|
3
|
+
permissions: PermissionStatus;
|
|
4
|
+
getContacts: () => Promise<import("@capacitor-community/contacts").ContactPayload[]>;
|
|
5
|
+
checkPermission: () => Promise<void>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PathRoute, type RouteGuide, type RouterInstance, type TransitionType } from "@akanjs/client";
|
|
2
|
+
export declare const useCsrValues: (rootRouteGuide: RouteGuide, pathRoutes: PathRoute[]) => {
|
|
3
|
+
topSafeArea: import("@akanjs/client").SafeAreaTransition | null;
|
|
4
|
+
page: import("@akanjs/client").PageTransition | null;
|
|
5
|
+
prevPage: import("@akanjs/client").PageTransition | null;
|
|
6
|
+
topInset: import("@akanjs/client").ContainerTransition | null;
|
|
7
|
+
bottomInset: import("@akanjs/client").ContainerTransition | null;
|
|
8
|
+
topLeftAction: import("@akanjs/client").ContainerTransition | null;
|
|
9
|
+
bottomSafeArea: import("@akanjs/client").SafeAreaTransition | null;
|
|
10
|
+
pageBind: (...args: any[]) => import("@use-gesture/react/dist/declarations/src/types").ReactDOMAttributes;
|
|
11
|
+
pageClassName: string;
|
|
12
|
+
transDirection: "vertical" | "horizontal" | "none";
|
|
13
|
+
transUnitRange: number[];
|
|
14
|
+
transUnit: import("@react-spring/web").SpringValue<number>;
|
|
15
|
+
transPercent: import("@react-spring/web").Interpolation<number>;
|
|
16
|
+
transProgress: import("@react-spring/web").Interpolation<number>;
|
|
17
|
+
clientWidth: number;
|
|
18
|
+
clientHeight: number;
|
|
19
|
+
location: import("@akanjs/client").Location;
|
|
20
|
+
prevLocation: import("@akanjs/client").Location | null;
|
|
21
|
+
history: import("react").MutableRefObject<import("@akanjs/client").History>;
|
|
22
|
+
topSafeAreaRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
23
|
+
bottomSafeAreaRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
24
|
+
prevPageContentRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
25
|
+
pageContentRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
26
|
+
frameRootRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
27
|
+
onBack: import("react").MutableRefObject<{ [K in TransitionType]?: () => Promise<void>; }>;
|
|
28
|
+
router: RouterInstance;
|
|
29
|
+
pathRoutes: PathRoute[];
|
|
30
|
+
};
|