@apps-in-toss/framework 0.0.0-dev.1757939087965 → 0.0.0-dev.1758103372343
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 +548 -379
- package/dist/index.js +444 -279
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -38,14 +38,14 @@ __export(src_exports, {
|
|
|
38
38
|
env: () => env,
|
|
39
39
|
useCreateUserAgent: () => useCreateUserAgent,
|
|
40
40
|
useGeolocation: () => useGeolocation,
|
|
41
|
-
useTopNavigation: () =>
|
|
41
|
+
useTopNavigation: () => import_private8.useTopNavigation
|
|
42
42
|
});
|
|
43
43
|
module.exports = __toCommonJS(src_exports);
|
|
44
44
|
var import_analytics2 = require("@apps-in-toss/analytics");
|
|
45
45
|
|
|
46
46
|
// src/core/registerApp.tsx
|
|
47
47
|
var import_analytics = require("@apps-in-toss/analytics");
|
|
48
|
-
var
|
|
48
|
+
var import_native_modules8 = require("@apps-in-toss/native-modules");
|
|
49
49
|
var import_react_native17 = require("@granite-js/react-native");
|
|
50
50
|
var import_react_native18 = require("@toss-design-system/react-native");
|
|
51
51
|
var import_react_native19 = require("react-native");
|
|
@@ -191,18 +191,58 @@ function AppUpdate() {
|
|
|
191
191
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
// src/core/
|
|
195
|
-
var
|
|
196
|
-
var
|
|
197
|
-
var
|
|
194
|
+
// src/core/hooks/useAppsInTossBridge.ts
|
|
195
|
+
var import_native_modules3 = require("@apps-in-toss/native-modules");
|
|
196
|
+
var import_react_native6 = require("@toss-design-system/react-native");
|
|
197
|
+
var import_react5 = require("react");
|
|
198
|
+
|
|
199
|
+
// src/core/utils/getAppsInTossGlobals.ts
|
|
200
|
+
function getAppsInTossGlobals() {
|
|
201
|
+
if (global.__appsInToss == null) {
|
|
202
|
+
throw new Error("invalid apps-in-toss globals");
|
|
203
|
+
}
|
|
204
|
+
return global.__appsInToss;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// src/core/utils/toIcon.ts
|
|
208
|
+
function toIcon(source) {
|
|
209
|
+
return source.startsWith("http") ? { source: { uri: source } } : { name: source };
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// src/core/hooks/useAppsInTossBridge.ts
|
|
213
|
+
function useAppsInTossBridge() {
|
|
214
|
+
const controller = (0, import_react_native6.useBridge)();
|
|
215
|
+
const appsInTossGlobals = getAppsInTossGlobals();
|
|
216
|
+
(0, import_react5.useEffect)(() => {
|
|
217
|
+
const commonProps = {
|
|
218
|
+
serviceName: appsInTossGlobals.brandDisplayName,
|
|
219
|
+
icon: toIcon(appsInTossGlobals.brandIcon),
|
|
220
|
+
color: appsInTossGlobals.brandPrimaryColor,
|
|
221
|
+
colorMode: appsInTossGlobals.brandBridgeColorMode
|
|
222
|
+
};
|
|
223
|
+
controller.open({
|
|
224
|
+
...commonProps,
|
|
225
|
+
onExited: () => {
|
|
226
|
+
import_native_modules3.appsInTossEvent.emit("entryMessageExited", void 0);
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
}, []);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// src/components/NavigationBar/RNNavigationBar.tsx
|
|
233
|
+
var import_react_native14 = require("@granite-js/react-native");
|
|
234
|
+
var import_react_native15 = require("@toss-design-system/react-native");
|
|
198
235
|
var import_private2 = require("@toss-design-system/react-native/private");
|
|
199
236
|
var import_es_hangul = require("es-hangul");
|
|
200
|
-
var
|
|
201
|
-
var
|
|
237
|
+
var import_react9 = require("react");
|
|
238
|
+
var import_react_native16 = require("react-native");
|
|
202
239
|
|
|
203
|
-
// src/
|
|
204
|
-
var
|
|
205
|
-
|
|
240
|
+
// src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
|
|
241
|
+
var import_react6 = require("react");
|
|
242
|
+
|
|
243
|
+
// src/components/NavigationBar/common/useNavigationBarLogging.tsx
|
|
244
|
+
var import_native_modules4 = require("@apps-in-toss/native-modules");
|
|
245
|
+
var import_react_native7 = require("@granite-js/react-native");
|
|
206
246
|
var NAVI_BAR_IMPRESSION_SCHEMA_ID = 1596837;
|
|
207
247
|
var NAVI_BAR_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__navigation_bar";
|
|
208
248
|
var CLOSE_POPUP_SHOW_SCHEMA_ID = 1644490;
|
|
@@ -213,14 +253,14 @@ var CLOSE_POPUP_CTA_CLICK_SCHEMA_ID = 1644492;
|
|
|
213
253
|
var CLOSE_POPUP_CTA_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::popup__close_app::click__cta";
|
|
214
254
|
var HOME_BUTTON_CLICK_SCHEMA_ID = 1596839;
|
|
215
255
|
var HOME_BUTTON_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::click__icon_home";
|
|
216
|
-
function
|
|
256
|
+
function useNavigationBarLogging() {
|
|
217
257
|
const referrer = useReferrer();
|
|
218
258
|
const baseParams = {
|
|
219
259
|
referrer,
|
|
220
|
-
app_name:
|
|
260
|
+
app_name: import_react_native7.Granite.appName
|
|
221
261
|
};
|
|
222
262
|
const logNavBarImpression = (naviBarConfig) => {
|
|
223
|
-
|
|
263
|
+
import_native_modules4.INTERNAL__module.tossCoreEventLog({
|
|
224
264
|
log_name: NAVI_BAR_IMPRESSION_LOG_NAME,
|
|
225
265
|
log_type: "event",
|
|
226
266
|
params: {
|
|
@@ -232,7 +272,7 @@ function useBuiltinNavigationBarLogging() {
|
|
|
232
272
|
});
|
|
233
273
|
};
|
|
234
274
|
const logHomeButtonClick = () => {
|
|
235
|
-
|
|
275
|
+
import_native_modules4.INTERNAL__module.tossCoreEventLog({
|
|
236
276
|
log_name: HOME_BUTTON_CLICK_LOG_NAME,
|
|
237
277
|
log_type: "event",
|
|
238
278
|
params: {
|
|
@@ -243,7 +283,7 @@ function useBuiltinNavigationBarLogging() {
|
|
|
243
283
|
});
|
|
244
284
|
};
|
|
245
285
|
const logCloseButtonClick = () => {
|
|
246
|
-
|
|
286
|
+
import_native_modules4.INTERNAL__module.tossCoreEventLog({
|
|
247
287
|
log_name: CLOSE_BUTTON_CLICK_LOG_NAME,
|
|
248
288
|
log_type: "event",
|
|
249
289
|
params: {
|
|
@@ -254,7 +294,7 @@ function useBuiltinNavigationBarLogging() {
|
|
|
254
294
|
});
|
|
255
295
|
};
|
|
256
296
|
const logClosePopupShow = () => {
|
|
257
|
-
|
|
297
|
+
import_native_modules4.INTERNAL__module.tossCoreEventLog({
|
|
258
298
|
log_name: CLOSE_POPUP_SHOW_LOG_NAME,
|
|
259
299
|
log_type: "popup",
|
|
260
300
|
params: {
|
|
@@ -264,7 +304,7 @@ function useBuiltinNavigationBarLogging() {
|
|
|
264
304
|
});
|
|
265
305
|
};
|
|
266
306
|
const logClosePopupCtaClick = (confirm) => {
|
|
267
|
-
|
|
307
|
+
import_native_modules4.INTERNAL__module.tossCoreEventLog({
|
|
268
308
|
log_name: CLOSE_POPUP_CTA_CLICK_LOG_NAME,
|
|
269
309
|
log_type: "event",
|
|
270
310
|
params: {
|
|
@@ -284,16 +324,33 @@ function useBuiltinNavigationBarLogging() {
|
|
|
284
324
|
};
|
|
285
325
|
}
|
|
286
326
|
|
|
327
|
+
// src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
|
|
328
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
329
|
+
function NavigationBarImpressionArea({
|
|
330
|
+
children,
|
|
331
|
+
withHomeButton
|
|
332
|
+
}) {
|
|
333
|
+
const hasLogged = (0, import_react6.useRef)(false);
|
|
334
|
+
const logging = useNavigationBarLogging();
|
|
335
|
+
(0, import_react6.useEffect)(() => {
|
|
336
|
+
if (hasLogged.current === false) {
|
|
337
|
+
logging.navBarImpression({ home_icon_yn: withHomeButton ? "Y" : "N" });
|
|
338
|
+
hasLogged.current = true;
|
|
339
|
+
}
|
|
340
|
+
}, []);
|
|
341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children });
|
|
342
|
+
}
|
|
343
|
+
|
|
287
344
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
288
|
-
var
|
|
289
|
-
var
|
|
290
|
-
var
|
|
345
|
+
var import_native_modules7 = require("@apps-in-toss/native-modules");
|
|
346
|
+
var import_react_native12 = require("@granite-js/react-native");
|
|
347
|
+
var import_react_native13 = require("@toss-design-system/react-native");
|
|
291
348
|
var import_private = require("@toss-design-system/react-native/private");
|
|
292
|
-
var
|
|
349
|
+
var import_react8 = require("react");
|
|
293
350
|
|
|
294
351
|
// src/core/hooks/useMoreButtonBottomSheet/useMoreButtonBottomSheetLogging.tsx
|
|
295
|
-
var
|
|
296
|
-
var
|
|
352
|
+
var import_native_modules5 = require("@apps-in-toss/native-modules");
|
|
353
|
+
var import_react_native8 = require("@granite-js/react-native");
|
|
297
354
|
var BOTTOM_SHEET_SCHEMA_ID = 1596825;
|
|
298
355
|
var BOTTOM_SHEET_LOG_NAME = "appsintoss_app_visit__common_module::bottomsheet__more";
|
|
299
356
|
var BOTTOM_SHEET_OPEN_SCHEMA_ID = 1596829;
|
|
@@ -306,10 +363,10 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
306
363
|
const referrer = useReferrer();
|
|
307
364
|
const baseParams = {
|
|
308
365
|
referrer,
|
|
309
|
-
app_name:
|
|
366
|
+
app_name: import_react_native8.Granite.appName
|
|
310
367
|
};
|
|
311
368
|
const logBottomSheetShow = () => {
|
|
312
|
-
|
|
369
|
+
import_native_modules5.INTERNAL__module.tossCoreEventLog({
|
|
313
370
|
log_name: BOTTOM_SHEET_LOG_NAME,
|
|
314
371
|
log_type: "popup",
|
|
315
372
|
params: {
|
|
@@ -319,7 +376,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
319
376
|
});
|
|
320
377
|
};
|
|
321
378
|
const logBottomSheetOpen = () => {
|
|
322
|
-
|
|
379
|
+
import_native_modules5.INTERNAL__module.tossCoreEventLog({
|
|
323
380
|
log_name: BOTTOM_SHEET_OPEN_LOG_NAME,
|
|
324
381
|
log_type: "event",
|
|
325
382
|
params: {
|
|
@@ -330,7 +387,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
330
387
|
});
|
|
331
388
|
};
|
|
332
389
|
const logBottomSheetCloseClick = () => {
|
|
333
|
-
|
|
390
|
+
import_native_modules5.INTERNAL__module.tossCoreEventLog({
|
|
334
391
|
log_name: BOTTOM_SHEET_CLOSE_CLICK_LOG_NAME,
|
|
335
392
|
log_type: "event",
|
|
336
393
|
params: {
|
|
@@ -341,7 +398,7 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
341
398
|
});
|
|
342
399
|
};
|
|
343
400
|
const logBottomSheetMenuClick = ({ title }) => {
|
|
344
|
-
|
|
401
|
+
import_native_modules5.INTERNAL__module.tossCoreEventLog({
|
|
345
402
|
log_name: BOTTOM_SHEET_MENU_CLICK_LOG_NAME,
|
|
346
403
|
log_type: "event",
|
|
347
404
|
params: {
|
|
@@ -361,24 +418,24 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
361
418
|
}
|
|
362
419
|
|
|
363
420
|
// src/hooks/useAppUpdateDialog.tsx
|
|
364
|
-
var
|
|
365
|
-
var
|
|
366
|
-
var
|
|
367
|
-
var
|
|
421
|
+
var import_native_modules6 = require("@apps-in-toss/native-modules");
|
|
422
|
+
var import_react_native10 = require("@granite-js/react-native");
|
|
423
|
+
var import_react_native11 = require("@toss-design-system/react-native");
|
|
424
|
+
var import_react7 = require("react");
|
|
368
425
|
|
|
369
426
|
// src/utils/market.ts
|
|
370
|
-
var
|
|
427
|
+
var import_react_native9 = require("react-native");
|
|
371
428
|
var PLAYSTORE_LINK = "https://play.google.com/store/apps/details?id=viva.republica.toss";
|
|
372
429
|
var APPSTORE_LINK = "https://itunes.apple.com/app/id839333328";
|
|
373
430
|
var getMarketLink = () => {
|
|
374
|
-
return
|
|
431
|
+
return import_react_native9.Platform.OS === "android" ? PLAYSTORE_LINK : APPSTORE_LINK;
|
|
375
432
|
};
|
|
376
433
|
|
|
377
434
|
// src/hooks/useAppUpdateDialog.tsx
|
|
378
435
|
function useAppUpdateDialog() {
|
|
379
|
-
const { openConfirm } = (0,
|
|
436
|
+
const { openConfirm } = (0, import_react_native11.useDialog)();
|
|
380
437
|
const logging = useAppUpdateDialogLogging();
|
|
381
|
-
const openAppUpdateDialog = (0,
|
|
438
|
+
const openAppUpdateDialog = (0, import_react7.useCallback)(
|
|
382
439
|
async ({
|
|
383
440
|
title,
|
|
384
441
|
description,
|
|
@@ -399,7 +456,7 @@ function useAppUpdateDialog() {
|
|
|
399
456
|
}
|
|
400
457
|
logging.update();
|
|
401
458
|
const STORE_SCHEME = getMarketLink();
|
|
402
|
-
(0,
|
|
459
|
+
(0, import_react_native10.openURL)(`supertoss://web?url=${STORE_SCHEME}&external=browser`);
|
|
403
460
|
},
|
|
404
461
|
[logging, openConfirm]
|
|
405
462
|
);
|
|
@@ -415,10 +472,10 @@ function useAppUpdateDialogLogging() {
|
|
|
415
472
|
const referrer = useReferrer();
|
|
416
473
|
const baseParams = {
|
|
417
474
|
referrer,
|
|
418
|
-
app_name:
|
|
475
|
+
app_name: import_react_native10.Granite.appName
|
|
419
476
|
};
|
|
420
477
|
const logUpdateClick = () => {
|
|
421
|
-
|
|
478
|
+
import_native_modules6.INTERNAL__module.tossCoreEventLog({
|
|
422
479
|
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
423
480
|
log_type: "event",
|
|
424
481
|
params: {
|
|
@@ -430,7 +487,7 @@ function useAppUpdateDialogLogging() {
|
|
|
430
487
|
});
|
|
431
488
|
};
|
|
432
489
|
const logCloseClick = () => {
|
|
433
|
-
|
|
490
|
+
import_native_modules6.INTERNAL__module.tossCoreEventLog({
|
|
434
491
|
log_name: UPDATE_DIALOG_CTA_CLICK_LOG_NAME,
|
|
435
492
|
log_type: "event",
|
|
436
493
|
params: {
|
|
@@ -442,7 +499,7 @@ function useAppUpdateDialogLogging() {
|
|
|
442
499
|
});
|
|
443
500
|
};
|
|
444
501
|
const logDialogShow = () => {
|
|
445
|
-
|
|
502
|
+
import_native_modules6.INTERNAL__module.tossCoreEventLog({
|
|
446
503
|
log_name: UPDATE_DIALOG_LOG_NAME,
|
|
447
504
|
log_type: "popup",
|
|
448
505
|
params: {
|
|
@@ -462,34 +519,26 @@ function ensureValue(value, name) {
|
|
|
462
519
|
return value;
|
|
463
520
|
}
|
|
464
521
|
|
|
465
|
-
// src/core/utils/getAppsInTossGlobals.ts
|
|
466
|
-
function getAppsInTossGlobals() {
|
|
467
|
-
if (global.__appsInToss == null) {
|
|
468
|
-
throw new Error("invalid apps-in-toss globals");
|
|
469
|
-
}
|
|
470
|
-
return global.__appsInToss;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
522
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
474
|
-
var
|
|
523
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
475
524
|
var APP_BRIDGE_METHOD_NAME = "getMiniAppsSupportContact";
|
|
476
525
|
function useMoreButtonBottomSheet() {
|
|
477
526
|
const globals = getAppsInTossGlobals();
|
|
478
527
|
const adaptive = (0, import_private.useAdaptive)();
|
|
479
|
-
const [itemList, setItemList] = (0,
|
|
528
|
+
const [itemList, setItemList] = (0, import_react8.useState)([]);
|
|
480
529
|
const appUpdateDialog = useAppUpdateDialog();
|
|
481
530
|
const logging = useMoreButtonBottomSheetLogging();
|
|
482
531
|
const overlay = (0, import_private.useOverlay)();
|
|
483
532
|
const title = ensureValue(globals.brandDisplayName, "displayName");
|
|
484
|
-
const isSupported = (0,
|
|
533
|
+
const isSupported = (0, import_native_modules7.isMinVersionSupported)({
|
|
485
534
|
android: "5.226.0",
|
|
486
535
|
ios: "5.226.0"
|
|
487
536
|
});
|
|
488
|
-
(0,
|
|
537
|
+
(0, import_react8.useEffect)(() => {
|
|
489
538
|
if (!isSupported) {
|
|
490
539
|
return;
|
|
491
540
|
}
|
|
492
|
-
|
|
541
|
+
import_native_modules7.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
493
542
|
APP_BRIDGE_METHOD_NAME,
|
|
494
543
|
{},
|
|
495
544
|
{
|
|
@@ -512,18 +561,18 @@ function useMoreButtonBottomSheet() {
|
|
|
512
561
|
logging.close();
|
|
513
562
|
close();
|
|
514
563
|
};
|
|
515
|
-
return /* @__PURE__ */ (0,
|
|
516
|
-
|
|
564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(BottomSheetImpressionArea, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
565
|
+
import_react_native13.BottomSheet.Root,
|
|
517
566
|
{
|
|
518
|
-
header: /* @__PURE__ */ (0,
|
|
519
|
-
|
|
567
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
568
|
+
import_react_native13.ListHeader,
|
|
520
569
|
{
|
|
521
|
-
title: /* @__PURE__ */ (0,
|
|
570
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native13.ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
|
|
522
571
|
}
|
|
523
572
|
),
|
|
524
573
|
open: isOpen,
|
|
525
|
-
cta: /* @__PURE__ */ (0,
|
|
526
|
-
|
|
574
|
+
cta: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
575
|
+
import_react_native13.BottomSheet.CTA,
|
|
527
576
|
{
|
|
528
577
|
size: "large",
|
|
529
578
|
type: "dark",
|
|
@@ -536,20 +585,20 @@ function useMoreButtonBottomSheet() {
|
|
|
536
585
|
),
|
|
537
586
|
onClose: handleClose,
|
|
538
587
|
onExited: exit,
|
|
539
|
-
children: /* @__PURE__ */ (0,
|
|
540
|
-
return /* @__PURE__ */ (0,
|
|
541
|
-
|
|
588
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native13.List, { rowSeparator: "none", children: itemList.map((item) => {
|
|
589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
590
|
+
import_react_native13.ListRow,
|
|
542
591
|
{
|
|
543
|
-
left: /* @__PURE__ */ (0,
|
|
544
|
-
|
|
592
|
+
left: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
593
|
+
import_react_native13.ListRow.Icon,
|
|
545
594
|
{
|
|
546
595
|
color: globals.brandPrimaryColor,
|
|
547
596
|
source: { uri: item.contactIconUrl },
|
|
548
597
|
type: "background"
|
|
549
598
|
}
|
|
550
599
|
),
|
|
551
|
-
contents: /* @__PURE__ */ (0,
|
|
552
|
-
|
|
600
|
+
contents: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
601
|
+
import_react_native13.ListRow.Texts,
|
|
553
602
|
{
|
|
554
603
|
type: "1RowTypeA",
|
|
555
604
|
top: item.contactItemName,
|
|
@@ -559,7 +608,7 @@ function useMoreButtonBottomSheet() {
|
|
|
559
608
|
verticalPadding: "extraSmall",
|
|
560
609
|
onPress: () => {
|
|
561
610
|
logging.menuClick({ title: item.contactItemName });
|
|
562
|
-
(0,
|
|
611
|
+
(0, import_react_native12.openURL)(item.contactUri);
|
|
563
612
|
}
|
|
564
613
|
},
|
|
565
614
|
item.contactItemName
|
|
@@ -573,10 +622,10 @@ function useMoreButtonBottomSheet() {
|
|
|
573
622
|
}
|
|
574
623
|
function BottomSheetImpressionArea({ children }) {
|
|
575
624
|
const logging = useMoreButtonBottomSheetLogging();
|
|
576
|
-
(0,
|
|
625
|
+
(0, import_react8.useEffect)(() => {
|
|
577
626
|
logging.show();
|
|
578
627
|
}, [logging]);
|
|
579
|
-
return /* @__PURE__ */ (0,
|
|
628
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children });
|
|
580
629
|
}
|
|
581
630
|
|
|
582
631
|
// src/core/utils/safeParseNavigationBar.ts
|
|
@@ -591,48 +640,26 @@ function safeParseNavigationBar(navigationBar) {
|
|
|
591
640
|
}
|
|
592
641
|
}
|
|
593
642
|
|
|
594
|
-
// src/
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
// src/core/components/BuiltinNavigationBar/index.tsx
|
|
600
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
601
|
-
function BuiltinNavigationBar() {
|
|
643
|
+
// src/components/NavigationBar/RNNavigationBar.tsx
|
|
644
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
645
|
+
function RNNavigationBar() {
|
|
602
646
|
const globals = getAppsInTossGlobals();
|
|
603
647
|
const { captureExitLog } = useCaptureExitLog();
|
|
604
|
-
const logging =
|
|
605
|
-
const { openConfirm } = (0,
|
|
648
|
+
const logging = useNavigationBarLogging();
|
|
649
|
+
const { openConfirm } = (0, import_react_native15.useDialog)();
|
|
606
650
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
607
651
|
const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
|
|
608
652
|
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
609
653
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
610
654
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
611
|
-
const
|
|
612
|
-
const isGameWebView = globals.webViewType === "game";
|
|
613
|
-
const backEventContext = (0, import_react_native13.useBackEventContext)();
|
|
655
|
+
const backEventContext = (0, import_react_native14.useBackEventContext)();
|
|
614
656
|
const handleBackOrClose = useBackOrCloseNavigation();
|
|
615
|
-
const navigation = (0,
|
|
616
|
-
const handlePressTitle = (0,
|
|
657
|
+
const navigation = (0, import_react_native14.useNavigation)();
|
|
658
|
+
const handlePressTitle = (0, import_react9.useCallback)(() => {
|
|
617
659
|
logging.homeButtonClick();
|
|
618
|
-
if (globals.webViewType != null) {
|
|
619
|
-
import_native_modules7.appsInTossEvent.emit("homeIconButtonClickEvent", void 0);
|
|
620
|
-
return;
|
|
621
|
-
}
|
|
622
660
|
navigation.navigate("/");
|
|
623
|
-
}, [logging,
|
|
624
|
-
const
|
|
625
|
-
if (globals.webViewType != null) {
|
|
626
|
-
import_native_modules7.appsInTossEvent.emit("backButtonClickEvent", void 0);
|
|
627
|
-
return;
|
|
628
|
-
}
|
|
629
|
-
if (backEventContext.hasBackEvent) {
|
|
630
|
-
backEventContext.onBack();
|
|
631
|
-
return;
|
|
632
|
-
}
|
|
633
|
-
handleBackOrClose();
|
|
634
|
-
}, [globals.webViewType, backEventContext, handleBackOrClose]);
|
|
635
|
-
const handleClose = (0, import_react7.useCallback)(async () => {
|
|
661
|
+
}, [logging, navigation]);
|
|
662
|
+
const handleClose = (0, import_react9.useCallback)(async () => {
|
|
636
663
|
logging.closeButtonClick();
|
|
637
664
|
const isConfirmed = await openConfirm({
|
|
638
665
|
title: `${(0, import_es_hangul.josa)(globals.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
@@ -644,29 +671,33 @@ function BuiltinNavigationBar() {
|
|
|
644
671
|
logging.closePopupCtaClick(isConfirmed);
|
|
645
672
|
if (isConfirmed) {
|
|
646
673
|
captureExitLog(Date.now());
|
|
647
|
-
(0,
|
|
674
|
+
(0, import_react_native14.closeView)();
|
|
648
675
|
}
|
|
649
676
|
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
650
|
-
const
|
|
677
|
+
const handleBack = (0, import_react9.useCallback)(() => {
|
|
678
|
+
if (backEventContext.hasBackEvent) {
|
|
679
|
+
backEventContext.onBack();
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
handleBackOrClose();
|
|
683
|
+
}, [backEventContext, handleBackOrClose]);
|
|
684
|
+
const handleAndroidBackEvent = (0, import_react9.useCallback)(() => {
|
|
651
685
|
handleBack();
|
|
652
686
|
return true;
|
|
653
687
|
}, [handleBack]);
|
|
654
|
-
(0,
|
|
655
|
-
|
|
688
|
+
(0, import_react9.useEffect)(() => {
|
|
689
|
+
import_react_native16.BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
656
690
|
return () => {
|
|
657
|
-
|
|
691
|
+
import_react_native16.BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
658
692
|
};
|
|
659
|
-
}, [
|
|
660
|
-
|
|
661
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {});
|
|
662
|
-
}
|
|
663
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(BuiltinNavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
693
|
+
}, [handleAndroidBackEvent]);
|
|
694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
664
695
|
import_private2.TopNavigation,
|
|
665
696
|
{
|
|
666
697
|
title: globals.brandDisplayName,
|
|
667
698
|
icon: toIcon(globals.brandIcon),
|
|
668
699
|
onPressDots: openMoreButtonBottomSheet,
|
|
669
|
-
contentVisible:
|
|
700
|
+
contentVisible: true,
|
|
670
701
|
onPressTitle: withHomeButton ? handlePressTitle : void 0,
|
|
671
702
|
onPressClose: handleClose,
|
|
672
703
|
withHome: withHomeButton,
|
|
@@ -675,96 +706,59 @@ function BuiltinNavigationBar() {
|
|
|
675
706
|
icon: initialAccessoryButton.icon,
|
|
676
707
|
id: initialAccessoryButton.id
|
|
677
708
|
} : void 0,
|
|
678
|
-
children:
|
|
709
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_private2.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_private2.NavigationBackButton, { onPress: handleBack, canGoBack: false }) })
|
|
679
710
|
}
|
|
680
711
|
) });
|
|
681
712
|
}
|
|
682
713
|
function useBackOrCloseNavigation() {
|
|
683
|
-
const navigation = (0,
|
|
714
|
+
const navigation = (0, import_react_native14.useNavigation)();
|
|
684
715
|
const { captureExitLog } = useCaptureExitLog();
|
|
685
|
-
return (0,
|
|
716
|
+
return (0, import_react9.useCallback)(() => {
|
|
686
717
|
if (navigation.canGoBack()) {
|
|
687
718
|
navigation.goBack();
|
|
688
719
|
} else {
|
|
689
720
|
captureExitLog(Date.now());
|
|
690
|
-
(0,
|
|
721
|
+
(0, import_react_native14.closeView)();
|
|
691
722
|
}
|
|
692
|
-
}, [navigation]);
|
|
693
|
-
}
|
|
694
|
-
function BuiltinNavigationBarImpressionArea({
|
|
695
|
-
children,
|
|
696
|
-
withHomeButton
|
|
697
|
-
}) {
|
|
698
|
-
const hasLogged = (0, import_react7.useRef)(false);
|
|
699
|
-
const logging = useBuiltinNavigationBarLogging();
|
|
700
|
-
(0, import_react7.useEffect)(() => {
|
|
701
|
-
if (hasLogged.current === false) {
|
|
702
|
-
logging.navBarImpression({ home_icon_yn: withHomeButton ? "Y" : "N" });
|
|
703
|
-
hasLogged.current = true;
|
|
704
|
-
}
|
|
705
|
-
}, []);
|
|
706
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children });
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
// src/core/hooks/useAppsInTossBridge.ts
|
|
710
|
-
var import_native_modules8 = require("@apps-in-toss/native-modules");
|
|
711
|
-
var import_react_native16 = require("@toss-design-system/react-native");
|
|
712
|
-
var import_react8 = require("react");
|
|
713
|
-
function useAppsInTossBridge() {
|
|
714
|
-
const controller = (0, import_react_native16.useBridge)();
|
|
715
|
-
const appsInTossGlobals = getAppsInTossGlobals();
|
|
716
|
-
(0, import_react8.useEffect)(() => {
|
|
717
|
-
const commonProps = {
|
|
718
|
-
serviceName: appsInTossGlobals.brandDisplayName,
|
|
719
|
-
icon: toIcon(appsInTossGlobals.brandIcon),
|
|
720
|
-
color: appsInTossGlobals.brandPrimaryColor,
|
|
721
|
-
colorMode: appsInTossGlobals.brandBridgeColorMode
|
|
722
|
-
};
|
|
723
|
-
controller.open({
|
|
724
|
-
...commonProps,
|
|
725
|
-
onExited: () => {
|
|
726
|
-
import_native_modules8.appsInTossEvent.emit("entryMessageExited", void 0);
|
|
727
|
-
}
|
|
728
|
-
});
|
|
729
|
-
}, []);
|
|
723
|
+
}, [captureExitLog, navigation]);
|
|
730
724
|
}
|
|
731
725
|
|
|
732
726
|
// src/core/registerApp.tsx
|
|
733
|
-
var
|
|
727
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
734
728
|
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
735
|
-
if (!(0,
|
|
729
|
+
if (!(0, import_native_modules8.isMinVersionSupported)({
|
|
736
730
|
android: "5.220.0",
|
|
737
731
|
ios: "5.221.0"
|
|
738
732
|
})) {
|
|
739
|
-
return /* @__PURE__ */ (0,
|
|
740
|
-
/* @__PURE__ */ (0,
|
|
741
|
-
/* @__PURE__ */ (0,
|
|
742
|
-
/* @__PURE__ */ (0,
|
|
733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
734
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppEvent.Entry, {}),
|
|
735
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppEvent.System, { ...initialProps }),
|
|
736
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppUpdate, {})
|
|
743
737
|
] });
|
|
744
738
|
}
|
|
745
|
-
return /* @__PURE__ */ (0,
|
|
746
|
-
/* @__PURE__ */ (0,
|
|
747
|
-
/* @__PURE__ */ (0,
|
|
748
|
-
/* @__PURE__ */ (0,
|
|
749
|
-
/* @__PURE__ */ (0,
|
|
739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
740
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppEvent.StayTime, {}),
|
|
741
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppEvent.Entry, {}),
|
|
742
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(AppEvent.System, { ...initialProps }),
|
|
743
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native18.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TDSContainer, { ...initialProps, children }) }) })
|
|
750
744
|
] });
|
|
751
745
|
}
|
|
752
746
|
function TDSContainer({ children }) {
|
|
753
747
|
useAppsInTossBridge();
|
|
754
|
-
return /* @__PURE__ */ (0,
|
|
748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children });
|
|
755
749
|
}
|
|
756
750
|
function registerApp(container, { context, analytics }) {
|
|
757
751
|
const appName = getAppName();
|
|
758
752
|
const isRegistered = import_react_native19.AppRegistry.getAppKeys().includes(appName);
|
|
759
753
|
if (!isRegistered) {
|
|
760
754
|
import_analytics.Analytics.init({
|
|
761
|
-
logger: (params) => void (0,
|
|
755
|
+
logger: (params) => void (0, import_native_modules8.eventLog)(params),
|
|
762
756
|
debug: analytics?.debug ?? __DEV__
|
|
763
757
|
});
|
|
764
758
|
const App = import_react_native17.Granite.registerApp(AppsInTossContainer.bind(null, container), {
|
|
765
759
|
appName,
|
|
766
760
|
context,
|
|
767
|
-
setIosSwipeGestureEnabled:
|
|
761
|
+
setIosSwipeGestureEnabled: import_native_modules8.setIosSwipeGestureEnabled,
|
|
768
762
|
router: {
|
|
769
763
|
screenContainer: AppsInTossScreenContainer,
|
|
770
764
|
defaultScreenOption: {
|
|
@@ -777,8 +771,9 @@ function registerApp(container, { context, analytics }) {
|
|
|
777
771
|
return global.Page;
|
|
778
772
|
}
|
|
779
773
|
function AppsInTossScreenContainer({ children }) {
|
|
780
|
-
|
|
781
|
-
|
|
774
|
+
const isRN = getAppsInTossGlobals().webViewType == null;
|
|
775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_analytics.Analytics.Screen, { children: [
|
|
776
|
+
isRN && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RNNavigationBar, {}),
|
|
782
777
|
children
|
|
783
778
|
] });
|
|
784
779
|
}
|
|
@@ -801,25 +796,24 @@ var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
|
801
796
|
var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async-bridges"), 1);
|
|
802
797
|
var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
|
|
803
798
|
var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event-bridges"), 1);
|
|
804
|
-
var
|
|
799
|
+
var import_react_native36 = require("@granite-js/react-native");
|
|
805
800
|
var graniteAsyncBridges = __toESM(require("@granite-js/react-native/async-bridges"), 1);
|
|
806
801
|
var graniteConstantBridges = __toESM(require("@granite-js/react-native/constant-bridges"), 1);
|
|
807
|
-
var
|
|
808
|
-
var
|
|
809
|
-
var
|
|
810
|
-
var
|
|
811
|
-
var import_react_native32 = require("react-native");
|
|
802
|
+
var import_react_native37 = require("@toss-design-system/react-native");
|
|
803
|
+
var import_private7 = require("@toss-design-system/react-native/private");
|
|
804
|
+
var import_react19 = require("react");
|
|
805
|
+
var import_react_native38 = require("react-native");
|
|
812
806
|
|
|
813
807
|
// src/components/GameWebView.tsx
|
|
814
|
-
var
|
|
808
|
+
var import_native_modules12 = require("@apps-in-toss/native-modules");
|
|
815
809
|
var import_react_native_webview = require("@granite-js/native/react-native-webview");
|
|
816
|
-
var
|
|
817
|
-
var
|
|
810
|
+
var import_react13 = require("react");
|
|
811
|
+
var import_react_native29 = require("react-native");
|
|
818
812
|
|
|
819
813
|
// src/components/GameProfile.tsx
|
|
820
|
-
var
|
|
814
|
+
var import_native_modules11 = require("@apps-in-toss/native-modules");
|
|
821
815
|
var import_react_native24 = require("@toss-design-system/react-native");
|
|
822
|
-
var
|
|
816
|
+
var import_react11 = require("react");
|
|
823
817
|
var import_react_native25 = require("react-native");
|
|
824
818
|
|
|
825
819
|
// src/constant/game-center.ts
|
|
@@ -830,22 +824,22 @@ var GAME_CENTER_MIN_VERSION = {
|
|
|
830
824
|
};
|
|
831
825
|
|
|
832
826
|
// src/hooks/useGameCenterProfile.ts
|
|
833
|
-
var
|
|
827
|
+
var import_native_modules10 = require("@apps-in-toss/native-modules");
|
|
834
828
|
var import_react_native22 = require("@granite-js/react-native");
|
|
835
829
|
var import_react_native23 = require("@toss-design-system/react-native");
|
|
836
830
|
var import_es_hangul2 = require("es-hangul");
|
|
837
|
-
var
|
|
831
|
+
var import_react10 = require("react");
|
|
838
832
|
|
|
839
833
|
// src/components/GameProfileToast.tsx
|
|
840
834
|
var import_react_native20 = require("@toss-design-system/react-native");
|
|
841
835
|
var import_private3 = require("@toss-design-system/react-native/private");
|
|
842
|
-
var
|
|
836
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
843
837
|
var useGameProfileToast = () => {
|
|
844
838
|
const overlay = (0, import_private3.useOverlay)();
|
|
845
839
|
const openGameProfileToast = (nickname, profileImageUri) => {
|
|
846
840
|
return new Promise((resolve) => {
|
|
847
841
|
overlay.open(({ isOpen, close, exit }) => {
|
|
848
|
-
return /* @__PURE__ */ (0,
|
|
842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_private3.ColorPreferenceProvider, { colorPreference: "dark", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_private3.AdaptiveColorProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
849
843
|
import_react_native20.Toast,
|
|
850
844
|
{
|
|
851
845
|
open: isOpen,
|
|
@@ -856,7 +850,7 @@ var useGameProfileToast = () => {
|
|
|
856
850
|
onExited: exit,
|
|
857
851
|
position: "top",
|
|
858
852
|
text: `${nickname}\uB2D8 \uBC18\uAC00\uC6CC\uC694!`,
|
|
859
|
-
icon: /* @__PURE__ */ (0,
|
|
853
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
860
854
|
import_react_native20.Asset.Image,
|
|
861
855
|
{
|
|
862
856
|
style: { borderRadius: 64, overflow: "hidden" },
|
|
@@ -882,8 +876,8 @@ var DEFAULT_ERROR = {
|
|
|
882
876
|
var import_react_native21 = require("@granite-js/react-native");
|
|
883
877
|
|
|
884
878
|
// src/private.ts
|
|
885
|
-
var
|
|
886
|
-
var INTERNAL__onVisibilityChangedByTransparentServiceWeb =
|
|
879
|
+
var import_native_modules9 = require("@apps-in-toss/native-modules");
|
|
880
|
+
var INTERNAL__onVisibilityChangedByTransparentServiceWeb = import_native_modules9.onVisibilityChangedByTransparentServiceWeb;
|
|
887
881
|
|
|
888
882
|
// src/utils/openTransparentWebView.ts
|
|
889
883
|
var openTransparentWebView = ({
|
|
@@ -918,24 +912,24 @@ var openTransparentWebView = ({
|
|
|
918
912
|
|
|
919
913
|
// src/hooks/useGameCenterProfile.ts
|
|
920
914
|
var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
921
|
-
const [profileData, setProfileData] = (0,
|
|
922
|
-
const [isProfileDataLoading, setIsProfileDataLoading] = (0,
|
|
923
|
-
const [isProfileDataRefetching, setIsProfileDataRefetching] = (0,
|
|
915
|
+
const [profileData, setProfileData] = (0, import_react10.useState)(void 0);
|
|
916
|
+
const [isProfileDataLoading, setIsProfileDataLoading] = (0, import_react10.useState)(true);
|
|
917
|
+
const [isProfileDataRefetching, setIsProfileDataRefetching] = (0, import_react10.useState)(false);
|
|
924
918
|
const shouldShowLoadingOverlay = isProfileDataLoading && isReadyForProfileUI;
|
|
925
919
|
const shouldShowProfileNotFoundOverlay = profileData?.statusCode === "PROFILE_NOT_FOUND" && isReadyForProfileUI && !isProfileDataRefetching;
|
|
926
920
|
const canShowBottomSheetOrToast = !isProfileDataLoading && isReadyForProfileUI;
|
|
927
|
-
const [isWebviewLoading, setIsWebviewLoading] = (0,
|
|
928
|
-
const isCompletedProfileFlow = (0,
|
|
921
|
+
const [isWebviewLoading, setIsWebviewLoading] = (0, import_react10.useState)(false);
|
|
922
|
+
const isCompletedProfileFlow = (0, import_react10.useRef)(false);
|
|
929
923
|
const { openAlert, openConfirm } = (0, import_react_native23.useDialog)();
|
|
930
924
|
const { openGameProfileToast } = useGameProfileToast();
|
|
931
|
-
const openErrorAlert = (0,
|
|
925
|
+
const openErrorAlert = (0, import_react10.useCallback)(async () => {
|
|
932
926
|
await openAlert({
|
|
933
927
|
title: DEFAULT_ERROR.title,
|
|
934
928
|
description: DEFAULT_ERROR.description
|
|
935
929
|
});
|
|
936
930
|
(0, import_react_native22.closeView)();
|
|
937
931
|
}, [openAlert]);
|
|
938
|
-
const openProfileWebview = (0,
|
|
932
|
+
const openProfileWebview = (0, import_react10.useCallback)(() => {
|
|
939
933
|
if (isWebviewLoading) {
|
|
940
934
|
return;
|
|
941
935
|
}
|
|
@@ -947,7 +941,7 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
947
941
|
try {
|
|
948
942
|
setIsWebviewLoading(false);
|
|
949
943
|
setIsProfileDataRefetching(true);
|
|
950
|
-
const data = await (0,
|
|
944
|
+
const data = await (0, import_native_modules10.getGameCenterGameProfile)();
|
|
951
945
|
setProfileData(data);
|
|
952
946
|
setIsProfileDataRefetching(false);
|
|
953
947
|
if (data?.statusCode === "SUCCESS") {
|
|
@@ -964,7 +958,7 @@ var useGameCenterProfile = (isReadyForProfileUI) => {
|
|
|
964
958
|
}
|
|
965
959
|
});
|
|
966
960
|
}, [isWebviewLoading, openGameProfileToast, openErrorAlert]);
|
|
967
|
-
const updateAppToSupportedMinVersion = (0,
|
|
961
|
+
const updateAppToSupportedMinVersion = (0, import_react10.useCallback)(async () => {
|
|
968
962
|
const upddateConfirmDialogLabel = {
|
|
969
963
|
title: `${(0, import_es_hangul2.josa)(getAppsInTossGlobals().brandDisplayName, "\uC744/\uB97C")} \uD558\uB824\uBA74
|
|
970
964
|
\uC571\uC744 \uC5C5\uB370\uC774\uD2B8\uD574\uC8FC\uC138\uC694`,
|
|
@@ -1011,7 +1005,7 @@ var Z_INDEX = {
|
|
|
1011
1005
|
};
|
|
1012
1006
|
|
|
1013
1007
|
// src/components/GameProfile.tsx
|
|
1014
|
-
var
|
|
1008
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1015
1009
|
var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
1016
1010
|
const {
|
|
1017
1011
|
profileData,
|
|
@@ -1027,10 +1021,10 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1027
1021
|
openErrorAlert,
|
|
1028
1022
|
openGameProfileToast
|
|
1029
1023
|
} = useGameCenterProfile(isReadyForProfileUI);
|
|
1030
|
-
(0,
|
|
1024
|
+
(0, import_react11.useEffect)(() => {
|
|
1031
1025
|
try {
|
|
1032
1026
|
const getProfileData = async () => {
|
|
1033
|
-
const data = await (0,
|
|
1027
|
+
const data = await (0, import_native_modules11.getGameCenterGameProfile)();
|
|
1034
1028
|
setProfileData(data);
|
|
1035
1029
|
setIsProfileDataLoading(false);
|
|
1036
1030
|
};
|
|
@@ -1040,7 +1034,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1040
1034
|
setIsProfileDataLoading(false);
|
|
1041
1035
|
}
|
|
1042
1036
|
}, []);
|
|
1043
|
-
(0,
|
|
1037
|
+
(0, import_react11.useEffect)(() => {
|
|
1044
1038
|
const handleGameProfileFlow = async () => {
|
|
1045
1039
|
if (!canShowBottomSheetOrToast) {
|
|
1046
1040
|
return;
|
|
@@ -1049,7 +1043,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1049
1043
|
return;
|
|
1050
1044
|
}
|
|
1051
1045
|
isCompletedProfileFlow.current = true;
|
|
1052
|
-
if (!(0,
|
|
1046
|
+
if (!(0, import_native_modules11.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
|
|
1053
1047
|
updateAppToSupportedMinVersion();
|
|
1054
1048
|
return;
|
|
1055
1049
|
}
|
|
@@ -1070,10 +1064,10 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1070
1064
|
profileData,
|
|
1071
1065
|
updateAppToSupportedMinVersion
|
|
1072
1066
|
]);
|
|
1073
|
-
if (!(0,
|
|
1074
|
-
return /* @__PURE__ */ (0,
|
|
1075
|
-
/* @__PURE__ */ (0,
|
|
1076
|
-
/* @__PURE__ */ (0,
|
|
1067
|
+
if (!(0, import_native_modules11.isMinVersionSupported)(GAME_CENTER_MIN_VERSION)) {
|
|
1068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1069
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native25.View, { style: { flex: 1, position: "relative" }, children }),
|
|
1070
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1077
1071
|
import_react_native25.Pressable,
|
|
1078
1072
|
{
|
|
1079
1073
|
style: {
|
|
@@ -1087,9 +1081,9 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1087
1081
|
] });
|
|
1088
1082
|
}
|
|
1089
1083
|
if (shouldShowLoadingOverlay || isProfileDataRefetching) {
|
|
1090
|
-
return /* @__PURE__ */ (0,
|
|
1091
|
-
/* @__PURE__ */ (0,
|
|
1092
|
-
/* @__PURE__ */ (0,
|
|
1084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1085
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native25.View, { style: { flex: 1, position: "relative" }, children }),
|
|
1086
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1093
1087
|
import_react_native25.View,
|
|
1094
1088
|
{
|
|
1095
1089
|
style: {
|
|
@@ -1098,15 +1092,15 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1098
1092
|
alignItems: "center",
|
|
1099
1093
|
backgroundColor: "rgba(0, 0, 0, 0.2)"
|
|
1100
1094
|
},
|
|
1101
|
-
children: /* @__PURE__ */ (0,
|
|
1095
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native24.Loader, { size: "large", type: "light" })
|
|
1102
1096
|
}
|
|
1103
1097
|
)
|
|
1104
1098
|
] });
|
|
1105
1099
|
}
|
|
1106
1100
|
if (shouldShowProfileNotFoundOverlay) {
|
|
1107
|
-
return /* @__PURE__ */ (0,
|
|
1108
|
-
/* @__PURE__ */ (0,
|
|
1109
|
-
shouldShowProfileNotFoundOverlay && /* @__PURE__ */ (0,
|
|
1101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native25.View, { style: { flex: 1, position: "relative" }, children }),
|
|
1103
|
+
shouldShowProfileNotFoundOverlay && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1110
1104
|
import_react_native25.Pressable,
|
|
1111
1105
|
{
|
|
1112
1106
|
style: {
|
|
@@ -1119,7 +1113,7 @@ var GameProfile = ({ children, isReadyForProfileUI }) => {
|
|
|
1119
1113
|
)
|
|
1120
1114
|
] });
|
|
1121
1115
|
}
|
|
1122
|
-
return /* @__PURE__ */ (0,
|
|
1116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native25.View, { style: { flex: 1, position: "relative" }, children }) });
|
|
1123
1117
|
};
|
|
1124
1118
|
var overlayStyle = {
|
|
1125
1119
|
position: "absolute",
|
|
@@ -1130,32 +1124,159 @@ var overlayStyle = {
|
|
|
1130
1124
|
zIndex: Z_INDEX.PROFILE_OVERLAY
|
|
1131
1125
|
};
|
|
1132
1126
|
|
|
1127
|
+
// src/components/NavigationBar/GameWebviewNavigationBar.tsx
|
|
1128
|
+
var import_react_native26 = require("@granite-js/react-native");
|
|
1129
|
+
var import_react_native27 = require("@toss-design-system/react-native");
|
|
1130
|
+
var import_private5 = require("@toss-design-system/react-native/private");
|
|
1131
|
+
var import_es_hangul3 = require("es-hangul");
|
|
1132
|
+
var import_react12 = require("react");
|
|
1133
|
+
var import_react_native28 = require("react-native");
|
|
1134
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1135
|
+
function GameWebviewNavigationBar() {
|
|
1136
|
+
const safeAreaTop = (0, import_private5.useSafeAreaTop)();
|
|
1137
|
+
const { openConfirm } = (0, import_react_native27.useDialog)();
|
|
1138
|
+
const { captureExitLog } = useCaptureExitLog();
|
|
1139
|
+
const global2 = getAppsInTossGlobals();
|
|
1140
|
+
const logging = useNavigationBarLogging();
|
|
1141
|
+
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1142
|
+
const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
|
|
1143
|
+
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
1144
|
+
const handleGameWebviewClose = (0, import_react12.useCallback)(async () => {
|
|
1145
|
+
const isConfirmed = await openConfirm({
|
|
1146
|
+
title: `${(0, import_es_hangul3.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
1147
|
+
leftButton: "\uCDE8\uC18C",
|
|
1148
|
+
rightButton: "\uC885\uB8CC\uD558\uAE30",
|
|
1149
|
+
closeOnDimmerClick: true,
|
|
1150
|
+
onEntered: logging.closePopupShow
|
|
1151
|
+
});
|
|
1152
|
+
logging.closePopupCtaClick(isConfirmed);
|
|
1153
|
+
if (isConfirmed) {
|
|
1154
|
+
captureExitLog(Date.now());
|
|
1155
|
+
(0, import_react_native26.closeView)();
|
|
1156
|
+
}
|
|
1157
|
+
}, [captureExitLog, global2.brandDisplayName, logging, openConfirm]);
|
|
1158
|
+
const handleAndroidBackEvent = (0, import_react12.useCallback)(() => {
|
|
1159
|
+
handleGameWebviewClose();
|
|
1160
|
+
return true;
|
|
1161
|
+
}, [handleGameWebviewClose]);
|
|
1162
|
+
(0, import_react12.useEffect)(() => {
|
|
1163
|
+
import_react_native28.BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
1164
|
+
return () => import_react_native28.BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
1165
|
+
}, [handleAndroidBackEvent]);
|
|
1166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1167
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native27.PageNavbar, { preference: { type: "none" } }),
|
|
1168
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1169
|
+
import_react_native28.View,
|
|
1170
|
+
{
|
|
1171
|
+
style: {
|
|
1172
|
+
width: "100%",
|
|
1173
|
+
height: import_react_native28.Platform.OS === "ios" ? 44 : 54,
|
|
1174
|
+
flexDirection: "row",
|
|
1175
|
+
alignItems: "center",
|
|
1176
|
+
justifyContent: "flex-end",
|
|
1177
|
+
position: "absolute",
|
|
1178
|
+
zIndex: Z_INDEX.CLOSE_BUTTON,
|
|
1179
|
+
marginTop: safeAreaTop,
|
|
1180
|
+
paddingRight: 10
|
|
1181
|
+
},
|
|
1182
|
+
pointerEvents: "box-none",
|
|
1183
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1184
|
+
import_private5.NavigationRightContent,
|
|
1185
|
+
{
|
|
1186
|
+
fixedRightButton: initialAccessoryButton,
|
|
1187
|
+
onPressDots: openMoreButtonBottomSheet,
|
|
1188
|
+
onPressClose: handleGameWebviewClose,
|
|
1189
|
+
theme: "dark"
|
|
1190
|
+
}
|
|
1191
|
+
)
|
|
1192
|
+
}
|
|
1193
|
+
)
|
|
1194
|
+
] });
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1133
1197
|
// src/components/GameWebView.tsx
|
|
1134
|
-
var
|
|
1135
|
-
var GameWebView = (0,
|
|
1136
|
-
const [isEntryMessageExited, setIsEntryMessageExited] = (0,
|
|
1137
|
-
(0,
|
|
1138
|
-
if (
|
|
1139
|
-
(0,
|
|
1198
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1199
|
+
var GameWebView = (0, import_react13.forwardRef)(function GameWebView2(props, ref) {
|
|
1200
|
+
const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react13.useState)(false);
|
|
1201
|
+
(0, import_react13.useEffect)(() => {
|
|
1202
|
+
if (import_react_native29.Platform.OS === "ios") {
|
|
1203
|
+
(0, import_native_modules12.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1140
1204
|
return () => {
|
|
1141
|
-
(0,
|
|
1205
|
+
(0, import_native_modules12.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1142
1206
|
};
|
|
1143
1207
|
}
|
|
1144
1208
|
return;
|
|
1145
1209
|
}, []);
|
|
1146
|
-
(0,
|
|
1147
|
-
|
|
1210
|
+
(0, import_react13.useEffect)(() => {
|
|
1211
|
+
import_native_modules12.appsInTossEvent.addEventListener("entryMessageExited", {
|
|
1148
1212
|
onEvent: () => {
|
|
1149
1213
|
setIsEntryMessageExited(true);
|
|
1150
1214
|
}
|
|
1151
1215
|
});
|
|
1152
1216
|
}, []);
|
|
1153
|
-
return /* @__PURE__ */ (0,
|
|
1217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1218
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GameWebviewNavigationBar, {}),
|
|
1219
|
+
(0, import_native_modules12.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(GameProfile, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native_webview.WebView, { ref, ...props }) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native_webview.WebView, { ref, ...props })
|
|
1220
|
+
] });
|
|
1154
1221
|
});
|
|
1155
1222
|
|
|
1156
1223
|
// src/components/PartnerWebView.tsx
|
|
1224
|
+
var import_native_modules14 = require("@apps-in-toss/native-modules");
|
|
1157
1225
|
var import_react_native_webview2 = require("@granite-js/native/react-native-webview");
|
|
1158
|
-
var
|
|
1226
|
+
var import_react16 = require("react");
|
|
1227
|
+
var import_react_native33 = require("react-native");
|
|
1228
|
+
|
|
1229
|
+
// src/components/NavigationBar/PartnerWebviewNavigationBar.tsx
|
|
1230
|
+
var import_react_native30 = require("@granite-js/react-native");
|
|
1231
|
+
var import_react_native31 = require("@toss-design-system/react-native");
|
|
1232
|
+
var import_private6 = require("@toss-design-system/react-native/private");
|
|
1233
|
+
var import_es_hangul4 = require("es-hangul");
|
|
1234
|
+
var import_react14 = require("react");
|
|
1235
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1236
|
+
function PartnerWebviewNavigationBar({ handleBackEvent, handleHomeIconButtonClick }) {
|
|
1237
|
+
const globals = getAppsInTossGlobals();
|
|
1238
|
+
const { captureExitLog } = useCaptureExitLog();
|
|
1239
|
+
const logging = useNavigationBarLogging();
|
|
1240
|
+
const { openConfirm } = (0, import_react_native31.useDialog)();
|
|
1241
|
+
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1242
|
+
const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
|
|
1243
|
+
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
1244
|
+
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
1245
|
+
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
1246
|
+
const handlePressTitle = (0, import_react14.useCallback)(() => {
|
|
1247
|
+
logging.homeButtonClick();
|
|
1248
|
+
handleHomeIconButtonClick();
|
|
1249
|
+
}, [handleHomeIconButtonClick, logging]);
|
|
1250
|
+
const handleClose = (0, import_react14.useCallback)(async () => {
|
|
1251
|
+
logging.closeButtonClick();
|
|
1252
|
+
const isConfirmed = await openConfirm({
|
|
1253
|
+
title: `${(0, import_es_hangul4.josa)(globals.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
1254
|
+
leftButton: "\uCDE8\uC18C",
|
|
1255
|
+
rightButton: "\uC885\uB8CC\uD558\uAE30",
|
|
1256
|
+
closeOnDimmerClick: true,
|
|
1257
|
+
onEntered: logging.closePopupShow
|
|
1258
|
+
});
|
|
1259
|
+
logging.closePopupCtaClick(isConfirmed);
|
|
1260
|
+
if (isConfirmed) {
|
|
1261
|
+
captureExitLog(Date.now());
|
|
1262
|
+
(0, import_react_native30.closeView)();
|
|
1263
|
+
}
|
|
1264
|
+
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
1265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1266
|
+
import_private6.TopNavigation,
|
|
1267
|
+
{
|
|
1268
|
+
title: globals.brandDisplayName,
|
|
1269
|
+
icon: toIcon(globals.brandIcon),
|
|
1270
|
+
onPressDots: openMoreButtonBottomSheet,
|
|
1271
|
+
contentVisible: true,
|
|
1272
|
+
onPressTitle: withHomeButton ? handlePressTitle : void 0,
|
|
1273
|
+
onPressClose: handleClose,
|
|
1274
|
+
withHome: withHomeButton,
|
|
1275
|
+
fixedRightButton: initialAccessoryButton,
|
|
1276
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_private6.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_private6.NavigationBackButton, { onPress: handleBackEvent, canGoBack: false }) })
|
|
1277
|
+
}
|
|
1278
|
+
) });
|
|
1279
|
+
}
|
|
1159
1280
|
|
|
1160
1281
|
// src/core/utils/mergeRefs.ts
|
|
1161
1282
|
function mergeRefs(...refs) {
|
|
@@ -1170,18 +1291,182 @@ function mergeRefs(...refs) {
|
|
|
1170
1291
|
};
|
|
1171
1292
|
}
|
|
1172
1293
|
|
|
1294
|
+
// src/hooks/useWebviewHistoryStack.tsx
|
|
1295
|
+
var import_react15 = require("react");
|
|
1296
|
+
function useWebViewHistory() {
|
|
1297
|
+
const [stack, setStack] = (0, import_react15.useState)([]);
|
|
1298
|
+
const [index, setIndex] = (0, import_react15.useState)(-1);
|
|
1299
|
+
const canGoBack = index > 0;
|
|
1300
|
+
const canGoForward = index >= 0 && index < stack.length - 1;
|
|
1301
|
+
const push = (0, import_react15.useCallback)(
|
|
1302
|
+
(url) => {
|
|
1303
|
+
setStack((prev) => {
|
|
1304
|
+
const base = prev.slice(0, index + 1);
|
|
1305
|
+
return [...base, url];
|
|
1306
|
+
});
|
|
1307
|
+
setIndex((i) => i + 1);
|
|
1308
|
+
},
|
|
1309
|
+
[index]
|
|
1310
|
+
);
|
|
1311
|
+
const onNavigationStateChange = (0, import_react15.useCallback)(
|
|
1312
|
+
({ url }) => {
|
|
1313
|
+
if (stack.length === 0) {
|
|
1314
|
+
setStack([url]);
|
|
1315
|
+
setIndex(0);
|
|
1316
|
+
return;
|
|
1317
|
+
}
|
|
1318
|
+
const cur = stack[index];
|
|
1319
|
+
if (url === cur) {
|
|
1320
|
+
return;
|
|
1321
|
+
}
|
|
1322
|
+
const prev = index > 0 ? stack[index - 1] : void 0;
|
|
1323
|
+
const next = index < stack.length - 1 ? stack[index + 1] : void 0;
|
|
1324
|
+
if (prev && url === prev) {
|
|
1325
|
+
setIndex((i) => i - 1);
|
|
1326
|
+
return;
|
|
1327
|
+
}
|
|
1328
|
+
if (next && url === next) {
|
|
1329
|
+
setIndex((i) => i + 1);
|
|
1330
|
+
return;
|
|
1331
|
+
}
|
|
1332
|
+
push(url);
|
|
1333
|
+
},
|
|
1334
|
+
[stack, index, push]
|
|
1335
|
+
);
|
|
1336
|
+
return {
|
|
1337
|
+
onNavigationStateChange,
|
|
1338
|
+
canGoBack,
|
|
1339
|
+
canGoForward
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
// src/utils/log.ts
|
|
1344
|
+
var import_native_modules13 = require("@apps-in-toss/native-modules");
|
|
1345
|
+
var import_react_native32 = require("@granite-js/react-native");
|
|
1346
|
+
|
|
1347
|
+
// src/utils/extractDateFromUUIDv7.ts
|
|
1348
|
+
var extractDateFromUUIDv7 = (uuid) => {
|
|
1349
|
+
const timestampHex = uuid.split("-").join("").slice(0, 12);
|
|
1350
|
+
const timestamp = Number.parseInt(timestampHex, 16);
|
|
1351
|
+
return new Date(timestamp);
|
|
1352
|
+
};
|
|
1353
|
+
|
|
1354
|
+
// src/utils/log.ts
|
|
1355
|
+
var getGroupId = (url) => {
|
|
1356
|
+
try {
|
|
1357
|
+
const urlObject = new URL(url);
|
|
1358
|
+
return {
|
|
1359
|
+
groupId: urlObject.pathname,
|
|
1360
|
+
search: urlObject.search.startsWith("?") ? urlObject.search.substring(1) : urlObject.search
|
|
1361
|
+
};
|
|
1362
|
+
} catch {
|
|
1363
|
+
return {
|
|
1364
|
+
groupId: "unknown",
|
|
1365
|
+
search: "unknown"
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
1369
|
+
var getReferrer = () => {
|
|
1370
|
+
try {
|
|
1371
|
+
const referrer = new URL((0, import_react_native32.getSchemeUri)());
|
|
1372
|
+
return referrer.searchParams.get("referrer");
|
|
1373
|
+
} catch {
|
|
1374
|
+
return "";
|
|
1375
|
+
}
|
|
1376
|
+
};
|
|
1377
|
+
var trackScreen = (url) => {
|
|
1378
|
+
const { groupId, search } = getGroupId(url);
|
|
1379
|
+
const log = {
|
|
1380
|
+
log_type: "screen",
|
|
1381
|
+
log_name: `${groupId}::screen`,
|
|
1382
|
+
params: {
|
|
1383
|
+
search,
|
|
1384
|
+
referrer: getReferrer(),
|
|
1385
|
+
deployment_id: env.getDeploymentId(),
|
|
1386
|
+
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
1387
|
+
}
|
|
1388
|
+
};
|
|
1389
|
+
return (0, import_native_modules13.eventLog)(log);
|
|
1390
|
+
};
|
|
1391
|
+
|
|
1173
1392
|
// src/components/PartnerWebView.tsx
|
|
1174
|
-
var
|
|
1175
|
-
var PartnerWebView = (0,
|
|
1393
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1394
|
+
var PartnerWebView = (0, import_react16.forwardRef)(
|
|
1176
1395
|
function PartnerWebViewScreen(webViewProps, ref) {
|
|
1177
|
-
const webViewRef = (0,
|
|
1396
|
+
const webViewRef = (0, import_react16.useRef)(null);
|
|
1178
1397
|
const refs = mergeRefs(ref, webViewRef);
|
|
1179
|
-
|
|
1398
|
+
const { captureExitLog } = useCaptureExitLog();
|
|
1399
|
+
const { canGoBack, onNavigationStateChange } = useWebViewHistory();
|
|
1400
|
+
const historyBackScript = `
|
|
1401
|
+
(function() {
|
|
1402
|
+
history.back();
|
|
1403
|
+
true;
|
|
1404
|
+
})();
|
|
1405
|
+
`;
|
|
1406
|
+
const historyHomeScript = `
|
|
1407
|
+
(function() {
|
|
1408
|
+
history.replaceState(null, '', '/');
|
|
1409
|
+
true;
|
|
1410
|
+
})();
|
|
1411
|
+
`;
|
|
1412
|
+
const handleBackEvent = (0, import_react16.useCallback)(() => {
|
|
1413
|
+
if (canGoBack) {
|
|
1414
|
+
webViewRef.current?.injectJavaScript(historyBackScript);
|
|
1415
|
+
} else {
|
|
1416
|
+
captureExitLog(Date.now());
|
|
1417
|
+
(0, import_native_modules14.closeView)();
|
|
1418
|
+
}
|
|
1419
|
+
}, [canGoBack, captureExitLog, historyBackScript]);
|
|
1420
|
+
const handleAndroidBackEvent = (0, import_react16.useCallback)(() => {
|
|
1421
|
+
if (canGoBack) {
|
|
1422
|
+
webViewRef.current?.injectJavaScript(historyBackScript);
|
|
1423
|
+
return true;
|
|
1424
|
+
} else {
|
|
1425
|
+
return false;
|
|
1426
|
+
}
|
|
1427
|
+
}, [canGoBack, historyBackScript]);
|
|
1428
|
+
(0, import_react16.useEffect)(() => {
|
|
1429
|
+
import_react_native33.BackHandler.addEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
1430
|
+
return () => import_react_native33.BackHandler.removeEventListener("hardwareBackPress", handleAndroidBackEvent);
|
|
1431
|
+
}, [handleAndroidBackEvent]);
|
|
1432
|
+
const handleHomeIconButtonClick = (0, import_react16.useCallback)(() => {
|
|
1433
|
+
webViewRef.current?.injectJavaScript(historyHomeScript);
|
|
1434
|
+
}, [historyHomeScript]);
|
|
1435
|
+
const handleNavigationStateChange = (0, import_react16.useCallback)(
|
|
1436
|
+
(event) => {
|
|
1437
|
+
if (event.url) {
|
|
1438
|
+
trackScreen(event.url);
|
|
1439
|
+
}
|
|
1440
|
+
onNavigationStateChange(event);
|
|
1441
|
+
},
|
|
1442
|
+
[onNavigationStateChange]
|
|
1443
|
+
);
|
|
1444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1445
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1446
|
+
PartnerWebviewNavigationBar,
|
|
1447
|
+
{
|
|
1448
|
+
handleBackEvent,
|
|
1449
|
+
handleHomeIconButtonClick
|
|
1450
|
+
}
|
|
1451
|
+
),
|
|
1452
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1453
|
+
import_react_native_webview2.WebView,
|
|
1454
|
+
{
|
|
1455
|
+
ref: refs,
|
|
1456
|
+
...webViewProps,
|
|
1457
|
+
style: { flex: 1 },
|
|
1458
|
+
onNavigationStateChange: (event) => {
|
|
1459
|
+
webViewProps?.onNavigationStateChange?.(event);
|
|
1460
|
+
handleNavigationStateChange(event);
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
)
|
|
1464
|
+
] });
|
|
1180
1465
|
}
|
|
1181
1466
|
);
|
|
1182
1467
|
|
|
1183
1468
|
// src/bridge-handler/useBridgeHandler.tsx
|
|
1184
|
-
var
|
|
1469
|
+
var import_react17 = require("react");
|
|
1185
1470
|
function serializeError(error) {
|
|
1186
1471
|
return JSON.stringify(error, (_, value) => {
|
|
1187
1472
|
if (value instanceof Error) {
|
|
@@ -1230,8 +1515,8 @@ function useBridgeHandler({
|
|
|
1230
1515
|
eventListenerMap,
|
|
1231
1516
|
injectedJavaScript: originalInjectedJavaScript
|
|
1232
1517
|
}) {
|
|
1233
|
-
const ref = (0,
|
|
1234
|
-
const injectedJavaScript = (0,
|
|
1518
|
+
const ref = (0, import_react17.useRef)(null);
|
|
1519
|
+
const injectedJavaScript = (0, import_react17.useMemo)(
|
|
1235
1520
|
() => [
|
|
1236
1521
|
`window.__CONSTANT_HANDLER_MAP = ${JSON.stringify(
|
|
1237
1522
|
Object.entries(constantHandlerMap).reduce(
|
|
@@ -1258,7 +1543,7 @@ function useBridgeHandler({
|
|
|
1258
1543
|
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
|
|
1259
1544
|
`);
|
|
1260
1545
|
};
|
|
1261
|
-
const $onMessage = (0,
|
|
1546
|
+
const $onMessage = (0, import_react17.useCallback)(
|
|
1262
1547
|
async (e) => {
|
|
1263
1548
|
onMessage?.(e);
|
|
1264
1549
|
const data = JSON.parse(e.nativeEvent.data);
|
|
@@ -1309,8 +1594,8 @@ function useBridgeHandler({
|
|
|
1309
1594
|
}
|
|
1310
1595
|
|
|
1311
1596
|
// src/hooks/useCreateUserAgent.ts
|
|
1312
|
-
var
|
|
1313
|
-
var
|
|
1597
|
+
var import_native_modules15 = require("@apps-in-toss/native-modules");
|
|
1598
|
+
var import_react_native34 = require("react-native");
|
|
1314
1599
|
var FontA11yCategory = {
|
|
1315
1600
|
Large: "Large",
|
|
1316
1601
|
xLarge: "xLarge",
|
|
@@ -1443,9 +1728,9 @@ function useCreateUserAgent({
|
|
|
1443
1728
|
safeArea,
|
|
1444
1729
|
safeAreaBottomTransparency
|
|
1445
1730
|
}) {
|
|
1446
|
-
const platform = (0,
|
|
1447
|
-
const appVersion = (0,
|
|
1448
|
-
const { fontScale } = (0,
|
|
1731
|
+
const platform = (0, import_native_modules15.getPlatformOS)();
|
|
1732
|
+
const appVersion = (0, import_native_modules15.getTossAppVersion)();
|
|
1733
|
+
const { fontScale } = (0, import_react_native34.useWindowDimensions)();
|
|
1449
1734
|
const platformString = platform === "ios" ? "iPhone" : "Android";
|
|
1450
1735
|
const fontA11y = mapFontScaleToCategory(fontScale, platform);
|
|
1451
1736
|
const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
|
|
@@ -1465,17 +1750,17 @@ function useCreateUserAgent({
|
|
|
1465
1750
|
}
|
|
1466
1751
|
|
|
1467
1752
|
// src/hooks/useGeolocation.ts
|
|
1468
|
-
var
|
|
1469
|
-
var
|
|
1470
|
-
var
|
|
1753
|
+
var import_native_modules16 = require("@apps-in-toss/native-modules");
|
|
1754
|
+
var import_react_native35 = require("@granite-js/react-native");
|
|
1755
|
+
var import_react18 = require("react");
|
|
1471
1756
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
1472
|
-
const isVisible = (0,
|
|
1473
|
-
const [location, setLocation] = (0,
|
|
1474
|
-
(0,
|
|
1757
|
+
const isVisible = (0, import_react_native35.useVisibility)();
|
|
1758
|
+
const [location, setLocation] = (0, import_react18.useState)(null);
|
|
1759
|
+
(0, import_react18.useEffect)(() => {
|
|
1475
1760
|
if (!isVisible) {
|
|
1476
1761
|
return;
|
|
1477
1762
|
}
|
|
1478
|
-
return (0,
|
|
1763
|
+
return (0, import_native_modules16.startUpdateLocation)({
|
|
1479
1764
|
options: {
|
|
1480
1765
|
accuracy,
|
|
1481
1766
|
distanceInterval,
|
|
@@ -1488,67 +1773,18 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
1488
1773
|
return location;
|
|
1489
1774
|
}
|
|
1490
1775
|
|
|
1491
|
-
// src/utils/log.ts
|
|
1492
|
-
var import_native_modules16 = require("@apps-in-toss/native-modules");
|
|
1493
|
-
var import_react_native29 = require("@granite-js/react-native");
|
|
1494
|
-
|
|
1495
|
-
// src/utils/extractDateFromUUIDv7.ts
|
|
1496
|
-
var extractDateFromUUIDv7 = (uuid) => {
|
|
1497
|
-
const timestampHex = uuid.split("-").join("").slice(0, 12);
|
|
1498
|
-
const timestamp = Number.parseInt(timestampHex, 16);
|
|
1499
|
-
return new Date(timestamp);
|
|
1500
|
-
};
|
|
1501
|
-
|
|
1502
|
-
// src/utils/log.ts
|
|
1503
|
-
var getGroupId = (url) => {
|
|
1504
|
-
try {
|
|
1505
|
-
const urlObject = new URL(url);
|
|
1506
|
-
return {
|
|
1507
|
-
groupId: urlObject.pathname,
|
|
1508
|
-
search: urlObject.search.startsWith("?") ? urlObject.search.substring(1) : urlObject.search
|
|
1509
|
-
};
|
|
1510
|
-
} catch {
|
|
1511
|
-
return {
|
|
1512
|
-
groupId: "unknown",
|
|
1513
|
-
search: "unknown"
|
|
1514
|
-
};
|
|
1515
|
-
}
|
|
1516
|
-
};
|
|
1517
|
-
var getReferrer = () => {
|
|
1518
|
-
try {
|
|
1519
|
-
const referrer = new URL((0, import_react_native29.getSchemeUri)());
|
|
1520
|
-
return referrer.searchParams.get("referrer");
|
|
1521
|
-
} catch {
|
|
1522
|
-
return "";
|
|
1523
|
-
}
|
|
1524
|
-
};
|
|
1525
|
-
var trackScreen = (url) => {
|
|
1526
|
-
const { groupId, search } = getGroupId(url);
|
|
1527
|
-
const log = {
|
|
1528
|
-
log_type: "screen",
|
|
1529
|
-
log_name: `${groupId}::screen`,
|
|
1530
|
-
params: {
|
|
1531
|
-
search,
|
|
1532
|
-
referrer: getReferrer(),
|
|
1533
|
-
deployment_id: env.getDeploymentId(),
|
|
1534
|
-
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
1535
|
-
}
|
|
1536
|
-
};
|
|
1537
|
-
return (0, import_native_modules16.eventLog)(log);
|
|
1538
|
-
};
|
|
1539
|
-
|
|
1540
1776
|
// src/components/WebView.tsx
|
|
1541
|
-
var
|
|
1777
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1542
1778
|
var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
|
|
1543
1779
|
var TYPES = ["partner", "external", "game"];
|
|
1544
1780
|
var WEBVIEW_TYPES = {
|
|
1545
1781
|
partner: PartnerWebView,
|
|
1546
|
-
external:
|
|
1782
|
+
external: import_react_native37.ExternalWebViewScreen,
|
|
1547
1783
|
game: GameWebView
|
|
1548
1784
|
};
|
|
1549
1785
|
function mergeSchemeQueryParamsInto(url) {
|
|
1550
1786
|
const baseUrl = new URL(url);
|
|
1551
|
-
const schemeUrl = new URL((0,
|
|
1787
|
+
const schemeUrl = new URL((0, import_react_native36.getSchemeUri)());
|
|
1552
1788
|
baseUrl.pathname = schemeUrl.pathname;
|
|
1553
1789
|
for (const [key, value] of schemeUrl.searchParams.entries()) {
|
|
1554
1790
|
baseUrl.searchParams.set(key, value);
|
|
@@ -1572,14 +1808,12 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1572
1808
|
if (!TYPES.includes(type)) {
|
|
1573
1809
|
throw new Error(`Invalid WebView type: '${type}'`);
|
|
1574
1810
|
}
|
|
1575
|
-
const
|
|
1576
|
-
const
|
|
1577
|
-
const
|
|
1578
|
-
const
|
|
1579
|
-
const top = (0, import_private5.useSafeAreaTop)();
|
|
1580
|
-
const bottom = (0, import_private5.useSafeAreaBottom)();
|
|
1811
|
+
const graniteEvent = (0, import_react_native36.useGraniteEvent)();
|
|
1812
|
+
const uri = (0, import_react19.useMemo)(() => getWebViewUri(local), [local]);
|
|
1813
|
+
const top = (0, import_private7.useSafeAreaTop)();
|
|
1814
|
+
const bottom = (0, import_private7.useSafeAreaBottom)();
|
|
1581
1815
|
const global2 = getAppsInTossGlobals();
|
|
1582
|
-
const topNavigation = (0,
|
|
1816
|
+
const topNavigation = (0, import_private7.useTopNavigation)();
|
|
1583
1817
|
const disableTextSelectionCSS = `
|
|
1584
1818
|
(function() {
|
|
1585
1819
|
const style = document.createElement('style');
|
|
@@ -1587,7 +1821,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1587
1821
|
document.head.appendChild(style);
|
|
1588
1822
|
})();
|
|
1589
1823
|
`;
|
|
1590
|
-
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0,
|
|
1824
|
+
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0, import_react19.useState)(
|
|
1591
1825
|
props.allowsBackForwardNavigationGestures
|
|
1592
1826
|
);
|
|
1593
1827
|
const handler = useBridgeHandler({
|
|
@@ -1596,7 +1830,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1596
1830
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1597
1831
|
eventListenerMap: {
|
|
1598
1832
|
...appsInTossEventBridges,
|
|
1599
|
-
navigationAccessoryEvent: ({ onEvent, onError }) =>
|
|
1833
|
+
navigationAccessoryEvent: ({ onEvent, onError }) => import_react_native37.tdsEvent.addEventListener("navigationAccessoryEvent", { onEvent, onError }),
|
|
1600
1834
|
backEvent: ({ onEvent, onError, options }) => graniteEvent.addEventListener("backEvent", { onEvent, onError, options }),
|
|
1601
1835
|
entryMessageExited: ({ onEvent, onError }) => import_native_modules17.appsInTossEvent.addEventListener("entryMessageExited", { onEvent, onError }),
|
|
1602
1836
|
updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules17.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
@@ -1657,7 +1891,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1657
1891
|
iapGetProductItemList: import_native_modules17.IAP.getProductItemList
|
|
1658
1892
|
}
|
|
1659
1893
|
});
|
|
1660
|
-
const headerPropForExternalWebView = (0,
|
|
1894
|
+
const headerPropForExternalWebView = (0, import_react19.useMemo)(() => {
|
|
1661
1895
|
const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
|
|
1662
1896
|
const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
|
|
1663
1897
|
const withBackButton = parsedNavigationBar?.withBackButton ?? true;
|
|
@@ -1674,74 +1908,10 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1674
1908
|
}, [global2.navigationBar, type]);
|
|
1675
1909
|
const BaseWebView = WEBVIEW_TYPES[type];
|
|
1676
1910
|
const webViewDebuggingEnabled = operationalEnvironment === "sandbox";
|
|
1677
|
-
const [canHistoryGoBack, setCanHistoryGoBack] = (0, import_react15.useState)(false);
|
|
1678
|
-
const handleNavigationStateChange = (0, import_react15.useCallback)(
|
|
1679
|
-
(event) => {
|
|
1680
|
-
if (event.url) {
|
|
1681
|
-
trackScreen(event.url);
|
|
1682
|
-
}
|
|
1683
|
-
setCanHistoryGoBack(event.canGoBack);
|
|
1684
|
-
},
|
|
1685
|
-
[setCanHistoryGoBack]
|
|
1686
|
-
);
|
|
1687
1911
|
const userAgent = useCreateUserAgent({
|
|
1688
1912
|
colorPreference: "light"
|
|
1689
1913
|
});
|
|
1690
|
-
|
|
1691
|
-
const isConfirmed = await openConfirm({
|
|
1692
|
-
title: `${(0, import_es_hangul3.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
1693
|
-
leftButton: "\uCDE8\uC18C",
|
|
1694
|
-
rightButton: "\uC885\uB8CC\uD558\uAE30",
|
|
1695
|
-
closeOnDimmerClick: true
|
|
1696
|
-
});
|
|
1697
|
-
if (isConfirmed) {
|
|
1698
|
-
captureExitLog(Date.now());
|
|
1699
|
-
(0, import_react_native30.closeView)();
|
|
1700
|
-
}
|
|
1701
|
-
}, [captureExitLog, openConfirm, global2.brandDisplayName]);
|
|
1702
|
-
const handleBackEvent = (0, import_react15.useCallback)(() => {
|
|
1703
|
-
if (type === "game") {
|
|
1704
|
-
handleGameWebviewClose();
|
|
1705
|
-
return true;
|
|
1706
|
-
}
|
|
1707
|
-
if (canHistoryGoBack) {
|
|
1708
|
-
handler.ref.current?.goBack();
|
|
1709
|
-
return true;
|
|
1710
|
-
} else {
|
|
1711
|
-
return false;
|
|
1712
|
-
}
|
|
1713
|
-
}, [canHistoryGoBack, handleGameWebviewClose, handler.ref, type]);
|
|
1714
|
-
(0, import_react15.useEffect)(() => {
|
|
1715
|
-
import_react_native32.BackHandler.addEventListener("hardwareBackPress", handleBackEvent);
|
|
1716
|
-
return () => import_react_native32.BackHandler.removeEventListener("hardwareBackPress", handleBackEvent);
|
|
1717
|
-
}, [handleBackEvent]);
|
|
1718
|
-
(0, import_react15.useEffect)(() => {
|
|
1719
|
-
return import_native_modules17.appsInTossEvent.addEventListener("homeIconButtonClickEvent", {
|
|
1720
|
-
onEvent: () => {
|
|
1721
|
-
handler.ref?.current?.injectJavaScript(`
|
|
1722
|
-
(function() {
|
|
1723
|
-
window.history.replaceState(null, '', '/');
|
|
1724
|
-
true;
|
|
1725
|
-
})();
|
|
1726
|
-
`);
|
|
1727
|
-
}
|
|
1728
|
-
});
|
|
1729
|
-
}, [handler.ref]);
|
|
1730
|
-
(0, import_react15.useEffect)(() => {
|
|
1731
|
-
return import_native_modules17.appsInTossEvent.addEventListener("backButtonClickEvent", {
|
|
1732
|
-
onEvent: () => {
|
|
1733
|
-
if (type === "game") {
|
|
1734
|
-
handleGameWebviewClose();
|
|
1735
|
-
} else if (canHistoryGoBack) {
|
|
1736
|
-
handler.ref.current?.goBack();
|
|
1737
|
-
} else {
|
|
1738
|
-
captureExitLog(Date.now());
|
|
1739
|
-
(0, import_react_native30.closeView)();
|
|
1740
|
-
}
|
|
1741
|
-
}
|
|
1742
|
-
});
|
|
1743
|
-
}, [handler.ref, canHistoryGoBack, handleGameWebviewClose, captureExitLog, type]);
|
|
1744
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1745
1915
|
BaseWebView,
|
|
1746
1916
|
{
|
|
1747
1917
|
ref: handler.ref,
|
|
@@ -1754,15 +1924,14 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1754
1924
|
"User-Agent": userAgent
|
|
1755
1925
|
}
|
|
1756
1926
|
},
|
|
1757
|
-
userAgent:
|
|
1927
|
+
userAgent: import_react_native38.Platform.OS === "ios" ? userAgent : void 0,
|
|
1758
1928
|
sharedCookiesEnabled: true,
|
|
1759
1929
|
webviewDebuggingEnabled: webViewDebuggingEnabled,
|
|
1760
1930
|
thirdPartyCookiesEnabled: true,
|
|
1761
1931
|
onMessage: handler.onMessage,
|
|
1762
|
-
onNavigationStateChange: handleNavigationStateChange,
|
|
1763
1932
|
injectedJavaScript: handler.injectedJavaScript,
|
|
1764
1933
|
injectedJavaScriptBeforeContentLoaded: handler.injectedJavaScript,
|
|
1765
|
-
decelerationRate:
|
|
1934
|
+
decelerationRate: import_react_native38.Platform.OS === "ios" ? 1 : void 0,
|
|
1766
1935
|
allowsBackForwardNavigationGestures
|
|
1767
1936
|
}
|
|
1768
1937
|
);
|
|
@@ -1770,7 +1939,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1770
1939
|
|
|
1771
1940
|
// src/index.ts
|
|
1772
1941
|
__reExport(src_exports, require("@apps-in-toss/analytics"), module.exports);
|
|
1773
|
-
var
|
|
1942
|
+
var import_private8 = require("@toss-design-system/react-native/private");
|
|
1774
1943
|
__reExport(src_exports, require("@apps-in-toss/native-modules"), module.exports);
|
|
1775
1944
|
__reExport(src_exports, require("@apps-in-toss/types"), module.exports);
|
|
1776
1945
|
var Analytics2 = {
|