@apps-in-toss/framework 2.5.2 → 2.6.1

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.
Files changed (3) hide show
  1. package/dist/index.cjs +111 -208
  2. package/dist/index.js +33 -130
  3. package/package.json +7 -7
package/dist/index.cjs CHANGED
@@ -56,7 +56,7 @@ var import_analytics2 = require("@apps-in-toss/analytics");
56
56
  var import_analytics = require("@apps-in-toss/analytics");
57
57
  var import_native_modules10 = require("@apps-in-toss/native-modules");
58
58
  var import_react_native21 = require("@granite-js/react-native");
59
- var import_tds_react_native10 = require("@toss/tds-react-native");
59
+ var import_tds_react_native9 = require("@toss/tds-react-native");
60
60
  var import_react_native22 = require("react-native");
61
61
 
62
62
  // src/core/components/AppEvent.tsx
@@ -185,7 +185,7 @@ function useNavigationBarContext() {
185
185
 
186
186
  // src/components/RNAppContainer.tsx
187
187
  var import_native_modules9 = require("@apps-in-toss/native-modules");
188
- var import_react16 = require("react");
188
+ var import_react15 = require("react");
189
189
  var import_react_native20 = require("react-native");
190
190
 
191
191
  // src/components/GameInitializer.tsx
@@ -660,28 +660,7 @@ function useHardwareBackPress(handler) {
660
660
 
661
661
  // src/components/NavigationBar/RNNavigationBar/hooks/useNavigationEvent.ts
662
662
  var import_react_native13 = require("@granite-js/react-native");
663
- var import_react13 = require("react");
664
-
665
- // src/components/NavigationBar/RNNavigationBar/hooks/useCloseConfirm.ts
666
- var import_tds_react_native5 = require("@toss/tds-react-native");
667
- var import_es_hangul2 = require("es-hangul");
668
663
  var import_react12 = require("react");
669
- function useCloseConfirm() {
670
- const { brandDisplayName } = getAppsInTossGlobals();
671
- const { openConfirm } = (0, import_tds_react_native5.useDialog)();
672
- return (0, import_react12.useCallback)(
673
- async ({ onEntered }) => {
674
- return await openConfirm({
675
- title: `${(0, import_es_hangul2.josa)(brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
676
- leftButton: "\uB2EB\uAE30",
677
- rightButton: "\uC885\uB8CC\uD558\uAE30",
678
- closeOnDimmerClick: true,
679
- onEntered
680
- });
681
- },
682
- [brandDisplayName, openConfirm]
683
- );
684
- }
685
664
 
686
665
  // src/utils/eventEmitter.ts
687
666
  var EventEmitter = class {
@@ -727,12 +706,8 @@ var safeAreaInsetsChange = createEvent("safeAreaInsetsChange");
727
706
  var import_react_native12 = require("@granite-js/react-native");
728
707
  var NAVI_BAR_IMPRESSION_SCHEMA_ID = 1596837;
729
708
  var NAVI_BAR_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__navigation_bar";
730
- var CLOSE_POPUP_SHOW_SCHEMA_ID = 1644490;
731
- var CLOSE_POPUP_SHOW_LOG_NAME = "appsintoss_app_visit__common_module::popup__close_app";
732
709
  var CLOSE_BUTTON_CLICK_SCHEMA_ID = 1596831;
733
710
  var CLOSE_BUTTON_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::click__icon_close";
734
- var CLOSE_POPUP_CTA_CLICK_SCHEMA_ID = 1644492;
735
- var CLOSE_POPUP_CTA_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::popup__close_app::click__cta";
736
711
  var HOME_BUTTON_CLICK_SCHEMA_ID = 1596839;
737
712
  var HOME_BUTTON_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::click__icon_home";
738
713
  function useNavigationBarLogging() {
@@ -775,32 +750,8 @@ function useNavigationBarLogging() {
775
750
  }
776
751
  });
777
752
  };
778
- const logClosePopupShow = () => {
779
- sendLog({
780
- log_name: CLOSE_POPUP_SHOW_LOG_NAME,
781
- log_type: "popup",
782
- params: {
783
- ...baseParams,
784
- schema_id: CLOSE_POPUP_SHOW_SCHEMA_ID
785
- }
786
- });
787
- };
788
- const logClosePopupCtaClick = (confirm) => {
789
- sendLog({
790
- log_name: CLOSE_POPUP_CTA_CLICK_LOG_NAME,
791
- log_type: "event",
792
- params: {
793
- ...baseParams,
794
- close_yn: confirm ? "Y" : "N",
795
- schema_id: CLOSE_POPUP_CTA_CLICK_SCHEMA_ID,
796
- event_type: "click"
797
- }
798
- });
799
- };
800
753
  return {
801
754
  navBarImpression: logNavBarImpression,
802
- closePopupShow: logClosePopupShow,
803
- closePopupCtaClick: logClosePopupCtaClick,
804
755
  closeButtonClick: logCloseButtonClick,
805
756
  homeButtonClick: logHomeButtonClick
806
757
  };
@@ -811,25 +762,15 @@ function useNavigationEvent() {
811
762
  const backEventContext = (0, import_react_native13.useBackEventContext)();
812
763
  const logging = useNavigationBarLogging();
813
764
  const navigation = (0, import_react_native13.useNavigation)();
814
- const closeConfirm = useCloseConfirm();
815
- return (0, import_react13.useMemo)(() => {
816
- const close = async () => {
817
- const hasConfirmed = await closeConfirm({
818
- onEntered: logging.closePopupShow
819
- });
820
- logging.closePopupCtaClick(hasConfirmed);
821
- if (hasConfirmed) {
822
- (0, import_react_native13.closeView)();
823
- }
824
- };
825
- return {
765
+ return (0, import_react12.useMemo)(
766
+ () => ({
826
767
  handleBack: () => {
827
768
  if (backEventContext.hasBackEvent) {
828
769
  backEventContext.onBack();
829
770
  } else if (navigation.canGoBack()) {
830
771
  navigation.goBack();
831
772
  } else {
832
- close();
773
+ (0, import_react_native13.closeView)();
833
774
  }
834
775
  },
835
776
  handleHomeButtonClick: () => {
@@ -842,26 +783,27 @@ function useNavigationEvent() {
842
783
  },
843
784
  handleCloseButtonClick: () => {
844
785
  logging.closeButtonClick();
845
- close();
786
+ (0, import_react_native13.closeView)();
846
787
  }
847
- };
848
- }, [backEventContext, navigation, closeConfirm, logging]);
788
+ }),
789
+ [backEventContext, navigation, logging]
790
+ );
849
791
  }
850
792
 
851
793
  // src/core/hooks/useMoreButtonBottomSheet/index.tsx
852
794
  var import_native_modules8 = require("@apps-in-toss/native-modules");
853
795
  var import_react_native18 = require("@granite-js/react-native");
854
- var import_tds_react_native8 = require("@toss/tds-react-native");
796
+ var import_tds_react_native7 = require("@toss/tds-react-native");
855
797
  var import_private4 = require("@toss/tds-react-native/private");
856
- var import_react14 = require("react");
798
+ var import_react13 = require("react");
857
799
 
858
800
  // src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
859
801
  var import_native_modules5 = require("@apps-in-toss/native-modules");
860
802
  var import_react_native16 = require("@granite-js/react-native");
861
- var import_tds_react_native7 = require("@toss/tds-react-native");
803
+ var import_tds_react_native6 = require("@toss/tds-react-native");
862
804
 
863
805
  // src/core/hooks/useMoreButtonBottomSheet/Menu.tsx
864
- var import_tds_react_native6 = require("@toss/tds-react-native");
806
+ var import_tds_react_native5 = require("@toss/tds-react-native");
865
807
  var import_private3 = require("@toss/tds-react-native/private");
866
808
  var import_react_native15 = require("react-native");
867
809
 
@@ -943,7 +885,7 @@ function Menu({ title, iconURL, onPress }) {
943
885
  const brandPrimaryColorRGB = hexToRGB(globals.brandPrimaryColor);
944
886
  const iconBackgroundColor = brandPrimaryColorRGB ? `rgba(${brandPrimaryColorRGB.join(",")},0.1)` : adaptive.grey100;
945
887
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
946
- import_tds_react_native6.ListRow,
888
+ import_tds_react_native5.ListRow,
947
889
  {
948
890
  left: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
949
891
  import_react_native15.View,
@@ -958,10 +900,10 @@ function Menu({ title, iconURL, onPress }) {
958
900
  marginRight: 16,
959
901
  backgroundColor: iconBackgroundColor
960
902
  },
961
- children: iconName ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_tds_react_native6.Asset.Icon, { frameShape: { width: 20, height: 20 }, color: globals.brandPrimaryColor, name: iconName }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_tds_react_native6.Asset.Image, { frameShape: { width: 20, height: 20 }, source: { uri: iconURL } })
903
+ children: iconName ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_tds_react_native5.Asset.Icon, { frameShape: { width: 20, height: 20 }, color: globals.brandPrimaryColor, name: iconName }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_tds_react_native5.Asset.Image, { frameShape: { width: 20, height: 20 }, source: { uri: iconURL } })
962
904
  }
963
905
  ),
964
- contents: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_tds_react_native6.ListRow.Texts, { type: "1RowTypeA", top: title, topProps: { color: adaptive.grey700 } }),
906
+ contents: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_tds_react_native5.ListRow.Texts, { type: "1RowTypeA", top: title, topProps: { color: adaptive.grey700 } }),
965
907
  verticalPadding: "extraSmall",
966
908
  onPress: () => {
967
909
  logging.menuClick({ title });
@@ -1008,7 +950,7 @@ var APP_SHARE_MENU_INFO = {
1008
950
  function AppShareListMenu() {
1009
951
  const initialScheme = (0, import_react_native16.getSchemeUri)();
1010
952
  const isSandbox = (0, import_native_modules5.getOperationalEnvironment)() === "sandbox";
1011
- const { openConfirm } = (0, import_tds_react_native7.useDialog)();
953
+ const { openConfirm } = (0, import_tds_react_native6.useDialog)();
1012
954
  const schemeForShare = addParamsToUrl(initialScheme, {
1013
955
  referrer: SHARE_SCHEME_REFERRER
1014
956
  });
@@ -1118,7 +1060,7 @@ var MIN_VERSION = {
1118
1060
  function useMoreButtonBottomSheet() {
1119
1061
  const globals = getAppsInTossGlobals();
1120
1062
  const adaptive = (0, import_private4.useAdaptive)();
1121
- const [itemList, setItemList] = (0, import_react14.useState)([]);
1063
+ const [itemList, setItemList] = (0, import_react13.useState)([]);
1122
1064
  const appUpdateDialog = useAppUpdateDialog();
1123
1065
  const logging = useMoreButtonBottomSheetLogging();
1124
1066
  const overlay = (0, import_private4.useOverlay)();
@@ -1127,7 +1069,7 @@ function useMoreButtonBottomSheet() {
1127
1069
  const isBottomSheetSupported = (0, import_native_modules8.isMinVersionSupported)(MIN_VERSION.BOTTOM_SHEET);
1128
1070
  const isShareListMenuSupported = (0, import_native_modules8.isMinVersionSupported)(MIN_VERSION.SHARE_LIST_MENU);
1129
1071
  const isSettingsMenuSupported = (0, import_native_modules8.isMinVersionSupported)(MIN_VERSION.SETTINGS_MENU);
1130
- (0, import_react14.useEffect)(() => {
1072
+ (0, import_react13.useEffect)(() => {
1131
1073
  if (!isBottomSheetSupported) {
1132
1074
  return;
1133
1075
  }
@@ -1155,17 +1097,17 @@ function useMoreButtonBottomSheet() {
1155
1097
  close();
1156
1098
  };
1157
1099
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BottomSheetImpressionArea, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1158
- import_tds_react_native8.BottomSheet.Root,
1100
+ import_tds_react_native7.BottomSheet.Root,
1159
1101
  {
1160
1102
  header: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1161
- import_tds_react_native8.ListHeader,
1103
+ import_tds_react_native7.ListHeader,
1162
1104
  {
1163
- title: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_tds_react_native8.ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
1105
+ title: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_tds_react_native7.ListHeader.TitleParagraph, { color: adaptive.grey800, fontWeight: "bold", typography: "t5", children: title })
1164
1106
  }
1165
1107
  ),
1166
1108
  open: isOpen,
1167
1109
  cta: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1168
- import_tds_react_native8.BottomSheet.CTA,
1110
+ import_tds_react_native7.BottomSheet.CTA,
1169
1111
  {
1170
1112
  size: "large",
1171
1113
  type: "dark",
@@ -1178,7 +1120,7 @@ function useMoreButtonBottomSheet() {
1178
1120
  ),
1179
1121
  onClose: handleClose,
1180
1122
  onExited: exit,
1181
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_tds_react_native8.List, { rowSeparator: "none", children: [
1123
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_tds_react_native7.List, { rowSeparator: "none", children: [
1182
1124
  itemList.map((item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1183
1125
  Menu,
1184
1126
  {
@@ -1200,7 +1142,7 @@ function useMoreButtonBottomSheet() {
1200
1142
  }
1201
1143
  function BottomSheetImpressionArea({ children }) {
1202
1144
  const logging = useMoreButtonBottomSheetLogging();
1203
- (0, import_react14.useEffect)(() => {
1145
+ (0, import_react13.useEffect)(() => {
1204
1146
  logging.show();
1205
1147
  }, [logging]);
1206
1148
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, { children });
@@ -1212,15 +1154,15 @@ function toIcon(source) {
1212
1154
  }
1213
1155
 
1214
1156
  // src/components/NavigationBar/common/NavigationBarImpressionArea.tsx
1215
- var import_react15 = require("react");
1157
+ var import_react14 = require("react");
1216
1158
  var import_jsx_runtime10 = require("react/jsx-runtime");
1217
1159
  function NavigationBarImpressionArea({
1218
1160
  children,
1219
1161
  withHomeButton
1220
1162
  }) {
1221
- const hasLogged = (0, import_react15.useRef)(false);
1163
+ const hasLogged = (0, import_react14.useRef)(false);
1222
1164
  const logging = useNavigationBarLogging();
1223
- (0, import_react15.useEffect)(() => {
1165
+ (0, import_react14.useEffect)(() => {
1224
1166
  if (hasLogged.current === false) {
1225
1167
  logging.navBarImpression({ home_icon_yn: withHomeButton ? "Y" : "N" });
1226
1168
  hasLogged.current = true;
@@ -1259,7 +1201,7 @@ function DefaultNavigationBar() {
1259
1201
 
1260
1202
  // src/components/NavigationBar/RNNavigationBar/Game.tsx
1261
1203
  var import_react_native_safe_area_context = require("@granite-js/native/react-native-safe-area-context");
1262
- var import_tds_react_native9 = require("@toss/tds-react-native");
1204
+ var import_tds_react_native8 = require("@toss/tds-react-native");
1263
1205
  var import_private6 = require("@toss/tds-react-native/private");
1264
1206
  var import_react_native19 = require("react-native");
1265
1207
  var import_jsx_runtime12 = require("react/jsx-runtime");
@@ -1271,7 +1213,7 @@ function GameNavigationBar() {
1271
1213
  const { right: safeAreaRight } = (0, import_react_native_safe_area_context.useSafeAreaInsets)();
1272
1214
  useHardwareBackPress(navigationEvent.handleBack);
1273
1215
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
1274
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_tds_react_native9.PageNavbar, { preference: { type: "none" } }),
1216
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_tds_react_native8.PageNavbar, { preference: { type: "none" } }),
1275
1217
  /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1276
1218
  import_react_native19.View,
1277
1219
  {
@@ -1327,7 +1269,7 @@ function RNAppContainer({ children }) {
1327
1269
  }
1328
1270
  }
1329
1271
  function GameAppContainer({ children }) {
1330
- (0, import_react16.useEffect)(() => {
1272
+ (0, import_react15.useEffect)(() => {
1331
1273
  if (import_react_native20.Platform.OS === "ios") {
1332
1274
  (0, import_native_modules9.setIosSwipeGestureEnabled)({ isEnabled: false });
1333
1275
  return () => {
@@ -1362,7 +1304,7 @@ function AppsInTossContainer(Container, { children, ...initialProps }) {
1362
1304
  }
1363
1305
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
1364
1306
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AppEvent.System, { ...initialProps }),
1365
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_tds_react_native10.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children }) })
1307
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Container, { ...initialProps, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_tds_react_native9.TDSProvider, { colorPreference: "light", token: { color: { primary: getAppsInTossGlobals().brandPrimaryColor } }, children }) })
1366
1308
  ] });
1367
1309
  }
1368
1310
  function registerApp(container, { context, analytics }) {
@@ -1433,50 +1375,38 @@ var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event
1433
1375
  var import_user_scripts = require("@apps-in-toss/user-scripts");
1434
1376
  var import_react_native_safe_area_context4 = require("@granite-js/native/react-native-safe-area-context");
1435
1377
  var import_react_native36 = require("@granite-js/react-native");
1436
- var import_tds_react_native15 = require("@toss/tds-react-native");
1378
+ var import_tds_react_native12 = require("@toss/tds-react-native");
1437
1379
  var import_private9 = require("@toss/tds-react-native/private");
1438
- var import_react27 = require("react");
1380
+ var import_react26 = require("react");
1439
1381
  var import_react_native37 = require("react-native");
1440
1382
 
1441
1383
  // src/components/GameWebView.tsx
1442
1384
  var import_native_modules11 = require("@apps-in-toss/native-modules");
1443
1385
  var import_react_native_webview = require("@granite-js/native/react-native-webview");
1444
- var import_react18 = require("react");
1386
+ var import_react17 = require("react");
1445
1387
  var import_react_native25 = require("react-native");
1446
1388
 
1447
1389
  // src/components/NavigationBar/GameWebviewNavigationBar.tsx
1448
1390
  var import_react_native_safe_area_context2 = require("@granite-js/native/react-native-safe-area-context");
1449
1391
  var import_react_native23 = require("@granite-js/react-native");
1450
- var import_tds_react_native11 = require("@toss/tds-react-native");
1392
+ var import_tds_react_native10 = require("@toss/tds-react-native");
1451
1393
  var import_private7 = require("@toss/tds-react-native/private");
1452
- var import_es_hangul3 = require("es-hangul");
1453
- var import_react17 = require("react");
1394
+ var import_react16 = require("react");
1454
1395
  var import_react_native24 = require("react-native");
1455
1396
  var import_jsx_runtime15 = require("react/jsx-runtime");
1456
1397
  function GameWebviewNavigationBar() {
1457
1398
  const safeAreaTop = (0, import_private7.useSafeAreaTop)();
1458
- const { openConfirm } = (0, import_tds_react_native11.useDialog)();
1459
- const global2 = getAppsInTossGlobals();
1399
+ const { openConfirm } = (0, import_tds_react_native10.useDialog)();
1460
1400
  const logging = useNavigationBarLogging();
1461
1401
  const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
1462
1402
  const { navigationRightButton } = useNavigationBarContext();
1463
1403
  const { right: safeAreaRight } = (0, import_react_native_safe_area_context2.useSafeAreaInsets)();
1464
- const handleGameWebviewClose = (0, import_react17.useCallback)(async () => {
1404
+ const handleGameWebviewClose = (0, import_react16.useCallback)(async () => {
1465
1405
  logging.closeButtonClick();
1466
- const isConfirmed = await openConfirm({
1467
- title: `${(0, import_es_hangul3.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
1468
- leftButton: "\uB2EB\uAE30",
1469
- rightButton: "\uC885\uB8CC\uD558\uAE30",
1470
- closeOnDimmerClick: true,
1471
- onEntered: logging.closePopupShow
1472
- });
1473
- logging.closePopupCtaClick(isConfirmed);
1474
- if (isConfirmed) {
1475
- (0, import_react_native23.closeView)();
1476
- }
1477
- }, [global2.brandDisplayName, logging, openConfirm]);
1406
+ (0, import_react_native23.closeView)();
1407
+ }, [logging, openConfirm]);
1478
1408
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
1479
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_tds_react_native11.PageNavbar, { preference: { type: "none" } }),
1409
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_tds_react_native10.PageNavbar, { preference: { type: "none" } }),
1480
1410
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1481
1411
  import_react_native24.View,
1482
1412
  {
@@ -1511,8 +1441,8 @@ function GameWebviewNavigationBar() {
1511
1441
 
1512
1442
  // src/components/GameWebView.tsx
1513
1443
  var import_jsx_runtime16 = require("react/jsx-runtime");
1514
- var GameWebView = (0, import_react18.forwardRef)(function GameWebView2(props, ref) {
1515
- (0, import_react18.useEffect)(() => {
1444
+ var GameWebView = (0, import_react17.forwardRef)(function GameWebView2(props, ref) {
1445
+ (0, import_react17.useEffect)(() => {
1516
1446
  if (import_react_native25.Platform.OS === "ios") {
1517
1447
  (0, import_native_modules11.setIosSwipeGestureEnabled)({ isEnabled: false });
1518
1448
  return () => {
@@ -1529,38 +1459,25 @@ var GameWebView = (0, import_react18.forwardRef)(function GameWebView2(props, re
1529
1459
 
1530
1460
  // src/components/PartnerWebView.tsx
1531
1461
  var import_react_native_webview2 = require("@granite-js/native/react-native-webview");
1532
- var import_react20 = require("react");
1462
+ var import_react19 = require("react");
1533
1463
 
1534
1464
  // src/components/NavigationBar/PartnerWebviewNavigationBar.tsx
1535
1465
  var import_react_native26 = require("@granite-js/react-native");
1536
- var import_tds_react_native12 = require("@toss/tds-react-native");
1537
1466
  var import_private8 = require("@toss/tds-react-native/private");
1538
- var import_es_hangul4 = require("es-hangul");
1539
- var import_react19 = require("react");
1467
+ var import_react18 = require("react");
1540
1468
  var import_jsx_runtime17 = require("react/jsx-runtime");
1541
1469
  function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
1542
1470
  const globals = getAppsInTossGlobals();
1543
1471
  const logging = useNavigationBarLogging();
1544
- const { openConfirm } = (0, import_tds_react_native12.useDialog)();
1545
1472
  const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
1546
1473
  const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
1547
1474
  const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
1548
1475
  const withBackButton = parsedNavigationBar?.withBackButton ?? true;
1549
1476
  const { navigationRightButton } = useNavigationBarContext();
1550
- const handleClose = (0, import_react19.useCallback)(async () => {
1477
+ const handleClose = (0, import_react18.useCallback)(async () => {
1551
1478
  logging.closeButtonClick();
1552
- const isConfirmed = await openConfirm({
1553
- title: `${(0, import_es_hangul4.josa)(globals.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
1554
- leftButton: "\uB2EB\uAE30",
1555
- rightButton: "\uC885\uB8CC\uD558\uAE30",
1556
- closeOnDimmerClick: true,
1557
- onEntered: logging.closePopupShow
1558
- });
1559
- logging.closePopupCtaClick(isConfirmed);
1560
- if (isConfirmed) {
1561
- (0, import_react_native26.closeView)();
1562
- }
1563
- }, [globals.brandDisplayName, logging, openConfirm]);
1479
+ (0, import_react_native26.closeView)();
1480
+ }, [logging]);
1564
1481
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1565
1482
  import_private8.TopNavigation,
1566
1483
  {
@@ -1580,7 +1497,7 @@ function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
1580
1497
 
1581
1498
  // src/components/PartnerWebView.tsx
1582
1499
  var import_jsx_runtime18 = require("react/jsx-runtime");
1583
- var PartnerWebView = (0, import_react20.forwardRef)(function PartnerWebViewScreen({ onBackButtonClick, onHomeButtonClick, ...webViewProps }, ref) {
1500
+ var PartnerWebView = (0, import_react19.forwardRef)(function PartnerWebViewScreen({ onBackButtonClick, onHomeButtonClick, ...webViewProps }, ref) {
1584
1501
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
1585
1502
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PartnerWebviewNavigationBar, { onBackButtonClick, onHomeButtonClick }),
1586
1503
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native_webview2.WebView, { ref, ...webViewProps, style: { flex: 1 } })
@@ -1988,7 +1905,7 @@ async function tossAdEventLog(params) {
1988
1905
  }
1989
1906
 
1990
1907
  // src/bridge-handler/useBridgeHandler.tsx
1991
- var import_react21 = require("react");
1908
+ var import_react20 = require("react");
1992
1909
  function serializeError(error) {
1993
1910
  return JSON.stringify(error, (_, value) => {
1994
1911
  if (value instanceof Error) {
@@ -2040,8 +1957,8 @@ function useBridgeHandler({
2040
1957
  asyncHandlerMap,
2041
1958
  eventListenerMap
2042
1959
  }) {
2043
- const ref = (0, import_react21.useRef)(null);
2044
- const injectedJavaScript = (0, import_react21.useMemo)(
1960
+ const ref = (0, import_react20.useRef)(null);
1961
+ const injectedJavaScript = (0, import_react20.useMemo)(
2045
1962
  () => `window.__CONSTANT_HANDLER_MAP = ${JSON.stringify(
2046
1963
  Object.entries(constantHandlerMap).reduce(
2047
1964
  (acc, [key, value]) => {
@@ -2053,7 +1970,7 @@ function useBridgeHandler({
2053
1970
  )};`,
2054
1971
  [constantHandlerMap]
2055
1972
  );
2056
- (0, import_react21.useEffect)(() => {
1973
+ (0, import_react20.useEffect)(() => {
2057
1974
  ref.current?.injectJavaScript(injectedJavaScript);
2058
1975
  }, [injectedJavaScript]);
2059
1976
  const createHandleOnEvent = (functionName, eventId) => (response) => {
@@ -2067,7 +1984,7 @@ function useBridgeHandler({
2067
1984
  window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
2068
1985
  `);
2069
1986
  };
2070
- const $onMessage = (0, import_react21.useCallback)(
1987
+ const $onMessage = (0, import_react20.useCallback)(
2071
1988
  async (e) => {
2072
1989
  onMessage?.(e);
2073
1990
  const data = parseNativeEventData(e.nativeEvent.data);
@@ -2127,13 +2044,13 @@ function parseNativeEventData(data) {
2127
2044
 
2128
2045
  // src/core/hooks/useSafeAreaInsetsEvent.tsx
2129
2046
  var import_react_native_safe_area_context3 = require("@granite-js/native/react-native-safe-area-context");
2130
- var import_react22 = require("react");
2047
+ var import_react21 = require("react");
2131
2048
  function useSafeAreaInsetsEvent() {
2132
2049
  const insets = (0, import_react_native_safe_area_context3.useSafeAreaInsets)();
2133
- (0, import_react22.useEffect)(() => {
2050
+ (0, import_react21.useEffect)(() => {
2134
2051
  safeAreaInsetsChange.emit(insets);
2135
2052
  }, [insets]);
2136
- (0, import_react22.useEffect)(() => {
2053
+ (0, import_react21.useEffect)(() => {
2137
2054
  return () => safeAreaInsetsChange.clearSubscriptions();
2138
2055
  }, []);
2139
2056
  return safeAreaInsetsChange;
@@ -2141,12 +2058,10 @@ function useSafeAreaInsetsEvent() {
2141
2058
 
2142
2059
  // src/core/hooks/useWebBackHandler.tsx
2143
2060
  var import_react_native30 = require("@granite-js/react-native");
2144
- var import_tds_react_native13 = require("@toss/tds-react-native");
2145
- var import_es_hangul5 = require("es-hangul");
2146
- var import_react24 = require("react");
2061
+ var import_react23 = require("react");
2147
2062
 
2148
2063
  // src/hooks/useWebviewHistoryStack.tsx
2149
- var import_react23 = require("react");
2064
+ var import_react22 = require("react");
2150
2065
  var INITIAL_STATE = { stack: [], index: -1 };
2151
2066
  function reducer(state, action) {
2152
2067
  switch (action.type) {
@@ -2177,11 +2092,11 @@ function reducer(state, action) {
2177
2092
  }
2178
2093
  }
2179
2094
  function useWebViewHistory() {
2180
- const [state, dispatch] = (0, import_react23.useReducer)(reducer, INITIAL_STATE);
2181
- const onNavigationStateChange = (0, import_react23.useCallback)(({ url, canGoForward: canGoForward2 }) => {
2095
+ const [state, dispatch] = (0, import_react22.useReducer)(reducer, INITIAL_STATE);
2096
+ const onNavigationStateChange = (0, import_react22.useCallback)(({ url, canGoForward: canGoForward2 }) => {
2182
2097
  dispatch({ type: "NAVIGATION_CHANGE", url, canGoForward: canGoForward2 });
2183
2098
  }, []);
2184
- const { canGoBack, canGoForward } = (0, import_react23.useMemo)(() => {
2099
+ const { canGoBack, canGoForward } = (0, import_react22.useMemo)(() => {
2185
2100
  const canBack = state.index > 0;
2186
2101
  const canFwd = state.index >= 0 && state.index < state.stack.length - 1;
2187
2102
  return { canGoBack: canBack, canGoForward: canFwd };
@@ -2199,21 +2114,19 @@ function useWebBackHandler(webViewInitialURL, webViewRef) {
2199
2114
  removeEventListener: removeWebBackEventListener
2200
2115
  } = (0, import_react_native30.useBackEventState)();
2201
2116
  const logging = useNavigationBarLogging();
2202
- const { openConfirm } = (0, import_tds_react_native13.useDialog)();
2203
- const global2 = getAppsInTossGlobals();
2204
- const addEventListener = (0, import_react24.useCallback)(
2117
+ const addEventListener = (0, import_react23.useCallback)(
2205
2118
  (handler) => {
2206
2119
  addWebBackEventListener(handler);
2207
2120
  },
2208
2121
  [addWebBackEventListener]
2209
2122
  );
2210
- const removeEventListener = (0, import_react24.useCallback)(
2123
+ const removeEventListener = (0, import_react23.useCallback)(
2211
2124
  (handler) => {
2212
2125
  removeWebBackEventListener(handler);
2213
2126
  },
2214
2127
  [removeWebBackEventListener]
2215
2128
  );
2216
- const handleWebBack = (0, import_react24.useCallback)(async () => {
2129
+ const handleWebBack = (0, import_react23.useCallback)(async () => {
2217
2130
  if (hasWebBackEvent) {
2218
2131
  for (const handler of webBackHandlersRef) {
2219
2132
  handler();
@@ -2223,20 +2136,10 @@ function useWebBackHandler(webViewInitialURL, webViewRef) {
2223
2136
  if (hasHistory) {
2224
2137
  webViewRef.current?.injectJavaScript("window.history.back();");
2225
2138
  } else {
2226
- const isConfirmed = await openConfirm({
2227
- title: `${(0, import_es_hangul5.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
2228
- leftButton: "\uB2EB\uAE30",
2229
- rightButton: "\uC885\uB8CC\uD558\uAE30",
2230
- closeOnDimmerClick: true,
2231
- onEntered: logging.closePopupShow
2232
- });
2233
- logging.closePopupCtaClick(isConfirmed);
2234
- if (isConfirmed) {
2235
- (0, import_react_native30.closeView)();
2236
- }
2139
+ (0, import_react_native30.closeView)();
2237
2140
  }
2238
- }, [global2.brandDisplayName, hasHistory, hasWebBackEvent, webBackHandlersRef, logging, openConfirm, webViewRef]);
2239
- const handleWebHome = (0, import_react24.useCallback)(() => {
2141
+ }, [hasHistory, hasWebBackEvent, webBackHandlersRef, logging, webViewRef]);
2142
+ const handleWebHome = (0, import_react23.useCallback)(() => {
2240
2143
  logging.homeButtonClick();
2241
2144
  if (homeEvent.hasSubscriptions()) {
2242
2145
  homeEvent.emit({});
@@ -2249,7 +2152,7 @@ function useWebBackHandler(webViewInitialURL, webViewRef) {
2249
2152
  })();
2250
2153
  `);
2251
2154
  }, [hasWebBackEvent, webBackHandlersRef, logging, webViewInitialURL, webViewRef]);
2252
- return (0, import_react24.useMemo)(
2155
+ return (0, import_react23.useMemo)(
2253
2156
  () => ({ addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange }),
2254
2157
  [addEventListener, removeEventListener, handleWebBack, handleWebHome, onNavigationStateChange]
2255
2158
  );
@@ -2428,11 +2331,11 @@ function useCreateUserAgent({
2428
2331
  // src/hooks/useGeolocation.ts
2429
2332
  var import_native_modules16 = require("@apps-in-toss/native-modules");
2430
2333
  var import_react_native32 = require("@granite-js/react-native");
2431
- var import_react25 = require("react");
2334
+ var import_react24 = require("react");
2432
2335
  function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
2433
2336
  const isVisible = (0, import_react_native32.useVisibility)();
2434
- const [location, setLocation] = (0, import_react25.useState)(null);
2435
- (0, import_react25.useEffect)(() => {
2337
+ const [location, setLocation] = (0, import_react24.useState)(null);
2338
+ (0, import_react24.useEffect)(() => {
2436
2339
  if (!isVisible) {
2437
2340
  return;
2438
2341
  }
@@ -2451,11 +2354,11 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
2451
2354
 
2452
2355
  // src/hooks/useWaitForReturnNavigator.tsx
2453
2356
  var import_react_native33 = require("@granite-js/react-native");
2454
- var import_react26 = require("react");
2357
+ var import_react25 = require("react");
2455
2358
  function useWaitForReturnNavigator() {
2456
- const callbacks = (0, import_react26.useRef)([]).current;
2359
+ const callbacks = (0, import_react25.useRef)([]).current;
2457
2360
  const navigation = (0, import_react_native33.useNavigation)();
2458
- const startNavigating = (0, import_react26.useCallback)(
2361
+ const startNavigating = (0, import_react25.useCallback)(
2459
2362
  (route, params) => {
2460
2363
  return new Promise((resolve) => {
2461
2364
  callbacks.push(resolve);
@@ -2464,7 +2367,7 @@ function useWaitForReturnNavigator() {
2464
2367
  },
2465
2368
  [callbacks, navigation]
2466
2369
  );
2467
- const handleVisibilityChange = (0, import_react26.useCallback)(
2370
+ const handleVisibilityChange = (0, import_react25.useCallback)(
2468
2371
  (state) => {
2469
2372
  if (state === "visible" && callbacks.length > 0) {
2470
2373
  for (const callback of callbacks) {
@@ -2491,9 +2394,9 @@ function useTopNavigation() {
2491
2394
  // src/hooks/useWebViewMemoryDebug.tsx
2492
2395
  var import_native_modules17 = require("@apps-in-toss/native-modules");
2493
2396
  var import_react_native34 = require("@granite-js/react-native");
2494
- var import_tds_react_native14 = require("@toss/tds-react-native");
2397
+ var import_tds_react_native11 = require("@toss/tds-react-native");
2495
2398
  function useHandleWebViewProcessDidTerminate(webViewRef) {
2496
- const toast = (0, import_tds_react_native14.useToast)();
2399
+ const toast = (0, import_tds_react_native11.useToast)();
2497
2400
  return () => {
2498
2401
  webViewDebugLog("AppsInTossWebViewProcessDidTerminate", {});
2499
2402
  toast.open("\uBB38\uC81C\uAC00 \uC0DD\uACA8\uC11C \uBBF8\uB2C8\uC571\uC744 \uB2E4\uC2DC \uC2DC\uC791\uD588\uC5B4\uC694.", {
@@ -2597,7 +2500,7 @@ var operationalEnvironment = appsInTossConstantBridges.getOperationalEnvironment
2597
2500
  var TYPES = ["partner", "external", "game"];
2598
2501
  var WEBVIEW_TYPES = {
2599
2502
  partner: PartnerWebView,
2600
- external: import_tds_react_native15.ExternalWebViewScreen,
2503
+ external: import_tds_react_native12.ExternalWebViewScreen,
2601
2504
  game: GameWebView
2602
2505
  };
2603
2506
  function mergeSchemeQueryParamsInto(url) {
@@ -2629,8 +2532,8 @@ function WebView({ type, local, onMessage, ...props }) {
2629
2532
  if (!TYPES.includes(type)) {
2630
2533
  throw new Error(`Invalid WebView type: '${type}'`);
2631
2534
  }
2632
- const webViewRef = (0, import_react27.useRef)(null);
2633
- const url = (0, import_react27.useMemo)(() => getWebViewURL(local), [local]);
2535
+ const webViewRef = (0, import_react26.useRef)(null);
2536
+ const url = (0, import_react26.useMemo)(() => getWebViewURL(local), [local]);
2634
2537
  const webBackHandler = useWebBackHandler(url, webViewRef);
2635
2538
  const top = (0, import_private9.useSafeAreaTop)();
2636
2539
  const bottom = (0, import_private9.useSafeAreaBottom)();
@@ -2638,14 +2541,14 @@ function WebView({ type, local, onMessage, ...props }) {
2638
2541
  const global2 = getAppsInTossGlobals();
2639
2542
  const navigationBarContext = useNavigationBarContext();
2640
2543
  const safeAreaInsetsEvent = useSafeAreaInsetsEvent();
2641
- const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0, import_react27.useState)(
2544
+ const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0, import_react26.useState)(
2642
2545
  props.allowsBackForwardNavigationGestures
2643
2546
  );
2644
2547
  const handler = useBridgeHandler({
2645
2548
  onMessage,
2646
2549
  eventListenerMap: {
2647
2550
  ...appsInTossEventBridges,
2648
- navigationAccessoryEvent: ({ onEvent, onError }) => import_tds_react_native15.tdsEvent.addEventListener("navigationAccessoryEvent", { onEvent, onError }),
2551
+ navigationAccessoryEvent: ({ onEvent, onError }) => import_tds_react_native12.tdsEvent.addEventListener("navigationAccessoryEvent", { onEvent, onError }),
2649
2552
  backEvent: ({ onEvent }) => {
2650
2553
  webBackHandler.addEventListener(onEvent);
2651
2554
  return () => {
@@ -2739,7 +2642,7 @@ function WebView({ type, local, onMessage, ...props }) {
2739
2642
  }
2740
2643
  }
2741
2644
  });
2742
- const headerPropForExternalWebView = (0, import_react27.useMemo)(() => {
2645
+ const headerPropForExternalWebView = (0, import_react26.useMemo)(() => {
2743
2646
  const parsedNavigationBar = global2.navigationBar != null ? safeParseNavigationBar(global2.navigationBar) : null;
2744
2647
  const initialAccessoryButton = parsedNavigationBar?.initialAccessoryButton;
2745
2648
  const withBackButton = parsedNavigationBar?.withBackButton ?? true;
@@ -2760,7 +2663,7 @@ function WebView({ type, local, onMessage, ...props }) {
2760
2663
  colorPreference: "light"
2761
2664
  });
2762
2665
  const refs = mergeRefs(handler.ref, webViewRef);
2763
- (0, import_react27.useEffect)(() => {
2666
+ (0, import_react26.useEffect)(() => {
2764
2667
  const callback = () => {
2765
2668
  webBackHandler.handleWebBack();
2766
2669
  return true;
@@ -2839,7 +2742,7 @@ var import_types = require("@apps-in-toss/types");
2839
2742
 
2840
2743
  // src/ads/inlineAd/InlineAd.tsx
2841
2744
  var import_react_native41 = require("@granite-js/react-native");
2842
- var import_react30 = require("react");
2745
+ var import_react29 = require("react");
2843
2746
  var import_react_native42 = require("react-native");
2844
2747
 
2845
2748
  // src/ads/inlineAd/constants.ts
@@ -3221,7 +3124,7 @@ var EventTracker = class {
3221
3124
 
3222
3125
  // src/ads/inlineAd/ui/FeedBannerAdView.tsx
3223
3126
  var import_react_native_svg = require("@granite-js/native/react-native-svg");
3224
- var import_react28 = require("react");
3127
+ var import_react27 = require("react");
3225
3128
  var import_react_native39 = require("react-native");
3226
3129
  var import_jsx_runtime20 = require("react/jsx-runtime");
3227
3130
  var ARROW_PATH = "m7.5 20.4c-.5-.5-.5-1.2 0-1.7l6.7-6.7-6.8-6.7c-.5-.5-.5-1.2 0-1.7s1.2-.5 1.7 0l7.5 7.5c.5.5.5 1.2 0 1.7l-7.5 7.5c-.2.3-.5.4-.8.4s-.6-.1-.8-.3z";
@@ -3240,7 +3143,7 @@ function FeedBannerAdView({
3240
3143
  paddingStyle,
3241
3144
  onPress
3242
3145
  }) {
3243
- const scale = (0, import_react28.useRef)(new import_react_native39.Animated.Value(1)).current;
3146
+ const scale = (0, import_react27.useRef)(new import_react_native39.Animated.Value(1)).current;
3244
3147
  const animateScale = (toValue) => {
3245
3148
  import_react_native39.Animated.timing(scale, {
3246
3149
  toValue,
@@ -3476,7 +3379,7 @@ var styles = import_react_native39.StyleSheet.create({
3476
3379
 
3477
3380
  // src/ads/inlineAd/ui/ListBannerAdView.tsx
3478
3381
  var import_react_native_svg2 = require("@granite-js/native/react-native-svg");
3479
- var import_react29 = require("react");
3382
+ var import_react28 = require("react");
3480
3383
  var import_react_native40 = require("react-native");
3481
3384
  var import_jsx_runtime21 = require("react/jsx-runtime");
3482
3385
  var SQUIRCLE_PATH = "M0 17.352C0 3.564 3.564 0 17.352 0H18.648C32.436 0 36 3.564 36 17.352V18.648C36 32.436 32.436 36 18.648 36H17.352C3.564 36 0 32.436 0 18.648V17.352Z";
@@ -3490,8 +3393,8 @@ function ListBannerAdView({
3490
3393
  colors,
3491
3394
  onPress
3492
3395
  }) {
3493
- const scale = (0, import_react29.useRef)(new import_react_native40.Animated.Value(1)).current;
3494
- const clipIdRef = (0, import_react29.useRef)(`clip-${Math.random().toString(36).slice(2)}`);
3396
+ const scale = (0, import_react28.useRef)(new import_react_native40.Animated.Value(1)).current;
3397
+ const clipIdRef = (0, import_react28.useRef)(`clip-${Math.random().toString(36).slice(2)}`);
3495
3398
  const animateScale = (toValue) => {
3496
3399
  import_react_native40.Animated.timing(scale, {
3497
3400
  toValue,
@@ -3799,21 +3702,21 @@ function InlineAd(props) {
3799
3702
  onAdFailedToRender,
3800
3703
  onNoFill
3801
3704
  } = props;
3802
- const slotIdRef = (0, import_react30.useRef)(createSlotId());
3803
- const [ad, setAd] = (0, import_react30.useState)(null);
3804
- const [isAdBadgeEnabled, setIsAdBadgeEnabled] = (0, import_react30.useState)(true);
3805
- const eventTrackerRef = (0, import_react30.useRef)(null);
3806
- const eventPayloadRef = (0, import_react30.useRef)(null);
3807
- const hasRenderedRef = (0, import_react30.useRef)(false);
3808
- const hasLoggedImp1pxRef = (0, import_react30.useRef)(false);
3809
- const hasLoggedImp100pRef = (0, import_react30.useRef)(false);
3810
- const hasNotifiedViewableRef = (0, import_react30.useRef)(false);
3811
- const viewableTimerRef = (0, import_react30.useRef)(null);
3812
- const refetchIntervalMsRef = (0, import_react30.useRef)(null);
3813
- const lastImp1pxAtRef = (0, import_react30.useRef)(null);
3814
- const loadingRef = (0, import_react30.useRef)(false);
3815
- const loadRef = (0, import_react30.useRef)(null);
3816
- const callbacksRef = (0, import_react30.useRef)({
3705
+ const slotIdRef = (0, import_react29.useRef)(createSlotId());
3706
+ const [ad, setAd] = (0, import_react29.useState)(null);
3707
+ const [isAdBadgeEnabled, setIsAdBadgeEnabled] = (0, import_react29.useState)(true);
3708
+ const eventTrackerRef = (0, import_react29.useRef)(null);
3709
+ const eventPayloadRef = (0, import_react29.useRef)(null);
3710
+ const hasRenderedRef = (0, import_react29.useRef)(false);
3711
+ const hasLoggedImp1pxRef = (0, import_react29.useRef)(false);
3712
+ const hasLoggedImp100pRef = (0, import_react29.useRef)(false);
3713
+ const hasNotifiedViewableRef = (0, import_react29.useRef)(false);
3714
+ const viewableTimerRef = (0, import_react29.useRef)(null);
3715
+ const refetchIntervalMsRef = (0, import_react29.useRef)(null);
3716
+ const lastImp1pxAtRef = (0, import_react29.useRef)(null);
3717
+ const loadingRef = (0, import_react29.useRef)(false);
3718
+ const loadRef = (0, import_react29.useRef)(null);
3719
+ const callbacksRef = (0, import_react29.useRef)({
3817
3720
  onAdRendered,
3818
3721
  onAdViewable,
3819
3722
  onAdClicked,
@@ -3821,7 +3724,7 @@ function InlineAd(props) {
3821
3724
  onAdFailedToRender,
3822
3725
  onNoFill
3823
3726
  });
3824
- const isMountedRef = (0, import_react30.useRef)(false);
3727
+ const isMountedRef = (0, import_react29.useRef)(false);
3825
3728
  const colorScheme = (0, import_react_native42.useColorScheme)();
3826
3729
  const selectedTheme = theme ?? DEFAULT_INLINE_AD_THEME;
3827
3730
  const resolvedTheme = selectedTheme === "auto" ? colorScheme === "dark" ? "dark" : "light" : selectedTheme;
@@ -3838,7 +3741,7 @@ function InlineAd(props) {
3838
3741
  onAdFailedToRender,
3839
3742
  onNoFill
3840
3743
  };
3841
- (0, import_react30.useEffect)(() => {
3744
+ (0, import_react29.useEffect)(() => {
3842
3745
  isMountedRef.current = true;
3843
3746
  return () => {
3844
3747
  isMountedRef.current = false;
@@ -3848,7 +3751,7 @@ function InlineAd(props) {
3848
3751
  }
3849
3752
  };
3850
3753
  }, []);
3851
- (0, import_react30.useEffect)(() => {
3754
+ (0, import_react29.useEffect)(() => {
3852
3755
  const normalizedAdGroupId = normalizeAdGroupId(adGroupId);
3853
3756
  const loadAdRequest = () => {
3854
3757
  if (loadingRef.current) {
@@ -3933,7 +3836,7 @@ function InlineAd(props) {
3933
3836
  loadRef.current?.();
3934
3837
  }
3935
3838
  });
3936
- (0, import_react30.useEffect)(() => {
3839
+ (0, import_react29.useEffect)(() => {
3937
3840
  if (!ad || hasRenderedRef.current) {
3938
3841
  return;
3939
3842
  }
package/dist/index.js CHANGED
@@ -625,27 +625,6 @@ function useHardwareBackPress(handler) {
625
625
  import { closeView as closeView3, useBackEventContext, useNavigation } from "@granite-js/react-native";
626
626
  import { useMemo as useMemo2 } from "react";
627
627
 
628
- // src/components/NavigationBar/RNNavigationBar/hooks/useCloseConfirm.ts
629
- import { useDialog as useDialog3 } from "@toss/tds-react-native";
630
- import { josa as josa2 } from "es-hangul";
631
- import { useCallback as useCallback6 } from "react";
632
- function useCloseConfirm() {
633
- const { brandDisplayName } = getAppsInTossGlobals();
634
- const { openConfirm } = useDialog3();
635
- return useCallback6(
636
- async ({ onEntered }) => {
637
- return await openConfirm({
638
- title: `${josa2(brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
639
- leftButton: "\uB2EB\uAE30",
640
- rightButton: "\uC885\uB8CC\uD558\uAE30",
641
- closeOnDimmerClick: true,
642
- onEntered
643
- });
644
- },
645
- [brandDisplayName, openConfirm]
646
- );
647
- }
648
-
649
628
  // src/utils/eventEmitter.ts
650
629
  var EventEmitter = class {
651
630
  listeners = {};
@@ -690,12 +669,8 @@ var safeAreaInsetsChange = createEvent("safeAreaInsetsChange");
690
669
  import { Granite as Granite3 } from "@granite-js/react-native";
691
670
  var NAVI_BAR_IMPRESSION_SCHEMA_ID = 1596837;
692
671
  var NAVI_BAR_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__navigation_bar";
693
- var CLOSE_POPUP_SHOW_SCHEMA_ID = 1644490;
694
- var CLOSE_POPUP_SHOW_LOG_NAME = "appsintoss_app_visit__common_module::popup__close_app";
695
672
  var CLOSE_BUTTON_CLICK_SCHEMA_ID = 1596831;
696
673
  var CLOSE_BUTTON_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::click__icon_close";
697
- var CLOSE_POPUP_CTA_CLICK_SCHEMA_ID = 1644492;
698
- var CLOSE_POPUP_CTA_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::popup__close_app::click__cta";
699
674
  var HOME_BUTTON_CLICK_SCHEMA_ID = 1596839;
700
675
  var HOME_BUTTON_CLICK_LOG_NAME = "appsintoss_app_visit__common_module::click__icon_home";
701
676
  function useNavigationBarLogging() {
@@ -738,32 +713,8 @@ function useNavigationBarLogging() {
738
713
  }
739
714
  });
740
715
  };
741
- const logClosePopupShow = () => {
742
- sendLog({
743
- log_name: CLOSE_POPUP_SHOW_LOG_NAME,
744
- log_type: "popup",
745
- params: {
746
- ...baseParams,
747
- schema_id: CLOSE_POPUP_SHOW_SCHEMA_ID
748
- }
749
- });
750
- };
751
- const logClosePopupCtaClick = (confirm) => {
752
- sendLog({
753
- log_name: CLOSE_POPUP_CTA_CLICK_LOG_NAME,
754
- log_type: "event",
755
- params: {
756
- ...baseParams,
757
- close_yn: confirm ? "Y" : "N",
758
- schema_id: CLOSE_POPUP_CTA_CLICK_SCHEMA_ID,
759
- event_type: "click"
760
- }
761
- });
762
- };
763
716
  return {
764
717
  navBarImpression: logNavBarImpression,
765
- closePopupShow: logClosePopupShow,
766
- closePopupCtaClick: logClosePopupCtaClick,
767
718
  closeButtonClick: logCloseButtonClick,
768
719
  homeButtonClick: logHomeButtonClick
769
720
  };
@@ -774,25 +725,15 @@ function useNavigationEvent() {
774
725
  const backEventContext = useBackEventContext();
775
726
  const logging = useNavigationBarLogging();
776
727
  const navigation = useNavigation();
777
- const closeConfirm = useCloseConfirm();
778
- return useMemo2(() => {
779
- const close = async () => {
780
- const hasConfirmed = await closeConfirm({
781
- onEntered: logging.closePopupShow
782
- });
783
- logging.closePopupCtaClick(hasConfirmed);
784
- if (hasConfirmed) {
785
- closeView3();
786
- }
787
- };
788
- return {
728
+ return useMemo2(
729
+ () => ({
789
730
  handleBack: () => {
790
731
  if (backEventContext.hasBackEvent) {
791
732
  backEventContext.onBack();
792
733
  } else if (navigation.canGoBack()) {
793
734
  navigation.goBack();
794
735
  } else {
795
- close();
736
+ closeView3();
796
737
  }
797
738
  },
798
739
  handleHomeButtonClick: () => {
@@ -805,10 +746,11 @@ function useNavigationEvent() {
805
746
  },
806
747
  handleCloseButtonClick: () => {
807
748
  logging.closeButtonClick();
808
- close();
749
+ closeView3();
809
750
  }
810
- };
811
- }, [backEventContext, navigation, closeConfirm, logging]);
751
+ }),
752
+ [backEventContext, navigation, logging]
753
+ );
812
754
  }
813
755
 
814
756
  // src/core/hooks/useMoreButtonBottomSheet/index.tsx
@@ -821,7 +763,7 @@ import { useEffect as useEffect5, useState as useState4 } from "react";
821
763
  // src/core/hooks/useMoreButtonBottomSheet/AppShareListMenu.tsx
822
764
  import { getOperationalEnvironment, shareWithScheme } from "@apps-in-toss/native-modules";
823
765
  import { getSchemeUri as getSchemeUri4 } from "@granite-js/react-native";
824
- import { useDialog as useDialog4 } from "@toss/tds-react-native";
766
+ import { useDialog as useDialog3 } from "@toss/tds-react-native";
825
767
 
826
768
  // src/core/hooks/useMoreButtonBottomSheet/Menu.tsx
827
769
  import { ListRow, Asset as Asset2 } from "@toss/tds-react-native";
@@ -971,7 +913,7 @@ var APP_SHARE_MENU_INFO = {
971
913
  function AppShareListMenu() {
972
914
  const initialScheme = getSchemeUri4();
973
915
  const isSandbox = getOperationalEnvironment() === "sandbox";
974
- const { openConfirm } = useDialog4();
916
+ const { openConfirm } = useDialog3();
975
917
  const schemeForShare = addParamsToUrl(initialScheme, {
976
918
  referrer: SHARE_SCHEME_REFERRER
977
919
  });
@@ -1427,34 +1369,22 @@ import { Platform as Platform5 } from "react-native";
1427
1369
  // src/components/NavigationBar/GameWebviewNavigationBar.tsx
1428
1370
  import { useSafeAreaInsets as useSafeAreaInsets2 } from "@granite-js/native/react-native-safe-area-context";
1429
1371
  import { closeView as closeView4 } from "@granite-js/react-native";
1430
- import { PageNavbar as PageNavbar2, useDialog as useDialog5 } from "@toss/tds-react-native";
1372
+ import { PageNavbar as PageNavbar2, useDialog as useDialog4 } from "@toss/tds-react-native";
1431
1373
  import { NavigationRightContent as NavigationRightContent2, useSafeAreaTop as useSafeAreaTop2 } from "@toss/tds-react-native/private";
1432
- import { josa as josa3 } from "es-hangul";
1433
- import { useCallback as useCallback7 } from "react";
1374
+ import { useCallback as useCallback6 } from "react";
1434
1375
  import { Platform as Platform4, View as View4 } from "react-native";
1435
1376
  import { Fragment as Fragment8, jsx as jsx15, jsxs as jsxs6 } from "react/jsx-runtime";
1436
1377
  function GameWebviewNavigationBar() {
1437
1378
  const safeAreaTop = useSafeAreaTop2();
1438
- const { openConfirm } = useDialog5();
1439
- const global2 = getAppsInTossGlobals();
1379
+ const { openConfirm } = useDialog4();
1440
1380
  const logging = useNavigationBarLogging();
1441
1381
  const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
1442
1382
  const { navigationRightButton } = useNavigationBarContext();
1443
1383
  const { right: safeAreaRight } = useSafeAreaInsets2();
1444
- const handleGameWebviewClose = useCallback7(async () => {
1384
+ const handleGameWebviewClose = useCallback6(async () => {
1445
1385
  logging.closeButtonClick();
1446
- const isConfirmed = await openConfirm({
1447
- title: `${josa3(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
1448
- leftButton: "\uB2EB\uAE30",
1449
- rightButton: "\uC885\uB8CC\uD558\uAE30",
1450
- closeOnDimmerClick: true,
1451
- onEntered: logging.closePopupShow
1452
- });
1453
- logging.closePopupCtaClick(isConfirmed);
1454
- if (isConfirmed) {
1455
- closeView4();
1456
- }
1457
- }, [global2.brandDisplayName, logging, openConfirm]);
1386
+ closeView4();
1387
+ }, [logging, openConfirm]);
1458
1388
  return /* @__PURE__ */ jsxs6(Fragment8, { children: [
1459
1389
  /* @__PURE__ */ jsx15(PageNavbar2, { preference: { type: "none" } }),
1460
1390
  /* @__PURE__ */ jsx15(
@@ -1515,34 +1445,21 @@ import { forwardRef as forwardRef2 } from "react";
1515
1445
 
1516
1446
  // src/components/NavigationBar/PartnerWebviewNavigationBar.tsx
1517
1447
  import { closeView as closeView5 } from "@granite-js/react-native";
1518
- import { useDialog as useDialog6 } from "@toss/tds-react-native";
1519
1448
  import { NavigationBackButton as NavigationBackButton2, NavigationLeft as NavigationLeft2, TopNavigation as TopNavigation2 } from "@toss/tds-react-native/private";
1520
- import { josa as josa4 } from "es-hangul";
1521
- import { useCallback as useCallback8 } from "react";
1449
+ import { useCallback as useCallback7 } from "react";
1522
1450
  import { jsx as jsx17 } from "react/jsx-runtime";
1523
1451
  function PartnerWebviewNavigationBar({ onBackButtonClick, onHomeButtonClick }) {
1524
1452
  const globals = getAppsInTossGlobals();
1525
1453
  const logging = useNavigationBarLogging();
1526
- const { openConfirm } = useDialog6();
1527
1454
  const { open: openMoreButtonBottomSheet } = useMoreButtonBottomSheet();
1528
1455
  const parsedNavigationBar = globals.navigationBar != null ? safeParseNavigationBar(globals.navigationBar) : null;
1529
1456
  const withHomeButton = parsedNavigationBar?.withHomeButton ?? false;
1530
1457
  const withBackButton = parsedNavigationBar?.withBackButton ?? true;
1531
1458
  const { navigationRightButton } = useNavigationBarContext();
1532
- const handleClose = useCallback8(async () => {
1459
+ const handleClose = useCallback7(async () => {
1533
1460
  logging.closeButtonClick();
1534
- const isConfirmed = await openConfirm({
1535
- title: `${josa4(globals.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
1536
- leftButton: "\uB2EB\uAE30",
1537
- rightButton: "\uC885\uB8CC\uD558\uAE30",
1538
- closeOnDimmerClick: true,
1539
- onEntered: logging.closePopupShow
1540
- });
1541
- logging.closePopupCtaClick(isConfirmed);
1542
- if (isConfirmed) {
1543
- closeView5();
1544
- }
1545
- }, [globals.brandDisplayName, logging, openConfirm]);
1461
+ closeView5();
1462
+ }, [logging]);
1546
1463
  return /* @__PURE__ */ jsx17(NavigationBarImpressionArea, { withHomeButton, children: /* @__PURE__ */ jsx17(
1547
1464
  TopNavigation2,
1548
1465
  {
@@ -1974,7 +1891,7 @@ async function tossAdEventLog(params) {
1974
1891
  }
1975
1892
 
1976
1893
  // src/bridge-handler/useBridgeHandler.tsx
1977
- import { useCallback as useCallback9, useEffect as useEffect9, useMemo as useMemo3, useRef as useRef3 } from "react";
1894
+ import { useCallback as useCallback8, useEffect as useEffect9, useMemo as useMemo3, useRef as useRef3 } from "react";
1978
1895
  function serializeError(error) {
1979
1896
  return JSON.stringify(error, (_, value) => {
1980
1897
  if (value instanceof Error) {
@@ -2053,7 +1970,7 @@ function useBridgeHandler({
2053
1970
  window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
2054
1971
  `);
2055
1972
  };
2056
- const $onMessage = useCallback9(
1973
+ const $onMessage = useCallback8(
2057
1974
  async (e) => {
2058
1975
  onMessage?.(e);
2059
1976
  const data = parseNativeEventData(e.nativeEvent.data);
@@ -2127,12 +2044,10 @@ function useSafeAreaInsetsEvent() {
2127
2044
 
2128
2045
  // src/core/hooks/useWebBackHandler.tsx
2129
2046
  import { closeView as closeView6, useBackEventState } from "@granite-js/react-native";
2130
- import { useDialog as useDialog7 } from "@toss/tds-react-native";
2131
- import { josa as josa5 } from "es-hangul";
2132
- import { useCallback as useCallback11, useMemo as useMemo5 } from "react";
2047
+ import { useCallback as useCallback10, useMemo as useMemo5 } from "react";
2133
2048
 
2134
2049
  // src/hooks/useWebviewHistoryStack.tsx
2135
- import { useCallback as useCallback10, useMemo as useMemo4, useReducer } from "react";
2050
+ import { useCallback as useCallback9, useMemo as useMemo4, useReducer } from "react";
2136
2051
  var INITIAL_STATE = { stack: [], index: -1 };
2137
2052
  function reducer(state, action) {
2138
2053
  switch (action.type) {
@@ -2164,7 +2079,7 @@ function reducer(state, action) {
2164
2079
  }
2165
2080
  function useWebViewHistory() {
2166
2081
  const [state, dispatch] = useReducer(reducer, INITIAL_STATE);
2167
- const onNavigationStateChange = useCallback10(({ url, canGoForward: canGoForward2 }) => {
2082
+ const onNavigationStateChange = useCallback9(({ url, canGoForward: canGoForward2 }) => {
2168
2083
  dispatch({ type: "NAVIGATION_CHANGE", url, canGoForward: canGoForward2 });
2169
2084
  }, []);
2170
2085
  const { canGoBack, canGoForward } = useMemo4(() => {
@@ -2185,21 +2100,19 @@ function useWebBackHandler(webViewInitialURL, webViewRef) {
2185
2100
  removeEventListener: removeWebBackEventListener
2186
2101
  } = useBackEventState();
2187
2102
  const logging = useNavigationBarLogging();
2188
- const { openConfirm } = useDialog7();
2189
- const global2 = getAppsInTossGlobals();
2190
- const addEventListener = useCallback11(
2103
+ const addEventListener = useCallback10(
2191
2104
  (handler) => {
2192
2105
  addWebBackEventListener(handler);
2193
2106
  },
2194
2107
  [addWebBackEventListener]
2195
2108
  );
2196
- const removeEventListener = useCallback11(
2109
+ const removeEventListener = useCallback10(
2197
2110
  (handler) => {
2198
2111
  removeWebBackEventListener(handler);
2199
2112
  },
2200
2113
  [removeWebBackEventListener]
2201
2114
  );
2202
- const handleWebBack = useCallback11(async () => {
2115
+ const handleWebBack = useCallback10(async () => {
2203
2116
  if (hasWebBackEvent) {
2204
2117
  for (const handler of webBackHandlersRef) {
2205
2118
  handler();
@@ -2209,20 +2122,10 @@ function useWebBackHandler(webViewInitialURL, webViewRef) {
2209
2122
  if (hasHistory) {
2210
2123
  webViewRef.current?.injectJavaScript("window.history.back();");
2211
2124
  } else {
2212
- const isConfirmed = await openConfirm({
2213
- title: `${josa5(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
2214
- leftButton: "\uB2EB\uAE30",
2215
- rightButton: "\uC885\uB8CC\uD558\uAE30",
2216
- closeOnDimmerClick: true,
2217
- onEntered: logging.closePopupShow
2218
- });
2219
- logging.closePopupCtaClick(isConfirmed);
2220
- if (isConfirmed) {
2221
- closeView6();
2222
- }
2125
+ closeView6();
2223
2126
  }
2224
- }, [global2.brandDisplayName, hasHistory, hasWebBackEvent, webBackHandlersRef, logging, openConfirm, webViewRef]);
2225
- const handleWebHome = useCallback11(() => {
2127
+ }, [hasHistory, hasWebBackEvent, webBackHandlersRef, logging, webViewRef]);
2128
+ const handleWebHome = useCallback10(() => {
2226
2129
  logging.homeButtonClick();
2227
2130
  if (homeEvent.hasSubscriptions()) {
2228
2131
  homeEvent.emit({});
@@ -2437,11 +2340,11 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
2437
2340
 
2438
2341
  // src/hooks/useWaitForReturnNavigator.tsx
2439
2342
  import { useNavigation as useNavigation2, useVisibilityChange } from "@granite-js/react-native";
2440
- import { useCallback as useCallback12, useRef as useRef4 } from "react";
2343
+ import { useCallback as useCallback11, useRef as useRef4 } from "react";
2441
2344
  function useWaitForReturnNavigator() {
2442
2345
  const callbacks = useRef4([]).current;
2443
2346
  const navigation = useNavigation2();
2444
- const startNavigating = useCallback12(
2347
+ const startNavigating = useCallback11(
2445
2348
  (route, params) => {
2446
2349
  return new Promise((resolve) => {
2447
2350
  callbacks.push(resolve);
@@ -2450,7 +2353,7 @@ function useWaitForReturnNavigator() {
2450
2353
  },
2451
2354
  [callbacks, navigation]
2452
2355
  );
2453
- const handleVisibilityChange = useCallback12(
2356
+ const handleVisibilityChange = useCallback11(
2454
2357
  (state) => {
2455
2358
  if (state === "visible" && callbacks.length > 0) {
2456
2359
  for (const callback of callbacks) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apps-in-toss/framework",
3
3
  "type": "module",
4
- "version": "2.5.2",
4
+ "version": "2.6.1",
5
5
  "description": "The framework for Apps In Toss",
6
6
  "scripts": {
7
7
  "typecheck": "tsc --noEmit",
@@ -55,12 +55,12 @@
55
55
  "ait": "./bin/ait.js"
56
56
  },
57
57
  "dependencies": {
58
- "@apps-in-toss/analytics": "2.5.2",
59
- "@apps-in-toss/cli": "2.5.2",
60
- "@apps-in-toss/native-modules": "2.5.2",
61
- "@apps-in-toss/plugins": "2.5.2",
62
- "@apps-in-toss/types": "2.5.2",
63
- "@apps-in-toss/user-scripts": "^2.5.2",
58
+ "@apps-in-toss/analytics": "2.6.1",
59
+ "@apps-in-toss/cli": "2.6.1",
60
+ "@apps-in-toss/native-modules": "2.6.1",
61
+ "@apps-in-toss/plugins": "2.6.1",
62
+ "@apps-in-toss/types": "2.6.1",
63
+ "@apps-in-toss/user-scripts": "^2.6.1",
64
64
  "es-hangul": "^2.3.2"
65
65
  },
66
66
  "devDependencies": {