@whop/react-native 0.0.11 → 0.0.12
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/dist/cli/index.js +353 -40
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +350 -37
- package/dist/cli/index.mjs.map +1 -1
- package/dist/lib/index.d.mts +15 -1
- package/dist/lib/index.d.ts +15 -1
- package/dist/lib/index.js +305 -5
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +295 -5
- package/dist/lib/index.mjs.map +1 -1
- package/dist/lib/web.mjs +214 -0
- package/dist/lib/web.mjs.map +1 -0
- package/package.json +63 -5
package/dist/lib/index.d.ts
CHANGED
|
@@ -61,4 +61,18 @@ interface ExecAsyncApi extends ExecSyncApi {
|
|
|
61
61
|
declare function __internal_execSync<F extends keyof ExecSyncApi>(name: F, params: Parameters<ExecSyncApi[F]>[0]): ReturnType<ExecSyncApi[F]>;
|
|
62
62
|
declare function __internal_execAsync<F extends keyof ExecAsyncApi>(name: F, params: Parameters<ExecAsyncApi[F]>[0]): Promise<ReturnType<ExecAsyncApi[F]>>;
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Web-safe wrapper for react-native-haptic-feedback.
|
|
66
|
+
* - Lazily imports the native module only in native environments.
|
|
67
|
+
* - Provides a no-op fallback on web to avoid runtime crashes.
|
|
68
|
+
*/
|
|
69
|
+
type HapticType = "selection" | "impactLight" | "impactMedium" | "impactHeavy" | "notificationSuccess" | "notificationWarning" | "notificationError";
|
|
70
|
+
type HapticOptions = {
|
|
71
|
+
enableVibrateFallback?: boolean;
|
|
72
|
+
ignoreAndroidSystemSettings?: boolean;
|
|
73
|
+
};
|
|
74
|
+
declare const Haptics: {
|
|
75
|
+
trigger(type: HapticType, options?: HapticOptions): Promise<void>;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export { type DiscoverViewProps, type ExecAsyncApi, type ExecSyncApi, type ExperienceViewProps, Haptics, type PathParams, __internal_execAsync, __internal_execSync, whopSdk };
|
package/dist/lib/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
+
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
9
|
var __export = (target, all) => {
|
|
8
10
|
for (var name in all)
|
|
@@ -17,11 +19,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
19
|
return to;
|
|
18
20
|
};
|
|
19
21
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
20
30
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
31
|
|
|
22
32
|
// src/lib/index.ts
|
|
23
33
|
var lib_exports = {};
|
|
24
34
|
__export(lib_exports, {
|
|
35
|
+
Haptics: () => haptics_default,
|
|
25
36
|
__internal_execAsync: () => __internal_execAsync,
|
|
26
37
|
__internal_execSync: () => __internal_execSync,
|
|
27
38
|
whopSdk: () => whopSdk
|
|
@@ -34,11 +45,263 @@ __export(client_sdk_exports, {
|
|
|
34
45
|
whopSdk: () => whopSdk
|
|
35
46
|
});
|
|
36
47
|
var import_api = require("@whop/api");
|
|
37
|
-
var
|
|
48
|
+
var import_react_native3 = require("react-native");
|
|
38
49
|
|
|
39
50
|
// src/lib/native-whop-core.ts
|
|
51
|
+
var import_react_native2 = require("react-native");
|
|
52
|
+
|
|
53
|
+
// src/lib/native-whop-core-stub.ts
|
|
40
54
|
var import_react_native = require("react-native");
|
|
41
|
-
var
|
|
55
|
+
var WhopCoreObservable = class {
|
|
56
|
+
subscribers = /* @__PURE__ */ new Set();
|
|
57
|
+
value;
|
|
58
|
+
constructor(value) {
|
|
59
|
+
this.value = value;
|
|
60
|
+
}
|
|
61
|
+
setValue(value) {
|
|
62
|
+
this.value = value;
|
|
63
|
+
for (const callback of this.subscribers) {
|
|
64
|
+
callback(value);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
getValue() {
|
|
68
|
+
return this.value;
|
|
69
|
+
}
|
|
70
|
+
subscribe(callback) {
|
|
71
|
+
this.subscribers.add(callback);
|
|
72
|
+
return () => {
|
|
73
|
+
this.subscribers.delete(callback);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
var WhopCoreNavigation = class {
|
|
78
|
+
path = new WhopCoreObservable([]);
|
|
79
|
+
sheet = new WhopCoreObservable(null);
|
|
80
|
+
constructor() {
|
|
81
|
+
this.getFullStack = this.getFullStack.bind(this);
|
|
82
|
+
this.getCurrentSheet = this.getCurrentSheet.bind(this);
|
|
83
|
+
this.subscribeToPath = this.subscribeToPath.bind(this);
|
|
84
|
+
this.subscribeToSheet = this.subscribeToSheet.bind(this);
|
|
85
|
+
}
|
|
86
|
+
push(route) {
|
|
87
|
+
if (this.getCurrent().path.join("/") === route.path.join("/")) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
this.path.setValue([...this.path.getValue(), route]);
|
|
91
|
+
if (typeof window !== "undefined" && window.history) {
|
|
92
|
+
try {
|
|
93
|
+
const pathBits = route.path.join("/");
|
|
94
|
+
const paramsBits = Object.entries(route.params).map(([key, value]) => `${key}=${value}`).join("&");
|
|
95
|
+
window.history.pushState(
|
|
96
|
+
{ route, index: this.path.getValue().length },
|
|
97
|
+
"",
|
|
98
|
+
`#${pathBits}?${paramsBits}`
|
|
99
|
+
);
|
|
100
|
+
} catch {
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
pop() {
|
|
105
|
+
if (typeof window !== "undefined" && window.history) {
|
|
106
|
+
try {
|
|
107
|
+
window.history.back();
|
|
108
|
+
} catch {
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
getFullStack() {
|
|
113
|
+
return this.path.getValue();
|
|
114
|
+
}
|
|
115
|
+
getCurrent() {
|
|
116
|
+
return this.path.getValue()[this.path.getValue().length - 1] ?? {
|
|
117
|
+
path: [],
|
|
118
|
+
params: {}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
presentSheet(route) {
|
|
122
|
+
this.sheet.setValue(route);
|
|
123
|
+
}
|
|
124
|
+
dismissSheet() {
|
|
125
|
+
this.sheet.setValue(null);
|
|
126
|
+
}
|
|
127
|
+
getCurrentSheet() {
|
|
128
|
+
return this.sheet.getValue() ?? null;
|
|
129
|
+
}
|
|
130
|
+
subscribeToPath(callback) {
|
|
131
|
+
return this.path.subscribe(callback);
|
|
132
|
+
}
|
|
133
|
+
subscribeToSheet(callback) {
|
|
134
|
+
return this.sheet.subscribe(callback);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
var navigation = new WhopCoreNavigation();
|
|
138
|
+
if (typeof window !== "undefined" && import_react_native.Platform.OS === "web") {
|
|
139
|
+
window.whopCoreNavigation = navigation;
|
|
140
|
+
window.addEventListener("popstate", (e) => {
|
|
141
|
+
const currentLength = navigation.path.getValue().length;
|
|
142
|
+
if (!e.state) {
|
|
143
|
+
navigation.path.setValue(navigation.path.getValue().slice(0, -1));
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const index = e.state.index;
|
|
147
|
+
const route = e.state.route;
|
|
148
|
+
if (index < currentLength) {
|
|
149
|
+
navigation.path.setValue(navigation.path.getValue().slice(0, -1));
|
|
150
|
+
} else {
|
|
151
|
+
navigation.path.setValue([...navigation.path.getValue(), route]);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function ok(data) {
|
|
156
|
+
return { isOk: true, data: JSON.stringify(data), errorMessage: null };
|
|
157
|
+
}
|
|
158
|
+
function err(message) {
|
|
159
|
+
return { isOk: false, data: null, errorMessage: message };
|
|
160
|
+
}
|
|
161
|
+
function getOrigin() {
|
|
162
|
+
if (typeof window !== "undefined" && window.location) {
|
|
163
|
+
return window.location.origin;
|
|
164
|
+
}
|
|
165
|
+
return "";
|
|
166
|
+
}
|
|
167
|
+
var syncHandlers = {
|
|
168
|
+
getAppApiOrigin() {
|
|
169
|
+
return { apiOrigin: getOrigin() };
|
|
170
|
+
},
|
|
171
|
+
cacheGet({ key }) {
|
|
172
|
+
try {
|
|
173
|
+
if (typeof window !== "undefined" && window.localStorage && key) {
|
|
174
|
+
return { data: window.localStorage.getItem(key) };
|
|
175
|
+
}
|
|
176
|
+
return { data: null };
|
|
177
|
+
} catch {
|
|
178
|
+
return { data: null };
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
cacheSet({ key, data }) {
|
|
182
|
+
try {
|
|
183
|
+
if (typeof window !== "undefined" && window.localStorage && key != null) {
|
|
184
|
+
if (data == null) {
|
|
185
|
+
window.localStorage.removeItem(key);
|
|
186
|
+
} else {
|
|
187
|
+
window.localStorage.setItem(key, data);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
} catch {
|
|
191
|
+
}
|
|
192
|
+
return {};
|
|
193
|
+
},
|
|
194
|
+
routerPush(route) {
|
|
195
|
+
navigation.push(route);
|
|
196
|
+
return {};
|
|
197
|
+
},
|
|
198
|
+
routerPop() {
|
|
199
|
+
navigation.pop();
|
|
200
|
+
return {};
|
|
201
|
+
},
|
|
202
|
+
routerGetCurrent() {
|
|
203
|
+
return navigation.getCurrent();
|
|
204
|
+
},
|
|
205
|
+
setNavigationBarData() {
|
|
206
|
+
return {};
|
|
207
|
+
},
|
|
208
|
+
routerPresentSheet({ path, params }) {
|
|
209
|
+
navigation.presentSheet({
|
|
210
|
+
path: Array.from(path ?? []),
|
|
211
|
+
params: params ?? {}
|
|
212
|
+
});
|
|
213
|
+
return {};
|
|
214
|
+
},
|
|
215
|
+
routerDismissSheet() {
|
|
216
|
+
navigation.dismissSheet();
|
|
217
|
+
return {};
|
|
218
|
+
},
|
|
219
|
+
routerGetCurrentSheet() {
|
|
220
|
+
return navigation.getCurrentSheet() ?? null;
|
|
221
|
+
},
|
|
222
|
+
downgradeToWebView() {
|
|
223
|
+
return {};
|
|
224
|
+
},
|
|
225
|
+
getHostAppDetails() {
|
|
226
|
+
return {
|
|
227
|
+
build: "web",
|
|
228
|
+
version: "0.0.0",
|
|
229
|
+
platform: "web",
|
|
230
|
+
buildType: "appstore"
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
var iframeModulePromise = null;
|
|
235
|
+
async function loadIframeModule() {
|
|
236
|
+
if (!iframeModulePromise) {
|
|
237
|
+
iframeModulePromise = import("@whop/iframe");
|
|
238
|
+
}
|
|
239
|
+
return await iframeModulePromise;
|
|
240
|
+
}
|
|
241
|
+
var iframeSdk = null;
|
|
242
|
+
async function loadIframeSdk() {
|
|
243
|
+
if (!iframeSdk) {
|
|
244
|
+
const module2 = await loadIframeModule();
|
|
245
|
+
iframeSdk = module2.createSdk({
|
|
246
|
+
appId: process.env.NEXT_PUBLIC_WHOP_APP_ID
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
return iframeSdk;
|
|
250
|
+
}
|
|
251
|
+
var asyncHandlers = {
|
|
252
|
+
inAppPurchase: async ({ planId, id }) => {
|
|
253
|
+
const sdk = await loadIframeSdk();
|
|
254
|
+
const result = await sdk.inAppPurchase({ planId, id: id ?? void 0 });
|
|
255
|
+
if (result.status === "ok") {
|
|
256
|
+
return {
|
|
257
|
+
sessionId: result.data.sessionId,
|
|
258
|
+
receiptId: result.data.receiptId
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
throw new Error(result.error);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
var nativeWhopCoreStub = {
|
|
265
|
+
execSync(name, paramsJson) {
|
|
266
|
+
try {
|
|
267
|
+
const params = paramsJson ? JSON.parse(paramsJson) : {};
|
|
268
|
+
const handler = syncHandlers[name];
|
|
269
|
+
if (!handler) return err(`Unknown sync method: ${name}`);
|
|
270
|
+
const result = handler(params);
|
|
271
|
+
return ok(result);
|
|
272
|
+
} catch (e) {
|
|
273
|
+
return err(e instanceof Error ? e.message : "Unknown error");
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
async execAsync(name, paramsJson) {
|
|
277
|
+
try {
|
|
278
|
+
const params = paramsJson ? JSON.parse(paramsJson) : {};
|
|
279
|
+
const handler = asyncHandlers[name];
|
|
280
|
+
if (!handler) return err(`Unknown async method: ${name}`);
|
|
281
|
+
const result = await handler(params);
|
|
282
|
+
return ok(result);
|
|
283
|
+
} catch (e) {
|
|
284
|
+
return err(e instanceof Error ? e.message : "Unknown error");
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
var native_whop_core_stub_default = nativeWhopCoreStub;
|
|
289
|
+
|
|
290
|
+
// src/lib/native-whop-core.ts
|
|
291
|
+
function resolveNative() {
|
|
292
|
+
try {
|
|
293
|
+
const registry = import_react_native2.TurboModuleRegistry;
|
|
294
|
+
const get = registry?.getEnforcing ?? registry?.get;
|
|
295
|
+
if (typeof get === "function") {
|
|
296
|
+
return get.call(registry, "NativeWhopCore");
|
|
297
|
+
}
|
|
298
|
+
return null;
|
|
299
|
+
} catch {
|
|
300
|
+
return null;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
var native = resolveNative();
|
|
304
|
+
var native_whop_core_default = native ?? native_whop_core_stub_default;
|
|
42
305
|
|
|
43
306
|
// src/lib/native-whop-core-wrapper.ts
|
|
44
307
|
function __internal_execSync(name, params) {
|
|
@@ -62,13 +325,13 @@ async function __internal_execAsync(name, params) {
|
|
|
62
325
|
// src/lib/client-sdk.ts
|
|
63
326
|
__reExport(client_sdk_exports, require("@whop/api"));
|
|
64
327
|
function getAppOrigin() {
|
|
65
|
-
if (
|
|
328
|
+
if (import_react_native3.Platform.OS === "android" || import_react_native3.Platform.OS === "ios") {
|
|
66
329
|
return __internal_execSync("getAppApiOrigin", {}).apiOrigin;
|
|
67
330
|
}
|
|
68
|
-
if (
|
|
331
|
+
if (import_react_native3.Platform.OS === "web" && typeof window !== "undefined") {
|
|
69
332
|
return window.location.origin;
|
|
70
333
|
}
|
|
71
|
-
throw new Error(`Unsupported platform: ${
|
|
334
|
+
throw new Error(`Unsupported platform: ${import_react_native3.Platform.OS}`);
|
|
72
335
|
}
|
|
73
336
|
var appOrigin = getAppOrigin();
|
|
74
337
|
var whopSdk = (0, import_api.WhopClientSdk)({
|
|
@@ -78,8 +341,45 @@ var whopSdk = (0, import_api.WhopClientSdk)({
|
|
|
78
341
|
|
|
79
342
|
// src/lib/index.ts
|
|
80
343
|
__reExport(lib_exports, client_sdk_exports, module.exports);
|
|
344
|
+
|
|
345
|
+
// src/lib/haptics.ts
|
|
346
|
+
var nativeModule = null;
|
|
347
|
+
var loadingPromise = null;
|
|
348
|
+
async function ensureNativeLoaded() {
|
|
349
|
+
const isWeb = typeof document !== "undefined" && typeof window !== "undefined";
|
|
350
|
+
if (isWeb) return;
|
|
351
|
+
if (nativeModule || loadingPromise) {
|
|
352
|
+
return loadingPromise ?? Promise.resolve();
|
|
353
|
+
}
|
|
354
|
+
loadingPromise = import("react-native-haptic-feedback").then((mod) => {
|
|
355
|
+
nativeModule = { trigger: mod.default.trigger };
|
|
356
|
+
}).catch(() => {
|
|
357
|
+
}).finally(() => {
|
|
358
|
+
loadingPromise = null;
|
|
359
|
+
});
|
|
360
|
+
return loadingPromise;
|
|
361
|
+
}
|
|
362
|
+
var HAPTIC_NOOP = {
|
|
363
|
+
trigger: (_type, _options) => {
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
var Haptics = {
|
|
367
|
+
async trigger(type, options) {
|
|
368
|
+
await ensureNativeLoaded();
|
|
369
|
+
if (nativeModule) {
|
|
370
|
+
try {
|
|
371
|
+
nativeModule.trigger(type, options);
|
|
372
|
+
} catch {
|
|
373
|
+
}
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
HAPTIC_NOOP.trigger(type, options);
|
|
377
|
+
}
|
|
378
|
+
};
|
|
379
|
+
var haptics_default = Haptics;
|
|
81
380
|
// Annotate the CommonJS export names for ESM import in node:
|
|
82
381
|
0 && (module.exports = {
|
|
382
|
+
Haptics,
|
|
83
383
|
__internal_execAsync,
|
|
84
384
|
__internal_execSync,
|
|
85
385
|
whopSdk
|
package/dist/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/index.ts","../../src/lib/client-sdk.ts","../../src/lib/native-whop-core.ts","../../src/lib/native-whop-core-wrapper.ts"],"sourcesContent":["export * from \"./client-sdk\";\nexport * from \"./native-whop-core-wrapper\";\nexport * from \"./props\";\n","import { WhopClientSdk } from \"@whop/api\";\nimport { Platform } from \"react-native\";\nimport { __internal_execSync } from \"./native-whop-core-wrapper\";\n\nfunction getAppOrigin() {\n\tif (Platform.OS === \"android\" || Platform.OS === \"ios\") {\n\t\treturn __internal_execSync(\"getAppApiOrigin\", {}).apiOrigin;\n\t}\n\n\tif (Platform.OS === \"web\" && typeof window !== \"undefined\") {\n\t\treturn window.location.origin;\n\t}\n\n\tthrow new Error(`Unsupported platform: ${Platform.OS}`);\n}\n\nconst appOrigin = getAppOrigin();\n\nexport const whopSdk: WhopClientSdk = WhopClientSdk({\n\tapiOrigin: appOrigin,\n\tapiPath: \"/_whop/public-graphql/\",\n});\n\nexport * from \"@whop/api\";\n","import type { TurboModule } from \"react-native\";\nimport { TurboModuleRegistry } from \"react-native\";\n\nexport type FunctionCallResult = {\n\tisOk: boolean;\n\tdata: string | null;\n\terrorMessage: string | null;\n};\n\nexport interface Spec extends TurboModule {\n\texecSync(name: string, paramsJson: string): FunctionCallResult;\n\texecAsync(name: string, paramsJson: string): Promise<FunctionCallResult>;\n}\n\nexport default TurboModuleRegistry.getEnforcing<Spec>(\"NativeWhopCore\");\n","import nativeWhopCore from \"./native-whop-core\";\nimport type { PathParams } from \"./props\";\n\n// biome-ignore lint/complexity/noBannedTypes: allow here\ntype EmptyObject = {};\n\nexport interface ExecSyncApi {\n\tgetAppApiOrigin(params: EmptyObject): { apiOrigin: string };\n\tcacheGet(params: { key?: string | null }): { data?: string | null };\n\tcacheSet(params: { key?: string | null; data?: string | null }): EmptyObject;\n\trouterPush(params: PathParams): EmptyObject;\n\trouterPop(params: EmptyObject): EmptyObject;\n\trouterGetCurrent(params: EmptyObject): PathParams;\n\tsetNavigationBarData(params: {\n\t\ttitle?: string | null;\n\t\tdescription?: string | null;\n\t}): EmptyObject;\n\trouterPresentSheet(params: PathParams): EmptyObject;\n\trouterDismissSheet(params: EmptyObject): EmptyObject;\n\trouterGetCurrentSheet(params: EmptyObject): PathParams | null | undefined;\n\tdowngradeToWebView(params: EmptyObject): EmptyObject;\n\tgetHostAppDetails(params: EmptyObject): {\n\t\tbuild: string;\n\t\tversion: string;\n\t\tplatform: \"ios\" | \"android\" | \"web\";\n\t\tbuildType: \"appstore\" | \"testflight\" | \"debug\";\n\t};\n}\n\nexport interface ExecAsyncApi extends ExecSyncApi {\n\tinAppPurchase(params: {\n\t\tid?: string | null;\n\t\tplanId: string;\n\t}): {\n\t\tsessionId: string;\n\t\treceiptId: string;\n\t};\n}\n\nexport function __internal_execSync<F extends keyof ExecSyncApi>(\n\tname: F,\n\tparams: Parameters<ExecSyncApi[F]>[0],\n): ReturnType<ExecSyncApi[F]> {\n\tconst resultJson = nativeWhopCore.execSync(name, JSON.stringify(params));\n\tif (!resultJson.isOk) {\n\t\tthrow new Error(`Failed to execute ${name}: ${resultJson.errorMessage}`);\n\t}\n\n\treturn JSON.parse(resultJson.data || \"{}\") as ReturnType<ExecSyncApi[F]>;\n}\n\nexport async function __internal_execAsync<F extends keyof ExecAsyncApi>(\n\tname: F,\n\tparams: Parameters<ExecAsyncApi[F]>[0],\n): Promise<ReturnType<ExecAsyncApi[F]>> {\n\tconst resultJson = await nativeWhopCore.execAsync(\n\t\tname,\n\t\tJSON.stringify(params),\n\t);\n\n\tif (!resultJson.isOk) {\n\t\tthrow new Error(`Failed to execute ${name}: ${resultJson.errorMessage}`);\n\t}\n\n\treturn JSON.parse(resultJson.data || \"{}\") as ReturnType<ExecAsyncApi[F]>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA,iBAA8B;AAC9B,IAAAA,uBAAyB;;;ACAzB,0BAAoC;AAapC,IAAO,2BAAQ,wCAAoB,aAAmB,gBAAgB;;;ACyB/D,SAAS,oBACf,MACA,QAC6B;AAC7B,QAAM,aAAa,yBAAe,SAAS,MAAM,KAAK,UAAU,MAAM,CAAC;AACvE,MAAI,CAAC,WAAW,MAAM;AACrB,UAAM,IAAI,MAAM,qBAAqB,IAAI,KAAK,WAAW,YAAY,EAAE;AAAA,EACxE;AAEA,SAAO,KAAK,MAAM,WAAW,QAAQ,IAAI;AAC1C;AAEA,eAAsB,qBACrB,MACA,QACuC;AACvC,QAAM,aAAa,MAAM,yBAAe;AAAA,IACvC;AAAA,IACA,KAAK,UAAU,MAAM;AAAA,EACtB;AAEA,MAAI,CAAC,WAAW,MAAM;AACrB,UAAM,IAAI,MAAM,qBAAqB,IAAI,KAAK,WAAW,YAAY,EAAE;AAAA,EACxE;AAEA,SAAO,KAAK,MAAM,WAAW,QAAQ,IAAI;AAC1C;;;AF1CA,+BAAc;AAnBd,SAAS,eAAe;AACvB,MAAI,8BAAS,OAAO,aAAa,8BAAS,OAAO,OAAO;AACvD,WAAO,oBAAoB,mBAAmB,CAAC,CAAC,EAAE;AAAA,EACnD;AAEA,MAAI,8BAAS,OAAO,SAAS,OAAO,WAAW,aAAa;AAC3D,WAAO,OAAO,SAAS;AAAA,EACxB;AAEA,QAAM,IAAI,MAAM,yBAAyB,8BAAS,EAAE,EAAE;AACvD;AAEA,IAAM,YAAY,aAAa;AAExB,IAAM,cAAyB,0BAAc;AAAA,EACnD,WAAW;AAAA,EACX,SAAS;AACV,CAAC;;;ADrBD,wBAAc,oBAAd;","names":["import_react_native"]}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/index.ts","../../src/lib/client-sdk.ts","../../src/lib/native-whop-core.ts","../../src/lib/native-whop-core-stub.ts","../../src/lib/native-whop-core-wrapper.ts","../../src/lib/haptics.ts"],"sourcesContent":["export * from \"./client-sdk\";\nexport * from \"./native-whop-core-wrapper\";\nexport * from \"./props\";\nimport Haptics from \"./haptics\";\n\nexport { Haptics };\n","import { WhopClientSdk } from \"@whop/api\";\nimport { Platform } from \"react-native\";\nimport { __internal_execSync } from \"./native-whop-core-wrapper\";\n\nfunction getAppOrigin() {\n\tif (Platform.OS === \"android\" || Platform.OS === \"ios\") {\n\t\treturn __internal_execSync(\"getAppApiOrigin\", {}).apiOrigin;\n\t}\n\n\tif (Platform.OS === \"web\" && typeof window !== \"undefined\") {\n\t\treturn window.location.origin;\n\t}\n\n\tthrow new Error(`Unsupported platform: ${Platform.OS}`);\n}\n\nconst appOrigin = getAppOrigin();\n\nexport const whopSdk: WhopClientSdk = WhopClientSdk({\n\tapiOrigin: appOrigin,\n\tapiPath: \"/_whop/public-graphql/\",\n});\n\nexport * from \"@whop/api\";\n","import type { TurboModule } from \"react-native\";\nimport { TurboModuleRegistry } from \"react-native\";\nimport stub from \"./native-whop-core-stub\";\n\nexport type FunctionCallResult = {\n\tisOk: boolean;\n\tdata: string | null;\n\terrorMessage: string | null;\n};\n\nexport interface Spec extends TurboModule {\n\texecSync(name: string, paramsJson: string): FunctionCallResult;\n\texecAsync(name: string, paramsJson: string): Promise<FunctionCallResult>;\n}\n\nfunction resolveNative(): Spec | null {\n\ttry {\n\t\t// biome-ignore lint/suspicious/noExplicitAny: <explanation>\n\t\tconst registry: any = TurboModuleRegistry as any;\n\t\tconst get = registry?.getEnforcing ?? registry?.get;\n\t\tif (typeof get === \"function\") {\n\t\t\treturn get.call(registry, \"NativeWhopCore\") as Spec;\n\t\t}\n\t\treturn null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nconst native = resolveNative();\n\nexport default native ?? (stub as Spec);\n","import { Platform } from \"react-native\";\nimport type { ExecAsyncApi, ExecSyncApi } from \"./native-whop-core-wrapper\";\n\nexport type FunctionCallResult = {\n\tisOk: boolean;\n\tdata: string | null;\n\terrorMessage: string | null;\n};\n\ntype Route = { path: string[]; params: Record<string, string> };\n\nclass WhopCoreObservable<T> {\n\tprivate subscribers: Set<(value: T) => void> = new Set();\n\tprivate value: T;\n\n\tconstructor(value: T) {\n\t\tthis.value = value;\n\t}\n\n\tsetValue(value: T) {\n\t\tthis.value = value;\n\t\tfor (const callback of this.subscribers) {\n\t\t\tcallback(value);\n\t\t}\n\t}\n\n\tgetValue() {\n\t\treturn this.value;\n\t}\n\n\tsubscribe(callback: (value: T) => void) {\n\t\tthis.subscribers.add(callback);\n\t\treturn () => {\n\t\t\tthis.subscribers.delete(callback);\n\t\t};\n\t}\n}\n\nclass WhopCoreNavigation {\n\tpublic path = new WhopCoreObservable<Route[]>([]);\n\tpublic sheet = new WhopCoreObservable<Route | null>(null);\n\n\tconstructor() {\n\t\tthis.getFullStack = this.getFullStack.bind(this);\n\t\tthis.getCurrentSheet = this.getCurrentSheet.bind(this);\n\t\tthis.subscribeToPath = this.subscribeToPath.bind(this);\n\t\tthis.subscribeToSheet = this.subscribeToSheet.bind(this);\n\t}\n\n\tpush(route: Route) {\n\t\tif (this.getCurrent().path.join(\"/\") === route.path.join(\"/\")) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.path.setValue([...this.path.getValue(), route]);\n\t\tif (typeof window !== \"undefined\" && window.history) {\n\t\t\ttry {\n\t\t\t\tconst pathBits = route.path.join(\"/\");\n\t\t\t\tconst paramsBits = Object.entries(route.params)\n\t\t\t\t\t.map(([key, value]) => `${key}=${value}`)\n\t\t\t\t\t.join(\"&\");\n\t\t\t\twindow.history.pushState(\n\t\t\t\t\t{ route, index: this.path.getValue().length },\n\t\t\t\t\t\"\",\n\t\t\t\t\t`#${pathBits}?${paramsBits}`,\n\t\t\t\t);\n\t\t\t} catch {}\n\t\t}\n\t}\n\n\tpop() {\n\t\tif (typeof window !== \"undefined\" && window.history) {\n\t\t\ttry {\n\t\t\t\twindow.history.back();\n\t\t\t} catch {}\n\t\t}\n\t}\n\n\tgetFullStack() {\n\t\treturn this.path.getValue();\n\t}\n\n\tgetCurrent() {\n\t\treturn (\n\t\t\tthis.path.getValue()[this.path.getValue().length - 1] ?? {\n\t\t\t\tpath: [],\n\t\t\t\tparams: {},\n\t\t\t}\n\t\t);\n\t}\n\n\tpresentSheet(route: Route) {\n\t\tthis.sheet.setValue(route);\n\t}\n\n\tdismissSheet() {\n\t\tthis.sheet.setValue(null);\n\t}\n\n\tgetCurrentSheet() {\n\t\treturn this.sheet.getValue() ?? null;\n\t}\n\n\tsubscribeToPath(callback: (route: Route[]) => void) {\n\t\treturn this.path.subscribe(callback);\n\t}\n\n\tsubscribeToSheet(callback: (route: Route | null) => void) {\n\t\treturn this.sheet.subscribe(callback);\n\t}\n}\n\nexport type TWhopCoreNavigation = WhopCoreNavigation;\n\nconst navigation = new WhopCoreNavigation();\nif (typeof window !== \"undefined\" && Platform.OS === \"web\") {\n\t// biome-ignore lint/suspicious/noExplicitAny: <explanation>\n\t(window as any).whopCoreNavigation = navigation;\n\n\twindow.addEventListener(\"popstate\", (e) => {\n\t\tconst currentLength = navigation.path.getValue().length;\n\t\tif (!e.state) {\n\t\t\tnavigation.path.setValue(navigation.path.getValue().slice(0, -1));\n\t\t\treturn;\n\t\t}\n\t\tconst index = e.state.index;\n\t\tconst route = e.state.route;\n\t\tif (index < currentLength) {\n\t\t\tnavigation.path.setValue(navigation.path.getValue().slice(0, -1));\n\t\t} else {\n\t\t\tnavigation.path.setValue([...navigation.path.getValue(), route]);\n\t\t}\n\t});\n}\n\nfunction ok(data: unknown): FunctionCallResult {\n\treturn { isOk: true, data: JSON.stringify(data), errorMessage: null };\n}\n\nfunction err(message: string): FunctionCallResult {\n\treturn { isOk: false, data: null, errorMessage: message };\n}\n\nfunction getOrigin(): string {\n\tif (typeof window !== \"undefined\" && window.location) {\n\t\treturn window.location.origin;\n\t}\n\treturn \"\";\n}\n\nconst syncHandlers: ExecSyncApi = {\n\tgetAppApiOrigin() {\n\t\treturn { apiOrigin: getOrigin() };\n\t},\n\tcacheGet({ key }: { key?: string | null }) {\n\t\ttry {\n\t\t\tif (typeof window !== \"undefined\" && window.localStorage && key) {\n\t\t\t\treturn { data: window.localStorage.getItem(key) };\n\t\t\t}\n\t\t\treturn { data: null };\n\t\t} catch {\n\t\t\treturn { data: null };\n\t\t}\n\t},\n\tcacheSet({ key, data }: { key?: string | null; data?: string | null }) {\n\t\ttry {\n\t\t\tif (typeof window !== \"undefined\" && window.localStorage && key != null) {\n\t\t\t\tif (data == null) {\n\t\t\t\t\twindow.localStorage.removeItem(key);\n\t\t\t\t} else {\n\t\t\t\t\twindow.localStorage.setItem(key, data);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch {}\n\t\treturn {};\n\t},\n\trouterPush(route: Route) {\n\t\tnavigation.push(route);\n\t\treturn {};\n\t},\n\trouterPop() {\n\t\tnavigation.pop();\n\t\treturn {};\n\t},\n\trouterGetCurrent() {\n\t\treturn navigation.getCurrent();\n\t},\n\tsetNavigationBarData() {\n\t\treturn {};\n\t},\n\trouterPresentSheet({ path, params }: Route) {\n\t\tnavigation.presentSheet({\n\t\t\tpath: Array.from(path ?? []),\n\t\t\tparams: params ?? {},\n\t\t});\n\t\treturn {};\n\t},\n\trouterDismissSheet() {\n\t\tnavigation.dismissSheet();\n\t\treturn {};\n\t},\n\trouterGetCurrentSheet() {\n\t\treturn navigation.getCurrentSheet() ?? null;\n\t},\n\tdowngradeToWebView() {\n\t\treturn {};\n\t},\n\tgetHostAppDetails() {\n\t\treturn {\n\t\t\tbuild: \"web\",\n\t\t\tversion: \"0.0.0\",\n\t\t\tplatform: \"web\",\n\t\t\tbuildType: \"appstore\",\n\t\t};\n\t},\n};\n\nlet iframeModulePromise: Promise<typeof import(\"@whop/iframe\")> | null = null;\n\nasync function loadIframeModule() {\n\tif (!iframeModulePromise) {\n\t\tiframeModulePromise = import(\"@whop/iframe\");\n\t}\n\treturn await iframeModulePromise;\n}\n\nlet iframeSdk: ReturnType<typeof import(\"@whop/iframe\").createSdk> | null =\n\tnull;\n\nasync function loadIframeSdk() {\n\tif (!iframeSdk) {\n\t\tconst module = await loadIframeModule();\n\t\tiframeSdk = module.createSdk({\n\t\t\tappId: process.env.NEXT_PUBLIC_WHOP_APP_ID,\n\t\t});\n\t}\n\treturn iframeSdk;\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: <explanation>\ntype MakeAsync<T extends Record<string, any>> = {\n\t[K in keyof T]: (params: Parameters<T[K]>[0]) => Promise<ReturnType<T[K]>>;\n};\n\nconst asyncHandlers: MakeAsync<Pick<ExecAsyncApi, \"inAppPurchase\">> = {\n\tinAppPurchase: async ({ planId, id }) => {\n\t\tconst sdk = await loadIframeSdk();\n\t\tconst result = await sdk.inAppPurchase({ planId, id: id ?? undefined });\n\t\tif (result.status === \"ok\") {\n\t\t\treturn {\n\t\t\t\tsessionId: result.data.sessionId,\n\t\t\t\treceiptId: result.data.receiptId,\n\t\t\t};\n\t\t}\n\t\tthrow new Error(result.error);\n\t},\n};\n\nconst nativeWhopCoreStub = {\n\texecSync(name: string, paramsJson: string): FunctionCallResult {\n\t\ttry {\n\t\t\tconst params = paramsJson ? JSON.parse(paramsJson) : {};\n\t\t\tconst handler = syncHandlers[name as keyof typeof syncHandlers];\n\t\t\tif (!handler) return err(`Unknown sync method: ${name}`);\n\t\t\tconst result = handler(params);\n\t\t\treturn ok(result);\n\t\t} catch (e) {\n\t\t\treturn err(e instanceof Error ? e.message : \"Unknown error\");\n\t\t}\n\t},\n\tasync execAsync(\n\t\tname: string,\n\t\tparamsJson: string,\n\t): Promise<FunctionCallResult> {\n\t\ttry {\n\t\t\tconst params = paramsJson ? JSON.parse(paramsJson) : {};\n\t\t\tconst handler = (\n\t\t\t\tasyncHandlers as Record<string, (p: unknown) => Promise<unknown>>\n\t\t\t)[name];\n\t\t\tif (!handler) return err(`Unknown async method: ${name}`);\n\t\t\tconst result = await handler(params);\n\t\t\treturn ok(result);\n\t\t} catch (e) {\n\t\t\treturn err(e instanceof Error ? e.message : \"Unknown error\");\n\t\t}\n\t},\n};\n\nexport default nativeWhopCoreStub;\n","import nativeWhopCore from \"./native-whop-core\";\nimport type { PathParams } from \"./props\";\n\n// biome-ignore lint/complexity/noBannedTypes: allow here\ntype EmptyObject = {};\n\nexport interface ExecSyncApi {\n\tgetAppApiOrigin(params: EmptyObject): { apiOrigin: string };\n\tcacheGet(params: { key?: string | null }): { data?: string | null };\n\tcacheSet(params: { key?: string | null; data?: string | null }): EmptyObject;\n\trouterPush(params: PathParams): EmptyObject;\n\trouterPop(params: EmptyObject): EmptyObject;\n\trouterGetCurrent(params: EmptyObject): PathParams;\n\tsetNavigationBarData(params: {\n\t\ttitle?: string | null;\n\t\tdescription?: string | null;\n\t}): EmptyObject;\n\trouterPresentSheet(params: PathParams): EmptyObject;\n\trouterDismissSheet(params: EmptyObject): EmptyObject;\n\trouterGetCurrentSheet(params: EmptyObject): PathParams | null | undefined;\n\tdowngradeToWebView(params: EmptyObject): EmptyObject;\n\tgetHostAppDetails(params: EmptyObject): {\n\t\tbuild: string;\n\t\tversion: string;\n\t\tplatform: \"ios\" | \"android\" | \"web\";\n\t\tbuildType: \"appstore\" | \"testflight\" | \"debug\";\n\t};\n}\n\nexport interface ExecAsyncApi extends ExecSyncApi {\n\tinAppPurchase(params: {\n\t\tid?: string | null;\n\t\tplanId: string;\n\t}): {\n\t\tsessionId: string;\n\t\treceiptId: string;\n\t};\n}\n\nexport function __internal_execSync<F extends keyof ExecSyncApi>(\n\tname: F,\n\tparams: Parameters<ExecSyncApi[F]>[0],\n): ReturnType<ExecSyncApi[F]> {\n\tconst resultJson = nativeWhopCore.execSync(name, JSON.stringify(params));\n\tif (!resultJson.isOk) {\n\t\tthrow new Error(`Failed to execute ${name}: ${resultJson.errorMessage}`);\n\t}\n\n\treturn JSON.parse(resultJson.data || \"{}\") as ReturnType<ExecSyncApi[F]>;\n}\n\nexport async function __internal_execAsync<F extends keyof ExecAsyncApi>(\n\tname: F,\n\tparams: Parameters<ExecAsyncApi[F]>[0],\n): Promise<ReturnType<ExecAsyncApi[F]>> {\n\tconst resultJson = await nativeWhopCore.execAsync(\n\t\tname,\n\t\tJSON.stringify(params),\n\t);\n\n\tif (!resultJson.isOk) {\n\t\tthrow new Error(`Failed to execute ${name}: ${resultJson.errorMessage}`);\n\t}\n\n\treturn JSON.parse(resultJson.data || \"{}\") as ReturnType<ExecAsyncApi[F]>;\n}\n","/**\n * Web-safe wrapper for react-native-haptic-feedback.\n * - Lazily imports the native module only in native environments.\n * - Provides a no-op fallback on web to avoid runtime crashes.\n */\n\ntype HapticType =\n\t| \"selection\"\n\t| \"impactLight\"\n\t| \"impactMedium\"\n\t| \"impactHeavy\"\n\t| \"notificationSuccess\"\n\t| \"notificationWarning\"\n\t| \"notificationError\";\n\ntype HapticOptions = {\n\tenableVibrateFallback?: boolean;\n\tignoreAndroidSystemSettings?: boolean;\n};\n\n// Singleton holder for the native module once loaded\nlet nativeModule: {\n\ttrigger: (type: HapticType, options?: HapticOptions) => void;\n} | null = null;\nlet loadingPromise: Promise<void> | null = null;\n\nasync function ensureNativeLoaded(): Promise<void> {\n\t// If on web, skip loading entirely\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore - process may not be typed in RN web builds\n\tconst isWeb =\n\t\ttypeof document !== \"undefined\" && typeof window !== \"undefined\";\n\tif (isWeb) return;\n\n\tif (nativeModule || loadingPromise) {\n\t\treturn loadingPromise ?? Promise.resolve();\n\t}\n\n\tloadingPromise = import(\"react-native-haptic-feedback\")\n\t\t.then((mod) => {\n\t\t\tnativeModule = { trigger: mod.default.trigger };\n\t\t})\n\t\t.catch(() => {\n\t\t\t// Keep nativeModule null; fall back to noop\n\t\t})\n\t\t.finally(() => {\n\t\t\tloadingPromise = null;\n\t\t});\n\n\treturn loadingPromise;\n}\n\nconst HAPTIC_NOOP = {\n\ttrigger: (_type: HapticType, _options?: HapticOptions) => {\n\t\t// no-op on web\n\t},\n};\n\nconst Haptics = {\n\tasync trigger(type: HapticType, options?: HapticOptions): Promise<void> {\n\t\tawait ensureNativeLoaded();\n\t\tif (nativeModule) {\n\t\t\ttry {\n\t\t\t\tnativeModule.trigger(type, options);\n\t\t\t} catch {\n\t\t\t\t// ignore\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tHAPTIC_NOOP.trigger(type, options);\n\t},\n};\n\nexport default Haptics;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA,iBAA8B;AAC9B,IAAAA,uBAAyB;;;ACAzB,IAAAC,uBAAoC;;;ACDpC,0BAAyB;AAWzB,IAAM,qBAAN,MAA4B;AAAA,EACnB,cAAuC,oBAAI,IAAI;AAAA,EAC/C;AAAA,EAER,YAAY,OAAU;AACrB,SAAK,QAAQ;AAAA,EACd;AAAA,EAEA,SAAS,OAAU;AAClB,SAAK,QAAQ;AACb,eAAW,YAA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