@apps-in-toss/framework 1.4.8 → 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.js
CHANGED
|
@@ -18,7 +18,7 @@ import { Analytics as InternalAnalytics } from "@apps-in-toss/analytics";
|
|
|
18
18
|
// src/core/registerApp.tsx
|
|
19
19
|
import { Analytics } from "@apps-in-toss/analytics";
|
|
20
20
|
import { isMinVersionSupported as isMinVersionSupported3, setIosSwipeGestureEnabled as setIosSwipeGestureEnabled2, eventLog } from "@apps-in-toss/native-modules";
|
|
21
|
-
import { Granite as
|
|
21
|
+
import { Granite as Granite7 } from "@granite-js/react-native";
|
|
22
22
|
import { TDSProvider } from "@toss/tds-react-native";
|
|
23
23
|
import { AppRegistry } from "react-native";
|
|
24
24
|
|
|
@@ -856,18 +856,22 @@ function useNavigationEvent() {
|
|
|
856
856
|
|
|
857
857
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
858
858
|
import { INTERNAL__appBridgeHandler, isMinVersionSupported as isMinVersionSupported2 } from "@apps-in-toss/native-modules";
|
|
859
|
-
import { openURL as
|
|
860
|
-
import { BottomSheet, List, ListHeader
|
|
859
|
+
import { openURL as openURL5 } from "@granite-js/react-native";
|
|
860
|
+
import { BottomSheet, List, ListHeader } from "@toss/tds-react-native";
|
|
861
861
|
import { useAdaptive as useAdaptive2, useOverlay as useOverlay2 } from "@toss/tds-react-native/private";
|
|
862
862
|
import { useEffect as useEffect7, useState as useState4 } from "react";
|
|
863
863
|
|
|
864
864
|
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
865
865
|
import { getOperationalEnvironment } from "@apps-in-toss/native-modules";
|
|
866
866
|
import { getSchemeUri as getSchemeUri4 } from "@granite-js/react-native";
|
|
867
|
-
import {
|
|
868
|
-
import { useAdaptive } from "@toss/tds-react-native/private";
|
|
867
|
+
import { useDialog as useDialog4 } from "@toss/tds-react-native";
|
|
869
868
|
import { NativeModules } from "react-native";
|
|
870
869
|
|
|
870
|
+
// src/core/hooks/useMoreButtonBottomSheet/Menu.tsx
|
|
871
|
+
import { ListRow, Asset as Asset2 } from "@toss/tds-react-native";
|
|
872
|
+
import { useAdaptive } from "@toss/tds-react-native/private";
|
|
873
|
+
import { View as View2 } from "react-native";
|
|
874
|
+
|
|
871
875
|
// src/core/hooks/useMoreButtonBottomSheet/useMoreButtonBottomSheetLogging.tsx
|
|
872
876
|
import { INTERNAL__module as INTERNAL__module5 } from "@apps-in-toss/native-modules";
|
|
873
877
|
import { Granite as Granite5 } from "@granite-js/react-native";
|
|
@@ -937,6 +941,82 @@ function useMoreButtonBottomSheetLogging() {
|
|
|
937
941
|
};
|
|
938
942
|
}
|
|
939
943
|
|
|
944
|
+
// src/core/hooks/useMoreButtonBottomSheet/Menu.tsx
|
|
945
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
946
|
+
function Menu({ title, iconURL, onPress }) {
|
|
947
|
+
const globals = getAppsInTossGlobals();
|
|
948
|
+
const adaptive = useAdaptive();
|
|
949
|
+
const iconName = getIconName(iconURL);
|
|
950
|
+
const logging = useMoreButtonBottomSheetLogging();
|
|
951
|
+
const brandPrimaryColorRGB = hexToRGB(globals.brandPrimaryColor);
|
|
952
|
+
const iconBackgroundColor = brandPrimaryColorRGB ? `rgba(${brandPrimaryColorRGB.join(",")},0.1)` : adaptive.grey100;
|
|
953
|
+
return /* @__PURE__ */ jsx5(
|
|
954
|
+
ListRow,
|
|
955
|
+
{
|
|
956
|
+
left: /* @__PURE__ */ jsx5(
|
|
957
|
+
View2,
|
|
958
|
+
{
|
|
959
|
+
style: {
|
|
960
|
+
width: 30,
|
|
961
|
+
height: 30,
|
|
962
|
+
borderRadius: 10,
|
|
963
|
+
flexDirection: "row",
|
|
964
|
+
alignItems: "center",
|
|
965
|
+
justifyContent: "center",
|
|
966
|
+
marginRight: 16,
|
|
967
|
+
backgroundColor: iconBackgroundColor
|
|
968
|
+
},
|
|
969
|
+
children: iconName ? /* @__PURE__ */ jsx5(
|
|
970
|
+
Asset2.Icon,
|
|
971
|
+
{
|
|
972
|
+
frameShape: { width: 20, height: 20 },
|
|
973
|
+
color: globals.brandPrimaryColor,
|
|
974
|
+
name: iconName
|
|
975
|
+
}
|
|
976
|
+
) : /* @__PURE__ */ jsx5(
|
|
977
|
+
Asset2.Image,
|
|
978
|
+
{
|
|
979
|
+
frameShape: { width: 20, height: 20 },
|
|
980
|
+
source: { uri: iconURL }
|
|
981
|
+
}
|
|
982
|
+
)
|
|
983
|
+
}
|
|
984
|
+
),
|
|
985
|
+
contents: /* @__PURE__ */ jsx5(
|
|
986
|
+
ListRow.Texts,
|
|
987
|
+
{
|
|
988
|
+
type: "1RowTypeA",
|
|
989
|
+
top: title,
|
|
990
|
+
topProps: { color: adaptive.grey700 }
|
|
991
|
+
}
|
|
992
|
+
),
|
|
993
|
+
verticalPadding: "extraSmall",
|
|
994
|
+
onPress: () => {
|
|
995
|
+
logging.menuClick({ title });
|
|
996
|
+
onPress?.();
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
);
|
|
1000
|
+
}
|
|
1001
|
+
var iconNameRegExp = /^(icon-|icn-(?!(car|sec|bank-(fill|square|horizontal))-))(.+)/i;
|
|
1002
|
+
var iconURLRegExp = /^https:\/\/static\.toss\.im\/icons\/(png\/\dx|svg|pdf)\/((icon-|icn-(?!(car|sec|bank-(fill|square|horizontal))-))(.+))\.(png|svg|pdf)$/i;
|
|
1003
|
+
function isIconUrl(url) {
|
|
1004
|
+
return iconNameRegExp.test(url) || iconURLRegExp.test(url);
|
|
1005
|
+
}
|
|
1006
|
+
function getIconName(url) {
|
|
1007
|
+
if (!isIconUrl(url)) {
|
|
1008
|
+
return null;
|
|
1009
|
+
}
|
|
1010
|
+
if (iconNameRegExp.test(url)) {
|
|
1011
|
+
return url;
|
|
1012
|
+
}
|
|
1013
|
+
return url.match(iconURLRegExp)?.[2];
|
|
1014
|
+
}
|
|
1015
|
+
function hexToRGB(hex) {
|
|
1016
|
+
const rgb = hex.toLowerCase().match(/[0-9,a-f]{2}/g)?.map((str) => parseInt(str, 16));
|
|
1017
|
+
return rgb?.length === 3 ? rgb : void 0;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
940
1020
|
// src/core/utils/url.ts
|
|
941
1021
|
function addParamsToUrl(url, params) {
|
|
942
1022
|
const urlObj = new URL(url);
|
|
@@ -947,42 +1027,24 @@ function addParamsToUrl(url, params) {
|
|
|
947
1027
|
}
|
|
948
1028
|
|
|
949
1029
|
// src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
|
|
950
|
-
import { jsx as
|
|
1030
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
951
1031
|
var SHARE_SCHEME_REFERRER = "appsintoss.common_module_share";
|
|
952
1032
|
var APP_SHARE_MENU_INFO = {
|
|
953
1033
|
contactItemName: "\uACF5\uC720\uD558\uAE30",
|
|
954
1034
|
contactIconUrl: "https://static.toss.im/icons/png/4x/icon-share-dots-mono.png"
|
|
955
1035
|
};
|
|
956
1036
|
function AppShareListMenu() {
|
|
957
|
-
const globals = getAppsInTossGlobals();
|
|
958
|
-
const adaptive = useAdaptive();
|
|
959
|
-
const logging = useMoreButtonBottomSheetLogging();
|
|
960
1037
|
const initialScheme = getSchemeUri4();
|
|
961
1038
|
const isSandbox = getOperationalEnvironment() === "sandbox";
|
|
962
1039
|
const { openConfirm } = useDialog4();
|
|
963
1040
|
const schemeForShare = addParamsToUrl(initialScheme, {
|
|
964
1041
|
referrer: SHARE_SCHEME_REFERRER
|
|
965
1042
|
});
|
|
966
|
-
return /* @__PURE__ */
|
|
967
|
-
|
|
1043
|
+
return /* @__PURE__ */ jsx6(
|
|
1044
|
+
Menu,
|
|
968
1045
|
{
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
{
|
|
972
|
-
color: globals.brandPrimaryColor,
|
|
973
|
-
source: { uri: APP_SHARE_MENU_INFO.contactIconUrl },
|
|
974
|
-
type: "background"
|
|
975
|
-
}
|
|
976
|
-
),
|
|
977
|
-
contents: /* @__PURE__ */ jsx5(
|
|
978
|
-
ListRow.Texts,
|
|
979
|
-
{
|
|
980
|
-
type: "1RowTypeA",
|
|
981
|
-
top: APP_SHARE_MENU_INFO.contactItemName,
|
|
982
|
-
topProps: { color: adaptive.grey700 }
|
|
983
|
-
}
|
|
984
|
-
),
|
|
985
|
-
verticalPadding: "extraSmall",
|
|
1046
|
+
title: APP_SHARE_MENU_INFO.contactItemName,
|
|
1047
|
+
iconURL: APP_SHARE_MENU_INFO.contactIconUrl,
|
|
986
1048
|
onPress: () => {
|
|
987
1049
|
if (isSandbox) {
|
|
988
1050
|
openConfirm({
|
|
@@ -993,7 +1055,6 @@ function AppShareListMenu() {
|
|
|
993
1055
|
});
|
|
994
1056
|
return;
|
|
995
1057
|
}
|
|
996
|
-
logging.menuClick({ title: APP_SHARE_MENU_INFO.contactItemName });
|
|
997
1058
|
NativeModules.AppsInTossModule.shareWithScheme({
|
|
998
1059
|
params: {
|
|
999
1060
|
schemeURL: schemeForShare
|
|
@@ -1004,6 +1065,25 @@ function AppShareListMenu() {
|
|
|
1004
1065
|
);
|
|
1005
1066
|
}
|
|
1006
1067
|
|
|
1068
|
+
// src/core/hooks/useMoreButtonBottomSheet/PermissionsMenu.tsx
|
|
1069
|
+
import { getOperationalEnvironment as getOperationalEnvironment2 } from "@apps-in-toss/native-modules";
|
|
1070
|
+
import { Granite as Granite6, openURL as openURL4 } from "@granite-js/react-native";
|
|
1071
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1072
|
+
function PermissionsMenu() {
|
|
1073
|
+
const globals = getAppsInTossGlobals();
|
|
1074
|
+
if (getOperationalEnvironment2() === "sandbox") {
|
|
1075
|
+
return null;
|
|
1076
|
+
}
|
|
1077
|
+
return /* @__PURE__ */ jsx7(
|
|
1078
|
+
Menu,
|
|
1079
|
+
{
|
|
1080
|
+
title: "\uAD8C\uD55C \uC124\uC815",
|
|
1081
|
+
iconURL: "https://static.toss.im/icons/png/4x/icon-setting-mono.png",
|
|
1082
|
+
onPress: () => openURL4(`servicetoss://apps-in-toss-menu/permissions?appName=${Granite6.appName}&displayAppName=${globals.brandDisplayName}`)
|
|
1083
|
+
}
|
|
1084
|
+
);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1007
1087
|
// src/core/utils/ensureValue.ts
|
|
1008
1088
|
function ensureValue(value, name) {
|
|
1009
1089
|
if (value === void 0) {
|
|
@@ -1013,7 +1093,7 @@ function ensureValue(value, name) {
|
|
|
1013
1093
|
}
|
|
1014
1094
|
|
|
1015
1095
|
// src/core/hooks/useMoreButtonBottomSheet/index.tsx
|
|
1016
|
-
import { Fragment as Fragment3, jsx as
|
|
1096
|
+
import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1017
1097
|
var APP_BRIDGE_METHOD_NAME = "getMiniAppsSupportContact";
|
|
1018
1098
|
var MIN_VERSION = {
|
|
1019
1099
|
BOTTOM_SHEET: {
|
|
@@ -1023,6 +1103,10 @@ var MIN_VERSION = {
|
|
|
1023
1103
|
SHARE_LIST_MENU: {
|
|
1024
1104
|
android: "5.230.0",
|
|
1025
1105
|
ios: "5.230.0"
|
|
1106
|
+
},
|
|
1107
|
+
PERMISSIONS_MENU: {
|
|
1108
|
+
android: "5.238.0",
|
|
1109
|
+
ios: "5.237.0"
|
|
1026
1110
|
}
|
|
1027
1111
|
};
|
|
1028
1112
|
function useMoreButtonBottomSheet() {
|
|
@@ -1035,6 +1119,7 @@ function useMoreButtonBottomSheet() {
|
|
|
1035
1119
|
const title = ensureValue(globals.brandDisplayName, "displayName");
|
|
1036
1120
|
const isBottomSheetSupported = isMinVersionSupported2(MIN_VERSION.BOTTOM_SHEET);
|
|
1037
1121
|
const isShareListMenuSupported = isMinVersionSupported2(MIN_VERSION.SHARE_LIST_MENU);
|
|
1122
|
+
const [isPermissionsMenuSupported, setIsPermissionsMenuSupported] = useState4(false);
|
|
1038
1123
|
useEffect7(() => {
|
|
1039
1124
|
if (!isBottomSheetSupported) {
|
|
1040
1125
|
return;
|
|
@@ -1047,6 +1132,16 @@ function useMoreButtonBottomSheet() {
|
|
|
1047
1132
|
onError: (error) => console.error("\uBA54\uB274 \uBAA9\uB85D\uC744 \uAC00\uC838\uC624\uB294 \uB370 \uC2E4\uD328\uD588\uC5B4\uC694:", error)
|
|
1048
1133
|
}
|
|
1049
1134
|
);
|
|
1135
|
+
if (isMinVersionSupported2(MIN_VERSION.PERMISSIONS_MENU)) {
|
|
1136
|
+
INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1137
|
+
"getAllPermission",
|
|
1138
|
+
{},
|
|
1139
|
+
{
|
|
1140
|
+
onSuccess: (permissions) => setIsPermissionsMenuSupported(permissions.length > 0),
|
|
1141
|
+
onError: (error) => console.error("\uAD8C\uD55C \uBAA9\uB85D\uC744 \uAC00\uC838\uC624\uB294 \uB370 \uC2E4\uD328\uD588\uC5B4\uC694:", error)
|
|
1142
|
+
}
|
|
1143
|
+
);
|
|
1144
|
+
}
|
|
1050
1145
|
}, [isBottomSheetSupported]);
|
|
1051
1146
|
const onClickHandler = async () => {
|
|
1052
1147
|
logging.open();
|
|
@@ -1062,17 +1157,17 @@ function useMoreButtonBottomSheet() {
|
|
|
1062
1157
|
logging.close();
|
|
1063
1158
|
close();
|
|
1064
1159
|
};
|
|
1065
|
-
return /* @__PURE__ */
|
|
1160
|
+
return /* @__PURE__ */ jsx8(BottomSheetImpressionArea, { children: /* @__PURE__ */ jsx8(
|
|
1066
1161
|
BottomSheet.Root,
|
|
1067
1162
|
{
|
|
1068
|
-
header: /* @__PURE__ */
|
|
1163
|
+
header: /* @__PURE__ */ jsx8(
|
|
1069
1164
|
ListHeader,
|
|
1070
1165
|
{
|
|
1071
|
-
title: /* @__PURE__ */
|
|
1166
|
+
title: /* @__PURE__ */ jsx8(ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
|
|
1072
1167
|
}
|
|
1073
1168
|
),
|
|
1074
1169
|
open: isOpen,
|
|
1075
|
-
cta: /* @__PURE__ */
|
|
1170
|
+
cta: /* @__PURE__ */ jsx8(
|
|
1076
1171
|
BottomSheet.CTA,
|
|
1077
1172
|
{
|
|
1078
1173
|
size: "large",
|
|
@@ -1087,36 +1182,19 @@ function useMoreButtonBottomSheet() {
|
|
|
1087
1182
|
onClose: handleClose,
|
|
1088
1183
|
onExited: exit,
|
|
1089
1184
|
children: /* @__PURE__ */ jsxs2(List, { rowSeparator: "none", children: [
|
|
1090
|
-
itemList.map(
|
|
1091
|
-
|
|
1092
|
-
|
|
1185
|
+
itemList.map(
|
|
1186
|
+
(item) => /* @__PURE__ */ jsx8(
|
|
1187
|
+
Menu,
|
|
1093
1188
|
{
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
color: globals.brandPrimaryColor,
|
|
1098
|
-
source: { uri: item.contactIconUrl },
|
|
1099
|
-
type: "background"
|
|
1100
|
-
}
|
|
1101
|
-
),
|
|
1102
|
-
contents: /* @__PURE__ */ jsx6(
|
|
1103
|
-
ListRow2.Texts,
|
|
1104
|
-
{
|
|
1105
|
-
type: "1RowTypeA",
|
|
1106
|
-
top: item.contactItemName,
|
|
1107
|
-
topProps: { color: adaptive.grey700 }
|
|
1108
|
-
}
|
|
1109
|
-
),
|
|
1110
|
-
verticalPadding: "extraSmall",
|
|
1111
|
-
onPress: () => {
|
|
1112
|
-
logging.menuClick({ title: item.contactItemName });
|
|
1113
|
-
openURL4(item.contactUri);
|
|
1114
|
-
}
|
|
1189
|
+
title: item.contactItemName,
|
|
1190
|
+
iconURL: item.contactIconUrl,
|
|
1191
|
+
onPress: () => openURL5(item.contactUri)
|
|
1115
1192
|
},
|
|
1116
1193
|
item.contactItemName
|
|
1117
|
-
)
|
|
1118
|
-
|
|
1119
|
-
isShareListMenuSupported && /* @__PURE__ */
|
|
1194
|
+
)
|
|
1195
|
+
),
|
|
1196
|
+
isShareListMenuSupported && /* @__PURE__ */ jsx8(AppShareListMenu, {}),
|
|
1197
|
+
isPermissionsMenuSupported && /* @__PURE__ */ jsx8(PermissionsMenu, {})
|
|
1120
1198
|
] })
|
|
1121
1199
|
}
|
|
1122
1200
|
) });
|
|
@@ -1129,12 +1207,12 @@ function BottomSheetImpressionArea({ children }) {
|
|
|
1129
1207
|
useEffect7(() => {
|
|
1130
1208
|
logging.show();
|
|
1131
1209
|
}, [logging]);
|
|
1132
|
-
return /* @__PURE__ */
|
|
1210
|
+
return /* @__PURE__ */ jsx8(Fragment3, { children });
|
|
1133
1211
|
}
|
|
1134
1212
|
|
|
1135
1213
|
// src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
|
|
1136
1214
|
import { useEffect as useEffect8, useRef as useRef3 } from "react";
|
|
1137
|
-
import { Fragment as Fragment4, jsx as
|
|
1215
|
+
import { Fragment as Fragment4, jsx as jsx9 } from "react/jsx-runtime";
|
|
1138
1216
|
function NavigationBarImpressionArea({
|
|
1139
1217
|
children,
|
|
1140
1218
|
withHomeButton
|
|
@@ -1147,11 +1225,11 @@ function NavigationBarImpressionArea({
|
|
|
1147
1225
|
hasLogged.current = true;
|
|
1148
1226
|
}
|
|
1149
1227
|
}, [logging, withHomeButton]);
|
|
1150
|
-
return /* @__PURE__ */
|
|
1228
|
+
return /* @__PURE__ */ jsx9(Fragment4, { children });
|
|
1151
1229
|
}
|
|
1152
1230
|
|
|
1153
1231
|
// src/components/NavigationBar/RNNavigationBar/Default.tsx
|
|
1154
|
-
import { jsx as
|
|
1232
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1155
1233
|
function DefaultNavigationBar() {
|
|
1156
1234
|
const globals = getAppsInTossGlobals();
|
|
1157
1235
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
@@ -1161,7 +1239,7 @@ function DefaultNavigationBar() {
|
|
|
1161
1239
|
const { navigationRightButton } = useNavigationBarContext();
|
|
1162
1240
|
const navigationEvent = useNavigationEvent();
|
|
1163
1241
|
useHardwareBackPress(navigationEvent.handleBack);
|
|
1164
|
-
return /* @__PURE__ */
|
|
1242
|
+
return /* @__PURE__ */ jsx10(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ jsx10(
|
|
1165
1243
|
TopNavigation,
|
|
1166
1244
|
{
|
|
1167
1245
|
title: globals.brandDisplayName,
|
|
@@ -1172,7 +1250,7 @@ function DefaultNavigationBar() {
|
|
|
1172
1250
|
onPressClose: navigationEvent.handleCloseButtonClick,
|
|
1173
1251
|
withHome: withHomeButton,
|
|
1174
1252
|
fixedRightButton: navigationRightButton,
|
|
1175
|
-
children: /* @__PURE__ */
|
|
1253
|
+
children: /* @__PURE__ */ jsx10(NavigationLeft, { visible: withBackButton, children: /* @__PURE__ */ jsx10(NavigationBackButton, { onPress: navigationEvent.handleBack, canGoBack: false }) })
|
|
1176
1254
|
}
|
|
1177
1255
|
) });
|
|
1178
1256
|
}
|
|
@@ -1181,8 +1259,8 @@ function DefaultNavigationBar() {
|
|
|
1181
1259
|
import { useSafeAreaInsets } from "@granite-js/native/react-native-safe-area-context";
|
|
1182
1260
|
import { PageNavbar } from "@toss/tds-react-native";
|
|
1183
1261
|
import { NavigationRightContent, useSafeAreaTop } from "@toss/tds-react-native/private";
|
|
1184
|
-
import { Platform as Platform2, View as
|
|
1185
|
-
import { Fragment as Fragment5, jsx as
|
|
1262
|
+
import { Platform as Platform2, View as View3 } from "react-native";
|
|
1263
|
+
import { Fragment as Fragment5, jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1186
1264
|
function GameNavigationBar() {
|
|
1187
1265
|
const safeAreaTop = useSafeAreaTop();
|
|
1188
1266
|
const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
|
|
@@ -1191,9 +1269,9 @@ function GameNavigationBar() {
|
|
|
1191
1269
|
const { right: safeAreaRight } = useSafeAreaInsets();
|
|
1192
1270
|
useHardwareBackPress(navigationEvent.handleBack);
|
|
1193
1271
|
return /* @__PURE__ */ jsxs3(Fragment5, { children: [
|
|
1194
|
-
/* @__PURE__ */
|
|
1195
|
-
/* @__PURE__ */
|
|
1196
|
-
|
|
1272
|
+
/* @__PURE__ */ jsx11(PageNavbar, { preference: { type: "none" } }),
|
|
1273
|
+
/* @__PURE__ */ jsx11(
|
|
1274
|
+
View3,
|
|
1197
1275
|
{
|
|
1198
1276
|
style: {
|
|
1199
1277
|
width: "100%",
|
|
@@ -1208,7 +1286,7 @@ function GameNavigationBar() {
|
|
|
1208
1286
|
paddingRight: safeAreaRight + 10
|
|
1209
1287
|
},
|
|
1210
1288
|
pointerEvents: "box-none",
|
|
1211
|
-
children: /* @__PURE__ */
|
|
1289
|
+
children: /* @__PURE__ */ jsx11(
|
|
1212
1290
|
NavigationRightContent,
|
|
1213
1291
|
{
|
|
1214
1292
|
fixedRightButton: navigationRightButton,
|
|
@@ -1238,15 +1316,15 @@ import * as constant_bridges_star from "@apps-in-toss/native-modules/constant-br
|
|
|
1238
1316
|
import * as event_bridges_star from "@apps-in-toss/native-modules/event-bridges";
|
|
1239
1317
|
|
|
1240
1318
|
// src/components/RNAppContainer.tsx
|
|
1241
|
-
import { Fragment as Fragment6, jsx as
|
|
1319
|
+
import { Fragment as Fragment6, jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1242
1320
|
function RNAppContainer({ children }) {
|
|
1243
1321
|
const global2 = getAppsInTossGlobals();
|
|
1244
1322
|
switch (global2.appType) {
|
|
1245
1323
|
case "game":
|
|
1246
|
-
return /* @__PURE__ */
|
|
1324
|
+
return /* @__PURE__ */ jsx12(GameAppContainer, { children });
|
|
1247
1325
|
case "general":
|
|
1248
1326
|
default:
|
|
1249
|
-
return /* @__PURE__ */
|
|
1327
|
+
return /* @__PURE__ */ jsx12(GeneralAppContainer, { children });
|
|
1250
1328
|
}
|
|
1251
1329
|
}
|
|
1252
1330
|
function GameAppContainer({ children }) {
|
|
@@ -1268,40 +1346,40 @@ function GameAppContainer({ children }) {
|
|
|
1268
1346
|
});
|
|
1269
1347
|
}, []);
|
|
1270
1348
|
return /* @__PURE__ */ jsxs4(Fragment6, { children: [
|
|
1271
|
-
/* @__PURE__ */
|
|
1272
|
-
(0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */
|
|
1349
|
+
/* @__PURE__ */ jsx12(RNNavigationBar.Game, {}),
|
|
1350
|
+
(0, bridge_entry_exports.getOperationalEnvironment)() === "toss" ? /* @__PURE__ */ jsx12(GameInitializer, { isReadyForProfileUI: isEntryMessageExited, children }) : children
|
|
1273
1351
|
] });
|
|
1274
1352
|
}
|
|
1275
1353
|
function GeneralAppContainer({ children }) {
|
|
1276
1354
|
return /* @__PURE__ */ jsxs4(Fragment6, { children: [
|
|
1277
|
-
/* @__PURE__ */
|
|
1355
|
+
/* @__PURE__ */ jsx12(RNNavigationBar.Default, {}),
|
|
1278
1356
|
children
|
|
1279
1357
|
] });
|
|
1280
1358
|
}
|
|
1281
1359
|
|
|
1282
1360
|
// src/core/registerApp.tsx
|
|
1283
|
-
import { Fragment as Fragment7, jsx as
|
|
1361
|
+
import { Fragment as Fragment7, jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1284
1362
|
function AppsInTossContainer(Container, { children, ...initialProps }) {
|
|
1285
1363
|
if (!isMinVersionSupported3({
|
|
1286
1364
|
android: "5.220.0",
|
|
1287
1365
|
ios: "5.221.0"
|
|
1288
1366
|
})) {
|
|
1289
1367
|
return /* @__PURE__ */ jsxs5(Fragment7, { children: [
|
|
1290
|
-
/* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */
|
|
1292
|
-
/* @__PURE__ */
|
|
1368
|
+
/* @__PURE__ */ jsx13(AppEvent.Entry, {}),
|
|
1369
|
+
/* @__PURE__ */ jsx13(AppEvent.System, { ...initialProps }),
|
|
1370
|
+
/* @__PURE__ */ jsx13(AppUpdate, {})
|
|
1293
1371
|
] });
|
|
1294
1372
|
}
|
|
1295
1373
|
return /* @__PURE__ */ jsxs5(Fragment7, { children: [
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1374
|
+
/* @__PURE__ */ jsx13(AppEvent.StayTime, {}),
|
|
1375
|
+
/* @__PURE__ */ jsx13(AppEvent.Entry, {}),
|
|
1376
|
+
/* @__PURE__ */ jsx13(AppEvent.System, { ...initialProps }),
|
|
1377
|
+
/* @__PURE__ */ jsx13(Container, { ...initialProps, children: /* @__PURE__ */ jsx13(TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children: /* @__PURE__ */ jsx13(TDSContainer, { ...initialProps, children }) }) })
|
|
1300
1378
|
] });
|
|
1301
1379
|
}
|
|
1302
1380
|
function TDSContainer({ children }) {
|
|
1303
1381
|
useAppsInTossBridge();
|
|
1304
|
-
return /* @__PURE__ */
|
|
1382
|
+
return /* @__PURE__ */ jsx13(Fragment7, { children });
|
|
1305
1383
|
}
|
|
1306
1384
|
function registerApp(container, { context, analytics }) {
|
|
1307
1385
|
const appName = getAppName();
|
|
@@ -1311,7 +1389,7 @@ function registerApp(container, { context, analytics }) {
|
|
|
1311
1389
|
logger: (params) => void eventLog(params),
|
|
1312
1390
|
debug: analytics?.debug ?? __DEV__
|
|
1313
1391
|
});
|
|
1314
|
-
const App =
|
|
1392
|
+
const App = Granite7.registerApp(AppsInTossContainer.bind(null, container), {
|
|
1315
1393
|
appName,
|
|
1316
1394
|
context,
|
|
1317
1395
|
setIosSwipeGestureEnabled: setIosSwipeGestureEnabled2,
|
|
@@ -1328,7 +1406,7 @@ function registerApp(container, { context, analytics }) {
|
|
|
1328
1406
|
}
|
|
1329
1407
|
function AppsInTossScreenContainer({ children }) {
|
|
1330
1408
|
const isRNApp = getAppsInTossGlobals().webViewType == null;
|
|
1331
|
-
return /* @__PURE__ */
|
|
1409
|
+
return /* @__PURE__ */ jsx13(NavigationBarContextProvider, { children: /* @__PURE__ */ jsx13(Analytics.Screen, { children: isRNApp ? /* @__PURE__ */ jsx13(RNAppContainer, { children }) : children }) });
|
|
1332
1410
|
}
|
|
1333
1411
|
function getAppName() {
|
|
1334
1412
|
try {
|
|
@@ -1366,7 +1444,7 @@ import { useEffect as useEffect14, useMemo as useMemo7, useRef as useRef6, useSt
|
|
|
1366
1444
|
import { BackHandler as BackHandler2, Platform as Platform6 } from "react-native";
|
|
1367
1445
|
|
|
1368
1446
|
// src/components/GameWebView.tsx
|
|
1369
|
-
import { setIosSwipeGestureEnabled as setIosSwipeGestureEnabled3, appsInTossEvent as appsInTossEvent3, getOperationalEnvironment as
|
|
1447
|
+
import { setIosSwipeGestureEnabled as setIosSwipeGestureEnabled3, appsInTossEvent as appsInTossEvent3, getOperationalEnvironment as getOperationalEnvironment4 } from "@apps-in-toss/native-modules";
|
|
1370
1448
|
import {
|
|
1371
1449
|
WebView as PlainWebView
|
|
1372
1450
|
} from "@granite-js/native/react-native-webview";
|
|
@@ -1380,8 +1458,8 @@ import { PageNavbar as PageNavbar2, useDialog as useDialog5 } from "@toss/tds-re
|
|
|
1380
1458
|
import { NavigationRightContent as NavigationRightContent2, useSafeAreaTop as useSafeAreaTop2 } from "@toss/tds-react-native/private";
|
|
1381
1459
|
import { josa as josa3 } from "es-hangul";
|
|
1382
1460
|
import { useCallback as useCallback8 } from "react";
|
|
1383
|
-
import { Platform as Platform4, View as
|
|
1384
|
-
import { Fragment as Fragment8, jsx as
|
|
1461
|
+
import { Platform as Platform4, View as View4 } from "react-native";
|
|
1462
|
+
import { Fragment as Fragment8, jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1385
1463
|
function GameWebviewNavigationBar() {
|
|
1386
1464
|
const safeAreaTop = useSafeAreaTop2();
|
|
1387
1465
|
const { openConfirm } = useDialog5();
|
|
@@ -1407,9 +1485,9 @@ function GameWebviewNavigationBar() {
|
|
|
1407
1485
|
}
|
|
1408
1486
|
}, [captureExitLog, global2.brandDisplayName, logging, openConfirm]);
|
|
1409
1487
|
return /* @__PURE__ */ jsxs6(Fragment8, { children: [
|
|
1410
|
-
/* @__PURE__ */
|
|
1411
|
-
/* @__PURE__ */
|
|
1412
|
-
|
|
1488
|
+
/* @__PURE__ */ jsx14(PageNavbar2, { preference: { type: "none" } }),
|
|
1489
|
+
/* @__PURE__ */ jsx14(
|
|
1490
|
+
View4,
|
|
1413
1491
|
{
|
|
1414
1492
|
style: {
|
|
1415
1493
|
width: "100%",
|
|
@@ -1424,7 +1502,7 @@ function GameWebviewNavigationBar() {
|
|
|
1424
1502
|
paddingRight: safeAreaRight + 10
|
|
1425
1503
|
},
|
|
1426
1504
|
pointerEvents: "box-none",
|
|
1427
|
-
children: /* @__PURE__ */
|
|
1505
|
+
children: /* @__PURE__ */ jsx14(
|
|
1428
1506
|
NavigationRightContent2,
|
|
1429
1507
|
{
|
|
1430
1508
|
fixedRightButton: navigationRightButton,
|
|
@@ -1441,7 +1519,7 @@ function GameWebviewNavigationBar() {
|
|
|
1441
1519
|
}
|
|
1442
1520
|
|
|
1443
1521
|
// src/components/GameWebView.tsx
|
|
1444
|
-
import { Fragment as Fragment9, jsx as
|
|
1522
|
+
import { Fragment as Fragment9, jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1445
1523
|
var GameWebView = forwardRef(function GameWebView2(props, ref) {
|
|
1446
1524
|
const [isEntryMessageExited, setIsEntryMessageExited] = useState6(false);
|
|
1447
1525
|
useEffect10(() => {
|
|
@@ -1461,8 +1539,8 @@ var GameWebView = forwardRef(function GameWebView2(props, ref) {
|
|
|
1461
1539
|
});
|
|
1462
1540
|
}, []);
|
|
1463
1541
|
return /* @__PURE__ */ jsxs7(Fragment9, { children: [
|
|
1464
|
-
/* @__PURE__ */
|
|
1465
|
-
|
|
1542
|
+
/* @__PURE__ */ jsx15(GameWebviewNavigationBar, {}),
|
|
1543
|
+
getOperationalEnvironment4() === "toss" ? /* @__PURE__ */ jsx15(GameInitializer, { isReadyForProfileUI: isEntryMessageExited, children: /* @__PURE__ */ jsx15(PlainWebView, { ref, ...props }) }) : /* @__PURE__ */ jsx15(PlainWebView, { ref, ...props })
|
|
1466
1544
|
] });
|
|
1467
1545
|
});
|
|
1468
1546
|
|
|
@@ -1478,7 +1556,7 @@ import { useDialog as useDialog6 } from "@toss/tds-react-native";
|
|
|
1478
1556
|
import { NavigationBackButton as NavigationBackButton2, NavigationLeft as NavigationLeft2, TopNavigation as TopNavigation2 } from "@toss/tds-react-native/private";
|
|
1479
1557
|
import { josa as josa4 } from "es-hangul";
|
|
1480
1558
|
import { useCallback as useCallback9 } from "react";
|
|
1481
|
-
import { jsx as
|
|
1559
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1482
1560
|
function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
1483
1561
|
const globals = getAppsInTossGlobals();
|
|
1484
1562
|
const { captureExitLog } = useCaptureExitLog();
|
|
@@ -1504,7 +1582,7 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1504
1582
|
closeView5();
|
|
1505
1583
|
}
|
|
1506
1584
|
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
1507
|
-
return /* @__PURE__ */
|
|
1585
|
+
return /* @__PURE__ */ jsx16(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ jsx16(
|
|
1508
1586
|
TopNavigation2,
|
|
1509
1587
|
{
|
|
1510
1588
|
title: globals.brandDisplayName,
|
|
@@ -1515,17 +1593,17 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
|
|
|
1515
1593
|
onPressClose: handleClose,
|
|
1516
1594
|
withHome: withHomeButton,
|
|
1517
1595
|
fixedRightButton: navigationRightButton,
|
|
1518
|
-
children: /* @__PURE__ */
|
|
1596
|
+
children: /* @__PURE__ */ jsx16(NavigationLeft2, { visible: withBackButton, children: /* @__PURE__ */ jsx16(NavigationBackButton2, { onPress: onBackButtonClick, canGoBack: false }) })
|
|
1519
1597
|
}
|
|
1520
1598
|
) });
|
|
1521
1599
|
}
|
|
1522
1600
|
|
|
1523
1601
|
// src/components/PartnerWebView.tsx
|
|
1524
|
-
import { Fragment as Fragment10, jsx as
|
|
1602
|
+
import { Fragment as Fragment10, jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1525
1603
|
var PartnerWebView = forwardRef2(function PartnerWebViewScreen({ onBackButtonClick, onHomeButtonClick, ...webViewProps }, ref) {
|
|
1526
1604
|
return /* @__PURE__ */ jsxs8(Fragment10, { children: [
|
|
1527
|
-
/* @__PURE__ */
|
|
1528
|
-
/* @__PURE__ */
|
|
1605
|
+
/* @__PURE__ */ jsx17(PartnerWebviewNavigationBar, { onBackButtonClick, onHomeButtonClick }),
|
|
1606
|
+
/* @__PURE__ */ jsx17(PlainWebView2, { ref, ...webViewProps, style: { flex: 1 } })
|
|
1529
1607
|
] });
|
|
1530
1608
|
});
|
|
1531
1609
|
|
|
@@ -2121,7 +2199,7 @@ var trackScreen = (url) => {
|
|
|
2121
2199
|
};
|
|
2122
2200
|
|
|
2123
2201
|
// src/components/WebView.tsx
|
|
2124
|
-
import { jsx as
|
|
2202
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2125
2203
|
var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment();
|
|
2126
2204
|
var TYPES = ["partner", "external", "game"];
|
|
2127
2205
|
var WEBVIEW_TYPES = {
|
|
@@ -2281,7 +2359,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2281
2359
|
return () => BackHandler2.removeEventListener("hardwareBackPress", callback);
|
|
2282
2360
|
}, [webBackHandler]);
|
|
2283
2361
|
const globalScripts = useGlobalScripts();
|
|
2284
|
-
return /* @__PURE__ */
|
|
2362
|
+
return /* @__PURE__ */ jsx18(
|
|
2285
2363
|
BaseWebView,
|
|
2286
2364
|
{
|
|
2287
2365
|
ref: refs,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apps-in-toss/framework",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"description": "The framework for Apps In Toss",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepack": "yarn build",
|
|
@@ -56,20 +56,20 @@
|
|
|
56
56
|
"ait": "./bin/ait.js"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@apps-in-toss/analytics": "1.
|
|
60
|
-
"@apps-in-toss/cli": "1.
|
|
61
|
-
"@apps-in-toss/native-modules": "1.
|
|
62
|
-
"@apps-in-toss/plugins": "1.
|
|
63
|
-
"@apps-in-toss/types": "1.
|
|
59
|
+
"@apps-in-toss/analytics": "1.5.0",
|
|
60
|
+
"@apps-in-toss/cli": "1.5.0",
|
|
61
|
+
"@apps-in-toss/native-modules": "1.5.0",
|
|
62
|
+
"@apps-in-toss/plugins": "1.5.0",
|
|
63
|
+
"@apps-in-toss/types": "1.5.0",
|
|
64
64
|
"es-hangul": "^2.3.2"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@babel/runtime": "^7",
|
|
68
|
-
"@granite-js/mpack": "0.1.
|
|
69
|
-
"@granite-js/native": "0.1.
|
|
70
|
-
"@granite-js/plugin-core": "0.1.
|
|
71
|
-
"@granite-js/react-native": "0.1.
|
|
72
|
-
"@granite-js/utils": "0.1.
|
|
68
|
+
"@granite-js/mpack": "0.1.31",
|
|
69
|
+
"@granite-js/native": "0.1.31",
|
|
70
|
+
"@granite-js/plugin-core": "0.1.31",
|
|
71
|
+
"@granite-js/react-native": "0.1.31",
|
|
72
|
+
"@granite-js/utils": "0.1.31",
|
|
73
73
|
"@toss/tds-react-native": "^1.3.4",
|
|
74
74
|
"@types/kill-port": "^2.0.3",
|
|
75
75
|
"@types/react": "18.3.3",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"publishConfig": {
|
|
97
97
|
"access": "public"
|
|
98
98
|
},
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "80e646a4924c5d91fce00b30ec1a43075853cadc"
|
|
100
100
|
}
|