@apps-in-toss/framework 1.4.9 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +294 -216
- package/dist/index.js +186 -108
- package/package.json +12 -12
package/dist/index.cjs
CHANGED
|
@@ -48,10 +48,10 @@ var import_analytics2 = require("@apps-in-toss/analytics");
|
|
|
48
48
|
|
|
49
49
|
// src/core/registerApp.tsx
|
|
50
50
|
var import_analytics = require("@apps-in-toss/analytics");
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
51
|
+
var import_native_modules14 = require("@apps-in-toss/native-modules");
|
|
52
|
+
var import_react_native23 = require("@granite-js/react-native");
|
|
53
|
+
var import_tds_react_native11 = require("@toss/tds-react-native");
|
|
54
|
+
var import_react_native24 = require("react-native");
|
|
55
55
|
|
|
56
56
|
// src/core/components/AppEvent.tsx
|
|
57
57
|
var import_native_modules2 = require("@apps-in-toss/native-modules");
|
|
@@ -277,9 +277,9 @@ function useAppsInTossBridge() {
|
|
|
277
277
|
}
|
|
278
278
|
|
|
279
279
|
// src/components/RNAppContainer.tsx
|
|
280
|
-
var
|
|
280
|
+
var import_native_modules13 = require("@apps-in-toss/native-modules");
|
|
281
281
|
var import_react18 = require("react");
|
|
282
|
-
var
|
|
282
|
+
var import_react_native22 = require("react-native");
|
|
283
283
|
|
|
284
284
|
// src/components/GameInitializer.tsx
|
|
285
285
|
var import_native_modules7 = require("@apps-in-toss/native-modules");
|
|
@@ -886,18 +886,22 @@ function useNavigationEvent() {
|
|
|
886
886
|
}
|
|
887
887
|
|
|
888
888
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
889
|
-
var
|
|
890
|
-
var
|
|
891
|
-
var
|
|
889
|
+
var import_native_modules12 = require("@apps-in-toss/native-modules");
|
|
890
|
+
var import_react_native20 = require("@granite-js/react-native");
|
|
891
|
+
var import_tds_react_native9 = require("@toss/tds-react-native");
|
|
892
892
|
var import_private4 = require("@toss/tds-react-native/private");
|
|
893
893
|
var import_react16 = require("react");
|
|
894
894
|
|
|
895
895
|
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
896
896
|
var import_native_modules10 = require("@apps-in-toss/native-modules");
|
|
897
|
-
var
|
|
897
|
+
var import_react_native17 = require("@granite-js/react-native");
|
|
898
|
+
var import_tds_react_native8 = require("@toss/tds-react-native");
|
|
899
|
+
var import_react_native18 = require("react-native");
|
|
900
|
+
|
|
901
|
+
// src/core/hooks/useMoreButtonBottomSheet/Menu.tsx
|
|
898
902
|
var import_tds_react_native7 = require("@toss/tds-react-native");
|
|
899
903
|
var import_private3 = require("@toss/tds-react-native/private");
|
|
900
|
-
var
|
|
904
|
+
var import_react_native16 = require("react-native");
|
|
901
905
|
|
|
902
906
|
// src/core/hooks/useMoreButtonBottomSheet/useMoreButtonBottomSheetLogging.tsx
|
|
903
907
|
var import_native_modules9 = require("@apps-in-toss/native-modules");
|
|
@@ -968,6 +972,82 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
968
972
|
};
|
|
969
973
|
}
|
|
970
974
|
|
|
975
|
+
// src/core/hooks/useMoreButtonBottomSheet/Menu.tsx
|
|
976
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
977
|
+
function Menu({ title, iconURL, onPress }) {
|
|
978
|
+
const globals = getAppsInTossGlobals();
|
|
979
|
+
const adaptive = (0, import_private3.useAdaptive)();
|
|
980
|
+
const iconName = getIconName(iconURL);
|
|
981
|
+
const logging = useMoreButtonBottomSheetLogging();
|
|
982
|
+
const brandPrimaryColorRGB = hexToRGB(globals.brandPrimaryColor);
|
|
983
|
+
const iconBackgroundColor = brandPrimaryColorRGB ? `rgba(${brandPrimaryColorRGB.join(",")},0.1)` : adaptive.grey100;
|
|
984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
985
|
+
import_tds_react_native7.ListRow,
|
|
986
|
+
{
|
|
987
|
+
left: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
988
|
+
import_react_native16.View,
|
|
989
|
+
{
|
|
990
|
+
style: {
|
|
991
|
+
width: 30,
|
|
992
|
+
height: 30,
|
|
993
|
+
borderRadius: 10,
|
|
994
|
+
flexDirection: "row",
|
|
995
|
+
alignItems: "center",
|
|
996
|
+
justifyContent: "center",
|
|
997
|
+
marginRight: 16,
|
|
998
|
+
backgroundColor: iconBackgroundColor
|
|
999
|
+
},
|
|
1000
|
+
children: iconName ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1001
|
+
import_tds_react_native7.Asset.Icon,
|
|
1002
|
+
{
|
|
1003
|
+
frameShape: { width: 20, height: 20 },
|
|
1004
|
+
color: globals.brandPrimaryColor,
|
|
1005
|
+
name: iconName
|
|
1006
|
+
}
|
|
1007
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1008
|
+
import_tds_react_native7.Asset.Image,
|
|
1009
|
+
{
|
|
1010
|
+
frameShape: { width: 20, height: 20 },
|
|
1011
|
+
source: { uri: iconURL }
|
|
1012
|
+
}
|
|
1013
|
+
)
|
|
1014
|
+
}
|
|
1015
|
+
),
|
|
1016
|
+
contents: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1017
|
+
import_tds_react_native7.ListRow.Texts,
|
|
1018
|
+
{
|
|
1019
|
+
type: "1RowTypeA",
|
|
1020
|
+
top: title,
|
|
1021
|
+
topProps: { color: adaptive.grey700 }
|
|
1022
|
+
}
|
|
1023
|
+
),
|
|
1024
|
+
verticalPadding: "extraSmall",
|
|
1025
|
+
onPress: () => {
|
|
1026
|
+
logging.menuClick({ title });
|
|
1027
|
+
onPress?.();
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
);
|
|
1031
|
+
}
|
|
1032
|
+
var iconNameRegExp = /^(icon-|icn-(?!(car|sec|bank-(fill|square|horizontal))-))(.+)/i;
|
|
1033
|
+
var iconURLRegExp = /^https:\/\/static\.toss\.im\/icons\/(png\/\dx|svg|pdf)\/((icon-|icn-(?!(car|sec|bank-(fill|square|horizontal))-))(.+))\.(png|svg|pdf)$/i;
|
|
1034
|
+
function isIconUrl(url) {
|
|
1035
|
+
return iconNameRegExp.test(url) || iconURLRegExp.test(url);
|
|
1036
|
+
}
|
|
1037
|
+
function getIconName(url) {
|
|
1038
|
+
if (!isIconUrl(url)) {
|
|
1039
|
+
return null;
|
|
1040
|
+
}
|
|
1041
|
+
if (iconNameRegExp.test(url)) {
|
|
1042
|
+
return url;
|
|
1043
|
+
}
|
|
1044
|
+
return url.match(iconURLRegExp)?.[2];
|
|
1045
|
+
}
|
|
1046
|
+
function hexToRGB(hex) {
|
|
1047
|
+
const rgb = hex.toLowerCase().match(/[0-9,a-f]{2}/g)?.map((str) => parseInt(str, 16));
|
|
1048
|
+
return rgb?.length === 3 ? rgb : void 0;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
971
1051
|
// src/core/utils/url.ts
|
|
972
1052
|
function addParamsToUrl(url, params) {
|
|
973
1053
|
const urlObj = new URL(url);
|
|
@@ -978,42 +1058,24 @@ function addParamsToUrl(url, params) {
|
|
|
978
1058
|
}
|
|
979
1059
|
|
|
980
1060
|
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
981
|
-
var
|
|
1061
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
982
1062
|
var SHARE_SCHEME_REFERRER = "appsintoss.common_module_share";
|
|
983
1063
|
var APP_SHARE_MENU_INFO = {
|
|
984
1064
|
contactItemName: "\uACF5\uC720\uD558\uAE30",
|
|
985
1065
|
contactIconUrl: "https://static.toss.im/icons/png/4x/icon-share-dots-mono.png"
|
|
986
1066
|
};
|
|
987
1067
|
function AppShareListMenu() {
|
|
988
|
-
const
|
|
989
|
-
const adaptive = (0, import_private3.useAdaptive)();
|
|
990
|
-
const logging = useMoreButtonBottomSheetLogging();
|
|
991
|
-
const initialScheme = (0, import_react_native16.getSchemeUri)();
|
|
1068
|
+
const initialScheme = (0, import_react_native17.getSchemeUri)();
|
|
992
1069
|
const isSandbox = (0, import_native_modules10.getOperationalEnvironment)() === "sandbox";
|
|
993
|
-
const { openConfirm } = (0,
|
|
1070
|
+
const { openConfirm } = (0, import_tds_react_native8.useDialog)();
|
|
994
1071
|
const schemeForShare = addParamsToUrl(initialScheme, {
|
|
995
1072
|
referrer: SHARE_SCHEME_REFERRER
|
|
996
1073
|
});
|
|
997
|
-
return /* @__PURE__ */ (0,
|
|
998
|
-
|
|
1074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1075
|
+
Menu,
|
|
999
1076
|
{
|
|
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",
|
|
1077
|
+
title: APP_SHARE_MENU_INFO.contactItemName,
|
|
1078
|
+
iconURL: APP_SHARE_MENU_INFO.contactIconUrl,
|
|
1017
1079
|
onPress: () => {
|
|
1018
1080
|
if (isSandbox) {
|
|
1019
1081
|
openConfirm({
|
|
@@ -1024,8 +1086,7 @@ function AppShareListMenu() {
|
|
|
1024
1086
|
});
|
|
1025
1087
|
return;
|
|
1026
1088
|
}
|
|
1027
|
-
|
|
1028
|
-
import_react_native17.NativeModules.AppsInTossModule.shareWithScheme({
|
|
1089
|
+
import_react_native18.NativeModules.AppsInTossModule.shareWithScheme({
|
|
1029
1090
|
params: {
|
|
1030
1091
|
schemeURL: schemeForShare
|
|
1031
1092
|
}
|
|
@@ -1035,6 +1096,25 @@ function AppShareListMenu() {
|
|
|
1035
1096
|
);
|
|
1036
1097
|
}
|
|
1037
1098
|
|
|
1099
|
+
// src/core/hooks/useMoreButtonBottomSheet/PermissionsMenu.tsx
|
|
1100
|
+
var import_native_modules11 = require("@apps-in-toss/native-modules");
|
|
1101
|
+
var import_react_native19 = require("@granite-js/react-native");
|
|
1102
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1103
|
+
function PermissionsMenu() {
|
|
1104
|
+
const globals = getAppsInTossGlobals();
|
|
1105
|
+
if ((0, import_native_modules11.getOperationalEnvironment)() === "sandbox") {
|
|
1106
|
+
return null;
|
|
1107
|
+
}
|
|
1108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1109
|
+
Menu,
|
|
1110
|
+
{
|
|
1111
|
+
title: "\uAD8C\uD55C \uC124\uC815",
|
|
1112
|
+
iconURL: "https://static.toss.im/icons/png/4x/icon-setting-mono.png",
|
|
1113
|
+
onPress: () => (0, import_react_native19.openURL)(`servicetoss://apps-in-toss-menu/permissions?appName=${import_react_native19.Granite.appName}&displayAppName=${globals.brandDisplayName}`)
|
|
1114
|
+
}
|
|
1115
|
+
);
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1038
1118
|
// src/core/utils/ensureValue.ts
|
|
1039
1119
|
function ensureValue(value, name) {
|
|
1040
1120
|
if (value === void 0) {
|
|
@@ -1044,7 +1124,7 @@ function ensureValue(value, name) {
|
|
|
1044
1124
|
}
|
|
1045
1125
|
|
|
1046
1126
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
1047
|
-
var
|
|
1127
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1048
1128
|
var APP_BRIDGE_METHOD_NAME = "getMiniAppsSupportContact";
|
|
1049
1129
|
var MIN_VERSION = {
|
|
1050
1130
|
BOTTOM_SHEET: {
|
|
@@ -1054,6 +1134,10 @@ var MIN_VERSION = {
|
|
|
1054
1134
|
SHARE_LIST_MENU: {
|
|
1055
1135
|
android: "5.230.0",
|
|
1056
1136
|
ios: "5.230.0"
|
|
1137
|
+
},
|
|
1138
|
+
PERMISSIONS_MENU: {
|
|
1139
|
+
android: "5.238.0",
|
|
1140
|
+
ios: "5.237.0"
|
|
1057
1141
|
}
|
|
1058
1142
|
};
|
|
1059
1143
|
function useMoreButtonBottomSheet() {
|
|
@@ -1064,13 +1148,14 @@ function useMoreButtonBottomSheet() {
|
|
|
1064
1148
|
const logging = useMoreButtonBottomSheetLogging();
|
|
1065
1149
|
const overlay = (0, import_private4.useOverlay)();
|
|
1066
1150
|
const title = ensureValue(globals.brandDisplayName, "displayName");
|
|
1067
|
-
const isBottomSheetSupported = (0,
|
|
1068
|
-
const isShareListMenuSupported = (0,
|
|
1151
|
+
const isBottomSheetSupported = (0, import_native_modules12.isMinVersionSupported)(MIN_VERSION.BOTTOM_SHEET);
|
|
1152
|
+
const isShareListMenuSupported = (0, import_native_modules12.isMinVersionSupported)(MIN_VERSION.SHARE_LIST_MENU);
|
|
1153
|
+
const [isPermissionsMenuSupported, setIsPermissionsMenuSupported] = (0, import_react16.useState)(false);
|
|
1069
1154
|
(0, import_react16.useEffect)(() => {
|
|
1070
1155
|
if (!isBottomSheetSupported) {
|
|
1071
1156
|
return;
|
|
1072
1157
|
}
|
|
1073
|
-
|
|
1158
|
+
import_native_modules12.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1074
1159
|
APP_BRIDGE_METHOD_NAME,
|
|
1075
1160
|
{},
|
|
1076
1161
|
{
|
|
@@ -1078,6 +1163,16 @@ function useMoreButtonBottomSheet() {
|
|
|
1078
1163
|
onError: (error) => console.error("\uBA54\uB274 \uBAA9\uB85D\uC744 \uAC00\uC838\uC624\uB294 \uB370 \uC2E4\uD328\uD588\uC5B4\uC694:", error)
|
|
1079
1164
|
}
|
|
1080
1165
|
);
|
|
1166
|
+
if ((0, import_native_modules12.isMinVersionSupported)(MIN_VERSION.PERMISSIONS_MENU)) {
|
|
1167
|
+
import_native_modules12.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1168
|
+
"getAllPermission",
|
|
1169
|
+
{},
|
|
1170
|
+
{
|
|
1171
|
+
onSuccess: (permissions) => setIsPermissionsMenuSupported(permissions.length > 0),
|
|
1172
|
+
onError: (error) => console.error("\uAD8C\uD55C \uBAA9\uB85D\uC744 \uAC00\uC838\uC624\uB294 \uB370 \uC2E4\uD328\uD588\uC5B4\uC694:", error)
|
|
1173
|
+
}
|
|
1174
|
+
);
|
|
1175
|
+
}
|
|
1081
1176
|
}, [isBottomSheetSupported]);
|
|
1082
1177
|
const onClickHandler = async () => {
|
|
1083
1178
|
logging.open();
|
|
@@ -1093,18 +1188,18 @@ function useMoreButtonBottomSheet() {
|
|
|
1093
1188
|
logging.close();
|
|
1094
1189
|
close();
|
|
1095
1190
|
};
|
|
1096
|
-
return /* @__PURE__ */ (0,
|
|
1097
|
-
|
|
1191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(BottomSheetImpressionArea, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1192
|
+
import_tds_react_native9.BottomSheet.Root,
|
|
1098
1193
|
{
|
|
1099
|
-
header: /* @__PURE__ */ (0,
|
|
1100
|
-
|
|
1194
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1195
|
+
import_tds_react_native9.ListHeader,
|
|
1101
1196
|
{
|
|
1102
|
-
title: /* @__PURE__ */ (0,
|
|
1197
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_tds_react_native9.ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
|
|
1103
1198
|
}
|
|
1104
1199
|
),
|
|
1105
1200
|
open: isOpen,
|
|
1106
|
-
cta: /* @__PURE__ */ (0,
|
|
1107
|
-
|
|
1201
|
+
cta: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1202
|
+
import_tds_react_native9.BottomSheet.CTA,
|
|
1108
1203
|
{
|
|
1109
1204
|
size: "large",
|
|
1110
1205
|
type: "dark",
|
|
@@ -1117,37 +1212,20 @@ function useMoreButtonBottomSheet() {
|
|
|
1117
1212
|
),
|
|
1118
1213
|
onClose: handleClose,
|
|
1119
1214
|
onExited: exit,
|
|
1120
|
-
children: /* @__PURE__ */ (0,
|
|
1121
|
-
itemList.map(
|
|
1122
|
-
|
|
1123
|
-
|
|
1215
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_tds_react_native9.List, { rowSeparator: "none", children: [
|
|
1216
|
+
itemList.map(
|
|
1217
|
+
(item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1218
|
+
Menu,
|
|
1124
1219
|
{
|
|
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
|
-
}
|
|
1220
|
+
title: item.contactItemName,
|
|
1221
|
+
iconURL: item.contactIconUrl,
|
|
1222
|
+
onPress: () => (0, import_react_native20.openURL)(item.contactUri)
|
|
1146
1223
|
},
|
|
1147
1224
|
item.contactItemName
|
|
1148
|
-
)
|
|
1149
|
-
|
|
1150
|
-
isShareListMenuSupported && /* @__PURE__ */ (0,
|
|
1225
|
+
)
|
|
1226
|
+
),
|
|
1227
|
+
isShareListMenuSupported && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AppShareListMenu, {}),
|
|
1228
|
+
isPermissionsMenuSupported && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PermissionsMenu, {})
|
|
1151
1229
|
] })
|
|
1152
1230
|
}
|
|
1153
1231
|
) });
|
|
@@ -1160,12 +1238,12 @@ function BottomSheetImpressionArea({ children }) {
|
|
|
1160
1238
|
(0, import_react16.useEffect)(() => {
|
|
1161
1239
|
logging.show();
|
|
1162
1240
|
}, [logging]);
|
|
1163
|
-
return /* @__PURE__ */ (0,
|
|
1241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children });
|
|
1164
1242
|
}
|
|
1165
1243
|
|
|
1166
1244
|
// src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
|
|
1167
1245
|
var import_react17 = require("react");
|
|
1168
|
-
var
|
|
1246
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1169
1247
|
function NavigationBarImpressionArea({
|
|
1170
1248
|
children,
|
|
1171
1249
|
withHomeButton
|
|
@@ -1178,11 +1256,11 @@ function NavigationBarImpressionArea({
|
|
|
1178
1256
|
hasLogged.current = true;
|
|
1179
1257
|
}
|
|
1180
1258
|
}, [logging, withHomeButton]);
|
|
1181
|
-
return /* @__PURE__ */ (0,
|
|
1259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children });
|
|
1182
1260
|
}
|
|
1183
1261
|
|
|
1184
1262
|
// src/components/NavigationBar/RNNavigationBar/Default.tsx
|
|
1185
|
-
var
|
|
1263
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1186
1264
|
function DefaultNavigationBar() {
|
|
1187
1265
|
const globals = getAppsInTossGlobals();
|
|
1188
1266
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
@@ -1192,7 +1270,7 @@ function DefaultNavigationBar() {
|
|
|
1192
1270
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1193
1271
|
const navigationEvent = useNavigationEvent();
|
|
1194
1272
|
useHardwareBackPress(navigationEvent.handleBack);
|
|
1195
|
-
return /* @__PURE__ */ (0,
|
|
1273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1196
1274
|
import_private5.TopNavigation,
|
|
1197
1275
|
{
|
|
1198
1276
|
title: globals.brandDisplayName,
|
|
@@ -1203,17 +1281,17 @@ function DefaultNavigationBar() {
|
|
|
1203
1281
|
onPressClose: navigationEvent.handleCloseButtonClick,
|
|
1204
1282
|
withHome: withHomeButton,
|
|
1205
1283
|
fixedRightButton: navigationRightButton,
|
|
1206
|
-
children: /* @__PURE__ */ (0,
|
|
1284
|
+
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
1285
|
}
|
|
1208
1286
|
) });
|
|
1209
1287
|
}
|
|
1210
1288
|
|
|
1211
1289
|
// src/components/NavigationBar/RNNavigationBar/Game.tsx
|
|
1212
1290
|
var import_react_native_safe_area_context = require("@granite-js/native/react-native-safe-area-context");
|
|
1213
|
-
var
|
|
1291
|
+
var import_tds_react_native10 = require("@toss/tds-react-native");
|
|
1214
1292
|
var import_private6 = require("@toss/tds-react-native/private");
|
|
1215
|
-
var
|
|
1216
|
-
var
|
|
1293
|
+
var import_react_native21 = require("react-native");
|
|
1294
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1217
1295
|
function GameNavigationBar() {
|
|
1218
1296
|
const safeAreaTop = (0, import_private6.useSafeAreaTop)();
|
|
1219
1297
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
@@ -1221,15 +1299,15 @@ function GameNavigationBar() {
|
|
|
1221
1299
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1222
1300
|
const { right: safeAreaRight } = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
|
|
1223
1301
|
useHardwareBackPress(navigationEvent.handleBack);
|
|
1224
|
-
return /* @__PURE__ */ (0,
|
|
1225
|
-
/* @__PURE__ */ (0,
|
|
1226
|
-
/* @__PURE__ */ (0,
|
|
1227
|
-
|
|
1302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1303
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_tds_react_native10.PageNavbar, { preference: { type: "none" } }),
|
|
1304
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1305
|
+
import_react_native21.View,
|
|
1228
1306
|
{
|
|
1229
1307
|
style: {
|
|
1230
1308
|
width: "100%",
|
|
1231
1309
|
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1232
|
-
height:
|
|
1310
|
+
height: import_react_native21.Platform.OS === "ios" ? 44 : 54,
|
|
1233
1311
|
flexDirection: "row",
|
|
1234
1312
|
alignItems: "center",
|
|
1235
1313
|
justifyContent: "flex-end",
|
|
@@ -1239,7 +1317,7 @@ function GameNavigationBar() {
|
|
|
1239
1317
|
paddingRight: safeAreaRight + 10
|
|
1240
1318
|
},
|
|
1241
1319
|
pointerEvents: "box-none",
|
|
1242
|
-
children: /* @__PURE__ */ (0,
|
|
1320
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1243
1321
|
import_private6.NavigationRightContent,
|
|
1244
1322
|
{
|
|
1245
1323
|
fixedRightButton: navigationRightButton,
|
|
@@ -1266,83 +1344,83 @@ __reExport(bridge_entry_exports, require("@apps-in-toss/native-modules/constant-
|
|
|
1266
1344
|
__reExport(bridge_entry_exports, require("@apps-in-toss/native-modules/event-bridges"));
|
|
1267
1345
|
|
|
1268
1346
|
// src/components/RNAppContainer.tsx
|
|
1269
|
-
var
|
|
1347
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1270
1348
|
function RNAppContainer({ children }) {
|
|
1271
1349
|
const global2 = getAppsInTossGlobals();
|
|
1272
1350
|
switch (global2.appType) {
|
|
1273
1351
|
case "game":
|
|
1274
|
-
return /* @__PURE__ */ (0,
|
|
1352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GameAppContainer, { children });
|
|
1275
1353
|
case "general":
|
|
1276
1354
|
default:
|
|
1277
|
-
return /* @__PURE__ */ (0,
|
|
1355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GeneralAppContainer, { children });
|
|
1278
1356
|
}
|
|
1279
1357
|
}
|
|
1280
1358
|
function GameAppContainer({ children }) {
|
|
1281
1359
|
const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react18.useState)(false);
|
|
1282
1360
|
(0, import_react18.useEffect)(() => {
|
|
1283
|
-
if (
|
|
1284
|
-
(0,
|
|
1361
|
+
if (import_react_native22.Platform.OS === "ios") {
|
|
1362
|
+
(0, import_native_modules13.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1285
1363
|
return () => {
|
|
1286
|
-
(0,
|
|
1364
|
+
(0, import_native_modules13.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1287
1365
|
};
|
|
1288
1366
|
}
|
|
1289
1367
|
return;
|
|
1290
1368
|
}, []);
|
|
1291
1369
|
(0, import_react18.useEffect)(() => {
|
|
1292
|
-
|
|
1370
|
+
import_native_modules13.appsInTossEvent.addEventListener("entryMessageExited", {
|
|
1293
1371
|
onEvent: () => {
|
|
1294
1372
|
setIsEntryMessageExited(true);
|
|
1295
1373
|
}
|
|
1296
1374
|
});
|
|
1297
1375
|
}, []);
|
|
1298
|
-
return /* @__PURE__ */ (0,
|
|
1299
|
-
/* @__PURE__ */ (0,
|
|
1300
|
-
(0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0,
|
|
1376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1377
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RNNavigationBar.Game, {}),
|
|
1378
|
+
(0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GameInitializer, { isReadyForProfileUI: isEntryMessageExited, children }) : children
|
|
1301
1379
|
] });
|
|
1302
1380
|
}
|
|
1303
1381
|
function GeneralAppContainer({ children }) {
|
|
1304
|
-
return /* @__PURE__ */ (0,
|
|
1305
|
-
/* @__PURE__ */ (0,
|
|
1382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1383
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RNNavigationBar.Default, {}),
|
|
1306
1384
|
children
|
|
1307
1385
|
] });
|
|
1308
1386
|
}
|
|
1309
1387
|
|
|
1310
1388
|
// src/core/registerApp.tsx
|
|
1311
|
-
var
|
|
1389
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1312
1390
|
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
1313
|
-
if (!(0,
|
|
1391
|
+
if (!(0, import_native_modules14.isMinVersionSupported)({
|
|
1314
1392
|
android: "5.220.0",
|
|
1315
1393
|
ios: "5.221.0"
|
|
1316
1394
|
})) {
|
|
1317
|
-
return /* @__PURE__ */ (0,
|
|
1318
|
-
/* @__PURE__ */ (0,
|
|
1319
|
-
/* @__PURE__ */ (0,
|
|
1320
|
-
/* @__PURE__ */ (0,
|
|
1395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1396
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.Entry, {}),
|
|
1397
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.System, { ...initialProps }),
|
|
1398
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppUpdate, {})
|
|
1321
1399
|
] });
|
|
1322
1400
|
}
|
|
1323
|
-
return /* @__PURE__ */ (0,
|
|
1324
|
-
/* @__PURE__ */ (0,
|
|
1325
|
-
/* @__PURE__ */ (0,
|
|
1326
|
-
/* @__PURE__ */ (0,
|
|
1327
|
-
/* @__PURE__ */ (0,
|
|
1401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1402
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.StayTime, {}),
|
|
1403
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.Entry, {}),
|
|
1404
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppEvent.System, { ...initialProps }),
|
|
1405
|
+
/* @__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
1406
|
] });
|
|
1329
1407
|
}
|
|
1330
1408
|
function TDSContainer({ children }) {
|
|
1331
1409
|
useAppsInTossBridge();
|
|
1332
|
-
return /* @__PURE__ */ (0,
|
|
1410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children });
|
|
1333
1411
|
}
|
|
1334
1412
|
function registerApp(container, { context, analytics }) {
|
|
1335
1413
|
const appName = getAppName();
|
|
1336
|
-
const isRegistered =
|
|
1414
|
+
const isRegistered = import_react_native24.AppRegistry.getAppKeys().includes(appName);
|
|
1337
1415
|
if (!isRegistered) {
|
|
1338
1416
|
import_analytics.Analytics.init({
|
|
1339
|
-
logger: (params) => void (0,
|
|
1417
|
+
logger: (params) => void (0, import_native_modules14.eventLog)(params),
|
|
1340
1418
|
debug: analytics?.debug ?? __DEV__
|
|
1341
1419
|
});
|
|
1342
|
-
const App =
|
|
1420
|
+
const App = import_react_native23.Granite.registerApp(AppsInTossContainer.bind(null, container), {
|
|
1343
1421
|
appName,
|
|
1344
1422
|
context,
|
|
1345
|
-
setIosSwipeGestureEnabled:
|
|
1423
|
+
setIosSwipeGestureEnabled: import_native_modules14.setIosSwipeGestureEnabled,
|
|
1346
1424
|
router: {
|
|
1347
1425
|
screenContainer: AppsInTossScreenContainer,
|
|
1348
1426
|
defaultScreenOption: {
|
|
@@ -1356,7 +1434,7 @@ function registerApp(container, { context, analytics }) {
|
|
|
1356
1434
|
}
|
|
1357
1435
|
function AppsInTossScreenContainer({ children }) {
|
|
1358
1436
|
const isRNApp = getAppsInTossGlobals().webViewType == null;
|
|
1359
|
-
return /* @__PURE__ */ (0,
|
|
1437
|
+
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
1438
|
}
|
|
1361
1439
|
function getAppName() {
|
|
1362
1440
|
try {
|
|
@@ -1373,35 +1451,35 @@ var AppsInToss = {
|
|
|
1373
1451
|
};
|
|
1374
1452
|
|
|
1375
1453
|
// src/components/WebView.tsx
|
|
1376
|
-
var
|
|
1454
|
+
var import_native_modules19 = require("@apps-in-toss/native-modules");
|
|
1377
1455
|
var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async-bridges"), 1);
|
|
1378
1456
|
var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
|
|
1379
1457
|
var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event-bridges"), 1);
|
|
1380
1458
|
var import_react_native_safe_area_context4 = require("@granite-js/native/react-native-safe-area-context");
|
|
1381
|
-
var
|
|
1382
|
-
var
|
|
1459
|
+
var import_react_native34 = require("@granite-js/react-native");
|
|
1460
|
+
var import_tds_react_native15 = require("@toss/tds-react-native");
|
|
1383
1461
|
var import_private9 = require("@toss/tds-react-native/private");
|
|
1384
1462
|
var import_react29 = require("react");
|
|
1385
|
-
var
|
|
1463
|
+
var import_react_native35 = require("react-native");
|
|
1386
1464
|
|
|
1387
1465
|
// src/components/GameWebView.tsx
|
|
1388
|
-
var
|
|
1466
|
+
var import_native_modules15 = require("@apps-in-toss/native-modules");
|
|
1389
1467
|
var import_react_native_webview = require("@granite-js/native/react-native-webview");
|
|
1390
1468
|
var import_react20 = require("react");
|
|
1391
|
-
var
|
|
1469
|
+
var import_react_native27 = require("react-native");
|
|
1392
1470
|
|
|
1393
1471
|
// src/components/NavigationBar/GameWebviewNavigationBar.tsx
|
|
1394
1472
|
var import_react_native_safe_area_context2 = require("@granite-js/native/react-native-safe-area-context");
|
|
1395
|
-
var
|
|
1396
|
-
var
|
|
1473
|
+
var import_react_native25 = require("@granite-js/react-native");
|
|
1474
|
+
var import_tds_react_native12 = require("@toss/tds-react-native");
|
|
1397
1475
|
var import_private7 = require("@toss/tds-react-native/private");
|
|
1398
1476
|
var import_es_hangul3 = require("es-hangul");
|
|
1399
1477
|
var import_react19 = require("react");
|
|
1400
|
-
var
|
|
1401
|
-
var
|
|
1478
|
+
var import_react_native26 = require("react-native");
|
|
1479
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1402
1480
|
function GameWebviewNavigationBar() {
|
|
1403
1481
|
const safeAreaTop = (0, import_private7.useSafeAreaTop)();
|
|
1404
|
-
const { openConfirm } = (0,
|
|
1482
|
+
const { openConfirm } = (0, import_tds_react_native12.useDialog)();
|
|
1405
1483
|
const { captureExitLog } = useCaptureExitLog();
|
|
1406
1484
|
const global2 = getAppsInTossGlobals();
|
|
1407
1485
|
const logging = useNavigationBarLogging();
|
|
@@ -1420,18 +1498,18 @@ function GameWebviewNavigationBar() {
|
|
|
1420
1498
|
logging.closePopupCtaClick(isConfirmed);
|
|
1421
1499
|
if (isConfirmed) {
|
|
1422
1500
|
captureExitLog(Date.now());
|
|
1423
|
-
(0,
|
|
1501
|
+
(0, import_react_native25.closeView)();
|
|
1424
1502
|
}
|
|
1425
1503
|
}, [captureExitLog, global2.brandDisplayName, logging, openConfirm]);
|
|
1426
|
-
return /* @__PURE__ */ (0,
|
|
1427
|
-
/* @__PURE__ */ (0,
|
|
1428
|
-
/* @__PURE__ */ (0,
|
|
1429
|
-
|
|
1504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1505
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_tds_react_native12.PageNavbar, { preference: { type: "none" } }),
|
|
1506
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1507
|
+
import_react_native26.View,
|
|
1430
1508
|
{
|
|
1431
1509
|
style: {
|
|
1432
1510
|
width: "100%",
|
|
1433
1511
|
// TODO: UI관련 스타일 설정은 TDS로 이관
|
|
1434
|
-
height:
|
|
1512
|
+
height: import_react_native26.Platform.OS === "ios" ? 44 : 54,
|
|
1435
1513
|
flexDirection: "row",
|
|
1436
1514
|
alignItems: "center",
|
|
1437
1515
|
justifyContent: "flex-end",
|
|
@@ -1441,7 +1519,7 @@ function GameWebviewNavigationBar() {
|
|
|
1441
1519
|
paddingRight: safeAreaRight + 10
|
|
1442
1520
|
},
|
|
1443
1521
|
pointerEvents: "box-none",
|
|
1444
|
-
children: /* @__PURE__ */ (0,
|
|
1522
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1445
1523
|
import_private7.NavigationRightContent,
|
|
1446
1524
|
{
|
|
1447
1525
|
fixedRightButton: navigationRightButton,
|
|
@@ -1458,28 +1536,28 @@ function GameWebviewNavigationBar() {
|
|
|
1458
1536
|
}
|
|
1459
1537
|
|
|
1460
1538
|
// src/components/GameWebView.tsx
|
|
1461
|
-
var
|
|
1539
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1462
1540
|
var GameWebView = (0, import_react20.forwardRef)(function GameWebView2(props, ref) {
|
|
1463
1541
|
const [isEntryMessageExited, setIsEntryMessageExited] = (0, import_react20.useState)(false);
|
|
1464
1542
|
(0, import_react20.useEffect)(() => {
|
|
1465
|
-
if (
|
|
1466
|
-
(0,
|
|
1543
|
+
if (import_react_native27.Platform.OS === "ios") {
|
|
1544
|
+
(0, import_native_modules15.setIosSwipeGestureEnabled)({ isEnabled: false });
|
|
1467
1545
|
return () => {
|
|
1468
|
-
(0,
|
|
1546
|
+
(0, import_native_modules15.setIosSwipeGestureEnabled)({ isEnabled: true });
|
|
1469
1547
|
};
|
|
1470
1548
|
}
|
|
1471
1549
|
return;
|
|
1472
1550
|
}, []);
|
|
1473
1551
|
(0, import_react20.useEffect)(() => {
|
|
1474
|
-
|
|
1552
|
+
import_native_modules15.appsInTossEvent.addEventListener("entryMessageExited", {
|
|
1475
1553
|
onEvent: () => {
|
|
1476
1554
|
setIsEntryMessageExited(true);
|
|
1477
1555
|
}
|
|
1478
1556
|
});
|
|
1479
1557
|
}, []);
|
|
1480
|
-
return /* @__PURE__ */ (0,
|
|
1481
|
-
/* @__PURE__ */ (0,
|
|
1482
|
-
(0,
|
|
1558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
1559
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GameWebviewNavigationBar, {}),
|
|
1560
|
+
(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
1561
|
] });
|
|
1484
1562
|
});
|
|
1485
1563
|
|
|
@@ -1488,17 +1566,17 @@ var import_react_native_webview2 = require("@granite-js/native/react-native-webv
|
|
|
1488
1566
|
var import_react22 = require("react");
|
|
1489
1567
|
|
|
1490
1568
|
// src/components/NavigationBar/PartnerWebviewNavigationBar.tsx
|
|
1491
|
-
var
|
|
1492
|
-
var
|
|
1569
|
+
var import_react_native28 = require("@granite-js/react-native");
|
|
1570
|
+
var import_tds_react_native13 = require("@toss/tds-react-native");
|
|
1493
1571
|
var import_private8 = require("@toss/tds-react-native/private");
|
|
1494
1572
|
var import_es_hangul4 = require("es-hangul");
|
|
1495
1573
|
var import_react21 = require("react");
|
|
1496
|
-
var
|
|
1574
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1497
1575
|
function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
1498
1576
|
const globals = getAppsInTossGlobals();
|
|
1499
1577
|
const { captureExitLog } = useCaptureExitLog();
|
|
1500
1578
|
const logging = useNavigationBarLogging();
|
|
1501
|
-
const { openConfirm } = (0,
|
|
1579
|
+
const { openConfirm } = (0, import_tds_react_native13.useDialog)();
|
|
1502
1580
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
1503
1581
|
const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
|
|
1504
1582
|
const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
|
|
@@ -1516,10 +1594,10 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1516
1594
|
logging.closePopupCtaClick(isConfirmed);
|
|
1517
1595
|
if (isConfirmed) {
|
|
1518
1596
|
captureExitLog(Date.now());
|
|
1519
|
-
(0,
|
|
1597
|
+
(0, import_react_native28.closeView)();
|
|
1520
1598
|
}
|
|
1521
1599
|
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
1522
|
-
return /* @__PURE__ */ (0,
|
|
1600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1523
1601
|
import_private8.TopNavigation,
|
|
1524
1602
|
{
|
|
1525
1603
|
title: globals.brandDisplayName,
|
|
@@ -1530,17 +1608,17 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1530
1608
|
onPressClose: handleClose,
|
|
1531
1609
|
withHome: withHomeButton,
|
|
1532
1610
|
fixedRightButton: navigationRightButton,
|
|
1533
|
-
children: /* @__PURE__ */ (0,
|
|
1611
|
+
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
1612
|
}
|
|
1535
1613
|
) });
|
|
1536
1614
|
}
|
|
1537
1615
|
|
|
1538
1616
|
// src/components/PartnerWebView.tsx
|
|
1539
|
-
var
|
|
1617
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1540
1618
|
var PartnerWebView = (0, import_react22.forwardRef)(function PartnerWebViewScreen({ onBackButtonClick, onHomeButtonClick, ...webViewProps }, ref) {
|
|
1541
|
-
return /* @__PURE__ */ (0,
|
|
1542
|
-
/* @__PURE__ */ (0,
|
|
1543
|
-
/* @__PURE__ */ (0,
|
|
1619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1620
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PartnerWebviewNavigationBar, { onBackButtonClick, onHomeButtonClick }),
|
|
1621
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native_webview2.WebView, { ref, ...webViewProps, style: { flex: 1 } })
|
|
1544
1622
|
] });
|
|
1545
1623
|
});
|
|
1546
1624
|
|
|
@@ -1719,8 +1797,8 @@ function useSafeAreaInsetsEmitter() {
|
|
|
1719
1797
|
}
|
|
1720
1798
|
|
|
1721
1799
|
// src/core/hooks/useWebBackHandler.tsx
|
|
1722
|
-
var
|
|
1723
|
-
var
|
|
1800
|
+
var import_react_native29 = require("@granite-js/react-native");
|
|
1801
|
+
var import_tds_react_native14 = require("@toss/tds-react-native");
|
|
1724
1802
|
var import_es_hangul5 = require("es-hangul");
|
|
1725
1803
|
var import_react26 = require("react");
|
|
1726
1804
|
|
|
@@ -1789,9 +1867,9 @@ function useWebBackHandler(webViewRef) {
|
|
|
1789
1867
|
hasBackEvent: hasWebBackEvent,
|
|
1790
1868
|
addEventListener: addWebBackEventListener,
|
|
1791
1869
|
removeEventListener: removeWebBackEventListener
|
|
1792
|
-
} = (0,
|
|
1870
|
+
} = (0, import_react_native29.useBackEventState)();
|
|
1793
1871
|
const logging = useNavigationBarLogging();
|
|
1794
|
-
const { openConfirm } = (0,
|
|
1872
|
+
const { openConfirm } = (0, import_tds_react_native14.useDialog)();
|
|
1795
1873
|
const global2 = getAppsInTossGlobals();
|
|
1796
1874
|
const addEventListener = (0, import_react26.useCallback)(
|
|
1797
1875
|
(handler) => {
|
|
@@ -1825,7 +1903,7 @@ function useWebBackHandler(webViewRef) {
|
|
|
1825
1903
|
logging.closePopupCtaClick(isConfirmed);
|
|
1826
1904
|
if (isConfirmed) {
|
|
1827
1905
|
captureExitLog(Date.now());
|
|
1828
|
-
(0,
|
|
1906
|
+
(0, import_react_native29.closeView)();
|
|
1829
1907
|
}
|
|
1830
1908
|
}
|
|
1831
1909
|
}, [
|
|
@@ -1868,8 +1946,8 @@ function mergeRefs(...refs) {
|
|
|
1868
1946
|
}
|
|
1869
1947
|
|
|
1870
1948
|
// src/hooks/useCreateUserAgent.ts
|
|
1871
|
-
var
|
|
1872
|
-
var
|
|
1949
|
+
var import_native_modules16 = require("@apps-in-toss/native-modules");
|
|
1950
|
+
var import_react_native30 = require("react-native");
|
|
1873
1951
|
var FontA11yCategory = {
|
|
1874
1952
|
Large: "Large",
|
|
1875
1953
|
xLarge: "xLarge",
|
|
@@ -2002,9 +2080,9 @@ function useCreateUserAgent({
|
|
|
2002
2080
|
safeArea,
|
|
2003
2081
|
safeAreaBottomTransparency
|
|
2004
2082
|
}) {
|
|
2005
|
-
const platform = (0,
|
|
2006
|
-
const appVersion = (0,
|
|
2007
|
-
const { fontScale } = (0,
|
|
2083
|
+
const platform = (0, import_native_modules16.getPlatformOS)();
|
|
2084
|
+
const appVersion = (0, import_native_modules16.getTossAppVersion)();
|
|
2085
|
+
const { fontScale } = (0, import_react_native30.useWindowDimensions)();
|
|
2008
2086
|
const platformString = platform === "ios" ? "iPhone" : "Android phone";
|
|
2009
2087
|
const fontA11y = mapFontScaleToCategory(fontScale, platform);
|
|
2010
2088
|
const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
|
|
@@ -2024,17 +2102,17 @@ function useCreateUserAgent({
|
|
|
2024
2102
|
}
|
|
2025
2103
|
|
|
2026
2104
|
// src/hooks/useGeolocation.ts
|
|
2027
|
-
var
|
|
2028
|
-
var
|
|
2105
|
+
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
2106
|
+
var import_react_native31 = require("@granite-js/react-native");
|
|
2029
2107
|
var import_react27 = require("react");
|
|
2030
2108
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
2031
|
-
const isVisible = (0,
|
|
2109
|
+
const isVisible = (0, import_react_native31.useVisibility)();
|
|
2032
2110
|
const [location, setLocation] = (0, import_react27.useState)(null);
|
|
2033
2111
|
(0, import_react27.useEffect)(() => {
|
|
2034
2112
|
if (!isVisible) {
|
|
2035
2113
|
return;
|
|
2036
2114
|
}
|
|
2037
|
-
return (0,
|
|
2115
|
+
return (0, import_native_modules17.startUpdateLocation)({
|
|
2038
2116
|
options: {
|
|
2039
2117
|
accuracy,
|
|
2040
2118
|
distanceInterval,
|
|
@@ -2048,11 +2126,11 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
2048
2126
|
}
|
|
2049
2127
|
|
|
2050
2128
|
// src/hooks/useWaitForReturnNavigator.tsx
|
|
2051
|
-
var
|
|
2129
|
+
var import_react_native32 = require("@granite-js/react-native");
|
|
2052
2130
|
var import_react28 = require("react");
|
|
2053
2131
|
function useWaitForReturnNavigator() {
|
|
2054
2132
|
const callbacks = (0, import_react28.useRef)([]).current;
|
|
2055
|
-
const navigation = (0,
|
|
2133
|
+
const navigation = (0, import_react_native32.useNavigation)();
|
|
2056
2134
|
const startNavigating = (0, import_react28.useCallback)(
|
|
2057
2135
|
(route, params) => {
|
|
2058
2136
|
return new Promise((resolve) => {
|
|
@@ -2073,7 +2151,7 @@ function useWaitForReturnNavigator() {
|
|
|
2073
2151
|
},
|
|
2074
2152
|
[callbacks]
|
|
2075
2153
|
);
|
|
2076
|
-
(0,
|
|
2154
|
+
(0, import_react_native32.useVisibilityChange)(handleVisibilityChange);
|
|
2077
2155
|
return startNavigating;
|
|
2078
2156
|
}
|
|
2079
2157
|
|
|
@@ -2087,8 +2165,8 @@ function useTopNavigation() {
|
|
|
2087
2165
|
}
|
|
2088
2166
|
|
|
2089
2167
|
// src/utils/log.ts
|
|
2090
|
-
var
|
|
2091
|
-
var
|
|
2168
|
+
var import_native_modules18 = require("@apps-in-toss/native-modules");
|
|
2169
|
+
var import_react_native33 = require("@granite-js/react-native");
|
|
2092
2170
|
|
|
2093
2171
|
// src/utils/extractDateFromUUIDv7.ts
|
|
2094
2172
|
var extractDateFromUUIDv7 = (uuid) => {
|
|
@@ -2114,7 +2192,7 @@ var getGroupId = (url) => {
|
|
|
2114
2192
|
};
|
|
2115
2193
|
var getReferrer = () => {
|
|
2116
2194
|
try {
|
|
2117
|
-
const referrer = new URL((0,
|
|
2195
|
+
const referrer = new URL((0, import_react_native33.getSchemeUri)());
|
|
2118
2196
|
return referrer.searchParams.get("referrer");
|
|
2119
2197
|
} catch {
|
|
2120
2198
|
return "";
|
|
@@ -2132,21 +2210,21 @@ var trackScreen = (url) => {
|
|
|
2132
2210
|
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
2133
2211
|
}
|
|
2134
2212
|
};
|
|
2135
|
-
return (0,
|
|
2213
|
+
return (0, import_native_modules18.eventLog)(log);
|
|
2136
2214
|
};
|
|
2137
2215
|
|
|
2138
2216
|
// src/components/WebView.tsx
|
|
2139
|
-
var
|
|
2217
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2140
2218
|
var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
|
|
2141
2219
|
var TYPES = ["partner", "external", "game"];
|
|
2142
2220
|
var WEBVIEW_TYPES = {
|
|
2143
2221
|
partner: PartnerWebView,
|
|
2144
|
-
external:
|
|
2222
|
+
external: import_tds_react_native15.ExternalWebViewScreen,
|
|
2145
2223
|
game: GameWebView
|
|
2146
2224
|
};
|
|
2147
2225
|
function mergeSchemeQueryParamsInto(url) {
|
|
2148
2226
|
const baseUrl = new URL(url);
|
|
2149
|
-
const schemeUrl = new URL((0,
|
|
2227
|
+
const schemeUrl = new URL((0, import_react_native34.getSchemeUri)());
|
|
2150
2228
|
baseUrl.pathname = schemeUrl.pathname;
|
|
2151
2229
|
for (const [key, value] of schemeUrl.searchParams.entries()) {
|
|
2152
2230
|
baseUrl.searchParams.set(key, value);
|
|
@@ -2158,7 +2236,7 @@ function getWebViewUri(local) {
|
|
|
2158
2236
|
const devUrl = `http://${local.host}:${local.port}`;
|
|
2159
2237
|
return mergeSchemeQueryParamsInto(devUrl).toString();
|
|
2160
2238
|
}
|
|
2161
|
-
const { url: rawUrl } =
|
|
2239
|
+
const { url: rawUrl } = import_native_modules19.AppsInTossModule.getWebBundleURL({});
|
|
2162
2240
|
const url = mergeSchemeQueryParamsInto(rawUrl);
|
|
2163
2241
|
const deploymentId = env.getDeploymentId();
|
|
2164
2242
|
if (deploymentId) {
|
|
@@ -2187,15 +2265,15 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2187
2265
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2188
2266
|
eventListenerMap: {
|
|
2189
2267
|
...appsInTossEventBridges,
|
|
2190
|
-
navigationAccessoryEvent: ({ onEvent, onError }) =>
|
|
2268
|
+
navigationAccessoryEvent: ({ onEvent, onError }) => import_tds_react_native15.tdsEvent.addEventListener("navigationAccessoryEvent", { onEvent, onError }),
|
|
2191
2269
|
backEvent: ({ onEvent }) => {
|
|
2192
2270
|
webBackHandler.addEventListener(onEvent);
|
|
2193
2271
|
return () => {
|
|
2194
2272
|
webBackHandler.removeEventListener(onEvent);
|
|
2195
2273
|
};
|
|
2196
2274
|
},
|
|
2197
|
-
entryMessageExited: ({ onEvent, onError }) =>
|
|
2198
|
-
updateLocationEvent: ({ onEvent, onError, options }) =>
|
|
2275
|
+
entryMessageExited: ({ onEvent, onError }) => import_native_modules19.appsInTossEvent.addEventListener("entryMessageExited", { onEvent, onError }),
|
|
2276
|
+
updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules19.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
2199
2277
|
safeAreaInsetsChange: ({ onEvent }) => {
|
|
2200
2278
|
safeAreaInsetsEmitter.on("safeAreaInsetsChange", onEvent);
|
|
2201
2279
|
return () => {
|
|
@@ -2203,18 +2281,18 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2203
2281
|
};
|
|
2204
2282
|
},
|
|
2205
2283
|
/** @internal */
|
|
2206
|
-
appBridgeCallbackEvent: ({ onEvent, onError, options }) =>
|
|
2284
|
+
appBridgeCallbackEvent: ({ onEvent, onError, options }) => import_native_modules19.appsInTossEvent.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
|
|
2207
2285
|
/** AdMob */
|
|
2208
|
-
loadAdMobInterstitialAd:
|
|
2209
|
-
showAdMobInterstitialAd:
|
|
2210
|
-
loadAdMobRewardedAd:
|
|
2211
|
-
showAdMobRewardedAd:
|
|
2286
|
+
loadAdMobInterstitialAd: import_native_modules19.GoogleAdMob.loadAdMobInterstitialAd,
|
|
2287
|
+
showAdMobInterstitialAd: import_native_modules19.GoogleAdMob.showAdMobInterstitialAd,
|
|
2288
|
+
loadAdMobRewardedAd: import_native_modules19.GoogleAdMob.loadAdMobRewardedAd,
|
|
2289
|
+
showAdMobRewardedAd: import_native_modules19.GoogleAdMob.showAdMobRewardedAd,
|
|
2212
2290
|
/** AdMobV2 */
|
|
2213
|
-
loadAppsInTossAdMob:
|
|
2214
|
-
showAppsInTossAdMob:
|
|
2291
|
+
loadAppsInTossAdMob: import_native_modules19.GoogleAdMob.loadAppsInTossAdMob,
|
|
2292
|
+
showAppsInTossAdMob: import_native_modules19.GoogleAdMob.showAppsInTossAdMob,
|
|
2215
2293
|
/** IAP */
|
|
2216
|
-
iapCreateOneTimePurchaseOrder:
|
|
2217
|
-
requestOneTimePurchase:
|
|
2294
|
+
iapCreateOneTimePurchaseOrder: import_native_modules19.IAP.createOneTimePurchaseOrder,
|
|
2295
|
+
requestOneTimePurchase: import_native_modules19.requestOneTimePurchase
|
|
2218
2296
|
},
|
|
2219
2297
|
constantHandlerMap: {
|
|
2220
2298
|
...appsInTossConstantBridges,
|
|
@@ -2224,13 +2302,13 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2224
2302
|
getSafeAreaRight: () => insets.right,
|
|
2225
2303
|
...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
|
|
2226
2304
|
/** AdMob */
|
|
2227
|
-
loadAdMobInterstitialAd_isSupported:
|
|
2228
|
-
showAdMobInterstitialAd_isSupported:
|
|
2229
|
-
loadAdMobRewardedAd_isSupported:
|
|
2230
|
-
showAdMobRewardedAd_isSupported:
|
|
2305
|
+
loadAdMobInterstitialAd_isSupported: import_native_modules19.GoogleAdMob.loadAdMobInterstitialAd.isSupported,
|
|
2306
|
+
showAdMobInterstitialAd_isSupported: import_native_modules19.GoogleAdMob.showAdMobInterstitialAd.isSupported,
|
|
2307
|
+
loadAdMobRewardedAd_isSupported: import_native_modules19.GoogleAdMob.loadAdMobRewardedAd.isSupported,
|
|
2308
|
+
showAdMobRewardedAd_isSupported: import_native_modules19.GoogleAdMob.showAdMobRewardedAd.isSupported,
|
|
2231
2309
|
/** AdMobV2 */
|
|
2232
|
-
loadAppsInTossAdMob_isSupported:
|
|
2233
|
-
showAppsInTossAdMob_isSupported:
|
|
2310
|
+
loadAppsInTossAdMob_isSupported: import_native_modules19.GoogleAdMob.loadAppsInTossAdMob.isSupported,
|
|
2311
|
+
showAppsInTossAdMob_isSupported: import_native_modules19.GoogleAdMob.showAppsInTossAdMob.isSupported,
|
|
2234
2312
|
/** env */
|
|
2235
2313
|
getDeploymentId: env.getDeploymentId
|
|
2236
2314
|
},
|
|
@@ -2253,17 +2331,17 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2253
2331
|
getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
|
|
2254
2332
|
openCamera: appsInTossAsyncBridges.openCamera,
|
|
2255
2333
|
/** Storage */
|
|
2256
|
-
getStorageItem:
|
|
2257
|
-
setStorageItem:
|
|
2258
|
-
removeStorageItem:
|
|
2259
|
-
clearItems:
|
|
2334
|
+
getStorageItem: import_native_modules19.Storage.getItem,
|
|
2335
|
+
setStorageItem: import_native_modules19.Storage.setItem,
|
|
2336
|
+
removeStorageItem: import_native_modules19.Storage.removeItem,
|
|
2337
|
+
clearItems: import_native_modules19.Storage.clearItems,
|
|
2260
2338
|
/** IAP */
|
|
2261
|
-
iapGetProductItemList:
|
|
2262
|
-
iapCreateOneTimePurchaseOrder:
|
|
2263
|
-
processProductGrant:
|
|
2264
|
-
getPendingOrders:
|
|
2265
|
-
getCompletedOrRefundedOrders:
|
|
2266
|
-
completeProductGrant:
|
|
2339
|
+
iapGetProductItemList: import_native_modules19.IAP.getProductItemList,
|
|
2340
|
+
iapCreateOneTimePurchaseOrder: import_native_modules19.iapCreateOneTimePurchaseOrder,
|
|
2341
|
+
processProductGrant: import_native_modules19.processProductGrant,
|
|
2342
|
+
getPendingOrders: import_native_modules19.IAP.getPendingOrders,
|
|
2343
|
+
getCompletedOrRefundedOrders: import_native_modules19.IAP.getCompletedOrRefundedOrders,
|
|
2344
|
+
completeProductGrant: import_native_modules19.IAP.completeProductGrant
|
|
2267
2345
|
}
|
|
2268
2346
|
});
|
|
2269
2347
|
const headerPropForExternalWebView = (0, import_react29.useMemo)(() => {
|
|
@@ -2292,11 +2370,11 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2292
2370
|
webBackHandler.handleWebBack();
|
|
2293
2371
|
return true;
|
|
2294
2372
|
};
|
|
2295
|
-
|
|
2296
|
-
return () =>
|
|
2373
|
+
import_react_native35.BackHandler.addEventListener("hardwareBackPress", callback);
|
|
2374
|
+
return () => import_react_native35.BackHandler.removeEventListener("hardwareBackPress", callback);
|
|
2297
2375
|
}, [webBackHandler]);
|
|
2298
2376
|
const globalScripts = useGlobalScripts();
|
|
2299
|
-
return /* @__PURE__ */ (0,
|
|
2377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2300
2378
|
BaseWebView,
|
|
2301
2379
|
{
|
|
2302
2380
|
ref: refs,
|
|
@@ -2318,14 +2396,14 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2318
2396
|
props.onNavigationStateChange?.(event);
|
|
2319
2397
|
webBackHandler.onNavigationStateChange(event);
|
|
2320
2398
|
},
|
|
2321
|
-
userAgent:
|
|
2399
|
+
userAgent: import_react_native35.Platform.OS === "ios" ? userAgent : void 0,
|
|
2322
2400
|
sharedCookiesEnabled: true,
|
|
2323
2401
|
webviewDebuggingEnabled: webViewDebuggingEnabled,
|
|
2324
2402
|
thirdPartyCookiesEnabled: true,
|
|
2325
2403
|
onMessage: handler.onMessage,
|
|
2326
2404
|
injectedJavaScript: globalScripts.afterLoad,
|
|
2327
2405
|
injectedJavaScriptBeforeContentLoaded: mergeScripts(handler.injectedJavaScript, globalScripts.beforeLoad),
|
|
2328
|
-
decelerationRate:
|
|
2406
|
+
decelerationRate: import_react_native35.Platform.OS === "ios" ? 1 : void 0,
|
|
2329
2407
|
allowsBackForwardNavigationGestures
|
|
2330
2408
|
}
|
|
2331
2409
|
);
|