@apps-in-toss/framework 1.2.2 → 1.4.0
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/index.cjs +1037 -892
- package/dist/index.js +800 -638
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -34,13 +34,13 @@ __export(src_exports, {
|
|
|
34
34
|
Analytics: () => Analytics2,
|
|
35
35
|
AppsInToss: () => AppsInToss,
|
|
36
36
|
INTERNAL__onVisibilityChangedByTransparentServiceWeb: () => INTERNAL__onVisibilityChangedByTransparentServiceWeb,
|
|
37
|
-
OverlayProvider: () =>
|
|
37
|
+
OverlayProvider: () => import_private10.OverlayProvider,
|
|
38
38
|
WebView: () => WebView,
|
|
39
39
|
env: () => env,
|
|
40
40
|
useCreateUserAgent: () => useCreateUserAgent,
|
|
41
41
|
useGeolocation: () => useGeolocation,
|
|
42
|
-
useOverlay: () =>
|
|
43
|
-
useTopNavigation: () =>
|
|
42
|
+
useOverlay: () => import_private10.useOverlay,
|
|
43
|
+
useTopNavigation: () => import_private10.useTopNavigation,
|
|
44
44
|
useWaitForReturnNavigator: () => useWaitForReturnNavigator
|
|
45
45
|
});
|
|
46
46
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -48,10 +48,10 @@ var import_analytics2 = require("@apps-in-toss/analytics");
|
|
|
48
48
|
|
|
49
49
|
// src/core/registerApp.tsx
|
|
50
50
|
var import_analytics = require("@apps-in-toss/analytics");
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
51
|
+
var import_native_modules13 = require("@apps-in-toss/native-modules");
|
|
52
|
+
var import_react_native21 = require("@granite-js/react-native");
|
|
53
|
+
var import_tds_react_native10 = require("@toss/tds-react-native");
|
|
54
|
+
var import_react_native22 = require("react-native");
|
|
55
55
|
|
|
56
56
|
// src/core/components/AppEvent.tsx
|
|
57
57
|
var import_native_modules2 = require("@apps-in-toss/native-modules");
|
|
@@ -217,14 +217,12 @@ function useAppsInTossBridge() {
|
|
|
217
217
|
const controller = (0, import_tds_react_native.useBridge)();
|
|
218
218
|
const appsInTossGlobals = getAppsInTossGlobals();
|
|
219
219
|
(0, import_react5.useEffect)(() => {
|
|
220
|
-
const
|
|
220
|
+
const isGameApp = appsInTossGlobals.webViewType === "game" || appsInTossGlobals.appType === "game";
|
|
221
|
+
controller.open({
|
|
221
222
|
serviceName: appsInTossGlobals.brandDisplayName,
|
|
222
223
|
icon: toIcon(appsInTossGlobals.brandIcon),
|
|
223
224
|
color: appsInTossGlobals.brandPrimaryColor,
|
|
224
|
-
colorMode: appsInTossGlobals.brandBridgeColorMode
|
|
225
|
-
};
|
|
226
|
-
controller.open({
|
|
227
|
-
...commonProps,
|
|
225
|
+
colorMode: isGameApp ? "inverted" : appsInTossGlobals.brandBridgeColorMode,
|
|
228
226
|
onExited: () => {
|
|
229
227
|
import_native_modules3.appsInTossEvent.emit("entryMessageExited", void 0);
|
|
230
228
|
}
|
|
@@ -232,360 +230,763 @@ function useAppsInTossBridge() {
|
|
|
232
230
|
}, []);
|
|
233
231
|
}
|
|
234
232
|
|
|
235
|
-
// src/components/
|
|
236
|
-
var
|
|
233
|
+
// src/components/RNAppContainer.tsx
|
|
234
|
+
var import_native_modules12 = require("@apps-in-toss/native-modules");
|
|
235
|
+
var import_react17 = require("react");
|
|
236
|
+
var import_react_native20 = require("react-native");
|
|
237
|
+
|
|
238
|
+
// src/components/GameInitializer.tsx
|
|
239
|
+
var import_native_modules7 = require("@apps-in-toss/native-modules");
|
|
240
|
+
var import_react_native10 = require("@granite-js/react-native");
|
|
237
241
|
var import_tds_react_native5 = require("@toss/tds-react-native");
|
|
238
|
-
var import_private3 = require("@toss/tds-react-native/private");
|
|
239
242
|
var import_es_hangul = require("es-hangul");
|
|
240
|
-
var
|
|
241
|
-
var
|
|
243
|
+
var import_react11 = require("react");
|
|
244
|
+
var import_react_native11 = require("react-native");
|
|
242
245
|
|
|
243
|
-
// src/
|
|
244
|
-
var
|
|
246
|
+
// src/constant/game-center.ts
|
|
247
|
+
var GAME_PROFILE_WEBVIEW_URL = "servicetoss://game-center/profile";
|
|
248
|
+
var GAME_MIN_VERSION = {
|
|
249
|
+
android: "5.232.0",
|
|
250
|
+
ios: "5.232.0"
|
|
251
|
+
};
|
|
245
252
|
|
|
246
|
-
// src/
|
|
253
|
+
// src/hooks/useAppUpdateDialog.tsx
|
|
247
254
|
var import_native_modules4 = require("@apps-in-toss/native-modules");
|
|
248
|
-
var
|
|
249
|
-
var
|
|
250
|
-
var
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
var
|
|
254
|
-
var
|
|
255
|
-
var
|
|
256
|
-
var
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
255
|
+
var import_react_native7 = require("@granite-js/react-native");
|
|
256
|
+
var import_tds_react_native2 = require("@toss/tds-react-native");
|
|
257
|
+
var import_react6 = require("react");
|
|
258
|
+
|
|
259
|
+
// src/utils/market.ts
|
|
260
|
+
var import_react_native6 = require("react-native");
|
|
261
|
+
var PLAYSTORE_LINK = "https://play.google.com/store/apps/details?id=viva.republica.toss";
|
|
262
|
+
var APPSTORE_LINK = "https://itunes.apple.com/app/id839333328";
|
|
263
|
+
var getMarketLink = () => {
|
|
264
|
+
return import_react_native6.Platform.OS === "android" ? PLAYSTORE_LINK : APPSTORE_LINK;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
// src/hooks/useAppUpdateDialog.tsx
|
|
268
|
+
function useAppUpdateDialog() {
|
|
269
|
+
const { openConfirm } = (0, import_tds_react_native2.useDialog)();
|
|
270
|
+
const logging = useAppUpdateDialogLogging();
|
|
271
|
+
const openAppUpdateDialog = (0, import_react6.useCallback)(
|
|
272
|
+
async ({
|
|
273
|
+
title,
|
|
274
|
+
description,
|
|
275
|
+
leftButton = "\uB2EB\uAE30",
|
|
276
|
+
rightButton = "\uC5C5\uB370\uC774\uD2B8\uD558\uAE30",
|
|
277
|
+
onDismiss
|
|
278
|
+
}) => {
|
|
279
|
+
logging.show();
|
|
280
|
+
const isConfirmed = await openConfirm({
|
|
281
|
+
title,
|
|
282
|
+
description,
|
|
283
|
+
leftButton,
|
|
284
|
+
rightButton,
|
|
285
|
+
closeOnDimmerClick: true
|
|
286
|
+
});
|
|
287
|
+
if (!isConfirmed) {
|
|
288
|
+
logging.close();
|
|
289
|
+
onDismiss?.();
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
logging.update();
|
|
293
|
+
const STORE_SCHEME = getMarketLink();
|
|
294
|
+
(0, import_react_native7.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
|
|
295
|
+
},
|
|
296
|
+
[logging, openConfirm]
|
|
297
|
+
);
|
|
298
|
+
return {
|
|
299
|
+
open: openAppUpdateDialog
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
var UPDATE_DIALOG_SCHEMA_ID = 1634992;
|
|
303
|
+
var UPDATE_DIALOG_LOG_NAME = "appsintoss_app_visit__common_module::bottomsheet__app_update";
|
|
304
|
+
var UPDATE_DIALOG_CTA_CLICK_SCHEMA_ID = 1634996;
|
|
305
|
+
var UPDATE_DIALOG_CTA_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::bottomsheet__app_update::click__cta";
|
|
306
|
+
function useAppUpdateDialogLogging() {
|
|
260
307
|
const referrer = useReferrer();
|
|
261
308
|
const baseParams = {
|
|
262
309
|
referrer,
|
|
263
|
-
app_name:
|
|
264
|
-
};
|
|
265
|
-
const logNavBarImpression = (naviBarConfig) => {
|
|
266
|
-
import_native_modules4.INTERNAL__module.tossCoreEventLog({
|
|
267
|
-
log_name: NAVI_BAR_IMPRESSION_LOG_NAME,
|
|
268
|
-
log_type: "event",
|
|
269
|
-
params: {
|
|
270
|
-
...naviBarConfig,
|
|
271
|
-
...baseParams,
|
|
272
|
-
event_type: "impression",
|
|
273
|
-
schema_id: NAVI_BAR_IMPRESSION_SCHEMA_ID
|
|
274
|
-
}
|
|
275
|
-
});
|
|
310
|
+
app_name: import_react_native7.Granite.appName
|
|
276
311
|
};
|
|
277
|
-
const
|
|
312
|
+
const logUpdateClick = () => {
|
|
278
313
|
import_native_modules4.INTERNAL__module.tossCoreEventLog({
|
|
279
|
-
log_name:
|
|
314
|
+
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
280
315
|
log_type: "event",
|
|
281
316
|
params: {
|
|
282
317
|
...baseParams,
|
|
318
|
+
schema_id: UPDATE_DIALOG_CTA_CLICK_SCHEMA_ID,
|
|
283
319
|
event_type: "click",
|
|
284
|
-
|
|
320
|
+
button_type: "update"
|
|
285
321
|
}
|
|
286
322
|
});
|
|
287
323
|
};
|
|
288
|
-
const
|
|
324
|
+
const logCloseClick = () => {
|
|
289
325
|
import_native_modules4.INTERNAL__module.tossCoreEventLog({
|
|
290
|
-
log_name:
|
|
326
|
+
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
291
327
|
log_type: "event",
|
|
292
328
|
params: {
|
|
293
329
|
...baseParams,
|
|
330
|
+
schema_id: UPDATE_DIALOG_CTA_CLICK_SCHEMA_ID,
|
|
294
331
|
event_type: "click",
|
|
295
|
-
|
|
332
|
+
button_type: "close"
|
|
296
333
|
}
|
|
297
334
|
});
|
|
298
335
|
};
|
|
299
|
-
const
|
|
336
|
+
const logDialogShow = () => {
|
|
300
337
|
import_native_modules4.INTERNAL__module.tossCoreEventLog({
|
|
301
|
-
log_name:
|
|
338
|
+
log_name: UPDATE_DIALOG_LOG_NAME,
|
|
302
339
|
log_type: "popup",
|
|
303
340
|
params: {
|
|
304
341
|
...baseParams,
|
|
305
|
-
schema_id:
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
};
|
|
309
|
-
const logClosePopupCtaClick = (confirm) => {
|
|
310
|
-
import_native_modules4.INTERNAL__module.tossCoreEventLog({
|
|
311
|
-
log_name: CLOSE_POPUP_CTA_CLICK_LOG_NAME,
|
|
312
|
-
log_type: "event",
|
|
313
|
-
params: {
|
|
314
|
-
...baseParams,
|
|
315
|
-
close_yn: confirm ? "Y" : "N",
|
|
316
|
-
schema_id: CLOSE_POPUP_CTA_CLICK_SCHEMA_ID,
|
|
317
|
-
event_type: "click"
|
|
342
|
+
schema_id: UPDATE_DIALOG_SCHEMA_ID
|
|
318
343
|
}
|
|
319
344
|
});
|
|
320
345
|
};
|
|
321
|
-
return {
|
|
322
|
-
navBarImpression: logNavBarImpression,
|
|
323
|
-
closePopupShow: logClosePopupShow,
|
|
324
|
-
closePopupCtaClick: logClosePopupCtaClick,
|
|
325
|
-
closeButtonClick: logCloseButtonClick,
|
|
326
|
-
homeButtonClick: logHomeButtonClick
|
|
327
|
-
};
|
|
346
|
+
return { update: logUpdateClick, close: logCloseClick, show: logDialogShow };
|
|
328
347
|
}
|
|
329
348
|
|
|
330
|
-
// src/
|
|
331
|
-
var
|
|
332
|
-
|
|
333
|
-
children,
|
|
334
|
-
withHomeButton
|
|
335
|
-
}) {
|
|
336
|
-
const hasLogged = (0, import_react6.useRef)(false);
|
|
337
|
-
const logging = useNavigationBarLogging();
|
|
338
|
-
(0, import_react6.useEffect)(() => {
|
|
339
|
-
if (hasLogged.current === false) {
|
|
340
|
-
logging.navBarImpression({ home_icon_yn: withHomeButton ? "Y" : "N" });
|
|
341
|
-
hasLogged.current = true;
|
|
342
|
-
}
|
|
343
|
-
}, [logging, withHomeButton]);
|
|
344
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children });
|
|
345
|
-
}
|
|
349
|
+
// src/hooks/useGameCenterProfile.ts
|
|
350
|
+
var import_native_modules6 = require("@apps-in-toss/native-modules");
|
|
351
|
+
var import_react10 = require("react");
|
|
346
352
|
|
|
347
|
-
// src/
|
|
348
|
-
var
|
|
349
|
-
var
|
|
350
|
-
var
|
|
351
|
-
|
|
353
|
+
// src/hooks/useErrorAlert.ts
|
|
354
|
+
var import_react_native8 = require("@granite-js/react-native");
|
|
355
|
+
var import_tds_react_native3 = require("@toss/tds-react-native");
|
|
356
|
+
var import_react7 = require("react");
|
|
357
|
+
|
|
358
|
+
// src/utils/error.ts
|
|
359
|
+
var DEFAULT_ERROR = {
|
|
360
|
+
title: "\uC7A0\uC2DC \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694",
|
|
361
|
+
description: "\uBB38\uC81C\uAC00 \uACC4\uC18D\uB418\uBA74 \uD1A0\uC2A4 \uACE0\uAC1D\uC13C\uD130(1599-4905)\uB85C \uBB38\uC758\uD574\uC8FC\uC138\uC694."
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
// src/hooks/useErrorAlert.ts
|
|
365
|
+
var useErrorAlert = () => {
|
|
366
|
+
const { openAlert } = (0, import_tds_react_native3.useDialog)();
|
|
367
|
+
const openErrorAlert = (0, import_react7.useCallback)(async () => {
|
|
368
|
+
await openAlert({
|
|
369
|
+
title: DEFAULT_ERROR.title,
|
|
370
|
+
description: DEFAULT_ERROR.description
|
|
371
|
+
});
|
|
372
|
+
(0, import_react_native8.closeView)();
|
|
373
|
+
}, [openAlert]);
|
|
374
|
+
return { open: openErrorAlert };
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
// src/hooks/useTransparentWebview.tsx
|
|
352
378
|
var import_react8 = require("react");
|
|
353
379
|
|
|
354
|
-
// src/
|
|
355
|
-
var
|
|
356
|
-
var import_react_native8 = require("@granite-js/react-native");
|
|
357
|
-
var import_tds_react_native2 = require("@toss/tds-react-native");
|
|
358
|
-
var import_private = require("@toss/tds-react-native/private");
|
|
359
|
-
var import_react_native9 = require("react-native");
|
|
380
|
+
// src/utils/openTransparentWebView.ts
|
|
381
|
+
var import_react_native9 = require("@granite-js/react-native");
|
|
360
382
|
|
|
361
|
-
// src/
|
|
383
|
+
// src/private.ts
|
|
362
384
|
var import_native_modules5 = require("@apps-in-toss/native-modules");
|
|
363
|
-
var
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
var
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
+
var INTERNAL__onVisibilityChangedByTransparentServiceWeb = import_native_modules5.onVisibilityChangedByTransparentServiceWeb;
|
|
386
|
+
|
|
387
|
+
// src/utils/openTransparentWebView.ts
|
|
388
|
+
var openTransparentWebView = ({
|
|
389
|
+
webUrl,
|
|
390
|
+
cleanupWhenDismissed = true,
|
|
391
|
+
onEvent,
|
|
392
|
+
onError,
|
|
393
|
+
callbackId = "fn",
|
|
394
|
+
params
|
|
395
|
+
}) => {
|
|
396
|
+
const url = new URL("supertoss://transparent-service-web");
|
|
397
|
+
url.searchParams.set("url", webUrl);
|
|
398
|
+
url.searchParams.set("onVisibilityChangeCallback", callbackId);
|
|
399
|
+
Object.entries(params ?? {}).forEach(([key, value]) => {
|
|
400
|
+
url.searchParams.set(key, value);
|
|
401
|
+
});
|
|
402
|
+
const cleanup = INTERNAL__onVisibilityChangedByTransparentServiceWeb({
|
|
403
|
+
options: { callbackId },
|
|
404
|
+
onError: (error) => {
|
|
405
|
+
onError(error);
|
|
406
|
+
cleanup();
|
|
407
|
+
},
|
|
408
|
+
onEvent: (value) => {
|
|
409
|
+
onEvent(value);
|
|
410
|
+
if (cleanupWhenDismissed && value === true) {
|
|
411
|
+
cleanup();
|
|
385
412
|
}
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
(0, import_react_native9.openURL)(url.toString());
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
// src/hooks/useTransparentWebview.tsx
|
|
419
|
+
var useTransparentWebview = () => {
|
|
420
|
+
const [isWebviewLoading, setIsWebviewLoading] = (0, import_react8.useState)(false);
|
|
421
|
+
const { open: openErrorAlert } = useErrorAlert();
|
|
422
|
+
const _openTransparentWebview = (0, import_react8.useCallback)(
|
|
423
|
+
({ webUrl, onClose, onError }) => {
|
|
424
|
+
if (isWebviewLoading) {
|
|
425
|
+
return;
|
|
396
426
|
}
|
|
397
|
-
|
|
427
|
+
setIsWebviewLoading(true);
|
|
428
|
+
openTransparentWebView({
|
|
429
|
+
webUrl,
|
|
430
|
+
onEvent: async (isClosedTransparentWebView) => {
|
|
431
|
+
if (isClosedTransparentWebView) {
|
|
432
|
+
setIsWebviewLoading(false);
|
|
433
|
+
onClose?.();
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
onError: (error) => {
|
|
437
|
+
setIsWebviewLoading(false);
|
|
438
|
+
if (onError) {
|
|
439
|
+
onError(error);
|
|
440
|
+
} else {
|
|
441
|
+
openErrorAlert();
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
},
|
|
446
|
+
[isWebviewLoading, openErrorAlert]
|
|
447
|
+
);
|
|
448
|
+
return {
|
|
449
|
+
open: _openTransparentWebview
|
|
398
450
|
};
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
// src/components/GameProfileToast.tsx
|
|
454
|
+
var import_tds_react_native4 = require("@toss/tds-react-native");
|
|
455
|
+
var import_private2 = require("@toss/tds-react-native/private");
|
|
456
|
+
var import_react9 = require("react");
|
|
457
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
458
|
+
var useGameProfileToast = () => {
|
|
459
|
+
const overlay = (0, import_private2.useOverlay)();
|
|
460
|
+
const openGameProfileToast = (0, import_react9.useCallback)(
|
|
461
|
+
(nickname, profileImageUri) => {
|
|
462
|
+
return new Promise((resolve) => {
|
|
463
|
+
overlay.open(({ isOpen, close, exit }) => {
|
|
464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_private2.ColorPreferenceProvider, { colorPreference: "dark", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_private2.AdaptiveColorProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
465
|
+
import_tds_react_native4.Toast,
|
|
466
|
+
{
|
|
467
|
+
open: isOpen,
|
|
468
|
+
onClose: () => {
|
|
469
|
+
resolve();
|
|
470
|
+
close();
|
|
471
|
+
},
|
|
472
|
+
onExited: exit,
|
|
473
|
+
position: "top",
|
|
474
|
+
text: `${nickname}\uB2D8 \uBC18\uAC00\uC6CC\uC694!`,
|
|
475
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
476
|
+
import_tds_react_native4.Asset.Image,
|
|
477
|
+
{
|
|
478
|
+
style: { borderRadius: 64, overflow: "hidden" },
|
|
479
|
+
frameShape: import_tds_react_native4.Asset.frameShape.CleanW32,
|
|
480
|
+
source: { uri: profileImageUri }
|
|
481
|
+
}
|
|
482
|
+
)
|
|
483
|
+
}
|
|
484
|
+
) }) });
|
|
485
|
+
});
|
|
486
|
+
});
|
|
487
|
+
},
|
|
488
|
+
[overlay]
|
|
489
|
+
);
|
|
490
|
+
return { openGameProfileToast };
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
// src/hooks/useGameCenterProfile.ts
|
|
494
|
+
var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
495
|
+
const [profileData, setProfileData] = (0, import_react10.useState)(void 0);
|
|
496
|
+
const [isProfileDataLoading, setIsProfileDataLoading] = (0, import_react10.useState)(true);
|
|
497
|
+
const [isProfileDataRefetching, setIsProfileDataRefetching] = (0, import_react10.useState)(false);
|
|
498
|
+
const shouldShowProfileLoadingOverlay = isProfileDataLoading && isReadyForProfileUI || isProfileDataRefetching;
|
|
499
|
+
const shouldShowProfileNotFoundOverlay = profileData?.statusCode === "PROFILE_NOT_FOUND" && isReadyForProfileUI && !isProfileDataRefetching;
|
|
500
|
+
const canShowBottomSheetOrToast = !isProfileDataLoading && isReadyForProfileUI;
|
|
501
|
+
const { openGameProfileToast } = useGameProfileToast();
|
|
502
|
+
const { open: openErrorAlert } = useErrorAlert();
|
|
503
|
+
const { open: openTransparentWebView2 } = useTransparentWebview();
|
|
504
|
+
const fetchProfileData = (0, import_react10.useCallback)(async () => {
|
|
505
|
+
try {
|
|
506
|
+
const data = await (0, import_native_modules6.getGameCenterGameProfile)();
|
|
507
|
+
setProfileData(data);
|
|
508
|
+
setIsProfileDataLoading(false);
|
|
509
|
+
} catch (_) {
|
|
510
|
+
openErrorAlert();
|
|
511
|
+
setIsProfileDataLoading(false);
|
|
512
|
+
}
|
|
513
|
+
}, [openErrorAlert]);
|
|
514
|
+
const refetchProfileData = (0, import_react10.useCallback)(async () => {
|
|
515
|
+
try {
|
|
516
|
+
setIsProfileDataRefetching(true);
|
|
517
|
+
const data = await (0, import_native_modules6.getGameCenterGameProfile)();
|
|
518
|
+
setProfileData(data);
|
|
519
|
+
setIsProfileDataRefetching(false);
|
|
520
|
+
if (data?.statusCode === "SUCCESS") {
|
|
521
|
+
openGameProfileToast(data.nickname, data.profileImageUri);
|
|
407
522
|
}
|
|
408
|
-
})
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
item_title: title
|
|
523
|
+
} catch (_) {
|
|
524
|
+
setIsProfileDataRefetching(false);
|
|
525
|
+
openErrorAlert();
|
|
526
|
+
}
|
|
527
|
+
}, [openErrorAlert, openGameProfileToast]);
|
|
528
|
+
const openProfileWebview = (0, import_react10.useCallback)(() => {
|
|
529
|
+
openTransparentWebView2({
|
|
530
|
+
webUrl: `${GAME_PROFILE_WEBVIEW_URL}?appName=${getAppName()}&referrer=appsintoss.${getAppName()}`,
|
|
531
|
+
onClose: async () => {
|
|
532
|
+
refetchProfileData();
|
|
419
533
|
}
|
|
420
534
|
});
|
|
421
|
-
};
|
|
535
|
+
}, [openTransparentWebView2, refetchProfileData]);
|
|
422
536
|
return {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
537
|
+
profileData,
|
|
538
|
+
isProfileDataLoading,
|
|
539
|
+
shouldShowProfileLoadingOverlay,
|
|
540
|
+
shouldShowProfileNotFoundOverlay,
|
|
541
|
+
canShowBottomSheetOrToast,
|
|
542
|
+
setIsProfileDataLoading,
|
|
543
|
+
openProfileWebview,
|
|
544
|
+
setProfileData,
|
|
545
|
+
openErrorAlert,
|
|
546
|
+
openGameProfileToast,
|
|
547
|
+
fetchProfileData
|
|
427
548
|
};
|
|
428
|
-
}
|
|
549
|
+
};
|
|
429
550
|
|
|
430
|
-
// src/
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}
|
|
551
|
+
// src/utils/zIndex.ts
|
|
552
|
+
var Z_INDEX = {
|
|
553
|
+
/* 게임 프로필을 위한 overlay
|
|
554
|
+
*/
|
|
555
|
+
PROFILE_OVERLAY: 9998,
|
|
556
|
+
// 게임을 종료할 수 있는 X 버튼
|
|
557
|
+
CLOSE_BUTTON: 9999
|
|
558
|
+
};
|
|
438
559
|
|
|
439
|
-
// src/
|
|
560
|
+
// src/components/GameInitializer.tsx
|
|
440
561
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
441
|
-
var
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
const
|
|
452
|
-
const {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
});
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
562
|
+
var GameInitializer = ({ children, isReadyForProfileUI }) => {
|
|
563
|
+
const {
|
|
564
|
+
profileData,
|
|
565
|
+
shouldShowProfileLoadingOverlay,
|
|
566
|
+
shouldShowProfileNotFoundOverlay,
|
|
567
|
+
canShowBottomSheetOrToast,
|
|
568
|
+
openProfileWebview,
|
|
569
|
+
openGameProfileToast,
|
|
570
|
+
fetchProfileData
|
|
571
|
+
} = useGameCenterProfile(isReadyForProfileUI);
|
|
572
|
+
const isCompletedFlow = (0, import_react11.useRef)(false);
|
|
573
|
+
const { open: openAppUpdateDialog } = useAppUpdateDialog();
|
|
574
|
+
(0, import_react11.useEffect)(() => {
|
|
575
|
+
fetchProfileData();
|
|
576
|
+
}, []);
|
|
577
|
+
(0, import_react11.useEffect)(() => {
|
|
578
|
+
const handleGameProfileFlow = async () => {
|
|
579
|
+
if (!canShowBottomSheetOrToast) {
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
if (isCompletedFlow.current) {
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
isCompletedFlow.current = true;
|
|
586
|
+
if (!(0, import_native_modules7.isMinVersionSupported)(GAME_MIN_VERSION)) {
|
|
587
|
+
openAppUpdateDialog({
|
|
588
|
+
title: `${(0, import_es_hangul.josa)(getAppsInTossGlobals().brandDisplayName, "\uC744/\uB97C")} \uD558\uB824\uBA74
|
|
589
|
+
\uC571\uC744 \uC5C5\uB370\uC774\uD2B8\uD574\uC8FC\uC138\uC694`,
|
|
590
|
+
onDismiss: () => {
|
|
591
|
+
(0, import_react_native10.closeView)();
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
if (profileData?.statusCode === "SUCCESS") {
|
|
597
|
+
openGameProfileToast(profileData.nickname, profileData.profileImageUri);
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
if (profileData?.statusCode === "PROFILE_NOT_FOUND") {
|
|
601
|
+
openProfileWebview();
|
|
602
|
+
}
|
|
603
|
+
};
|
|
604
|
+
handleGameProfileFlow();
|
|
605
|
+
}, [
|
|
606
|
+
canShowBottomSheetOrToast,
|
|
607
|
+
isCompletedFlow,
|
|
608
|
+
openAppUpdateDialog,
|
|
609
|
+
openGameProfileToast,
|
|
610
|
+
openProfileWebview,
|
|
611
|
+
profileData
|
|
612
|
+
]);
|
|
613
|
+
if (!(0, import_native_modules7.isMinVersionSupported)(GAME_MIN_VERSION)) {
|
|
614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
615
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native11.View, { style: { flex: 1, position: "relative" }, children }),
|
|
616
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
617
|
+
import_react_native11.Pressable,
|
|
461
618
|
{
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
619
|
+
style: {
|
|
620
|
+
...overlayStyle
|
|
621
|
+
},
|
|
622
|
+
onPress: () => {
|
|
623
|
+
openAppUpdateDialog({
|
|
624
|
+
title: `${(0, import_es_hangul.josa)(getAppsInTossGlobals().brandDisplayName, "\uC744/\uB97C")} \uD558\uB824\uBA74
|
|
625
|
+
\uC571\uC744 \uC5C5\uB370\uC774\uD2B8\uD574\uC8FC\uC138\uC694`,
|
|
626
|
+
onDismiss: () => {
|
|
627
|
+
(0, import_react_native10.closeView)();
|
|
628
|
+
}
|
|
629
|
+
});
|
|
630
|
+
}
|
|
465
631
|
}
|
|
466
|
-
)
|
|
467
|
-
|
|
468
|
-
|
|
632
|
+
)
|
|
633
|
+
] });
|
|
634
|
+
}
|
|
635
|
+
if (shouldShowProfileLoadingOverlay) {
|
|
636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
637
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native11.View, { style: { flex: 1, position: "relative" }, children }),
|
|
638
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
639
|
+
import_react_native11.View,
|
|
469
640
|
{
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
if (isSandbox) {
|
|
478
|
-
openConfirm({
|
|
479
|
-
title: "\uACF5\uC720\uD558\uAE30 \uAE30\uB2A5 \uBBF8\uC9C0\uC6D0",
|
|
480
|
-
description: "\uC0CC\uB4DC\uBC15\uC2A4 \uD658\uACBD\uC5D0\uC11C\uB294 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4\uC694. \uCF58\uC194\uC744 \uD1B5\uD574 \uD1A0\uC2A4\uC571\uC5D0\uC11C \uD14C\uC2A4\uD2B8\uD574 \uC8FC\uC138\uC694.",
|
|
481
|
-
rightButton: "\uD655\uC778",
|
|
482
|
-
closeOnDimmerClick: true
|
|
483
|
-
});
|
|
484
|
-
return;
|
|
641
|
+
style: {
|
|
642
|
+
...overlayStyle,
|
|
643
|
+
justifyContent: "center",
|
|
644
|
+
alignItems: "center",
|
|
645
|
+
backgroundColor: "rgba(0, 0, 0, 0.2)"
|
|
646
|
+
},
|
|
647
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_tds_react_native5.Loader, { size: "large", type: "light" })
|
|
485
648
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
649
|
+
)
|
|
650
|
+
] });
|
|
651
|
+
}
|
|
652
|
+
if (shouldShowProfileNotFoundOverlay) {
|
|
653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
654
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native11.View, { style: { flex: 1, position: "relative" }, children }),
|
|
655
|
+
shouldShowProfileNotFoundOverlay && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
656
|
+
import_react_native11.Pressable,
|
|
657
|
+
{
|
|
658
|
+
style: {
|
|
659
|
+
...overlayStyle
|
|
660
|
+
},
|
|
661
|
+
onPress: () => {
|
|
662
|
+
openProfileWebview();
|
|
490
663
|
}
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
}
|
|
494
|
-
|
|
664
|
+
}
|
|
665
|
+
)
|
|
666
|
+
] });
|
|
667
|
+
}
|
|
668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native11.View, { style: { flex: 1, position: "relative" }, children }) });
|
|
669
|
+
};
|
|
670
|
+
var overlayStyle = {
|
|
671
|
+
position: "absolute",
|
|
672
|
+
top: 0,
|
|
673
|
+
left: 0,
|
|
674
|
+
right: 0,
|
|
675
|
+
bottom: 0,
|
|
676
|
+
zIndex: Z_INDEX.PROFILE_OVERLAY
|
|
677
|
+
};
|
|
678
|
+
|
|
679
|
+
// src/components/NavigationBar/RNNavigationBar/Default.tsx
|
|
680
|
+
var import_private5 = require("@toss/tds-react-native/private");
|
|
681
|
+
|
|
682
|
+
// src/components/NavigationBar/RNNavigationBar/hooks/useHardwareBackPress.ts
|
|
683
|
+
var import_react12 = require("react");
|
|
684
|
+
var import_react_native12 = require("react-native");
|
|
685
|
+
function useHardwareBackPress(handler) {
|
|
686
|
+
(0, import_react12.useEffect)(() => {
|
|
687
|
+
const handleBackPress = () => {
|
|
688
|
+
handler();
|
|
689
|
+
return true;
|
|
690
|
+
};
|
|
691
|
+
import_react_native12.BackHandler.addEventListener("hardwareBackPress", handleBackPress);
|
|
692
|
+
return () => import_react_native12.BackHandler.removeEventListener("hardwareBackPress", handleBackPress);
|
|
693
|
+
}, [handler]);
|
|
495
694
|
}
|
|
496
695
|
|
|
497
|
-
// src/hooks/
|
|
498
|
-
var
|
|
499
|
-
var
|
|
500
|
-
var import_tds_react_native3 = require("@toss/tds-react-native");
|
|
501
|
-
var import_react7 = require("react");
|
|
696
|
+
// src/components/NavigationBar/RNNavigationBar/hooks/useNavigationEvent.ts
|
|
697
|
+
var import_react_native14 = require("@granite-js/react-native");
|
|
698
|
+
var import_react14 = require("react");
|
|
502
699
|
|
|
503
|
-
// src/
|
|
504
|
-
var
|
|
505
|
-
var
|
|
506
|
-
var
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
};
|
|
700
|
+
// src/components/NavigationBar/RNNavigationBar/hooks/useCloseConfirm.ts
|
|
701
|
+
var import_tds_react_native6 = require("@toss/tds-react-native");
|
|
702
|
+
var import_es_hangul2 = require("es-hangul");
|
|
703
|
+
var import_react13 = require("react");
|
|
704
|
+
function useCloseConfirm() {
|
|
705
|
+
const { brandDisplayName } = getAppsInTossGlobals();
|
|
706
|
+
const { openConfirm } = (0, import_tds_react_native6.useDialog)();
|
|
707
|
+
return (0, import_react13.useCallback)(async ({ onEntered }) => {
|
|
708
|
+
return await openConfirm({
|
|
709
|
+
title: `${(0, import_es_hangul2.josa)(brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
710
|
+
leftButton: "\uCDE8\uC18C",
|
|
711
|
+
rightButton: "\uC885\uB8CC\uD558\uAE30",
|
|
712
|
+
closeOnDimmerClick: true,
|
|
713
|
+
onEntered
|
|
714
|
+
});
|
|
715
|
+
}, [brandDisplayName, openConfirm]);
|
|
716
|
+
}
|
|
510
717
|
|
|
511
|
-
// src/
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
718
|
+
// src/components/NavigationBar/common/useNavigationBarLogging.tsx
|
|
719
|
+
var import_native_modules8 = require("@apps-in-toss/native-modules");
|
|
720
|
+
var import_react_native13 = require("@granite-js/react-native");
|
|
721
|
+
var NAVI_BAR_IMPRESSION_SCHEMA_ID = 1596837;
|
|
722
|
+
var NAVI_BAR_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__navigation_bar";
|
|
723
|
+
var CLOSE_POPUP_SHOW_SCHEMA_ID = 1644490;
|
|
724
|
+
var CLOSE_POPUP_SHOW_LOG_NAME = "appsintoss_app_visit__common_module::popup__close_app";
|
|
725
|
+
var CLOSE_BUTTON_CLICK_SCHEMA_ID = 1596831;
|
|
726
|
+
var CLOSE_BUTTON_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::click__icon_close";
|
|
727
|
+
var CLOSE_POPUP_CTA_CLICK_SCHEMA_ID = 1644492;
|
|
728
|
+
var CLOSE_POPUP_CTA_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::popup__close_app::click__cta";
|
|
729
|
+
var HOME_BUTTON_CLICK_SCHEMA_ID = 1596839;
|
|
730
|
+
var HOME_BUTTON_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::click__icon_home";
|
|
731
|
+
function useNavigationBarLogging() {
|
|
732
|
+
const referrer = useReferrer();
|
|
733
|
+
const baseParams = {
|
|
734
|
+
referrer,
|
|
735
|
+
app_name: import_react_native13.Granite.appName
|
|
736
|
+
};
|
|
737
|
+
const logNavBarImpression = (naviBarConfig) => {
|
|
738
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
739
|
+
log_name: NAVI_BAR_IMPRESSION_LOG_NAME,
|
|
740
|
+
log_type: "event",
|
|
741
|
+
params: {
|
|
742
|
+
...naviBarConfig,
|
|
743
|
+
...baseParams,
|
|
744
|
+
event_type: "impression",
|
|
745
|
+
schema_id: NAVI_BAR_IMPRESSION_SCHEMA_ID
|
|
533
746
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
747
|
+
});
|
|
748
|
+
};
|
|
749
|
+
const logHomeButtonClick = () => {
|
|
750
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
751
|
+
log_name: HOME_BUTTON_CLICK_LOG_NAME,
|
|
752
|
+
log_type: "event",
|
|
753
|
+
params: {
|
|
754
|
+
...baseParams,
|
|
755
|
+
event_type: "click",
|
|
756
|
+
schema_id: HOME_BUTTON_CLICK_SCHEMA_ID
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
};
|
|
760
|
+
const logCloseButtonClick = () => {
|
|
761
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
762
|
+
log_name: CLOSE_BUTTON_CLICK_LOG_NAME,
|
|
763
|
+
log_type: "event",
|
|
764
|
+
params: {
|
|
765
|
+
...baseParams,
|
|
766
|
+
event_type: "click",
|
|
767
|
+
schema_id: CLOSE_BUTTON_CLICK_SCHEMA_ID
|
|
768
|
+
}
|
|
769
|
+
});
|
|
770
|
+
};
|
|
771
|
+
const logClosePopupShow = () => {
|
|
772
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
773
|
+
log_name: CLOSE_POPUP_SHOW_LOG_NAME,
|
|
774
|
+
log_type: "popup",
|
|
775
|
+
params: {
|
|
776
|
+
...baseParams,
|
|
777
|
+
schema_id: CLOSE_POPUP_SHOW_SCHEMA_ID
|
|
778
|
+
}
|
|
779
|
+
});
|
|
780
|
+
};
|
|
781
|
+
const logClosePopupCtaClick = (confirm) => {
|
|
782
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
783
|
+
log_name: CLOSE_POPUP_CTA_CLICK_LOG_NAME,
|
|
784
|
+
log_type: "event",
|
|
785
|
+
params: {
|
|
786
|
+
...baseParams,
|
|
787
|
+
close_yn: confirm ? "Y" : "N",
|
|
788
|
+
schema_id: CLOSE_POPUP_CTA_CLICK_SCHEMA_ID,
|
|
789
|
+
event_type: "click"
|
|
790
|
+
}
|
|
791
|
+
});
|
|
792
|
+
};
|
|
540
793
|
return {
|
|
541
|
-
|
|
794
|
+
navBarImpression: logNavBarImpression,
|
|
795
|
+
closePopupShow: logClosePopupShow,
|
|
796
|
+
closePopupCtaClick: logClosePopupCtaClick,
|
|
797
|
+
closeButtonClick: logCloseButtonClick,
|
|
798
|
+
homeButtonClick: logHomeButtonClick
|
|
542
799
|
};
|
|
543
800
|
}
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
801
|
+
|
|
802
|
+
// src/components/NavigationBar/RNNavigationBar/hooks/useNavigationEvent.ts
|
|
803
|
+
function useNavigationEvent() {
|
|
804
|
+
const backEventContext = (0, import_react_native14.useBackEventContext)();
|
|
805
|
+
const logging = useNavigationBarLogging();
|
|
806
|
+
const navigation = (0, import_react_native14.useNavigation)();
|
|
807
|
+
const closeConfirm = useCloseConfirm();
|
|
808
|
+
const { captureExitLog } = useCaptureExitLog();
|
|
809
|
+
return (0, import_react14.useMemo)(() => {
|
|
810
|
+
const close = async () => {
|
|
811
|
+
const hasConfirmed = await closeConfirm({
|
|
812
|
+
onEntered: logging.closePopupShow
|
|
813
|
+
});
|
|
814
|
+
logging.closePopupCtaClick(hasConfirmed);
|
|
815
|
+
if (hasConfirmed) {
|
|
816
|
+
captureExitLog(Date.now());
|
|
817
|
+
(0, import_react_native14.closeView)();
|
|
818
|
+
}
|
|
819
|
+
};
|
|
820
|
+
return {
|
|
821
|
+
handleBack: () => {
|
|
822
|
+
if (backEventContext.hasBackEvent) {
|
|
823
|
+
backEventContext.onBack();
|
|
824
|
+
} else if (navigation.canGoBack()) {
|
|
825
|
+
navigation.goBack();
|
|
826
|
+
} else {
|
|
827
|
+
close();
|
|
828
|
+
}
|
|
829
|
+
},
|
|
830
|
+
handleHomeButtonClick: () => {
|
|
831
|
+
logging.homeButtonClick();
|
|
832
|
+
navigation.navigate("/");
|
|
833
|
+
},
|
|
834
|
+
handleCloseButtonClick: () => {
|
|
835
|
+
logging.closeButtonClick();
|
|
836
|
+
close();
|
|
837
|
+
}
|
|
838
|
+
};
|
|
839
|
+
}, [backEventContext, navigation, closeConfirm, logging, captureExitLog]);
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
843
|
+
var import_native_modules11 = require("@apps-in-toss/native-modules");
|
|
844
|
+
var import_react_native18 = require("@granite-js/react-native");
|
|
845
|
+
var import_tds_react_native8 = require("@toss/tds-react-native");
|
|
846
|
+
var import_private4 = require("@toss/tds-react-native/private");
|
|
847
|
+
var import_react15 = require("react");
|
|
848
|
+
|
|
849
|
+
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
850
|
+
var import_native_modules10 = require("@apps-in-toss/native-modules");
|
|
851
|
+
var import_react_native16 = require("@granite-js/react-native");
|
|
852
|
+
var import_tds_react_native7 = require("@toss/tds-react-native");
|
|
853
|
+
var import_private3 = require("@toss/tds-react-native/private");
|
|
854
|
+
var import_react_native17 = require("react-native");
|
|
855
|
+
|
|
856
|
+
// src/core/hooks/useMoreButtonBottomSheet/useMoreButtonBottomSheetLogging.tsx
|
|
857
|
+
var import_native_modules9 = require("@apps-in-toss/native-modules");
|
|
858
|
+
var import_react_native15 = require("@granite-js/react-native");
|
|
859
|
+
var BOTTOM_SHEET_SCHEMA_ID = 1596825;
|
|
860
|
+
var BOTTOM_SHEET_LOG_NAME = "appsintoss_app_visit__common_module::bottomsheet__more";
|
|
861
|
+
var BOTTOM_SHEET_OPEN_SCHEMA_ID = 1596829;
|
|
862
|
+
var BOTTOM_SHEET_OPEN_LOG_NAME = "appsintoss_app_visit__common_module::click__icon_more";
|
|
863
|
+
var BOTTOM_SHEET_CLOSE_CLICK_SCHEMA_ID = 1596843;
|
|
864
|
+
var BOTTOM_SHEET_CLOSE_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::bottomsheet__more::click__close";
|
|
865
|
+
var BOTTOM_SHEET_MENU_CLICK_SCHEMA_ID = 1596841;
|
|
866
|
+
var BOTTOM_SHEET_MENU_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::bottomsheet__more::click__menu";
|
|
867
|
+
function useMoreButtonBottomSheetLogging() {
|
|
549
868
|
const referrer = useReferrer();
|
|
550
869
|
const baseParams = {
|
|
551
870
|
referrer,
|
|
552
|
-
app_name:
|
|
871
|
+
app_name: import_react_native15.Granite.appName
|
|
553
872
|
};
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
log_name:
|
|
873
|
+
const logBottomSheetShow = () => {
|
|
874
|
+
import_native_modules9.INTERNAL__module.tossCoreEventLog({
|
|
875
|
+
log_name: BOTTOM_SHEET_LOG_NAME,
|
|
876
|
+
log_type: "popup",
|
|
877
|
+
params: {
|
|
878
|
+
...baseParams,
|
|
879
|
+
schema_id: BOTTOM_SHEET_SCHEMA_ID
|
|
880
|
+
}
|
|
881
|
+
});
|
|
882
|
+
};
|
|
883
|
+
const logBottomSheetOpen = () => {
|
|
884
|
+
import_native_modules9.INTERNAL__module.tossCoreEventLog({
|
|
885
|
+
log_name: BOTTOM_SHEET_OPEN_LOG_NAME,
|
|
557
886
|
log_type: "event",
|
|
558
887
|
params: {
|
|
559
888
|
...baseParams,
|
|
560
|
-
schema_id:
|
|
561
|
-
event_type: "click"
|
|
562
|
-
button_type: "update"
|
|
889
|
+
schema_id: BOTTOM_SHEET_OPEN_SCHEMA_ID,
|
|
890
|
+
event_type: "click"
|
|
563
891
|
}
|
|
564
892
|
});
|
|
565
893
|
};
|
|
566
|
-
const
|
|
567
|
-
|
|
568
|
-
log_name:
|
|
894
|
+
const logBottomSheetCloseClick = () => {
|
|
895
|
+
import_native_modules9.INTERNAL__module.tossCoreEventLog({
|
|
896
|
+
log_name: BOTTOM_SHEET_CLOSE_CLICK_LOG_NAME,
|
|
569
897
|
log_type: "event",
|
|
570
898
|
params: {
|
|
571
899
|
...baseParams,
|
|
572
|
-
schema_id:
|
|
573
|
-
event_type: "click"
|
|
574
|
-
button_type: "close"
|
|
900
|
+
schema_id: BOTTOM_SHEET_CLOSE_CLICK_SCHEMA_ID,
|
|
901
|
+
event_type: "click"
|
|
575
902
|
}
|
|
576
903
|
});
|
|
577
904
|
};
|
|
578
|
-
const
|
|
579
|
-
|
|
580
|
-
log_name:
|
|
581
|
-
log_type: "
|
|
905
|
+
const logBottomSheetMenuClick = ({ title }) => {
|
|
906
|
+
import_native_modules9.INTERNAL__module.tossCoreEventLog({
|
|
907
|
+
log_name: BOTTOM_SHEET_MENU_CLICK_LOG_NAME,
|
|
908
|
+
log_type: "event",
|
|
582
909
|
params: {
|
|
583
910
|
...baseParams,
|
|
584
|
-
schema_id:
|
|
911
|
+
schema_id: BOTTOM_SHEET_MENU_CLICK_SCHEMA_ID,
|
|
912
|
+
event_type: "click",
|
|
913
|
+
item_title: title
|
|
914
|
+
}
|
|
915
|
+
});
|
|
916
|
+
};
|
|
917
|
+
return {
|
|
918
|
+
show: logBottomSheetShow,
|
|
919
|
+
open: logBottomSheetOpen,
|
|
920
|
+
close: logBottomSheetCloseClick,
|
|
921
|
+
menuClick: logBottomSheetMenuClick
|
|
922
|
+
};
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
// src/core/utils/url.ts
|
|
926
|
+
function addParamsToUrl(url, params) {
|
|
927
|
+
const urlObj = new URL(url);
|
|
928
|
+
for (const [key, value] of Object.entries(params)) {
|
|
929
|
+
urlObj.searchParams.set(key, value);
|
|
930
|
+
}
|
|
931
|
+
return urlObj.toString();
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
935
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
936
|
+
var SHARE_SCHEME_REFERRER = "appsintoss.common_module_share";
|
|
937
|
+
var APP_SHARE_MENU_INFO = {
|
|
938
|
+
contactItemName: "\uACF5\uC720\uD558\uAE30",
|
|
939
|
+
contactIconUrl: "https://static.toss.im/icons/png/4x/icon-share-dots-mono.png"
|
|
940
|
+
};
|
|
941
|
+
function AppShareListMenu() {
|
|
942
|
+
const globals = getAppsInTossGlobals();
|
|
943
|
+
const adaptive = (0, import_private3.useAdaptive)();
|
|
944
|
+
const logging = useMoreButtonBottomSheetLogging();
|
|
945
|
+
const initialScheme = (0, import_react_native16.getSchemeUri)();
|
|
946
|
+
const isSandbox = (0, import_native_modules10.getOperationalEnvironment)() === "sandbox";
|
|
947
|
+
const { openConfirm } = (0, import_tds_react_native7.useDialog)();
|
|
948
|
+
const schemeForShare = addParamsToUrl(initialScheme, {
|
|
949
|
+
referrer: SHARE_SCHEME_REFERRER
|
|
950
|
+
});
|
|
951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
952
|
+
import_tds_react_native7.ListRow,
|
|
953
|
+
{
|
|
954
|
+
left: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
955
|
+
import_tds_react_native7.ListRow.Icon,
|
|
956
|
+
{
|
|
957
|
+
color: globals.brandPrimaryColor,
|
|
958
|
+
source: { uri: APP_SHARE_MENU_INFO.contactIconUrl },
|
|
959
|
+
type: "background"
|
|
960
|
+
}
|
|
961
|
+
),
|
|
962
|
+
contents: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
963
|
+
import_tds_react_native7.ListRow.Texts,
|
|
964
|
+
{
|
|
965
|
+
type: "1RowTypeA",
|
|
966
|
+
top: APP_SHARE_MENU_INFO.contactItemName,
|
|
967
|
+
topProps: { color: adaptive.grey700 }
|
|
968
|
+
}
|
|
969
|
+
),
|
|
970
|
+
verticalPadding: "extraSmall",
|
|
971
|
+
onPress: () => {
|
|
972
|
+
if (isSandbox) {
|
|
973
|
+
openConfirm({
|
|
974
|
+
title: "\uACF5\uC720\uD558\uAE30 \uAE30\uB2A5 \uBBF8\uC9C0\uC6D0",
|
|
975
|
+
description: "\uC0CC\uB4DC\uBC15\uC2A4 \uD658\uACBD\uC5D0\uC11C\uB294 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4\uC694. \uCF58\uC194\uC744 \uD1B5\uD574 \uD1A0\uC2A4\uC571\uC5D0\uC11C \uD14C\uC2A4\uD2B8\uD574 \uC8FC\uC138\uC694.",
|
|
976
|
+
rightButton: "\uD655\uC778",
|
|
977
|
+
closeOnDimmerClick: true
|
|
978
|
+
});
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
981
|
+
logging.menuClick({ title: APP_SHARE_MENU_INFO.contactItemName });
|
|
982
|
+
import_react_native17.NativeModules.AppsInTossModule.shareWithScheme({
|
|
983
|
+
params: {
|
|
984
|
+
schemeURL: schemeForShare
|
|
985
|
+
}
|
|
986
|
+
});
|
|
585
987
|
}
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
return { update: logUpdateClick, close: logCloseClick, show: logDialogShow };
|
|
988
|
+
}
|
|
989
|
+
);
|
|
589
990
|
}
|
|
590
991
|
|
|
591
992
|
// src/core/utils/ensureValue.ts
|
|
@@ -597,7 +998,7 @@ function ensureValue(value, name) {
|
|
|
597
998
|
}
|
|
598
999
|
|
|
599
1000
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
600
|
-
var
|
|
1001
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
601
1002
|
var APP_BRIDGE_METHOD_NAME = "getMiniAppsSupportContact";
|
|
602
1003
|
var MIN_VERSION = {
|
|
603
1004
|
BOTTOM_SHEET: {
|
|
@@ -611,19 +1012,19 @@ var MIN_VERSION = {
|
|
|
611
1012
|
};
|
|
612
1013
|
function useMoreButtonBottomSheet() {
|
|
613
1014
|
const globals = getAppsInTossGlobals();
|
|
614
|
-
const adaptive = (0,
|
|
615
|
-
const [itemList, setItemList] = (0,
|
|
1015
|
+
const adaptive = (0, import_private4.useAdaptive)();
|
|
1016
|
+
const [itemList, setItemList] = (0, import_react15.useState)([]);
|
|
616
1017
|
const appUpdateDialog = useAppUpdateDialog();
|
|
617
1018
|
const logging = useMoreButtonBottomSheetLogging();
|
|
618
|
-
const overlay = (0,
|
|
1019
|
+
const overlay = (0, import_private4.useOverlay)();
|
|
619
1020
|
const title = ensureValue(globals.brandDisplayName, "displayName");
|
|
620
|
-
const isBottomSheetSupported = (0,
|
|
621
|
-
const isShareListMenuSupported = (0,
|
|
622
|
-
(0,
|
|
1021
|
+
const isBottomSheetSupported = (0, import_native_modules11.isMinVersionSupported)(MIN_VERSION.BOTTOM_SHEET);
|
|
1022
|
+
const isShareListMenuSupported = (0, import_native_modules11.isMinVersionSupported)(MIN_VERSION.SHARE_LIST_MENU);
|
|
1023
|
+
(0, import_react15.useEffect)(() => {
|
|
623
1024
|
if (!isBottomSheetSupported) {
|
|
624
1025
|
return;
|
|
625
1026
|
}
|
|
626
|
-
|
|
1027
|
+
import_native_modules11.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
627
1028
|
APP_BRIDGE_METHOD_NAME,
|
|
628
1029
|
{},
|
|
629
1030
|
{
|
|
@@ -646,18 +1047,18 @@ function useMoreButtonBottomSheet() {
|
|
|
646
1047
|
logging.close();
|
|
647
1048
|
close();
|
|
648
1049
|
};
|
|
649
|
-
return /* @__PURE__ */ (0,
|
|
650
|
-
|
|
1050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(BottomSheetImpressionArea, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1051
|
+
import_tds_react_native8.BottomSheet.Root,
|
|
651
1052
|
{
|
|
652
|
-
header: /* @__PURE__ */ (0,
|
|
653
|
-
|
|
1053
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1054
|
+
import_tds_react_native8.ListHeader,
|
|
654
1055
|
{
|
|
655
|
-
title: /* @__PURE__ */ (0,
|
|
1056
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_tds_react_native8.ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
|
|
656
1057
|
}
|
|
657
1058
|
),
|
|
658
1059
|
open: isOpen,
|
|
659
|
-
cta: /* @__PURE__ */ (0,
|
|
660
|
-
|
|
1060
|
+
cta: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1061
|
+
import_tds_react_native8.BottomSheet.CTA,
|
|
661
1062
|
{
|
|
662
1063
|
size: "large",
|
|
663
1064
|
type: "dark",
|
|
@@ -670,21 +1071,21 @@ function useMoreButtonBottomSheet() {
|
|
|
670
1071
|
),
|
|
671
1072
|
onClose: handleClose,
|
|
672
1073
|
onExited: exit,
|
|
673
|
-
children: /* @__PURE__ */ (0,
|
|
1074
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_tds_react_native8.List, { rowSeparator: "none", children: [
|
|
674
1075
|
itemList.map((item) => {
|
|
675
|
-
return /* @__PURE__ */ (0,
|
|
676
|
-
|
|
1076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1077
|
+
import_tds_react_native8.ListRow,
|
|
677
1078
|
{
|
|
678
|
-
left: /* @__PURE__ */ (0,
|
|
679
|
-
|
|
1079
|
+
left: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1080
|
+
import_tds_react_native8.ListRow.Icon,
|
|
680
1081
|
{
|
|
681
1082
|
color: globals.brandPrimaryColor,
|
|
682
1083
|
source: { uri: item.contactIconUrl },
|
|
683
1084
|
type: "background"
|
|
684
1085
|
}
|
|
685
1086
|
),
|
|
686
|
-
contents: /* @__PURE__ */ (0,
|
|
687
|
-
|
|
1087
|
+
contents: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1088
|
+
import_tds_react_native8.ListRow.Texts,
|
|
688
1089
|
{
|
|
689
1090
|
type: "1RowTypeA",
|
|
690
1091
|
top: item.contactItemName,
|
|
@@ -694,13 +1095,13 @@ function useMoreButtonBottomSheet() {
|
|
|
694
1095
|
verticalPadding: "extraSmall",
|
|
695
1096
|
onPress: () => {
|
|
696
1097
|
logging.menuClick({ title: item.contactItemName });
|
|
697
|
-
(0,
|
|
1098
|
+
(0, import_react_native18.openURL)(item.contactUri);
|
|
698
1099
|
}
|
|
699
1100
|
},
|
|
700
1101
|
item.contactItemName
|
|
701
1102
|
);
|
|
702
1103
|
}),
|
|
703
|
-
isShareListMenuSupported && /* @__PURE__ */ (0,
|
|
1104
|
+
isShareListMenuSupported && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppShareListMenu, {})
|
|
704
1105
|
] })
|
|
705
1106
|
}
|
|
706
1107
|
) });
|
|
@@ -710,10 +1111,10 @@ function useMoreButtonBottomSheet() {
|
|
|
710
1111
|
}
|
|
711
1112
|
function BottomSheetImpressionArea({ children }) {
|
|
712
1113
|
const logging = useMoreButtonBottomSheetLogging();
|
|
713
|
-
(0,
|
|
1114
|
+
(0, import_react15.useEffect)(() => {
|
|
714
1115
|
logging.show();
|
|
715
1116
|
}, [logging]);
|
|
716
|
-
return /* @__PURE__ */ (0,
|
|
1117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children });
|
|
717
1118
|
}
|
|
718
1119
|
|
|
719
1120
|
// src/core/utils/safeParseNavigationBar.ts
|
|
@@ -728,506 +1129,250 @@ function safeParseNavigationBar(navigationBar) {
|
|
|
728
1129
|
}
|
|
729
1130
|
}
|
|
730
1131
|
|
|
731
|
-
// src/components/NavigationBar/
|
|
732
|
-
var
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
1132
|
+
// src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
|
|
1133
|
+
var import_react16 = require("react");
|
|
1134
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1135
|
+
function NavigationBarImpressionArea({
|
|
1136
|
+
children,
|
|
1137
|
+
withHomeButton
|
|
1138
|
+
}) {
|
|
1139
|
+
const hasLogged = (0, import_react16.useRef)(false);
|
|
736
1140
|
const logging = useNavigationBarLogging();
|
|
737
|
-
|
|
1141
|
+
(0, import_react16.useEffect)(() => {
|
|
1142
|
+
if (hasLogged.current === false) {
|
|
1143
|
+
logging.navBarImpression({ home_icon_yn: withHomeButton ? "Y" : "N" });
|
|
1144
|
+
hasLogged.current = true;
|
|
1145
|
+
}
|
|
1146
|
+
}, [logging, withHomeButton]);
|
|
1147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children });
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
// src/components/NavigationBar/RNNavigationBar/Default.tsx
|
|
1151
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1152
|
+
function DefaultNavigationBar() {
|
|
1153
|
+
const globals = getAppsInTossGlobals();
|
|
738
1154
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
739
1155
|
const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
|
|
740
1156
|
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
741
1157
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
742
1158
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
logging.homeButtonClick();
|
|
748
|
-
navigation.navigate("/");
|
|
749
|
-
}, [logging, navigation]);
|
|
750
|
-
const handleClose = (0, import_react9.useCallback)(async () => {
|
|
751
|
-
logging.closeButtonClick();
|
|
752
|
-
const isConfirmed = await openConfirm({
|
|
753
|
-
title: `${(0, import_es_hangul.josa)(globals.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
754
|
-
leftButton: "\uCDE8\uC18C",
|
|
755
|
-
rightButton: "\uC885\uB8CC\uD558\uAE30",
|
|
756
|
-
closeOnDimmerClick: true,
|
|
757
|
-
onEntered: logging.closePopupShow
|
|
758
|
-
});
|
|
759
|
-
logging.closePopupCtaClick(isConfirmed);
|
|
760
|
-
if (isConfirmed) {
|
|
761
|
-
captureExitLog(Date.now());
|
|
762
|
-
(0, import_react_native13.closeView)();
|
|
763
|
-
}
|
|
764
|
-
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
765
|
-
const handleBack = (0, import_react9.useCallback)(() => {
|
|
766
|
-
if (backEventContext.hasBackEvent) {
|
|
767
|
-
backEventContext.onBack();
|
|
768
|
-
return;
|
|
769
|
-
}
|
|
770
|
-
handleBackOrClose();
|
|
771
|
-
}, [backEventContext, handleBackOrClose]);
|
|
772
|
-
(0, import_react9.useEffect)(() => {
|
|
773
|
-
const handleAndroidBackEvent = () => {
|
|
774
|
-
handleBack();
|
|
775
|
-
return true;
|
|
776
|
-
};
|
|
777
|
-
import_react_native14.BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
778
|
-
return () => {
|
|
779
|
-
import_react_native14.BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
780
|
-
};
|
|
781
|
-
}, [handleBack]);
|
|
782
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
783
|
-
import_private3.TopNavigation,
|
|
1159
|
+
const navigationEvent = useNavigationEvent();
|
|
1160
|
+
useHardwareBackPress(navigationEvent.handleBack);
|
|
1161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1162
|
+
import_private5.TopNavigation,
|
|
784
1163
|
{
|
|
785
1164
|
title: globals.brandDisplayName,
|
|
786
1165
|
icon: toIcon(globals.brandIcon),
|
|
787
1166
|
onPressDots: openMoreButtonBottomSheet,
|
|
788
1167
|
contentVisible: true,
|
|
789
|
-
onPressTitle: withHomeButton ?
|
|
790
|
-
onPressClose:
|
|
1168
|
+
onPressTitle: withHomeButton ? navigationEvent.handleHomeButtonClick : void 0,
|
|
1169
|
+
onPressClose: navigationEvent.handleCloseButtonClick,
|
|
791
1170
|
withHome: withHomeButton,
|
|
792
|
-
fixedRightButton: initialAccessoryButton
|
|
793
|
-
|
|
794
|
-
icon: initialAccessoryButton.icon,
|
|
795
|
-
id: initialAccessoryButton.id
|
|
796
|
-
} : void 0,
|
|
797
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_private3.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_private3.NavigationBackButton, { onPress: handleBack, canGoBack: false }) })
|
|
1171
|
+
fixedRightButton: initialAccessoryButton,
|
|
1172
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_private5.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_private5.NavigationBackButton, { onPress: navigationEvent.handleBack, canGoBack: false }) })
|
|
798
1173
|
}
|
|
799
1174
|
) });
|
|
800
1175
|
}
|
|
801
|
-
function useBackOrCloseNavigation() {
|
|
802
|
-
const navigation = (0, import_react_native13.useNavigation)();
|
|
803
|
-
const { captureExitLog } = useCaptureExitLog();
|
|
804
|
-
return (0, import_react9.useCallback)(() => {
|
|
805
|
-
if (navigation.canGoBack()) {
|
|
806
|
-
navigation.goBack();
|
|
807
|
-
} else {
|
|
808
|
-
captureExitLog(Date.now());
|
|
809
|
-
(0, import_react_native13.closeView)();
|
|
810
|
-
}
|
|
811
|
-
}, [captureExitLog, navigation]);
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
// src/core/registerApp.tsx
|
|
815
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
816
|
-
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
817
|
-
if (!(0, import_native_modules9.isMinVersionSupported)({
|
|
818
|
-
android: "5.220.0",
|
|
819
|
-
ios: "5.221.0"
|
|
820
|
-
})) {
|
|
821
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
822
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.Entry, {}),
|
|
823
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.System, { ...initialProps }),
|
|
824
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppUpdate, {})
|
|
825
|
-
] });
|
|
826
|
-
}
|
|
827
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
828
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.StayTime, {}),
|
|
829
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.Entry, {}),
|
|
830
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.System, { ...initialProps }),
|
|
831
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_tds_react_native6.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TDSContainer, { ...initialProps, children }) }) })
|
|
832
|
-
] });
|
|
833
|
-
}
|
|
834
|
-
function TDSContainer({ children }) {
|
|
835
|
-
useAppsInTossBridge();
|
|
836
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children });
|
|
837
|
-
}
|
|
838
|
-
function registerApp(container, { context, analytics }) {
|
|
839
|
-
const appName = getAppName();
|
|
840
|
-
const isRegistered = import_react_native16.AppRegistry.getAppKeys().includes(appName);
|
|
841
|
-
if (!isRegistered) {
|
|
842
|
-
import_analytics.Analytics.init({
|
|
843
|
-
logger: (params) => void (0, import_native_modules9.eventLog)(params),
|
|
844
|
-
debug: analytics?.debug ?? __DEV__
|
|
845
|
-
});
|
|
846
|
-
const App = import_react_native15.Granite.registerApp(AppsInTossContainer.bind(null, container), {
|
|
847
|
-
appName,
|
|
848
|
-
context,
|
|
849
|
-
setIosSwipeGestureEnabled: import_native_modules9.setIosSwipeGestureEnabled,
|
|
850
|
-
router: {
|
|
851
|
-
screenContainer: AppsInTossScreenContainer,
|
|
852
|
-
defaultScreenOption: {
|
|
853
|
-
statusBarStyle: "dark"
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
});
|
|
857
|
-
global.Page = App;
|
|
858
|
-
}
|
|
859
|
-
return global.Page;
|
|
860
|
-
}
|
|
861
|
-
function AppsInTossScreenContainer({ children }) {
|
|
862
|
-
const isReactNativeService = getAppsInTossGlobals().webViewType == null;
|
|
863
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_analytics.Analytics.Screen, { children: [
|
|
864
|
-
isReactNativeService && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RNNavigationBar, {}),
|
|
865
|
-
children
|
|
866
|
-
] });
|
|
867
|
-
}
|
|
868
|
-
function getAppName() {
|
|
869
|
-
try {
|
|
870
|
-
return global.__granite.app.name;
|
|
871
|
-
} catch (error) {
|
|
872
|
-
console.error("unexpected error occurred while getting app name");
|
|
873
|
-
throw error;
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
// src/core/index.ts
|
|
878
|
-
var AppsInToss = {
|
|
879
|
-
registerApp
|
|
880
|
-
};
|
|
881
|
-
|
|
882
|
-
// src/components/WebView.tsx
|
|
883
|
-
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
884
|
-
var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async-bridges"), 1);
|
|
885
|
-
var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
|
|
886
|
-
var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event-bridges"), 1);
|
|
887
|
-
var import_react_native29 = require("@granite-js/react-native");
|
|
888
|
-
var import_tds_react_native13 = require("@toss/tds-react-native");
|
|
889
|
-
var import_private8 = require("@toss/tds-react-native/private");
|
|
890
|
-
var import_react21 = require("react");
|
|
891
|
-
var import_react_native30 = require("react-native");
|
|
892
1176
|
|
|
893
|
-
// src/components/
|
|
894
|
-
var import_native_modules13 = require("@apps-in-toss/native-modules");
|
|
895
|
-
var import_react_native_webview = require("@granite-js/native/react-native-webview");
|
|
896
|
-
var import_react13 = require("react");
|
|
897
|
-
var import_react_native22 = require("react-native");
|
|
898
|
-
|
|
899
|
-
// src/components/GameProfile.tsx
|
|
900
|
-
var import_native_modules12 = require("@apps-in-toss/native-modules");
|
|
1177
|
+
// src/components/NavigationBar/RNNavigationBar/Game.tsx
|
|
901
1178
|
var import_tds_react_native9 = require("@toss/tds-react-native");
|
|
902
|
-
var
|
|
1179
|
+
var import_private6 = require("@toss/tds-react-native/private");
|
|
903
1180
|
var import_react_native19 = require("react-native");
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
text: `${nickname}\uB2D8 \uBC18\uAC00\uC6CC\uC694!`,
|
|
939
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
940
|
-
import_tds_react_native7.Asset.Image,
|
|
941
|
-
{
|
|
942
|
-
style: { borderRadius: 64, overflow: "hidden" },
|
|
943
|
-
frameShape: import_tds_react_native7.Asset.frameShape.CleanW32,
|
|
944
|
-
source: { uri: profileImageUri }
|
|
945
|
-
}
|
|
946
|
-
)
|
|
947
|
-
}
|
|
948
|
-
) }) });
|
|
949
|
-
});
|
|
950
|
-
});
|
|
951
|
-
};
|
|
952
|
-
return { openGameProfileToast };
|
|
953
|
-
};
|
|
954
|
-
|
|
955
|
-
// src/utils/error.ts
|
|
956
|
-
var DEFAULT_ERROR = {
|
|
957
|
-
title: "\uC7A0\uC2DC \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694",
|
|
958
|
-
description: "\uBB38\uC81C\uAC00 \uACC4\uC18D\uB418\uBA74 \uD1A0\uC2A4 \uACE0\uAC1D\uC13C\uD130(1599-4905)\uB85C \uBB38\uC758\uD574\uC8FC\uC138\uC694."
|
|
959
|
-
};
|
|
960
|
-
|
|
961
|
-
// src/utils/openTransparentWebView.ts
|
|
962
|
-
var import_react_native17 = require("@granite-js/react-native");
|
|
963
|
-
|
|
964
|
-
// src/private.ts
|
|
965
|
-
var import_native_modules10 = require("@apps-in-toss/native-modules");
|
|
966
|
-
var INTERNAL__onVisibilityChangedByTransparentServiceWeb = import_native_modules10.onVisibilityChangedByTransparentServiceWeb;
|
|
967
|
-
|
|
968
|
-
// src/utils/openTransparentWebView.ts
|
|
969
|
-
var openTransparentWebView = ({
|
|
970
|
-
webUrl,
|
|
971
|
-
cleanupWhenDismissed = true,
|
|
972
|
-
onEvent,
|
|
973
|
-
onError,
|
|
974
|
-
callbackId = "fn",
|
|
975
|
-
params
|
|
976
|
-
}) => {
|
|
977
|
-
const url = new URL("supertoss://transparent-service-web");
|
|
978
|
-
url.searchParams.set("url", webUrl);
|
|
979
|
-
url.searchParams.set("onVisibilityChangeCallback", callbackId);
|
|
980
|
-
Object.entries(params ?? {}).forEach(([key, value]) => {
|
|
981
|
-
url.searchParams.set(key, value);
|
|
982
|
-
});
|
|
983
|
-
const cleanup = INTERNAL__onVisibilityChangedByTransparentServiceWeb({
|
|
984
|
-
options: { callbackId },
|
|
985
|
-
onError: (error) => {
|
|
986
|
-
onError(error);
|
|
987
|
-
cleanup();
|
|
988
|
-
},
|
|
989
|
-
onEvent: (value) => {
|
|
990
|
-
onEvent(value);
|
|
991
|
-
if (cleanupWhenDismissed && value === true) {
|
|
992
|
-
cleanup();
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
});
|
|
996
|
-
(0, import_react_native17.openURL)(url.toString());
|
|
997
|
-
};
|
|
998
|
-
|
|
999
|
-
// src/hooks/useGameCenterProfile.ts
|
|
1000
|
-
var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
1001
|
-
const [profileData, setProfileData] = (0, import_react10.useState)(void 0);
|
|
1002
|
-
const [isProfileDataLoading, setIsProfileDataLoading] = (0, import_react10.useState)(true);
|
|
1003
|
-
const [isProfileDataRefetching, setIsProfileDataRefetching] = (0, import_react10.useState)(false);
|
|
1004
|
-
const shouldShowLoadingOverlay = isProfileDataLoading && isReadyForProfileUI;
|
|
1005
|
-
const shouldShowProfileNotFoundOverlay = profileData?.statusCode === "PROFILE_NOT_FOUND" && isReadyForProfileUI && !isProfileDataRefetching;
|
|
1006
|
-
const canShowBottomSheetOrToast = !isProfileDataLoading && isReadyForProfileUI;
|
|
1007
|
-
const [isWebviewLoading, setIsWebviewLoading] = (0, import_react10.useState)(false);
|
|
1008
|
-
const isCompletedProfileFlow = (0, import_react10.useRef)(false);
|
|
1009
|
-
const { openAlert, openConfirm } = (0, import_tds_react_native8.useDialog)();
|
|
1010
|
-
const { openGameProfileToast } = useGameProfileToast();
|
|
1011
|
-
const openErrorAlert = (0, import_react10.useCallback)(async () => {
|
|
1012
|
-
await openAlert({
|
|
1013
|
-
title: DEFAULT_ERROR.title,
|
|
1014
|
-
description: DEFAULT_ERROR.description
|
|
1015
|
-
});
|
|
1016
|
-
(0, import_react_native18.closeView)();
|
|
1017
|
-
}, [openAlert]);
|
|
1018
|
-
const openProfileWebview = (0, import_react10.useCallback)(() => {
|
|
1019
|
-
if (isWebviewLoading) {
|
|
1020
|
-
return;
|
|
1021
|
-
}
|
|
1022
|
-
setIsWebviewLoading(true);
|
|
1023
|
-
openTransparentWebView({
|
|
1024
|
-
webUrl: `${GAME_PROFILE_WEBVIEW_URL}?appName=${getAppName()}&referrer=appsintoss.${getAppName()}`,
|
|
1025
|
-
onEvent: async (isClosedTransparentWebView) => {
|
|
1026
|
-
if (isClosedTransparentWebView) {
|
|
1027
|
-
try {
|
|
1028
|
-
setIsWebviewLoading(false);
|
|
1029
|
-
setIsProfileDataRefetching(true);
|
|
1030
|
-
const data = await (0, import_native_modules11.getGameCenterGameProfile)();
|
|
1031
|
-
setProfileData(data);
|
|
1032
|
-
setIsProfileDataRefetching(false);
|
|
1033
|
-
if (data?.statusCode === "SUCCESS") {
|
|
1034
|
-
openGameProfileToast(data.nickname, data.profileImageUri);
|
|
1035
|
-
}
|
|
1036
|
-
} catch (_) {
|
|
1037
|
-
setIsProfileDataRefetching(false);
|
|
1038
|
-
openErrorAlert();
|
|
1181
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1182
|
+
function GameNavigationBar() {
|
|
1183
|
+
const safeAreaTop = (0, import_private6.useSafeAreaTop)();
|
|
1184
|
+
const global2 = getAppsInTossGlobals();
|
|
1185
|
+
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1186
|
+
const navigationEvent = useNavigationEvent();
|
|
1187
|
+
useHardwareBackPress(navigationEvent.handleBack);
|
|
1188
|
+
const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
|
|
1189
|
+
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
1190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1191
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tds_react_native9.PageNavbar, { preference: { type: "none" } }),
|
|
1192
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1193
|
+
import_react_native19.View,
|
|
1194
|
+
{
|
|
1195
|
+
style: {
|
|
1196
|
+
width: "100%",
|
|
1197
|
+
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1198
|
+
height: import_react_native19.Platform.OS === "ios" ? 44 : 54,
|
|
1199
|
+
flexDirection: "row",
|
|
1200
|
+
alignItems: "center",
|
|
1201
|
+
justifyContent: "flex-end",
|
|
1202
|
+
position: "absolute",
|
|
1203
|
+
zIndex: Z_INDEX.CLOSE_BUTTON,
|
|
1204
|
+
marginTop: safeAreaTop,
|
|
1205
|
+
paddingRight: 10
|
|
1206
|
+
},
|
|
1207
|
+
pointerEvents: "box-none",
|
|
1208
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1209
|
+
import_private6.NavigationRightContent,
|
|
1210
|
+
{
|
|
1211
|
+
fixedRightButton: initialAccessoryButton,
|
|
1212
|
+
onPressDots: openMoreButtonBottomSheet,
|
|
1213
|
+
onPressClose: navigationEvent.handleCloseButtonClick,
|
|
1214
|
+
theme: "dark"
|
|
1039
1215
|
}
|
|
1040
|
-
|
|
1041
|
-
},
|
|
1042
|
-
onError: () => {
|
|
1043
|
-
openErrorAlert();
|
|
1216
|
+
)
|
|
1044
1217
|
}
|
|
1045
|
-
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
const upddateConfirmDialogLabel = {
|
|
1049
|
-
title: `${(0, import_es_hangul2.josa)(getAppsInTossGlobals().brandDisplayName, "\uC744/\uB97C")} \uD558\uB824\uBA74
|
|
1050
|
-
\uC571\uC744 \uC5C5\uB370\uC774\uD2B8\uD574\uC8FC\uC138\uC694`,
|
|
1051
|
-
leftButton: "\uB2EB\uAE30",
|
|
1052
|
-
rightButton: "\uC5C5\uB370\uC774\uD2B8\uD558\uAE30"
|
|
1053
|
-
};
|
|
1054
|
-
const isConfirmed = await openConfirm({
|
|
1055
|
-
title: upddateConfirmDialogLabel.title,
|
|
1056
|
-
leftButton: upddateConfirmDialogLabel.leftButton,
|
|
1057
|
-
rightButton: upddateConfirmDialogLabel.rightButton,
|
|
1058
|
-
closeOnDimmerClick: true
|
|
1059
|
-
});
|
|
1060
|
-
if (!isConfirmed) {
|
|
1061
|
-
(0, import_react_native18.closeView)();
|
|
1062
|
-
return;
|
|
1063
|
-
}
|
|
1064
|
-
const STORE_SCHEME = getMarketLink();
|
|
1065
|
-
(0, import_react_native18.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
|
|
1066
|
-
}, [openConfirm]);
|
|
1067
|
-
return {
|
|
1068
|
-
profileData,
|
|
1069
|
-
isProfileDataLoading,
|
|
1070
|
-
isProfileDataRefetching,
|
|
1071
|
-
shouldShowLoadingOverlay,
|
|
1072
|
-
shouldShowProfileNotFoundOverlay,
|
|
1073
|
-
canShowBottomSheetOrToast,
|
|
1074
|
-
isCompletedProfileFlow,
|
|
1075
|
-
updateAppToSupportedMinVersion,
|
|
1076
|
-
setIsProfileDataLoading,
|
|
1077
|
-
openProfileWebview,
|
|
1078
|
-
setProfileData,
|
|
1079
|
-
openErrorAlert,
|
|
1080
|
-
openGameProfileToast
|
|
1081
|
-
};
|
|
1082
|
-
};
|
|
1218
|
+
)
|
|
1219
|
+
] });
|
|
1220
|
+
}
|
|
1083
1221
|
|
|
1084
|
-
// src/
|
|
1085
|
-
var
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
PROFILE_OVERLAY: 9998,
|
|
1089
|
-
// 게임을 종료할 수 있는 X 버튼
|
|
1090
|
-
CLOSE_BUTTON: 9999
|
|
1222
|
+
// src/components/NavigationBar/RNNavigationBar/index.tsx
|
|
1223
|
+
var RNNavigationBar = {
|
|
1224
|
+
Default: DefaultNavigationBar,
|
|
1225
|
+
Game: GameNavigationBar
|
|
1091
1226
|
};
|
|
1092
1227
|
|
|
1093
|
-
// src/
|
|
1094
|
-
var
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1228
|
+
// src/bridge-entry.ts
|
|
1229
|
+
var bridge_entry_exports = {};
|
|
1230
|
+
__reExport(bridge_entry_exports, require("@apps-in-toss/native-modules/async-bridges"));
|
|
1231
|
+
__reExport(bridge_entry_exports, require("@apps-in-toss/native-modules/constant-bridges"));
|
|
1232
|
+
__reExport(bridge_entry_exports, require("@apps-in-toss/native-modules/event-bridges"));
|
|
1233
|
+
|
|
1234
|
+
// src/components/RNAppContainer.tsx
|
|
1235
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1236
|
+
function RNAppContainer({ children }) {
|
|
1237
|
+
const global2 = getAppsInTossGlobals();
|
|
1238
|
+
switch (global2.appType) {
|
|
1239
|
+
case "game":
|
|
1240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GameAppContainer, { children });
|
|
1241
|
+
case "general":
|
|
1242
|
+
default:
|
|
1243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GeneralAppContainer, { children });
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
function GameAppContainer({ children }) {
|
|
1247
|
+
const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react17.useState)(false);
|
|
1248
|
+
(0, import_react17.useEffect)(() => {
|
|
1249
|
+
if (import_react_native20.Platform.OS === "ios") {
|
|
1250
|
+
(0, import_native_modules12.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1251
|
+
return () => {
|
|
1252
|
+
(0, import_native_modules12.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1116
1253
|
};
|
|
1117
|
-
getProfileData();
|
|
1118
|
-
} catch (_) {
|
|
1119
|
-
openErrorAlert();
|
|
1120
|
-
setIsProfileDataLoading(false);
|
|
1121
1254
|
}
|
|
1255
|
+
return;
|
|
1122
1256
|
}, []);
|
|
1123
|
-
(0,
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
}
|
|
1128
|
-
if (isCompletedProfileFlow.current) {
|
|
1129
|
-
return;
|
|
1130
|
-
}
|
|
1131
|
-
isCompletedProfileFlow.current = true;
|
|
1132
|
-
if (!(0, import_native_modules12.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
|
|
1133
|
-
updateAppToSupportedMinVersion();
|
|
1134
|
-
return;
|
|
1135
|
-
}
|
|
1136
|
-
if (profileData?.statusCode === "SUCCESS") {
|
|
1137
|
-
openGameProfileToast(profileData.nickname, profileData.profileImageUri);
|
|
1138
|
-
return;
|
|
1139
|
-
}
|
|
1140
|
-
if (profileData?.statusCode === "PROFILE_NOT_FOUND") {
|
|
1141
|
-
openProfileWebview();
|
|
1257
|
+
(0, import_react17.useEffect)(() => {
|
|
1258
|
+
import_native_modules12.appsInTossEvent.addEventListener("entryMessageExited", {
|
|
1259
|
+
onEvent: () => {
|
|
1260
|
+
setIsEntryMessageExited(true);
|
|
1142
1261
|
}
|
|
1143
|
-
};
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
)
|
|
1262
|
+
});
|
|
1263
|
+
}, []);
|
|
1264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1265
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RNNavigationBar.Game, {}),
|
|
1266
|
+
(0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GameInitializer, { isReadyForProfileUI: isEntryMessageExited, children }) : children
|
|
1267
|
+
] });
|
|
1268
|
+
}
|
|
1269
|
+
function GeneralAppContainer({ children }) {
|
|
1270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1271
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RNNavigationBar.Default, {}),
|
|
1272
|
+
children
|
|
1273
|
+
] });
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
// src/core/registerApp.tsx
|
|
1277
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1278
|
+
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
1279
|
+
if (!(0, import_native_modules13.isMinVersionSupported)({
|
|
1280
|
+
android: "5.220.0",
|
|
1281
|
+
ios: "5.221.0"
|
|
1282
|
+
})) {
|
|
1283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
1284
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AppEvent.Entry, {}),
|
|
1285
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AppEvent.System, { ...initialProps }),
|
|
1286
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AppUpdate, {})
|
|
1167
1287
|
] });
|
|
1168
1288
|
}
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
1290
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AppEvent.StayTime, {}),
|
|
1291
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AppEvent.Entry, {}),
|
|
1292
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AppEvent.System, { ...initialProps }),
|
|
1293
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tds_react_native10.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TDSContainer, { ...initialProps, children }) }) })
|
|
1294
|
+
] });
|
|
1295
|
+
}
|
|
1296
|
+
function TDSContainer({ children }) {
|
|
1297
|
+
useAppsInTossBridge();
|
|
1298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children });
|
|
1299
|
+
}
|
|
1300
|
+
function registerApp(container, { context, analytics }) {
|
|
1301
|
+
const appName = getAppName();
|
|
1302
|
+
const isRegistered = import_react_native22.AppRegistry.getAppKeys().includes(appName);
|
|
1303
|
+
if (!isRegistered) {
|
|
1304
|
+
import_analytics.Analytics.init({
|
|
1305
|
+
logger: (params) => void (0, import_native_modules13.eventLog)(params),
|
|
1306
|
+
debug: analytics?.debug ?? __DEV__
|
|
1307
|
+
});
|
|
1308
|
+
const App = import_react_native21.Granite.registerApp(AppsInTossContainer.bind(null, container), {
|
|
1309
|
+
appName,
|
|
1310
|
+
context,
|
|
1311
|
+
setIosSwipeGestureEnabled: import_native_modules13.setIosSwipeGestureEnabled,
|
|
1312
|
+
router: {
|
|
1313
|
+
screenContainer: AppsInTossScreenContainer,
|
|
1314
|
+
defaultScreenOption: {
|
|
1315
|
+
statusBarStyle: "dark"
|
|
1182
1316
|
}
|
|
1183
|
-
|
|
1184
|
-
|
|
1317
|
+
}
|
|
1318
|
+
});
|
|
1319
|
+
global.Page = App;
|
|
1185
1320
|
}
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
}
|
|
1199
|
-
)
|
|
1200
|
-
] });
|
|
1321
|
+
return global.Page;
|
|
1322
|
+
}
|
|
1323
|
+
function AppsInTossScreenContainer({ children }) {
|
|
1324
|
+
const isRNApp = getAppsInTossGlobals().webViewType == null;
|
|
1325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_analytics.Analytics.Screen, { children: isRNApp ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RNAppContainer, { children }) : children });
|
|
1326
|
+
}
|
|
1327
|
+
function getAppName() {
|
|
1328
|
+
try {
|
|
1329
|
+
return global.__granite.app.name;
|
|
1330
|
+
} catch (error) {
|
|
1331
|
+
console.error("unexpected error occurred while getting app name");
|
|
1332
|
+
throw error;
|
|
1201
1333
|
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
left: 0,
|
|
1208
|
-
right: 0,
|
|
1209
|
-
bottom: 0,
|
|
1210
|
-
zIndex: Z_INDEX.PROFILE_OVERLAY
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
// src/core/index.ts
|
|
1337
|
+
var AppsInToss = {
|
|
1338
|
+
registerApp
|
|
1211
1339
|
};
|
|
1212
1340
|
|
|
1341
|
+
// src/components/WebView.tsx
|
|
1342
|
+
var import_native_modules18 = require("@apps-in-toss/native-modules");
|
|
1343
|
+
var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async-bridges"), 1);
|
|
1344
|
+
var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
|
|
1345
|
+
var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event-bridges"), 1);
|
|
1346
|
+
var import_react_native32 = require("@granite-js/react-native");
|
|
1347
|
+
var import_tds_react_native14 = require("@toss/tds-react-native");
|
|
1348
|
+
var import_private9 = require("@toss/tds-react-native/private");
|
|
1349
|
+
var import_react27 = require("react");
|
|
1350
|
+
var import_react_native33 = require("react-native");
|
|
1351
|
+
|
|
1352
|
+
// src/components/GameWebView.tsx
|
|
1353
|
+
var import_native_modules14 = require("@apps-in-toss/native-modules");
|
|
1354
|
+
var import_react_native_webview = require("@granite-js/native/react-native-webview");
|
|
1355
|
+
var import_react19 = require("react");
|
|
1356
|
+
var import_react_native25 = require("react-native");
|
|
1357
|
+
|
|
1213
1358
|
// src/components/NavigationBar/GameWebviewNavigationBar.tsx
|
|
1214
|
-
var
|
|
1215
|
-
var
|
|
1216
|
-
var
|
|
1359
|
+
var import_react_native23 = require("@granite-js/react-native");
|
|
1360
|
+
var import_tds_react_native11 = require("@toss/tds-react-native");
|
|
1361
|
+
var import_private7 = require("@toss/tds-react-native/private");
|
|
1217
1362
|
var import_es_hangul3 = require("es-hangul");
|
|
1218
|
-
var
|
|
1219
|
-
var
|
|
1220
|
-
var
|
|
1363
|
+
var import_react18 = require("react");
|
|
1364
|
+
var import_react_native24 = require("react-native");
|
|
1365
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1221
1366
|
function GameWebviewNavigationBar() {
|
|
1222
|
-
const safeAreaTop = (0,
|
|
1223
|
-
const { openConfirm } = (0,
|
|
1367
|
+
const safeAreaTop = (0, import_private7.useSafeAreaTop)();
|
|
1368
|
+
const { openConfirm } = (0, import_tds_react_native11.useDialog)();
|
|
1224
1369
|
const { captureExitLog } = useCaptureExitLog();
|
|
1225
1370
|
const global2 = getAppsInTossGlobals();
|
|
1226
1371
|
const logging = useNavigationBarLogging();
|
|
1227
1372
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1228
1373
|
const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
|
|
1229
1374
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
1230
|
-
const handleGameWebviewClose = (0,
|
|
1375
|
+
const handleGameWebviewClose = (0, import_react18.useCallback)(async () => {
|
|
1231
1376
|
logging.closeButtonClick();
|
|
1232
1377
|
const isConfirmed = await openConfirm({
|
|
1233
1378
|
title: `${(0, import_es_hangul3.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
@@ -1239,18 +1384,18 @@ function GameWebviewNavigationBar() {
|
|
|
1239
1384
|
logging.closePopupCtaClick(isConfirmed);
|
|
1240
1385
|
if (isConfirmed) {
|
|
1241
1386
|
captureExitLog(Date.now());
|
|
1242
|
-
(0,
|
|
1387
|
+
(0, import_react_native23.closeView)();
|
|
1243
1388
|
}
|
|
1244
1389
|
}, [captureExitLog, global2.brandDisplayName, logging, openConfirm]);
|
|
1245
|
-
return /* @__PURE__ */ (0,
|
|
1246
|
-
/* @__PURE__ */ (0,
|
|
1247
|
-
/* @__PURE__ */ (0,
|
|
1248
|
-
|
|
1390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1391
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_tds_react_native11.PageNavbar, { preference: { type: "none" } }),
|
|
1392
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1393
|
+
import_react_native24.View,
|
|
1249
1394
|
{
|
|
1250
1395
|
style: {
|
|
1251
1396
|
width: "100%",
|
|
1252
1397
|
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1253
|
-
height:
|
|
1398
|
+
height: import_react_native24.Platform.OS === "ios" ? 44 : 54,
|
|
1254
1399
|
flexDirection: "row",
|
|
1255
1400
|
alignItems: "center",
|
|
1256
1401
|
justifyContent: "flex-end",
|
|
@@ -1260,8 +1405,8 @@ function GameWebviewNavigationBar() {
|
|
|
1260
1405
|
paddingRight: 10
|
|
1261
1406
|
},
|
|
1262
1407
|
pointerEvents: "box-none",
|
|
1263
|
-
children: /* @__PURE__ */ (0,
|
|
1264
|
-
|
|
1408
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1409
|
+
import_private7.NavigationRightContent,
|
|
1265
1410
|
{
|
|
1266
1411
|
fixedRightButton: initialAccessoryButton,
|
|
1267
1412
|
onPressDots: openMoreButtonBottomSheet,
|
|
@@ -1277,53 +1422,53 @@ function GameWebviewNavigationBar() {
|
|
|
1277
1422
|
}
|
|
1278
1423
|
|
|
1279
1424
|
// src/components/GameWebView.tsx
|
|
1280
|
-
var
|
|
1281
|
-
var GameWebView = (0,
|
|
1282
|
-
const [isEntryMessageExited, setIsEntryMessageExited] = (0,
|
|
1283
|
-
(0,
|
|
1284
|
-
if (
|
|
1285
|
-
(0,
|
|
1425
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1426
|
+
var GameWebView = (0, import_react19.forwardRef)(function GameWebView2(props, ref) {
|
|
1427
|
+
const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react19.useState)(false);
|
|
1428
|
+
(0, import_react19.useEffect)(() => {
|
|
1429
|
+
if (import_react_native25.Platform.OS === "ios") {
|
|
1430
|
+
(0, import_native_modules14.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1286
1431
|
return () => {
|
|
1287
|
-
(0,
|
|
1432
|
+
(0, import_native_modules14.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1288
1433
|
};
|
|
1289
1434
|
}
|
|
1290
1435
|
return;
|
|
1291
1436
|
}, []);
|
|
1292
|
-
(0,
|
|
1293
|
-
|
|
1437
|
+
(0, import_react19.useEffect)(() => {
|
|
1438
|
+
import_native_modules14.appsInTossEvent.addEventListener("entryMessageExited", {
|
|
1294
1439
|
onEvent: () => {
|
|
1295
1440
|
setIsEntryMessageExited(true);
|
|
1296
1441
|
}
|
|
1297
1442
|
});
|
|
1298
1443
|
}, []);
|
|
1299
|
-
return /* @__PURE__ */ (0,
|
|
1300
|
-
/* @__PURE__ */ (0,
|
|
1301
|
-
(0,
|
|
1444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1445
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GameWebviewNavigationBar, {}),
|
|
1446
|
+
(0, import_native_modules14.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GameInitializer, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native_webview.WebView, { ref, ...props }) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native_webview.WebView, { ref, ...props })
|
|
1302
1447
|
] });
|
|
1303
1448
|
});
|
|
1304
1449
|
|
|
1305
1450
|
// src/components/PartnerWebView.tsx
|
|
1306
1451
|
var import_react_native_webview2 = require("@granite-js/native/react-native-webview");
|
|
1307
|
-
var
|
|
1452
|
+
var import_react21 = require("react");
|
|
1308
1453
|
|
|
1309
1454
|
// src/components/NavigationBar/PartnerWebviewNavigationBar.tsx
|
|
1310
|
-
var
|
|
1311
|
-
var
|
|
1312
|
-
var
|
|
1455
|
+
var import_react_native26 = require("@granite-js/react-native");
|
|
1456
|
+
var import_tds_react_native12 = require("@toss/tds-react-native");
|
|
1457
|
+
var import_private8 = require("@toss/tds-react-native/private");
|
|
1313
1458
|
var import_es_hangul4 = require("es-hangul");
|
|
1314
|
-
var
|
|
1315
|
-
var
|
|
1459
|
+
var import_react20 = require("react");
|
|
1460
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1316
1461
|
function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
1317
1462
|
const globals = getAppsInTossGlobals();
|
|
1318
1463
|
const { captureExitLog } = useCaptureExitLog();
|
|
1319
1464
|
const logging = useNavigationBarLogging();
|
|
1320
|
-
const { openConfirm } = (0,
|
|
1465
|
+
const { openConfirm } = (0, import_tds_react_native12.useDialog)();
|
|
1321
1466
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1322
1467
|
const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
|
|
1323
1468
|
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
1324
1469
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
1325
1470
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
1326
|
-
const handleClose = (0,
|
|
1471
|
+
const handleClose = (0, import_react20.useCallback)(async () => {
|
|
1327
1472
|
logging.closeButtonClick();
|
|
1328
1473
|
const isConfirmed = await openConfirm({
|
|
1329
1474
|
title: `${(0, import_es_hangul4.josa)(globals.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
@@ -1335,11 +1480,11 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1335
1480
|
logging.closePopupCtaClick(isConfirmed);
|
|
1336
1481
|
if (isConfirmed) {
|
|
1337
1482
|
captureExitLog(Date.now());
|
|
1338
|
-
(0,
|
|
1483
|
+
(0, import_react_native26.closeView)();
|
|
1339
1484
|
}
|
|
1340
1485
|
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
1341
|
-
return /* @__PURE__ */ (0,
|
|
1342
|
-
|
|
1486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1487
|
+
import_private8.TopNavigation,
|
|
1343
1488
|
{
|
|
1344
1489
|
title: globals.brandDisplayName,
|
|
1345
1490
|
icon: toIcon(globals.brandIcon),
|
|
@@ -1349,22 +1494,22 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1349
1494
|
onPressClose: handleClose,
|
|
1350
1495
|
withHome: withHomeButton,
|
|
1351
1496
|
fixedRightButton: initialAccessoryButton,
|
|
1352
|
-
children: /* @__PURE__ */ (0,
|
|
1497
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_private8.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_private8.NavigationBackButton, { onPress: onBackButtonClick, canGoBack: false }) })
|
|
1353
1498
|
}
|
|
1354
1499
|
) });
|
|
1355
1500
|
}
|
|
1356
1501
|
|
|
1357
1502
|
// src/components/PartnerWebView.tsx
|
|
1358
|
-
var
|
|
1359
|
-
var PartnerWebView = (0,
|
|
1360
|
-
return /* @__PURE__ */ (0,
|
|
1361
|
-
/* @__PURE__ */ (0,
|
|
1362
|
-
/* @__PURE__ */ (0,
|
|
1503
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1504
|
+
var PartnerWebView = (0, import_react21.forwardRef)(function PartnerWebViewScreen({ onBackButtonClick, onHomeButtonClick, ...webViewProps }, ref) {
|
|
1505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1506
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PartnerWebviewNavigationBar, { onBackButtonClick, onHomeButtonClick }),
|
|
1507
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_webview2.WebView, { ref, ...webViewProps, style: { flex: 1 } })
|
|
1363
1508
|
] });
|
|
1364
1509
|
});
|
|
1365
1510
|
|
|
1366
1511
|
// src/bridge-handler/useBridgeHandler.tsx
|
|
1367
|
-
var
|
|
1512
|
+
var import_react22 = require("react");
|
|
1368
1513
|
function serializeError(error) {
|
|
1369
1514
|
return JSON.stringify(error, (_, value) => {
|
|
1370
1515
|
if (value instanceof Error) {
|
|
@@ -1417,8 +1562,8 @@ function useBridgeHandler({
|
|
|
1417
1562
|
eventListenerMap,
|
|
1418
1563
|
injectedJavaScript: originalInjectedJavaScript
|
|
1419
1564
|
}) {
|
|
1420
|
-
const ref = (0,
|
|
1421
|
-
const injectedJavaScript = (0,
|
|
1565
|
+
const ref = (0, import_react22.useRef)(null);
|
|
1566
|
+
const injectedJavaScript = (0, import_react22.useMemo)(
|
|
1422
1567
|
() => [
|
|
1423
1568
|
`window.__CONSTANT_HANDLER_MAP = ${JSON.stringify(
|
|
1424
1569
|
Object.entries(constantHandlerMap).reduce(
|
|
@@ -1445,7 +1590,7 @@ function useBridgeHandler({
|
|
|
1445
1590
|
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
|
|
1446
1591
|
`);
|
|
1447
1592
|
};
|
|
1448
|
-
const $onMessage = (0,
|
|
1593
|
+
const $onMessage = (0, import_react22.useCallback)(
|
|
1449
1594
|
async (e) => {
|
|
1450
1595
|
onMessage?.(e);
|
|
1451
1596
|
const data = JSON.parse(e.nativeEvent.data);
|
|
@@ -1496,13 +1641,13 @@ function useBridgeHandler({
|
|
|
1496
1641
|
}
|
|
1497
1642
|
|
|
1498
1643
|
// src/core/hooks/useWebBackHandler.tsx
|
|
1499
|
-
var
|
|
1500
|
-
var
|
|
1644
|
+
var import_react_native27 = require("@granite-js/react-native");
|
|
1645
|
+
var import_tds_react_native13 = require("@toss/tds-react-native");
|
|
1501
1646
|
var import_es_hangul5 = require("es-hangul");
|
|
1502
|
-
var
|
|
1647
|
+
var import_react24 = require("react");
|
|
1503
1648
|
|
|
1504
1649
|
// src/hooks/useWebviewHistoryStack.tsx
|
|
1505
|
-
var
|
|
1650
|
+
var import_react23 = require("react");
|
|
1506
1651
|
var INITIAL_STATE = { stack: [], index: -1 };
|
|
1507
1652
|
function reducer(state, action) {
|
|
1508
1653
|
switch (action.type) {
|
|
@@ -1533,11 +1678,11 @@ function reducer(state, action) {
|
|
|
1533
1678
|
}
|
|
1534
1679
|
}
|
|
1535
1680
|
function useWebViewHistory() {
|
|
1536
|
-
const [state, dispatch] = (0,
|
|
1537
|
-
const onNavigationStateChange = (0,
|
|
1681
|
+
const [state, dispatch] = (0, import_react23.useReducer)(reducer, INITIAL_STATE);
|
|
1682
|
+
const onNavigationStateChange = (0, import_react23.useCallback)(({ url, canGoForward: canGoForward2 }) => {
|
|
1538
1683
|
dispatch({ type: "NAVIGATION_CHANGE", url, canGoForward: canGoForward2 });
|
|
1539
1684
|
}, []);
|
|
1540
|
-
const { canGoBack, canGoForward } = (0,
|
|
1685
|
+
const { canGoBack, canGoForward } = (0, import_react23.useMemo)(() => {
|
|
1541
1686
|
const canBack = state.index > 0;
|
|
1542
1687
|
const canFwd = state.index >= 0 && state.index < state.stack.length - 1;
|
|
1543
1688
|
return { canGoBack: canBack, canGoForward: canFwd };
|
|
@@ -1566,23 +1711,23 @@ function useWebBackHandler(webViewRef) {
|
|
|
1566
1711
|
hasBackEvent: hasWebBackEvent,
|
|
1567
1712
|
addEventListener: addWebBackEventListener,
|
|
1568
1713
|
removeEventListener: removeWebBackEventListener
|
|
1569
|
-
} = (0,
|
|
1714
|
+
} = (0, import_react_native27.useBackEventState)();
|
|
1570
1715
|
const logging = useNavigationBarLogging();
|
|
1571
|
-
const { openConfirm } = (0,
|
|
1716
|
+
const { openConfirm } = (0, import_tds_react_native13.useDialog)();
|
|
1572
1717
|
const global2 = getAppsInTossGlobals();
|
|
1573
|
-
const addEventListener = (0,
|
|
1718
|
+
const addEventListener = (0, import_react24.useCallback)(
|
|
1574
1719
|
(handler) => {
|
|
1575
1720
|
addWebBackEventListener(handler);
|
|
1576
1721
|
},
|
|
1577
1722
|
[addWebBackEventListener]
|
|
1578
1723
|
);
|
|
1579
|
-
const removeEventListener = (0,
|
|
1724
|
+
const removeEventListener = (0, import_react24.useCallback)(
|
|
1580
1725
|
(handler) => {
|
|
1581
1726
|
removeWebBackEventListener(handler);
|
|
1582
1727
|
},
|
|
1583
1728
|
[removeWebBackEventListener]
|
|
1584
1729
|
);
|
|
1585
|
-
const handleWebBack = (0,
|
|
1730
|
+
const handleWebBack = (0, import_react24.useCallback)(async () => {
|
|
1586
1731
|
if (hasWebBackEvent) {
|
|
1587
1732
|
for (const handler of webBackHandlersRef) {
|
|
1588
1733
|
handler();
|
|
@@ -1602,7 +1747,7 @@ function useWebBackHandler(webViewRef) {
|
|
|
1602
1747
|
logging.closePopupCtaClick(isConfirmed);
|
|
1603
1748
|
if (isConfirmed) {
|
|
1604
1749
|
captureExitLog(Date.now());
|
|
1605
|
-
(0,
|
|
1750
|
+
(0, import_react_native27.closeView)();
|
|
1606
1751
|
}
|
|
1607
1752
|
}
|
|
1608
1753
|
}, [
|
|
@@ -1615,7 +1760,7 @@ function useWebBackHandler(webViewRef) {
|
|
|
1615
1760
|
openConfirm,
|
|
1616
1761
|
webViewRef
|
|
1617
1762
|
]);
|
|
1618
|
-
const handleWebHome = (0,
|
|
1763
|
+
const handleWebHome = (0, import_react24.useCallback)(() => {
|
|
1619
1764
|
logging.homeButtonClick();
|
|
1620
1765
|
if (hasWebBackEvent) {
|
|
1621
1766
|
for (const handler of webBackHandlersRef) {
|
|
@@ -1625,7 +1770,7 @@ function useWebBackHandler(webViewRef) {
|
|
|
1625
1770
|
}
|
|
1626
1771
|
webViewRef.current?.injectJavaScript(HISTORY_HOME_SCRIPT);
|
|
1627
1772
|
}, [hasWebBackEvent, webBackHandlersRef, logging, webViewRef]);
|
|
1628
|
-
return (0,
|
|
1773
|
+
return (0, import_react24.useMemo)(
|
|
1629
1774
|
() => ({ addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange }),
|
|
1630
1775
|
[addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange]
|
|
1631
1776
|
);
|
|
@@ -1645,8 +1790,8 @@ function mergeRefs(...refs) {
|
|
|
1645
1790
|
}
|
|
1646
1791
|
|
|
1647
1792
|
// src/hooks/useCreateUserAgent.ts
|
|
1648
|
-
var
|
|
1649
|
-
var
|
|
1793
|
+
var import_native_modules15 = require("@apps-in-toss/native-modules");
|
|
1794
|
+
var import_react_native28 = require("react-native");
|
|
1650
1795
|
var FontA11yCategory = {
|
|
1651
1796
|
Large: "Large",
|
|
1652
1797
|
xLarge: "xLarge",
|
|
@@ -1779,9 +1924,9 @@ function useCreateUserAgent({
|
|
|
1779
1924
|
safeArea,
|
|
1780
1925
|
safeAreaBottomTransparency
|
|
1781
1926
|
}) {
|
|
1782
|
-
const platform = (0,
|
|
1783
|
-
const appVersion = (0,
|
|
1784
|
-
const { fontScale } = (0,
|
|
1927
|
+
const platform = (0, import_native_modules15.getPlatformOS)();
|
|
1928
|
+
const appVersion = (0, import_native_modules15.getTossAppVersion)();
|
|
1929
|
+
const { fontScale } = (0, import_react_native28.useWindowDimensions)();
|
|
1785
1930
|
const platformString = platform === "ios" ? "iPhone" : "Android";
|
|
1786
1931
|
const fontA11y = mapFontScaleToCategory(fontScale, platform);
|
|
1787
1932
|
const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
|
|
@@ -1801,17 +1946,17 @@ function useCreateUserAgent({
|
|
|
1801
1946
|
}
|
|
1802
1947
|
|
|
1803
1948
|
// src/hooks/useGeolocation.ts
|
|
1804
|
-
var
|
|
1805
|
-
var
|
|
1806
|
-
var
|
|
1949
|
+
var import_native_modules16 = require("@apps-in-toss/native-modules");
|
|
1950
|
+
var import_react_native29 = require("@granite-js/react-native");
|
|
1951
|
+
var import_react25 = require("react");
|
|
1807
1952
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
1808
|
-
const isVisible = (0,
|
|
1809
|
-
const [location, setLocation] = (0,
|
|
1810
|
-
(0,
|
|
1953
|
+
const isVisible = (0, import_react_native29.useVisibility)();
|
|
1954
|
+
const [location, setLocation] = (0, import_react25.useState)(null);
|
|
1955
|
+
(0, import_react25.useEffect)(() => {
|
|
1811
1956
|
if (!isVisible) {
|
|
1812
1957
|
return;
|
|
1813
1958
|
}
|
|
1814
|
-
return (0,
|
|
1959
|
+
return (0, import_native_modules16.startUpdateLocation)({
|
|
1815
1960
|
options: {
|
|
1816
1961
|
accuracy,
|
|
1817
1962
|
distanceInterval,
|
|
@@ -1825,12 +1970,12 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
1825
1970
|
}
|
|
1826
1971
|
|
|
1827
1972
|
// src/hooks/useWaitForReturnNavigator.tsx
|
|
1828
|
-
var
|
|
1829
|
-
var
|
|
1973
|
+
var import_react_native30 = require("@granite-js/react-native");
|
|
1974
|
+
var import_react26 = require("react");
|
|
1830
1975
|
function useWaitForReturnNavigator() {
|
|
1831
|
-
const callbacks = (0,
|
|
1832
|
-
const navigation = (0,
|
|
1833
|
-
const startNavigating = (0,
|
|
1976
|
+
const callbacks = (0, import_react26.useRef)([]).current;
|
|
1977
|
+
const navigation = (0, import_react_native30.useNavigation)();
|
|
1978
|
+
const startNavigating = (0, import_react26.useCallback)(
|
|
1834
1979
|
(route, params) => {
|
|
1835
1980
|
return new Promise((resolve) => {
|
|
1836
1981
|
callbacks.push(resolve);
|
|
@@ -1839,7 +1984,7 @@ function useWaitForReturnNavigator() {
|
|
|
1839
1984
|
},
|
|
1840
1985
|
[callbacks, navigation]
|
|
1841
1986
|
);
|
|
1842
|
-
const handleVisibilityChange = (0,
|
|
1987
|
+
const handleVisibilityChange = (0, import_react26.useCallback)(
|
|
1843
1988
|
(state) => {
|
|
1844
1989
|
if (state === "visible" && callbacks.length > 0) {
|
|
1845
1990
|
for (const callback of callbacks) {
|
|
@@ -1850,13 +1995,13 @@ function useWaitForReturnNavigator() {
|
|
|
1850
1995
|
},
|
|
1851
1996
|
[callbacks]
|
|
1852
1997
|
);
|
|
1853
|
-
(0,
|
|
1998
|
+
(0, import_react_native30.useVisibilityChange)(handleVisibilityChange);
|
|
1854
1999
|
return startNavigating;
|
|
1855
2000
|
}
|
|
1856
2001
|
|
|
1857
2002
|
// src/utils/log.ts
|
|
1858
|
-
var
|
|
1859
|
-
var
|
|
2003
|
+
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
2004
|
+
var import_react_native31 = require("@granite-js/react-native");
|
|
1860
2005
|
|
|
1861
2006
|
// src/utils/extractDateFromUUIDv7.ts
|
|
1862
2007
|
var extractDateFromUUIDv7 = (uuid) => {
|
|
@@ -1882,7 +2027,7 @@ var getGroupId = (url) => {
|
|
|
1882
2027
|
};
|
|
1883
2028
|
var getReferrer = () => {
|
|
1884
2029
|
try {
|
|
1885
|
-
const referrer = new URL((0,
|
|
2030
|
+
const referrer = new URL((0, import_react_native31.getSchemeUri)());
|
|
1886
2031
|
return referrer.searchParams.get("referrer");
|
|
1887
2032
|
} catch {
|
|
1888
2033
|
return "";
|
|
@@ -1900,21 +2045,21 @@ var trackScreen = (url) => {
|
|
|
1900
2045
|
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
1901
2046
|
}
|
|
1902
2047
|
};
|
|
1903
|
-
return (0,
|
|
2048
|
+
return (0, import_native_modules17.eventLog)(log);
|
|
1904
2049
|
};
|
|
1905
2050
|
|
|
1906
2051
|
// src/components/WebView.tsx
|
|
1907
|
-
var
|
|
2052
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1908
2053
|
var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
|
|
1909
2054
|
var TYPES = ["partner", "external", "game"];
|
|
1910
2055
|
var WEBVIEW_TYPES = {
|
|
1911
2056
|
partner: PartnerWebView,
|
|
1912
|
-
external:
|
|
2057
|
+
external: import_tds_react_native14.ExternalWebViewScreen,
|
|
1913
2058
|
game: GameWebView
|
|
1914
2059
|
};
|
|
1915
2060
|
function mergeSchemeQueryParamsInto(url) {
|
|
1916
2061
|
const baseUrl = new URL(url);
|
|
1917
|
-
const schemeUrl = new URL((0,
|
|
2062
|
+
const schemeUrl = new URL((0, import_react_native32.getSchemeUri)());
|
|
1918
2063
|
baseUrl.pathname = schemeUrl.pathname;
|
|
1919
2064
|
for (const [key, value] of schemeUrl.searchParams.entries()) {
|
|
1920
2065
|
baseUrl.searchParams.set(key, value);
|
|
@@ -1926,7 +2071,7 @@ function getWebViewUri(local) {
|
|
|
1926
2071
|
const devUrl = `http://${local.host}:${local.port}`;
|
|
1927
2072
|
return mergeSchemeQueryParamsInto(devUrl).toString();
|
|
1928
2073
|
}
|
|
1929
|
-
const { url: rawUrl } =
|
|
2074
|
+
const { url: rawUrl } = import_native_modules18.AppsInTossModule.getWebBundleURL({});
|
|
1930
2075
|
const url = mergeSchemeQueryParamsInto(rawUrl);
|
|
1931
2076
|
const deploymentId = env.getDeploymentId();
|
|
1932
2077
|
if (deploymentId) {
|
|
@@ -1938,13 +2083,13 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1938
2083
|
if (!TYPES.includes(type)) {
|
|
1939
2084
|
throw new Error(`Invalid WebView type: '${type}'`);
|
|
1940
2085
|
}
|
|
1941
|
-
const webViewRef = (0,
|
|
2086
|
+
const webViewRef = (0, import_react27.useRef)(null);
|
|
1942
2087
|
const webBackHandler = useWebBackHandler(webViewRef);
|
|
1943
|
-
const uri = (0,
|
|
1944
|
-
const top = (0,
|
|
1945
|
-
const bottom = (0,
|
|
2088
|
+
const uri = (0, import_react27.useMemo)(() => getWebViewUri(local), [local]);
|
|
2089
|
+
const top = (0, import_private9.useSafeAreaTop)();
|
|
2090
|
+
const bottom = (0, import_private9.useSafeAreaBottom)();
|
|
1946
2091
|
const global2 = getAppsInTossGlobals();
|
|
1947
|
-
const topNavigation = (0,
|
|
2092
|
+
const topNavigation = (0, import_private9.useTopNavigation)();
|
|
1948
2093
|
const disableTextSelectionCSS = `
|
|
1949
2094
|
(function() {
|
|
1950
2095
|
const style = document.createElement('style');
|
|
@@ -1952,7 +2097,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1952
2097
|
document.head.appendChild(style);
|
|
1953
2098
|
})();
|
|
1954
2099
|
`;
|
|
1955
|
-
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0,
|
|
2100
|
+
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0, import_react27.useState)(
|
|
1956
2101
|
props.allowsBackForwardNavigationGestures
|
|
1957
2102
|
);
|
|
1958
2103
|
const handler = useBridgeHandler({
|
|
@@ -1961,28 +2106,28 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1961
2106
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1962
2107
|
eventListenerMap: {
|
|
1963
2108
|
...appsInTossEventBridges,
|
|
1964
|
-
navigationAccessoryEvent: ({ onEvent, onError }) =>
|
|
2109
|
+
navigationAccessoryEvent: ({ onEvent, onError }) => import_tds_react_native14.tdsEvent.addEventListener("navigationAccessoryEvent", { onEvent, onError }),
|
|
1965
2110
|
backEvent: ({ onEvent }) => {
|
|
1966
2111
|
webBackHandler.addEventListener(onEvent);
|
|
1967
2112
|
return () => {
|
|
1968
2113
|
webBackHandler.removeEventListener(onEvent);
|
|
1969
2114
|
};
|
|
1970
2115
|
},
|
|
1971
|
-
entryMessageExited: ({ onEvent, onError }) =>
|
|
1972
|
-
updateLocationEvent: ({ onEvent, onError, options }) =>
|
|
2116
|
+
entryMessageExited: ({ onEvent, onError }) => import_native_modules18.appsInTossEvent.addEventListener("entryMessageExited", { onEvent, onError }),
|
|
2117
|
+
updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules18.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
1973
2118
|
/** @internal */
|
|
1974
|
-
appBridgeCallbackEvent: ({ onEvent, onError, options }) =>
|
|
2119
|
+
appBridgeCallbackEvent: ({ onEvent, onError, options }) => import_native_modules18.appsInTossEvent.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
|
|
1975
2120
|
/** AdMob */
|
|
1976
|
-
loadAdMobInterstitialAd:
|
|
1977
|
-
showAdMobInterstitialAd:
|
|
1978
|
-
loadAdMobRewardedAd:
|
|
1979
|
-
showAdMobRewardedAd:
|
|
2121
|
+
loadAdMobInterstitialAd: import_native_modules18.GoogleAdMob.loadAdMobInterstitialAd,
|
|
2122
|
+
showAdMobInterstitialAd: import_native_modules18.GoogleAdMob.showAdMobInterstitialAd,
|
|
2123
|
+
loadAdMobRewardedAd: import_native_modules18.GoogleAdMob.loadAdMobRewardedAd,
|
|
2124
|
+
showAdMobRewardedAd: import_native_modules18.GoogleAdMob.showAdMobRewardedAd,
|
|
1980
2125
|
/** AdMobV2 */
|
|
1981
|
-
loadAppsInTossAdMob:
|
|
1982
|
-
showAppsInTossAdMob:
|
|
2126
|
+
loadAppsInTossAdMob: import_native_modules18.GoogleAdMob.loadAppsInTossAdMob,
|
|
2127
|
+
showAppsInTossAdMob: import_native_modules18.GoogleAdMob.showAppsInTossAdMob,
|
|
1983
2128
|
/** IAP */
|
|
1984
|
-
iapCreateOneTimePurchaseOrder:
|
|
1985
|
-
requestOneTimePurchase:
|
|
2129
|
+
iapCreateOneTimePurchaseOrder: import_native_modules18.IAP.createOneTimePurchaseOrder,
|
|
2130
|
+
requestOneTimePurchase: import_native_modules18.requestOneTimePurchase
|
|
1986
2131
|
},
|
|
1987
2132
|
constantHandlerMap: {
|
|
1988
2133
|
...appsInTossConstantBridges,
|
|
@@ -1990,13 +2135,13 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1990
2135
|
getSafeAreaBottom: () => bottom,
|
|
1991
2136
|
...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
|
|
1992
2137
|
/** AdMob */
|
|
1993
|
-
loadAdMobInterstitialAd_isSupported:
|
|
1994
|
-
showAdMobInterstitialAd_isSupported:
|
|
1995
|
-
loadAdMobRewardedAd_isSupported:
|
|
1996
|
-
showAdMobRewardedAd_isSupported:
|
|
2138
|
+
loadAdMobInterstitialAd_isSupported: import_native_modules18.GoogleAdMob.loadAdMobInterstitialAd.isSupported,
|
|
2139
|
+
showAdMobInterstitialAd_isSupported: import_native_modules18.GoogleAdMob.showAdMobInterstitialAd.isSupported,
|
|
2140
|
+
loadAdMobRewardedAd_isSupported: import_native_modules18.GoogleAdMob.loadAdMobRewardedAd.isSupported,
|
|
2141
|
+
showAdMobRewardedAd_isSupported: import_native_modules18.GoogleAdMob.showAdMobRewardedAd.isSupported,
|
|
1997
2142
|
/** AdMobV2 */
|
|
1998
|
-
loadAppsInTossAdMob_isSupported:
|
|
1999
|
-
showAppsInTossAdMob_isSupported:
|
|
2143
|
+
loadAppsInTossAdMob_isSupported: import_native_modules18.GoogleAdMob.loadAppsInTossAdMob.isSupported,
|
|
2144
|
+
showAppsInTossAdMob_isSupported: import_native_modules18.GoogleAdMob.showAppsInTossAdMob.isSupported,
|
|
2000
2145
|
/** env */
|
|
2001
2146
|
getDeploymentId: env.getDeploymentId
|
|
2002
2147
|
},
|
|
@@ -2019,20 +2164,20 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2019
2164
|
getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
|
|
2020
2165
|
openCamera: appsInTossAsyncBridges.openCamera,
|
|
2021
2166
|
/** Storage */
|
|
2022
|
-
getStorageItem:
|
|
2023
|
-
setStorageItem:
|
|
2024
|
-
removeStorageItem:
|
|
2025
|
-
clearItems:
|
|
2167
|
+
getStorageItem: import_native_modules18.Storage.getItem,
|
|
2168
|
+
setStorageItem: import_native_modules18.Storage.setItem,
|
|
2169
|
+
removeStorageItem: import_native_modules18.Storage.removeItem,
|
|
2170
|
+
clearItems: import_native_modules18.Storage.clearItems,
|
|
2026
2171
|
/** IAP */
|
|
2027
|
-
iapGetProductItemList:
|
|
2028
|
-
iapCreateOneTimePurchaseOrder:
|
|
2029
|
-
processProductGrant:
|
|
2030
|
-
getPendingOrders:
|
|
2031
|
-
getCompletedOrRefundedOrders:
|
|
2032
|
-
completeProductGrant:
|
|
2172
|
+
iapGetProductItemList: import_native_modules18.IAP.getProductItemList,
|
|
2173
|
+
iapCreateOneTimePurchaseOrder: import_native_modules18.iapCreateOneTimePurchaseOrder,
|
|
2174
|
+
processProductGrant: import_native_modules18.processProductGrant,
|
|
2175
|
+
getPendingOrders: import_native_modules18.IAP.getPendingOrders,
|
|
2176
|
+
getCompletedOrRefundedOrders: import_native_modules18.IAP.getCompletedOrRefundedOrders,
|
|
2177
|
+
completeProductGrant: import_native_modules18.IAP.completeProductGrant
|
|
2033
2178
|
}
|
|
2034
2179
|
});
|
|
2035
|
-
const headerPropForExternalWebView = (0,
|
|
2180
|
+
const headerPropForExternalWebView = (0, import_react27.useMemo)(() => {
|
|
2036
2181
|
const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
|
|
2037
2182
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
2038
2183
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
@@ -2053,15 +2198,15 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2053
2198
|
colorPreference: "light"
|
|
2054
2199
|
});
|
|
2055
2200
|
const refs = mergeRefs(handler.ref, webViewRef);
|
|
2056
|
-
(0,
|
|
2201
|
+
(0, import_react27.useEffect)(() => {
|
|
2057
2202
|
const callback = () => {
|
|
2058
2203
|
webBackHandler.handleWebBack();
|
|
2059
2204
|
return true;
|
|
2060
2205
|
};
|
|
2061
|
-
|
|
2062
|
-
return () =>
|
|
2206
|
+
import_react_native33.BackHandler.addEventListener("hardwareBackPress", callback);
|
|
2207
|
+
return () => import_react_native33.BackHandler.removeEventListener("hardwareBackPress", callback);
|
|
2063
2208
|
}, [webBackHandler]);
|
|
2064
|
-
return /* @__PURE__ */ (0,
|
|
2209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2065
2210
|
BaseWebView,
|
|
2066
2211
|
{
|
|
2067
2212
|
ref: refs,
|
|
@@ -2083,14 +2228,14 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2083
2228
|
props.onNavigationStateChange?.(event);
|
|
2084
2229
|
webBackHandler.onNavigationStateChange(event);
|
|
2085
2230
|
},
|
|
2086
|
-
userAgent:
|
|
2231
|
+
userAgent: import_react_native33.Platform.OS === "ios" ? userAgent : void 0,
|
|
2087
2232
|
sharedCookiesEnabled: true,
|
|
2088
2233
|
webviewDebuggingEnabled: webViewDebuggingEnabled,
|
|
2089
2234
|
thirdPartyCookiesEnabled: true,
|
|
2090
2235
|
onMessage: handler.onMessage,
|
|
2091
2236
|
injectedJavaScript: handler.injectedJavaScript,
|
|
2092
2237
|
injectedJavaScriptBeforeContentLoaded: handler.injectedJavaScript,
|
|
2093
|
-
decelerationRate:
|
|
2238
|
+
decelerationRate: import_react_native33.Platform.OS === "ios" ? 1 : void 0,
|
|
2094
2239
|
allowsBackForwardNavigationGestures
|
|
2095
2240
|
}
|
|
2096
2241
|
);
|
|
@@ -2098,7 +2243,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2098
2243
|
|
|
2099
2244
|
// src/index.ts
|
|
2100
2245
|
__reExport(src_exports, require("@apps-in-toss/analytics"), module.exports);
|
|
2101
|
-
var
|
|
2246
|
+
var import_private10 = require("@toss/tds-react-native/private");
|
|
2102
2247
|
__reExport(src_exports, require("@apps-in-toss/native-modules"), module.exports);
|
|
2103
2248
|
__reExport(src_exports, require("@apps-in-toss/types"), module.exports);
|
|
2104
2249
|
var Analytics2 = {
|