@jobber/components-native 0.86.0 → 0.86.1-JOB-136074-c379982.0
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/package.json +8 -2
- package/dist/src/Form/Form.js +4 -1
- package/dist/src/utils/buildConfig/isEdgeToEdgeEnabled.js +18 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/src/utils/buildConfig/isEdgeToEdgeEnabled.d.ts +1 -0
- package/package.json +8 -2
- package/src/Form/Form.tsx +6 -0
- package/src/types/buildConfig.d.ts +7 -0
- package/src/utils/buildConfig/isEdgeToEdgeEnabled.ts +21 -0
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.86.0",
|
|
3
|
+
"version": "0.86.1-JOB-136074-c379982.0+c379982e9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
"react": "^18.2.0",
|
|
87
87
|
"react-intl": "^6.4.2",
|
|
88
88
|
"react-native": ">=0.76.0",
|
|
89
|
+
"react-native-build-config": "^0.3.2",
|
|
89
90
|
"react-native-gesture-handler": ">=2.10.0",
|
|
90
91
|
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
|
91
92
|
"react-native-modal-datetime-picker": " >=13.0.0",
|
|
@@ -95,5 +96,10 @@
|
|
|
95
96
|
"react-native-safe-area-context": "^5.4.0",
|
|
96
97
|
"react-native-svg": ">=12.0.0"
|
|
97
98
|
},
|
|
98
|
-
"
|
|
99
|
+
"peerDependenciesMeta": {
|
|
100
|
+
"react-native-build-config": {
|
|
101
|
+
"optional": true
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"gitHead": "c379982e9d83ceef1ec4ffa08f53ce98ed914d8c"
|
|
99
105
|
}
|
package/dist/src/Form/Form.js
CHANGED
|
@@ -38,6 +38,7 @@ import { useScrollToError } from "./hooks/useScrollToError";
|
|
|
38
38
|
import { FormSaveButton } from "./components/FormSaveButton";
|
|
39
39
|
import { useSaveButtonPosition } from "./hooks/useSaveButtonPosition";
|
|
40
40
|
import { FormCache } from "./components/FormCache/FormCache";
|
|
41
|
+
import { isEdgeToEdgeEnabled } from "../utils/buildConfig/isEdgeToEdgeEnabled";
|
|
41
42
|
import { InputAccessoriesProvider } from "../InputText";
|
|
42
43
|
import { tokens } from "../utils/design";
|
|
43
44
|
import { ErrorMessageProvider } from "../ErrorMessageWrapper";
|
|
@@ -102,12 +103,14 @@ function InternalForm({ children, onBeforeSubmit, onSubmit, onSubmitError, onSub
|
|
|
102
103
|
setMessageBannerHeight(event.nativeEvent.layout.height);
|
|
103
104
|
};
|
|
104
105
|
const styles = useStyles();
|
|
106
|
+
// Check if edge-to-edge is enabled using utility function
|
|
107
|
+
const edgeToEdgeEnabled = isEdgeToEdgeEnabled();
|
|
105
108
|
return (React.createElement(FormProvider, Object.assign({}, formMethods),
|
|
106
109
|
React.createElement(React.Fragment, null,
|
|
107
110
|
(isSubmitting || isSecondaryActionLoading) && React.createElement(FormMask, null),
|
|
108
111
|
React.createElement(FormCache, { localCacheKey: localCacheKey, localCacheExclude: localCacheExclude, setLocalCache: setLocalCache }),
|
|
109
112
|
React.createElement(FormBody, { keyboardHeight: calculateSaveButtonOffset(), submit: handleSubmit(internalSubmit), isFormSubmitting: isSubmitting, saveButtonLabel: saveButtonLabel, shouldRenderActionBar: saveButtonPosition === "sticky", renderStickySection: renderStickySection, secondaryActions: secondaryActions, setSecondaryActionLoading: setIsSecondaryActionLoading, setSaveButtonHeight: setSaveButtonHeight, saveButtonOffset: saveButtonOffset },
|
|
110
|
-
React.createElement(KeyboardAwareScrollView, Object.assign({ enableResetScrollToCoords: false, enableAutomaticScroll: true, keyboardOpeningTime: Platform.OS === "ios" ? tokens["timing-slowest"] : 0, keyboardShouldPersistTaps: "handled", ref: scrollViewRef }, keyboardProps, { extraHeight: headerHeight, contentContainerStyle: !keyboardHeight && styles.scrollContentContainer }),
|
|
113
|
+
React.createElement(KeyboardAwareScrollView, Object.assign({ enableResetScrollToCoords: false, enableAutomaticScroll: true, enableOnAndroid: edgeToEdgeEnabled, keyboardOpeningTime: Platform.OS === "ios" ? tokens["timing-slowest"] : 0, keyboardShouldPersistTaps: "handled", ref: scrollViewRef }, keyboardProps, { extraHeight: headerHeight, extraScrollHeight: edgeToEdgeEnabled ? 20 : 0, contentContainerStyle: !keyboardHeight && styles.scrollContentContainer }),
|
|
111
114
|
React.createElement(View, { onLayout: ({ nativeEvent }) => {
|
|
112
115
|
setFormContentHeight(nativeEvent.layout.height);
|
|
113
116
|
} },
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Platform } from "react-native";
|
|
2
|
+
function loadBuildConfig() {
|
|
3
|
+
var _a;
|
|
4
|
+
try {
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
6
|
+
const mod = require("react-native-build-config");
|
|
7
|
+
return ((_a = mod === null || mod === void 0 ? void 0 : mod.default) !== null && _a !== void 0 ? _a : mod);
|
|
8
|
+
}
|
|
9
|
+
catch (_b) {
|
|
10
|
+
return null; // module not installed or not linked
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export function isEdgeToEdgeEnabled() {
|
|
14
|
+
if (Platform.OS !== "android")
|
|
15
|
+
return false;
|
|
16
|
+
const cfg = loadBuildConfig();
|
|
17
|
+
return !!(cfg === null || cfg === void 0 ? void 0 : cfg.IS_EDGE_TO_EDGE_ENABLED);
|
|
18
|
+
}
|