@draftbit/core 50.0.3-6b2618.2 → 50.1.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/lib/commonjs/components/Markdown.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlashList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlatList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleScrollView.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSectionList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +1 -1
- package/lib/typescript/src/components/Markdown.d.ts +2 -2
- package/lib/typescript/src/components/Markdown.js +11 -2
- package/lib/typescript/src/components/Markdown.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js +2 -7
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +2 -7
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +2 -7
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +2 -7
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js +2 -7
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js +2 -7
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +2 -7
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.d.ts +1 -2
- package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +5 -36
- package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/Markdown.js +11 -2
- package/src/components/Markdown.js.map +1 -1
- package/src/components/Markdown.tsx +29 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js +2 -7
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.tsx +2 -13
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +2 -7
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.tsx +2 -13
- package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +2 -7
- package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.tsx +2 -12
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +2 -7
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.tsx +2 -13
- package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js +2 -7
- package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.tsx +2 -12
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js +2 -7
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.tsx +2 -13
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +2 -7
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.tsx +2 -13
- package/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js +5 -36
- package/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js.map +1 -1
- package/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.ts +5 -47
|
@@ -1 +1 @@
|
|
|
1
|
-
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Markdown.tsx";import*as React from"react";import{StyleSheet}from"react-native";import MarkdownComponent from"react-native-markdown-display";import{jsx as _jsx}from"react/jsx-runtime";var childToString=function childToString(child){if(typeof child==="undefined"||child===null||typeof child==="boolean"){return"";}if(JSON.stringify(child)==="{}"){return"";}return child.toString();};var Markdown=function Markdown(_ref){var childrenProp=_ref.children,style=_ref.style;var children=React.Children.toArray(childrenProp);var text=children.map(childToString).join("");return _jsx(MarkdownComponent,{style:{body:
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Markdown.tsx";import*as React from"react";import{Text,StyleSheet}from"react-native";import MarkdownComponent from"react-native-markdown-display";import{extractStyles}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";var childToString=function childToString(child){if(typeof child==="undefined"||child===null||typeof child==="boolean"){return"";}if(JSON.stringify(child)==="{}"){return"";}return child.toString();};var Markdown=function Markdown(_ref){var childrenProp=_ref.children,style=_ref.style;var children=React.Children.toArray(childrenProp);var text=children.map(childToString).join("");var bodyStyle=StyleSheet.flatten(style);var _extractStyles=extractStyles(bodyStyle),textStyles=_extractStyles.textStyles;return _jsx(MarkdownComponent,{style:{body:bodyStyle},rules:{strong:function strong(node){return _jsx(Text,{style:Object.assign({},textStyles,{fontWeight:"bold"}),children:node.children[0].content},node.key);}},children:text});};export default Markdown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","data"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SimpleStyleScrollables/SimpleStyleFlashList.tsx";import React from"react";import{FlashList}from"@shopify/flash-list";import useSplitContentContainerStyles from"./useSplitContentContainerStyles";import{jsx as _jsx}from"react/jsx-runtime";var SimpleStyleFlashList=function SimpleStyleFlashList(_ref){var styleProp=_ref.style,data=_ref.data,rest=_objectWithoutProperties(_ref,_excluded);var _useSplitContentConta=useSplitContentContainerStyles(styleProp),style=_useSplitContentConta.style,contentContainerStyle=_useSplitContentConta.contentContainerStyle;return _jsx(FlashList,Object.assign({style:style,contentContainerStyle:contentContainerStyle,data:data},rest));};export default SimpleStyleFlashList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","data"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SimpleStyleScrollables/SimpleStyleFlatList.tsx";import React from"react";import{FlatList}from"react-native";import useSplitContentContainerStyles from"./useSplitContentContainerStyles";import{jsx as _jsx}from"react/jsx-runtime";var SimpleStyleFlatList=function SimpleStyleFlatList(_ref){var styleProp=_ref.style,data=_ref.data,rest=_objectWithoutProperties(_ref,_excluded);var _useSplitContentConta=useSplitContentContainerStyles(styleProp),style=_useSplitContentConta.style,contentContainerStyle=_useSplitContentConta.contentContainerStyle;return _jsx(FlatList,Object.assign({style:style,contentContainerStyle:contentContainerStyle,data:data},rest));};export default SimpleStyleFlatList;
|
package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.tsx";import React from"react";import{KeyboardAwareScrollView}from"react-native-keyboard-aware-scroll-view";import useSplitContentContainerStyles from"./useSplitContentContainerStyles";import{jsx as _jsx}from"react/jsx-runtime";var SimpleStyleKeyboardAwareScrollView=function SimpleStyleKeyboardAwareScrollView(_ref){var styleProp=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);var _useSplitContentConta=useSplitContentContainerStyles(styleProp),style=_useSplitContentConta.style,contentContainerStyle=_useSplitContentConta.contentContainerStyle;return _jsx(KeyboardAwareScrollView,Object.assign({style:style,contentContainerStyle:contentContainerStyle},rest));};export default SimpleStyleKeyboardAwareScrollView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","data"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.tsx";import React from"react";import{MasonryFlashList}from"@shopify/flash-list";import useSplitContentContainerStyles from"./useSplitContentContainerStyles";import{jsx as _jsx}from"react/jsx-runtime";var SimpleStyleMasonryFlashList=function SimpleStyleMasonryFlashList(_ref){var styleProp=_ref.style,data=_ref.data,rest=_objectWithoutProperties(_ref,_excluded);var _useSplitContentConta=useSplitContentContainerStyles(styleProp),style=_useSplitContentConta.style,contentContainerStyle=_useSplitContentConta.contentContainerStyle;return _jsx(MasonryFlashList,Object.assign({style:style,contentContainerStyle:contentContainerStyle,data:data},rest));};export default SimpleStyleMasonryFlashList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SimpleStyleScrollables/SimpleStyleScrollView.tsx";import React from"react";import{ScrollView}from"react-native";import useSplitContentContainerStyles from"./useSplitContentContainerStyles";import{jsx as _jsx}from"react/jsx-runtime";var SimpleStyleScrollView=function SimpleStyleScrollView(_ref){var styleProp=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);var _useSplitContentConta=useSplitContentContainerStyles(styleProp),style=_useSplitContentConta.style,contentContainerStyle=_useSplitContentConta.contentContainerStyle;return _jsx(ScrollView,Object.assign({style:style,contentContainerStyle:contentContainerStyle},rest));};export default SimpleStyleScrollView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","data"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SimpleStyleScrollables/SimpleStyleSectionList.tsx";import React from"react";import{SectionList}from"../SectionList";import useSplitContentContainerStyles from"./useSplitContentContainerStyles";import{jsx as _jsx}from"react/jsx-runtime";var SimpleStyleSectionList=function SimpleStyleSectionList(_ref){var styleProp=_ref.style,data=_ref.data,rest=_objectWithoutProperties(_ref,_excluded);var _useSplitContentConta=useSplitContentContainerStyles(styleProp),style=_useSplitContentConta.style,contentContainerStyle=_useSplitContentConta.contentContainerStyle;return _jsx(SectionList,Object.assign({style:style,contentContainerStyle:contentContainerStyle,data:data},rest));};export default SimpleStyleSectionList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","data"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.tsx";import React from"react";import{SwipeableList}from"../SwipeableItem";import useSplitContentContainerStyles from"./useSplitContentContainerStyles";import{jsx as _jsx}from"react/jsx-runtime";var SimpleStyleSwipeableList=function SimpleStyleSwipeableList(_ref){var styleProp=_ref.style,data=_ref.data,rest=_objectWithoutProperties(_ref,_excluded);var _useSplitContentConta=useSplitContentContainerStyles(styleProp),style=_useSplitContentConta.style,contentContainerStyle=_useSplitContentConta.contentContainerStyle;return _jsx(SwipeableList,Object.assign({style:style,contentContainerStyle:contentContainerStyle,data:data},rest));};export default SimpleStyleSwipeableList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{StyleSheet}from"react-native";import{pick,omit}from"lodash";import{useDeepCompareMemo}from"../../utilities";export var contentContainerStyleNames=["padding","paddingBottom","paddingEnd","paddingHorizontal","paddingLeft","paddingRight","paddingStart","paddingTop","paddingVertical","justifyContent","alignItems","alignContent","flexDirection","flexWrap","gap","columnGap","rowGap"];export default function useSplitContentContainerStyles(originalStyle){return useDeepCompareMemo(function(){var flattenedStyle=StyleSheet.flatten(originalStyle);var contentContainerStyle=pick(flattenedStyle,contentContainerStyleNames);contentContainerStyle.flexGrow=1;var style=omit(flattenedStyle,contentContainerStyleNames);if(style.flex===undefined){style=Object.assign({flexGrow:0},style);}else if(style.flexGrow===undefined){style=Object.assign({flexGrow:style.flex},style);}return{style:style,contentContainerStyle:contentContainerStyle};},[originalStyle]);}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
import { StyleProp, ViewStyle, TextStyle } from "react-native";
|
|
3
3
|
declare type MarkdownProps = {
|
|
4
|
-
style?: StyleProp<ViewStyle>;
|
|
4
|
+
style?: StyleProp<ViewStyle & TextStyle>;
|
|
5
5
|
};
|
|
6
6
|
declare const Markdown: React.FC<React.PropsWithChildren<MarkdownProps>>;
|
|
7
7
|
export default Markdown;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { StyleSheet } from "react-native";
|
|
2
|
+
import { Text, StyleSheet, } from "react-native";
|
|
3
3
|
import MarkdownComponent from "react-native-markdown-display";
|
|
4
|
+
import { extractStyles } from "../utilities";
|
|
4
5
|
const childToString = (child) => {
|
|
5
6
|
if (typeof child === "undefined" ||
|
|
6
7
|
child === null ||
|
|
@@ -15,10 +16,18 @@ const childToString = (child) => {
|
|
|
15
16
|
const Markdown = ({ children: childrenProp, style, }) => {
|
|
16
17
|
const children = React.Children.toArray(childrenProp);
|
|
17
18
|
const text = children.map(childToString).join("");
|
|
19
|
+
const bodyStyle = StyleSheet.flatten(style);
|
|
20
|
+
const { textStyles } = extractStyles(bodyStyle);
|
|
18
21
|
return (
|
|
19
22
|
//'body' style applies to all markdown components
|
|
20
23
|
//@ts-ignore TS does not like the type of this named style for some reason
|
|
21
|
-
React.createElement(MarkdownComponent, { style: { body:
|
|
24
|
+
React.createElement(MarkdownComponent, { style: { body: bodyStyle }, rules: {
|
|
25
|
+
// By default, strong does not work with custom fonts on iOS. This addresses the issue
|
|
26
|
+
strong: (node) => (React.createElement(Text, { key: node.key, style: {
|
|
27
|
+
...textStyles,
|
|
28
|
+
fontWeight: "bold",
|
|
29
|
+
} }, node.children[0].content)),
|
|
30
|
+
} }, text));
|
|
22
31
|
};
|
|
23
32
|
export default Markdown;
|
|
24
33
|
//# sourceMappingURL=Markdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.js","sourceRoot":"","sources":["../../../../src/components/Markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,
|
|
1
|
+
{"version":3,"file":"Markdown.js","sourceRoot":"","sources":["../../../../src/components/Markdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,IAAI,EAIJ,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,OAAO,iBAAiB,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAM7C,MAAM,aAAa,GAAG,CAAC,KAAuB,EAAU,EAAE;IACxD,IACE,OAAO,KAAK,KAAK,WAAW;QAC5B,KAAK,KAAK,IAAI;QACd,OAAO,KAAK,KAAK,SAAS,EAC1B;QACA,OAAO,EAAE,CAAC;KACX;IAED,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE;QAClC,OAAO,EAAE,CAAC;KACX;IAED,OAAQ,KAAyB,CAAC,QAAQ,EAAE,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAqD,CAAC,EAClE,QAAQ,EAAE,YAAY,EACtB,KAAK,GACN,EAAE,EAAE;IACH,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACtD,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAElD,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;IAEhD,OAAO;IACL,iDAAiD;IACjD,0EAA0E;IAC1E,oBAAC,iBAAiB,IAChB,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAC1B,KAAK,EAAE;YACL,sFAAsF;YACtF,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAChB,oBAAC,IAAI,IACH,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,KAAK,EAAE;oBACL,GAAG,UAAU;oBACb,UAAU,EAAE,MAAM;iBACnB,IAEA,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CACpB,CACR;SACF,IAEA,IAAI,CACa,CACrB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -6,13 +6,8 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
8
|
const SimpleStyleFlashList = ({ style: styleProp, data, ...rest }) => {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, measuredWidth, measuredHeight, [data]);
|
|
12
|
-
return (React.createElement(FlashList, { onLayout: (event) => {
|
|
13
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
14
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
15
|
-
}, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
9
|
+
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
10
|
+
return (React.createElement(FlashList, { style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
16
11
|
};
|
|
17
12
|
export default SimpleStyleFlashList;
|
|
18
13
|
//# sourceMappingURL=SimpleStyleFlashList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleFlashList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleFlashList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,oBAAoB,GAAG,CAAgB,EAC3C,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAC0C,EAAE,EAAE;IACrD,MAAM,
|
|
1
|
+
{"version":3,"file":"SimpleStyleFlashList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleFlashList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,oBAAoB,GAAG,CAAgB,EAC3C,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAC0C,EAAE,EAAE;IACrD,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqC,EAC5D,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -6,13 +6,8 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
8
|
const SimpleStyleFlatList = ({ style: styleProp, data, ...rest }) => {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, measuredWidth, measuredHeight, [data]);
|
|
12
|
-
return (React.createElement(FlatList, { onLayout: (event) => {
|
|
13
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
14
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
15
|
-
}, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
9
|
+
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
10
|
+
return (React.createElement(FlatList, { style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
16
11
|
};
|
|
17
12
|
export default SimpleStyleFlatList;
|
|
18
13
|
//# sourceMappingURL=SimpleStyleFlatList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleFlatList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleFlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,mBAAmB,GAAG,CAAgB,EAC1C,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EACyC,EAAE,EAAE;IACpD,MAAM,
|
|
1
|
+
{"version":3,"file":"SimpleStyleFlatList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleFlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,mBAAmB,GAAG,CAAgB,EAC1C,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EACyC,EAAE,EAAE;IACpD,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,QAAQ,IACP,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js
CHANGED
|
@@ -6,13 +6,8 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
8
|
const SimpleStyleKeyboardAwareScrollView = ({ style: styleProp, ...rest }) => {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, measuredWidth, measuredHeight);
|
|
12
|
-
return (React.createElement(KeyboardAwareScrollView, { onLayout: (event) => {
|
|
13
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
14
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
15
|
-
}, style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
9
|
+
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
10
|
+
return (React.createElement(KeyboardAwareScrollView, { style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
16
11
|
};
|
|
17
12
|
export default SimpleStyleKeyboardAwareScrollView;
|
|
18
13
|
//# sourceMappingURL=SimpleStyleKeyboardAwareScrollView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleKeyboardAwareScrollView.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,kCAAkC,GAEpC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACpC,MAAM,
|
|
1
|
+
{"version":3,"file":"SimpleStyleKeyboardAwareScrollView.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,kCAAkC,GAEpC,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACpC,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,uBAAuB,IACtB,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,KACxC,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kCAAkC,CAAC"}
|
|
@@ -6,13 +6,8 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
8
|
const SimpleStyleMasonryFlashList = ({ style: styleProp, data, ...rest }) => {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, measuredWidth, measuredHeight, [data]);
|
|
12
|
-
return (React.createElement(MasonryFlashList, { onLayout: (event) => {
|
|
13
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
14
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
15
|
-
}, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
9
|
+
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
10
|
+
return (React.createElement(MasonryFlashList, { style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
16
11
|
};
|
|
17
12
|
export default SimpleStyleMasonryFlashList;
|
|
18
13
|
//# sourceMappingURL=SimpleStyleMasonryFlashList.js.map
|
package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleMasonryFlashList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,2BAA2B,GAAG,CAAgB,EAClD,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EACiD,EAAE,EAAE;IAC5D,MAAM,
|
|
1
|
+
{"version":3,"file":"SimpleStyleMasonryFlashList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,2BAA2B,GAAG,CAAgB,EAClD,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EACiD,EAAE,EAAE;IAC5D,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,gBAAgB,IACf,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqC,EAC5D,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
|
|
@@ -6,13 +6,8 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
8
|
const SimpleStyleScrollView = ({ style: styleProp, ...rest }) => {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, measuredWidth, measuredHeight);
|
|
12
|
-
return (React.createElement(ScrollView, { onLayout: (event) => {
|
|
13
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
14
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
15
|
-
}, style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
9
|
+
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
10
|
+
return (React.createElement(ScrollView, { style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
16
11
|
};
|
|
17
12
|
export default SimpleStyleScrollView;
|
|
18
13
|
//# sourceMappingURL=SimpleStyleScrollView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleScrollView.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,qBAAqB,GAEvB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACpC,MAAM,
|
|
1
|
+
{"version":3,"file":"SimpleStyleScrollView.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,qBAAqB,GAEvB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACpC,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,KACxC,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -6,15 +6,10 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
8
|
const SimpleStyleSectionList = ({ style: styleProp, data, ...rest }) => {
|
|
9
|
-
const
|
|
10
|
-
const [measuredHeight, setMeasuredHeight] = React.useState();
|
|
11
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, measuredWidth, measuredHeight, [data]);
|
|
9
|
+
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
12
10
|
return (
|
|
13
11
|
//@ts-ignore contentContainerStyle has different types for FlashList and FlatList implmentations and confuses TS
|
|
14
|
-
React.createElement(SectionList, {
|
|
15
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
16
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
17
|
-
}, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
12
|
+
React.createElement(SectionList, { style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
18
13
|
};
|
|
19
14
|
export default SimpleStyleSectionList;
|
|
20
15
|
//# sourceMappingURL=SimpleStyleSectionList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleSectionList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleSectionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK7C,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,sBAAsB,GAAG,CAAmC,EAChE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAIR,EAAE,EAAE;IACH,MAAM,
|
|
1
|
+
{"version":3,"file":"SimpleStyleSectionList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleSectionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK7C,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,sBAAsB,GAAG,CAAmC,EAChE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAIR,EAAE,EAAE;IACH,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO;IACL,gHAAgH;IAChH,oBAAC,WAAW,IACV,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -6,15 +6,10 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
8
|
const SimpleStyleSwipeableList = ({ style: styleProp, data, ...rest }) => {
|
|
9
|
-
const
|
|
10
|
-
const [measuredHeight, setMeasuredHeight] = React.useState();
|
|
11
|
-
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp, measuredWidth, measuredHeight, [data]);
|
|
9
|
+
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
12
10
|
return (
|
|
13
11
|
//@ts-ignore contentContainerStyle has different types for FlashList and FlatList implmentations and confuses TS
|
|
14
|
-
React.createElement(SwipeableList, {
|
|
15
|
-
setMeasuredWidth(event.nativeEvent.layout.width);
|
|
16
|
-
setMeasuredHeight(event.nativeEvent.layout.height);
|
|
17
|
-
}, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
12
|
+
React.createElement(SwipeableList, { style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
18
13
|
};
|
|
19
14
|
export default SimpleStyleSwipeableList;
|
|
20
15
|
//# sourceMappingURL=SimpleStyleSwipeableList.js.map
|
package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleSwipeableList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKjD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,wBAAwB,GAAG,CAAmC,EAClE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAIR,EAAE,EAAE;IACH,MAAM,
|
|
1
|
+
{"version":3,"file":"SimpleStyleSwipeableList.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAKjD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAE9E;;;GAGG;AACH,MAAM,wBAAwB,GAAG,CAAmC,EAClE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAIR,EAAE,EAAE;IACH,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO;IACL,gHAAgH;IAChH,oBAAC,aAAa,IACZ,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { StyleProp, ViewStyle } from "react-native";
|
|
3
2
|
interface Styles {
|
|
4
3
|
style?: StyleProp<ViewStyle>;
|
|
5
4
|
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
6
5
|
}
|
|
7
6
|
export declare const contentContainerStyleNames: string[];
|
|
8
|
-
export default function useSplitContentContainerStyles(originalStyle: StyleProp<ViewStyle
|
|
7
|
+
export default function useSplitContentContainerStyles(originalStyle: StyleProp<ViewStyle>): Styles;
|
|
9
8
|
export {};
|
package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { StyleSheet } from "react-native";
|
|
3
2
|
import { pick, omit } from "lodash";
|
|
4
3
|
import { useDeepCompareMemo } from "../../utilities";
|
|
@@ -21,39 +20,12 @@ export const contentContainerStyleNames = [
|
|
|
21
20
|
"columnGap",
|
|
22
21
|
"rowGap",
|
|
23
22
|
];
|
|
24
|
-
export default function useSplitContentContainerStyles(originalStyle
|
|
25
|
-
// This temporarily removes contentContainerStyle min sizes whenever some
|
|
26
|
-
// given dependencies change to allow the list to properly recalculate it's measured size
|
|
27
|
-
const [tempContentContainerStyle, setTempContentContainerStyle] = React.useState(null);
|
|
28
|
-
React.useEffect(() => {
|
|
29
|
-
if (tempContentContainerStyle) {
|
|
30
|
-
setTempContentContainerStyle(null);
|
|
31
|
-
}
|
|
32
|
-
// We only want this to run when measured size changes
|
|
33
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
34
|
-
}, [measuredHeight, measuredWidth]);
|
|
35
|
-
React.useEffect(() => {
|
|
36
|
-
setTempContentContainerStyle({ minHeight: 0, minWidth: 0 });
|
|
37
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
|
-
}, recalculateSizeDeps);
|
|
23
|
+
export default function useSplitContentContainerStyles(originalStyle) {
|
|
39
24
|
return useDeepCompareMemo(() => {
|
|
40
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
41
25
|
const flattenedStyle = StyleSheet.flatten(originalStyle);
|
|
42
|
-
|
|
43
|
-
const leftBorderWidth = (_b = (_a = flattenedStyle === null || flattenedStyle === void 0 ? void 0 : flattenedStyle.borderLeftWidth) !== null && _a !== void 0 ? _a : flattenedStyle === null || flattenedStyle === void 0 ? void 0 : flattenedStyle.borderWidth) !== null && _b !== void 0 ? _b : 0;
|
|
44
|
-
const rightBorderWidth = (_d = (_c = flattenedStyle === null || flattenedStyle === void 0 ? void 0 : flattenedStyle.borderRightWidth) !== null && _c !== void 0 ? _c : flattenedStyle === null || flattenedStyle === void 0 ? void 0 : flattenedStyle.borderWidth) !== null && _d !== void 0 ? _d : 0;
|
|
45
|
-
const topBorderWidth = (_f = (_e = flattenedStyle === null || flattenedStyle === void 0 ? void 0 : flattenedStyle.borderTopWidth) !== null && _e !== void 0 ? _e : flattenedStyle === null || flattenedStyle === void 0 ? void 0 : flattenedStyle.borderWidth) !== null && _f !== void 0 ? _f : 0;
|
|
46
|
-
const bottomBorderWidth = (_h = (_g = flattenedStyle === null || flattenedStyle === void 0 ? void 0 : flattenedStyle.borderBottomWidth) !== null && _g !== void 0 ? _g : flattenedStyle === null || flattenedStyle === void 0 ? void 0 : flattenedStyle.borderWidth) !== null && _h !== void 0 ? _h : 0;
|
|
26
|
+
const contentContainerStyle = pick(flattenedStyle, contentContainerStyleNames);
|
|
47
27
|
// contentContainerStyle should always at least fill the parent to ensure sizing changes reflects properly on component and children.
|
|
48
|
-
|
|
49
|
-
if (measuredWidth) {
|
|
50
|
-
contentContainerStyle.minWidth =
|
|
51
|
-
measuredWidth - leftBorderWidth - rightBorderWidth;
|
|
52
|
-
}
|
|
53
|
-
if (measuredHeight) {
|
|
54
|
-
contentContainerStyle.minHeight =
|
|
55
|
-
measuredHeight - topBorderWidth - bottomBorderWidth;
|
|
56
|
-
}
|
|
28
|
+
contentContainerStyle.flexGrow = 1;
|
|
57
29
|
let style = omit(flattenedStyle, contentContainerStyleNames);
|
|
58
30
|
// ScrollView's implementation defaults flexGrow to 1, which prevents the ability to set a static size or use a flex larger than 1
|
|
59
31
|
// See: https://github.com/facebook/react-native/issues/3422
|
|
@@ -65,11 +37,8 @@ export default function useSplitContentContainerStyles(originalStyle, measuredWi
|
|
|
65
37
|
}
|
|
66
38
|
return {
|
|
67
39
|
style,
|
|
68
|
-
contentContainerStyle
|
|
69
|
-
contentContainerStyle,
|
|
70
|
-
tempContentContainerStyle,
|
|
71
|
-
]),
|
|
40
|
+
contentContainerStyle,
|
|
72
41
|
};
|
|
73
|
-
}, [originalStyle
|
|
42
|
+
}, [originalStyle]);
|
|
74
43
|
}
|
|
75
44
|
//# sourceMappingURL=useSplitContentContainerStyles.js.map
|
package/lib/typescript/src/components/SimpleStyleScrollables/useSplitContentContainerStyles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSplitContentContainerStyles.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/useSplitContentContainerStyles.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useSplitContentContainerStyles.js","sourceRoot":"","sources":["../../../../../src/components/SimpleStyleScrollables/useSplitContentContainerStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,UAAU,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAOrD,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,SAAS;IACT,eAAe;IACf,YAAY;IACZ,mBAAmB;IACnB,aAAa;IACb,cAAc;IACd,cAAc;IACd,YAAY;IACZ,iBAAiB;IACjB,gBAAgB;IAChB,YAAY;IACZ,cAAc;IACd,eAAe;IACf,UAAU;IACV,KAAK;IACL,WAAW;IACX,QAAQ;CACT,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,8BAA8B,CACpD,aAAmC;IAEnC,OAAO,kBAAkB,CAAS,GAAG,EAAE;QACrC,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAEzD,MAAM,qBAAqB,GAAG,IAAI,CAChC,cAAc,EACd,0BAA0B,CAC3B,CAAC;QAEF,qIAAqI;QACrI,qBAAqB,CAAC,QAAQ,GAAG,CAAC,CAAC;QAEnC,IAAI,KAAK,GAAG,IAAI,CAAC,cAAc,EAAE,0BAA0B,CAAC,CAAC;QAE7D,kIAAkI;QAClI,4DAA4D;QAC5D,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE;YAC5B,KAAK,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;SACnC;aAAM,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,EAAE;YACvC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC;SAC5C;QAED,OAAO;YACL,KAAK;YACL,qBAAqB;SACtB,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;AACtB,CAAC"}
|