@draftbit/core 50.0.2 → 50.0.3-6b2618.2
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/lib/commonjs/components/ScreenContainer.js +1 -1
- package/lib/typescript/src/components/ScreenContainer.d.ts +3 -1
- package/lib/typescript/src/components/ScreenContainer.js +8 -2
- package/lib/typescript/src/components/ScreenContainer.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/ScreenContainer.js +8 -2
- package/src/components/ScreenContainer.js.map +1 -1
- package/src/components/ScreenContainer.tsx +13 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/ScreenContainer.tsx";var _excluded=["scrollable","hasSafeArea","hasBottomSafeArea","hasTopSafeArea","theme","style","children"];import*as React from"react";import{StyleSheet,ScrollView,View}from"react-native";import{SafeAreaView}from"react-native-safe-area-context";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";function ScreenContainer(_ref){var _StyleSheet$flatten;var _ref$scrollable=_ref.scrollable,scrollable=_ref$scrollable===void 0?false:_ref$scrollable,_ref$hasSafeArea=_ref.hasSafeArea,hasSafeArea=_ref$hasSafeArea===void 0?false:_ref$hasSafeArea,_ref$hasBottomSafeAre=_ref.hasBottomSafeArea,hasBottomSafeArea=_ref$hasBottomSafeAre===void 0?false:_ref$hasBottomSafeAre,_ref$hasTopSafeArea=_ref.hasTopSafeArea,hasTopSafeArea=_ref$hasTopSafeArea===void 0?false:_ref$hasTopSafeArea,theme=_ref.theme,style=_ref.style,children=_ref.children,rest=_objectWithoutProperties(_ref,_excluded);var backgroundColor=((_StyleSheet$flatten=StyleSheet.flatten(style))==null?void 0:_StyleSheet$flatten.backgroundColor)||theme.colors.background;var edges=[
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/ScreenContainer.tsx";var _excluded=["scrollable","hasSafeArea","hasBottomSafeArea","hasTopSafeArea","hasLeftSafeArea","hasRightSafeArea","theme","style","children"];import*as React from"react";import{StyleSheet,ScrollView,View}from"react-native";import{SafeAreaView}from"react-native-safe-area-context";import{withTheme}from"../theming";import{jsx as _jsx}from"react/jsx-runtime";function ScreenContainer(_ref){var _StyleSheet$flatten;var _ref$scrollable=_ref.scrollable,scrollable=_ref$scrollable===void 0?false:_ref$scrollable,_ref$hasSafeArea=_ref.hasSafeArea,hasSafeArea=_ref$hasSafeArea===void 0?false:_ref$hasSafeArea,_ref$hasBottomSafeAre=_ref.hasBottomSafeArea,hasBottomSafeArea=_ref$hasBottomSafeAre===void 0?false:_ref$hasBottomSafeAre,_ref$hasTopSafeArea=_ref.hasTopSafeArea,hasTopSafeArea=_ref$hasTopSafeArea===void 0?false:_ref$hasTopSafeArea,_ref$hasLeftSafeArea=_ref.hasLeftSafeArea,hasLeftSafeArea=_ref$hasLeftSafeArea===void 0?true:_ref$hasLeftSafeArea,_ref$hasRightSafeArea=_ref.hasRightSafeArea,hasRightSafeArea=_ref$hasRightSafeArea===void 0?true:_ref$hasRightSafeArea,theme=_ref.theme,style=_ref.style,children=_ref.children,rest=_objectWithoutProperties(_ref,_excluded);var backgroundColor=((_StyleSheet$flatten=StyleSheet.flatten(style))==null?void 0:_StyleSheet$flatten.backgroundColor)||theme.colors.background;var edges=[];if(hasSafeArea||hasTopSafeArea){edges.push("top");}if(hasSafeArea||hasBottomSafeArea){edges.push("bottom");}if(hasSafeArea||hasLeftSafeArea){edges.push("left");}if(hasSafeArea||hasRightSafeArea){edges.push("right");}return _jsx(SafeAreaView,Object.assign({edges:edges,style:[styles.container,{backgroundColor:backgroundColor}]},rest,{children:scrollable?_jsx(ScrollView,{contentContainerStyle:[styles.scrollViewContainer,{backgroundColor:backgroundColor},style],children:children}):_jsx(View,{style:[styles.container,{backgroundColor:backgroundColor},style],children:children})}));}var styles=StyleSheet.create({container:{flex:1},scrollViewContainer:{flexGrow:1,flex:undefined}});export default withTheme(ScreenContainer);
|
|
@@ -6,11 +6,13 @@ declare type ScreenContainerProps = {
|
|
|
6
6
|
hasSafeArea?: boolean;
|
|
7
7
|
hasTopSafeArea?: boolean;
|
|
8
8
|
hasBottomSafeArea?: boolean;
|
|
9
|
+
hasLeftSafeArea?: boolean;
|
|
10
|
+
hasRightSafeArea?: boolean;
|
|
9
11
|
theme: Theme;
|
|
10
12
|
style?: StyleProp<ViewStyle>;
|
|
11
13
|
children?: React.ReactNode;
|
|
12
14
|
};
|
|
13
|
-
declare function ScreenContainer({ scrollable, hasSafeArea, hasBottomSafeArea, hasTopSafeArea, theme, style, children, ...rest }: ScreenContainerProps): React.JSX.Element;
|
|
15
|
+
declare function ScreenContainer({ scrollable, hasSafeArea, hasBottomSafeArea, hasTopSafeArea, hasLeftSafeArea, hasRightSafeArea, theme, style, children, ...rest }: ScreenContainerProps): React.JSX.Element;
|
|
14
16
|
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<ScreenContainerProps, "theme"> & {
|
|
15
17
|
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
16
18
|
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<ScreenContainerProps> & typeof ScreenContainer, {}>;
|
|
@@ -2,16 +2,22 @@ import * as React from "react";
|
|
|
2
2
|
import { StyleSheet, ScrollView, View, } from "react-native";
|
|
3
3
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
4
4
|
import { withTheme } from "../theming";
|
|
5
|
-
function ScreenContainer({ scrollable = false, hasSafeArea = false, hasBottomSafeArea = false, hasTopSafeArea = false, theme, style, children, ...rest }) {
|
|
5
|
+
function ScreenContainer({ scrollable = false, hasSafeArea = false, hasBottomSafeArea = false, hasTopSafeArea = false, hasLeftSafeArea = true, hasRightSafeArea = true, theme, style, children, ...rest }) {
|
|
6
6
|
var _a;
|
|
7
7
|
const backgroundColor = ((_a = StyleSheet.flatten(style)) === null || _a === void 0 ? void 0 : _a.backgroundColor) || theme.colors.background;
|
|
8
|
-
const edges = [
|
|
8
|
+
const edges = [];
|
|
9
9
|
if (hasSafeArea || hasTopSafeArea) {
|
|
10
10
|
edges.push("top");
|
|
11
11
|
}
|
|
12
12
|
if (hasSafeArea || hasBottomSafeArea) {
|
|
13
13
|
edges.push("bottom");
|
|
14
14
|
}
|
|
15
|
+
if (hasSafeArea || hasLeftSafeArea) {
|
|
16
|
+
edges.push("left");
|
|
17
|
+
}
|
|
18
|
+
if (hasSafeArea || hasRightSafeArea) {
|
|
19
|
+
edges.push("right");
|
|
20
|
+
}
|
|
15
21
|
return (React.createElement(SafeAreaView, { edges: edges, style: [
|
|
16
22
|
styles.container,
|
|
17
23
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenContainer.js","sourceRoot":"","sources":["../../../../src/components/ScreenContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,UAAU,EACV,UAAU,EAGV,IAAI,GACL,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ScreenContainer.js","sourceRoot":"","sources":["../../../../src/components/ScreenContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,UAAU,EACV,UAAU,EAGV,IAAI,GACL,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAevC,SAAS,eAAe,CAAC,EACvB,UAAU,GAAG,KAA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