@apps-in-toss/web-framework 1.13.0 → 1.14.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.
@@ -45303,6 +45303,23 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
45303
45303
  openConfirm
45304
45304
  ]);
45305
45305
  }
45306
+ function createEvent(event) {
45307
+ return {
45308
+ name: event,
45309
+ subscribe: function(listener) {
45310
+ return eventEmitter.subscribe(event, listener);
45311
+ },
45312
+ hasSubscriptions: function() {
45313
+ return eventEmitter.hasSubscriptions(event);
45314
+ },
45315
+ clearSubscriptions: function() {
45316
+ return eventEmitter.clearSubscriptions(event);
45317
+ },
45318
+ emit: function(data) {
45319
+ return eventEmitter.emit(event, data);
45320
+ }
45321
+ };
45322
+ }
45306
45323
  function useNavigationBarLogging() {
45307
45324
  var referrer2 = useReferrer();
45308
45325
  var baseParams = {
@@ -45415,7 +45432,11 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
45415
45432
  },
45416
45433
  handleHomeButtonClick: function() {
45417
45434
  logging.homeButtonClick();
45418
- navigation.navigate("/");
45435
+ if (homeEvent.hasSubscriptions()) {
45436
+ homeEvent.emit({});
45437
+ } else {
45438
+ navigation.navigate("/");
45439
+ }
45419
45440
  },
45420
45441
  handleCloseButtonClick: function() {
45421
45442
  logging.closeButtonClick();
@@ -46651,23 +46672,19 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46651
46672
  return null;
46652
46673
  }
46653
46674
  }
46654
- function useSafeAreaInsetsEmitter() {
46675
+ function useSafeAreaInsetsEvent() {
46655
46676
  var insets = (0, react_native_safe_area_context_exports.useSafeAreaInsets)();
46656
- var emitter = (0, import_react232.useMemo)(function() {
46657
- return new EventEmitter();
46658
- }, []);
46659
46677
  (0, import_react232.useEffect)(function() {
46660
- emitter.emit("safeAreaInsetsChange", insets);
46661
- return function() {
46662
- emitter.off("safeAreaInsetsChange", function(listener) {
46663
- return listener(insets);
46664
- });
46665
- };
46678
+ safeAreaInsetsChange.emit(insets);
46666
46679
  }, [
46667
- emitter,
46668
46680
  insets
46669
46681
  ]);
46670
- return emitter;
46682
+ (0, import_react232.useEffect)(function() {
46683
+ return function() {
46684
+ return safeAreaInsetsChange.clearSubscriptions();
46685
+ };
46686
+ }, []);
46687
+ return safeAreaInsetsChange;
46671
46688
  }
46672
46689
  function reducer(state, action) {
46673
46690
  switch (action.type) {
@@ -46721,7 +46738,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46721
46738
  canGoForward: canGoForward2
46722
46739
  });
46723
46740
  }, []);
