@apps-in-toss/framework 0.0.0-dev.1758198081085 → 0.0.0-dev.1760064876537
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 +555 -331
- package/dist/index.d.cts +44 -6
- package/dist/index.d.ts +44 -6
- package/dist/index.js +459 -229
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -34,21 +34,24 @@ __export(src_exports, {
|
|
|
34
34
|
Analytics: () => Analytics2,
|
|
35
35
|
AppsInToss: () => AppsInToss,
|
|
36
36
|
INTERNAL__onVisibilityChangedByTransparentServiceWeb: () => INTERNAL__onVisibilityChangedByTransparentServiceWeb,
|
|
37
|
+
OverlayProvider: () => import_private9.OverlayProvider,
|
|
37
38
|
WebView: () => WebView,
|
|
38
39
|
env: () => env,
|
|
39
40
|
useCreateUserAgent: () => useCreateUserAgent,
|
|
40
41
|
useGeolocation: () => useGeolocation,
|
|
41
|
-
|
|
42
|
+
useOverlay: () => import_private9.useOverlay,
|
|
43
|
+
useTopNavigation: () => import_private9.useTopNavigation,
|
|
44
|
+
useWaitForReturnNavigator: () => useWaitForReturnNavigator
|
|
42
45
|
});
|
|
43
46
|
module.exports = __toCommonJS(src_exports);
|
|
44
47
|
var import_analytics2 = require("@apps-in-toss/analytics");
|
|
45
48
|
|
|
46
49
|
// src/core/registerApp.tsx
|
|
47
50
|
var import_analytics = require("@apps-in-toss/analytics");
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
51
|
+
var import_native_modules9 = require("@apps-in-toss/native-modules");
|
|
52
|
+
var import_react_native15 = require("@granite-js/react-native");
|
|
53
|
+
var import_tds_react_native6 = require("@toss/tds-react-native");
|
|
54
|
+
var import_react_native16 = require("react-native");
|
|
52
55
|
|
|
53
56
|
// src/core/components/AppEvent.tsx
|
|
54
57
|
var import_native_modules2 = require("@apps-in-toss/native-modules");
|
|
@@ -193,7 +196,7 @@ function AppUpdate() {
|
|
|
193
196
|
|
|
194
197
|
// src/core/hooks/useAppsInTossBridge.ts
|
|
195
198
|
var import_native_modules3 = require("@apps-in-toss/native-modules");
|
|
196
|
-
var
|
|
199
|
+
var import_tds_react_native = require("@toss/tds-react-native");
|
|
197
200
|
var import_react5 = require("react");
|
|
198
201
|
|
|
199
202
|
// src/core/utils/getAppsInTossGlobals.ts
|
|
@@ -211,7 +214,7 @@ function toIcon(source) {
|
|
|
211
214
|
|
|
212
215
|
// src/core/hooks/useAppsInTossBridge.ts
|
|
213
216
|
function useAppsInTossBridge() {
|
|
214
|
-
const controller = (0,
|
|
217
|
+
const controller = (0, import_tds_react_native.useBridge)();
|
|
215
218
|
const appsInTossGlobals = getAppsInTossGlobals();
|
|
216
219
|
(0, import_react5.useEffect)(() => {
|
|
217
220
|
const commonProps = {
|
|
@@ -230,19 +233,19 @@ function useAppsInTossBridge() {
|
|
|
230
233
|
}
|
|
231
234
|
|
|
232
235
|
// src/components/NavigationBar/RNNavigationBar.tsx
|
|
233
|
-
var
|
|
234
|
-
var
|
|
235
|
-
var
|
|
236
|
+
var import_react_native13 = require("@granite-js/react-native");
|
|
237
|
+
var import_tds_react_native5 = require("@toss/tds-react-native");
|
|
238
|
+
var import_private3 = require("@toss/tds-react-native/private");
|
|
236
239
|
var import_es_hangul = require("es-hangul");
|
|
237
240
|
var import_react9 = require("react");
|
|
238
|
-
var
|
|
241
|
+
var import_react_native14 = require("react-native");
|
|
239
242
|
|
|
240
243
|
// src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
|
|
241
244
|
var import_react6 = require("react");
|
|
242
245
|
|
|
243
246
|
// src/components/NavigationBar/common/useNavigationBarLogging.tsx
|
|
244
247
|
var import_native_modules4 = require("@apps-in-toss/native-modules");
|
|
245
|
-
var
|
|
248
|
+
var import_react_native6 = require("@granite-js/react-native");
|
|
246
249
|
var NAVI_BAR_IMPRESSION_SCHEMA_ID = 1596837;
|
|
247
250
|
var NAVI_BAR_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__navigation_bar";
|
|
248
251
|
var CLOSE_POPUP_SHOW_SCHEMA_ID = 1644490;
|
|
@@ -257,7 +260,7 @@ function useNavigationBarLogging() {
|
|
|
257
260
|
const referrer = useReferrer();
|
|
258
261
|
const baseParams = {
|
|
259
262
|
referrer,
|
|
260
|
-
app_name:
|
|
263
|
+
app_name: import_react_native6.Granite.appName
|
|
261
264
|
};
|
|
262
265
|
const logNavBarImpression = (naviBarConfig) => {
|
|
263
266
|
import_native_modules4.INTERNAL__module.tossCoreEventLog({
|
|
@@ -342,15 +345,22 @@ function NavigationBarImpressionArea({
|
|
|
342
345
|
}
|
|
343
346
|
|
|
344
347
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
345
|
-
var
|
|
348
|
+
var import_native_modules8 = require("@apps-in-toss/native-modules");
|
|
346
349
|
var import_react_native12 = require("@granite-js/react-native");
|
|
347
|
-
var
|
|
348
|
-
var
|
|
350
|
+
var import_tds_react_native4 = require("@toss/tds-react-native");
|
|
351
|
+
var import_private2 = require("@toss/tds-react-native/private");
|
|
349
352
|
var import_react8 = require("react");
|
|
350
353
|
|
|
354
|
+
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
355
|
+
var import_native_modules6 = require("@apps-in-toss/native-modules");
|
|
356
|
+
var import_react_native8 = require("@granite-js/react-native");
|
|
357
|
+
var import_tds_react_native2 = require("@toss/tds-react-native");
|
|
358
|
+
var import_private = require("@toss/tds-react-native/private");
|
|
359
|
+
var import_react_native9 = require("react-native");
|
|
360
|
+
|
|
351
361
|
// src/core/hooks/useMoreButtonBottomSheet/useMoreButtonBottomSheetLogging.tsx
|
|
352
362
|
var import_native_modules5 = require("@apps-in-toss/native-modules");
|
|
353
|
-
var
|
|
363
|
+
var import_react_native7 = require("@granite-js/react-native");
|
|
354
364
|
var BOTTOM_SHEET_SCHEMA_ID = 1596825;
|
|
355
365
|
var BOTTOM_SHEET_LOG_NAME = "appsintoss_app_visit__common_module::bottomsheet__more";
|
|
356
366
|
var BOTTOM_SHEET_OPEN_SCHEMA_ID = 1596829;
|
|
@@ -363,7 +373,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
363
373
|
const referrer = useReferrer();
|
|
364
374
|
const baseParams = {
|
|
365
375
|
referrer,
|
|
366
|
-
app_name:
|
|
376
|
+
app_name: import_react_native7.Granite.appName
|
|
367
377
|
};
|
|
368
378
|
const logBottomSheetShow = () => {
|
|
369
379
|
import_native_modules5.INTERNAL__module.tossCoreEventLog({
|
|
@@ -417,23 +427,90 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
417
427
|
};
|
|
418
428
|
}
|
|
419
429
|
|
|
430
|
+
// src/core/utils/url.ts
|
|
431
|
+
function addParamsToUrl(url, params) {
|
|
432
|
+
const urlObj = new URL(url);
|
|
433
|
+
for (const [key, value] of Object.entries(params)) {
|
|
434
|
+
urlObj.searchParams.set(key, value);
|
|
435
|
+
}
|
|
436
|
+
return urlObj.toString();
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
440
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
441
|
+
var SHARE_SCHEME_REFERRER = "appsintoss.common_module_share";
|
|
442
|
+
var APP_SHARE_MENU_INFO = {
|
|
443
|
+
contactItemName: "\uACF5\uC720\uD558\uAE30",
|
|
444
|
+
contactIconUrl: "https://static.toss.im/icons/png/4x/icon-share-dots-mono.png"
|
|
445
|
+
};
|
|
446
|
+
function AppShareListMenu() {
|
|
447
|
+
const globals = getAppsInTossGlobals();
|
|
448
|
+
const adaptive = (0, import_private.useAdaptive)();
|
|
449
|
+
const logging = useMoreButtonBottomSheetLogging();
|
|
450
|
+
const initialScheme = (0, import_react_native8.getSchemeUri)();
|
|
451
|
+
const isSandbox = (0, import_native_modules6.getOperationalEnvironment)() === "sandbox";
|
|
452
|
+
const { openConfirm } = (0, import_tds_react_native2.useDialog)();
|
|
453
|
+
const schemeForShare = addParamsToUrl(initialScheme, {
|
|
454
|
+
referrer: SHARE_SCHEME_REFERRER
|
|
455
|
+
});
|
|
456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
457
|
+
import_tds_react_native2.ListRow,
|
|
458
|
+
{
|
|
459
|
+
left: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
460
|
+
import_tds_react_native2.ListRow.Icon,
|
|
461
|
+
{
|
|
462
|
+
color: globals.brandPrimaryColor,
|
|
463
|
+
source: { uri: APP_SHARE_MENU_INFO.contactIconUrl },
|
|
464
|
+
type: "background"
|
|
465
|
+
}
|
|
466
|
+
),
|
|
467
|
+
contents: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
468
|
+
import_tds_react_native2.ListRow.Texts,
|
|
469
|
+
{
|
|
470
|
+
type: "1RowTypeA",
|
|
471
|
+
top: APP_SHARE_MENU_INFO.contactItemName,
|
|
472
|
+
topProps: { color: adaptive.grey700 }
|
|
473
|
+
}
|
|
474
|
+
),
|
|
475
|
+
verticalPadding: "extraSmall",
|
|
476
|
+
onPress: () => {
|
|
477
|
+
if (isSandbox) {
|
|
478
|
+
openConfirm({
|
|
479
|
+
title: "\uACF5\uC720\uD558\uAE30 \uAE30\uB2A5 \uBBF8\uC9C0\uC6D0",
|
|
480
|
+
description: "\uC0CC\uB4DC\uBC15\uC2A4 \uD658\uACBD\uC5D0\uC11C\uB294 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC5B4\uC694. \uCF58\uC194\uC744 \uD1B5\uD574 \uD1A0\uC2A4\uC571\uC5D0\uC11C \uD14C\uC2A4\uD2B8\uD574 \uC8FC\uC138\uC694.",
|
|
481
|
+
rightButton: "\uD655\uC778",
|
|
482
|
+
closeOnDimmerClick: true
|
|
483
|
+
});
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
logging.menuClick({ title: APP_SHARE_MENU_INFO.contactItemName });
|
|
487
|
+
import_react_native9.NativeModules.AppsInTossModule.shareWithScheme({
|
|
488
|
+
params: {
|
|
489
|
+
schemeURL: schemeForShare
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
);
|
|
495
|
+
}
|
|
496
|
+
|
|
420
497
|
// src/hooks/useAppUpdateDialog.tsx
|
|
421
|
-
var
|
|
422
|
-
var
|
|
423
|
-
var
|
|
498
|
+
var import_native_modules7 = require("@apps-in-toss/native-modules");
|
|
499
|
+
var import_react_native11 = require("@granite-js/react-native");
|
|
500
|
+
var import_tds_react_native3 = require("@toss/tds-react-native");
|
|
424
501
|
var import_react7 = require("react");
|
|
425
502
|
|
|
426
503
|
// src/utils/market.ts
|
|
427
|
-
var
|
|
504
|
+
var import_react_native10 = require("react-native");
|
|
428
505
|
var PLAYSTORE_LINK = "https://play.google.com/store/apps/details?id=viva.republica.toss";
|
|
429
506
|
var APPSTORE_LINK = "https://itunes.apple.com/app/id839333328";
|
|
430
507
|
var getMarketLink = () => {
|
|
431
|
-
return
|
|
508
|
+
return import_react_native10.Platform.OS === "android" ? PLAYSTORE_LINK : APPSTORE_LINK;
|
|
432
509
|
};
|
|
433
510
|
|
|
434
511
|
// src/hooks/useAppUpdateDialog.tsx
|
|
435
512
|
function useAppUpdateDialog() {
|
|
436
|
-
const { openConfirm } = (0,
|
|
513
|
+
const { openConfirm } = (0, import_tds_react_native3.useDialog)();
|
|
437
514
|
const logging = useAppUpdateDialogLogging();
|
|
438
515
|
const openAppUpdateDialog = (0, import_react7.useCallback)(
|
|
439
516
|
async ({
|
|
@@ -456,7 +533,7 @@ function useAppUpdateDialog() {
|
|
|
456
533
|
}
|
|
457
534
|
logging.update();
|
|
458
535
|
const STORE_SCHEME = getMarketLink();
|
|
459
|
-
(0,
|
|
536
|
+
(0, import_react_native11.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
|
|
460
537
|
},
|
|
461
538
|
[logging, openConfirm]
|
|
462
539
|
);
|
|
@@ -472,10 +549,10 @@ function useAppUpdateDialogLogging() {
|
|
|
472
549
|
const referrer = useReferrer();
|
|
473
550
|
const baseParams = {
|
|
474
551
|
referrer,
|
|
475
|
-
app_name:
|
|
552
|
+
app_name: import_react_native11.Granite.appName
|
|
476
553
|
};
|
|
477
554
|
const logUpdateClick = () => {
|
|
478
|
-
|
|
555
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
479
556
|
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
480
557
|
log_type: "event",
|
|
481
558
|
params: {
|
|
@@ -487,7 +564,7 @@ function useAppUpdateDialogLogging() {
|
|
|
487
564
|
});
|
|
488
565
|
};
|
|
489
566
|
const logCloseClick = () => {
|
|
490
|
-
|
|
567
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
491
568
|
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
492
569
|
log_type: "event",
|
|
493
570
|
params: {
|
|
@@ -499,7 +576,7 @@ function useAppUpdateDialogLogging() {
|
|
|
499
576
|
});
|
|
500
577
|
};
|
|
501
578
|
const logDialogShow = () => {
|
|
502
|
-
|
|
579
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
503
580
|
log_name: UPDATE_DIALOG_LOG_NAME,
|
|
504
581
|
log_type: "popup",
|
|
505
582
|
params: {
|
|
@@ -520,25 +597,33 @@ function ensureValue(value, name) {
|
|
|
520
597
|
}
|
|
521
598
|
|
|
522
599
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
523
|
-
var
|
|
600
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
524
601
|
var APP_BRIDGE_METHOD_NAME = "getMiniAppsSupportContact";
|
|
602
|
+
var MIN_VERSION = {
|
|
603
|
+
BOTTOM_SHEET: {
|
|
604
|
+
android: "5.226.0",
|
|
605
|
+
ios: "5.226.0"
|
|
606
|
+
},
|
|
607
|
+
SHARE_LIST_MENU: {
|
|
608
|
+
android: "5.230.0",
|
|
609
|
+
ios: "5.230.0"
|
|
610
|
+
}
|
|
611
|
+
};
|
|
525
612
|
function useMoreButtonBottomSheet() {
|
|
526
613
|
const globals = getAppsInTossGlobals();
|
|
527
|
-
const adaptive = (0,
|
|
614
|
+
const adaptive = (0, import_private2.useAdaptive)();
|
|
528
615
|
const [itemList, setItemList] = (0, import_react8.useState)([]);
|
|
529
616
|
const appUpdateDialog = useAppUpdateDialog();
|
|
530
617
|
const logging = useMoreButtonBottomSheetLogging();
|
|
531
|
-
const overlay = (0,
|
|
618
|
+
const overlay = (0, import_private2.useOverlay)();
|
|
532
619
|
const title = ensureValue(globals.brandDisplayName, "displayName");
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
ios: "5.226.0"
|
|
536
|
-
});
|
|
620
|
+
const isBottomSheetSupported = (0, import_native_modules8.isMinVersionSupported)(MIN_VERSION.BOTTOM_SHEET);
|
|
621
|
+
const isShareListMenuSupported = (0, import_native_modules8.isMinVersionSupported)(MIN_VERSION.SHARE_LIST_MENU);
|
|
537
622
|
(0, import_react8.useEffect)(() => {
|
|
538
|
-
if (!
|
|
623
|
+
if (!isBottomSheetSupported) {
|
|
539
624
|
return;
|
|
540
625
|
}
|
|
541
|
-
|
|
626
|
+
import_native_modules8.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
542
627
|
APP_BRIDGE_METHOD_NAME,
|
|
543
628
|
{},
|
|
544
629
|
{
|
|
@@ -546,10 +631,10 @@ function useMoreButtonBottomSheet() {
|
|
|
546
631
|
onError: (error) => console.error("\uBA54\uB274 \uBAA9\uB85D\uC744 \uAC00\uC838\uC624\uB294 \uB370 \uC2E4\uD328\uD588\uC5B4\uC694:", error)
|
|
547
632
|
}
|
|
548
633
|
);
|
|
549
|
-
}, [
|
|
634
|
+
}, [isBottomSheetSupported]);
|
|
550
635
|
const onClickHandler = async () => {
|
|
551
636
|
logging.open();
|
|
552
|
-
if (!
|
|
637
|
+
if (!isBottomSheetSupported) {
|
|
553
638
|
await appUpdateDialog.open({
|
|
554
639
|
title: `\uC774 \uAE30\uB2A5\uC744 \uC4F0\uB824\uBA74 \uC571 \uC5C5\uB370\uC774\uD2B8\uAC00 \uD544\uC694\uD574\uC694`,
|
|
555
640
|
description: `\uBB38\uC758, \uAD8C\uD55C \uC124\uC815, \uC2E0\uACE0 \uB4F1 \uAE30\uB2A5\uC744 \uC4F8 \uC218 \uC788\uC5B4\uC694`
|
|
@@ -561,18 +646,18 @@ function useMoreButtonBottomSheet() {
|
|
|
561
646
|
logging.close();
|
|
562
647
|
close();
|
|
563
648
|
};
|
|
564
|
-
return /* @__PURE__ */ (0,
|
|
565
|
-
|
|
649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(BottomSheetImpressionArea, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
650
|
+
import_tds_react_native4.BottomSheet.Root,
|
|
566
651
|
{
|
|
567
|
-
header: /* @__PURE__ */ (0,
|
|
568
|
-
|
|
652
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
653
|
+
import_tds_react_native4.ListHeader,
|
|
569
654
|
{
|
|
570
|
-
title: /* @__PURE__ */ (0,
|
|
655
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_tds_react_native4.ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
|
|
571
656
|
}
|
|
572
657
|
),
|
|
573
658
|
open: isOpen,
|
|
574
|
-
cta: /* @__PURE__ */ (0,
|
|
575
|
-
|
|
659
|
+
cta: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
660
|
+
import_tds_react_native4.BottomSheet.CTA,
|
|
576
661
|
{
|
|
577
662
|
size: "large",
|
|
578
663
|
type: "dark",
|
|
@@ -585,35 +670,38 @@ function useMoreButtonBottomSheet() {
|
|
|
585
670
|
),
|
|
586
671
|
onClose: handleClose,
|
|
587
672
|
onExited: exit,
|
|
588
|
-
children: /* @__PURE__ */ (0,
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
673
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_tds_react_native4.List, { rowSeparator: "none", children: [
|
|
674
|
+
itemList.map((item) => {
|
|
675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
676
|
+
import_tds_react_native4.ListRow,
|
|
677
|
+
{
|
|
678
|
+
left: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
679
|
+
import_tds_react_native4.ListRow.Icon,
|
|
680
|
+
{
|
|
681
|
+
color: globals.brandPrimaryColor,
|
|
682
|
+
source: { uri: item.contactIconUrl },
|
|
683
|
+
type: "background"
|
|
684
|
+
}
|
|
685
|
+
),
|
|
686
|
+
contents: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
687
|
+
import_tds_react_native4.ListRow.Texts,
|
|
688
|
+
{
|
|
689
|
+
type: "1RowTypeA",
|
|
690
|
+
top: item.contactItemName,
|
|
691
|
+
topProps: { color: adaptive.grey700 }
|
|
692
|
+
}
|
|
693
|
+
),
|
|
694
|
+
verticalPadding: "extraSmall",
|
|
695
|
+
onPress: () => {
|
|
696
|
+
logging.menuClick({ title: item.contactItemName });
|
|
697
|
+
(0, import_react_native12.openURL)(item.contactUri);
|
|
606
698
|
}
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
},
|
|
614
|
-
item.contactItemName
|
|
615
|
-
);
|
|
616
|
-
}) })
|
|
699
|
+
},
|
|
700
|
+
item.contactItemName
|
|
701
|
+
);
|
|
702
|
+
}),
|
|
703
|
+
isShareListMenuSupported && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AppShareListMenu, {})
|
|
704
|
+
] })
|
|
617
705
|
}
|
|
618
706
|
) });
|
|
619
707
|
});
|
|
@@ -625,7 +713,7 @@ function BottomSheetImpressionArea({ children }) {
|
|
|
625
713
|
(0, import_react8.useEffect)(() => {
|
|
626
714
|
logging.show();
|
|
627
715
|
}, [logging]);
|
|
628
|
-
return /* @__PURE__ */ (0,
|
|
716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
|
|
629
717
|
}
|
|
630
718
|
|
|
631
719
|
// src/core/utils/safeParseNavigationBar.ts
|
|
@@ -641,20 +729,20 @@ function safeParseNavigationBar(navigationBar) {
|
|
|
641
729
|
}
|
|
642
730
|
|
|
643
731
|
// src/components/NavigationBar/RNNavigationBar.tsx
|
|
644
|
-
var
|
|
732
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
645
733
|
function RNNavigationBar() {
|
|
646
734
|
const globals = getAppsInTossGlobals();
|
|
647
735
|
const { captureExitLog } = useCaptureExitLog();
|
|
648
736
|
const logging = useNavigationBarLogging();
|
|
649
|
-
const { openConfirm } = (0,
|
|
737
|
+
const { openConfirm } = (0, import_tds_react_native5.useDialog)();
|
|
650
738
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
651
739
|
const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
|
|
652
740
|
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
653
741
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
654
742
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
655
|
-
const backEventContext = (0,
|
|
743
|
+
const backEventContext = (0, import_react_native13.useBackEventContext)();
|
|
656
744
|
const handleBackOrClose = useBackOrCloseNavigation();
|
|
657
|
-
const navigation = (0,
|
|
745
|
+
const navigation = (0, import_react_native13.useNavigation)();
|
|
658
746
|
const handlePressTitle = (0, import_react9.useCallback)(() => {
|
|
659
747
|
logging.homeButtonClick();
|
|
660
748
|
navigation.navigate("/");
|
|
@@ -671,7 +759,7 @@ function RNNavigationBar() {
|
|
|
671
759
|
logging.closePopupCtaClick(isConfirmed);
|
|
672
760
|
if (isConfirmed) {
|
|
673
761
|
captureExitLog(Date.now());
|
|
674
|
-
(0,
|
|
762
|
+
(0, import_react_native13.closeView)();
|
|
675
763
|
}
|
|
676
764
|
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
677
765
|
const handleBack = (0, import_react9.useCallback)(() => {
|
|
@@ -686,13 +774,13 @@ function RNNavigationBar() {
|
|
|
686
774
|
handleBack();
|
|
687
775
|
return true;
|
|
688
776
|
};
|
|
689
|
-
|
|
777
|
+
import_react_native14.BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
690
778
|
return () => {
|
|
691
|
-
|
|
779
|
+
import_react_native14.BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
692
780
|
};
|
|
693
781
|
}, [handleBack]);
|
|
694
|
-
return /* @__PURE__ */ (0,
|
|
695
|
-
|
|
782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
783
|
+
import_private3.TopNavigation,
|
|
696
784
|
{
|
|
697
785
|
title: globals.brandDisplayName,
|
|
698
786
|
icon: toIcon(globals.brandIcon),
|
|
@@ -706,59 +794,59 @@ function RNNavigationBar() {
|
|
|
706
794
|
icon: initialAccessoryButton.icon,
|
|
707
795
|
id: initialAccessoryButton.id
|
|
708
796
|
} : void 0,
|
|
709
|
-
children: /* @__PURE__ */ (0,
|
|
797
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_private3.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_private3.NavigationBackButton, { onPress: handleBack, canGoBack: false }) })
|
|
710
798
|
}
|
|
711
799
|
) });
|
|
712
800
|
}
|
|
713
801
|
function useBackOrCloseNavigation() {
|
|
714
|
-
const navigation = (0,
|
|
802
|
+
const navigation = (0, import_react_native13.useNavigation)();
|
|
715
803
|
const { captureExitLog } = useCaptureExitLog();
|
|
716
804
|
return (0, import_react9.useCallback)(() => {
|
|
717
805
|
if (navigation.canGoBack()) {
|
|
718
806
|
navigation.goBack();
|
|
719
807
|
} else {
|
|
720
808
|
captureExitLog(Date.now());
|
|
721
|
-
(0,
|
|
809
|
+
(0, import_react_native13.closeView)();
|
|
722
810
|
}
|
|
723
811
|
}, [captureExitLog, navigation]);
|
|
724
812
|
}
|
|
725
813
|
|
|
726
814
|
// src/core/registerApp.tsx
|
|
727
|
-
var
|
|
815
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
728
816
|
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
729
|
-
if (!(0,
|
|
817
|
+
if (!(0, import_native_modules9.isMinVersionSupported)({
|
|
730
818
|
android: "5.220.0",
|
|
731
819
|
ios: "5.221.0"
|
|
732
820
|
})) {
|
|
733
|
-
return /* @__PURE__ */ (0,
|
|
734
|
-
/* @__PURE__ */ (0,
|
|
735
|
-
/* @__PURE__ */ (0,
|
|
736
|
-
/* @__PURE__ */ (0,
|
|
821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
822
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.Entry, {}),
|
|
823
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.System, { ...initialProps }),
|
|
824
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppUpdate, {})
|
|
737
825
|
] });
|
|
738
826
|
}
|
|
739
|
-
return /* @__PURE__ */ (0,
|
|
740
|
-
/* @__PURE__ */ (0,
|
|
741
|
-
/* @__PURE__ */ (0,
|
|
742
|
-
/* @__PURE__ */ (0,
|
|
743
|
-
/* @__PURE__ */ (0,
|
|
827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
828
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.StayTime, {}),
|
|
829
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.Entry, {}),
|
|
830
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.System, { ...initialProps }),
|
|
831
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_tds_react_native6.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TDSContainer, { ...initialProps, children }) }) })
|
|
744
832
|
] });
|
|
745
833
|
}
|
|
746
834
|
function TDSContainer({ children }) {
|
|
747
835
|
useAppsInTossBridge();
|
|
748
|
-
return /* @__PURE__ */ (0,
|
|
836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children });
|
|
749
837
|
}
|
|
750
838
|
function registerApp(container, { context, analytics }) {
|
|
751
839
|
const appName = getAppName();
|
|
752
|
-
const isRegistered =
|
|
840
|
+
const isRegistered = import_react_native16.AppRegistry.getAppKeys().includes(appName);
|
|
753
841
|
if (!isRegistered) {
|
|
754
842
|
import_analytics.Analytics.init({
|
|
755
|
-
logger: (params) => void (0,
|
|
843
|
+
logger: (params) => void (0, import_native_modules9.eventLog)(params),
|
|
756
844
|
debug: analytics?.debug ?? __DEV__
|
|
757
845
|
});
|
|
758
|
-
const App =
|
|
846
|
+
const App = import_react_native15.Granite.registerApp(AppsInTossContainer.bind(null, container), {
|
|
759
847
|
appName,
|
|
760
848
|
context,
|
|
761
|
-
setIosSwipeGestureEnabled:
|
|
849
|
+
setIosSwipeGestureEnabled: import_native_modules9.setIosSwipeGestureEnabled,
|
|
762
850
|
router: {
|
|
763
851
|
screenContainer: AppsInTossScreenContainer,
|
|
764
852
|
defaultScreenOption: {
|
|
@@ -772,8 +860,8 @@ function registerApp(container, { context, analytics }) {
|
|
|
772
860
|
}
|
|
773
861
|
function AppsInTossScreenContainer({ children }) {
|
|
774
862
|
const isReactNativeService = getAppsInTossGlobals().webViewType == null;
|
|
775
|
-
return /* @__PURE__ */ (0,
|
|
776
|
-
isReactNativeService && /* @__PURE__ */ (0,
|
|
863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_analytics.Analytics.Screen, { children: [
|
|
864
|
+
isReactNativeService && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RNNavigationBar, {}),
|
|
777
865
|
children
|
|
778
866
|
] });
|
|
779
867
|
}
|
|
@@ -792,29 +880,27 @@ var AppsInToss = {
|
|
|
792
880
|
};
|
|
793
881
|
|
|
794
882
|
// src/components/WebView.tsx
|
|
795
|
-
var
|
|
883
|
+
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
796
884
|
var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async-bridges"), 1);
|
|
797
885
|
var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
|
|
798
886
|
var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event-bridges"), 1);
|
|
799
|
-
var
|
|
800
|
-
var
|
|
801
|
-
var
|
|
802
|
-
var
|
|
803
|
-
var
|
|
804
|
-
var import_react18 = require("react");
|
|
805
|
-
var import_react_native38 = require("react-native");
|
|
887
|
+
var import_react_native29 = require("@granite-js/react-native");
|
|
888
|
+
var import_tds_react_native13 = require("@toss/tds-react-native");
|
|
889
|
+
var import_private8 = require("@toss/tds-react-native/private");
|
|
890
|
+
var import_react21 = require("react");
|
|
891
|
+
var import_react_native30 = require("react-native");
|
|
806
892
|
|
|
807
893
|
// src/components/GameWebView.tsx
|
|
808
|
-
var
|
|
894
|
+
var import_native_modules13 = require("@apps-in-toss/native-modules");
|
|
809
895
|
var import_react_native_webview = require("@granite-js/native/react-native-webview");
|
|
810
896
|
var import_react13 = require("react");
|
|
811
|
-
var
|
|
897
|
+
var import_react_native22 = require("react-native");
|
|
812
898
|
|
|
813
899
|
// src/components/GameProfile.tsx
|
|
814
|
-
var
|
|
815
|
-
var
|
|
900
|
+
var import_native_modules12 = require("@apps-in-toss/native-modules");
|
|
901
|
+
var import_tds_react_native9 = require("@toss/tds-react-native");
|
|
816
902
|
var import_react11 = require("react");
|
|
817
|
-
var
|
|
903
|
+
var import_react_native19 = require("react-native");
|
|
818
904
|
|
|
819
905
|
// src/constant/game-center.ts
|
|
820
906
|
var GAME_PROFILE_WEBVIEW_URL = "servicetoss://game-center/profile";
|
|
@@ -824,23 +910,23 @@ var GAME_CENTER_MIN_VERSION = {
|
|
|
824
910
|
};
|
|
825
911
|
|
|
826
912
|
// src/hooks/useGameCenterProfile.ts
|
|
827
|
-
var
|
|
828
|
-
var
|
|
829
|
-
var
|
|
913
|
+
var import_native_modules11 = require("@apps-in-toss/native-modules");
|
|
914
|
+
var import_react_native18 = require("@granite-js/react-native");
|
|
915
|
+
var import_tds_react_native8 = require("@toss/tds-react-native");
|
|
830
916
|
var import_es_hangul2 = require("es-hangul");
|
|
831
917
|
var import_react10 = require("react");
|
|
832
918
|
|
|
833
919
|
// src/components/GameProfileToast.tsx
|
|
834
|
-
var
|
|
835
|
-
var
|
|
836
|
-
var
|
|
920
|
+
var import_tds_react_native7 = require("@toss/tds-react-native");
|
|
921
|
+
var import_private4 = require("@toss/tds-react-native/private");
|
|
922
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
837
923
|
var useGameProfileToast = () => {
|
|
838
|
-
const overlay = (0,
|
|
924
|
+
const overlay = (0, import_private4.useOverlay)();
|
|
839
925
|
const openGameProfileToast = (nickname, profileImageUri) => {
|
|
840
926
|
return new Promise((resolve) => {
|
|
841
927
|
overlay.open(({ isOpen, close, exit }) => {
|
|
842
|
-
return /* @__PURE__ */ (0,
|
|
843
|
-
|
|
928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_private4.ColorPreferenceProvider, { colorPreference: "dark", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_private4.AdaptiveColorProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
929
|
+
import_tds_react_native7.Toast,
|
|
844
930
|
{
|
|
845
931
|
open: isOpen,
|
|
846
932
|
onClose: () => {
|
|
@@ -850,11 +936,11 @@ var useGameProfileToast = () => {
|
|
|
850
936
|
onExited: exit,
|
|
851
937
|
position: "top",
|
|
852
938
|
text: `${nickname}\uB2D8 \uBC18\uAC00\uC6CC\uC694!`,
|
|
853
|
-
icon: /* @__PURE__ */ (0,
|
|
854
|
-
|
|
939
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
940
|
+
import_tds_react_native7.Asset.Image,
|
|
855
941
|
{
|
|
856
942
|
style: { borderRadius: 64, overflow: "hidden" },
|
|
857
|
-
frameShape:
|
|
943
|
+
frameShape: import_tds_react_native7.Asset.frameShape.CleanW32,
|
|
858
944
|
source: { uri: profileImageUri }
|
|
859
945
|
}
|
|
860
946
|
)
|
|
@@ -873,11 +959,11 @@ var DEFAULT_ERROR = {
|
|
|
873
959
|
};
|
|
874
960
|
|
|
875
961
|
// src/utils/openTransparentWebView.ts
|
|
876
|
-
var
|
|
962
|
+
var import_react_native17 = require("@granite-js/react-native");
|
|
877
963
|
|
|
878
964
|
// src/private.ts
|
|
879
|
-
var
|
|
880
|
-
var INTERNAL__onVisibilityChangedByTransparentServiceWeb =
|
|
965
|
+
var import_native_modules10 = require("@apps-in-toss/native-modules");
|
|
966
|
+
var INTERNAL__onVisibilityChangedByTransparentServiceWeb = import_native_modules10.onVisibilityChangedByTransparentServiceWeb;
|
|
881
967
|
|
|
882
968
|
// src/utils/openTransparentWebView.ts
|
|
883
969
|
var openTransparentWebView = ({
|
|
@@ -907,7 +993,7 @@ var openTransparentWebView = ({
|
|
|
907
993
|
}
|
|
908
994
|
}
|
|
909
995
|
});
|
|
910
|
-
(0,
|
|
996
|
+
(0, import_react_native17.openURL)(url.toString());
|
|
911
997
|
};
|
|
912
998
|
|
|
913
999
|
// src/hooks/useGameCenterProfile.ts
|
|
@@ -920,14 +1006,14 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
920
1006
|
const canShowBottomSheetOrToast = !isProfileDataLoading && isReadyForProfileUI;
|
|
921
1007
|
const [isWebviewLoading, setIsWebviewLoading] = (0, import_react10.useState)(false);
|
|
922
1008
|
const isCompletedProfileFlow = (0, import_react10.useRef)(false);
|
|
923
|
-
const { openAlert, openConfirm } = (0,
|
|
1009
|
+
const { openAlert, openConfirm } = (0, import_tds_react_native8.useDialog)();
|
|
924
1010
|
const { openGameProfileToast } = useGameProfileToast();
|
|
925
1011
|
const openErrorAlert = (0, import_react10.useCallback)(async () => {
|
|
926
1012
|
await openAlert({
|
|
927
1013
|
title: DEFAULT_ERROR.title,
|
|
928
1014
|
description: DEFAULT_ERROR.description
|
|
929
1015
|
});
|
|
930
|
-
(0,
|
|
1016
|
+
(0, import_react_native18.closeView)();
|
|
931
1017
|
}, [openAlert]);
|
|
932
1018
|
const openProfileWebview = (0, import_react10.useCallback)(() => {
|
|
933
1019
|
if (isWebviewLoading) {
|
|
@@ -941,7 +1027,7 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
941
1027
|
try {
|
|
942
1028
|
setIsWebviewLoading(false);
|
|
943
1029
|
setIsProfileDataRefetching(true);
|
|
944
|
-
const data = await (0,
|
|
1030
|
+
const data = await (0, import_native_modules11.getGameCenterGameProfile)();
|
|
945
1031
|
setProfileData(data);
|
|
946
1032
|
setIsProfileDataRefetching(false);
|
|
947
1033
|
if (data?.statusCode === "SUCCESS") {
|
|
@@ -972,11 +1058,11 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
972
1058
|
closeOnDimmerClick: true
|
|
973
1059
|
});
|
|
974
1060
|
if (!isConfirmed) {
|
|
975
|
-
(0,
|
|
1061
|
+
(0, import_react_native18.closeView)();
|
|
976
1062
|
return;
|
|
977
1063
|
}
|
|
978
1064
|
const STORE_SCHEME = getMarketLink();
|
|
979
|
-
(0,
|
|
1065
|
+
(0, import_react_native18.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
|
|
980
1066
|
}, [openConfirm]);
|
|
981
1067
|
return {
|
|
982
1068
|
profileData,
|
|
@@ -1005,7 +1091,7 @@ var Z_INDEX = {
|
|
|
1005
1091
|
};
|
|
1006
1092
|
|
|
1007
1093
|
// src/components/GameProfile.tsx
|
|
1008
|
-
var
|
|
1094
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1009
1095
|
var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
1010
1096
|
const {
|
|
1011
1097
|
profileData,
|
|
@@ -1024,7 +1110,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1024
1110
|
(0, import_react11.useEffect)(() => {
|
|
1025
1111
|
try {
|
|
1026
1112
|
const getProfileData = async () => {
|
|
1027
|
-
const data = await (0,
|
|
1113
|
+
const data = await (0, import_native_modules12.getGameCenterGameProfile)();
|
|
1028
1114
|
setProfileData(data);
|
|
1029
1115
|
setIsProfileDataLoading(false);
|
|
1030
1116
|
};
|
|
@@ -1043,7 +1129,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1043
1129
|
return;
|
|
1044
1130
|
}
|
|
1045
1131
|
isCompletedProfileFlow.current = true;
|
|
1046
|
-
if (!(0,
|
|
1132
|
+
if (!(0, import_native_modules12.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
|
|
1047
1133
|
updateAppToSupportedMinVersion();
|
|
1048
1134
|
return;
|
|
1049
1135
|
}
|
|
@@ -1064,11 +1150,11 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1064
1150
|
profileData,
|
|
1065
1151
|
updateAppToSupportedMinVersion
|
|
1066
1152
|
]);
|
|
1067
|
-
if (!(0,
|
|
1068
|
-
return /* @__PURE__ */ (0,
|
|
1069
|
-
/* @__PURE__ */ (0,
|
|
1070
|
-
/* @__PURE__ */ (0,
|
|
1071
|
-
|
|
1153
|
+
if (!(0, import_native_modules12.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
|
|
1154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1155
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native19.View, { style: { flex: 1, position: "relative" }, children }),
|
|
1156
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1157
|
+
import_react_native19.Pressable,
|
|
1072
1158
|
{
|
|
1073
1159
|
style: {
|
|
1074
1160
|
...overlayStyle
|
|
@@ -1081,10 +1167,10 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1081
1167
|
] });
|
|
1082
1168
|
}
|
|
1083
1169
|
if (shouldShowLoadingOverlay || isProfileDataRefetching) {
|
|
1084
|
-
return /* @__PURE__ */ (0,
|
|
1085
|
-
/* @__PURE__ */ (0,
|
|
1086
|
-
/* @__PURE__ */ (0,
|
|
1087
|
-
|
|
1170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1171
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native19.View, { style: { flex: 1, position: "relative" }, children }),
|
|
1172
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1173
|
+
import_react_native19.View,
|
|
1088
1174
|
{
|
|
1089
1175
|
style: {
|
|
1090
1176
|
...overlayStyle,
|
|
@@ -1092,16 +1178,16 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1092
1178
|
alignItems: "center",
|
|
1093
1179
|
backgroundColor: "rgba(0, 0, 0, 0.2)"
|
|
1094
1180
|
},
|
|
1095
|
-
children: /* @__PURE__ */ (0,
|
|
1181
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tds_react_native9.Loader, { size: "large", type: "light" })
|
|
1096
1182
|
}
|
|
1097
1183
|
)
|
|
1098
1184
|
] });
|
|
1099
1185
|
}
|
|
1100
1186
|
if (shouldShowProfileNotFoundOverlay) {
|
|
1101
|
-
return /* @__PURE__ */ (0,
|
|
1102
|
-
/* @__PURE__ */ (0,
|
|
1103
|
-
shouldShowProfileNotFoundOverlay && /* @__PURE__ */ (0,
|
|
1104
|
-
|
|
1187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1188
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native19.View, { style: { flex: 1, position: "relative" }, children }),
|
|
1189
|
+
shouldShowProfileNotFoundOverlay && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1190
|
+
import_react_native19.Pressable,
|
|
1105
1191
|
{
|
|
1106
1192
|
style: {
|
|
1107
1193
|
...overlayStyle
|
|
@@ -1113,7 +1199,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1113
1199
|
)
|
|
1114
1200
|
] });
|
|
1115
1201
|
}
|
|
1116
|
-
return /* @__PURE__ */ (0,
|
|
1202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native19.View, { style: { flex: 1, position: "relative" }, children }) });
|
|
1117
1203
|
};
|
|
1118
1204
|
var overlayStyle = {
|
|
1119
1205
|
position: "absolute",
|
|
@@ -1125,16 +1211,16 @@ var overlayStyle = {
|
|
|
1125
1211
|
};
|
|
1126
1212
|
|
|
1127
1213
|
// src/components/NavigationBar/GameWebviewNavigationBar.tsx
|
|
1128
|
-
var
|
|
1129
|
-
var
|
|
1130
|
-
var
|
|
1214
|
+
var import_react_native20 = require("@granite-js/react-native");
|
|
1215
|
+
var import_tds_react_native10 = require("@toss/tds-react-native");
|
|
1216
|
+
var import_private6 = require("@toss/tds-react-native/private");
|
|
1131
1217
|
var import_es_hangul3 = require("es-hangul");
|
|
1132
1218
|
var import_react12 = require("react");
|
|
1133
|
-
var
|
|
1134
|
-
var
|
|
1219
|
+
var import_react_native21 = require("react-native");
|
|
1220
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1135
1221
|
function GameWebviewNavigationBar() {
|
|
1136
|
-
const safeAreaTop = (0,
|
|
1137
|
-
const { openConfirm } = (0,
|
|
1222
|
+
const safeAreaTop = (0, import_private6.useSafeAreaTop)();
|
|
1223
|
+
const { openConfirm } = (0, import_tds_react_native10.useDialog)();
|
|
1138
1224
|
const { captureExitLog } = useCaptureExitLog();
|
|
1139
1225
|
const global2 = getAppsInTossGlobals();
|
|
1140
1226
|
const logging = useNavigationBarLogging();
|
|
@@ -1142,6 +1228,7 @@ function GameWebviewNavigationBar() {
|
|
|
1142
1228
|
const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
|
|
1143
1229
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
1144
1230
|
const handleGameWebviewClose = (0, import_react12.useCallback)(async () => {
|
|
1231
|
+
logging.closeButtonClick();
|
|
1145
1232
|
const isConfirmed = await openConfirm({
|
|
1146
1233
|
title: `${(0, import_es_hangul3.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
1147
1234
|
leftButton: "\uCDE8\uC18C",
|
|
@@ -1152,26 +1239,18 @@ function GameWebviewNavigationBar() {
|
|
|
1152
1239
|
logging.closePopupCtaClick(isConfirmed);
|
|
1153
1240
|
if (isConfirmed) {
|
|
1154
1241
|
captureExitLog(Date.now());
|
|
1155
|
-
(0,
|
|
1242
|
+
(0, import_react_native20.closeView)();
|
|
1156
1243
|
}
|
|
1157
1244
|
}, [captureExitLog, global2.brandDisplayName, logging, openConfirm]);
|
|
1158
|
-
(0,
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
};
|
|
1163
|
-
import_react_native28.BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
1164
|
-
return () => import_react_native28.BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
1165
|
-
}, [handleGameWebviewClose]);
|
|
1166
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1167
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native27.PageNavbar, { preference: { type: "none" } }),
|
|
1168
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1169
|
-
import_react_native28.View,
|
|
1245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1246
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_tds_react_native10.PageNavbar, { preference: { type: "none" } }),
|
|
1247
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1248
|
+
import_react_native21.View,
|
|
1170
1249
|
{
|
|
1171
1250
|
style: {
|
|
1172
1251
|
width: "100%",
|
|
1173
1252
|
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1174
|
-
height:
|
|
1253
|
+
height: import_react_native21.Platform.OS === "ios" ? 44 : 54,
|
|
1175
1254
|
flexDirection: "row",
|
|
1176
1255
|
alignItems: "center",
|
|
1177
1256
|
justifyContent: "flex-end",
|
|
@@ -1181,13 +1260,12 @@ function GameWebviewNavigationBar() {
|
|
|
1181
1260
|
paddingRight: 10
|
|
1182
1261
|
},
|
|
1183
1262
|
pointerEvents: "box-none",
|
|
1184
|
-
children: /* @__PURE__ */ (0,
|
|
1185
|
-
|
|
1263
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1264
|
+
import_private6.NavigationRightContent,
|
|
1186
1265
|
{
|
|
1187
1266
|
fixedRightButton: initialAccessoryButton,
|
|
1188
1267
|
onPressDots: openMoreButtonBottomSheet,
|
|
1189
1268
|
onPressClose: () => {
|
|
1190
|
-
logging.closeButtonClick();
|
|
1191
1269
|
handleGameWebviewClose();
|
|
1192
1270
|
},
|
|
1193
1271
|
theme: "dark"
|
|
@@ -1199,59 +1277,52 @@ function GameWebviewNavigationBar() {
|
|
|
1199
1277
|
}
|
|
1200
1278
|
|
|
1201
1279
|
// src/components/GameWebView.tsx
|
|
1202
|
-
var
|
|
1280
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1203
1281
|
var GameWebView = (0, import_react13.forwardRef)(function GameWebView2(props, ref) {
|
|
1204
1282
|
const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react13.useState)(false);
|
|
1205
1283
|
(0, import_react13.useEffect)(() => {
|
|
1206
|
-
if (
|
|
1207
|
-
(0,
|
|
1284
|
+
if (import_react_native22.Platform.OS === "ios") {
|
|
1285
|
+
(0, import_native_modules13.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1208
1286
|
return () => {
|
|
1209
|
-
(0,
|
|
1287
|
+
(0, import_native_modules13.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1210
1288
|
};
|
|
1211
1289
|
}
|
|
1212
1290
|
return;
|
|
1213
1291
|
}, []);
|
|
1214
1292
|
(0, import_react13.useEffect)(() => {
|
|
1215
|
-
|
|
1293
|
+
import_native_modules13.appsInTossEvent.addEventListener("entryMessageExited", {
|
|
1216
1294
|
onEvent: () => {
|
|
1217
1295
|
setIsEntryMessageExited(true);
|
|
1218
1296
|
}
|
|
1219
1297
|
});
|
|
1220
1298
|
}, []);
|
|
1221
|
-
return /* @__PURE__ */ (0,
|
|
1222
|
-
/* @__PURE__ */ (0,
|
|
1223
|
-
(0,
|
|
1299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
1300
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GameWebviewNavigationBar, {}),
|
|
1301
|
+
(0, import_native_modules13.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GameProfile, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native_webview.WebView, { ref, ...props }) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native_webview.WebView, { ref, ...props })
|
|
1224
1302
|
] });
|
|
1225
1303
|
});
|
|
1226
1304
|
|
|
1227
1305
|
// src/components/PartnerWebView.tsx
|
|
1228
|
-
var import_native_modules14 = require("@apps-in-toss/native-modules");
|
|
1229
1306
|
var import_react_native_webview2 = require("@granite-js/native/react-native-webview");
|
|
1230
1307
|
var import_react15 = require("react");
|
|
1231
|
-
var import_react_native32 = require("react-native");
|
|
1232
1308
|
|
|
1233
1309
|
// src/components/NavigationBar/PartnerWebviewNavigationBar.tsx
|
|
1234
|
-
var
|
|
1235
|
-
var
|
|
1236
|
-
var
|
|
1237
|
-
var import_private6 = require("@toss-design-system/react-native/private");
|
|
1310
|
+
var import_react_native23 = require("@granite-js/react-native");
|
|
1311
|
+
var import_tds_react_native11 = require("@toss/tds-react-native");
|
|
1312
|
+
var import_private7 = require("@toss/tds-react-native/private");
|
|
1238
1313
|
var import_es_hangul4 = require("es-hangul");
|
|
1239
1314
|
var import_react14 = require("react");
|
|
1240
|
-
var
|
|
1241
|
-
function PartnerWebviewNavigationBar({
|
|
1315
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1316
|
+
function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
1242
1317
|
const globals = getAppsInTossGlobals();
|
|
1243
1318
|
const { captureExitLog } = useCaptureExitLog();
|
|
1244
1319
|
const logging = useNavigationBarLogging();
|
|
1245
|
-
const { openConfirm } = (0,
|
|
1320
|
+
const { openConfirm } = (0, import_tds_react_native11.useDialog)();
|
|
1246
1321
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1247
1322
|
const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
|
|
1248
1323
|
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
1249
1324
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
1250
1325
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
1251
|
-
const handlePressTitle = (0, import_react14.useCallback)(() => {
|
|
1252
|
-
logging.homeButtonClick();
|
|
1253
|
-
import_native_modules13.appsInTossEvent.emit("homeIconButtonClickEvent", void 0);
|
|
1254
|
-
}, [logging]);
|
|
1255
1326
|
const handleClose = (0, import_react14.useCallback)(async () => {
|
|
1256
1327
|
logging.closeButtonClick();
|
|
1257
1328
|
const isConfirmed = await openConfirm({
|
|
@@ -1264,80 +1335,31 @@ function PartnerWebviewNavigationBar({ handleBackEvent }) {
|
|
|
1264
1335
|
logging.closePopupCtaClick(isConfirmed);
|
|
1265
1336
|
if (isConfirmed) {
|
|
1266
1337
|
captureExitLog(Date.now());
|
|
1267
|
-
(0,
|
|
1338
|
+
(0, import_react_native23.closeView)();
|
|
1268
1339
|
}
|
|
1269
1340
|
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
1270
|
-
return /* @__PURE__ */ (0,
|
|
1271
|
-
|
|
1341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1342
|
+
import_private7.TopNavigation,
|
|
1272
1343
|
{
|
|
1273
1344
|
title: globals.brandDisplayName,
|
|
1274
1345
|
icon: toIcon(globals.brandIcon),
|
|
1275
1346
|
onPressDots: openMoreButtonBottomSheet,
|
|
1276
1347
|
contentVisible: true,
|
|
1277
|
-
onPressTitle: withHomeButton ?
|
|
1348
|
+
onPressTitle: withHomeButton ? onHomeButtonClick : void 0,
|
|
1278
1349
|
onPressClose: handleClose,
|
|
1279
1350
|
withHome: withHomeButton,
|
|
1280
1351
|
fixedRightButton: initialAccessoryButton,
|
|
1281
|
-
children: /* @__PURE__ */ (0,
|
|
1352
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_private7.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_private7.NavigationBackButton, { onPress: onBackButtonClick, canGoBack: false }) })
|
|
1282
1353
|
}
|
|
1283
1354
|
) });
|
|
1284
1355
|
}
|
|
1285
1356
|
|
|
1286
|
-
// src/core/utils/mergeRefs.ts
|
|
1287
|
-
function mergeRefs(...refs) {
|
|
1288
|
-
return (value) => {
|
|
1289
|
-
refs.forEach((ref) => {
|
|
1290
|
-
if (typeof ref === "function") {
|
|
1291
|
-
ref(value);
|
|
1292
|
-
} else if (ref != null) {
|
|
1293
|
-
ref.current = value;
|
|
1294
|
-
}
|
|
1295
|
-
});
|
|
1296
|
-
};
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
1357
|
// src/components/PartnerWebView.tsx
|
|
1300
|
-
var
|
|
1301
|
-
var PartnerWebView = (0, import_react15.forwardRef)(function PartnerWebViewScreen({
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
const handleBackEvent = (0, import_react15.useCallback)(() => {
|
|
1306
|
-
if (canHistoryGoBack) {
|
|
1307
|
-
webViewRef.current?.goBack();
|
|
1308
|
-
} else {
|
|
1309
|
-
captureExitLog(Date.now());
|
|
1310
|
-
(0, import_native_modules14.closeView)();
|
|
1311
|
-
}
|
|
1312
|
-
}, [canHistoryGoBack, captureExitLog]);
|
|
1313
|
-
(0, import_react15.useEffect)(() => {
|
|
1314
|
-
const handleAndroidBackEvent = () => {
|
|
1315
|
-
if (canHistoryGoBack) {
|
|
1316
|
-
webViewRef.current?.goBack();
|
|
1317
|
-
return true;
|
|
1318
|
-
} else {
|
|
1319
|
-
captureExitLog(Date.now());
|
|
1320
|
-
return false;
|
|
1321
|
-
}
|
|
1322
|
-
};
|
|
1323
|
-
import_react_native32.BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
1324
|
-
return () => import_react_native32.BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
1325
|
-
}, [canHistoryGoBack, captureExitLog]);
|
|
1326
|
-
(0, import_react15.useEffect)(() => {
|
|
1327
|
-
return import_native_modules14.appsInTossEvent.addEventListener("homeIconButtonClickEvent", {
|
|
1328
|
-
onEvent: () => {
|
|
1329
|
-
webViewRef.current?.injectJavaScript(`
|
|
1330
|
-
(function() {
|
|
1331
|
-
window.history.replaceState(null, '', '/');
|
|
1332
|
-
true;
|
|
1333
|
-
})();
|
|
1334
|
-
`);
|
|
1335
|
-
}
|
|
1336
|
-
});
|
|
1337
|
-
}, [webViewRef]);
|
|
1338
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1339
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PartnerWebviewNavigationBar, { handleBackEvent }),
|
|
1340
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native_webview2.WebView, { ref: refs, ...webViewProps, style: { flex: 1 } })
|
|
1358
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1359
|
+
var PartnerWebView = (0, import_react15.forwardRef)(function PartnerWebViewScreen({ onBackButtonClick, onHomeButtonClick, ...webViewProps }, ref) {
|
|
1360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1361
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PartnerWebviewNavigationBar, { onBackButtonClick, onHomeButtonClick }),
|
|
1362
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native_webview2.WebView, { ref, ...webViewProps, style: { flex: 1 } })
|
|
1341
1363
|
] });
|
|
1342
1364
|
});
|
|
1343
1365
|
|
|
@@ -1347,6 +1369,10 @@ function serializeError(error) {
|
|
|
1347
1369
|
return JSON.stringify(error, (_, value) => {
|
|
1348
1370
|
if (value instanceof Error) {
|
|
1349
1371
|
return {
|
|
1372
|
+
...Object.entries(value).reduce((acc, [key, value2]) => {
|
|
1373
|
+
acc[key] = value2;
|
|
1374
|
+
return acc;
|
|
1375
|
+
}, {}),
|
|
1350
1376
|
name: value.name,
|
|
1351
1377
|
message: value.message,
|
|
1352
1378
|
stack: value.stack,
|
|
@@ -1469,9 +1495,158 @@ function useBridgeHandler({
|
|
|
1469
1495
|
};
|
|
1470
1496
|
}
|
|
1471
1497
|
|
|
1498
|
+
// src/core/hooks/useWebBackHandler.tsx
|
|
1499
|
+
var import_react_native24 = require("@granite-js/react-native");
|
|
1500
|
+
var import_tds_react_native12 = require("@toss/tds-react-native");
|
|
1501
|
+
var import_es_hangul5 = require("es-hangul");
|
|
1502
|
+
var import_react18 = require("react");
|
|
1503
|
+
|
|
1504
|
+
// src/hooks/useWebviewHistoryStack.tsx
|
|
1505
|
+
var import_react17 = require("react");
|
|
1506
|
+
var INITIAL_STATE = { stack: [], index: -1 };
|
|
1507
|
+
function reducer(state, action) {
|
|
1508
|
+
switch (action.type) {
|
|
1509
|
+
case "NAVIGATION_CHANGE": {
|
|
1510
|
+
const { url, canGoForward } = action;
|
|
1511
|
+
if (state.stack.length === 0) {
|
|
1512
|
+
return { stack: [url], index: 0 };
|
|
1513
|
+
}
|
|
1514
|
+
const { stack, index } = state;
|
|
1515
|
+
const cur = stack[index];
|
|
1516
|
+
if (url === cur) {
|
|
1517
|
+
return state;
|
|
1518
|
+
}
|
|
1519
|
+
const prev = index > 0 ? stack[index - 1] : void 0;
|
|
1520
|
+
const next = index < stack.length - 1 ? stack[index + 1] : void 0;
|
|
1521
|
+
if (prev && url === prev && canGoForward) {
|
|
1522
|
+
return { ...state, index: index - 1 };
|
|
1523
|
+
}
|
|
1524
|
+
if (next && url === next) {
|
|
1525
|
+
return { ...state, index: index + 1 };
|
|
1526
|
+
}
|
|
1527
|
+
const base = stack.slice(0, index + 1);
|
|
1528
|
+
const nextStack = [...base, url];
|
|
1529
|
+
return { stack: nextStack, index: nextStack.length - 1 };
|
|
1530
|
+
}
|
|
1531
|
+
default:
|
|
1532
|
+
return state;
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
function useWebViewHistory() {
|
|
1536
|
+
const [state, dispatch] = (0, import_react17.useReducer)(reducer, INITIAL_STATE);
|
|
1537
|
+
const onNavigationStateChange = (0, import_react17.useCallback)(({ url, canGoForward: canGoForward2 }) => {
|
|
1538
|
+
dispatch({ type: "NAVIGATION_CHANGE", url, canGoForward: canGoForward2 });
|
|
1539
|
+
}, []);
|
|
1540
|
+
const { canGoBack, canGoForward } = (0, import_react17.useMemo)(() => {
|
|
1541
|
+
const canBack = state.index > 0;
|
|
1542
|
+
const canFwd = state.index >= 0 && state.index < state.stack.length - 1;
|
|
1543
|
+
return { canGoBack: canBack, canGoForward: canFwd };
|
|
1544
|
+
}, [state.index, state.stack.length]);
|
|
1545
|
+
return { onNavigationStateChange, hasHistory: canGoBack, canGoForward };
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
// src/core/hooks/useWebBackHandler.tsx
|
|
1549
|
+
var HISTORY_BACK_SCRIPT = `
|
|
1550
|
+
(function() {
|
|
1551
|
+
window.history.back();
|
|
1552
|
+
true;
|
|
1553
|
+
})();
|
|
1554
|
+
`;
|
|
1555
|
+
var HISTORY_HOME_SCRIPT = `
|
|
1556
|
+
(function() {
|
|
1557
|
+
window.location.href = '/';
|
|
1558
|
+
true;
|
|
1559
|
+
})();
|
|
1560
|
+
`;
|
|
1561
|
+
function useWebBackHandler(webViewRef) {
|
|
1562
|
+
const { captureExitLog } = useCaptureExitLog();
|
|
1563
|
+
const { hasHistory, onNavigationStateChange } = useWebViewHistory();
|
|
1564
|
+
const {
|
|
1565
|
+
handlersRef: webBackHandlersRef,
|
|
1566
|
+
hasBackEvent: hasWebBackEvent,
|
|
1567
|
+
addEventListener: addWebBackEventListener,
|
|
1568
|
+
removeEventListener: removeWebBackEventListener
|
|
1569
|
+
} = (0, import_react_native24.useBackEventState)();
|
|
1570
|
+
const logging = useNavigationBarLogging();
|
|
1571
|
+
const { openConfirm } = (0, import_tds_react_native12.useDialog)();
|
|
1572
|
+
const global2 = getAppsInTossGlobals();
|
|
1573
|
+
const addEventListener = (0, import_react18.useCallback)(
|
|
1574
|
+
(handler) => {
|
|
1575
|
+
addWebBackEventListener(handler);
|
|
1576
|
+
},
|
|
1577
|
+
[addWebBackEventListener]
|
|
1578
|
+
);
|
|
1579
|
+
const removeEventListener = (0, import_react18.useCallback)(
|
|
1580
|
+
(handler) => {
|
|
1581
|
+
removeWebBackEventListener(handler);
|
|
1582
|
+
},
|
|
1583
|
+
[removeWebBackEventListener]
|
|
1584
|
+
);
|
|
1585
|
+
const handleWebBack = (0, import_react18.useCallback)(async () => {
|
|
1586
|
+
if (hasWebBackEvent) {
|
|
1587
|
+
for (const handler of webBackHandlersRef) {
|
|
1588
|
+
handler();
|
|
1589
|
+
}
|
|
1590
|
+
return;
|
|
1591
|
+
}
|
|
1592
|
+
if (hasHistory) {
|
|
1593
|
+
webViewRef.current?.injectJavaScript(HISTORY_BACK_SCRIPT);
|
|
1594
|
+
} else {
|
|
1595
|
+
const isConfirmed = await openConfirm({
|
|
1596
|
+
title: `${(0, import_es_hangul5.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
1597
|
+
leftButton: "\uCDE8\uC18C",
|
|
1598
|
+
rightButton: "\uC885\uB8CC\uD558\uAE30",
|
|
1599
|
+
closeOnDimmerClick: true,
|
|
1600
|
+
onEntered: logging.closePopupShow
|
|
1601
|
+
});
|
|
1602
|
+
logging.closePopupCtaClick(isConfirmed);
|
|
1603
|
+
if (isConfirmed) {
|
|
1604
|
+
captureExitLog(Date.now());
|
|
1605
|
+
(0, import_react_native24.closeView)();
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
}, [
|
|
1609
|
+
captureExitLog,
|
|
1610
|
+
global2.brandDisplayName,
|
|
1611
|
+
hasHistory,
|
|
1612
|
+
hasWebBackEvent,
|
|
1613
|
+
webBackHandlersRef,
|
|
1614
|
+
logging,
|
|
1615
|
+
openConfirm,
|
|
1616
|
+
webViewRef
|
|
1617
|
+
]);
|
|
1618
|
+
const handleWebHome = (0, import_react18.useCallback)(() => {
|
|
1619
|
+
logging.homeButtonClick();
|
|
1620
|
+
if (hasWebBackEvent) {
|
|
1621
|
+
for (const handler of webBackHandlersRef) {
|
|
1622
|
+
handler();
|
|
1623
|
+
}
|
|
1624
|
+
return;
|
|
1625
|
+
}
|
|
1626
|
+
webViewRef.current?.injectJavaScript(HISTORY_HOME_SCRIPT);
|
|
1627
|
+
}, [hasWebBackEvent, webBackHandlersRef, logging, webViewRef]);
|
|
1628
|
+
return (0, import_react18.useMemo)(
|
|
1629
|
+
() => ({ addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange }),
|
|
1630
|
+
[addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange]
|
|
1631
|
+
);
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
// src/core/utils/mergeRefs.ts
|
|
1635
|
+
function mergeRefs(...refs) {
|
|
1636
|
+
return (value) => {
|
|
1637
|
+
refs.forEach((ref) => {
|
|
1638
|
+
if (typeof ref === "function") {
|
|
1639
|
+
ref(value);
|
|
1640
|
+
} else if (ref != null) {
|
|
1641
|
+
ref.current = value;
|
|
1642
|
+
}
|
|
1643
|
+
});
|
|
1644
|
+
};
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1472
1647
|
// src/hooks/useCreateUserAgent.ts
|
|
1473
|
-
var
|
|
1474
|
-
var
|
|
1648
|
+
var import_native_modules14 = require("@apps-in-toss/native-modules");
|
|
1649
|
+
var import_react_native25 = require("react-native");
|
|
1475
1650
|
var FontA11yCategory = {
|
|
1476
1651
|
Large: "Large",
|
|
1477
1652
|
xLarge: "xLarge",
|
|
@@ -1604,9 +1779,9 @@ function useCreateUserAgent({
|
|
|
1604
1779
|
safeArea,
|
|
1605
1780
|
safeAreaBottomTransparency
|
|
1606
1781
|
}) {
|
|
1607
|
-
const platform = (0,
|
|
1608
|
-
const appVersion = (0,
|
|
1609
|
-
const { fontScale } = (0,
|
|
1782
|
+
const platform = (0, import_native_modules14.getPlatformOS)();
|
|
1783
|
+
const appVersion = (0, import_native_modules14.getTossAppVersion)();
|
|
1784
|
+
const { fontScale } = (0, import_react_native25.useWindowDimensions)();
|
|
1610
1785
|
const platformString = platform === "ios" ? "iPhone" : "Android";
|
|
1611
1786
|
const fontA11y = mapFontScaleToCategory(fontScale, platform);
|
|
1612
1787
|
const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
|
|
@@ -1626,17 +1801,17 @@ function useCreateUserAgent({
|
|
|
1626
1801
|
}
|
|
1627
1802
|
|
|
1628
1803
|
// src/hooks/useGeolocation.ts
|
|
1629
|
-
var
|
|
1630
|
-
var
|
|
1631
|
-
var
|
|
1804
|
+
var import_native_modules15 = require("@apps-in-toss/native-modules");
|
|
1805
|
+
var import_react_native26 = require("@granite-js/react-native");
|
|
1806
|
+
var import_react19 = require("react");
|
|
1632
1807
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
1633
|
-
const isVisible = (0,
|
|
1634
|
-
const [location, setLocation] = (0,
|
|
1635
|
-
(0,
|
|
1808
|
+
const isVisible = (0, import_react_native26.useVisibility)();
|
|
1809
|
+
const [location, setLocation] = (0, import_react19.useState)(null);
|
|
1810
|
+
(0, import_react19.useEffect)(() => {
|
|
1636
1811
|
if (!isVisible) {
|
|
1637
1812
|
return;
|
|
1638
1813
|
}
|
|
1639
|
-
return (0,
|
|
1814
|
+
return (0, import_native_modules15.startUpdateLocation)({
|
|
1640
1815
|
options: {
|
|
1641
1816
|
accuracy,
|
|
1642
1817
|
distanceInterval,
|
|
@@ -1649,9 +1824,39 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
1649
1824
|
return location;
|
|
1650
1825
|
}
|
|
1651
1826
|
|
|
1827
|
+
// src/hooks/useWaitForReturnNavigator.tsx
|
|
1828
|
+
var import_react_native27 = require("@granite-js/react-native");
|
|
1829
|
+
var import_react20 = require("react");
|
|
1830
|
+
function useWaitForReturnNavigator() {
|
|
1831
|
+
const callbacks = (0, import_react20.useRef)([]).current;
|
|
1832
|
+
const navigation = (0, import_react_native27.useNavigation)();
|
|
1833
|
+
const startNavigating = (0, import_react20.useCallback)(
|
|
1834
|
+
(route, params) => {
|
|
1835
|
+
return new Promise((resolve) => {
|
|
1836
|
+
callbacks.push(resolve);
|
|
1837
|
+
navigation.navigate(route, params);
|
|
1838
|
+
});
|
|
1839
|
+
},
|
|
1840
|
+
[callbacks, navigation]
|
|
1841
|
+
);
|
|
1842
|
+
const handleVisibilityChange = (0, import_react20.useCallback)(
|
|
1843
|
+
(state) => {
|
|
1844
|
+
if (state === "visible" && callbacks.length > 0) {
|
|
1845
|
+
for (const callback of callbacks) {
|
|
1846
|
+
callback();
|
|
1847
|
+
}
|
|
1848
|
+
callbacks.splice(0, callbacks.length);
|
|
1849
|
+
}
|
|
1850
|
+
},
|
|
1851
|
+
[callbacks]
|
|
1852
|
+
);
|
|
1853
|
+
(0, import_react_native27.useVisibilityChange)(handleVisibilityChange);
|
|
1854
|
+
return startNavigating;
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1652
1857
|
// src/utils/log.ts
|
|
1653
|
-
var
|
|
1654
|
-
var
|
|
1858
|
+
var import_native_modules16 = require("@apps-in-toss/native-modules");
|
|
1859
|
+
var import_react_native28 = require("@granite-js/react-native");
|
|
1655
1860
|
|
|
1656
1861
|
// src/utils/extractDateFromUUIDv7.ts
|
|
1657
1862
|
var extractDateFromUUIDv7 = (uuid) => {
|
|
@@ -1677,7 +1882,7 @@ var getGroupId = (url) => {
|
|
|
1677
1882
|
};
|
|
1678
1883
|
var getReferrer = () => {
|
|
1679
1884
|
try {
|
|
1680
|
-
const referrer = new URL((0,
|
|
1885
|
+
const referrer = new URL((0, import_react_native28.getSchemeUri)());
|
|
1681
1886
|
return referrer.searchParams.get("referrer");
|
|
1682
1887
|
} catch {
|
|
1683
1888
|
return "";
|
|
@@ -1695,21 +1900,21 @@ var trackScreen = (url) => {
|
|
|
1695
1900
|
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
1696
1901
|
}
|
|
1697
1902
|
};
|
|
1698
|
-
return (0,
|
|
1903
|
+
return (0, import_native_modules16.eventLog)(log);
|
|
1699
1904
|
};
|
|
1700
1905
|
|
|
1701
1906
|
// src/components/WebView.tsx
|
|
1702
|
-
var
|
|
1907
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1703
1908
|
var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
|
|
1704
1909
|
var TYPES = ["partner", "external", "game"];
|
|
1705
1910
|
var WEBVIEW_TYPES = {
|
|
1706
1911
|
partner: PartnerWebView,
|
|
1707
|
-
external:
|
|
1912
|
+
external: import_tds_react_native13.ExternalWebViewScreen,
|
|
1708
1913
|
game: GameWebView
|
|
1709
1914
|
};
|
|
1710
1915
|
function mergeSchemeQueryParamsInto(url) {
|
|
1711
1916
|
const baseUrl = new URL(url);
|
|
1712
|
-
const schemeUrl = new URL((0,
|
|
1917
|
+
const schemeUrl = new URL((0, import_react_native29.getSchemeUri)());
|
|
1713
1918
|
baseUrl.pathname = schemeUrl.pathname;
|
|
1714
1919
|
for (const [key, value] of schemeUrl.searchParams.entries()) {
|
|
1715
1920
|
baseUrl.searchParams.set(key, value);
|
|
@@ -1721,7 +1926,7 @@ function getWebViewUri(local) {
|
|
|
1721
1926
|
const devUrl = `http://${local.host}:${local.port}`;
|
|
1722
1927
|
return mergeSchemeQueryParamsInto(devUrl).toString();
|
|
1723
1928
|
}
|
|
1724
|
-
const { url: rawUrl } =
|
|
1929
|
+
const { url: rawUrl } = import_native_modules17.AppsInTossModule.getWebBundleURL({});
|
|
1725
1930
|
const url = mergeSchemeQueryParamsInto(rawUrl);
|
|
1726
1931
|
const deploymentId = env.getDeploymentId();
|
|
1727
1932
|
if (deploymentId) {
|
|
@@ -1733,12 +1938,13 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1733
1938
|
if (!TYPES.includes(type)) {
|
|
1734
1939
|
throw new Error(`Invalid WebView type: '${type}'`);
|
|
1735
1940
|
}
|
|
1736
|
-
const
|
|
1737
|
-
const
|
|
1738
|
-
const
|
|
1739
|
-
const
|
|
1941
|
+
const webViewRef = (0, import_react21.useRef)(null);
|
|
1942
|
+
const webBackHandler = useWebBackHandler(webViewRef);
|
|
1943
|
+
const uri = (0, import_react21.useMemo)(() => getWebViewUri(local), [local]);
|
|
1944
|
+
const top = (0, import_private8.useSafeAreaTop)();
|
|
1945
|
+
const bottom = (0, import_private8.useSafeAreaBottom)();
|
|
1740
1946
|
const global2 = getAppsInTossGlobals();
|
|
1741
|
-
const topNavigation = (0,
|
|
1947
|
+
const topNavigation = (0, import_private8.useTopNavigation)();
|
|
1742
1948
|
const disableTextSelectionCSS = `
|
|
1743
1949
|
(function() {
|
|
1744
1950
|
const style = document.createElement('style');
|
|
@@ -1746,7 +1952,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1746
1952
|
document.head.appendChild(style);
|
|
1747
1953
|
})();
|
|
1748
1954
|
`;
|
|
1749
|
-
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0,
|
|
1955
|
+
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0, import_react21.useState)(
|
|
1750
1956
|
props.allowsBackForwardNavigationGestures
|
|
1751
1957
|
);
|
|
1752
1958
|
const handler = useBridgeHandler({
|
|
@@ -1755,40 +1961,46 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1755
1961
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1756
1962
|
eventListenerMap: {
|
|
1757
1963
|
...appsInTossEventBridges,
|
|
1758
|
-
navigationAccessoryEvent: ({ onEvent, onError }) =>
|
|
1759
|
-
backEvent: ({ onEvent
|
|
1760
|
-
|
|
1761
|
-
|
|
1964
|
+
navigationAccessoryEvent: ({ onEvent, onError }) => import_tds_react_native13.tdsEvent.addEventListener("navigationAccessoryEvent", { onEvent, onError }),
|
|
1965
|
+
backEvent: ({ onEvent }) => {
|
|
1966
|
+
webBackHandler.addEventListener(onEvent);
|
|
1967
|
+
return () => {
|
|
1968
|
+
webBackHandler.removeEventListener(onEvent);
|
|
1969
|
+
};
|
|
1970
|
+
},
|
|
1971
|
+
entryMessageExited: ({ onEvent, onError }) => import_native_modules17.appsInTossEvent.addEventListener("entryMessageExited", { onEvent, onError }),
|
|
1972
|
+
updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules17.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
1762
1973
|
/** @internal */
|
|
1763
|
-
appBridgeCallbackEvent: ({ onEvent, onError, options }) =>
|
|
1974
|
+
appBridgeCallbackEvent: ({ onEvent, onError, options }) => import_native_modules17.appsInTossEvent.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
|
|
1764
1975
|
/** AdMob */
|
|
1765
|
-
loadAdMobInterstitialAd:
|
|
1766
|
-
showAdMobInterstitialAd:
|
|
1767
|
-
loadAdMobRewardedAd:
|
|
1768
|
-
showAdMobRewardedAd:
|
|
1976
|
+
loadAdMobInterstitialAd: import_native_modules17.GoogleAdMob.loadAdMobInterstitialAd,
|
|
1977
|
+
showAdMobInterstitialAd: import_native_modules17.GoogleAdMob.showAdMobInterstitialAd,
|
|
1978
|
+
loadAdMobRewardedAd: import_native_modules17.GoogleAdMob.loadAdMobRewardedAd,
|
|
1979
|
+
showAdMobRewardedAd: import_native_modules17.GoogleAdMob.showAdMobRewardedAd,
|
|
1769
1980
|
/** AdMobV2 */
|
|
1770
|
-
loadAppsInTossAdMob:
|
|
1771
|
-
showAppsInTossAdMob:
|
|
1981
|
+
loadAppsInTossAdMob: import_native_modules17.GoogleAdMob.loadAppsInTossAdMob,
|
|
1982
|
+
showAppsInTossAdMob: import_native_modules17.GoogleAdMob.showAppsInTossAdMob,
|
|
1983
|
+
/** IAP */
|
|
1984
|
+
iapCreateOneTimePurchaseOrder: import_native_modules17.IAP.createOneTimePurchaseOrder,
|
|
1985
|
+
requestOneTimePurchase: import_native_modules17.requestOneTimePurchase
|
|
1772
1986
|
},
|
|
1773
1987
|
constantHandlerMap: {
|
|
1774
|
-
...graniteConstantBridges,
|
|
1775
1988
|
...appsInTossConstantBridges,
|
|
1776
1989
|
getSafeAreaTop: () => top,
|
|
1777
1990
|
getSafeAreaBottom: () => bottom,
|
|
1778
1991
|
...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
|
|
1779
1992
|
/** AdMob */
|
|
1780
|
-
loadAdMobInterstitialAd_isSupported:
|
|
1781
|
-
showAdMobInterstitialAd_isSupported:
|
|
1782
|
-
loadAdMobRewardedAd_isSupported:
|
|
1783
|
-
showAdMobRewardedAd_isSupported:
|
|
1993
|
+
loadAdMobInterstitialAd_isSupported: import_native_modules17.GoogleAdMob.loadAdMobInterstitialAd.isSupported,
|
|
1994
|
+
showAdMobInterstitialAd_isSupported: import_native_modules17.GoogleAdMob.showAdMobInterstitialAd.isSupported,
|
|
1995
|
+
loadAdMobRewardedAd_isSupported: import_native_modules17.GoogleAdMob.loadAdMobRewardedAd.isSupported,
|
|
1996
|
+
showAdMobRewardedAd_isSupported: import_native_modules17.GoogleAdMob.showAdMobRewardedAd.isSupported,
|
|
1784
1997
|
/** AdMobV2 */
|
|
1785
|
-
loadAppsInTossAdMob_isSupported:
|
|
1786
|
-
showAppsInTossAdMob_isSupported:
|
|
1998
|
+
loadAppsInTossAdMob_isSupported: import_native_modules17.GoogleAdMob.loadAppsInTossAdMob.isSupported,
|
|
1999
|
+
showAppsInTossAdMob_isSupported: import_native_modules17.GoogleAdMob.showAppsInTossAdMob.isSupported,
|
|
1787
2000
|
/** env */
|
|
1788
2001
|
getDeploymentId: env.getDeploymentId
|
|
1789
2002
|
},
|
|
1790
2003
|
asyncHandlerMap: {
|
|
1791
|
-
...graniteAsyncBridges,
|
|
1792
2004
|
...appsInTossAsyncBridges,
|
|
1793
2005
|
setIosSwipeGestureEnabled: (options) => {
|
|
1794
2006
|
setAllowsBackForwardNavigationGestures(options.isEnabled);
|
|
@@ -1807,16 +2019,19 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1807
2019
|
getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
|
|
1808
2020
|
openCamera: appsInTossAsyncBridges.openCamera,
|
|
1809
2021
|
/** Storage */
|
|
1810
|
-
getStorageItem:
|
|
1811
|
-
setStorageItem:
|
|
1812
|
-
removeStorageItem:
|
|
1813
|
-
clearItems:
|
|
2022
|
+
getStorageItem: import_native_modules17.Storage.getItem,
|
|
2023
|
+
setStorageItem: import_native_modules17.Storage.setItem,
|
|
2024
|
+
removeStorageItem: import_native_modules17.Storage.removeItem,
|
|
2025
|
+
clearItems: import_native_modules17.Storage.clearItems,
|
|
1814
2026
|
/** IAP */
|
|
1815
|
-
|
|
1816
|
-
|
|
2027
|
+
iapGetProductItemList: import_native_modules17.IAP.getProductItemList,
|
|
2028
|
+
iapCreateOneTimePurchaseOrder: import_native_modules17.iapCreateOneTimePurchaseOrder,
|
|
2029
|
+
processProductGrant: import_native_modules17.processProductGrant,
|
|
2030
|
+
getPendingOrders: import_native_modules17.IAP.getPendingOrders,
|
|
2031
|
+
getCompletedOrRefundedOrders: import_native_modules17.IAP.getCompletedOrRefundedOrders
|
|
1817
2032
|
}
|
|
1818
2033
|
});
|
|
1819
|
-
const headerPropForExternalWebView = (0,
|
|
2034
|
+
const headerPropForExternalWebView = (0, import_react21.useMemo)(() => {
|
|
1820
2035
|
const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
|
|
1821
2036
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
1822
2037
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
@@ -1833,23 +2048,22 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1833
2048
|
}, [global2.navigationBar, type]);
|
|
1834
2049
|
const BaseWebView = WEBVIEW_TYPES[type];
|
|
1835
2050
|
const webViewDebuggingEnabled = operationalEnvironment === "sandbox";
|
|
1836
|
-
const [canHistoryGoBack, setCanHistoryGoBack] = (0, import_react18.useState)(false);
|
|
1837
|
-
const handleNavigationStateChange = (0, import_react18.useCallback)(
|
|
1838
|
-
(event) => {
|
|
1839
|
-
if (event.url) {
|
|
1840
|
-
trackScreen(event.url);
|
|
1841
|
-
}
|
|
1842
|
-
setCanHistoryGoBack(event.canGoBack);
|
|
1843
|
-
},
|
|
1844
|
-
[setCanHistoryGoBack]
|
|
1845
|
-
);
|
|
1846
2051
|
const userAgent = useCreateUserAgent({
|
|
1847
2052
|
colorPreference: "light"
|
|
1848
2053
|
});
|
|
1849
|
-
|
|
2054
|
+
const refs = mergeRefs(handler.ref, webViewRef);
|
|
2055
|
+
(0, import_react21.useEffect)(() => {
|
|
2056
|
+
const callback = () => {
|
|
2057
|
+
webBackHandler.handleWebBack();
|
|
2058
|
+
return true;
|
|
2059
|
+
};
|
|
2060
|
+
import_react_native30.BackHandler.addEventListener("hardwareBackPress", callback);
|
|
2061
|
+
return () => import_react_native30.BackHandler.removeEventListener("hardwareBackPress", callback);
|
|
2062
|
+
}, [webBackHandler]);
|
|
2063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1850
2064
|
BaseWebView,
|
|
1851
2065
|
{
|
|
1852
|
-
ref:
|
|
2066
|
+
ref: refs,
|
|
1853
2067
|
...props,
|
|
1854
2068
|
...headerPropForExternalWebView,
|
|
1855
2069
|
source: {
|
|
@@ -1859,16 +2073,23 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1859
2073
|
"User-Agent": userAgent
|
|
1860
2074
|
}
|
|
1861
2075
|
},
|
|
1862
|
-
|
|
2076
|
+
onHomeButtonClick: webBackHandler.handleWebHome,
|
|
2077
|
+
onBackButtonClick: webBackHandler.handleWebBack,
|
|
2078
|
+
onNavigationStateChange: (event) => {
|
|
2079
|
+
if (event.url) {
|
|
2080
|
+
trackScreen(event.url);
|
|
2081
|
+
}
|
|
2082
|
+
props.onNavigationStateChange?.(event);
|
|
2083
|
+
webBackHandler.onNavigationStateChange(event);
|
|
2084
|
+
},
|
|
2085
|
+
userAgent: import_react_native30.Platform.OS === "ios" ? userAgent : void 0,
|
|
1863
2086
|
sharedCookiesEnabled: true,
|
|
1864
2087
|
webviewDebuggingEnabled: webViewDebuggingEnabled,
|
|
1865
2088
|
thirdPartyCookiesEnabled: true,
|
|
1866
2089
|
onMessage: handler.onMessage,
|
|
1867
|
-
canHistoryGoBack,
|
|
1868
|
-
onNavigationStateChange: handleNavigationStateChange,
|
|
1869
2090
|
injectedJavaScript: handler.injectedJavaScript,
|
|
1870
2091
|
injectedJavaScriptBeforeContentLoaded: handler.injectedJavaScript,
|
|
1871
|
-
decelerationRate:
|
|
2092
|
+
decelerationRate: import_react_native30.Platform.OS === "ios" ? 1 : void 0,
|
|
1872
2093
|
allowsBackForwardNavigationGestures
|
|
1873
2094
|
}
|
|
1874
2095
|
);
|
|
@@ -1876,7 +2097,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1876
2097
|
|
|
1877
2098
|
// src/index.ts
|
|
1878
2099
|
__reExport(src_exports, require("@apps-in-toss/analytics"), module.exports);
|
|
1879
|
-
var
|
|
2100
|
+
var import_private9 = require("@toss/tds-react-native/private");
|
|
1880
2101
|
__reExport(src_exports, require("@apps-in-toss/native-modules"), module.exports);
|
|
1881
2102
|
__reExport(src_exports, require("@apps-in-toss/types"), module.exports);
|
|
1882
2103
|
var Analytics2 = {
|
|
@@ -1890,11 +2111,14 @@ var Analytics2 = {
|
|
|
1890
2111
|
Analytics,
|
|
1891
2112
|
AppsInToss,
|
|
1892
2113
|
INTERNAL__onVisibilityChangedByTransparentServiceWeb,
|
|
2114
|
+
OverlayProvider,
|
|
1893
2115
|
WebView,
|
|
1894
2116
|
env,
|
|
1895
2117
|
useCreateUserAgent,
|
|
1896
2118
|
useGeolocation,
|
|
2119
|
+
useOverlay,
|
|
1897
2120
|
useTopNavigation,
|
|
2121
|
+
useWaitForReturnNavigator,
|
|
1898
2122
|
...require("@apps-in-toss/analytics"),
|
|
1899
2123
|
...require("@apps-in-toss/native-modules"),
|
|
1900
2124
|
...require("@apps-in-toss/types")
|