@akanjs/next 0.0.39 → 0.0.40
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/csrTypes-B6ATv9-y.d.ts +88 -0
- package/index.d.ts +33 -0
- package/index.js +20 -2723
- package/package.json +2 -35
- package/src/bootCsr.d.ts +3 -0
- package/src/bootCsr.js +206 -0
- package/src/createNextMiddleware.d.ts +5 -0
- package/src/createNextMiddleware.js +88 -0
- package/src/createRobotPage.d.ts +5 -0
- package/src/createRobotPage.js +39 -0
- package/src/createSitemapPage.d.ts +5 -0
- package/src/createSitemapPage.js +34 -0
- package/src/index.d.ts +33 -0
- package/src/index.js +82 -0
- package/src/lazy.d.ts +8 -0
- package/src/lazy.js +40 -0
- package/src/makePageProto.d.ts +42 -0
- package/src/makePageProto.js +147 -0
- package/src/types.d.ts +9 -0
- package/src/types.js +15 -0
- package/src/useCamera.d.ts +11 -0
- package/src/useCamera.js +114 -0
- package/src/useCodepush.d.ts +51 -0
- package/src/useCodepush.js +115 -0
- package/src/useContact.d.ts +10 -0
- package/src/useContact.js +73 -0
- package/src/useCsrValues.d.ts +44 -0
- package/src/useCsrValues.js +924 -0
- package/src/useDebounce.d.ts +3 -0
- package/src/useDebounce.js +42 -0
- package/src/useFetch.d.ts +8 -0
- package/src/useFetch.js +54 -0
- package/src/useGeoLocation.d.ts +12 -0
- package/src/useGeoLocation.js +51 -0
- package/src/useHistory.d.ts +24 -0
- package/src/useHistory.js +88 -0
- package/src/useInterval.d.ts +5 -0
- package/src/useInterval.js +49 -0
- package/src/useLocation.d.ts +12 -0
- package/src/useLocation.js +92 -0
- package/src/usePurchase.d.ts +20 -0
- package/src/usePurchase.js +139 -0
- package/src/usePushNoti.d.ts +8 -0
- package/src/usePushNoti.js +68 -0
- package/src/useThrottle.d.ts +3 -0
- package/src/useThrottle.js +44 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var usePushNoti_exports = {};
|
|
21
|
+
__export(usePushNoti_exports, {
|
|
22
|
+
usePushNoti: () => usePushNoti
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(usePushNoti_exports);
|
|
25
|
+
var import_device = require("@capacitor/device");
|
|
26
|
+
var import_push_notifications = require("@capacitor/push-notifications");
|
|
27
|
+
var import_fcm = require("@capacitor-community/fcm");
|
|
28
|
+
const usePushNoti = /* @__PURE__ */ __name(() => {
|
|
29
|
+
const init = /* @__PURE__ */ __name(async () => {
|
|
30
|
+
const device = await import_device.Device.getInfo();
|
|
31
|
+
if (device.platform === "web") return;
|
|
32
|
+
void import_fcm.FCM.setAutoInit({
|
|
33
|
+
enabled: true
|
|
34
|
+
});
|
|
35
|
+
void import_push_notifications.PushNotifications.requestPermissions().then(async (result) => {
|
|
36
|
+
if (result.receive === "granted") {
|
|
37
|
+
await import_push_notifications.PushNotifications.register();
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}, "init");
|
|
41
|
+
const checkPermission = /* @__PURE__ */ __name(async () => {
|
|
42
|
+
const { receive } = await import_push_notifications.PushNotifications.checkPermissions();
|
|
43
|
+
return receive === "granted";
|
|
44
|
+
}, "checkPermission");
|
|
45
|
+
const register = /* @__PURE__ */ __name(async () => {
|
|
46
|
+
const device = await import_device.Device.getInfo();
|
|
47
|
+
if (device.platform === "web") return;
|
|
48
|
+
const { receive } = await import_push_notifications.PushNotifications.checkPermissions();
|
|
49
|
+
if (receive === "denied") location.assign("app-settings:");
|
|
50
|
+
else await import_push_notifications.PushNotifications.register();
|
|
51
|
+
}, "register");
|
|
52
|
+
const getToken = /* @__PURE__ */ __name(async () => {
|
|
53
|
+
const device = await import_device.Device.getInfo();
|
|
54
|
+
if (device.platform === "web") return;
|
|
55
|
+
const { token } = await import_fcm.FCM.getToken();
|
|
56
|
+
return token;
|
|
57
|
+
}, "getToken");
|
|
58
|
+
return {
|
|
59
|
+
init,
|
|
60
|
+
checkPermission,
|
|
61
|
+
register,
|
|
62
|
+
getToken
|
|
63
|
+
};
|
|
64
|
+
}, "usePushNoti");
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
usePushNoti
|
|
68
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var useThrottle_exports = {};
|
|
21
|
+
__export(useThrottle_exports, {
|
|
22
|
+
useThrottle: () => useThrottle
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(useThrottle_exports);
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
const useThrottle = /* @__PURE__ */ __name((func, delay = 200, deps = []) => {
|
|
27
|
+
const throttleSeed = (0, import_react.useRef)(null);
|
|
28
|
+
const throttleFunction = (0, import_react.useCallback)((...args) => {
|
|
29
|
+
if (throttleSeed.current) return;
|
|
30
|
+
func(...args);
|
|
31
|
+
throttleSeed.current = setTimeout(() => {
|
|
32
|
+
throttleSeed.current = null;
|
|
33
|
+
}, delay);
|
|
34
|
+
}, [
|
|
35
|
+
func,
|
|
36
|
+
delay,
|
|
37
|
+
...deps
|
|
38
|
+
]);
|
|
39
|
+
return throttleFunction;
|
|
40
|
+
}, "useThrottle");
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
useThrottle
|
|
44
|
+
});
|