@apps-in-toss/framework 1.5.2 → 1.5.3
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 +206 -250
- package/dist/index.js +43 -87
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -48,9 +48,9 @@ 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
|
|
51
|
+
var import_native_modules13 = require("@apps-in-toss/native-modules");
|
|
52
52
|
var import_react_native23 = require("@granite-js/react-native");
|
|
53
|
-
var
|
|
53
|
+
var import_tds_react_native10 = require("@toss/tds-react-native");
|
|
54
54
|
var import_react_native24 = require("react-native");
|
|
55
55
|
|
|
56
56
|
// src/core/components/AppEvent.tsx
|
|
@@ -248,45 +248,17 @@ function useNavigationBarContext() {
|
|
|
248
248
|
return context;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
// src/core/hooks/useAppsInTossBridge.ts
|
|
252
|
-
var import_native_modules3 = require("@apps-in-toss/native-modules");
|
|
253
|
-
var import_tds_react_native = require("@toss/tds-react-native");
|
|
254
|
-
var import_react6 = require("react");
|
|
255
|
-
|
|
256
|
-
// src/core/utils/toIcon.ts
|
|
257
|
-
function toIcon(source) {
|
|
258
|
-
return source.startsWith("http") ? { source: { uri: source } } : { name: source };
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
// src/core/hooks/useAppsInTossBridge.ts
|
|
262
|
-
function useAppsInTossBridge() {
|
|
263
|
-
const controller = (0, import_tds_react_native.useBridge)();
|
|
264
|
-
const appsInTossGlobals = getAppsInTossGlobals();
|
|
265
|
-
(0, import_react6.useEffect)(() => {
|
|
266
|
-
const isGameApp = appsInTossGlobals.webViewType === "game" || appsInTossGlobals.appType === "game";
|
|
267
|
-
controller.open({
|
|
268
|
-
serviceName: appsInTossGlobals.brandDisplayName,
|
|
269
|
-
icon: toIcon(appsInTossGlobals.brandIcon),
|
|
270
|
-
color: appsInTossGlobals.brandPrimaryColor,
|
|
271
|
-
colorMode: isGameApp ? "inverted" : appsInTossGlobals.brandBridgeColorMode,
|
|
272
|
-
onExited: () => {
|
|
273
|
-
import_native_modules3.appsInTossEvent.emit("entryMessageExited", void 0);
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
}, []);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
251
|
// src/components/RNAppContainer.tsx
|
|
280
|
-
var
|
|
281
|
-
var
|
|
252
|
+
var import_native_modules12 = require("@apps-in-toss/native-modules");
|
|
253
|
+
var import_react17 = require("react");
|
|
282
254
|
var import_react_native22 = require("react-native");
|
|
283
255
|
|
|
284
256
|
// src/components/GameInitializer.tsx
|
|
285
|
-
var
|
|
257
|
+
var import_native_modules6 = require("@apps-in-toss/native-modules");
|
|
286
258
|
var import_react_native10 = require("@granite-js/react-native");
|
|
287
|
-
var
|
|
259
|
+
var import_tds_react_native4 = require("@toss/tds-react-native");
|
|
288
260
|
var import_es_hangul = require("es-hangul");
|
|
289
|
-
var
|
|
261
|
+
var import_react11 = require("react");
|
|
290
262
|
var import_react_native11 = require("react-native");
|
|
291
263
|
|
|
292
264
|
// src/constant/game-center.ts
|
|
@@ -297,10 +269,10 @@ var GAME_MIN_VERSION = {
|
|
|
297
269
|
};
|
|
298
270
|
|
|
299
271
|
// src/hooks/useAppUpdateDialog.tsx
|
|
300
|
-
var
|
|
272
|
+
var import_native_modules3 = require("@apps-in-toss/native-modules");
|
|
301
273
|
var import_react_native7 = require("@granite-js/react-native");
|
|
302
|
-
var
|
|
303
|
-
var
|
|
274
|
+
var import_tds_react_native = require("@toss/tds-react-native");
|
|
275
|
+
var import_react6 = require("react");
|
|
304
276
|
|
|
305
277
|
// src/utils/market.ts
|
|
306
278
|
var import_react_native6 = require("react-native");
|
|
@@ -312,9 +284,9 @@ var getMarketLink = () => {
|
|
|
312
284
|
|
|
313
285
|
// src/hooks/useAppUpdateDialog.tsx
|
|
314
286
|
function useAppUpdateDialog() {
|
|
315
|
-
const { openConfirm } = (0,
|
|
287
|
+
const { openConfirm } = (0, import_tds_react_native.useDialog)();
|
|
316
288
|
const logging = useAppUpdateDialogLogging();
|
|
317
|
-
const openAppUpdateDialog = (0,
|
|
289
|
+
const openAppUpdateDialog = (0, import_react6.useCallback)(
|
|
318
290
|
async ({
|
|
319
291
|
title,
|
|
320
292
|
description,
|
|
@@ -356,7 +328,7 @@ function useAppUpdateDialogLogging() {
|
|
|
356
328
|
app_name: import_react_native7.Granite.appName
|
|
357
329
|
};
|
|
358
330
|
const logUpdateClick = () => {
|
|
359
|
-
|
|
331
|
+
import_native_modules3.INTERNAL__module.tossCoreEventLog({
|
|
360
332
|
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
361
333
|
log_type: "event",
|
|
362
334
|
params: {
|
|
@@ -368,7 +340,7 @@ function useAppUpdateDialogLogging() {
|
|
|
368
340
|
});
|
|
369
341
|
};
|
|
370
342
|
const logCloseClick = () => {
|
|
371
|
-
|
|
343
|
+
import_native_modules3.INTERNAL__module.tossCoreEventLog({
|
|
372
344
|
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
373
345
|
log_type: "event",
|
|
374
346
|
params: {
|
|
@@ -380,7 +352,7 @@ function useAppUpdateDialogLogging() {
|
|
|
380
352
|
});
|
|
381
353
|
};
|
|
382
354
|
const logDialogShow = () => {
|
|
383
|
-
|
|
355
|
+
import_native_modules3.INTERNAL__module.tossCoreEventLog({
|
|
384
356
|
log_name: UPDATE_DIALOG_LOG_NAME,
|
|
385
357
|
log_type: "popup",
|
|
386
358
|
params: {
|
|
@@ -393,13 +365,13 @@ function useAppUpdateDialogLogging() {
|
|
|
393
365
|
}
|
|
394
366
|
|
|
395
367
|
// src/hooks/useGameCenterProfile.ts
|
|
396
|
-
var
|
|
397
|
-
var
|
|
368
|
+
var import_native_modules5 = require("@apps-in-toss/native-modules");
|
|
369
|
+
var import_react10 = require("react");
|
|
398
370
|
|
|
399
371
|
// src/hooks/useErrorAlert.ts
|
|
400
372
|
var import_react_native8 = require("@granite-js/react-native");
|
|
401
|
-
var
|
|
402
|
-
var
|
|
373
|
+
var import_tds_react_native2 = require("@toss/tds-react-native");
|
|
374
|
+
var import_react7 = require("react");
|
|
403
375
|
|
|
404
376
|
// src/utils/error.ts
|
|
405
377
|
var DEFAULT_ERROR = {
|
|
@@ -409,8 +381,8 @@ var DEFAULT_ERROR = {
|
|
|
409
381
|
|
|
410
382
|
// src/hooks/useErrorAlert.ts
|
|
411
383
|
var useErrorAlert = () => {
|
|
412
|
-
const { openAlert } = (0,
|
|
413
|
-
const openErrorAlert = (0,
|
|
384
|
+
const { openAlert } = (0, import_tds_react_native2.useDialog)();
|
|
385
|
+
const openErrorAlert = (0, import_react7.useCallback)(async () => {
|
|
414
386
|
await openAlert({
|
|
415
387
|
title: DEFAULT_ERROR.title,
|
|
416
388
|
description: DEFAULT_ERROR.description
|
|
@@ -421,14 +393,14 @@ var useErrorAlert = () => {
|
|
|
421
393
|
};
|
|
422
394
|
|
|
423
395
|
// src/hooks/useTransparentWebview.tsx
|
|
424
|
-
var
|
|
396
|
+
var import_react8 = require("react");
|
|
425
397
|
|
|
426
398
|
// src/utils/openTransparentWebView.ts
|
|
427
399
|
var import_react_native9 = require("@granite-js/react-native");
|
|
428
400
|
|
|
429
401
|
// src/private.ts
|
|
430
|
-
var
|
|
431
|
-
var INTERNAL__onVisibilityChangedByTransparentServiceWeb =
|
|
402
|
+
var import_native_modules4 = require("@apps-in-toss/native-modules");
|
|
403
|
+
var INTERNAL__onVisibilityChangedByTransparentServiceWeb = import_native_modules4.onVisibilityChangedByTransparentServiceWeb;
|
|
432
404
|
|
|
433
405
|
// src/utils/openTransparentWebView.ts
|
|
434
406
|
var openTransparentWebView = ({
|
|
@@ -463,9 +435,9 @@ var openTransparentWebView = ({
|
|
|
463
435
|
|
|
464
436
|
// src/hooks/useTransparentWebview.tsx
|
|
465
437
|
var useTransparentWebview = () => {
|
|
466
|
-
const [isWebviewLoading, setIsWebviewLoading] = (0,
|
|
438
|
+
const [isWebviewLoading, setIsWebviewLoading] = (0, import_react8.useState)(false);
|
|
467
439
|
const { open: openErrorAlert } = useErrorAlert();
|
|
468
|
-
const _openTransparentWebview = (0,
|
|
440
|
+
const _openTransparentWebview = (0, import_react8.useCallback)(
|
|
469
441
|
({ webUrl, onClose, onError }) => {
|
|
470
442
|
if (isWebviewLoading) {
|
|
471
443
|
return;
|
|
@@ -497,18 +469,18 @@ var useTransparentWebview = () => {
|
|
|
497
469
|
};
|
|
498
470
|
|
|
499
471
|
// src/components/GameProfileToast.tsx
|
|
500
|
-
var
|
|
472
|
+
var import_tds_react_native3 = require("@toss/tds-react-native");
|
|
501
473
|
var import_private2 = require("@toss/tds-react-native/private");
|
|
502
|
-
var
|
|
474
|
+
var import_react9 = require("react");
|
|
503
475
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
504
476
|
var useGameProfileToast = () => {
|
|
505
477
|
const overlay = (0, import_private2.useOverlay)();
|
|
506
|
-
const openGameProfileToast = (0,
|
|
478
|
+
const openGameProfileToast = (0, import_react9.useCallback)(
|
|
507
479
|
(nickname, profileImageUri) => {
|
|
508
480
|
return new Promise((resolve) => {
|
|
509
481
|
overlay.open(({ isOpen, close, exit }) => {
|
|
510
482
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_private2.ColorPreferenceProvider, { colorPreference: "dark", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_private2.AdaptiveColorProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
511
|
-
|
|
483
|
+
import_tds_react_native3.Toast,
|
|
512
484
|
{
|
|
513
485
|
open: isOpen,
|
|
514
486
|
onClose: () => {
|
|
@@ -519,10 +491,10 @@ var useGameProfileToast = () => {
|
|
|
519
491
|
position: "top",
|
|
520
492
|
text: `${nickname}\uB2D8 \uBC18\uAC00\uC6CC\uC694!`,
|
|
521
493
|
icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
522
|
-
|
|
494
|
+
import_tds_react_native3.Asset.Image,
|
|
523
495
|
{
|
|
524
496
|
style: { borderRadius: 64, overflow: "hidden" },
|
|
525
|
-
frameShape:
|
|
497
|
+
frameShape: import_tds_react_native3.Asset.frameShape.CleanW32,
|
|
526
498
|
source: { uri: profileImageUri }
|
|
527
499
|
}
|
|
528
500
|
)
|
|
@@ -537,19 +509,19 @@ var useGameProfileToast = () => {
|
|
|
537
509
|
};
|
|
538
510
|
|
|
539
511
|
// src/hooks/useGameCenterProfile.ts
|
|
540
|
-
var useGameCenterProfile = (
|
|
541
|
-
const [profileData, setProfileData] = (0,
|
|
542
|
-
const [isProfileDataLoading, setIsProfileDataLoading] = (0,
|
|
543
|
-
const [isProfileDataRefetching, setIsProfileDataRefetching] = (0,
|
|
544
|
-
const shouldShowProfileLoadingOverlay = isProfileDataLoading
|
|
545
|
-
const shouldShowProfileNotFoundOverlay = profileData?.statusCode === "PROFILE_NOT_FOUND" &&
|
|
546
|
-
const canShowBottomSheetOrToast = !isProfileDataLoading
|
|
512
|
+
var useGameCenterProfile = () => {
|
|
513
|
+
const [profileData, setProfileData] = (0, import_react10.useState)(void 0);
|
|
514
|
+
const [isProfileDataLoading, setIsProfileDataLoading] = (0, import_react10.useState)(true);
|
|
515
|
+
const [isProfileDataRefetching, setIsProfileDataRefetching] = (0, import_react10.useState)(false);
|
|
516
|
+
const shouldShowProfileLoadingOverlay = isProfileDataLoading || isProfileDataRefetching;
|
|
517
|
+
const shouldShowProfileNotFoundOverlay = profileData?.statusCode === "PROFILE_NOT_FOUND" && !isProfileDataRefetching;
|
|
518
|
+
const canShowBottomSheetOrToast = !isProfileDataLoading;
|
|
547
519
|
const { openGameProfileToast } = useGameProfileToast();
|
|
548
520
|
const { open: openErrorAlert } = useErrorAlert();
|
|
549
521
|
const { open: openTransparentWebView2 } = useTransparentWebview();
|
|
550
|
-
const fetchProfileData = (0,
|
|
522
|
+
const fetchProfileData = (0, import_react10.useCallback)(async () => {
|
|
551
523
|
try {
|
|
552
|
-
const data = await (0,
|
|
524
|
+
const data = await (0, import_native_modules5.getGameCenterGameProfile)();
|
|
553
525
|
setProfileData(data);
|
|
554
526
|
setIsProfileDataLoading(false);
|
|
555
527
|
} catch (_) {
|
|
@@ -557,10 +529,10 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
557
529
|
setIsProfileDataLoading(false);
|
|
558
530
|
}
|
|
559
531
|
}, [openErrorAlert]);
|
|
560
|
-
const refetchProfileData = (0,
|
|
532
|
+
const refetchProfileData = (0, import_react10.useCallback)(async () => {
|
|
561
533
|
try {
|
|
562
534
|
setIsProfileDataRefetching(true);
|
|
563
|
-
const data = await (0,
|
|
535
|
+
const data = await (0, import_native_modules5.getGameCenterGameProfile)();
|
|
564
536
|
setProfileData(data);
|
|
565
537
|
setIsProfileDataRefetching(false);
|
|
566
538
|
if (data?.statusCode === "SUCCESS") {
|
|
@@ -571,7 +543,7 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
571
543
|
openErrorAlert();
|
|
572
544
|
}
|
|
573
545
|
}, [openErrorAlert, openGameProfileToast]);
|
|
574
|
-
const openProfileWebview = (0,
|
|
546
|
+
const openProfileWebview = (0, import_react10.useCallback)(() => {
|
|
575
547
|
openTransparentWebView2({
|
|
576
548
|
webUrl: `${GAME_PROFILE_WEBVIEW_URL}?appName=${getAppName()}&referrer=appsintoss.${getAppName()}`,
|
|
577
549
|
onClose: async () => {
|
|
@@ -605,7 +577,7 @@ var Z_INDEX = {
|
|
|
605
577
|
|
|
606
578
|
// src/components/GameInitializer.tsx
|
|
607
579
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
608
|
-
var GameInitializer = ({ children
|
|
580
|
+
var GameInitializer = ({ children }) => {
|
|
609
581
|
const {
|
|
610
582
|
profileData,
|
|
611
583
|
shouldShowProfileLoadingOverlay,
|
|
@@ -614,13 +586,13 @@ var GameInitializer = ({ children, isReadyForProfileUI }) => {
|
|
|
614
586
|
openProfileWebview,
|
|
615
587
|
openGameProfileToast,
|
|
616
588
|
fetchProfileData
|
|
617
|
-
} = useGameCenterProfile(
|
|
618
|
-
const isCompletedFlow = (0,
|
|
589
|
+
} = useGameCenterProfile();
|
|
590
|
+
const isCompletedFlow = (0, import_react11.useRef)(false);
|
|
619
591
|
const { open: openAppUpdateDialog } = useAppUpdateDialog();
|
|
620
|
-
(0,
|
|
592
|
+
(0, import_react11.useEffect)(() => {
|
|
621
593
|
fetchProfileData();
|
|
622
594
|
}, []);
|
|
623
|
-
(0,
|
|
595
|
+
(0, import_react11.useEffect)(() => {
|
|
624
596
|
const handleGameProfileFlow = async () => {
|
|
625
597
|
if (!canShowBottomSheetOrToast) {
|
|
626
598
|
return;
|
|
@@ -629,7 +601,7 @@ var GameInitializer = ({ children, isReadyForProfileUI }) => {
|
|
|
629
601
|
return;
|
|
630
602
|
}
|
|
631
603
|
isCompletedFlow.current = true;
|
|
632
|
-
if (!(0,
|
|
604
|
+
if (!(0, import_native_modules6.isMinVersionSupported)(GAME_MIN_VERSION)) {
|
|
633
605
|
openAppUpdateDialog({
|
|
634
606
|
title: `${(0, import_es_hangul.josa)(getAppsInTossGlobals().brandDisplayName, "\uC744/\uB97C")} \uD558\uB824\uBA74
|
|
635
607
|
\uC571\uC744 \uC5C5\uB370\uC774\uD2B8\uD574\uC8FC\uC138\uC694`,
|
|
@@ -656,7 +628,7 @@ var GameInitializer = ({ children, isReadyForProfileUI }) => {
|
|
|
656
628
|
openProfileWebview,
|
|
657
629
|
profileData
|
|
658
630
|
]);
|
|
659
|
-
if (!(0,
|
|
631
|
+
if (!(0, import_native_modules6.isMinVersionSupported)(GAME_MIN_VERSION)) {
|
|
660
632
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
661
633
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native11.View, { style: { flex: 1, position: "relative" }, children }),
|
|
662
634
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
@@ -690,7 +662,7 @@ var GameInitializer = ({ children, isReadyForProfileUI }) => {
|
|
|
690
662
|
alignItems: "center",
|
|
691
663
|
backgroundColor: "rgba(0, 0, 0, 0.2)"
|
|
692
664
|
},
|
|
693
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
665
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_tds_react_native4.Loader, { size: "large", type: "light" })
|
|
694
666
|
}
|
|
695
667
|
)
|
|
696
668
|
] });
|
|
@@ -726,10 +698,10 @@ var overlayStyle = {
|
|
|
726
698
|
var import_private5 = require("@toss/tds-react-native/private");
|
|
727
699
|
|
|
728
700
|
// src/components/NavigationBar/RNNavigationBar/hooks/useHardwareBackPress.ts
|
|
729
|
-
var
|
|
701
|
+
var import_react12 = require("react");
|
|
730
702
|
var import_react_native12 = require("react-native");
|
|
731
703
|
function useHardwareBackPress(handler) {
|
|
732
|
-
(0,
|
|
704
|
+
(0, import_react12.useEffect)(() => {
|
|
733
705
|
const handleBackPress = () => {
|
|
734
706
|
handler();
|
|
735
707
|
return true;
|
|
@@ -741,16 +713,16 @@ function useHardwareBackPress(handler) {
|
|
|
741
713
|
|
|
742
714
|
// src/components/NavigationBar/RNNavigationBar/hooks/useNavigationEvent.ts
|
|
743
715
|
var import_react_native14 = require("@granite-js/react-native");
|
|
744
|
-
var
|
|
716
|
+
var import_react14 = require("react");
|
|
745
717
|
|
|
746
718
|
// src/components/NavigationBar/RNNavigationBar/hooks/useCloseConfirm.ts
|
|
747
|
-
var
|
|
719
|
+
var import_tds_react_native5 = require("@toss/tds-react-native");
|
|
748
720
|
var import_es_hangul2 = require("es-hangul");
|
|
749
|
-
var
|
|
721
|
+
var import_react13 = require("react");
|
|
750
722
|
function useCloseConfirm() {
|
|
751
723
|
const { brandDisplayName } = getAppsInTossGlobals();
|
|
752
|
-
const { openConfirm } = (0,
|
|
753
|
-
return (0,
|
|
724
|
+
const { openConfirm } = (0, import_tds_react_native5.useDialog)();
|
|
725
|
+
return (0, import_react13.useCallback)(async ({ onEntered }) => {
|
|
754
726
|
return await openConfirm({
|
|
755
727
|
title: `${(0, import_es_hangul2.josa)(brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
756
728
|
leftButton: "\uCDE8\uC18C",
|
|
@@ -762,7 +734,7 @@ function useCloseConfirm() {
|
|
|
762
734
|
}
|
|
763
735
|
|
|
764
736
|
// src/components/NavigationBar/common/useNavigationBarLogging.tsx
|
|
765
|
-
var
|
|
737
|
+
var import_native_modules7 = require("@apps-in-toss/native-modules");
|
|
766
738
|
var import_react_native13 = require("@granite-js/react-native");
|
|
767
739
|
var NAVI_BAR_IMPRESSION_SCHEMA_ID = 1596837;
|
|
768
740
|
var NAVI_BAR_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__navigation_bar";
|
|
@@ -781,7 +753,7 @@ function useNavigationBarLogging() {
|
|
|
781
753
|
app_name: import_react_native13.Granite.appName
|
|
782
754
|
};
|
|
783
755
|
const logNavBarImpression = (naviBarConfig) => {
|
|
784
|
-
|
|
756
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
785
757
|
log_name: NAVI_BAR_IMPRESSION_LOG_NAME,
|
|
786
758
|
log_type: "event",
|
|
787
759
|
params: {
|
|
@@ -793,7 +765,7 @@ function useNavigationBarLogging() {
|
|
|
793
765
|
});
|
|
794
766
|
};
|
|
795
767
|
const logHomeButtonClick = () => {
|
|
796
|
-
|
|
768
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
797
769
|
log_name: HOME_BUTTON_CLICK_LOG_NAME,
|
|
798
770
|
log_type: "event",
|
|
799
771
|
params: {
|
|
@@ -804,7 +776,7 @@ function useNavigationBarLogging() {
|
|
|
804
776
|
});
|
|
805
777
|
};
|
|
806
778
|
const logCloseButtonClick = () => {
|
|
807
|
-
|
|
779
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
808
780
|
log_name: CLOSE_BUTTON_CLICK_LOG_NAME,
|
|
809
781
|
log_type: "event",
|
|
810
782
|
params: {
|
|
@@ -815,7 +787,7 @@ function useNavigationBarLogging() {
|
|
|
815
787
|
});
|
|
816
788
|
};
|
|
817
789
|
const logClosePopupShow = () => {
|
|
818
|
-
|
|
790
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
819
791
|
log_name: CLOSE_POPUP_SHOW_LOG_NAME,
|
|
820
792
|
log_type: "popup",
|
|
821
793
|
params: {
|
|
@@ -825,7 +797,7 @@ function useNavigationBarLogging() {
|
|
|
825
797
|
});
|
|
826
798
|
};
|
|
827
799
|
const logClosePopupCtaClick = (confirm) => {
|
|
828
|
-
|
|
800
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
829
801
|
log_name: CLOSE_POPUP_CTA_CLICK_LOG_NAME,
|
|
830
802
|
log_type: "event",
|
|
831
803
|
params: {
|
|
@@ -852,7 +824,7 @@ function useNavigationEvent() {
|
|
|
852
824
|
const navigation = (0, import_react_native14.useNavigation)();
|
|
853
825
|
const closeConfirm = useCloseConfirm();
|
|
854
826
|
const { captureExitLog } = useCaptureExitLog();
|
|
855
|
-
return (0,
|
|
827
|
+
return (0, import_react14.useMemo)(() => {
|
|
856
828
|
const close = async () => {
|
|
857
829
|
const hasConfirmed = await closeConfirm({
|
|
858
830
|
onEntered: logging.closePopupShow
|
|
@@ -886,25 +858,25 @@ function useNavigationEvent() {
|
|
|
886
858
|
}
|
|
887
859
|
|
|
888
860
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
889
|
-
var
|
|
861
|
+
var import_native_modules11 = require("@apps-in-toss/native-modules");
|
|
890
862
|
var import_react_native20 = require("@granite-js/react-native");
|
|
891
|
-
var
|
|
863
|
+
var import_tds_react_native8 = require("@toss/tds-react-native");
|
|
892
864
|
var import_private4 = require("@toss/tds-react-native/private");
|
|
893
|
-
var
|
|
865
|
+
var import_react15 = require("react");
|
|
894
866
|
|
|
895
867
|
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
896
|
-
var
|
|
868
|
+
var import_native_modules9 = require("@apps-in-toss/native-modules");
|
|
897
869
|
var import_react_native17 = require("@granite-js/react-native");
|
|
898
|
-
var
|
|
870
|
+
var import_tds_react_native7 = require("@toss/tds-react-native");
|
|
899
871
|
var import_react_native18 = require("react-native");
|
|
900
872
|
|
|
901
873
|
// src/core/hooks/useMoreButtonBottomSheet/Menu.tsx
|
|
902
|
-
var
|
|
874
|
+
var import_tds_react_native6 = require("@toss/tds-react-native");
|
|
903
875
|
var import_private3 = require("@toss/tds-react-native/private");
|
|
904
876
|
var import_react_native16 = require("react-native");
|
|
905
877
|
|
|
906
878
|
// src/core/hooks/useMoreButtonBottomSheet/useMoreButtonBottomSheetLogging.tsx
|
|
907
|
-
var
|
|
879
|
+
var import_native_modules8 = require("@apps-in-toss/native-modules");
|
|
908
880
|
var import_react_native15 = require("@granite-js/react-native");
|
|
909
881
|
var BOTTOM_SHEET_SCHEMA_ID = 1596825;
|
|
910
882
|
var BOTTOM_SHEET_LOG_NAME = "appsintoss_app_visit__common_module::bottomsheet__more";
|
|
@@ -921,7 +893,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
921
893
|
app_name: import_react_native15.Granite.appName
|
|
922
894
|
};
|
|
923
895
|
const logBottomSheetShow = () => {
|
|
924
|
-
|
|
896
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
925
897
|
log_name: BOTTOM_SHEET_LOG_NAME,
|
|
926
898
|
log_type: "popup",
|
|
927
899
|
params: {
|
|
@@ -931,7 +903,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
931
903
|
});
|
|
932
904
|
};
|
|
933
905
|
const logBottomSheetOpen = () => {
|
|
934
|
-
|
|
906
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
935
907
|
log_name: BOTTOM_SHEET_OPEN_LOG_NAME,
|
|
936
908
|
log_type: "event",
|
|
937
909
|
params: {
|
|
@@ -942,7 +914,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
942
914
|
});
|
|
943
915
|
};
|
|
944
916
|
const logBottomSheetCloseClick = () => {
|
|
945
|
-
|
|
917
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
946
918
|
log_name: BOTTOM_SHEET_CLOSE_CLICK_LOG_NAME,
|
|
947
919
|
log_type: "event",
|
|
948
920
|
params: {
|
|
@@ -953,7 +925,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
953
925
|
});
|
|
954
926
|
};
|
|
955
927
|
const logBottomSheetMenuClick = ({ title }) => {
|
|
956
|
-
|
|
928
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
957
929
|
log_name: BOTTOM_SHEET_MENU_CLICK_LOG_NAME,
|
|
958
930
|
log_type: "event",
|
|
959
931
|
params: {
|
|
@@ -982,7 +954,7 @@ function Menu({ title, iconURL, onPress }) {
|
|
|
982
954
|
const brandPrimaryColorRGB = hexToRGB(globals.brandPrimaryColor);
|
|
983
955
|
const iconBackgroundColor = brandPrimaryColorRGB ? `rgba(${brandPrimaryColorRGB.join(",")},0.1)` : adaptive.grey100;
|
|
984
956
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
985
|
-
|
|
957
|
+
import_tds_react_native6.ListRow,
|
|
986
958
|
{
|
|
987
959
|
left: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
988
960
|
import_react_native16.View,
|
|
@@ -998,14 +970,14 @@ function Menu({ title, iconURL, onPress }) {
|
|
|
998
970
|
backgroundColor: iconBackgroundColor
|
|
999
971
|
},
|
|
1000
972
|
children: iconName ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1001
|
-
|
|
973
|
+
import_tds_react_native6.Asset.Icon,
|
|
1002
974
|
{
|
|
1003
975
|
frameShape: { width: 20, height: 20 },
|
|
1004
976
|
color: globals.brandPrimaryColor,
|
|
1005
977
|
name: iconName
|
|
1006
978
|
}
|
|
1007
979
|
) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1008
|
-
|
|
980
|
+
import_tds_react_native6.Asset.Image,
|
|
1009
981
|
{
|
|
1010
982
|
frameShape: { width: 20, height: 20 },
|
|
1011
983
|
source: { uri: iconURL }
|
|
@@ -1014,7 +986,7 @@ function Menu({ title, iconURL, onPress }) {
|
|
|
1014
986
|
}
|
|
1015
987
|
),
|
|
1016
988
|
contents: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1017
|
-
|
|
989
|
+
import_tds_react_native6.ListRow.Texts,
|
|
1018
990
|
{
|
|
1019
991
|
type: "1RowTypeA",
|
|
1020
992
|
top: title,
|
|
@@ -1066,8 +1038,8 @@ var APP_SHARE_MENU_INFO = {
|
|
|
1066
1038
|
};
|
|
1067
1039
|
function AppShareListMenu() {
|
|
1068
1040
|
const initialScheme = (0, import_react_native17.getSchemeUri)();
|
|
1069
|
-
const isSandbox = (0,
|
|
1070
|
-
const { openConfirm } = (0,
|
|
1041
|
+
const isSandbox = (0, import_native_modules9.getOperationalEnvironment)() === "sandbox";
|
|
1042
|
+
const { openConfirm } = (0, import_tds_react_native7.useDialog)();
|
|
1071
1043
|
const schemeForShare = addParamsToUrl(initialScheme, {
|
|
1072
1044
|
referrer: SHARE_SCHEME_REFERRER
|
|
1073
1045
|
});
|
|
@@ -1097,12 +1069,12 @@ function AppShareListMenu() {
|
|
|
1097
1069
|
}
|
|
1098
1070
|
|
|
1099
1071
|
// src/core/hooks/useMoreButtonBottomSheet/PermissionsMenu.tsx
|
|
1100
|
-
var
|
|
1072
|
+
var import_native_modules10 = require("@apps-in-toss/native-modules");
|
|
1101
1073
|
var import_react_native19 = require("@granite-js/react-native");
|
|
1102
1074
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1103
1075
|
function PermissionsMenu() {
|
|
1104
1076
|
const globals = getAppsInTossGlobals();
|
|
1105
|
-
if ((0,
|
|
1077
|
+
if ((0, import_native_modules10.getOperationalEnvironment)() === "sandbox") {
|
|
1106
1078
|
return null;
|
|
1107
1079
|
}
|
|
1108
1080
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
@@ -1143,19 +1115,19 @@ var MIN_VERSION = {
|
|
|
1143
1115
|
function useMoreButtonBottomSheet() {
|
|
1144
1116
|
const globals = getAppsInTossGlobals();
|
|
1145
1117
|
const adaptive = (0, import_private4.useAdaptive)();
|
|
1146
|
-
const [itemList, setItemList] = (0,
|
|
1118
|
+
const [itemList, setItemList] = (0, import_react15.useState)([]);
|
|
1147
1119
|
const appUpdateDialog = useAppUpdateDialog();
|
|
1148
1120
|
const logging = useMoreButtonBottomSheetLogging();
|
|
1149
1121
|
const overlay = (0, import_private4.useOverlay)();
|
|
1150
1122
|
const title = ensureValue(globals.brandDisplayName, "displayName");
|
|
1151
|
-
const isBottomSheetSupported = (0,
|
|
1152
|
-
const isShareListMenuSupported = (0,
|
|
1153
|
-
const [isPermissionsMenuSupported, setIsPermissionsMenuSupported] = (0,
|
|
1154
|
-
(0,
|
|
1123
|
+
const isBottomSheetSupported = (0, import_native_modules11.isMinVersionSupported)(MIN_VERSION.BOTTOM_SHEET);
|
|
1124
|
+
const isShareListMenuSupported = (0, import_native_modules11.isMinVersionSupported)(MIN_VERSION.SHARE_LIST_MENU);
|
|
1125
|
+
const [isPermissionsMenuSupported, setIsPermissionsMenuSupported] = (0, import_react15.useState)(false);
|
|
1126
|
+
(0, import_react15.useEffect)(() => {
|
|
1155
1127
|
if (!isBottomSheetSupported) {
|
|
1156
1128
|
return;
|
|
1157
1129
|
}
|
|
1158
|
-
|
|
1130
|
+
import_native_modules11.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1159
1131
|
APP_BRIDGE_METHOD_NAME,
|
|
1160
1132
|
{},
|
|
1161
1133
|
{
|
|
@@ -1163,8 +1135,8 @@ function useMoreButtonBottomSheet() {
|
|
|
1163
1135
|
onError: (error) => console.error("\uBA54\uB274 \uBAA9\uB85D\uC744 \uAC00\uC838\uC624\uB294 \uB370 \uC2E4\uD328\uD588\uC5B4\uC694:", error)
|
|
1164
1136
|
}
|
|
1165
1137
|
);
|
|
1166
|
-
if ((0,
|
|
1167
|
-
|
|
1138
|
+
if ((0, import_native_modules11.isMinVersionSupported)(MIN_VERSION.PERMISSIONS_MENU)) {
|
|
1139
|
+
import_native_modules11.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1168
1140
|
"getAllPermission",
|
|
1169
1141
|
{},
|
|
1170
1142
|
{
|
|
@@ -1189,17 +1161,17 @@ function useMoreButtonBottomSheet() {
|
|
|
1189
1161
|
close();
|
|
1190
1162
|
};
|
|
1191
1163
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(BottomSheetImpressionArea, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1192
|
-
|
|
1164
|
+
import_tds_react_native8.BottomSheet.Root,
|
|
1193
1165
|
{
|
|
1194
1166
|
header: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1195
|
-
|
|
1167
|
+
import_tds_react_native8.ListHeader,
|
|
1196
1168
|
{
|
|
1197
|
-
title: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1169
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tds_react_native8.ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
|
|
1198
1170
|
}
|
|
1199
1171
|
),
|
|
1200
1172
|
open: isOpen,
|
|
1201
1173
|
cta: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1202
|
-
|
|
1174
|
+
import_tds_react_native8.BottomSheet.CTA,
|
|
1203
1175
|
{
|
|
1204
1176
|
size: "large",
|
|
1205
1177
|
type: "dark",
|
|
@@ -1212,7 +1184,7 @@ function useMoreButtonBottomSheet() {
|
|
|
1212
1184
|
),
|
|
1213
1185
|
onClose: handleClose,
|
|
1214
1186
|
onExited: exit,
|
|
1215
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1187
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_tds_react_native8.List, { rowSeparator: "none", children: [
|
|
1216
1188
|
itemList.map(
|
|
1217
1189
|
(item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1218
1190
|
Menu,
|
|
@@ -1235,22 +1207,27 @@ function useMoreButtonBottomSheet() {
|
|
|
1235
1207
|
}
|
|
1236
1208
|
function BottomSheetImpressionArea({ children }) {
|
|
1237
1209
|
const logging = useMoreButtonBottomSheetLogging();
|
|
1238
|
-
(0,
|
|
1210
|
+
(0, import_react15.useEffect)(() => {
|
|
1239
1211
|
logging.show();
|
|
1240
1212
|
}, [logging]);
|
|
1241
1213
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children });
|
|
1242
1214
|
}
|
|
1243
1215
|
|
|
1216
|
+
// src/core/utils/toIcon.ts
|
|
1217
|
+
function toIcon(source) {
|
|
1218
|
+
return source.startsWith("http") ? { source: { uri: source } } : { name: source };
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1244
1221
|
// src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
|
|
1245
|
-
var
|
|
1222
|
+
var import_react16 = require("react");
|
|
1246
1223
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1247
1224
|
function NavigationBarImpressionArea({
|
|
1248
1225
|
children,
|
|
1249
1226
|
withHomeButton
|
|
1250
1227
|
}) {
|
|
1251
|
-
const hasLogged = (0,
|
|
1228
|
+
const hasLogged = (0, import_react16.useRef)(false);
|
|
1252
1229
|
const logging = useNavigationBarLogging();
|
|
1253
|
-
(0,
|
|
1230
|
+
(0, import_react16.useEffect)(() => {
|
|
1254
1231
|
if (hasLogged.current === false) {
|
|
1255
1232
|
logging.navBarImpression({ home_icon_yn: withHomeButton ? "Y" : "N" });
|
|
1256
1233
|
hasLogged.current = true;
|
|
@@ -1289,7 +1266,7 @@ function DefaultNavigationBar() {
|
|
|
1289
1266
|
|
|
1290
1267
|
// src/components/NavigationBar/RNNavigationBar/Game.tsx
|
|
1291
1268
|
var import_react_native_safe_area_context = require("@granite-js/native/react-native-safe-area-context");
|
|
1292
|
-
var
|
|
1269
|
+
var import_tds_react_native9 = require("@toss/tds-react-native");
|
|
1293
1270
|
var import_private6 = require("@toss/tds-react-native/private");
|
|
1294
1271
|
var import_react_native21 = require("react-native");
|
|
1295
1272
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
@@ -1301,7 +1278,7 @@ function GameNavigationBar() {
|
|
|
1301
1278
|
const { right: safeAreaRight } = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
|
|
1302
1279
|
useHardwareBackPress(navigationEvent.handleBack);
|
|
1303
1280
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1304
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1281
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_tds_react_native9.PageNavbar, { preference: { type: "none" } }),
|
|
1305
1282
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1306
1283
|
import_react_native21.View,
|
|
1307
1284
|
{
|
|
@@ -1357,26 +1334,18 @@ function RNAppContainer({ children }) {
|
|
|
1357
1334
|
}
|
|
1358
1335
|
}
|
|
1359
1336
|
function GameAppContainer({ children }) {
|
|
1360
|
-
|
|
1361
|
-
(0, import_react18.useEffect)(() => {
|
|
1337
|
+
(0, import_react17.useEffect)(() => {
|
|
1362
1338
|
if (import_react_native22.Platform.OS === "ios") {
|
|
1363
|
-
(0,
|
|
1339
|
+
(0, import_native_modules12.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1364
1340
|
return () => {
|
|
1365
|
-
(0,
|
|
1341
|
+
(0, import_native_modules12.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1366
1342
|
};
|
|
1367
1343
|
}
|
|
1368
1344
|
return;
|
|
1369
1345
|
}, []);
|
|
1370
|
-
(0, import_react18.useEffect)(() => {
|
|
1371
|
-
import_native_modules13.appsInTossEvent.addEventListener("entryMessageExited", {
|
|
1372
|
-
onEvent: () => {
|
|
1373
|
-
setIsEntryMessageExited(true);
|
|
1374
|
-
}
|
|
1375
|
-
});
|
|
1376
|
-
}, []);
|
|
1377
1346
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1378
1347
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RNNavigationBar.Game, {}),
|
|
1379
|
-
(0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GameInitializer, {
|
|
1348
|
+
(0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GameInitializer, { children }) : children
|
|
1380
1349
|
] });
|
|
1381
1350
|
}
|
|
1382
1351
|
function GeneralAppContainer({ children }) {
|
|
@@ -1389,7 +1358,7 @@ function GeneralAppContainer({ children }) {
|
|
|
1389
1358
|
// src/core/registerApp.tsx
|
|
1390
1359
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1391
1360
|
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
1392
|
-
if (!(0,
|
|
1361
|
+
if (!(0, import_native_modules13.isMinVersionSupported)({
|
|
1393
1362
|
android: "5.220.0",
|
|
1394
1363
|
ios: "5.221.0"
|
|
1395
1364
|
})) {
|
|
@@ -1403,25 +1372,21 @@ function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
|
1403
1372
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.StayTime, {}),
|
|
1404
1373
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.Entry, {}),
|
|
1405
1374
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.System, { ...initialProps }),
|
|
1406
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1375
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_tds_react_native10.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children }) })
|
|
1407
1376
|
] });
|
|
1408
1377
|
}
|
|
1409
|
-
function TDSContainer({ children }) {
|
|
1410
|
-
useAppsInTossBridge();
|
|
1411
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children });
|
|
1412
|
-
}
|
|
1413
1378
|
function registerApp(container, { context, analytics }) {
|
|
1414
1379
|
const appName = getAppName();
|
|
1415
1380
|
const isRegistered = import_react_native24.AppRegistry.getAppKeys().includes(appName);
|
|
1416
1381
|
if (!isRegistered) {
|
|
1417
1382
|
import_analytics.Analytics.init({
|
|
1418
|
-
logger: (params) => void (0,
|
|
1383
|
+
logger: (params) => void (0, import_native_modules13.eventLog)(params),
|
|
1419
1384
|
debug: analytics?.debug ?? __DEV__
|
|
1420
1385
|
});
|
|
1421
1386
|
const App = import_react_native23.Granite.registerApp(AppsInTossContainer.bind(null, container), {
|
|
1422
1387
|
appName,
|
|
1423
1388
|
context,
|
|
1424
|
-
setIosSwipeGestureEnabled:
|
|
1389
|
+
setIosSwipeGestureEnabled: import_native_modules13.setIosSwipeGestureEnabled,
|
|
1425
1390
|
router: {
|
|
1426
1391
|
screenContainer: AppsInTossScreenContainer,
|
|
1427
1392
|
defaultScreenOption: {
|
|
@@ -1452,42 +1417,42 @@ var AppsInToss = {
|
|
|
1452
1417
|
};
|
|
1453
1418
|
|
|
1454
1419
|
// src/components/WebView.tsx
|
|
1455
|
-
var
|
|
1420
|
+
var import_native_modules18 = require("@apps-in-toss/native-modules");
|
|
1456
1421
|
var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async-bridges"), 1);
|
|
1457
1422
|
var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
|
|
1458
1423
|
var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event-bridges"), 1);
|
|
1459
1424
|
var import_react_native_safe_area_context4 = require("@granite-js/native/react-native-safe-area-context");
|
|
1460
1425
|
var import_react_native34 = require("@granite-js/react-native");
|
|
1461
|
-
var
|
|
1426
|
+
var import_tds_react_native14 = require("@toss/tds-react-native");
|
|
1462
1427
|
var import_private9 = require("@toss/tds-react-native/private");
|
|
1463
|
-
var
|
|
1428
|
+
var import_react28 = require("react");
|
|
1464
1429
|
var import_react_native35 = require("react-native");
|
|
1465
1430
|
|
|
1466
1431
|
// src/components/GameWebView.tsx
|
|
1467
|
-
var
|
|
1432
|
+
var import_native_modules14 = require("@apps-in-toss/native-modules");
|
|
1468
1433
|
var import_react_native_webview = require("@granite-js/native/react-native-webview");
|
|
1469
|
-
var
|
|
1434
|
+
var import_react19 = require("react");
|
|
1470
1435
|
var import_react_native27 = require("react-native");
|
|
1471
1436
|
|
|
1472
1437
|
// src/components/NavigationBar/GameWebviewNavigationBar.tsx
|
|
1473
1438
|
var import_react_native_safe_area_context2 = require("@granite-js/native/react-native-safe-area-context");
|
|
1474
1439
|
var import_react_native25 = require("@granite-js/react-native");
|
|
1475
|
-
var
|
|
1440
|
+
var import_tds_react_native11 = require("@toss/tds-react-native");
|
|
1476
1441
|
var import_private7 = require("@toss/tds-react-native/private");
|
|
1477
1442
|
var import_es_hangul3 = require("es-hangul");
|
|
1478
|
-
var
|
|
1443
|
+
var import_react18 = require("react");
|
|
1479
1444
|
var import_react_native26 = require("react-native");
|
|
1480
1445
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1481
1446
|
function GameWebviewNavigationBar() {
|
|
1482
1447
|
const safeAreaTop = (0, import_private7.useSafeAreaTop)();
|
|
1483
|
-
const { openConfirm } = (0,
|
|
1448
|
+
const { openConfirm } = (0, import_tds_react_native11.useDialog)();
|
|
1484
1449
|
const { captureExitLog } = useCaptureExitLog();
|
|
1485
1450
|
const global2 = getAppsInTossGlobals();
|
|
1486
1451
|
const logging = useNavigationBarLogging();
|
|
1487
1452
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1488
1453
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1489
1454
|
const { right: safeAreaRight } = (0, import_react_native_safe_area_context2.useSafeAreaInsets)();
|
|
1490
|
-
const handleGameWebviewClose = (0,
|
|
1455
|
+
const handleGameWebviewClose = (0, import_react18.useCallback)(async () => {
|
|
1491
1456
|
logging.closeButtonClick();
|
|
1492
1457
|
const isConfirmed = await openConfirm({
|
|
1493
1458
|
title: `${(0, import_es_hangul3.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
@@ -1503,7 +1468,7 @@ function GameWebviewNavigationBar() {
|
|
|
1503
1468
|
}
|
|
1504
1469
|
}, [captureExitLog, global2.brandDisplayName, logging, openConfirm]);
|
|
1505
1470
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1506
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1471
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_tds_react_native11.PageNavbar, { preference: { type: "none" } }),
|
|
1507
1472
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1508
1473
|
import_react_native26.View,
|
|
1509
1474
|
{
|
|
@@ -1538,52 +1503,44 @@ function GameWebviewNavigationBar() {
|
|
|
1538
1503
|
|
|
1539
1504
|
// src/components/GameWebView.tsx
|
|
1540
1505
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1541
|
-
var GameWebView = (0,
|
|
1542
|
-
|
|
1543
|
-
(0, import_react20.useEffect)(() => {
|
|
1506
|
+
var GameWebView = (0, import_react19.forwardRef)(function GameWebView2(props, ref) {
|
|
1507
|
+
(0, import_react19.useEffect)(() => {
|
|
1544
1508
|
if (import_react_native27.Platform.OS === "ios") {
|
|
1545
|
-
(0,
|
|
1509
|
+
(0, import_native_modules14.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1546
1510
|
return () => {
|
|
1547
|
-
(0,
|
|
1511
|
+
(0, import_native_modules14.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1548
1512
|
};
|
|
1549
1513
|
}
|
|
1550
1514
|
return;
|
|
1551
1515
|
}, []);
|
|
1552
|
-
(0, import_react20.useEffect)(() => {
|
|
1553
|
-
import_native_modules15.appsInTossEvent.addEventListener("entryMessageExited", {
|
|
1554
|
-
onEvent: () => {
|
|
1555
|
-
setIsEntryMessageExited(true);
|
|
1556
|
-
}
|
|
1557
|
-
});
|
|
1558
|
-
}, []);
|
|
1559
1516
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
1560
1517
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GameWebviewNavigationBar, {}),
|
|
1561
|
-
(0,
|
|
1518
|
+
(0, import_native_modules14.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GameInitializer, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native_webview.WebView, { ref, ...props }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native_webview.WebView, { ref, ...props })
|
|
1562
1519
|
] });
|
|
1563
1520
|
});
|
|
1564
1521
|
|
|
1565
1522
|
// src/components/PartnerWebView.tsx
|
|
1566
1523
|
var import_react_native_webview2 = require("@granite-js/native/react-native-webview");
|
|
1567
|
-
var
|
|
1524
|
+
var import_react21 = require("react");
|
|
1568
1525
|
|
|
1569
1526
|
// src/components/NavigationBar/PartnerWebviewNavigationBar.tsx
|
|
1570
1527
|
var import_react_native28 = require("@granite-js/react-native");
|
|
1571
|
-
var
|
|
1528
|
+
var import_tds_react_native12 = require("@toss/tds-react-native");
|
|
1572
1529
|
var import_private8 = require("@toss/tds-react-native/private");
|
|
1573
1530
|
var import_es_hangul4 = require("es-hangul");
|
|
1574
|
-
var
|
|
1531
|
+
var import_react20 = require("react");
|
|
1575
1532
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1576
1533
|
function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
1577
1534
|
const globals = getAppsInTossGlobals();
|
|
1578
1535
|
const { captureExitLog } = useCaptureExitLog();
|
|
1579
1536
|
const logging = useNavigationBarLogging();
|
|
1580
|
-
const { openConfirm } = (0,
|
|
1537
|
+
const { openConfirm } = (0, import_tds_react_native12.useDialog)();
|
|
1581
1538
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1582
1539
|
const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
|
|
1583
1540
|
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
1584
1541
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
1585
1542
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1586
|
-
const handleClose = (0,
|
|
1543
|
+
const handleClose = (0, import_react20.useCallback)(async () => {
|
|
1587
1544
|
logging.closeButtonClick();
|
|
1588
1545
|
const isConfirmed = await openConfirm({
|
|
1589
1546
|
title: `${(0, import_es_hangul4.josa)(globals.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
@@ -1617,7 +1574,7 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1617
1574
|
|
|
1618
1575
|
// src/components/PartnerWebView.tsx
|
|
1619
1576
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1620
|
-
var PartnerWebView = (0,
|
|
1577
|
+
var PartnerWebView = (0, import_react21.forwardRef)(function PartnerWebViewScreen({ onBackButtonClick, onHomeButtonClick, ...webViewProps }, ref) {
|
|
1621
1578
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1622
1579
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PartnerWebviewNavigationBar, { onBackButtonClick, onHomeButtonClick }),
|
|
1623
1580
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native_webview2.WebView, { ref, ...webViewProps, style: { flex: 1 } })
|
|
@@ -1638,7 +1595,7 @@ function convertIntentURL(url) {
|
|
|
1638
1595
|
}
|
|
1639
1596
|
|
|
1640
1597
|
// src/bridge-handler/useBridgeHandler.tsx
|
|
1641
|
-
var
|
|
1598
|
+
var import_react22 = require("react");
|
|
1642
1599
|
function serializeError(error) {
|
|
1643
1600
|
return JSON.stringify(error, (_, value) => {
|
|
1644
1601
|
if (value instanceof Error) {
|
|
@@ -1690,8 +1647,8 @@ function useBridgeHandler({
|
|
|
1690
1647
|
asyncHandlerMap,
|
|
1691
1648
|
eventListenerMap
|
|
1692
1649
|
}) {
|
|
1693
|
-
const ref = (0,
|
|
1694
|
-
const injectedJavaScript = (0,
|
|
1650
|
+
const ref = (0, import_react22.useRef)(null);
|
|
1651
|
+
const injectedJavaScript = (0, import_react22.useMemo)(
|
|
1695
1652
|
() => `window.__CONSTANT_HANDLER_MAP = ${JSON.stringify(
|
|
1696
1653
|
Object.entries(constantHandlerMap).reduce(
|
|
1697
1654
|
(acc, [key, value]) => {
|
|
@@ -1703,7 +1660,7 @@ function useBridgeHandler({
|
|
|
1703
1660
|
)};`,
|
|
1704
1661
|
[constantHandlerMap]
|
|
1705
1662
|
);
|
|
1706
|
-
(0,
|
|
1663
|
+
(0, import_react22.useEffect)(() => {
|
|
1707
1664
|
ref.current?.injectJavaScript(injectedJavaScript);
|
|
1708
1665
|
}, [injectedJavaScript]);
|
|
1709
1666
|
const createHandleOnEvent = (functionName, eventId) => (response) => {
|
|
@@ -1717,7 +1674,7 @@ function useBridgeHandler({
|
|
|
1717
1674
|
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
|
|
1718
1675
|
`);
|
|
1719
1676
|
};
|
|
1720
|
-
const $onMessage = (0,
|
|
1677
|
+
const $onMessage = (0, import_react22.useCallback)(
|
|
1721
1678
|
async (e) => {
|
|
1722
1679
|
onMessage?.(e);
|
|
1723
1680
|
const data = parseNativeEventData(e.nativeEvent.data);
|
|
@@ -1777,7 +1734,7 @@ function parseNativeEventData(data) {
|
|
|
1777
1734
|
|
|
1778
1735
|
// src/core/hooks/useSafeAreaInsetsEmitter.tsx
|
|
1779
1736
|
var import_react_native_safe_area_context3 = require("@granite-js/native/react-native-safe-area-context");
|
|
1780
|
-
var
|
|
1737
|
+
var import_react23 = require("react");
|
|
1781
1738
|
var EventEmitter = class {
|
|
1782
1739
|
listeners = {};
|
|
1783
1740
|
on(event, listener) {
|
|
@@ -1801,8 +1758,8 @@ var EventEmitter = class {
|
|
|
1801
1758
|
};
|
|
1802
1759
|
function useSafeAreaInsetsEmitter() {
|
|
1803
1760
|
const insets = (0, import_react_native_safe_area_context3.useSafeAreaInsets)();
|
|
1804
|
-
const emitter = (0,
|
|
1805
|
-
(0,
|
|
1761
|
+
const emitter = (0, import_react23.useMemo)(() => new EventEmitter(), []);
|
|
1762
|
+
(0, import_react23.useEffect)(() => {
|
|
1806
1763
|
emitter.emit("safeAreaInsetsChange", insets);
|
|
1807
1764
|
return () => {
|
|
1808
1765
|
emitter.off("safeAreaInsetsChange", (listener) => listener(insets));
|
|
@@ -1813,12 +1770,12 @@ function useSafeAreaInsetsEmitter() {
|
|
|
1813
1770
|
|
|
1814
1771
|
// src/core/hooks/useWebBackHandler.tsx
|
|
1815
1772
|
var import_react_native29 = require("@granite-js/react-native");
|
|
1816
|
-
var
|
|
1773
|
+
var import_tds_react_native13 = require("@toss/tds-react-native");
|
|
1817
1774
|
var import_es_hangul5 = require("es-hangul");
|
|
1818
|
-
var
|
|
1775
|
+
var import_react25 = require("react");
|
|
1819
1776
|
|
|
1820
1777
|
// src/hooks/useWebviewHistoryStack.tsx
|
|
1821
|
-
var
|
|
1778
|
+
var import_react24 = require("react");
|
|
1822
1779
|
var INITIAL_STATE = { stack: [], index: -1 };
|
|
1823
1780
|
function reducer(state, action) {
|
|
1824
1781
|
switch (action.type) {
|
|
@@ -1849,11 +1806,11 @@ function reducer(state, action) {
|
|
|
1849
1806
|
}
|
|
1850
1807
|
}
|
|
1851
1808
|
function useWebViewHistory() {
|
|
1852
|
-
const [state, dispatch] = (0,
|
|
1853
|
-
const onNavigationStateChange = (0,
|
|
1809
|
+
const [state, dispatch] = (0, import_react24.useReducer)(reducer, INITIAL_STATE);
|
|
1810
|
+
const onNavigationStateChange = (0, import_react24.useCallback)(({ url, canGoForward: canGoForward2 }) => {
|
|
1854
1811
|
dispatch({ type: "NAVIGATION_CHANGE", url, canGoForward: canGoForward2 });
|
|
1855
1812
|
}, []);
|
|
1856
|
-
const { canGoBack, canGoForward } = (0,
|
|
1813
|
+
const { canGoBack, canGoForward } = (0, import_react24.useMemo)(() => {
|
|
1857
1814
|
const canBack = state.index > 0;
|
|
1858
1815
|
const canFwd = state.index >= 0 && state.index < state.stack.length - 1;
|
|
1859
1816
|
return { canGoBack: canBack, canGoForward: canFwd };
|
|
@@ -1884,21 +1841,21 @@ function useWebBackHandler(webViewRef) {
|
|
|
1884
1841
|
removeEventListener: removeWebBackEventListener
|
|
1885
1842
|
} = (0, import_react_native29.useBackEventState)();
|
|
1886
1843
|
const logging = useNavigationBarLogging();
|
|
1887
|
-
const { openConfirm } = (0,
|
|
1844
|
+
const { openConfirm } = (0, import_tds_react_native13.useDialog)();
|
|
1888
1845
|
const global2 = getAppsInTossGlobals();
|
|
1889
|
-
const addEventListener = (0,
|
|
1846
|
+
const addEventListener = (0, import_react25.useCallback)(
|
|
1890
1847
|
(handler) => {
|
|
1891
1848
|
addWebBackEventListener(handler);
|
|
1892
1849
|
},
|
|
1893
1850
|
[addWebBackEventListener]
|
|
1894
1851
|
);
|
|
1895
|
-
const removeEventListener = (0,
|
|
1852
|
+
const removeEventListener = (0, import_react25.useCallback)(
|
|
1896
1853
|
(handler) => {
|
|
1897
1854
|
removeWebBackEventListener(handler);
|
|
1898
1855
|
},
|
|
1899
1856
|
[removeWebBackEventListener]
|
|
1900
1857
|
);
|
|
1901
|
-
const handleWebBack = (0,
|
|
1858
|
+
const handleWebBack = (0, import_react25.useCallback)(async () => {
|
|
1902
1859
|
if (hasWebBackEvent) {
|
|
1903
1860
|
for (const handler of webBackHandlersRef) {
|
|
1904
1861
|
handler();
|
|
@@ -1931,7 +1888,7 @@ function useWebBackHandler(webViewRef) {
|
|
|
1931
1888
|
openConfirm,
|
|
1932
1889
|
webViewRef
|
|
1933
1890
|
]);
|
|
1934
|
-
const handleWebHome = (0,
|
|
1891
|
+
const handleWebHome = (0, import_react25.useCallback)(() => {
|
|
1935
1892
|
logging.homeButtonClick();
|
|
1936
1893
|
if (hasWebBackEvent) {
|
|
1937
1894
|
for (const handler of webBackHandlersRef) {
|
|
@@ -1941,7 +1898,7 @@ function useWebBackHandler(webViewRef) {
|
|
|
1941
1898
|
}
|
|
1942
1899
|
webViewRef.current?.injectJavaScript(HISTORY_HOME_SCRIPT);
|
|
1943
1900
|
}, [hasWebBackEvent, webBackHandlersRef, logging, webViewRef]);
|
|
1944
|
-
return (0,
|
|
1901
|
+
return (0, import_react25.useMemo)(
|
|
1945
1902
|
() => ({ addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange }),
|
|
1946
1903
|
[addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange]
|
|
1947
1904
|
);
|
|
@@ -1961,7 +1918,7 @@ function mergeRefs(...refs) {
|
|
|
1961
1918
|
}
|
|
1962
1919
|
|
|
1963
1920
|
// src/hooks/useCreateUserAgent.ts
|
|
1964
|
-
var
|
|
1921
|
+
var import_native_modules15 = require("@apps-in-toss/native-modules");
|
|
1965
1922
|
var import_react_native30 = require("react-native");
|
|
1966
1923
|
var FontA11yCategory = {
|
|
1967
1924
|
Large: "Large",
|
|
@@ -2095,8 +2052,8 @@ function useCreateUserAgent({
|
|
|
2095
2052
|
safeArea,
|
|
2096
2053
|
safeAreaBottomTransparency
|
|
2097
2054
|
}) {
|
|
2098
|
-
const platform = (0,
|
|
2099
|
-
const appVersion = (0,
|
|
2055
|
+
const platform = (0, import_native_modules15.getPlatformOS)();
|
|
2056
|
+
const appVersion = (0, import_native_modules15.getTossAppVersion)();
|
|
2100
2057
|
const { fontScale } = (0, import_react_native30.useWindowDimensions)();
|
|
2101
2058
|
const platformString = platform === "ios" ? "iPhone" : "Android phone";
|
|
2102
2059
|
const fontA11y = mapFontScaleToCategory(fontScale, platform);
|
|
@@ -2118,17 +2075,17 @@ function useCreateUserAgent({
|
|
|
2118
2075
|
}
|
|
2119
2076
|
|
|
2120
2077
|
// src/hooks/useGeolocation.ts
|
|
2121
|
-
var
|
|
2078
|
+
var import_native_modules16 = require("@apps-in-toss/native-modules");
|
|
2122
2079
|
var import_react_native31 = require("@granite-js/react-native");
|
|
2123
|
-
var
|
|
2080
|
+
var import_react26 = require("react");
|
|
2124
2081
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
2125
2082
|
const isVisible = (0, import_react_native31.useVisibility)();
|
|
2126
|
-
const [location, setLocation] = (0,
|
|
2127
|
-
(0,
|
|
2083
|
+
const [location, setLocation] = (0, import_react26.useState)(null);
|
|
2084
|
+
(0, import_react26.useEffect)(() => {
|
|
2128
2085
|
if (!isVisible) {
|
|
2129
2086
|
return;
|
|
2130
2087
|
}
|
|
2131
|
-
return (0,
|
|
2088
|
+
return (0, import_native_modules16.startUpdateLocation)({
|
|
2132
2089
|
options: {
|
|
2133
2090
|
accuracy,
|
|
2134
2091
|
distanceInterval,
|
|
@@ -2143,11 +2100,11 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
2143
2100
|
|
|
2144
2101
|
// src/hooks/useWaitForReturnNavigator.tsx
|
|
2145
2102
|
var import_react_native32 = require("@granite-js/react-native");
|
|
2146
|
-
var
|
|
2103
|
+
var import_react27 = require("react");
|
|
2147
2104
|
function useWaitForReturnNavigator() {
|
|
2148
|
-
const callbacks = (0,
|
|
2105
|
+
const callbacks = (0, import_react27.useRef)([]).current;
|
|
2149
2106
|
const navigation = (0, import_react_native32.useNavigation)();
|
|
2150
|
-
const startNavigating = (0,
|
|
2107
|
+
const startNavigating = (0, import_react27.useCallback)(
|
|
2151
2108
|
(route, params) => {
|
|
2152
2109
|
return new Promise((resolve) => {
|
|
2153
2110
|
callbacks.push(resolve);
|
|
@@ -2156,7 +2113,7 @@ function useWaitForReturnNavigator() {
|
|
|
2156
2113
|
},
|
|
2157
2114
|
[callbacks, navigation]
|
|
2158
2115
|
);
|
|
2159
|
-
const handleVisibilityChange = (0,
|
|
2116
|
+
const handleVisibilityChange = (0, import_react27.useCallback)(
|
|
2160
2117
|
(state) => {
|
|
2161
2118
|
if (state === "visible" && callbacks.length > 0) {
|
|
2162
2119
|
for (const callback of callbacks) {
|
|
@@ -2181,7 +2138,7 @@ function useTopNavigation() {
|
|
|
2181
2138
|
}
|
|
2182
2139
|
|
|
2183
2140
|
// src/utils/log.ts
|
|
2184
|
-
var
|
|
2141
|
+
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
2185
2142
|
var import_react_native33 = require("@granite-js/react-native");
|
|
2186
2143
|
|
|
2187
2144
|
// src/utils/extractDateFromUUIDv7.ts
|
|
@@ -2226,7 +2183,7 @@ var trackScreen = (url) => {
|
|
|
2226
2183
|
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
2227
2184
|
}
|
|
2228
2185
|
};
|
|
2229
|
-
return (0,
|
|
2186
|
+
return (0, import_native_modules17.eventLog)(log);
|
|
2230
2187
|
};
|
|
2231
2188
|
|
|
2232
2189
|
// src/components/WebView.tsx
|
|
@@ -2235,7 +2192,7 @@ var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment
|
|
|
2235
2192
|
var TYPES = ["partner", "external", "game"];
|
|
2236
2193
|
var WEBVIEW_TYPES = {
|
|
2237
2194
|
partner: PartnerWebView,
|
|
2238
|
-
external:
|
|
2195
|
+
external: import_tds_react_native14.ExternalWebViewScreen,
|
|
2239
2196
|
game: GameWebView
|
|
2240
2197
|
};
|
|
2241
2198
|
function mergeSchemeQueryParamsInto(url) {
|
|
@@ -2252,7 +2209,7 @@ function getWebViewUri(local) {
|
|
|
2252
2209
|
const devUrl = `http://${local.host}:${local.port}`;
|
|
2253
2210
|
return mergeSchemeQueryParamsInto(devUrl).toString();
|
|
2254
2211
|
}
|
|
2255
|
-
const { url: rawUrl } =
|
|
2212
|
+
const { url: rawUrl } = import_native_modules18.AppsInTossModule.getWebBundleURL({});
|
|
2256
2213
|
const url = mergeSchemeQueryParamsInto(rawUrl);
|
|
2257
2214
|
const deploymentId = env.getDeploymentId();
|
|
2258
2215
|
if (deploymentId) {
|
|
@@ -2264,31 +2221,30 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2264
2221
|
if (!TYPES.includes(type)) {
|
|
2265
2222
|
throw new Error(`Invalid WebView type: '${type}'`);
|
|
2266
2223
|
}
|
|
2267
|
-
const webViewRef = (0,
|
|
2224
|
+
const webViewRef = (0, import_react28.useRef)(null);
|
|
2268
2225
|
const webBackHandler = useWebBackHandler(webViewRef);
|
|
2269
|
-
const uri = (0,
|
|
2226
|
+
const uri = (0, import_react28.useMemo)(() => getWebViewUri(local), [local]);
|
|
2270
2227
|
const top = (0, import_private9.useSafeAreaTop)();
|
|
2271
2228
|
const bottom = (0, import_private9.useSafeAreaBottom)();
|
|
2272
2229
|
const insets = (0, import_react_native_safe_area_context4.useSafeAreaInsets)();
|
|
2273
2230
|
const global2 = getAppsInTossGlobals();
|
|
2274
2231
|
const navigationBarContext = useNavigationBarContext();
|
|
2275
2232
|
const safeAreaInsetsEmitter = useSafeAreaInsetsEmitter();
|
|
2276
|
-
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0,
|
|
2233
|
+
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0, import_react28.useState)(
|
|
2277
2234
|
props.allowsBackForwardNavigationGestures
|
|
2278
2235
|
);
|
|
2279
2236
|
const handler = useBridgeHandler({
|
|
2280
2237
|
onMessage,
|
|
2281
2238
|
eventListenerMap: {
|
|
2282
2239
|
...appsInTossEventBridges,
|
|
2283
|
-
navigationAccessoryEvent: ({ onEvent, onError }) =>
|
|
2240
|
+
navigationAccessoryEvent: ({ onEvent, onError }) => import_tds_react_native14.tdsEvent.addEventListener("navigationAccessoryEvent", { onEvent, onError }),
|
|
2284
2241
|
backEvent: ({ onEvent }) => {
|
|
2285
2242
|
webBackHandler.addEventListener(onEvent);
|
|
2286
2243
|
return () => {
|
|
2287
2244
|
webBackHandler.removeEventListener(onEvent);
|
|
2288
2245
|
};
|
|
2289
2246
|
},
|
|
2290
|
-
|
|
2291
|
-
updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules19.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
2247
|
+
updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules18.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
2292
2248
|
safeAreaInsetsChange: ({ onEvent }) => {
|
|
2293
2249
|
safeAreaInsetsEmitter.on("safeAreaInsetsChange", onEvent);
|
|
2294
2250
|
return () => {
|
|
@@ -2296,18 +2252,18 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2296
2252
|
};
|
|
2297
2253
|
},
|
|
2298
2254
|
/** @internal */
|
|
2299
|
-
appBridgeCallbackEvent: ({ onEvent, onError, options }) =>
|
|
2255
|
+
appBridgeCallbackEvent: ({ onEvent, onError, options }) => import_native_modules18.appsInTossEvent.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
|
|
2300
2256
|
/** AdMob */
|
|
2301
|
-
loadAdMobInterstitialAd:
|
|
2302
|
-
showAdMobInterstitialAd:
|
|
2303
|
-
loadAdMobRewardedAd:
|
|
2304
|
-
showAdMobRewardedAd:
|
|
2257
|
+
loadAdMobInterstitialAd: import_native_modules18.GoogleAdMob.loadAdMobInterstitialAd,
|
|
2258
|
+
showAdMobInterstitialAd: import_native_modules18.GoogleAdMob.showAdMobInterstitialAd,
|
|
2259
|
+
loadAdMobRewardedAd: import_native_modules18.GoogleAdMob.loadAdMobRewardedAd,
|
|
2260
|
+
showAdMobRewardedAd: import_native_modules18.GoogleAdMob.showAdMobRewardedAd,
|
|
2305
2261
|
/** AdMobV2 */
|
|
2306
|
-
loadAppsInTossAdMob:
|
|
2307
|
-
showAppsInTossAdMob:
|
|
2262
|
+
loadAppsInTossAdMob: import_native_modules18.GoogleAdMob.loadAppsInTossAdMob,
|
|
2263
|
+
showAppsInTossAdMob: import_native_modules18.GoogleAdMob.showAppsInTossAdMob,
|
|
2308
2264
|
/** IAP */
|
|
2309
|
-
iapCreateOneTimePurchaseOrder:
|
|
2310
|
-
requestOneTimePurchase:
|
|
2265
|
+
iapCreateOneTimePurchaseOrder: import_native_modules18.IAP.createOneTimePurchaseOrder,
|
|
2266
|
+
requestOneTimePurchase: import_native_modules18.requestOneTimePurchase
|
|
2311
2267
|
},
|
|
2312
2268
|
constantHandlerMap: {
|
|
2313
2269
|
...appsInTossConstantBridges,
|
|
@@ -2317,13 +2273,13 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2317
2273
|
getSafeAreaRight: () => insets.right,
|
|
2318
2274
|
...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
|
|
2319
2275
|
/** AdMob */
|
|
2320
|
-
loadAdMobInterstitialAd_isSupported:
|
|
2321
|
-
showAdMobInterstitialAd_isSupported:
|
|
2322
|
-
loadAdMobRewardedAd_isSupported:
|
|
2323
|
-
showAdMobRewardedAd_isSupported:
|
|
2276
|
+
loadAdMobInterstitialAd_isSupported: import_native_modules18.GoogleAdMob.loadAdMobInterstitialAd.isSupported,
|
|
2277
|
+
showAdMobInterstitialAd_isSupported: import_native_modules18.GoogleAdMob.showAdMobInterstitialAd.isSupported,
|
|
2278
|
+
loadAdMobRewardedAd_isSupported: import_native_modules18.GoogleAdMob.loadAdMobRewardedAd.isSupported,
|
|
2279
|
+
showAdMobRewardedAd_isSupported: import_native_modules18.GoogleAdMob.showAdMobRewardedAd.isSupported,
|
|
2324
2280
|
/** AdMobV2 */
|
|
2325
|
-
loadAppsInTossAdMob_isSupported:
|
|
2326
|
-
showAppsInTossAdMob_isSupported:
|
|
2281
|
+
loadAppsInTossAdMob_isSupported: import_native_modules18.GoogleAdMob.loadAppsInTossAdMob.isSupported,
|
|
2282
|
+
showAppsInTossAdMob_isSupported: import_native_modules18.GoogleAdMob.showAppsInTossAdMob.isSupported,
|
|
2327
2283
|
/** env */
|
|
2328
2284
|
getDeploymentId: env.getDeploymentId
|
|
2329
2285
|
},
|
|
@@ -2346,20 +2302,20 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2346
2302
|
getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
|
|
2347
2303
|
openCamera: appsInTossAsyncBridges.openCamera,
|
|
2348
2304
|
/** Storage */
|
|
2349
|
-
getStorageItem:
|
|
2350
|
-
setStorageItem:
|
|
2351
|
-
removeStorageItem:
|
|
2352
|
-
clearItems:
|
|
2305
|
+
getStorageItem: import_native_modules18.Storage.getItem,
|
|
2306
|
+
setStorageItem: import_native_modules18.Storage.setItem,
|
|
2307
|
+
removeStorageItem: import_native_modules18.Storage.removeItem,
|
|
2308
|
+
clearItems: import_native_modules18.Storage.clearItems,
|
|
2353
2309
|
/** IAP */
|
|
2354
|
-
iapGetProductItemList:
|
|
2355
|
-
iapCreateOneTimePurchaseOrder:
|
|
2356
|
-
processProductGrant:
|
|
2357
|
-
getPendingOrders:
|
|
2358
|
-
getCompletedOrRefundedOrders:
|
|
2359
|
-
completeProductGrant:
|
|
2310
|
+
iapGetProductItemList: import_native_modules18.IAP.getProductItemList,
|
|
2311
|
+
iapCreateOneTimePurchaseOrder: import_native_modules18.iapCreateOneTimePurchaseOrder,
|
|
2312
|
+
processProductGrant: import_native_modules18.processProductGrant,
|
|
2313
|
+
getPendingOrders: import_native_modules18.IAP.getPendingOrders,
|
|
2314
|
+
getCompletedOrRefundedOrders: import_native_modules18.IAP.getCompletedOrRefundedOrders,
|
|
2315
|
+
completeProductGrant: import_native_modules18.IAP.completeProductGrant
|
|
2360
2316
|
}
|
|
2361
2317
|
});
|
|
2362
|
-
const headerPropForExternalWebView = (0,
|
|
2318
|
+
const headerPropForExternalWebView = (0, import_react28.useMemo)(() => {
|
|
2363
2319
|
const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
|
|
2364
2320
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
2365
2321
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
@@ -2380,7 +2336,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2380
2336
|
colorPreference: "light"
|
|
2381
2337
|
});
|
|
2382
2338
|
const refs = mergeRefs(handler.ref, webViewRef);
|
|
2383
|
-
(0,
|
|
2339
|
+
(0, import_react28.useEffect)(() => {
|
|
2384
2340
|
const callback = () => {
|
|
2385
2341
|
webBackHandler.handleWebBack();
|
|
2386
2342
|
return true;
|