@apps-in-toss/framework 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +882 -772
- package/dist/index.js +786 -659
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -34,13 +34,13 @@ __export(src_exports, {
|
|
|
34
34
|
Analytics: () => Analytics2,
|
|
35
35
|
AppsInToss: () => AppsInToss,
|
|
36
36
|
INTERNAL__onVisibilityChangedByTransparentServiceWeb: () => INTERNAL__onVisibilityChangedByTransparentServiceWeb,
|
|
37
|
-
OverlayProvider: () =>
|
|
37
|
+
OverlayProvider: () => import_private10.OverlayProvider,
|
|
38
38
|
WebView: () => WebView,
|
|
39
39
|
env: () => env,
|
|
40
40
|
useCreateUserAgent: () => useCreateUserAgent,
|
|
41
41
|
useGeolocation: () => useGeolocation,
|
|
42
|
-
useOverlay: () =>
|
|
43
|
-
useTopNavigation: () =>
|
|
42
|
+
useOverlay: () => import_private10.useOverlay,
|
|
43
|
+
useTopNavigation: () => import_private10.useTopNavigation,
|
|
44
44
|
useWaitForReturnNavigator: () => useWaitForReturnNavigator
|
|
45
45
|
});
|
|
46
46
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -48,10 +48,10 @@ var import_analytics2 = require("@apps-in-toss/analytics");
|
|
|
48
48
|
|
|
49
49
|
// src/core/registerApp.tsx
|
|
50
50
|
var import_analytics = require("@apps-in-toss/analytics");
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
51
|
+
var import_native_modules13 = require("@apps-in-toss/native-modules");
|
|
52
|
+
var import_react_native20 = require("@granite-js/react-native");
|
|
53
|
+
var import_tds_react_native10 = require("@toss/tds-react-native");
|
|
54
|
+
var import_react_native21 = require("react-native");
|
|
55
55
|
|
|
56
56
|
// src/core/components/AppEvent.tsx
|
|
57
57
|
var import_native_modules2 = require("@apps-in-toss/native-modules");
|
|
@@ -217,14 +217,12 @@ function useAppsInTossBridge() {
|
|
|
217
217
|
const controller = (0, import_tds_react_native.useBridge)();
|
|
218
218
|
const appsInTossGlobals = getAppsInTossGlobals();
|
|
219
219
|
(0, import_react5.useEffect)(() => {
|
|
220
|
-
const
|
|
220
|
+
const isGameApp = appsInTossGlobals.webViewType === "game" || appsInTossGlobals.appType === "game";
|
|
221
|
+
controller.open({
|
|
221
222
|
serviceName: appsInTossGlobals.brandDisplayName,
|
|
222
223
|
icon: toIcon(appsInTossGlobals.brandIcon),
|
|
223
224
|
color: appsInTossGlobals.brandPrimaryColor,
|
|
224
|
-
colorMode: appsInTossGlobals.brandBridgeColorMode
|
|
225
|
-
};
|
|
226
|
-
controller.open({
|
|
227
|
-
...commonProps,
|
|
225
|
+
colorMode: isGameApp ? "inverted" : appsInTossGlobals.brandBridgeColorMode,
|
|
228
226
|
onExited: () => {
|
|
229
227
|
import_native_modules3.appsInTossEvent.emit("entryMessageExited", void 0);
|
|
230
228
|
}
|
|
@@ -232,135 +230,513 @@ function useAppsInTossBridge() {
|
|
|
232
230
|
}, []);
|
|
233
231
|
}
|
|
234
232
|
|
|
235
|
-
// src/components/
|
|
236
|
-
var
|
|
237
|
-
var
|
|
238
|
-
var
|
|
239
|
-
var import_es_hangul = require("es-hangul");
|
|
240
|
-
var import_react9 = require("react");
|
|
241
|
-
var import_react_native14 = require("react-native");
|
|
233
|
+
// src/components/RNAppContainer.tsx
|
|
234
|
+
var import_native_modules12 = require("@apps-in-toss/native-modules");
|
|
235
|
+
var import_react14 = require("react");
|
|
236
|
+
var import_react_native19 = require("react-native");
|
|
242
237
|
|
|
243
|
-
// src/components/
|
|
238
|
+
// src/components/GameProfile.tsx
|
|
239
|
+
var import_native_modules6 = require("@apps-in-toss/native-modules");
|
|
240
|
+
var import_tds_react_native4 = require("@toss/tds-react-native");
|
|
241
|
+
var import_react7 = require("react");
|
|
242
|
+
var import_react_native9 = require("react-native");
|
|
243
|
+
|
|
244
|
+
// src/constant/game-center.ts
|
|
245
|
+
var GAME_PROFILE_WEBVIEW_URL = "servicetoss://game-center/profile";
|
|
246
|
+
var GAME_CENTER_MIN_VERSION = {
|
|
247
|
+
android: "5.221.0",
|
|
248
|
+
ios: "5.221.0"
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
// src/hooks/useGameCenterProfile.ts
|
|
252
|
+
var import_native_modules5 = require("@apps-in-toss/native-modules");
|
|
253
|
+
var import_react_native8 = require("@granite-js/react-native");
|
|
254
|
+
var import_tds_react_native3 = require("@toss/tds-react-native");
|
|
255
|
+
var import_es_hangul = require("es-hangul");
|
|
244
256
|
var import_react6 = require("react");
|
|
245
257
|
|
|
246
|
-
// src/components/
|
|
247
|
-
var
|
|
248
|
-
var
|
|
249
|
-
var
|
|
250
|
-
var
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
const logHomeButtonClick = () => {
|
|
278
|
-
import_native_modules4.INTERNAL__module.tossCoreEventLog({
|
|
279
|
-
log_name: HOME_BUTTON_CLICK_LOG_NAME,
|
|
280
|
-
log_type: "event",
|
|
281
|
-
params: {
|
|
282
|
-
...baseParams,
|
|
283
|
-
event_type: "click",
|
|
284
|
-
schema_id: HOME_BUTTON_CLICK_SCHEMA_ID
|
|
285
|
-
}
|
|
258
|
+
// src/components/GameProfileToast.tsx
|
|
259
|
+
var import_tds_react_native2 = require("@toss/tds-react-native");
|
|
260
|
+
var import_private = require("@toss/tds-react-native/private");
|
|
261
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
262
|
+
var useGameProfileToast = () => {
|
|
263
|
+
const overlay = (0, import_private.useOverlay)();
|
|
264
|
+
const openGameProfileToast = (nickname, profileImageUri) => {
|
|
265
|
+
return new Promise((resolve) => {
|
|
266
|
+
overlay.open(({ isOpen, close, exit }) => {
|
|
267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_private.ColorPreferenceProvider, { colorPreference: "dark", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_private.AdaptiveColorProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
268
|
+
import_tds_react_native2.Toast,
|
|
269
|
+
{
|
|
270
|
+
open: isOpen,
|
|
271
|
+
onClose: () => {
|
|
272
|
+
resolve();
|
|
273
|
+
close();
|
|
274
|
+
},
|
|
275
|
+
onExited: exit,
|
|
276
|
+
position: "top",
|
|
277
|
+
text: `${nickname}\uB2D8 \uBC18\uAC00\uC6CC\uC694!`,
|
|
278
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
279
|
+
import_tds_react_native2.Asset.Image,
|
|
280
|
+
{
|
|
281
|
+
style: { borderRadius: 64, overflow: "hidden" },
|
|
282
|
+
frameShape: import_tds_react_native2.Asset.frameShape.CleanW32,
|
|
283
|
+
source: { uri: profileImageUri }
|
|
284
|
+
}
|
|
285
|
+
)
|
|
286
|
+
}
|
|
287
|
+
) }) });
|
|
288
|
+
});
|
|
286
289
|
});
|
|
287
290
|
};
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
291
|
+
return { openGameProfileToast };
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
// src/utils/error.ts
|
|
295
|
+
var DEFAULT_ERROR = {
|
|
296
|
+
title: "\uC7A0\uC2DC \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694",
|
|
297
|
+
description: "\uBB38\uC81C\uAC00 \uACC4\uC18D\uB418\uBA74 \uD1A0\uC2A4 \uACE0\uAC1D\uC13C\uD130(1599-4905)\uB85C \uBB38\uC758\uD574\uC8FC\uC138\uC694."
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
// src/utils/market.ts
|
|
301
|
+
var import_react_native6 = require("react-native");
|
|
302
|
+
var PLAYSTORE_LINK = "https://play.google.com/store/apps/details?id=viva.republica.toss";
|
|
303
|
+
var APPSTORE_LINK = "https://itunes.apple.com/app/id839333328";
|
|
304
|
+
var getMarketLink = () => {
|
|
305
|
+
return import_react_native6.Platform.OS === "android" ? PLAYSTORE_LINK : APPSTORE_LINK;
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
// src/utils/openTransparentWebView.ts
|
|
309
|
+
var import_react_native7 = require("@granite-js/react-native");
|
|
310
|
+
|
|
311
|
+
// src/private.ts
|
|
312
|
+
var import_native_modules4 = require("@apps-in-toss/native-modules");
|
|
313
|
+
var INTERNAL__onVisibilityChangedByTransparentServiceWeb = import_native_modules4.onVisibilityChangedByTransparentServiceWeb;
|
|
314
|
+
|
|
315
|
+
// src/utils/openTransparentWebView.ts
|
|
316
|
+
var openTransparentWebView = ({
|
|
317
|
+
webUrl,
|
|
318
|
+
cleanupWhenDismissed = true,
|
|
319
|
+
onEvent,
|
|
320
|
+
onError,
|
|
321
|
+
callbackId = "fn",
|
|
322
|
+
params
|
|
323
|
+
}) => {
|
|
324
|
+
const url = new URL("supertoss://transparent-service-web");
|
|
325
|
+
url.searchParams.set("url", webUrl);
|
|
326
|
+
url.searchParams.set("onVisibilityChangeCallback", callbackId);
|
|
327
|
+
Object.entries(params ?? {}).forEach(([key, value]) => {
|
|
328
|
+
url.searchParams.set(key, value);
|
|
329
|
+
});
|
|
330
|
+
const cleanup = INTERNAL__onVisibilityChangedByTransparentServiceWeb({
|
|
331
|
+
options: { callbackId },
|
|
332
|
+
onError: (error) => {
|
|
333
|
+
onError(error);
|
|
334
|
+
cleanup();
|
|
335
|
+
},
|
|
336
|
+
onEvent: (value) => {
|
|
337
|
+
onEvent(value);
|
|
338
|
+
if (cleanupWhenDismissed && value === true) {
|
|
339
|
+
cleanup();
|
|
296
340
|
}
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
(0, import_react_native7.openURL)(url.toString());
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
// src/hooks/useGameCenterProfile.ts
|
|
347
|
+
var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
348
|
+
const [profileData, setProfileData] = (0, import_react6.useState)(void 0);
|
|
349
|
+
const [isProfileDataLoading, setIsProfileDataLoading] = (0, import_react6.useState)(true);
|
|
350
|
+
const [isProfileDataRefetching, setIsProfileDataRefetching] = (0, import_react6.useState)(false);
|
|
351
|
+
const shouldShowLoadingOverlay = isProfileDataLoading && isReadyForProfileUI;
|
|
352
|
+
const shouldShowProfileNotFoundOverlay = profileData?.statusCode === "PROFILE_NOT_FOUND" && isReadyForProfileUI && !isProfileDataRefetching;
|
|
353
|
+
const canShowBottomSheetOrToast = !isProfileDataLoading && isReadyForProfileUI;
|
|
354
|
+
const [isWebviewLoading, setIsWebviewLoading] = (0, import_react6.useState)(false);
|
|
355
|
+
const isCompletedProfileFlow = (0, import_react6.useRef)(false);
|
|
356
|
+
const { openAlert, openConfirm } = (0, import_tds_react_native3.useDialog)();
|
|
357
|
+
const { openGameProfileToast } = useGameProfileToast();
|
|
358
|
+
const openErrorAlert = (0, import_react6.useCallback)(async () => {
|
|
359
|
+
await openAlert({
|
|
360
|
+
title: DEFAULT_ERROR.title,
|
|
361
|
+
description: DEFAULT_ERROR.description
|
|
297
362
|
});
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
363
|
+
(0, import_react_native8.closeView)();
|
|
364
|
+
}, [openAlert]);
|
|
365
|
+
const openProfileWebview = (0, import_react6.useCallback)(() => {
|
|
366
|
+
if (isWebviewLoading) {
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
setIsWebviewLoading(true);
|
|
370
|
+
openTransparentWebView({
|
|
371
|
+
webUrl: `${GAME_PROFILE_WEBVIEW_URL}?appName=${getAppName()}&referrer=appsintoss.${getAppName()}`,
|
|
372
|
+
onEvent: async (isClosedTransparentWebView) => {
|
|
373
|
+
if (isClosedTransparentWebView) {
|
|
374
|
+
try {
|
|
375
|
+
setIsWebviewLoading(false);
|
|
376
|
+
setIsProfileDataRefetching(true);
|
|
377
|
+
const data = await (0, import_native_modules5.getGameCenterGameProfile)();
|
|
378
|
+
setProfileData(data);
|
|
379
|
+
setIsProfileDataRefetching(false);
|
|
380
|
+
if (data?.statusCode === "SUCCESS") {
|
|
381
|
+
openGameProfileToast(data.nickname, data.profileImageUri);
|
|
382
|
+
}
|
|
383
|
+
} catch (_) {
|
|
384
|
+
setIsProfileDataRefetching(false);
|
|
385
|
+
openErrorAlert();
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
onError: () => {
|
|
390
|
+
openErrorAlert();
|
|
306
391
|
}
|
|
307
392
|
});
|
|
308
|
-
};
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
393
|
+
}, [isWebviewLoading, openGameProfileToast, openErrorAlert]);
|
|
394
|
+
const updateAppToSupportedMinVersion = (0, import_react6.useCallback)(async () => {
|
|
395
|
+
const upddateConfirmDialogLabel = {
|
|
396
|
+
title: `${(0, import_es_hangul.josa)(getAppsInTossGlobals().brandDisplayName, "\uC744/\uB97C")} \uD558\uB824\uBA74
|
|
397
|
+
\uC571\uC744 \uC5C5\uB370\uC774\uD2B8\uD574\uC8FC\uC138\uC694`,
|
|
398
|
+
leftButton: "\uB2EB\uAE30",
|
|
399
|
+
rightButton: "\uC5C5\uB370\uC774\uD2B8\uD558\uAE30"
|
|
400
|
+
};
|
|
401
|
+
const isConfirmed = await openConfirm({
|
|
402
|
+
title: upddateConfirmDialogLabel.title,
|
|
403
|
+
leftButton: upddateConfirmDialogLabel.leftButton,
|
|
404
|
+
rightButton: upddateConfirmDialogLabel.rightButton,
|
|
405
|
+
closeOnDimmerClick: true
|
|
319
406
|
});
|
|
320
|
-
|
|
407
|
+
if (!isConfirmed) {
|
|
408
|
+
(0, import_react_native8.closeView)();
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
const STORE_SCHEME = getMarketLink();
|
|
412
|
+
(0, import_react_native8.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
|
|
413
|
+
}, [openConfirm]);
|
|
321
414
|
return {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
415
|
+
profileData,
|
|
416
|
+
isProfileDataLoading,
|
|
417
|
+
isProfileDataRefetching,
|
|
418
|
+
shouldShowLoadingOverlay,
|
|
419
|
+
shouldShowProfileNotFoundOverlay,
|
|
420
|
+
canShowBottomSheetOrToast,
|
|
421
|
+
isCompletedProfileFlow,
|
|
422
|
+
updateAppToSupportedMinVersion,
|
|
423
|
+
setIsProfileDataLoading,
|
|
424
|
+
openProfileWebview,
|
|
425
|
+
setProfileData,
|
|
426
|
+
openErrorAlert,
|
|
427
|
+
openGameProfileToast
|
|
327
428
|
};
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
// src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
|
|
331
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
332
|
-
function NavigationBarImpressionArea({
|
|
333
|
-
children,
|
|
334
|
-
withHomeButton
|
|
335
|
-
}) {
|
|
336
|
-
const hasLogged = (0, import_react6.useRef)(false);
|
|
337
|
-
const logging = useNavigationBarLogging();
|
|
338
|
-
(0, import_react6.useEffect)(() => {
|
|
339
|
-
if (hasLogged.current === false) {
|
|
340
|
-
logging.navBarImpression({ home_icon_yn: withHomeButton ? "Y" : "N" });
|
|
341
|
-
hasLogged.current = true;
|
|
342
|
-
}
|
|
343
|
-
}, [logging, withHomeButton]);
|
|
344
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children });
|
|
345
|
-
}
|
|
429
|
+
};
|
|
346
430
|
|
|
347
|
-
// src/
|
|
348
|
-
var
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
431
|
+
// src/utils/zIndex.ts
|
|
432
|
+
var Z_INDEX = {
|
|
433
|
+
/* 게임 프로필을 위한 overlay
|
|
434
|
+
*/
|
|
435
|
+
PROFILE_OVERLAY: 9998,
|
|
436
|
+
// 게임을 종료할 수 있는 X 버튼
|
|
437
|
+
CLOSE_BUTTON: 9999
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
// src/components/GameProfile.tsx
|
|
441
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
442
|
+
var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
443
|
+
const {
|
|
444
|
+
profileData,
|
|
445
|
+
isProfileDataRefetching,
|
|
446
|
+
shouldShowLoadingOverlay,
|
|
447
|
+
shouldShowProfileNotFoundOverlay,
|
|
448
|
+
canShowBottomSheetOrToast,
|
|
449
|
+
isCompletedProfileFlow,
|
|
450
|
+
openProfileWebview,
|
|
451
|
+
updateAppToSupportedMinVersion,
|
|
452
|
+
setIsProfileDataLoading,
|
|
453
|
+
setProfileData,
|
|
454
|
+
openErrorAlert,
|
|
455
|
+
openGameProfileToast
|
|
456
|
+
} = useGameCenterProfile(isReadyForProfileUI);
|
|
457
|
+
(0, import_react7.useEffect)(() => {
|
|
458
|
+
try {
|
|
459
|
+
const getProfileData = async () => {
|
|
460
|
+
const data = await (0, import_native_modules6.getGameCenterGameProfile)();
|
|
461
|
+
setProfileData(data);
|
|
462
|
+
setIsProfileDataLoading(false);
|
|
463
|
+
};
|
|
464
|
+
getProfileData();
|
|
465
|
+
} catch (_) {
|
|
466
|
+
openErrorAlert();
|
|
467
|
+
setIsProfileDataLoading(false);
|
|
468
|
+
}
|
|
469
|
+
}, []);
|
|
470
|
+
(0, import_react7.useEffect)(() => {
|
|
471
|
+
const handleGameProfileFlow = async () => {
|
|
472
|
+
if (!canShowBottomSheetOrToast) {
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
if (isCompletedProfileFlow.current) {
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
isCompletedProfileFlow.current = true;
|
|
479
|
+
if (!(0, import_native_modules6.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
|
|
480
|
+
updateAppToSupportedMinVersion();
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
if (profileData?.statusCode === "SUCCESS") {
|
|
484
|
+
openGameProfileToast(profileData.nickname, profileData.profileImageUri);
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
if (profileData?.statusCode === "PROFILE_NOT_FOUND") {
|
|
488
|
+
openProfileWebview();
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
handleGameProfileFlow();
|
|
492
|
+
}, [
|
|
493
|
+
canShowBottomSheetOrToast,
|
|
494
|
+
isCompletedProfileFlow,
|
|
495
|
+
openGameProfileToast,
|
|
496
|
+
openProfileWebview,
|
|
497
|
+
profileData,
|
|
498
|
+
updateAppToSupportedMinVersion
|
|
499
|
+
]);
|
|
500
|
+
if (!(0, import_native_modules6.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
|
|
501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
502
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native9.View, { style: { flex: 1, position: "relative" }, children }),
|
|
503
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
504
|
+
import_react_native9.Pressable,
|
|
505
|
+
{
|
|
506
|
+
style: {
|
|
507
|
+
...overlayStyle
|
|
508
|
+
},
|
|
509
|
+
onPress: () => {
|
|
510
|
+
updateAppToSupportedMinVersion();
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
)
|
|
514
|
+
] });
|
|
515
|
+
}
|
|
516
|
+
if (shouldShowLoadingOverlay || isProfileDataRefetching) {
|
|
517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
518
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native9.View, { style: { flex: 1, position: "relative" }, children }),
|
|
519
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
520
|
+
import_react_native9.View,
|
|
521
|
+
{
|
|
522
|
+
style: {
|
|
523
|
+
...overlayStyle,
|
|
524
|
+
justifyContent: "center",
|
|
525
|
+
alignItems: "center",
|
|
526
|
+
backgroundColor: "rgba(0, 0, 0, 0.2)"
|
|
527
|
+
},
|
|
528
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_tds_react_native4.Loader, { size: "large", type: "light" })
|
|
529
|
+
}
|
|
530
|
+
)
|
|
531
|
+
] });
|
|
532
|
+
}
|
|
533
|
+
if (shouldShowProfileNotFoundOverlay) {
|
|
534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
535
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native9.View, { style: { flex: 1, position: "relative" }, children }),
|
|
536
|
+
shouldShowProfileNotFoundOverlay && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
537
|
+
import_react_native9.Pressable,
|
|
538
|
+
{
|
|
539
|
+
style: {
|
|
540
|
+
...overlayStyle
|
|
541
|
+
},
|
|
542
|
+
onPress: () => {
|
|
543
|
+
openProfileWebview();
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
)
|
|
547
|
+
] });
|
|
548
|
+
}
|
|
549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native9.View, { style: { flex: 1, position: "relative" }, children }) });
|
|
550
|
+
};
|
|
551
|
+
var overlayStyle = {
|
|
552
|
+
position: "absolute",
|
|
553
|
+
top: 0,
|
|
554
|
+
left: 0,
|
|
555
|
+
right: 0,
|
|
556
|
+
bottom: 0,
|
|
557
|
+
zIndex: Z_INDEX.PROFILE_OVERLAY
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
// src/components/NavigationBar/RNNavigationBar/Default.tsx
|
|
561
|
+
var import_private5 = require("@toss/tds-react-native/private");
|
|
562
|
+
|
|
563
|
+
// src/components/NavigationBar/RNNavigationBar/hooks/useHardwareBackPress.ts
|
|
352
564
|
var import_react8 = require("react");
|
|
565
|
+
var import_react_native10 = require("react-native");
|
|
566
|
+
function useHardwareBackPress(handler) {
|
|
567
|
+
(0, import_react8.useEffect)(() => {
|
|
568
|
+
const handleBackPress = () => {
|
|
569
|
+
handler();
|
|
570
|
+
return true;
|
|
571
|
+
};
|
|
572
|
+
import_react_native10.BackHandler.addEventListener("hardwareBackPress", handleBackPress);
|
|
573
|
+
return () => import_react_native10.BackHandler.removeEventListener("hardwareBackPress", handleBackPress);
|
|
574
|
+
}, [handler]);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
// src/components/NavigationBar/RNNavigationBar/hooks/useNavigationEvent.ts
|
|
578
|
+
var import_react_native12 = require("@granite-js/react-native");
|
|
579
|
+
var import_react10 = require("react");
|
|
580
|
+
|
|
581
|
+
// src/components/NavigationBar/RNNavigationBar/hooks/useCloseConfirm.ts
|
|
582
|
+
var import_tds_react_native5 = require("@toss/tds-react-native");
|
|
583
|
+
var import_es_hangul2 = require("es-hangul");
|
|
584
|
+
var import_react9 = require("react");
|
|
585
|
+
function useCloseConfirm() {
|
|
586
|
+
const { brandDisplayName } = getAppsInTossGlobals();
|
|
587
|
+
const { openConfirm } = (0, import_tds_react_native5.useDialog)();
|
|
588
|
+
return (0, import_react9.useCallback)(async ({ onEntered }) => {
|
|
589
|
+
return await openConfirm({
|
|
590
|
+
title: `${(0, import_es_hangul2.josa)(brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
591
|
+
leftButton: "\uCDE8\uC18C",
|
|
592
|
+
rightButton: "\uC885\uB8CC\uD558\uAE30",
|
|
593
|
+
closeOnDimmerClick: true,
|
|
594
|
+
onEntered
|
|
595
|
+
});
|
|
596
|
+
}, [brandDisplayName, openConfirm]);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
// src/components/NavigationBar/common/useNavigationBarLogging.tsx
|
|
600
|
+
var import_native_modules7 = require("@apps-in-toss/native-modules");
|
|
601
|
+
var import_react_native11 = require("@granite-js/react-native");
|
|
602
|
+
var NAVI_BAR_IMPRESSION_SCHEMA_ID = 1596837;
|
|
603
|
+
var NAVI_BAR_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__navigation_bar";
|
|
604
|
+
var CLOSE_POPUP_SHOW_SCHEMA_ID = 1644490;
|
|
605
|
+
var CLOSE_POPUP_SHOW_LOG_NAME = "appsintoss_app_visit__common_module::popup__close_app";
|
|
606
|
+
var CLOSE_BUTTON_CLICK_SCHEMA_ID = 1596831;
|
|
607
|
+
var CLOSE_BUTTON_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::click__icon_close";
|
|
608
|
+
var CLOSE_POPUP_CTA_CLICK_SCHEMA_ID = 1644492;
|
|
609
|
+
var CLOSE_POPUP_CTA_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::popup__close_app::click__cta";
|
|
610
|
+
var HOME_BUTTON_CLICK_SCHEMA_ID = 1596839;
|
|
611
|
+
var HOME_BUTTON_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::click__icon_home";
|
|
612
|
+
function useNavigationBarLogging() {
|
|
613
|
+
const referrer = useReferrer();
|
|
614
|
+
const baseParams = {
|
|
615
|
+
referrer,
|
|
616
|
+
app_name: import_react_native11.Granite.appName
|
|
617
|
+
};
|
|
618
|
+
const logNavBarImpression = (naviBarConfig) => {
|
|
619
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
620
|
+
log_name: NAVI_BAR_IMPRESSION_LOG_NAME,
|
|
621
|
+
log_type: "event",
|
|
622
|
+
params: {
|
|
623
|
+
...naviBarConfig,
|
|
624
|
+
...baseParams,
|
|
625
|
+
event_type: "impression",
|
|
626
|
+
schema_id: NAVI_BAR_IMPRESSION_SCHEMA_ID
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
};
|
|
630
|
+
const logHomeButtonClick = () => {
|
|
631
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
632
|
+
log_name: HOME_BUTTON_CLICK_LOG_NAME,
|
|
633
|
+
log_type: "event",
|
|
634
|
+
params: {
|
|
635
|
+
...baseParams,
|
|
636
|
+
event_type: "click",
|
|
637
|
+
schema_id: HOME_BUTTON_CLICK_SCHEMA_ID
|
|
638
|
+
}
|
|
639
|
+
});
|
|
640
|
+
};
|
|
641
|
+
const logCloseButtonClick = () => {
|
|
642
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
643
|
+
log_name: CLOSE_BUTTON_CLICK_LOG_NAME,
|
|
644
|
+
log_type: "event",
|
|
645
|
+
params: {
|
|
646
|
+
...baseParams,
|
|
647
|
+
event_type: "click",
|
|
648
|
+
schema_id: CLOSE_BUTTON_CLICK_SCHEMA_ID
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
};
|
|
652
|
+
const logClosePopupShow = () => {
|
|
653
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
654
|
+
log_name: CLOSE_POPUP_SHOW_LOG_NAME,
|
|
655
|
+
log_type: "popup",
|
|
656
|
+
params: {
|
|
657
|
+
...baseParams,
|
|
658
|
+
schema_id: CLOSE_POPUP_SHOW_SCHEMA_ID
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
};
|
|
662
|
+
const logClosePopupCtaClick = (confirm) => {
|
|
663
|
+
import_native_modules7.INTERNAL__module.tossCoreEventLog({
|
|
664
|
+
log_name: CLOSE_POPUP_CTA_CLICK_LOG_NAME,
|
|
665
|
+
log_type: "event",
|
|
666
|
+
params: {
|
|
667
|
+
...baseParams,
|
|
668
|
+
close_yn: confirm ? "Y" : "N",
|
|
669
|
+
schema_id: CLOSE_POPUP_CTA_CLICK_SCHEMA_ID,
|
|
670
|
+
event_type: "click"
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
};
|
|
674
|
+
return {
|
|
675
|
+
navBarImpression: logNavBarImpression,
|
|
676
|
+
closePopupShow: logClosePopupShow,
|
|
677
|
+
closePopupCtaClick: logClosePopupCtaClick,
|
|
678
|
+
closeButtonClick: logCloseButtonClick,
|
|
679
|
+
homeButtonClick: logHomeButtonClick
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
// src/components/NavigationBar/RNNavigationBar/hooks/useNavigationEvent.ts
|
|
684
|
+
function useNavigationEvent() {
|
|
685
|
+
const backEventContext = (0, import_react_native12.useBackEventContext)();
|
|
686
|
+
const logging = useNavigationBarLogging();
|
|
687
|
+
const navigation = (0, import_react_native12.useNavigation)();
|
|
688
|
+
const closeConfirm = useCloseConfirm();
|
|
689
|
+
const { captureExitLog } = useCaptureExitLog();
|
|
690
|
+
return (0, import_react10.useMemo)(() => {
|
|
691
|
+
const close = async () => {
|
|
692
|
+
const hasConfirmed = await closeConfirm({
|
|
693
|
+
onEntered: logging.closePopupShow
|
|
694
|
+
});
|
|
695
|
+
logging.closePopupCtaClick(hasConfirmed);
|
|
696
|
+
if (hasConfirmed) {
|
|
697
|
+
captureExitLog(Date.now());
|
|
698
|
+
(0, import_react_native12.closeView)();
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
return {
|
|
702
|
+
handleBack: () => {
|
|
703
|
+
if (backEventContext.hasBackEvent) {
|
|
704
|
+
backEventContext.onBack();
|
|
705
|
+
} else if (navigation.canGoBack()) {
|
|
706
|
+
navigation.goBack();
|
|
707
|
+
} else {
|
|
708
|
+
close();
|
|
709
|
+
}
|
|
710
|
+
},
|
|
711
|
+
handleHomeButtonClick: () => {
|
|
712
|
+
logging.homeButtonClick();
|
|
713
|
+
navigation.navigate("/");
|
|
714
|
+
},
|
|
715
|
+
handleCloseButtonClick: () => {
|
|
716
|
+
logging.closeButtonClick();
|
|
717
|
+
close();
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
}, [backEventContext, navigation, closeConfirm, logging, captureExitLog]);
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
724
|
+
var import_native_modules11 = require("@apps-in-toss/native-modules");
|
|
725
|
+
var import_react_native17 = require("@granite-js/react-native");
|
|
726
|
+
var import_tds_react_native8 = require("@toss/tds-react-native");
|
|
727
|
+
var import_private4 = require("@toss/tds-react-native/private");
|
|
728
|
+
var import_react12 = require("react");
|
|
353
729
|
|
|
354
730
|
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
355
|
-
var
|
|
356
|
-
var
|
|
357
|
-
var
|
|
358
|
-
var
|
|
359
|
-
var
|
|
731
|
+
var import_native_modules9 = require("@apps-in-toss/native-modules");
|
|
732
|
+
var import_react_native14 = require("@granite-js/react-native");
|
|
733
|
+
var import_tds_react_native6 = require("@toss/tds-react-native");
|
|
734
|
+
var import_private3 = require("@toss/tds-react-native/private");
|
|
735
|
+
var import_react_native15 = require("react-native");
|
|
360
736
|
|
|
361
737
|
// src/core/hooks/useMoreButtonBottomSheet/useMoreButtonBottomSheetLogging.tsx
|
|
362
|
-
var
|
|
363
|
-
var
|
|
738
|
+
var import_native_modules8 = require("@apps-in-toss/native-modules");
|
|
739
|
+
var import_react_native13 = require("@granite-js/react-native");
|
|
364
740
|
var BOTTOM_SHEET_SCHEMA_ID = 1596825;
|
|
365
741
|
var BOTTOM_SHEET_LOG_NAME = "appsintoss_app_visit__common_module::bottomsheet__more";
|
|
366
742
|
var BOTTOM_SHEET_OPEN_SCHEMA_ID = 1596829;
|
|
@@ -373,10 +749,10 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
373
749
|
const referrer = useReferrer();
|
|
374
750
|
const baseParams = {
|
|
375
751
|
referrer,
|
|
376
|
-
app_name:
|
|
752
|
+
app_name: import_react_native13.Granite.appName
|
|
377
753
|
};
|
|
378
754
|
const logBottomSheetShow = () => {
|
|
379
|
-
|
|
755
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
380
756
|
log_name: BOTTOM_SHEET_LOG_NAME,
|
|
381
757
|
log_type: "popup",
|
|
382
758
|
params: {
|
|
@@ -386,7 +762,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
386
762
|
});
|
|
387
763
|
};
|
|
388
764
|
const logBottomSheetOpen = () => {
|
|
389
|
-
|
|
765
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
390
766
|
log_name: BOTTOM_SHEET_OPEN_LOG_NAME,
|
|
391
767
|
log_type: "event",
|
|
392
768
|
params: {
|
|
@@ -397,7 +773,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
397
773
|
});
|
|
398
774
|
};
|
|
399
775
|
const logBottomSheetCloseClick = () => {
|
|
400
|
-
|
|
776
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
401
777
|
log_name: BOTTOM_SHEET_CLOSE_CLICK_LOG_NAME,
|
|
402
778
|
log_type: "event",
|
|
403
779
|
params: {
|
|
@@ -408,7 +784,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
408
784
|
});
|
|
409
785
|
};
|
|
410
786
|
const logBottomSheetMenuClick = ({ title }) => {
|
|
411
|
-
|
|
787
|
+
import_native_modules8.INTERNAL__module.tossCoreEventLog({
|
|
412
788
|
log_name: BOTTOM_SHEET_MENU_CLICK_LOG_NAME,
|
|
413
789
|
log_type: "event",
|
|
414
790
|
params: {
|
|
@@ -437,7 +813,7 @@ function addParamsToUrl(url, params) {
|
|
|
437
813
|
}
|
|
438
814
|
|
|
439
815
|
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
440
|
-
var
|
|
816
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
441
817
|
var SHARE_SCHEME_REFERRER = "appsintoss.common_module_share";
|
|
442
818
|
var APP_SHARE_MENU_INFO = {
|
|
443
819
|
contactItemName: "\uACF5\uC720\uD558\uAE30",
|
|
@@ -445,27 +821,27 @@ var APP_SHARE_MENU_INFO = {
|
|
|
445
821
|
};
|
|
446
822
|
function AppShareListMenu() {
|
|
447
823
|
const globals = getAppsInTossGlobals();
|
|
448
|
-
const adaptive = (0,
|
|
824
|
+
const adaptive = (0, import_private3.useAdaptive)();
|
|
449
825
|
const logging = useMoreButtonBottomSheetLogging();
|
|
450
|
-
const initialScheme = (0,
|
|
451
|
-
const isSandbox = (0,
|
|
452
|
-
const { openConfirm } = (0,
|
|
826
|
+
const initialScheme = (0, import_react_native14.getSchemeUri)();
|
|
827
|
+
const isSandbox = (0, import_native_modules9.getOperationalEnvironment)() === "sandbox";
|
|
828
|
+
const { openConfirm } = (0, import_tds_react_native6.useDialog)();
|
|
453
829
|
const schemeForShare = addParamsToUrl(initialScheme, {
|
|
454
830
|
referrer: SHARE_SCHEME_REFERRER
|
|
455
831
|
});
|
|
456
|
-
return /* @__PURE__ */ (0,
|
|
457
|
-
|
|
832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
833
|
+
import_tds_react_native6.ListRow,
|
|
458
834
|
{
|
|
459
|
-
left: /* @__PURE__ */ (0,
|
|
460
|
-
|
|
835
|
+
left: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
836
|
+
import_tds_react_native6.ListRow.Icon,
|
|
461
837
|
{
|
|
462
838
|
color: globals.brandPrimaryColor,
|
|
463
839
|
source: { uri: APP_SHARE_MENU_INFO.contactIconUrl },
|
|
464
840
|
type: "background"
|
|
465
841
|
}
|
|
466
842
|
),
|
|
467
|
-
contents: /* @__PURE__ */ (0,
|
|
468
|
-
|
|
843
|
+
contents: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
844
|
+
import_tds_react_native6.ListRow.Texts,
|
|
469
845
|
{
|
|
470
846
|
type: "1RowTypeA",
|
|
471
847
|
top: APP_SHARE_MENU_INFO.contactItemName,
|
|
@@ -484,7 +860,7 @@ function AppShareListMenu() {
|
|
|
484
860
|
return;
|
|
485
861
|
}
|
|
486
862
|
logging.menuClick({ title: APP_SHARE_MENU_INFO.contactItemName });
|
|
487
|
-
|
|
863
|
+
import_react_native15.NativeModules.AppsInTossModule.shareWithScheme({
|
|
488
864
|
params: {
|
|
489
865
|
schemeURL: schemeForShare
|
|
490
866
|
}
|
|
@@ -495,24 +871,14 @@ function AppShareListMenu() {
|
|
|
495
871
|
}
|
|
496
872
|
|
|
497
873
|
// src/hooks/useAppUpdateDialog.tsx
|
|
498
|
-
var
|
|
499
|
-
var
|
|
500
|
-
var
|
|
501
|
-
var
|
|
502
|
-
|
|
503
|
-
// src/utils/market.ts
|
|
504
|
-
var import_react_native10 = require("react-native");
|
|
505
|
-
var PLAYSTORE_LINK = "https://play.google.com/store/apps/details?id=viva.republica.toss";
|
|
506
|
-
var APPSTORE_LINK = "https://itunes.apple.com/app/id839333328";
|
|
507
|
-
var getMarketLink = () => {
|
|
508
|
-
return import_react_native10.Platform.OS === "android" ? PLAYSTORE_LINK : APPSTORE_LINK;
|
|
509
|
-
};
|
|
510
|
-
|
|
511
|
-
// src/hooks/useAppUpdateDialog.tsx
|
|
874
|
+
var import_native_modules10 = require("@apps-in-toss/native-modules");
|
|
875
|
+
var import_react_native16 = require("@granite-js/react-native");
|
|
876
|
+
var import_tds_react_native7 = require("@toss/tds-react-native");
|
|
877
|
+
var import_react11 = require("react");
|
|
512
878
|
function useAppUpdateDialog() {
|
|
513
|
-
const { openConfirm } = (0,
|
|
879
|
+
const { openConfirm } = (0, import_tds_react_native7.useDialog)();
|
|
514
880
|
const logging = useAppUpdateDialogLogging();
|
|
515
|
-
const openAppUpdateDialog = (0,
|
|
881
|
+
const openAppUpdateDialog = (0, import_react11.useCallback)(
|
|
516
882
|
async ({
|
|
517
883
|
title,
|
|
518
884
|
description,
|
|
@@ -533,7 +899,7 @@ function useAppUpdateDialog() {
|
|
|
533
899
|
}
|
|
534
900
|
logging.update();
|
|
535
901
|
const STORE_SCHEME = getMarketLink();
|
|
536
|
-
(0,
|
|
902
|
+
(0, import_react_native16.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
|
|
537
903
|
},
|
|
538
904
|
[logging, openConfirm]
|
|
539
905
|
);
|
|
@@ -549,10 +915,10 @@ function useAppUpdateDialogLogging() {
|
|
|
549
915
|
const referrer = useReferrer();
|
|
550
916
|
const baseParams = {
|
|
551
917
|
referrer,
|
|
552
|
-
app_name:
|
|
918
|
+
app_name: import_react_native16.Granite.appName
|
|
553
919
|
};
|
|
554
920
|
const logUpdateClick = () => {
|
|
555
|
-
|
|
921
|
+
import_native_modules10.INTERNAL__module.tossCoreEventLog({
|
|
556
922
|
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
557
923
|
log_type: "event",
|
|
558
924
|
params: {
|
|
@@ -564,7 +930,7 @@ function useAppUpdateDialogLogging() {
|
|
|
564
930
|
});
|
|
565
931
|
};
|
|
566
932
|
const logCloseClick = () => {
|
|
567
|
-
|
|
933
|
+
import_native_modules10.INTERNAL__module.tossCoreEventLog({
|
|
568
934
|
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
569
935
|
log_type: "event",
|
|
570
936
|
params: {
|
|
@@ -576,7 +942,7 @@ function useAppUpdateDialogLogging() {
|
|
|
576
942
|
});
|
|
577
943
|
};
|
|
578
944
|
const logDialogShow = () => {
|
|
579
|
-
|
|
945
|
+
import_native_modules10.INTERNAL__module.tossCoreEventLog({
|
|
580
946
|
log_name: UPDATE_DIALOG_LOG_NAME,
|
|
581
947
|
log_type: "popup",
|
|
582
948
|
params: {
|
|
@@ -597,7 +963,7 @@ function ensureValue(value, name) {
|
|
|
597
963
|
}
|
|
598
964
|
|
|
599
965
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
600
|
-
var
|
|
966
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
601
967
|
var APP_BRIDGE_METHOD_NAME = "getMiniAppsSupportContact";
|
|
602
968
|
var MIN_VERSION = {
|
|
603
969
|
BOTTOM_SHEET: {
|
|
@@ -611,19 +977,19 @@ var MIN_VERSION = {
|
|
|
611
977
|
};
|
|
612
978
|
function useMoreButtonBottomSheet() {
|
|
613
979
|
const globals = getAppsInTossGlobals();
|
|
614
|
-
const adaptive = (0,
|
|
615
|
-
const [itemList, setItemList] = (0,
|
|
980
|
+
const adaptive = (0, import_private4.useAdaptive)();
|
|
981
|
+
const [itemList, setItemList] = (0, import_react12.useState)([]);
|
|
616
982
|
const appUpdateDialog = useAppUpdateDialog();
|
|
617
983
|
const logging = useMoreButtonBottomSheetLogging();
|
|
618
|
-
const overlay = (0,
|
|
984
|
+
const overlay = (0, import_private4.useOverlay)();
|
|
619
985
|
const title = ensureValue(globals.brandDisplayName, "displayName");
|
|
620
|
-
const isBottomSheetSupported = (0,
|
|
621
|
-
const isShareListMenuSupported = (0,
|
|
622
|
-
(0,
|
|
986
|
+
const isBottomSheetSupported = (0, import_native_modules11.isMinVersionSupported)(MIN_VERSION.BOTTOM_SHEET);
|
|
987
|
+
const isShareListMenuSupported = (0, import_native_modules11.isMinVersionSupported)(MIN_VERSION.SHARE_LIST_MENU);
|
|
988
|
+
(0, import_react12.useEffect)(() => {
|
|
623
989
|
if (!isBottomSheetSupported) {
|
|
624
990
|
return;
|
|
625
991
|
}
|
|
626
|
-
|
|
992
|
+
import_native_modules11.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
627
993
|
APP_BRIDGE_METHOD_NAME,
|
|
628
994
|
{},
|
|
629
995
|
{
|
|
@@ -646,18 +1012,18 @@ function useMoreButtonBottomSheet() {
|
|
|
646
1012
|
logging.close();
|
|
647
1013
|
close();
|
|
648
1014
|
};
|
|
649
|
-
return /* @__PURE__ */ (0,
|
|
650
|
-
|
|
1015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(BottomSheetImpressionArea, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1016
|
+
import_tds_react_native8.BottomSheet.Root,
|
|
651
1017
|
{
|
|
652
|
-
header: /* @__PURE__ */ (0,
|
|
653
|
-
|
|
1018
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1019
|
+
import_tds_react_native8.ListHeader,
|
|
654
1020
|
{
|
|
655
|
-
title: /* @__PURE__ */ (0,
|
|
1021
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_tds_react_native8.ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
|
|
656
1022
|
}
|
|
657
1023
|
),
|
|
658
1024
|
open: isOpen,
|
|
659
|
-
cta: /* @__PURE__ */ (0,
|
|
660
|
-
|
|
1025
|
+
cta: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1026
|
+
import_tds_react_native8.BottomSheet.CTA,
|
|
661
1027
|
{
|
|
662
1028
|
size: "large",
|
|
663
1029
|
type: "dark",
|
|
@@ -670,21 +1036,21 @@ function useMoreButtonBottomSheet() {
|
|
|
670
1036
|
),
|
|
671
1037
|
onClose: handleClose,
|
|
672
1038
|
onExited: exit,
|
|
673
|
-
children: /* @__PURE__ */ (0,
|
|
1039
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_tds_react_native8.List, { rowSeparator: "none", children: [
|
|
674
1040
|
itemList.map((item) => {
|
|
675
|
-
return /* @__PURE__ */ (0,
|
|
676
|
-
|
|
1041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1042
|
+
import_tds_react_native8.ListRow,
|
|
677
1043
|
{
|
|
678
|
-
left: /* @__PURE__ */ (0,
|
|
679
|
-
|
|
1044
|
+
left: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1045
|
+
import_tds_react_native8.ListRow.Icon,
|
|
680
1046
|
{
|
|
681
1047
|
color: globals.brandPrimaryColor,
|
|
682
1048
|
source: { uri: item.contactIconUrl },
|
|
683
1049
|
type: "background"
|
|
684
1050
|
}
|
|
685
1051
|
),
|
|
686
|
-
contents: /* @__PURE__ */ (0,
|
|
687
|
-
|
|
1052
|
+
contents: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1053
|
+
import_tds_react_native8.ListRow.Texts,
|
|
688
1054
|
{
|
|
689
1055
|
type: "1RowTypeA",
|
|
690
1056
|
top: item.contactItemName,
|
|
@@ -694,13 +1060,13 @@ function useMoreButtonBottomSheet() {
|
|
|
694
1060
|
verticalPadding: "extraSmall",
|
|
695
1061
|
onPress: () => {
|
|
696
1062
|
logging.menuClick({ title: item.contactItemName });
|
|
697
|
-
(0,
|
|
1063
|
+
(0, import_react_native17.openURL)(item.contactUri);
|
|
698
1064
|
}
|
|
699
1065
|
},
|
|
700
1066
|
item.contactItemName
|
|
701
1067
|
);
|
|
702
1068
|
}),
|
|
703
|
-
isShareListMenuSupported && /* @__PURE__ */ (0,
|
|
1069
|
+
isShareListMenuSupported && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppShareListMenu, {})
|
|
704
1070
|
] })
|
|
705
1071
|
}
|
|
706
1072
|
) });
|
|
@@ -710,10 +1076,10 @@ function useMoreButtonBottomSheet() {
|
|
|
710
1076
|
}
|
|
711
1077
|
function BottomSheetImpressionArea({ children }) {
|
|
712
1078
|
const logging = useMoreButtonBottomSheetLogging();
|
|
713
|
-
(0,
|
|
1079
|
+
(0, import_react12.useEffect)(() => {
|
|
714
1080
|
logging.show();
|
|
715
1081
|
}, [logging]);
|
|
716
|
-
return /* @__PURE__ */ (0,
|
|
1082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children });
|
|
717
1083
|
}
|
|
718
1084
|
|
|
719
1085
|
// src/core/utils/safeParseNavigationBar.ts
|
|
@@ -728,506 +1094,250 @@ function safeParseNavigationBar(navigationBar) {
|
|
|
728
1094
|
}
|
|
729
1095
|
}
|
|
730
1096
|
|
|
731
|
-
// src/components/NavigationBar/
|
|
732
|
-
var
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
1097
|
+
// src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
|
|
1098
|
+
var import_react13 = require("react");
|
|
1099
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1100
|
+
function NavigationBarImpressionArea({
|
|
1101
|
+
children,
|
|
1102
|
+
withHomeButton
|
|
1103
|
+
}) {
|
|
1104
|
+
const hasLogged = (0, import_react13.useRef)(false);
|
|
736
1105
|
const logging = useNavigationBarLogging();
|
|
737
|
-
|
|
1106
|
+
(0, import_react13.useEffect)(() => {
|
|
1107
|
+
if (hasLogged.current === false) {
|
|
1108
|
+
logging.navBarImpression({ home_icon_yn: withHomeButton ? "Y" : "N" });
|
|
1109
|
+
hasLogged.current = true;
|
|
1110
|
+
}
|
|
1111
|
+
}, [logging, withHomeButton]);
|
|
1112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children });
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
// src/components/NavigationBar/RNNavigationBar/Default.tsx
|
|
1116
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1117
|
+
function DefaultNavigationBar() {
|
|
1118
|
+
const globals = getAppsInTossGlobals();
|
|
738
1119
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
739
1120
|
const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
|
|
740
1121
|
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
741
1122
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
742
1123
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
logging.homeButtonClick();
|
|
748
|
-
navigation.navigate("/");
|
|
749
|
-
}, [logging, navigation]);
|
|
750
|
-
const handleClose = (0, import_react9.useCallback)(async () => {
|
|
751
|
-
logging.closeButtonClick();
|
|
752
|
-
const isConfirmed = await openConfirm({
|
|
753
|
-
title: `${(0, import_es_hangul.josa)(globals.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
754
|
-
leftButton: "\uCDE8\uC18C",
|
|
755
|
-
rightButton: "\uC885\uB8CC\uD558\uAE30",
|
|
756
|
-
closeOnDimmerClick: true,
|
|
757
|
-
onEntered: logging.closePopupShow
|
|
758
|
-
});
|
|
759
|
-
logging.closePopupCtaClick(isConfirmed);
|
|
760
|
-
if (isConfirmed) {
|
|
761
|
-
captureExitLog(Date.now());
|
|
762
|
-
(0, import_react_native13.closeView)();
|
|
763
|
-
}
|
|
764
|
-
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
765
|
-
const handleBack = (0, import_react9.useCallback)(() => {
|
|
766
|
-
if (backEventContext.hasBackEvent) {
|
|
767
|
-
backEventContext.onBack();
|
|
768
|
-
return;
|
|
769
|
-
}
|
|
770
|
-
handleBackOrClose();
|
|
771
|
-
}, [backEventContext, handleBackOrClose]);
|
|
772
|
-
(0, import_react9.useEffect)(() => {
|
|
773
|
-
const handleAndroidBackEvent = () => {
|
|
774
|
-
handleBack();
|
|
775
|
-
return true;
|
|
776
|
-
};
|
|
777
|
-
import_react_native14.BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
778
|
-
return () => {
|
|
779
|
-
import_react_native14.BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
780
|
-
};
|
|
781
|
-
}, [handleBack]);
|
|
782
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
783
|
-
import_private3.TopNavigation,
|
|
1124
|
+
const navigationEvent = useNavigationEvent();
|
|
1125
|
+
useHardwareBackPress(navigationEvent.handleBack);
|
|
1126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1127
|
+
import_private5.TopNavigation,
|
|
784
1128
|
{
|
|
785
1129
|
title: globals.brandDisplayName,
|
|
786
1130
|
icon: toIcon(globals.brandIcon),
|
|
787
1131
|
onPressDots: openMoreButtonBottomSheet,
|
|
788
1132
|
contentVisible: true,
|
|
789
|
-
onPressTitle: withHomeButton ?
|
|
790
|
-
onPressClose:
|
|
1133
|
+
onPressTitle: withHomeButton ? navigationEvent.handleHomeButtonClick : void 0,
|
|
1134
|
+
onPressClose: navigationEvent.handleCloseButtonClick,
|
|
791
1135
|
withHome: withHomeButton,
|
|
792
|
-
fixedRightButton: initialAccessoryButton
|
|
793
|
-
|
|
794
|
-
icon: initialAccessoryButton.icon,
|
|
795
|
-
id: initialAccessoryButton.id
|
|
796
|
-
} : void 0,
|
|
797
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_private3.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_private3.NavigationBackButton, { onPress: handleBack, canGoBack: false }) })
|
|
1136
|
+
fixedRightButton: initialAccessoryButton,
|
|
1137
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_private5.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_private5.NavigationBackButton, { onPress: navigationEvent.handleBack, canGoBack: false }) })
|
|
798
1138
|
}
|
|
799
1139
|
) });
|
|
800
1140
|
}
|
|
801
|
-
function useBackOrCloseNavigation() {
|
|
802
|
-
const navigation = (0, import_react_native13.useNavigation)();
|
|
803
|
-
const { captureExitLog } = useCaptureExitLog();
|
|
804
|
-
return (0, import_react9.useCallback)(() => {
|
|
805
|
-
if (navigation.canGoBack()) {
|
|
806
|
-
navigation.goBack();
|
|
807
|
-
} else {
|
|
808
|
-
captureExitLog(Date.now());
|
|
809
|
-
(0, import_react_native13.closeView)();
|
|
810
|
-
}
|
|
811
|
-
}, [captureExitLog, navigation]);
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
// src/core/registerApp.tsx
|
|
815
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
816
|
-
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
817
|
-
if (!(0, import_native_modules9.isMinVersionSupported)({
|
|
818
|
-
android: "5.220.0",
|
|
819
|
-
ios: "5.221.0"
|
|
820
|
-
})) {
|
|
821
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
822
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.Entry, {}),
|
|
823
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.System, { ...initialProps }),
|
|
824
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppUpdate, {})
|
|
825
|
-
] });
|
|
826
|
-
}
|
|
827
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
828
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.StayTime, {}),
|
|
829
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.Entry, {}),
|
|
830
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AppEvent.System, { ...initialProps }),
|
|
831
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_tds_react_native6.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TDSContainer, { ...initialProps, children }) }) })
|
|
832
|
-
] });
|
|
833
|
-
}
|
|
834
|
-
function TDSContainer({ children }) {
|
|
835
|
-
useAppsInTossBridge();
|
|
836
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children });
|
|
837
|
-
}
|
|
838
|
-
function registerApp(container, { context, analytics }) {
|
|
839
|
-
const appName = getAppName();
|
|
840
|
-
const isRegistered = import_react_native16.AppRegistry.getAppKeys().includes(appName);
|
|
841
|
-
if (!isRegistered) {
|
|
842
|
-
import_analytics.Analytics.init({
|
|
843
|
-
logger: (params) => void (0, import_native_modules9.eventLog)(params),
|
|
844
|
-
debug: analytics?.debug ?? __DEV__
|
|
845
|
-
});
|
|
846
|
-
const App = import_react_native15.Granite.registerApp(AppsInTossContainer.bind(null, container), {
|
|
847
|
-
appName,
|
|
848
|
-
context,
|
|
849
|
-
setIosSwipeGestureEnabled: import_native_modules9.setIosSwipeGestureEnabled,
|
|
850
|
-
router: {
|
|
851
|
-
screenContainer: AppsInTossScreenContainer,
|
|
852
|
-
defaultScreenOption: {
|
|
853
|
-
statusBarStyle: "dark"
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
});
|
|
857
|
-
global.Page = App;
|
|
858
|
-
}
|
|
859
|
-
return global.Page;
|
|
860
|
-
}
|
|
861
|
-
function AppsInTossScreenContainer({ children }) {
|
|
862
|
-
const isReactNativeService = getAppsInTossGlobals().webViewType == null;
|
|
863
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_analytics.Analytics.Screen, { children: [
|
|
864
|
-
isReactNativeService && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RNNavigationBar, {}),
|
|
865
|
-
children
|
|
866
|
-
] });
|
|
867
|
-
}
|
|
868
|
-
function getAppName() {
|
|
869
|
-
try {
|
|
870
|
-
return global.__granite.app.name;
|
|
871
|
-
} catch (error) {
|
|
872
|
-
console.error("unexpected error occurred while getting app name");
|
|
873
|
-
throw error;
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
// src/core/index.ts
|
|
878
|
-
var AppsInToss = {
|
|
879
|
-
registerApp
|
|
880
|
-
};
|
|
881
1141
|
|
|
882
|
-
// src/components/
|
|
883
|
-
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
884
|
-
var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async-bridges"), 1);
|
|
885
|
-
var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
|
|
886
|
-
var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event-bridges"), 1);
|
|
887
|
-
var import_react_native29 = require("@granite-js/react-native");
|
|
888
|
-
var import_tds_react_native13 = require("@toss/tds-react-native");
|
|
889
|
-
var import_private8 = require("@toss/tds-react-native/private");
|
|
890
|
-
var import_react21 = require("react");
|
|
891
|
-
var import_react_native30 = require("react-native");
|
|
892
|
-
|
|
893
|
-
// src/components/GameWebView.tsx
|
|
894
|
-
var import_native_modules13 = require("@apps-in-toss/native-modules");
|
|
895
|
-
var import_react_native_webview = require("@granite-js/native/react-native-webview");
|
|
896
|
-
var import_react13 = require("react");
|
|
897
|
-
var import_react_native22 = require("react-native");
|
|
898
|
-
|
|
899
|
-
// src/components/GameProfile.tsx
|
|
900
|
-
var import_native_modules12 = require("@apps-in-toss/native-modules");
|
|
1142
|
+
// src/components/NavigationBar/RNNavigationBar/Game.tsx
|
|
901
1143
|
var import_tds_react_native9 = require("@toss/tds-react-native");
|
|
902
|
-
var
|
|
903
|
-
var
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
source: { uri: profileImageUri }
|
|
945
|
-
}
|
|
946
|
-
)
|
|
947
|
-
}
|
|
948
|
-
) }) });
|
|
949
|
-
});
|
|
950
|
-
});
|
|
951
|
-
};
|
|
952
|
-
return { openGameProfileToast };
|
|
953
|
-
};
|
|
954
|
-
|
|
955
|
-
// src/utils/error.ts
|
|
956
|
-
var DEFAULT_ERROR = {
|
|
957
|
-
title: "\uC7A0\uC2DC \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694",
|
|
958
|
-
description: "\uBB38\uC81C\uAC00 \uACC4\uC18D\uB418\uBA74 \uD1A0\uC2A4 \uACE0\uAC1D\uC13C\uD130(1599-4905)\uB85C \uBB38\uC758\uD574\uC8FC\uC138\uC694."
|
|
959
|
-
};
|
|
960
|
-
|
|
961
|
-
// src/utils/openTransparentWebView.ts
|
|
962
|
-
var import_react_native17 = require("@granite-js/react-native");
|
|
963
|
-
|
|
964
|
-
// src/private.ts
|
|
965
|
-
var import_native_modules10 = require("@apps-in-toss/native-modules");
|
|
966
|
-
var INTERNAL__onVisibilityChangedByTransparentServiceWeb = import_native_modules10.onVisibilityChangedByTransparentServiceWeb;
|
|
967
|
-
|
|
968
|
-
// src/utils/openTransparentWebView.ts
|
|
969
|
-
var openTransparentWebView = ({
|
|
970
|
-
webUrl,
|
|
971
|
-
cleanupWhenDismissed = true,
|
|
972
|
-
onEvent,
|
|
973
|
-
onError,
|
|
974
|
-
callbackId = "fn",
|
|
975
|
-
params
|
|
976
|
-
}) => {
|
|
977
|
-
const url = new URL("supertoss://transparent-service-web");
|
|
978
|
-
url.searchParams.set("url", webUrl);
|
|
979
|
-
url.searchParams.set("onVisibilityChangeCallback", callbackId);
|
|
980
|
-
Object.entries(params ?? {}).forEach(([key, value]) => {
|
|
981
|
-
url.searchParams.set(key, value);
|
|
982
|
-
});
|
|
983
|
-
const cleanup = INTERNAL__onVisibilityChangedByTransparentServiceWeb({
|
|
984
|
-
options: { callbackId },
|
|
985
|
-
onError: (error) => {
|
|
986
|
-
onError(error);
|
|
987
|
-
cleanup();
|
|
988
|
-
},
|
|
989
|
-
onEvent: (value) => {
|
|
990
|
-
onEvent(value);
|
|
991
|
-
if (cleanupWhenDismissed && value === true) {
|
|
992
|
-
cleanup();
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
});
|
|
996
|
-
(0, import_react_native17.openURL)(url.toString());
|
|
997
|
-
};
|
|
998
|
-
|
|
999
|
-
// src/hooks/useGameCenterProfile.ts
|
|
1000
|
-
var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
1001
|
-
const [profileData, setProfileData] = (0, import_react10.useState)(void 0);
|
|
1002
|
-
const [isProfileDataLoading, setIsProfileDataLoading] = (0, import_react10.useState)(true);
|
|
1003
|
-
const [isProfileDataRefetching, setIsProfileDataRefetching] = (0, import_react10.useState)(false);
|
|
1004
|
-
const shouldShowLoadingOverlay = isProfileDataLoading && isReadyForProfileUI;
|
|
1005
|
-
const shouldShowProfileNotFoundOverlay = profileData?.statusCode === "PROFILE_NOT_FOUND" && isReadyForProfileUI && !isProfileDataRefetching;
|
|
1006
|
-
const canShowBottomSheetOrToast = !isProfileDataLoading && isReadyForProfileUI;
|
|
1007
|
-
const [isWebviewLoading, setIsWebviewLoading] = (0, import_react10.useState)(false);
|
|
1008
|
-
const isCompletedProfileFlow = (0, import_react10.useRef)(false);
|
|
1009
|
-
const { openAlert, openConfirm } = (0, import_tds_react_native8.useDialog)();
|
|
1010
|
-
const { openGameProfileToast } = useGameProfileToast();
|
|
1011
|
-
const openErrorAlert = (0, import_react10.useCallback)(async () => {
|
|
1012
|
-
await openAlert({
|
|
1013
|
-
title: DEFAULT_ERROR.title,
|
|
1014
|
-
description: DEFAULT_ERROR.description
|
|
1015
|
-
});
|
|
1016
|
-
(0, import_react_native18.closeView)();
|
|
1017
|
-
}, [openAlert]);
|
|
1018
|
-
const openProfileWebview = (0, import_react10.useCallback)(() => {
|
|
1019
|
-
if (isWebviewLoading) {
|
|
1020
|
-
return;
|
|
1021
|
-
}
|
|
1022
|
-
setIsWebviewLoading(true);
|
|
1023
|
-
openTransparentWebView({
|
|
1024
|
-
webUrl: `${GAME_PROFILE_WEBVIEW_URL}?appName=${getAppName()}&referrer=appsintoss.${getAppName()}`,
|
|
1025
|
-
onEvent: async (isClosedTransparentWebView) => {
|
|
1026
|
-
if (isClosedTransparentWebView) {
|
|
1027
|
-
try {
|
|
1028
|
-
setIsWebviewLoading(false);
|
|
1029
|
-
setIsProfileDataRefetching(true);
|
|
1030
|
-
const data = await (0, import_native_modules11.getGameCenterGameProfile)();
|
|
1031
|
-
setProfileData(data);
|
|
1032
|
-
setIsProfileDataRefetching(false);
|
|
1033
|
-
if (data?.statusCode === "SUCCESS") {
|
|
1034
|
-
openGameProfileToast(data.nickname, data.profileImageUri);
|
|
1035
|
-
}
|
|
1036
|
-
} catch (_) {
|
|
1037
|
-
setIsProfileDataRefetching(false);
|
|
1038
|
-
openErrorAlert();
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
},
|
|
1042
|
-
onError: () => {
|
|
1043
|
-
openErrorAlert();
|
|
1044
|
-
}
|
|
1045
|
-
});
|
|
1046
|
-
}, [isWebviewLoading, openGameProfileToast, openErrorAlert]);
|
|
1047
|
-
const updateAppToSupportedMinVersion = (0, import_react10.useCallback)(async () => {
|
|
1048
|
-
const upddateConfirmDialogLabel = {
|
|
1049
|
-
title: `${(0, import_es_hangul2.josa)(getAppsInTossGlobals().brandDisplayName, "\uC744/\uB97C")} \uD558\uB824\uBA74
|
|
1050
|
-
\uC571\uC744 \uC5C5\uB370\uC774\uD2B8\uD574\uC8FC\uC138\uC694`,
|
|
1051
|
-
leftButton: "\uB2EB\uAE30",
|
|
1052
|
-
rightButton: "\uC5C5\uB370\uC774\uD2B8\uD558\uAE30"
|
|
1053
|
-
};
|
|
1054
|
-
const isConfirmed = await openConfirm({
|
|
1055
|
-
title: upddateConfirmDialogLabel.title,
|
|
1056
|
-
leftButton: upddateConfirmDialogLabel.leftButton,
|
|
1057
|
-
rightButton: upddateConfirmDialogLabel.rightButton,
|
|
1058
|
-
closeOnDimmerClick: true
|
|
1059
|
-
});
|
|
1060
|
-
if (!isConfirmed) {
|
|
1061
|
-
(0, import_react_native18.closeView)();
|
|
1062
|
-
return;
|
|
1063
|
-
}
|
|
1064
|
-
const STORE_SCHEME = getMarketLink();
|
|
1065
|
-
(0, import_react_native18.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
|
|
1066
|
-
}, [openConfirm]);
|
|
1067
|
-
return {
|
|
1068
|
-
profileData,
|
|
1069
|
-
isProfileDataLoading,
|
|
1070
|
-
isProfileDataRefetching,
|
|
1071
|
-
shouldShowLoadingOverlay,
|
|
1072
|
-
shouldShowProfileNotFoundOverlay,
|
|
1073
|
-
canShowBottomSheetOrToast,
|
|
1074
|
-
isCompletedProfileFlow,
|
|
1075
|
-
updateAppToSupportedMinVersion,
|
|
1076
|
-
setIsProfileDataLoading,
|
|
1077
|
-
openProfileWebview,
|
|
1078
|
-
setProfileData,
|
|
1079
|
-
openErrorAlert,
|
|
1080
|
-
openGameProfileToast
|
|
1081
|
-
};
|
|
1082
|
-
};
|
|
1144
|
+
var import_private6 = require("@toss/tds-react-native/private");
|
|
1145
|
+
var import_react_native18 = require("react-native");
|
|
1146
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1147
|
+
function GameNavigationBar() {
|
|
1148
|
+
const safeAreaTop = (0, import_private6.useSafeAreaTop)();
|
|
1149
|
+
const global2 = getAppsInTossGlobals();
|
|
1150
|
+
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1151
|
+
const navigationEvent = useNavigationEvent();
|
|
1152
|
+
useHardwareBackPress(navigationEvent.handleBack);
|
|
1153
|
+
const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
|
|
1154
|
+
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
1155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1156
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tds_react_native9.PageNavbar, { preference: { type: "none" } }),
|
|
1157
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1158
|
+
import_react_native18.View,
|
|
1159
|
+
{
|
|
1160
|
+
style: {
|
|
1161
|
+
width: "100%",
|
|
1162
|
+
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1163
|
+
height: import_react_native18.Platform.OS === "ios" ? 44 : 54,
|
|
1164
|
+
flexDirection: "row",
|
|
1165
|
+
alignItems: "center",
|
|
1166
|
+
justifyContent: "flex-end",
|
|
1167
|
+
position: "absolute",
|
|
1168
|
+
zIndex: Z_INDEX.CLOSE_BUTTON,
|
|
1169
|
+
marginTop: safeAreaTop,
|
|
1170
|
+
paddingRight: 10
|
|
1171
|
+
},
|
|
1172
|
+
pointerEvents: "box-none",
|
|
1173
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1174
|
+
import_private6.NavigationRightContent,
|
|
1175
|
+
{
|
|
1176
|
+
fixedRightButton: initialAccessoryButton,
|
|
1177
|
+
onPressDots: openMoreButtonBottomSheet,
|
|
1178
|
+
onPressClose: navigationEvent.handleCloseButtonClick,
|
|
1179
|
+
theme: "dark"
|
|
1180
|
+
}
|
|
1181
|
+
)
|
|
1182
|
+
}
|
|
1183
|
+
)
|
|
1184
|
+
] });
|
|
1185
|
+
}
|
|
1083
1186
|
|
|
1084
|
-
// src/
|
|
1085
|
-
var
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
PROFILE_OVERLAY: 9998,
|
|
1089
|
-
// 게임을 종료할 수 있는 X 버튼
|
|
1090
|
-
CLOSE_BUTTON: 9999
|
|
1187
|
+
// src/components/NavigationBar/RNNavigationBar/index.tsx
|
|
1188
|
+
var RNNavigationBar = {
|
|
1189
|
+
Default: DefaultNavigationBar,
|
|
1190
|
+
Game: GameNavigationBar
|
|
1091
1191
|
};
|
|
1092
1192
|
|
|
1093
|
-
// src/
|
|
1094
|
-
var
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1193
|
+
// src/bridge-entry.ts
|
|
1194
|
+
var bridge_entry_exports = {};
|
|
1195
|
+
__reExport(bridge_entry_exports, require("@apps-in-toss/native-modules/async-bridges"));
|
|
1196
|
+
__reExport(bridge_entry_exports, require("@apps-in-toss/native-modules/constant-bridges"));
|
|
1197
|
+
__reExport(bridge_entry_exports, require("@apps-in-toss/native-modules/event-bridges"));
|
|
1198
|
+
|
|
1199
|
+
// src/components/RNAppContainer.tsx
|
|
1200
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1201
|
+
function RNAppContainer({ children }) {
|
|
1202
|
+
const global2 = getAppsInTossGlobals();
|
|
1203
|
+
switch (global2.appType) {
|
|
1204
|
+
case "game":
|
|
1205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GameAppContainer, { children });
|
|
1206
|
+
case "general":
|
|
1207
|
+
default:
|
|
1208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GeneralAppContainer, { children });
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
function GameAppContainer({ children }) {
|
|
1212
|
+
const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react14.useState)(false);
|
|
1213
|
+
(0, import_react14.useEffect)(() => {
|
|
1214
|
+
if (import_react_native19.Platform.OS === "ios") {
|
|
1215
|
+
(0, import_native_modules12.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1216
|
+
return () => {
|
|
1217
|
+
(0, import_native_modules12.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1116
1218
|
};
|
|
1117
|
-
getProfileData();
|
|
1118
|
-
} catch (_) {
|
|
1119
|
-
openErrorAlert();
|
|
1120
|
-
setIsProfileDataLoading(false);
|
|
1121
1219
|
}
|
|
1220
|
+
return;
|
|
1122
1221
|
}, []);
|
|
1123
|
-
(0,
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
}
|
|
1128
|
-
if (isCompletedProfileFlow.current) {
|
|
1129
|
-
return;
|
|
1130
|
-
}
|
|
1131
|
-
isCompletedProfileFlow.current = true;
|
|
1132
|
-
if (!(0, import_native_modules12.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
|
|
1133
|
-
updateAppToSupportedMinVersion();
|
|
1134
|
-
return;
|
|
1135
|
-
}
|
|
1136
|
-
if (profileData?.statusCode === "SUCCESS") {
|
|
1137
|
-
openGameProfileToast(profileData.nickname, profileData.profileImageUri);
|
|
1138
|
-
return;
|
|
1139
|
-
}
|
|
1140
|
-
if (profileData?.statusCode === "PROFILE_NOT_FOUND") {
|
|
1141
|
-
openProfileWebview();
|
|
1222
|
+
(0, import_react14.useEffect)(() => {
|
|
1223
|
+
import_native_modules12.appsInTossEvent.addEventListener("entryMessageExited", {
|
|
1224
|
+
onEvent: () => {
|
|
1225
|
+
setIsEntryMessageExited(true);
|
|
1142
1226
|
}
|
|
1143
|
-
};
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
)
|
|
1227
|
+
});
|
|
1228
|
+
}, []);
|
|
1229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1230
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RNNavigationBar.Game, {}),
|
|
1231
|
+
(0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GameProfile, { isReadyForProfileUI: isEntryMessageExited, children }) : children
|
|
1232
|
+
] });
|
|
1233
|
+
}
|
|
1234
|
+
function GeneralAppContainer({ children }) {
|
|
1235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1236
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(RNNavigationBar.Default, {}),
|
|
1237
|
+
children
|
|
1238
|
+
] });
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
// src/core/registerApp.tsx
|
|
1242
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1243
|
+
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
1244
|
+
if (!(0, import_native_modules13.isMinVersionSupported)({
|
|
1245
|
+
android: "5.220.0",
|
|
1246
|
+
ios: "5.221.0"
|
|
1247
|
+
})) {
|
|
1248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
1249
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AppEvent.Entry, {}),
|
|
1250
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AppEvent.System, { ...initialProps }),
|
|
1251
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AppUpdate, {})
|
|
1167
1252
|
] });
|
|
1168
1253
|
}
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
1255
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AppEvent.StayTime, {}),
|
|
1256
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AppEvent.Entry, {}),
|
|
1257
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AppEvent.System, { ...initialProps }),
|
|
1258
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tds_react_native10.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TDSContainer, { ...initialProps, children }) }) })
|
|
1259
|
+
] });
|
|
1260
|
+
}
|
|
1261
|
+
function TDSContainer({ children }) {
|
|
1262
|
+
useAppsInTossBridge();
|
|
1263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children });
|
|
1264
|
+
}
|
|
1265
|
+
function registerApp(container, { context, analytics }) {
|
|
1266
|
+
const appName = getAppName();
|
|
1267
|
+
const isRegistered = import_react_native21.AppRegistry.getAppKeys().includes(appName);
|
|
1268
|
+
if (!isRegistered) {
|
|
1269
|
+
import_analytics.Analytics.init({
|
|
1270
|
+
logger: (params) => void (0, import_native_modules13.eventLog)(params),
|
|
1271
|
+
debug: analytics?.debug ?? __DEV__
|
|
1272
|
+
});
|
|
1273
|
+
const App = import_react_native20.Granite.registerApp(AppsInTossContainer.bind(null, container), {
|
|
1274
|
+
appName,
|
|
1275
|
+
context,
|
|
1276
|
+
setIosSwipeGestureEnabled: import_native_modules13.setIosSwipeGestureEnabled,
|
|
1277
|
+
router: {
|
|
1278
|
+
screenContainer: AppsInTossScreenContainer,
|
|
1279
|
+
defaultScreenOption: {
|
|
1280
|
+
statusBarStyle: "dark"
|
|
1182
1281
|
}
|
|
1183
|
-
|
|
1184
|
-
|
|
1282
|
+
}
|
|
1283
|
+
});
|
|
1284
|
+
global.Page = App;
|
|
1185
1285
|
}
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
}
|
|
1199
|
-
)
|
|
1200
|
-
] });
|
|
1286
|
+
return global.Page;
|
|
1287
|
+
}
|
|
1288
|
+
function AppsInTossScreenContainer({ children }) {
|
|
1289
|
+
const isRNApp = getAppsInTossGlobals().webViewType == null;
|
|
1290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_analytics.Analytics.Screen, { children: isRNApp ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RNAppContainer, { children }) : children });
|
|
1291
|
+
}
|
|
1292
|
+
function getAppName() {
|
|
1293
|
+
try {
|
|
1294
|
+
return global.__granite.app.name;
|
|
1295
|
+
} catch (error) {
|
|
1296
|
+
console.error("unexpected error occurred while getting app name");
|
|
1297
|
+
throw error;
|
|
1201
1298
|
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
left: 0,
|
|
1208
|
-
right: 0,
|
|
1209
|
-
bottom: 0,
|
|
1210
|
-
zIndex: Z_INDEX.PROFILE_OVERLAY
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
// src/core/index.ts
|
|
1302
|
+
var AppsInToss = {
|
|
1303
|
+
registerApp
|
|
1211
1304
|
};
|
|
1212
1305
|
|
|
1306
|
+
// src/components/WebView.tsx
|
|
1307
|
+
var import_native_modules18 = require("@apps-in-toss/native-modules");
|
|
1308
|
+
var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async-bridges"), 1);
|
|
1309
|
+
var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
|
|
1310
|
+
var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event-bridges"), 1);
|
|
1311
|
+
var import_react_native31 = require("@granite-js/react-native");
|
|
1312
|
+
var import_tds_react_native14 = require("@toss/tds-react-native");
|
|
1313
|
+
var import_private9 = require("@toss/tds-react-native/private");
|
|
1314
|
+
var import_react24 = require("react");
|
|
1315
|
+
var import_react_native32 = require("react-native");
|
|
1316
|
+
|
|
1317
|
+
// src/components/GameWebView.tsx
|
|
1318
|
+
var import_native_modules14 = require("@apps-in-toss/native-modules");
|
|
1319
|
+
var import_react_native_webview = require("@granite-js/native/react-native-webview");
|
|
1320
|
+
var import_react16 = require("react");
|
|
1321
|
+
var import_react_native24 = require("react-native");
|
|
1322
|
+
|
|
1213
1323
|
// src/components/NavigationBar/GameWebviewNavigationBar.tsx
|
|
1214
|
-
var
|
|
1215
|
-
var
|
|
1216
|
-
var
|
|
1324
|
+
var import_react_native22 = require("@granite-js/react-native");
|
|
1325
|
+
var import_tds_react_native11 = require("@toss/tds-react-native");
|
|
1326
|
+
var import_private7 = require("@toss/tds-react-native/private");
|
|
1217
1327
|
var import_es_hangul3 = require("es-hangul");
|
|
1218
|
-
var
|
|
1219
|
-
var
|
|
1220
|
-
var
|
|
1328
|
+
var import_react15 = require("react");
|
|
1329
|
+
var import_react_native23 = require("react-native");
|
|
1330
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1221
1331
|
function GameWebviewNavigationBar() {
|
|
1222
|
-
const safeAreaTop = (0,
|
|
1223
|
-
const { openConfirm } = (0,
|
|
1332
|
+
const safeAreaTop = (0, import_private7.useSafeAreaTop)();
|
|
1333
|
+
const { openConfirm } = (0, import_tds_react_native11.useDialog)();
|
|
1224
1334
|
const { captureExitLog } = useCaptureExitLog();
|
|
1225
1335
|
const global2 = getAppsInTossGlobals();
|
|
1226
1336
|
const logging = useNavigationBarLogging();
|
|
1227
1337
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1228
1338
|
const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
|
|
1229
1339
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
1230
|
-
const handleGameWebviewClose = (0,
|
|
1340
|
+
const handleGameWebviewClose = (0, import_react15.useCallback)(async () => {
|
|
1231
1341
|
logging.closeButtonClick();
|
|
1232
1342
|
const isConfirmed = await openConfirm({
|
|
1233
1343
|
title: `${(0, import_es_hangul3.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
@@ -1239,18 +1349,18 @@ function GameWebviewNavigationBar() {
|
|
|
1239
1349
|
logging.closePopupCtaClick(isConfirmed);
|
|
1240
1350
|
if (isConfirmed) {
|
|
1241
1351
|
captureExitLog(Date.now());
|
|
1242
|
-
(0,
|
|
1352
|
+
(0, import_react_native22.closeView)();
|
|
1243
1353
|
}
|
|
1244
1354
|
}, [captureExitLog, global2.brandDisplayName, logging, openConfirm]);
|
|
1245
|
-
return /* @__PURE__ */ (0,
|
|
1246
|
-
/* @__PURE__ */ (0,
|
|
1247
|
-
/* @__PURE__ */ (0,
|
|
1248
|
-
|
|
1355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1356
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_tds_react_native11.PageNavbar, { preference: { type: "none" } }),
|
|
1357
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1358
|
+
import_react_native23.View,
|
|
1249
1359
|
{
|
|
1250
1360
|
style: {
|
|
1251
1361
|
width: "100%",
|
|
1252
1362
|
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1253
|
-
height:
|
|
1363
|
+
height: import_react_native23.Platform.OS === "ios" ? 44 : 54,
|
|
1254
1364
|
flexDirection: "row",
|
|
1255
1365
|
alignItems: "center",
|
|
1256
1366
|
justifyContent: "flex-end",
|
|
@@ -1260,8 +1370,8 @@ function GameWebviewNavigationBar() {
|
|
|
1260
1370
|
paddingRight: 10
|
|
1261
1371
|
},
|
|
1262
1372
|
pointerEvents: "box-none",
|
|
1263
|
-
children: /* @__PURE__ */ (0,
|
|
1264
|
-
|
|
1373
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1374
|
+
import_private7.NavigationRightContent,
|
|
1265
1375
|
{
|
|
1266
1376
|
fixedRightButton: initialAccessoryButton,
|
|
1267
1377
|
onPressDots: openMoreButtonBottomSheet,
|
|
@@ -1277,53 +1387,53 @@ function GameWebviewNavigationBar() {
|
|
|
1277
1387
|
}
|
|
1278
1388
|
|
|
1279
1389
|
// src/components/GameWebView.tsx
|
|
1280
|
-
var
|
|
1281
|
-
var GameWebView = (0,
|
|
1282
|
-
const [isEntryMessageExited, setIsEntryMessageExited] = (0,
|
|
1283
|
-
(0,
|
|
1284
|
-
if (
|
|
1285
|
-
(0,
|
|
1390
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1391
|
+
var GameWebView = (0, import_react16.forwardRef)(function GameWebView2(props, ref) {
|
|
1392
|
+
const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react16.useState)(false);
|
|
1393
|
+
(0, import_react16.useEffect)(() => {
|
|
1394
|
+
if (import_react_native24.Platform.OS === "ios") {
|
|
1395
|
+
(0, import_native_modules14.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1286
1396
|
return () => {
|
|
1287
|
-
(0,
|
|
1397
|
+
(0, import_native_modules14.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1288
1398
|
};
|
|
1289
1399
|
}
|
|
1290
1400
|
return;
|
|
1291
1401
|
}, []);
|
|
1292
|
-
(0,
|
|
1293
|
-
|
|
1402
|
+
(0, import_react16.useEffect)(() => {
|
|
1403
|
+
import_native_modules14.appsInTossEvent.addEventListener("entryMessageExited", {
|
|
1294
1404
|
onEvent: () => {
|
|
1295
1405
|
setIsEntryMessageExited(true);
|
|
1296
1406
|
}
|
|
1297
1407
|
});
|
|
1298
1408
|
}, []);
|
|
1299
|
-
return /* @__PURE__ */ (0,
|
|
1300
|
-
/* @__PURE__ */ (0,
|
|
1301
|
-
(0,
|
|
1409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1410
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GameWebviewNavigationBar, {}),
|
|
1411
|
+
(0, import_native_modules14.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GameProfile, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native_webview.WebView, { ref, ...props }) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native_webview.WebView, { ref, ...props })
|
|
1302
1412
|
] });
|
|
1303
1413
|
});
|
|
1304
1414
|
|
|
1305
1415
|
// src/components/PartnerWebView.tsx
|
|
1306
1416
|
var import_react_native_webview2 = require("@granite-js/native/react-native-webview");
|
|
1307
|
-
var
|
|
1417
|
+
var import_react18 = require("react");
|
|
1308
1418
|
|
|
1309
1419
|
// src/components/NavigationBar/PartnerWebviewNavigationBar.tsx
|
|
1310
|
-
var
|
|
1311
|
-
var
|
|
1312
|
-
var
|
|
1420
|
+
var import_react_native25 = require("@granite-js/react-native");
|
|
1421
|
+
var import_tds_react_native12 = require("@toss/tds-react-native");
|
|
1422
|
+
var import_private8 = require("@toss/tds-react-native/private");
|
|
1313
1423
|
var import_es_hangul4 = require("es-hangul");
|
|
1314
|
-
var
|
|
1315
|
-
var
|
|
1424
|
+
var import_react17 = require("react");
|
|
1425
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1316
1426
|
function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
1317
1427
|
const globals = getAppsInTossGlobals();
|
|
1318
1428
|
const { captureExitLog } = useCaptureExitLog();
|
|
1319
1429
|
const logging = useNavigationBarLogging();
|
|
1320
|
-
const { openConfirm } = (0,
|
|
1430
|
+
const { openConfirm } = (0, import_tds_react_native12.useDialog)();
|
|
1321
1431
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1322
1432
|
const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
|
|
1323
1433
|
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
1324
1434
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
1325
1435
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
1326
|
-
const handleClose = (0,
|
|
1436
|
+
const handleClose = (0, import_react17.useCallback)(async () => {
|
|
1327
1437
|
logging.closeButtonClick();
|
|
1328
1438
|
const isConfirmed = await openConfirm({
|
|
1329
1439
|
title: `${(0, import_es_hangul4.josa)(globals.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
@@ -1335,11 +1445,11 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1335
1445
|
logging.closePopupCtaClick(isConfirmed);
|
|
1336
1446
|
if (isConfirmed) {
|
|
1337
1447
|
captureExitLog(Date.now());
|
|
1338
|
-
(0,
|
|
1448
|
+
(0, import_react_native25.closeView)();
|
|
1339
1449
|
}
|
|
1340
1450
|
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
1341
|
-
return /* @__PURE__ */ (0,
|
|
1342
|
-
|
|
1451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1452
|
+
import_private8.TopNavigation,
|
|
1343
1453
|
{
|
|
1344
1454
|
title: globals.brandDisplayName,
|
|
1345
1455
|
icon: toIcon(globals.brandIcon),
|
|
@@ -1349,22 +1459,22 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1349
1459
|
onPressClose: handleClose,
|
|
1350
1460
|
withHome: withHomeButton,
|
|
1351
1461
|
fixedRightButton: initialAccessoryButton,
|
|
1352
|
-
children: /* @__PURE__ */ (0,
|
|
1462
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_private8.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_private8.NavigationBackButton, { onPress: onBackButtonClick, canGoBack: false }) })
|
|
1353
1463
|
}
|
|
1354
1464
|
) });
|
|
1355
1465
|
}
|
|
1356
1466
|
|
|
1357
1467
|
// src/components/PartnerWebView.tsx
|
|
1358
|
-
var
|
|
1359
|
-
var PartnerWebView = (0,
|
|
1360
|
-
return /* @__PURE__ */ (0,
|
|
1361
|
-
/* @__PURE__ */ (0,
|
|
1362
|
-
/* @__PURE__ */ (0,
|
|
1468
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1469
|
+
var PartnerWebView = (0, import_react18.forwardRef)(function PartnerWebViewScreen({ onBackButtonClick, onHomeButtonClick, ...webViewProps }, ref) {
|
|
1470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1471
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PartnerWebviewNavigationBar, { onBackButtonClick, onHomeButtonClick }),
|
|
1472
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_webview2.WebView, { ref, ...webViewProps, style: { flex: 1 } })
|
|
1363
1473
|
] });
|
|
1364
1474
|
});
|
|
1365
1475
|
|
|
1366
1476
|
// src/bridge-handler/useBridgeHandler.tsx
|
|
1367
|
-
var
|
|
1477
|
+
var import_react19 = require("react");
|
|
1368
1478
|
function serializeError(error) {
|
|
1369
1479
|
return JSON.stringify(error, (_, value) => {
|
|
1370
1480
|
if (value instanceof Error) {
|
|
@@ -1417,8 +1527,8 @@ function useBridgeHandler({
|
|
|
1417
1527
|
eventListenerMap,
|
|
1418
1528
|
injectedJavaScript: originalInjectedJavaScript
|
|
1419
1529
|
}) {
|
|
1420
|
-
const ref = (0,
|
|
1421
|
-
const injectedJavaScript = (0,
|
|
1530
|
+
const ref = (0, import_react19.useRef)(null);
|
|
1531
|
+
const injectedJavaScript = (0, import_react19.useMemo)(
|
|
1422
1532
|
() => [
|
|
1423
1533
|
`window.__CONSTANT_HANDLER_MAP = ${JSON.stringify(
|
|
1424
1534
|
Object.entries(constantHandlerMap).reduce(
|
|
@@ -1445,7 +1555,7 @@ function useBridgeHandler({
|
|
|
1445
1555
|
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
|
|
1446
1556
|
`);
|
|
1447
1557
|
};
|
|
1448
|
-
const $onMessage = (0,
|
|
1558
|
+
const $onMessage = (0, import_react19.useCallback)(
|
|
1449
1559
|
async (e) => {
|
|
1450
1560
|
onMessage?.(e);
|
|
1451
1561
|
const data = JSON.parse(e.nativeEvent.data);
|
|
@@ -1496,13 +1606,13 @@ function useBridgeHandler({
|
|
|
1496
1606
|
}
|
|
1497
1607
|
|
|
1498
1608
|
// src/core/hooks/useWebBackHandler.tsx
|
|
1499
|
-
var
|
|
1500
|
-
var
|
|
1609
|
+
var import_react_native26 = require("@granite-js/react-native");
|
|
1610
|
+
var import_tds_react_native13 = require("@toss/tds-react-native");
|
|
1501
1611
|
var import_es_hangul5 = require("es-hangul");
|
|
1502
|
-
var
|
|
1612
|
+
var import_react21 = require("react");
|
|
1503
1613
|
|
|
1504
1614
|
// src/hooks/useWebviewHistoryStack.tsx
|
|
1505
|
-
var
|
|
1615
|
+
var import_react20 = require("react");
|
|
1506
1616
|
var INITIAL_STATE = { stack: [], index: -1 };
|
|
1507
1617
|
function reducer(state, action) {
|
|
1508
1618
|
switch (action.type) {
|
|
@@ -1533,11 +1643,11 @@ function reducer(state, action) {
|
|
|
1533
1643
|
}
|
|
1534
1644
|
}
|
|
1535
1645
|
function useWebViewHistory() {
|
|
1536
|
-
const [state, dispatch] = (0,
|
|
1537
|
-
const onNavigationStateChange = (0,
|
|
1646
|
+
const [state, dispatch] = (0, import_react20.useReducer)(reducer, INITIAL_STATE);
|
|
1647
|
+
const onNavigationStateChange = (0, import_react20.useCallback)(({ url, canGoForward: canGoForward2 }) => {
|
|
1538
1648
|
dispatch({ type: "NAVIGATION_CHANGE", url, canGoForward: canGoForward2 });
|
|
1539
1649
|
}, []);
|
|
1540
|
-
const { canGoBack, canGoForward } = (0,
|
|
1650
|
+
const { canGoBack, canGoForward } = (0, import_react20.useMemo)(() => {
|
|
1541
1651
|
const canBack = state.index > 0;
|
|
1542
1652
|
const canFwd = state.index >= 0 && state.index < state.stack.length - 1;
|
|
1543
1653
|
return { canGoBack: canBack, canGoForward: canFwd };
|
|
@@ -1566,23 +1676,23 @@ function useWebBackHandler(webViewRef) {
|
|
|
1566
1676
|
hasBackEvent: hasWebBackEvent,
|
|
1567
1677
|
addEventListener: addWebBackEventListener,
|
|
1568
1678
|
removeEventListener: removeWebBackEventListener
|
|
1569
|
-
} = (0,
|
|
1679
|
+
} = (0, import_react_native26.useBackEventState)();
|
|
1570
1680
|
const logging = useNavigationBarLogging();
|
|
1571
|
-
const { openConfirm } = (0,
|
|
1681
|
+
const { openConfirm } = (0, import_tds_react_native13.useDialog)();
|
|
1572
1682
|
const global2 = getAppsInTossGlobals();
|
|
1573
|
-
const addEventListener = (0,
|
|
1683
|
+
const addEventListener = (0, import_react21.useCallback)(
|
|
1574
1684
|
(handler) => {
|
|
1575
1685
|
addWebBackEventListener(handler);
|
|
1576
1686
|
},
|
|
1577
1687
|
[addWebBackEventListener]
|
|
1578
1688
|
);
|
|
1579
|
-
const removeEventListener = (0,
|
|
1689
|
+
const removeEventListener = (0, import_react21.useCallback)(
|
|
1580
1690
|
(handler) => {
|
|
1581
1691
|
removeWebBackEventListener(handler);
|
|
1582
1692
|
},
|
|
1583
1693
|
[removeWebBackEventListener]
|
|
1584
1694
|
);
|
|
1585
|
-
const handleWebBack = (0,
|
|
1695
|
+
const handleWebBack = (0, import_react21.useCallback)(async () => {
|
|
1586
1696
|
if (hasWebBackEvent) {
|
|
1587
1697
|
for (const handler of webBackHandlersRef) {
|
|
1588
1698
|
handler();
|
|
@@ -1602,7 +1712,7 @@ function useWebBackHandler(webViewRef) {
|
|
|
1602
1712
|
logging.closePopupCtaClick(isConfirmed);
|
|
1603
1713
|
if (isConfirmed) {
|
|
1604
1714
|
captureExitLog(Date.now());
|
|
1605
|
-
(0,
|
|
1715
|
+
(0, import_react_native26.closeView)();
|
|
1606
1716
|
}
|
|
1607
1717
|
}
|
|
1608
1718
|
}, [
|
|
@@ -1615,7 +1725,7 @@ function useWebBackHandler(webViewRef) {
|
|
|
1615
1725
|
openConfirm,
|
|
1616
1726
|
webViewRef
|
|
1617
1727
|
]);
|
|
1618
|
-
const handleWebHome = (0,
|
|
1728
|
+
const handleWebHome = (0, import_react21.useCallback)(() => {
|
|
1619
1729
|
logging.homeButtonClick();
|
|
1620
1730
|
if (hasWebBackEvent) {
|
|
1621
1731
|
for (const handler of webBackHandlersRef) {
|
|
@@ -1625,7 +1735,7 @@ function useWebBackHandler(webViewRef) {
|
|
|
1625
1735
|
}
|
|
1626
1736
|
webViewRef.current?.injectJavaScript(HISTORY_HOME_SCRIPT);
|
|
1627
1737
|
}, [hasWebBackEvent, webBackHandlersRef, logging, webViewRef]);
|
|
1628
|
-
return (0,
|
|
1738
|
+
return (0, import_react21.useMemo)(
|
|
1629
1739
|
() => ({ addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange }),
|
|
1630
1740
|
[addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange]
|
|
1631
1741
|
);
|
|
@@ -1645,8 +1755,8 @@ function mergeRefs(...refs) {
|
|
|
1645
1755
|
}
|
|
1646
1756
|
|
|
1647
1757
|
// src/hooks/useCreateUserAgent.ts
|
|
1648
|
-
var
|
|
1649
|
-
var
|
|
1758
|
+
var import_native_modules15 = require("@apps-in-toss/native-modules");
|
|
1759
|
+
var import_react_native27 = require("react-native");
|
|
1650
1760
|
var FontA11yCategory = {
|
|
1651
1761
|
Large: "Large",
|
|
1652
1762
|
xLarge: "xLarge",
|
|
@@ -1779,9 +1889,9 @@ function useCreateUserAgent({
|
|
|
1779
1889
|
safeArea,
|
|
1780
1890
|
safeAreaBottomTransparency
|
|
1781
1891
|
}) {
|
|
1782
|
-
const platform = (0,
|
|
1783
|
-
const appVersion = (0,
|
|
1784
|
-
const { fontScale } = (0,
|
|
1892
|
+
const platform = (0, import_native_modules15.getPlatformOS)();
|
|
1893
|
+
const appVersion = (0, import_native_modules15.getTossAppVersion)();
|
|
1894
|
+
const { fontScale } = (0, import_react_native27.useWindowDimensions)();
|
|
1785
1895
|
const platformString = platform === "ios" ? "iPhone" : "Android";
|
|
1786
1896
|
const fontA11y = mapFontScaleToCategory(fontScale, platform);
|
|
1787
1897
|
const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
|
|
@@ -1801,17 +1911,17 @@ function useCreateUserAgent({
|
|
|
1801
1911
|
}
|
|
1802
1912
|
|
|
1803
1913
|
// src/hooks/useGeolocation.ts
|
|
1804
|
-
var
|
|
1805
|
-
var
|
|
1806
|
-
var
|
|
1914
|
+
var import_native_modules16 = require("@apps-in-toss/native-modules");
|
|
1915
|
+
var import_react_native28 = require("@granite-js/react-native");
|
|
1916
|
+
var import_react22 = require("react");
|
|
1807
1917
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
1808
|
-
const isVisible = (0,
|
|
1809
|
-
const [location, setLocation] = (0,
|
|
1810
|
-
(0,
|
|
1918
|
+
const isVisible = (0, import_react_native28.useVisibility)();
|
|
1919
|
+
const [location, setLocation] = (0, import_react22.useState)(null);
|
|
1920
|
+
(0, import_react22.useEffect)(() => {
|
|
1811
1921
|
if (!isVisible) {
|
|
1812
1922
|
return;
|
|
1813
1923
|
}
|
|
1814
|
-
return (0,
|
|
1924
|
+
return (0, import_native_modules16.startUpdateLocation)({
|
|
1815
1925
|
options: {
|
|
1816
1926
|
accuracy,
|
|
1817
1927
|
distanceInterval,
|
|
@@ -1825,12 +1935,12 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
1825
1935
|
}
|
|
1826
1936
|
|
|
1827
1937
|
// src/hooks/useWaitForReturnNavigator.tsx
|
|
1828
|
-
var
|
|
1829
|
-
var
|
|
1938
|
+
var import_react_native29 = require("@granite-js/react-native");
|
|
1939
|
+
var import_react23 = require("react");
|
|
1830
1940
|
function useWaitForReturnNavigator() {
|
|
1831
|
-
const callbacks = (0,
|
|
1832
|
-
const navigation = (0,
|
|
1833
|
-
const startNavigating = (0,
|
|
1941
|
+
const callbacks = (0, import_react23.useRef)([]).current;
|
|
1942
|
+
const navigation = (0, import_react_native29.useNavigation)();
|
|
1943
|
+
const startNavigating = (0, import_react23.useCallback)(
|
|
1834
1944
|
(route, params) => {
|
|
1835
1945
|
return new Promise((resolve) => {
|
|
1836
1946
|
callbacks.push(resolve);
|
|
@@ -1839,7 +1949,7 @@ function useWaitForReturnNavigator() {
|
|
|
1839
1949
|
},
|
|
1840
1950
|
[callbacks, navigation]
|
|
1841
1951
|
);
|
|
1842
|
-
const handleVisibilityChange = (0,
|
|
1952
|
+
const handleVisibilityChange = (0, import_react23.useCallback)(
|
|
1843
1953
|
(state) => {
|
|
1844
1954
|
if (state === "visible" && callbacks.length > 0) {
|
|
1845
1955
|
for (const callback of callbacks) {
|
|
@@ -1850,13 +1960,13 @@ function useWaitForReturnNavigator() {
|
|
|
1850
1960
|
},
|
|
1851
1961
|
[callbacks]
|
|
1852
1962
|
);
|
|
1853
|
-
(0,
|
|
1963
|
+
(0, import_react_native29.useVisibilityChange)(handleVisibilityChange);
|
|
1854
1964
|
return startNavigating;
|
|
1855
1965
|
}
|
|
1856
1966
|
|
|
1857
1967
|
// src/utils/log.ts
|
|
1858
|
-
var
|
|
1859
|
-
var
|
|
1968
|
+
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
1969
|
+
var import_react_native30 = require("@granite-js/react-native");
|
|
1860
1970
|
|
|
1861
1971
|
// src/utils/extractDateFromUUIDv7.ts
|
|
1862
1972
|
var extractDateFromUUIDv7 = (uuid) => {
|
|
@@ -1882,7 +1992,7 @@ var getGroupId = (url) => {
|
|
|
1882
1992
|
};
|
|
1883
1993
|
var getReferrer = () => {
|
|
1884
1994
|
try {
|
|
1885
|
-
const referrer = new URL((0,
|
|
1995
|
+
const referrer = new URL((0, import_react_native30.getSchemeUri)());
|
|
1886
1996
|
return referrer.searchParams.get("referrer");
|
|
1887
1997
|
} catch {
|
|
1888
1998
|
return "";
|
|
@@ -1900,21 +2010,21 @@ var trackScreen = (url) => {
|
|
|
1900
2010
|
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
1901
2011
|
}
|
|
1902
2012
|
};
|
|
1903
|
-
return (0,
|
|
2013
|
+
return (0, import_native_modules17.eventLog)(log);
|
|
1904
2014
|
};
|
|
1905
2015
|
|
|
1906
2016
|
// src/components/WebView.tsx
|
|
1907
|
-
var
|
|
2017
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1908
2018
|
var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
|
|
1909
2019
|
var TYPES = ["partner", "external", "game"];
|
|
1910
2020
|
var WEBVIEW_TYPES = {
|
|
1911
2021
|
partner: PartnerWebView,
|
|
1912
|
-
external:
|
|
2022
|
+
external: import_tds_react_native14.ExternalWebViewScreen,
|
|
1913
2023
|
game: GameWebView
|
|
1914
2024
|
};
|
|
1915
2025
|
function mergeSchemeQueryParamsInto(url) {
|
|
1916
2026
|
const baseUrl = new URL(url);
|
|
1917
|
-
const schemeUrl = new URL((0,
|
|
2027
|
+
const schemeUrl = new URL((0, import_react_native31.getSchemeUri)());
|
|
1918
2028
|
baseUrl.pathname = schemeUrl.pathname;
|
|
1919
2029
|
for (const [key, value] of schemeUrl.searchParams.entries()) {
|
|
1920
2030
|
baseUrl.searchParams.set(key, value);
|
|
@@ -1926,7 +2036,7 @@ function getWebViewUri(local) {
|
|
|
1926
2036
|
const devUrl = `http://${local.host}:${local.port}`;
|
|
1927
2037
|
return mergeSchemeQueryParamsInto(devUrl).toString();
|
|
1928
2038
|
}
|
|
1929
|
-
const { url: rawUrl } =
|
|
2039
|
+
const { url: rawUrl } = import_native_modules18.AppsInTossModule.getWebBundleURL({});
|
|
1930
2040
|
const url = mergeSchemeQueryParamsInto(rawUrl);
|
|
1931
2041
|
const deploymentId = env.getDeploymentId();
|
|
1932
2042
|
if (deploymentId) {
|
|
@@ -1938,13 +2048,13 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1938
2048
|
if (!TYPES.includes(type)) {
|
|
1939
2049
|
throw new Error(`Invalid WebView type: '${type}'`);
|
|
1940
2050
|
}
|
|
1941
|
-
const webViewRef = (0,
|
|
2051
|
+
const webViewRef = (0, import_react24.useRef)(null);
|
|
1942
2052
|
const webBackHandler = useWebBackHandler(webViewRef);
|
|
1943
|
-
const uri = (0,
|
|
1944
|
-
const top = (0,
|
|
1945
|
-
const bottom = (0,
|
|
2053
|
+
const uri = (0, import_react24.useMemo)(() => getWebViewUri(local), [local]);
|
|
2054
|
+
const top = (0, import_private9.useSafeAreaTop)();
|
|
2055
|
+
const bottom = (0, import_private9.useSafeAreaBottom)();
|
|
1946
2056
|
const global2 = getAppsInTossGlobals();
|
|
1947
|
-
const topNavigation = (0,
|
|
2057
|
+
const topNavigation = (0, import_private9.useTopNavigation)();
|
|
1948
2058
|
const disableTextSelectionCSS = `
|
|
1949
2059
|
(function() {
|
|
1950
2060
|
const style = document.createElement('style');
|
|
@@ -1952,7 +2062,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1952
2062
|
document.head.appendChild(style);
|
|
1953
2063
|
})();
|
|
1954
2064
|
`;
|
|
1955
|
-
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0,
|
|
2065
|
+
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0, import_react24.useState)(
|
|
1956
2066
|
props.allowsBackForwardNavigationGestures
|
|
1957
2067
|
);
|
|
1958
2068
|
const handler = useBridgeHandler({
|
|
@@ -1961,28 +2071,28 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1961
2071
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1962
2072
|
eventListenerMap: {
|
|
1963
2073
|
...appsInTossEventBridges,
|
|
1964
|
-
navigationAccessoryEvent: ({ onEvent, onError }) =>
|
|
2074
|
+
navigationAccessoryEvent: ({ onEvent, onError }) => import_tds_react_native14.tdsEvent.addEventListener("navigationAccessoryEvent", { onEvent, onError }),
|
|
1965
2075
|
backEvent: ({ onEvent }) => {
|
|
1966
2076
|
webBackHandler.addEventListener(onEvent);
|
|
1967
2077
|
return () => {
|
|
1968
2078
|
webBackHandler.removeEventListener(onEvent);
|
|
1969
2079
|
};
|
|
1970
2080
|
},
|
|
1971
|
-
entryMessageExited: ({ onEvent, onError }) =>
|
|
1972
|
-
updateLocationEvent: ({ onEvent, onError, options }) =>
|
|
2081
|
+
entryMessageExited: ({ onEvent, onError }) => import_native_modules18.appsInTossEvent.addEventListener("entryMessageExited", { onEvent, onError }),
|
|
2082
|
+
updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules18.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
1973
2083
|
/** @internal */
|
|
1974
|
-
appBridgeCallbackEvent: ({ onEvent, onError, options }) =>
|
|
2084
|
+
appBridgeCallbackEvent: ({ onEvent, onError, options }) => import_native_modules18.appsInTossEvent.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
|
|
1975
2085
|
/** AdMob */
|
|
1976
|
-
loadAdMobInterstitialAd:
|
|
1977
|
-
showAdMobInterstitialAd:
|
|
1978
|
-
loadAdMobRewardedAd:
|
|
1979
|
-
showAdMobRewardedAd:
|
|
2086
|
+
loadAdMobInterstitialAd: import_native_modules18.GoogleAdMob.loadAdMobInterstitialAd,
|
|
2087
|
+
showAdMobInterstitialAd: import_native_modules18.GoogleAdMob.showAdMobInterstitialAd,
|
|
2088
|
+
loadAdMobRewardedAd: import_native_modules18.GoogleAdMob.loadAdMobRewardedAd,
|
|
2089
|
+
showAdMobRewardedAd: import_native_modules18.GoogleAdMob.showAdMobRewardedAd,
|
|
1980
2090
|
/** AdMobV2 */
|
|
1981
|
-
loadAppsInTossAdMob:
|
|
1982
|
-
showAppsInTossAdMob:
|
|
2091
|
+
loadAppsInTossAdMob: import_native_modules18.GoogleAdMob.loadAppsInTossAdMob,
|
|
2092
|
+
showAppsInTossAdMob: import_native_modules18.GoogleAdMob.showAppsInTossAdMob,
|
|
1983
2093
|
/** IAP */
|
|
1984
|
-
iapCreateOneTimePurchaseOrder:
|
|
1985
|
-
requestOneTimePurchase:
|
|
2094
|
+
iapCreateOneTimePurchaseOrder: import_native_modules18.IAP.createOneTimePurchaseOrder,
|
|
2095
|
+
requestOneTimePurchase: import_native_modules18.requestOneTimePurchase
|
|
1986
2096
|
},
|
|
1987
2097
|
constantHandlerMap: {
|
|
1988
2098
|
...appsInTossConstantBridges,
|
|
@@ -1990,13 +2100,13 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1990
2100
|
getSafeAreaBottom: () => bottom,
|
|
1991
2101
|
...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
|
|
1992
2102
|
/** AdMob */
|
|
1993
|
-
loadAdMobInterstitialAd_isSupported:
|
|
1994
|
-
showAdMobInterstitialAd_isSupported:
|
|
1995
|
-
loadAdMobRewardedAd_isSupported:
|
|
1996
|
-
showAdMobRewardedAd_isSupported:
|
|
2103
|
+
loadAdMobInterstitialAd_isSupported: import_native_modules18.GoogleAdMob.loadAdMobInterstitialAd.isSupported,
|
|
2104
|
+
showAdMobInterstitialAd_isSupported: import_native_modules18.GoogleAdMob.showAdMobInterstitialAd.isSupported,
|
|
2105
|
+
loadAdMobRewardedAd_isSupported: import_native_modules18.GoogleAdMob.loadAdMobRewardedAd.isSupported,
|
|
2106
|
+
showAdMobRewardedAd_isSupported: import_native_modules18.GoogleAdMob.showAdMobRewardedAd.isSupported,
|
|
1997
2107
|
/** AdMobV2 */
|
|
1998
|
-
loadAppsInTossAdMob_isSupported:
|
|
1999
|
-
showAppsInTossAdMob_isSupported:
|
|
2108
|
+
loadAppsInTossAdMob_isSupported: import_native_modules18.GoogleAdMob.loadAppsInTossAdMob.isSupported,
|
|
2109
|
+
showAppsInTossAdMob_isSupported: import_native_modules18.GoogleAdMob.showAppsInTossAdMob.isSupported,
|
|
2000
2110
|
/** env */
|
|
2001
2111
|
getDeploymentId: env.getDeploymentId
|
|
2002
2112
|
},
|
|
@@ -2019,20 +2129,20 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2019
2129
|
getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
|
|
2020
2130
|
openCamera: appsInTossAsyncBridges.openCamera,
|
|
2021
2131
|
/** Storage */
|
|
2022
|
-
getStorageItem:
|
|
2023
|
-
setStorageItem:
|
|
2024
|
-
removeStorageItem:
|
|
2025
|
-
clearItems:
|
|
2132
|
+
getStorageItem: import_native_modules18.Storage.getItem,
|
|
2133
|
+
setStorageItem: import_native_modules18.Storage.setItem,
|
|
2134
|
+
removeStorageItem: import_native_modules18.Storage.removeItem,
|
|
2135
|
+
clearItems: import_native_modules18.Storage.clearItems,
|
|
2026
2136
|
/** IAP */
|
|
2027
|
-
iapGetProductItemList:
|
|
2028
|
-
iapCreateOneTimePurchaseOrder:
|
|
2029
|
-
processProductGrant:
|
|
2030
|
-
getPendingOrders:
|
|
2031
|
-
getCompletedOrRefundedOrders:
|
|
2032
|
-
completeProductGrant:
|
|
2137
|
+
iapGetProductItemList: import_native_modules18.IAP.getProductItemList,
|
|
2138
|
+
iapCreateOneTimePurchaseOrder: import_native_modules18.iapCreateOneTimePurchaseOrder,
|
|
2139
|
+
processProductGrant: import_native_modules18.processProductGrant,
|
|
2140
|
+
getPendingOrders: import_native_modules18.IAP.getPendingOrders,
|
|
2141
|
+
getCompletedOrRefundedOrders: import_native_modules18.IAP.getCompletedOrRefundedOrders,
|
|
2142
|
+
completeProductGrant: import_native_modules18.IAP.completeProductGrant
|
|
2033
2143
|
}
|
|
2034
2144
|
});
|
|
2035
|
-
const headerPropForExternalWebView = (0,
|
|
2145
|
+
const headerPropForExternalWebView = (0, import_react24.useMemo)(() => {
|
|
2036
2146
|
const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
|
|
2037
2147
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
2038
2148
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
@@ -2053,15 +2163,15 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2053
2163
|
colorPreference: "light"
|
|
2054
2164
|
});
|
|
2055
2165
|
const refs = mergeRefs(handler.ref, webViewRef);
|
|
2056
|
-
(0,
|
|
2166
|
+
(0, import_react24.useEffect)(() => {
|
|
2057
2167
|
const callback = () => {
|
|
2058
2168
|
webBackHandler.handleWebBack();
|
|
2059
2169
|
return true;
|
|
2060
2170
|
};
|
|
2061
|
-
|
|
2062
|
-
return () =>
|
|
2171
|
+
import_react_native32.BackHandler.addEventListener("hardwareBackPress", callback);
|
|
2172
|
+
return () => import_react_native32.BackHandler.removeEventListener("hardwareBackPress", callback);
|
|
2063
2173
|
}, [webBackHandler]);
|
|
2064
|
-
return /* @__PURE__ */ (0,
|
|
2174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2065
2175
|
BaseWebView,
|
|
2066
2176
|
{
|
|
2067
2177
|
ref: refs,
|
|
@@ -2083,14 +2193,14 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2083
2193
|
props.onNavigationStateChange?.(event);
|
|
2084
2194
|
webBackHandler.onNavigationStateChange(event);
|
|
2085
2195
|
},
|
|
2086
|
-
userAgent:
|
|
2196
|
+
userAgent: import_react_native32.Platform.OS === "ios" ? userAgent : void 0,
|
|
2087
2197
|
sharedCookiesEnabled: true,
|
|
2088
2198
|
webviewDebuggingEnabled: webViewDebuggingEnabled,
|
|
2089
2199
|
thirdPartyCookiesEnabled: true,
|
|
2090
2200
|
onMessage: handler.onMessage,
|
|
2091
2201
|
injectedJavaScript: handler.injectedJavaScript,
|
|
2092
2202
|
injectedJavaScriptBeforeContentLoaded: handler.injectedJavaScript,
|
|
2093
|
-
decelerationRate:
|
|
2203
|
+
decelerationRate: import_react_native32.Platform.OS === "ios" ? 1 : void 0,
|
|
2094
2204
|
allowsBackForwardNavigationGestures
|
|
2095
2205
|
}
|
|
2096
2206
|
);
|
|
@@ -2098,7 +2208,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2098
2208
|
|
|
2099
2209
|
// src/index.ts
|
|
2100
2210
|
__reExport(src_exports, require("@apps-in-toss/analytics"), module.exports);
|
|
2101
|
-
var
|
|
2211
|
+
var import_private10 = require("@toss/tds-react-native/private");
|
|
2102
2212
|
__reExport(src_exports, require("@apps-in-toss/native-modules"), module.exports);
|
|
2103
2213
|
__reExport(src_exports, require("@apps-in-toss/types"), module.exports);
|
|
2104
2214
|
var Analytics2 = {
|