@apps-in-toss/framework 1.9.2 → 1.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +214 -181
- package/dist/index.js +92 -59
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -50,10 +50,10 @@ var import_analytics2 = require("@apps-in-toss/analytics");
|
|
|
50
50
|
|
|
51
51
|
// src/core/registerApp.tsx
|
|
52
52
|
var import_analytics = require("@apps-in-toss/analytics");
|
|
53
|
-
var
|
|
54
|
-
var
|
|
53
|
+
var import_native_modules14 = require("@apps-in-toss/native-modules");
|
|
54
|
+
var import_react_native24 = require("@granite-js/react-native");
|
|
55
55
|
var import_tds_react_native10 = require("@toss/tds-react-native");
|
|
56
|
-
var
|
|
56
|
+
var import_react_native25 = require("react-native");
|
|
57
57
|
|
|
58
58
|
// src/core/components/AppEvent.tsx
|
|
59
59
|
var import_native_modules2 = require("@apps-in-toss/native-modules");
|
|
@@ -251,9 +251,9 @@ function useNavigationBarContext() {
|
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
// src/components/RNAppContainer.tsx
|
|
254
|
-
var
|
|
254
|
+
var import_native_modules13 = require("@apps-in-toss/native-modules");
|
|
255
255
|
var import_react17 = require("react");
|
|
256
|
-
var
|
|
256
|
+
var import_react_native23 = require("react-native");
|
|
257
257
|
|
|
258
258
|
// src/components/GameInitializer.tsx
|
|
259
259
|
var import_native_modules6 = require("@apps-in-toss/native-modules");
|
|
@@ -863,8 +863,8 @@ function useNavigationEvent() {
|
|
|
863
863
|
}
|
|
864
864
|
|
|
865
865
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
866
|
-
var
|
|
867
|
-
var
|
|
866
|
+
var import_native_modules12 = require("@apps-in-toss/native-modules");
|
|
867
|
+
var import_react_native21 = require("@granite-js/react-native");
|
|
868
868
|
var import_tds_react_native8 = require("@toss/tds-react-native");
|
|
869
869
|
var import_private4 = require("@toss/tds-react-native/private");
|
|
870
870
|
var import_react15 = require("react");
|
|
@@ -1053,22 +1053,49 @@ function AppShareListMenu() {
|
|
|
1053
1053
|
);
|
|
1054
1054
|
}
|
|
1055
1055
|
|
|
1056
|
-
// src/core/hooks/useMoreButtonBottomSheet/
|
|
1056
|
+
// src/core/hooks/useMoreButtonBottomSheet/HomeShortcutMenu.tsx
|
|
1057
1057
|
var import_native_modules10 = require("@apps-in-toss/native-modules");
|
|
1058
|
-
var import_react_native19 = require("
|
|
1058
|
+
var import_react_native19 = require("react-native");
|
|
1059
1059
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1060
|
-
function
|
|
1060
|
+
function HomeShortcutMenu() {
|
|
1061
|
+
const isSandbox = (0, import_native_modules10.getOperationalEnvironment)() === "sandbox";
|
|
1061
1062
|
const globals = getAppsInTossGlobals();
|
|
1062
|
-
if (
|
|
1063
|
+
if (isSandbox) {
|
|
1063
1064
|
return null;
|
|
1064
1065
|
}
|
|
1065
1066
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1067
|
+
Menu,
|
|
1068
|
+
{
|
|
1069
|
+
title: "\uD648 \uD654\uBA74\uC5D0 \uCD94\uAC00",
|
|
1070
|
+
iconURL: "https://static.toss.im/icons/png/4x/icon-plus-circle-mono.png",
|
|
1071
|
+
onPress: () => {
|
|
1072
|
+
import_react_native19.NativeModules.AppsInTossModule.addMiniAppShortcut({
|
|
1073
|
+
title: globals.brandDisplayName,
|
|
1074
|
+
appName: global.__granite.app.name,
|
|
1075
|
+
iconUrl: globals.brandIcon,
|
|
1076
|
+
guideUrl: "https://service.toss.im/app-mini-home/shortcut"
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
);
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
// src/core/hooks/useMoreButtonBottomSheet/PermissionsMenu.tsx
|
|
1084
|
+
var import_native_modules11 = require("@apps-in-toss/native-modules");
|
|
1085
|
+
var import_react_native20 = require("@granite-js/react-native");
|
|
1086
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1087
|
+
function PermissionsMenu() {
|
|
1088
|
+
const globals = getAppsInTossGlobals();
|
|
1089
|
+
if ((0, import_native_modules11.getOperationalEnvironment)() === "sandbox") {
|
|
1090
|
+
return null;
|
|
1091
|
+
}
|
|
1092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1066
1093
|
Menu,
|
|
1067
1094
|
{
|
|
1068
1095
|
title: "\uAD8C\uD55C \uC124\uC815",
|
|
1069
1096
|
iconURL: "https://static.toss.im/icons/png/4x/icon-setting-mono.png",
|
|
1070
|
-
onPress: () => (0,
|
|
1071
|
-
`servicetoss://apps-in-toss-menu/permissions?appName=${
|
|
1097
|
+
onPress: () => (0, import_react_native20.openURL)(
|
|
1098
|
+
`servicetoss://apps-in-toss-menu/permissions?appName=${import_react_native20.Granite.appName}&displayAppName=${globals.brandDisplayName}`
|
|
1072
1099
|
)
|
|
1073
1100
|
}
|
|
1074
1101
|
);
|
|
@@ -1083,7 +1110,7 @@ function ensureValue(value, name) {
|
|
|
1083
1110
|
}
|
|
1084
1111
|
|
|
1085
1112
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
1086
|
-
var
|
|
1113
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1087
1114
|
var APP_BRIDGE_METHOD_NAME = "getMiniAppsSupportContact";
|
|
1088
1115
|
var MIN_VERSION = {
|
|
1089
1116
|
BOTTOM_SHEET: {
|
|
@@ -1094,6 +1121,10 @@ var MIN_VERSION = {
|
|
|
1094
1121
|
android: "5.230.0",
|
|
1095
1122
|
ios: "5.230.0"
|
|
1096
1123
|
},
|
|
1124
|
+
HOME_SHORTCUT_MENU: {
|
|
1125
|
+
android: "5.246.0",
|
|
1126
|
+
ios: "5.246.0"
|
|
1127
|
+
},
|
|
1097
1128
|
PERMISSIONS_MENU: {
|
|
1098
1129
|
android: "5.238.0",
|
|
1099
1130
|
ios: "5.237.0"
|
|
@@ -1107,14 +1138,15 @@ function useMoreButtonBottomSheet() {
|
|
|
1107
1138
|
const logging = useMoreButtonBottomSheetLogging();
|
|
1108
1139
|
const overlay = (0, import_private4.useOverlay)();
|
|
1109
1140
|
const title = ensureValue(globals.brandDisplayName, "displayName");
|
|
1110
|
-
const
|
|
1111
|
-
const
|
|
1141
|
+
const isHomeShortcutSupported = (0, import_native_modules12.isMinVersionSupported)(MIN_VERSION.HOME_SHORTCUT_MENU);
|
|
1142
|
+
const isBottomSheetSupported = (0, import_native_modules12.isMinVersionSupported)(MIN_VERSION.BOTTOM_SHEET);
|
|
1143
|
+
const isShareListMenuSupported = (0, import_native_modules12.isMinVersionSupported)(MIN_VERSION.SHARE_LIST_MENU);
|
|
1112
1144
|
const [isPermissionsMenuSupported, setIsPermissionsMenuSupported] = (0, import_react15.useState)(false);
|
|
1113
1145
|
(0, import_react15.useEffect)(() => {
|
|
1114
1146
|
if (!isBottomSheetSupported) {
|
|
1115
1147
|
return;
|
|
1116
1148
|
}
|
|
1117
|
-
|
|
1149
|
+
import_native_modules12.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1118
1150
|
APP_BRIDGE_METHOD_NAME,
|
|
1119
1151
|
{},
|
|
1120
1152
|
{
|
|
@@ -1122,8 +1154,8 @@ function useMoreButtonBottomSheet() {
|
|
|
1122
1154
|
onError: (error) => console.error("\uBA54\uB274 \uBAA9\uB85D\uC744 \uAC00\uC838\uC624\uB294 \uB370 \uC2E4\uD328\uD588\uC5B4\uC694:", error)
|
|
1123
1155
|
}
|
|
1124
1156
|
);
|
|
1125
|
-
if ((0,
|
|
1126
|
-
|
|
1157
|
+
if ((0, import_native_modules12.isMinVersionSupported)(MIN_VERSION.PERMISSIONS_MENU)) {
|
|
1158
|
+
import_native_modules12.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1127
1159
|
"getAllPermission",
|
|
1128
1160
|
{},
|
|
1129
1161
|
{
|
|
@@ -1147,17 +1179,17 @@ function useMoreButtonBottomSheet() {
|
|
|
1147
1179
|
logging.close();
|
|
1148
1180
|
close();
|
|
1149
1181
|
};
|
|
1150
|
-
return /* @__PURE__ */ (0,
|
|
1182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BottomSheetImpressionArea, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1151
1183
|
import_tds_react_native8.BottomSheet.Root,
|
|
1152
1184
|
{
|
|
1153
|
-
header: /* @__PURE__ */ (0,
|
|
1185
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1154
1186
|
import_tds_react_native8.ListHeader,
|
|
1155
1187
|
{
|
|
1156
|
-
title: /* @__PURE__ */ (0,
|
|
1188
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_tds_react_native8.ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
|
|
1157
1189
|
}
|
|
1158
1190
|
),
|
|
1159
1191
|
open: isOpen,
|
|
1160
|
-
cta: /* @__PURE__ */ (0,
|
|
1192
|
+
cta: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1161
1193
|
import_tds_react_native8.BottomSheet.CTA,
|
|
1162
1194
|
{
|
|
1163
1195
|
size: "large",
|
|
@@ -1171,18 +1203,19 @@ function useMoreButtonBottomSheet() {
|
|
|
1171
1203
|
),
|
|
1172
1204
|
onClose: handleClose,
|
|
1173
1205
|
onExited: exit,
|
|
1174
|
-
children: /* @__PURE__ */ (0,
|
|
1175
|
-
itemList.map((item) => /* @__PURE__ */ (0,
|
|
1206
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_tds_react_native8.List, { rowSeparator: "none", children: [
|
|
1207
|
+
itemList.map((item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1176
1208
|
Menu,
|
|
1177
1209
|
{
|
|
1178
1210
|
title: item.contactItemName,
|
|
1179
1211
|
iconURL: item.contactIconUrl,
|
|
1180
|
-
onPress: () => (0,
|
|
1212
|
+
onPress: () => (0, import_react_native21.openURL)(item.contactUri)
|
|
1181
1213
|
},
|
|
1182
1214
|
item.contactItemName
|
|
1183
1215
|
)),
|
|
1184
|
-
|
|
1185
|
-
|
|
1216
|
+
isHomeShortcutSupported && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(HomeShortcutMenu, {}),
|
|
1217
|
+
isShareListMenuSupported && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(AppShareListMenu, {}),
|
|
1218
|
+
isPermissionsMenuSupported && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PermissionsMenu, {})
|
|
1186
1219
|
] })
|
|
1187
1220
|
}
|
|
1188
1221
|
) });
|
|
@@ -1195,7 +1228,7 @@ function BottomSheetImpressionArea({ children }) {
|
|
|
1195
1228
|
(0, import_react15.useEffect)(() => {
|
|
1196
1229
|
logging.show();
|
|
1197
1230
|
}, [logging]);
|
|
1198
|
-
return /* @__PURE__ */ (0,
|
|
1231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children });
|
|
1199
1232
|
}
|
|
1200
1233
|
|
|
1201
1234
|
// src/core/utils/toIcon.ts
|
|
@@ -1205,7 +1238,7 @@ function toIcon(source) {
|
|
|
1205
1238
|
|
|
1206
1239
|
// src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
|
|
1207
1240
|
var import_react16 = require("react");
|
|
1208
|
-
var
|
|
1241
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1209
1242
|
function NavigationBarImpressionArea({
|
|
1210
1243
|
children,
|
|
1211
1244
|
withHomeButton
|
|
@@ -1218,11 +1251,11 @@ function NavigationBarImpressionArea({
|
|
|
1218
1251
|
hasLogged.current = true;
|
|
1219
1252
|
}
|
|
1220
1253
|
}, [logging, withHomeButton]);
|
|
1221
|
-
return /* @__PURE__ */ (0,
|
|
1254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children });
|
|
1222
1255
|
}
|
|
1223
1256
|
|
|
1224
1257
|
// src/components/NavigationBar/RNNavigationBar/Default.tsx
|
|
1225
|
-
var
|
|
1258
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1226
1259
|
function DefaultNavigationBar() {
|
|
1227
1260
|
const globals = getAppsInTossGlobals();
|
|
1228
1261
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
@@ -1232,7 +1265,7 @@ function DefaultNavigationBar() {
|
|
|
1232
1265
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1233
1266
|
const navigationEvent = useNavigationEvent();
|
|
1234
1267
|
useHardwareBackPress(navigationEvent.handleBack);
|
|
1235
|
-
return /* @__PURE__ */ (0,
|
|
1268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1236
1269
|
import_private5.TopNavigation,
|
|
1237
1270
|
{
|
|
1238
1271
|
title: globals.brandDisplayName,
|
|
@@ -1244,7 +1277,7 @@ function DefaultNavigationBar() {
|
|
|
1244
1277
|
withHome: withHomeButton,
|
|
1245
1278
|
fixedRightButton: navigationRightButton,
|
|
1246
1279
|
leftVisible: withBackButton,
|
|
1247
|
-
children: /* @__PURE__ */ (0,
|
|
1280
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_private5.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_private5.NavigationBackButton, { onPress: navigationEvent.handleBack, canGoBack: false }) })
|
|
1248
1281
|
}
|
|
1249
1282
|
) });
|
|
1250
1283
|
}
|
|
@@ -1253,8 +1286,8 @@ function DefaultNavigationBar() {
|
|
|
1253
1286
|
var import_react_native_safe_area_context = require("@granite-js/native/react-native-safe-area-context");
|
|
1254
1287
|
var import_tds_react_native9 = require("@toss/tds-react-native");
|
|
1255
1288
|
var import_private6 = require("@toss/tds-react-native/private");
|
|
1256
|
-
var
|
|
1257
|
-
var
|
|
1289
|
+
var import_react_native22 = require("react-native");
|
|
1290
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1258
1291
|
function GameNavigationBar() {
|
|
1259
1292
|
const safeAreaTop = (0, import_private6.useSafeAreaTop)();
|
|
1260
1293
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
@@ -1262,15 +1295,15 @@ function GameNavigationBar() {
|
|
|
1262
1295
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1263
1296
|
const { right: safeAreaRight } = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
|
|
1264
1297
|
useHardwareBackPress(navigationEvent.handleBack);
|
|
1265
|
-
return /* @__PURE__ */ (0,
|
|
1266
|
-
/* @__PURE__ */ (0,
|
|
1267
|
-
/* @__PURE__ */ (0,
|
|
1268
|
-
|
|
1298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1299
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_tds_react_native9.PageNavbar, { preference: { type: "none" } }),
|
|
1300
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1301
|
+
import_react_native22.View,
|
|
1269
1302
|
{
|
|
1270
1303
|
style: {
|
|
1271
1304
|
width: "100%",
|
|
1272
1305
|
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1273
|
-
height:
|
|
1306
|
+
height: import_react_native22.Platform.OS === "ios" ? 44 : 54,
|
|
1274
1307
|
flexDirection: "row",
|
|
1275
1308
|
alignItems: "center",
|
|
1276
1309
|
justifyContent: "flex-end",
|
|
@@ -1280,7 +1313,7 @@ function GameNavigationBar() {
|
|
|
1280
1313
|
paddingRight: safeAreaRight + 10
|
|
1281
1314
|
},
|
|
1282
1315
|
pointerEvents: "box-none",
|
|
1283
|
-
children: /* @__PURE__ */ (0,
|
|
1316
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1284
1317
|
import_private6.NavigationRightContent,
|
|
1285
1318
|
{
|
|
1286
1319
|
fixedRightButton: navigationRightButton,
|
|
@@ -1307,71 +1340,71 @@ __reExport(bridge_entry_exports, require("@apps-in-toss/native-modules/constant-
|
|
|
1307
1340
|
__reExport(bridge_entry_exports, require("@apps-in-toss/native-modules/event-bridges"));
|
|
1308
1341
|
|
|
1309
1342
|
// src/components/RNAppContainer.tsx
|
|
1310
|
-
var
|
|
1343
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1311
1344
|
function RNAppContainer({ children }) {
|
|
1312
1345
|
const global2 = getAppsInTossGlobals();
|
|
1313
1346
|
switch (global2.appType) {
|
|
1314
1347
|
case "game":
|
|
1315
|
-
return /* @__PURE__ */ (0,
|
|
1348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GameAppContainer, { children });
|
|
1316
1349
|
case "general":
|
|
1317
1350
|
default:
|
|
1318
|
-
return /* @__PURE__ */ (0,
|
|
1351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GeneralAppContainer, { children });
|
|
1319
1352
|
}
|
|
1320
1353
|
}
|
|
1321
1354
|
function GameAppContainer({ children }) {
|
|
1322
1355
|
(0, import_react17.useEffect)(() => {
|
|
1323
|
-
if (
|
|
1324
|
-
(0,
|
|
1356
|
+
if (import_react_native23.Platform.OS === "ios") {
|
|
1357
|
+
(0, import_native_modules13.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1325
1358
|
return () => {
|
|
1326
|
-
(0,
|
|
1359
|
+
(0, import_native_modules13.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1327
1360
|
};
|
|
1328
1361
|
}
|
|
1329
1362
|
return;
|
|
1330
1363
|
}, []);
|
|
1331
|
-
return /* @__PURE__ */ (0,
|
|
1332
|
-
/* @__PURE__ */ (0,
|
|
1333
|
-
(0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0,
|
|
1364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1365
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RNNavigationBar.Game, {}),
|
|
1366
|
+
(0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GameInitializer, { children }) : children
|
|
1334
1367
|
] });
|
|
1335
1368
|
}
|
|
1336
1369
|
function GeneralAppContainer({ children }) {
|
|
1337
|
-
return /* @__PURE__ */ (0,
|
|
1338
|
-
/* @__PURE__ */ (0,
|
|
1370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1371
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RNNavigationBar.Default, {}),
|
|
1339
1372
|
children
|
|
1340
1373
|
] });
|
|
1341
1374
|
}
|
|
1342
1375
|
|
|
1343
1376
|
// src/core/registerApp.tsx
|
|
1344
|
-
var
|
|
1377
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1345
1378
|
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
1346
|
-
if (!(0,
|
|
1379
|
+
if (!(0, import_native_modules14.isMinVersionSupported)({
|
|
1347
1380
|
android: "5.220.0",
|
|
1348
1381
|
ios: "5.221.0"
|
|
1349
1382
|
})) {
|
|
1350
|
-
return /* @__PURE__ */ (0,
|
|
1351
|
-
/* @__PURE__ */ (0,
|
|
1352
|
-
/* @__PURE__ */ (0,
|
|
1353
|
-
/* @__PURE__ */ (0,
|
|
1383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AppEvent.Entry, {}),
|
|
1385
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AppEvent.System, { ...initialProps }),
|
|
1386
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AppUpdate, {})
|
|
1354
1387
|
] });
|
|
1355
1388
|
}
|
|
1356
|
-
return /* @__PURE__ */ (0,
|
|
1357
|
-
/* @__PURE__ */ (0,
|
|
1358
|
-
/* @__PURE__ */ (0,
|
|
1359
|
-
/* @__PURE__ */ (0,
|
|
1360
|
-
/* @__PURE__ */ (0,
|
|
1389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1390
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AppEvent.StayTime, {}),
|
|
1391
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AppEvent.Entry, {}),
|
|
1392
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AppEvent.System, { ...initialProps }),
|
|
1393
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_tds_react_native10.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children }) })
|
|
1361
1394
|
] });
|
|
1362
1395
|
}
|
|
1363
1396
|
function registerApp(container, { context, analytics }) {
|
|
1364
1397
|
const appName = getAppName();
|
|
1365
|
-
const isRegistered =
|
|
1398
|
+
const isRegistered = import_react_native25.AppRegistry.getAppKeys().includes(appName);
|
|
1366
1399
|
if (!isRegistered) {
|
|
1367
1400
|
import_analytics.Analytics.init({
|
|
1368
|
-
logger: (params) => void (0,
|
|
1401
|
+
logger: (params) => void (0, import_native_modules14.eventLog)(params),
|
|
1369
1402
|
debug: analytics?.debug ?? __DEV__
|
|
1370
1403
|
});
|
|
1371
|
-
const App =
|
|
1404
|
+
const App = import_react_native24.Granite.registerApp(AppsInTossContainer.bind(null, container), {
|
|
1372
1405
|
appName,
|
|
1373
1406
|
context,
|
|
1374
|
-
setIosSwipeGestureEnabled:
|
|
1407
|
+
setIosSwipeGestureEnabled: import_native_modules14.setIosSwipeGestureEnabled,
|
|
1375
1408
|
router: {
|
|
1376
1409
|
screenContainer: AppsInTossScreenContainer,
|
|
1377
1410
|
defaultScreenOption: {
|
|
@@ -1385,7 +1418,7 @@ function registerApp(container, { context, analytics }) {
|
|
|
1385
1418
|
}
|
|
1386
1419
|
function AppsInTossScreenContainer({ children }) {
|
|
1387
1420
|
const isRNApp = getAppsInTossGlobals().webViewType == null;
|
|
1388
|
-
return /* @__PURE__ */ (0,
|
|
1421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(NavigationBarContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_analytics.Analytics.Screen, { children: isRNApp ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RNAppContainer, { children }) : children }) });
|
|
1389
1422
|
}
|
|
1390
1423
|
function getAppName() {
|
|
1391
1424
|
try {
|
|
@@ -1402,32 +1435,32 @@ var AppsInToss = {
|
|
|
1402
1435
|
};
|
|
1403
1436
|
|
|
1404
1437
|
// src/components/WebView.tsx
|
|
1405
|
-
var
|
|
1438
|
+
var import_native_modules24 = require("@apps-in-toss/native-modules");
|
|
1406
1439
|
var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async-bridges"), 1);
|
|
1407
1440
|
var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
|
|
1408
1441
|
var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event-bridges"), 1);
|
|
1409
1442
|
var import_react_native_safe_area_context4 = require("@granite-js/native/react-native-safe-area-context");
|
|
1410
|
-
var
|
|
1443
|
+
var import_react_native39 = require("@granite-js/react-native");
|
|
1411
1444
|
var import_tds_react_native15 = require("@toss/tds-react-native");
|
|
1412
1445
|
var import_private9 = require("@toss/tds-react-native/private");
|
|
1413
1446
|
var import_react28 = require("react");
|
|
1414
|
-
var
|
|
1447
|
+
var import_react_native40 = require("react-native");
|
|
1415
1448
|
|
|
1416
1449
|
// src/components/GameWebView.tsx
|
|
1417
|
-
var
|
|
1450
|
+
var import_native_modules15 = require("@apps-in-toss/native-modules");
|
|
1418
1451
|
var import_react_native_webview = require("@granite-js/native/react-native-webview");
|
|
1419
1452
|
var import_react19 = require("react");
|
|
1420
|
-
var
|
|
1453
|
+
var import_react_native28 = require("react-native");
|
|
1421
1454
|
|
|
1422
1455
|
// src/components/NavigationBar/GameWebviewNavigationBar.tsx
|
|
1423
1456
|
var import_react_native_safe_area_context2 = require("@granite-js/native/react-native-safe-area-context");
|
|
1424
|
-
var
|
|
1457
|
+
var import_react_native26 = require("@granite-js/react-native");
|
|
1425
1458
|
var import_tds_react_native11 = require("@toss/tds-react-native");
|
|
1426
1459
|
var import_private7 = require("@toss/tds-react-native/private");
|
|
1427
1460
|
var import_es_hangul3 = require("es-hangul");
|
|
1428
1461
|
var import_react18 = require("react");
|
|
1429
|
-
var
|
|
1430
|
-
var
|
|
1462
|
+
var import_react_native27 = require("react-native");
|
|
1463
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1431
1464
|
function GameWebviewNavigationBar() {
|
|
1432
1465
|
const safeAreaTop = (0, import_private7.useSafeAreaTop)();
|
|
1433
1466
|
const { openConfirm } = (0, import_tds_react_native11.useDialog)();
|
|
@@ -1449,18 +1482,18 @@ function GameWebviewNavigationBar() {
|
|
|
1449
1482
|
logging.closePopupCtaClick(isConfirmed);
|
|
1450
1483
|
if (isConfirmed) {
|
|
1451
1484
|
captureExitLog(Date.now());
|
|
1452
|
-
(0,
|
|
1485
|
+
(0, import_react_native26.closeView)();
|
|
1453
1486
|
}
|
|
1454
1487
|
}, [captureExitLog, global2.brandDisplayName, logging, openConfirm]);
|
|
1455
|
-
return /* @__PURE__ */ (0,
|
|
1456
|
-
/* @__PURE__ */ (0,
|
|
1457
|
-
/* @__PURE__ */ (0,
|
|
1458
|
-
|
|
1488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
1489
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_tds_react_native11.PageNavbar, { preference: { type: "none" } }),
|
|
1490
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1491
|
+
import_react_native27.View,
|
|
1459
1492
|
{
|
|
1460
1493
|
style: {
|
|
1461
1494
|
width: "100%",
|
|
1462
1495
|
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1463
|
-
height:
|
|
1496
|
+
height: import_react_native27.Platform.OS === "ios" ? 44 : 54,
|
|
1464
1497
|
flexDirection: "row",
|
|
1465
1498
|
alignItems: "center",
|
|
1466
1499
|
justifyContent: "flex-end",
|
|
@@ -1470,7 +1503,7 @@ function GameWebviewNavigationBar() {
|
|
|
1470
1503
|
paddingRight: safeAreaRight + 10
|
|
1471
1504
|
},
|
|
1472
1505
|
pointerEvents: "box-none",
|
|
1473
|
-
children: /* @__PURE__ */ (0,
|
|
1506
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1474
1507
|
import_private7.NavigationRightContent,
|
|
1475
1508
|
{
|
|
1476
1509
|
fixedRightButton: navigationRightButton,
|
|
@@ -1487,20 +1520,20 @@ function GameWebviewNavigationBar() {
|
|
|
1487
1520
|
}
|
|
1488
1521
|
|
|
1489
1522
|
// src/components/GameWebView.tsx
|
|
1490
|
-
var
|
|
1523
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1491
1524
|
var GameWebView = (0, import_react19.forwardRef)(function GameWebView2(props, ref) {
|
|
1492
1525
|
(0, import_react19.useEffect)(() => {
|
|
1493
|
-
if (
|
|
1494
|
-
(0,
|
|
1526
|
+
if (import_react_native28.Platform.OS === "ios") {
|
|
1527
|
+
(0, import_native_modules15.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1495
1528
|
return () => {
|
|
1496
|
-
(0,
|
|
1529
|
+
(0, import_native_modules15.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1497
1530
|
};
|
|
1498
1531
|
}
|
|
1499
1532
|
return;
|
|
1500
1533
|
}, []);
|
|
1501
|
-
return /* @__PURE__ */ (0,
|
|
1502
|
-
/* @__PURE__ */ (0,
|
|
1503
|
-
(0,
|
|
1534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1535
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GameWebviewNavigationBar, {}),
|
|
1536
|
+
(0, import_native_modules15.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GameInitializer, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native_webview.WebView, { ref, ...props }) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native_webview.WebView, { ref, ...props })
|
|
1504
1537
|
] });
|
|
1505
1538
|
});
|
|
1506
1539
|
|
|
@@ -1509,12 +1542,12 @@ var import_react_native_webview2 = require("@granite-js/native/react-native-webv
|
|
|
1509
1542
|
var import_react21 = require("react");
|
|
1510
1543
|
|
|
1511
1544
|
// src/components/NavigationBar/PartnerWebviewNavigationBar.tsx
|
|
1512
|
-
var
|
|
1545
|
+
var import_react_native29 = require("@granite-js/react-native");
|
|
1513
1546
|
var import_tds_react_native12 = require("@toss/tds-react-native");
|
|
1514
1547
|
var import_private8 = require("@toss/tds-react-native/private");
|
|
1515
1548
|
var import_es_hangul4 = require("es-hangul");
|
|
1516
1549
|
var import_react20 = require("react");
|
|
1517
|
-
var
|
|
1550
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1518
1551
|
function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
1519
1552
|
const globals = getAppsInTossGlobals();
|
|
1520
1553
|
const { captureExitLog } = useCaptureExitLog();
|
|
@@ -1537,10 +1570,10 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1537
1570
|
logging.closePopupCtaClick(isConfirmed);
|
|
1538
1571
|
if (isConfirmed) {
|
|
1539
1572
|
captureExitLog(Date.now());
|
|
1540
|
-
(0,
|
|
1573
|
+
(0, import_react_native29.closeView)();
|
|
1541
1574
|
}
|
|
1542
1575
|
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
1543
|
-
return /* @__PURE__ */ (0,
|
|
1576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1544
1577
|
import_private8.TopNavigation,
|
|
1545
1578
|
{
|
|
1546
1579
|
title: globals.brandDisplayName,
|
|
@@ -1552,17 +1585,17 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1552
1585
|
withHome: withHomeButton,
|
|
1553
1586
|
fixedRightButton: navigationRightButton,
|
|
1554
1587
|
leftVisible: withBackButton,
|
|
1555
|
-
children: /* @__PURE__ */ (0,
|
|
1588
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_private8.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_private8.NavigationBackButton, { onPress: onBackButtonClick, canGoBack: false }) })
|
|
1556
1589
|
}
|
|
1557
1590
|
) });
|
|
1558
1591
|
}
|
|
1559
1592
|
|
|
1560
1593
|
// src/components/PartnerWebView.tsx
|
|
1561
|
-
var
|
|
1594
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1562
1595
|
var PartnerWebView = (0, import_react21.forwardRef)(function PartnerWebViewScreen({ onBackButtonClick, onHomeButtonClick, ...webViewProps }, ref) {
|
|
1563
|
-
return /* @__PURE__ */ (0,
|
|
1564
|
-
/* @__PURE__ */ (0,
|
|
1565
|
-
/* @__PURE__ */ (0,
|
|
1596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
1597
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PartnerWebviewNavigationBar, { onBackButtonClick, onHomeButtonClick }),
|
|
1598
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native_webview2.WebView, { ref, ...webViewProps, style: { flex: 1 } })
|
|
1566
1599
|
] });
|
|
1567
1600
|
});
|
|
1568
1601
|
|
|
@@ -1580,7 +1613,7 @@ function convertIntentURL(url) {
|
|
|
1580
1613
|
}
|
|
1581
1614
|
|
|
1582
1615
|
// src/ads/fetchTossAd.ts
|
|
1583
|
-
var
|
|
1616
|
+
var import_native_modules16 = require("@apps-in-toss/native-modules");
|
|
1584
1617
|
|
|
1585
1618
|
// ../../../.yarn/cache/es-toolkit-npm-1.34.1-4cd6371dcb-aab6d07be3.zip/node_modules/es-toolkit/dist/function/noop.mjs
|
|
1586
1619
|
function noop() {
|
|
@@ -1602,7 +1635,7 @@ var sessionId = generateSessionId();
|
|
|
1602
1635
|
var ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1603
1636
|
var IOS_FETCH_TOSS_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1604
1637
|
var UNSUPPORTED_ERROR_MESSAGE = "This feature is not supported in the current environment";
|
|
1605
|
-
var ENVIRONMENT = (0,
|
|
1638
|
+
var ENVIRONMENT = (0, import_native_modules16.getOperationalEnvironment)();
|
|
1606
1639
|
function fetchTossAd(params) {
|
|
1607
1640
|
if (!fetchTossAd.isSupported()) {
|
|
1608
1641
|
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
@@ -1610,7 +1643,7 @@ function fetchTossAd(params) {
|
|
|
1610
1643
|
}
|
|
1611
1644
|
const { onEvent, onError, options } = params;
|
|
1612
1645
|
const { adGroupId } = options;
|
|
1613
|
-
const unregisterCallbacks =
|
|
1646
|
+
const unregisterCallbacks = import_native_modules16.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1614
1647
|
"fetchTossAd",
|
|
1615
1648
|
{ spaceUnitId: adGroupId, sessionId, sdkId: options.sdkId, availableStyleIds: options.availableStyleIds },
|
|
1616
1649
|
{
|
|
@@ -1628,14 +1661,14 @@ fetchTossAd.isSupported = () => {
|
|
|
1628
1661
|
if (ENVIRONMENT !== "toss") {
|
|
1629
1662
|
return false;
|
|
1630
1663
|
}
|
|
1631
|
-
return (0,
|
|
1664
|
+
return (0, import_native_modules16.isMinVersionSupported)({
|
|
1632
1665
|
android: ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION,
|
|
1633
1666
|
ios: IOS_FETCH_TOSS_AD_SUPPORTED_VERSION
|
|
1634
1667
|
});
|
|
1635
1668
|
};
|
|
1636
1669
|
|
|
1637
1670
|
// src/ads/integratedAd.ts
|
|
1638
|
-
var
|
|
1671
|
+
var import_native_modules18 = require("@apps-in-toss/native-modules");
|
|
1639
1672
|
|
|
1640
1673
|
// src/ads/generateRequestId.ts
|
|
1641
1674
|
function generateRequestId() {
|
|
@@ -1645,32 +1678,32 @@ function generateRequestId() {
|
|
|
1645
1678
|
}
|
|
1646
1679
|
|
|
1647
1680
|
// src/ads/getReferrer.ts
|
|
1648
|
-
var
|
|
1681
|
+
var import_react_native30 = require("@granite-js/react-native");
|
|
1649
1682
|
function getReferrer() {
|
|
1650
1683
|
try {
|
|
1651
|
-
return new URL((0,
|
|
1684
|
+
return new URL((0, import_react_native30.getSchemeUri)()).searchParams.get("referrer");
|
|
1652
1685
|
} catch {
|
|
1653
1686
|
return null;
|
|
1654
1687
|
}
|
|
1655
1688
|
}
|
|
1656
1689
|
|
|
1657
1690
|
// src/ads/remotes.ts
|
|
1658
|
-
var
|
|
1691
|
+
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
1659
1692
|
|
|
1660
1693
|
// src/ads/getIsDev.ts
|
|
1661
|
-
var
|
|
1694
|
+
var import_react_native31 = require("@granite-js/react-native");
|
|
1662
1695
|
function getIsDev() {
|
|
1663
1696
|
try {
|
|
1664
|
-
return new URL((0,
|
|
1697
|
+
return new URL((0, import_react_native31.getSchemeUri)()).searchParams.get("isDev") === "true";
|
|
1665
1698
|
} catch {
|
|
1666
1699
|
return false;
|
|
1667
1700
|
}
|
|
1668
1701
|
}
|
|
1669
1702
|
|
|
1670
1703
|
// src/ads/remotes.ts
|
|
1671
|
-
var OPERATIONAL_ENVIRONMENT = (0,
|
|
1672
|
-
var OS = (0,
|
|
1673
|
-
var APP_VER = (0,
|
|
1704
|
+
var OPERATIONAL_ENVIRONMENT = (0, import_native_modules17.getOperationalEnvironment)();
|
|
1705
|
+
var OS = (0, import_native_modules17.getPlatformOS)();
|
|
1706
|
+
var APP_VER = (0, import_native_modules17.getTossAppVersion)();
|
|
1674
1707
|
var ALPHA_EVENT_TRACKER_HTTP_ENDPOINT = "https://alpha-trillion.toss.im/trk/sdk-mediation/event";
|
|
1675
1708
|
var LIVE_EVENT_TRACKER_HTTP_ENDPOINT = "https://trillion.toss.im/trk/sdk-mediation/event";
|
|
1676
1709
|
function getPostEventTrackingUrl() {
|
|
@@ -1705,19 +1738,19 @@ var IOS_INTEGRATED_AD_SUPPORTED_VERSION = "5.244.1";
|
|
|
1705
1738
|
var UNSUPPORTED_ERROR_MESSAGE2 = "This feature is not supported in the current environment";
|
|
1706
1739
|
var INTG_AD_ADM_FALLBACK_RID_MAP = {};
|
|
1707
1740
|
function integratedAdIsSupported() {
|
|
1708
|
-
return (0,
|
|
1741
|
+
return (0, import_native_modules18.isMinVersionSupported)({
|
|
1709
1742
|
android: ANDROID_INTEGRATED_AD_SUPPORTED_VERSION,
|
|
1710
1743
|
ios: IOS_INTEGRATED_AD_SUPPORTED_VERSION
|
|
1711
1744
|
});
|
|
1712
1745
|
}
|
|
1713
1746
|
function generateLoadFullScreenAd(sdkId) {
|
|
1714
1747
|
const fn = (params) => {
|
|
1715
|
-
if (!
|
|
1748
|
+
if (!import_native_modules18.GoogleAdMob.loadAppsInTossAdMob.isSupported()) {
|
|
1716
1749
|
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
1717
1750
|
return noop;
|
|
1718
1751
|
}
|
|
1719
1752
|
if (!integratedAdIsSupported()) {
|
|
1720
|
-
return
|
|
1753
|
+
return import_native_modules18.GoogleAdMob.loadAppsInTossAdMob({
|
|
1721
1754
|
...params,
|
|
1722
1755
|
onEvent: (event) => {
|
|
1723
1756
|
if (event.type === "loaded") {
|
|
@@ -1755,7 +1788,7 @@ function generateLoadFullScreenAd(sdkId) {
|
|
|
1755
1788
|
const { onEvent, onError, options } = params;
|
|
1756
1789
|
const { adGroupId } = options;
|
|
1757
1790
|
const referrer = getReferrer();
|
|
1758
|
-
const unregisterCallbacks =
|
|
1791
|
+
const unregisterCallbacks = import_native_modules18.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1759
1792
|
"loadTossAdOrAdmob",
|
|
1760
1793
|
{ spaceUnitId: adGroupId, referrer, sessionId, sdkId },
|
|
1761
1794
|
{
|
|
@@ -1769,18 +1802,18 @@ function generateLoadFullScreenAd(sdkId) {
|
|
|
1769
1802
|
);
|
|
1770
1803
|
return unregisterCallbacks;
|
|
1771
1804
|
};
|
|
1772
|
-
fn.isSupported =
|
|
1805
|
+
fn.isSupported = import_native_modules18.GoogleAdMob.loadAppsInTossAdMob.isSupported;
|
|
1773
1806
|
return fn;
|
|
1774
1807
|
}
|
|
1775
1808
|
var loadFullScreenAd = generateLoadFullScreenAd("107");
|
|
1776
1809
|
var loadFullScreenAdForWeb = generateLoadFullScreenAd("107");
|
|
1777
1810
|
function showFullScreenAd(params) {
|
|
1778
|
-
if (!
|
|
1811
|
+
if (!import_native_modules18.GoogleAdMob.showAppsInTossAdMob.isSupported()) {
|
|
1779
1812
|
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
1780
1813
|
return noop;
|
|
1781
1814
|
}
|
|
1782
1815
|
if (!integratedAdIsSupported()) {
|
|
1783
|
-
return
|
|
1816
|
+
return import_native_modules18.GoogleAdMob.showAppsInTossAdMob({
|
|
1784
1817
|
...params,
|
|
1785
1818
|
onEvent: (event) => {
|
|
1786
1819
|
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] ?? "";
|
|
@@ -1879,7 +1912,7 @@ function showFullScreenAd(params) {
|
|
|
1879
1912
|
const { onEvent, onError, options } = params;
|
|
1880
1913
|
const { adGroupId } = options;
|
|
1881
1914
|
const referrer = getReferrer();
|
|
1882
|
-
const unregisterCallbacks =
|
|
1915
|
+
const unregisterCallbacks = import_native_modules18.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1883
1916
|
"showTossAdOrAdmob",
|
|
1884
1917
|
{ spaceUnitId: adGroupId, referrer, sessionId },
|
|
1885
1918
|
{
|
|
@@ -1911,14 +1944,14 @@ function showFullScreenAd(params) {
|
|
|
1911
1944
|
);
|
|
1912
1945
|
return unregisterCallbacks;
|
|
1913
1946
|
}
|
|
1914
|
-
showFullScreenAd.isSupported =
|
|
1947
|
+
showFullScreenAd.isSupported = import_native_modules18.GoogleAdMob.showAppsInTossAdMob.isSupported;
|
|
1915
1948
|
|
|
1916
1949
|
// src/ads/tossAdEventLog.ts
|
|
1917
|
-
var
|
|
1918
|
-
var
|
|
1950
|
+
var import_native_modules19 = require("@apps-in-toss/native-modules");
|
|
1951
|
+
var import_react_native32 = require("@granite-js/react-native");
|
|
1919
1952
|
async function tossAdEventLog(params) {
|
|
1920
1953
|
const referrer = getReferrer();
|
|
1921
|
-
const appName =
|
|
1954
|
+
const appName = import_react_native32.Granite.appName;
|
|
1922
1955
|
const eventLogParams = {
|
|
1923
1956
|
...params,
|
|
1924
1957
|
params: {
|
|
@@ -1927,7 +1960,7 @@ async function tossAdEventLog(params) {
|
|
|
1927
1960
|
app_name: appName
|
|
1928
1961
|
}
|
|
1929
1962
|
};
|
|
1930
|
-
return
|
|
1963
|
+
return import_native_modules19.INTERNAL__module.tossCoreEventLog(eventLogParams);
|
|
1931
1964
|
}
|
|
1932
1965
|
|
|
1933
1966
|
// src/bridge-handler/useBridgeHandler.tsx
|
|
@@ -2105,7 +2138,7 @@ function useSafeAreaInsetsEmitter() {
|
|
|
2105
2138
|
}
|
|
2106
2139
|
|
|
2107
2140
|
// src/core/hooks/useWebBackHandler.tsx
|
|
2108
|
-
var
|
|
2141
|
+
var import_react_native33 = require("@granite-js/react-native");
|
|
2109
2142
|
var import_tds_react_native13 = require("@toss/tds-react-native");
|
|
2110
2143
|
var import_es_hangul5 = require("es-hangul");
|
|
2111
2144
|
var import_react25 = require("react");
|
|
@@ -2163,7 +2196,7 @@ function useWebBackHandler(webViewInitialURL, webViewRef) {
|
|
|
2163
2196
|
hasBackEvent: hasWebBackEvent,
|
|
2164
2197
|
addEventListener: addWebBackEventListener,
|
|
2165
2198
|
removeEventListener: removeWebBackEventListener
|
|
2166
|
-
} = (0,
|
|
2199
|
+
} = (0, import_react_native33.useBackEventState)();
|
|
2167
2200
|
const logging = useNavigationBarLogging();
|
|
2168
2201
|
const { openConfirm } = (0, import_tds_react_native13.useDialog)();
|
|
2169
2202
|
const global2 = getAppsInTossGlobals();
|
|
@@ -2199,7 +2232,7 @@ function useWebBackHandler(webViewInitialURL, webViewRef) {
|
|
|
2199
2232
|
logging.closePopupCtaClick(isConfirmed);
|
|
2200
2233
|
if (isConfirmed) {
|
|
2201
2234
|
captureExitLog(Date.now());
|
|
2202
|
-
(0,
|
|
2235
|
+
(0, import_react_native33.closeView)();
|
|
2203
2236
|
}
|
|
2204
2237
|
}
|
|
2205
2238
|
}, [
|
|
@@ -2247,8 +2280,8 @@ function mergeRefs(...refs) {
|
|
|
2247
2280
|
}
|
|
2248
2281
|
|
|
2249
2282
|
// src/hooks/useCreateUserAgent.ts
|
|
2250
|
-
var
|
|
2251
|
-
var
|
|
2283
|
+
var import_native_modules20 = require("@apps-in-toss/native-modules");
|
|
2284
|
+
var import_react_native34 = require("react-native");
|
|
2252
2285
|
var FontA11yCategory = {
|
|
2253
2286
|
Large: "Large",
|
|
2254
2287
|
xLarge: "xLarge",
|
|
@@ -2381,9 +2414,9 @@ function useCreateUserAgent({
|
|
|
2381
2414
|
safeArea,
|
|
2382
2415
|
safeAreaBottomTransparency
|
|
2383
2416
|
}) {
|
|
2384
|
-
const platform = (0,
|
|
2385
|
-
const appVersion = (0,
|
|
2386
|
-
const { fontScale } = (0,
|
|
2417
|
+
const platform = (0, import_native_modules20.getPlatformOS)();
|
|
2418
|
+
const appVersion = (0, import_native_modules20.getTossAppVersion)();
|
|
2419
|
+
const { fontScale } = (0, import_react_native34.useWindowDimensions)();
|
|
2387
2420
|
const platformString = platform === "ios" ? "iPhone" : "Android phone";
|
|
2388
2421
|
const fontA11y = mapFontScaleToCategory(fontScale, platform);
|
|
2389
2422
|
const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
|
|
@@ -2404,17 +2437,17 @@ function useCreateUserAgent({
|
|
|
2404
2437
|
}
|
|
2405
2438
|
|
|
2406
2439
|
// src/hooks/useGeolocation.ts
|
|
2407
|
-
var
|
|
2408
|
-
var
|
|
2440
|
+
var import_native_modules21 = require("@apps-in-toss/native-modules");
|
|
2441
|
+
var import_react_native35 = require("@granite-js/react-native");
|
|
2409
2442
|
var import_react26 = require("react");
|
|
2410
2443
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
2411
|
-
const isVisible = (0,
|
|
2444
|
+
const isVisible = (0, import_react_native35.useVisibility)();
|
|
2412
2445
|
const [location, setLocation] = (0, import_react26.useState)(null);
|
|
2413
2446
|
(0, import_react26.useEffect)(() => {
|
|
2414
2447
|
if (!isVisible) {
|
|
2415
2448
|
return;
|
|
2416
2449
|
}
|
|
2417
|
-
return (0,
|
|
2450
|
+
return (0, import_native_modules21.startUpdateLocation)({
|
|
2418
2451
|
options: {
|
|
2419
2452
|
accuracy,
|
|
2420
2453
|
distanceInterval,
|
|
@@ -2428,11 +2461,11 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
2428
2461
|
}
|
|
2429
2462
|
|
|
2430
2463
|
// src/hooks/useWaitForReturnNavigator.tsx
|
|
2431
|
-
var
|
|
2464
|
+
var import_react_native36 = require("@granite-js/react-native");
|
|
2432
2465
|
var import_react27 = require("react");
|
|
2433
2466
|
function useWaitForReturnNavigator() {
|
|
2434
2467
|
const callbacks = (0, import_react27.useRef)([]).current;
|
|
2435
|
-
const navigation = (0,
|
|
2468
|
+
const navigation = (0, import_react_native36.useNavigation)();
|
|
2436
2469
|
const startNavigating = (0, import_react27.useCallback)(
|
|
2437
2470
|
(route, params) => {
|
|
2438
2471
|
return new Promise((resolve) => {
|
|
@@ -2453,7 +2486,7 @@ function useWaitForReturnNavigator() {
|
|
|
2453
2486
|
},
|
|
2454
2487
|
[callbacks]
|
|
2455
2488
|
);
|
|
2456
|
-
(0,
|
|
2489
|
+
(0, import_react_native36.useVisibilityChange)(handleVisibilityChange);
|
|
2457
2490
|
return startNavigating;
|
|
2458
2491
|
}
|
|
2459
2492
|
|
|
@@ -2467,8 +2500,8 @@ function useTopNavigation() {
|
|
|
2467
2500
|
}
|
|
2468
2501
|
|
|
2469
2502
|
// src/hooks/useWebViewMemoryDebug.tsx
|
|
2470
|
-
var
|
|
2471
|
-
var
|
|
2503
|
+
var import_native_modules22 = require("@apps-in-toss/native-modules");
|
|
2504
|
+
var import_react_native37 = require("@granite-js/react-native");
|
|
2472
2505
|
var import_tds_react_native14 = require("@toss/tds-react-native");
|
|
2473
2506
|
function useHandleWebViewProcessDidTerminate(webViewRef) {
|
|
2474
2507
|
const toast = (0, import_tds_react_native14.useToast)();
|
|
@@ -2491,20 +2524,20 @@ function webViewDebugLog(logName, params) {
|
|
|
2491
2524
|
log_type: "debug",
|
|
2492
2525
|
params: {
|
|
2493
2526
|
...params,
|
|
2494
|
-
app_name:
|
|
2527
|
+
app_name: import_react_native37.Granite.appName,
|
|
2495
2528
|
deployment_id: global2.deploymentId
|
|
2496
2529
|
}
|
|
2497
2530
|
};
|
|
2498
|
-
if ((0,
|
|
2499
|
-
|
|
2531
|
+
if ((0, import_native_modules22.getOperationalEnvironment)() === "toss") {
|
|
2532
|
+
import_native_modules22.INTERNAL__module.tossCoreEventLog(event);
|
|
2500
2533
|
} else {
|
|
2501
2534
|
console.log("[webViewDebugLog]", event);
|
|
2502
2535
|
}
|
|
2503
2536
|
}
|
|
2504
2537
|
|
|
2505
2538
|
// src/utils/log.ts
|
|
2506
|
-
var
|
|
2507
|
-
var
|
|
2539
|
+
var import_native_modules23 = require("@apps-in-toss/native-modules");
|
|
2540
|
+
var import_react_native38 = require("@granite-js/react-native");
|
|
2508
2541
|
|
|
2509
2542
|
// src/utils/extractDateFromUUIDv7.ts
|
|
2510
2543
|
var extractDateFromUUIDv7 = (uuid) => {
|
|
@@ -2530,7 +2563,7 @@ var getGroupId = (url) => {
|
|
|
2530
2563
|
};
|
|
2531
2564
|
var getReferrer2 = () => {
|
|
2532
2565
|
try {
|
|
2533
|
-
const referrer = new URL((0,
|
|
2566
|
+
const referrer = new URL((0, import_react_native38.getSchemeUri)());
|
|
2534
2567
|
return referrer.searchParams.get("referrer");
|
|
2535
2568
|
} catch {
|
|
2536
2569
|
return "";
|
|
@@ -2548,11 +2581,11 @@ var trackScreen = (url) => {
|
|
|
2548
2581
|
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
2549
2582
|
}
|
|
2550
2583
|
};
|
|
2551
|
-
return (0,
|
|
2584
|
+
return (0, import_native_modules23.eventLog)(log);
|
|
2552
2585
|
};
|
|
2553
2586
|
|
|
2554
2587
|
// src/components/WebView.tsx
|
|
2555
|
-
var
|
|
2588
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2556
2589
|
var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
|
|
2557
2590
|
var TYPES = ["partner", "external", "game"];
|
|
2558
2591
|
var WEBVIEW_TYPES = {
|
|
@@ -2562,7 +2595,7 @@ var WEBVIEW_TYPES = {
|
|
|
2562
2595
|
};
|
|
2563
2596
|
function mergeSchemeQueryParamsInto(url) {
|
|
2564
2597
|
const baseUrl = new URL(url);
|
|
2565
|
-
const schemeUrl = new URL((0,
|
|
2598
|
+
const schemeUrl = new URL((0, import_react_native39.getSchemeUri)());
|
|
2566
2599
|
baseUrl.pathname = schemeUrl.pathname;
|
|
2567
2600
|
for (const [key, value] of schemeUrl.searchParams.entries()) {
|
|
2568
2601
|
baseUrl.searchParams.set(key, value);
|
|
@@ -2574,7 +2607,7 @@ function getWebViewURL(local) {
|
|
|
2574
2607
|
const devUrl = `http://${local.host}:${local.port}`;
|
|
2575
2608
|
return mergeSchemeQueryParamsInto(devUrl);
|
|
2576
2609
|
}
|
|
2577
|
-
const { url: rawUrl } =
|
|
2610
|
+
const { url: rawUrl } = import_native_modules24.AppsInTossModule.getWebBundleURL({});
|
|
2578
2611
|
const url = mergeSchemeQueryParamsInto(rawUrl);
|
|
2579
2612
|
const deploymentId = env.getDeploymentId();
|
|
2580
2613
|
if (deploymentId) {
|
|
@@ -2609,7 +2642,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2609
2642
|
webBackHandler.removeEventListener(onEvent);
|
|
2610
2643
|
};
|
|
2611
2644
|
},
|
|
2612
|
-
updateLocationEvent: ({ onEvent, onError, options }) =>
|
|
2645
|
+
updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules24.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
2613
2646
|
safeAreaInsetsChange: ({ onEvent }) => {
|
|
2614
2647
|
safeAreaInsetsEmitter.on("safeAreaInsetsChange", onEvent);
|
|
2615
2648
|
return () => {
|
|
@@ -2617,18 +2650,18 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2617
2650
|
};
|
|
2618
2651
|
},
|
|
2619
2652
|
/** @internal */
|
|
2620
|
-
appBridgeCallbackEvent: ({ onEvent, onError, options }) =>
|
|
2653
|
+
appBridgeCallbackEvent: ({ onEvent, onError, options }) => import_native_modules24.appsInTossEvent.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
|
|
2621
2654
|
/** AdMobV2 */
|
|
2622
|
-
loadAppsInTossAdMob:
|
|
2623
|
-
showAppsInTossAdMob:
|
|
2655
|
+
loadAppsInTossAdMob: import_native_modules24.GoogleAdMob.loadAppsInTossAdMob,
|
|
2656
|
+
showAppsInTossAdMob: import_native_modules24.GoogleAdMob.showAppsInTossAdMob,
|
|
2624
2657
|
/** IntegratedAd */
|
|
2625
2658
|
loadFullScreenAd: loadFullScreenAdForWeb,
|
|
2626
2659
|
showFullScreenAd,
|
|
2627
2660
|
/** TossAd */
|
|
2628
2661
|
fetchTossAd,
|
|
2629
2662
|
/** IAP */
|
|
2630
|
-
iapCreateOneTimePurchaseOrder:
|
|
2631
|
-
requestOneTimePurchase:
|
|
2663
|
+
iapCreateOneTimePurchaseOrder: import_native_modules24.IAP.createOneTimePurchaseOrder,
|
|
2664
|
+
requestOneTimePurchase: import_native_modules24.requestOneTimePurchase
|
|
2632
2665
|
},
|
|
2633
2666
|
constantHandlerMap: {
|
|
2634
2667
|
...appsInTossConstantBridges,
|
|
@@ -2639,11 +2672,11 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2639
2672
|
right: insets.right
|
|
2640
2673
|
}),
|
|
2641
2674
|
...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
|
|
2642
|
-
getServerTime_isSupported:
|
|
2675
|
+
getServerTime_isSupported: import_native_modules24.getServerTime.isSupported,
|
|
2643
2676
|
/** AdMobV2 */
|
|
2644
|
-
loadAppsInTossAdMob_isSupported:
|
|
2645
|
-
showAppsInTossAdMob_isSupported:
|
|
2646
|
-
isAppsInTossAdMobLoaded_isSupported:
|
|
2677
|
+
loadAppsInTossAdMob_isSupported: import_native_modules24.GoogleAdMob.loadAppsInTossAdMob.isSupported,
|
|
2678
|
+
showAppsInTossAdMob_isSupported: import_native_modules24.GoogleAdMob.showAppsInTossAdMob.isSupported,
|
|
2679
|
+
isAppsInTossAdMobLoaded_isSupported: import_native_modules24.GoogleAdMob.isAppsInTossAdMobLoaded.isSupported,
|
|
2647
2680
|
/** IntegratedAd */
|
|
2648
2681
|
loadFullScreenAd_isSupported: loadFullScreenAdForWeb.isSupported,
|
|
2649
2682
|
showFullScreenAd_isSupported: showFullScreenAd.isSupported,
|
|
@@ -2654,7 +2687,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2654
2687
|
},
|
|
2655
2688
|
asyncHandlerMap: {
|
|
2656
2689
|
...appsInTossAsyncBridges,
|
|
2657
|
-
getServerTime:
|
|
2690
|
+
getServerTime: import_native_modules24.getServerTime,
|
|
2658
2691
|
setIosSwipeGestureEnabled: (options) => {
|
|
2659
2692
|
setAllowsBackForwardNavigationGestures(options.isEnabled);
|
|
2660
2693
|
return appsInTossAsyncBridges.setIosSwipeGestureEnabled(options);
|
|
@@ -2672,19 +2705,19 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2672
2705
|
getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
|
|
2673
2706
|
openCamera: appsInTossAsyncBridges.openCamera,
|
|
2674
2707
|
/** Storage */
|
|
2675
|
-
getStorageItem:
|
|
2676
|
-
setStorageItem:
|
|
2677
|
-
removeStorageItem:
|
|
2678
|
-
clearItems:
|
|
2708
|
+
getStorageItem: import_native_modules24.Storage.getItem,
|
|
2709
|
+
setStorageItem: import_native_modules24.Storage.setItem,
|
|
2710
|
+
removeStorageItem: import_native_modules24.Storage.removeItem,
|
|
2711
|
+
clearItems: import_native_modules24.Storage.clearItems,
|
|
2679
2712
|
/** IAP */
|
|
2680
|
-
iapGetProductItemList:
|
|
2681
|
-
iapCreateOneTimePurchaseOrder:
|
|
2682
|
-
processProductGrant:
|
|
2683
|
-
getPendingOrders:
|
|
2684
|
-
getCompletedOrRefundedOrders:
|
|
2685
|
-
completeProductGrant:
|
|
2713
|
+
iapGetProductItemList: import_native_modules24.IAP.getProductItemList,
|
|
2714
|
+
iapCreateOneTimePurchaseOrder: import_native_modules24.iapCreateOneTimePurchaseOrder,
|
|
2715
|
+
processProductGrant: import_native_modules24.processProductGrant,
|
|
2716
|
+
getPendingOrders: import_native_modules24.IAP.getPendingOrders,
|
|
2717
|
+
getCompletedOrRefundedOrders: import_native_modules24.IAP.getCompletedOrRefundedOrders,
|
|
2718
|
+
completeProductGrant: import_native_modules24.IAP.completeProductGrant,
|
|
2686
2719
|
/** AdMobV2 */
|
|
2687
|
-
isAppsInTossAdMobLoaded:
|
|
2720
|
+
isAppsInTossAdMobLoaded: import_native_modules24.GoogleAdMob.isAppsInTossAdMobLoaded,
|
|
2688
2721
|
/** Toss Ads */
|
|
2689
2722
|
tossAdEventLog,
|
|
2690
2723
|
/** Private */
|
|
@@ -2717,12 +2750,12 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2717
2750
|
webBackHandler.handleWebBack();
|
|
2718
2751
|
return true;
|
|
2719
2752
|
};
|
|
2720
|
-
|
|
2721
|
-
return () =>
|
|
2753
|
+
import_react_native40.BackHandler.addEventListener("hardwareBackPress", callback);
|
|
2754
|
+
return () => import_react_native40.BackHandler.removeEventListener("hardwareBackPress", callback);
|
|
2722
2755
|
}, [webBackHandler]);
|
|
2723
2756
|
const globalScripts = useGlobalScripts();
|
|
2724
2757
|
const handleWebViewProcessDidTerminate = useHandleWebViewProcessDidTerminate(webViewRef);
|
|
2725
|
-
return /* @__PURE__ */ (0,
|
|
2758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2726
2759
|
BaseWebView,
|
|
2727
2760
|
{
|
|
2728
2761
|
ref: refs,
|
|
@@ -2744,14 +2777,14 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2744
2777
|
props.onNavigationStateChange?.(event);
|
|
2745
2778
|
webBackHandler.onNavigationStateChange(event);
|
|
2746
2779
|
},
|
|
2747
|
-
userAgent:
|
|
2780
|
+
userAgent: import_react_native40.Platform.OS === "ios" ? userAgent : void 0,
|
|
2748
2781
|
sharedCookiesEnabled: true,
|
|
2749
2782
|
webviewDebuggingEnabled: webViewDebuggingEnabled,
|
|
2750
2783
|
thirdPartyCookiesEnabled: true,
|
|
2751
2784
|
onMessage: handler.onMessage,
|
|
2752
2785
|
injectedJavaScript: globalScripts.afterLoad,
|
|
2753
2786
|
injectedJavaScriptBeforeContentLoaded: mergeScripts(handler.injectedJavaScript, globalScripts.beforeLoad),
|
|
2754
|
-
decelerationRate:
|
|
2787
|
+
decelerationRate: import_react_native40.Platform.OS === "ios" ? 1 : void 0,
|
|
2755
2788
|
allowsBackForwardNavigationGestures,
|
|
2756
2789
|
onShouldStartLoadWithRequest: (event) => {
|
|
2757
2790
|
try {
|
|
@@ -2759,7 +2792,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2759
2792
|
if (["https:", "http:"].includes(url2.protocol) || url2.href === "about:blank") {
|
|
2760
2793
|
return true;
|
|
2761
2794
|
} else {
|
|
2762
|
-
|
|
2795
|
+
import_react_native40.Linking.openURL(convertIntentURL(url2) ?? url2.href);
|
|
2763
2796
|
return false;
|
|
2764
2797
|
}
|
|
2765
2798
|
} catch (error) {
|