@apps-in-toss/framework 2.4.1 → 2.4.3
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 +476 -521
- package/dist/index.js +242 -289
- 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,12 +1583,21 @@ 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() {
|
|
1662
1590
|
}
|
|
1663
1591
|
|
|
1592
|
+
// src/ads/adGroupId.ts
|
|
1593
|
+
var INVALID_AD_GROUP_ID_ERROR_MESSAGE = "\uC798\uBABB\uB41C \uC694\uCCAD\uC774\uC5D0\uC694. \uD544\uC694\uD55C \uAC12\uC774 \uBE44\uC5B4 \uC788\uC5B4\uC694.";
|
|
1594
|
+
function normalizeAdGroupId(adGroupId) {
|
|
1595
|
+
return adGroupId.trim();
|
|
1596
|
+
}
|
|
1597
|
+
function createInvalidAdGroupIdError() {
|
|
1598
|
+
return new Error(INVALID_AD_GROUP_ID_ERROR_MESSAGE);
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1664
1601
|
// src/ads/generateSessionId.ts
|
|
1665
1602
|
function generateSessionId() {
|
|
1666
1603
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
@@ -1677,15 +1614,19 @@ var sessionId = generateSessionId();
|
|
|
1677
1614
|
var ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1678
1615
|
var IOS_FETCH_TOSS_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1679
1616
|
var UNSUPPORTED_ERROR_MESSAGE = "This feature is not supported in the current environment";
|
|
1680
|
-
var ENVIRONMENT = (0,
|
|
1617
|
+
var ENVIRONMENT = (0, import_native_modules12.getOperationalEnvironment)();
|
|
1681
1618
|
function fetchTossAd(params) {
|
|
1682
1619
|
if (!fetchTossAd.isSupported()) {
|
|
1683
1620
|
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
1684
1621
|
return noop;
|
|
1685
1622
|
}
|
|
1686
1623
|
const { onEvent, onError, options } = params;
|
|
1687
|
-
const
|
|
1688
|
-
|
|
1624
|
+
const adGroupId = normalizeAdGroupId(options.adGroupId);
|
|
1625
|
+
if (adGroupId.length === 0) {
|
|
1626
|
+
params.onError(createInvalidAdGroupIdError());
|
|
1627
|
+
return noop;
|
|
1628
|
+
}
|
|
1629
|
+
const unregisterCallbacks = import_native_modules12.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1689
1630
|
"fetchTossAd",
|
|
1690
1631
|
{ spaceUnitId: adGroupId, sessionId, sdkId: options.sdkId, availableStyleIds: options.availableStyleIds },
|
|
1691
1632
|
{
|
|
@@ -1703,14 +1644,14 @@ fetchTossAd.isSupported = () => {
|
|
|
1703
1644
|
if (ENVIRONMENT !== "toss") {
|
|
1704
1645
|
return false;
|
|
1705
1646
|
}
|
|
1706
|
-
return (0,
|
|
1647
|
+
return (0, import_native_modules12.isMinVersionSupported)({
|
|
1707
1648
|
android: ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION,
|
|
1708
1649
|
ios: IOS_FETCH_TOSS_AD_SUPPORTED_VERSION
|
|
1709
1650
|
});
|
|
1710
1651
|
};
|
|
1711
1652
|
|
|
1712
1653
|
// src/ads/integratedAd.ts
|
|
1713
|
-
var
|
|
1654
|
+
var import_native_modules14 = require("@apps-in-toss/native-modules");
|
|
1714
1655
|
|
|
1715
1656
|
// src/ads/generateRequestId.ts
|
|
1716
1657
|
function generateRequestId() {
|
|
@@ -1720,32 +1661,32 @@ function generateRequestId() {
|
|
|
1720
1661
|
}
|
|
1721
1662
|
|
|
1722
1663
|
// src/ads/getReferrer.ts
|
|
1723
|
-
var
|
|
1664
|
+
var import_react_native27 = require("@granite-js/react-native");
|
|
1724
1665
|
function getReferrer() {
|
|
1725
1666
|
try {
|
|
1726
|
-
return new URL((0,
|
|
1667
|
+
return new URL((0, import_react_native27.getSchemeUri)()).searchParams.get("referrer");
|
|
1727
1668
|
} catch {
|
|
1728
1669
|
return null;
|
|
1729
1670
|
}
|
|
1730
1671
|
}
|
|
1731
1672
|
|
|
1732
1673
|
// src/ads/remotes.ts
|
|
1733
|
-
var
|
|
1674
|
+
var import_native_modules13 = require("@apps-in-toss/native-modules");
|
|
1734
1675
|
|
|
1735
1676
|
// src/ads/getIsDev.ts
|
|
1736
|
-
var
|
|
1677
|
+
var import_react_native28 = require("@granite-js/react-native");
|
|
1737
1678
|
function getIsDev() {
|
|
1738
1679
|
try {
|
|
1739
|
-
return new URL((0,
|
|
1680
|
+
return new URL((0, import_react_native28.getSchemeUri)()).searchParams.get("isDev") === "true";
|
|
1740
1681
|
} catch {
|
|
1741
1682
|
return false;
|
|
1742
1683
|
}
|
|
1743
1684
|
}
|
|
1744
1685
|
|
|
1745
1686
|
// src/ads/remotes.ts
|
|
1746
|
-
var OPERATIONAL_ENVIRONMENT = (0,
|
|
1747
|
-
var OS = (0,
|
|
1748
|
-
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)();
|
|
1749
1690
|
var ALPHA_EVENT_TRACKER_HTTP_ENDPOINT = "https://alpha-trillion.toss.im/trk/sdk-mediation/event";
|
|
1750
1691
|
var LIVE_EVENT_TRACKER_HTTP_ENDPOINT = "https://trillion.toss.im/trk/sdk-mediation/event";
|
|
1751
1692
|
function getPostEventTrackingUrl() {
|
|
@@ -1775,32 +1716,44 @@ function postEventTracking(params) {
|
|
|
1775
1716
|
|
|
1776
1717
|
// src/ads/integratedAd.ts
|
|
1777
1718
|
var INTEGRATED_AD_SDK_VERSION = "0.0.0";
|
|
1778
|
-
var ANDROID_INTEGRATED_AD_SUPPORTED_VERSION = "5.
|
|
1779
|
-
var IOS_INTEGRATED_AD_SUPPORTED_VERSION = "5.
|
|
1719
|
+
var ANDROID_INTEGRATED_AD_SUPPORTED_VERSION = "5.247.0";
|
|
1720
|
+
var IOS_INTEGRATED_AD_SUPPORTED_VERSION = "5.247.0";
|
|
1780
1721
|
var UNSUPPORTED_ERROR_MESSAGE2 = "This feature is not supported in the current environment";
|
|
1781
1722
|
var INTG_AD_ADM_FALLBACK_RID_MAP = {};
|
|
1782
1723
|
function integratedAdIsSupported() {
|
|
1783
|
-
return (0,
|
|
1724
|
+
return (0, import_native_modules14.isMinVersionSupported)({
|
|
1784
1725
|
android: ANDROID_INTEGRATED_AD_SUPPORTED_VERSION,
|
|
1785
1726
|
ios: IOS_INTEGRATED_AD_SUPPORTED_VERSION
|
|
1786
1727
|
});
|
|
1787
1728
|
}
|
|
1788
1729
|
function generateLoadFullScreenAd(sdkId) {
|
|
1789
1730
|
const fn = (params) => {
|
|
1790
|
-
if (!
|
|
1731
|
+
if (!import_native_modules14.GoogleAdMob.loadAppsInTossAdMob.isSupported()) {
|
|
1791
1732
|
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
1792
1733
|
return noop;
|
|
1793
1734
|
}
|
|
1735
|
+
const normalizedAdGroupId = normalizeAdGroupId(params.options.adGroupId);
|
|
1736
|
+
if (normalizedAdGroupId.length === 0) {
|
|
1737
|
+
params.onError(createInvalidAdGroupIdError());
|
|
1738
|
+
return noop;
|
|
1739
|
+
}
|
|
1740
|
+
const normalizedParams = {
|
|
1741
|
+
...params,
|
|
1742
|
+
options: {
|
|
1743
|
+
...params.options,
|
|
1744
|
+
adGroupId: normalizedAdGroupId
|
|
1745
|
+
}
|
|
1746
|
+
};
|
|
1794
1747
|
if (!integratedAdIsSupported()) {
|
|
1795
|
-
return
|
|
1796
|
-
...
|
|
1748
|
+
return import_native_modules14.GoogleAdMob.loadAppsInTossAdMob({
|
|
1749
|
+
...normalizedParams,
|
|
1797
1750
|
onEvent: (event) => {
|
|
1798
1751
|
if (event.type === "loaded") {
|
|
1799
1752
|
const requestId = generateRequestId();
|
|
1800
|
-
INTG_AD_ADM_FALLBACK_RID_MAP[
|
|
1753
|
+
INTG_AD_ADM_FALLBACK_RID_MAP[normalizedAdGroupId] = requestId;
|
|
1801
1754
|
postEventTracking({
|
|
1802
1755
|
eventName: "LOAD",
|
|
1803
|
-
spaceUnitId:
|
|
1756
|
+
spaceUnitId: normalizedAdGroupId,
|
|
1804
1757
|
requestId,
|
|
1805
1758
|
responseId: event.data.responseInfo.responseId,
|
|
1806
1759
|
mediationType: "ADMOB",
|
|
@@ -1809,13 +1762,13 @@ function generateLoadFullScreenAd(sdkId) {
|
|
|
1809
1762
|
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1810
1763
|
});
|
|
1811
1764
|
}
|
|
1812
|
-
return
|
|
1765
|
+
return normalizedParams.onEvent(event);
|
|
1813
1766
|
},
|
|
1814
1767
|
onError: (error) => {
|
|
1815
|
-
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[
|
|
1768
|
+
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[normalizedAdGroupId] ?? "";
|
|
1816
1769
|
postEventTracking({
|
|
1817
1770
|
eventName: "FAILED_TO_LOAD",
|
|
1818
|
-
spaceUnitId:
|
|
1771
|
+
spaceUnitId: normalizedAdGroupId,
|
|
1819
1772
|
requestId,
|
|
1820
1773
|
responseId: "",
|
|
1821
1774
|
mediationType: "ADMOB",
|
|
@@ -1823,14 +1776,14 @@ function generateLoadFullScreenAd(sdkId) {
|
|
|
1823
1776
|
adSourceName: "",
|
|
1824
1777
|
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1825
1778
|
});
|
|
1826
|
-
return
|
|
1779
|
+
return normalizedParams.onError(error);
|
|
1827
1780
|
}
|
|
1828
1781
|
});
|
|
1829
1782
|
}
|
|
1830
|
-
const { onEvent, onError, options } =
|
|
1783
|
+
const { onEvent, onError, options } = normalizedParams;
|
|
1831
1784
|
const { adGroupId } = options;
|
|
1832
1785
|
const referrer = getReferrer();
|
|
1833
|
-
const unregisterCallbacks =
|
|
1786
|
+
const unregisterCallbacks = import_native_modules14.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1834
1787
|
"loadTossAdOrAdmob",
|
|
1835
1788
|
{ spaceUnitId: adGroupId, referrer, sessionId, sdkId },
|
|
1836
1789
|
{
|
|
@@ -1844,26 +1797,38 @@ function generateLoadFullScreenAd(sdkId) {
|
|
|
1844
1797
|
);
|
|
1845
1798
|
return unregisterCallbacks;
|
|
1846
1799
|
};
|
|
1847
|
-
fn.isSupported =
|
|
1800
|
+
fn.isSupported = import_native_modules14.GoogleAdMob.loadAppsInTossAdMob.isSupported;
|
|
1848
1801
|
return fn;
|
|
1849
1802
|
}
|
|
1850
1803
|
var loadFullScreenAd = generateLoadFullScreenAd("107");
|
|
1851
1804
|
var loadFullScreenAdForWeb = generateLoadFullScreenAd("107");
|
|
1852
1805
|
function showFullScreenAd(params) {
|
|
1853
|
-
if (!
|
|
1806
|
+
if (!import_native_modules14.GoogleAdMob.showAppsInTossAdMob.isSupported()) {
|
|
1854
1807
|
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
1855
1808
|
return noop;
|
|
1856
1809
|
}
|
|
1810
|
+
const normalizedAdGroupId = normalizeAdGroupId(params.options.adGroupId);
|
|
1811
|
+
if (normalizedAdGroupId.length === 0) {
|
|
1812
|
+
params.onError(createInvalidAdGroupIdError());
|
|
1813
|
+
return noop;
|
|
1814
|
+
}
|
|
1815
|
+
const normalizedParams = {
|
|
1816
|
+
...params,
|
|
1817
|
+
options: {
|
|
1818
|
+
...params.options,
|
|
1819
|
+
adGroupId: normalizedAdGroupId
|
|
1820
|
+
}
|
|
1821
|
+
};
|
|
1857
1822
|
if (!integratedAdIsSupported()) {
|
|
1858
|
-
return
|
|
1859
|
-
...
|
|
1823
|
+
return import_native_modules14.GoogleAdMob.showAppsInTossAdMob({
|
|
1824
|
+
...normalizedParams,
|
|
1860
1825
|
onEvent: (event) => {
|
|
1861
|
-
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[
|
|
1826
|
+
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[normalizedAdGroupId] ?? "";
|
|
1862
1827
|
switch (event.type) {
|
|
1863
1828
|
case "show":
|
|
1864
1829
|
postEventTracking({
|
|
1865
1830
|
eventName: "SHOW",
|
|
1866
|
-
spaceUnitId:
|
|
1831
|
+
spaceUnitId: normalizedAdGroupId,
|
|
1867
1832
|
requestId,
|
|
1868
1833
|
responseId: "",
|
|
1869
1834
|
mediationType: "ADMOB",
|
|
@@ -1875,7 +1840,7 @@ function showFullScreenAd(params) {
|
|
|
1875
1840
|
case "failedToShow":
|
|
1876
1841
|
postEventTracking({
|
|
1877
1842
|
eventName: "FAILED_TO_SHOW",
|
|
1878
|
-
spaceUnitId:
|
|
1843
|
+
spaceUnitId: normalizedAdGroupId,
|
|
1879
1844
|
requestId,
|
|
1880
1845
|
responseId: "",
|
|
1881
1846
|
mediationType: "ADMOB",
|
|
@@ -1887,7 +1852,7 @@ function showFullScreenAd(params) {
|
|
|
1887
1852
|
case "impression":
|
|
1888
1853
|
postEventTracking({
|
|
1889
1854
|
eventName: "IMP",
|
|
1890
|
-
spaceUnitId:
|
|
1855
|
+
spaceUnitId: normalizedAdGroupId,
|
|
1891
1856
|
requestId,
|
|
1892
1857
|
responseId: "",
|
|
1893
1858
|
mediationType: "ADMOB",
|
|
@@ -1899,7 +1864,7 @@ function showFullScreenAd(params) {
|
|
|
1899
1864
|
case "clicked":
|
|
1900
1865
|
postEventTracking({
|
|
1901
1866
|
eventName: "CLICK",
|
|
1902
|
-
spaceUnitId:
|
|
1867
|
+
spaceUnitId: normalizedAdGroupId,
|
|
1903
1868
|
requestId,
|
|
1904
1869
|
responseId: "",
|
|
1905
1870
|
mediationType: "ADMOB",
|
|
@@ -1911,7 +1876,7 @@ function showFullScreenAd(params) {
|
|
|
1911
1876
|
case "dismissed":
|
|
1912
1877
|
postEventTracking({
|
|
1913
1878
|
eventName: "DISMISS",
|
|
1914
|
-
spaceUnitId:
|
|
1879
|
+
spaceUnitId: normalizedAdGroupId,
|
|
1915
1880
|
requestId,
|
|
1916
1881
|
responseId: "",
|
|
1917
1882
|
mediationType: "ADMOB",
|
|
@@ -1923,7 +1888,7 @@ function showFullScreenAd(params) {
|
|
|
1923
1888
|
case "userEarnedReward":
|
|
1924
1889
|
postEventTracking({
|
|
1925
1890
|
eventName: "USER_EARNED_REWARD",
|
|
1926
|
-
spaceUnitId:
|
|
1891
|
+
spaceUnitId: normalizedAdGroupId,
|
|
1927
1892
|
requestId,
|
|
1928
1893
|
responseId: "",
|
|
1929
1894
|
mediationType: "ADMOB",
|
|
@@ -1933,13 +1898,13 @@ function showFullScreenAd(params) {
|
|
|
1933
1898
|
});
|
|
1934
1899
|
break;
|
|
1935
1900
|
}
|
|
1936
|
-
return
|
|
1901
|
+
return normalizedParams.onEvent(event);
|
|
1937
1902
|
},
|
|
1938
1903
|
onError: (error) => {
|
|
1939
|
-
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[
|
|
1904
|
+
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[normalizedAdGroupId] ?? "";
|
|
1940
1905
|
postEventTracking({
|
|
1941
1906
|
eventName: "FAILED_TO_SHOW",
|
|
1942
|
-
spaceUnitId:
|
|
1907
|
+
spaceUnitId: normalizedAdGroupId,
|
|
1943
1908
|
requestId,
|
|
1944
1909
|
responseId: "",
|
|
1945
1910
|
mediationType: "ADMOB",
|
|
@@ -1947,14 +1912,14 @@ function showFullScreenAd(params) {
|
|
|
1947
1912
|
adSourceName: "",
|
|
1948
1913
|
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1949
1914
|
});
|
|
1950
|
-
return
|
|
1915
|
+
return normalizedParams.onError(error);
|
|
1951
1916
|
}
|
|
1952
1917
|
});
|
|
1953
1918
|
}
|
|
1954
|
-
const { onEvent, onError, options } =
|
|
1919
|
+
const { onEvent, onError, options } = normalizedParams;
|
|
1955
1920
|
const { adGroupId } = options;
|
|
1956
1921
|
const referrer = getReferrer();
|
|
1957
|
-
const unregisterCallbacks =
|
|
1922
|
+
const unregisterCallbacks = import_native_modules14.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1958
1923
|
"showTossAdOrAdmob",
|
|
1959
1924
|
{ spaceUnitId: adGroupId, referrer, sessionId },
|
|
1960
1925
|
{
|
|
@@ -1986,14 +1951,13 @@ function showFullScreenAd(params) {
|
|
|
1986
1951
|
);
|
|
1987
1952
|
return unregisterCallbacks;
|
|
1988
1953
|
}
|
|
1989
|
-
showFullScreenAd.isSupported =
|
|
1954
|
+
showFullScreenAd.isSupported = import_native_modules14.GoogleAdMob.showAppsInTossAdMob.isSupported;
|
|
1990
1955
|
|
|
1991
1956
|
// src/ads/tossAdEventLog.ts
|
|
1992
|
-
var
|
|
1993
|
-
var import_react_native30 = require("@granite-js/react-native");
|
|
1957
|
+
var import_react_native29 = require("@granite-js/react-native");
|
|
1994
1958
|
async function tossAdEventLog(params) {
|
|
1995
1959
|
const referrer = getReferrer();
|
|
1996
|
-
const appName =
|
|
1960
|
+
const appName = import_react_native29.Granite.appName;
|
|
1997
1961
|
const eventLogParams = {
|
|
1998
1962
|
...params,
|
|
1999
1963
|
params: {
|
|
@@ -2002,11 +1966,11 @@ async function tossAdEventLog(params) {
|
|
|
2002
1966
|
app_name: appName
|
|
2003
1967
|
}
|
|
2004
1968
|
};
|
|
2005
|
-
return
|
|
1969
|
+
return sendLog(eventLogParams, { pipelines: ["core"] });
|
|
2006
1970
|
}
|
|
2007
1971
|
|
|
2008
1972
|
// src/bridge-handler/useBridgeHandler.tsx
|
|
2009
|
-
var
|
|
1973
|
+
var import_react21 = require("react");
|
|
2010
1974
|
function serializeError(error) {
|
|
2011
1975
|
return JSON.stringify(error, (_, value) => {
|
|
2012
1976
|
if (value instanceof Error) {
|
|
@@ -2058,8 +2022,8 @@ function useBridgeHandler({
|
|
|
2058
2022
|
asyncHandlerMap,
|
|
2059
2023
|
eventListenerMap
|
|
2060
2024
|
}) {
|
|
2061
|
-
const ref = (0,
|
|
2062
|
-
const injectedJavaScript = (0,
|
|
2025
|
+
const ref = (0, import_react21.useRef)(null);
|
|
2026
|
+
const injectedJavaScript = (0, import_react21.useMemo)(
|
|
2063
2027
|
() => `window.__CONSTANT_HANDLER_MAP = ${JSON.stringify(
|
|
2064
2028
|
Object.entries(constantHandlerMap).reduce(
|
|
2065
2029
|
(acc, [key, value]) => {
|
|
@@ -2071,7 +2035,7 @@ function useBridgeHandler({
|
|
|
2071
2035
|
)};`,
|
|
2072
2036
|
[constantHandlerMap]
|
|
2073
2037
|
);
|
|
2074
|
-
(0,
|
|
2038
|
+
(0, import_react21.useEffect)(() => {
|
|
2075
2039
|
ref.current?.injectJavaScript(injectedJavaScript);
|
|
2076
2040
|
}, [injectedJavaScript]);
|
|
2077
2041
|
const createHandleOnEvent = (functionName, eventId) => (response) => {
|
|
@@ -2085,7 +2049,7 @@ function useBridgeHandler({
|
|
|
2085
2049
|
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
|
|
2086
2050
|
`);
|
|
2087
2051
|
};
|
|
2088
|
-
const $onMessage = (0,
|
|
2052
|
+
const $onMessage = (0, import_react21.useCallback)(
|
|
2089
2053
|
async (e) => {
|
|
2090
2054
|
onMessage?.(e);
|
|
2091
2055
|
const data = parseNativeEventData(e.nativeEvent.data);
|
|
@@ -2145,26 +2109,26 @@ function parseNativeEventData(data) {
|
|
|
2145
2109
|
|
|
2146
2110
|
// src/core/hooks/useSafeAreaInsetsEvent.tsx
|
|
2147
2111
|
var import_react_native_safe_area_context3 = require("@granite-js/native/react-native-safe-area-context");
|
|
2148
|
-
var
|
|
2112
|
+
var import_react22 = require("react");
|
|
2149
2113
|
function useSafeAreaInsetsEvent() {
|
|
2150
2114
|
const insets = (0, import_react_native_safe_area_context3.useSafeAreaInsets)();
|
|
2151
|
-
(0,
|
|
2115
|
+
(0, import_react22.useEffect)(() => {
|
|
2152
2116
|
safeAreaInsetsChange.emit(insets);
|
|
2153
2117
|
}, [insets]);
|
|
2154
|
-
(0,
|
|
2118
|
+
(0, import_react22.useEffect)(() => {
|
|
2155
2119
|
return () => safeAreaInsetsChange.clearSubscriptions();
|
|
2156
2120
|
}, []);
|
|
2157
2121
|
return safeAreaInsetsChange;
|
|
2158
2122
|
}
|
|
2159
2123
|
|
|
2160
2124
|
// src/core/hooks/useWebBackHandler.tsx
|
|
2161
|
-
var
|
|
2125
|
+
var import_react_native30 = require("@granite-js/react-native");
|
|
2162
2126
|
var import_tds_react_native13 = require("@toss/tds-react-native");
|
|
2163
2127
|
var import_es_hangul5 = require("es-hangul");
|
|
2164
|
-
var
|
|
2128
|
+
var import_react24 = require("react");
|
|
2165
2129
|
|
|
2166
2130
|
// src/hooks/useWebviewHistoryStack.tsx
|
|
2167
|
-
var
|
|
2131
|
+
var import_react23 = require("react");
|
|
2168
2132
|
var INITIAL_STATE = { stack: [], index: -1 };
|
|
2169
2133
|
function reducer(state, action) {
|
|
2170
2134
|
switch (action.type) {
|
|
@@ -2195,11 +2159,11 @@ function reducer(state, action) {
|
|
|
2195
2159
|
}
|
|
2196
2160
|
}
|
|
2197
2161
|
function useWebViewHistory() {
|
|
2198
|
-
const [state, dispatch] = (0,
|
|
2199
|
-
const onNavigationStateChange = (0,
|
|
2162
|
+
const [state, dispatch] = (0, import_react23.useReducer)(reducer, INITIAL_STATE);
|
|
2163
|
+
const onNavigationStateChange = (0, import_react23.useCallback)(({ url, canGoForward: canGoForward2 }) => {
|
|
2200
2164
|
dispatch({ type: "NAVIGATION_CHANGE", url, canGoForward: canGoForward2 });
|
|
2201
2165
|
}, []);
|
|
2202
|
-
const { canGoBack, canGoForward } = (0,
|
|
2166
|
+
const { canGoBack, canGoForward } = (0, import_react23.useMemo)(() => {
|
|
2203
2167
|
const canBack = state.index > 0;
|
|
2204
2168
|
const canFwd = state.index >= 0 && state.index < state.stack.length - 1;
|
|
2205
2169
|
return { canGoBack: canBack, canGoForward: canFwd };
|
|
@@ -2209,30 +2173,29 @@ function useWebViewHistory() {
|
|
|
2209
2173
|
|
|
2210
2174
|
// src/core/hooks/useWebBackHandler.tsx
|
|
2211
2175
|
function useWebBackHandler(webViewInitialURL, webViewRef) {
|
|
2212
|
-
const { captureExitLog } = useCaptureExitLog();
|
|
2213
2176
|
const { hasHistory, onNavigationStateChange } = useWebViewHistory();
|
|
2214
2177
|
const {
|
|
2215
2178
|
handlersRef: webBackHandlersRef,
|
|
2216
2179
|
hasBackEvent: hasWebBackEvent,
|
|
2217
2180
|
addEventListener: addWebBackEventListener,
|
|
2218
2181
|
removeEventListener: removeWebBackEventListener
|
|
2219
|
-
} = (0,
|
|
2182
|
+
} = (0, import_react_native30.useBackEventState)();
|
|
2220
2183
|
const logging = useNavigationBarLogging();
|
|
2221
2184
|
const { openConfirm } = (0, import_tds_react_native13.useDialog)();
|
|
2222
2185
|
const global2 = getAppsInTossGlobals();
|
|
2223
|
-
const addEventListener = (0,
|
|
2186
|
+
const addEventListener = (0, import_react24.useCallback)(
|
|
2224
2187
|
(handler) => {
|
|
2225
2188
|
addWebBackEventListener(handler);
|
|
2226
2189
|
},
|
|
2227
2190
|
[addWebBackEventListener]
|
|
2228
2191
|
);
|
|
2229
|
-
const removeEventListener = (0,
|
|
2192
|
+
const removeEventListener = (0, import_react24.useCallback)(
|
|
2230
2193
|
(handler) => {
|
|
2231
2194
|
removeWebBackEventListener(handler);
|
|
2232
2195
|
},
|
|
2233
2196
|
[removeWebBackEventListener]
|
|
2234
2197
|
);
|
|
2235
|
-
const handleWebBack = (0,
|
|
2198
|
+
const handleWebBack = (0, import_react24.useCallback)(async () => {
|
|
2236
2199
|
if (hasWebBackEvent) {
|
|
2237
2200
|
for (const handler of webBackHandlersRef) {
|
|
2238
2201
|
handler();
|
|
@@ -2251,21 +2214,11 @@ function useWebBackHandler(webViewInitialURL, webViewRef) {
|
|
|
2251
2214
|
});
|
|
2252
2215
|
logging.closePopupCtaClick(isConfirmed);
|
|
2253
2216
|
if (isConfirmed) {
|
|
2254
|
-
|
|
2255
|
-
(0, import_react_native31.closeView)();
|
|
2217
|
+
(0, import_react_native30.closeView)();
|
|
2256
2218
|
}
|
|
2257
2219
|
}
|
|
2258
|
-
}, [
|
|
2259
|
-
|
|
2260
|
-
global2.brandDisplayName,
|
|
2261
|
-
hasHistory,
|
|
2262
|
-
hasWebBackEvent,
|
|
2263
|
-
webBackHandlersRef,
|
|
2264
|
-
logging,
|
|
2265
|
-
openConfirm,
|
|
2266
|
-
webViewRef
|
|
2267
|
-
]);
|
|
2268
|
-
const handleWebHome = (0, import_react25.useCallback)(() => {
|
|
2220
|
+
}, [global2.brandDisplayName, hasHistory, hasWebBackEvent, webBackHandlersRef, logging, openConfirm, webViewRef]);
|
|
2221
|
+
const handleWebHome = (0, import_react24.useCallback)(() => {
|
|
2269
2222
|
logging.homeButtonClick();
|
|
2270
2223
|
if (homeEvent.hasSubscriptions()) {
|
|
2271
2224
|
homeEvent.emit({});
|
|
@@ -2278,7 +2231,7 @@ function useWebBackHandler(webViewInitialURL, webViewRef) {
|
|
|
2278
2231
|
})();
|
|
2279
2232
|
`);
|
|
2280
2233
|
}, [hasWebBackEvent, webBackHandlersRef, logging, webViewInitialURL, webViewRef]);
|
|
2281
|
-
return (0,
|
|
2234
|
+
return (0, import_react24.useMemo)(
|
|
2282
2235
|
() => ({ addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange }),
|
|
2283
2236
|
[addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange]
|
|
2284
2237
|
);
|
|
@@ -2298,8 +2251,8 @@ function mergeRefs(...refs) {
|
|
|
2298
2251
|
}
|
|
2299
2252
|
|
|
2300
2253
|
// src/hooks/useCreateUserAgent.ts
|
|
2301
|
-
var
|
|
2302
|
-
var
|
|
2254
|
+
var import_native_modules15 = require("@apps-in-toss/native-modules");
|
|
2255
|
+
var import_react_native31 = require("react-native");
|
|
2303
2256
|
var FontA11yCategory = {
|
|
2304
2257
|
Large: "Large",
|
|
2305
2258
|
xLarge: "xLarge",
|
|
@@ -2432,9 +2385,9 @@ function useCreateUserAgent({
|
|
|
2432
2385
|
safeArea,
|
|
2433
2386
|
safeAreaBottomTransparency
|
|
2434
2387
|
}) {
|
|
2435
|
-
const platform = (0,
|
|
2436
|
-
const appVersion = (0,
|
|
2437
|
-
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)();
|
|
2438
2391
|
const platformString = platform === "ios" ? "iPhone" : "Android phone";
|
|
2439
2392
|
const fontA11y = mapFontScaleToCategory(fontScale, platform);
|
|
2440
2393
|
const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
|
|
@@ -2455,17 +2408,17 @@ function useCreateUserAgent({
|
|
|
2455
2408
|
}
|
|
2456
2409
|
|
|
2457
2410
|
// src/hooks/useGeolocation.ts
|
|
2458
|
-
var
|
|
2459
|
-
var
|
|
2460
|
-
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");
|
|
2461
2414
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
2462
|
-
const isVisible = (0,
|
|
2463
|
-
const [location, setLocation] = (0,
|
|
2464
|
-
(0,
|
|
2415
|
+
const isVisible = (0, import_react_native32.useVisibility)();
|
|
2416
|
+
const [location, setLocation] = (0, import_react25.useState)(null);
|
|
2417
|
+
(0, import_react25.useEffect)(() => {
|
|
2465
2418
|
if (!isVisible) {
|
|
2466
2419
|
return;
|
|
2467
2420
|
}
|
|
2468
|
-
return (0,
|
|
2421
|
+
return (0, import_native_modules16.startUpdateLocation)({
|
|
2469
2422
|
options: {
|
|
2470
2423
|
accuracy,
|
|
2471
2424
|
distanceInterval,
|
|
@@ -2479,12 +2432,12 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
2479
2432
|
}
|
|
2480
2433
|
|
|
2481
2434
|
// src/hooks/useWaitForReturnNavigator.tsx
|
|
2482
|
-
var
|
|
2483
|
-
var
|
|
2435
|
+
var import_react_native33 = require("@granite-js/react-native");
|
|
2436
|
+
var import_react26 = require("react");
|
|
2484
2437
|
function useWaitForReturnNavigator() {
|
|
2485
|
-
const callbacks = (0,
|
|
2486
|
-
const navigation = (0,
|
|
2487
|
-
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)(
|
|
2488
2441
|
(route, params) => {
|
|
2489
2442
|
return new Promise((resolve) => {
|
|
2490
2443
|
callbacks.push(resolve);
|
|
@@ -2493,7 +2446,7 @@ function useWaitForReturnNavigator() {
|
|
|
2493
2446
|
},
|
|
2494
2447
|
[callbacks, navigation]
|
|
2495
2448
|
);
|
|
2496
|
-
const handleVisibilityChange = (0,
|
|
2449
|
+
const handleVisibilityChange = (0, import_react26.useCallback)(
|
|
2497
2450
|
(state) => {
|
|
2498
2451
|
if (state === "visible" && callbacks.length > 0) {
|
|
2499
2452
|
for (const callback of callbacks) {
|
|
@@ -2504,7 +2457,7 @@ function useWaitForReturnNavigator() {
|
|
|
2504
2457
|
},
|
|
2505
2458
|
[callbacks]
|
|
2506
2459
|
);
|
|
2507
|
-
(0,
|
|
2460
|
+
(0, import_react_native33.useVisibilityChange)(handleVisibilityChange);
|
|
2508
2461
|
return startNavigating;
|
|
2509
2462
|
}
|
|
2510
2463
|
|
|
@@ -2518,8 +2471,8 @@ function useTopNavigation() {
|
|
|
2518
2471
|
}
|
|
2519
2472
|
|
|
2520
2473
|
// src/hooks/useWebViewMemoryDebug.tsx
|
|
2521
|
-
var
|
|
2522
|
-
var
|
|
2474
|
+
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
2475
|
+
var import_react_native34 = require("@granite-js/react-native");
|
|
2523
2476
|
var import_tds_react_native14 = require("@toss/tds-react-native");
|
|
2524
2477
|
function useHandleWebViewProcessDidTerminate(webViewRef) {
|
|
2525
2478
|
const toast = (0, import_tds_react_native14.useToast)();
|
|
@@ -2542,20 +2495,20 @@ function webViewDebugLog(logName, params) {
|
|
|
2542
2495
|
log_type: "debug",
|
|
2543
2496
|
params: {
|
|
2544
2497
|
...params,
|
|
2545
|
-
app_name:
|
|
2498
|
+
app_name: import_react_native34.Granite.appName,
|
|
2546
2499
|
deployment_id: global2.deploymentId
|
|
2547
2500
|
}
|
|
2548
2501
|
};
|
|
2549
|
-
if ((0,
|
|
2550
|
-
|
|
2502
|
+
if ((0, import_native_modules17.getOperationalEnvironment)() === "toss") {
|
|
2503
|
+
sendLog(event, { pipelines: ["core"] });
|
|
2551
2504
|
} else {
|
|
2552
2505
|
console.log("[webViewDebugLog]", event);
|
|
2553
2506
|
}
|
|
2554
2507
|
}
|
|
2555
2508
|
|
|
2556
2509
|
// src/utils/log.ts
|
|
2557
|
-
var
|
|
2558
|
-
var
|
|
2510
|
+
var import_native_modules18 = require("@apps-in-toss/native-modules");
|
|
2511
|
+
var import_react_native35 = require("@granite-js/react-native");
|
|
2559
2512
|
|
|
2560
2513
|
// src/utils/extractDateFromUUIDv7.ts
|
|
2561
2514
|
var extractDateFromUUIDv7 = (uuid) => {
|
|
@@ -2581,7 +2534,7 @@ var getGroupId = (url) => {
|
|
|
2581
2534
|
};
|
|
2582
2535
|
var getReferrer2 = () => {
|
|
2583
2536
|
try {
|
|
2584
|
-
const referrer = new URL((0,
|
|
2537
|
+
const referrer = new URL((0, import_react_native35.getSchemeUri)());
|
|
2585
2538
|
return referrer.searchParams.get("referrer");
|
|
2586
2539
|
} catch {
|
|
2587
2540
|
return "";
|
|
@@ -2600,7 +2553,7 @@ var trackScreen = (url, title) => {
|
|
|
2600
2553
|
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
2601
2554
|
}
|
|
2602
2555
|
};
|
|
2603
|
-
return (0,
|
|
2556
|
+
return (0, import_native_modules18.eventLog)(log);
|
|
2604
2557
|
};
|
|
2605
2558
|
|
|
2606
2559
|
// src/components/WebView.tsx
|
|
@@ -2614,7 +2567,7 @@ var WEBVIEW_TYPES = {
|
|
|
2614
2567
|
};
|
|
2615
2568
|
function mergeSchemeQueryParamsInto(url) {
|
|
2616
2569
|
const baseUrl = new URL(url);
|
|
2617
|
-
const schemeUrl = new URL((0,
|
|
2570
|
+
const schemeUrl = new URL((0, import_react_native36.getSchemeUri)());
|
|
2618
2571
|
const resultUrl = new URL(schemeUrl.pathname, baseUrl.origin);
|
|
2619
2572
|
for (const [key, value] of baseUrl.searchParams.entries()) {
|
|
2620
2573
|
resultUrl.searchParams.set(key, value);
|
|
@@ -2629,7 +2582,7 @@ function getWebViewURL(local) {
|
|
|
2629
2582
|
const devUrl = `http://${local.host}:${local.port}`;
|
|
2630
2583
|
return mergeSchemeQueryParamsInto(devUrl);
|
|
2631
2584
|
}
|
|
2632
|
-
const { url: rawUrl } = (0,
|
|
2585
|
+
const { url: rawUrl } = (0, import_native_modules19.safeSyncPostMessage)("getWebBundleURL", {});
|
|
2633
2586
|
const url = mergeSchemeQueryParamsInto(rawUrl);
|
|
2634
2587
|
const deploymentId = env.getDeploymentId();
|
|
2635
2588
|
if (deploymentId) {
|
|
@@ -2641,8 +2594,8 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2641
2594
|
if (!TYPES.includes(type)) {
|
|
2642
2595
|
throw new Error(`Invalid WebView type: '${type}'`);
|
|
2643
2596
|
}
|
|
2644
|
-
const webViewRef = (0,
|
|
2645
|
-
const url = (0,
|
|
2597
|
+
const webViewRef = (0, import_react27.useRef)(null);
|
|
2598
|
+
const url = (0, import_react27.useMemo)(() => getWebViewURL(local), [local]);
|
|
2646
2599
|
const webBackHandler = useWebBackHandler(url, webViewRef);
|
|
2647
2600
|
const top = (0, import_private9.useSafeAreaTop)();
|
|
2648
2601
|
const bottom = (0, import_private9.useSafeAreaBottom)();
|
|
@@ -2650,7 +2603,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2650
2603
|
const global2 = getAppsInTossGlobals();
|
|
2651
2604
|
const navigationBarContext = useNavigationBarContext();
|
|
2652
2605
|
const safeAreaInsetsEvent = useSafeAreaInsetsEvent();
|
|
2653
|
-
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0,
|
|
2606
|
+
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0, import_react27.useState)(
|
|
2654
2607
|
props.allowsBackForwardNavigationGestures
|
|
2655
2608
|
);
|
|
2656
2609
|
const handler = useBridgeHandler({
|
|
@@ -2665,22 +2618,22 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2665
2618
|
};
|
|
2666
2619
|
},
|
|
2667
2620
|
homeEvent: ({ onEvent }) => homeEvent.subscribe(onEvent),
|
|
2668
|
-
updateLocationEvent: ({ onEvent, onError, options }) =>
|
|
2621
|
+
updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules19.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
2669
2622
|
safeAreaInsetsChange: ({ onEvent }) => safeAreaInsetsEvent.subscribe(onEvent),
|
|
2670
2623
|
/** @internal */
|
|
2671
|
-
appBridgeCallbackEvent: ({ onEvent, onError, options }) =>
|
|
2624
|
+
appBridgeCallbackEvent: ({ onEvent, onError, options }) => import_native_modules19.appsInTossEvent.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
|
|
2672
2625
|
/** AdMobV2 */
|
|
2673
|
-
loadAppsInTossAdMob:
|
|
2674
|
-
showAppsInTossAdMob:
|
|
2626
|
+
loadAppsInTossAdMob: import_native_modules19.GoogleAdMob.loadAppsInTossAdMob,
|
|
2627
|
+
showAppsInTossAdMob: import_native_modules19.GoogleAdMob.showAppsInTossAdMob,
|
|
2675
2628
|
/** IntegratedAd */
|
|
2676
2629
|
loadFullScreenAd: loadFullScreenAdForWeb,
|
|
2677
2630
|
showFullScreenAd,
|
|
2678
2631
|
/** TossAd */
|
|
2679
2632
|
fetchTossAd,
|
|
2680
2633
|
/** IAP */
|
|
2681
|
-
iapCreateOneTimePurchaseOrder:
|
|
2682
|
-
requestSubscriptionPurchase:
|
|
2683
|
-
requestOneTimePurchase:
|
|
2634
|
+
iapCreateOneTimePurchaseOrder: import_native_modules19.IAP.createOneTimePurchaseOrder,
|
|
2635
|
+
requestSubscriptionPurchase: import_native_modules19.IAP.createSubscriptionPurchaseOrder,
|
|
2636
|
+
requestOneTimePurchase: import_native_modules19.requestOneTimePurchase
|
|
2684
2637
|
},
|
|
2685
2638
|
constantHandlerMap: {
|
|
2686
2639
|
...appsInTossConstantBridges,
|
|
@@ -2691,12 +2644,12 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2691
2644
|
right: insets.right
|
|
2692
2645
|
}),
|
|
2693
2646
|
...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
|
|
2694
|
-
getServerTime_isSupported:
|
|
2695
|
-
requestReview_isSupported:
|
|
2647
|
+
getServerTime_isSupported: import_native_modules19.getServerTime.isSupported,
|
|
2648
|
+
requestReview_isSupported: import_native_modules19.requestReview.isSupported,
|
|
2696
2649
|
/** AdMobV2 */
|
|
2697
|
-
loadAppsInTossAdMob_isSupported:
|
|
2698
|
-
showAppsInTossAdMob_isSupported:
|
|
2699
|
-
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,
|
|
2700
2653
|
/** IntegratedAd */
|
|
2701
2654
|
loadFullScreenAd_isSupported: loadFullScreenAdForWeb.isSupported,
|
|
2702
2655
|
showFullScreenAd_isSupported: showFullScreenAd.isSupported,
|
|
@@ -2709,7 +2662,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2709
2662
|
},
|
|
2710
2663
|
asyncHandlerMap: {
|
|
2711
2664
|
...appsInTossAsyncBridges,
|
|
2712
|
-
getServerTime:
|
|
2665
|
+
getServerTime: import_native_modules19.getServerTime,
|
|
2713
2666
|
setIosSwipeGestureEnabled: (options) => {
|
|
2714
2667
|
setAllowsBackForwardNavigationGestures(options.isEnabled);
|
|
2715
2668
|
return appsInTossAsyncBridges.setIosSwipeGestureEnabled(options);
|
|
@@ -2727,31 +2680,30 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2727
2680
|
getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
|
|
2728
2681
|
openCamera: appsInTossAsyncBridges.openCamera,
|
|
2729
2682
|
/** Storage */
|
|
2730
|
-
getStorageItem:
|
|
2731
|
-
setStorageItem:
|
|
2732
|
-
removeStorageItem:
|
|
2733
|
-
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,
|
|
2734
2687
|
/** IAP */
|
|
2735
|
-
iapGetProductItemList:
|
|
2736
|
-
iapCreateOneTimePurchaseOrder:
|
|
2737
|
-
processProductGrant:
|
|
2738
|
-
getPendingOrders:
|
|
2739
|
-
getCompletedOrRefundedOrders:
|
|
2740
|
-
completeProductGrant:
|
|
2741
|
-
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,
|
|
2742
2695
|
/** AdMobV2 */
|
|
2743
|
-
isAppsInTossAdMobLoaded:
|
|
2696
|
+
isAppsInTossAdMobLoaded: import_native_modules19.GoogleAdMob.isAppsInTossAdMobLoaded,
|
|
2744
2697
|
/** Toss Ads */
|
|
2745
2698
|
tossAdEventLog,
|
|
2746
2699
|
/** Private */
|
|
2747
2700
|
memoryDebugLog: webViewMemoryDebugLog,
|
|
2748
2701
|
debugLog: async (event) => {
|
|
2749
|
-
(
|
|
2750
|
-
import_native_modules24.INTERNAL__module.tossCoreEventLog(event);
|
|
2702
|
+
sendLog(event);
|
|
2751
2703
|
}
|
|
2752
2704
|
}
|
|
2753
2705
|
});
|
|
2754
|
-
const headerPropForExternalWebView = (0,
|
|
2706
|
+
const headerPropForExternalWebView = (0, import_react27.useMemo)(() => {
|
|
2755
2707
|
const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
|
|
2756
2708
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
2757
2709
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
@@ -2772,12 +2724,12 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2772
2724
|
colorPreference: "light"
|
|
2773
2725
|
});
|
|
2774
2726
|
const refs = mergeRefs(handler.ref, webViewRef);
|
|
2775
|
-
(0,
|
|
2727
|
+
(0, import_react27.useEffect)(() => {
|
|
2776
2728
|
const callback = () => {
|
|
2777
2729
|
webBackHandler.handleWebBack();
|
|
2778
2730
|
return true;
|
|
2779
2731
|
};
|
|
2780
|
-
const subscription =
|
|
2732
|
+
const subscription = import_react_native37.BackHandler.addEventListener("hardwareBackPress", callback);
|
|
2781
2733
|
return () => subscription.remove();
|
|
2782
2734
|
}, [webBackHandler]);
|
|
2783
2735
|
const handleWebViewProcessDidTerminate = useHandleWebViewProcessDidTerminate(webViewRef);
|
|
@@ -2804,14 +2756,14 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2804
2756
|
webBackHandler.onNavigationStateChange(event);
|
|
2805
2757
|
},
|
|
2806
2758
|
textZoom: 100,
|
|
2807
|
-
userAgent:
|
|
2759
|
+
userAgent: import_react_native37.Platform.OS === "ios" ? userAgent : void 0,
|
|
2808
2760
|
sharedCookiesEnabled: true,
|
|
2809
2761
|
webviewDebuggingEnabled: webViewDebuggingEnabled,
|
|
2810
2762
|
thirdPartyCookiesEnabled: true,
|
|
2811
2763
|
onMessage: handler.onMessage,
|
|
2812
2764
|
injectedJavaScript: import_user_scripts.afterDocumentLoad,
|
|
2813
2765
|
injectedJavaScriptBeforeContentLoaded: [handler.injectedJavaScript, import_user_scripts.beforeDocumentLoad].join("\n"),
|
|
2814
|
-
decelerationRate:
|
|
2766
|
+
decelerationRate: import_react_native37.Platform.OS === "ios" ? 1 : void 0,
|
|
2815
2767
|
allowsBackForwardNavigationGestures,
|
|
2816
2768
|
onShouldStartLoadWithRequest: (event) => {
|
|
2817
2769
|
try {
|
|
@@ -2819,7 +2771,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2819
2771
|
if (["https:", "http:"].includes(url2.protocol) || url2.href === "about:blank") {
|
|
2820
2772
|
return true;
|
|
2821
2773
|
} else {
|
|
2822
|
-
|
|
2774
|
+
import_react_native37.Linking.openURL(convertIntentURL(url2) ?? url2.href);
|
|
2823
2775
|
return false;
|
|
2824
2776
|
}
|
|
2825
2777
|
} catch (error) {
|
|
@@ -2850,9 +2802,9 @@ __reExport(src_exports, require("@apps-in-toss/types"), module.exports);
|
|
|
2850
2802
|
var import_types = require("@apps-in-toss/types");
|
|
2851
2803
|
|
|
2852
2804
|
// src/ads/inlineAd/InlineAd.tsx
|
|
2853
|
-
var
|
|
2854
|
-
var
|
|
2855
|
-
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");
|
|
2856
2808
|
|
|
2857
2809
|
// src/ads/inlineAd/constants.ts
|
|
2858
2810
|
var SDK_ID = "106";
|
|
@@ -3038,10 +2990,11 @@ function isStructurallyValidAd(ad) {
|
|
|
3038
2990
|
return Boolean(ad && ad.creative && typeof ad.creative === "object");
|
|
3039
2991
|
}
|
|
3040
2992
|
async function loadAd(adGroupId) {
|
|
3041
|
-
|
|
2993
|
+
const normalizedAdGroupId = normalizeAdGroupId(adGroupId);
|
|
2994
|
+
if (normalizedAdGroupId.length === 0) {
|
|
3042
2995
|
return {
|
|
3043
2996
|
type: "error",
|
|
3044
|
-
error: createError(ERROR_CODES.INVALID_SPACE,
|
|
2997
|
+
error: createError(ERROR_CODES.INVALID_SPACE, INVALID_AD_GROUP_ID_ERROR_MESSAGE)
|
|
3045
2998
|
};
|
|
3046
2999
|
}
|
|
3047
3000
|
if (!fetchTossAd.isSupported()) {
|
|
@@ -3053,7 +3006,7 @@ async function loadAd(adGroupId) {
|
|
|
3053
3006
|
let response;
|
|
3054
3007
|
try {
|
|
3055
3008
|
const raw = await fetchTossAdPromise({
|
|
3056
|
-
adGroupId,
|
|
3009
|
+
adGroupId: normalizedAdGroupId,
|
|
3057
3010
|
sdkId: SDK_ID,
|
|
3058
3011
|
availableStyleIds: AVAILABLE_STYLE_IDS
|
|
3059
3012
|
});
|
|
@@ -3113,7 +3066,7 @@ async function loadAd(adGroupId) {
|
|
|
3113
3066
|
}
|
|
3114
3067
|
|
|
3115
3068
|
// src/ads/inlineAd/opener.ts
|
|
3116
|
-
var
|
|
3069
|
+
var import_react_native38 = require("@granite-js/react-native");
|
|
3117
3070
|
function isSafeUrl(url) {
|
|
3118
3071
|
try {
|
|
3119
3072
|
const parsed = new URL(url);
|
|
@@ -3145,7 +3098,7 @@ function openLandingUrl(url) {
|
|
|
3145
3098
|
return;
|
|
3146
3099
|
}
|
|
3147
3100
|
try {
|
|
3148
|
-
(0,
|
|
3101
|
+
(0, import_react_native38.openURL)(getWebSchemeOrUri(url));
|
|
3149
3102
|
} catch (error) {
|
|
3150
3103
|
console.error("[InlineAd] Failed to open landing URL:", error);
|
|
3151
3104
|
}
|
|
@@ -3232,8 +3185,8 @@ var EventTracker = class {
|
|
|
3232
3185
|
|
|
3233
3186
|
// src/ads/inlineAd/ui/FeedBannerAdView.tsx
|
|
3234
3187
|
var import_react_native_svg = require("@granite-js/native/react-native-svg");
|
|
3235
|
-
var
|
|
3236
|
-
var
|
|
3188
|
+
var import_react28 = require("react");
|
|
3189
|
+
var import_react_native39 = require("react-native");
|
|
3237
3190
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3238
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";
|
|
3239
3192
|
function FeedBannerAdView({
|
|
@@ -3251,12 +3204,12 @@ function FeedBannerAdView({
|
|
|
3251
3204
|
paddingStyle,
|
|
3252
3205
|
onPress
|
|
3253
3206
|
}) {
|
|
3254
|
-
const scale = (0,
|
|
3207
|
+
const scale = (0, import_react28.useRef)(new import_react_native39.Animated.Value(1)).current;
|
|
3255
3208
|
const animateScale = (toValue) => {
|
|
3256
|
-
|
|
3209
|
+
import_react_native39.Animated.timing(scale, {
|
|
3257
3210
|
toValue,
|
|
3258
3211
|
duration: 100,
|
|
3259
|
-
easing:
|
|
3212
|
+
easing: import_react_native39.Easing.inOut(import_react_native39.Easing.ease),
|
|
3260
3213
|
useNativeDriver: true
|
|
3261
3214
|
}).start();
|
|
3262
3215
|
};
|
|
@@ -3269,40 +3222,40 @@ function FeedBannerAdView({
|
|
|
3269
3222
|
const resolvedCtaBackground = ctaBackgroundColor ?? "#3081F9";
|
|
3270
3223
|
const resolvedCtaTextColor = ctaTextColor ?? "#ffffff";
|
|
3271
3224
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3272
|
-
|
|
3225
|
+
import_react_native39.Pressable,
|
|
3273
3226
|
{
|
|
3274
3227
|
accessibilityRole: "button",
|
|
3275
3228
|
onPress: () => onPress(null),
|
|
3276
3229
|
onPressIn: handlePressIn,
|
|
3277
3230
|
onPressOut: handlePressOut,
|
|
3278
3231
|
style: styles.pressable,
|
|
3279
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3280
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3281
|
-
/* @__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: [
|
|
3282
3235
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3283
|
-
|
|
3236
|
+
import_react_native39.Pressable,
|
|
3284
3237
|
{
|
|
3285
3238
|
accessibilityRole: "button",
|
|
3286
3239
|
onPress: () => onPress("202"),
|
|
3287
3240
|
onPressIn: handlePressIn,
|
|
3288
3241
|
onPressOut: handlePressOut,
|
|
3289
3242
|
style: styles.logoContainer,
|
|
3290
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3291
|
-
brandLogoUri ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3292
|
-
/* @__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 }] })
|
|
3293
3246
|
] })
|
|
3294
3247
|
}
|
|
3295
3248
|
),
|
|
3296
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3249
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native39.View, { style: styles.brandTextContainer, children: [
|
|
3297
3250
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3298
|
-
|
|
3251
|
+
import_react_native39.Pressable,
|
|
3299
3252
|
{
|
|
3300
3253
|
accessibilityRole: "button",
|
|
3301
3254
|
onPress: () => onPress("103"),
|
|
3302
3255
|
onPressIn: handlePressIn,
|
|
3303
3256
|
onPressOut: handlePressOut,
|
|
3304
3257
|
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3305
|
-
|
|
3258
|
+
import_react_native39.Text,
|
|
3306
3259
|
{
|
|
3307
3260
|
allowFontScaling: false,
|
|
3308
3261
|
numberOfLines: 1,
|
|
@@ -3312,46 +3265,46 @@ function FeedBannerAdView({
|
|
|
3312
3265
|
)
|
|
3313
3266
|
}
|
|
3314
3267
|
),
|
|
3315
|
-
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
|
|
3316
3269
|
] })
|
|
3317
3270
|
] }),
|
|
3318
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3271
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native39.View, { style: styles.textArea, children: [
|
|
3319
3272
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3320
|
-
|
|
3273
|
+
import_react_native39.Pressable,
|
|
3321
3274
|
{
|
|
3322
3275
|
accessibilityRole: "button",
|
|
3323
3276
|
onPress: () => onPress("101"),
|
|
3324
3277
|
onPressIn: handlePressIn,
|
|
3325
3278
|
onPressOut: handlePressOut,
|
|
3326
|
-
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 })
|
|
3327
3280
|
}
|
|
3328
3281
|
),
|
|
3329
3282
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3330
|
-
|
|
3283
|
+
import_react_native39.Pressable,
|
|
3331
3284
|
{
|
|
3332
3285
|
accessibilityRole: "button",
|
|
3333
3286
|
onPress: () => onPress("102"),
|
|
3334
3287
|
onPressIn: handlePressIn,
|
|
3335
3288
|
onPressOut: handlePressOut,
|
|
3336
|
-
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 })
|
|
3337
3290
|
}
|
|
3338
3291
|
)
|
|
3339
3292
|
] })
|
|
3340
3293
|
] }),
|
|
3341
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3294
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native39.View, { style: styles.card, children: [
|
|
3342
3295
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3343
|
-
|
|
3296
|
+
import_react_native39.Pressable,
|
|
3344
3297
|
{
|
|
3345
3298
|
accessibilityRole: "button",
|
|
3346
3299
|
onPress: () => onPress("201"),
|
|
3347
3300
|
onPressIn: handlePressIn,
|
|
3348
3301
|
onPressOut: handlePressOut,
|
|
3349
3302
|
style: styles.imageButton,
|
|
3350
|
-
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 })
|
|
3351
3304
|
}
|
|
3352
3305
|
),
|
|
3353
3306
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3354
|
-
|
|
3307
|
+
import_react_native39.Pressable,
|
|
3355
3308
|
{
|
|
3356
3309
|
accessibilityRole: "button",
|
|
3357
3310
|
onPress: () => onPress("0"),
|
|
@@ -3359,19 +3312,19 @@ function FeedBannerAdView({
|
|
|
3359
3312
|
onPressOut: handlePressOut,
|
|
3360
3313
|
style: [styles.cta, { backgroundColor: resolvedCtaBackground }],
|
|
3361
3314
|
children: [
|
|
3362
|
-
/* @__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 }),
|
|
3363
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 }) })
|
|
3364
3317
|
]
|
|
3365
3318
|
}
|
|
3366
3319
|
),
|
|
3367
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3320
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native39.View, { style: [styles.cardOverlay, { borderColor: colors.imageOverlayBorder }] })
|
|
3368
3321
|
] }),
|
|
3369
|
-
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
|
|
3370
3323
|
] })
|
|
3371
3324
|
}
|
|
3372
3325
|
);
|
|
3373
3326
|
}
|
|
3374
|
-
var styles =
|
|
3327
|
+
var styles = import_react_native39.StyleSheet.create({
|
|
3375
3328
|
pressable: {
|
|
3376
3329
|
width: "100%"
|
|
3377
3330
|
},
|
|
@@ -3410,7 +3363,7 @@ var styles = import_react_native40.StyleSheet.create({
|
|
|
3410
3363
|
borderRadius: 18
|
|
3411
3364
|
},
|
|
3412
3365
|
logoOverlay: {
|
|
3413
|
-
...
|
|
3366
|
+
...import_react_native39.StyleSheet.absoluteFillObject,
|
|
3414
3367
|
borderWidth: 1,
|
|
3415
3368
|
borderRadius: 18
|
|
3416
3369
|
},
|
|
@@ -3473,7 +3426,7 @@ var styles = import_react_native40.StyleSheet.create({
|
|
|
3473
3426
|
lineHeight: 22.5
|
|
3474
3427
|
},
|
|
3475
3428
|
cardOverlay: {
|
|
3476
|
-
...
|
|
3429
|
+
...import_react_native39.StyleSheet.absoluteFillObject,
|
|
3477
3430
|
borderWidth: 2,
|
|
3478
3431
|
borderRadius: 12,
|
|
3479
3432
|
pointerEvents: "none"
|
|
@@ -3487,8 +3440,8 @@ var styles = import_react_native40.StyleSheet.create({
|
|
|
3487
3440
|
|
|
3488
3441
|
// src/ads/inlineAd/ui/ListBannerAdView.tsx
|
|
3489
3442
|
var import_react_native_svg2 = require("@granite-js/native/react-native-svg");
|
|
3490
|
-
var
|
|
3491
|
-
var
|
|
3443
|
+
var import_react29 = require("react");
|
|
3444
|
+
var import_react_native40 = require("react-native");
|
|
3492
3445
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3493
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";
|
|
3494
3447
|
function ListBannerAdView({
|
|
@@ -3501,13 +3454,13 @@ function ListBannerAdView({
|
|
|
3501
3454
|
colors,
|
|
3502
3455
|
onPress
|
|
3503
3456
|
}) {
|
|
3504
|
-
const scale = (0,
|
|
3505
|
-
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)}`);
|
|
3506
3459
|
const animateScale = (toValue) => {
|
|
3507
|
-
|
|
3460
|
+
import_react_native40.Animated.timing(scale, {
|
|
3508
3461
|
toValue,
|
|
3509
3462
|
duration: 100,
|
|
3510
|
-
easing:
|
|
3463
|
+
easing: import_react_native40.Easing.inOut(import_react_native40.Easing.ease),
|
|
3511
3464
|
useNativeDriver: true
|
|
3512
3465
|
}).start();
|
|
3513
3466
|
};
|
|
@@ -3518,17 +3471,17 @@ function ListBannerAdView({
|
|
|
3518
3471
|
animateScale(1);
|
|
3519
3472
|
};
|
|
3520
3473
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3521
|
-
|
|
3474
|
+
import_react_native40.Pressable,
|
|
3522
3475
|
{
|
|
3523
3476
|
accessibilityRole: "button",
|
|
3524
3477
|
onPress: () => onPress(null),
|
|
3525
3478
|
onPressIn: handlePressIn,
|
|
3526
3479
|
onPressOut: handlePressOut,
|
|
3527
3480
|
style: styles2.pressable,
|
|
3528
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3529
|
-
/* @__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: [
|
|
3530
3483
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3531
|
-
|
|
3484
|
+
import_react_native40.Pressable,
|
|
3532
3485
|
{
|
|
3533
3486
|
accessibilityRole: "button",
|
|
3534
3487
|
onPress: () => onPress("202"),
|
|
@@ -3561,31 +3514,31 @@ function ListBannerAdView({
|
|
|
3561
3514
|
] })
|
|
3562
3515
|
}
|
|
3563
3516
|
),
|
|
3564
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3517
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native40.View, { style: styles2.textWrapper, children: [
|
|
3565
3518
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3566
|
-
|
|
3519
|
+
import_react_native40.Pressable,
|
|
3567
3520
|
{
|
|
3568
3521
|
accessibilityRole: "button",
|
|
3569
3522
|
onPress: () => onPress("101"),
|
|
3570
3523
|
onPressIn: handlePressIn,
|
|
3571
3524
|
onPressOut: handlePressOut,
|
|
3572
|
-
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 })
|
|
3573
3526
|
}
|
|
3574
3527
|
),
|
|
3575
3528
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3576
|
-
|
|
3529
|
+
import_react_native40.Pressable,
|
|
3577
3530
|
{
|
|
3578
3531
|
accessibilityRole: "button",
|
|
3579
3532
|
onPress: () => onPress("102"),
|
|
3580
3533
|
onPressIn: handlePressIn,
|
|
3581
3534
|
onPressOut: handlePressOut,
|
|
3582
|
-
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 })
|
|
3583
3536
|
}
|
|
3584
3537
|
)
|
|
3585
3538
|
] })
|
|
3586
3539
|
] }),
|
|
3587
3540
|
adClearanceText ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3588
|
-
|
|
3541
|
+
import_react_native40.Text,
|
|
3589
3542
|
{
|
|
3590
3543
|
allowFontScaling: false,
|
|
3591
3544
|
style: [
|
|
@@ -3603,7 +3556,7 @@ function ListBannerAdView({
|
|
|
3603
3556
|
}
|
|
3604
3557
|
);
|
|
3605
3558
|
}
|
|
3606
|
-
var styles2 =
|
|
3559
|
+
var styles2 = import_react_native40.StyleSheet.create({
|
|
3607
3560
|
pressable: {
|
|
3608
3561
|
width: "100%"
|
|
3609
3562
|
},
|
|
@@ -3810,21 +3763,21 @@ function InlineAd(props) {
|
|
|
3810
3763
|
onAdFailedToRender,
|
|
3811
3764
|
onNoFill
|
|
3812
3765
|
} = props;
|
|
3813
|
-
const slotIdRef = (0,
|
|
3814
|
-
const [ad, setAd] = (0,
|
|
3815
|
-
const [isAdBadgeEnabled, setIsAdBadgeEnabled] = (0,
|
|
3816
|
-
const eventTrackerRef = (0,
|
|
3817
|
-
const eventPayloadRef = (0,
|
|
3818
|
-
const hasRenderedRef = (0,
|
|
3819
|
-
const hasLoggedImp1pxRef = (0,
|
|
3820
|
-
const hasLoggedImp100pRef = (0,
|
|
3821
|
-
const hasNotifiedViewableRef = (0,
|
|
3822
|
-
const viewableTimerRef = (0,
|
|
3823
|
-
const refetchIntervalMsRef = (0,
|
|
3824
|
-
const lastImp1pxAtRef = (0,
|
|
3825
|
-
const loadingRef = (0,
|
|
3826
|
-
const loadRef = (0,
|
|
3827
|
-
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)({
|
|
3828
3781
|
onAdRendered,
|
|
3829
3782
|
onAdViewable,
|
|
3830
3783
|
onAdClicked,
|
|
@@ -3832,8 +3785,8 @@ function InlineAd(props) {
|
|
|
3832
3785
|
onAdFailedToRender,
|
|
3833
3786
|
onNoFill
|
|
3834
3787
|
});
|
|
3835
|
-
const isMountedRef = (0,
|
|
3836
|
-
const colorScheme = (0,
|
|
3788
|
+
const isMountedRef = (0, import_react30.useRef)(false);
|
|
3789
|
+
const colorScheme = (0, import_react_native42.useColorScheme)();
|
|
3837
3790
|
const selectedTheme = theme ?? DEFAULT_INLINE_AD_THEME;
|
|
3838
3791
|
const resolvedTheme = selectedTheme === "auto" ? colorScheme === "dark" ? "dark" : "light" : selectedTheme;
|
|
3839
3792
|
const resolvedTone = tone ?? DEFAULT_INLINE_AD_TONE;
|
|
@@ -3849,7 +3802,7 @@ function InlineAd(props) {
|
|
|
3849
3802
|
onAdFailedToRender,
|
|
3850
3803
|
onNoFill
|
|
3851
3804
|
};
|
|
3852
|
-
(0,
|
|
3805
|
+
(0, import_react30.useEffect)(() => {
|
|
3853
3806
|
isMountedRef.current = true;
|
|
3854
3807
|
return () => {
|
|
3855
3808
|
isMountedRef.current = false;
|
|
@@ -3859,36 +3812,36 @@ function InlineAd(props) {
|
|
|
3859
3812
|
}
|
|
3860
3813
|
};
|
|
3861
3814
|
}, []);
|
|
3862
|
-
(0,
|
|
3815
|
+
(0, import_react30.useEffect)(() => {
|
|
3816
|
+
const normalizedAdGroupId = normalizeAdGroupId(adGroupId);
|
|
3863
3817
|
const loadAdRequest = () => {
|
|
3864
3818
|
if (loadingRef.current) {
|
|
3865
3819
|
return;
|
|
3866
3820
|
}
|
|
3867
|
-
if (
|
|
3868
|
-
const error = createError2(
|
|
3869
|
-
|
|
3870
|
-
|
|
3821
|
+
if (normalizedAdGroupId.length === 0) {
|
|
3822
|
+
const error = createError2(ERROR_CODES.INVALID_SPACE, INVALID_AD_GROUP_ID_ERROR_MESSAGE);
|
|
3823
|
+
callbacksRef.current.onAdFailedToRender?.(
|
|
3824
|
+
buildBannerErrorPayload(slotIdRef.current, normalizedAdGroupId, error)
|
|
3871
3825
|
);
|
|
3872
|
-
callbacksRef.current.onAdFailedToRender?.(buildBannerErrorPayload(slotIdRef.current, adGroupId, error));
|
|
3873
3826
|
return;
|
|
3874
3827
|
}
|
|
3875
3828
|
loadingRef.current = true;
|
|
3876
|
-
loadAd(
|
|
3829
|
+
loadAd(normalizedAdGroupId).then((result) => {
|
|
3877
3830
|
if (!isMountedRef.current) return;
|
|
3878
3831
|
if (result.type === "noFill") {
|
|
3879
|
-
callbacksRef.current.onNoFill?.(buildNoFillPayload(slotIdRef.current,
|
|
3832
|
+
callbacksRef.current.onNoFill?.(buildNoFillPayload(slotIdRef.current, normalizedAdGroupId));
|
|
3880
3833
|
return;
|
|
3881
3834
|
}
|
|
3882
3835
|
if (result.type === "error") {
|
|
3883
3836
|
callbacksRef.current.onAdFailedToRender?.(
|
|
3884
|
-
buildBannerErrorPayload(slotIdRef.current,
|
|
3837
|
+
buildBannerErrorPayload(slotIdRef.current, normalizedAdGroupId, result.error)
|
|
3885
3838
|
);
|
|
3886
3839
|
return;
|
|
3887
3840
|
}
|
|
3888
3841
|
if (!isValidCreative(result.ad)) {
|
|
3889
3842
|
const invalidError = createError2(ERROR_CODES.INTERNAL_ERROR, "Invalid creative payload");
|
|
3890
3843
|
callbacksRef.current.onAdFailedToRender?.(
|
|
3891
|
-
buildBannerErrorPayload(slotIdRef.current,
|
|
3844
|
+
buildBannerErrorPayload(slotIdRef.current, normalizedAdGroupId, invalidError)
|
|
3892
3845
|
);
|
|
3893
3846
|
return;
|
|
3894
3847
|
}
|
|
@@ -3904,7 +3857,7 @@ function InlineAd(props) {
|
|
|
3904
3857
|
clearTimeout(viewableTimerRef.current);
|
|
3905
3858
|
viewableTimerRef.current = null;
|
|
3906
3859
|
}
|
|
3907
|
-
const payload = buildBannerEventPayload(slotIdRef.current,
|
|
3860
|
+
const payload = buildBannerEventPayload(slotIdRef.current, normalizedAdGroupId, result.ad);
|
|
3908
3861
|
eventPayloadRef.current = payload;
|
|
3909
3862
|
eventTrackerRef.current = new EventTracker(
|
|
3910
3863
|
result.ad.eventTrackingUrls ?? [],
|
|
@@ -3918,7 +3871,9 @@ function InlineAd(props) {
|
|
|
3918
3871
|
}).catch((error) => {
|
|
3919
3872
|
if (!isMountedRef.current) return;
|
|
3920
3873
|
const adError = error instanceof Error ? createError2(ERROR_CODES.INTERNAL_ERROR, error.message) : createError2(ERROR_CODES.INTERNAL_ERROR, "Unknown error");
|
|
3921
|
-
callbacksRef.current.onAdFailedToRender?.(
|
|
3874
|
+
callbacksRef.current.onAdFailedToRender?.(
|
|
3875
|
+
buildBannerErrorPayload(slotIdRef.current, normalizedAdGroupId, adError)
|
|
3876
|
+
);
|
|
3922
3877
|
}).finally(() => {
|
|
3923
3878
|
loadingRef.current = false;
|
|
3924
3879
|
});
|
|
@@ -3929,7 +3884,7 @@ function InlineAd(props) {
|
|
|
3929
3884
|
loadRef.current = null;
|
|
3930
3885
|
};
|
|
3931
3886
|
}, [adGroupId]);
|
|
3932
|
-
(0,
|
|
3887
|
+
(0, import_react_native41.useVisibilityChange)((documentVisibility) => {
|
|
3933
3888
|
if (documentVisibility !== "visible") {
|
|
3934
3889
|
return;
|
|
3935
3890
|
}
|
|
@@ -3942,7 +3897,7 @@ function InlineAd(props) {
|
|
|
3942
3897
|
loadRef.current?.();
|
|
3943
3898
|
}
|
|
3944
3899
|
});
|
|
3945
|
-
(0,
|
|
3900
|
+
(0, import_react30.useEffect)(() => {
|
|
3946
3901
|
if (!ad || hasRenderedRef.current) {
|
|
3947
3902
|
return;
|
|
3948
3903
|
}
|
|
@@ -4028,26 +3983,26 @@ function InlineAd(props) {
|
|
|
4028
3983
|
}
|
|
4029
3984
|
};
|
|
4030
3985
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4031
|
-
|
|
3986
|
+
import_react_native41.ImpressionArea,
|
|
4032
3987
|
{
|
|
4033
3988
|
style: styles3.impressionArea,
|
|
4034
3989
|
onImpressionStart: handleImpression1px,
|
|
4035
3990
|
areaThreshold: 0,
|
|
4036
3991
|
UNSAFE__impressFallbackOnMount: Boolean(impressFallbackOnMount),
|
|
4037
3992
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4038
|
-
|
|
3993
|
+
import_react_native41.ImpressionArea,
|
|
4039
3994
|
{
|
|
4040
3995
|
onImpressionStart: handleImpression100p,
|
|
4041
3996
|
areaThreshold: 1,
|
|
4042
3997
|
UNSAFE__impressFallbackOnMount: Boolean(impressFallbackOnMount),
|
|
4043
3998
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4044
|
-
|
|
3999
|
+
import_react_native41.ImpressionArea,
|
|
4045
4000
|
{
|
|
4046
4001
|
onImpressionStart: handleViewableStart,
|
|
4047
4002
|
onImpressionEnd: handleViewableEnd,
|
|
4048
4003
|
areaThreshold: 0.5,
|
|
4049
4004
|
UNSAFE__impressFallbackOnMount: Boolean(impressFallbackOnMount),
|
|
4050
|
-
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: [
|
|
4051
4006
|
isListBanner && listCreative ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4052
4007
|
ListBannerAdView,
|
|
4053
4008
|
{
|
|
@@ -4088,7 +4043,7 @@ function InlineAd(props) {
|
|
|
4088
4043
|
impressionKey
|
|
4089
4044
|
);
|
|
4090
4045
|
}
|
|
4091
|
-
var styles3 =
|
|
4046
|
+
var styles3 = import_react_native42.StyleSheet.create({
|
|
4092
4047
|
impressionArea: {
|
|
4093
4048
|
width: "100%"
|
|
4094
4049
|
},
|