@apps-in-toss/web-framework 1.8.0 → 1.8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @apps-in-toss/web-framework
2
2
 
3
+ ## 1.8.1
4
+
3
5
  ## 1.8.0
4
6
 
5
7
  ## 1.7.1
@@ -155695,19 +155695,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
155695
155695
  canGoForward: canGoForward
155696
155696
  };
155697
155697
  }
155698
- var HISTORY_BACK_SCRIPT = `
155699
- (function() {
155700
- window.history.back();
155701
- true;
155702
- })();
155703
- `;
155704
- var HISTORY_HOME_SCRIPT = `
155705
- (function() {
155706
- window.location.href = '/';
155707
- true;
155708
- })();
155709
- `;
155710
- function useWebBackHandler(webViewRef) {
155698
+ function useWebBackHandler(webViewInitialURL, webViewRef) {
155711
155699
  var _useCaptureExitLog5 = useCaptureExitLog(),
155712
155700
  captureExitLog = _useCaptureExitLog5.captureExitLog;
155713
155701
  var _useWebViewHistory = useWebViewHistory(),
@@ -155737,7 +155725,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
155737
155725
  }
155738
155726
  if (hasHistory) {
155739
155727
  var _webViewRef$current;
155740
- (_webViewRef$current = webViewRef.current) == null ? void 0 : _webViewRef$current.injectJavaScript(HISTORY_BACK_SCRIPT);
155728
+ (_webViewRef$current = webViewRef.current) == null ? void 0 : _webViewRef$current.injectJavaScript("window.history.back();");
155741
155729
  } else {
155742
155730
  var isConfirmed = yield openConfirm({
155743
155731
  title: `${(0, import_es_hangul5.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
@@ -155762,8 +155750,13 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
155762
155750
  }
155763
155751
  return;
155764
155752
  }
155765
- (_webViewRef$current2 = webViewRef.current) == null ? void 0 : _webViewRef$current2.injectJavaScript(HISTORY_HOME_SCRIPT);
155766
- }, [hasWebBackEvent, webBackHandlersRef, logging, webViewRef]);
155753
+ (_webViewRef$current2 = webViewRef.current) == null ? void 0 : _webViewRef$current2.injectJavaScript(`
155754
+ (function() {
155755
+ const webBundleOrigin = '${webViewInitialURL.origin}';
155756
+ window.location.href = window.location.origin === webBundleOrigin ? '/' : webBundleOrigin;
155757
+ })();
155758
+ `);
155759
+ }, [hasWebBackEvent, webBackHandlersRef, logging, webViewInitialURL, webViewRef]);
155767
155760
  return (0, import_react25.useMemo)(function () {
155768
155761
  return {
155769
155762
  addEventListener: addEventListener,
@@ -156098,10 +156091,10 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156098
156091
  }
156099
156092
  return baseUrl;
156100
156093
  }
156101
- function getWebViewUri(local) {
156094
+ function getWebViewURL(local) {
156102
156095
  if (__DEV__) {
156103
156096
  var devUrl = `http://${local.host}:${local.port}`;
156104
- return mergeSchemeQueryParamsInto(devUrl).toString();
156097
+ return mergeSchemeQueryParamsInto(devUrl);
156105
156098
  }
156106
156099
  var _import_native_module = import_native_modules23.AppsInTossModule.getWebBundleURL({}),
156107
156100
  rawUrl = _import_native_module.url;
@@ -156110,7 +156103,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156110
156103
  if (deploymentId) {
156111
156104
  url.searchParams.set("_deploymentId", deploymentId);
156112
156105
  }
156113
- return url.toString();
156106
+ return url;
156114
156107
  }
156115
156108
  function _WebView(_ref83) {
156116
156109
  var type = _ref83.type,
@@ -156121,10 +156114,10 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156121
156114
  throw new Error(`Invalid WebView type: '${type}'`);
156122
156115
  }
156123
156116
  var webViewRef = (0, import_react28.useRef)(null);
156124
- var webBackHandler = useWebBackHandler(webViewRef);
156125
- var uri = (0, import_react28.useMemo)(function () {
156126
- return getWebViewUri(local);
156117
+ var url = (0, import_react28.useMemo)(function () {
156118
+ return getWebViewURL(local);
156127
156119
  }, [local]);
156120
+ var webBackHandler = useWebBackHandler(url, webViewRef);
156128
156121
  var top = (0, import_private9.useSafeAreaTop)();
156129
156122
  var bottom = (0, import_private9.useSafeAreaBottom)();
156130
156123
  var insets = (0, import_react_native_safe_area_context4.useSafeAreaInsets)();
@@ -156298,7 +156291,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156298
156291
  ref: refs
156299
156292
  }, props, headerPropForExternalWebView, {
156300
156293
  source: {
156301
- uri: uri,
156294
+ uri: url.href,
156302
156295
  headers: {
156303
156296
  "User-Agent": userAgent
156304
156297
  }
@@ -156323,12 +156316,12 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156323
156316
  allowsBackForwardNavigationGestures: allowsBackForwardNavigationGestures,
156324
156317
  onShouldStartLoadWithRequest: function onShouldStartLoadWithRequest(event) {
156325
156318
  try {
156326
- var url = new URL(event.url);
156327
- if (["https:", "http:"].includes(url.protocol) || url.href === "about:blank") {
156319
+ var url2 = new URL(event.url);
156320
+ if (["https:", "http:"].includes(url2.protocol) || url2.href === "about:blank") {
156328
156321
  return true;
156329
156322
  } else {
156330
156323
  var _convertIntentURL;
156331
- import_react_native39.Linking.openURL((_convertIntentURL = convertIntentURL(url)) != null ? _convertIntentURL : url.href);
156324
+ import_react_native39.Linking.openURL((_convertIntentURL = convertIntentURL(url2)) != null ? _convertIntentURL : url2.href);
156332
156325
  return false;
156333
156326
  }
156334
156327
  } catch (error) {
@@ -155516,19 +155516,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
155516
155516
  canGoForward: canGoForward
155517
155517
  };
155518
155518
  }
155519
- var HISTORY_BACK_SCRIPT = `
155520
- (function() {
155521
- window.history.back();
155522
- true;
155523
- })();
155524
- `;
155525
- var HISTORY_HOME_SCRIPT = `
155526
- (function() {
155527
- window.location.href = '/';
155528
- true;
155529
- })();
155530
- `;
155531
- function useWebBackHandler(webViewRef) {
155519
+ function useWebBackHandler(webViewInitialURL, webViewRef) {
155532
155520
  var _useCaptureExitLog5 = useCaptureExitLog(),
155533
155521
  captureExitLog = _useCaptureExitLog5.captureExitLog;
155534
155522
  var _useWebViewHistory = useWebViewHistory(),
@@ -155558,7 +155546,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
155558
155546
  }
155559
155547
  if (hasHistory) {
155560
155548
  var _webViewRef$current;
155561
- (_webViewRef$current = webViewRef.current) == null ? void 0 : _webViewRef$current.injectJavaScript(HISTORY_BACK_SCRIPT);
155549
+ (_webViewRef$current = webViewRef.current) == null ? void 0 : _webViewRef$current.injectJavaScript("window.history.back();");
155562
155550
  } else {
155563
155551
  var isConfirmed = yield openConfirm({
155564
155552
  title: `${(0, import_es_hangul5.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
@@ -155583,8 +155571,13 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
155583
155571
  }
155584
155572
  return;
155585
155573
  }
155586
- (_webViewRef$current2 = webViewRef.current) == null ? void 0 : _webViewRef$current2.injectJavaScript(HISTORY_HOME_SCRIPT);
155587
- }, [hasWebBackEvent, webBackHandlersRef, logging, webViewRef]);
155574
+ (_webViewRef$current2 = webViewRef.current) == null ? void 0 : _webViewRef$current2.injectJavaScript(`
155575
+ (function() {
155576
+ const webBundleOrigin = '${webViewInitialURL.origin}';
155577
+ window.location.href = window.location.origin === webBundleOrigin ? '/' : webBundleOrigin;
155578
+ })();
155579
+ `);
155580
+ }, [hasWebBackEvent, webBackHandlersRef, logging, webViewInitialURL, webViewRef]);
155588
155581
  return (0, import_react25.useMemo)(function () {
155589
155582
  return {
155590
155583
  addEventListener: addEventListener,
@@ -155919,10 +155912,10 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
155919
155912
  }
155920
155913
  return baseUrl;
155921
155914
  }
155922
- function getWebViewUri(local) {
155915
+ function getWebViewURL(local) {
155923
155916
  if (__DEV__) {
155924
155917
  var devUrl = `http://${local.host}:${local.port}`;
155925
- return mergeSchemeQueryParamsInto(devUrl).toString();
155918
+ return mergeSchemeQueryParamsInto(devUrl);
155926
155919
  }
155927
155920
  var _import_native_module = import_native_modules23.AppsInTossModule.getWebBundleURL({}),
155928
155921
  rawUrl = _import_native_module.url;
@@ -155931,7 +155924,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
155931
155924
  if (deploymentId) {
155932
155925
  url.searchParams.set("_deploymentId", deploymentId);
155933
155926
  }
155934
- return url.toString();
155927
+ return url;
155935
155928
  }
155936
155929
  function _WebView(_ref83) {
155937
155930
  var type = _ref83.type,
@@ -155942,10 +155935,10 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
155942
155935
  throw new Error(`Invalid WebView type: '${type}'`);
155943
155936
  }
155944
155937
  var webViewRef = (0, import_react28.useRef)(null);
155945
- var webBackHandler = useWebBackHandler(webViewRef);
155946
- var uri = (0, import_react28.useMemo)(function () {
155947
- return getWebViewUri(local);
155938
+ var url = (0, import_react28.useMemo)(function () {
155939
+ return getWebViewURL(local);
155948
155940
  }, [local]);
155941
+ var webBackHandler = useWebBackHandler(url, webViewRef);
155949
155942
  var top = (0, import_private9.useSafeAreaTop)();
155950
155943
  var bottom = (0, import_private9.useSafeAreaBottom)();
155951
155944
  var insets = (0, import_react_native_safe_area_context4.useSafeAreaInsets)();
@@ -156119,7 +156112,7 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156119
156112
  ref: refs
156120
156113
  }, props, headerPropForExternalWebView, {
156121
156114
  source: {
156122
- uri: uri,
156115
+ uri: url.href,
156123
156116
  headers: {
156124
156117
  "User-Agent": userAgent
156125
156118
  }
@@ -156144,12 +156137,12 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156144
156137
  allowsBackForwardNavigationGestures: allowsBackForwardNavigationGestures,
156145
156138
  onShouldStartLoadWithRequest: function onShouldStartLoadWithRequest(event) {
156146
156139
  try {
156147
- var url = new URL(event.url);
156148
- if (["https:", "http:"].includes(url.protocol) || url.href === "about:blank") {
156140
+ var url2 = new URL(event.url);
156141
+ if (["https:", "http:"].includes(url2.protocol) || url2.href === "about:blank") {
156149
156142
  return true;
156150
156143
  } else {
156151
156144
  var _convertIntentURL;
156152
- import_react_native39.Linking.openURL((_convertIntentURL = convertIntentURL(url)) != null ? _convertIntentURL : url.href);
156145
+ import_react_native39.Linking.openURL((_convertIntentURL = convertIntentURL(url2)) != null ? _convertIntentURL : url2.href);
156153
156146
  return false;
156154
156147
  }
156155
156148
  } catch (error) {
@@ -46568,7 +46568,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46568
46568
  canGoForward
46569
46569
  };
46570
46570
  }
46571
- function useWebBackHandler(webViewRef) {
46571
+ function useWebBackHandler(webViewInitialURL, webViewRef) {
46572
46572
  var captureExitLog = useCaptureExitLog().captureExitLog;
46573
46573
  var _useWebViewHistory = useWebViewHistory(), hasHistory = _useWebViewHistory.hasHistory, onNavigationStateChange = _useWebViewHistory.onNavigationStateChange;
46574
46574
  var _useBackEventState = useBackEventState(), webBackHandlersRef = _useBackEventState.handlersRef, hasWebBackEvent = _useBackEventState.hasBackEvent, addWebBackEventListener = _useBackEventState.addEventListener, removeWebBackEventListener = _useBackEventState.removeEventListener;
@@ -46619,7 +46619,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46619
46619
  3,
46620
46620
  1
46621
46621
  ];
46622
- (_webViewRef_current = webViewRef.current) === null || _webViewRef_current === void 0 ? void 0 : _webViewRef_current.injectJavaScript(HISTORY_BACK_SCRIPT);
46622
+ (_webViewRef_current = webViewRef.current) === null || _webViewRef_current === void 0 ? void 0 : _webViewRef_current.injectJavaScript("window.history.back();");
46623
46623
  return [
46624
46624
  3,
46625
46625
  3
@@ -46685,11 +46685,12 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46685
46685
  }
46686
46686
  return;
46687
46687
  }
46688
- (_webViewRef_current = webViewRef.current) === null || _webViewRef_current === void 0 ? void 0 : _webViewRef_current.injectJavaScript(HISTORY_HOME_SCRIPT);
46688
+ (_webViewRef_current = webViewRef.current) === null || _webViewRef_current === void 0 ? void 0 : _webViewRef_current.injectJavaScript("\n (function() {\n const webBundleOrigin = '".concat(webViewInitialURL.origin, "';\n window.location.href = window.location.origin === webBundleOrigin ? '/' : webBundleOrigin;\n })();\n "));
46689
46689
  }, [
46690
46690
  hasWebBackEvent,
46691
46691
  webBackHandlersRef,
46692
46692
  logging,
46693
+ webViewInitialURL,
46693
46694
  webViewRef
46694
46695
  ]);
46695
46696
  return (0, import_react233.useMemo)(function() {
@@ -46955,10 +46956,10 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46955
46956
  }
46956
46957
  return baseUrl;
46957
46958
  }
46958
- function getWebViewUri(local) {
46959
+ function getWebViewURL(local) {
46959
46960
  if (false) {
46960
46961
  var devUrl = "http://".concat(local.host, ":").concat(local.port);
46961
- return mergeSchemeQueryParamsInto(devUrl).toString();
46962
+ return mergeSchemeQueryParamsInto(devUrl);
46962
46963
  }
46963
46964
  var _AppsInTossModule_getWebBundleURL = AppsInTossModule.getWebBundleURL({}), rawUrl = _AppsInTossModule_getWebBundleURL.url;
46964
46965
  var url = mergeSchemeQueryParamsInto(rawUrl);
@@ -46966,7 +46967,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46966
46967
  if (deploymentId2) {
46967
46968
  url.searchParams.set("_deploymentId", deploymentId2);
46968
46969
  }
46969
- return url.toString();
46970
+ return url;
46970
46971
  }
46971
46972
  function WebView(_param) {
46972
46973
  var type = _param.type, local = _param.local, onMessage = _param.onMessage, props = _object_without_properties(_param, [
@@ -46978,12 +46979,12 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46978
46979
  throw new Error("Invalid WebView type: '".concat(type, "'"));
46979
46980
  }
46980
46981
  var webViewRef = (0, import_react226.useRef)(null);
46981
- var webBackHandler = useWebBackHandler(webViewRef);
46982
- var uri = (0, import_react226.useMemo)(function() {
46983
- return getWebViewUri(local);
46982
+ var url = (0, import_react226.useMemo)(function() {
46983
+ return getWebViewURL(local);
46984
46984
  }, [
46985
46985
  local
46986
46986
  ]);
46987
+ var webBackHandler = useWebBackHandler(url, webViewRef);
46987
46988
  var top = useSafeAreaTop();
46988
46989
  var bottom = useSafeAreaBottom();
46989
46990
  var insets = (0, react_native_safe_area_context_exports.useSafeAreaInsets)();
@@ -47173,7 +47174,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
47173
47174
  ref: refs
47174
47175
  }, props, headerPropForExternalWebView), {
47175
47176
  source: {
47176
- uri,
47177
+ uri: url.href,
47177
47178
  // NOTE: https://github.com/react-native-webview/react-native-webview/pull/3133
47178
47179
  headers: {
47179
47180
  "User-Agent": userAgent
@@ -47200,15 +47201,15 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
47200
47201
  allowsBackForwardNavigationGestures,
47201
47202
  onShouldStartLoadWithRequest: function(event) {
47202
47203
  try {
47203
- var url = new URL(event.url);
47204
+ var url2 = new URL(event.url);
47204
47205
  if ([
47205
47206
  "https:",
47206
47207
  "http:"
47207
- ].includes(url.protocol) || url.href === "about:blank") {
47208
+ ].includes(url2.protocol) || url2.href === "about:blank") {
47208
47209
  return true;
47209
47210
  } else {
47210
47211
  var _convertIntentURL;
47211
- import_react_native221.Linking.openURL((_convertIntentURL = convertIntentURL(url)) !== null && _convertIntentURL !== void 0 ? _convertIntentURL : url.href);
47212
+ import_react_native221.Linking.openURL((_convertIntentURL = convertIntentURL(url2)) !== null && _convertIntentURL !== void 0 ? _convertIntentURL : url2.href);
47212
47213
  return false;
47213
47214
  }
47214
47215
  } catch (error) {
@@ -47246,7 +47247,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
47246
47247
  return typeof script === "string";
47247
47248
  }).join("\n");
47248
47249
  }
47249
- var import_react_native197, import_react209, import_react210, import_react211, import_react212, import_jsx_runtime218, import_react213, import_jsx_runtime219, import_react214, import_react_native203, import_react215, import_react_native205, import_react216, import_react_native207, import_react217, import_react218, import_react219, import_react220, import_jsx_runtime220, import_jsx_runtime221, import_react221, import_react_native210, import_react222, import_react223, import_react224, import_react_native215, import_react_native216, import_jsx_runtime222, import_jsx_runtime223, import_jsx_runtime224, import_jsx_runtime225, import_react225, import_jsx_runtime226, import_jsx_runtime227, import_react_native219, import_jsx_runtime228, import_jsx_runtime229, import_jsx_runtime230, import_react226, import_react_native221, import_react227, import_react_native222, import_react228, import_react_native224, import_jsx_runtime231, import_jsx_runtime232, import_react229, import_react230, import_jsx_runtime233, import_jsx_runtime234, import_react231, import_react232, import_react233, import_react234, import_react_native230, import_react235, import_react236, import_jsx_runtime235, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __hasOwnProp2, __copyProps2, __reExport2, env, EXIT_IMPRESSION_LOG_NAME, EXIT_IMPRESSION_SCHEMA_ID, ENTRY_APP_EVENT_SCHEMA_ID, AppEvent, UPDATE_SCHEME, NavigationBarContext, GAME_PROFILE_WEBVIEW_URL, GAME_MIN_VERSION, PLAYSTORE_LINK, APPSTORE_LINK, getMarketLink, UPDATE_DIALOG_SCHEMA_ID, UPDATE_DIALOG_LOG_NAME, UPDATE_DIALOG_CTA_CLICK_SCHEMA_ID, UPDATE_DIALOG_CTA_CLICK_LOG_NAME, DEFAULT_ERROR, useErrorAlert, INTERNAL__onVisibilityChangedByTransparentServiceWeb, openTransparentWebView, useTransparentWebview, useGameProfileToast, useGameCenterProfile, Z_INDEX, GameInitializer, overlayStyle, NAVI_BAR_IMPRESSION_SCHEMA_ID, NAVI_BAR_IMPRESSION_LOG_NAME, CLOSE_POPUP_SHOW_SCHEMA_ID, CLOSE_POPUP_SHOW_LOG_NAME, CLOSE_BUTTON_CLICK_SCHEMA_ID, CLOSE_BUTTON_CLICK_LOG_NAME, CLOSE_POPUP_CTA_CLICK_SCHEMA_ID, CLOSE_POPUP_CTA_CLICK_LOG_NAME, HOME_BUTTON_CLICK_SCHEMA_ID, HOME_BUTTON_CLICK_LOG_NAME, BOTTOM_SHEET_SCHEMA_ID, BOTTOM_SHEET_LOG_NAME, BOTTOM_SHEET_OPEN_SCHEMA_ID, BOTTOM_SHEET_OPEN_LOG_NAME, BOTTOM_SHEET_CLOSE_CLICK_SCHEMA_ID, BOTTOM_SHEET_CLOSE_CLICK_LOG_NAME, BOTTOM_SHEET_MENU_CLICK_SCHEMA_ID, BOTTOM_SHEET_MENU_CLICK_LOG_NAME, iconNameRegExp, iconURLRegExp, SHARE_SCHEME_REFERRER, APP_SHARE_MENU_INFO, APP_BRIDGE_METHOD_NAME, MIN_VERSION, RNNavigationBar, bridge_entry_exports, AppsInToss, GameWebView, PartnerWebView, sessionId, ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION, IOS_FETCH_TOSS_AD_SUPPORTED_VERSION, UNSUPPORTED_ERROR_MESSAGE3, ENVIRONMENT3, OPERATIONAL_ENVIRONMENT, OS, APP_VER, ALPHA_EVENT_TRACKER_HTTP_ENDPOINT, LIVE_EVENT_TRACKER_HTTP_ENDPOINT, INTEGRATED_AD_SDK_VERSION, ANDROID_INTEGRATED_AD_SUPPORTED_VERSION, IOS_INTEGRATED_AD_SUPPORTED_VERSION, UNSUPPORTED_ERROR_MESSAGE22, INTG_AD_ADM_FALLBACK_RID_MAP, loadFullScreenAd, loadFullScreenAdForWeb, globalEventListenerMap, EventEmitter, INITIAL_STATE, HISTORY_BACK_SCRIPT, HISTORY_HOME_SCRIPT, FontA11yCategory, androidFontScaleMap, iosScaleToAndroidScale, extractDateFromUUIDv7, getGroupId, getReferrer22, trackScreen, operationalEnvironment, TYPES, WEBVIEW_TYPES, Analytics2;
47250
+ var import_react_native197, import_react209, import_react210, import_react211, import_react212, import_jsx_runtime218, import_react213, import_jsx_runtime219, import_react214, import_react_native203, import_react215, import_react_native205, import_react216, import_react_native207, import_react217, import_react218, import_react219, import_react220, import_jsx_runtime220, import_jsx_runtime221, import_react221, import_react_native210, import_react222, import_react223, import_react224, import_react_native215, import_react_native216, import_jsx_runtime222, import_jsx_runtime223, import_jsx_runtime224, import_jsx_runtime225, import_react225, import_jsx_runtime226, import_jsx_runtime227, import_react_native219, import_jsx_runtime228, import_jsx_runtime229, import_jsx_runtime230, import_react226, import_react_native221, import_react227, import_react_native222, import_react228, import_react_native224, import_jsx_runtime231, import_jsx_runtime232, import_react229, import_react230, import_jsx_runtime233, import_jsx_runtime234, import_react231, import_react232, import_react233, import_react234, import_react_native230, import_react235, import_react236, import_jsx_runtime235, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __hasOwnProp2, __copyProps2, __reExport2, env, EXIT_IMPRESSION_LOG_NAME, EXIT_IMPRESSION_SCHEMA_ID, ENTRY_APP_EVENT_SCHEMA_ID, AppEvent, UPDATE_SCHEME, NavigationBarContext, GAME_PROFILE_WEBVIEW_URL, GAME_MIN_VERSION, PLAYSTORE_LINK, APPSTORE_LINK, getMarketLink, UPDATE_DIALOG_SCHEMA_ID, UPDATE_DIALOG_LOG_NAME, UPDATE_DIALOG_CTA_CLICK_SCHEMA_ID, UPDATE_DIALOG_CTA_CLICK_LOG_NAME, DEFAULT_ERROR, useErrorAlert, INTERNAL__onVisibilityChangedByTransparentServiceWeb, openTransparentWebView, useTransparentWebview, useGameProfileToast, useGameCenterProfile, Z_INDEX, GameInitializer, overlayStyle, NAVI_BAR_IMPRESSION_SCHEMA_ID, NAVI_BAR_IMPRESSION_LOG_NAME, CLOSE_POPUP_SHOW_SCHEMA_ID, CLOSE_POPUP_SHOW_LOG_NAME, CLOSE_BUTTON_CLICK_SCHEMA_ID, CLOSE_BUTTON_CLICK_LOG_NAME, CLOSE_POPUP_CTA_CLICK_SCHEMA_ID, CLOSE_POPUP_CTA_CLICK_LOG_NAME, HOME_BUTTON_CLICK_SCHEMA_ID, HOME_BUTTON_CLICK_LOG_NAME, BOTTOM_SHEET_SCHEMA_ID, BOTTOM_SHEET_LOG_NAME, BOTTOM_SHEET_OPEN_SCHEMA_ID, BOTTOM_SHEET_OPEN_LOG_NAME, BOTTOM_SHEET_CLOSE_CLICK_SCHEMA_ID, BOTTOM_SHEET_CLOSE_CLICK_LOG_NAME, BOTTOM_SHEET_MENU_CLICK_SCHEMA_ID, BOTTOM_SHEET_MENU_CLICK_LOG_NAME, iconNameRegExp, iconURLRegExp, SHARE_SCHEME_REFERRER, APP_SHARE_MENU_INFO, APP_BRIDGE_METHOD_NAME, MIN_VERSION, RNNavigationBar, bridge_entry_exports, AppsInToss, GameWebView, PartnerWebView, sessionId, ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION, IOS_FETCH_TOSS_AD_SUPPORTED_VERSION, UNSUPPORTED_ERROR_MESSAGE3, ENVIRONMENT3, OPERATIONAL_ENVIRONMENT, OS, APP_VER, ALPHA_EVENT_TRACKER_HTTP_ENDPOINT, LIVE_EVENT_TRACKER_HTTP_ENDPOINT, INTEGRATED_AD_SDK_VERSION, ANDROID_INTEGRATED_AD_SUPPORTED_VERSION, IOS_INTEGRATED_AD_SUPPORTED_VERSION, UNSUPPORTED_ERROR_MESSAGE22, INTG_AD_ADM_FALLBACK_RID_MAP, loadFullScreenAd, loadFullScreenAdForWeb, globalEventListenerMap, EventEmitter, INITIAL_STATE, FontA11yCategory, androidFontScaleMap, iosScaleToAndroidScale, extractDateFromUUIDv7, getGroupId, getReferrer22, trackScreen, operationalEnvironment, TYPES, WEBVIEW_TYPES, Analytics2;
47250
47251
  var init_dist8 = __esm({
47251
47252
  "../../../.yarn/__virtual__/@apps-in-toss-framework-virtual-afbad361af/1/packages/apps-in-toss/framework/dist/index.js"() {
47252
47253
  "use strict";
@@ -48078,8 +48079,6 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
48078
48079
  stack: [],
48079
48080
  index: -1
48080
48081
  };
48081
- HISTORY_BACK_SCRIPT = "\n(function() {\n window.history.back();\n true;\n})();\n";
48082
- HISTORY_HOME_SCRIPT = "\n (function() {\n window.location.href = '/';\n true;\n })();\n";
48083
48082
  FontA11yCategory = {
48084
48083
  Large: "Large",
48085
48084
  xLarge: "xLarge",
@@ -46577,7 +46577,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46577
46577
  canGoForward
46578
46578
  };
46579
46579
  }
46580
- function useWebBackHandler(webViewRef) {
46580
+ function useWebBackHandler(webViewInitialURL, webViewRef) {
46581
46581
  var captureExitLog = useCaptureExitLog().captureExitLog;
46582
46582
  var _useWebViewHistory = useWebViewHistory(), hasHistory = _useWebViewHistory.hasHistory, onNavigationStateChange = _useWebViewHistory.onNavigationStateChange;
46583
46583
  var _useBackEventState = useBackEventState(), webBackHandlersRef = _useBackEventState.handlersRef, hasWebBackEvent = _useBackEventState.hasBackEvent, addWebBackEventListener = _useBackEventState.addEventListener, removeWebBackEventListener = _useBackEventState.removeEventListener;
@@ -46628,7 +46628,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46628
46628
  3,
46629
46629
  1
46630
46630
  ];
46631
- (_webViewRef_current = webViewRef.current) === null || _webViewRef_current === void 0 ? void 0 : _webViewRef_current.injectJavaScript(HISTORY_BACK_SCRIPT);
46631
+ (_webViewRef_current = webViewRef.current) === null || _webViewRef_current === void 0 ? void 0 : _webViewRef_current.injectJavaScript("window.history.back();");
46632
46632
  return [
46633
46633
  3,
46634
46634
  3
@@ -46694,11 +46694,12 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46694
46694
  }
46695
46695
  return;
46696
46696
  }
46697
- (_webViewRef_current = webViewRef.current) === null || _webViewRef_current === void 0 ? void 0 : _webViewRef_current.injectJavaScript(HISTORY_HOME_SCRIPT);
46697
+ (_webViewRef_current = webViewRef.current) === null || _webViewRef_current === void 0 ? void 0 : _webViewRef_current.injectJavaScript("\n (function() {\n const webBundleOrigin = '".concat(webViewInitialURL.origin, "';\n window.location.href = window.location.origin === webBundleOrigin ? '/' : webBundleOrigin;\n })();\n "));
46698
46698
  }, [
46699
46699
  hasWebBackEvent,
46700
46700
  webBackHandlersRef,
46701
46701
  logging,
46702
+ webViewInitialURL,
46702
46703
  webViewRef
46703
46704
  ]);
46704
46705
  return (0, import_react234.useMemo)(function() {
@@ -46964,10 +46965,10 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46964
46965
  }
46965
46966
  return baseUrl;
46966
46967
  }
46967
- function getWebViewUri(local) {
46968
+ function getWebViewURL(local) {
46968
46969
  if (false) {
46969
46970
  var devUrl = "http://".concat(local.host, ":").concat(local.port);
46970
- return mergeSchemeQueryParamsInto(devUrl).toString();
46971
+ return mergeSchemeQueryParamsInto(devUrl);
46971
46972
  }
46972
46973
  var _AppsInTossModule_getWebBundleURL = AppsInTossModule.getWebBundleURL({}), rawUrl = _AppsInTossModule_getWebBundleURL.url;
46973
46974
  var url = mergeSchemeQueryParamsInto(rawUrl);
@@ -46975,7 +46976,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46975
46976
  if (deploymentId2) {
46976
46977
  url.searchParams.set("_deploymentId", deploymentId2);
46977
46978
  }
46978
- return url.toString();
46979
+ return url;
46979
46980
  }
46980
46981
  function WebView(_param) {
46981
46982
  var type = _param.type, local = _param.local, onMessage = _param.onMessage, props = _object_without_properties(_param, [
@@ -46987,12 +46988,12 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46987
46988
  throw new Error("Invalid WebView type: '".concat(type, "'"));
46988
46989
  }
46989
46990
  var webViewRef = (0, import_react227.useRef)(null);
46990
- var webBackHandler = useWebBackHandler(webViewRef);
46991
- var uri = (0, import_react227.useMemo)(function() {
46992
- return getWebViewUri(local);
46991
+ var url = (0, import_react227.useMemo)(function() {
46992
+ return getWebViewURL(local);
46993
46993
  }, [
46994
46994
  local
46995
46995
  ]);
46996
+ var webBackHandler = useWebBackHandler(url, webViewRef);
46996
46997
  var top = useSafeAreaTop();
46997
46998
  var bottom = useSafeAreaBottom();
46998
46999
  var insets = (0, react_native_safe_area_context_exports.useSafeAreaInsets)();
@@ -47182,7 +47183,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
47182
47183
  ref: refs
47183
47184
  }, props, headerPropForExternalWebView), {
47184
47185
  source: {
47185
- uri,
47186
+ uri: url.href,
47186
47187
  // NOTE: https://github.com/react-native-webview/react-native-webview/pull/3133
47187
47188
  headers: {
47188
47189
  "User-Agent": userAgent
@@ -47209,15 +47210,15 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
47209
47210
  allowsBackForwardNavigationGestures,
47210
47211
  onShouldStartLoadWithRequest: function(event) {
47211
47212
  try {
47212
- var url = new URL(event.url);
47213
+ var url2 = new URL(event.url);
47213
47214
  if ([
47214
47215
  "https:",
47215
47216
  "http:"
47216
- ].includes(url.protocol) || url.href === "about:blank") {
47217
+ ].includes(url2.protocol) || url2.href === "about:blank") {
47217
47218
  return true;
47218
47219
  } else {
47219
47220
  var _convertIntentURL;
47220
- import_react_native221.Linking.openURL((_convertIntentURL = convertIntentURL(url)) !== null && _convertIntentURL !== void 0 ? _convertIntentURL : url.href);
47221
+ import_react_native221.Linking.openURL((_convertIntentURL = convertIntentURL(url2)) !== null && _convertIntentURL !== void 0 ? _convertIntentURL : url2.href);
47221
47222
  return false;
47222
47223
  }
47223
47224
  } catch (error) {
@@ -47255,7 +47256,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
47255
47256
  return typeof script === "string";
47256
47257
  }).join("\n");
47257
47258
  }
47258
- var import_react_native197, import_react210, import_react211, import_react212, import_react213, import_jsx_runtime218, import_react214, import_jsx_runtime219, import_react215, import_react_native203, import_react216, import_react_native205, import_react217, import_react_native207, import_react218, import_react219, import_react220, import_react221, import_jsx_runtime220, import_jsx_runtime221, import_react222, import_react_native210, import_react223, import_react224, import_react225, import_react_native215, import_react_native216, import_jsx_runtime222, import_jsx_runtime223, import_jsx_runtime224, import_jsx_runtime225, import_react226, import_jsx_runtime226, import_jsx_runtime227, import_react_native219, import_jsx_runtime228, import_jsx_runtime229, import_jsx_runtime230, import_react227, import_react_native221, import_react228, import_react_native222, import_react229, import_react_native224, import_jsx_runtime231, import_jsx_runtime232, import_react230, import_react231, import_jsx_runtime233, import_jsx_runtime234, import_react232, import_react233, import_react234, import_react235, import_react_native230, import_react236, import_react237, import_jsx_runtime235, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __hasOwnProp2, __copyProps2, __reExport2, env, EXIT_IMPRESSION_LOG_NAME, EXIT_IMPRESSION_SCHEMA_ID, ENTRY_APP_EVENT_SCHEMA_ID, AppEvent, UPDATE_SCHEME, NavigationBarContext, GAME_PROFILE_WEBVIEW_URL, GAME_MIN_VERSION, PLAYSTORE_LINK, APPSTORE_LINK, getMarketLink, UPDATE_DIALOG_SCHEMA_ID, UPDATE_DIALOG_LOG_NAME, UPDATE_DIALOG_CTA_CLICK_SCHEMA_ID, UPDATE_DIALOG_CTA_CLICK_LOG_NAME, DEFAULT_ERROR, useErrorAlert, INTERNAL__onVisibilityChangedByTransparentServiceWeb, openTransparentWebView, useTransparentWebview, useGameProfileToast, useGameCenterProfile, Z_INDEX, GameInitializer, overlayStyle, NAVI_BAR_IMPRESSION_SCHEMA_ID, NAVI_BAR_IMPRESSION_LOG_NAME, CLOSE_POPUP_SHOW_SCHEMA_ID, CLOSE_POPUP_SHOW_LOG_NAME, CLOSE_BUTTON_CLICK_SCHEMA_ID, CLOSE_BUTTON_CLICK_LOG_NAME, CLOSE_POPUP_CTA_CLICK_SCHEMA_ID, CLOSE_POPUP_CTA_CLICK_LOG_NAME, HOME_BUTTON_CLICK_SCHEMA_ID, HOME_BUTTON_CLICK_LOG_NAME, BOTTOM_SHEET_SCHEMA_ID, BOTTOM_SHEET_LOG_NAME, BOTTOM_SHEET_OPEN_SCHEMA_ID, BOTTOM_SHEET_OPEN_LOG_NAME, BOTTOM_SHEET_CLOSE_CLICK_SCHEMA_ID, BOTTOM_SHEET_CLOSE_CLICK_LOG_NAME, BOTTOM_SHEET_MENU_CLICK_SCHEMA_ID, BOTTOM_SHEET_MENU_CLICK_LOG_NAME, iconNameRegExp, iconURLRegExp, SHARE_SCHEME_REFERRER, APP_SHARE_MENU_INFO, APP_BRIDGE_METHOD_NAME, MIN_VERSION, RNNavigationBar, bridge_entry_exports, AppsInToss, GameWebView, PartnerWebView, sessionId, ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION, IOS_FETCH_TOSS_AD_SUPPORTED_VERSION, UNSUPPORTED_ERROR_MESSAGE3, ENVIRONMENT3, OPERATIONAL_ENVIRONMENT, OS, APP_VER, ALPHA_EVENT_TRACKER_HTTP_ENDPOINT, LIVE_EVENT_TRACKER_HTTP_ENDPOINT, INTEGRATED_AD_SDK_VERSION, ANDROID_INTEGRATED_AD_SUPPORTED_VERSION, IOS_INTEGRATED_AD_SUPPORTED_VERSION, UNSUPPORTED_ERROR_MESSAGE22, INTG_AD_ADM_FALLBACK_RID_MAP, loadFullScreenAd, loadFullScreenAdForWeb, globalEventListenerMap, EventEmitter, INITIAL_STATE, HISTORY_BACK_SCRIPT, HISTORY_HOME_SCRIPT, FontA11yCategory, androidFontScaleMap, iosScaleToAndroidScale, extractDateFromUUIDv7, getGroupId, getReferrer22, trackScreen, operationalEnvironment, TYPES, WEBVIEW_TYPES, Analytics2;
47259
+ var import_react_native197, import_react210, import_react211, import_react212, import_react213, import_jsx_runtime218, import_react214, import_jsx_runtime219, import_react215, import_react_native203, import_react216, import_react_native205, import_react217, import_react_native207, import_react218, import_react219, import_react220, import_react221, import_jsx_runtime220, import_jsx_runtime221, import_react222, import_react_native210, import_react223, import_react224, import_react225, import_react_native215, import_react_native216, import_jsx_runtime222, import_jsx_runtime223, import_jsx_runtime224, import_jsx_runtime225, import_react226, import_jsx_runtime226, import_jsx_runtime227, import_react_native219, import_jsx_runtime228, import_jsx_runtime229, import_jsx_runtime230, import_react227, import_react_native221, import_react228, import_react_native222, import_react229, import_react_native224, import_jsx_runtime231, import_jsx_runtime232, import_react230, import_react231, import_jsx_runtime233, import_jsx_runtime234, import_react232, import_react233, import_react234, import_react235, import_react_native230, import_react236, import_react237, import_jsx_runtime235, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __hasOwnProp2, __copyProps2, __reExport2, env, EXIT_IMPRESSION_LOG_NAME, EXIT_IMPRESSION_SCHEMA_ID, ENTRY_APP_EVENT_SCHEMA_ID, AppEvent, UPDATE_SCHEME, NavigationBarContext, GAME_PROFILE_WEBVIEW_URL, GAME_MIN_VERSION, PLAYSTORE_LINK, APPSTORE_LINK, getMarketLink, UPDATE_DIALOG_SCHEMA_ID, UPDATE_DIALOG_LOG_NAME, UPDATE_DIALOG_CTA_CLICK_SCHEMA_ID, UPDATE_DIALOG_CTA_CLICK_LOG_NAME, DEFAULT_ERROR, useErrorAlert, INTERNAL__onVisibilityChangedByTransparentServiceWeb, openTransparentWebView, useTransparentWebview, useGameProfileToast, useGameCenterProfile, Z_INDEX, GameInitializer, overlayStyle, NAVI_BAR_IMPRESSION_SCHEMA_ID, NAVI_BAR_IMPRESSION_LOG_NAME, CLOSE_POPUP_SHOW_SCHEMA_ID, CLOSE_POPUP_SHOW_LOG_NAME, CLOSE_BUTTON_CLICK_SCHEMA_ID, CLOSE_BUTTON_CLICK_LOG_NAME, CLOSE_POPUP_CTA_CLICK_SCHEMA_ID, CLOSE_POPUP_CTA_CLICK_LOG_NAME, HOME_BUTTON_CLICK_SCHEMA_ID, HOME_BUTTON_CLICK_LOG_NAME, BOTTOM_SHEET_SCHEMA_ID, BOTTOM_SHEET_LOG_NAME, BOTTOM_SHEET_OPEN_SCHEMA_ID, BOTTOM_SHEET_OPEN_LOG_NAME, BOTTOM_SHEET_CLOSE_CLICK_SCHEMA_ID, BOTTOM_SHEET_CLOSE_CLICK_LOG_NAME, BOTTOM_SHEET_MENU_CLICK_SCHEMA_ID, BOTTOM_SHEET_MENU_CLICK_LOG_NAME, iconNameRegExp, iconURLRegExp, SHARE_SCHEME_REFERRER, APP_SHARE_MENU_INFO, APP_BRIDGE_METHOD_NAME, MIN_VERSION, RNNavigationBar, bridge_entry_exports, AppsInToss, GameWebView, PartnerWebView, sessionId, ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION, IOS_FETCH_TOSS_AD_SUPPORTED_VERSION, UNSUPPORTED_ERROR_MESSAGE3, ENVIRONMENT3, OPERATIONAL_ENVIRONMENT, OS, APP_VER, ALPHA_EVENT_TRACKER_HTTP_ENDPOINT, LIVE_EVENT_TRACKER_HTTP_ENDPOINT, INTEGRATED_AD_SDK_VERSION, ANDROID_INTEGRATED_AD_SUPPORTED_VERSION, IOS_INTEGRATED_AD_SUPPORTED_VERSION, UNSUPPORTED_ERROR_MESSAGE22, INTG_AD_ADM_FALLBACK_RID_MAP, loadFullScreenAd, loadFullScreenAdForWeb, globalEventListenerMap, EventEmitter, INITIAL_STATE, FontA11yCategory, androidFontScaleMap, iosScaleToAndroidScale, extractDateFromUUIDv7, getGroupId, getReferrer22, trackScreen, operationalEnvironment, TYPES, WEBVIEW_TYPES, Analytics2;
47259
47260
  var init_dist8 = __esm({
47260
47261
  "../../../.yarn/__virtual__/@apps-in-toss-framework-virtual-afbad361af/1/packages/apps-in-toss/framework/dist/index.js"() {
47261
47262
  "use strict";
@@ -48087,8 +48088,6 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
48087
48088
  stack: [],
48088
48089
  index: -1
48089
48090
  };
48090
- HISTORY_BACK_SCRIPT = "\n(function() {\n window.history.back();\n true;\n})();\n";
48091
- HISTORY_HOME_SCRIPT = "\n (function() {\n window.location.href = '/';\n true;\n })();\n";
48092
48091
  FontA11yCategory = {
48093
48092
  Large: "Large",
48094
48093
  xLarge: "xLarge",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apps-in-toss/web-framework",
3
3
  "type": "module",
4
- "version": "1.8.0",
4
+ "version": "1.8.1",
5
5
  "description": "Web Framework for Apps In Toss",
6
6
  "scripts": {
7
7
  "typecheck": "tsc --noEmit",
@@ -86,12 +86,12 @@
86
86
  "zod": "3.24.4"
87
87
  },
88
88
  "dependencies": {
89
- "@apps-in-toss/bridge-core": "1.8.0",
90
- "@apps-in-toss/cli": "1.8.0",
91
- "@apps-in-toss/framework": "1.8.0",
92
- "@apps-in-toss/plugins": "1.8.0",
93
- "@apps-in-toss/web-analytics": "1.8.0",
94
- "@apps-in-toss/web-bridge": "1.8.0",
89
+ "@apps-in-toss/bridge-core": "1.8.1",
90
+ "@apps-in-toss/cli": "1.8.1",
91
+ "@apps-in-toss/framework": "1.8.1",
92
+ "@apps-in-toss/plugins": "1.8.1",
93
+ "@apps-in-toss/web-analytics": "1.8.1",
94
+ "@apps-in-toss/web-bridge": "1.8.1",
95
95
  "@babel/core": "7.23.9",
96
96
  "@granite-js/cli": "0.1.31",
97
97
  "@granite-js/mpack": "0.1.31",