@apps-in-toss/framework 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +489 -335
- package/dist/index.d.cts +3 -5
- package/dist/index.d.ts +3 -5
- package/dist/index.js +400 -237
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -38,17 +38,17 @@ __export(src_exports, {
|
|
|
38
38
|
env: () => env,
|
|
39
39
|
useCreateUserAgent: () => useCreateUserAgent,
|
|
40
40
|
useGeolocation: () => useGeolocation,
|
|
41
|
-
useTopNavigation: () =>
|
|
41
|
+
useTopNavigation: () => import_private9.useTopNavigation
|
|
42
42
|
});
|
|
43
43
|
module.exports = __toCommonJS(src_exports);
|
|
44
44
|
var import_analytics2 = require("@apps-in-toss/analytics");
|
|
45
45
|
|
|
46
46
|
// src/core/registerApp.tsx
|
|
47
47
|
var import_analytics = require("@apps-in-toss/analytics");
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
48
|
+
var import_native_modules9 = require("@apps-in-toss/native-modules");
|
|
49
|
+
var import_react_native15 = require("@granite-js/react-native");
|
|
50
|
+
var import_tds_react_native6 = require("@toss/tds-react-native");
|
|
51
|
+
var import_react_native16 = require("react-native");
|
|
52
52
|
|
|
53
53
|
// src/core/components/AppEvent.tsx
|
|
54
54
|
var import_native_modules2 = require("@apps-in-toss/native-modules");
|
|
@@ -193,7 +193,7 @@ function AppUpdate() {
|
|
|
193
193
|
|
|
194
194
|
// src/core/hooks/useAppsInTossBridge.ts
|
|
195
195
|
var import_native_modules3 = require("@apps-in-toss/native-modules");
|
|
196
|
-
var
|
|
196
|
+
var import_tds_react_native = require("@toss/tds-react-native");
|
|
197
197
|
var import_react5 = require("react");
|
|
198
198
|
|
|
199
199
|
// src/core/utils/getAppsInTossGlobals.ts
|
|
@@ -211,7 +211,7 @@ function toIcon(source) {
|
|
|
211
211
|
|
|
212
212
|
// src/core/hooks/useAppsInTossBridge.ts
|
|
213
213
|
function useAppsInTossBridge() {
|
|
214
|
-
const controller = (0,
|
|
214
|
+
const controller = (0, import_tds_react_native.useBridge)();
|
|
215
215
|
const appsInTossGlobals = getAppsInTossGlobals();
|
|
216
216
|
(0, import_react5.useEffect)(() => {
|
|
217
217
|
const commonProps = {
|
|
@@ -230,19 +230,19 @@ function useAppsInTossBridge() {
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
// src/components/NavigationBar/RNNavigationBar.tsx
|
|
233
|
-
var
|
|
234
|
-
var
|
|
235
|
-
var
|
|
233
|
+
var import_react_native13 = require("@granite-js/react-native");
|
|
234
|
+
var import_tds_react_native5 = require("@toss/tds-react-native");
|
|
235
|
+
var import_private3 = require("@toss/tds-react-native/private");
|
|
236
236
|
var import_es_hangul = require("es-hangul");
|
|
237
237
|
var import_react9 = require("react");
|
|
238
|
-
var
|
|
238
|
+
var import_react_native14 = require("react-native");
|
|
239
239
|
|
|
240
240
|
// src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
|
|
241
241
|
var import_react6 = require("react");
|
|
242
242
|
|
|
243
243
|
// src/components/NavigationBar/common/useNavigationBarLogging.tsx
|
|
244
244
|
var import_native_modules4 = require("@apps-in-toss/native-modules");
|
|
245
|
-
var
|
|
245
|
+
var import_react_native6 = require("@granite-js/react-native");
|
|
246
246
|
var NAVI_BAR_IMPRESSION_SCHEMA_ID = 1596837;
|
|
247
247
|
var NAVI_BAR_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__navigation_bar";
|
|
248
248
|
var CLOSE_POPUP_SHOW_SCHEMA_ID = 1644490;
|
|
@@ -257,7 +257,7 @@ function useNavigationBarLogging() {
|
|
|
257
257
|
const referrer = useReferrer();
|
|
258
258
|
const baseParams = {
|
|
259
259
|
referrer,
|
|
260
|
-
app_name:
|
|
260
|
+
app_name: import_react_native6.Granite.appName
|
|
261
261
|
};
|
|
262
262
|
const logNavBarImpression = (naviBarConfig) => {
|
|
263
263
|
import_native_modules4.INTERNAL__module.tossCoreEventLog({
|
|
@@ -342,15 +342,22 @@ function NavigationBarImpressionArea({
|
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
345
|
-
var
|
|
345
|
+
var import_native_modules8 = require("@apps-in-toss/native-modules");
|
|
346
346
|
var import_react_native12 = require("@granite-js/react-native");
|
|
347
|
-
var
|
|
348
|
-
var
|
|
347
|
+
var import_tds_react_native4 = require("@toss/tds-react-native");
|
|
348
|
+
var import_private2 = require("@toss/tds-react-native/private");
|
|
349
349
|
var import_react8 = require("react");
|
|
350
350
|
|
|
351
|
+
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
352
|
+
var import_native_modules6 = require("@apps-in-toss/native-modules");
|
|
353
|
+
var import_react_native8 = require("@granite-js/react-native");
|
|
354
|
+
var import_tds_react_native2 = require("@toss/tds-react-native");
|
|
355
|
+
var import_private = require("@toss/tds-react-native/private");
|
|
356
|
+
var import_react_native9 = require("react-native");
|
|
357
|
+
|
|
351
358
|
// src/core/hooks/useMoreButtonBottomSheet/useMoreButtonBottomSheetLogging.tsx
|
|
352
359
|
var import_native_modules5 = require("@apps-in-toss/native-modules");
|
|
353
|
-
var
|
|
360
|
+
var import_react_native7 = require("@granite-js/react-native");
|
|
354
361
|
var BOTTOM_SHEET_SCHEMA_ID = 1596825;
|
|
355
362
|
var BOTTOM_SHEET_LOG_NAME = "appsintoss_app_visit__common_module::bottomsheet__more";
|
|
356
363
|
var BOTTOM_SHEET_OPEN_SCHEMA_ID = 1596829;
|
|
@@ -363,7 +370,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
363
370
|
const referrer = useReferrer();
|
|
364
371
|
const baseParams = {
|
|
365
372
|
referrer,
|
|
366
|
-
app_name:
|
|
373
|
+
app_name: import_react_native7.Granite.appName
|
|
367
374
|
};
|
|
368
375
|
const logBottomSheetShow = () => {
|
|
369
376
|
import_native_modules5.INTERNAL__module.tossCoreEventLog({
|
|
@@ -417,23 +424,90 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
417
424
|
};
|
|
418
425
|
}
|
|
419
426
|
|
|
427
|
+
// src/core/utils/url.ts
|
|
428
|
+
function addParamsToUrl(url, params) {
|
|
429
|
+
const urlObj = new URL(url);
|
|
430
|
+
for (const [key, value] of Object.entries(params)) {
|
|
431
|
+
urlObj.searchParams.set(key, value);
|
|
432
|
+
}
|
|
433
|
+
return urlObj.toString();
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
437
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
438
|
+
var SHARE_SCHEME_REFERRER = "appsintoss.common_module_share";
|
|
439
|
+
var APP_SHARE_MENU_INFO = {
|
|
440
|
+
contactItemName: "\uACF5\uC720\uD558\uAE30",
|
|
441
|
+
contactIconUrl: "https://static.toss.im/icons/png/4x/icon-share-dots-mono.png"
|
|
442
|
+
};
|
|
443
|
+
function AppShareListMenu() {
|
|
444
|
+
const globals = getAppsInTossGlobals();
|
|
445
|
+
const adaptive = (0, import_private.useAdaptive)();
|
|
446
|
+
const logging = useMoreButtonBottomSheetLogging();
|
|
447
|
+
const initialScheme = (0, import_react_native8.getSchemeUri)();
|
|
448
|
+
const isSandbox = (0, import_native_modules6.getOperationalEnvironment)() === "sandbox";
|
|
449
|
+
const { openConfirm } = (0, import_tds_react_native2.useDialog)();
|
|
450
|
+
const schemeForShare = addParamsToUrl(initialScheme, {
|
|
451
|
+
referrer: SHARE_SCHEME_REFERRER
|
|
452
|
+
});
|
|
453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
454
|
+
import_tds_react_native2.ListRow,
|
|
455
|
+
{
|
|
456
|
+
left: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
457
|
+
import_tds_react_native2.ListRow.Icon,
|
|
458
|
+
{
|
|
459
|
+
color: globals.brandPrimaryColor,
|
|
460
|
+
source: { uri: APP_SHARE_MENU_INFO.contactIconUrl },
|
|
461
|
+
type: "background"
|
|
462
|
+
}
|
|
463
|
+
),
|
|
464
|
+
contents: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
465
|
+
import_tds_react_native2.ListRow.Texts,
|
|
466
|
+
{
|
|
467
|
+
type: "1RowTypeA",
|
|
468
|
+
top: APP_SHARE_MENU_INFO.contactItemName,
|
|
469
|
+
topProps: { color: adaptive.grey700 }
|
|
470
|
+
}
|
|
471
|
+
),
|
|
472
|
+
verticalPadding: "extraSmall",
|
|
473
|
+
onPress: () => {
|
|
474
|
+
if (isSandbox) {
|
|
475
|
+
openConfirm({
|
|
476
|
+
title: "\uACF5\uC720\uD558\uAE30 \uAE30\uB2A5 \uBBF8\uC9C0\uC6D0",
|
|
477
|
+
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.",
|
|
478
|
+
rightButton: "\uD655\uC778",
|
|
479
|
+
closeOnDimmerClick: true
|
|
480
|
+
});
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
logging.menuClick({ title: APP_SHARE_MENU_INFO.contactItemName });
|
|
484
|
+
import_react_native9.NativeModules.AppsInTossModule.shareWithScheme({
|
|
485
|
+
params: {
|
|
486
|
+
schemeURL: schemeForShare
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
|
|
420
494
|
// src/hooks/useAppUpdateDialog.tsx
|
|
421
|
-
var
|
|
422
|
-
var
|
|
423
|
-
var
|
|
495
|
+
var import_native_modules7 = require("@apps-in-toss/native-modules");
|
|
496
|
+
var import_react_native11 = require("@granite-js/react-native");
|
|
497
|
+
var import_tds_react_native3 = require("@toss/tds-react-native");
|
|
424
498
|
var import_react7 = require("react");
|
|
425
499
|
|
|
426
500
|
// src/utils/market.ts
|
|
427
|
-
var
|
|
501
|
+
var import_react_native10 = require("react-native");
|
|
428
502
|
var PLAYSTORE_LINK = "https://play.google.com/store/apps/details?id=viva.republica.toss";
|
|
429
503
|
var APPSTORE_LINK = "https://itunes.apple.com/app/id839333328";
|
|
430
504
|
var getMarketLink = () => {
|
|
431
|
-
return
|
|
505
|
+
return import_react_native10.Platform.OS === "android" ? PLAYSTORE_LINK : APPSTORE_LINK;
|
|
432
506
|
};
|
|
433
507
|
|
|
434
508
|
// src/hooks/useAppUpdateDialog.tsx
|
|
435
509
|
function useAppUpdateDialog() {
|
|
436
|
-
const { openConfirm } = (0,
|
|
510
|
+
const { openConfirm } = (0, import_tds_react_native3.useDialog)();
|
|
437
511
|
const logging = useAppUpdateDialogLogging();
|
|
438
512
|
const openAppUpdateDialog = (0, import_react7.useCallback)(
|
|
439
513
|
async ({
|
|
@@ -456,7 +530,7 @@ function useAppUpdateDialog() {
|
|
|
456
530
|
}
|
|
457
531
|
logging.update();
|
|
458
532
|
const STORE_SCHEME = getMarketLink();
|
|
459
|
-
(0,
|
|
533
|
+
(0, import_react_native11.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
|
|
460
534
|
},
|
|
461
535
|
[logging, openConfirm]
|
|
462
536
|
);
|
|
@@ -472,10 +546,10 @@ function useAppUpdateDialogLogging() {
|
|
|
472
546
|
const referrer = useReferrer();
|
|
473
547
|
const baseParams = {
|
|
474
548
|
referrer,
|
|
475
|
-
app_name:
|
|
549
|
+
app_name: import_react_native11.Granite.appName
|
|
476
550
|
};
|
|
477
551
|
const logUpdateClick = () => {
|
|
478
|
-
|
|
552
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
479
553
|
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
480
554
|
log_type: "event",
|
|
481
555
|
params: {
|
|
@@ -487,7 +561,7 @@ function useAppUpdateDialogLogging() {
|
|
|
487
561
|
});
|
|
488
562
|
};
|
|
489
563
|
const logCloseClick = () => {
|
|
490
|
-
|
|
564
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
491
565
|
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
492
566
|
log_type: "event",
|
|
493
567
|
params: {
|
|
@@ -499,7 +573,7 @@ function useAppUpdateDialogLogging() {
|
|
|
499
573
|
});
|
|
500
574
|
};
|
|
501
575
|
const logDialogShow = () => {
|
|
502
|
-
|
|
576
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
503
577
|
log_name: UPDATE_DIALOG_LOG_NAME,
|
|
504
578
|
log_type: "popup",
|
|
505
579
|
params: {
|
|
@@ -520,25 +594,33 @@ function ensureValue(value, name) {
|
|
|
520
594
|
}
|
|
521
595
|
|
|
522
596
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
523
|
-
var
|
|
597
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
524
598
|
var APP_BRIDGE_METHOD_NAME = "getMiniAppsSupportContact";
|
|
599
|
+
var MIN_VERSION = {
|
|
600
|
+
BOTTOM_SHEET: {
|
|
601
|
+
android: "5.226.0",
|
|
602
|
+
ios: "5.226.0"
|
|
603
|
+
},
|
|
604
|
+
SHARE_LIST_MENU: {
|
|
605
|
+
android: "5.230.0",
|
|
606
|
+
ios: "5.230.0"
|
|
607
|
+
}
|
|
608
|
+
};
|
|
525
609
|
function useMoreButtonBottomSheet() {
|
|
526
610
|
const globals = getAppsInTossGlobals();
|
|
527
|
-
const adaptive = (0,
|
|
611
|
+
const adaptive = (0, import_private2.useAdaptive)();
|
|
528
612
|
const [itemList, setItemList] = (0, import_react8.useState)([]);
|
|
529
613
|
const appUpdateDialog = useAppUpdateDialog();
|
|
530
614
|
const logging = useMoreButtonBottomSheetLogging();
|
|
531
|
-
const overlay = (0,
|
|
615
|
+
const overlay = (0, import_private2.useOverlay)();
|
|
532
616
|
const title = ensureValue(globals.brandDisplayName, "displayName");
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
ios: "5.226.0"
|
|
536
|
-
});
|
|
617
|
+
const isBottomSheetSupported = (0, import_native_modules8.isMinVersionSupported)(MIN_VERSION.BOTTOM_SHEET);
|
|
618
|
+
const isShareListMenuSupported = (0, import_native_modules8.isMinVersionSupported)(MIN_VERSION.SHARE_LIST_MENU);
|
|
537
619
|
(0, import_react8.useEffect)(() => {
|
|
538
|
-
if (!
|
|
620
|
+
if (!isBottomSheetSupported) {
|
|
539
621
|
return;
|
|
540
622
|
}
|
|
541
|
-
|
|
623
|
+
import_native_modules8.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
542
624
|
APP_BRIDGE_METHOD_NAME,
|
|
543
625
|
{},
|
|
544
626
|
{
|
|
@@ -546,10 +628,10 @@ function useMoreButtonBottomSheet() {
|
|
|
546
628
|
onError: (error) => console.error("\uBA54\uB274 \uBAA9\uB85D\uC744 \uAC00\uC838\uC624\uB294 \uB370 \uC2E4\uD328\uD588\uC5B4\uC694:", error)
|
|
547
629
|
}
|
|
548
630
|
);
|
|
549
|
-
}, [
|
|
631
|
+
}, [isBottomSheetSupported]);
|
|
550
632
|
const onClickHandler = async () => {
|
|
551
633
|
logging.open();
|
|
552
|
-
if (!
|
|
634
|
+
if (!isBottomSheetSupported) {
|
|
553
635
|
await appUpdateDialog.open({
|
|
554
636
|
title: `\uC774 \uAE30\uB2A5\uC744 \uC4F0\uB824\uBA74 \uC571 \uC5C5\uB370\uC774\uD2B8\uAC00 \uD544\uC694\uD574\uC694`,
|
|
555
637
|
description: `\uBB38\uC758, \uAD8C\uD55C \uC124\uC815, \uC2E0\uACE0 \uB4F1 \uAE30\uB2A5\uC744 \uC4F8 \uC218 \uC788\uC5B4\uC694`
|
|
@@ -561,18 +643,18 @@ function useMoreButtonBottomSheet() {
|
|
|
561
643
|
logging.close();
|
|
562
644
|
close();
|
|
563
645
|
};
|
|
564
|
-
return /* @__PURE__ */ (0,
|
|
565
|
-
|
|
646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(BottomSheetImpressionArea, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
647
|
+
import_tds_react_native4.BottomSheet.Root,
|
|
566
648
|
{
|
|
567
|
-
header: /* @__PURE__ */ (0,
|
|
568
|
-
|
|
649
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
650
|
+
import_tds_react_native4.ListHeader,
|
|
569
651
|
{
|
|
570
|
-
title: /* @__PURE__ */ (0,
|
|
652
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_tds_react_native4.ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
|
|
571
653
|
}
|
|
572
654
|
),
|
|
573
655
|
open: isOpen,
|
|
574
|
-
cta: /* @__PURE__ */ (0,
|
|
575
|
-
|
|
656
|
+
cta: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
657
|
+
import_tds_react_native4.BottomSheet.CTA,
|
|
576
658
|
{
|
|
577
659
|
size: "large",
|
|
578
660
|
type: "dark",
|
|
@@ -585,35 +667,38 @@ function useMoreButtonBottomSheet() {
|
|
|
585
667
|
),
|
|
586
668
|
onClose: handleClose,
|
|
587
669
|
onExited: exit,
|
|
588
|
-
children: /* @__PURE__ */ (0,
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
670
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_tds_react_native4.List, { rowSeparator: "none", children: [
|
|
671
|
+
itemList.map((item) => {
|
|
672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
673
|
+
import_tds_react_native4.ListRow,
|
|
674
|
+
{
|
|
675
|
+
left: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
676
|
+
import_tds_react_native4.ListRow.Icon,
|
|
677
|
+
{
|
|
678
|
+
color: globals.brandPrimaryColor,
|
|
679
|
+
source: { uri: item.contactIconUrl },
|
|
680
|
+
type: "background"
|
|
681
|
+
}
|
|
682
|
+
),
|
|
683
|
+
contents: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
684
|
+
import_tds_react_native4.ListRow.Texts,
|
|
685
|
+
{
|
|
686
|
+
type: "1RowTypeA",
|
|
687
|
+
top: item.contactItemName,
|
|
688
|
+
topProps: { color: adaptive.grey700 }
|
|
689
|
+
}
|
|
690
|
+
),
|
|
691
|
+
verticalPadding: "extraSmall",
|
|
692
|
+
onPress: () => {
|
|
693
|
+
logging.menuClick({ title: item.contactItemName });
|
|
694
|
+
(0, import_react_native12.openURL)(item.contactUri);
|
|
606
695
|
}
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
},
|
|
614
|
-
item.contactItemName
|
|
615
|
-
);
|
|
616
|
-
}) })
|
|
696
|
+
},
|
|
697
|
+
item.contactItemName
|
|
698
|
+
);
|
|
699
|
+
}),
|
|
700
|
+
isShareListMenuSupported && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AppShareListMenu, {})
|
|
701
|
+
] })
|
|
617
702
|
}
|
|
618
703
|
) });
|
|
619
704
|
});
|
|
@@ -625,7 +710,7 @@ function BottomSheetImpressionArea({ children }) {
|
|
|
625
710
|
(0, import_react8.useEffect)(() => {
|
|
626
711
|
logging.show();
|
|
627
712
|
}, [logging]);
|
|
628
|
-
return /* @__PURE__ */ (0,
|
|
713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
|
|
629
714
|
}
|
|
630
715
|
|
|
631
716
|
// src/core/utils/safeParseNavigationBar.ts
|
|
@@ -641,20 +726,20 @@ function safeParseNavigationBar(navigationBar) {
|
|
|
641
726
|
}
|
|
642
727
|
|
|
643
728
|
// src/components/NavigationBar/RNNavigationBar.tsx
|
|
644
|
-
var
|
|
729
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
645
730
|
function RNNavigationBar() {
|
|
646
731
|
const globals = getAppsInTossGlobals();
|
|
647
732
|
const { captureExitLog } = useCaptureExitLog();
|
|
648
733
|
const logging = useNavigationBarLogging();
|
|
649
|
-
const { openConfirm } = (0,
|
|
734
|
+
const { openConfirm } = (0, import_tds_react_native5.useDialog)();
|
|
650
735
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
651
736
|
const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
|
|
652
737
|
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
653
738
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
654
739
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
655
|
-
const backEventContext = (0,
|
|
740
|
+
const backEventContext = (0, import_react_native13.useBackEventContext)();
|
|
656
741
|
const handleBackOrClose = useBackOrCloseNavigation();
|
|
657
|
-
const navigation = (0,
|
|
742
|
+
const navigation = (0, import_react_native13.useNavigation)();
|
|
658
743
|
const handlePressTitle = (0, import_react9.useCallback)(() => {
|
|
659
744
|
logging.homeButtonClick();
|
|
660
745
|
navigation.navigate("/");
|
|
@@ -671,7 +756,7 @@ function RNNavigationBar() {
|
|
|
671
756
|
logging.closePopupCtaClick(isConfirmed);
|
|
672
757
|
if (isConfirmed) {
|
|
673
758
|
captureExitLog(Date.now());
|
|
674
|
-
(0,
|
|
759
|
+
(0, import_react_native13.closeView)();
|
|
675
760
|
}
|
|
676
761
|
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
677
762
|
const handleBack = (0, import_react9.useCallback)(() => {
|
|
@@ -686,13 +771,13 @@ function RNNavigationBar() {
|
|
|
686
771
|
handleBack();
|
|
687
772
|
return true;
|
|
688
773
|
};
|
|
689
|
-
|
|
774
|
+
import_react_native14.BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
690
775
|
return () => {
|
|
691
|
-
|
|
776
|
+
import_react_native14.BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
692
777
|
};
|
|
693
778
|
}, [handleBack]);
|
|
694
|
-
return /* @__PURE__ */ (0,
|
|
695
|
-
|
|
779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
780
|
+
import_private3.TopNavigation,
|
|
696
781
|
{
|
|
697
782
|
title: globals.brandDisplayName,
|
|
698
783
|
icon: toIcon(globals.brandIcon),
|
|
@@ -706,59 +791,59 @@ function RNNavigationBar() {
|
|
|
706
791
|
icon: initialAccessoryButton.icon,
|
|
707
792
|
id: initialAccessoryButton.id
|
|
708
793
|
} : void 0,
|
|
709
|
-
children: /* @__PURE__ */ (0,
|
|
794
|
+
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
795
|
}
|
|
711
796
|
) });
|
|
712
797
|
}
|
|
713
798
|
function useBackOrCloseNavigation() {
|
|
714
|
-
const navigation = (0,
|
|
799
|
+
const navigation = (0, import_react_native13.useNavigation)();
|
|
715
800
|
const { captureExitLog } = useCaptureExitLog();
|
|
716
801
|
return (0, import_react9.useCallback)(() => {
|
|
717
802
|
if (navigation.canGoBack()) {
|
|
718
803
|
navigation.goBack();
|
|
719
804
|
} else {
|
|
720
805
|
captureExitLog(Date.now());
|
|
721
|
-
(0,
|
|
806
|
+
(0, import_react_native13.closeView)();
|
|
722
807
|
}
|
|
723
808
|
}, [captureExitLog, navigation]);
|
|
724
809
|
}
|
|
725
810
|
|
|
726
811
|
// src/core/registerApp.tsx
|
|
727
|
-
var
|
|
812
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
728
813
|
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
729
|
-
if (!(0,
|
|
814
|
+
if (!(0, import_native_modules9.isMinVersionSupported)({
|
|
730
815
|
android: "5.220.0",
|
|
731
816
|
ios: "5.221.0"
|
|
732
817
|
})) {
|
|
733
|
-
return /* @__PURE__ */ (0,
|
|
734
|
-
/* @__PURE__ */ (0,
|
|
735
|
-
/* @__PURE__ */ (0,
|
|
736
|
-
/* @__PURE__ */ (0,
|
|
818
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
819
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.Entry, {}),
|
|
820
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.System, { ...initialProps }),
|
|
821
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppUpdate, {})
|
|
737
822
|
] });
|
|
738
823
|
}
|
|
739
|
-
return /* @__PURE__ */ (0,
|
|
740
|
-
/* @__PURE__ */ (0,
|
|
741
|
-
/* @__PURE__ */ (0,
|
|
742
|
-
/* @__PURE__ */ (0,
|
|
743
|
-
/* @__PURE__ */ (0,
|
|
824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
825
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.StayTime, {}),
|
|
826
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.Entry, {}),
|
|
827
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.System, { ...initialProps }),
|
|
828
|
+
/* @__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
829
|
] });
|
|
745
830
|
}
|
|
746
831
|
function TDSContainer({ children }) {
|
|
747
832
|
useAppsInTossBridge();
|
|
748
|
-
return /* @__PURE__ */ (0,
|
|
833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children });
|
|
749
834
|
}
|
|
750
835
|
function registerApp(container, { context, analytics }) {
|
|
751
836
|
const appName = getAppName();
|
|
752
|
-
const isRegistered =
|
|
837
|
+
const isRegistered = import_react_native16.AppRegistry.getAppKeys().includes(appName);
|
|
753
838
|
if (!isRegistered) {
|
|
754
839
|
import_analytics.Analytics.init({
|
|
755
|
-
logger: (params) => void (0,
|
|
840
|
+
logger: (params) => void (0, import_native_modules9.eventLog)(params),
|
|
756
841
|
debug: analytics?.debug ?? __DEV__
|
|
757
842
|
});
|
|
758
|
-
const App =
|
|
843
|
+
const App = import_react_native15.Granite.registerApp(AppsInTossContainer.bind(null, container), {
|
|
759
844
|
appName,
|
|
760
845
|
context,
|
|
761
|
-
setIosSwipeGestureEnabled:
|
|
846
|
+
setIosSwipeGestureEnabled: import_native_modules9.setIosSwipeGestureEnabled,
|
|
762
847
|
router: {
|
|
763
848
|
screenContainer: AppsInTossScreenContainer,
|
|
764
849
|
defaultScreenOption: {
|
|
@@ -772,8 +857,8 @@ function registerApp(container, { context, analytics }) {
|
|
|
772
857
|
}
|
|
773
858
|
function AppsInTossScreenContainer({ children }) {
|
|
774
859
|
const isReactNativeService = getAppsInTossGlobals().webViewType == null;
|
|
775
|
-
return /* @__PURE__ */ (0,
|
|
776
|
-
isReactNativeService && /* @__PURE__ */ (0,
|
|
860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_analytics.Analytics.Screen, { children: [
|
|
861
|
+
isReactNativeService && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RNNavigationBar, {}),
|
|
777
862
|
children
|
|
778
863
|
] });
|
|
779
864
|
}
|
|
@@ -796,25 +881,23 @@ var import_native_modules18 = require("@apps-in-toss/native-modules");
|
|
|
796
881
|
var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async-bridges"), 1);
|
|
797
882
|
var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
|
|
798
883
|
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");
|
|
884
|
+
var import_react_native28 = require("@granite-js/react-native");
|
|
885
|
+
var import_tds_react_native12 = require("@toss/tds-react-native");
|
|
886
|
+
var import_private8 = require("@toss/tds-react-native/private");
|
|
887
|
+
var import_react19 = require("react");
|
|
888
|
+
var import_react_native29 = require("react-native");
|
|
806
889
|
|
|
807
890
|
// src/components/GameWebView.tsx
|
|
808
|
-
var
|
|
891
|
+
var import_native_modules13 = require("@apps-in-toss/native-modules");
|
|
809
892
|
var import_react_native_webview = require("@granite-js/native/react-native-webview");
|
|
810
893
|
var import_react13 = require("react");
|
|
811
|
-
var
|
|
894
|
+
var import_react_native22 = require("react-native");
|
|
812
895
|
|
|
813
896
|
// src/components/GameProfile.tsx
|
|
814
|
-
var
|
|
815
|
-
var
|
|
897
|
+
var import_native_modules12 = require("@apps-in-toss/native-modules");
|
|
898
|
+
var import_tds_react_native9 = require("@toss/tds-react-native");
|
|
816
899
|
var import_react11 = require("react");
|
|
817
|
-
var
|
|
900
|
+
var import_react_native19 = require("react-native");
|
|
818
901
|
|
|
819
902
|
// src/constant/game-center.ts
|
|
820
903
|
var GAME_PROFILE_WEBVIEW_URL = "servicetoss://game-center/profile";
|
|
@@ -824,23 +907,23 @@ var GAME_CENTER_MIN_VERSION = {
|
|
|
824
907
|
};
|
|
825
908
|
|
|
826
909
|
// src/hooks/useGameCenterProfile.ts
|
|
827
|
-
var
|
|
828
|
-
var
|
|
829
|
-
var
|
|
910
|
+
var import_native_modules11 = require("@apps-in-toss/native-modules");
|
|
911
|
+
var import_react_native18 = require("@granite-js/react-native");
|
|
912
|
+
var import_tds_react_native8 = require("@toss/tds-react-native");
|
|
830
913
|
var import_es_hangul2 = require("es-hangul");
|
|
831
914
|
var import_react10 = require("react");
|
|
832
915
|
|
|
833
916
|
// src/components/GameProfileToast.tsx
|
|
834
|
-
var
|
|
835
|
-
var
|
|
836
|
-
var
|
|
917
|
+
var import_tds_react_native7 = require("@toss/tds-react-native");
|
|
918
|
+
var import_private4 = require("@toss/tds-react-native/private");
|
|
919
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
837
920
|
var useGameProfileToast = () => {
|
|
838
|
-
const overlay = (0,
|
|
921
|
+
const overlay = (0, import_private4.useOverlay)();
|
|
839
922
|
const openGameProfileToast = (nickname, profileImageUri) => {
|
|
840
923
|
return new Promise((resolve) => {
|
|
841
924
|
overlay.open(({ isOpen, close, exit }) => {
|
|
842
|
-
return /* @__PURE__ */ (0,
|
|
843
|
-
|
|
925
|
+
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)(
|
|
926
|
+
import_tds_react_native7.Toast,
|
|
844
927
|
{
|
|
845
928
|
open: isOpen,
|
|
846
929
|
onClose: () => {
|
|
@@ -850,11 +933,11 @@ var useGameProfileToast = () => {
|
|
|
850
933
|
onExited: exit,
|
|
851
934
|
position: "top",
|
|
852
935
|
text: `${nickname}\uB2D8 \uBC18\uAC00\uC6CC\uC694!`,
|
|
853
|
-
icon: /* @__PURE__ */ (0,
|
|
854
|
-
|
|
936
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
937
|
+
import_tds_react_native7.Asset.Image,
|
|
855
938
|
{
|
|
856
939
|
style: { borderRadius: 64, overflow: "hidden" },
|
|
857
|
-
frameShape:
|
|
940
|
+
frameShape: import_tds_react_native7.Asset.frameShape.CleanW32,
|
|
858
941
|
source: { uri: profileImageUri }
|
|
859
942
|
}
|
|
860
943
|
)
|
|
@@ -873,11 +956,11 @@ var DEFAULT_ERROR = {
|
|
|
873
956
|
};
|
|
874
957
|
|
|
875
958
|
// src/utils/openTransparentWebView.ts
|
|
876
|
-
var
|
|
959
|
+
var import_react_native17 = require("@granite-js/react-native");
|
|
877
960
|
|
|
878
961
|
// src/private.ts
|
|
879
|
-
var
|
|
880
|
-
var INTERNAL__onVisibilityChangedByTransparentServiceWeb =
|
|
962
|
+
var import_native_modules10 = require("@apps-in-toss/native-modules");
|
|
963
|
+
var INTERNAL__onVisibilityChangedByTransparentServiceWeb = import_native_modules10.onVisibilityChangedByTransparentServiceWeb;
|
|
881
964
|
|
|
882
965
|
// src/utils/openTransparentWebView.ts
|
|
883
966
|
var openTransparentWebView = ({
|
|
@@ -907,7 +990,7 @@ var openTransparentWebView = ({
|
|
|
907
990
|
}
|
|
908
991
|
}
|
|
909
992
|
});
|
|
910
|
-
(0,
|
|
993
|
+
(0, import_react_native17.openURL)(url.toString());
|
|
911
994
|
};
|
|
912
995
|
|
|
913
996
|
// src/hooks/useGameCenterProfile.ts
|
|
@@ -920,14 +1003,14 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
920
1003
|
const canShowBottomSheetOrToast = !isProfileDataLoading && isReadyForProfileUI;
|
|
921
1004
|
const [isWebviewLoading, setIsWebviewLoading] = (0, import_react10.useState)(false);
|
|
922
1005
|
const isCompletedProfileFlow = (0, import_react10.useRef)(false);
|
|
923
|
-
const { openAlert, openConfirm } = (0,
|
|
1006
|
+
const { openAlert, openConfirm } = (0, import_tds_react_native8.useDialog)();
|
|
924
1007
|
const { openGameProfileToast } = useGameProfileToast();
|
|
925
1008
|
const openErrorAlert = (0, import_react10.useCallback)(async () => {
|
|
926
1009
|
await openAlert({
|
|
927
1010
|
title: DEFAULT_ERROR.title,
|
|
928
1011
|
description: DEFAULT_ERROR.description
|
|
929
1012
|
});
|
|
930
|
-
(0,
|
|
1013
|
+
(0, import_react_native18.closeView)();
|
|
931
1014
|
}, [openAlert]);
|
|
932
1015
|
const openProfileWebview = (0, import_react10.useCallback)(() => {
|
|
933
1016
|
if (isWebviewLoading) {
|
|
@@ -941,7 +1024,7 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
941
1024
|
try {
|
|
942
1025
|
setIsWebviewLoading(false);
|
|
943
1026
|
setIsProfileDataRefetching(true);
|
|
944
|
-
const data = await (0,
|
|
1027
|
+
const data = await (0, import_native_modules11.getGameCenterGameProfile)();
|
|
945
1028
|
setProfileData(data);
|
|
946
1029
|
setIsProfileDataRefetching(false);
|
|
947
1030
|
if (data?.statusCode === "SUCCESS") {
|
|
@@ -972,11 +1055,11 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
972
1055
|
closeOnDimmerClick: true
|
|
973
1056
|
});
|
|
974
1057
|
if (!isConfirmed) {
|
|
975
|
-
(0,
|
|
1058
|
+
(0, import_react_native18.closeView)();
|
|
976
1059
|
return;
|
|
977
1060
|
}
|
|
978
1061
|
const STORE_SCHEME = getMarketLink();
|
|
979
|
-
(0,
|
|
1062
|
+
(0, import_react_native18.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
|
|
980
1063
|
}, [openConfirm]);
|
|
981
1064
|
return {
|
|
982
1065
|
profileData,
|
|
@@ -1005,7 +1088,7 @@ var Z_INDEX = {
|
|
|
1005
1088
|
};
|
|
1006
1089
|
|
|
1007
1090
|
// src/components/GameProfile.tsx
|
|
1008
|
-
var
|
|
1091
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1009
1092
|
var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
1010
1093
|
const {
|
|
1011
1094
|
profileData,
|
|
@@ -1024,7 +1107,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1024
1107
|
(0, import_react11.useEffect)(() => {
|
|
1025
1108
|
try {
|
|
1026
1109
|
const getProfileData = async () => {
|
|
1027
|
-
const data = await (0,
|
|
1110
|
+
const data = await (0, import_native_modules12.getGameCenterGameProfile)();
|
|
1028
1111
|
setProfileData(data);
|
|
1029
1112
|
setIsProfileDataLoading(false);
|
|
1030
1113
|
};
|
|
@@ -1043,7 +1126,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1043
1126
|
return;
|
|
1044
1127
|
}
|
|
1045
1128
|
isCompletedProfileFlow.current = true;
|
|
1046
|
-
if (!(0,
|
|
1129
|
+
if (!(0, import_native_modules12.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
|
|
1047
1130
|
updateAppToSupportedMinVersion();
|
|
1048
1131
|
return;
|
|
1049
1132
|
}
|
|
@@ -1064,11 +1147,11 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1064
1147
|
profileData,
|
|
1065
1148
|
updateAppToSupportedMinVersion
|
|
1066
1149
|
]);
|
|
1067
|
-
if (!(0,
|
|
1068
|
-
return /* @__PURE__ */ (0,
|
|
1069
|
-
/* @__PURE__ */ (0,
|
|
1070
|
-
/* @__PURE__ */ (0,
|
|
1071
|
-
|
|
1150
|
+
if (!(0, import_native_modules12.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
|
|
1151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1152
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native19.View, { style: { flex: 1, position: "relative" }, children }),
|
|
1153
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1154
|
+
import_react_native19.Pressable,
|
|
1072
1155
|
{
|
|
1073
1156
|
style: {
|
|
1074
1157
|
...overlayStyle
|
|
@@ -1081,10 +1164,10 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1081
1164
|
] });
|
|
1082
1165
|
}
|
|
1083
1166
|
if (shouldShowLoadingOverlay || isProfileDataRefetching) {
|
|
1084
|
-
return /* @__PURE__ */ (0,
|
|
1085
|
-
/* @__PURE__ */ (0,
|
|
1086
|
-
/* @__PURE__ */ (0,
|
|
1087
|
-
|
|
1167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1168
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native19.View, { style: { flex: 1, position: "relative" }, children }),
|
|
1169
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1170
|
+
import_react_native19.View,
|
|
1088
1171
|
{
|
|
1089
1172
|
style: {
|
|
1090
1173
|
...overlayStyle,
|
|
@@ -1092,16 +1175,16 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1092
1175
|
alignItems: "center",
|
|
1093
1176
|
backgroundColor: "rgba(0, 0, 0, 0.2)"
|
|
1094
1177
|
},
|
|
1095
|
-
children: /* @__PURE__ */ (0,
|
|
1178
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tds_react_native9.Loader, { size: "large", type: "light" })
|
|
1096
1179
|
}
|
|
1097
1180
|
)
|
|
1098
1181
|
] });
|
|
1099
1182
|
}
|
|
1100
1183
|
if (shouldShowProfileNotFoundOverlay) {
|
|
1101
|
-
return /* @__PURE__ */ (0,
|
|
1102
|
-
/* @__PURE__ */ (0,
|
|
1103
|
-
shouldShowProfileNotFoundOverlay && /* @__PURE__ */ (0,
|
|
1104
|
-
|
|
1184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1185
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native19.View, { style: { flex: 1, position: "relative" }, children }),
|
|
1186
|
+
shouldShowProfileNotFoundOverlay && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1187
|
+
import_react_native19.Pressable,
|
|
1105
1188
|
{
|
|
1106
1189
|
style: {
|
|
1107
1190
|
...overlayStyle
|
|
@@ -1113,7 +1196,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1113
1196
|
)
|
|
1114
1197
|
] });
|
|
1115
1198
|
}
|
|
1116
|
-
return /* @__PURE__ */ (0,
|
|
1199
|
+
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
1200
|
};
|
|
1118
1201
|
var overlayStyle = {
|
|
1119
1202
|
position: "absolute",
|
|
@@ -1125,16 +1208,16 @@ var overlayStyle = {
|
|
|
1125
1208
|
};
|
|
1126
1209
|
|
|
1127
1210
|
// src/components/NavigationBar/GameWebviewNavigationBar.tsx
|
|
1128
|
-
var
|
|
1129
|
-
var
|
|
1130
|
-
var
|
|
1211
|
+
var import_react_native20 = require("@granite-js/react-native");
|
|
1212
|
+
var import_tds_react_native10 = require("@toss/tds-react-native");
|
|
1213
|
+
var import_private6 = require("@toss/tds-react-native/private");
|
|
1131
1214
|
var import_es_hangul3 = require("es-hangul");
|
|
1132
1215
|
var import_react12 = require("react");
|
|
1133
|
-
var
|
|
1134
|
-
var
|
|
1216
|
+
var import_react_native21 = require("react-native");
|
|
1217
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1135
1218
|
function GameWebviewNavigationBar() {
|
|
1136
|
-
const safeAreaTop = (0,
|
|
1137
|
-
const { openConfirm } = (0,
|
|
1219
|
+
const safeAreaTop = (0, import_private6.useSafeAreaTop)();
|
|
1220
|
+
const { openConfirm } = (0, import_tds_react_native10.useDialog)();
|
|
1138
1221
|
const { captureExitLog } = useCaptureExitLog();
|
|
1139
1222
|
const global2 = getAppsInTossGlobals();
|
|
1140
1223
|
const logging = useNavigationBarLogging();
|
|
@@ -1152,7 +1235,7 @@ function GameWebviewNavigationBar() {
|
|
|
1152
1235
|
logging.closePopupCtaClick(isConfirmed);
|
|
1153
1236
|
if (isConfirmed) {
|
|
1154
1237
|
captureExitLog(Date.now());
|
|
1155
|
-
(0,
|
|
1238
|
+
(0, import_react_native20.closeView)();
|
|
1156
1239
|
}
|
|
1157
1240
|
}, [captureExitLog, global2.brandDisplayName, logging, openConfirm]);
|
|
1158
1241
|
(0, import_react12.useEffect)(() => {
|
|
@@ -1160,18 +1243,18 @@ function GameWebviewNavigationBar() {
|
|
|
1160
1243
|
handleGameWebviewClose();
|
|
1161
1244
|
return true;
|
|
1162
1245
|
};
|
|
1163
|
-
|
|
1164
|
-
return () =>
|
|
1246
|
+
import_react_native21.BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
1247
|
+
return () => import_react_native21.BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
1165
1248
|
}, [handleGameWebviewClose]);
|
|
1166
|
-
return /* @__PURE__ */ (0,
|
|
1167
|
-
/* @__PURE__ */ (0,
|
|
1168
|
-
/* @__PURE__ */ (0,
|
|
1169
|
-
|
|
1249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1250
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_tds_react_native10.PageNavbar, { preference: { type: "none" } }),
|
|
1251
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1252
|
+
import_react_native21.View,
|
|
1170
1253
|
{
|
|
1171
1254
|
style: {
|
|
1172
1255
|
width: "100%",
|
|
1173
1256
|
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1174
|
-
height:
|
|
1257
|
+
height: import_react_native21.Platform.OS === "ios" ? 44 : 54,
|
|
1175
1258
|
flexDirection: "row",
|
|
1176
1259
|
alignItems: "center",
|
|
1177
1260
|
justifyContent: "flex-end",
|
|
@@ -1181,8 +1264,8 @@ function GameWebviewNavigationBar() {
|
|
|
1181
1264
|
paddingRight: 10
|
|
1182
1265
|
},
|
|
1183
1266
|
pointerEvents: "box-none",
|
|
1184
|
-
children: /* @__PURE__ */ (0,
|
|
1185
|
-
|
|
1267
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1268
|
+
import_private6.NavigationRightContent,
|
|
1186
1269
|
{
|
|
1187
1270
|
fixedRightButton: initialAccessoryButton,
|
|
1188
1271
|
onPressDots: openMoreButtonBottomSheet,
|
|
@@ -1199,50 +1282,49 @@ function GameWebviewNavigationBar() {
|
|
|
1199
1282
|
}
|
|
1200
1283
|
|
|
1201
1284
|
// src/components/GameWebView.tsx
|
|
1202
|
-
var
|
|
1285
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1203
1286
|
var GameWebView = (0, import_react13.forwardRef)(function GameWebView2(props, ref) {
|
|
1204
1287
|
const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react13.useState)(false);
|
|
1205
1288
|
(0, import_react13.useEffect)(() => {
|
|
1206
|
-
if (
|
|
1207
|
-
(0,
|
|
1289
|
+
if (import_react_native22.Platform.OS === "ios") {
|
|
1290
|
+
(0, import_native_modules13.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1208
1291
|
return () => {
|
|
1209
|
-
(0,
|
|
1292
|
+
(0, import_native_modules13.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1210
1293
|
};
|
|
1211
1294
|
}
|
|
1212
1295
|
return;
|
|
1213
1296
|
}, []);
|
|
1214
1297
|
(0, import_react13.useEffect)(() => {
|
|
1215
|
-
|
|
1298
|
+
import_native_modules13.appsInTossEvent.addEventListener("entryMessageExited", {
|
|
1216
1299
|
onEvent: () => {
|
|
1217
1300
|
setIsEntryMessageExited(true);
|
|
1218
1301
|
}
|
|
1219
1302
|
});
|
|
1220
1303
|
}, []);
|
|
1221
|
-
return /* @__PURE__ */ (0,
|
|
1222
|
-
/* @__PURE__ */ (0,
|
|
1223
|
-
(0,
|
|
1304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
1305
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GameWebviewNavigationBar, {}),
|
|
1306
|
+
(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
1307
|
] });
|
|
1225
1308
|
});
|
|
1226
1309
|
|
|
1227
1310
|
// src/components/PartnerWebView.tsx
|
|
1228
|
-
var
|
|
1311
|
+
var import_native_modules15 = require("@apps-in-toss/native-modules");
|
|
1229
1312
|
var import_react_native_webview2 = require("@granite-js/native/react-native-webview");
|
|
1230
|
-
var
|
|
1231
|
-
var
|
|
1313
|
+
var import_react16 = require("react");
|
|
1314
|
+
var import_react_native25 = require("react-native");
|
|
1232
1315
|
|
|
1233
1316
|
// src/components/NavigationBar/PartnerWebviewNavigationBar.tsx
|
|
1234
|
-
var
|
|
1235
|
-
var
|
|
1236
|
-
var
|
|
1237
|
-
var import_private6 = require("@toss-design-system/react-native/private");
|
|
1317
|
+
var import_react_native23 = require("@granite-js/react-native");
|
|
1318
|
+
var import_tds_react_native11 = require("@toss/tds-react-native");
|
|
1319
|
+
var import_private7 = require("@toss/tds-react-native/private");
|
|
1238
1320
|
var import_es_hangul4 = require("es-hangul");
|
|
1239
1321
|
var import_react14 = require("react");
|
|
1240
|
-
var
|
|
1241
|
-
function PartnerWebviewNavigationBar({ handleBackEvent }) {
|
|
1322
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1323
|
+
function PartnerWebviewNavigationBar({ handleBackEvent, handleHomeIconButtonClick }) {
|
|
1242
1324
|
const globals = getAppsInTossGlobals();
|
|
1243
1325
|
const { captureExitLog } = useCaptureExitLog();
|
|
1244
1326
|
const logging = useNavigationBarLogging();
|
|
1245
|
-
const { openConfirm } = (0,
|
|
1327
|
+
const { openConfirm } = (0, import_tds_react_native11.useDialog)();
|
|
1246
1328
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1247
1329
|
const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
|
|
1248
1330
|
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
@@ -1250,8 +1332,8 @@ function PartnerWebviewNavigationBar({ handleBackEvent }) {
|
|
|
1250
1332
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
1251
1333
|
const handlePressTitle = (0, import_react14.useCallback)(() => {
|
|
1252
1334
|
logging.homeButtonClick();
|
|
1253
|
-
|
|
1254
|
-
}, [logging]);
|
|
1335
|
+
handleHomeIconButtonClick();
|
|
1336
|
+
}, [handleHomeIconButtonClick, logging]);
|
|
1255
1337
|
const handleClose = (0, import_react14.useCallback)(async () => {
|
|
1256
1338
|
logging.closeButtonClick();
|
|
1257
1339
|
const isConfirmed = await openConfirm({
|
|
@@ -1264,11 +1346,11 @@ function PartnerWebviewNavigationBar({ handleBackEvent }) {
|
|
|
1264
1346
|
logging.closePopupCtaClick(isConfirmed);
|
|
1265
1347
|
if (isConfirmed) {
|
|
1266
1348
|
captureExitLog(Date.now());
|
|
1267
|
-
(0,
|
|
1349
|
+
(0, import_react_native23.closeView)();
|
|
1268
1350
|
}
|
|
1269
1351
|
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
1270
|
-
return /* @__PURE__ */ (0,
|
|
1271
|
-
|
|
1352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1353
|
+
import_private7.TopNavigation,
|
|
1272
1354
|
{
|
|
1273
1355
|
title: globals.brandDisplayName,
|
|
1274
1356
|
icon: toIcon(globals.brandIcon),
|
|
@@ -1278,7 +1360,7 @@ function PartnerWebviewNavigationBar({ handleBackEvent }) {
|
|
|
1278
1360
|
onPressClose: handleClose,
|
|
1279
1361
|
withHome: withHomeButton,
|
|
1280
1362
|
fixedRightButton: initialAccessoryButton,
|
|
1281
|
-
children: /* @__PURE__ */ (0,
|
|
1363
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_private7.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_private7.NavigationBackButton, { onPress: handleBackEvent, canGoBack: false }) })
|
|
1282
1364
|
}
|
|
1283
1365
|
) });
|
|
1284
1366
|
}
|
|
@@ -1296,57 +1378,186 @@ function mergeRefs(...refs) {
|
|
|
1296
1378
|
};
|
|
1297
1379
|
}
|
|
1298
1380
|
|
|
1299
|
-
// src/
|
|
1300
|
-
var
|
|
1301
|
-
var
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1381
|
+
// src/hooks/useWebviewHistoryStack.tsx
|
|
1382
|
+
var import_react15 = require("react");
|
|
1383
|
+
var INITIAL_STATE = { stack: [], index: -1 };
|
|
1384
|
+
function reducer(state, action) {
|
|
1385
|
+
switch (action.type) {
|
|
1386
|
+
case "NAVIGATION_CHANGE": {
|
|
1387
|
+
const { url, canGoForward } = action;
|
|
1388
|
+
if (state.stack.length === 0) {
|
|
1389
|
+
return { stack: [url], index: 0 };
|
|
1390
|
+
}
|
|
1391
|
+
const { stack, index } = state;
|
|
1392
|
+
const cur = stack[index];
|
|
1393
|
+
if (url === cur) {
|
|
1394
|
+
return state;
|
|
1395
|
+
}
|
|
1396
|
+
const prev = index > 0 ? stack[index - 1] : void 0;
|
|
1397
|
+
const next = index < stack.length - 1 ? stack[index + 1] : void 0;
|
|
1398
|
+
if (prev && url === prev && canGoForward) {
|
|
1399
|
+
return { ...state, index: index - 1 };
|
|
1400
|
+
}
|
|
1401
|
+
if (next && url === next) {
|
|
1402
|
+
return { ...state, index: index + 1 };
|
|
1403
|
+
}
|
|
1404
|
+
const base = stack.slice(0, index + 1);
|
|
1405
|
+
const nextStack = [...base, url];
|
|
1406
|
+
return { stack: nextStack, index: nextStack.length - 1 };
|
|
1311
1407
|
}
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1408
|
+
default:
|
|
1409
|
+
return state;
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
function useWebViewHistory() {
|
|
1413
|
+
const [state, dispatch] = (0, import_react15.useReducer)(reducer, INITIAL_STATE);
|
|
1414
|
+
const onNavigationStateChange = (0, import_react15.useCallback)(({ url, canGoForward: canGoForward2 }) => {
|
|
1415
|
+
dispatch({ type: "NAVIGATION_CHANGE", url, canGoForward: canGoForward2 });
|
|
1416
|
+
}, []);
|
|
1417
|
+
const { canGoBack, canGoForward } = (0, import_react15.useMemo)(() => {
|
|
1418
|
+
const canBack = state.index > 0;
|
|
1419
|
+
const canFwd = state.index >= 0 && state.index < state.stack.length - 1;
|
|
1420
|
+
return { canGoBack: canBack, canGoForward: canFwd };
|
|
1421
|
+
}, [state.index, state.stack.length]);
|
|
1422
|
+
return { onNavigationStateChange, canGoBack, canGoForward };
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
// src/utils/log.ts
|
|
1426
|
+
var import_native_modules14 = require("@apps-in-toss/native-modules");
|
|
1427
|
+
var import_react_native24 = require("@granite-js/react-native");
|
|
1428
|
+
|
|
1429
|
+
// src/utils/extractDateFromUUIDv7.ts
|
|
1430
|
+
var extractDateFromUUIDv7 = (uuid) => {
|
|
1431
|
+
const timestampHex = uuid.split("-").join("").slice(0, 12);
|
|
1432
|
+
const timestamp = Number.parseInt(timestampHex, 16);
|
|
1433
|
+
return new Date(timestamp);
|
|
1434
|
+
};
|
|
1435
|
+
|
|
1436
|
+
// src/utils/log.ts
|
|
1437
|
+
var getGroupId = (url) => {
|
|
1438
|
+
try {
|
|
1439
|
+
const urlObject = new URL(url);
|
|
1440
|
+
return {
|
|
1441
|
+
groupId: urlObject.pathname,
|
|
1442
|
+
search: urlObject.search.startsWith("?") ? urlObject.search.substring(1) : urlObject.search
|
|
1443
|
+
};
|
|
1444
|
+
} catch {
|
|
1445
|
+
return {
|
|
1446
|
+
groupId: "unknown",
|
|
1447
|
+
search: "unknown"
|
|
1448
|
+
};
|
|
1449
|
+
}
|
|
1450
|
+
};
|
|
1451
|
+
var getReferrer = () => {
|
|
1452
|
+
try {
|
|
1453
|
+
const referrer = new URL((0, import_react_native24.getSchemeUri)());
|
|
1454
|
+
return referrer.searchParams.get("referrer");
|
|
1455
|
+
} catch {
|
|
1456
|
+
return "";
|
|
1457
|
+
}
|
|
1458
|
+
};
|
|
1459
|
+
var trackScreen = (url) => {
|
|
1460
|
+
const { groupId, search } = getGroupId(url);
|
|
1461
|
+
const log = {
|
|
1462
|
+
log_type: "screen",
|
|
1463
|
+
log_name: `${groupId}::screen`,
|
|
1464
|
+
params: {
|
|
1465
|
+
search,
|
|
1466
|
+
referrer: getReferrer(),
|
|
1467
|
+
deployment_id: env.getDeploymentId(),
|
|
1468
|
+
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
1469
|
+
}
|
|
1470
|
+
};
|
|
1471
|
+
return (0, import_native_modules14.eventLog)(log);
|
|
1472
|
+
};
|
|
1473
|
+
|
|
1474
|
+
// src/components/PartnerWebView.tsx
|
|
1475
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1476
|
+
var PartnerWebView = (0, import_react16.forwardRef)(
|
|
1477
|
+
function PartnerWebViewScreen(webViewProps, ref) {
|
|
1478
|
+
const webViewRef = (0, import_react16.useRef)(null);
|
|
1479
|
+
const refs = mergeRefs(ref, webViewRef);
|
|
1480
|
+
const { captureExitLog } = useCaptureExitLog();
|
|
1481
|
+
const { canGoBack, onNavigationStateChange } = useWebViewHistory();
|
|
1482
|
+
const historyBackScript = `
|
|
1483
|
+
(function() {
|
|
1484
|
+
window.history.back();
|
|
1485
|
+
true;
|
|
1486
|
+
})();
|
|
1487
|
+
`;
|
|
1488
|
+
const historyHomeScript = `
|
|
1489
|
+
(function() {
|
|
1490
|
+
window.location.href = '/';
|
|
1491
|
+
true;
|
|
1492
|
+
})();
|
|
1493
|
+
`;
|
|
1494
|
+
const handleBackEvent = (0, import_react16.useCallback)(() => {
|
|
1495
|
+
if (canGoBack) {
|
|
1496
|
+
webViewRef.current?.injectJavaScript(historyBackScript);
|
|
1318
1497
|
} else {
|
|
1319
1498
|
captureExitLog(Date.now());
|
|
1320
|
-
|
|
1499
|
+
(0, import_native_modules15.closeView)();
|
|
1321
1500
|
}
|
|
1322
|
-
};
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1501
|
+
}, [canGoBack, captureExitLog, historyBackScript]);
|
|
1502
|
+
(0, import_react16.useEffect)(() => {
|
|
1503
|
+
const handleAndroidBackEvent = () => {
|
|
1504
|
+
if (canGoBack) {
|
|
1505
|
+
webViewRef.current?.injectJavaScript(historyBackScript);
|
|
1506
|
+
return true;
|
|
1507
|
+
} else {
|
|
1508
|
+
captureExitLog(Date.now());
|
|
1509
|
+
return false;
|
|
1510
|
+
}
|
|
1511
|
+
};
|
|
1512
|
+
import_react_native25.BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
1513
|
+
return () => import_react_native25.BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
1514
|
+
}, [canGoBack, captureExitLog, historyBackScript]);
|
|
1515
|
+
const handleHomeIconButtonClick = (0, import_react16.useCallback)(() => {
|
|
1516
|
+
webViewRef.current?.injectJavaScript(historyHomeScript);
|
|
1517
|
+
}, [historyHomeScript]);
|
|
1518
|
+
const handleNavigationStateChange = (0, import_react16.useCallback)(
|
|
1519
|
+
(event) => {
|
|
1520
|
+
if (event.url) {
|
|
1521
|
+
trackScreen(event.url);
|
|
1522
|
+
}
|
|
1523
|
+
onNavigationStateChange(event);
|
|
1524
|
+
},
|
|
1525
|
+
[onNavigationStateChange]
|
|
1526
|
+
);
|
|
1527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1528
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1529
|
+
PartnerWebviewNavigationBar,
|
|
1530
|
+
{
|
|
1531
|
+
handleBackEvent,
|
|
1532
|
+
handleHomeIconButtonClick
|
|
1533
|
+
}
|
|
1534
|
+
),
|
|
1535
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1536
|
+
import_react_native_webview2.WebView,
|
|
1537
|
+
{
|
|
1538
|
+
ref: refs,
|
|
1539
|
+
...webViewProps,
|
|
1540
|
+
style: { flex: 1 },
|
|
1541
|
+
onNavigationStateChange: (event) => {
|
|
1542
|
+
webViewProps?.onNavigationStateChange?.(event);
|
|
1543
|
+
handleNavigationStateChange(event);
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
)
|
|
1547
|
+
] });
|
|
1548
|
+
}
|
|
1549
|
+
);
|
|
1343
1550
|
|
|
1344
1551
|
// src/bridge-handler/useBridgeHandler.tsx
|
|
1345
|
-
var
|
|
1552
|
+
var import_react17 = require("react");
|
|
1346
1553
|
function serializeError(error) {
|
|
1347
1554
|
return JSON.stringify(error, (_, value) => {
|
|
1348
1555
|
if (value instanceof Error) {
|
|
1349
1556
|
return {
|
|
1557
|
+
...Object.entries(value).reduce((acc, [key, value2]) => {
|
|
1558
|
+
acc[key] = value2;
|
|
1559
|
+
return acc;
|
|
1560
|
+
}, {}),
|
|
1350
1561
|
name: value.name,
|
|
1351
1562
|
message: value.message,
|
|
1352
1563
|
stack: value.stack,
|
|
@@ -1391,8 +1602,8 @@ function useBridgeHandler({
|
|
|
1391
1602
|
eventListenerMap,
|
|
1392
1603
|
injectedJavaScript: originalInjectedJavaScript
|
|
1393
1604
|
}) {
|
|
1394
|
-
const ref = (0,
|
|
1395
|
-
const injectedJavaScript = (0,
|
|
1605
|
+
const ref = (0, import_react17.useRef)(null);
|
|
1606
|
+
const injectedJavaScript = (0, import_react17.useMemo)(
|
|
1396
1607
|
() => [
|
|
1397
1608
|
`window.__CONSTANT_HANDLER_MAP = ${JSON.stringify(
|
|
1398
1609
|
Object.entries(constantHandlerMap).reduce(
|
|
@@ -1419,7 +1630,7 @@ function useBridgeHandler({
|
|
|
1419
1630
|
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
|
|
1420
1631
|
`);
|
|
1421
1632
|
};
|
|
1422
|
-
const $onMessage = (0,
|
|
1633
|
+
const $onMessage = (0, import_react17.useCallback)(
|
|
1423
1634
|
async (e) => {
|
|
1424
1635
|
onMessage?.(e);
|
|
1425
1636
|
const data = JSON.parse(e.nativeEvent.data);
|
|
@@ -1470,8 +1681,8 @@ function useBridgeHandler({
|
|
|
1470
1681
|
}
|
|
1471
1682
|
|
|
1472
1683
|
// src/hooks/useCreateUserAgent.ts
|
|
1473
|
-
var
|
|
1474
|
-
var
|
|
1684
|
+
var import_native_modules16 = require("@apps-in-toss/native-modules");
|
|
1685
|
+
var import_react_native26 = require("react-native");
|
|
1475
1686
|
var FontA11yCategory = {
|
|
1476
1687
|
Large: "Large",
|
|
1477
1688
|
xLarge: "xLarge",
|
|
@@ -1604,9 +1815,9 @@ function useCreateUserAgent({
|
|
|
1604
1815
|
safeArea,
|
|
1605
1816
|
safeAreaBottomTransparency
|
|
1606
1817
|
}) {
|
|
1607
|
-
const platform = (0,
|
|
1608
|
-
const appVersion = (0,
|
|
1609
|
-
const { fontScale } = (0,
|
|
1818
|
+
const platform = (0, import_native_modules16.getPlatformOS)();
|
|
1819
|
+
const appVersion = (0, import_native_modules16.getTossAppVersion)();
|
|
1820
|
+
const { fontScale } = (0, import_react_native26.useWindowDimensions)();
|
|
1610
1821
|
const platformString = platform === "ios" ? "iPhone" : "Android";
|
|
1611
1822
|
const fontA11y = mapFontScaleToCategory(fontScale, platform);
|
|
1612
1823
|
const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
|
|
@@ -1626,17 +1837,17 @@ function useCreateUserAgent({
|
|
|
1626
1837
|
}
|
|
1627
1838
|
|
|
1628
1839
|
// src/hooks/useGeolocation.ts
|
|
1629
|
-
var
|
|
1630
|
-
var
|
|
1631
|
-
var
|
|
1840
|
+
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
1841
|
+
var import_react_native27 = require("@granite-js/react-native");
|
|
1842
|
+
var import_react18 = require("react");
|
|
1632
1843
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
1633
|
-
const isVisible = (0,
|
|
1634
|
-
const [location, setLocation] = (0,
|
|
1635
|
-
(0,
|
|
1844
|
+
const isVisible = (0, import_react_native27.useVisibility)();
|
|
1845
|
+
const [location, setLocation] = (0, import_react18.useState)(null);
|
|
1846
|
+
(0, import_react18.useEffect)(() => {
|
|
1636
1847
|
if (!isVisible) {
|
|
1637
1848
|
return;
|
|
1638
1849
|
}
|
|
1639
|
-
return (0,
|
|
1850
|
+
return (0, import_native_modules17.startUpdateLocation)({
|
|
1640
1851
|
options: {
|
|
1641
1852
|
accuracy,
|
|
1642
1853
|
distanceInterval,
|
|
@@ -1649,67 +1860,18 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
1649
1860
|
return location;
|
|
1650
1861
|
}
|
|
1651
1862
|
|
|
1652
|
-
// src/utils/log.ts
|
|
1653
|
-
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
1654
|
-
var import_react_native35 = require("@granite-js/react-native");
|
|
1655
|
-
|
|
1656
|
-
// src/utils/extractDateFromUUIDv7.ts
|
|
1657
|
-
var extractDateFromUUIDv7 = (uuid) => {
|
|
1658
|
-
const timestampHex = uuid.split("-").join("").slice(0, 12);
|
|
1659
|
-
const timestamp = Number.parseInt(timestampHex, 16);
|
|
1660
|
-
return new Date(timestamp);
|
|
1661
|
-
};
|
|
1662
|
-
|
|
1663
|
-
// src/utils/log.ts
|
|
1664
|
-
var getGroupId = (url) => {
|
|
1665
|
-
try {
|
|
1666
|
-
const urlObject = new URL(url);
|
|
1667
|
-
return {
|
|
1668
|
-
groupId: urlObject.pathname,
|
|
1669
|
-
search: urlObject.search.startsWith("?") ? urlObject.search.substring(1) : urlObject.search
|
|
1670
|
-
};
|
|
1671
|
-
} catch {
|
|
1672
|
-
return {
|
|
1673
|
-
groupId: "unknown",
|
|
1674
|
-
search: "unknown"
|
|
1675
|
-
};
|
|
1676
|
-
}
|
|
1677
|
-
};
|
|
1678
|
-
var getReferrer = () => {
|
|
1679
|
-
try {
|
|
1680
|
-
const referrer = new URL((0, import_react_native35.getSchemeUri)());
|
|
1681
|
-
return referrer.searchParams.get("referrer");
|
|
1682
|
-
} catch {
|
|
1683
|
-
return "";
|
|
1684
|
-
}
|
|
1685
|
-
};
|
|
1686
|
-
var trackScreen = (url) => {
|
|
1687
|
-
const { groupId, search } = getGroupId(url);
|
|
1688
|
-
const log = {
|
|
1689
|
-
log_type: "screen",
|
|
1690
|
-
log_name: `${groupId}::screen`,
|
|
1691
|
-
params: {
|
|
1692
|
-
search,
|
|
1693
|
-
referrer: getReferrer(),
|
|
1694
|
-
deployment_id: env.getDeploymentId(),
|
|
1695
|
-
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
1696
|
-
}
|
|
1697
|
-
};
|
|
1698
|
-
return (0, import_native_modules17.eventLog)(log);
|
|
1699
|
-
};
|
|
1700
|
-
|
|
1701
1863
|
// src/components/WebView.tsx
|
|
1702
|
-
var
|
|
1864
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1703
1865
|
var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
|
|
1704
1866
|
var TYPES = ["partner", "external", "game"];
|
|
1705
1867
|
var WEBVIEW_TYPES = {
|
|
1706
1868
|
partner: PartnerWebView,
|
|
1707
|
-
external:
|
|
1869
|
+
external: import_tds_react_native12.ExternalWebViewScreen,
|
|
1708
1870
|
game: GameWebView
|
|
1709
1871
|
};
|
|
1710
1872
|
function mergeSchemeQueryParamsInto(url) {
|
|
1711
1873
|
const baseUrl = new URL(url);
|
|
1712
|
-
const schemeUrl = new URL((0,
|
|
1874
|
+
const schemeUrl = new URL((0, import_react_native28.getSchemeUri)());
|
|
1713
1875
|
baseUrl.pathname = schemeUrl.pathname;
|
|
1714
1876
|
for (const [key, value] of schemeUrl.searchParams.entries()) {
|
|
1715
1877
|
baseUrl.searchParams.set(key, value);
|
|
@@ -1733,12 +1895,12 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1733
1895
|
if (!TYPES.includes(type)) {
|
|
1734
1896
|
throw new Error(`Invalid WebView type: '${type}'`);
|
|
1735
1897
|
}
|
|
1736
|
-
const graniteEvent = (0,
|
|
1737
|
-
const uri = (0,
|
|
1738
|
-
const top = (0,
|
|
1739
|
-
const bottom = (0,
|
|
1898
|
+
const graniteEvent = (0, import_react_native28.useGraniteEvent)();
|
|
1899
|
+
const uri = (0, import_react19.useMemo)(() => getWebViewUri(local), [local]);
|
|
1900
|
+
const top = (0, import_private8.useSafeAreaTop)();
|
|
1901
|
+
const bottom = (0, import_private8.useSafeAreaBottom)();
|
|
1740
1902
|
const global2 = getAppsInTossGlobals();
|
|
1741
|
-
const topNavigation = (0,
|
|
1903
|
+
const topNavigation = (0, import_private8.useTopNavigation)();
|
|
1742
1904
|
const disableTextSelectionCSS = `
|
|
1743
1905
|
(function() {
|
|
1744
1906
|
const style = document.createElement('style');
|
|
@@ -1746,7 +1908,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1746
1908
|
document.head.appendChild(style);
|
|
1747
1909
|
})();
|
|
1748
1910
|
`;
|
|
1749
|
-
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0,
|
|
1911
|
+
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0, import_react19.useState)(
|
|
1750
1912
|
props.allowsBackForwardNavigationGestures
|
|
1751
1913
|
);
|
|
1752
1914
|
const handler = useBridgeHandler({
|
|
@@ -1755,7 +1917,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1755
1917
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1756
1918
|
eventListenerMap: {
|
|
1757
1919
|
...appsInTossEventBridges,
|
|
1758
|
-
navigationAccessoryEvent: ({ onEvent, onError }) =>
|
|
1920
|
+
navigationAccessoryEvent: ({ onEvent, onError }) => import_tds_react_native12.tdsEvent.addEventListener("navigationAccessoryEvent", { onEvent, onError }),
|
|
1759
1921
|
backEvent: ({ onEvent, onError, options }) => graniteEvent.addEventListener("backEvent", { onEvent, onError, options }),
|
|
1760
1922
|
entryMessageExited: ({ onEvent, onError }) => import_native_modules18.appsInTossEvent.addEventListener("entryMessageExited", { onEvent, onError }),
|
|
1761
1923
|
updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules18.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
@@ -1768,10 +1930,12 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1768
1930
|
showAdMobRewardedAd: import_native_modules18.GoogleAdMob.showAdMobRewardedAd,
|
|
1769
1931
|
/** AdMobV2 */
|
|
1770
1932
|
loadAppsInTossAdMob: import_native_modules18.GoogleAdMob.loadAppsInTossAdMob,
|
|
1771
|
-
showAppsInTossAdMob: import_native_modules18.GoogleAdMob.showAppsInTossAdMob
|
|
1933
|
+
showAppsInTossAdMob: import_native_modules18.GoogleAdMob.showAppsInTossAdMob,
|
|
1934
|
+
/** IAP */
|
|
1935
|
+
iapCreateOneTimePurchaseOrder: import_native_modules18.IAP.createOneTimePurchaseOrder,
|
|
1936
|
+
requestOneTimePurchase: import_native_modules18.requestOneTimePurchase
|
|
1772
1937
|
},
|
|
1773
1938
|
constantHandlerMap: {
|
|
1774
|
-
...graniteConstantBridges,
|
|
1775
1939
|
...appsInTossConstantBridges,
|
|
1776
1940
|
getSafeAreaTop: () => top,
|
|
1777
1941
|
getSafeAreaBottom: () => bottom,
|
|
@@ -1788,7 +1952,6 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1788
1952
|
getDeploymentId: env.getDeploymentId
|
|
1789
1953
|
},
|
|
1790
1954
|
asyncHandlerMap: {
|
|
1791
|
-
...graniteAsyncBridges,
|
|
1792
1955
|
...appsInTossAsyncBridges,
|
|
1793
1956
|
setIosSwipeGestureEnabled: (options) => {
|
|
1794
1957
|
setAllowsBackForwardNavigationGestures(options.isEnabled);
|
|
@@ -1812,11 +1975,14 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1812
1975
|
removeStorageItem: import_native_modules18.Storage.removeItem,
|
|
1813
1976
|
clearItems: import_native_modules18.Storage.clearItems,
|
|
1814
1977
|
/** IAP */
|
|
1815
|
-
|
|
1816
|
-
|
|
1978
|
+
iapGetProductItemList: import_native_modules18.IAP.getProductItemList,
|
|
1979
|
+
iapCreateOneTimePurchaseOrder: import_native_modules18.iapCreateOneTimePurchaseOrder,
|
|
1980
|
+
processProductGrant: import_native_modules18.processProductGrant,
|
|
1981
|
+
getPendingOrders: import_native_modules18.IAP.getPendingOrders,
|
|
1982
|
+
getCompletedOrRefundedOrders: import_native_modules18.IAP.getCompletedOrRefundedOrders
|
|
1817
1983
|
}
|
|
1818
1984
|
});
|
|
1819
|
-
const headerPropForExternalWebView = (0,
|
|
1985
|
+
const headerPropForExternalWebView = (0, import_react19.useMemo)(() => {
|
|
1820
1986
|
const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
|
|
1821
1987
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
1822
1988
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
@@ -1833,20 +1999,10 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1833
1999
|
}, [global2.navigationBar, type]);
|
|
1834
2000
|
const BaseWebView = WEBVIEW_TYPES[type];
|
|
1835
2001
|
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
2002
|
const userAgent = useCreateUserAgent({
|
|
1847
2003
|
colorPreference: "light"
|
|
1848
2004
|
});
|
|
1849
|
-
return /* @__PURE__ */ (0,
|
|
2005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1850
2006
|
BaseWebView,
|
|
1851
2007
|
{
|
|
1852
2008
|
ref: handler.ref,
|
|
@@ -1859,16 +2015,14 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1859
2015
|
"User-Agent": userAgent
|
|
1860
2016
|
}
|
|
1861
2017
|
},
|
|
1862
|
-
userAgent:
|
|
2018
|
+
userAgent: import_react_native29.Platform.OS === "ios" ? userAgent : void 0,
|
|
1863
2019
|
sharedCookiesEnabled: true,
|
|
1864
2020
|
webviewDebuggingEnabled: webViewDebuggingEnabled,
|
|
1865
2021
|
thirdPartyCookiesEnabled: true,
|
|
1866
2022
|
onMessage: handler.onMessage,
|
|
1867
|
-
canHistoryGoBack,
|
|
1868
|
-
onNavigationStateChange: handleNavigationStateChange,
|
|
1869
2023
|
injectedJavaScript: handler.injectedJavaScript,
|
|
1870
2024
|
injectedJavaScriptBeforeContentLoaded: handler.injectedJavaScript,
|
|
1871
|
-
decelerationRate:
|
|
2025
|
+
decelerationRate: import_react_native29.Platform.OS === "ios" ? 1 : void 0,
|
|
1872
2026
|
allowsBackForwardNavigationGestures
|
|
1873
2027
|
}
|
|
1874
2028
|
);
|
|
@@ -1876,7 +2030,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1876
2030
|
|
|
1877
2031
|
// src/index.ts
|
|
1878
2032
|
__reExport(src_exports, require("@apps-in-toss/analytics"), module.exports);
|
|
1879
|
-
var
|
|
2033
|
+
var import_private9 = require("@toss/tds-react-native/private");
|
|
1880
2034
|
__reExport(src_exports, require("@apps-in-toss/native-modules"), module.exports);
|
|
1881
2035
|
__reExport(src_exports, require("@apps-in-toss/types"), module.exports);
|
|
1882
2036
|
var Analytics2 = {
|