@apps-in-toss/framework 0.0.0-dev.1763036638916 → 0.0.0-dev.1764816865438
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 +693 -220
- package/dist/index.d.cts +66 -2
- package/dist/index.d.ts +66 -2
- package/dist/index.js +605 -134
- package/package.json +15 -15
package/dist/index.cjs
CHANGED
|
@@ -37,6 +37,8 @@ __export(src_exports, {
|
|
|
37
37
|
OverlayProvider: () => import_private10.OverlayProvider,
|
|
38
38
|
WebView: () => WebView,
|
|
39
39
|
env: () => env,
|
|
40
|
+
loadFullScreenAd: () => loadFullScreenAd,
|
|
41
|
+
showFullScreenAd: () => showFullScreenAd,
|
|
40
42
|
useCreateUserAgent: () => useCreateUserAgent,
|
|
41
43
|
useGeolocation: () => useGeolocation,
|
|
42
44
|
useOverlay: () => import_private10.useOverlay,
|
|
@@ -48,10 +50,10 @@ var import_analytics2 = require("@apps-in-toss/analytics");
|
|
|
48
50
|
|
|
49
51
|
// src/core/registerApp.tsx
|
|
50
52
|
var import_analytics = require("@apps-in-toss/analytics");
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
53
|
+
var import_native_modules14 = require("@apps-in-toss/native-modules");
|
|
54
|
+
var import_react_native23 = require("@granite-js/react-native");
|
|
55
|
+
var import_tds_react_native11 = require("@toss/tds-react-native");
|
|
56
|
+
var import_react_native24 = require("react-native");
|
|
55
57
|
|
|
56
58
|
// src/core/components/AppEvent.tsx
|
|
57
59
|
var import_native_modules2 = require("@apps-in-toss/native-modules");
|
|
@@ -277,9 +279,9 @@ function useAppsInTossBridge() {
|
|
|
277
279
|
}
|
|
278
280
|
|
|
279
281
|
// src/components/RNAppContainer.tsx
|
|
280
|
-
var
|
|
282
|
+
var import_native_modules13 = require("@apps-in-toss/native-modules");
|
|
281
283
|
var import_react18 = require("react");
|
|
282
|
-
var
|
|
284
|
+
var import_react_native22 = require("react-native");
|
|
283
285
|
|
|
284
286
|
// src/components/GameInitializer.tsx
|
|
285
287
|
var import_native_modules7 = require("@apps-in-toss/native-modules");
|
|
@@ -886,18 +888,22 @@ function useNavigationEvent() {
|
|
|
886
888
|
}
|
|
887
889
|
|
|
888
890
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
889
|
-
var
|
|
890
|
-
var
|
|
891
|
-
var
|
|
891
|
+
var import_native_modules12 = require("@apps-in-toss/native-modules");
|
|
892
|
+
var import_react_native20 = require("@granite-js/react-native");
|
|
893
|
+
var import_tds_react_native9 = require("@toss/tds-react-native");
|
|
892
894
|
var import_private4 = require("@toss/tds-react-native/private");
|
|
893
895
|
var import_react16 = require("react");
|
|
894
896
|
|
|
895
897
|
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
896
898
|
var import_native_modules10 = require("@apps-in-toss/native-modules");
|
|
897
|
-
var
|
|
899
|
+
var import_react_native17 = require("@granite-js/react-native");
|
|
900
|
+
var import_tds_react_native8 = require("@toss/tds-react-native");
|
|
901
|
+
var import_react_native18 = require("react-native");
|
|
902
|
+
|
|
903
|
+
// src/core/hooks/useMoreButtonBottomSheet/Menu.tsx
|
|
898
904
|
var import_tds_react_native7 = require("@toss/tds-react-native");
|
|
899
905
|
var import_private3 = require("@toss/tds-react-native/private");
|
|
900
|
-
var
|
|
906
|
+
var import_react_native16 = require("react-native");
|
|
901
907
|
|
|
902
908
|
// src/core/hooks/useMoreButtonBottomSheet/useMoreButtonBottomSheetLogging.tsx
|
|
903
909
|
var import_native_modules9 = require("@apps-in-toss/native-modules");
|
|
@@ -968,6 +974,82 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
968
974
|
};
|
|
969
975
|
}
|
|
970
976
|
|
|
977
|
+
// src/core/hooks/useMoreButtonBottomSheet/Menu.tsx
|
|
978
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
979
|
+
function Menu({ title, iconURL, onPress }) {
|
|
980
|
+
const globals = getAppsInTossGlobals();
|
|
981
|
+
const adaptive = (0, import_private3.useAdaptive)();
|
|
982
|
+
const iconName = getIconName(iconURL);
|
|
983
|
+
const logging = useMoreButtonBottomSheetLogging();
|
|
984
|
+
const brandPrimaryColorRGB = hexToRGB(globals.brandPrimaryColor);
|
|
985
|
+
const iconBackgroundColor = brandPrimaryColorRGB ? `rgba(${brandPrimaryColorRGB.join(",")},0.1)` : adaptive.grey100;
|
|
986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
987
|
+
import_tds_react_native7.ListRow,
|
|
988
|
+
{
|
|
989
|
+
left: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
990
|
+
import_react_native16.View,
|
|
991
|
+
{
|
|
992
|
+
style: {
|
|
993
|
+
width: 30,
|
|
994
|
+
height: 30,
|
|
995
|
+
borderRadius: 10,
|
|
996
|
+
flexDirection: "row",
|
|
997
|
+
alignItems: "center",
|
|
998
|
+
justifyContent: "center",
|
|
999
|
+
marginRight: 16,
|
|
1000
|
+
backgroundColor: iconBackgroundColor
|
|
1001
|
+
},
|
|
1002
|
+
children: iconName ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1003
|
+
import_tds_react_native7.Asset.Icon,
|
|
1004
|
+
{
|
|
1005
|
+
frameShape: { width: 20, height: 20 },
|
|
1006
|
+
color: globals.brandPrimaryColor,
|
|
1007
|
+
name: iconName
|
|
1008
|
+
}
|
|
1009
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1010
|
+
import_tds_react_native7.Asset.Image,
|
|
1011
|
+
{
|
|
1012
|
+
frameShape: { width: 20, height: 20 },
|
|
1013
|
+
source: { uri: iconURL }
|
|
1014
|
+
}
|
|
1015
|
+
)
|
|
1016
|
+
}
|
|
1017
|
+
),
|
|
1018
|
+
contents: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1019
|
+
import_tds_react_native7.ListRow.Texts,
|
|
1020
|
+
{
|
|
1021
|
+
type: "1RowTypeA",
|
|
1022
|
+
top: title,
|
|
1023
|
+
topProps: { color: adaptive.grey700 }
|
|
1024
|
+
}
|
|
1025
|
+
),
|
|
1026
|
+
verticalPadding: "extraSmall",
|
|
1027
|
+
onPress: () => {
|
|
1028
|
+
logging.menuClick({ title });
|
|
1029
|
+
onPress?.();
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
);
|
|
1033
|
+
}
|
|
1034
|
+
var iconNameRegExp = /^(icon-|icn-(?!(car|sec|bank-(fill|square|horizontal))-))(.+)/i;
|
|
1035
|
+
var iconURLRegExp = /^https:\/\/static\.toss\.im\/icons\/(png\/\dx|svg|pdf)\/((icon-|icn-(?!(car|sec|bank-(fill|square|horizontal))-))(.+))\.(png|svg|pdf)$/i;
|
|
1036
|
+
function isIconUrl(url) {
|
|
1037
|
+
return iconNameRegExp.test(url) || iconURLRegExp.test(url);
|
|
1038
|
+
}
|
|
1039
|
+
function getIconName(url) {
|
|
1040
|
+
if (!isIconUrl(url)) {
|
|
1041
|
+
return null;
|
|
1042
|
+
}
|
|
1043
|
+
if (iconNameRegExp.test(url)) {
|
|
1044
|
+
return url;
|
|
1045
|
+
}
|
|
1046
|
+
return url.match(iconURLRegExp)?.[2];
|
|
1047
|
+
}
|
|
1048
|
+
function hexToRGB(hex) {
|
|
1049
|
+
const rgb = hex.toLowerCase().match(/[0-9,a-f]{2}/g)?.map((str) => parseInt(str, 16));
|
|
1050
|
+
return rgb?.length === 3 ? rgb : void 0;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
971
1053
|
// src/core/utils/url.ts
|
|
972
1054
|
function addParamsToUrl(url, params) {
|
|
973
1055
|
const urlObj = new URL(url);
|
|
@@ -978,42 +1060,24 @@ function addParamsToUrl(url, params) {
|
|
|
978
1060
|
}
|
|
979
1061
|
|
|
980
1062
|
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
981
|
-
var
|
|
1063
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
982
1064
|
var SHARE_SCHEME_REFERRER = "appsintoss.common_module_share";
|
|
983
1065
|
var APP_SHARE_MENU_INFO = {
|
|
984
1066
|
contactItemName: "\uACF5\uC720\uD558\uAE30",
|
|
985
1067
|
contactIconUrl: "https://static.toss.im/icons/png/4x/icon-share-dots-mono.png"
|
|
986
1068
|
};
|
|
987
1069
|
function AppShareListMenu() {
|
|
988
|
-
const
|
|
989
|
-
const adaptive = (0, import_private3.useAdaptive)();
|
|
990
|
-
const logging = useMoreButtonBottomSheetLogging();
|
|
991
|
-
const initialScheme = (0, import_react_native16.getSchemeUri)();
|
|
1070
|
+
const initialScheme = (0, import_react_native17.getSchemeUri)();
|
|
992
1071
|
const isSandbox = (0, import_native_modules10.getOperationalEnvironment)() === "sandbox";
|
|
993
|
-
const { openConfirm } = (0,
|
|
1072
|
+
const { openConfirm } = (0, import_tds_react_native8.useDialog)();
|
|
994
1073
|
const schemeForShare = addParamsToUrl(initialScheme, {
|
|
995
1074
|
referrer: SHARE_SCHEME_REFERRER
|
|
996
1075
|
});
|
|
997
|
-
return /* @__PURE__ */ (0,
|
|
998
|
-
|
|
1076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1077
|
+
Menu,
|
|
999
1078
|
{
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
{
|
|
1003
|
-
color: globals.brandPrimaryColor,
|
|
1004
|
-
source: { uri: APP_SHARE_MENU_INFO.contactIconUrl },
|
|
1005
|
-
type: "background"
|
|
1006
|
-
}
|
|
1007
|
-
),
|
|
1008
|
-
contents: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1009
|
-
import_tds_react_native7.ListRow.Texts,
|
|
1010
|
-
{
|
|
1011
|
-
type: "1RowTypeA",
|
|
1012
|
-
top: APP_SHARE_MENU_INFO.contactItemName,
|
|
1013
|
-
topProps: { color: adaptive.grey700 }
|
|
1014
|
-
}
|
|
1015
|
-
),
|
|
1016
|
-
verticalPadding: "extraSmall",
|
|
1079
|
+
title: APP_SHARE_MENU_INFO.contactItemName,
|
|
1080
|
+
iconURL: APP_SHARE_MENU_INFO.contactIconUrl,
|
|
1017
1081
|
onPress: () => {
|
|
1018
1082
|
if (isSandbox) {
|
|
1019
1083
|
openConfirm({
|
|
@@ -1024,8 +1088,7 @@ function AppShareListMenu() {
|
|
|
1024
1088
|
});
|
|
1025
1089
|
return;
|
|
1026
1090
|
}
|
|
1027
|
-
|
|
1028
|
-
import_react_native17.NativeModules.AppsInTossModule.shareWithScheme({
|
|
1091
|
+
import_react_native18.NativeModules.AppsInTossModule.shareWithScheme({
|
|
1029
1092
|
params: {
|
|
1030
1093
|
schemeURL: schemeForShare
|
|
1031
1094
|
}
|
|
@@ -1035,6 +1098,25 @@ function AppShareListMenu() {
|
|
|
1035
1098
|
);
|
|
1036
1099
|
}
|
|
1037
1100
|
|
|
1101
|
+
// src/core/hooks/useMoreButtonBottomSheet/PermissionsMenu.tsx
|
|
1102
|
+
var import_native_modules11 = require("@apps-in-toss/native-modules");
|
|
1103
|
+
var import_react_native19 = require("@granite-js/react-native");
|
|
1104
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1105
|
+
function PermissionsMenu() {
|
|
1106
|
+
const globals = getAppsInTossGlobals();
|
|
1107
|
+
if ((0, import_native_modules11.getOperationalEnvironment)() === "sandbox") {
|
|
1108
|
+
return null;
|
|
1109
|
+
}
|
|
1110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1111
|
+
Menu,
|
|
1112
|
+
{
|
|
1113
|
+
title: "\uAD8C\uD55C \uC124\uC815",
|
|
1114
|
+
iconURL: "https://static.toss.im/icons/png/4x/icon-setting-mono.png",
|
|
1115
|
+
onPress: () => (0, import_react_native19.openURL)(`servicetoss://apps-in-toss-menu/permissions?appName=${import_react_native19.Granite.appName}&displayAppName=${globals.brandDisplayName}`)
|
|
1116
|
+
}
|
|
1117
|
+
);
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1038
1120
|
// src/core/utils/ensureValue.ts
|
|
1039
1121
|
function ensureValue(value, name) {
|
|
1040
1122
|
if (value === void 0) {
|
|
@@ -1044,7 +1126,7 @@ function ensureValue(value, name) {
|
|
|
1044
1126
|
}
|
|
1045
1127
|
|
|
1046
1128
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
1047
|
-
var
|
|
1129
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1048
1130
|
var APP_BRIDGE_METHOD_NAME = "getMiniAppsSupportContact";
|
|
1049
1131
|
var MIN_VERSION = {
|
|
1050
1132
|
BOTTOM_SHEET: {
|
|
@@ -1054,6 +1136,10 @@ var MIN_VERSION = {
|
|
|
1054
1136
|
SHARE_LIST_MENU: {
|
|
1055
1137
|
android: "5.230.0",
|
|
1056
1138
|
ios: "5.230.0"
|
|
1139
|
+
},
|
|
1140
|
+
PERMISSIONS_MENU: {
|
|
1141
|
+
android: "5.238.0",
|
|
1142
|
+
ios: "5.237.0"
|
|
1057
1143
|
}
|
|
1058
1144
|
};
|
|
1059
1145
|
function useMoreButtonBottomSheet() {
|
|
@@ -1064,13 +1150,14 @@ function useMoreButtonBottomSheet() {
|
|
|
1064
1150
|
const logging = useMoreButtonBottomSheetLogging();
|
|
1065
1151
|
const overlay = (0, import_private4.useOverlay)();
|
|
1066
1152
|
const title = ensureValue(globals.brandDisplayName, "displayName");
|
|
1067
|
-
const isBottomSheetSupported = (0,
|
|
1068
|
-
const isShareListMenuSupported = (0,
|
|
1153
|
+
const isBottomSheetSupported = (0, import_native_modules12.isMinVersionSupported)(MIN_VERSION.BOTTOM_SHEET);
|
|
1154
|
+
const isShareListMenuSupported = (0, import_native_modules12.isMinVersionSupported)(MIN_VERSION.SHARE_LIST_MENU);
|
|
1155
|
+
const [isPermissionsMenuSupported, setIsPermissionsMenuSupported] = (0, import_react16.useState)(false);
|
|
1069
1156
|
(0, import_react16.useEffect)(() => {
|
|
1070
1157
|
if (!isBottomSheetSupported) {
|
|
1071
1158
|
return;
|
|
1072
1159
|
}
|
|
1073
|
-
|
|
1160
|
+
import_native_modules12.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1074
1161
|
APP_BRIDGE_METHOD_NAME,
|
|
1075
1162
|
{},
|
|
1076
1163
|
{
|
|
@@ -1078,6 +1165,16 @@ function useMoreButtonBottomSheet() {
|
|
|
1078
1165
|
onError: (error) => console.error("\uBA54\uB274 \uBAA9\uB85D\uC744 \uAC00\uC838\uC624\uB294 \uB370 \uC2E4\uD328\uD588\uC5B4\uC694:", error)
|
|
1079
1166
|
}
|
|
1080
1167
|
);
|
|
1168
|
+
if ((0, import_native_modules12.isMinVersionSupported)(MIN_VERSION.PERMISSIONS_MENU)) {
|
|
1169
|
+
import_native_modules12.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1170
|
+
"getAllPermission",
|
|
1171
|
+
{},
|
|
1172
|
+
{
|
|
1173
|
+
onSuccess: (permissions) => setIsPermissionsMenuSupported(permissions.length > 0),
|
|
1174
|
+
onError: (error) => console.error("\uAD8C\uD55C \uBAA9\uB85D\uC744 \uAC00\uC838\uC624\uB294 \uB370 \uC2E4\uD328\uD588\uC5B4\uC694:", error)
|
|
1175
|
+
}
|
|
1176
|
+
);
|
|
1177
|
+
}
|
|
1081
1178
|
}, [isBottomSheetSupported]);
|
|
1082
1179
|
const onClickHandler = async () => {
|
|
1083
1180
|
logging.open();
|
|
@@ -1093,18 +1190,18 @@ function useMoreButtonBottomSheet() {
|
|
|
1093
1190
|
logging.close();
|
|
1094
1191
|
close();
|
|
1095
1192
|
};
|
|
1096
|
-
return /* @__PURE__ */ (0,
|
|
1097
|
-
|
|
1193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(BottomSheetImpressionArea, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1194
|
+
import_tds_react_native9.BottomSheet.Root,
|
|
1098
1195
|
{
|
|
1099
|
-
header: /* @__PURE__ */ (0,
|
|
1100
|
-
|
|
1196
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1197
|
+
import_tds_react_native9.ListHeader,
|
|
1101
1198
|
{
|
|
1102
|
-
title: /* @__PURE__ */ (0,
|
|
1199
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tds_react_native9.ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
|
|
1103
1200
|
}
|
|
1104
1201
|
),
|
|
1105
1202
|
open: isOpen,
|
|
1106
|
-
cta: /* @__PURE__ */ (0,
|
|
1107
|
-
|
|
1203
|
+
cta: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1204
|
+
import_tds_react_native9.BottomSheet.CTA,
|
|
1108
1205
|
{
|
|
1109
1206
|
size: "large",
|
|
1110
1207
|
type: "dark",
|
|
@@ -1117,37 +1214,20 @@ function useMoreButtonBottomSheet() {
|
|
|
1117
1214
|
),
|
|
1118
1215
|
onClose: handleClose,
|
|
1119
1216
|
onExited: exit,
|
|
1120
|
-
children: /* @__PURE__ */ (0,
|
|
1121
|
-
itemList.map(
|
|
1122
|
-
|
|
1123
|
-
|
|
1217
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_tds_react_native9.List, { rowSeparator: "none", children: [
|
|
1218
|
+
itemList.map(
|
|
1219
|
+
(item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1220
|
+
Menu,
|
|
1124
1221
|
{
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
color: globals.brandPrimaryColor,
|
|
1129
|
-
source: { uri: item.contactIconUrl },
|
|
1130
|
-
type: "background"
|
|
1131
|
-
}
|
|
1132
|
-
),
|
|
1133
|
-
contents: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1134
|
-
import_tds_react_native8.ListRow.Texts,
|
|
1135
|
-
{
|
|
1136
|
-
type: "1RowTypeA",
|
|
1137
|
-
top: item.contactItemName,
|
|
1138
|
-
topProps: { color: adaptive.grey700 }
|
|
1139
|
-
}
|
|
1140
|
-
),
|
|
1141
|
-
verticalPadding: "extraSmall",
|
|
1142
|
-
onPress: () => {
|
|
1143
|
-
logging.menuClick({ title: item.contactItemName });
|
|
1144
|
-
(0, import_react_native18.openURL)(item.contactUri);
|
|
1145
|
-
}
|
|
1222
|
+
title: item.contactItemName,
|
|
1223
|
+
iconURL: item.contactIconUrl,
|
|
1224
|
+
onPress: () => (0, import_react_native20.openURL)(item.contactUri)
|
|
1146
1225
|
},
|
|
1147
1226
|
item.contactItemName
|
|
1148
|
-
)
|
|
1149
|
-
|
|
1150
|
-
isShareListMenuSupported && /* @__PURE__ */ (0,
|
|
1227
|
+
)
|
|
1228
|
+
),
|
|
1229
|
+
isShareListMenuSupported && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AppShareListMenu, {}),
|
|
1230
|
+
isPermissionsMenuSupported && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PermissionsMenu, {})
|
|
1151
1231
|
] })
|
|
1152
1232
|
}
|
|
1153
1233
|
) });
|
|
@@ -1160,12 +1240,12 @@ function BottomSheetImpressionArea({ children }) {
|
|
|
1160
1240
|
(0, import_react16.useEffect)(() => {
|
|
1161
1241
|
logging.show();
|
|
1162
1242
|
}, [logging]);
|
|
1163
|
-
return /* @__PURE__ */ (0,
|
|
1243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children });
|
|
1164
1244
|
}
|
|
1165
1245
|
|
|
1166
1246
|
// src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
|
|
1167
1247
|
var import_react17 = require("react");
|
|
1168
|
-
var
|
|
1248
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1169
1249
|
function NavigationBarImpressionArea({
|
|
1170
1250
|
children,
|
|
1171
1251
|
withHomeButton
|
|
@@ -1178,11 +1258,11 @@ function NavigationBarImpressionArea({
|
|
|
1178
1258
|
hasLogged.current = true;
|
|
1179
1259
|
}
|
|
1180
1260
|
}, [logging, withHomeButton]);
|
|
1181
|
-
return /* @__PURE__ */ (0,
|
|
1261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children });
|
|
1182
1262
|
}
|
|
1183
1263
|
|
|
1184
1264
|
// src/components/NavigationBar/RNNavigationBar/Default.tsx
|
|
1185
|
-
var
|
|
1265
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1186
1266
|
function DefaultNavigationBar() {
|
|
1187
1267
|
const globals = getAppsInTossGlobals();
|
|
1188
1268
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
@@ -1192,7 +1272,7 @@ function DefaultNavigationBar() {
|
|
|
1192
1272
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1193
1273
|
const navigationEvent = useNavigationEvent();
|
|
1194
1274
|
useHardwareBackPress(navigationEvent.handleBack);
|
|
1195
|
-
return /* @__PURE__ */ (0,
|
|
1275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1196
1276
|
import_private5.TopNavigation,
|
|
1197
1277
|
{
|
|
1198
1278
|
title: globals.brandDisplayName,
|
|
@@ -1203,17 +1283,18 @@ function DefaultNavigationBar() {
|
|
|
1203
1283
|
onPressClose: navigationEvent.handleCloseButtonClick,
|
|
1204
1284
|
withHome: withHomeButton,
|
|
1205
1285
|
fixedRightButton: navigationRightButton,
|
|
1206
|
-
|
|
1286
|
+
leftVisible: withBackButton,
|
|
1287
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_private5.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_private5.NavigationBackButton, { onPress: navigationEvent.handleBack, canGoBack: false }) })
|
|
1207
1288
|
}
|
|
1208
1289
|
) });
|
|
1209
1290
|
}
|
|
1210
1291
|
|
|
1211
1292
|
// src/components/NavigationBar/RNNavigationBar/Game.tsx
|
|
1212
1293
|
var import_react_native_safe_area_context = require("@granite-js/native/react-native-safe-area-context");
|
|
1213
|
-
var
|
|
1294
|
+
var import_tds_react_native10 = require("@toss/tds-react-native");
|
|
1214
1295
|
var import_private6 = require("@toss/tds-react-native/private");
|
|
1215
|
-
var
|
|
1216
|
-
var
|
|
1296
|
+
var import_react_native21 = require("react-native");
|
|
1297
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1217
1298
|
function GameNavigationBar() {
|
|
1218
1299
|
const safeAreaTop = (0, import_private6.useSafeAreaTop)();
|
|
1219
1300
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
@@ -1221,15 +1302,15 @@ function GameNavigationBar() {
|
|
|
1221
1302
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1222
1303
|
const { right: safeAreaRight } = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
|
|
1223
1304
|
useHardwareBackPress(navigationEvent.handleBack);
|
|
1224
|
-
return /* @__PURE__ */ (0,
|
|
1225
|
-
/* @__PURE__ */ (0,
|
|
1226
|
-
/* @__PURE__ */ (0,
|
|
1227
|
-
|
|
1305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1306
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_tds_react_native10.PageNavbar, { preference: { type: "none" } }),
|
|
1307
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1308
|
+
import_react_native21.View,
|
|
1228
1309
|
{
|
|
1229
1310
|
style: {
|
|
1230
1311
|
width: "100%",
|
|
1231
1312
|
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1232
|
-
height:
|
|
1313
|
+
height: import_react_native21.Platform.OS === "ios" ? 44 : 54,
|
|
1233
1314
|
flexDirection: "row",
|
|
1234
1315
|
alignItems: "center",
|
|
1235
1316
|
justifyContent: "flex-end",
|
|
@@ -1239,7 +1320,7 @@ function GameNavigationBar() {
|
|
|
1239
1320
|
paddingRight: safeAreaRight + 10
|
|
1240
1321
|
},
|
|
1241
1322
|
pointerEvents: "box-none",
|
|
1242
|
-
children: /* @__PURE__ */ (0,
|
|
1323
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1243
1324
|
import_private6.NavigationRightContent,
|
|
1244
1325
|
{
|
|
1245
1326
|
fixedRightButton: navigationRightButton,
|
|
@@ -1266,83 +1347,83 @@ __reExport(bridge_entry_exports, require("@apps-in-toss/native-modules/constant-
|
|
|
1266
1347
|
__reExport(bridge_entry_exports, require("@apps-in-toss/native-modules/event-bridges"));
|
|
1267
1348
|
|
|
1268
1349
|
// src/components/RNAppContainer.tsx
|
|
1269
|
-
var
|
|
1350
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1270
1351
|
function RNAppContainer({ children }) {
|
|
1271
1352
|
const global2 = getAppsInTossGlobals();
|
|
1272
1353
|
switch (global2.appType) {
|
|
1273
1354
|
case "game":
|
|
1274
|
-
return /* @__PURE__ */ (0,
|
|
1355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GameAppContainer, { children });
|
|
1275
1356
|
case "general":
|
|
1276
1357
|
default:
|
|
1277
|
-
return /* @__PURE__ */ (0,
|
|
1358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GeneralAppContainer, { children });
|
|
1278
1359
|
}
|
|
1279
1360
|
}
|
|
1280
1361
|
function GameAppContainer({ children }) {
|
|
1281
1362
|
const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react18.useState)(false);
|
|
1282
1363
|
(0, import_react18.useEffect)(() => {
|
|
1283
|
-
if (
|
|
1284
|
-
(0,
|
|
1364
|
+
if (import_react_native22.Platform.OS === "ios") {
|
|
1365
|
+
(0, import_native_modules13.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1285
1366
|
return () => {
|
|
1286
|
-
(0,
|
|
1367
|
+
(0, import_native_modules13.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1287
1368
|
};
|
|
1288
1369
|
}
|
|
1289
1370
|
return;
|
|
1290
1371
|
}, []);
|
|
1291
1372
|
(0, import_react18.useEffect)(() => {
|
|
1292
|
-
|
|
1373
|
+
import_native_modules13.appsInTossEvent.addEventListener("entryMessageExited", {
|
|
1293
1374
|
onEvent: () => {
|
|
1294
1375
|
setIsEntryMessageExited(true);
|
|
1295
1376
|
}
|
|
1296
1377
|
});
|
|
1297
1378
|
}, []);
|
|
1298
|
-
return /* @__PURE__ */ (0,
|
|
1299
|
-
/* @__PURE__ */ (0,
|
|
1300
|
-
(0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0,
|
|
1379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RNNavigationBar.Game, {}),
|
|
1381
|
+
(0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GameInitializer, { isReadyForProfileUI: isEntryMessageExited, children }) : children
|
|
1301
1382
|
] });
|
|
1302
1383
|
}
|
|
1303
1384
|
function GeneralAppContainer({ children }) {
|
|
1304
|
-
return /* @__PURE__ */ (0,
|
|
1305
|
-
/* @__PURE__ */ (0,
|
|
1385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1386
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RNNavigationBar.Default, {}),
|
|
1306
1387
|
children
|
|
1307
1388
|
] });
|
|
1308
1389
|
}
|
|
1309
1390
|
|
|
1310
1391
|
// src/core/registerApp.tsx
|
|
1311
|
-
var
|
|
1392
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1312
1393
|
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
1313
|
-
if (!(0,
|
|
1394
|
+
if (!(0, import_native_modules14.isMinVersionSupported)({
|
|
1314
1395
|
android: "5.220.0",
|
|
1315
1396
|
ios: "5.221.0"
|
|
1316
1397
|
})) {
|
|
1317
|
-
return /* @__PURE__ */ (0,
|
|
1318
|
-
/* @__PURE__ */ (0,
|
|
1319
|
-
/* @__PURE__ */ (0,
|
|
1320
|
-
/* @__PURE__ */ (0,
|
|
1398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1399
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.Entry, {}),
|
|
1400
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.System, { ...initialProps }),
|
|
1401
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppUpdate, {})
|
|
1321
1402
|
] });
|
|
1322
1403
|
}
|
|
1323
|
-
return /* @__PURE__ */ (0,
|
|
1324
|
-
/* @__PURE__ */ (0,
|
|
1325
|
-
/* @__PURE__ */ (0,
|
|
1326
|
-
/* @__PURE__ */ (0,
|
|
1327
|
-
/* @__PURE__ */ (0,
|
|
1404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1405
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.StayTime, {}),
|
|
1406
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.Entry, {}),
|
|
1407
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.System, { ...initialProps }),
|
|
1408
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_tds_react_native11.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TDSContainer, { ...initialProps, children }) }) })
|
|
1328
1409
|
] });
|
|
1329
1410
|
}
|
|
1330
1411
|
function TDSContainer({ children }) {
|
|
1331
1412
|
useAppsInTossBridge();
|
|
1332
|
-
return /* @__PURE__ */ (0,
|
|
1413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children });
|
|
1333
1414
|
}
|
|
1334
1415
|
function registerApp(container, { context, analytics }) {
|
|
1335
1416
|
const appName = getAppName();
|
|
1336
|
-
const isRegistered =
|
|
1417
|
+
const isRegistered = import_react_native24.AppRegistry.getAppKeys().includes(appName);
|
|
1337
1418
|
if (!isRegistered) {
|
|
1338
1419
|
import_analytics.Analytics.init({
|
|
1339
|
-
logger: (params) => void (0,
|
|
1420
|
+
logger: (params) => void (0, import_native_modules14.eventLog)(params),
|
|
1340
1421
|
debug: analytics?.debug ?? __DEV__
|
|
1341
1422
|
});
|
|
1342
|
-
const App =
|
|
1423
|
+
const App = import_react_native23.Granite.registerApp(AppsInTossContainer.bind(null, container), {
|
|
1343
1424
|
appName,
|
|
1344
1425
|
context,
|
|
1345
|
-
setIosSwipeGestureEnabled:
|
|
1426
|
+
setIosSwipeGestureEnabled: import_native_modules14.setIosSwipeGestureEnabled,
|
|
1346
1427
|
router: {
|
|
1347
1428
|
screenContainer: AppsInTossScreenContainer,
|
|
1348
1429
|
defaultScreenOption: {
|
|
@@ -1356,7 +1437,7 @@ function registerApp(container, { context, analytics }) {
|
|
|
1356
1437
|
}
|
|
1357
1438
|
function AppsInTossScreenContainer({ children }) {
|
|
1358
1439
|
const isRNApp = getAppsInTossGlobals().webViewType == null;
|
|
1359
|
-
return /* @__PURE__ */ (0,
|
|
1440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(NavigationBarContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_analytics.Analytics.Screen, { children: isRNApp ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RNAppContainer, { children }) : children }) });
|
|
1360
1441
|
}
|
|
1361
1442
|
function getAppName() {
|
|
1362
1443
|
try {
|
|
@@ -1373,35 +1454,35 @@ var AppsInToss = {
|
|
|
1373
1454
|
};
|
|
1374
1455
|
|
|
1375
1456
|
// src/components/WebView.tsx
|
|
1376
|
-
var
|
|
1457
|
+
var import_native_modules23 = require("@apps-in-toss/native-modules");
|
|
1377
1458
|
var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async-bridges"), 1);
|
|
1378
1459
|
var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
|
|
1379
1460
|
var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event-bridges"), 1);
|
|
1380
1461
|
var import_react_native_safe_area_context4 = require("@granite-js/native/react-native-safe-area-context");
|
|
1381
|
-
var
|
|
1382
|
-
var
|
|
1462
|
+
var import_react_native37 = require("@granite-js/react-native");
|
|
1463
|
+
var import_tds_react_native15 = require("@toss/tds-react-native");
|
|
1383
1464
|
var import_private9 = require("@toss/tds-react-native/private");
|
|
1384
1465
|
var import_react29 = require("react");
|
|
1385
|
-
var
|
|
1466
|
+
var import_react_native38 = require("react-native");
|
|
1386
1467
|
|
|
1387
1468
|
// src/components/GameWebView.tsx
|
|
1388
|
-
var
|
|
1469
|
+
var import_native_modules15 = require("@apps-in-toss/native-modules");
|
|
1389
1470
|
var import_react_native_webview = require("@granite-js/native/react-native-webview");
|
|
1390
1471
|
var import_react20 = require("react");
|
|
1391
|
-
var
|
|
1472
|
+
var import_react_native27 = require("react-native");
|
|
1392
1473
|
|
|
1393
1474
|
// src/components/NavigationBar/GameWebviewNavigationBar.tsx
|
|
1394
1475
|
var import_react_native_safe_area_context2 = require("@granite-js/native/react-native-safe-area-context");
|
|
1395
|
-
var
|
|
1396
|
-
var
|
|
1476
|
+
var import_react_native25 = require("@granite-js/react-native");
|
|
1477
|
+
var import_tds_react_native12 = require("@toss/tds-react-native");
|
|
1397
1478
|
var import_private7 = require("@toss/tds-react-native/private");
|
|
1398
1479
|
var import_es_hangul3 = require("es-hangul");
|
|
1399
1480
|
var import_react19 = require("react");
|
|
1400
|
-
var
|
|
1401
|
-
var
|
|
1481
|
+
var import_react_native26 = require("react-native");
|
|
1482
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1402
1483
|
function GameWebviewNavigationBar() {
|
|
1403
1484
|
const safeAreaTop = (0, import_private7.useSafeAreaTop)();
|
|
1404
|
-
const { openConfirm } = (0,
|
|
1485
|
+
const { openConfirm } = (0, import_tds_react_native12.useDialog)();
|
|
1405
1486
|
const { captureExitLog } = useCaptureExitLog();
|
|
1406
1487
|
const global2 = getAppsInTossGlobals();
|
|
1407
1488
|
const logging = useNavigationBarLogging();
|
|
@@ -1420,18 +1501,18 @@ function GameWebviewNavigationBar() {
|
|
|
1420
1501
|
logging.closePopupCtaClick(isConfirmed);
|
|
1421
1502
|
if (isConfirmed) {
|
|
1422
1503
|
captureExitLog(Date.now());
|
|
1423
|
-
(0,
|
|
1504
|
+
(0, import_react_native25.closeView)();
|
|
1424
1505
|
}
|
|
1425
1506
|
}, [captureExitLog, global2.brandDisplayName, logging, openConfirm]);
|
|
1426
|
-
return /* @__PURE__ */ (0,
|
|
1427
|
-
/* @__PURE__ */ (0,
|
|
1428
|
-
/* @__PURE__ */ (0,
|
|
1429
|
-
|
|
1507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1508
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_tds_react_native12.PageNavbar, { preference: { type: "none" } }),
|
|
1509
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1510
|
+
import_react_native26.View,
|
|
1430
1511
|
{
|
|
1431
1512
|
style: {
|
|
1432
1513
|
width: "100%",
|
|
1433
1514
|
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1434
|
-
height:
|
|
1515
|
+
height: import_react_native26.Platform.OS === "ios" ? 44 : 54,
|
|
1435
1516
|
flexDirection: "row",
|
|
1436
1517
|
alignItems: "center",
|
|
1437
1518
|
justifyContent: "flex-end",
|
|
@@ -1441,7 +1522,7 @@ function GameWebviewNavigationBar() {
|
|
|
1441
1522
|
paddingRight: safeAreaRight + 10
|
|
1442
1523
|
},
|
|
1443
1524
|
pointerEvents: "box-none",
|
|
1444
|
-
children: /* @__PURE__ */ (0,
|
|
1525
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1445
1526
|
import_private7.NavigationRightContent,
|
|
1446
1527
|
{
|
|
1447
1528
|
fixedRightButton: navigationRightButton,
|
|
@@ -1458,28 +1539,28 @@ function GameWebviewNavigationBar() {
|
|
|
1458
1539
|
}
|
|
1459
1540
|
|
|
1460
1541
|
// src/components/GameWebView.tsx
|
|
1461
|
-
var
|
|
1542
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1462
1543
|
var GameWebView = (0, import_react20.forwardRef)(function GameWebView2(props, ref) {
|
|
1463
1544
|
const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react20.useState)(false);
|
|
1464
1545
|
(0, import_react20.useEffect)(() => {
|
|
1465
|
-
if (
|
|
1466
|
-
(0,
|
|
1546
|
+
if (import_react_native27.Platform.OS === "ios") {
|
|
1547
|
+
(0, import_native_modules15.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1467
1548
|
return () => {
|
|
1468
|
-
(0,
|
|
1549
|
+
(0, import_native_modules15.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1469
1550
|
};
|
|
1470
1551
|
}
|
|
1471
1552
|
return;
|
|
1472
1553
|
}, []);
|
|
1473
1554
|
(0, import_react20.useEffect)(() => {
|
|
1474
|
-
|
|
1555
|
+
import_native_modules15.appsInTossEvent.addEventListener("entryMessageExited", {
|
|
1475
1556
|
onEvent: () => {
|
|
1476
1557
|
setIsEntryMessageExited(true);
|
|
1477
1558
|
}
|
|
1478
1559
|
});
|
|
1479
1560
|
}, []);
|
|
1480
|
-
return /* @__PURE__ */ (0,
|
|
1481
|
-
/* @__PURE__ */ (0,
|
|
1482
|
-
(0,
|
|
1561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
1562
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GameWebviewNavigationBar, {}),
|
|
1563
|
+
(0, import_native_modules15.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GameInitializer, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native_webview.WebView, { ref, ...props }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native_webview.WebView, { ref, ...props })
|
|
1483
1564
|
] });
|
|
1484
1565
|
});
|
|
1485
1566
|
|
|
@@ -1488,17 +1569,17 @@ var import_react_native_webview2 = require("@granite-js/native/react-native-webv
|
|
|
1488
1569
|
var import_react22 = require("react");
|
|
1489
1570
|
|
|
1490
1571
|
// src/components/NavigationBar/PartnerWebviewNavigationBar.tsx
|
|
1491
|
-
var
|
|
1492
|
-
var
|
|
1572
|
+
var import_react_native28 = require("@granite-js/react-native");
|
|
1573
|
+
var import_tds_react_native13 = require("@toss/tds-react-native");
|
|
1493
1574
|
var import_private8 = require("@toss/tds-react-native/private");
|
|
1494
1575
|
var import_es_hangul4 = require("es-hangul");
|
|
1495
1576
|
var import_react21 = require("react");
|
|
1496
|
-
var
|
|
1577
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1497
1578
|
function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
1498
1579
|
const globals = getAppsInTossGlobals();
|
|
1499
1580
|
const { captureExitLog } = useCaptureExitLog();
|
|
1500
1581
|
const logging = useNavigationBarLogging();
|
|
1501
|
-
const { openConfirm } = (0,
|
|
1582
|
+
const { openConfirm } = (0, import_tds_react_native13.useDialog)();
|
|
1502
1583
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1503
1584
|
const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
|
|
1504
1585
|
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
@@ -1516,10 +1597,10 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1516
1597
|
logging.closePopupCtaClick(isConfirmed);
|
|
1517
1598
|
if (isConfirmed) {
|
|
1518
1599
|
captureExitLog(Date.now());
|
|
1519
|
-
(0,
|
|
1600
|
+
(0, import_react_native28.closeView)();
|
|
1520
1601
|
}
|
|
1521
1602
|
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
1522
|
-
return /* @__PURE__ */ (0,
|
|
1603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1523
1604
|
import_private8.TopNavigation,
|
|
1524
1605
|
{
|
|
1525
1606
|
title: globals.brandDisplayName,
|
|
@@ -1530,20 +1611,383 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1530
1611
|
onPressClose: handleClose,
|
|
1531
1612
|
withHome: withHomeButton,
|
|
1532
1613
|
fixedRightButton: navigationRightButton,
|
|
1533
|
-
|
|
1614
|
+
leftVisible: withBackButton,
|
|
1615
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_private8.NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_private8.NavigationBackButton, { onPress: onBackButtonClick, canGoBack: false }) })
|
|
1534
1616
|
}
|
|
1535
1617
|
) });
|
|
1536
1618
|
}
|
|
1537
1619
|
|
|
1538
1620
|
// src/components/PartnerWebView.tsx
|
|
1539
|
-
var
|
|
1621
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1540
1622
|
var PartnerWebView = (0, import_react22.forwardRef)(function PartnerWebViewScreen({ onBackButtonClick, onHomeButtonClick, ...webViewProps }, ref) {
|
|
1541
|
-
return /* @__PURE__ */ (0,
|
|
1542
|
-
/* @__PURE__ */ (0,
|
|
1543
|
-
/* @__PURE__ */ (0,
|
|
1623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1624
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PartnerWebviewNavigationBar, { onBackButtonClick, onHomeButtonClick }),
|
|
1625
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native_webview2.WebView, { ref, ...webViewProps, style: { flex: 1 } })
|
|
1544
1626
|
] });
|
|
1545
1627
|
});
|
|
1546
1628
|
|
|
1629
|
+
// src/components/utils/url.ts
|
|
1630
|
+
function convertIntentURL(url) {
|
|
1631
|
+
if (url.protocol !== "intent:") {
|
|
1632
|
+
return null;
|
|
1633
|
+
}
|
|
1634
|
+
const components = url.hash.replace("#Intent;", "").split(";").map((component) => component.split("="));
|
|
1635
|
+
const scheme = components.find(([key]) => key === "scheme")?.[1];
|
|
1636
|
+
if (!scheme) {
|
|
1637
|
+
return null;
|
|
1638
|
+
}
|
|
1639
|
+
return `${scheme}://${url.hostname}${url.pathname}${url.search}`;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
// src/ads/fetchTossAd.ts
|
|
1643
|
+
var import_native_modules16 = require("@apps-in-toss/native-modules");
|
|
1644
|
+
|
|
1645
|
+
// ../../.yarn/cache/es-toolkit-npm-1.34.1-4cd6371dcb-aab6d07be3.zip/node_modules/es-toolkit/dist/function/noop.mjs
|
|
1646
|
+
function noop() {
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
// src/ads/generateSessionId.ts
|
|
1650
|
+
function generateSessionId() {
|
|
1651
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
1652
|
+
const r = Math.random() * 16 | 0;
|
|
1653
|
+
const v = c === "x" ? r : r & 3 | 8;
|
|
1654
|
+
return v.toString(16);
|
|
1655
|
+
});
|
|
1656
|
+
}
|
|
1657
|
+
|
|
1658
|
+
// src/ads/constants.ts
|
|
1659
|
+
var sessionId = generateSessionId();
|
|
1660
|
+
|
|
1661
|
+
// src/ads/fetchTossAd.ts
|
|
1662
|
+
var ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION = "5.239.0";
|
|
1663
|
+
var IOS_FETCH_TOSS_AD_SUPPORTED_VERSION = "5.239.0";
|
|
1664
|
+
var UNSUPPORTED_ERROR_MESSAGE = "This feature is not supported in the current environment";
|
|
1665
|
+
var ENVIRONMENT = (0, import_native_modules16.getOperationalEnvironment)();
|
|
1666
|
+
function fetchTossAd(params) {
|
|
1667
|
+
if (!fetchTossAd.isSupported()) {
|
|
1668
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
1669
|
+
return noop;
|
|
1670
|
+
}
|
|
1671
|
+
const { onEvent, onError, options } = params;
|
|
1672
|
+
const { adGroupId } = options;
|
|
1673
|
+
const unregisterCallbacks = import_native_modules16.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1674
|
+
"fetchTossAd",
|
|
1675
|
+
{ spaceUnitId: adGroupId, sessionId },
|
|
1676
|
+
{
|
|
1677
|
+
onSuccess: (response) => {
|
|
1678
|
+
onEvent(response);
|
|
1679
|
+
},
|
|
1680
|
+
onError: (error) => {
|
|
1681
|
+
onError(error);
|
|
1682
|
+
}
|
|
1683
|
+
}
|
|
1684
|
+
);
|
|
1685
|
+
return unregisterCallbacks;
|
|
1686
|
+
}
|
|
1687
|
+
fetchTossAd.isSupported = () => {
|
|
1688
|
+
if (ENVIRONMENT !== "toss") {
|
|
1689
|
+
return false;
|
|
1690
|
+
}
|
|
1691
|
+
return (0, import_native_modules16.isMinVersionSupported)({
|
|
1692
|
+
android: ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION,
|
|
1693
|
+
ios: IOS_FETCH_TOSS_AD_SUPPORTED_VERSION
|
|
1694
|
+
});
|
|
1695
|
+
};
|
|
1696
|
+
|
|
1697
|
+
// src/ads/integratedAd.ts
|
|
1698
|
+
var import_native_modules18 = require("@apps-in-toss/native-modules");
|
|
1699
|
+
|
|
1700
|
+
// src/ads/generateRequestId.ts
|
|
1701
|
+
function generateRequestId() {
|
|
1702
|
+
const timestamp = Date.now().toString(36).toUpperCase();
|
|
1703
|
+
const random = Math.random().toString(36).substring(2, 7).toUpperCase();
|
|
1704
|
+
return `ait-${timestamp}${random}`;
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
// src/ads/getReferrer.ts
|
|
1708
|
+
var import_react_native29 = require("@granite-js/react-native");
|
|
1709
|
+
function getReferrer() {
|
|
1710
|
+
try {
|
|
1711
|
+
return new URL((0, import_react_native29.getSchemeUri)()).searchParams.get("referrer");
|
|
1712
|
+
} catch {
|
|
1713
|
+
return null;
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
// src/ads/remotes.ts
|
|
1718
|
+
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
1719
|
+
|
|
1720
|
+
// src/ads/getIsDev.ts
|
|
1721
|
+
var import_react_native30 = require("@granite-js/react-native");
|
|
1722
|
+
function getIsDev() {
|
|
1723
|
+
try {
|
|
1724
|
+
return new URL((0, import_react_native30.getSchemeUri)()).searchParams.get("isDev") === "true";
|
|
1725
|
+
} catch {
|
|
1726
|
+
return false;
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
// src/ads/remotes.ts
|
|
1731
|
+
var OPERATIONAL_ENVIRONMENT = (0, import_native_modules17.getOperationalEnvironment)();
|
|
1732
|
+
var OS = (0, import_native_modules17.getPlatformOS)();
|
|
1733
|
+
var APP_VER = (0, import_native_modules17.getTossAppVersion)();
|
|
1734
|
+
var ALPHA_EVENT_TRACKER_HTTP_ENDPOINT = "https://alpha-trillion.toss.im/trk/sdk-mediation/event";
|
|
1735
|
+
var LIVE_EVENT_TRACKER_HTTP_ENDPOINT = "https://trillion.toss.im/trk/sdk-mediation/event";
|
|
1736
|
+
function getPostEventTrackingUrl() {
|
|
1737
|
+
const isDev = getIsDev();
|
|
1738
|
+
if (OPERATIONAL_ENVIRONMENT === "sandbox" || isDev) {
|
|
1739
|
+
return ALPHA_EVENT_TRACKER_HTTP_ENDPOINT;
|
|
1740
|
+
}
|
|
1741
|
+
return LIVE_EVENT_TRACKER_HTTP_ENDPOINT;
|
|
1742
|
+
}
|
|
1743
|
+
function postEventTracking(params) {
|
|
1744
|
+
const endpoint = getPostEventTrackingUrl();
|
|
1745
|
+
const bodyJSON = JSON.stringify({
|
|
1746
|
+
...params,
|
|
1747
|
+
os: OS,
|
|
1748
|
+
appVer: APP_VER,
|
|
1749
|
+
deviceIdType: "NONE",
|
|
1750
|
+
platform: "RN"
|
|
1751
|
+
});
|
|
1752
|
+
return fetch(
|
|
1753
|
+
endpoint,
|
|
1754
|
+
{
|
|
1755
|
+
method: "POST",
|
|
1756
|
+
headers: {
|
|
1757
|
+
"Content-Type": "application/json"
|
|
1758
|
+
},
|
|
1759
|
+
body: bodyJSON
|
|
1760
|
+
}
|
|
1761
|
+
).catch(noop);
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
// src/ads/integratedAd.ts
|
|
1765
|
+
var INTEGRATED_AD_SDK_VERSION = "0.0.0";
|
|
1766
|
+
var ANDROID_INTEGRATED_AD_SUPPORTED_VERSION = "5.239.0";
|
|
1767
|
+
var IOS_INTEGRATED_AD_SUPPORTED_VERSION = "5.239.0";
|
|
1768
|
+
var UNSUPPORTED_ERROR_MESSAGE2 = "This feature is not supported in the current environment";
|
|
1769
|
+
var INTG_AD_ADM_FALLBACK_RID_MAP = {};
|
|
1770
|
+
function integratedAdIsSupported() {
|
|
1771
|
+
return (0, import_native_modules18.isMinVersionSupported)({
|
|
1772
|
+
android: ANDROID_INTEGRATED_AD_SUPPORTED_VERSION,
|
|
1773
|
+
ios: IOS_INTEGRATED_AD_SUPPORTED_VERSION
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
function loadFullScreenAd(params) {
|
|
1777
|
+
if (!import_native_modules18.GoogleAdMob.loadAppsInTossAdMob.isSupported()) {
|
|
1778
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
1779
|
+
return noop;
|
|
1780
|
+
}
|
|
1781
|
+
if (!integratedAdIsSupported()) {
|
|
1782
|
+
return import_native_modules18.GoogleAdMob.loadAppsInTossAdMob({
|
|
1783
|
+
...params,
|
|
1784
|
+
onEvent: (event) => {
|
|
1785
|
+
if (event.type === "loaded") {
|
|
1786
|
+
const requestId = generateRequestId();
|
|
1787
|
+
INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] = requestId;
|
|
1788
|
+
postEventTracking({
|
|
1789
|
+
eventName: "LOAD",
|
|
1790
|
+
spaceUnitId: params.options.adGroupId,
|
|
1791
|
+
requestId,
|
|
1792
|
+
responseId: event.data.responseInfo.responseId,
|
|
1793
|
+
mediationType: "ADMOB",
|
|
1794
|
+
format: "",
|
|
1795
|
+
adSourceName: event.data.responseInfo.loadedAdNetworkInfo?.adSourceName ?? "",
|
|
1796
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1797
|
+
});
|
|
1798
|
+
}
|
|
1799
|
+
return params.onEvent(event);
|
|
1800
|
+
},
|
|
1801
|
+
onError: (error) => {
|
|
1802
|
+
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] ?? "";
|
|
1803
|
+
postEventTracking({
|
|
1804
|
+
eventName: "FAILED_TO_LOAD",
|
|
1805
|
+
spaceUnitId: params.options.adGroupId,
|
|
1806
|
+
requestId,
|
|
1807
|
+
responseId: "",
|
|
1808
|
+
mediationType: "ADMOB",
|
|
1809
|
+
format: "",
|
|
1810
|
+
adSourceName: "",
|
|
1811
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1812
|
+
});
|
|
1813
|
+
return params.onError(error);
|
|
1814
|
+
}
|
|
1815
|
+
});
|
|
1816
|
+
}
|
|
1817
|
+
const { onEvent, onError, options } = params;
|
|
1818
|
+
const { adGroupId } = options;
|
|
1819
|
+
const referrer = getReferrer();
|
|
1820
|
+
const unregisterCallbacks = import_native_modules18.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1821
|
+
"loadTossAdOrAdmob",
|
|
1822
|
+
{ spaceUnitId: adGroupId, referrer, sessionId },
|
|
1823
|
+
{
|
|
1824
|
+
onSuccess: () => {
|
|
1825
|
+
onEvent({ type: "loaded" });
|
|
1826
|
+
},
|
|
1827
|
+
onError: (error) => {
|
|
1828
|
+
onError(error);
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
);
|
|
1832
|
+
return unregisterCallbacks;
|
|
1833
|
+
}
|
|
1834
|
+
loadFullScreenAd.isSupported = import_native_modules18.GoogleAdMob.loadAppsInTossAdMob.isSupported;
|
|
1835
|
+
function showFullScreenAd(params) {
|
|
1836
|
+
if (!import_native_modules18.GoogleAdMob.showAppsInTossAdMob.isSupported()) {
|
|
1837
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
1838
|
+
return noop;
|
|
1839
|
+
}
|
|
1840
|
+
if (!integratedAdIsSupported()) {
|
|
1841
|
+
return import_native_modules18.GoogleAdMob.showAppsInTossAdMob({
|
|
1842
|
+
...params,
|
|
1843
|
+
onEvent: (event) => {
|
|
1844
|
+
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] ?? "";
|
|
1845
|
+
switch (event.type) {
|
|
1846
|
+
case "show":
|
|
1847
|
+
postEventTracking({
|
|
1848
|
+
eventName: "SHOW",
|
|
1849
|
+
spaceUnitId: params.options.adGroupId,
|
|
1850
|
+
requestId,
|
|
1851
|
+
responseId: "",
|
|
1852
|
+
mediationType: "ADMOB",
|
|
1853
|
+
format: "",
|
|
1854
|
+
adSourceName: "",
|
|
1855
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1856
|
+
});
|
|
1857
|
+
break;
|
|
1858
|
+
case "failedToShow":
|
|
1859
|
+
postEventTracking({
|
|
1860
|
+
eventName: "FAILED_TO_SHOW",
|
|
1861
|
+
spaceUnitId: params.options.adGroupId,
|
|
1862
|
+
requestId,
|
|
1863
|
+
responseId: "",
|
|
1864
|
+
mediationType: "ADMOB",
|
|
1865
|
+
format: "",
|
|
1866
|
+
adSourceName: "",
|
|
1867
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1868
|
+
});
|
|
1869
|
+
break;
|
|
1870
|
+
case "impression":
|
|
1871
|
+
postEventTracking({
|
|
1872
|
+
eventName: "IMP",
|
|
1873
|
+
spaceUnitId: params.options.adGroupId,
|
|
1874
|
+
requestId,
|
|
1875
|
+
responseId: "",
|
|
1876
|
+
mediationType: "ADMOB",
|
|
1877
|
+
format: "",
|
|
1878
|
+
adSourceName: "",
|
|
1879
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1880
|
+
});
|
|
1881
|
+
break;
|
|
1882
|
+
case "clicked":
|
|
1883
|
+
postEventTracking({
|
|
1884
|
+
eventName: "CLICK",
|
|
1885
|
+
spaceUnitId: params.options.adGroupId,
|
|
1886
|
+
requestId,
|
|
1887
|
+
responseId: "",
|
|
1888
|
+
mediationType: "ADMOB",
|
|
1889
|
+
format: "",
|
|
1890
|
+
adSourceName: "",
|
|
1891
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1892
|
+
});
|
|
1893
|
+
break;
|
|
1894
|
+
case "dismissed":
|
|
1895
|
+
postEventTracking({
|
|
1896
|
+
eventName: "DISMISS",
|
|
1897
|
+
spaceUnitId: params.options.adGroupId,
|
|
1898
|
+
requestId,
|
|
1899
|
+
responseId: "",
|
|
1900
|
+
mediationType: "ADMOB",
|
|
1901
|
+
format: "",
|
|
1902
|
+
adSourceName: "",
|
|
1903
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1904
|
+
});
|
|
1905
|
+
break;
|
|
1906
|
+
case "userEarnedReward":
|
|
1907
|
+
postEventTracking({
|
|
1908
|
+
eventName: "USER_EARNED_REWARD",
|
|
1909
|
+
spaceUnitId: params.options.adGroupId,
|
|
1910
|
+
requestId,
|
|
1911
|
+
responseId: "",
|
|
1912
|
+
mediationType: "ADMOB",
|
|
1913
|
+
format: "",
|
|
1914
|
+
adSourceName: "",
|
|
1915
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1916
|
+
});
|
|
1917
|
+
break;
|
|
1918
|
+
}
|
|
1919
|
+
return params.onEvent(event);
|
|
1920
|
+
},
|
|
1921
|
+
onError: (error) => {
|
|
1922
|
+
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] ?? "";
|
|
1923
|
+
postEventTracking({
|
|
1924
|
+
eventName: "FAILED_TO_SHOW",
|
|
1925
|
+
spaceUnitId: params.options.adGroupId,
|
|
1926
|
+
requestId,
|
|
1927
|
+
responseId: "",
|
|
1928
|
+
mediationType: "ADMOB",
|
|
1929
|
+
format: "",
|
|
1930
|
+
adSourceName: "",
|
|
1931
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1932
|
+
});
|
|
1933
|
+
return params.onError(error);
|
|
1934
|
+
}
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
const { onEvent, onError, options } = params;
|
|
1938
|
+
const { adGroupId } = options;
|
|
1939
|
+
const referrer = getReferrer();
|
|
1940
|
+
const unregisterCallbacks = import_native_modules18.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1941
|
+
"showTossAdOrAdmob",
|
|
1942
|
+
{ spaceUnitId: adGroupId, referrer, sessionId },
|
|
1943
|
+
{
|
|
1944
|
+
onAdClicked: () => {
|
|
1945
|
+
onEvent({ type: "clicked" });
|
|
1946
|
+
},
|
|
1947
|
+
onAdDismissed: () => {
|
|
1948
|
+
onEvent({ type: "dismissed" });
|
|
1949
|
+
},
|
|
1950
|
+
onAdFailedToShow: () => {
|
|
1951
|
+
onEvent({ type: "failedToShow" });
|
|
1952
|
+
},
|
|
1953
|
+
onAdImpression: () => {
|
|
1954
|
+
onEvent({ type: "impression" });
|
|
1955
|
+
},
|
|
1956
|
+
onAdShow: () => {
|
|
1957
|
+
onEvent({ type: "show" });
|
|
1958
|
+
},
|
|
1959
|
+
onUserEarnedReward: (data) => {
|
|
1960
|
+
onEvent({ type: "userEarnedReward", data });
|
|
1961
|
+
},
|
|
1962
|
+
onSuccess: () => {
|
|
1963
|
+
onEvent({ type: "requested" });
|
|
1964
|
+
},
|
|
1965
|
+
onError: (error) => {
|
|
1966
|
+
onError(error);
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
);
|
|
1970
|
+
return unregisterCallbacks;
|
|
1971
|
+
}
|
|
1972
|
+
showFullScreenAd.isSupported = import_native_modules18.GoogleAdMob.showAppsInTossAdMob.isSupported;
|
|
1973
|
+
|
|
1974
|
+
// src/ads/tossAdEventLog.ts
|
|
1975
|
+
var import_native_modules19 = require("@apps-in-toss/native-modules");
|
|
1976
|
+
var import_react_native31 = require("@granite-js/react-native");
|
|
1977
|
+
async function tossAdEventLog(params) {
|
|
1978
|
+
const referrer = getReferrer();
|
|
1979
|
+
const appName = import_react_native31.Granite.appName;
|
|
1980
|
+
const eventLogParams = {
|
|
1981
|
+
...params,
|
|
1982
|
+
params: {
|
|
1983
|
+
...params.params,
|
|
1984
|
+
referrer,
|
|
1985
|
+
app_name: appName
|
|
1986
|
+
}
|
|
1987
|
+
};
|
|
1988
|
+
return import_native_modules19.INTERNAL__module.tossCoreEventLog(eventLogParams);
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1547
1991
|
// src/bridge-handler/useBridgeHandler.tsx
|
|
1548
1992
|
var import_react23 = require("react");
|
|
1549
1993
|
function serializeError(error) {
|
|
@@ -1719,8 +2163,8 @@ function useSafeAreaInsetsEmitter() {
|
|
|
1719
2163
|
}
|
|
1720
2164
|
|
|
1721
2165
|
// src/core/hooks/useWebBackHandler.tsx
|
|
1722
|
-
var
|
|
1723
|
-
var
|
|
2166
|
+
var import_react_native32 = require("@granite-js/react-native");
|
|
2167
|
+
var import_tds_react_native14 = require("@toss/tds-react-native");
|
|
1724
2168
|
var import_es_hangul5 = require("es-hangul");
|
|
1725
2169
|
var import_react26 = require("react");
|
|
1726
2170
|
|
|
@@ -1789,9 +2233,9 @@ function useWebBackHandler(webViewRef) {
|
|
|
1789
2233
|
hasBackEvent: hasWebBackEvent,
|
|
1790
2234
|
addEventListener: addWebBackEventListener,
|
|
1791
2235
|
removeEventListener: removeWebBackEventListener
|
|
1792
|
-
} = (0,
|
|
2236
|
+
} = (0, import_react_native32.useBackEventState)();
|
|
1793
2237
|
const logging = useNavigationBarLogging();
|
|
1794
|
-
const { openConfirm } = (0,
|
|
2238
|
+
const { openConfirm } = (0, import_tds_react_native14.useDialog)();
|
|
1795
2239
|
const global2 = getAppsInTossGlobals();
|
|
1796
2240
|
const addEventListener = (0, import_react26.useCallback)(
|
|
1797
2241
|
(handler) => {
|
|
@@ -1825,7 +2269,7 @@ function useWebBackHandler(webViewRef) {
|
|
|
1825
2269
|
logging.closePopupCtaClick(isConfirmed);
|
|
1826
2270
|
if (isConfirmed) {
|
|
1827
2271
|
captureExitLog(Date.now());
|
|
1828
|
-
(0,
|
|
2272
|
+
(0, import_react_native32.closeView)();
|
|
1829
2273
|
}
|
|
1830
2274
|
}
|
|
1831
2275
|
}, [
|
|
@@ -1868,8 +2312,8 @@ function mergeRefs(...refs) {
|
|
|
1868
2312
|
}
|
|
1869
2313
|
|
|
1870
2314
|
// src/hooks/useCreateUserAgent.ts
|
|
1871
|
-
var
|
|
1872
|
-
var
|
|
2315
|
+
var import_native_modules20 = require("@apps-in-toss/native-modules");
|
|
2316
|
+
var import_react_native33 = require("react-native");
|
|
1873
2317
|
var FontA11yCategory = {
|
|
1874
2318
|
Large: "Large",
|
|
1875
2319
|
xLarge: "xLarge",
|
|
@@ -2002,13 +2446,14 @@ function useCreateUserAgent({
|
|
|
2002
2446
|
safeArea,
|
|
2003
2447
|
safeAreaBottomTransparency
|
|
2004
2448
|
}) {
|
|
2005
|
-
const platform = (0,
|
|
2006
|
-
const appVersion = (0,
|
|
2007
|
-
const { fontScale } = (0,
|
|
2449
|
+
const platform = (0, import_native_modules20.getPlatformOS)();
|
|
2450
|
+
const appVersion = (0, import_native_modules20.getTossAppVersion)();
|
|
2451
|
+
const { fontScale } = (0, import_react_native33.useWindowDimensions)();
|
|
2008
2452
|
const platformString = platform === "ios" ? "iPhone" : "Android phone";
|
|
2009
2453
|
const fontA11y = mapFontScaleToCategory(fontScale, platform);
|
|
2010
2454
|
const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
|
|
2011
2455
|
return [
|
|
2456
|
+
"AppsInToss",
|
|
2012
2457
|
`TossApp/${appVersion}`,
|
|
2013
2458
|
batteryModePreference && `TossBatteryModePreference/${batteryModePreference}`,
|
|
2014
2459
|
colorPreference && `TossColorPreference/${colorPreference}`,
|
|
@@ -2024,17 +2469,17 @@ function useCreateUserAgent({
|
|
|
2024
2469
|
}
|
|
2025
2470
|
|
|
2026
2471
|
// src/hooks/useGeolocation.ts
|
|
2027
|
-
var
|
|
2028
|
-
var
|
|
2472
|
+
var import_native_modules21 = require("@apps-in-toss/native-modules");
|
|
2473
|
+
var import_react_native34 = require("@granite-js/react-native");
|
|
2029
2474
|
var import_react27 = require("react");
|
|
2030
2475
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
2031
|
-
const isVisible = (0,
|
|
2476
|
+
const isVisible = (0, import_react_native34.useVisibility)();
|
|
2032
2477
|
const [location, setLocation] = (0, import_react27.useState)(null);
|
|
2033
2478
|
(0, import_react27.useEffect)(() => {
|
|
2034
2479
|
if (!isVisible) {
|
|
2035
2480
|
return;
|
|
2036
2481
|
}
|
|
2037
|
-
return (0,
|
|
2482
|
+
return (0, import_native_modules21.startUpdateLocation)({
|
|
2038
2483
|
options: {
|
|
2039
2484
|
accuracy,
|
|
2040
2485
|
distanceInterval,
|
|
@@ -2048,11 +2493,11 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
2048
2493
|
}
|
|
2049
2494
|
|
|
2050
2495
|
// src/hooks/useWaitForReturnNavigator.tsx
|
|
2051
|
-
var
|
|
2496
|
+
var import_react_native35 = require("@granite-js/react-native");
|
|
2052
2497
|
var import_react28 = require("react");
|
|
2053
2498
|
function useWaitForReturnNavigator() {
|
|
2054
2499
|
const callbacks = (0, import_react28.useRef)([]).current;
|
|
2055
|
-
const navigation = (0,
|
|
2500
|
+
const navigation = (0, import_react_native35.useNavigation)();
|
|
2056
2501
|
const startNavigating = (0, import_react28.useCallback)(
|
|
2057
2502
|
(route, params) => {
|
|
2058
2503
|
return new Promise((resolve) => {
|
|
@@ -2073,7 +2518,7 @@ function useWaitForReturnNavigator() {
|
|
|
2073
2518
|
},
|
|
2074
2519
|
[callbacks]
|
|
2075
2520
|
);
|
|
2076
|
-
(0,
|
|
2521
|
+
(0, import_react_native35.useVisibilityChange)(handleVisibilityChange);
|
|
2077
2522
|
return startNavigating;
|
|
2078
2523
|
}
|
|
2079
2524
|
|
|
@@ -2087,8 +2532,8 @@ function useTopNavigation() {
|
|
|
2087
2532
|
}
|
|
2088
2533
|
|
|
2089
2534
|
// src/utils/log.ts
|
|
2090
|
-
var
|
|
2091
|
-
var
|
|
2535
|
+
var import_native_modules22 = require("@apps-in-toss/native-modules");
|
|
2536
|
+
var import_react_native36 = require("@granite-js/react-native");
|
|
2092
2537
|
|
|
2093
2538
|
// src/utils/extractDateFromUUIDv7.ts
|
|
2094
2539
|
var extractDateFromUUIDv7 = (uuid) => {
|
|
@@ -2112,9 +2557,9 @@ var getGroupId = (url) => {
|
|
|
2112
2557
|
};
|
|
2113
2558
|
}
|
|
2114
2559
|
};
|
|
2115
|
-
var
|
|
2560
|
+
var getReferrer2 = () => {
|
|
2116
2561
|
try {
|
|
2117
|
-
const referrer = new URL((0,
|
|
2562
|
+
const referrer = new URL((0, import_react_native36.getSchemeUri)());
|
|
2118
2563
|
return referrer.searchParams.get("referrer");
|
|
2119
2564
|
} catch {
|
|
2120
2565
|
return "";
|
|
@@ -2127,26 +2572,26 @@ var trackScreen = (url) => {
|
|
|
2127
2572
|
log_name: `${groupId}::screen`,
|
|
2128
2573
|
params: {
|
|
2129
2574
|
search,
|
|
2130
|
-
referrer:
|
|
2575
|
+
referrer: getReferrer2(),
|
|
2131
2576
|
deployment_id: env.getDeploymentId(),
|
|
2132
2577
|
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
2133
2578
|
}
|
|
2134
2579
|
};
|
|
2135
|
-
return (0,
|
|
2580
|
+
return (0, import_native_modules22.eventLog)(log);
|
|
2136
2581
|
};
|
|
2137
2582
|
|
|
2138
2583
|
// src/components/WebView.tsx
|
|
2139
|
-
var
|
|
2584
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2140
2585
|
var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
|
|
2141
2586
|
var TYPES = ["partner", "external", "game"];
|
|
2142
2587
|
var WEBVIEW_TYPES = {
|
|
2143
2588
|
partner: PartnerWebView,
|
|
2144
|
-
external:
|
|
2589
|
+
external: import_tds_react_native15.ExternalWebViewScreen,
|
|
2145
2590
|
game: GameWebView
|
|
2146
2591
|
};
|
|
2147
2592
|
function mergeSchemeQueryParamsInto(url) {
|
|
2148
2593
|
const baseUrl = new URL(url);
|
|
2149
|
-
const schemeUrl = new URL((0,
|
|
2594
|
+
const schemeUrl = new URL((0, import_react_native37.getSchemeUri)());
|
|
2150
2595
|
baseUrl.pathname = schemeUrl.pathname;
|
|
2151
2596
|
for (const [key, value] of schemeUrl.searchParams.entries()) {
|
|
2152
2597
|
baseUrl.searchParams.set(key, value);
|
|
@@ -2158,7 +2603,7 @@ function getWebViewUri(local) {
|
|
|
2158
2603
|
const devUrl = `http://${local.host}:${local.port}`;
|
|
2159
2604
|
return mergeSchemeQueryParamsInto(devUrl).toString();
|
|
2160
2605
|
}
|
|
2161
|
-
const { url: rawUrl } =
|
|
2606
|
+
const { url: rawUrl } = import_native_modules23.AppsInTossModule.getWebBundleURL({});
|
|
2162
2607
|
const url = mergeSchemeQueryParamsInto(rawUrl);
|
|
2163
2608
|
const deploymentId = env.getDeploymentId();
|
|
2164
2609
|
if (deploymentId) {
|
|
@@ -2184,18 +2629,17 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2184
2629
|
);
|
|
2185
2630
|
const handler = useBridgeHandler({
|
|
2186
2631
|
onMessage,
|
|
2187
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2188
2632
|
eventListenerMap: {
|
|
2189
2633
|
...appsInTossEventBridges,
|
|
2190
|
-
navigationAccessoryEvent: ({ onEvent, onError }) =>
|
|
2634
|
+
navigationAccessoryEvent: ({ onEvent, onError }) => import_tds_react_native15.tdsEvent.addEventListener("navigationAccessoryEvent", { onEvent, onError }),
|
|
2191
2635
|
backEvent: ({ onEvent }) => {
|
|
2192
2636
|
webBackHandler.addEventListener(onEvent);
|
|
2193
2637
|
return () => {
|
|
2194
2638
|
webBackHandler.removeEventListener(onEvent);
|
|
2195
2639
|
};
|
|
2196
2640
|
},
|
|
2197
|
-
entryMessageExited: ({ onEvent, onError }) =>
|
|
2198
|
-
updateLocationEvent: ({ onEvent, onError, options }) =>
|
|
2641
|
+
entryMessageExited: ({ onEvent, onError }) => import_native_modules23.appsInTossEvent.addEventListener("entryMessageExited", { onEvent, onError }),
|
|
2642
|
+
updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules23.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
2199
2643
|
safeAreaInsetsChange: ({ onEvent }) => {
|
|
2200
2644
|
safeAreaInsetsEmitter.on("safeAreaInsetsChange", onEvent);
|
|
2201
2645
|
return () => {
|
|
@@ -2203,18 +2647,23 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2203
2647
|
};
|
|
2204
2648
|
},
|
|
2205
2649
|
/** @internal */
|
|
2206
|
-
appBridgeCallbackEvent: ({ onEvent, onError, options }) =>
|
|
2650
|
+
appBridgeCallbackEvent: ({ onEvent, onError, options }) => import_native_modules23.appsInTossEvent.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
|
|
2207
2651
|
/** AdMob */
|
|
2208
|
-
loadAdMobInterstitialAd:
|
|
2209
|
-
showAdMobInterstitialAd:
|
|
2210
|
-
loadAdMobRewardedAd:
|
|
2211
|
-
showAdMobRewardedAd:
|
|
2652
|
+
loadAdMobInterstitialAd: import_native_modules23.GoogleAdMob.loadAdMobInterstitialAd,
|
|
2653
|
+
showAdMobInterstitialAd: import_native_modules23.GoogleAdMob.showAdMobInterstitialAd,
|
|
2654
|
+
loadAdMobRewardedAd: import_native_modules23.GoogleAdMob.loadAdMobRewardedAd,
|
|
2655
|
+
showAdMobRewardedAd: import_native_modules23.GoogleAdMob.showAdMobRewardedAd,
|
|
2212
2656
|
/** AdMobV2 */
|
|
2213
|
-
loadAppsInTossAdMob:
|
|
2214
|
-
showAppsInTossAdMob:
|
|
2657
|
+
loadAppsInTossAdMob: import_native_modules23.GoogleAdMob.loadAppsInTossAdMob,
|
|
2658
|
+
showAppsInTossAdMob: import_native_modules23.GoogleAdMob.showAppsInTossAdMob,
|
|
2659
|
+
/** IntegratedAd */
|
|
2660
|
+
loadFullScreenAd,
|
|
2661
|
+
showFullScreenAd,
|
|
2662
|
+
/** TossAd */
|
|
2663
|
+
fetchTossAd,
|
|
2215
2664
|
/** IAP */
|
|
2216
|
-
iapCreateOneTimePurchaseOrder:
|
|
2217
|
-
requestOneTimePurchase:
|
|
2665
|
+
iapCreateOneTimePurchaseOrder: import_native_modules23.IAP.createOneTimePurchaseOrder,
|
|
2666
|
+
requestOneTimePurchase: import_native_modules23.requestOneTimePurchase
|
|
2218
2667
|
},
|
|
2219
2668
|
constantHandlerMap: {
|
|
2220
2669
|
...appsInTossConstantBridges,
|
|
@@ -2224,13 +2673,18 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2224
2673
|
getSafeAreaRight: () => insets.right,
|
|
2225
2674
|
...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
|
|
2226
2675
|
/** AdMob */
|
|
2227
|
-
loadAdMobInterstitialAd_isSupported:
|
|
2228
|
-
showAdMobInterstitialAd_isSupported:
|
|
2229
|
-
loadAdMobRewardedAd_isSupported:
|
|
2230
|
-
showAdMobRewardedAd_isSupported:
|
|
2676
|
+
loadAdMobInterstitialAd_isSupported: import_native_modules23.GoogleAdMob.loadAdMobInterstitialAd.isSupported,
|
|
2677
|
+
showAdMobInterstitialAd_isSupported: import_native_modules23.GoogleAdMob.showAdMobInterstitialAd.isSupported,
|
|
2678
|
+
loadAdMobRewardedAd_isSupported: import_native_modules23.GoogleAdMob.loadAdMobRewardedAd.isSupported,
|
|
2679
|
+
showAdMobRewardedAd_isSupported: import_native_modules23.GoogleAdMob.showAdMobRewardedAd.isSupported,
|
|
2231
2680
|
/** AdMobV2 */
|
|
2232
|
-
loadAppsInTossAdMob_isSupported:
|
|
2233
|
-
showAppsInTossAdMob_isSupported:
|
|
2681
|
+
loadAppsInTossAdMob_isSupported: import_native_modules23.GoogleAdMob.loadAppsInTossAdMob.isSupported,
|
|
2682
|
+
showAppsInTossAdMob_isSupported: import_native_modules23.GoogleAdMob.showAppsInTossAdMob.isSupported,
|
|
2683
|
+
/** IntegratedAd */
|
|
2684
|
+
loadFullScreenAd_isSupported: loadFullScreenAd.isSupported,
|
|
2685
|
+
showFullScreenAd_isSupported: showFullScreenAd.isSupported,
|
|
2686
|
+
/** TossAd */
|
|
2687
|
+
fetchTossAd_isSupported: fetchTossAd.isSupported,
|
|
2234
2688
|
/** env */
|
|
2235
2689
|
getDeploymentId: env.getDeploymentId
|
|
2236
2690
|
},
|
|
@@ -2253,17 +2707,19 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2253
2707
|
getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
|
|
2254
2708
|
openCamera: appsInTossAsyncBridges.openCamera,
|
|
2255
2709
|
/** Storage */
|
|
2256
|
-
getStorageItem:
|
|
2257
|
-
setStorageItem:
|
|
2258
|
-
removeStorageItem:
|
|
2259
|
-
clearItems:
|
|
2710
|
+
getStorageItem: import_native_modules23.Storage.getItem,
|
|
2711
|
+
setStorageItem: import_native_modules23.Storage.setItem,
|
|
2712
|
+
removeStorageItem: import_native_modules23.Storage.removeItem,
|
|
2713
|
+
clearItems: import_native_modules23.Storage.clearItems,
|
|
2260
2714
|
/** IAP */
|
|
2261
|
-
iapGetProductItemList:
|
|
2262
|
-
iapCreateOneTimePurchaseOrder:
|
|
2263
|
-
processProductGrant:
|
|
2264
|
-
getPendingOrders:
|
|
2265
|
-
getCompletedOrRefundedOrders:
|
|
2266
|
-
completeProductGrant:
|
|
2715
|
+
iapGetProductItemList: import_native_modules23.IAP.getProductItemList,
|
|
2716
|
+
iapCreateOneTimePurchaseOrder: import_native_modules23.iapCreateOneTimePurchaseOrder,
|
|
2717
|
+
processProductGrant: import_native_modules23.processProductGrant,
|
|
2718
|
+
getPendingOrders: import_native_modules23.IAP.getPendingOrders,
|
|
2719
|
+
getCompletedOrRefundedOrders: import_native_modules23.IAP.getCompletedOrRefundedOrders,
|
|
2720
|
+
completeProductGrant: import_native_modules23.IAP.completeProductGrant,
|
|
2721
|
+
/** Toss Ads */
|
|
2722
|
+
tossAdEventLog
|
|
2267
2723
|
}
|
|
2268
2724
|
});
|
|
2269
2725
|
const headerPropForExternalWebView = (0, import_react29.useMemo)(() => {
|
|
@@ -2292,11 +2748,11 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2292
2748
|
webBackHandler.handleWebBack();
|
|
2293
2749
|
return true;
|
|
2294
2750
|
};
|
|
2295
|
-
|
|
2296
|
-
return () =>
|
|
2751
|
+
import_react_native38.BackHandler.addEventListener("hardwareBackPress", callback);
|
|
2752
|
+
return () => import_react_native38.BackHandler.removeEventListener("hardwareBackPress", callback);
|
|
2297
2753
|
}, [webBackHandler]);
|
|
2298
2754
|
const globalScripts = useGlobalScripts();
|
|
2299
|
-
return /* @__PURE__ */ (0,
|
|
2755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2300
2756
|
BaseWebView,
|
|
2301
2757
|
{
|
|
2302
2758
|
ref: refs,
|
|
@@ -2318,15 +2774,30 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2318
2774
|
props.onNavigationStateChange?.(event);
|
|
2319
2775
|
webBackHandler.onNavigationStateChange(event);
|
|
2320
2776
|
},
|
|
2321
|
-
userAgent:
|
|
2777
|
+
userAgent: import_react_native38.Platform.OS === "ios" ? userAgent : void 0,
|
|
2322
2778
|
sharedCookiesEnabled: true,
|
|
2323
2779
|
webviewDebuggingEnabled: webViewDebuggingEnabled,
|
|
2324
2780
|
thirdPartyCookiesEnabled: true,
|
|
2325
2781
|
onMessage: handler.onMessage,
|
|
2326
2782
|
injectedJavaScript: globalScripts.afterLoad,
|
|
2327
2783
|
injectedJavaScriptBeforeContentLoaded: mergeScripts(handler.injectedJavaScript, globalScripts.beforeLoad),
|
|
2328
|
-
decelerationRate:
|
|
2329
|
-
allowsBackForwardNavigationGestures
|
|
2784
|
+
decelerationRate: import_react_native38.Platform.OS === "ios" ? 1 : void 0,
|
|
2785
|
+
allowsBackForwardNavigationGestures,
|
|
2786
|
+
onShouldStartLoadWithRequest: (event) => {
|
|
2787
|
+
try {
|
|
2788
|
+
const url = new URL(event.url);
|
|
2789
|
+
if (["https:", "http:"].includes(url.protocol)) {
|
|
2790
|
+
return true;
|
|
2791
|
+
} else {
|
|
2792
|
+
import_react_native38.Linking.openURL(convertIntentURL(url) ?? url.href);
|
|
2793
|
+
return false;
|
|
2794
|
+
}
|
|
2795
|
+
} catch (error) {
|
|
2796
|
+
console.error(error);
|
|
2797
|
+
return false;
|
|
2798
|
+
}
|
|
2799
|
+
},
|
|
2800
|
+
originWhitelist: ["https://*", "http://*", "intoss://*", "intoss-private://*", "servicetoss://*", "supertoss://*", "intent://*"]
|
|
2330
2801
|
}
|
|
2331
2802
|
);
|
|
2332
2803
|
}
|
|
@@ -2411,6 +2882,8 @@ var Analytics2 = {
|
|
|
2411
2882
|
OverlayProvider,
|
|
2412
2883
|
WebView,
|
|
2413
2884
|
env,
|
|
2885
|
+
loadFullScreenAd,
|
|
2886
|
+
showFullScreenAd,
|
|
2414
2887
|
useCreateUserAgent,
|
|
2415
2888
|
useGeolocation,
|
|
2416
2889
|
useOverlay,
|