@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.cjs
CHANGED
|
@@ -54,15 +54,14 @@ var import_analytics2 = require("@apps-in-toss/analytics");
|
|
|
54
54
|
|
|
55
55
|
// src/core/registerApp.tsx
|
|
56
56
|
var import_analytics = require("@apps-in-toss/analytics");
|
|
57
|
-
var
|
|
58
|
-
var
|
|
57
|
+
var import_native_modules10 = require("@apps-in-toss/native-modules");
|
|
58
|
+
var import_react_native21 = require("@granite-js/react-native");
|
|
59
59
|
var import_tds_react_native10 = require("@toss/tds-react-native");
|
|
60
|
-
var
|
|
60
|
+
var import_react_native22 = require("react-native");
|
|
61
61
|
|
|
62
62
|
// src/core/components/AppEvent.tsx
|
|
63
|
-
var
|
|
64
|
-
var
|
|
65
|
-
var import_react3 = require("react");
|
|
63
|
+
var import_react_native2 = require("@granite-js/react-native");
|
|
64
|
+
var import_react = require("react");
|
|
66
65
|
|
|
67
66
|
// src/env.ts
|
|
68
67
|
var env = {
|
|
@@ -71,139 +70,67 @@ var env = {
|
|
|
71
70
|
getAppName: () => global.__granite.app.name
|
|
72
71
|
};
|
|
73
72
|
|
|
74
|
-
// src/hooks/useCaptureExitLog.ts
|
|
75
|
-
var import_native_modules = require("@apps-in-toss/native-modules");
|
|
76
|
-
var import_react_native3 = require("@granite-js/react-native");
|
|
77
|
-
var import_react2 = require("react");
|
|
78
|
-
|
|
79
|
-
// src/core/hooks/useReferrer.ts
|
|
80
|
-
var import_react_native = require("@granite-js/react-native");
|
|
81
|
-
var import_react = require("react");
|
|
82
|
-
function useReferrer() {
|
|
83
|
-
return (0, import_react.useMemo)(() => {
|
|
84
|
-
try {
|
|
85
|
-
return new URL((0, import_react_native.getSchemeUri)()).searchParams.get("referrer");
|
|
86
|
-
} catch {
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
}, []);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
73
|
// src/utils/isPrivateScheme.ts
|
|
93
|
-
var
|
|
74
|
+
var import_react_native = require("@granite-js/react-native");
|
|
94
75
|
function isPrivateScheme() {
|
|
95
76
|
try {
|
|
96
|
-
return new URL((0,
|
|
77
|
+
return new URL((0, import_react_native.getSchemeUri)()).protocol === "intoss-private:";
|
|
97
78
|
} catch {
|
|
98
79
|
return false;
|
|
99
80
|
}
|
|
100
81
|
}
|
|
101
82
|
|
|
102
|
-
// src/
|
|
103
|
-
var
|
|
104
|
-
var
|
|
105
|
-
function
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}, [visible]);
|
|
114
|
-
const captureExitLog = (0, import_react2.useCallback)(
|
|
115
|
-
(exitTime) => {
|
|
116
|
-
if (enterTime.current == null) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
const stayTime = Math.floor(exitTime - enterTime.current);
|
|
120
|
-
import_native_modules.INTERNAL__module.tossCoreEventLog({
|
|
121
|
-
log_name: EXIT_IMPRESSION_LOG_NAME,
|
|
122
|
-
log_type: "event",
|
|
123
|
-
params: {
|
|
124
|
-
schema_id: EXIT_IMPRESSION_SCHEMA_ID,
|
|
125
|
-
event_type: "impression",
|
|
126
|
-
referrer,
|
|
127
|
-
deployment_id: env.getDeploymentId(),
|
|
128
|
-
app_name: import_react_native3.Granite.appName,
|
|
129
|
-
is_private: isPrivateScheme(),
|
|
130
|
-
stay_time: stayTime.toString(),
|
|
131
|
-
exit_time: exitTime.toString()
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
enterTime.current = void 0;
|
|
135
|
-
},
|
|
136
|
-
[referrer]
|
|
137
|
-
);
|
|
138
|
-
return { captureExitLog };
|
|
83
|
+
// src/utils/sendLog.ts
|
|
84
|
+
var import_native_modules = require("@apps-in-toss/native-modules");
|
|
85
|
+
var DEFAULT_PIPELINES = ["core", "partner"];
|
|
86
|
+
function sendLog(logData, options) {
|
|
87
|
+
const { pipelines = DEFAULT_PIPELINES } = options ?? {};
|
|
88
|
+
if (pipelines.includes("core")) {
|
|
89
|
+
import_native_modules.INTERNAL__module.tossCoreEventLog(logData);
|
|
90
|
+
}
|
|
91
|
+
if (pipelines.includes("partner")) {
|
|
92
|
+
(0, import_native_modules.eventLog)(logData);
|
|
93
|
+
}
|
|
139
94
|
}
|
|
140
95
|
|
|
141
96
|
// src/core/components/AppEvent.tsx
|
|
142
|
-
var ENTRY_APP_EVENT_SCHEMA_ID = 1562181;
|
|
143
|
-
function EntryAppEvent() {
|
|
144
|
-
const referrer = useReferrer() ?? "";
|
|
145
|
-
(0, import_react3.useEffect)(() => {
|
|
146
|
-
import_native_modules2.INTERNAL__module.tossCoreEventLog({
|
|
147
|
-
log_name: "appsintoss_app_visit::impression__enter_appsintoss",
|
|
148
|
-
log_type: "info",
|
|
149
|
-
params: {
|
|
150
|
-
is_transform: true,
|
|
151
|
-
schema_id: ENTRY_APP_EVENT_SCHEMA_ID,
|
|
152
|
-
referrer,
|
|
153
|
-
deployment_id: env.getDeploymentId(),
|
|
154
|
-
app_name: import_react_native4.Granite.appName,
|
|
155
|
-
is_private: isPrivateScheme()
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
}, [referrer]);
|
|
159
|
-
return null;
|
|
160
|
-
}
|
|
161
97
|
function SystemAppEvent({ ...initialProps }) {
|
|
162
|
-
(0,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
98
|
+
(0, import_react.useEffect)(() => {
|
|
99
|
+
sendLog(
|
|
100
|
+
{
|
|
101
|
+
log_name: "AppsInTossInitialProps",
|
|
102
|
+
log_type: "debug",
|
|
103
|
+
params: {
|
|
104
|
+
...initialProps,
|
|
105
|
+
schemeUri: (0, import_react_native2.getSchemeUri)(),
|
|
106
|
+
deployment_id: env.getDeploymentId(),
|
|
107
|
+
app_name: import_react_native2.Granite.appName,
|
|
108
|
+
is_private: isPrivateScheme()
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{ pipelines: ["core"] }
|
|
112
|
+
);
|
|
174
113
|
}, [initialProps]);
|
|
175
114
|
return null;
|
|
176
115
|
}
|
|
177
|
-
function StayTimeAppEvent() {
|
|
178
|
-
const visible = (0, import_react_native4.useVisibility)();
|
|
179
|
-
const { captureExitLog } = useCaptureExitLog();
|
|
180
|
-
(0, import_react3.useEffect)(() => {
|
|
181
|
-
if (visible === false) {
|
|
182
|
-
captureExitLog(Date.now());
|
|
183
|
-
}
|
|
184
|
-
}, [visible, captureExitLog]);
|
|
185
|
-
return null;
|
|
186
|
-
}
|
|
187
116
|
var AppEvent = {
|
|
188
|
-
|
|
189
|
-
System: SystemAppEvent,
|
|
190
|
-
StayTime: StayTimeAppEvent
|
|
117
|
+
System: SystemAppEvent
|
|
191
118
|
};
|
|
192
119
|
|
|
193
120
|
// src/core/components/AppUpdate.tsx
|
|
194
|
-
var
|
|
195
|
-
var
|
|
121
|
+
var import_react_native3 = require("@granite-js/react-native");
|
|
122
|
+
var import_react2 = require("react");
|
|
196
123
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
197
124
|
var UPDATE_SCHEME = "servicetoss://update/forced/j?updateType=required";
|
|
198
125
|
function AppUpdate() {
|
|
199
|
-
(0,
|
|
200
|
-
(0,
|
|
126
|
+
(0, import_react2.useEffect)(() => {
|
|
127
|
+
(0, import_react_native3.openURL)(`supertoss://closePage?url=${UPDATE_SCHEME}`);
|
|
201
128
|
}, []);
|
|
202
129
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
|
|
203
130
|
}
|
|
204
131
|
|
|
205
132
|
// src/core/context/NavigationBarContext.tsx
|
|
206
|
-
var
|
|
133
|
+
var import_react3 = require("react");
|
|
207
134
|
|
|
208
135
|
// src/core/utils/getAppsInTossGlobals.ts
|
|
209
136
|
function getAppsInTossGlobals() {
|
|
@@ -227,11 +154,11 @@ function safeParseNavigationBar(navigationBar) {
|
|
|
227
154
|
|
|
228
155
|
// src/core/context/NavigationBarContext.tsx
|
|
229
156
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
230
|
-
var NavigationBarContext = (0,
|
|
157
|
+
var NavigationBarContext = (0, import_react3.createContext)(null);
|
|
231
158
|
function NavigationBarContextProvider({ children }) {
|
|
232
159
|
const globals = getAppsInTossGlobals();
|
|
233
160
|
const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
|
|
234
|
-
const [navigationRightButton, setNavigationRightButton] = (0,
|
|
161
|
+
const [navigationRightButton, setNavigationRightButton] = (0, import_react3.useState)(
|
|
235
162
|
parsedNavigationBar?.initialAccessoryButton
|
|
236
163
|
);
|
|
237
164
|
const addNavigationRightButton = (button) => {
|
|
@@ -249,7 +176,7 @@ function NavigationBarContextProvider({ children }) {
|
|
|
249
176
|
);
|
|
250
177
|
}
|
|
251
178
|
function useNavigationBarContext() {
|
|
252
|
-
const context = (0,
|
|
179
|
+
const context = (0, import_react3.useContext)(NavigationBarContext);
|
|
253
180
|
if (context == null) {
|
|
254
181
|
throw Error("useNavigationBarContext must be used within NavigationBarContextProvider");
|
|
255
182
|
}
|
|
@@ -257,17 +184,17 @@ function useNavigationBarContext() {
|
|
|
257
184
|
}
|
|
258
185
|
|
|
259
186
|
// src/components/RNAppContainer.tsx
|
|
260
|
-
var
|
|
261
|
-
var
|
|
262
|
-
var
|
|
187
|
+
var import_native_modules9 = require("@apps-in-toss/native-modules");
|
|
188
|
+
var import_react16 = require("react");
|
|
189
|
+
var import_react_native20 = require("react-native");
|
|
263
190
|
|
|
264
191
|
// src/components/GameInitializer.tsx
|
|
265
|
-
var
|
|
266
|
-
var
|
|
192
|
+
var import_native_modules4 = require("@apps-in-toss/native-modules");
|
|
193
|
+
var import_react_native9 = require("@granite-js/react-native");
|
|
267
194
|
var import_tds_react_native4 = require("@toss/tds-react-native");
|
|
268
195
|
var import_es_hangul = require("es-hangul");
|
|
269
|
-
var
|
|
270
|
-
var
|
|
196
|
+
var import_react10 = require("react");
|
|
197
|
+
var import_react_native10 = require("react-native");
|
|
271
198
|
|
|
272
199
|
// src/constant/game-center.ts
|
|
273
200
|
var GAME_PROFILE_WEBVIEW_URL = "servicetoss://game-center/profile";
|
|
@@ -277,24 +204,36 @@ var GAME_MIN_VERSION = {
|
|
|
277
204
|
};
|
|
278
205
|
|
|
279
206
|
// src/hooks/useAppUpdateDialog.tsx
|
|
280
|
-
var
|
|
281
|
-
var import_react_native7 = require("@granite-js/react-native");
|
|
207
|
+
var import_react_native6 = require("@granite-js/react-native");
|
|
282
208
|
var import_tds_react_native = require("@toss/tds-react-native");
|
|
283
|
-
var
|
|
209
|
+
var import_react5 = require("react");
|
|
210
|
+
|
|
211
|
+
// src/core/hooks/useReferrer.ts
|
|
212
|
+
var import_react_native4 = require("@granite-js/react-native");
|
|
213
|
+
var import_react4 = require("react");
|
|
214
|
+
function useReferrer() {
|
|
215
|
+
return (0, import_react4.useMemo)(() => {
|
|
216
|
+
try {
|
|
217
|
+
return new URL((0, import_react_native4.getSchemeUri)()).searchParams.get("referrer");
|
|
218
|
+
} catch {
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
221
|
+
}, []);
|
|
222
|
+
}
|
|
284
223
|
|
|
285
224
|
// src/utils/market.ts
|
|
286
|
-
var
|
|
225
|
+
var import_react_native5 = require("react-native");
|
|
287
226
|
var PLAYSTORE_LINK = "https://play.google.com/store/apps/details?id=viva.republica.toss";
|
|
288
227
|
var APPSTORE_LINK = "https://itunes.apple.com/app/id839333328";
|
|
289
228
|
var getMarketLink = () => {
|
|
290
|
-
return
|
|
229
|
+
return import_react_native5.Platform.OS === "android" ? PLAYSTORE_LINK : APPSTORE_LINK;
|
|
291
230
|
};
|
|
292
231
|
|
|
293
232
|
// src/hooks/useAppUpdateDialog.tsx
|
|
294
233
|
function useAppUpdateDialog() {
|
|
295
234
|
const { openConfirm } = (0, import_tds_react_native.useDialog)();
|
|
296
235
|
const logging = useAppUpdateDialogLogging();
|
|
297
|
-
const openAppUpdateDialog = (0,
|
|
236
|
+
const openAppUpdateDialog = (0, import_react5.useCallback)(
|
|
298
237
|
async ({
|
|
299
238
|
title,
|
|
300
239
|
description,
|
|
@@ -317,7 +256,7 @@ function useAppUpdateDialog() {
|
|
|
317
256
|
}
|
|
318
257
|
logging.update();
|
|
319
258
|
const STORE_SCHEME = getMarketLink();
|
|
320
|
-
(0,
|
|
259
|
+
(0, import_react_native6.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
|
|
321
260
|
},
|
|
322
261
|
[logging, openConfirm]
|
|
323
262
|
);
|
|
@@ -333,10 +272,10 @@ function useAppUpdateDialogLogging() {
|
|
|
333
272
|
const referrer = useReferrer();
|
|
334
273
|
const baseParams = {
|
|
335
274
|
referrer,
|
|
336
|
-
app_name:
|
|
275
|
+
app_name: import_react_native6.Granite.appName
|
|
337
276
|
};
|
|
338
277
|
const logUpdateClick = () => {
|
|
339
|
-
|
|
278
|
+
sendLog({
|
|
340
279
|
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
341
280
|
log_type: "event",
|
|
342
281
|
params: {
|
|
@@ -348,7 +287,7 @@ function useAppUpdateDialogLogging() {
|
|
|
348
287
|
});
|
|
349
288
|
};
|
|
350
289
|
const logCloseClick = () => {
|
|
351
|
-
|
|
290
|
+
sendLog({
|
|
352
291
|
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
353
292
|
log_type: "event",
|
|
354
293
|
params: {
|
|
@@ -360,7 +299,7 @@ function useAppUpdateDialogLogging() {
|
|
|
360
299
|
});
|
|
361
300
|
};
|
|
362
301
|
const logDialogShow = () => {
|
|
363
|
-
|
|
302
|
+
sendLog({
|
|
364
303
|
log_name: UPDATE_DIALOG_LOG_NAME,
|
|
365
304
|
log_type: "popup",
|
|
366
305
|
params: {
|
|
@@ -373,13 +312,13 @@ function useAppUpdateDialogLogging() {
|
|
|
373
312
|
}
|
|
374
313
|
|
|
375
314
|
// src/hooks/useGameCenterProfile.ts
|
|
376
|
-
var
|
|
377
|
-
var
|
|
315
|
+
var import_native_modules3 = require("@apps-in-toss/native-modules");
|
|
316
|
+
var import_react9 = require("react");
|
|
378
317
|
|
|
379
318
|
// src/hooks/useErrorAlert.ts
|
|
380
|
-
var
|
|
319
|
+
var import_react_native7 = require("@granite-js/react-native");
|
|
381
320
|
var import_tds_react_native2 = require("@toss/tds-react-native");
|
|
382
|
-
var
|
|
321
|
+
var import_react6 = require("react");
|
|
383
322
|
|
|
384
323
|
// src/utils/error.ts
|
|
385
324
|
var DEFAULT_ERROR = {
|
|
@@ -390,25 +329,25 @@ var DEFAULT_ERROR = {
|
|
|
390
329
|
// src/hooks/useErrorAlert.ts
|
|
391
330
|
var useErrorAlert = () => {
|
|
392
331
|
const { openAlert } = (0, import_tds_react_native2.useDialog)();
|
|
393
|
-
const openErrorAlert = (0,
|
|
332
|
+
const openErrorAlert = (0, import_react6.useCallback)(async () => {
|
|
394
333
|
await openAlert({
|
|
395
334
|
title: DEFAULT_ERROR.title,
|
|
396
335
|
description: DEFAULT_ERROR.description
|
|
397
336
|
});
|
|
398
|
-
(0,
|
|
337
|
+
(0, import_react_native7.closeView)();
|
|
399
338
|
}, [openAlert]);
|
|
400
339
|
return { open: openErrorAlert };
|
|
401
340
|
};
|
|
402
341
|
|
|
403
342
|
// src/hooks/useTransparentWebview.tsx
|
|
404
|
-
var
|
|
343
|
+
var import_react7 = require("react");
|
|
405
344
|
|
|
406
345
|
// src/utils/openTransparentWebView.ts
|
|
407
|
-
var
|
|
346
|
+
var import_react_native8 = require("@granite-js/react-native");
|
|
408
347
|
|
|
409
348
|
// src/private.ts
|
|
410
|
-
var
|
|
411
|
-
var INTERNAL__onVisibilityChangedByTransparentServiceWeb =
|
|
349
|
+
var import_native_modules2 = require("@apps-in-toss/native-modules");
|
|
350
|
+
var INTERNAL__onVisibilityChangedByTransparentServiceWeb = import_native_modules2.onVisibilityChangedByTransparentServiceWeb;
|
|
412
351
|
|
|
413
352
|
// src/utils/openTransparentWebView.ts
|
|
414
353
|
var openTransparentWebView = ({
|
|
@@ -438,14 +377,14 @@ var openTransparentWebView = ({
|
|
|
438
377
|
}
|
|
439
378
|
}
|
|
440
379
|
});
|
|
441
|
-
(0,
|
|
380
|
+
(0, import_react_native8.openURL)(url.toString());
|
|
442
381
|
};
|
|
443
382
|
|
|
444
383
|
// src/hooks/useTransparentWebview.tsx
|
|
445
384
|
var useTransparentWebview = () => {
|
|
446
|
-
const [isWebviewLoading, setIsWebviewLoading] = (0,
|
|
385
|
+
const [isWebviewLoading, setIsWebviewLoading] = (0, import_react7.useState)(false);
|
|
447
386
|
const { open: openErrorAlert } = useErrorAlert();
|
|
448
|
-
const _openTransparentWebview = (0,
|
|
387
|
+
const _openTransparentWebview = (0, import_react7.useCallback)(
|
|
449
388
|
({ webUrl, onClose, onError }) => {
|
|
450
389
|
if (isWebviewLoading) {
|
|
451
390
|
return;
|
|
@@ -479,11 +418,11 @@ var useTransparentWebview = () => {
|
|
|
479
418
|
// src/components/GameProfileToast.tsx
|
|
480
419
|
var import_tds_react_native3 = require("@toss/tds-react-native");
|
|
481
420
|
var import_private2 = require("@toss/tds-react-native/private");
|
|
482
|
-
var
|
|
421
|
+
var import_react8 = require("react");
|
|
483
422
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
484
423
|
var useGameProfileToast = () => {
|
|
485
424
|
const overlay = (0, import_private2.useOverlay)();
|
|
486
|
-
const openGameProfileToast = (0,
|
|
425
|
+
const openGameProfileToast = (0, import_react8.useCallback)(
|
|
487
426
|
(nickname, profileImageUri) => {
|
|
488
427
|
return new Promise((resolve) => {
|
|
489
428
|
overlay.open(({ isOpen, close, exit }) => {
|
|
@@ -518,18 +457,18 @@ var useGameProfileToast = () => {
|
|
|
518
457
|
|
|
519
458
|
// src/hooks/useGameCenterProfile.ts
|
|
520
459
|
var useGameCenterProfile = () => {
|
|
521
|
-
const [profileData, setProfileData] = (0,
|
|
522
|
-
const [isProfileDataLoading, setIsProfileDataLoading] = (0,
|
|
523
|
-
const [isProfileDataRefetching, setIsProfileDataRefetching] = (0,
|
|
460
|
+
const [profileData, setProfileData] = (0, import_react9.useState)(void 0);
|
|
461
|
+
const [isProfileDataLoading, setIsProfileDataLoading] = (0, import_react9.useState)(true);
|
|
462
|
+
const [isProfileDataRefetching, setIsProfileDataRefetching] = (0, import_react9.useState)(false);
|
|
524
463
|
const shouldShowProfileLoadingOverlay = isProfileDataLoading || isProfileDataRefetching;
|
|
525
464
|
const shouldShowProfileNotFoundOverlay = profileData?.statusCode === "PROFILE_NOT_FOUND" && !isProfileDataRefetching;
|
|
526
465
|
const canShowBottomSheetOrToast = !isProfileDataLoading;
|
|
527
466
|
const { openGameProfileToast } = useGameProfileToast();
|
|
528
467
|
const { open: openErrorAlert } = useErrorAlert();
|
|
529
468
|
const { open: openTransparentWebView2 } = useTransparentWebview();
|
|
530
|
-
const fetchProfileData = (0,
|
|
469
|
+
const fetchProfileData = (0, import_react9.useCallback)(async () => {
|
|
531
470
|
try {
|
|
532
|
-
const data = await (0,
|
|
471
|
+
const data = await (0, import_native_modules3.getGameCenterGameProfile)();
|
|
533
472
|
setProfileData(data);
|
|
534
473
|
setIsProfileDataLoading(false);
|
|
535
474
|
} catch (_) {
|
|
@@ -537,10 +476,10 @@ var useGameCenterProfile = () => {
|
|
|
537
476
|
setIsProfileDataLoading(false);
|
|
538
477
|
}
|
|
539
478
|
}, [openErrorAlert]);
|
|
540
|
-
const refetchProfileData = (0,
|
|
479
|
+
const refetchProfileData = (0, import_react9.useCallback)(async () => {
|
|
541
480
|
try {
|
|
542
481
|
setIsProfileDataRefetching(true);
|
|
543
|
-
const data = await (0,
|
|
482
|
+
const data = await (0, import_native_modules3.getGameCenterGameProfile)();
|
|
544
483
|
setProfileData(data);
|
|
545
484
|
setIsProfileDataRefetching(false);
|
|
546
485
|
if (data?.statusCode === "SUCCESS") {
|
|
@@ -551,7 +490,7 @@ var useGameCenterProfile = () => {
|
|
|
551
490
|
openErrorAlert();
|
|
552
491
|
}
|
|
553
492
|
}, [openErrorAlert, openGameProfileToast]);
|
|
554
|
-
const openProfileWebview = (0,
|
|
493
|
+
const openProfileWebview = (0, import_react9.useCallback)(() => {
|
|
555
494
|
openTransparentWebView2({
|
|
556
495
|
webUrl: `${GAME_PROFILE_WEBVIEW_URL}?appName=${getAppName()}&referrer=appsintoss.${getAppName()}`,
|
|
557
496
|
onClose: async () => {
|
|
@@ -595,12 +534,12 @@ var GameInitializer = ({ children }) => {
|
|
|
595
534
|
openGameProfileToast,
|
|
596
535
|
fetchProfileData
|
|
597
536
|
} = useGameCenterProfile();
|
|
598
|
-
const isCompletedFlow = (0,
|
|
537
|
+
const isCompletedFlow = (0, import_react10.useRef)(false);
|
|
599
538
|
const { open: openAppUpdateDialog } = useAppUpdateDialog();
|
|
600
|
-
(0,
|
|
539
|
+
(0, import_react10.useEffect)(() => {
|
|
601
540
|
fetchProfileData();
|
|
602
541
|
}, []);
|
|
603
|
-
(0,
|
|
542
|
+
(0, import_react10.useEffect)(() => {
|
|
604
543
|
const handleGameProfileFlow = async () => {
|
|
605
544
|
if (!canShowBottomSheetOrToast) {
|
|
606
545
|
return;
|
|
@@ -609,12 +548,12 @@ var GameInitializer = ({ children }) => {
|
|
|
609
548
|
return;
|
|
610
549
|
}
|
|
611
550
|
isCompletedFlow.current = true;
|
|
612
|
-
if (!(0,
|
|
551
|
+
if (!(0, import_native_modules4.isMinVersionSupported)(GAME_MIN_VERSION)) {
|
|
613
552
|
openAppUpdateDialog({
|
|
614
553
|
title: `${(0, import_es_hangul.josa)(getAppsInTossGlobals().brandDisplayName, "\uC744/\uB97C")} \uD558\uB824\uBA74
|
|
615
554
|
\uC571\uC744 \uC5C5\uB370\uC774\uD2B8\uD574\uC8FC\uC138\uC694`,
|
|
616
555
|
onDismiss: () => {
|
|
617
|
-
(0,
|
|
556
|
+
(0, import_react_native9.closeView)();
|
|
618
557
|
}
|
|
619
558
|
});
|
|
620
559
|
return;
|
|
@@ -636,11 +575,11 @@ var GameInitializer = ({ children }) => {
|
|
|
636
575
|
openProfileWebview,
|
|
637
576
|
profileData
|
|
638
577
|
]);
|
|
639
|
-
if (!(0,
|
|
578
|
+
if (!(0, import_native_modules4.isMinVersionSupported)(GAME_MIN_VERSION)) {
|
|
640
579
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
641
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
580
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native10.View, { style: { flex: 1, position: "relative" }, children }),
|
|
642
581
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
643
|
-
|
|
582
|
+
import_react_native10.Pressable,
|
|
644
583
|
{
|
|
645
584
|
style: {
|
|
646
585
|
...overlayStyle
|
|
@@ -650,7 +589,7 @@ var GameInitializer = ({ children }) => {
|
|
|
650
589
|
title: `${(0, import_es_hangul.josa)(getAppsInTossGlobals().brandDisplayName, "\uC744/\uB97C")} \uD558\uB824\uBA74
|
|
651
590
|
\uC571\uC744 \uC5C5\uB370\uC774\uD2B8\uD574\uC8FC\uC138\uC694`,
|
|
652
591
|
onDismiss: () => {
|
|
653
|
-
(0,
|
|
592
|
+
(0, import_react_native9.closeView)();
|
|
654
593
|
}
|
|
655
594
|
});
|
|
656
595
|
}
|
|
@@ -660,9 +599,9 @@ var GameInitializer = ({ children }) => {
|
|
|
660
599
|
}
|
|
661
600
|
if (shouldShowProfileLoadingOverlay) {
|
|
662
601
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
663
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
602
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native10.View, { style: { flex: 1, position: "relative" }, children }),
|
|
664
603
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
665
|
-
|
|
604
|
+
import_react_native10.View,
|
|
666
605
|
{
|
|
667
606
|
style: {
|
|
668
607
|
...overlayStyle,
|
|
@@ -677,9 +616,9 @@ var GameInitializer = ({ children }) => {
|
|
|
677
616
|
}
|
|
678
617
|
if (shouldShowProfileNotFoundOverlay) {
|
|
679
618
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
680
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
619
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native10.View, { style: { flex: 1, position: "relative" }, children }),
|
|
681
620
|
shouldShowProfileNotFoundOverlay && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
682
|
-
|
|
621
|
+
import_react_native10.Pressable,
|
|
683
622
|
{
|
|
684
623
|
style: {
|
|
685
624
|
...overlayStyle
|
|
@@ -691,7 +630,7 @@ var GameInitializer = ({ children }) => {
|
|
|
691
630
|
)
|
|
692
631
|
] });
|
|
693
632
|
}
|
|
694
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native10.View, { style: { flex: 1, position: "relative" }, children }) });
|
|
695
634
|
};
|
|
696
635
|
var overlayStyle = {
|
|
697
636
|
position: "absolute",
|
|
@@ -706,31 +645,31 @@ var overlayStyle = {
|
|
|
706
645
|
var import_private5 = require("@toss/tds-react-native/private");
|
|
707
646
|
|
|
708
647
|
// src/components/NavigationBar/RNNavigationBar/hooks/useHardwareBackPress.ts
|
|
709
|
-
var
|
|
710
|
-
var
|
|
648
|
+
var import_react11 = require("react");
|
|
649
|
+
var import_react_native11 = require("react-native");
|
|
711
650
|
function useHardwareBackPress(handler) {
|
|
712
|
-
(0,
|
|
651
|
+
(0, import_react11.useEffect)(() => {
|
|
713
652
|
const handleBackPress = () => {
|
|
714
653
|
handler();
|
|
715
654
|
return true;
|
|
716
655
|
};
|
|
717
|
-
const backHandler =
|
|
656
|
+
const backHandler = import_react_native11.BackHandler.addEventListener("hardwareBackPress", handleBackPress);
|
|
718
657
|
return () => backHandler.remove();
|
|
719
658
|
}, [handler]);
|
|
720
659
|
}
|
|
721
660
|
|
|
722
661
|
// src/components/NavigationBar/RNNavigationBar/hooks/useNavigationEvent.ts
|
|
723
|
-
var
|
|
724
|
-
var
|
|
662
|
+
var import_react_native13 = require("@granite-js/react-native");
|
|
663
|
+
var import_react13 = require("react");
|
|
725
664
|
|
|
726
665
|
// src/components/NavigationBar/RNNavigationBar/hooks/useCloseConfirm.ts
|
|
727
666
|
var import_tds_react_native5 = require("@toss/tds-react-native");
|
|
728
667
|
var import_es_hangul2 = require("es-hangul");
|
|
729
|
-
var
|
|
668
|
+
var import_react12 = require("react");
|
|
730
669
|
function useCloseConfirm() {
|
|
731
670
|
const { brandDisplayName } = getAppsInTossGlobals();
|
|
732
671
|
const { openConfirm } = (0, import_tds_react_native5.useDialog)();
|
|
733
|
-
return (0,
|
|
672
|
+
return (0, import_react12.useCallback)(
|
|
734
673
|
async ({ onEntered }) => {
|
|
735
674
|
return await openConfirm({
|
|
736
675
|
title: `${(0, import_es_hangul2.josa)(brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
@@ -785,8 +724,7 @@ var homeEvent = createEvent("homeEvent");
|
|
|
785
724
|
var safeAreaInsetsChange = createEvent("safeAreaInsetsChange");
|
|
786
725
|
|
|
787
726
|
// src/components/NavigationBar/common/useNavigationBarLogging.tsx
|
|
788
|
-
var
|
|
789
|
-
var import_react_native13 = require("@granite-js/react-native");
|
|
727
|
+
var import_react_native12 = require("@granite-js/react-native");
|
|
790
728
|
var NAVI_BAR_IMPRESSION_SCHEMA_ID = 1596837;
|
|
791
729
|
var NAVI_BAR_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__navigation_bar";
|
|
792
730
|
var CLOSE_POPUP_SHOW_SCHEMA_ID = 1644490;
|
|
@@ -801,10 +739,10 @@ function useNavigationBarLogging() {
|
|
|
801
739
|
const referrer = useReferrer();
|
|
802
740
|
const baseParams = {
|
|
803
741
|
referrer,
|
|
804
|
-
app_name:
|
|
742
|
+
app_name: import_react_native12.Granite.appName
|
|
805
743
|
};
|
|
806
744
|
const logNavBarImpression = (naviBarConfig) => {
|
|
807
|
-
|
|
745
|
+
sendLog({
|
|
808
746
|
log_name: NAVI_BAR_IMPRESSION_LOG_NAME,
|
|
809
747
|
log_type: "event",
|
|
810
748
|
params: {
|
|
@@ -816,7 +754,7 @@ function useNavigationBarLogging() {
|
|
|
816
754
|
});
|
|
817
755
|
};
|
|
818
756
|
const logHomeButtonClick = () => {
|
|
819
|
-
|
|
757
|
+
sendLog({
|
|
820
758
|
log_name: HOME_BUTTON_CLICK_LOG_NAME,
|
|
821
759
|
log_type: "event",
|
|
822
760
|
params: {
|
|
@@ -827,7 +765,7 @@ function useNavigationBarLogging() {
|
|
|
827
765
|
});
|
|
828
766
|
};
|
|
829
767
|
const logCloseButtonClick = () => {
|
|
830
|
-
|
|
768
|
+
sendLog({
|
|
831
769
|
log_name: CLOSE_BUTTON_CLICK_LOG_NAME,
|
|
832
770
|
log_type: "event",
|
|
833
771
|
params: {
|
|
@@ -838,7 +776,7 @@ function useNavigationBarLogging() {
|
|
|
838
776
|
});
|
|
839
777
|
};
|
|
840
778
|
const logClosePopupShow = () => {
|
|
841
|
-
|
|
779
|
+
sendLog({
|
|
842
780
|
log_name: CLOSE_POPUP_SHOW_LOG_NAME,
|
|
843
781
|
log_type: "popup",
|
|
844
782
|
params: {
|
|
@@ -848,7 +786,7 @@ function useNavigationBarLogging() {
|
|
|
848
786
|
});
|
|
849
787
|
};
|
|
850
788
|
const logClosePopupCtaClick = (confirm) => {
|
|
851
|
-
|
|
789
|
+
sendLog({
|
|
852
790
|
log_name: CLOSE_POPUP_CTA_CLICK_LOG_NAME,
|
|
853
791
|
log_type: "event",
|
|
854
792
|
params: {
|
|
@@ -870,20 +808,18 @@ function useNavigationBarLogging() {
|
|
|
870
808
|
|
|
871
809
|
// src/components/NavigationBar/RNNavigationBar/hooks/useNavigationEvent.ts
|
|
872
810
|
function useNavigationEvent() {
|
|
873
|
-
const backEventContext = (0,
|
|
811
|
+
const backEventContext = (0, import_react_native13.useBackEventContext)();
|
|
874
812
|
const logging = useNavigationBarLogging();
|
|
875
|
-
const navigation = (0,
|
|
813
|
+
const navigation = (0, import_react_native13.useNavigation)();
|
|
876
814
|
const closeConfirm = useCloseConfirm();
|
|
877
|
-
|
|
878
|
-
return (0, import_react14.useMemo)(() => {
|
|
815
|
+
return (0, import_react13.useMemo)(() => {
|
|
879
816
|
const close = async () => {
|
|
880
817
|
const hasConfirmed = await closeConfirm({
|
|
881
818
|
onEntered: logging.closePopupShow
|
|
882
819
|
});
|
|
883
820
|
logging.closePopupCtaClick(hasConfirmed);
|
|
884
821
|
if (hasConfirmed) {
|
|
885
|
-
|
|
886
|
-
(0, import_react_native14.closeView)();
|
|
822
|
+
(0, import_react_native13.closeView)();
|
|
887
823
|
}
|
|
888
824
|
};
|
|
889
825
|
return {
|
|
@@ -909,29 +845,28 @@ function useNavigationEvent() {
|
|
|
909
845
|
close();
|
|
910
846
|
}
|
|
911
847
|
};
|
|
912
|
-
}, [backEventContext, navigation, closeConfirm, logging
|
|
848
|
+
}, [backEventContext, navigation, closeConfirm, logging]);
|
|
913
849
|
}
|
|
914
850
|
|
|
915
851
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
916
|
-
var
|
|
917
|
-
var
|
|
852
|
+
var import_native_modules8 = require("@apps-in-toss/native-modules");
|
|
853
|
+
var import_react_native18 = require("@granite-js/react-native");
|
|
918
854
|
var import_tds_react_native8 = require("@toss/tds-react-native");
|
|
919
855
|
var import_private4 = require("@toss/tds-react-native/private");
|
|
920
|
-
var
|
|
856
|
+
var import_react14 = require("react");
|
|
921
857
|
|
|
922
858
|
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
923
|
-
var
|
|
924
|
-
var
|
|
859
|
+
var import_native_modules5 = require("@apps-in-toss/native-modules");
|
|
860
|
+
var import_react_native16 = require("@granite-js/react-native");
|
|
925
861
|
var import_tds_react_native7 = require("@toss/tds-react-native");
|
|
926
862
|
|
|
927
863
|
// src/core/hooks/useMoreButtonBottomSheet/Menu.tsx
|
|
928
864
|
var import_tds_react_native6 = require("@toss/tds-react-native");
|
|
929
865
|
var import_private3 = require("@toss/tds-react-native/private");
|
|
930
|
-
var
|
|
866
|
+
var import_react_native15 = require("react-native");
|
|
931
867
|
|
|
932
868
|
// src/core/hooks/useMoreButtonBottomSheet/useMoreButtonBottomSheetLogging.tsx
|
|
933
|
-
var
|
|
934
|
-
var import_react_native15 = require("@granite-js/react-native");
|
|
869
|
+
var import_react_native14 = require("@granite-js/react-native");
|
|
935
870
|
var BOTTOM_SHEET_SCHEMA_ID = 1596825;
|
|
936
871
|
var BOTTOM_SHEET_LOG_NAME = "appsintoss_app_visit__common_module::bottomsheet__more";
|
|
937
872
|
var BOTTOM_SHEET_OPEN_SCHEMA_ID = 1596829;
|
|
@@ -944,10 +879,10 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
944
879
|
const referrer = useReferrer();
|
|
945
880
|
const baseParams = {
|
|
946
881
|
referrer,
|
|
947
|
-
app_name:
|
|
882
|
+
app_name: import_react_native14.Granite.appName
|
|
948
883
|
};
|
|
949
884
|
const logBottomSheetShow = () => {
|
|
950
|
-
|
|
885
|
+
sendLog({
|
|
951
886
|
log_name: BOTTOM_SHEET_LOG_NAME,
|
|
952
887
|
log_type: "popup",
|
|
953
888
|
params: {
|
|
@@ -957,7 +892,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
957
892
|
});
|
|
958
893
|
};
|
|
959
894
|
const logBottomSheetOpen = () => {
|
|
960
|
-
|
|
895
|
+
sendLog({
|
|
961
896
|
log_name: BOTTOM_SHEET_OPEN_LOG_NAME,
|
|
962
897
|
log_type: "event",
|
|
963
898
|
params: {
|
|
@@ -968,7 +903,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
968
903
|
});
|
|
969
904
|
};
|
|
970
905
|
const logBottomSheetCloseClick = () => {
|
|
971
|
-
|
|
906
|
+
sendLog({
|
|
972
907
|
log_name: BOTTOM_SHEET_CLOSE_CLICK_LOG_NAME,
|
|
973
908
|
log_type: "event",
|
|
974
909
|
params: {
|
|
@@ -979,7 +914,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
979
914
|
});
|
|
980
915
|
};
|
|
981
916
|
const logBottomSheetMenuClick = ({ title }) => {
|
|
982
|
-
|
|
917
|
+
sendLog({
|
|
983
918
|
log_name: BOTTOM_SHEET_MENU_CLICK_LOG_NAME,
|
|
984
919
|
log_type: "event",
|
|
985
920
|
params: {
|
|
@@ -1011,7 +946,7 @@ function Menu({ title, iconURL, onPress }) {
|
|
|
1011
946
|
import_tds_react_native6.ListRow,
|
|
1012
947
|
{
|
|
1013
948
|
left: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1014
|
-
|
|
949
|
+
import_react_native15.View,
|
|
1015
950
|
{
|
|
1016
951
|
style: {
|
|
1017
952
|
width: 30,
|
|
@@ -1071,8 +1006,8 @@ var APP_SHARE_MENU_INFO = {
|
|
|
1071
1006
|
contactIconUrl: "https://static.toss.im/icons/png/4x/icon-share-dots-mono.png"
|
|
1072
1007
|
};
|
|
1073
1008
|
function AppShareListMenu() {
|
|
1074
|
-
const initialScheme = (0,
|
|
1075
|
-
const isSandbox = (0,
|
|
1009
|
+
const initialScheme = (0, import_react_native16.getSchemeUri)();
|
|
1010
|
+
const isSandbox = (0, import_native_modules5.getOperationalEnvironment)() === "sandbox";
|
|
1076
1011
|
const { openConfirm } = (0, import_tds_react_native7.useDialog)();
|
|
1077
1012
|
const schemeForShare = addParamsToUrl(initialScheme, {
|
|
1078
1013
|
referrer: SHARE_SCHEME_REFERRER
|
|
@@ -1092,17 +1027,17 @@ function AppShareListMenu() {
|
|
|
1092
1027
|
});
|
|
1093
1028
|
return;
|
|
1094
1029
|
}
|
|
1095
|
-
(0,
|
|
1030
|
+
(0, import_native_modules5.shareWithScheme)({ schemeURL: schemeForShare });
|
|
1096
1031
|
}
|
|
1097
1032
|
}
|
|
1098
1033
|
);
|
|
1099
1034
|
}
|
|
1100
1035
|
|
|
1101
1036
|
// src/core/hooks/useMoreButtonBottomSheet/HomeShortcutMenu.tsx
|
|
1102
|
-
var
|
|
1037
|
+
var import_native_modules6 = require("@apps-in-toss/native-modules");
|
|
1103
1038
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1104
1039
|
function HomeShortcutMenu() {
|
|
1105
|
-
const isSandbox = (0,
|
|
1040
|
+
const isSandbox = (0, import_native_modules6.getOperationalEnvironment)() === "sandbox";
|
|
1106
1041
|
const globals = getAppsInTossGlobals();
|
|
1107
1042
|
if (isSandbox) {
|
|
1108
1043
|
return null;
|
|
@@ -1113,7 +1048,7 @@ function HomeShortcutMenu() {
|
|
|
1113
1048
|
title: "\uD648 \uD654\uBA74\uC5D0 \uCD94\uAC00",
|
|
1114
1049
|
iconURL: "https://static.toss.im/icons/png/4x/icon-plus-circle-mono.png",
|
|
1115
1050
|
onPress: () => {
|
|
1116
|
-
|
|
1051
|
+
import_native_modules6.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1117
1052
|
"addMiniAppShortcut",
|
|
1118
1053
|
{
|
|
1119
1054
|
title: globals.brandDisplayName,
|
|
@@ -1131,12 +1066,12 @@ function HomeShortcutMenu() {
|
|
|
1131
1066
|
}
|
|
1132
1067
|
|
|
1133
1068
|
// src/core/hooks/useMoreButtonBottomSheet/SettingsMenu.tsx
|
|
1134
|
-
var
|
|
1135
|
-
var
|
|
1069
|
+
var import_native_modules7 = require("@apps-in-toss/native-modules");
|
|
1070
|
+
var import_react_native17 = require("@granite-js/react-native");
|
|
1136
1071
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1137
1072
|
function SettingsMenu() {
|
|
1138
1073
|
const globals = getAppsInTossGlobals();
|
|
1139
|
-
if ((0,
|
|
1074
|
+
if ((0, import_native_modules7.getOperationalEnvironment)() === "sandbox") {
|
|
1140
1075
|
return null;
|
|
1141
1076
|
}
|
|
1142
1077
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
@@ -1144,8 +1079,8 @@ function SettingsMenu() {
|
|
|
1144
1079
|
{
|
|
1145
1080
|
title: "\uC124\uC815",
|
|
1146
1081
|
iconURL: "https://static.toss.im/icons/png/4x/icon-setting-mono.png",
|
|
1147
|
-
onPress: () => (0,
|
|
1148
|
-
`servicetoss://apps-in-toss-menu/settings?appName=${
|
|
1082
|
+
onPress: () => (0, import_react_native17.openURL)(
|
|
1083
|
+
`servicetoss://apps-in-toss-menu/settings?appName=${import_react_native17.Granite.appName}&displayAppName=${globals.brandDisplayName}`
|
|
1149
1084
|
)
|
|
1150
1085
|
}
|
|
1151
1086
|
);
|
|
@@ -1183,20 +1118,20 @@ var MIN_VERSION = {
|
|
|
1183
1118
|
function useMoreButtonBottomSheet() {
|
|
1184
1119
|
const globals = getAppsInTossGlobals();
|
|
1185
1120
|
const adaptive = (0, import_private4.useAdaptive)();
|
|
1186
|
-
const [itemList, setItemList] = (0,
|
|
1121
|
+
const [itemList, setItemList] = (0, import_react14.useState)([]);
|
|
1187
1122
|
const appUpdateDialog = useAppUpdateDialog();
|
|
1188
1123
|
const logging = useMoreButtonBottomSheetLogging();
|
|
1189
1124
|
const overlay = (0, import_private4.useOverlay)();
|
|
1190
1125
|
const title = ensureValue(globals.brandDisplayName, "displayName");
|
|
1191
|
-
const isHomeShortcutSupported = (0,
|
|
1192
|
-
const isBottomSheetSupported = (0,
|
|
1193
|
-
const isShareListMenuSupported = (0,
|
|
1194
|
-
const isSettingsMenuSupported = (0,
|
|
1195
|
-
(0,
|
|
1126
|
+
const isHomeShortcutSupported = (0, import_native_modules8.isMinVersionSupported)(MIN_VERSION.HOME_SHORTCUT_MENU);
|
|
1127
|
+
const isBottomSheetSupported = (0, import_native_modules8.isMinVersionSupported)(MIN_VERSION.BOTTOM_SHEET);
|
|
1128
|
+
const isShareListMenuSupported = (0, import_native_modules8.isMinVersionSupported)(MIN_VERSION.SHARE_LIST_MENU);
|
|
1129
|
+
const isSettingsMenuSupported = (0, import_native_modules8.isMinVersionSupported)(MIN_VERSION.SETTINGS_MENU);
|
|
1130
|
+
(0, import_react14.useEffect)(() => {
|
|
1196
1131
|
if (!isBottomSheetSupported) {
|
|
1197
1132
|
return;
|
|
1198
1133
|
}
|
|
1199
|
-
|
|
1134
|
+
import_native_modules8.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1200
1135
|
APP_BRIDGE_METHOD_NAME,
|
|
1201
1136
|
{},
|
|
1202
1137
|
{
|
|
@@ -1249,7 +1184,7 @@ function useMoreButtonBottomSheet() {
|
|
|
1249
1184
|
{
|
|
1250
1185
|
title: item.contactItemName,
|
|
1251
1186
|
iconURL: item.contactIconUrl,
|
|
1252
|
-
onPress: () => (0,
|
|
1187
|
+
onPress: () => (0, import_react_native18.openURL)(item.contactUri)
|
|
1253
1188
|
},
|
|
1254
1189
|
item.contactItemName
|
|
1255
1190
|
)),
|
|
@@ -1265,7 +1200,7 @@ function useMoreButtonBottomSheet() {
|
|
|
1265
1200
|
}
|
|
1266
1201
|
function BottomSheetImpressionArea({ children }) {
|
|
1267
1202
|
const logging = useMoreButtonBottomSheetLogging();
|
|
1268
|
-
(0,
|
|
1203
|
+
(0, import_react14.useEffect)(() => {
|
|
1269
1204
|
logging.show();
|
|
1270
1205
|
}, [logging]);
|
|
1271
1206
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children });
|
|
@@ -1277,15 +1212,15 @@ function toIcon(source) {
|
|
|
1277
1212
|
}
|
|
1278
1213
|
|
|
1279
1214
|
// src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
|
|
1280
|
-
var
|
|
1215
|
+
var import_react15 = require("react");
|
|
1281
1216
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1282
1217
|
function NavigationBarImpressionArea({
|
|
1283
1218
|
children,
|
|
1284
1219
|
withHomeButton
|
|
1285
1220
|
}) {
|
|
1286
|
-
const hasLogged = (0,
|
|
1221
|
+
const hasLogged = (0, import_react15.useRef)(false);
|
|
1287
1222
|
const logging = useNavigationBarLogging();
|
|
1288
|
-
(0,
|
|
1223
|
+
(0, import_react15.useEffect)(() => {
|
|
1289
1224
|
if (hasLogged.current === false) {
|
|
1290
1225
|
logging.navBarImpression({ home_icon_yn: withHomeButton ? "Y" : "N" });
|
|
1291
1226
|
hasLogged.current = true;
|
|
@@ -1326,7 +1261,7 @@ function DefaultNavigationBar() {
|
|
|
1326
1261
|
var import_react_native_safe_area_context = require("@granite-js/native/react-native-safe-area-context");
|
|
1327
1262
|
var import_tds_react_native9 = require("@toss/tds-react-native");
|
|
1328
1263
|
var import_private6 = require("@toss/tds-react-native/private");
|
|
1329
|
-
var
|
|
1264
|
+
var import_react_native19 = require("react-native");
|
|
1330
1265
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1331
1266
|
function GameNavigationBar() {
|
|
1332
1267
|
const safeAreaTop = (0, import_private6.useSafeAreaTop)();
|
|
@@ -1338,12 +1273,12 @@ function GameNavigationBar() {
|
|
|
1338
1273
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1339
1274
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_tds_react_native9.PageNavbar, { preference: { type: "none" } }),
|
|
1340
1275
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1341
|
-
|
|
1276
|
+
import_react_native19.View,
|
|
1342
1277
|
{
|
|
1343
1278
|
style: {
|
|
1344
1279
|
width: "100%",
|
|
1345
1280
|
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1346
|
-
height:
|
|
1281
|
+
height: import_react_native19.Platform.OS === "ios" ? 44 : 54,
|
|
1347
1282
|
flexDirection: "row",
|
|
1348
1283
|
alignItems: "center",
|
|
1349
1284
|
justifyContent: "flex-end",
|
|
@@ -1392,11 +1327,11 @@ function RNAppContainer({ children }) {
|
|
|
1392
1327
|
}
|
|
1393
1328
|
}
|
|
1394
1329
|
function GameAppContainer({ children }) {
|
|
1395
|
-
(0,
|
|
1396
|
-
if (
|
|
1397
|
-
(0,
|
|
1330
|
+
(0, import_react16.useEffect)(() => {
|
|
1331
|
+
if (import_react_native20.Platform.OS === "ios") {
|
|
1332
|
+
(0, import_native_modules9.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1398
1333
|
return () => {
|
|
1399
|
-
(0,
|
|
1334
|
+
(0, import_native_modules9.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1400
1335
|
};
|
|
1401
1336
|
}
|
|
1402
1337
|
return;
|
|
@@ -1416,36 +1351,33 @@ function GeneralAppContainer({ children }) {
|
|
|
1416
1351
|
// src/core/registerApp.tsx
|
|
1417
1352
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1418
1353
|
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
1419
|
-
if (!(0,
|
|
1354
|
+
if (!(0, import_native_modules10.isMinVersionSupported)({
|
|
1420
1355
|
android: "5.220.0",
|
|
1421
1356
|
ios: "5.221.0"
|
|
1422
1357
|
})) {
|
|
1423
1358
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1424
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AppEvent.Entry, {}),
|
|
1425
1359
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AppEvent.System, { ...initialProps }),
|
|
1426
1360
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AppUpdate, {})
|
|
1427
1361
|
] });
|
|
1428
1362
|
}
|
|
1429
1363
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1430
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AppEvent.StayTime, {}),
|
|
1431
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AppEvent.Entry, {}),
|
|
1432
1364
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AppEvent.System, { ...initialProps }),
|
|
1433
1365
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_tds_react_native10.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children }) })
|
|
1434
1366
|
] });
|
|
1435
1367
|
}
|
|
1436
1368
|
function registerApp(container, { context, analytics }) {
|
|
1437
1369
|
const appName = getAppName();
|
|
1438
|
-
const isRegistered =
|
|
1370
|
+
const isRegistered = import_react_native22.AppRegistry.getAppKeys().includes(appName);
|
|
1439
1371
|
if (!isRegistered) {
|
|
1440
1372
|
import_analytics.Analytics.init({
|
|
1441
|
-
logger: (params) => void (0,
|
|
1373
|
+
logger: (params) => void (0, import_native_modules10.eventLog)(params),
|
|
1442
1374
|
debug: analytics?.debug ?? __DEV__
|
|
1443
1375
|
});
|
|
1444
|
-
const App =
|
|
1376
|
+
const App = import_react_native21.Granite.registerApp(AppsInTossContainer.bind(null, container), {
|
|
1445
1377
|
appName,
|
|
1446
1378
|
context,
|
|
1447
|
-
initialScheme: (0,
|
|
1448
|
-
setIosSwipeGestureEnabled:
|
|
1379
|
+
initialScheme: (0, import_native_modules10.getSchemeUri)(),
|
|
1380
|
+
setIosSwipeGestureEnabled: import_native_modules10.setIosSwipeGestureEnabled,
|
|
1449
1381
|
router: {
|
|
1450
1382
|
screenContainer: AppsInTossScreenContainer,
|
|
1451
1383
|
defaultScreenOption: {
|
|
@@ -1476,43 +1408,42 @@ var AppsInToss = {
|
|
|
1476
1408
|
};
|
|
1477
1409
|
|
|
1478
1410
|
// src/components/WebView.tsx
|
|
1479
|
-
var
|
|
1411
|
+
var import_native_modules19 = require("@apps-in-toss/native-modules");
|
|
1480
1412
|
var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async-bridges"), 1);
|
|
1481
1413
|
var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
|
|
1482
1414
|
var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event-bridges"), 1);
|
|
1483
1415
|
var import_user_scripts = require("@apps-in-toss/user-scripts");
|
|
1484
1416
|
var import_react_native_safe_area_context4 = require("@granite-js/native/react-native-safe-area-context");
|
|
1485
|
-
var
|
|
1417
|
+
var import_react_native36 = require("@granite-js/react-native");
|
|
1486
1418
|
var import_tds_react_native15 = require("@toss/tds-react-native");
|
|
1487
1419
|
var import_private9 = require("@toss/tds-react-native/private");
|
|
1488
|
-
var
|
|
1489
|
-
var
|
|
1420
|
+
var import_react27 = require("react");
|
|
1421
|
+
var import_react_native37 = require("react-native");
|
|
1490
1422
|
|
|
1491
1423
|
// src/components/GameWebView.tsx
|
|
1492
|
-
var
|
|
1424
|
+
var import_native_modules11 = require("@apps-in-toss/native-modules");
|
|
1493
1425
|
var import_react_native_webview = require("@granite-js/native/react-native-webview");
|
|
1494
|
-
var
|
|
1495
|
-
var
|
|
1426
|
+
var import_react18 = require("react");
|
|
1427
|
+
var import_react_native25 = require("react-native");
|
|
1496
1428
|
|
|
1497
1429
|
// src/components/NavigationBar/GameWebviewNavigationBar.tsx
|
|
1498
1430
|
var import_react_native_safe_area_context2 = require("@granite-js/native/react-native-safe-area-context");
|
|
1499
|
-
var
|
|
1431
|
+
var import_react_native23 = require("@granite-js/react-native");
|
|
1500
1432
|
var import_tds_react_native11 = require("@toss/tds-react-native");
|
|
1501
1433
|
var import_private7 = require("@toss/tds-react-native/private");
|
|
1502
1434
|
var import_es_hangul3 = require("es-hangul");
|
|
1503
|
-
var
|
|
1504
|
-
var
|
|
1435
|
+
var import_react17 = require("react");
|
|
1436
|
+
var import_react_native24 = require("react-native");
|
|
1505
1437
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1506
1438
|
function GameWebviewNavigationBar() {
|
|
1507
1439
|
const safeAreaTop = (0, import_private7.useSafeAreaTop)();
|
|
1508
1440
|
const { openConfirm } = (0, import_tds_react_native11.useDialog)();
|
|
1509
|
-
const { captureExitLog } = useCaptureExitLog();
|
|
1510
1441
|
const global2 = getAppsInTossGlobals();
|
|
1511
1442
|
const logging = useNavigationBarLogging();
|
|
1512
1443
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1513
1444
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1514
1445
|
const { right: safeAreaRight } = (0, import_react_native_safe_area_context2.useSafeAreaInsets)();
|
|
1515
|
-
const handleGameWebviewClose = (0,
|
|
1446
|
+
const handleGameWebviewClose = (0, import_react17.useCallback)(async () => {
|
|
1516
1447
|
logging.closeButtonClick();
|
|
1517
1448
|
const isConfirmed = await openConfirm({
|
|
1518
1449
|
title: `${(0, import_es_hangul3.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
@@ -1523,19 +1454,18 @@ function GameWebviewNavigationBar() {
|
|
|
1523
1454
|
});
|
|
1524
1455
|
logging.closePopupCtaClick(isConfirmed);
|
|
1525
1456
|
if (isConfirmed) {
|
|
1526
|
-
|
|
1527
|
-
(0, import_react_native24.closeView)();
|
|
1457
|
+
(0, import_react_native23.closeView)();
|
|
1528
1458
|
}
|
|
1529
|
-
}, [
|
|
1459
|
+
}, [global2.brandDisplayName, logging, openConfirm]);
|
|
1530
1460
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
1531
1461
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_tds_react_native11.PageNavbar, { preference: { type: "none" } }),
|
|
1532
1462
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1533
|
-
|
|
1463
|
+
import_react_native24.View,
|
|
1534
1464
|
{
|
|
1535
1465
|
style: {
|
|
1536
1466
|
width: "100%",
|
|
1537
1467
|
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1538
|
-
height:
|
|
1468
|
+
height: import_react_native24.Platform.OS === "ios" ? 44 : 54,
|
|
1539
1469
|
flexDirection: "row",
|
|
1540
1470
|
alignItems: "center",
|
|
1541
1471
|
justifyContent: "flex-end",
|
|
@@ -1563,36 +1493,35 @@ function GameWebviewNavigationBar() {
|
|
|
1563
1493
|
|
|
1564
1494
|
// src/components/GameWebView.tsx
|
|
1565
1495
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1566
|
-
var GameWebView = (0,
|
|
1567
|
-
(0,
|
|
1568
|
-
if (
|
|
1569
|
-
(0,
|
|
1496
|
+
var GameWebView = (0, import_react18.forwardRef)(function GameWebView2(props, ref) {
|
|
1497
|
+
(0, import_react18.useEffect)(() => {
|
|
1498
|
+
if (import_react_native25.Platform.OS === "ios") {
|
|
1499
|
+
(0, import_native_modules11.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1570
1500
|
return () => {
|
|
1571
|
-
(0,
|
|
1501
|
+
(0, import_native_modules11.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1572
1502
|
};
|
|
1573
1503
|
}
|
|
1574
1504
|
return;
|
|
1575
1505
|
}, []);
|
|
1576
1506
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1577
1507
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GameWebviewNavigationBar, {}),
|
|
1578
|
-
(0,
|
|
1508
|
+
(0, import_native_modules11.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GameInitializer, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native_webview.WebView, { ref, ...props }) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native_webview.WebView, { ref, ...props })
|
|
1579
1509
|
] });
|
|
1580
1510
|
});
|
|
1581
1511
|
|
|
1582
1512
|
// src/components/PartnerWebView.tsx
|
|
1583
1513
|
var import_react_native_webview2 = require("@granite-js/native/react-native-webview");
|
|
1584
|
-
var
|
|
1514
|
+
var import_react20 = require("react");
|
|
1585
1515
|
|
|
1586
1516
|
// src/components/NavigationBar/PartnerWebviewNavigationBar.tsx
|
|
1587
|
-
var
|
|
1517
|
+
var import_react_native26 = require("@granite-js/react-native");
|
|
1588
1518
|
var import_tds_react_native12 = require("@toss/tds-react-native");
|
|
1589
1519
|
var import_private8 = require("@toss/tds-react-native/private");
|
|
1590
1520
|
var import_es_hangul4 = require("es-hangul");
|
|
1591
|
-
var
|
|
1521
|
+
var import_react19 = require("react");
|
|
1592
1522
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1593
1523
|
function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
1594
1524
|
const globals = getAppsInTossGlobals();
|
|
1595
|
-
const { captureExitLog } = useCaptureExitLog();
|
|
1596
1525
|
const logging = useNavigationBarLogging();
|
|
1597
1526
|
const { openConfirm } = (0, import_tds_react_native12.useDialog)();
|
|
1598
1527
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
@@ -1600,7 +1529,7 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1600
1529
|
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
1601
1530
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
1602
1531
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1603
|
-
const handleClose = (0,
|
|
1532
|
+
const handleClose = (0, import_react19.useCallback)(async () => {
|
|
1604
1533
|
logging.closeButtonClick();
|
|
1605
1534
|
const isConfirmed = await openConfirm({
|
|
1606
1535
|
title: `${(0, import_es_hangul4.josa)(globals.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
@@ -1611,10 +1540,9 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1611
1540
|
});
|
|
1612
1541
|
logging.closePopupCtaClick(isConfirmed);
|
|
1613
1542
|
if (isConfirmed) {
|
|
1614
|
-
|
|
1615
|
-
(0, import_react_native27.closeView)();
|
|
1543
|
+
(0, import_react_native26.closeView)();
|
|
1616
1544
|
}
|
|
1617
|
-
}, [
|
|
1545
|
+
}, [globals.brandDisplayName, logging, openConfirm]);
|
|
1618
1546
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1619
1547
|
import_private8.TopNavigation,
|
|
1620
1548
|
{
|
|
@@ -1634,7 +1562,7 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1634
1562
|
|
|
1635
1563
|
// src/components/PartnerWebView.tsx
|
|
1636
1564
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1637
|
-
var PartnerWebView = (0,
|
|
1565
|
+
var PartnerWebView = (0, import_react20.forwardRef)(function PartnerWebViewScreen({ onBackButtonClick, onHomeButtonClick, ...webViewProps }, ref) {
|
|
1638
1566
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
1639
1567
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PartnerWebviewNavigationBar, { onBackButtonClick, onHomeButtonClick }),
|
|
1640
1568
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native_webview2.WebView, { ref, ...webViewProps, style: { flex: 1 } })
|
|
@@ -1655,7 +1583,7 @@ function convertIntentURL(url) {
|
|
|
1655
1583
|
}
|
|
1656
1584
|
|
|
1657
1585
|
// src/ads/fetchTossAd.ts
|
|
1658
|
-
var
|
|
1586
|
+
var import_native_modules12 = require("@apps-in-toss/native-modules");
|
|
1659
1587
|
|
|
1660
1588
|
// ../../../.yarn/cache/es-toolkit-npm-1.34.1-4cd6371dcb-aab6d07be3.zip/node_modules/es-toolkit/dist/function/noop.mjs
|
|
1661
1589
|
function noop() {
|
|
@@ -1686,7 +1614,7 @@ var sessionId = generateSessionId();
|
|
|
1686
1614
|
var ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1687
1615
|
var IOS_FETCH_TOSS_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1688
1616
|
var UNSUPPORTED_ERROR_MESSAGE = "This feature is not supported in the current environment";
|
|
1689
|
-
var ENVIRONMENT = (0,
|
|
1617
|
+
var ENVIRONMENT = (0, import_native_modules12.getOperationalEnvironment)();
|
|
1690
1618
|
function fetchTossAd(params) {
|
|
1691
1619
|
if (!fetchTossAd.isSupported()) {
|
|
1692
1620
|
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
@@ -1698,7 +1626,7 @@ function fetchTossAd(params) {
|
|
|
1698
1626
|
params.onError(createInvalidAdGroupIdError());
|
|
1699
1627
|
return noop;
|
|
1700
1628
|
}
|
|
1701
|
-
const unregisterCallbacks =
|
|
1629
|
+
const unregisterCallbacks = import_native_modules12.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1702
1630
|
"fetchTossAd",
|
|
1703
1631
|
{ spaceUnitId: adGroupId, sessionId, sdkId: options.sdkId, availableStyleIds: options.availableStyleIds },
|
|
1704
1632
|
{
|
|
@@ -1716,14 +1644,14 @@ fetchTossAd.isSupported = () => {
|
|
|
1716
1644
|
if (ENVIRONMENT !== "toss") {
|
|
1717
1645
|
return false;
|
|
1718
1646
|
}
|
|
1719
|
-
return (0,
|
|
1647
|
+
return (0, import_native_modules12.isMinVersionSupported)({
|
|
1720
1648
|
android: ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION,
|
|
1721
1649
|
ios: IOS_FETCH_TOSS_AD_SUPPORTED_VERSION
|
|
1722
1650
|
});
|
|
1723
1651
|
};
|
|
1724
1652
|
|
|
1725
1653
|
// src/ads/integratedAd.ts
|
|
1726
|
-
var
|
|
1654
|
+
var import_native_modules14 = require("@apps-in-toss/native-modules");
|
|
1727
1655
|
|
|
1728
1656
|
// src/ads/generateRequestId.ts
|
|
1729
1657
|
function generateRequestId() {
|
|
@@ -1733,32 +1661,32 @@ function generateRequestId() {
|
|
|
1733
1661
|
}
|
|
1734
1662
|
|
|
1735
1663
|
// src/ads/getReferrer.ts
|
|
1736
|
-
var
|
|
1664
|
+
var import_react_native27 = require("@granite-js/react-native");
|
|
1737
1665
|
function getReferrer() {
|
|
1738
1666
|
try {
|
|
1739
|
-
return new URL((0,
|
|
1667
|
+
return new URL((0, import_react_native27.getSchemeUri)()).searchParams.get("referrer");
|
|
1740
1668
|
} catch {
|
|
1741
1669
|
return null;
|
|
1742
1670
|
}
|
|
1743
1671
|
}
|
|
1744
1672
|
|
|
1745
1673
|
// src/ads/remotes.ts
|
|
1746
|
-
var
|
|
1674
|
+
var import_native_modules13 = require("@apps-in-toss/native-modules");
|
|
1747
1675
|
|
|
1748
1676
|
// src/ads/getIsDev.ts
|
|
1749
|
-
var
|
|
1677
|
+
var import_react_native28 = require("@granite-js/react-native");
|
|
1750
1678
|
function getIsDev() {
|
|
1751
1679
|
try {
|
|
1752
|
-
return new URL((0,
|
|
1680
|
+
return new URL((0, import_react_native28.getSchemeUri)()).searchParams.get("isDev") === "true";
|
|
1753
1681
|
} catch {
|
|
1754
1682
|
return false;
|
|
1755
1683
|
}
|
|
1756
1684
|
}
|
|
1757
1685
|
|
|
1758
1686
|
// src/ads/remotes.ts
|
|
1759
|
-
var OPERATIONAL_ENVIRONMENT = (0,
|
|
1760
|
-
var OS = (0,
|
|
1761
|
-
var APP_VER = (0,
|
|
1687
|
+
var OPERATIONAL_ENVIRONMENT = (0, import_native_modules13.getOperationalEnvironment)();
|
|
1688
|
+
var OS = (0, import_native_modules13.getPlatformOS)();
|
|
1689
|
+
var APP_VER = (0, import_native_modules13.getTossAppVersion)();
|
|
1762
1690
|
var ALPHA_EVENT_TRACKER_HTTP_ENDPOINT = "https://alpha-trillion.toss.im/trk/sdk-mediation/event";
|
|
1763
1691
|
var LIVE_EVENT_TRACKER_HTTP_ENDPOINT = "https://trillion.toss.im/trk/sdk-mediation/event";
|
|
1764
1692
|
function getPostEventTrackingUrl() {
|
|
@@ -1793,14 +1721,14 @@ var IOS_INTEGRATED_AD_SUPPORTED_VERSION = "5.247.0";
|
|
|
1793
1721
|
var UNSUPPORTED_ERROR_MESSAGE2 = "This feature is not supported in the current environment";
|
|
1794
1722
|
var INTG_AD_ADM_FALLBACK_RID_MAP = {};
|
|
1795
1723
|
function integratedAdIsSupported() {
|
|
1796
|
-
return (0,
|
|
1724
|
+
return (0, import_native_modules14.isMinVersionSupported)({
|
|
1797
1725
|
android: ANDROID_INTEGRATED_AD_SUPPORTED_VERSION,
|
|
1798
1726
|
ios: IOS_INTEGRATED_AD_SUPPORTED_VERSION
|
|
1799
1727
|
});
|
|
1800
1728
|
}
|
|
1801
1729
|
function generateLoadFullScreenAd(sdkId) {
|
|
1802
1730
|
const fn = (params) => {
|
|
1803
|
-
if (!
|
|
1731
|
+
if (!import_native_modules14.GoogleAdMob.loadAppsInTossAdMob.isSupported()) {
|
|
1804
1732
|
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
1805
1733
|
return noop;
|
|
1806
1734
|
}
|
|
@@ -1817,7 +1745,7 @@ function generateLoadFullScreenAd(sdkId) {
|
|
|
1817
1745
|
}
|
|
1818
1746
|
};
|
|
1819
1747
|
if (!integratedAdIsSupported()) {
|
|
1820
|
-
return
|
|
1748
|
+
return import_native_modules14.GoogleAdMob.loadAppsInTossAdMob({
|
|
1821
1749
|
...normalizedParams,
|
|
1822
1750
|
onEvent: (event) => {
|
|
1823
1751
|
if (event.type === "loaded") {
|
|
@@ -1855,7 +1783,7 @@ function generateLoadFullScreenAd(sdkId) {
|
|
|
1855
1783
|
const { onEvent, onError, options } = normalizedParams;
|
|
1856
1784
|
const { adGroupId } = options;
|
|
1857
1785
|
const referrer = getReferrer();
|
|
1858
|
-
const unregisterCallbacks =
|
|
1786
|
+
const unregisterCallbacks = import_native_modules14.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1859
1787
|
"loadTossAdOrAdmob",
|
|
1860
1788
|
{ spaceUnitId: adGroupId, referrer, sessionId, sdkId },
|
|
1861
1789
|
{
|
|
@@ -1869,13 +1797,13 @@ function generateLoadFullScreenAd(sdkId) {
|
|
|
1869
1797
|
);
|
|
1870
1798
|
return unregisterCallbacks;
|
|
1871
1799
|
};
|
|
1872
|
-
fn.isSupported =
|
|
1800
|
+
fn.isSupported = import_native_modules14.GoogleAdMob.loadAppsInTossAdMob.isSupported;
|
|
1873
1801
|
return fn;
|
|
1874
1802
|
}
|
|
1875
1803
|
var loadFullScreenAd = generateLoadFullScreenAd("107");
|
|
1876
1804
|
var loadFullScreenAdForWeb = generateLoadFullScreenAd("107");
|
|
1877
1805
|
function showFullScreenAd(params) {
|
|
1878
|
-
if (!
|
|
1806
|
+
if (!import_native_modules14.GoogleAdMob.showAppsInTossAdMob.isSupported()) {
|
|
1879
1807
|
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
1880
1808
|
return noop;
|
|
1881
1809
|
}
|
|
@@ -1892,7 +1820,7 @@ function showFullScreenAd(params) {
|
|
|
1892
1820
|
}
|
|
1893
1821
|
};
|
|
1894
1822
|
if (!integratedAdIsSupported()) {
|
|
1895
|
-
return
|
|
1823
|
+
return import_native_modules14.GoogleAdMob.showAppsInTossAdMob({
|
|
1896
1824
|
...normalizedParams,
|
|
1897
1825
|
onEvent: (event) => {
|
|
1898
1826
|
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[normalizedAdGroupId] ?? "";
|
|
@@ -1991,7 +1919,7 @@ function showFullScreenAd(params) {
|
|
|
1991
1919
|
const { onEvent, onError, options } = normalizedParams;
|
|
1992
1920
|
const { adGroupId } = options;
|
|
1993
1921
|
const referrer = getReferrer();
|
|
1994
|
-
const unregisterCallbacks =
|
|
1922
|
+
const unregisterCallbacks = import_native_modules14.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1995
1923
|
"showTossAdOrAdmob",
|
|
1996
1924
|
{ spaceUnitId: adGroupId, referrer, sessionId },
|
|
1997
1925
|
{
|
|
@@ -2023,14 +1951,13 @@ function showFullScreenAd(params) {
|
|
|
2023
1951
|
);
|
|
2024
1952
|
return unregisterCallbacks;
|
|
2025
1953
|
}
|
|
2026
|
-
showFullScreenAd.isSupported =
|
|
1954
|
+
showFullScreenAd.isSupported = import_native_modules14.GoogleAdMob.showAppsInTossAdMob.isSupported;
|
|
2027
1955
|
|
|
2028
1956
|
// src/ads/tossAdEventLog.ts
|
|
2029
|
-
var
|
|
2030
|
-
var import_react_native30 = require("@granite-js/react-native");
|
|
1957
|
+
var import_react_native29 = require("@granite-js/react-native");
|
|
2031
1958
|
async function tossAdEventLog(params) {
|
|
2032
1959
|
const referrer = getReferrer();
|
|
2033
|
-
const appName =
|
|
1960
|
+
const appName = import_react_native29.Granite.appName;
|
|
2034
1961
|
const eventLogParams = {
|
|
2035
1962
|
...params,
|
|
2036
1963
|
params: {
|
|
@@ -2039,11 +1966,11 @@ async function tossAdEventLog(params) {
|
|
|
2039
1966
|
app_name: appName
|
|
2040
1967
|
}
|
|
2041
1968
|
};
|
|
2042
|
-
return
|
|
1969
|
+
return sendLog(eventLogParams, { pipelines: ["core"] });
|
|
2043
1970
|
}
|
|
2044
1971
|
|
|
2045
1972
|
// src/bridge-handler/useBridgeHandler.tsx
|
|
2046
|
-
var
|
|
1973
|
+
var import_react21 = require("react");
|
|
2047
1974
|
function serializeError(error) {
|
|
2048
1975
|
return JSON.stringify(error, (_, value) => {
|
|
2049
1976
|
if (value instanceof Error) {
|
|
@@ -2095,8 +2022,8 @@ function useBridgeHandler({
|
|
|
2095
2022
|
asyncHandlerMap,
|
|
2096
2023
|
eventListenerMap
|
|
2097
2024
|
}) {
|
|
2098
|
-
const ref = (0,
|
|
2099
|
-
const injectedJavaScript = (0,
|
|
2025
|
+
const ref = (0, import_react21.useRef)(null);
|
|
2026
|
+
const injectedJavaScript = (0, import_react21.useMemo)(
|
|
2100
2027
|
() => `window.__CONSTANT_HANDLER_MAP = ${JSON.stringify(
|
|
2101
2028
|
Object.entries(constantHandlerMap).reduce(
|
|
2102
2029
|
(acc, [key, value]) => {
|
|
@@ -2108,7 +2035,7 @@ function useBridgeHandler({
|
|
|
2108
2035
|
)};`,
|
|
2109
2036
|
[constantHandlerMap]
|
|
2110
2037
|
);
|
|
2111
|
-
(0,
|
|
2038
|
+
(0, import_react21.useEffect)(() => {
|
|
2112
2039
|
ref.current?.injectJavaScript(injectedJavaScript);
|
|
2113
2040
|
}, [injectedJavaScript]);
|
|
2114
2041
|
const createHandleOnEvent = (functionName, eventId) => (response) => {
|
|
@@ -2122,7 +2049,7 @@ function useBridgeHandler({
|
|
|
2122
2049
|
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
|
|
2123
2050
|
`);
|
|
2124
2051
|
};
|
|
2125
|
-
const $onMessage = (0,
|
|
2052
|
+
const $onMessage = (0, import_react21.useCallback)(
|
|
2126
2053
|
async (e) => {
|
|
2127
2054
|
onMessage?.(e);
|
|
2128
2055
|
const data = parseNativeEventData(e.nativeEvent.data);
|
|
@@ -2182,26 +2109,26 @@ function parseNativeEventData(data) {
|
|
|
2182
2109
|
|
|
2183
2110
|
// src/core/hooks/useSafeAreaInsetsEvent.tsx
|
|
2184
2111
|
var import_react_native_safe_area_context3 = require("@granite-js/native/react-native-safe-area-context");
|
|
2185
|
-
var
|
|
2112
|
+
var import_react22 = require("react");
|
|
2186
2113
|
function useSafeAreaInsetsEvent() {
|
|
2187
2114
|
const insets = (0, import_react_native_safe_area_context3.useSafeAreaInsets)();
|
|
2188
|
-
(0,
|
|
2115
|
+
(0, import_react22.useEffect)(() => {
|
|
2189
2116
|
safeAreaInsetsChange.emit(insets);
|
|
2190
2117
|
}, [insets]);
|
|
2191
|
-
(0,
|
|
2118
|
+
(0, import_react22.useEffect)(() => {
|
|
2192
2119
|
return () => safeAreaInsetsChange.clearSubscriptions();
|
|
2193
2120
|
}, []);
|
|
2194
2121
|
return safeAreaInsetsChange;
|
|
2195
2122
|
}
|
|
2196
2123
|
|
|
2197
2124
|
// src/core/hooks/useWebBackHandler.tsx
|
|
2198
|
-
var
|
|
2125
|
+
var import_react_native30 = require("@granite-js/react-native");
|
|
2199
2126
|
var import_tds_react_native13 = require("@toss/tds-react-native");
|
|
2200
2127
|
var import_es_hangul5 = require("es-hangul");
|
|
2201
|
-
var
|
|
2128
|
+
var import_react24 = require("react");
|
|
2202
2129
|
|
|
2203
2130
|
// src/hooks/useWebviewHistoryStack.tsx
|
|
2204
|
-
var
|
|
2131
|
+
var import_react23 = require("react");
|
|
2205
2132
|
var INITIAL_STATE = { stack: [], index: -1 };
|
|
2206
2133
|
function reducer(state, action) {
|
|
2207
2134
|
switch (action.type) {
|
|
@@ -2232,11 +2159,11 @@ function reducer(state, action) {
|
|
|
2232
2159
|
}
|
|
2233
2160
|
}
|
|
2234
2161
|
function useWebViewHistory() {
|
|
2235
|
-
const [state, dispatch] = (0,
|
|
2236
|
-
const onNavigationStateChange = (0,
|
|
2162
|
+
const [state, dispatch] = (0, import_react23.useReducer)(reducer, INITIAL_STATE);
|
|
2163
|
+
const onNavigationStateChange = (0, import_react23.useCallback)(({ url, canGoForward: canGoForward2 }) => {
|
|
2237
2164
|
dispatch({ type: "NAVIGATION_CHANGE", url, canGoForward: canGoForward2 });
|
|
2238
2165
|
}, []);
|
|
2239
|
-
const { canGoBack, canGoForward } = (0,
|
|
2166
|
+
const { canGoBack, canGoForward } = (0, import_react23.useMemo)(() => {
|
|
2240
2167
|
const canBack = state.index > 0;
|
|
2241
2168
|
const canFwd = state.index >= 0 && state.index < state.stack.length - 1;
|
|
2242
2169
|
return { canGoBack: canBack, canGoForward: canFwd };
|
|
@@ -2246,30 +2173,29 @@ function useWebViewHistory() {
|
|
|
2246
2173
|
|
|
2247
2174
|
// src/core/hooks/useWebBackHandler.tsx
|
|
2248
2175
|
function useWebBackHandler(webViewInitialURL, webViewRef) {
|
|
2249
|
-
const { captureExitLog } = useCaptureExitLog();
|
|
2250
2176
|
const { hasHistory, onNavigationStateChange } = useWebViewHistory();
|
|
2251
2177
|
const {
|
|
2252
2178
|
handlersRef: webBackHandlersRef,
|
|
2253
2179
|
hasBackEvent: hasWebBackEvent,
|
|
2254
2180
|
addEventListener: addWebBackEventListener,
|
|
2255
2181
|
removeEventListener: removeWebBackEventListener
|
|
2256
|
-
} = (0,
|
|
2182
|
+
} = (0, import_react_native30.useBackEventState)();
|
|
2257
2183
|
const logging = useNavigationBarLogging();
|
|
2258
2184
|
const { openConfirm } = (0, import_tds_react_native13.useDialog)();
|
|
2259
2185
|
const global2 = getAppsInTossGlobals();
|
|
2260
|
-
const addEventListener = (0,
|
|
2186
|
+
const addEventListener = (0, import_react24.useCallback)(
|
|
2261
2187
|
(handler) => {
|
|
2262
2188
|
addWebBackEventListener(handler);
|
|
2263
2189
|
},
|
|
2264
2190
|
[addWebBackEventListener]
|
|
2265
2191
|
);
|
|
2266
|
-
const removeEventListener = (0,
|
|
2192
|
+
const removeEventListener = (0, import_react24.useCallback)(
|
|
2267
2193
|
(handler) => {
|
|
2268
2194
|
removeWebBackEventListener(handler);
|
|
2269
2195
|
},
|
|
2270
2196
|
[removeWebBackEventListener]
|
|
2271
2197
|
);
|
|
2272
|
-
const handleWebBack = (0,
|
|
2198
|
+
const handleWebBack = (0, import_react24.useCallback)(async () => {
|
|
2273
2199
|
if (hasWebBackEvent) {
|
|
2274
2200
|
for (const handler of webBackHandlersRef) {
|
|
2275
2201
|
handler();
|
|
@@ -2288,21 +2214,11 @@ function useWebBackHandler(webViewInitialURL, webViewRef) {
|
|
|
2288
2214
|
});
|
|
2289
2215
|
logging.closePopupCtaClick(isConfirmed);
|
|
2290
2216
|
if (isConfirmed) {
|
|
2291
|
-
|
|
2292
|
-
(0, import_react_native31.closeView)();
|
|
2217
|
+
(0, import_react_native30.closeView)();
|
|
2293
2218
|
}
|
|
2294
2219
|
}
|
|
2295
|
-
}, [
|
|
2296
|
-
|
|
2297
|
-
global2.brandDisplayName,
|
|
2298
|
-
hasHistory,
|
|
2299
|
-
hasWebBackEvent,
|
|
2300
|
-
webBackHandlersRef,
|
|
2301
|
-
logging,
|
|
2302
|
-
openConfirm,
|
|
2303
|
-
webViewRef
|
|
2304
|
-
]);
|
|
2305
|
-
const handleWebHome = (0, import_react25.useCallback)(() => {
|
|
2220
|
+
}, [global2.brandDisplayName, hasHistory, hasWebBackEvent, webBackHandlersRef, logging, openConfirm, webViewRef]);
|
|
2221
|
+
const handleWebHome = (0, import_react24.useCallback)(() => {
|
|
2306
2222
|
logging.homeButtonClick();
|
|
2307
2223
|
if (homeEvent.hasSubscriptions()) {
|
|
2308
2224
|
homeEvent.emit({});
|
|
@@ -2315,7 +2231,7 @@ function useWebBackHandler(webViewInitialURL, webViewRef) {
|
|
|
2315
2231
|
})();
|
|
2316
2232
|
`);
|
|
2317
2233
|
}, [hasWebBackEvent, webBackHandlersRef, logging, webViewInitialURL, webViewRef]);
|
|
2318
|
-
return (0,
|
|
2234
|
+
return (0, import_react24.useMemo)(
|
|
2319
2235
|
() => ({ addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange }),
|
|
2320
2236
|
[addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange]
|
|
2321
2237
|
);
|
|
@@ -2335,8 +2251,8 @@ function mergeRefs(...refs) {
|
|
|
2335
2251
|
}
|
|
2336
2252
|
|
|
2337
2253
|
// src/hooks/useCreateUserAgent.ts
|
|
2338
|
-
var
|
|
2339
|
-
var
|
|
2254
|
+
var import_native_modules15 = require("@apps-in-toss/native-modules");
|
|
2255
|
+
var import_react_native31 = require("react-native");
|
|
2340
2256
|
var FontA11yCategory = {
|
|
2341
2257
|
Large: "Large",
|
|
2342
2258
|
xLarge: "xLarge",
|
|
@@ -2469,9 +2385,9 @@ function useCreateUserAgent({
|
|
|
2469
2385
|
safeArea,
|
|
2470
2386
|
safeAreaBottomTransparency
|
|
2471
2387
|
}) {
|
|
2472
|
-
const platform = (0,
|
|
2473
|
-
const appVersion = (0,
|
|
2474
|
-
const { fontScale } = (0,
|
|
2388
|
+
const platform = (0, import_native_modules15.getPlatformOS)();
|
|
2389
|
+
const appVersion = (0, import_native_modules15.getTossAppVersion)();
|
|
2390
|
+
const { fontScale } = (0, import_react_native31.useWindowDimensions)();
|
|
2475
2391
|
const platformString = platform === "ios" ? "iPhone" : "Android phone";
|
|
2476
2392
|
const fontA11y = mapFontScaleToCategory(fontScale, platform);
|
|
2477
2393
|
const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
|
|
@@ -2492,17 +2408,17 @@ function useCreateUserAgent({
|
|
|
2492
2408
|
}
|
|
2493
2409
|
|
|
2494
2410
|
// src/hooks/useGeolocation.ts
|
|
2495
|
-
var
|
|
2496
|
-
var
|
|
2497
|
-
var
|
|
2411
|
+
var import_native_modules16 = require("@apps-in-toss/native-modules");
|
|
2412
|
+
var import_react_native32 = require("@granite-js/react-native");
|
|
2413
|
+
var import_react25 = require("react");
|
|
2498
2414
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
2499
|
-
const isVisible = (0,
|
|
2500
|
-
const [location, setLocation] = (0,
|
|
2501
|
-
(0,
|
|
2415
|
+
const isVisible = (0, import_react_native32.useVisibility)();
|
|
2416
|
+
const [location, setLocation] = (0, import_react25.useState)(null);
|
|
2417
|
+
(0, import_react25.useEffect)(() => {
|
|
2502
2418
|
if (!isVisible) {
|
|
2503
2419
|
return;
|
|
2504
2420
|
}
|
|
2505
|
-
return (0,
|
|
2421
|
+
return (0, import_native_modules16.startUpdateLocation)({
|
|
2506
2422
|
options: {
|
|
2507
2423
|
accuracy,
|
|
2508
2424
|
distanceInterval,
|
|
@@ -2516,12 +2432,12 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
2516
2432
|
}
|
|
2517
2433
|
|
|
2518
2434
|
// src/hooks/useWaitForReturnNavigator.tsx
|
|
2519
|
-
var
|
|
2520
|
-
var
|
|
2435
|
+
var import_react_native33 = require("@granite-js/react-native");
|
|
2436
|
+
var import_react26 = require("react");
|
|
2521
2437
|
function useWaitForReturnNavigator() {
|
|
2522
|
-
const callbacks = (0,
|
|
2523
|
-
const navigation = (0,
|
|
2524
|
-
const startNavigating = (0,
|
|
2438
|
+
const callbacks = (0, import_react26.useRef)([]).current;
|
|
2439
|
+
const navigation = (0, import_react_native33.useNavigation)();
|
|
2440
|
+
const startNavigating = (0, import_react26.useCallback)(
|
|
2525
2441
|
(route, params) => {
|
|
2526
2442
|
return new Promise((resolve) => {
|
|
2527
2443
|
callbacks.push(resolve);
|
|
@@ -2530,7 +2446,7 @@ function useWaitForReturnNavigator() {
|
|
|
2530
2446
|
},
|
|
2531
2447
|
[callbacks, navigation]
|
|
2532
2448
|
);
|
|
2533
|
-
const handleVisibilityChange = (0,
|
|
2449
|
+
const handleVisibilityChange = (0, import_react26.useCallback)(
|
|
2534
2450
|
(state) => {
|
|
2535
2451
|
if (state === "visible" && callbacks.length > 0) {
|
|
2536
2452
|
for (const callback of callbacks) {
|
|
@@ -2541,7 +2457,7 @@ function useWaitForReturnNavigator() {
|
|
|
2541
2457
|
},
|
|
2542
2458
|
[callbacks]
|
|
2543
2459
|
);
|
|
2544
|
-
(0,
|
|
2460
|
+
(0, import_react_native33.useVisibilityChange)(handleVisibilityChange);
|
|
2545
2461
|
return startNavigating;
|
|
2546
2462
|
}
|
|
2547
2463
|
|
|
@@ -2555,8 +2471,8 @@ function useTopNavigation() {
|
|
|
2555
2471
|
}
|
|
2556
2472
|
|
|
2557
2473
|
// src/hooks/useWebViewMemoryDebug.tsx
|
|
2558
|
-
var
|
|
2559
|
-
var
|
|
2474
|
+
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
2475
|
+
var import_react_native34 = require("@granite-js/react-native");
|
|
2560
2476
|
var import_tds_react_native14 = require("@toss/tds-react-native");
|
|
2561
2477
|
function useHandleWebViewProcessDidTerminate(webViewRef) {
|
|
2562
2478
|
const toast = (0, import_tds_react_native14.useToast)();
|
|
@@ -2579,20 +2495,20 @@ function webViewDebugLog(logName, params) {
|
|
|
2579
2495
|
log_type: "debug",
|
|
2580
2496
|
params: {
|
|
2581
2497
|
...params,
|
|
2582
|
-
app_name:
|
|
2498
|
+
app_name: import_react_native34.Granite.appName,
|
|
2583
2499
|
deployment_id: global2.deploymentId
|
|
2584
2500
|
}
|
|
2585
2501
|
};
|
|
2586
|
-
if ((0,
|
|
2587
|
-
|
|
2502
|
+
if ((0, import_native_modules17.getOperationalEnvironment)() === "toss") {
|
|
2503
|
+
sendLog(event, { pipelines: ["core"] });
|
|
2588
2504
|
} else {
|
|
2589
2505
|
console.log("[webViewDebugLog]", event);
|
|
2590
2506
|
}
|
|
2591
2507
|
}
|
|
2592
2508
|
|
|
2593
2509
|
// src/utils/log.ts
|
|
2594
|
-
var
|
|
2595
|
-
var
|
|
2510
|
+
var import_native_modules18 = require("@apps-in-toss/native-modules");
|
|
2511
|
+
var import_react_native35 = require("@granite-js/react-native");
|
|
2596
2512
|
|
|
2597
2513
|
// src/utils/extractDateFromUUIDv7.ts
|
|
2598
2514
|
var extractDateFromUUIDv7 = (uuid) => {
|
|
@@ -2618,7 +2534,7 @@ var getGroupId = (url) => {
|
|
|
2618
2534
|
};
|
|
2619
2535
|
var getReferrer2 = () => {
|
|
2620
2536
|
try {
|
|
2621
|
-
const referrer = new URL((0,
|
|
2537
|
+
const referrer = new URL((0, import_react_native35.getSchemeUri)());
|
|
2622
2538
|
return referrer.searchParams.get("referrer");
|
|
2623
2539
|
} catch {
|
|
2624
2540
|
return "";
|
|
@@ -2637,7 +2553,7 @@ var trackScreen = (url, title) => {
|
|
|
2637
2553
|
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
2638
2554
|
}
|
|
2639
2555
|
};
|
|
2640
|
-
return (0,
|
|
2556
|
+
return (0, import_native_modules18.eventLog)(log);
|
|
2641
2557
|
};
|
|
2642
2558
|
|
|
2643
2559
|
// src/components/WebView.tsx
|
|
@@ -2651,7 +2567,7 @@ var WEBVIEW_TYPES = {
|
|
|
2651
2567
|
};
|
|
2652
2568
|
function mergeSchemeQueryParamsInto(url) {
|
|
2653
2569
|
const baseUrl = new URL(url);
|
|
2654
|
-
const schemeUrl = new URL((0,
|
|
2570
|
+
const schemeUrl = new URL((0, import_react_native36.getSchemeUri)());
|
|
2655
2571
|
const resultUrl = new URL(schemeUrl.pathname, baseUrl.origin);
|
|
2656
2572
|
for (const [key, value] of baseUrl.searchParams.entries()) {
|
|
2657
2573
|
resultUrl.searchParams.set(key, value);
|
|
@@ -2666,7 +2582,7 @@ function getWebViewURL(local) {
|
|
|
2666
2582
|
const devUrl = `http://${local.host}:${local.port}`;
|
|
2667
2583
|
return mergeSchemeQueryParamsInto(devUrl);
|
|
2668
2584
|
}
|
|
2669
|
-
const { url: rawUrl } = (0,
|
|
2585
|
+
const { url: rawUrl } = (0, import_native_modules19.safeSyncPostMessage)("getWebBundleURL", {});
|
|
2670
2586
|
const url = mergeSchemeQueryParamsInto(rawUrl);
|
|
2671
2587
|
const deploymentId = env.getDeploymentId();
|
|
2672
2588
|
if (deploymentId) {
|
|
@@ -2678,8 +2594,8 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2678
2594
|
if (!TYPES.includes(type)) {
|
|
2679
2595
|
throw new Error(`Invalid WebView type: '${type}'`);
|
|
2680
2596
|
}
|
|
2681
|
-
const webViewRef = (0,
|
|
2682
|
-
const url = (0,
|
|
2597
|
+
const webViewRef = (0, import_react27.useRef)(null);
|
|
2598
|
+
const url = (0, import_react27.useMemo)(() => getWebViewURL(local), [local]);
|
|
2683
2599
|
const webBackHandler = useWebBackHandler(url, webViewRef);
|
|
2684
2600
|
const top = (0, import_private9.useSafeAreaTop)();
|
|
2685
2601
|
const bottom = (0, import_private9.useSafeAreaBottom)();
|
|
@@ -2687,7 +2603,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2687
2603
|
const global2 = getAppsInTossGlobals();
|
|
2688
2604
|
const navigationBarContext = useNavigationBarContext();
|
|
2689
2605
|
const safeAreaInsetsEvent = useSafeAreaInsetsEvent();
|
|
2690
|
-
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0,
|
|
2606
|
+
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0, import_react27.useState)(
|
|
2691
2607
|
props.allowsBackForwardNavigationGestures
|
|
2692
2608
|
);
|
|
2693
2609
|
const handler = useBridgeHandler({
|
|
@@ -2702,22 +2618,22 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2702
2618
|
};
|
|
2703
2619
|
},
|
|
2704
2620
|
homeEvent: ({ onEvent }) => homeEvent.subscribe(onEvent),
|
|
2705
|
-
updateLocationEvent: ({ onEvent, onError, options }) =>
|
|
2621
|
+
updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules19.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
2706
2622
|
safeAreaInsetsChange: ({ onEvent }) => safeAreaInsetsEvent.subscribe(onEvent),
|
|
2707
2623
|
/** @internal */
|
|
2708
|
-
appBridgeCallbackEvent: ({ onEvent, onError, options }) =>
|
|
2624
|
+
appBridgeCallbackEvent: ({ onEvent, onError, options }) => import_native_modules19.appsInTossEvent.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
|
|
2709
2625
|
/** AdMobV2 */
|
|
2710
|
-
loadAppsInTossAdMob:
|
|
2711
|
-
showAppsInTossAdMob:
|
|
2626
|
+
loadAppsInTossAdMob: import_native_modules19.GoogleAdMob.loadAppsInTossAdMob,
|
|
2627
|
+
showAppsInTossAdMob: import_native_modules19.GoogleAdMob.showAppsInTossAdMob,
|
|
2712
2628
|
/** IntegratedAd */
|
|
2713
2629
|
loadFullScreenAd: loadFullScreenAdForWeb,
|
|
2714
2630
|
showFullScreenAd,
|
|
2715
2631
|
/** TossAd */
|
|
2716
2632
|
fetchTossAd,
|
|
2717
2633
|
/** IAP */
|
|
2718
|
-
iapCreateOneTimePurchaseOrder:
|
|
2719
|
-
requestSubscriptionPurchase:
|
|
2720
|
-
requestOneTimePurchase:
|
|
2634
|
+
iapCreateOneTimePurchaseOrder: import_native_modules19.IAP.createOneTimePurchaseOrder,
|
|
2635
|
+
requestSubscriptionPurchase: import_native_modules19.IAP.createSubscriptionPurchaseOrder,
|
|
2636
|
+
requestOneTimePurchase: import_native_modules19.requestOneTimePurchase
|
|
2721
2637
|
},
|
|
2722
2638
|
constantHandlerMap: {
|
|
2723
2639
|
...appsInTossConstantBridges,
|
|
@@ -2728,12 +2644,12 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2728
2644
|
right: insets.right
|
|
2729
2645
|
}),
|
|
2730
2646
|
...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
|
|
2731
|
-
getServerTime_isSupported:
|
|
2732
|
-
requestReview_isSupported:
|
|
2647
|
+
getServerTime_isSupported: import_native_modules19.getServerTime.isSupported,
|
|
2648
|
+
requestReview_isSupported: import_native_modules19.requestReview.isSupported,
|
|
2733
2649
|
/** AdMobV2 */
|
|
2734
|
-
loadAppsInTossAdMob_isSupported:
|
|
2735
|
-
showAppsInTossAdMob_isSupported:
|
|
2736
|
-
isAppsInTossAdMobLoaded_isSupported:
|
|
2650
|
+
loadAppsInTossAdMob_isSupported: import_native_modules19.GoogleAdMob.loadAppsInTossAdMob.isSupported,
|
|
2651
|
+
showAppsInTossAdMob_isSupported: import_native_modules19.GoogleAdMob.showAppsInTossAdMob.isSupported,
|
|
2652
|
+
isAppsInTossAdMobLoaded_isSupported: import_native_modules19.GoogleAdMob.isAppsInTossAdMobLoaded.isSupported,
|
|
2737
2653
|
/** IntegratedAd */
|
|
2738
2654
|
loadFullScreenAd_isSupported: loadFullScreenAdForWeb.isSupported,
|
|
2739
2655
|
showFullScreenAd_isSupported: showFullScreenAd.isSupported,
|
|
@@ -2746,7 +2662,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2746
2662
|
},
|
|
2747
2663
|
asyncHandlerMap: {
|
|
2748
2664
|
...appsInTossAsyncBridges,
|
|
2749
|
-
getServerTime:
|
|
2665
|
+
getServerTime: import_native_modules19.getServerTime,
|
|
2750
2666
|
setIosSwipeGestureEnabled: (options) => {
|
|
2751
2667
|
setAllowsBackForwardNavigationGestures(options.isEnabled);
|
|
2752
2668
|
return appsInTossAsyncBridges.setIosSwipeGestureEnabled(options);
|
|
@@ -2764,31 +2680,30 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2764
2680
|
getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
|
|
2765
2681
|
openCamera: appsInTossAsyncBridges.openCamera,
|
|
2766
2682
|
/** Storage */
|
|
2767
|
-
getStorageItem:
|
|
2768
|
-
setStorageItem:
|
|
2769
|
-
removeStorageItem:
|
|
2770
|
-
clearItems:
|
|
2683
|
+
getStorageItem: import_native_modules19.Storage.getItem,
|
|
2684
|
+
setStorageItem: import_native_modules19.Storage.setItem,
|
|
2685
|
+
removeStorageItem: import_native_modules19.Storage.removeItem,
|
|
2686
|
+
clearItems: import_native_modules19.Storage.clearItems,
|
|
2771
2687
|
/** IAP */
|
|
2772
|
-
iapGetProductItemList:
|
|
2773
|
-
iapCreateOneTimePurchaseOrder:
|
|
2774
|
-
processProductGrant:
|
|
2775
|
-
getPendingOrders:
|
|
2776
|
-
getCompletedOrRefundedOrders:
|
|
2777
|
-
completeProductGrant:
|
|
2778
|
-
getSubscriptionInfo:
|
|
2688
|
+
iapGetProductItemList: import_native_modules19.IAP.getProductItemList,
|
|
2689
|
+
iapCreateOneTimePurchaseOrder: import_native_modules19.iapCreateOneTimePurchaseOrder,
|
|
2690
|
+
processProductGrant: import_native_modules19.processProductGrant,
|
|
2691
|
+
getPendingOrders: import_native_modules19.IAP.getPendingOrders,
|
|
2692
|
+
getCompletedOrRefundedOrders: import_native_modules19.IAP.getCompletedOrRefundedOrders,
|
|
2693
|
+
completeProductGrant: import_native_modules19.IAP.completeProductGrant,
|
|
2694
|
+
getSubscriptionInfo: import_native_modules19.IAP.getSubscriptionInfo,
|
|
2779
2695
|
/** AdMobV2 */
|
|
2780
|
-
isAppsInTossAdMobLoaded:
|
|
2696
|
+
isAppsInTossAdMobLoaded: import_native_modules19.GoogleAdMob.isAppsInTossAdMobLoaded,
|
|
2781
2697
|
/** Toss Ads */
|
|
2782
2698
|
tossAdEventLog,
|
|
2783
2699
|
/** Private */
|
|
2784
2700
|
memoryDebugLog: webViewMemoryDebugLog,
|
|
2785
2701
|
debugLog: async (event) => {
|
|
2786
|
-
(
|
|
2787
|
-
import_native_modules24.INTERNAL__module.tossCoreEventLog(event);
|
|
2702
|
+
sendLog(event);
|
|
2788
2703
|
}
|
|
2789
2704
|
}
|
|
2790
2705
|
});
|
|
2791
|
-
const headerPropForExternalWebView = (0,
|
|
2706
|
+
const headerPropForExternalWebView = (0, import_react27.useMemo)(() => {
|
|
2792
2707
|
const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
|
|
2793
2708
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
2794
2709
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
@@ -2809,12 +2724,12 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2809
2724
|
colorPreference: "light"
|
|
2810
2725
|
});
|
|
2811
2726
|
const refs = mergeRefs(handler.ref, webViewRef);
|
|
2812
|
-
(0,
|
|
2727
|
+
(0, import_react27.useEffect)(() => {
|
|
2813
2728
|
const callback = () => {
|
|
2814
2729
|
webBackHandler.handleWebBack();
|
|
2815
2730
|
return true;
|
|
2816
2731
|
};
|
|
2817
|
-
const subscription =
|
|
2732
|
+
const subscription = import_react_native37.BackHandler.addEventListener("hardwareBackPress", callback);
|
|
2818
2733
|
return () => subscription.remove();
|
|
2819
2734
|
}, [webBackHandler]);
|
|
2820
2735
|
const handleWebViewProcessDidTerminate = useHandleWebViewProcessDidTerminate(webViewRef);
|
|
@@ -2841,14 +2756,14 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2841
2756
|
webBackHandler.onNavigationStateChange(event);
|
|
2842
2757
|
},
|
|
2843
2758
|
textZoom: 100,
|
|
2844
|
-
userAgent:
|
|
2759
|
+
userAgent: import_react_native37.Platform.OS === "ios" ? userAgent : void 0,
|
|
2845
2760
|
sharedCookiesEnabled: true,
|
|
2846
2761
|
webviewDebuggingEnabled: webViewDebuggingEnabled,
|
|
2847
2762
|
thirdPartyCookiesEnabled: true,
|
|
2848
2763
|
onMessage: handler.onMessage,
|
|
2849
2764
|
injectedJavaScript: import_user_scripts.afterDocumentLoad,
|
|
2850
2765
|
injectedJavaScriptBeforeContentLoaded: [handler.injectedJavaScript, import_user_scripts.beforeDocumentLoad].join("\n"),
|
|
2851
|
-
decelerationRate:
|
|
2766
|
+
decelerationRate: import_react_native37.Platform.OS === "ios" ? 1 : void 0,
|
|
2852
2767
|
allowsBackForwardNavigationGestures,
|
|
2853
2768
|
onShouldStartLoadWithRequest: (event) => {
|
|
2854
2769
|
try {
|
|
@@ -2856,7 +2771,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2856
2771
|
if (["https:", "http:"].includes(url2.protocol) || url2.href === "about:blank") {
|
|
2857
2772
|
return true;
|
|
2858
2773
|
} else {
|
|
2859
|
-
|
|
2774
|
+
import_react_native37.Linking.openURL(convertIntentURL(url2) ?? url2.href);
|
|
2860
2775
|
return false;
|
|
2861
2776
|
}
|
|
2862
2777
|
} catch (error) {
|
|
@@ -2887,9 +2802,9 @@ __reExport(src_exports, require("@apps-in-toss/types"), module.exports);
|
|
|
2887
2802
|
var import_types = require("@apps-in-toss/types");
|
|
2888
2803
|
|
|
2889
2804
|
// src/ads/inlineAd/InlineAd.tsx
|
|
2890
|
-
var
|
|
2891
|
-
var
|
|
2892
|
-
var
|
|
2805
|
+
var import_react_native41 = require("@granite-js/react-native");
|
|
2806
|
+
var import_react30 = require("react");
|
|
2807
|
+
var import_react_native42 = require("react-native");
|
|
2893
2808
|
|
|
2894
2809
|
// src/ads/inlineAd/constants.ts
|
|
2895
2810
|
var SDK_ID = "106";
|
|
@@ -3151,7 +3066,7 @@ async function loadAd(adGroupId) {
|
|
|
3151
3066
|
}
|
|
3152
3067
|
|
|
3153
3068
|
// src/ads/inlineAd/opener.ts
|
|
3154
|
-
var
|
|
3069
|
+
var import_react_native38 = require("@granite-js/react-native");
|
|
3155
3070
|
function isSafeUrl(url) {
|
|
3156
3071
|
try {
|
|
3157
3072
|
const parsed = new URL(url);
|
|
@@ -3183,7 +3098,7 @@ function openLandingUrl(url) {
|
|
|
3183
3098
|
return;
|
|
3184
3099
|
}
|
|
3185
3100
|
try {
|
|
3186
|
-
(0,
|
|
3101
|
+
(0, import_react_native38.openURL)(getWebSchemeOrUri(url));
|
|
3187
3102
|
} catch (error) {
|
|
3188
3103
|
console.error("[InlineAd] Failed to open landing URL:", error);
|
|
3189
3104
|
}
|
|
@@ -3270,8 +3185,8 @@ var EventTracker = class {
|
|
|
3270
3185
|
|
|
3271
3186
|
// src/ads/inlineAd/ui/FeedBannerAdView.tsx
|
|
3272
3187
|
var import_react_native_svg = require("@granite-js/native/react-native-svg");
|
|
3273
|
-
var
|
|
3274
|
-
var
|
|
3188
|
+
var import_react28 = require("react");
|
|
3189
|
+
var import_react_native39 = require("react-native");
|
|
3275
3190
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3276
3191
|
var ARROW_PATH = "m7.5 20.4c-.5-.5-.5-1.2 0-1.7l6.7-6.7-6.8-6.7c-.5-.5-.5-1.2 0-1.7s1.2-.5 1.7 0l7.5 7.5c.5.5.5 1.2 0 1.7l-7.5 7.5c-.2.3-.5.4-.8.4s-.6-.1-.8-.3z";
|
|
3277
3192
|
function FeedBannerAdView({
|
|
@@ -3289,12 +3204,12 @@ function FeedBannerAdView({
|
|
|
3289
3204
|
paddingStyle,
|
|
3290
3205
|
onPress
|
|
3291
3206
|
}) {
|
|
3292
|
-
const scale = (0,
|
|
3207
|
+
const scale = (0, import_react28.useRef)(new import_react_native39.Animated.Value(1)).current;
|
|
3293
3208
|
const animateScale = (toValue) => {
|
|
3294
|
-
|
|
3209
|
+
import_react_native39.Animated.timing(scale, {
|
|
3295
3210
|
toValue,
|
|
3296
3211
|
duration: 100,
|
|
3297
|
-
easing:
|
|
3212
|
+
easing: import_react_native39.Easing.inOut(import_react_native39.Easing.ease),
|
|
3298
3213
|
useNativeDriver: true
|
|
3299
3214
|
}).start();
|
|
3300
3215
|
};
|
|
@@ -3307,40 +3222,40 @@ function FeedBannerAdView({
|
|
|
3307
3222
|
const resolvedCtaBackground = ctaBackgroundColor ?? "#3081F9";
|
|
3308
3223
|
const resolvedCtaTextColor = ctaTextColor ?? "#ffffff";
|
|
3309
3224
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3310
|
-
|
|
3225
|
+
import_react_native39.Pressable,
|
|
3311
3226
|
{
|
|
3312
3227
|
accessibilityRole: "button",
|
|
3313
3228
|
onPress: () => onPress(null),
|
|
3314
3229
|
onPressIn: handlePressIn,
|
|
3315
3230
|
onPressOut: handlePressOut,
|
|
3316
3231
|
style: styles.pressable,
|
|
3317
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3318
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3319
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3232
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native39.Animated.View, { style: [styles.container, paddingStyle, { transform: [{ scale }] }], children: [
|
|
3233
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native39.View, { style: styles.profileContainer, children: [
|
|
3234
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native39.View, { style: styles.brandArea, children: [
|
|
3320
3235
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3321
|
-
|
|
3236
|
+
import_react_native39.Pressable,
|
|
3322
3237
|
{
|
|
3323
3238
|
accessibilityRole: "button",
|
|
3324
3239
|
onPress: () => onPress("202"),
|
|
3325
3240
|
onPressIn: handlePressIn,
|
|
3326
3241
|
onPressOut: handlePressOut,
|
|
3327
3242
|
style: styles.logoContainer,
|
|
3328
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3329
|
-
brandLogoUri ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3330
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3243
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native39.View, { style: [styles.logoWrapper, { backgroundColor: colors.brandLogoBg }], children: [
|
|
3244
|
+
brandLogoUri ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native39.Image, { source: { uri: brandLogoUri }, style: styles.logoImage, resizeMode: "cover" }) : null,
|
|
3245
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native39.View, { style: [styles.logoOverlay, { borderColor: colors.brandLogoBorder }] })
|
|
3331
3246
|
] })
|
|
3332
3247
|
}
|
|
3333
3248
|
),
|
|
3334
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3249
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native39.View, { style: styles.brandTextContainer, children: [
|
|
3335
3250
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3336
|
-
|
|
3251
|
+
import_react_native39.Pressable,
|
|
3337
3252
|
{
|
|
3338
3253
|
accessibilityRole: "button",
|
|
3339
3254
|
onPress: () => onPress("103"),
|
|
3340
3255
|
onPressIn: handlePressIn,
|
|
3341
3256
|
onPressOut: handlePressOut,
|
|
3342
3257
|
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3343
|
-
|
|
3258
|
+
import_react_native39.Text,
|
|
3344
3259
|
{
|
|
3345
3260
|
allowFontScaling: false,
|
|
3346
3261
|
numberOfLines: 1,
|
|
@@ -3350,46 +3265,46 @@ function FeedBannerAdView({
|
|
|
3350
3265
|
)
|
|
3351
3266
|
}
|
|
3352
3267
|
),
|
|
3353
|
-
isAdBadgeEnabled ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3268
|
+
isAdBadgeEnabled ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native39.Text, { allowFontScaling: false, numberOfLines: 1, style: [styles.adBadge, { color: colors.adBadge }], children: "\uAD11\uACE0" }) : null
|
|
3354
3269
|
] })
|
|
3355
3270
|
] }),
|
|
3356
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3271
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native39.View, { style: styles.textArea, children: [
|
|
3357
3272
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3358
|
-
|
|
3273
|
+
import_react_native39.Pressable,
|
|
3359
3274
|
{
|
|
3360
3275
|
accessibilityRole: "button",
|
|
3361
3276
|
onPress: () => onPress("101"),
|
|
3362
3277
|
onPressIn: handlePressIn,
|
|
3363
3278
|
onPressOut: handlePressOut,
|
|
3364
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3279
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native39.Text, { allowFontScaling: false, style: [styles.title, { color: colors.title }], children: title })
|
|
3365
3280
|
}
|
|
3366
3281
|
),
|
|
3367
3282
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3368
|
-
|
|
3283
|
+
import_react_native39.Pressable,
|
|
3369
3284
|
{
|
|
3370
3285
|
accessibilityRole: "button",
|
|
3371
3286
|
onPress: () => onPress("102"),
|
|
3372
3287
|
onPressIn: handlePressIn,
|
|
3373
3288
|
onPressOut: handlePressOut,
|
|
3374
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3289
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native39.Text, { allowFontScaling: false, style: [styles.subtitle, { color: colors.subtitle }], children: subtitle })
|
|
3375
3290
|
}
|
|
3376
3291
|
)
|
|
3377
3292
|
] })
|
|
3378
3293
|
] }),
|
|
3379
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3294
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native39.View, { style: styles.card, children: [
|
|
3380
3295
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3381
|
-
|
|
3296
|
+
import_react_native39.Pressable,
|
|
3382
3297
|
{
|
|
3383
3298
|
accessibilityRole: "button",
|
|
3384
3299
|
onPress: () => onPress("201"),
|
|
3385
3300
|
onPressIn: handlePressIn,
|
|
3386
3301
|
onPressOut: handlePressOut,
|
|
3387
3302
|
style: styles.imageButton,
|
|
3388
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3303
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native39.View, { style: styles.imageContainer, children: mainImageUri ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native39.Image, { source: { uri: mainImageUri }, style: styles.mainImage, resizeMode: "cover" }) : null })
|
|
3389
3304
|
}
|
|
3390
3305
|
),
|
|
3391
3306
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3392
|
-
|
|
3307
|
+
import_react_native39.Pressable,
|
|
3393
3308
|
{
|
|
3394
3309
|
accessibilityRole: "button",
|
|
3395
3310
|
onPress: () => onPress("0"),
|
|
@@ -3397,19 +3312,19 @@ function FeedBannerAdView({
|
|
|
3397
3312
|
onPressOut: handlePressOut,
|
|
3398
3313
|
style: [styles.cta, { backgroundColor: resolvedCtaBackground }],
|
|
3399
3314
|
children: [
|
|
3400
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3315
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native39.Text, { allowFontScaling: false, style: [styles.ctaText, { color: resolvedCtaTextColor }], children: ctaText }),
|
|
3401
3316
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native_svg.Svg, { width: 20, height: 20, viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native_svg.Path, { d: ARROW_PATH, fill: resolvedCtaTextColor }) })
|
|
3402
3317
|
]
|
|
3403
3318
|
}
|
|
3404
3319
|
),
|
|
3405
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3320
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native39.View, { style: [styles.cardOverlay, { borderColor: colors.imageOverlayBorder }] })
|
|
3406
3321
|
] }),
|
|
3407
|
-
adClearanceText ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3322
|
+
adClearanceText ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native39.Text, { allowFontScaling: false, style: [styles.adClearance, { color: colors.adClearance }], children: adClearanceText }) : null
|
|
3408
3323
|
] })
|
|
3409
3324
|
}
|
|
3410
3325
|
);
|
|
3411
3326
|
}
|
|
3412
|
-
var styles =
|
|
3327
|
+
var styles = import_react_native39.StyleSheet.create({
|
|
3413
3328
|
pressable: {
|
|
3414
3329
|
width: "100%"
|
|
3415
3330
|
},
|
|
@@ -3448,7 +3363,7 @@ var styles = import_react_native40.StyleSheet.create({
|
|
|
3448
3363
|
borderRadius: 18
|
|
3449
3364
|
},
|
|
3450
3365
|
logoOverlay: {
|
|
3451
|
-
...
|
|
3366
|
+
...import_react_native39.StyleSheet.absoluteFillObject,
|
|
3452
3367
|
borderWidth: 1,
|
|
3453
3368
|
borderRadius: 18
|
|
3454
3369
|
},
|
|
@@ -3511,7 +3426,7 @@ var styles = import_react_native40.StyleSheet.create({
|
|
|
3511
3426
|
lineHeight: 22.5
|
|
3512
3427
|
},
|
|
3513
3428
|
cardOverlay: {
|
|
3514
|
-
...
|
|
3429
|
+
...import_react_native39.StyleSheet.absoluteFillObject,
|
|
3515
3430
|
borderWidth: 2,
|
|
3516
3431
|
borderRadius: 12,
|
|
3517
3432
|
pointerEvents: "none"
|
|
@@ -3525,8 +3440,8 @@ var styles = import_react_native40.StyleSheet.create({
|
|
|
3525
3440
|
|
|
3526
3441
|
// src/ads/inlineAd/ui/ListBannerAdView.tsx
|
|
3527
3442
|
var import_react_native_svg2 = require("@granite-js/native/react-native-svg");
|
|
3528
|
-
var
|
|
3529
|
-
var
|
|
3443
|
+
var import_react29 = require("react");
|
|
3444
|
+
var import_react_native40 = require("react-native");
|
|
3530
3445
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3531
3446
|
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";
|
|
3532
3447
|
function ListBannerAdView({
|
|
@@ -3539,13 +3454,13 @@ function ListBannerAdView({
|
|
|
3539
3454
|
colors,
|
|
3540
3455
|
onPress
|
|
3541
3456
|
}) {
|
|
3542
|
-
const scale = (0,
|
|
3543
|
-
const clipIdRef = (0,
|
|
3457
|
+
const scale = (0, import_react29.useRef)(new import_react_native40.Animated.Value(1)).current;
|
|
3458
|
+
const clipIdRef = (0, import_react29.useRef)(`clip-${Math.random().toString(36).slice(2)}`);
|
|
3544
3459
|
const animateScale = (toValue) => {
|
|
3545
|
-
|
|
3460
|
+
import_react_native40.Animated.timing(scale, {
|
|
3546
3461
|
toValue,
|
|
3547
3462
|
duration: 100,
|
|
3548
|
-
easing:
|
|
3463
|
+
easing: import_react_native40.Easing.inOut(import_react_native40.Easing.ease),
|
|
3549
3464
|
useNativeDriver: true
|
|
3550
3465
|
}).start();
|
|
3551
3466
|
};
|
|
@@ -3556,17 +3471,17 @@ function ListBannerAdView({
|
|
|
3556
3471
|
animateScale(1);
|
|
3557
3472
|
};
|
|
3558
3473
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3559
|
-
|
|
3474
|
+
import_react_native40.Pressable,
|
|
3560
3475
|
{
|
|
3561
3476
|
accessibilityRole: "button",
|
|
3562
3477
|
onPress: () => onPress(null),
|
|
3563
3478
|
onPressIn: handlePressIn,
|
|
3564
3479
|
onPressOut: handlePressOut,
|
|
3565
3480
|
style: styles2.pressable,
|
|
3566
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3567
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3481
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native40.Animated.View, { style: [styles2.container, paddingStyle, { transform: [{ scale }] }], children: [
|
|
3482
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native40.View, { style: styles2.titleRow, children: [
|
|
3568
3483
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3569
|
-
|
|
3484
|
+
import_react_native40.Pressable,
|
|
3570
3485
|
{
|
|
3571
3486
|
accessibilityRole: "button",
|
|
3572
3487
|
onPress: () => onPress("202"),
|
|
@@ -3599,31 +3514,31 @@ function ListBannerAdView({
|
|
|
3599
3514
|
] })
|
|
3600
3515
|
}
|
|
3601
3516
|
),
|
|
3602
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3517
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native40.View, { style: styles2.textWrapper, children: [
|
|
3603
3518
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3604
|
-
|
|
3519
|
+
import_react_native40.Pressable,
|
|
3605
3520
|
{
|
|
3606
3521
|
accessibilityRole: "button",
|
|
3607
3522
|
onPress: () => onPress("101"),
|
|
3608
3523
|
onPressIn: handlePressIn,
|
|
3609
3524
|
onPressOut: handlePressOut,
|
|
3610
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3525
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native40.Text, { allowFontScaling: false, style: [styles2.title, { color: colors.title }], children: title })
|
|
3611
3526
|
}
|
|
3612
3527
|
),
|
|
3613
3528
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3614
|
-
|
|
3529
|
+
import_react_native40.Pressable,
|
|
3615
3530
|
{
|
|
3616
3531
|
accessibilityRole: "button",
|
|
3617
3532
|
onPress: () => onPress("102"),
|
|
3618
3533
|
onPressIn: handlePressIn,
|
|
3619
3534
|
onPressOut: handlePressOut,
|
|
3620
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3535
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native40.Text, { allowFontScaling: false, style: [styles2.subtitle, { color: colors.subtitle }], children: subtitle })
|
|
3621
3536
|
}
|
|
3622
3537
|
)
|
|
3623
3538
|
] })
|
|
3624
3539
|
] }),
|
|
3625
3540
|
adClearanceText ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3626
|
-
|
|
3541
|
+
import_react_native40.Text,
|
|
3627
3542
|
{
|
|
3628
3543
|
allowFontScaling: false,
|
|
3629
3544
|
style: [
|
|
@@ -3641,7 +3556,7 @@ function ListBannerAdView({
|
|
|
3641
3556
|
}
|
|
3642
3557
|
);
|
|
3643
3558
|
}
|
|
3644
|
-
var styles2 =
|
|
3559
|
+
var styles2 = import_react_native40.StyleSheet.create({
|
|
3645
3560
|
pressable: {
|
|
3646
3561
|
width: "100%"
|
|
3647
3562
|
},
|
|
@@ -3848,21 +3763,21 @@ function InlineAd(props) {
|
|
|
3848
3763
|
onAdFailedToRender,
|
|
3849
3764
|
onNoFill
|
|
3850
3765
|
} = props;
|
|
3851
|
-
const slotIdRef = (0,
|
|
3852
|
-
const [ad, setAd] = (0,
|
|
3853
|
-
const [isAdBadgeEnabled, setIsAdBadgeEnabled] = (0,
|
|
3854
|
-
const eventTrackerRef = (0,
|
|
3855
|
-
const eventPayloadRef = (0,
|
|
3856
|
-
const hasRenderedRef = (0,
|
|
3857
|
-
const hasLoggedImp1pxRef = (0,
|
|
3858
|
-
const hasLoggedImp100pRef = (0,
|
|
3859
|
-
const hasNotifiedViewableRef = (0,
|
|
3860
|
-
const viewableTimerRef = (0,
|
|
3861
|
-
const refetchIntervalMsRef = (0,
|
|
3862
|
-
const lastImp1pxAtRef = (0,
|
|
3863
|
-
const loadingRef = (0,
|
|
3864
|
-
const loadRef = (0,
|
|
3865
|
-
const callbacksRef = (0,
|
|
3766
|
+
const slotIdRef = (0, import_react30.useRef)(createSlotId());
|
|
3767
|
+
const [ad, setAd] = (0, import_react30.useState)(null);
|
|
3768
|
+
const [isAdBadgeEnabled, setIsAdBadgeEnabled] = (0, import_react30.useState)(true);
|
|
3769
|
+
const eventTrackerRef = (0, import_react30.useRef)(null);
|
|
3770
|
+
const eventPayloadRef = (0, import_react30.useRef)(null);
|
|
3771
|
+
const hasRenderedRef = (0, import_react30.useRef)(false);
|
|
3772
|
+
const hasLoggedImp1pxRef = (0, import_react30.useRef)(false);
|
|
3773
|
+
const hasLoggedImp100pRef = (0, import_react30.useRef)(false);
|
|
3774
|
+
const hasNotifiedViewableRef = (0, import_react30.useRef)(false);
|
|
3775
|
+
const viewableTimerRef = (0, import_react30.useRef)(null);
|
|
3776
|
+
const refetchIntervalMsRef = (0, import_react30.useRef)(null);
|
|
3777
|
+
const lastImp1pxAtRef = (0, import_react30.useRef)(null);
|
|
3778
|
+
const loadingRef = (0, import_react30.useRef)(false);
|
|
3779
|
+
const loadRef = (0, import_react30.useRef)(null);
|
|
3780
|
+
const callbacksRef = (0, import_react30.useRef)({
|
|
3866
3781
|
onAdRendered,
|
|
3867
3782
|
onAdViewable,
|
|
3868
3783
|
onAdClicked,
|
|
@@ -3870,8 +3785,8 @@ function InlineAd(props) {
|
|
|
3870
3785
|
onAdFailedToRender,
|
|
3871
3786
|
onNoFill
|
|
3872
3787
|
});
|
|
3873
|
-
const isMountedRef = (0,
|
|
3874
|
-
const colorScheme = (0,
|
|
3788
|
+
const isMountedRef = (0, import_react30.useRef)(false);
|
|
3789
|
+
const colorScheme = (0, import_react_native42.useColorScheme)();
|
|
3875
3790
|
const selectedTheme = theme ?? DEFAULT_INLINE_AD_THEME;
|
|
3876
3791
|
const resolvedTheme = selectedTheme === "auto" ? colorScheme === "dark" ? "dark" : "light" : selectedTheme;
|
|
3877
3792
|
const resolvedTone = tone ?? DEFAULT_INLINE_AD_TONE;
|
|
@@ -3887,7 +3802,7 @@ function InlineAd(props) {
|
|
|
3887
3802
|
onAdFailedToRender,
|
|
3888
3803
|
onNoFill
|
|
3889
3804
|
};
|
|
3890
|
-
(0,
|
|
3805
|
+
(0, import_react30.useEffect)(() => {
|
|
3891
3806
|
isMountedRef.current = true;
|
|
3892
3807
|
return () => {
|
|
3893
3808
|
isMountedRef.current = false;
|
|
@@ -3897,7 +3812,7 @@ function InlineAd(props) {
|
|
|
3897
3812
|
}
|
|
3898
3813
|
};
|
|
3899
3814
|
}, []);
|
|
3900
|
-
(0,
|
|
3815
|
+
(0, import_react30.useEffect)(() => {
|
|
3901
3816
|
const normalizedAdGroupId = normalizeAdGroupId(adGroupId);
|
|
3902
3817
|
const loadAdRequest = () => {
|
|
3903
3818
|
if (loadingRef.current) {
|
|
@@ -3969,7 +3884,7 @@ function InlineAd(props) {
|
|
|
3969
3884
|
loadRef.current = null;
|
|
3970
3885
|
};
|
|
3971
3886
|
}, [adGroupId]);
|
|
3972
|
-
(0,
|
|
3887
|
+
(0, import_react_native41.useVisibilityChange)((documentVisibility) => {
|
|
3973
3888
|
if (documentVisibility !== "visible") {
|
|
3974
3889
|
return;
|
|
3975
3890
|
}
|
|
@@ -3982,7 +3897,7 @@ function InlineAd(props) {
|
|
|
3982
3897
|
loadRef.current?.();
|
|
3983
3898
|
}
|
|
3984
3899
|
});
|
|
3985
|
-
(0,
|
|
3900
|
+
(0, import_react30.useEffect)(() => {
|
|
3986
3901
|
if (!ad || hasRenderedRef.current) {
|
|
3987
3902
|
return;
|
|
3988
3903
|
}
|
|
@@ -4068,26 +3983,26 @@ function InlineAd(props) {
|
|
|
4068
3983
|
}
|
|
4069
3984
|
};
|
|
4070
3985
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4071
|
-
|
|
3986
|
+
import_react_native41.ImpressionArea,
|
|
4072
3987
|
{
|
|
4073
3988
|
style: styles3.impressionArea,
|
|
4074
3989
|
onImpressionStart: handleImpression1px,
|
|
4075
3990
|
areaThreshold: 0,
|
|
4076
3991
|
UNSAFE__impressFallbackOnMount: Boolean(impressFallbackOnMount),
|
|
4077
3992
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4078
|
-
|
|
3993
|
+
import_react_native41.ImpressionArea,
|
|
4079
3994
|
{
|
|
4080
3995
|
onImpressionStart: handleImpression100p,
|
|
4081
3996
|
areaThreshold: 1,
|
|
4082
3997
|
UNSAFE__impressFallbackOnMount: Boolean(impressFallbackOnMount),
|
|
4083
3998
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4084
|
-
|
|
3999
|
+
import_react_native41.ImpressionArea,
|
|
4085
4000
|
{
|
|
4086
4001
|
onImpressionStart: handleViewableStart,
|
|
4087
4002
|
onImpressionEnd: handleViewableEnd,
|
|
4088
4003
|
areaThreshold: 0.5,
|
|
4089
4004
|
UNSAFE__impressFallbackOnMount: Boolean(impressFallbackOnMount),
|
|
4090
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4005
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_native42.View, { style: [styles3.wrapper, resolvedVariant === "card" && styles3.cardWrapper], children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react_native42.View, { style: [styles3.surface, { backgroundColor }, resolvedVariant === "card" && styles3.cardSurface], children: [
|
|
4091
4006
|
isListBanner && listCreative ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4092
4007
|
ListBannerAdView,
|
|
4093
4008
|
{
|
|
@@ -4128,7 +4043,7 @@ function InlineAd(props) {
|
|
|
4128
4043
|
impressionKey
|
|
4129
4044
|
);
|
|
4130
4045
|
}
|
|
4131
|
-
var styles3 =
|
|
4046
|
+
var styles3 = import_react_native42.StyleSheet.create({
|
|
4132
4047
|
impressionArea: {
|
|
4133
4048
|
width: "100%"
|
|
4134
4049
|
},
|