@apps-in-toss/framework 2.4.2 → 2.4.4
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 +398 -483
- package/dist/index.js +164 -251
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -17,15 +17,14 @@ import { Analytics as InternalAnalytics } from "@apps-in-toss/analytics";
|
|
|
17
17
|
|
|
18
18
|
// src/core/registerApp.tsx
|
|
19
19
|
import { Analytics } from "@apps-in-toss/analytics";
|
|
20
|
-
import { isMinVersionSupported as isMinVersionSupported3, setIosSwipeGestureEnabled as setIosSwipeGestureEnabled2, eventLog, getSchemeUri as getSchemeUri5 } from "@apps-in-toss/native-modules";
|
|
21
|
-
import { Granite as
|
|
20
|
+
import { isMinVersionSupported as isMinVersionSupported3, setIosSwipeGestureEnabled as setIosSwipeGestureEnabled2, eventLog as eventLog2, getSchemeUri as getSchemeUri5 } from "@apps-in-toss/native-modules";
|
|
21
|
+
import { Granite as Granite6 } from "@granite-js/react-native";
|
|
22
22
|
import { TDSProvider } from "@toss/tds-react-native";
|
|
23
23
|
import { AppRegistry } from "react-native";
|
|
24
24
|
|
|
25
25
|
// src/core/components/AppEvent.tsx
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { useEffect as useEffect2 } from "react";
|
|
26
|
+
import { Granite, getSchemeUri as getSchemeUri2 } from "@granite-js/react-native";
|
|
27
|
+
import { useEffect } from "react";
|
|
29
28
|
|
|
30
29
|
// src/env.ts
|
|
31
30
|
var env = {
|
|
@@ -34,132 +33,60 @@ var env = {
|
|
|
34
33
|
getAppName: () => global.__granite.app.name
|
|
35
34
|
};
|
|
36
35
|
|
|
37
|
-
// src/hooks/useCaptureExitLog.ts
|
|
38
|
-
import { INTERNAL__module } from "@apps-in-toss/native-modules";
|
|
39
|
-
import { Granite, useVisibility } from "@granite-js/react-native";
|
|
40
|
-
import { useCallback, useEffect, useRef } from "react";
|
|
41
|
-
|
|
42
|
-
// src/core/hooks/useReferrer.ts
|
|
43
|
-
import { getSchemeUri } from "@granite-js/react-native";
|
|
44
|
-
import { useMemo } from "react";
|
|
45
|
-
function useReferrer() {
|
|
46
|
-
return useMemo(() => {
|
|
47
|
-
try {
|
|
48
|
-
return new URL(getSchemeUri()).searchParams.get("referrer");
|
|
49
|
-
} catch {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
}, []);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
36
|
// src/utils/isPrivateScheme.ts
|
|
56
|
-
import { getSchemeUri
|
|
37
|
+
import { getSchemeUri } from "@granite-js/react-native";
|
|
57
38
|
function isPrivateScheme() {
|
|
58
39
|
try {
|
|
59
|
-
return new URL(
|
|
40
|
+
return new URL(getSchemeUri()).protocol === "intoss-private:";
|
|
60
41
|
} catch {
|
|
61
42
|
return false;
|
|
62
43
|
}
|
|
63
44
|
}
|
|
64
45
|
|
|
65
|
-
// src/
|
|
66
|
-
|
|
67
|
-
var
|
|
68
|
-
function
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
46
|
+
// src/utils/sendLog.ts
|
|
47
|
+
import { INTERNAL__module, eventLog } from "@apps-in-toss/native-modules";
|
|
48
|
+
var DEFAULT_PIPELINES = ["core", "partner"];
|
|
49
|
+
function sendLog(logData, options) {
|
|
50
|
+
const { pipelines = DEFAULT_PIPELINES } = options ?? {};
|
|
51
|
+
if (pipelines.includes("core")) {
|
|
52
|
+
INTERNAL__module.tossCoreEventLog(logData);
|
|
53
|
+
}
|
|
54
|
+
if (pipelines.includes("partner")) {
|
|
55
|
+
eventLog(logData);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// src/core/components/AppEvent.tsx
|
|
60
|
+
function SystemAppEvent({ ...initialProps }) {
|
|
72
61
|
useEffect(() => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const captureExitLog = useCallback(
|
|
78
|
-
(exitTime) => {
|
|
79
|
-
if (enterTime.current == null) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const stayTime = Math.floor(exitTime - enterTime.current);
|
|
83
|
-
INTERNAL__module.tossCoreEventLog({
|
|
84
|
-
log_name: EXIT_IMPRESSION_LOG_NAME,
|
|
85
|
-
log_type: "event",
|
|
62
|
+
sendLog(
|
|
63
|
+
{
|
|
64
|
+
log_name: "AppsInTossInitialProps",
|
|
65
|
+
log_type: "debug",
|
|
86
66
|
params: {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
referrer,
|
|
67
|
+
...initialProps,
|
|
68
|
+
schemeUri: getSchemeUri2(),
|
|
90
69
|
deployment_id: env.getDeploymentId(),
|
|
91
70
|
app_name: Granite.appName,
|
|
92
|
-
is_private: isPrivateScheme()
|
|
93
|
-
stay_time: stayTime.toString(),
|
|
94
|
-
exit_time: exitTime.toString()
|
|
71
|
+
is_private: isPrivateScheme()
|
|
95
72
|
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
[referrer]
|
|
100
|
-
);
|
|
101
|
-
return { captureExitLog };
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// src/core/components/AppEvent.tsx
|
|
105
|
-
var ENTRY_APP_EVENT_SCHEMA_ID = 1562181;
|
|
106
|
-
function EntryAppEvent() {
|
|
107
|
-
const referrer = useReferrer() ?? "";
|
|
108
|
-
useEffect2(() => {
|
|
109
|
-
INTERNAL__module2.tossCoreEventLog({
|
|
110
|
-
log_name: "appsintoss_app_visit::impression__enter_appsintoss",
|
|
111
|
-
log_type: "info",
|
|
112
|
-
params: {
|
|
113
|
-
is_transform: true,
|
|
114
|
-
schema_id: ENTRY_APP_EVENT_SCHEMA_ID,
|
|
115
|
-
referrer,
|
|
116
|
-
deployment_id: env.getDeploymentId(),
|
|
117
|
-
app_name: Granite2.appName,
|
|
118
|
-
is_private: isPrivateScheme()
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
}, [referrer]);
|
|
122
|
-
return null;
|
|
123
|
-
}
|
|
124
|
-
function SystemAppEvent({ ...initialProps }) {
|
|
125
|
-
useEffect2(() => {
|
|
126
|
-
INTERNAL__module2.tossCoreEventLog({
|
|
127
|
-
log_name: "AppsInTossInitialProps",
|
|
128
|
-
log_type: "debug",
|
|
129
|
-
params: {
|
|
130
|
-
...initialProps,
|
|
131
|
-
schemeUri: getSchemeUri3(),
|
|
132
|
-
deployment_id: env.getDeploymentId(),
|
|
133
|
-
app_name: Granite2.appName,
|
|
134
|
-
is_private: isPrivateScheme()
|
|
135
|
-
}
|
|
136
|
-
});
|
|
73
|
+
},
|
|
74
|
+
{ pipelines: ["core"] }
|
|
75
|
+
);
|
|
137
76
|
}, [initialProps]);
|
|
138
77
|
return null;
|
|
139
78
|
}
|
|
140
|
-
function StayTimeAppEvent() {
|
|
141
|
-
const visible = useVisibility2();
|
|
142
|
-
const { captureExitLog } = useCaptureExitLog();
|
|
143
|
-
useEffect2(() => {
|
|
144
|
-
if (visible === false) {
|
|
145
|
-
captureExitLog(Date.now());
|
|
146
|
-
}
|
|
147
|
-
}, [visible, captureExitLog]);
|
|
148
|
-
return null;
|
|
149
|
-
}
|
|
150
79
|
var AppEvent = {
|
|
151
|
-
|
|
152
|
-
System: SystemAppEvent,
|
|
153
|
-
StayTime: StayTimeAppEvent
|
|
80
|
+
System: SystemAppEvent
|
|
154
81
|
};
|
|
155
82
|
|
|
156
83
|
// src/core/components/AppUpdate.tsx
|
|
157
84
|
import { openURL } from "@granite-js/react-native";
|
|
158
|
-
import { useEffect as
|
|
85
|
+
import { useEffect as useEffect2 } from "react";
|
|
159
86
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
160
87
|
var UPDATE_SCHEME = "servicetoss://update/forced/j?updateType=required";
|
|
161
88
|
function AppUpdate() {
|
|
162
|
-
|
|
89
|
+
useEffect2(() => {
|
|
163
90
|
openURL(`supertoss://closePage?url=${UPDATE_SCHEME}`);
|
|
164
91
|
}, []);
|
|
165
92
|
return /* @__PURE__ */ jsx(Fragment, {});
|
|
@@ -221,7 +148,7 @@ function useNavigationBarContext() {
|
|
|
221
148
|
|
|
222
149
|
// src/components/RNAppContainer.tsx
|
|
223
150
|
import { setIosSwipeGestureEnabled } from "@apps-in-toss/native-modules";
|
|
224
|
-
import { useEffect as
|
|
151
|
+
import { useEffect as useEffect7 } from "react";
|
|
225
152
|
import { Platform as Platform3 } from "react-native";
|
|
226
153
|
|
|
227
154
|
// src/components/GameInitializer.tsx
|
|
@@ -229,7 +156,7 @@ import { isMinVersionSupported } from "@apps-in-toss/native-modules";
|
|
|
229
156
|
import { closeView as closeView2 } from "@granite-js/react-native";
|
|
230
157
|
import { Loader } from "@toss/tds-react-native";
|
|
231
158
|
import { josa } from "es-hangul";
|
|
232
|
-
import { useEffect as
|
|
159
|
+
import { useEffect as useEffect3, useRef } from "react";
|
|
233
160
|
import { Pressable, View } from "react-native";
|
|
234
161
|
|
|
235
162
|
// src/constant/game-center.ts
|
|
@@ -240,10 +167,22 @@ var GAME_MIN_VERSION = {
|
|
|
240
167
|
};
|
|
241
168
|
|
|
242
169
|
// src/hooks/useAppUpdateDialog.tsx
|
|
243
|
-
import {
|
|
244
|
-
import { Granite as Granite3, openURL as openURL2 } from "@granite-js/react-native";
|
|
170
|
+
import { Granite as Granite2, openURL as openURL2 } from "@granite-js/react-native";
|
|
245
171
|
import { useDialog } from "@toss/tds-react-native";
|
|
246
|
-
import { useCallback
|
|
172
|
+
import { useCallback } from "react";
|
|
173
|
+
|
|
174
|
+
// src/core/hooks/useReferrer.ts
|
|
175
|
+
import { getSchemeUri as getSchemeUri3 } from "@granite-js/react-native";
|
|
176
|
+
import { useMemo } from "react";
|
|
177
|
+
function useReferrer() {
|
|
178
|
+
return useMemo(() => {
|
|
179
|
+
try {
|
|
180
|
+
return new URL(getSchemeUri3()).searchParams.get("referrer");
|
|
181
|
+
} catch {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
}, []);
|
|
185
|
+
}
|
|
247
186
|
|
|
248
187
|
// src/utils/market.ts
|
|
249
188
|
import { Platform } from "react-native";
|
|
@@ -257,7 +196,7 @@ var getMarketLink = () => {
|
|
|
257
196
|
function useAppUpdateDialog() {
|
|
258
197
|
const { openConfirm } = useDialog();
|
|
259
198
|
const logging = useAppUpdateDialogLogging();
|
|
260
|
-
const openAppUpdateDialog =
|
|
199
|
+
const openAppUpdateDialog = useCallback(
|
|
261
200
|
async ({
|
|
262
201
|
title,
|
|
263
202
|
description,
|
|
@@ -296,10 +235,10 @@ function useAppUpdateDialogLogging() {
|
|
|
296
235
|
const referrer = useReferrer();
|
|
297
236
|
const baseParams = {
|
|
298
237
|
referrer,
|
|
299
|
-
app_name:
|
|
238
|
+
app_name: Granite2.appName
|
|
300
239
|
};
|
|
301
240
|
const logUpdateClick = () => {
|
|
302
|
-
|
|
241
|
+
sendLog({
|
|
303
242
|
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
304
243
|
log_type: "event",
|
|
305
244
|
params: {
|
|
@@ -311,7 +250,7 @@ function useAppUpdateDialogLogging() {
|
|
|
311
250
|
});
|
|
312
251
|
};
|
|
313
252
|
const logCloseClick = () => {
|
|
314
|
-
|
|
253
|
+
sendLog({
|
|
315
254
|
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
316
255
|
log_type: "event",
|
|
317
256
|
params: {
|
|
@@ -323,7 +262,7 @@ function useAppUpdateDialogLogging() {
|
|
|
323
262
|
});
|
|
324
263
|
};
|
|
325
264
|
const logDialogShow = () => {
|
|
326
|
-
|
|
265
|
+
sendLog({
|
|
327
266
|
log_name: UPDATE_DIALOG_LOG_NAME,
|
|
328
267
|
log_type: "popup",
|
|
329
268
|
params: {
|
|
@@ -337,12 +276,12 @@ function useAppUpdateDialogLogging() {
|
|
|
337
276
|
|
|
338
277
|
// src/hooks/useGameCenterProfile.ts
|
|
339
278
|
import { getGameCenterGameProfile } from "@apps-in-toss/native-modules";
|
|
340
|
-
import { useCallback as
|
|
279
|
+
import { useCallback as useCallback5, useState as useState3 } from "react";
|
|
341
280
|
|
|
342
281
|
// src/hooks/useErrorAlert.ts
|
|
343
282
|
import { closeView } from "@granite-js/react-native";
|
|
344
283
|
import { useDialog as useDialog2 } from "@toss/tds-react-native";
|
|
345
|
-
import { useCallback as
|
|
284
|
+
import { useCallback as useCallback2 } from "react";
|
|
346
285
|
|
|
347
286
|
// src/utils/error.ts
|
|
348
287
|
var DEFAULT_ERROR = {
|
|
@@ -353,7 +292,7 @@ var DEFAULT_ERROR = {
|
|
|
353
292
|
// src/hooks/useErrorAlert.ts
|
|
354
293
|
var useErrorAlert = () => {
|
|
355
294
|
const { openAlert } = useDialog2();
|
|
356
|
-
const openErrorAlert =
|
|
295
|
+
const openErrorAlert = useCallback2(async () => {
|
|
357
296
|
await openAlert({
|
|
358
297
|
title: DEFAULT_ERROR.title,
|
|
359
298
|
description: DEFAULT_ERROR.description
|
|
@@ -364,7 +303,7 @@ var useErrorAlert = () => {
|
|
|
364
303
|
};
|
|
365
304
|
|
|
366
305
|
// src/hooks/useTransparentWebview.tsx
|
|
367
|
-
import { useCallback as
|
|
306
|
+
import { useCallback as useCallback3, useState as useState2 } from "react";
|
|
368
307
|
|
|
369
308
|
// src/utils/openTransparentWebView.ts
|
|
370
309
|
import { openURL as openURL3 } from "@granite-js/react-native";
|
|
@@ -408,7 +347,7 @@ var openTransparentWebView = ({
|
|
|
408
347
|
var useTransparentWebview = () => {
|
|
409
348
|
const [isWebviewLoading, setIsWebviewLoading] = useState2(false);
|
|
410
349
|
const { open: openErrorAlert } = useErrorAlert();
|
|
411
|
-
const _openTransparentWebview =
|
|
350
|
+
const _openTransparentWebview = useCallback3(
|
|
412
351
|
({ webUrl, onClose, onError }) => {
|
|
413
352
|
if (isWebviewLoading) {
|
|
414
353
|
return;
|
|
@@ -442,11 +381,11 @@ var useTransparentWebview = () => {
|
|
|
442
381
|
// src/components/GameProfileToast.tsx
|
|
443
382
|
import { Asset, Toast } from "@toss/tds-react-native";
|
|
444
383
|
import { AdaptiveColorProvider, ColorPreferenceProvider, useOverlay } from "@toss/tds-react-native/private";
|
|
445
|
-
import { useCallback as
|
|
384
|
+
import { useCallback as useCallback4 } from "react";
|
|
446
385
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
447
386
|
var useGameProfileToast = () => {
|
|
448
387
|
const overlay = useOverlay();
|
|
449
|
-
const openGameProfileToast =
|
|
388
|
+
const openGameProfileToast = useCallback4(
|
|
450
389
|
(nickname, profileImageUri) => {
|
|
451
390
|
return new Promise((resolve) => {
|
|
452
391
|
overlay.open(({ isOpen, close, exit }) => {
|
|
@@ -490,7 +429,7 @@ var useGameCenterProfile = () => {
|
|
|
490
429
|
const { openGameProfileToast } = useGameProfileToast();
|
|
491
430
|
const { open: openErrorAlert } = useErrorAlert();
|
|
492
431
|
const { open: openTransparentWebView2 } = useTransparentWebview();
|
|
493
|
-
const fetchProfileData =
|
|
432
|
+
const fetchProfileData = useCallback5(async () => {
|
|
494
433
|
try {
|
|
495
434
|
const data = await getGameCenterGameProfile();
|
|
496
435
|
setProfileData(data);
|
|
@@ -500,7 +439,7 @@ var useGameCenterProfile = () => {
|
|
|
500
439
|
setIsProfileDataLoading(false);
|
|
501
440
|
}
|
|
502
441
|
}, [openErrorAlert]);
|
|
503
|
-
const refetchProfileData =
|
|
442
|
+
const refetchProfileData = useCallback5(async () => {
|
|
504
443
|
try {
|
|
505
444
|
setIsProfileDataRefetching(true);
|
|
506
445
|
const data = await getGameCenterGameProfile();
|
|
@@ -514,7 +453,7 @@ var useGameCenterProfile = () => {
|
|
|
514
453
|
openErrorAlert();
|
|
515
454
|
}
|
|
516
455
|
}, [openErrorAlert, openGameProfileToast]);
|
|
517
|
-
const openProfileWebview =
|
|
456
|
+
const openProfileWebview = useCallback5(() => {
|
|
518
457
|
openTransparentWebView2({
|
|
519
458
|
webUrl: `${GAME_PROFILE_WEBVIEW_URL}?appName=${getAppName()}&referrer=appsintoss.${getAppName()}`,
|
|
520
459
|
onClose: async () => {
|
|
@@ -558,12 +497,12 @@ var GameInitializer = ({ children }) => {
|
|
|
558
497
|
openGameProfileToast,
|
|
559
498
|
fetchProfileData
|
|
560
499
|
} = useGameCenterProfile();
|
|
561
|
-
const isCompletedFlow =
|
|
500
|
+
const isCompletedFlow = useRef(false);
|
|
562
501
|
const { open: openAppUpdateDialog } = useAppUpdateDialog();
|
|
563
|
-
|
|
502
|
+
useEffect3(() => {
|
|
564
503
|
fetchProfileData();
|
|
565
504
|
}, []);
|
|
566
|
-
|
|
505
|
+
useEffect3(() => {
|
|
567
506
|
const handleGameProfileFlow = async () => {
|
|
568
507
|
if (!canShowBottomSheetOrToast) {
|
|
569
508
|
return;
|
|
@@ -669,10 +608,10 @@ var overlayStyle = {
|
|
|
669
608
|
import { NavigationBackButton, NavigationLeft, TopNavigation } from "@toss/tds-react-native/private";
|
|
670
609
|
|
|
671
610
|
// src/components/NavigationBar/RNNavigationBar/hooks/useHardwareBackPress.ts
|
|
672
|
-
import { useEffect as
|
|
611
|
+
import { useEffect as useEffect4 } from "react";
|
|
673
612
|
import { BackHandler } from "react-native";
|
|
674
613
|
function useHardwareBackPress(handler) {
|
|
675
|
-
|
|
614
|
+
useEffect4(() => {
|
|
676
615
|
const handleBackPress = () => {
|
|
677
616
|
handler();
|
|
678
617
|
return true;
|
|
@@ -689,11 +628,11 @@ import { useMemo as useMemo2 } from "react";
|
|
|
689
628
|
// src/components/NavigationBar/RNNavigationBar/hooks/useCloseConfirm.ts
|
|
690
629
|
import { useDialog as useDialog3 } from "@toss/tds-react-native";
|
|
691
630
|
import { josa as josa2 } from "es-hangul";
|
|
692
|
-
import { useCallback as
|
|
631
|
+
import { useCallback as useCallback6 } from "react";
|
|
693
632
|
function useCloseConfirm() {
|
|
694
633
|
const { brandDisplayName } = getAppsInTossGlobals();
|
|
695
634
|
const { openConfirm } = useDialog3();
|
|
696
|
-
return
|
|
635
|
+
return useCallback6(
|
|
697
636
|
async ({ onEntered }) => {
|
|
698
637
|
return await openConfirm({
|
|
699
638
|
title: `${josa2(brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
@@ -748,8 +687,7 @@ var homeEvent = createEvent("homeEvent");
|
|
|
748
687
|
var safeAreaInsetsChange = createEvent("safeAreaInsetsChange");
|
|
749
688
|
|
|
750
689
|
// src/components/NavigationBar/common/useNavigationBarLogging.tsx
|
|
751
|
-
import {
|
|
752
|
-
import { Granite as Granite4 } from "@granite-js/react-native";
|
|
690
|
+
import { Granite as Granite3 } from "@granite-js/react-native";
|
|
753
691
|
var NAVI_BAR_IMPRESSION_SCHEMA_ID = 1596837;
|
|
754
692
|
var NAVI_BAR_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__navigation_bar";
|
|
755
693
|
var CLOSE_POPUP_SHOW_SCHEMA_ID = 1644490;
|
|
@@ -764,10 +702,10 @@ function useNavigationBarLogging() {
|
|
|
764
702
|
const referrer = useReferrer();
|
|
765
703
|
const baseParams = {
|
|
766
704
|
referrer,
|
|
767
|
-
app_name:
|
|
705
|
+
app_name: Granite3.appName
|
|
768
706
|
};
|
|
769
707
|
const logNavBarImpression = (naviBarConfig) => {
|
|
770
|
-
|
|
708
|
+
sendLog({
|
|
771
709
|
log_name: NAVI_BAR_IMPRESSION_LOG_NAME,
|
|
772
710
|
log_type: "event",
|
|
773
711
|
params: {
|
|
@@ -779,7 +717,7 @@ function useNavigationBarLogging() {
|
|
|
779
717
|
});
|
|
780
718
|
};
|
|
781
719
|
const logHomeButtonClick = () => {
|
|
782
|
-
|
|
720
|
+
sendLog({
|
|
783
721
|
log_name: HOME_BUTTON_CLICK_LOG_NAME,
|
|
784
722
|
log_type: "event",
|
|
785
723
|
params: {
|
|
@@ -790,7 +728,7 @@ function useNavigationBarLogging() {
|
|
|
790
728
|
});
|
|
791
729
|
};
|
|
792
730
|
const logCloseButtonClick = () => {
|
|
793
|
-
|
|
731
|
+
sendLog({
|
|
794
732
|
log_name: CLOSE_BUTTON_CLICK_LOG_NAME,
|
|
795
733
|
log_type: "event",
|
|
796
734
|
params: {
|
|
@@ -801,7 +739,7 @@ function useNavigationBarLogging() {
|
|
|
801
739
|
});
|
|
802
740
|
};
|
|
803
741
|
const logClosePopupShow = () => {
|
|
804
|
-
|
|
742
|
+
sendLog({
|
|
805
743
|
log_name: CLOSE_POPUP_SHOW_LOG_NAME,
|
|
806
744
|
log_type: "popup",
|
|
807
745
|
params: {
|
|
@@ -811,7 +749,7 @@ function useNavigationBarLogging() {
|
|
|
811
749
|
});
|
|
812
750
|
};
|
|
813
751
|
const logClosePopupCtaClick = (confirm) => {
|
|
814
|
-
|
|
752
|
+
sendLog({
|
|
815
753
|
log_name: CLOSE_POPUP_CTA_CLICK_LOG_NAME,
|
|
816
754
|
log_type: "event",
|
|
817
755
|
params: {
|
|
@@ -837,7 +775,6 @@ function useNavigationEvent() {
|
|
|
837
775
|
const logging = useNavigationBarLogging();
|
|
838
776
|
const navigation = useNavigation();
|
|
839
777
|
const closeConfirm = useCloseConfirm();
|
|
840
|
-
const { captureExitLog } = useCaptureExitLog();
|
|
841
778
|
return useMemo2(() => {
|
|
842
779
|
const close = async () => {
|
|
843
780
|
const hasConfirmed = await closeConfirm({
|
|
@@ -845,7 +782,6 @@ function useNavigationEvent() {
|
|
|
845
782
|
});
|
|
846
783
|
logging.closePopupCtaClick(hasConfirmed);
|
|
847
784
|
if (hasConfirmed) {
|
|
848
|
-
captureExitLog(Date.now());
|
|
849
785
|
closeView3();
|
|
850
786
|
}
|
|
851
787
|
};
|
|
@@ -872,7 +808,7 @@ function useNavigationEvent() {
|
|
|
872
808
|
close();
|
|
873
809
|
}
|
|
874
810
|
};
|
|
875
|
-
}, [backEventContext, navigation, closeConfirm, logging
|
|
811
|
+
}, [backEventContext, navigation, closeConfirm, logging]);
|
|
876
812
|
}
|
|
877
813
|
|
|
878
814
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
@@ -880,7 +816,7 @@ import { INTERNAL__appBridgeHandler as INTERNAL__appBridgeHandler2, isMinVersion
|
|
|
880
816
|
import { openURL as openURL5 } from "@granite-js/react-native";
|
|
881
817
|
import { BottomSheet, List, ListHeader } from "@toss/tds-react-native";
|
|
882
818
|
import { useAdaptive as useAdaptive2, useOverlay as useOverlay2 } from "@toss/tds-react-native/private";
|
|
883
|
-
import { useEffect as
|
|
819
|
+
import { useEffect as useEffect5, useState as useState4 } from "react";
|
|
884
820
|
|
|
885
821
|
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
886
822
|
import { getOperationalEnvironment, shareWithScheme } from "@apps-in-toss/native-modules";
|
|
@@ -893,8 +829,7 @@ import { useAdaptive } from "@toss/tds-react-native/private";
|
|
|
893
829
|
import { View as View2 } from "react-native";
|
|
894
830
|
|
|
895
831
|
// src/core/hooks/useMoreButtonBottomSheet/useMoreButtonBottomSheetLogging.tsx
|
|
896
|
-
import {
|
|
897
|
-
import { Granite as Granite5 } from "@granite-js/react-native";
|
|
832
|
+
import { Granite as Granite4 } from "@granite-js/react-native";
|
|
898
833
|
var BOTTOM_SHEET_SCHEMA_ID = 1596825;
|
|
899
834
|
var BOTTOM_SHEET_LOG_NAME = "appsintoss_app_visit__common_module::bottomsheet__more";
|
|
900
835
|
var BOTTOM_SHEET_OPEN_SCHEMA_ID = 1596829;
|
|
@@ -907,10 +842,10 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
907
842
|
const referrer = useReferrer();
|
|
908
843
|
const baseParams = {
|
|
909
844
|
referrer,
|
|
910
|
-
app_name:
|
|
845
|
+
app_name: Granite4.appName
|
|
911
846
|
};
|
|
912
847
|
const logBottomSheetShow = () => {
|
|
913
|
-
|
|
848
|
+
sendLog({
|
|
914
849
|
log_name: BOTTOM_SHEET_LOG_NAME,
|
|
915
850
|
log_type: "popup",
|
|
916
851
|
params: {
|
|
@@ -920,7 +855,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
920
855
|
});
|
|
921
856
|
};
|
|
922
857
|
const logBottomSheetOpen = () => {
|
|
923
|
-
|
|
858
|
+
sendLog({
|
|
924
859
|
log_name: BOTTOM_SHEET_OPEN_LOG_NAME,
|
|
925
860
|
log_type: "event",
|
|
926
861
|
params: {
|
|
@@ -931,7 +866,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
931
866
|
});
|
|
932
867
|
};
|
|
933
868
|
const logBottomSheetCloseClick = () => {
|
|
934
|
-
|
|
869
|
+
sendLog({
|
|
935
870
|
log_name: BOTTOM_SHEET_CLOSE_CLICK_LOG_NAME,
|
|
936
871
|
log_type: "event",
|
|
937
872
|
params: {
|
|
@@ -942,7 +877,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
942
877
|
});
|
|
943
878
|
};
|
|
944
879
|
const logBottomSheetMenuClick = ({ title }) => {
|
|
945
|
-
|
|
880
|
+
sendLog({
|
|
946
881
|
log_name: BOTTOM_SHEET_MENU_CLICK_LOG_NAME,
|
|
947
882
|
log_type: "event",
|
|
948
883
|
params: {
|
|
@@ -1095,7 +1030,7 @@ function HomeShortcutMenu() {
|
|
|
1095
1030
|
|
|
1096
1031
|
// src/core/hooks/useMoreButtonBottomSheet/SettingsMenu.tsx
|
|
1097
1032
|
import { getOperationalEnvironment as getOperationalEnvironment3 } from "@apps-in-toss/native-modules";
|
|
1098
|
-
import { Granite as
|
|
1033
|
+
import { Granite as Granite5, openURL as openURL4 } from "@granite-js/react-native";
|
|
1099
1034
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1100
1035
|
function SettingsMenu() {
|
|
1101
1036
|
const globals = getAppsInTossGlobals();
|
|
@@ -1108,7 +1043,7 @@ function SettingsMenu() {
|
|
|
1108
1043
|
title: "\uC124\uC815",
|
|
1109
1044
|
iconURL: "https://static.toss.im/icons/png/4x/icon-setting-mono.png",
|
|
1110
1045
|
onPress: () => openURL4(
|
|
1111
|
-
`servicetoss://apps-in-toss-menu/settings?appName=${
|
|
1046
|
+
`servicetoss://apps-in-toss-menu/settings?appName=${Granite5.appName}&displayAppName=${globals.brandDisplayName}`
|
|
1112
1047
|
)
|
|
1113
1048
|
}
|
|
1114
1049
|
);
|
|
@@ -1155,7 +1090,7 @@ function useMoreButtonBottomSheet() {
|
|
|
1155
1090
|
const isBottomSheetSupported = isMinVersionSupported2(MIN_VERSION.BOTTOM_SHEET);
|
|
1156
1091
|
const isShareListMenuSupported = isMinVersionSupported2(MIN_VERSION.SHARE_LIST_MENU);
|
|
1157
1092
|
const isSettingsMenuSupported = isMinVersionSupported2(MIN_VERSION.SETTINGS_MENU);
|
|
1158
|
-
|
|
1093
|
+
useEffect5(() => {
|
|
1159
1094
|
if (!isBottomSheetSupported) {
|
|
1160
1095
|
return;
|
|
1161
1096
|
}
|
|
@@ -1228,7 +1163,7 @@ function useMoreButtonBottomSheet() {
|
|
|
1228
1163
|
}
|
|
1229
1164
|
function BottomSheetImpressionArea({ children }) {
|
|
1230
1165
|
const logging = useMoreButtonBottomSheetLogging();
|
|
1231
|
-
|
|
1166
|
+
useEffect5(() => {
|
|
1232
1167
|
logging.show();
|
|
1233
1168
|
}, [logging]);
|
|
1234
1169
|
return /* @__PURE__ */ jsx9(Fragment3, { children });
|
|
@@ -1240,15 +1175,15 @@ function toIcon(source) {
|
|
|
1240
1175
|
}
|
|
1241
1176
|
|
|
1242
1177
|
// src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
|
|
1243
|
-
import { useEffect as
|
|
1178
|
+
import { useEffect as useEffect6, useRef as useRef2 } from "react";
|
|
1244
1179
|
import { Fragment as Fragment4, jsx as jsx10 } from "react/jsx-runtime";
|
|
1245
1180
|
function NavigationBarImpressionArea({
|
|
1246
1181
|
children,
|
|
1247
1182
|
withHomeButton
|
|
1248
1183
|
}) {
|
|
1249
|
-
const hasLogged =
|
|
1184
|
+
const hasLogged = useRef2(false);
|
|
1250
1185
|
const logging = useNavigationBarLogging();
|
|
1251
|
-
|
|
1186
|
+
useEffect6(() => {
|
|
1252
1187
|
if (hasLogged.current === false) {
|
|
1253
1188
|
logging.navBarImpression({ home_icon_yn: withHomeButton ? "Y" : "N" });
|
|
1254
1189
|
hasLogged.current = true;
|
|
@@ -1358,7 +1293,7 @@ function RNAppContainer({ children }) {
|
|
|
1358
1293
|
}
|
|
1359
1294
|
}
|
|
1360
1295
|
function GameAppContainer({ children }) {
|
|
1361
|
-
|
|
1296
|
+
useEffect7(() => {
|
|
1362
1297
|
if (Platform3.OS === "ios") {
|
|
1363
1298
|
setIosSwipeGestureEnabled({ isEnabled: false });
|
|
1364
1299
|
return () => {
|
|
@@ -1387,14 +1322,11 @@ function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
|
1387
1322
|
ios: "5.221.0"
|
|
1388
1323
|
})) {
|
|
1389
1324
|
return /* @__PURE__ */ jsxs5(Fragment7, { children: [
|
|
1390
|
-
/* @__PURE__ */ jsx14(AppEvent.Entry, {}),
|
|
1391
1325
|
/* @__PURE__ */ jsx14(AppEvent.System, { ...initialProps }),
|
|
1392
1326
|
/* @__PURE__ */ jsx14(AppUpdate, {})
|
|
1393
1327
|
] });
|
|
1394
1328
|
}
|
|
1395
1329
|
return /* @__PURE__ */ jsxs5(Fragment7, { children: [
|
|
1396
|
-
/* @__PURE__ */ jsx14(AppEvent.StayTime, {}),
|
|
1397
|
-
/* @__PURE__ */ jsx14(AppEvent.Entry, {}),
|
|
1398
1330
|
/* @__PURE__ */ jsx14(AppEvent.System, { ...initialProps }),
|
|
1399
1331
|
/* @__PURE__ */ jsx14(Container, { ...initialProps, children: /* @__PURE__ */ jsx14(TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children }) })
|
|
1400
1332
|
] });
|
|
@@ -1404,10 +1336,10 @@ function registerApp(container, { context, analytics }) {
|
|
|
1404
1336
|
const isRegistered = AppRegistry.getAppKeys().includes(appName);
|
|
1405
1337
|
if (!isRegistered) {
|
|
1406
1338
|
Analytics.init({
|
|
1407
|
-
logger: (params) => void
|
|
1339
|
+
logger: (params) => void eventLog2(params),
|
|
1408
1340
|
debug: analytics?.debug ?? __DEV__
|
|
1409
1341
|
});
|
|
1410
|
-
const App =
|
|
1342
|
+
const App = Granite6.registerApp(AppsInTossContainer.bind(null, container), {
|
|
1411
1343
|
appName,
|
|
1412
1344
|
context,
|
|
1413
1345
|
initialScheme: getSchemeUri5(),
|
|
@@ -1452,9 +1384,7 @@ import {
|
|
|
1452
1384
|
iapCreateOneTimePurchaseOrder,
|
|
1453
1385
|
processProductGrant,
|
|
1454
1386
|
requestOneTimePurchase,
|
|
1455
|
-
safeSyncPostMessage
|
|
1456
|
-
eventLog as eventLog2,
|
|
1457
|
-
INTERNAL__module as INTERNAL__module8
|
|
1387
|
+
safeSyncPostMessage
|
|
1458
1388
|
} from "@apps-in-toss/native-modules";
|
|
1459
1389
|
import * as appsInTossAsyncBridges from "@apps-in-toss/native-modules/async-bridges";
|
|
1460
1390
|
import * as appsInTossConstantBridges from "@apps-in-toss/native-modules/constant-bridges";
|
|
@@ -1464,7 +1394,7 @@ import { useSafeAreaInsets as useSafeAreaInsets4 } from "@granite-js/native/reac
|
|
|
1464
1394
|
import { getSchemeUri as getSchemeUri9 } from "@granite-js/react-native";
|
|
1465
1395
|
import { ExternalWebViewScreen, tdsEvent } from "@toss/tds-react-native";
|
|
1466
1396
|
import { useSafeAreaBottom, useSafeAreaTop as useSafeAreaTop3 } from "@toss/tds-react-native/private";
|
|
1467
|
-
import { useEffect as
|
|
1397
|
+
import { useEffect as useEffect12, useMemo as useMemo6, useRef as useRef5, useState as useState6 } from "react";
|
|
1468
1398
|
import { BackHandler as BackHandler2, Linking, Platform as Platform6 } from "react-native";
|
|
1469
1399
|
|
|
1470
1400
|
// src/components/GameWebView.tsx
|
|
@@ -1472,7 +1402,7 @@ import { setIosSwipeGestureEnabled as setIosSwipeGestureEnabled3, getOperational
|
|
|
1472
1402
|
import {
|
|
1473
1403
|
WebView as PlainWebView
|
|
1474
1404
|
} from "@granite-js/native/react-native-webview";
|
|
1475
|
-
import { forwardRef, useEffect as
|
|
1405
|
+
import { forwardRef, useEffect as useEffect8 } from "react";
|
|
1476
1406
|
import { Platform as Platform5 } from "react-native";
|
|
1477
1407
|
|
|
1478
1408
|
// src/components/NavigationBar/GameWebviewNavigationBar.tsx
|
|
@@ -1481,19 +1411,18 @@ import { closeView as closeView4 } from "@granite-js/react-native";
|
|
|
1481
1411
|
import { PageNavbar as PageNavbar2, useDialog as useDialog5 } from "@toss/tds-react-native";
|
|
1482
1412
|
import { NavigationRightContent as NavigationRightContent2, useSafeAreaTop as useSafeAreaTop2 } from "@toss/tds-react-native/private";
|
|
1483
1413
|
import { josa as josa3 } from "es-hangul";
|
|
1484
|
-
import { useCallback as
|
|
1414
|
+
import { useCallback as useCallback7 } from "react";
|
|
1485
1415
|
import { Platform as Platform4, View as View4 } from "react-native";
|
|
1486
1416
|
import { Fragment as Fragment8, jsx as jsx15, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1487
1417
|
function GameWebviewNavigationBar() {
|
|
1488
1418
|
const safeAreaTop = useSafeAreaTop2();
|
|
1489
1419
|
const { openConfirm } = useDialog5();
|
|
1490
|
-
const { captureExitLog } = useCaptureExitLog();
|
|
1491
1420
|
const global2 = getAppsInTossGlobals();
|
|
1492
1421
|
const logging = useNavigationBarLogging();
|
|
1493
1422
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1494
1423
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1495
1424
|
const { right: safeAreaRight } = useSafeAreaInsets2();
|
|
1496
|
-
const handleGameWebviewClose =
|
|
1425
|
+
const handleGameWebviewClose = useCallback7(async () => {
|
|
1497
1426
|
logging.closeButtonClick();
|
|
1498
1427
|
const isConfirmed = await openConfirm({
|
|
1499
1428
|
title: `${josa3(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
@@ -1504,10 +1433,9 @@ function GameWebviewNavigationBar() {
|
|
|
1504
1433
|
});
|
|
1505
1434
|
logging.closePopupCtaClick(isConfirmed);
|
|
1506
1435
|
if (isConfirmed) {
|
|
1507
|
-
captureExitLog(Date.now());
|
|
1508
1436
|
closeView4();
|
|
1509
1437
|
}
|
|
1510
|
-
}, [
|
|
1438
|
+
}, [global2.brandDisplayName, logging, openConfirm]);
|
|
1511
1439
|
return /* @__PURE__ */ jsxs6(Fragment8, { children: [
|
|
1512
1440
|
/* @__PURE__ */ jsx15(PageNavbar2, { preference: { type: "none" } }),
|
|
1513
1441
|
/* @__PURE__ */ jsx15(
|
|
@@ -1545,7 +1473,7 @@ function GameWebviewNavigationBar() {
|
|
|
1545
1473
|
// src/components/GameWebView.tsx
|
|
1546
1474
|
import { Fragment as Fragment9, jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1547
1475
|
var GameWebView = forwardRef(function GameWebView2(props, ref) {
|
|
1548
|
-
|
|
1476
|
+
useEffect8(() => {
|
|
1549
1477
|
if (Platform5.OS === "ios") {
|
|
1550
1478
|
setIosSwipeGestureEnabled3({ isEnabled: false });
|
|
1551
1479
|
return () => {
|
|
@@ -1571,11 +1499,10 @@ import { closeView as closeView5 } from "@granite-js/react-native";
|
|
|
1571
1499
|
import { useDialog as useDialog6 } from "@toss/tds-react-native";
|
|
1572
1500
|
import { NavigationBackButton as NavigationBackButton2, NavigationLeft as NavigationLeft2, TopNavigation as TopNavigation2 } from "@toss/tds-react-native/private";
|
|
1573
1501
|
import { josa as josa4 } from "es-hangul";
|
|
1574
|
-
import { useCallback as
|
|
1502
|
+
import { useCallback as useCallback8 } from "react";
|
|
1575
1503
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1576
1504
|
function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
1577
1505
|
const globals = getAppsInTossGlobals();
|
|
1578
|
-
const { captureExitLog } = useCaptureExitLog();
|
|
1579
1506
|
const logging = useNavigationBarLogging();
|
|
1580
1507
|
const { openConfirm } = useDialog6();
|
|
1581
1508
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
@@ -1583,7 +1510,7 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1583
1510
|
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
1584
1511
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
1585
1512
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1586
|
-
const handleClose =
|
|
1513
|
+
const handleClose = useCallback8(async () => {
|
|
1587
1514
|
logging.closeButtonClick();
|
|
1588
1515
|
const isConfirmed = await openConfirm({
|
|
1589
1516
|
title: `${josa4(globals.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
@@ -1594,10 +1521,9 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1594
1521
|
});
|
|
1595
1522
|
logging.closePopupCtaClick(isConfirmed);
|
|
1596
1523
|
if (isConfirmed) {
|
|
1597
|
-
captureExitLog(Date.now());
|
|
1598
1524
|
closeView5();
|
|
1599
1525
|
}
|
|
1600
|
-
}, [
|
|
1526
|
+
}, [globals.brandDisplayName, logging, openConfirm]);
|
|
1601
1527
|
return /* @__PURE__ */ jsx17(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ jsx17(
|
|
1602
1528
|
TopNavigation2,
|
|
1603
1529
|
{
|
|
@@ -2013,11 +1939,10 @@ function showFullScreenAd(params) {
|
|
|
2013
1939
|
showFullScreenAd.isSupported = GoogleAdMob.showAppsInTossAdMob.isSupported;
|
|
2014
1940
|
|
|
2015
1941
|
// src/ads/tossAdEventLog.ts
|
|
2016
|
-
import {
|
|
2017
|
-
import { Granite as Granite8 } from "@granite-js/react-native";
|
|
1942
|
+
import { Granite as Granite7 } from "@granite-js/react-native";
|
|
2018
1943
|
async function tossAdEventLog(params) {
|
|
2019
1944
|
const referrer = getReferrer();
|
|
2020
|
-
const appName =
|
|
1945
|
+
const appName = Granite7.appName;
|
|
2021
1946
|
const eventLogParams = {
|
|
2022
1947
|
...params,
|
|
2023
1948
|
params: {
|
|
@@ -2026,11 +1951,11 @@ async function tossAdEventLog(params) {
|
|
|
2026
1951
|
app_name: appName
|
|
2027
1952
|
}
|
|
2028
1953
|
};
|
|
2029
|
-
return
|
|
1954
|
+
return sendLog(eventLogParams, { pipelines: ["core"] });
|
|
2030
1955
|
}
|
|
2031
1956
|
|
|
2032
1957
|
// src/bridge-handler/useBridgeHandler.tsx
|
|
2033
|
-
import { useCallback as
|
|
1958
|
+
import { useCallback as useCallback9, useEffect as useEffect9, useMemo as useMemo3, useRef as useRef3 } from "react";
|
|
2034
1959
|
function serializeError(error) {
|
|
2035
1960
|
return JSON.stringify(error, (_, value) => {
|
|
2036
1961
|
if (value instanceof Error) {
|
|
@@ -2082,7 +2007,7 @@ function useBridgeHandler({
|
|
|
2082
2007
|
asyncHandlerMap,
|
|
2083
2008
|
eventListenerMap
|
|
2084
2009
|
}) {
|
|
2085
|
-
const ref =
|
|
2010
|
+
const ref = useRef3(null);
|
|
2086
2011
|
const injectedJavaScript = useMemo3(
|
|
2087
2012
|
() => `window.__CONSTANT_HANDLER_MAP = ${JSON.stringify(
|
|
2088
2013
|
Object.entries(constantHandlerMap).reduce(
|
|
@@ -2095,7 +2020,7 @@ function useBridgeHandler({
|
|
|
2095
2020
|
)};`,
|
|
2096
2021
|
[constantHandlerMap]
|
|
2097
2022
|
);
|
|
2098
|
-
|
|
2023
|
+
useEffect9(() => {
|
|
2099
2024
|
ref.current?.injectJavaScript(injectedJavaScript);
|
|
2100
2025
|
}, [injectedJavaScript]);
|
|
2101
2026
|
const createHandleOnEvent = (functionName, eventId) => (response) => {
|
|
@@ -2109,7 +2034,7 @@ function useBridgeHandler({
|
|
|
2109
2034
|
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
|
|
2110
2035
|
`);
|
|
2111
2036
|
};
|
|
2112
|
-
const $onMessage =
|
|
2037
|
+
const $onMessage = useCallback9(
|
|
2113
2038
|
async (e) => {
|
|
2114
2039
|
onMessage?.(e);
|
|
2115
2040
|
const data = parseNativeEventData(e.nativeEvent.data);
|
|
@@ -2169,13 +2094,13 @@ function parseNativeEventData(data) {
|
|
|
2169
2094
|
|
|
2170
2095
|
// src/core/hooks/useSafeAreaInsetsEvent.tsx
|
|
2171
2096
|
import { useSafeAreaInsets as useSafeAreaInsets3 } from "@granite-js/native/react-native-safe-area-context";
|
|
2172
|
-
import { useEffect as
|
|
2097
|
+
import { useEffect as useEffect10 } from "react";
|
|
2173
2098
|
function useSafeAreaInsetsEvent() {
|
|
2174
2099
|
const insets = useSafeAreaInsets3();
|
|
2175
|
-
|
|
2100
|
+
useEffect10(() => {
|
|
2176
2101
|
safeAreaInsetsChange.emit(insets);
|
|
2177
2102
|
}, [insets]);
|
|
2178
|
-
|
|
2103
|
+
useEffect10(() => {
|
|
2179
2104
|
return () => safeAreaInsetsChange.clearSubscriptions();
|
|
2180
2105
|
}, []);
|
|
2181
2106
|
return safeAreaInsetsChange;
|
|
@@ -2185,10 +2110,10 @@ function useSafeAreaInsetsEvent() {
|
|
|
2185
2110
|
import { closeView as closeView6, useBackEventState } from "@granite-js/react-native";
|
|
2186
2111
|
import { useDialog as useDialog7 } from "@toss/tds-react-native";
|
|
2187
2112
|
import { josa as josa5 } from "es-hangul";
|
|
2188
|
-
import { useCallback as
|
|
2113
|
+
import { useCallback as useCallback11, useMemo as useMemo5 } from "react";
|
|
2189
2114
|
|
|
2190
2115
|
// src/hooks/useWebviewHistoryStack.tsx
|
|
2191
|
-
import { useCallback as
|
|
2116
|
+
import { useCallback as useCallback10, useMemo as useMemo4, useReducer } from "react";
|
|
2192
2117
|
var INITIAL_STATE = { stack: [], index: -1 };
|
|
2193
2118
|
function reducer(state, action) {
|
|
2194
2119
|
switch (action.type) {
|
|
@@ -2220,7 +2145,7 @@ function reducer(state, action) {
|
|
|
2220
2145
|
}
|
|
2221
2146
|
function useWebViewHistory() {
|
|
2222
2147
|
const [state, dispatch] = useReducer(reducer, INITIAL_STATE);
|
|
2223
|
-
const onNavigationStateChange =
|
|
2148
|
+
const onNavigationStateChange = useCallback10(({ url, canGoForward: canGoForward2 }) => {
|
|
2224
2149
|
dispatch({ type: "NAVIGATION_CHANGE", url, canGoForward: canGoForward2 });
|
|
2225
2150
|
}, []);
|
|
2226
2151
|
const { canGoBack, canGoForward } = useMemo4(() => {
|
|
@@ -2233,7 +2158,6 @@ function useWebViewHistory() {
|
|
|
2233
2158
|
|
|
2234
2159
|
// src/core/hooks/useWebBackHandler.tsx
|
|
2235
2160
|
function useWebBackHandler(webViewInitialURL, webViewRef) {
|
|
2236
|
-
const { captureExitLog } = useCaptureExitLog();
|
|
2237
2161
|
const { hasHistory, onNavigationStateChange } = useWebViewHistory();
|
|
2238
2162
|
const {
|
|
2239
2163
|
handlersRef: webBackHandlersRef,
|
|
@@ -2244,19 +2168,19 @@ function useWebBackHandler(webViewInitialURL, webViewRef) {
|
|
|
2244
2168
|
const logging = useNavigationBarLogging();
|
|
2245
2169
|
const { openConfirm } = useDialog7();
|
|
2246
2170
|
const global2 = getAppsInTossGlobals();
|
|
2247
|
-
const addEventListener =
|
|
2171
|
+
const addEventListener = useCallback11(
|
|
2248
2172
|
(handler) => {
|
|
2249
2173
|
addWebBackEventListener(handler);
|
|
2250
2174
|
},
|
|
2251
2175
|
[addWebBackEventListener]
|
|
2252
2176
|
);
|
|
2253
|
-
const removeEventListener =
|
|
2177
|
+
const removeEventListener = useCallback11(
|
|
2254
2178
|
(handler) => {
|
|
2255
2179
|
removeWebBackEventListener(handler);
|
|
2256
2180
|
},
|
|
2257
2181
|
[removeWebBackEventListener]
|
|
2258
2182
|
);
|
|
2259
|
-
const handleWebBack =
|
|
2183
|
+
const handleWebBack = useCallback11(async () => {
|
|
2260
2184
|
if (hasWebBackEvent) {
|
|
2261
2185
|
for (const handler of webBackHandlersRef) {
|
|
2262
2186
|
handler();
|
|
@@ -2275,21 +2199,11 @@ function useWebBackHandler(webViewInitialURL, webViewRef) {
|
|
|
2275
2199
|
});
|
|
2276
2200
|
logging.closePopupCtaClick(isConfirmed);
|
|
2277
2201
|
if (isConfirmed) {
|
|
2278
|
-
captureExitLog(Date.now());
|
|
2279
2202
|
closeView6();
|
|
2280
2203
|
}
|
|
2281
2204
|
}
|
|
2282
|
-
}, [
|
|
2283
|
-
|
|
2284
|
-
global2.brandDisplayName,
|
|
2285
|
-
hasHistory,
|
|
2286
|
-
hasWebBackEvent,
|
|
2287
|
-
webBackHandlersRef,
|
|
2288
|
-
logging,
|
|
2289
|
-
openConfirm,
|
|
2290
|
-
webViewRef
|
|
2291
|
-
]);
|
|
2292
|
-
const handleWebHome = useCallback12(() => {
|
|
2205
|
+
}, [global2.brandDisplayName, hasHistory, hasWebBackEvent, webBackHandlersRef, logging, openConfirm, webViewRef]);
|
|
2206
|
+
const handleWebHome = useCallback11(() => {
|
|
2293
2207
|
logging.homeButtonClick();
|
|
2294
2208
|
if (homeEvent.hasSubscriptions()) {
|
|
2295
2209
|
homeEvent.emit({});
|
|
@@ -2480,12 +2394,12 @@ function useCreateUserAgent({
|
|
|
2480
2394
|
|
|
2481
2395
|
// src/hooks/useGeolocation.ts
|
|
2482
2396
|
import { startUpdateLocation } from "@apps-in-toss/native-modules";
|
|
2483
|
-
import { useVisibility
|
|
2484
|
-
import { useEffect as
|
|
2397
|
+
import { useVisibility } from "@granite-js/react-native";
|
|
2398
|
+
import { useEffect as useEffect11, useState as useState5 } from "react";
|
|
2485
2399
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
2486
|
-
const isVisible =
|
|
2400
|
+
const isVisible = useVisibility();
|
|
2487
2401
|
const [location, setLocation] = useState5(null);
|
|
2488
|
-
|
|
2402
|
+
useEffect11(() => {
|
|
2489
2403
|
if (!isVisible) {
|
|
2490
2404
|
return;
|
|
2491
2405
|
}
|
|
@@ -2504,11 +2418,11 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
2504
2418
|
|
|
2505
2419
|
// src/hooks/useWaitForReturnNavigator.tsx
|
|
2506
2420
|
import { useNavigation as useNavigation2, useVisibilityChange } from "@granite-js/react-native";
|
|
2507
|
-
import { useCallback as
|
|
2421
|
+
import { useCallback as useCallback12, useRef as useRef4 } from "react";
|
|
2508
2422
|
function useWaitForReturnNavigator() {
|
|
2509
|
-
const callbacks =
|
|
2423
|
+
const callbacks = useRef4([]).current;
|
|
2510
2424
|
const navigation = useNavigation2();
|
|
2511
|
-
const startNavigating =
|
|
2425
|
+
const startNavigating = useCallback12(
|
|
2512
2426
|
(route, params) => {
|
|
2513
2427
|
return new Promise((resolve) => {
|
|
2514
2428
|
callbacks.push(resolve);
|
|
@@ -2517,7 +2431,7 @@ function useWaitForReturnNavigator() {
|
|
|
2517
2431
|
},
|
|
2518
2432
|
[callbacks, navigation]
|
|
2519
2433
|
);
|
|
2520
|
-
const handleVisibilityChange =
|
|
2434
|
+
const handleVisibilityChange = useCallback12(
|
|
2521
2435
|
(state) => {
|
|
2522
2436
|
if (state === "visible" && callbacks.length > 0) {
|
|
2523
2437
|
for (const callback of callbacks) {
|
|
@@ -2542,8 +2456,8 @@ function useTopNavigation() {
|
|
|
2542
2456
|
}
|
|
2543
2457
|
|
|
2544
2458
|
// src/hooks/useWebViewMemoryDebug.tsx
|
|
2545
|
-
import { getOperationalEnvironment as getOperationalEnvironment8
|
|
2546
|
-
import { Granite as
|
|
2459
|
+
import { getOperationalEnvironment as getOperationalEnvironment8 } from "@apps-in-toss/native-modules";
|
|
2460
|
+
import { Granite as Granite8 } from "@granite-js/react-native";
|
|
2547
2461
|
import { useToast } from "@toss/tds-react-native";
|
|
2548
2462
|
function useHandleWebViewProcessDidTerminate(webViewRef) {
|
|
2549
2463
|
const toast = useToast();
|
|
@@ -2566,12 +2480,12 @@ function webViewDebugLog(logName, params) {
|
|
|
2566
2480
|
log_type: "debug",
|
|
2567
2481
|
params: {
|
|
2568
2482
|
...params,
|
|
2569
|
-
app_name:
|
|
2483
|
+
app_name: Granite8.appName,
|
|
2570
2484
|
deployment_id: global2.deploymentId
|
|
2571
2485
|
}
|
|
2572
2486
|
};
|
|
2573
2487
|
if (getOperationalEnvironment8() === "toss") {
|
|
2574
|
-
|
|
2488
|
+
sendLog(event, { pipelines: ["core"] });
|
|
2575
2489
|
} else {
|
|
2576
2490
|
console.log("[webViewDebugLog]", event);
|
|
2577
2491
|
}
|
|
@@ -2665,7 +2579,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2665
2579
|
if (!TYPES.includes(type)) {
|
|
2666
2580
|
throw new Error(`Invalid WebView type: '${type}'`);
|
|
2667
2581
|
}
|
|
2668
|
-
const webViewRef =
|
|
2582
|
+
const webViewRef = useRef5(null);
|
|
2669
2583
|
const url = useMemo6(() => getWebViewURL(local), [local]);
|
|
2670
2584
|
const webBackHandler = useWebBackHandler(url, webViewRef);
|
|
2671
2585
|
const top = useSafeAreaTop3();
|
|
@@ -2770,8 +2684,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2770
2684
|
/** Private */
|
|
2771
2685
|
memoryDebugLog: webViewMemoryDebugLog,
|
|
2772
2686
|
debugLog: async (event) => {
|
|
2773
|
-
|
|
2774
|
-
INTERNAL__module8.tossCoreEventLog(event);
|
|
2687
|
+
sendLog(event);
|
|
2775
2688
|
}
|
|
2776
2689
|
}
|
|
2777
2690
|
});
|
|
@@ -2796,7 +2709,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2796
2709
|
colorPreference: "light"
|
|
2797
2710
|
});
|
|
2798
2711
|
const refs = mergeRefs(handler.ref, webViewRef);
|
|
2799
|
-
|
|
2712
|
+
useEffect12(() => {
|
|
2800
2713
|
const callback = () => {
|
|
2801
2714
|
webBackHandler.handleWebBack();
|
|
2802
2715
|
return true;
|
|
@@ -2875,7 +2788,7 @@ import { StartUpdateLocationPermissionError } from "@apps-in-toss/types";
|
|
|
2875
2788
|
|
|
2876
2789
|
// src/ads/inlineAd/InlineAd.tsx
|
|
2877
2790
|
import { ImpressionArea, useVisibilityChange as useVisibilityChange2 } from "@granite-js/react-native";
|
|
2878
|
-
import { useEffect as
|
|
2791
|
+
import { useEffect as useEffect13, useRef as useRef8, useState as useState7 } from "react";
|
|
2879
2792
|
import { StyleSheet as StyleSheet3, View as View7, useColorScheme } from "react-native";
|
|
2880
2793
|
|
|
2881
2794
|
// src/ads/inlineAd/constants.ts
|
|
@@ -3257,7 +3170,7 @@ var EventTracker = class {
|
|
|
3257
3170
|
|
|
3258
3171
|
// src/ads/inlineAd/ui/FeedBannerAdView.tsx
|
|
3259
3172
|
import { Path, Svg } from "@granite-js/native/react-native-svg";
|
|
3260
|
-
import { useRef as
|
|
3173
|
+
import { useRef as useRef6 } from "react";
|
|
3261
3174
|
import {
|
|
3262
3175
|
Animated,
|
|
3263
3176
|
Easing,
|
|
@@ -3284,7 +3197,7 @@ function FeedBannerAdView({
|
|
|
3284
3197
|
paddingStyle,
|
|
3285
3198
|
onPress
|
|
3286
3199
|
}) {
|
|
3287
|
-
const scale =
|
|
3200
|
+
const scale = useRef6(new Animated.Value(1)).current;
|
|
3288
3201
|
const animateScale = (toValue) => {
|
|
3289
3202
|
Animated.timing(scale, {
|
|
3290
3203
|
toValue,
|
|
@@ -3520,7 +3433,7 @@ var styles = StyleSheet.create({
|
|
|
3520
3433
|
|
|
3521
3434
|
// src/ads/inlineAd/ui/ListBannerAdView.tsx
|
|
3522
3435
|
import { ClipPath, Defs, Image as SvgImage, Path as Path2, Svg as Svg2 } from "@granite-js/native/react-native-svg";
|
|
3523
|
-
import { useRef as
|
|
3436
|
+
import { useRef as useRef7 } from "react";
|
|
3524
3437
|
import { Animated as Animated2, Easing as Easing2, Pressable as Pressable3, StyleSheet as StyleSheet2, Text as Text2, View as View6 } from "react-native";
|
|
3525
3438
|
import { jsx as jsx21, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3526
3439
|
var SQUIRCLE_PATH = "M0 17.352C0 3.564 3.564 0 17.352 0H18.648C32.436 0 36 3.564 36 17.352V18.648C36 32.436 32.436 36 18.648 36H17.352C3.564 36 0 32.436 0 18.648V17.352Z";
|
|
@@ -3534,8 +3447,8 @@ function ListBannerAdView({
|
|
|
3534
3447
|
colors,
|
|
3535
3448
|
onPress
|
|
3536
3449
|
}) {
|
|
3537
|
-
const scale =
|
|
3538
|
-
const clipIdRef =
|
|
3450
|
+
const scale = useRef7(new Animated2.Value(1)).current;
|
|
3451
|
+
const clipIdRef = useRef7(`clip-${Math.random().toString(36).slice(2)}`);
|
|
3539
3452
|
const animateScale = (toValue) => {
|
|
3540
3453
|
Animated2.timing(scale, {
|
|
3541
3454
|
toValue,
|
|
@@ -3843,21 +3756,21 @@ function InlineAd(props) {
|
|
|
3843
3756
|
onAdFailedToRender,
|
|
3844
3757
|
onNoFill
|
|
3845
3758
|
} = props;
|
|
3846
|
-
const slotIdRef =
|
|
3759
|
+
const slotIdRef = useRef8(createSlotId());
|
|
3847
3760
|
const [ad, setAd] = useState7(null);
|
|
3848
3761
|
const [isAdBadgeEnabled, setIsAdBadgeEnabled] = useState7(true);
|
|
3849
|
-
const eventTrackerRef =
|
|
3850
|
-
const eventPayloadRef =
|
|
3851
|
-
const hasRenderedRef =
|
|
3852
|
-
const hasLoggedImp1pxRef =
|
|
3853
|
-
const hasLoggedImp100pRef =
|
|
3854
|
-
const hasNotifiedViewableRef =
|
|
3855
|
-
const viewableTimerRef =
|
|
3856
|
-
const refetchIntervalMsRef =
|
|
3857
|
-
const lastImp1pxAtRef =
|
|
3858
|
-
const loadingRef =
|
|
3859
|
-
const loadRef =
|
|
3860
|
-
const callbacksRef =
|
|
3762
|
+
const eventTrackerRef = useRef8(null);
|
|
3763
|
+
const eventPayloadRef = useRef8(null);
|
|
3764
|
+
const hasRenderedRef = useRef8(false);
|
|
3765
|
+
const hasLoggedImp1pxRef = useRef8(false);
|
|
3766
|
+
const hasLoggedImp100pRef = useRef8(false);
|
|
3767
|
+
const hasNotifiedViewableRef = useRef8(false);
|
|
3768
|
+
const viewableTimerRef = useRef8(null);
|
|
3769
|
+
const refetchIntervalMsRef = useRef8(null);
|
|
3770
|
+
const lastImp1pxAtRef = useRef8(null);
|
|
3771
|
+
const loadingRef = useRef8(false);
|
|
3772
|
+
const loadRef = useRef8(null);
|
|
3773
|
+
const callbacksRef = useRef8({
|
|
3861
3774
|
onAdRendered,
|
|
3862
3775
|
onAdViewable,
|
|
3863
3776
|
onAdClicked,
|
|
@@ -3865,7 +3778,7 @@ function InlineAd(props) {
|
|
|
3865
3778
|
onAdFailedToRender,
|
|
3866
3779
|
onNoFill
|
|
3867
3780
|
});
|
|
3868
|
-
const isMountedRef =
|
|
3781
|
+
const isMountedRef = useRef8(false);
|
|
3869
3782
|
const colorScheme = useColorScheme();
|
|
3870
3783
|
const selectedTheme = theme ?? DEFAULT_INLINE_AD_THEME;
|
|
3871
3784
|
const resolvedTheme = selectedTheme === "auto" ? colorScheme === "dark" ? "dark" : "light" : selectedTheme;
|
|
@@ -3882,7 +3795,7 @@ function InlineAd(props) {
|
|
|
3882
3795
|
onAdFailedToRender,
|
|
3883
3796
|
onNoFill
|
|
3884
3797
|
};
|
|
3885
|
-
|
|
3798
|
+
useEffect13(() => {
|
|
3886
3799
|
isMountedRef.current = true;
|
|
3887
3800
|
return () => {
|
|
3888
3801
|
isMountedRef.current = false;
|
|
@@ -3892,7 +3805,7 @@ function InlineAd(props) {
|
|
|
3892
3805
|
}
|
|
3893
3806
|
};
|
|
3894
3807
|
}, []);
|
|
3895
|
-
|
|
3808
|
+
useEffect13(() => {
|
|
3896
3809
|
const normalizedAdGroupId = normalizeAdGroupId(adGroupId);
|
|
3897
3810
|
const loadAdRequest = () => {
|
|
3898
3811
|
if (loadingRef.current) {
|
|
@@ -3977,7 +3890,7 @@ function InlineAd(props) {
|
|
|
3977
3890
|
loadRef.current?.();
|
|
3978
3891
|
}
|
|
3979
3892
|
});
|
|
3980
|
-
|
|
3893
|
+
useEffect13(() => {
|
|
3981
3894
|
if (!ad || hasRenderedRef.current) {
|
|
3982
3895
|
return;
|
|
3983
3896
|
}
|