@apps-in-toss/framework 0.0.0-dev.1763432540119 → 0.0.0-dev.1765732023607
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 +422 -317
- package/dist/index.js +303 -196
- package/package.json +15 -15
package/dist/index.cjs
CHANGED
|
@@ -49,9 +49,9 @@ var import_analytics2 = require("@apps-in-toss/analytics");
|
|
|
49
49
|
// src/core/registerApp.tsx
|
|
50
50
|
var import_analytics = require("@apps-in-toss/analytics");
|
|
51
51
|
var import_native_modules13 = require("@apps-in-toss/native-modules");
|
|
52
|
-
var
|
|
52
|
+
var import_react_native23 = require("@granite-js/react-native");
|
|
53
53
|
var import_tds_react_native10 = require("@toss/tds-react-native");
|
|
54
|
-
var
|
|
54
|
+
var import_react_native24 = require("react-native");
|
|
55
55
|
|
|
56
56
|
// src/core/components/AppEvent.tsx
|
|
57
57
|
var import_native_modules2 = require("@apps-in-toss/native-modules");
|
|
@@ -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
252
|
var import_native_modules12 = require("@apps-in-toss/native-modules");
|
|
281
|
-
var
|
|
282
|
-
var
|
|
253
|
+
var import_react17 = require("react");
|
|
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
|
|
@@ -887,20 +859,24 @@ function useNavigationEvent() {
|
|
|
887
859
|
|
|
888
860
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
889
861
|
var import_native_modules11 = require("@apps-in-toss/native-modules");
|
|
890
|
-
var
|
|
862
|
+
var import_react_native20 = require("@granite-js/react-native");
|
|
891
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
|
|
897
|
-
var
|
|
868
|
+
var import_native_modules9 = require("@apps-in-toss/native-modules");
|
|
869
|
+
var import_react_native17 = require("@granite-js/react-native");
|
|
898
870
|
var import_tds_react_native7 = require("@toss/tds-react-native");
|
|
871
|
+
var import_react_native18 = require("react-native");
|
|
872
|
+
|
|
873
|
+
// src/core/hooks/useMoreButtonBottomSheet/Menu.tsx
|
|
874
|
+
var import_tds_react_native6 = require("@toss/tds-react-native");
|
|
899
875
|
var import_private3 = require("@toss/tds-react-native/private");
|
|
900
|
-
var
|
|
876
|
+
var import_react_native16 = require("react-native");
|
|
901
877
|
|
|
902
878
|
// src/core/hooks/useMoreButtonBottomSheet/useMoreButtonBottomSheetLogging.tsx
|
|
903
|
-
var
|
|
879
|
+
var import_native_modules8 = require("@apps-in-toss/native-modules");
|
|
904
880
|
var import_react_native15 = require("@granite-js/react-native");
|
|
905
881
|
var BOTTOM_SHEET_SCHEMA_ID = 1596825;
|
|
906
882
|
var BOTTOM_SHEET_LOG_NAME = "appsintoss_app_visit__common_module::bottomsheet__more";
|
|
@@ -917,7 +893,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
917
893
|
app_name: import_react_native15.Granite.appName
|
|
918
894
|
};
|
|
919
895
|
const logBottomSheetShow = () => {
|
|
920
|
-
|
|
896
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
921
897
|
log_name: BOTTOM_SHEET_LOG_NAME,
|
|
922
898
|
log_type: "popup",
|
|
923
899
|
params: {
|
|
@@ -927,7 +903,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
927
903
|
});
|
|
928
904
|
};
|
|
929
905
|
const logBottomSheetOpen = () => {
|
|
930
|
-
|
|
906
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
931
907
|
log_name: BOTTOM_SHEET_OPEN_LOG_NAME,
|
|
932
908
|
log_type: "event",
|
|
933
909
|
params: {
|
|
@@ -938,7 +914,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
938
914
|
});
|
|
939
915
|
};
|
|
940
916
|
const logBottomSheetCloseClick = () => {
|
|
941
|
-
|
|
917
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
942
918
|
log_name: BOTTOM_SHEET_CLOSE_CLICK_LOG_NAME,
|
|
943
919
|
log_type: "event",
|
|
944
920
|
params: {
|
|
@@ -949,7 +925,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
949
925
|
});
|
|
950
926
|
};
|
|
951
927
|
const logBottomSheetMenuClick = ({ title }) => {
|
|
952
|
-
|
|
928
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
953
929
|
log_name: BOTTOM_SHEET_MENU_CLICK_LOG_NAME,
|
|
954
930
|
log_type: "event",
|
|
955
931
|
params: {
|
|
@@ -968,6 +944,82 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
968
944
|
};
|
|
969
945
|
}
|
|
970
946
|
|
|
947
|
+
// src/core/hooks/useMoreButtonBottomSheet/Menu.tsx
|
|
948
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
949
|
+
function Menu({ title, iconURL, onPress }) {
|
|
950
|
+
const globals = getAppsInTossGlobals();
|
|
951
|
+
const adaptive = (0, import_private3.useAdaptive)();
|
|
952
|
+
const iconName = getIconName(iconURL);
|
|
953
|
+
const logging = useMoreButtonBottomSheetLogging();
|
|
954
|
+
const brandPrimaryColorRGB = hexToRGB(globals.brandPrimaryColor);
|
|
955
|
+
const iconBackgroundColor = brandPrimaryColorRGB ? `rgba(${brandPrimaryColorRGB.join(",")},0.1)` : adaptive.grey100;
|
|
956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
957
|
+
import_tds_react_native6.ListRow,
|
|
958
|
+
{
|
|
959
|
+
left: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
960
|
+
import_react_native16.View,
|
|
961
|
+
{
|
|
962
|
+
style: {
|
|
963
|
+
width: 30,
|
|
964
|
+
height: 30,
|
|
965
|
+
borderRadius: 10,
|
|
966
|
+
flexDirection: "row",
|
|
967
|
+
alignItems: "center",
|
|
968
|
+
justifyContent: "center",
|
|
969
|
+
marginRight: 16,
|
|
970
|
+
backgroundColor: iconBackgroundColor
|
|
971
|
+
},
|
|
972
|
+
children: iconName ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
973
|
+
import_tds_react_native6.Asset.Icon,
|
|
974
|
+
{
|
|
975
|
+
frameShape: { width: 20, height: 20 },
|
|
976
|
+
color: globals.brandPrimaryColor,
|
|
977
|
+
name: iconName
|
|
978
|
+
}
|
|
979
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
980
|
+
import_tds_react_native6.Asset.Image,
|
|
981
|
+
{
|
|
982
|
+
frameShape: { width: 20, height: 20 },
|
|
983
|
+
source: { uri: iconURL }
|
|
984
|
+
}
|
|
985
|
+
)
|
|
986
|
+
}
|
|
987
|
+
),
|
|
988
|
+
contents: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
989
|
+
import_tds_react_native6.ListRow.Texts,
|
|
990
|
+
{
|
|
991
|
+
type: "1RowTypeA",
|
|
992
|
+
top: title,
|
|
993
|
+
topProps: { color: adaptive.grey700 }
|
|
994
|
+
}
|
|
995
|
+
),
|
|
996
|
+
verticalPadding: "extraSmall",
|
|
997
|
+
onPress: () => {
|
|
998
|
+
logging.menuClick({ title });
|
|
999
|
+
onPress?.();
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
);
|
|
1003
|
+
}
|
|
1004
|
+
var iconNameRegExp = /^(icon-|icn-(?!(car|sec|bank-(fill|square|horizontal))-))(.+)/i;
|
|
1005
|
+
var iconURLRegExp = /^https:\/\/static\.toss\.im\/icons\/(png\/\dx|svg|pdf)\/((icon-|icn-(?!(car|sec|bank-(fill|square|horizontal))-))(.+))\.(png|svg|pdf)$/i;
|
|
1006
|
+
function isIconUrl(url) {
|
|
1007
|
+
return iconNameRegExp.test(url) || iconURLRegExp.test(url);
|
|
1008
|
+
}
|
|
1009
|
+
function getIconName(url) {
|
|
1010
|
+
if (!isIconUrl(url)) {
|
|
1011
|
+
return null;
|
|
1012
|
+
}
|
|
1013
|
+
if (iconNameRegExp.test(url)) {
|
|
1014
|
+
return url;
|
|
1015
|
+
}
|
|
1016
|
+
return url.match(iconURLRegExp)?.[2];
|
|
1017
|
+
}
|
|
1018
|
+
function hexToRGB(hex) {
|
|
1019
|
+
const rgb = hex.toLowerCase().match(/[0-9,a-f]{2}/g)?.map((str) => parseInt(str, 16));
|
|
1020
|
+
return rgb?.length === 3 ? rgb : void 0;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
971
1023
|
// src/core/utils/url.ts
|
|
972
1024
|
function addParamsToUrl(url, params) {
|
|
973
1025
|
const urlObj = new URL(url);
|
|
@@ -978,42 +1030,24 @@ function addParamsToUrl(url, params) {
|
|
|
978
1030
|
}
|
|
979
1031
|
|
|
980
1032
|
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
981
|
-
var
|
|
1033
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
982
1034
|
var SHARE_SCHEME_REFERRER = "appsintoss.common_module_share";
|
|
983
1035
|
var APP_SHARE_MENU_INFO = {
|
|
984
1036
|
contactItemName: "\uACF5\uC720\uD558\uAE30",
|
|
985
1037
|
contactIconUrl: "https://static.toss.im/icons/png/4x/icon-share-dots-mono.png"
|
|
986
1038
|
};
|
|
987
1039
|
function AppShareListMenu() {
|
|
988
|
-
const
|
|
989
|
-
const
|
|
990
|
-
const logging = useMoreButtonBottomSheetLogging();
|
|
991
|
-
const initialScheme = (0, import_react_native16.getSchemeUri)();
|
|
992
|
-
const isSandbox = (0, import_native_modules10.getOperationalEnvironment)() === "sandbox";
|
|
1040
|
+
const initialScheme = (0, import_react_native17.getSchemeUri)();
|
|
1041
|
+
const isSandbox = (0, import_native_modules9.getOperationalEnvironment)() === "sandbox";
|
|
993
1042
|
const { openConfirm } = (0, import_tds_react_native7.useDialog)();
|
|
994
1043
|
const schemeForShare = addParamsToUrl(initialScheme, {
|
|
995
1044
|
referrer: SHARE_SCHEME_REFERRER
|
|
996
1045
|
});
|
|
997
|
-
return /* @__PURE__ */ (0,
|
|
998
|
-
|
|
1046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1047
|
+
Menu,
|
|
999
1048
|
{
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
{
|
|
1003
|
-
color: globals.brandPrimaryColor,
|
|
1004
|
-
source: { uri: APP_SHARE_MENU_INFO.contactIconUrl },
|
|
1005
|
-
type: "background"
|
|
1006
|
-
}
|
|
1007
|
-
),
|
|
1008
|
-
contents: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1009
|
-
import_tds_react_native7.ListRow.Texts,
|
|
1010
|
-
{
|
|
1011
|
-
type: "1RowTypeA",
|
|
1012
|
-
top: APP_SHARE_MENU_INFO.contactItemName,
|
|
1013
|
-
topProps: { color: adaptive.grey700 }
|
|
1014
|
-
}
|
|
1015
|
-
),
|
|
1016
|
-
verticalPadding: "extraSmall",
|
|
1049
|
+
title: APP_SHARE_MENU_INFO.contactItemName,
|
|
1050
|
+
iconURL: APP_SHARE_MENU_INFO.contactIconUrl,
|
|
1017
1051
|
onPress: () => {
|
|
1018
1052
|
if (isSandbox) {
|
|
1019
1053
|
openConfirm({
|
|
@@ -1024,8 +1058,7 @@ function AppShareListMenu() {
|
|
|
1024
1058
|
});
|
|
1025
1059
|
return;
|
|
1026
1060
|
}
|
|
1027
|
-
|
|
1028
|
-
import_react_native17.NativeModules.AppsInTossModule.shareWithScheme({
|
|
1061
|
+
import_react_native18.NativeModules.AppsInTossModule.shareWithScheme({
|
|
1029
1062
|
params: {
|
|
1030
1063
|
schemeURL: schemeForShare
|
|
1031
1064
|
}
|
|
@@ -1035,6 +1068,25 @@ function AppShareListMenu() {
|
|
|
1035
1068
|
);
|
|
1036
1069
|
}
|
|
1037
1070
|
|
|
1071
|
+
// src/core/hooks/useMoreButtonBottomSheet/PermissionsMenu.tsx
|
|
1072
|
+
var import_native_modules10 = require("@apps-in-toss/native-modules");
|
|
1073
|
+
var import_react_native19 = require("@granite-js/react-native");
|
|
1074
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1075
|
+
function PermissionsMenu() {
|
|
1076
|
+
const globals = getAppsInTossGlobals();
|
|
1077
|
+
if ((0, import_native_modules10.getOperationalEnvironment)() === "sandbox") {
|
|
1078
|
+
return null;
|
|
1079
|
+
}
|
|
1080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1081
|
+
Menu,
|
|
1082
|
+
{
|
|
1083
|
+
title: "\uAD8C\uD55C \uC124\uC815",
|
|
1084
|
+
iconURL: "https://static.toss.im/icons/png/4x/icon-setting-mono.png",
|
|
1085
|
+
onPress: () => (0, import_react_native19.openURL)(`servicetoss://apps-in-toss-menu/permissions?appName=${import_react_native19.Granite.appName}&displayAppName=${globals.brandDisplayName}`)
|
|
1086
|
+
}
|
|
1087
|
+
);
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1038
1090
|
// src/core/utils/ensureValue.ts
|
|
1039
1091
|
function ensureValue(value, name) {
|
|
1040
1092
|
if (value === void 0) {
|
|
@@ -1044,7 +1096,7 @@ function ensureValue(value, name) {
|
|
|
1044
1096
|
}
|
|
1045
1097
|
|
|
1046
1098
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
1047
|
-
var
|
|
1099
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1048
1100
|
var APP_BRIDGE_METHOD_NAME = "getMiniAppsSupportContact";
|
|
1049
1101
|
var MIN_VERSION = {
|
|
1050
1102
|
BOTTOM_SHEET: {
|
|
@@ -1054,19 +1106,24 @@ var MIN_VERSION = {
|
|
|
1054
1106
|
SHARE_LIST_MENU: {
|
|
1055
1107
|
android: "5.230.0",
|
|
1056
1108
|
ios: "5.230.0"
|
|
1109
|
+
},
|
|
1110
|
+
PERMISSIONS_MENU: {
|
|
1111
|
+
android: "5.238.0",
|
|
1112
|
+
ios: "5.237.0"
|
|
1057
1113
|
}
|
|
1058
1114
|
};
|
|
1059
1115
|
function useMoreButtonBottomSheet() {
|
|
1060
1116
|
const globals = getAppsInTossGlobals();
|
|
1061
1117
|
const adaptive = (0, import_private4.useAdaptive)();
|
|
1062
|
-
const [itemList, setItemList] = (0,
|
|
1118
|
+
const [itemList, setItemList] = (0, import_react15.useState)([]);
|
|
1063
1119
|
const appUpdateDialog = useAppUpdateDialog();
|
|
1064
1120
|
const logging = useMoreButtonBottomSheetLogging();
|
|
1065
1121
|
const overlay = (0, import_private4.useOverlay)();
|
|
1066
1122
|
const title = ensureValue(globals.brandDisplayName, "displayName");
|
|
1067
1123
|
const isBottomSheetSupported = (0, import_native_modules11.isMinVersionSupported)(MIN_VERSION.BOTTOM_SHEET);
|
|
1068
1124
|
const isShareListMenuSupported = (0, import_native_modules11.isMinVersionSupported)(MIN_VERSION.SHARE_LIST_MENU);
|
|
1069
|
-
(0,
|
|
1125
|
+
const [isPermissionsMenuSupported, setIsPermissionsMenuSupported] = (0, import_react15.useState)(false);
|
|
1126
|
+
(0, import_react15.useEffect)(() => {
|
|
1070
1127
|
if (!isBottomSheetSupported) {
|
|
1071
1128
|
return;
|
|
1072
1129
|
}
|
|
@@ -1078,6 +1135,16 @@ function useMoreButtonBottomSheet() {
|
|
|
1078
1135
|
onError: (error) => console.error("\uBA54\uB274 \uBAA9\uB85D\uC744 \uAC00\uC838\uC624\uB294 \uB370 \uC2E4\uD328\uD588\uC5B4\uC694:", error)
|
|
1079
1136
|
}
|
|
1080
1137
|
);
|
|
1138
|
+
if ((0, import_native_modules11.isMinVersionSupported)(MIN_VERSION.PERMISSIONS_MENU)) {
|
|
1139
|
+
import_native_modules11.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1140
|
+
"getAllPermission",
|
|
1141
|
+
{},
|
|
1142
|
+
{
|
|
1143
|
+
onSuccess: (permissions) => setIsPermissionsMenuSupported(permissions.length > 0),
|
|
1144
|
+
onError: (error) => console.error("\uAD8C\uD55C \uBAA9\uB85D\uC744 \uAC00\uC838\uC624\uB294 \uB370 \uC2E4\uD328\uD588\uC5B4\uC694:", error)
|
|
1145
|
+
}
|
|
1146
|
+
);
|
|
1147
|
+
}
|
|
1081
1148
|
}, [isBottomSheetSupported]);
|
|
1082
1149
|
const onClickHandler = async () => {
|
|
1083
1150
|
logging.open();
|
|
@@ -1093,17 +1160,17 @@ function useMoreButtonBottomSheet() {
|
|
|
1093
1160
|
logging.close();
|
|
1094
1161
|
close();
|
|
1095
1162
|
};
|
|
1096
|
-
return /* @__PURE__ */ (0,
|
|
1163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(BottomSheetImpressionArea, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1097
1164
|
import_tds_react_native8.BottomSheet.Root,
|
|
1098
1165
|
{
|
|
1099
|
-
header: /* @__PURE__ */ (0,
|
|
1166
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1100
1167
|
import_tds_react_native8.ListHeader,
|
|
1101
1168
|
{
|
|
1102
|
-
title: /* @__PURE__ */ (0,
|
|
1169
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tds_react_native8.ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
|
|
1103
1170
|
}
|
|
1104
1171
|
),
|
|
1105
1172
|
open: isOpen,
|
|
1106
|
-
cta: /* @__PURE__ */ (0,
|
|
1173
|
+
cta: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1107
1174
|
import_tds_react_native8.BottomSheet.CTA,
|
|
1108
1175
|
{
|
|
1109
1176
|
size: "large",
|
|
@@ -1117,37 +1184,20 @@ function useMoreButtonBottomSheet() {
|
|
|
1117
1184
|
),
|
|
1118
1185
|
onClose: handleClose,
|
|
1119
1186
|
onExited: exit,
|
|
1120
|
-
children: /* @__PURE__ */ (0,
|
|
1121
|
-
itemList.map(
|
|
1122
|
-
|
|
1123
|
-
|
|
1187
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_tds_react_native8.List, { rowSeparator: "none", children: [
|
|
1188
|
+
itemList.map(
|
|
1189
|
+
(item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1190
|
+
Menu,
|
|
1124
1191
|
{
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
color: globals.brandPrimaryColor,
|
|
1129
|
-
source: { uri: item.contactIconUrl },
|
|
1130
|
-
type: "background"
|
|
1131
|
-
}
|
|
1132
|
-
),
|
|
1133
|
-
contents: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1134
|
-
import_tds_react_native8.ListRow.Texts,
|
|
1135
|
-
{
|
|
1136
|
-
type: "1RowTypeA",
|
|
1137
|
-
top: item.contactItemName,
|
|
1138
|
-
topProps: { color: adaptive.grey700 }
|
|
1139
|
-
}
|
|
1140
|
-
),
|
|
1141
|
-
verticalPadding: "extraSmall",
|
|
1142
|
-
onPress: () => {
|
|
1143
|
-
logging.menuClick({ title: item.contactItemName });
|
|
1144
|
-
(0, import_react_native18.openURL)(item.contactUri);
|
|
1145
|
-
}
|
|
1192
|
+
title: item.contactItemName,
|
|
1193
|
+
iconURL: item.contactIconUrl,
|
|
1194
|
+
onPress: () => (0, import_react_native20.openURL)(item.contactUri)
|
|
1146
1195
|
},
|
|
1147
1196
|
item.contactItemName
|
|
1148
|
-
)
|
|
1149
|
-
|
|
1150
|
-
isShareListMenuSupported && /* @__PURE__ */ (0,
|
|
1197
|
+
)
|
|
1198
|
+
),
|
|
1199
|
+
isShareListMenuSupported && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AppShareListMenu, {}),
|
|
1200
|
+
isPermissionsMenuSupported && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PermissionsMenu, {})
|
|
1151
1201
|
] })
|
|
1152
1202
|
}
|
|
1153
1203
|
) });
|
|
@@ -1157,32 +1207,37 @@ function useMoreButtonBottomSheet() {
|
|
|
1157
1207
|
}
|
|
1158
1208
|
function BottomSheetImpressionArea({ children }) {
|
|
1159
1209
|
const logging = useMoreButtonBottomSheetLogging();
|
|
1160
|
-
(0,
|
|
1210
|
+
(0, import_react15.useEffect)(() => {
|
|
1161
1211
|
logging.show();
|
|
1162
1212
|
}, [logging]);
|
|
1163
|
-
return /* @__PURE__ */ (0,
|
|
1213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children });
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
// src/core/utils/toIcon.ts
|
|
1217
|
+
function toIcon(source) {
|
|
1218
|
+
return source.startsWith("http") ? { source: { uri: source } } : { name: source };
|
|
1164
1219
|
}
|
|
1165
1220
|
|
|
1166
1221
|
// src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
|
|
1167
|
-
var
|
|
1168
|
-
var
|
|
1222
|
+
var import_react16 = require("react");
|
|
1223
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1169
1224
|
function NavigationBarImpressionArea({
|
|
1170
1225
|
children,
|
|
1171
1226
|
withHomeButton
|
|
1172
1227
|
}) {
|
|
1173
|
-
const hasLogged = (0,
|
|
1228
|
+
const hasLogged = (0, import_react16.useRef)(false);
|
|
1174
1229
|
const logging = useNavigationBarLogging();
|
|
1175
|
-
(0,
|
|
1230
|
+
(0, import_react16.useEffect)(() => {
|
|
1176
1231
|
if (hasLogged.current === false) {
|
|
1177
1232
|
logging.navBarImpression({ home_icon_yn: withHomeButton ? "Y" : "N" });
|
|
1178
1233
|
hasLogged.current = true;
|
|
1179
1234
|
}
|
|
1180
1235
|
}, [logging, withHomeButton]);
|
|
1181
|
-
return /* @__PURE__ */ (0,
|
|
1236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children });
|
|
1182
1237
|
}
|
|
1183
1238
|
|
|
1184
1239
|
// src/components/NavigationBar/RNNavigationBar/Default.tsx
|
|
1185
|
-
var
|
|
1240
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1186
1241
|
function DefaultNavigationBar() {
|
|
1187
1242
|
const globals = getAppsInTossGlobals();
|
|
1188
1243
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
@@ -1192,7 +1247,7 @@ function DefaultNavigationBar() {
|
|
|
1192
1247
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1193
1248
|
const navigationEvent = useNavigationEvent();
|
|
1194
1249
|
useHardwareBackPress(navigationEvent.handleBack);
|
|
1195
|
-
return /* @__PURE__ */ (0,
|
|
1250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1196
1251
|
import_private5.TopNavigation,
|
|
1197
1252
|
{
|
|
1198
1253
|
title: globals.brandDisplayName,
|
|
@@ -1203,7 +1258,8 @@ function DefaultNavigationBar() {
|
|
|
1203
1258
|
onPressClose: navigationEvent.handleCloseButtonClick,
|
|
1204
1259
|
withHome: withHomeButton,
|
|
1205
1260
|
fixedRightButton: navigationRightButton,
|
|
1206
|
-
|
|
1261
|
+
leftVisible: withBackButton,
|
|
1262
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_private5.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_private5.NavigationBackButton, { onPress: navigationEvent.handleBack, canGoBack: false }) })
|
|
1207
1263
|
}
|
|
1208
1264
|
) });
|
|
1209
1265
|
}
|
|
@@ -1212,8 +1268,8 @@ function DefaultNavigationBar() {
|
|
|
1212
1268
|
var import_react_native_safe_area_context = require("@granite-js/native/react-native-safe-area-context");
|
|
1213
1269
|
var import_tds_react_native9 = require("@toss/tds-react-native");
|
|
1214
1270
|
var import_private6 = require("@toss/tds-react-native/private");
|
|
1215
|
-
var
|
|
1216
|
-
var
|
|
1271
|
+
var import_react_native21 = require("react-native");
|
|
1272
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1217
1273
|
function GameNavigationBar() {
|
|
1218
1274
|
const safeAreaTop = (0, import_private6.useSafeAreaTop)();
|
|
1219
1275
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
@@ -1221,15 +1277,15 @@ function GameNavigationBar() {
|
|
|
1221
1277
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1222
1278
|
const { right: safeAreaRight } = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
|
|
1223
1279
|
useHardwareBackPress(navigationEvent.handleBack);
|
|
1224
|
-
return /* @__PURE__ */ (0,
|
|
1225
|
-
/* @__PURE__ */ (0,
|
|
1226
|
-
/* @__PURE__ */ (0,
|
|
1227
|
-
|
|
1280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1281
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_tds_react_native9.PageNavbar, { preference: { type: "none" } }),
|
|
1282
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1283
|
+
import_react_native21.View,
|
|
1228
1284
|
{
|
|
1229
1285
|
style: {
|
|
1230
1286
|
width: "100%",
|
|
1231
1287
|
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1232
|
-
height:
|
|
1288
|
+
height: import_react_native21.Platform.OS === "ios" ? 44 : 54,
|
|
1233
1289
|
flexDirection: "row",
|
|
1234
1290
|
alignItems: "center",
|
|
1235
1291
|
justifyContent: "flex-end",
|
|
@@ -1239,7 +1295,7 @@ function GameNavigationBar() {
|
|
|
1239
1295
|
paddingRight: safeAreaRight + 10
|
|
1240
1296
|
},
|
|
1241
1297
|
pointerEvents: "box-none",
|
|
1242
|
-
children: /* @__PURE__ */ (0,
|
|
1298
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1243
1299
|
import_private6.NavigationRightContent,
|
|
1244
1300
|
{
|
|
1245
1301
|
fixedRightButton: navigationRightButton,
|
|
@@ -1266,21 +1322,20 @@ __reExport(bridge_entry_exports, require("@apps-in-toss/native-modules/constant-
|
|
|
1266
1322
|
__reExport(bridge_entry_exports, require("@apps-in-toss/native-modules/event-bridges"));
|
|
1267
1323
|
|
|
1268
1324
|
// src/components/RNAppContainer.tsx
|
|
1269
|
-
var
|
|
1325
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1270
1326
|
function RNAppContainer({ children }) {
|
|
1271
1327
|
const global2 = getAppsInTossGlobals();
|
|
1272
1328
|
switch (global2.appType) {
|
|
1273
1329
|
case "game":
|
|
1274
|
-
return /* @__PURE__ */ (0,
|
|
1330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GameAppContainer, { children });
|
|
1275
1331
|
case "general":
|
|
1276
1332
|
default:
|
|
1277
|
-
return /* @__PURE__ */ (0,
|
|
1333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GeneralAppContainer, { children });
|
|
1278
1334
|
}
|
|
1279
1335
|
}
|
|
1280
1336
|
function GameAppContainer({ children }) {
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
if (import_react_native20.Platform.OS === "ios") {
|
|
1337
|
+
(0, import_react17.useEffect)(() => {
|
|
1338
|
+
if (import_react_native22.Platform.OS === "ios") {
|
|
1284
1339
|
(0, import_native_modules12.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1285
1340
|
return () => {
|
|
1286
1341
|
(0, import_native_modules12.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
@@ -1288,58 +1343,47 @@ function GameAppContainer({ children }) {
|
|
|
1288
1343
|
}
|
|
1289
1344
|
return;
|
|
1290
1345
|
}, []);
|
|
1291
|
-
(0,
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
setIsEntryMessageExited(true);
|
|
1295
|
-
}
|
|
1296
|
-
});
|
|
1297
|
-
}, []);
|
|
1298
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
1299
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RNNavigationBar.Game, {}),
|
|
1300
|
-
(0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GameInitializer, { isReadyForProfileUI: isEntryMessageExited, children }) : children
|
|
1346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1347
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RNNavigationBar.Game, {}),
|
|
1348
|
+
(0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GameInitializer, { children }) : children
|
|
1301
1349
|
] });
|
|
1302
1350
|
}
|
|
1303
1351
|
function GeneralAppContainer({ children }) {
|
|
1304
|
-
return /* @__PURE__ */ (0,
|
|
1305
|
-
/* @__PURE__ */ (0,
|
|
1352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1353
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RNNavigationBar.Default, {}),
|
|
1306
1354
|
children
|
|
1307
1355
|
] });
|
|
1308
1356
|
}
|
|
1309
1357
|
|
|
1310
1358
|
// src/core/registerApp.tsx
|
|
1311
|
-
var
|
|
1359
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1312
1360
|
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
1313
1361
|
if (!(0, import_native_modules13.isMinVersionSupported)({
|
|
1314
1362
|
android: "5.220.0",
|
|
1315
1363
|
ios: "5.221.0"
|
|
1316
1364
|
})) {
|
|
1317
|
-
return /* @__PURE__ */ (0,
|
|
1318
|
-
/* @__PURE__ */ (0,
|
|
1319
|
-
/* @__PURE__ */ (0,
|
|
1320
|
-
/* @__PURE__ */ (0,
|
|
1365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1366
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.Entry, {}),
|
|
1367
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.System, { ...initialProps }),
|
|
1368
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppUpdate, {})
|
|
1321
1369
|
] });
|
|
1322
1370
|
}
|
|
1323
|
-
return /* @__PURE__ */ (0,
|
|
1324
|
-
/* @__PURE__ */ (0,
|
|
1325
|
-
/* @__PURE__ */ (0,
|
|
1326
|
-
/* @__PURE__ */ (0,
|
|
1327
|
-
/* @__PURE__ */ (0,
|
|
1371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1372
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.StayTime, {}),
|
|
1373
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.Entry, {}),
|
|
1374
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.System, { ...initialProps }),
|
|
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 }) })
|
|
1328
1376
|
] });
|
|
1329
1377
|
}
|
|
1330
|
-
function TDSContainer({ children }) {
|
|
1331
|
-
useAppsInTossBridge();
|
|
1332
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, { children });
|
|
1333
|
-
}
|
|
1334
1378
|
function registerApp(container, { context, analytics }) {
|
|
1335
1379
|
const appName = getAppName();
|
|
1336
|
-
const isRegistered =
|
|
1380
|
+
const isRegistered = import_react_native24.AppRegistry.getAppKeys().includes(appName);
|
|
1337
1381
|
if (!isRegistered) {
|
|
1338
1382
|
import_analytics.Analytics.init({
|
|
1339
1383
|
logger: (params) => void (0, import_native_modules13.eventLog)(params),
|
|
1340
1384
|
debug: analytics?.debug ?? __DEV__
|
|
1341
1385
|
});
|
|
1342
|
-
const App =
|
|
1386
|
+
const App = import_react_native23.Granite.registerApp(AppsInTossContainer.bind(null, container), {
|
|
1343
1387
|
appName,
|
|
1344
1388
|
context,
|
|
1345
1389
|
setIosSwipeGestureEnabled: import_native_modules13.setIosSwipeGestureEnabled,
|
|
@@ -1356,7 +1400,7 @@ function registerApp(container, { context, analytics }) {
|
|
|
1356
1400
|
}
|
|
1357
1401
|
function AppsInTossScreenContainer({ children }) {
|
|
1358
1402
|
const isRNApp = getAppsInTossGlobals().webViewType == null;
|
|
1359
|
-
return /* @__PURE__ */ (0,
|
|
1403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(NavigationBarContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_analytics.Analytics.Screen, { children: isRNApp ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RNAppContainer, { children }) : children }) });
|
|
1360
1404
|
}
|
|
1361
1405
|
function getAppName() {
|
|
1362
1406
|
try {
|
|
@@ -1378,27 +1422,27 @@ var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async
|
|
|
1378
1422
|
var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
|
|
1379
1423
|
var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event-bridges"), 1);
|
|
1380
1424
|
var import_react_native_safe_area_context4 = require("@granite-js/native/react-native-safe-area-context");
|
|
1381
|
-
var
|
|
1425
|
+
var import_react_native34 = require("@granite-js/react-native");
|
|
1382
1426
|
var import_tds_react_native14 = require("@toss/tds-react-native");
|
|
1383
1427
|
var import_private9 = require("@toss/tds-react-native/private");
|
|
1384
|
-
var
|
|
1385
|
-
var
|
|
1428
|
+
var import_react28 = require("react");
|
|
1429
|
+
var import_react_native35 = require("react-native");
|
|
1386
1430
|
|
|
1387
1431
|
// src/components/GameWebView.tsx
|
|
1388
1432
|
var import_native_modules14 = require("@apps-in-toss/native-modules");
|
|
1389
1433
|
var import_react_native_webview = require("@granite-js/native/react-native-webview");
|
|
1390
|
-
var
|
|
1391
|
-
var
|
|
1434
|
+
var import_react19 = require("react");
|
|
1435
|
+
var import_react_native27 = require("react-native");
|
|
1392
1436
|
|
|
1393
1437
|
// src/components/NavigationBar/GameWebviewNavigationBar.tsx
|
|
1394
1438
|
var import_react_native_safe_area_context2 = require("@granite-js/native/react-native-safe-area-context");
|
|
1395
|
-
var
|
|
1439
|
+
var import_react_native25 = require("@granite-js/react-native");
|
|
1396
1440
|
var import_tds_react_native11 = require("@toss/tds-react-native");
|
|
1397
1441
|
var import_private7 = require("@toss/tds-react-native/private");
|
|
1398
1442
|
var import_es_hangul3 = require("es-hangul");
|
|
1399
|
-
var
|
|
1400
|
-
var
|
|
1401
|
-
var
|
|
1443
|
+
var import_react18 = require("react");
|
|
1444
|
+
var import_react_native26 = require("react-native");
|
|
1445
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1402
1446
|
function GameWebviewNavigationBar() {
|
|
1403
1447
|
const safeAreaTop = (0, import_private7.useSafeAreaTop)();
|
|
1404
1448
|
const { openConfirm } = (0, import_tds_react_native11.useDialog)();
|
|
@@ -1408,7 +1452,7 @@ function GameWebviewNavigationBar() {
|
|
|
1408
1452
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1409
1453
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1410
1454
|
const { right: safeAreaRight } = (0, import_react_native_safe_area_context2.useSafeAreaInsets)();
|
|
1411
|
-
const handleGameWebviewClose = (0,
|
|
1455
|
+
const handleGameWebviewClose = (0, import_react18.useCallback)(async () => {
|
|
1412
1456
|
logging.closeButtonClick();
|
|
1413
1457
|
const isConfirmed = await openConfirm({
|
|
1414
1458
|
title: `${(0, import_es_hangul3.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
@@ -1420,18 +1464,18 @@ function GameWebviewNavigationBar() {
|
|
|
1420
1464
|
logging.closePopupCtaClick(isConfirmed);
|
|
1421
1465
|
if (isConfirmed) {
|
|
1422
1466
|
captureExitLog(Date.now());
|
|
1423
|
-
(0,
|
|
1467
|
+
(0, import_react_native25.closeView)();
|
|
1424
1468
|
}
|
|
1425
1469
|
}, [captureExitLog, global2.brandDisplayName, logging, openConfirm]);
|
|
1426
|
-
return /* @__PURE__ */ (0,
|
|
1427
|
-
/* @__PURE__ */ (0,
|
|
1428
|
-
/* @__PURE__ */ (0,
|
|
1429
|
-
|
|
1470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1471
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_tds_react_native11.PageNavbar, { preference: { type: "none" } }),
|
|
1472
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1473
|
+
import_react_native26.View,
|
|
1430
1474
|
{
|
|
1431
1475
|
style: {
|
|
1432
1476
|
width: "100%",
|
|
1433
1477
|
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1434
|
-
height:
|
|
1478
|
+
height: import_react_native26.Platform.OS === "ios" ? 44 : 54,
|
|
1435
1479
|
flexDirection: "row",
|
|
1436
1480
|
alignItems: "center",
|
|
1437
1481
|
justifyContent: "flex-end",
|
|
@@ -1441,7 +1485,7 @@ function GameWebviewNavigationBar() {
|
|
|
1441
1485
|
paddingRight: safeAreaRight + 10
|
|
1442
1486
|
},
|
|
1443
1487
|
pointerEvents: "box-none",
|
|
1444
|
-
children: /* @__PURE__ */ (0,
|
|
1488
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1445
1489
|
import_private7.NavigationRightContent,
|
|
1446
1490
|
{
|
|
1447
1491
|
fixedRightButton: navigationRightButton,
|
|
@@ -1458,11 +1502,10 @@ function GameWebviewNavigationBar() {
|
|
|
1458
1502
|
}
|
|
1459
1503
|
|
|
1460
1504
|
// src/components/GameWebView.tsx
|
|
1461
|
-
var
|
|
1462
|
-
var GameWebView = (0,
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
if (import_react_native25.Platform.OS === "ios") {
|
|
1505
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1506
|
+
var GameWebView = (0, import_react19.forwardRef)(function GameWebView2(props, ref) {
|
|
1507
|
+
(0, import_react19.useEffect)(() => {
|
|
1508
|
+
if (import_react_native27.Platform.OS === "ios") {
|
|
1466
1509
|
(0, import_native_modules14.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1467
1510
|
return () => {
|
|
1468
1511
|
(0, import_native_modules14.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
@@ -1470,30 +1513,23 @@ var GameWebView = (0, import_react20.forwardRef)(function GameWebView2(props, re
|
|
|
1470
1513
|
}
|
|
1471
1514
|
return;
|
|
1472
1515
|
}, []);
|
|
1473
|
-
(0,
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
setIsEntryMessageExited(true);
|
|
1477
|
-
}
|
|
1478
|
-
});
|
|
1479
|
-
}, []);
|
|
1480
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1481
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GameWebviewNavigationBar, {}),
|
|
1482
|
-
(0, import_native_modules14.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GameInitializer, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native_webview.WebView, { ref, ...props }) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native_webview.WebView, { ref, ...props })
|
|
1516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
1517
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GameWebviewNavigationBar, {}),
|
|
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 })
|
|
1483
1519
|
] });
|
|
1484
1520
|
});
|
|
1485
1521
|
|
|
1486
1522
|
// src/components/PartnerWebView.tsx
|
|
1487
1523
|
var import_react_native_webview2 = require("@granite-js/native/react-native-webview");
|
|
1488
|
-
var
|
|
1524
|
+
var import_react21 = require("react");
|
|
1489
1525
|
|
|
1490
1526
|
// src/components/NavigationBar/PartnerWebviewNavigationBar.tsx
|
|
1491
|
-
var
|
|
1527
|
+
var import_react_native28 = require("@granite-js/react-native");
|
|
1492
1528
|
var import_tds_react_native12 = require("@toss/tds-react-native");
|
|
1493
1529
|
var import_private8 = require("@toss/tds-react-native/private");
|
|
1494
1530
|
var import_es_hangul4 = require("es-hangul");
|
|
1495
|
-
var
|
|
1496
|
-
var
|
|
1531
|
+
var import_react20 = require("react");
|
|
1532
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1497
1533
|
function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
1498
1534
|
const globals = getAppsInTossGlobals();
|
|
1499
1535
|
const { captureExitLog } = useCaptureExitLog();
|
|
@@ -1504,7 +1540,7 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1504
1540
|
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
1505
1541
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
1506
1542
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1507
|
-
const handleClose = (0,
|
|
1543
|
+
const handleClose = (0, import_react20.useCallback)(async () => {
|
|
1508
1544
|
logging.closeButtonClick();
|
|
1509
1545
|
const isConfirmed = await openConfirm({
|
|
1510
1546
|
title: `${(0, import_es_hangul4.josa)(globals.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
@@ -1516,10 +1552,10 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1516
1552
|
logging.closePopupCtaClick(isConfirmed);
|
|
1517
1553
|
if (isConfirmed) {
|
|
1518
1554
|
captureExitLog(Date.now());
|
|
1519
|
-
(0,
|
|
1555
|
+
(0, import_react_native28.closeView)();
|
|
1520
1556
|
}
|
|
1521
1557
|
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
1522
|
-
return /* @__PURE__ */ (0,
|
|
1558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1523
1559
|
import_private8.TopNavigation,
|
|
1524
1560
|
{
|
|
1525
1561
|
title: globals.brandDisplayName,
|
|
@@ -1530,22 +1566,36 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1530
1566
|
onPressClose: handleClose,
|
|
1531
1567
|
withHome: withHomeButton,
|
|
1532
1568
|
fixedRightButton: navigationRightButton,
|
|
1533
|
-
|
|
1569
|
+
leftVisible: withBackButton,
|
|
1570
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_private8.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_private8.NavigationBackButton, { onPress: onBackButtonClick, canGoBack: false }) })
|
|
1534
1571
|
}
|
|
1535
1572
|
) });
|
|
1536
1573
|
}
|
|
1537
1574
|
|
|
1538
1575
|
// src/components/PartnerWebView.tsx
|
|
1539
|
-
var
|
|
1540
|
-
var PartnerWebView = (0,
|
|
1541
|
-
return /* @__PURE__ */ (0,
|
|
1542
|
-
/* @__PURE__ */ (0,
|
|
1543
|
-
/* @__PURE__ */ (0,
|
|
1576
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1577
|
+
var PartnerWebView = (0, import_react21.forwardRef)(function PartnerWebViewScreen({ onBackButtonClick, onHomeButtonClick, ...webViewProps }, ref) {
|
|
1578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1579
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PartnerWebviewNavigationBar, { onBackButtonClick, onHomeButtonClick }),
|
|
1580
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native_webview2.WebView, { ref, ...webViewProps, style: { flex: 1 } })
|
|
1544
1581
|
] });
|
|
1545
1582
|
});
|
|
1546
1583
|
|
|
1584
|
+
// src/components/utils/url.ts
|
|
1585
|
+
function convertIntentURL(url) {
|
|
1586
|
+
if (url.protocol !== "intent:") {
|
|
1587
|
+
return null;
|
|
1588
|
+
}
|
|
1589
|
+
const components = url.hash.replace("#Intent;", "").split(";").map((component) => component.split("="));
|
|
1590
|
+
const scheme = components.find(([key]) => key === "scheme")?.[1];
|
|
1591
|
+
if (!scheme) {
|
|
1592
|
+
return null;
|
|
1593
|
+
}
|
|
1594
|
+
return `${scheme}://${url.hostname}${url.pathname}${url.search}`;
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1547
1597
|
// src/bridge-handler/useBridgeHandler.tsx
|
|
1548
|
-
var
|
|
1598
|
+
var import_react22 = require("react");
|
|
1549
1599
|
function serializeError(error) {
|
|
1550
1600
|
return JSON.stringify(error, (_, value) => {
|
|
1551
1601
|
if (value instanceof Error) {
|
|
@@ -1597,8 +1647,8 @@ function useBridgeHandler({
|
|
|
1597
1647
|
asyncHandlerMap,
|
|
1598
1648
|
eventListenerMap
|
|
1599
1649
|
}) {
|
|
1600
|
-
const ref = (0,
|
|
1601
|
-
const injectedJavaScript = (0,
|
|
1650
|
+
const ref = (0, import_react22.useRef)(null);
|
|
1651
|
+
const injectedJavaScript = (0, import_react22.useMemo)(
|
|
1602
1652
|
() => `window.__CONSTANT_HANDLER_MAP = ${JSON.stringify(
|
|
1603
1653
|
Object.entries(constantHandlerMap).reduce(
|
|
1604
1654
|
(acc, [key, value]) => {
|
|
@@ -1610,7 +1660,7 @@ function useBridgeHandler({
|
|
|
1610
1660
|
)};`,
|
|
1611
1661
|
[constantHandlerMap]
|
|
1612
1662
|
);
|
|
1613
|
-
(0,
|
|
1663
|
+
(0, import_react22.useEffect)(() => {
|
|
1614
1664
|
ref.current?.injectJavaScript(injectedJavaScript);
|
|
1615
1665
|
}, [injectedJavaScript]);
|
|
1616
1666
|
const createHandleOnEvent = (functionName, eventId) => (response) => {
|
|
@@ -1624,7 +1674,7 @@ function useBridgeHandler({
|
|
|
1624
1674
|
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
|
|
1625
1675
|
`);
|
|
1626
1676
|
};
|
|
1627
|
-
const $onMessage = (0,
|
|
1677
|
+
const $onMessage = (0, import_react22.useCallback)(
|
|
1628
1678
|
async (e) => {
|
|
1629
1679
|
onMessage?.(e);
|
|
1630
1680
|
const data = parseNativeEventData(e.nativeEvent.data);
|
|
@@ -1684,7 +1734,7 @@ function parseNativeEventData(data) {
|
|
|
1684
1734
|
|
|
1685
1735
|
// src/core/hooks/useSafeAreaInsetsEmitter.tsx
|
|
1686
1736
|
var import_react_native_safe_area_context3 = require("@granite-js/native/react-native-safe-area-context");
|
|
1687
|
-
var
|
|
1737
|
+
var import_react23 = require("react");
|
|
1688
1738
|
var EventEmitter = class {
|
|
1689
1739
|
listeners = {};
|
|
1690
1740
|
on(event, listener) {
|
|
@@ -1708,8 +1758,8 @@ var EventEmitter = class {
|
|
|
1708
1758
|
};
|
|
1709
1759
|
function useSafeAreaInsetsEmitter() {
|
|
1710
1760
|
const insets = (0, import_react_native_safe_area_context3.useSafeAreaInsets)();
|
|
1711
|
-
const emitter = (0,
|
|
1712
|
-
(0,
|
|
1761
|
+
const emitter = (0, import_react23.useMemo)(() => new EventEmitter(), []);
|
|
1762
|
+
(0, import_react23.useEffect)(() => {
|
|
1713
1763
|
emitter.emit("safeAreaInsetsChange", insets);
|
|
1714
1764
|
return () => {
|
|
1715
1765
|
emitter.off("safeAreaInsetsChange", (listener) => listener(insets));
|
|
@@ -1719,13 +1769,13 @@ function useSafeAreaInsetsEmitter() {
|
|
|
1719
1769
|
}
|
|
1720
1770
|
|
|
1721
1771
|
// src/core/hooks/useWebBackHandler.tsx
|
|
1722
|
-
var
|
|
1772
|
+
var import_react_native29 = require("@granite-js/react-native");
|
|
1723
1773
|
var import_tds_react_native13 = require("@toss/tds-react-native");
|
|
1724
1774
|
var import_es_hangul5 = require("es-hangul");
|
|
1725
|
-
var
|
|
1775
|
+
var import_react25 = require("react");
|
|
1726
1776
|
|
|
1727
1777
|
// src/hooks/useWebviewHistoryStack.tsx
|
|
1728
|
-
var
|
|
1778
|
+
var import_react24 = require("react");
|
|
1729
1779
|
var INITIAL_STATE = { stack: [], index: -1 };
|
|
1730
1780
|
function reducer(state, action) {
|
|
1731
1781
|
switch (action.type) {
|
|
@@ -1756,11 +1806,11 @@ function reducer(state, action) {
|
|
|
1756
1806
|
}
|
|
1757
1807
|
}
|
|
1758
1808
|
function useWebViewHistory() {
|
|
1759
|
-
const [state, dispatch] = (0,
|
|
1760
|
-
const onNavigationStateChange = (0,
|
|
1809
|
+
const [state, dispatch] = (0, import_react24.useReducer)(reducer, INITIAL_STATE);
|
|
1810
|
+
const onNavigationStateChange = (0, import_react24.useCallback)(({ url, canGoForward: canGoForward2 }) => {
|
|
1761
1811
|
dispatch({ type: "NAVIGATION_CHANGE", url, canGoForward: canGoForward2 });
|
|
1762
1812
|
}, []);
|
|
1763
|
-
const { canGoBack, canGoForward } = (0,
|
|
1813
|
+
const { canGoBack, canGoForward } = (0, import_react24.useMemo)(() => {
|
|
1764
1814
|
const canBack = state.index > 0;
|
|
1765
1815
|
const canFwd = state.index >= 0 && state.index < state.stack.length - 1;
|
|
1766
1816
|
return { canGoBack: canBack, canGoForward: canFwd };
|
|
@@ -1789,23 +1839,23 @@ function useWebBackHandler(webViewRef) {
|
|
|
1789
1839
|
hasBackEvent: hasWebBackEvent,
|
|
1790
1840
|
addEventListener: addWebBackEventListener,
|
|
1791
1841
|
removeEventListener: removeWebBackEventListener
|
|
1792
|
-
} = (0,
|
|
1842
|
+
} = (0, import_react_native29.useBackEventState)();
|
|
1793
1843
|
const logging = useNavigationBarLogging();
|
|
1794
1844
|
const { openConfirm } = (0, import_tds_react_native13.useDialog)();
|
|
1795
1845
|
const global2 = getAppsInTossGlobals();
|
|
1796
|
-
const addEventListener = (0,
|
|
1846
|
+
const addEventListener = (0, import_react25.useCallback)(
|
|
1797
1847
|
(handler) => {
|
|
1798
1848
|
addWebBackEventListener(handler);
|
|
1799
1849
|
},
|
|
1800
1850
|
[addWebBackEventListener]
|
|
1801
1851
|
);
|
|
1802
|
-
const removeEventListener = (0,
|
|
1852
|
+
const removeEventListener = (0, import_react25.useCallback)(
|
|
1803
1853
|
(handler) => {
|
|
1804
1854
|
removeWebBackEventListener(handler);
|
|
1805
1855
|
},
|
|
1806
1856
|
[removeWebBackEventListener]
|
|
1807
1857
|
);
|
|
1808
|
-
const handleWebBack = (0,
|
|
1858
|
+
const handleWebBack = (0, import_react25.useCallback)(async () => {
|
|
1809
1859
|
if (hasWebBackEvent) {
|
|
1810
1860
|
for (const handler of webBackHandlersRef) {
|
|
1811
1861
|
handler();
|
|
@@ -1825,7 +1875,7 @@ function useWebBackHandler(webViewRef) {
|
|
|
1825
1875
|
logging.closePopupCtaClick(isConfirmed);
|
|
1826
1876
|
if (isConfirmed) {
|
|
1827
1877
|
captureExitLog(Date.now());
|
|
1828
|
-
(0,
|
|
1878
|
+
(0, import_react_native29.closeView)();
|
|
1829
1879
|
}
|
|
1830
1880
|
}
|
|
1831
1881
|
}, [
|
|
@@ -1838,7 +1888,7 @@ function useWebBackHandler(webViewRef) {
|
|
|
1838
1888
|
openConfirm,
|
|
1839
1889
|
webViewRef
|
|
1840
1890
|
]);
|
|
1841
|
-
const handleWebHome = (0,
|
|
1891
|
+
const handleWebHome = (0, import_react25.useCallback)(() => {
|
|
1842
1892
|
logging.homeButtonClick();
|
|
1843
1893
|
if (hasWebBackEvent) {
|
|
1844
1894
|
for (const handler of webBackHandlersRef) {
|
|
@@ -1848,7 +1898,7 @@ function useWebBackHandler(webViewRef) {
|
|
|
1848
1898
|
}
|
|
1849
1899
|
webViewRef.current?.injectJavaScript(HISTORY_HOME_SCRIPT);
|
|
1850
1900
|
}, [hasWebBackEvent, webBackHandlersRef, logging, webViewRef]);
|
|
1851
|
-
return (0,
|
|
1901
|
+
return (0, import_react25.useMemo)(
|
|
1852
1902
|
() => ({ addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange }),
|
|
1853
1903
|
[addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange]
|
|
1854
1904
|
);
|
|
@@ -1869,7 +1919,7 @@ function mergeRefs(...refs) {
|
|
|
1869
1919
|
|
|
1870
1920
|
// src/hooks/useCreateUserAgent.ts
|
|
1871
1921
|
var import_native_modules15 = require("@apps-in-toss/native-modules");
|
|
1872
|
-
var
|
|
1922
|
+
var import_react_native30 = require("react-native");
|
|
1873
1923
|
var FontA11yCategory = {
|
|
1874
1924
|
Large: "Large",
|
|
1875
1925
|
xLarge: "xLarge",
|
|
@@ -2004,11 +2054,12 @@ function useCreateUserAgent({
|
|
|
2004
2054
|
}) {
|
|
2005
2055
|
const platform = (0, import_native_modules15.getPlatformOS)();
|
|
2006
2056
|
const appVersion = (0, import_native_modules15.getTossAppVersion)();
|
|
2007
|
-
const { fontScale } = (0,
|
|
2057
|
+
const { fontScale } = (0, import_react_native30.useWindowDimensions)();
|
|
2008
2058
|
const platformString = platform === "ios" ? "iPhone" : "Android phone";
|
|
2009
2059
|
const fontA11y = mapFontScaleToCategory(fontScale, platform);
|
|
2010
2060
|
const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
|
|
2011
2061
|
return [
|
|
2062
|
+
"AppsInToss",
|
|
2012
2063
|
`TossApp/${appVersion}`,
|
|
2013
2064
|
batteryModePreference && `TossBatteryModePreference/${batteryModePreference}`,
|
|
2014
2065
|
colorPreference && `TossColorPreference/${colorPreference}`,
|
|
@@ -2025,12 +2076,12 @@ function useCreateUserAgent({
|
|
|
2025
2076
|
|
|
2026
2077
|
// src/hooks/useGeolocation.ts
|
|
2027
2078
|
var import_native_modules16 = require("@apps-in-toss/native-modules");
|
|
2028
|
-
var
|
|
2029
|
-
var
|
|
2079
|
+
var import_react_native31 = require("@granite-js/react-native");
|
|
2080
|
+
var import_react26 = require("react");
|
|
2030
2081
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
2031
|
-
const isVisible = (0,
|
|
2032
|
-
const [location, setLocation] = (0,
|
|
2033
|
-
(0,
|
|
2082
|
+
const isVisible = (0, import_react_native31.useVisibility)();
|
|
2083
|
+
const [location, setLocation] = (0, import_react26.useState)(null);
|
|
2084
|
+
(0, import_react26.useEffect)(() => {
|
|
2034
2085
|
if (!isVisible) {
|
|
2035
2086
|
return;
|
|
2036
2087
|
}
|
|
@@ -2048,12 +2099,12 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
2048
2099
|
}
|
|
2049
2100
|
|
|
2050
2101
|
// src/hooks/useWaitForReturnNavigator.tsx
|
|
2051
|
-
var
|
|
2052
|
-
var
|
|
2102
|
+
var import_react_native32 = require("@granite-js/react-native");
|
|
2103
|
+
var import_react27 = require("react");
|
|
2053
2104
|
function useWaitForReturnNavigator() {
|
|
2054
|
-
const callbacks = (0,
|
|
2055
|
-
const navigation = (0,
|
|
2056
|
-
const startNavigating = (0,
|
|
2105
|
+
const callbacks = (0, import_react27.useRef)([]).current;
|
|
2106
|
+
const navigation = (0, import_react_native32.useNavigation)();
|
|
2107
|
+
const startNavigating = (0, import_react27.useCallback)(
|
|
2057
2108
|
(route, params) => {
|
|
2058
2109
|
return new Promise((resolve) => {
|
|
2059
2110
|
callbacks.push(resolve);
|
|
@@ -2062,7 +2113,7 @@ function useWaitForReturnNavigator() {
|
|
|
2062
2113
|
},
|
|
2063
2114
|
[callbacks, navigation]
|
|
2064
2115
|
);
|
|
2065
|
-
const handleVisibilityChange = (0,
|
|
2116
|
+
const handleVisibilityChange = (0, import_react27.useCallback)(
|
|
2066
2117
|
(state) => {
|
|
2067
2118
|
if (state === "visible" && callbacks.length > 0) {
|
|
2068
2119
|
for (const callback of callbacks) {
|
|
@@ -2073,7 +2124,7 @@ function useWaitForReturnNavigator() {
|
|
|
2073
2124
|
},
|
|
2074
2125
|
[callbacks]
|
|
2075
2126
|
);
|
|
2076
|
-
(0,
|
|
2127
|
+
(0, import_react_native32.useVisibilityChange)(handleVisibilityChange);
|
|
2077
2128
|
return startNavigating;
|
|
2078
2129
|
}
|
|
2079
2130
|
|
|
@@ -2088,7 +2139,7 @@ function useTopNavigation() {
|
|
|
2088
2139
|
|
|
2089
2140
|
// src/utils/log.ts
|
|
2090
2141
|
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
2091
|
-
var
|
|
2142
|
+
var import_react_native33 = require("@granite-js/react-native");
|
|
2092
2143
|
|
|
2093
2144
|
// src/utils/extractDateFromUUIDv7.ts
|
|
2094
2145
|
var extractDateFromUUIDv7 = (uuid) => {
|
|
@@ -2114,7 +2165,7 @@ var getGroupId = (url) => {
|
|
|
2114
2165
|
};
|
|
2115
2166
|
var getReferrer = () => {
|
|
2116
2167
|
try {
|
|
2117
|
-
const referrer = new URL((0,
|
|
2168
|
+
const referrer = new URL((0, import_react_native33.getSchemeUri)());
|
|
2118
2169
|
return referrer.searchParams.get("referrer");
|
|
2119
2170
|
} catch {
|
|
2120
2171
|
return "";
|
|
@@ -2136,7 +2187,7 @@ var trackScreen = (url) => {
|
|
|
2136
2187
|
};
|
|
2137
2188
|
|
|
2138
2189
|
// src/components/WebView.tsx
|
|
2139
|
-
var
|
|
2190
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2140
2191
|
var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
|
|
2141
2192
|
var TYPES = ["partner", "external", "game"];
|
|
2142
2193
|
var WEBVIEW_TYPES = {
|
|
@@ -2146,7 +2197,7 @@ var WEBVIEW_TYPES = {
|
|
|
2146
2197
|
};
|
|
2147
2198
|
function mergeSchemeQueryParamsInto(url) {
|
|
2148
2199
|
const baseUrl = new URL(url);
|
|
2149
|
-
const schemeUrl = new URL((0,
|
|
2200
|
+
const schemeUrl = new URL((0, import_react_native34.getSchemeUri)());
|
|
2150
2201
|
baseUrl.pathname = schemeUrl.pathname;
|
|
2151
2202
|
for (const [key, value] of schemeUrl.searchParams.entries()) {
|
|
2152
2203
|
baseUrl.searchParams.set(key, value);
|
|
@@ -2170,21 +2221,20 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2170
2221
|
if (!TYPES.includes(type)) {
|
|
2171
2222
|
throw new Error(`Invalid WebView type: '${type}'`);
|
|
2172
2223
|
}
|
|
2173
|
-
const webViewRef = (0,
|
|
2224
|
+
const webViewRef = (0, import_react28.useRef)(null);
|
|
2174
2225
|
const webBackHandler = useWebBackHandler(webViewRef);
|
|
2175
|
-
const uri = (0,
|
|
2226
|
+
const uri = (0, import_react28.useMemo)(() => getWebViewUri(local), [local]);
|
|
2176
2227
|
const top = (0, import_private9.useSafeAreaTop)();
|
|
2177
2228
|
const bottom = (0, import_private9.useSafeAreaBottom)();
|
|
2178
2229
|
const insets = (0, import_react_native_safe_area_context4.useSafeAreaInsets)();
|
|
2179
2230
|
const global2 = getAppsInTossGlobals();
|
|
2180
2231
|
const navigationBarContext = useNavigationBarContext();
|
|
2181
2232
|
const safeAreaInsetsEmitter = useSafeAreaInsetsEmitter();
|
|
2182
|
-
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0,
|
|
2233
|
+
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0, import_react28.useState)(
|
|
2183
2234
|
props.allowsBackForwardNavigationGestures
|
|
2184
2235
|
);
|
|
2185
2236
|
const handler = useBridgeHandler({
|
|
2186
2237
|
onMessage,
|
|
2187
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2188
2238
|
eventListenerMap: {
|
|
2189
2239
|
...appsInTossEventBridges,
|
|
2190
2240
|
navigationAccessoryEvent: ({ onEvent, onError }) => import_tds_react_native14.tdsEvent.addEventListener("navigationAccessoryEvent", { onEvent, onError }),
|
|
@@ -2194,7 +2244,6 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2194
2244
|
webBackHandler.removeEventListener(onEvent);
|
|
2195
2245
|
};
|
|
2196
2246
|
},
|
|
2197
|
-
entryMessageExited: ({ onEvent, onError }) => import_native_modules18.appsInTossEvent.addEventListener("entryMessageExited", { onEvent, onError }),
|
|
2198
2247
|
updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules18.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
2199
2248
|
safeAreaInsetsChange: ({ onEvent }) => {
|
|
2200
2249
|
safeAreaInsetsEmitter.on("safeAreaInsetsChange", onEvent);
|
|
@@ -2263,10 +2312,12 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2263
2312
|
processProductGrant: import_native_modules18.processProductGrant,
|
|
2264
2313
|
getPendingOrders: import_native_modules18.IAP.getPendingOrders,
|
|
2265
2314
|
getCompletedOrRefundedOrders: import_native_modules18.IAP.getCompletedOrRefundedOrders,
|
|
2266
|
-
completeProductGrant: import_native_modules18.IAP.completeProductGrant
|
|
2315
|
+
completeProductGrant: import_native_modules18.IAP.completeProductGrant,
|
|
2316
|
+
/* Private */
|
|
2317
|
+
memoryDebugEventLog: webViewMemoryDebugLog
|
|
2267
2318
|
}
|
|
2268
2319
|
});
|
|
2269
|
-
const headerPropForExternalWebView = (0,
|
|
2320
|
+
const headerPropForExternalWebView = (0, import_react28.useMemo)(() => {
|
|
2270
2321
|
const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
|
|
2271
2322
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
2272
2323
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
@@ -2287,16 +2338,16 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2287
2338
|
colorPreference: "light"
|
|
2288
2339
|
});
|
|
2289
2340
|
const refs = mergeRefs(handler.ref, webViewRef);
|
|
2290
|
-
(0,
|
|
2341
|
+
(0, import_react28.useEffect)(() => {
|
|
2291
2342
|
const callback = () => {
|
|
2292
2343
|
webBackHandler.handleWebBack();
|
|
2293
2344
|
return true;
|
|
2294
2345
|
};
|
|
2295
|
-
|
|
2296
|
-
return () =>
|
|
2346
|
+
import_react_native35.BackHandler.addEventListener("hardwareBackPress", callback);
|
|
2347
|
+
return () => import_react_native35.BackHandler.removeEventListener("hardwareBackPress", callback);
|
|
2297
2348
|
}, [webBackHandler]);
|
|
2298
2349
|
const globalScripts = useGlobalScripts();
|
|
2299
|
-
return /* @__PURE__ */ (0,
|
|
2350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2300
2351
|
BaseWebView,
|
|
2301
2352
|
{
|
|
2302
2353
|
ref: refs,
|
|
@@ -2318,18 +2369,72 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2318
2369
|
props.onNavigationStateChange?.(event);
|
|
2319
2370
|
webBackHandler.onNavigationStateChange(event);
|
|
2320
2371
|
},
|
|
2321
|
-
userAgent:
|
|
2372
|
+
userAgent: import_react_native35.Platform.OS === "ios" ? userAgent : void 0,
|
|
2322
2373
|
sharedCookiesEnabled: true,
|
|
2323
2374
|
webviewDebuggingEnabled: webViewDebuggingEnabled,
|
|
2324
2375
|
thirdPartyCookiesEnabled: true,
|
|
2325
2376
|
onMessage: handler.onMessage,
|
|
2326
2377
|
injectedJavaScript: globalScripts.afterLoad,
|
|
2327
2378
|
injectedJavaScriptBeforeContentLoaded: mergeScripts(handler.injectedJavaScript, globalScripts.beforeLoad),
|
|
2328
|
-
decelerationRate:
|
|
2329
|
-
allowsBackForwardNavigationGestures
|
|
2379
|
+
decelerationRate: import_react_native35.Platform.OS === "ios" ? 1 : void 0,
|
|
2380
|
+
allowsBackForwardNavigationGestures,
|
|
2381
|
+
onShouldStartLoadWithRequest: (event) => {
|
|
2382
|
+
try {
|
|
2383
|
+
const url = new URL(event.url);
|
|
2384
|
+
if (["https:", "http:"].includes(url.protocol)) {
|
|
2385
|
+
return true;
|
|
2386
|
+
} else {
|
|
2387
|
+
import_react_native35.Linking.openURL(convertIntentURL(url) ?? url.href);
|
|
2388
|
+
return false;
|
|
2389
|
+
}
|
|
2390
|
+
} catch (error) {
|
|
2391
|
+
console.error(error);
|
|
2392
|
+
return false;
|
|
2393
|
+
}
|
|
2394
|
+
},
|
|
2395
|
+
originWhitelist: [
|
|
2396
|
+
"https://*",
|
|
2397
|
+
"http://*",
|
|
2398
|
+
"intoss://*",
|
|
2399
|
+
"intoss-private://*",
|
|
2400
|
+
"servicetoss://*",
|
|
2401
|
+
"supertoss://*",
|
|
2402
|
+
"intent://*"
|
|
2403
|
+
],
|
|
2404
|
+
onContentProcessDidTerminate: (event) => {
|
|
2405
|
+
webViewProcessDidTerminateEventLog(event.nativeEvent.url);
|
|
2406
|
+
webViewRef.current?.reload();
|
|
2407
|
+
},
|
|
2408
|
+
onRenderProcessGone: () => {
|
|
2409
|
+
webViewProcessDidTerminateEventLog();
|
|
2410
|
+
webViewRef.current?.reload();
|
|
2411
|
+
}
|
|
2330
2412
|
}
|
|
2331
2413
|
);
|
|
2332
2414
|
}
|
|
2415
|
+
async function webViewMemoryDebugLog(params) {
|
|
2416
|
+
webViewDebugLog("AppsInTossWebViewMemoryDebug", params);
|
|
2417
|
+
}
|
|
2418
|
+
function webViewProcessDidTerminateEventLog(url) {
|
|
2419
|
+
webViewDebugLog("AppsInTossWebViewProcessDidTerminate", { url });
|
|
2420
|
+
}
|
|
2421
|
+
function webViewDebugLog(logName, params) {
|
|
2422
|
+
const global2 = getAppsInTossGlobals();
|
|
2423
|
+
const event = {
|
|
2424
|
+
log_name: logName,
|
|
2425
|
+
log_type: "debug",
|
|
2426
|
+
params: {
|
|
2427
|
+
...params,
|
|
2428
|
+
app_name: import_react_native34.Granite.appName,
|
|
2429
|
+
deployment_id: global2.deploymentId
|
|
2430
|
+
}
|
|
2431
|
+
};
|
|
2432
|
+
if ((0, import_native_modules18.getOperationalEnvironment)() === "toss") {
|
|
2433
|
+
import_native_modules18.INTERNAL__module.tossCoreEventLog(event);
|
|
2434
|
+
} else {
|
|
2435
|
+
console.log("[webViewDebugLog]", event);
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2333
2438
|
function useGlobalScripts() {
|
|
2334
2439
|
const global2 = getAppsInTossGlobals();
|
|
2335
2440
|
const disableTextSelectionCSS = `
|