@apps-in-toss/framework 1.0.3 → 1.1.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/dist/index.cjs +64 -15
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +69 -17
- package/package.json +12 -11
package/dist/index.cjs
CHANGED
|
@@ -611,7 +611,6 @@ function BuiltinNavigationBar() {
|
|
|
611
611
|
const isExternalWebView = globals.webViewType === "external";
|
|
612
612
|
const isGameWebView = globals.webViewType === "game";
|
|
613
613
|
const backEventContext = (0, import_react_native13.useBackEventContext)();
|
|
614
|
-
const overrideCanGoBack = !backEventContext.hasBackEvent;
|
|
615
614
|
const handleBackOrClose = useBackOrCloseNavigation();
|
|
616
615
|
const navigation = (0, import_react_native13.useNavigation)();
|
|
617
616
|
const handlePressTitle = (0, import_react7.useCallback)(() => {
|
|
@@ -623,12 +622,16 @@ function BuiltinNavigationBar() {
|
|
|
623
622
|
navigation.navigate("/");
|
|
624
623
|
}, [logging, globals.webViewType, navigation]);
|
|
625
624
|
const handleBack = (0, import_react7.useCallback)(() => {
|
|
626
|
-
if (
|
|
625
|
+
if (globals.webViewType != null) {
|
|
626
|
+
import_native_modules7.appsInTossEvent.emit("backButtonClickEvent", void 0);
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
if (backEventContext.hasBackEvent) {
|
|
627
630
|
backEventContext.onBack();
|
|
628
631
|
return;
|
|
629
632
|
}
|
|
630
633
|
handleBackOrClose();
|
|
631
|
-
}, [
|
|
634
|
+
}, [globals.webViewType, backEventContext, handleBackOrClose]);
|
|
632
635
|
const handleClose = (0, import_react7.useCallback)(async () => {
|
|
633
636
|
logging.closeButtonClick();
|
|
634
637
|
const isConfirmed = await openConfirm({
|
|
@@ -644,16 +647,16 @@ function BuiltinNavigationBar() {
|
|
|
644
647
|
(0, import_react_native13.closeView)();
|
|
645
648
|
}
|
|
646
649
|
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
650
|
+
const handleBackEvent = (0, import_react7.useCallback)(() => {
|
|
651
|
+
handleBack();
|
|
652
|
+
return true;
|
|
653
|
+
}, [handleBack]);
|
|
647
654
|
(0, import_react7.useEffect)(() => {
|
|
648
|
-
|
|
649
|
-
handleClose();
|
|
650
|
-
return true;
|
|
651
|
-
};
|
|
652
|
-
import_react_native15.BackHandler.addEventListener("hardwareBackPress", backHandler);
|
|
655
|
+
import_react_native15.BackHandler.addEventListener("hardwareBackPress", handleBackEvent);
|
|
653
656
|
return () => {
|
|
654
|
-
import_react_native15.BackHandler.removeEventListener("hardwareBackPress",
|
|
657
|
+
import_react_native15.BackHandler.removeEventListener("hardwareBackPress", handleBackEvent);
|
|
655
658
|
};
|
|
656
|
-
}, [
|
|
659
|
+
}, [handleBackEvent]);
|
|
657
660
|
if (isExternalWebView) {
|
|
658
661
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {});
|
|
659
662
|
}
|
|
@@ -678,10 +681,12 @@ function BuiltinNavigationBar() {
|
|
|
678
681
|
}
|
|
679
682
|
function useBackOrCloseNavigation() {
|
|
680
683
|
const navigation = (0, import_react_native13.useNavigation)();
|
|
684
|
+
const { captureExitLog } = useCaptureExitLog();
|
|
681
685
|
return (0, import_react7.useCallback)(() => {
|
|
682
686
|
if (navigation.canGoBack()) {
|
|
683
687
|
navigation.goBack();
|
|
684
688
|
} else {
|
|
689
|
+
captureExitLog(Date.now());
|
|
685
690
|
(0, import_react_native13.closeView)();
|
|
686
691
|
}
|
|
687
692
|
}, [navigation]);
|
|
@@ -801,6 +806,7 @@ var graniteAsyncBridges = __toESM(require("@granite-js/react-native/async-bridge
|
|
|
801
806
|
var graniteConstantBridges = __toESM(require("@granite-js/react-native/constant-bridges"), 1);
|
|
802
807
|
var import_react_native31 = require("@toss-design-system/react-native");
|
|
803
808
|
var import_private5 = require("@toss-design-system/react-native/private");
|
|
809
|
+
var import_es_hangul3 = require("es-hangul");
|
|
804
810
|
var import_react15 = require("react");
|
|
805
811
|
var import_react_native32 = require("react-native");
|
|
806
812
|
|
|
@@ -1247,8 +1253,9 @@ function useBridgeHandler({
|
|
|
1247
1253
|
`);
|
|
1248
1254
|
};
|
|
1249
1255
|
const createHandleOnError = (functionName, eventId) => (error) => {
|
|
1256
|
+
const serializedError = serializeError(error);
|
|
1250
1257
|
ref.current?.injectJavaScript(`
|
|
1251
|
-
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${
|
|
1258
|
+
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
|
|
1252
1259
|
`);
|
|
1253
1260
|
};
|
|
1254
1261
|
const $onMessage = (0, import_react13.useCallback)(
|
|
@@ -1565,6 +1572,8 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1565
1572
|
if (!TYPES.includes(type)) {
|
|
1566
1573
|
throw new Error(`Invalid WebView type: '${type}'`);
|
|
1567
1574
|
}
|
|
1575
|
+
const { openConfirm } = (0, import_react_native31.useDialog)();
|
|
1576
|
+
const { captureExitLog } = useCaptureExitLog();
|
|
1568
1577
|
const graniteEvent = (0, import_react_native30.useGraniteEvent)();
|
|
1569
1578
|
const uri = (0, import_react15.useMemo)(() => getWebViewUri(local), [local]);
|
|
1570
1579
|
const top = (0, import_private5.useSafeAreaTop)();
|
|
@@ -1628,8 +1637,16 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1628
1637
|
},
|
|
1629
1638
|
addAccessoryButton: async (params) => topNavigation.addAccessoryButton(params),
|
|
1630
1639
|
removeAccessoryButton: async () => topNavigation.removeAccessoryButton(),
|
|
1631
|
-
/**
|
|
1632
|
-
|
|
1640
|
+
/** permissions */
|
|
1641
|
+
requestPermission: appsInTossAsyncBridges.requestPermission,
|
|
1642
|
+
openPermissionDialog: appsInTossAsyncBridges.openPermissionDialog,
|
|
1643
|
+
getPermission: appsInTossAsyncBridges.getPermission,
|
|
1644
|
+
getClipboardText: appsInTossAsyncBridges.getClipboardText,
|
|
1645
|
+
setClipboardText: appsInTossAsyncBridges.setClipboardText,
|
|
1646
|
+
fetchAlbumPhotos: appsInTossAsyncBridges.fetchAlbumPhotos,
|
|
1647
|
+
fetchContacts: appsInTossAsyncBridges.fetchContacts,
|
|
1648
|
+
getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
|
|
1649
|
+
openCamera: appsInTossAsyncBridges.openCamera,
|
|
1633
1650
|
/** Storage */
|
|
1634
1651
|
getStorageItem: import_native_modules17.Storage.getItem,
|
|
1635
1652
|
setStorageItem: import_native_modules17.Storage.setItem,
|
|
@@ -1670,14 +1687,30 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1670
1687
|
const userAgent = useCreateUserAgent({
|
|
1671
1688
|
colorPreference: "light"
|
|
1672
1689
|
});
|
|
1690
|
+
const handleGameWebviewClose = (0, import_react15.useCallback)(async () => {
|
|
1691
|
+
const isConfirmed = await openConfirm({
|
|
1692
|
+
title: `${(0, import_es_hangul3.josa)(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
1693
|
+
leftButton: "\uCDE8\uC18C",
|
|
1694
|
+
rightButton: "\uC885\uB8CC\uD558\uAE30",
|
|
1695
|
+
closeOnDimmerClick: true
|
|
1696
|
+
});
|
|
1697
|
+
if (isConfirmed) {
|
|
1698
|
+
captureExitLog(Date.now());
|
|
1699
|
+
(0, import_react_native30.closeView)();
|
|
1700
|
+
}
|
|
1701
|
+
}, [captureExitLog, openConfirm, global2.brandDisplayName]);
|
|
1673
1702
|
const handleBackEvent = (0, import_react15.useCallback)(() => {
|
|
1703
|
+
if (type === "game") {
|
|
1704
|
+
handleGameWebviewClose();
|
|
1705
|
+
return true;
|
|
1706
|
+
}
|
|
1674
1707
|
if (canHistoryGoBack) {
|
|
1675
1708
|
handler.ref.current?.goBack();
|
|
1676
1709
|
return true;
|
|
1677
1710
|
} else {
|
|
1678
1711
|
return false;
|
|
1679
1712
|
}
|
|
1680
|
-
}, [canHistoryGoBack, handler]);
|
|
1713
|
+
}, [canHistoryGoBack, handleGameWebviewClose, handler.ref, type]);
|
|
1681
1714
|
(0, import_react15.useEffect)(() => {
|
|
1682
1715
|
import_react_native32.BackHandler.addEventListener("hardwareBackPress", handleBackEvent);
|
|
1683
1716
|
return () => import_react_native32.BackHandler.removeEventListener("hardwareBackPress", handleBackEvent);
|
|
@@ -1694,6 +1727,20 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1694
1727
|
}
|
|
1695
1728
|
});
|
|
1696
1729
|
}, [handler.ref]);
|
|
1730
|
+
(0, import_react15.useEffect)(() => {
|
|
1731
|
+
return import_native_modules17.appsInTossEvent.addEventListener("backButtonClickEvent", {
|
|
1732
|
+
onEvent: () => {
|
|
1733
|
+
if (type === "game") {
|
|
1734
|
+
handleGameWebviewClose();
|
|
1735
|
+
} else if (canHistoryGoBack) {
|
|
1736
|
+
handler.ref.current?.goBack();
|
|
1737
|
+
} else {
|
|
1738
|
+
captureExitLog(Date.now());
|
|
1739
|
+
(0, import_react_native30.closeView)();
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
});
|
|
1743
|
+
}, [handler.ref, canHistoryGoBack, handleGameWebviewClose, captureExitLog, type]);
|
|
1697
1744
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1698
1745
|
BaseWebView,
|
|
1699
1746
|
{
|
|
@@ -1725,6 +1772,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1725
1772
|
__reExport(src_exports, require("@apps-in-toss/analytics"), module.exports);
|
|
1726
1773
|
var import_private6 = require("@toss-design-system/react-native/private");
|
|
1727
1774
|
__reExport(src_exports, require("@apps-in-toss/native-modules"), module.exports);
|
|
1775
|
+
__reExport(src_exports, require("@apps-in-toss/types"), module.exports);
|
|
1728
1776
|
var Analytics2 = {
|
|
1729
1777
|
init: import_analytics2.Analytics.init,
|
|
1730
1778
|
Impression: import_analytics2.Analytics.Impression,
|
|
@@ -1742,5 +1790,6 @@ var Analytics2 = {
|
|
|
1742
1790
|
useGeolocation,
|
|
1743
1791
|
useTopNavigation,
|
|
1744
1792
|
...require("@apps-in-toss/analytics"),
|
|
1745
|
-
...require("@apps-in-toss/native-modules")
|
|
1793
|
+
...require("@apps-in-toss/native-modules"),
|
|
1794
|
+
...require("@apps-in-toss/types")
|
|
1746
1795
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -6,7 +6,9 @@ export * from '@apps-in-toss/analytics';
|
|
|
6
6
|
import { InitialProps, GraniteProps } from '@granite-js/react-native';
|
|
7
7
|
import { WebViewProps as WebViewProps$1 } from '@granite-js/native/react-native-webview';
|
|
8
8
|
import { ExternalWebViewScreenProps } from '@toss-design-system/react-native';
|
|
9
|
-
import { StartUpdateLocationOptions, Location
|
|
9
|
+
import { StartUpdateLocationOptions, Location } from '@apps-in-toss/types';
|
|
10
|
+
export * from '@apps-in-toss/types';
|
|
11
|
+
import { onVisibilityChangedByTransparentServiceWeb } from '@apps-in-toss/native-modules';
|
|
10
12
|
export * from '@apps-in-toss/native-modules';
|
|
11
13
|
export { useTopNavigation } from '@toss-design-system/react-native/private';
|
|
12
14
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,9 @@ export * from '@apps-in-toss/analytics';
|
|
|
6
6
|
import { InitialProps, GraniteProps } from '@granite-js/react-native';
|
|
7
7
|
import { WebViewProps as WebViewProps$1 } from '@granite-js/native/react-native-webview';
|
|
8
8
|
import { ExternalWebViewScreenProps } from '@toss-design-system/react-native';
|
|
9
|
-
import { StartUpdateLocationOptions, Location
|
|
9
|
+
import { StartUpdateLocationOptions, Location } from '@apps-in-toss/types';
|
|
10
|
+
export * from '@apps-in-toss/types';
|
|
11
|
+
import { onVisibilityChangedByTransparentServiceWeb } from '@apps-in-toss/native-modules';
|
|
10
12
|
export * from '@apps-in-toss/native-modules';
|
|
11
13
|
export { useTopNavigation } from '@toss-design-system/react-native/private';
|
|
12
14
|
|
package/dist/index.js
CHANGED
|
@@ -569,7 +569,6 @@ function BuiltinNavigationBar() {
|
|
|
569
569
|
const isExternalWebView = globals.webViewType === "external";
|
|
570
570
|
const isGameWebView = globals.webViewType === "game";
|
|
571
571
|
const backEventContext = useBackEventContext();
|
|
572
|
-
const overrideCanGoBack = !backEventContext.hasBackEvent;
|
|
573
572
|
const handleBackOrClose = useBackOrCloseNavigation();
|
|
574
573
|
const navigation = useNavigation();
|
|
575
574
|
const handlePressTitle = useCallback3(() => {
|
|
@@ -581,12 +580,16 @@ function BuiltinNavigationBar() {
|
|
|
581
580
|
navigation.navigate("/");
|
|
582
581
|
}, [logging, globals.webViewType, navigation]);
|
|
583
582
|
const handleBack = useCallback3(() => {
|
|
584
|
-
if (
|
|
583
|
+
if (globals.webViewType != null) {
|
|
584
|
+
appsInTossEvent.emit("backButtonClickEvent", void 0);
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
if (backEventContext.hasBackEvent) {
|
|
585
588
|
backEventContext.onBack();
|
|
586
589
|
return;
|
|
587
590
|
}
|
|
588
591
|
handleBackOrClose();
|
|
589
|
-
}, [
|
|
592
|
+
}, [globals.webViewType, backEventContext, handleBackOrClose]);
|
|
590
593
|
const handleClose = useCallback3(async () => {
|
|
591
594
|
logging.closeButtonClick();
|
|
592
595
|
const isConfirmed = await openConfirm({
|
|
@@ -602,16 +605,16 @@ function BuiltinNavigationBar() {
|
|
|
602
605
|
closeView();
|
|
603
606
|
}
|
|
604
607
|
}, [captureExitLog, globals.brandDisplayName, logging, openConfirm]);
|
|
608
|
+
const handleBackEvent = useCallback3(() => {
|
|
609
|
+
handleBack();
|
|
610
|
+
return true;
|
|
611
|
+
}, [handleBack]);
|
|
605
612
|
useEffect5(() => {
|
|
606
|
-
|
|
607
|
-
handleClose();
|
|
608
|
-
return true;
|
|
609
|
-
};
|
|
610
|
-
BackHandler.addEventListener("hardwareBackPress", backHandler);
|
|
613
|
+
BackHandler.addEventListener("hardwareBackPress", handleBackEvent);
|
|
611
614
|
return () => {
|
|
612
|
-
BackHandler.removeEventListener("hardwareBackPress",
|
|
615
|
+
BackHandler.removeEventListener("hardwareBackPress", handleBackEvent);
|
|
613
616
|
};
|
|
614
|
-
}, [
|
|
617
|
+
}, [handleBackEvent]);
|
|
615
618
|
if (isExternalWebView) {
|
|
616
619
|
return /* @__PURE__ */ jsx3(Fragment3, {});
|
|
617
620
|
}
|
|
@@ -636,10 +639,12 @@ function BuiltinNavigationBar() {
|
|
|
636
639
|
}
|
|
637
640
|
function useBackOrCloseNavigation() {
|
|
638
641
|
const navigation = useNavigation();
|
|
642
|
+
const { captureExitLog } = useCaptureExitLog();
|
|
639
643
|
return useCallback3(() => {
|
|
640
644
|
if (navigation.canGoBack()) {
|
|
641
645
|
navigation.goBack();
|
|
642
646
|
} else {
|
|
647
|
+
captureExitLog(Date.now());
|
|
643
648
|
closeView();
|
|
644
649
|
}
|
|
645
650
|
}, [navigation]);
|
|
@@ -754,11 +759,16 @@ import { GoogleAdMob, IAP, Storage, AppsInTossModule, appsInTossEvent as appsInT
|
|
|
754
759
|
import * as appsInTossAsyncBridges from "@apps-in-toss/native-modules/async-bridges";
|
|
755
760
|
import * as appsInTossConstantBridges from "@apps-in-toss/native-modules/constant-bridges";
|
|
756
761
|
import * as appsInTossEventBridges from "@apps-in-toss/native-modules/event-bridges";
|
|
757
|
-
import { getSchemeUri as getSchemeUri5, useGraniteEvent } from "@granite-js/react-native";
|
|
762
|
+
import { closeView as closeView3, getSchemeUri as getSchemeUri5, useGraniteEvent } from "@granite-js/react-native";
|
|
758
763
|
import * as graniteAsyncBridges from "@granite-js/react-native/async-bridges";
|
|
759
764
|
import * as graniteConstantBridges from "@granite-js/react-native/constant-bridges";
|
|
760
|
-
import {
|
|
765
|
+
import {
|
|
766
|
+
ExternalWebViewScreen,
|
|
767
|
+
tdsEvent,
|
|
768
|
+
useDialog as useDialog4
|
|
769
|
+
} from "@toss-design-system/react-native";
|
|
761
770
|
import { useSafeAreaBottom, useSafeAreaTop, useTopNavigation } from "@toss-design-system/react-native/private";
|
|
771
|
+
import { josa as josa3 } from "es-hangul";
|
|
762
772
|
import { useCallback as useCallback6, useEffect as useEffect10, useMemo as useMemo3, useState as useState5 } from "react";
|
|
763
773
|
import { BackHandler as BackHandler2, Platform as Platform3 } from "react-native";
|
|
764
774
|
|
|
@@ -1209,8 +1219,9 @@ function useBridgeHandler({
|
|
|
1209
1219
|
`);
|
|
1210
1220
|
};
|
|
1211
1221
|
const createHandleOnError = (functionName, eventId) => (error) => {
|
|
1222
|
+
const serializedError = serializeError(error);
|
|
1212
1223
|
ref.current?.injectJavaScript(`
|
|
1213
|
-
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${
|
|
1224
|
+
window.__GRANITE_NATIVE_EMITTER.emit('${functionName}/onError/${eventId}', ${serializedError});
|
|
1214
1225
|
`);
|
|
1215
1226
|
};
|
|
1216
1227
|
const $onMessage = useCallback5(
|
|
@@ -1422,7 +1433,7 @@ function useCreateUserAgent({
|
|
|
1422
1433
|
// src/hooks/useGeolocation.ts
|
|
1423
1434
|
import { startUpdateLocation } from "@apps-in-toss/native-modules";
|
|
1424
1435
|
import { useVisibility as useVisibility3 } from "@granite-js/react-native";
|
|
1425
|
-
import {
|
|
1436
|
+
import { useEffect as useEffect9, useState as useState4 } from "react";
|
|
1426
1437
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
1427
1438
|
const isVisible = useVisibility3();
|
|
1428
1439
|
const [location, setLocation] = useState4(null);
|
|
@@ -1527,6 +1538,8 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1527
1538
|
if (!TYPES.includes(type)) {
|
|
1528
1539
|
throw new Error(`Invalid WebView type: '${type}'`);
|
|
1529
1540
|
}
|
|
1541
|
+
const { openConfirm } = useDialog4();
|
|
1542
|
+
const { captureExitLog } = useCaptureExitLog();
|
|
1530
1543
|
const graniteEvent = useGraniteEvent();
|
|
1531
1544
|
const uri = useMemo3(() => getWebViewUri(local), [local]);
|
|
1532
1545
|
const top = useSafeAreaTop();
|
|
@@ -1590,8 +1603,16 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1590
1603
|
},
|
|
1591
1604
|
addAccessoryButton: async (params) => topNavigation.addAccessoryButton(params),
|
|
1592
1605
|
removeAccessoryButton: async () => topNavigation.removeAccessoryButton(),
|
|
1593
|
-
/**
|
|
1594
|
-
|
|
1606
|
+
/** permissions */
|
|
1607
|
+
requestPermission: appsInTossAsyncBridges.requestPermission,
|
|
1608
|
+
openPermissionDialog: appsInTossAsyncBridges.openPermissionDialog,
|
|
1609
|
+
getPermission: appsInTossAsyncBridges.getPermission,
|
|
1610
|
+
getClipboardText: appsInTossAsyncBridges.getClipboardText,
|
|
1611
|
+
setClipboardText: appsInTossAsyncBridges.setClipboardText,
|
|
1612
|
+
fetchAlbumPhotos: appsInTossAsyncBridges.fetchAlbumPhotos,
|
|
1613
|
+
fetchContacts: appsInTossAsyncBridges.fetchContacts,
|
|
1614
|
+
getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
|
|
1615
|
+
openCamera: appsInTossAsyncBridges.openCamera,
|
|
1595
1616
|
/** Storage */
|
|
1596
1617
|
getStorageItem: Storage.getItem,
|
|
1597
1618
|
setStorageItem: Storage.setItem,
|
|
@@ -1632,14 +1653,30 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1632
1653
|
const userAgent = useCreateUserAgent({
|
|
1633
1654
|
colorPreference: "light"
|
|
1634
1655
|
});
|
|
1656
|
+
const handleGameWebviewClose = useCallback6(async () => {
|
|
1657
|
+
const isConfirmed = await openConfirm({
|
|
1658
|
+
title: `${josa3(global2.brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
1659
|
+
leftButton: "\uCDE8\uC18C",
|
|
1660
|
+
rightButton: "\uC885\uB8CC\uD558\uAE30",
|
|
1661
|
+
closeOnDimmerClick: true
|
|
1662
|
+
});
|
|
1663
|
+
if (isConfirmed) {
|
|
1664
|
+
captureExitLog(Date.now());
|
|
1665
|
+
closeView3();
|
|
1666
|
+
}
|
|
1667
|
+
}, [captureExitLog, openConfirm, global2.brandDisplayName]);
|
|
1635
1668
|
const handleBackEvent = useCallback6(() => {
|
|
1669
|
+
if (type === "game") {
|
|
1670
|
+
handleGameWebviewClose();
|
|
1671
|
+
return true;
|
|
1672
|
+
}
|
|
1636
1673
|
if (canHistoryGoBack) {
|
|
1637
1674
|
handler.ref.current?.goBack();
|
|
1638
1675
|
return true;
|
|
1639
1676
|
} else {
|
|
1640
1677
|
return false;
|
|
1641
1678
|
}
|
|
1642
|
-
}, [canHistoryGoBack, handler]);
|
|
1679
|
+
}, [canHistoryGoBack, handleGameWebviewClose, handler.ref, type]);
|
|
1643
1680
|
useEffect10(() => {
|
|
1644
1681
|
BackHandler2.addEventListener("hardwareBackPress", handleBackEvent);
|
|
1645
1682
|
return () => BackHandler2.removeEventListener("hardwareBackPress", handleBackEvent);
|
|
@@ -1656,6 +1693,20 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1656
1693
|
}
|
|
1657
1694
|
});
|
|
1658
1695
|
}, [handler.ref]);
|
|
1696
|
+
useEffect10(() => {
|
|
1697
|
+
return appsInTossEvent4.addEventListener("backButtonClickEvent", {
|
|
1698
|
+
onEvent: () => {
|
|
1699
|
+
if (type === "game") {
|
|
1700
|
+
handleGameWebviewClose();
|
|
1701
|
+
} else if (canHistoryGoBack) {
|
|
1702
|
+
handler.ref.current?.goBack();
|
|
1703
|
+
} else {
|
|
1704
|
+
captureExitLog(Date.now());
|
|
1705
|
+
closeView3();
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
});
|
|
1709
|
+
}, [handler.ref, canHistoryGoBack, handleGameWebviewClose, captureExitLog, type]);
|
|
1659
1710
|
return /* @__PURE__ */ jsx9(
|
|
1660
1711
|
BaseWebView,
|
|
1661
1712
|
{
|
|
@@ -1687,6 +1738,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1687
1738
|
export * from "@apps-in-toss/analytics";
|
|
1688
1739
|
import { useTopNavigation as useTopNavigation2 } from "@toss-design-system/react-native/private";
|
|
1689
1740
|
export * from "@apps-in-toss/native-modules";
|
|
1741
|
+
export * from "@apps-in-toss/types";
|
|
1690
1742
|
var Analytics2 = {
|
|
1691
1743
|
init: InternalAnalytics.init,
|
|
1692
1744
|
Impression: InternalAnalytics.Impression,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apps-in-toss/framework",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"description": "The framework for Apps In Toss",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepack": "yarn build",
|
|
@@ -56,19 +56,20 @@
|
|
|
56
56
|
"ait": "./bin/ait.js"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@apps-in-toss/analytics": "1.
|
|
60
|
-
"@apps-in-toss/cli": "1.
|
|
61
|
-
"@apps-in-toss/native-modules": "1.
|
|
62
|
-
"@apps-in-toss/plugins": "1.
|
|
59
|
+
"@apps-in-toss/analytics": "1.1.1",
|
|
60
|
+
"@apps-in-toss/cli": "1.1.1",
|
|
61
|
+
"@apps-in-toss/native-modules": "1.1.1",
|
|
62
|
+
"@apps-in-toss/plugins": "1.1.1",
|
|
63
|
+
"@apps-in-toss/types": "1.1.1",
|
|
63
64
|
"es-hangul": "^2.3.2"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
67
|
"@babel/runtime": "^7",
|
|
67
|
-
"@granite-js/mpack": "0.1.
|
|
68
|
-
"@granite-js/native": "0.1.
|
|
69
|
-
"@granite-js/plugin-core": "0.1.
|
|
70
|
-
"@granite-js/react-native": "0.1.
|
|
71
|
-
"@granite-js/utils": "0.1.
|
|
68
|
+
"@granite-js/mpack": "0.1.22",
|
|
69
|
+
"@granite-js/native": "0.1.22",
|
|
70
|
+
"@granite-js/plugin-core": "0.1.22",
|
|
71
|
+
"@granite-js/react-native": "0.1.22",
|
|
72
|
+
"@granite-js/utils": "0.1.22",
|
|
72
73
|
"@toss-design-system/react-native": "1.1.0",
|
|
73
74
|
"@types/kill-port": "^2.0.3",
|
|
74
75
|
"@types/react": "18.3.3",
|
|
@@ -95,5 +96,5 @@
|
|
|
95
96
|
"publishConfig": {
|
|
96
97
|
"access": "public"
|
|
97
98
|
},
|
|
98
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "0e0af7d44ed8ad2615a237650b9682c68ab5861e"
|
|
99
100
|
}
|