@apps-in-toss/framework 0.0.38 → 0.0.40
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 +14 -6
- package/dist/index.js +16 -8
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -1906,6 +1906,9 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1906
1906
|
document.head.appendChild(style);
|
|
1907
1907
|
})();
|
|
1908
1908
|
`;
|
|
1909
|
+
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = (0, import_react10.useState)(
|
|
1910
|
+
props.allowsBackForwardNavigationGestures
|
|
1911
|
+
);
|
|
1909
1912
|
const handler = useBridgeHandler({
|
|
1910
1913
|
onMessage,
|
|
1911
1914
|
injectedJavaScript: [disableTextSelectionCSS].join("\n"),
|
|
@@ -1944,6 +1947,10 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1944
1947
|
asyncHandlerMap: {
|
|
1945
1948
|
...bedrockAsyncBridges,
|
|
1946
1949
|
...async_bridges_exports,
|
|
1950
|
+
setIosSwipeGestureEnabled: (options) => {
|
|
1951
|
+
setAllowsBackForwardNavigationGestures(options.isEnabled);
|
|
1952
|
+
return bedrockAsyncBridges.setIosSwipeGestureEnabled(options);
|
|
1953
|
+
},
|
|
1947
1954
|
addAccessoryButton: async (params) => partner.addAccessoryButton(params),
|
|
1948
1955
|
removeAccessoryButton: async () => partner.removeAccessoryButton(),
|
|
1949
1956
|
/** internal */
|
|
@@ -2000,18 +2007,18 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2000
2007
|
const userAgent = useCreateUserAgent({
|
|
2001
2008
|
colorPreference: "light"
|
|
2002
2009
|
});
|
|
2003
|
-
const backEvent = (0, import_react_native_bedrock18.useBackEvent)();
|
|
2004
2010
|
const handleBackEvent = (0, import_react10.useCallback)(() => {
|
|
2005
2011
|
if (canHistoryGoBack) {
|
|
2006
2012
|
handler.ref.current?.goBack();
|
|
2013
|
+
return true;
|
|
2007
2014
|
} else {
|
|
2008
|
-
|
|
2015
|
+
return false;
|
|
2009
2016
|
}
|
|
2010
2017
|
}, [canHistoryGoBack, handler]);
|
|
2011
2018
|
(0, import_react10.useEffect)(() => {
|
|
2012
|
-
|
|
2013
|
-
return () =>
|
|
2014
|
-
}, [
|
|
2019
|
+
import_react_native21.BackHandler.addEventListener("hardwareBackPress", handleBackEvent);
|
|
2020
|
+
return () => import_react_native21.BackHandler.removeEventListener("hardwareBackPress", handleBackEvent);
|
|
2021
|
+
}, [handleBackEvent]);
|
|
2015
2022
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
2016
2023
|
BaseWebView,
|
|
2017
2024
|
{
|
|
@@ -2033,7 +2040,8 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2033
2040
|
onNavigationStateChange: handleNavigationStateChange,
|
|
2034
2041
|
injectedJavaScript: handler.injectedJavaScript,
|
|
2035
2042
|
injectedJavaScriptBeforeContentLoaded: handler.injectedJavaScript,
|
|
2036
|
-
decelerationRate: import_react_native21.Platform.OS === "ios" ? 1 : void 0
|
|
2043
|
+
decelerationRate: import_react_native21.Platform.OS === "ios" ? 1 : void 0,
|
|
2044
|
+
allowsBackForwardNavigationGestures
|
|
2037
2045
|
}
|
|
2038
2046
|
);
|
|
2039
2047
|
}
|
package/dist/index.js
CHANGED
|
@@ -955,8 +955,8 @@ import {
|
|
|
955
955
|
} from "@toss-design-system/react-native";
|
|
956
956
|
import { useSafeAreaBottom, useSafeAreaTop as useSafeAreaTop2 } from "@toss-design-system/react-native/private";
|
|
957
957
|
import { useCallback as useCallback5, useEffect as useEffect7, useMemo as useMemo3, useState as useState4 } from "react";
|
|
958
|
-
import { Platform as Platform7 } from "react-native";
|
|
959
|
-
import { getSchemeUri as getSchemeUri5,
|
|
958
|
+
import { BackHandler as BackHandler2, Platform as Platform7 } from "react-native";
|
|
959
|
+
import { getSchemeUri as getSchemeUri5, useBedrockEvent } from "react-native-bedrock";
|
|
960
960
|
import * as bedrockAsyncBridges from "react-native-bedrock/async-bridges";
|
|
961
961
|
import * as bedrockConstantBridges from "react-native-bedrock/constant-bridges";
|
|
962
962
|
|
|
@@ -1852,6 +1852,9 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1852
1852
|
document.head.appendChild(style);
|
|
1853
1853
|
})();
|
|
1854
1854
|
`;
|
|
1855
|
+
const [allowsBackForwardNavigationGestures, setAllowsBackForwardNavigationGestures] = useState4(
|
|
1856
|
+
props.allowsBackForwardNavigationGestures
|
|
1857
|
+
);
|
|
1855
1858
|
const handler = useBridgeHandler({
|
|
1856
1859
|
onMessage,
|
|
1857
1860
|
injectedJavaScript: [disableTextSelectionCSS].join("\n"),
|
|
@@ -1890,6 +1893,10 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1890
1893
|
asyncHandlerMap: {
|
|
1891
1894
|
...bedrockAsyncBridges,
|
|
1892
1895
|
...async_bridges_exports,
|
|
1896
|
+
setIosSwipeGestureEnabled: (options) => {
|
|
1897
|
+
setAllowsBackForwardNavigationGestures(options.isEnabled);
|
|
1898
|
+
return bedrockAsyncBridges.setIosSwipeGestureEnabled(options);
|
|
1899
|
+
},
|
|
1893
1900
|
addAccessoryButton: async (params) => partner.addAccessoryButton(params),
|
|
1894
1901
|
removeAccessoryButton: async () => partner.removeAccessoryButton(),
|
|
1895
1902
|
/** internal */
|
|
@@ -1946,18 +1953,18 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1946
1953
|
const userAgent = useCreateUserAgent({
|
|
1947
1954
|
colorPreference: "light"
|
|
1948
1955
|
});
|
|
1949
|
-
const backEvent = useBackEvent();
|
|
1950
1956
|
const handleBackEvent = useCallback5(() => {
|
|
1951
1957
|
if (canHistoryGoBack) {
|
|
1952
1958
|
handler.ref.current?.goBack();
|
|
1959
|
+
return true;
|
|
1953
1960
|
} else {
|
|
1954
|
-
|
|
1961
|
+
return false;
|
|
1955
1962
|
}
|
|
1956
1963
|
}, [canHistoryGoBack, handler]);
|
|
1957
1964
|
useEffect7(() => {
|
|
1958
|
-
|
|
1959
|
-
return () =>
|
|
1960
|
-
}, [
|
|
1965
|
+
BackHandler2.addEventListener("hardwareBackPress", handleBackEvent);
|
|
1966
|
+
return () => BackHandler2.removeEventListener("hardwareBackPress", handleBackEvent);
|
|
1967
|
+
}, [handleBackEvent]);
|
|
1961
1968
|
return /* @__PURE__ */ jsx7(
|
|
1962
1969
|
BaseWebView,
|
|
1963
1970
|
{
|
|
@@ -1979,7 +1986,8 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
1979
1986
|
onNavigationStateChange: handleNavigationStateChange,
|
|
1980
1987
|
injectedJavaScript: handler.injectedJavaScript,
|
|
1981
1988
|
injectedJavaScriptBeforeContentLoaded: handler.injectedJavaScript,
|
|
1982
|
-
decelerationRate: Platform7.OS === "ios" ? 1 : void 0
|
|
1989
|
+
decelerationRate: Platform7.OS === "ios" ? 1 : void 0,
|
|
1990
|
+
allowsBackForwardNavigationGestures
|
|
1983
1991
|
}
|
|
1984
1992
|
);
|
|
1985
1993
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apps-in-toss/framework",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.40",
|
|
5
5
|
"description": "The framework for Apps In Toss",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepack": "yarn build",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"ait": "./bin/ait.js"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@apps-in-toss/analytics": "0.0.
|
|
61
|
-
"@apps-in-toss/cli": "0.0.
|
|
62
|
-
"@apps-in-toss/plugins": "0.0.
|
|
60
|
+
"@apps-in-toss/analytics": "0.0.40",
|
|
61
|
+
"@apps-in-toss/cli": "0.0.40",
|
|
62
|
+
"@apps-in-toss/plugins": "0.0.40",
|
|
63
63
|
"es-hangul": "^2.3.2"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"publishConfig": {
|
|
95
95
|
"access": "public"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "3a5a037ebbe1292238d007a3e8f6a5bdb0681a72"
|
|
98
98
|
}
|