46724
- var _useMemo5 = (0, import_react234.useMemo)(function() {
46741
+ var _useMemo4 = (0, import_react234.useMemo)(function() {
46725
46742
  var canBack = state.index > 0;
46726
46743
  var canFwd = state.index >= 0 && state.index < state.stack.length - 1;
46727
46744
  return {
@@ -46731,7 +46748,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46731
46748
  }, [
46732
46749
  state.index,
46733
46750
  state.stack.length
46734
- ]), canGoBack = _useMemo5.canGoBack, canGoForward = _useMemo5.canGoForward;
46751
+ ]), canGoBack = _useMemo4.canGoBack, canGoForward = _useMemo4.canGoForward;
46735
46752
  return {
46736
46753
  onNavigationStateChange,
46737
46754
  hasHistory: canGoBack,
@@ -46832,27 +46849,8 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46832
46849
  var handleWebHome = (0, import_react233.useCallback)(function() {
46833
46850
  var _webViewRef_current;
46834
46851
  logging.homeButtonClick();
46835
- if (hasWebBackEvent) {
46836
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
46837
- try {
46838
- for (var _iterator = webBackHandlersRef[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
46839
- var handler = _step.value;
46840
- handler();
46841
- }
46842
- } catch (err) {
46843
- _didIteratorError = true;
46844
- _iteratorError = err;
46845
- } finally {
46846
- try {
46847
- if (!_iteratorNormalCompletion && _iterator.return != null) {
46848
- _iterator.return();
46849
- }
46850
- } finally {
46851
- if (_didIteratorError) {
46852
- throw _iteratorError;
46853
- }
46854
- }
46855
- }
46852
+ if (homeEvent.hasSubscriptions()) {
46853
+ homeEvent.emit({});
46856
46854
  return;
46857
46855
  }
46858
46856
  (_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 "));
@@ -47160,7 +47158,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
47160
47158
  var insets = (0, react_native_safe_area_context_exports.useSafeAreaInsets)();
47161
47159
  var global2 = getAppsInTossGlobals();
47162
47160
  var navigationBarContext = useNavigationBarContext();
47163
- var safeAreaInsetsEmitter = useSafeAreaInsetsEmitter();
47161
+ var safeAreaInsetsEvent = useSafeAreaInsetsEvent();
47164
47162
  var _useState6 = _sliced_to_array((0, import_react226.useState)(props.allowsBackForwardNavigationGestures), 2), allowsBackForwardNavigationGestures = _useState6[0], setAllowsBackForwardNavigationGestures = _useState6[1];
47165
47163
  var handler = useBridgeHandler({
47166
47164
  onMessage,
@@ -47179,6 +47177,10 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
47179
47177
  webBackHandler.removeEventListener(onEvent);
47180
47178
  };
47181
47179
  },
47180
+ homeEvent: function(param) {
47181
+ var onEvent = param.onEvent;
47182
+ return homeEvent.subscribe(onEvent);
47183
+ },
47182
47184
  updateLocationEvent: function(param) {
47183
47185
  var onEvent = param.onEvent, onError2 = param.onError, options = param.options;
47184
47186
  return appsInTossEvent.addEventListener("updateLocationEvent", {
@@ -47189,10 +47191,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
47189
47191
  },
47190
47192
  safeAreaInsetsChange: function(param) {
47191
47193
  var onEvent = param.onEvent;
47192
- safeAreaInsetsEmitter.on("safeAreaInsetsChange", onEvent);
47193
- return function() {
47194
- safeAreaInsetsEmitter.off("safeAreaInsetsChange", onEvent);
47195
- };
47194
+ return safeAreaInsetsEvent.subscribe(onEvent);
47196
47195
  },
47197
47196
  /** @internal */
47198
47197
  appBridgeCallbackEvent: function(param) {
@@ -47424,7 +47423,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
47424
47423
  onRenderProcessGone: handleWebViewProcessDidTerminate
47425
47424
  }));
47426
47425
  }
47427
- 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_react_native218, import_jsx_runtime224, import_jsx_runtime225, import_jsx_runtime226, import_react225, import_jsx_runtime227, import_jsx_runtime228, import_react_native220, import_jsx_runtime229, import_jsx_runtime230, import_jsx_runtime231, import_react226, import_react_native222, import_react227, import_react_native223, import_react228, import_react_native225, import_jsx_runtime232, import_jsx_runtime233, import_react229, import_react230, import_jsx_runtime234, import_jsx_runtime235, import_react231, import_react232, import_react233, import_react234, import_react_native231, import_react235, import_react236, import_jsx_runtime236, import_react237, import_react_native234, import_react238, import_react_native235, import_jsx_runtime237, import_react239, import_react_native236, import_jsx_runtime238, import_jsx_runtime239, __GlobalEventDeduplicator, __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, ERROR_CODES, _obj6, ERROR_MESSAGES, API_RESULT_ERROR_MAP, AD_STATUS_ERROR_MAP, GlobalEventDeduplicator, globalEventDeduplicator, styles3, styles22, styles32, Analytics2;
47426
+ 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_react_native218, import_jsx_runtime224, import_jsx_runtime225, import_jsx_runtime226, import_react225, import_jsx_runtime227, import_jsx_runtime228, import_react_native220, import_jsx_runtime229, import_jsx_runtime230, import_jsx_runtime231, import_react226, import_react_native222, import_react227, import_react_native223, import_react228, import_react_native225, import_jsx_runtime232, import_jsx_runtime233, import_react229, import_react230, import_jsx_runtime234, import_jsx_runtime235, import_react231, import_react232, import_react233, import_react234, import_react_native231, import_react235, import_react236, import_jsx_runtime236, import_react237, import_react_native234, import_react238, import_react_native235, import_jsx_runtime237, import_react239, import_react_native236, import_jsx_runtime238, import_jsx_runtime239, __GlobalEventDeduplicator, __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, EventEmitter, eventEmitter, homeEvent, safeAreaInsetsChange, 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, INITIAL_STATE, FontA11yCategory, androidFontScaleMap, iosScaleToAndroidScale, extractDateFromUUIDv7, getGroupId, getReferrer22, trackScreen, operationalEnvironment, TYPES, WEBVIEW_TYPES, ERROR_CODES, _obj6, ERROR_MESSAGES, API_RESULT_ERROR_MAP, AD_STATUS_ERROR_MAP, GlobalEventDeduplicator, globalEventDeduplicator, styles3, styles22, styles32, Analytics2;
47428
47427
  var init_dist9 = __esm({
47429
47428
  "../../../.yarn/__virtual__/@apps-in-toss-framework-virtual-afbad361af/1/packages/apps-in-toss/framework/dist/index.js"() {
47430
47429
  "use strict";
@@ -48101,6 +48100,62 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
48101
48100
  bottom: 0,
48102
48101
  zIndex: Z_INDEX.PROFILE_OVERLAY
48103
48102
  };
48103
+ EventEmitter = /* @__PURE__ */ function() {
48104
+ "use strict";
48105
+ function EventEmitter2() {
48106
+ _class_call_check(this, EventEmitter2);
48107
+ this.listeners = {};
48108
+ }
48109
+ _create_class(EventEmitter2, [
48110
+ {
48111
+ key: "subscribe",
48112
+ value: function subscribe(event, listener) {
48113
+ var _this = this;
48114
+ if (!this.listeners[event]) {
48115
+ this.listeners[event] = [];
48116
+ }
48117
+ this.listeners[event].push(listener);
48118
+ return function() {
48119
+ var _this_listeners_event;
48120
+ var _this_listeners_event_filter;
48121
+ _this.listeners[event] = (_this_listeners_event_filter = (_this_listeners_event = _this.listeners[event]) === null || _this_listeners_event === void 0 ? void 0 : _this_listeners_event.filter(function(l51) {
48122
+ return l51 !== listener;
48123
+ })) !== null && _this_listeners_event_filter !== void 0 ? _this_listeners_event_filter : [];
48124
+ };
48125
+ }
48126
+ },
48127
+ {
48128
+ key: "hasSubscriptions",
48129
+ value: function hasSubscriptions(event) {
48130
+ return this.listeners[event] != null && this.listeners[event].length > 0;
48131
+ }
48132
+ },
48133
+ {
48134
+ key: "clearSubscriptions",
48135
+ value: function clearSubscriptions(event) {
48136
+ this.listeners[event] = [];
48137
+ }
48138
+ },
48139
+ {
48140
+ key: "emit",
48141
+ value: function emit(event) {
48142
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
48143
+ args[_key - 1] = arguments[_key];
48144
+ }
48145
+ if (!this.listeners[event]) {
48146
+ return;
48147
+ }
48148
+ this.listeners[event].forEach(function(listener) {
48149
+ return listener.apply(void 0, _to_consumable_array(args));
48150
+ });
48151
+ }
48152
+ }
48153
+ ]);
48154
+ return EventEmitter2;
48155
+ }();
48156
+ eventEmitter = new EventEmitter();
48157
+ homeEvent = createEvent("homeEvent");
48158
+ safeAreaInsetsChange = createEvent("safeAreaInsetsChange");
48104
48159
  NAVI_BAR_IMPRESSION_SCHEMA_ID = 1596837;
48105
48160
  NAVI_BAR_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__navigation_bar";
48106
48161
  CLOSE_POPUP_SHOW_SCHEMA_ID = 1644490;
@@ -48232,50 +48287,6 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
48232
48287
  loadFullScreenAdForWeb = generateLoadFullScreenAd("107");
48233
48288
  showFullScreenAd.isSupported = GoogleAdMob.showAppsInTossAdMob.isSupported;
48234
48289
  globalEventListenerMap = /* @__PURE__ */ new Map();
48235
- EventEmitter = /* @__PURE__ */ function() {
48236
- "use strict";
48237
- function EventEmitter2() {
48238
- _class_call_check(this, EventEmitter2);
48239
- this.listeners = {};
48240
- }
48241
- _create_class(EventEmitter2, [
48242
- {
48243
- key: "on",
48244
- value: function on3(event, listener) {
48245
- if (!this.listeners[event]) {
48246
- this.listeners[event] = [];
48247
- }
48248
- this.listeners[event].push(listener);
48249
- }
48250
- },
48251
- {
48252
- key: "emit",
48253
- value: function emit(event) {
48254
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
48255
- args[_key - 1] = arguments[_key];
48256
- }
48257
- if (!this.listeners[event]) {
48258
- return;
48259
- }
48260
- this.listeners[event].forEach(function(listener) {
48261
- return listener.apply(void 0, _to_consumable_array(args));
48262
- });
48263
- }
48264
- },
48265
- {
48266
- key: "off",
48267
- value: function off(event, listener) {
48268
- if (!this.listeners[event]) {
48269
- return;
48270
- }
48271
- this.listeners[event] = this.listeners[event].filter(function(l51) {
48272
- return l51 !== listener;
48273
- });
48274
- }
48275
- }
48276
- ]);
48277
- return EventEmitter2;
48278
- }();
48279
48290
  INITIAL_STATE = {
48280
48291
  stack: [],
48281
48292
  index: -1
@@ -45312,6 +45312,23 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
45312
45312
  openConfirm
45313
45313
  ]);
45314
45314
  }
45315
+ function createEvent(event) {
45316
+ return {
45317
+ name: event,
45318
+ subscribe: function(listener) {
45319
+ return eventEmitter.subscribe(event, listener);
45320
+ },
45321
+ hasSubscriptions: function() {
45322
+ return eventEmitter.hasSubscriptions(event);
45323
+ },
45324
+ clearSubscriptions: function() {
45325
+ return eventEmitter.clearSubscriptions(event);
45326
+ },
45327
+ emit: function(data) {
45328
+ return eventEmitter.emit(event, data);
45329
+ }
45330
+ };
45331
+ }
45315
45332
  function useNavigationBarLogging() {
45316
45333
  var referrer2 = useReferrer();
45317
45334
  var baseParams = {
@@ -45424,7 +45441,11 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
45424
45441
  },
45425
45442
  handleHomeButtonClick: function() {
45426
45443
  logging.homeButtonClick();
45427
- navigation.navigate("/");
45444
+ if (homeEvent.hasSubscriptions()) {
45445
+ homeEvent.emit({});
45446
+ } else {
45447
+ navigation.navigate("/");
45448
+ }
45428
45449
  },
45429
45450
  handleCloseButtonClick: function() {
45430
45451
  logging.closeButtonClick();
@@ -46660,23 +46681,19 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46660
46681
  return null;
46661
46682
  }
46662
46683
  }
46663
- function useSafeAreaInsetsEmitter() {
46684
+ function useSafeAreaInsetsEvent() {
46664
46685
  var insets = (0, react_native_safe_area_context_exports.useSafeAreaInsets)();
46665
- var emitter = (0, import_react233.useMemo)(function() {
46666
- return new EventEmitter();
46667
- }, []);
46668
46686
  (0, import_react233.useEffect)(function() {
46669
- emitter.emit("safeAreaInsetsChange", insets);
46670
- return function() {
46671
- emitter.off("safeAreaInsetsChange", function(listener) {
46672
- return listener(insets);
46673
- });
46674
- };
46687
+ safeAreaInsetsChange.emit(insets);
46675
46688
  }, [
46676
- emitter,
46677
46689
  insets
46678
46690
  ]);
46679
- return emitter;
46691
+ (0, import_react233.useEffect)(function() {
46692
+ return function() {
46693
+ return safeAreaInsetsChange.clearSubscriptions();
46694
+ };
46695
+ }, []);
46696
+ return safeAreaInsetsChange;
46680
46697
  }
46681
46698
  function reducer(state, action) {
46682
46699
  switch (action.type) {
@@ -46730,7 +46747,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46730
46747
  canGoForward: canGoForward2
46731
46748
  });
46732
46749
  }, []);
46733
- var _useMemo5 = (0, import_react235.useMemo)(function() {
46750
+ var _useMemo4 = (0, import_react235.useMemo)(function() {
46734
46751
  var canBack = state.index > 0;
46735
46752
  var canFwd = state.index >= 0 && state.index < state.stack.length - 1;
46736
46753
  return {
@@ -46740,7 +46757,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46740
46757
  }, [
46741
46758
  state.index,
46742
46759
  state.stack.length
46743
- ]), canGoBack = _useMemo5.canGoBack, canGoForward = _useMemo5.canGoForward;
46760
+ ]), canGoBack = _useMemo4.canGoBack, canGoForward = _useMemo4.canGoForward;
46744
46761
  return {
46745
46762
  onNavigationStateChange,
46746
46763
  hasHistory: canGoBack,
@@ -46841,27 +46858,8 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
46841
46858
  var handleWebHome = (0, import_react234.useCallback)(function() {
46842
46859
  var _webViewRef_current;
46843
46860
  logging.homeButtonClick();
46844
- if (hasWebBackEvent) {
46845
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
46846
- try {
46847
- for (var _iterator = webBackHandlersRef[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
46848
- var handler = _step.value;
46849
- handler();
46850
- }
46851
- } catch (err) {
46852
- _didIteratorError = true;
46853
- _iteratorError = err;
46854
- } finally {
46855
- try {
46856
- if (!_iteratorNormalCompletion && _iterator.return != null) {
46857
- _iterator.return();
46858
- }
46859
- } finally {
46860
- if (_didIteratorError) {
46861
- throw _iteratorError;
46862
- }
46863
- }
46864
- }
46861
+ if (homeEvent.hasSubscriptions()) {
46862
+ homeEvent.emit({});
46865
46863
  return;
46866
46864
  }
46867
46865
  (_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 "));
@@ -47169,7 +47167,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
47169
47167
  var insets = (0, react_native_safe_area_context_exports.useSafeAreaInsets)();
47170
47168
  var global2 = getAppsInTossGlobals();
47171
47169
  var navigationBarContext = useNavigationBarContext();
47172
- var safeAreaInsetsEmitter = useSafeAreaInsetsEmitter();
47170
+ var safeAreaInsetsEvent = useSafeAreaInsetsEvent();
47173
47171
  var _useState6 = _sliced_to_array((0, import_react227.useState)(props.allowsBackForwardNavigationGestures), 2), allowsBackForwardNavigationGestures = _useState6[0], setAllowsBackForwardNavigationGestures = _useState6[1];
47174
47172
  var handler = useBridgeHandler({
47175
47173
  onMessage,
@@ -47188,6 +47186,10 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
47188
47186
  webBackHandler.removeEventListener(onEvent);
47189
47187
  };
47190
47188
  },
47189
+ homeEvent: function(param) {
47190
+ var onEvent = param.onEvent;
47191
+ return homeEvent.subscribe(onEvent);
47192
+ },
47191
47193
  updateLocationEvent: function(param) {
47192
47194
  var onEvent = param.onEvent, onError2 = param.onError, options = param.options;
47193
47195
  return appsInTossEvent.addEventListener("updateLocationEvent", {
@@ -47198,10 +47200,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
47198
47200
  },
47199
47201
  safeAreaInsetsChange: function(param) {
47200
47202
  var onEvent = param.onEvent;
47201
- safeAreaInsetsEmitter.on("safeAreaInsetsChange", onEvent);
47202
- return function() {
47203
- safeAreaInsetsEmitter.off("safeAreaInsetsChange", onEvent);
47204
- };
47203
+ return safeAreaInsetsEvent.subscribe(onEvent);
47205
47204
  },
47206
47205
  /** @internal */
47207
47206
  appBridgeCallbackEvent: function(param) {
@@ -47433,7 +47432,7 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
47433
47432
  onRenderProcessGone: handleWebViewProcessDidTerminate
47434
47433
  }));
47435
47434
  }
47436
- 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_react_native218, import_jsx_runtime224, import_jsx_runtime225, import_jsx_runtime226, import_react226, import_jsx_runtime227, import_jsx_runtime228, import_react_native220, import_jsx_runtime229, import_jsx_runtime230, import_jsx_runtime231, import_react227, import_react_native222, import_react228, import_react_native223, import_react229, import_react_native225, import_jsx_runtime232, import_jsx_runtime233, import_react230, import_react231, import_jsx_runtime234, import_jsx_runtime235, import_react232, import_react233, import_react234, import_react235, import_react_native231, import_react236, import_react237, import_jsx_runtime236, import_react238, import_react_native234, import_react239, import_react_native235, import_jsx_runtime237, import_react240, import_react_native236, import_jsx_runtime238, import_jsx_runtime239, __GlobalEventDeduplicator, __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, ERROR_CODES, _obj6, ERROR_MESSAGES, API_RESULT_ERROR_MAP, AD_STATUS_ERROR_MAP, GlobalEventDeduplicator, globalEventDeduplicator, styles3, styles22, styles32, Analytics2;
47435
+ 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_react_native218, import_jsx_runtime224, import_jsx_runtime225, import_jsx_runtime226, import_react226, import_jsx_runtime227, import_jsx_runtime228, import_react_native220, import_jsx_runtime229, import_jsx_runtime230, import_jsx_runtime231, import_react227, import_react_native222, import_react228, import_react_native223, import_react229, import_react_native225, import_jsx_runtime232, import_jsx_runtime233, import_react230, import_react231, import_jsx_runtime234, import_jsx_runtime235, import_react232, import_react233, import_react234, import_react235, import_react_native231, import_react236, import_react237, import_jsx_runtime236, import_react238, import_react_native234, import_react239, import_react_native235, import_jsx_runtime237, import_react240, import_react_native236, import_jsx_runtime238, import_jsx_runtime239, __GlobalEventDeduplicator, __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, EventEmitter, eventEmitter, homeEvent, safeAreaInsetsChange, 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, INITIAL_STATE, FontA11yCategory, androidFontScaleMap, iosScaleToAndroidScale, extractDateFromUUIDv7, getGroupId, getReferrer22, trackScreen, operationalEnvironment, TYPES, WEBVIEW_TYPES, ERROR_CODES, _obj6, ERROR_MESSAGES, API_RESULT_ERROR_MAP, AD_STATUS_ERROR_MAP, GlobalEventDeduplicator, globalEventDeduplicator, styles3, styles22, styles32, Analytics2;
47437
47436
  var init_dist9 = __esm({
47438
47437
  "../../../.yarn/__virtual__/@apps-in-toss-framework-virtual-afbad361af/1/packages/apps-in-toss/framework/dist/index.js"() {
47439
47438
  "use strict";
@@ -48110,6 +48109,62 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
48110
48109
  bottom: 0,
48111
48110
  zIndex: Z_INDEX.PROFILE_OVERLAY
48112
48111
  };
48112
+ EventEmitter = /* @__PURE__ */ function() {
48113
+ "use strict";
48114
+ function EventEmitter2() {
48115
+ _class_call_check(this, EventEmitter2);
48116
+ this.listeners = {};
48117
+ }
48118
+ _create_class(EventEmitter2, [
48119
+ {
48120
+ key: "subscribe",
48121
+ value: function subscribe(event, listener) {
48122
+ var _this = this;
48123
+ if (!this.listeners[event]) {
48124
+ this.listeners[event] = [];
48125
+ }
48126
+ this.listeners[event].push(listener);
48127
+ return function() {
48128
+ var _this_listeners_event;
48129
+ var _this_listeners_event_filter;
48130
+ _this.listeners[event] = (_this_listeners_event_filter = (_this_listeners_event = _this.listeners[event]) === null || _this_listeners_event === void 0 ? void 0 : _this_listeners_event.filter(function(l51) {
48131
+ return l51 !== listener;
48132
+ })) !== null && _this_listeners_event_filter !== void 0 ? _this_listeners_event_filter : [];
48133
+ };
48134
+ }
48135
+ },
48136
+ {
48137
+ key: "hasSubscriptions",
48138
+ value: function hasSubscriptions(event) {
48139
+ return this.listeners[event] != null && this.listeners[event].length > 0;
48140
+ }
48141
+ },
48142
+ {
48143
+ key: "clearSubscriptions",
48144
+ value: function clearSubscriptions(event) {
48145
+ this.listeners[event] = [];
48146
+ }
48147
+ },
48148
+ {
48149
+ key: "emit",
48150
+ value: function emit(event) {
48151
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
48152
+ args[_key - 1] = arguments[_key];
48153
+ }
48154
+ if (!this.listeners[event]) {
48155
+ return;
48156
+ }
48157
+ this.listeners[event].forEach(function(listener) {
48158
+ return listener.apply(void 0, _to_consumable_array(args));
48159
+ });
48160
+ }
48161
+ }
48162
+ ]);
48163
+ return EventEmitter2;
48164
+ }();
48165
+ eventEmitter = new EventEmitter();
48166
+ homeEvent = createEvent("homeEvent");
48167
+ safeAreaInsetsChange = createEvent("safeAreaInsetsChange");
48113
48168
  NAVI_BAR_IMPRESSION_SCHEMA_ID = 1596837;
48114
48169
  NAVI_BAR_IMPRESSION_LOG_NAME = "appsintoss_app_visit__common_module::impression__navigation_bar";
48115
48170
  CLOSE_POPUP_SHOW_SCHEMA_ID = 1644490;
@@ -48241,50 +48296,6 @@ var global=typeof globalThis!=='undefined'?globalThis:typeof global!=='undefined
48241
48296
  loadFullScreenAdForWeb = generateLoadFullScreenAd("107");
48242
48297
  showFullScreenAd.isSupported = GoogleAdMob.showAppsInTossAdMob.isSupported;
48243
48298
  globalEventListenerMap = /* @__PURE__ */ new Map();
48244
- EventEmitter = /* @__PURE__ */ function() {
48245
- "use strict";
48246
- function EventEmitter2() {
48247
- _class_call_check(this, EventEmitter2);
48248
- this.listeners = {};
48249
- }
48250
- _create_class(EventEmitter2, [
48251
- {
48252
- key: "on",
48253
- value: function on3(event, listener) {
48254
- if (!this.listeners[event]) {
48255
- this.listeners[event] = [];
48256
- }
48257
- this.listeners[event].push(listener);
48258
- }
48259
- },
48260
- {
48261
- key: "emit",
48262
- value: function emit(event) {
48263
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
48264
- args[_key - 1] = arguments[_key];
48265
- }
48266
- if (!this.listeners[event]) {
48267
- return;
48268
- }
48269
- this.listeners[event].forEach(function(listener) {
48270
- return listener.apply(void 0, _to_consumable_array(args));
48271
- });
48272
- }
48273
- },
48274
- {
48275
- key: "off",
48276
- value: function off(event, listener) {
48277
- if (!this.listeners[event]) {
48278
- return;
48279
- }
48280
- this.listeners[event] = this.listeners[event].filter(function(l51) {
48281
- return l51 !== listener;
48282
- });
48283
- }
48284
- }
48285
- ]);
48286
- return EventEmitter2;
48287
- }();
48288
48299
  INITIAL_STATE = {
48289
48300
  stack: [],
48290
48301
  index: -1
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.13.0",
4
+ "version": "1.14.1",
5
5
  "description": "Web Framework for Apps In Toss",
6
6
  "scripts": {
7
7
  "typecheck": "tsc --noEmit",
@@ -87,12 +87,12 @@
87
87
  "zod": "3.24.4"
88
88
  },
89
89
  "dependencies": {
90
- "@apps-in-toss/bridge-core": "1.13.0",
91
- "@apps-in-toss/cli": "1.13.0",
92
- "@apps-in-toss/framework": "1.13.0",
93
- "@apps-in-toss/plugins": "1.13.0",
94
- "@apps-in-toss/web-analytics": "1.13.0",
95
- "@apps-in-toss/web-bridge": "1.13.0",
90
+ "@apps-in-toss/bridge-core": "1.14.1",
91
+ "@apps-in-toss/cli": "1.14.1",
92
+ "@apps-in-toss/framework": "1.14.1",
93
+ "@apps-in-toss/plugins": "1.14.1",
94
+ "@apps-in-toss/web-analytics": "1.14.1",
95
+ "@apps-in-toss/web-bridge": "1.14.1",
96
96
  "@babel/core": "7.23.9",
97
97
  "@granite-js/cli": "0.1.31",
98
98
  "@granite-js/mpack": "0.1.31",