@jobber/components-native 0.88.1-JOB-139048-04134dd.0 → 0.88.1-JOB-136074-020f532.3
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 +2 -2
- package/dist/src/ContentOverlay/ContentOverlay.js +2 -2
- package/dist/src/ContentOverlay/index.js +0 -1
- package/dist/src/Form/Form.js +3 -1
- package/dist/src/Form/context/AtlantisFormContext.js +1 -0
- package/dist/src/utils/meta/meta.json +1 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/src/ContentOverlay/ContentOverlay.d.ts +1 -1
- package/dist/types/src/ContentOverlay/index.d.ts +0 -1
- package/dist/types/src/Form/context/AtlantisFormContext.d.ts +1 -0
- package/dist/types/src/Form/context/types.d.ts +1 -0
- package/package.json +2 -2
- package/src/ContentOverlay/ContentOverlay.test.tsx +23 -30
- package/src/ContentOverlay/ContentOverlay.tsx +3 -4
- package/src/ContentOverlay/index.ts +0 -1
- package/src/Form/Form.tsx +5 -0
- package/src/Form/context/AtlantisFormContext.tsx +1 -0
- package/src/Form/context/types.ts +1 -0
- package/src/utils/meta/meta.json +1 -2
- package/dist/src/ContentOverlay/UNSAFE_WrappedModalize.js +0 -27
- package/dist/types/src/ContentOverlay/UNSAFE_WrappedModalize.d.ts +0 -3
- package/src/ContentOverlay/UNSAFE_WrappedModalize.tsx +0 -45
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components-native",
|
|
3
|
-
"version": "0.88.1-JOB-
|
|
3
|
+
"version": "0.88.1-JOB-136074-020f532.3+020f532a0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "React Native implementation of Atlantis",
|
|
6
6
|
"repository": {
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"react-native-safe-area-context": "^5.4.0",
|
|
95
95
|
"react-native-svg": ">=12.0.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "020f532a06bc1651b24f6c7743a11dbd4e72553b"
|
|
98
98
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState, } from "react";
|
|
2
|
+
import { Modalize } from "react-native-modalize";
|
|
2
3
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
3
4
|
import { AccessibilityInfo, Platform, View, findNodeHandle, useWindowDimensions, } from "react-native";
|
|
4
5
|
import { Portal } from "react-native-portalize";
|
|
5
6
|
import { useKeyboardVisibility } from "./hooks/useKeyboardVisibility";
|
|
6
7
|
import { useStyles } from "./ContentOverlay.style";
|
|
7
8
|
import { useViewLayoutHeight } from "./hooks/useViewLayoutHeight";
|
|
8
|
-
import { UNSAFE_WrappedModalize } from "./UNSAFE_WrappedModalize";
|
|
9
9
|
import { useIsScreenReaderEnabled } from "../hooks";
|
|
10
10
|
import { IconButton } from "../IconButton";
|
|
11
11
|
import { Heading } from "../Heading";
|
|
@@ -86,7 +86,7 @@ function ContentOverlayInternal({ children, title, accessibilityLabel, fullScree
|
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
return (React.createElement(React.Fragment, null,
|
|
89
|
-
headerHeightKnown && childrenHeightKnown && (React.createElement(
|
|
89
|
+
headerHeightKnown && childrenHeightKnown && (React.createElement(Modalize, { ref: callbackInternalRef, overlayStyle: styles.overlay, handleStyle: styles.handle, handlePosition: "inside", modalStyle: modalStyle, modalTopOffset: tokens["space-larger"], snapPoint: snapPoint, closeSnapPointStraightEnabled: false, withHandle: isDraggable, panGestureEnabled: isDraggable, adjustToContentHeight: adjustToContentHeight, disableScrollIfPossible: !adjustToContentHeight, onClose: onClose, onOpen: onOpen, keyboardAvoidingBehavior: keyboardAvoidingBehavior, avoidKeyboardLikeIOS: avoidKeyboardLikeIOS, childrenStyle: styles.childrenStyle, onBackButtonPress: onCloseController, closeOnOverlayTap: isCloseableOnOverlayTap, onOpened: () => {
|
|
90
90
|
if (overlayHeader.current) {
|
|
91
91
|
const reactTag = findNodeHandle(overlayHeader.current);
|
|
92
92
|
if (reactTag) {
|
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 { useAtlantisFormContext } from "./context/AtlantisFormContext";
|
|
41
42
|
import { InputAccessoriesProvider } from "../InputText";
|
|
42
43
|
import { tokens } from "../utils/design";
|
|
43
44
|
import { ErrorMessageProvider } from "../ErrorMessageWrapper";
|
|
@@ -102,12 +103,13 @@ function InternalForm({ children, onBeforeSubmit, onSubmit, onSubmitError, onSub
|
|
|
102
103
|
setMessageBannerHeight(event.nativeEvent.layout.height);
|
|
103
104
|
};
|
|
104
105
|
const styles = useStyles();
|
|
106
|
+
const { edgeToEdgeEnabled } = useAtlantisFormContext();
|
|
105
107
|
return (React.createElement(FormProvider, Object.assign({}, formMethods),
|
|
106
108
|
React.createElement(React.Fragment, null,
|
|
107
109
|
(isSubmitting || isSecondaryActionLoading) && React.createElement(FormMask, null),
|
|
108
110
|
React.createElement(FormCache, { localCacheKey: localCacheKey, localCacheExclude: localCacheExclude, setLocalCache: setLocalCache }),
|
|
109
111
|
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 }),
|
|
112
|
+
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 ? tokens["space-large"] : 0, contentContainerStyle: !keyboardHeight && styles.scrollContentContainer }),
|
|
111
113
|
React.createElement(View, { onLayout: ({ nativeEvent }) => {
|
|
112
114
|
setFormContentHeight(nativeEvent.layout.height);
|
|
113
115
|
} },
|
|
@@ -8,6 +8,7 @@ export const atlantisFormContextDefaultValues = {
|
|
|
8
8
|
setLocalCache: () => undefined,
|
|
9
9
|
removeLocalCache: () => undefined,
|
|
10
10
|
}),
|
|
11
|
+
edgeToEdgeEnabled: false,
|
|
11
12
|
};
|
|
12
13
|
export const AtlantisFormContext = createContext(atlantisFormContextDefaultValues);
|
|
13
14
|
export function useAtlantisFormContext() {
|