@draftbit/core 49.5.2-ff55cf.2 → 49.5.3-d0d605.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/Checkbox/CheckboxRow.js +1 -1
- package/lib/commonjs/components/ScreenContainer.js +1 -1
- package/lib/commonjs/components/SectionList/SectionList.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/SwipeableItem/SwipeableList.js +1 -1
- package/lib/commonjs/components/TabView/TabView.js +1 -1
- package/lib/typescript/src/components/Checkbox/CheckboxRow.js +3 -3
- package/lib/typescript/src/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/typescript/src/components/ScreenContainer.js +1 -2
- package/lib/typescript/src/components/ScreenContainer.js.map +1 -1
- package/lib/typescript/src/components/SectionList/SectionList.d.ts +6 -4
- package/lib/typescript/src/components/SectionList/SectionList.js +4 -4
- package/lib/typescript/src/components/SectionList/SectionList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.d.ts +2 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js +3 -3
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.d.ts +2 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +3 -3
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.d.ts +2 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +3 -3
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.d.ts +2 -2
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +3 -3
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.d.ts +2 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js +3 -3
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.d.ts +6 -2
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js +3 -3
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.d.ts +6 -2
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +3 -3
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js.map +1 -1
- package/lib/typescript/src/components/SwipeableItem/SwipeableList.d.ts +3 -3
- package/lib/typescript/src/components/SwipeableItem/SwipeableList.js +4 -4
- package/lib/typescript/src/components/SwipeableItem/SwipeableList.js.map +1 -1
- package/lib/typescript/src/components/TabView/TabView.d.ts +2 -0
- package/lib/typescript/src/components/TabView/TabView.js +17 -2
- package/lib/typescript/src/components/TabView/TabView.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -3
- package/src/components/Checkbox/CheckboxRow.js +3 -3
- package/src/components/Checkbox/CheckboxRow.js.map +1 -1
- package/src/components/Checkbox/CheckboxRow.tsx +3 -3
- package/src/components/ScreenContainer.js +1 -2
- package/src/components/ScreenContainer.js.map +1 -1
- package/src/components/ScreenContainer.tsx +1 -2
- package/src/components/SectionList/SectionList.js +4 -4
- package/src/components/SectionList/SectionList.js.map +1 -1
- package/src/components/SectionList/SectionList.tsx +152 -145
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js +3 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleFlashList.tsx +22 -16
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +3 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.tsx +22 -16
- package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js +3 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleKeyboardAwareScrollView.tsx +20 -13
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js +3 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleMasonryFlashList.tsx +27 -17
- package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js +3 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleScrollView.tsx +20 -13
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js +3 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.tsx +28 -20
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js +3 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.tsx +28 -20
- package/src/components/SwipeableItem/SwipeableList.js +4 -4
- package/src/components/SwipeableItem/SwipeableList.js.map +1 -1
- package/src/components/SwipeableItem/SwipeableList.tsx +47 -32
- package/src/components/TabView/TabView.js +17 -2
- package/src/components/TabView/TabView.js.map +1 -1
- package/src/components/TabView/TabView.tsx +19 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "49.5.
|
|
3
|
+
"version": "49.5.3-d0d605.2+d0d6051",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"types": "lib/typescript/src/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/theme": "^49.5.
|
|
44
|
+
"@draftbit/theme": "^49.5.3-d0d605.2+d0d6051",
|
|
45
45
|
"@expo/vector-icons": "^13.0.0",
|
|
46
46
|
"@gorhom/bottom-sheet": "5.0.0-alpha.7",
|
|
47
47
|
"@material-ui/core": "^4.11.0",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"react-native-swipe-list-view": "^3.2.9",
|
|
73
73
|
"react-native-tab-view": "^3.4.0",
|
|
74
74
|
"react-native-web-swiper": "^2.2.3",
|
|
75
|
+
"react-native-webview": "13.6.3",
|
|
75
76
|
"react-native-youtube-iframe": "^2.2.2",
|
|
76
77
|
"react-youtube": "^10.1.0",
|
|
77
78
|
"uuid": "^9.0.1"
|
|
@@ -115,5 +116,5 @@
|
|
|
115
116
|
],
|
|
116
117
|
"testEnvironment": "node"
|
|
117
118
|
},
|
|
118
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "d0d605196758d5d37e470ae05d8ee8351d4b1091"
|
|
119
120
|
}
|
|
@@ -46,7 +46,7 @@ const CheckboxRow = ({ label = "Label", labelStyle, labelContainerStyle, checkbo
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
const { textStyles, viewStyles } = extractStyles(style);
|
|
49
|
-
return (React.createElement(Pressable, { onPress: handlePress, style: [
|
|
49
|
+
return (React.createElement(Pressable, { onPress: handlePress, style: [styles.mainParent, viewStyles, , { flexDirection: direction }], disabled: disabled, ...rest },
|
|
50
50
|
React.createElement(View, { style: [
|
|
51
51
|
styles.label,
|
|
52
52
|
{
|
|
@@ -60,9 +60,9 @@ const styles = StyleSheet.create({
|
|
|
60
60
|
mainParent: {
|
|
61
61
|
alignItems: "center",
|
|
62
62
|
justifyContent: "space-around",
|
|
63
|
-
|
|
63
|
+
paddingLeft: 20,
|
|
64
|
+
paddingRight: 20,
|
|
64
65
|
minHeight: 50,
|
|
65
|
-
paddingEnd: 20,
|
|
66
66
|
display: "flex",
|
|
67
67
|
...Platform.select({
|
|
68
68
|
web: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxRow.js","sourceRoot":"","sources":["CheckboxRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,UAAU,EAEV,IAAI,EACJ,QAAQ,EACR,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAGlC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,QAA2B,MAAM,YAAY,CAAC;AACrD,OAAO,EAAa,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE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AAE,IAAI,GACV,CACQ,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,UAAU,EAAE;QACV,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,EAAE;QACf,YAAY,EAAE,EAAE;QAChB,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,MAAM;QACf,GAAG,QAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,MAAM,EAAE,SAAS;gBACjB,UAAU,EAAE,MAAM;aACnB;SACF,CAAC;KACH;IACD,KAAK,EAAE;QACL,IAAI,EAAE,CAAC;KACR;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -105,7 +105,7 @@ const CheckboxRow: React.FC<CheckboxRowProps & IconSlot> = ({
|
|
|
105
105
|
return (
|
|
106
106
|
<Pressable
|
|
107
107
|
onPress={handlePress}
|
|
108
|
-
style={[
|
|
108
|
+
style={[styles.mainParent, viewStyles, , { flexDirection: direction }]}
|
|
109
109
|
disabled={disabled}
|
|
110
110
|
{...rest}
|
|
111
111
|
>
|
|
@@ -145,9 +145,9 @@ const styles = StyleSheet.create({
|
|
|
145
145
|
mainParent: {
|
|
146
146
|
alignItems: "center",
|
|
147
147
|
justifyContent: "space-around",
|
|
148
|
-
|
|
148
|
+
paddingLeft: 20,
|
|
149
|
+
paddingRight: 20,
|
|
149
150
|
minHeight: 50,
|
|
150
|
-
paddingEnd: 20,
|
|
151
151
|
display: "flex",
|
|
152
152
|
...Platform.select({
|
|
153
153
|
web: {
|
|
@@ -4,8 +4,7 @@ import { SafeAreaView } from "react-native-safe-area-context";
|
|
|
4
4
|
import { withTheme } from "@draftbit/theme";
|
|
5
5
|
function ScreenContainer({ scrollable = false, hasSafeArea = false, hasBottomSafeArea = false, hasTopSafeArea = false, hasLeftSafeArea = true, hasRightSafeArea = true, theme, style, children, ...rest }) {
|
|
6
6
|
var _a;
|
|
7
|
-
const backgroundColor = ((_a = StyleSheet.flatten(style)) === null || _a === void 0 ? void 0 : _a.backgroundColor) ||
|
|
8
|
-
theme.colors.branding.background.brand;
|
|
7
|
+
const backgroundColor = ((_a = StyleSheet.flatten(style)) === null || _a === void 0 ? void 0 : _a.backgroundColor) || theme.colors.background.brand;
|
|
9
8
|
const edges = [];
|
|
10
9
|
if (hasSafeArea || hasTopSafeArea) {
|
|
11
10
|
edges.push("top");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenContainer.js","sourceRoot":"","sources":["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,iBAAiB,CAAC;AAe5C,SAAS,eAAe,CAAC,EACvB,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,KAAK,EACnB,iBAAiB,GAAG,KAAK,EACzB,cAAc,GAAG,KAAK,EACtB,eAAe,GAAG,IAAI,EACtB,gBAAgB,GAAG,IAAI,EACvB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACc;;IACrB,MAAM,eAAe,GACnB,CAAA,MAAA,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,0CAAE,eAAe
|
|
1
|
+
{"version":3,"file":"ScreenContainer.js","sourceRoot":"","sources":["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,iBAAiB,CAA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,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;KACR;IACD,mBAAmB,EAAE;QACnB,QAAQ,EAAE,CAAC;QACX,IAAI,EAAE,SAAS;KAChB;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -36,8 +36,7 @@ function ScreenContainer({
|
|
|
36
36
|
...rest
|
|
37
37
|
}: ScreenContainerProps) {
|
|
38
38
|
const backgroundColor =
|
|
39
|
-
StyleSheet.flatten(style)?.backgroundColor ||
|
|
40
|
-
theme.colors.branding.background.brand;
|
|
39
|
+
StyleSheet.flatten(style)?.backgroundColor || theme.colors.background.brand;
|
|
41
40
|
|
|
42
41
|
const edges: Edge[] = [];
|
|
43
42
|
if (hasSafeArea || hasTopSafeArea) {
|
|
@@ -4,7 +4,7 @@ import { FlatList } from "react-native";
|
|
|
4
4
|
import SectionHeader, { DefaultSectionHeader } from "./SectionHeader";
|
|
5
5
|
import { flattenReactFragments } from "../../utilities";
|
|
6
6
|
export const DEFAULT_SECTION = "Uncategorized";
|
|
7
|
-
const SectionList = ({ sectionKey, stickyHeader = false, listComponent = "FlatList", data: dataProp, renderItem: renderItemProp, keyExtractor: keyExtractorProp, ...rest }) => {
|
|
7
|
+
const SectionList = React.forwardRef(({ sectionKey, stickyHeader = false, listComponent = "FlatList", data: dataProp, renderItem: renderItemProp, keyExtractor: keyExtractorProp, ...rest }, ref) => {
|
|
8
8
|
const data = React.useMemo(() => (Array.isArray(dataProp) ? dataProp : []), [dataProp]);
|
|
9
9
|
const dataWithSections = React.useMemo(() => {
|
|
10
10
|
var _a;
|
|
@@ -102,10 +102,10 @@ const SectionList = ({ sectionKey, stickyHeader = false, listComponent = "FlatLi
|
|
|
102
102
|
};
|
|
103
103
|
switch (listComponent) {
|
|
104
104
|
case "FlatList":
|
|
105
|
-
return (React.createElement(FlatList, { stickyHeaderIndices: sectionHeaderIndicies, ...rest, data: dataWithSections, renderItem: renderItem, keyExtractor: keyExtractor }));
|
|
105
|
+
return (React.createElement(FlatList, { ref: ref, stickyHeaderIndices: sectionHeaderIndicies, ...rest, data: dataWithSections, renderItem: renderItem, keyExtractor: keyExtractor }));
|
|
106
106
|
case "FlashList":
|
|
107
|
-
return (React.createElement(FlashList, { stickyHeaderIndices: sectionHeaderIndicies, ...rest, data: dataWithSections, renderItem: renderItem, keyExtractor: keyExtractor }));
|
|
107
|
+
return (React.createElement(FlashList, { ref: ref, stickyHeaderIndices: sectionHeaderIndicies, ...rest, data: dataWithSections, renderItem: renderItem, keyExtractor: keyExtractor }));
|
|
108
108
|
}
|
|
109
|
-
};
|
|
109
|
+
});
|
|
110
110
|
export default SectionList;
|
|
111
111
|
//# sourceMappingURL=SectionList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionList.js","sourceRoot":"","sources":["SectionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAiB,QAAQ,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,aAAa,EAAE,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAqCxD,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;AAE/C,MAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"SectionList.js","sourceRoot":"","sources":["SectionList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAkB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAiB,QAAQ,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,aAAa,EAAE,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EA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F;IACH,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,CAAC,IAAwB,EAAE,KAAa,EAAE,EAAE;QAC/D,QAAQ,IAAI,CAAC,IAAI,EAAE;YACjB,KAAK,cAAc,CAAC,CAAC;gBACnB,OAAO,WAAW,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;aACtC;YACD,KAAK,WAAW,CAAC,CAAC;gBAChB,OAAO,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAG,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,KAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;aACjE;SACF;IACH,CAAC,CAAC;IAEF,QAAQ,aAAa,EAAE;QACrB,KAAK,UAAU;YACb,OAAO,CACL,oBAAC,QAAQ,IACP,GAAG,EAAE,GAA0B,EAC/B,mBAAmB,EAAE,qBAAqB,KACrC,IAA0C,EAC/C,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;QACJ,KAAK,WAAW;YACd,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAA+C,EACpD,mBAAmB,EAAE,qBAAqB,KACrC,IAA2C,EAChD,IAAI,EAAE,gBAAgB,EACtB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,GAC1B,CACH,CAAC;KACL;AACH,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -41,168 +41,175 @@ type SectionListItem<T> = SectionListDataItem<T> | SectionListSectionItem;
|
|
|
41
41
|
|
|
42
42
|
export const DEFAULT_SECTION = "Uncategorized";
|
|
43
43
|
|
|
44
|
-
const SectionList =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
for (const item of data) {
|
|
63
|
-
const section = item[sectionKey]?.toString() || DEFAULT_SECTION;
|
|
64
|
-
if (sectionDataItems[section]) {
|
|
65
|
-
sectionDataItems[section].push(item);
|
|
66
|
-
} else {
|
|
67
|
-
sectionDataItems[section] = [item];
|
|
68
|
-
}
|
|
69
|
-
}
|
|
44
|
+
const SectionList = React.forwardRef(
|
|
45
|
+
<T extends { [key: string]: any }>(
|
|
46
|
+
{
|
|
47
|
+
sectionKey,
|
|
48
|
+
stickyHeader = false,
|
|
49
|
+
listComponent = "FlatList",
|
|
50
|
+
data: dataProp,
|
|
51
|
+
renderItem: renderItemProp,
|
|
52
|
+
keyExtractor: keyExtractorProp,
|
|
53
|
+
...rest
|
|
54
|
+
}: FlatListSectionListProps<T> | FlashListSectionListProps<T>,
|
|
55
|
+
ref: React.Ref<FlatList | FlashList<any>>
|
|
56
|
+
) => {
|
|
57
|
+
const data = React.useMemo(
|
|
58
|
+
() => (Array.isArray(dataProp) ? dataProp : []) as T[],
|
|
59
|
+
[dataProp]
|
|
60
|
+
);
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
result
|
|
73
|
-
const
|
|
74
|
-
section
|
|
75
|
-
].map((item) => ({ type: "DATA_ITEM", data: item }));
|
|
76
|
-
result.push(...sectionItems);
|
|
77
|
-
}
|
|
62
|
+
const dataWithSections = React.useMemo(() => {
|
|
63
|
+
const result: SectionListItem<T>[] = [];
|
|
64
|
+
const sectionDataItems: { [key: string]: T[] } = {};
|
|
78
65
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (!element) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
66
|
+
for (const item of data) {
|
|
67
|
+
const section = item[sectionKey]?.toString() || DEFAULT_SECTION;
|
|
68
|
+
if (sectionDataItems[section]) {
|
|
69
|
+
sectionDataItems[section].push(item);
|
|
70
|
+
} else {
|
|
71
|
+
sectionDataItems[section] = [item];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
for (const section in sectionDataItems) {
|
|
76
|
+
result.push({ type: "SECTION_ITEM", title: section });
|
|
77
|
+
const sectionItems: SectionListDataItem<T>[] = sectionDataItems[
|
|
78
|
+
section
|
|
79
|
+
].map((item) => ({ type: "DATA_ITEM", data: item }));
|
|
80
|
+
result.push(...sectionItems);
|
|
81
|
+
}
|
|
98
82
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
83
|
+
return result;
|
|
84
|
+
}, [data, sectionKey]);
|
|
85
|
+
|
|
86
|
+
const sectionHeaderIndicies = React.useMemo(
|
|
87
|
+
() =>
|
|
88
|
+
stickyHeader
|
|
89
|
+
? dataWithSections
|
|
90
|
+
.filter((item) => item.type === "SECTION_ITEM")
|
|
91
|
+
.map((item) => dataWithSections.indexOf(item))
|
|
92
|
+
: undefined,
|
|
93
|
+
[dataWithSections, stickyHeader]
|
|
102
94
|
);
|
|
103
95
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return child;
|
|
110
|
-
}
|
|
96
|
+
const extractSectionHeader = (
|
|
97
|
+
element: JSX.Element | null
|
|
98
|
+
): JSX.Element | null => {
|
|
99
|
+
if (!element) {
|
|
100
|
+
return null;
|
|
111
101
|
}
|
|
112
|
-
}
|
|
113
|
-
return null;
|
|
114
|
-
};
|
|
115
102
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
103
|
+
const props = element.props || {};
|
|
104
|
+
const children = flattenReactFragments(
|
|
105
|
+
React.Children.toArray(props.children) as React.ReactElement[]
|
|
106
|
+
);
|
|
122
107
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const newChildren = [];
|
|
131
|
-
for (const child of children) {
|
|
132
|
-
if (child.type !== SectionHeader) {
|
|
133
|
-
newChildren.push(child);
|
|
108
|
+
if (element.type === SectionHeader) {
|
|
109
|
+
return element;
|
|
110
|
+
} else {
|
|
111
|
+
for (const child of children) {
|
|
112
|
+
if (child.type === SectionHeader) {
|
|
113
|
+
return child;
|
|
114
|
+
}
|
|
134
115
|
}
|
|
135
116
|
}
|
|
136
|
-
return
|
|
137
|
-
|
|
138
|
-
children: newChildren,
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
};
|
|
117
|
+
return null;
|
|
118
|
+
};
|
|
142
119
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
index: number;
|
|
149
|
-
}) => {
|
|
150
|
-
switch (item.type) {
|
|
151
|
-
case "SECTION_ITEM": {
|
|
152
|
-
const renderedItem = renderItemProp({
|
|
153
|
-
index,
|
|
154
|
-
section: item.title,
|
|
155
|
-
});
|
|
156
|
-
return (
|
|
157
|
-
extractSectionHeader(renderedItem) || (
|
|
158
|
-
<DefaultSectionHeader title={item.title} />
|
|
159
|
-
)
|
|
160
|
-
);
|
|
120
|
+
const extractRemainingNonSectionHeader = (
|
|
121
|
+
element: JSX.Element | null
|
|
122
|
+
): JSX.Element | null => {
|
|
123
|
+
if (!element) {
|
|
124
|
+
return null;
|
|
161
125
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
126
|
+
|
|
127
|
+
const props = element.props || {};
|
|
128
|
+
const children = flattenReactFragments(
|
|
129
|
+
React.Children.toArray(props.children) as React.ReactElement[]
|
|
130
|
+
);
|
|
131
|
+
if (element.type === SectionHeader) {
|
|
132
|
+
return null;
|
|
133
|
+
} else {
|
|
134
|
+
const newChildren = [];
|
|
135
|
+
for (const child of children) {
|
|
136
|
+
if (child.type !== SectionHeader) {
|
|
137
|
+
newChildren.push(child);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return React.cloneElement(element, {
|
|
141
|
+
...props,
|
|
142
|
+
children: newChildren,
|
|
167
143
|
});
|
|
168
|
-
return extractRemainingNonSectionHeader(renderedItem);
|
|
169
144
|
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const renderItem = ({
|
|
148
|
+
item,
|
|
149
|
+
index,
|
|
150
|
+
}: {
|
|
151
|
+
item: SectionListItem<T>;
|
|
152
|
+
index: number;
|
|
153
|
+
}) => {
|
|
154
|
+
switch (item.type) {
|
|
155
|
+
case "SECTION_ITEM": {
|
|
156
|
+
const renderedItem = renderItemProp({
|
|
157
|
+
index,
|
|
158
|
+
section: item.title,
|
|
159
|
+
});
|
|
160
|
+
return (
|
|
161
|
+
extractSectionHeader(renderedItem) || (
|
|
162
|
+
<DefaultSectionHeader title={item.title} />
|
|
163
|
+
)
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
case "DATA_ITEM": {
|
|
167
|
+
const renderedItem = renderItemProp({
|
|
168
|
+
item: item.data,
|
|
169
|
+
index,
|
|
170
|
+
section: item.data[sectionKey] || DEFAULT_SECTION,
|
|
171
|
+
});
|
|
172
|
+
return extractRemainingNonSectionHeader(renderedItem);
|
|
173
|
+
}
|
|
177
174
|
}
|
|
178
|
-
|
|
179
|
-
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
const keyExtractor = (item: SectionListItem<T>, index: number) => {
|
|
178
|
+
switch (item.type) {
|
|
179
|
+
case "SECTION_ITEM": {
|
|
180
|
+
return `section_${index.toString()}`;
|
|
181
|
+
}
|
|
182
|
+
case "DATA_ITEM": {
|
|
183
|
+
return keyExtractorProp?.(item.data, index) || index.toString();
|
|
184
|
+
}
|
|
180
185
|
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
switch (listComponent) {
|
|
189
|
+
case "FlatList":
|
|
190
|
+
return (
|
|
191
|
+
<FlatList
|
|
192
|
+
ref={ref as React.Ref<FlatList>}
|
|
193
|
+
stickyHeaderIndices={sectionHeaderIndicies}
|
|
194
|
+
{...(rest as FlatListProps<SectionListItem<T>>)}
|
|
195
|
+
data={dataWithSections}
|
|
196
|
+
renderItem={renderItem}
|
|
197
|
+
keyExtractor={keyExtractor}
|
|
198
|
+
/>
|
|
199
|
+
);
|
|
200
|
+
case "FlashList":
|
|
201
|
+
return (
|
|
202
|
+
<FlashList
|
|
203
|
+
ref={ref as React.Ref<FlashList<SectionListItem<T>>>}
|
|
204
|
+
stickyHeaderIndices={sectionHeaderIndicies}
|
|
205
|
+
{...(rest as FlashListProps<SectionListItem<T>>)}
|
|
206
|
+
data={dataWithSections}
|
|
207
|
+
renderItem={renderItem}
|
|
208
|
+
keyExtractor={keyExtractor}
|
|
209
|
+
/>
|
|
210
|
+
);
|
|
181
211
|
}
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
switch (listComponent) {
|
|
185
|
-
case "FlatList":
|
|
186
|
-
return (
|
|
187
|
-
<FlatList
|
|
188
|
-
stickyHeaderIndices={sectionHeaderIndicies}
|
|
189
|
-
{...(rest as FlatListProps<SectionListItem<T>>)}
|
|
190
|
-
data={dataWithSections}
|
|
191
|
-
renderItem={renderItem}
|
|
192
|
-
keyExtractor={keyExtractor}
|
|
193
|
-
/>
|
|
194
|
-
);
|
|
195
|
-
case "FlashList":
|
|
196
|
-
return (
|
|
197
|
-
<FlashList
|
|
198
|
-
stickyHeaderIndices={sectionHeaderIndicies}
|
|
199
|
-
{...(rest as FlashListProps<SectionListItem<T>>)}
|
|
200
|
-
data={dataWithSections}
|
|
201
|
-
renderItem={renderItem}
|
|
202
|
-
keyExtractor={keyExtractor}
|
|
203
|
-
/>
|
|
204
|
-
);
|
|
205
212
|
}
|
|
206
|
-
|
|
213
|
+
);
|
|
207
214
|
|
|
208
215
|
export default SectionList;
|
|
@@ -5,9 +5,9 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
5
5
|
* A FlashList wrapper that takes a single `style` prop and internally extracts
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
|
-
const SimpleStyleFlashList = ({ style: styleProp, data, ...rest }) => {
|
|
8
|
+
const SimpleStyleFlashList = React.forwardRef(({ style: styleProp, data, ...rest }, ref) => {
|
|
9
9
|
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
10
|
-
return (React.createElement(FlashList, { style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
11
|
-
};
|
|
10
|
+
return (React.createElement(FlashList, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
11
|
+
});
|
|
12
12
|
export default SimpleStyleFlashList;
|
|
13
13
|
//# sourceMappingURL=SimpleStyleFlashList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleFlashList.js","sourceRoot":"","sources":["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,
|
|
1
|
+
{"version":3,"file":"SimpleStyleFlashList.js","sourceRoot":"","sources":["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,KAAK,CAAC,UAAU,CAC3C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EAC0C,EACnD,GAA8B,EAC9B,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqC,EAC5D,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -7,22 +7,28 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
7
7
|
* A FlashList wrapper that takes a single `style` prop and internally extracts
|
|
8
8
|
* the appropriate style keys into the `contentContainerStyle`
|
|
9
9
|
*/
|
|
10
|
-
const SimpleStyleFlashList =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const SimpleStyleFlashList = React.forwardRef(
|
|
11
|
+
<T extends any>(
|
|
12
|
+
{
|
|
13
|
+
style: styleProp,
|
|
14
|
+
data,
|
|
15
|
+
...rest
|
|
16
|
+
}: Omit<FlashListProps<T>, "contentContainerStyle">,
|
|
17
|
+
ref: React.Ref<FlashList<any>>
|
|
18
|
+
) => {
|
|
19
|
+
const { style, contentContainerStyle } =
|
|
20
|
+
useSplitContentContainerStyles(styleProp);
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
return (
|
|
23
|
+
<FlashList
|
|
24
|
+
ref={ref}
|
|
25
|
+
style={style}
|
|
26
|
+
contentContainerStyle={contentContainerStyle as ContentStyle}
|
|
27
|
+
data={data}
|
|
28
|
+
{...rest}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
);
|
|
27
33
|
|
|
28
34
|
export default SimpleStyleFlashList;
|
|
@@ -5,9 +5,9 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
5
5
|
* A FlatList wrapper that takes a single `style` prop and internally extracts
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
|
-
const SimpleStyleFlatList = ({ style: styleProp, data, ...rest }) => {
|
|
8
|
+
const SimpleStyleFlatList = React.forwardRef(({ style: styleProp, data, ...rest }, ref) => {
|
|
9
9
|
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
10
|
-
return (React.createElement(FlatList, { style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
11
|
-
};
|
|
10
|
+
return (React.createElement(FlatList, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, data: data, ...rest }));
|
|
11
|
+
});
|
|
12
12
|
export default SimpleStyleFlatList;
|
|
13
13
|
//# sourceMappingURL=SimpleStyleFlatList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleFlatList.js","sourceRoot":"","sources":["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,
|
|
1
|
+
{"version":3,"file":"SimpleStyleFlatList.js","sourceRoot":"","sources":["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,KAAK,CAAC,UAAU,CAC1C,CACE,EACE,KAAK,EAAE,SAAS,EAChB,IAAI,EACJ,GAAG,IAAI,EACyC,EAClD,GAAwB,EACxB,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,QAAQ,IACP,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,EAC5C,IAAI,EAAE,IAAI,KACN,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -7,22 +7,28 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
7
7
|
* A FlatList wrapper that takes a single `style` prop and internally extracts
|
|
8
8
|
* the appropriate style keys into the `contentContainerStyle`
|
|
9
9
|
*/
|
|
10
|
-
const SimpleStyleFlatList =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const SimpleStyleFlatList = React.forwardRef(
|
|
11
|
+
<T extends any>(
|
|
12
|
+
{
|
|
13
|
+
style: styleProp,
|
|
14
|
+
data,
|
|
15
|
+
...rest
|
|
16
|
+
}: Omit<FlatListProps<T>, "contentContainerStyle">,
|
|
17
|
+
ref: React.Ref<FlatList>
|
|
18
|
+
) => {
|
|
19
|
+
const { style, contentContainerStyle } =
|
|
20
|
+
useSplitContentContainerStyles(styleProp);
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
return (
|
|
23
|
+
<FlatList
|
|
24
|
+
ref={ref}
|
|
25
|
+
style={style}
|
|
26
|
+
contentContainerStyle={contentContainerStyle}
|
|
27
|
+
data={data}
|
|
28
|
+
{...rest}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
);
|
|
27
33
|
|
|
28
34
|
export default SimpleStyleFlatList;
|
|
@@ -5,9 +5,9 @@ import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
|
5
5
|
* A KeyboardAwareScrollView wrapper that takes a single `style` prop and internally extracts
|
|
6
6
|
* the appropriate style keys into the `contentContainerStyle`
|
|
7
7
|
*/
|
|
8
|
-
const SimpleStyleKeyboardAwareScrollView = ({ style: styleProp, ...rest }) => {
|
|
8
|
+
const SimpleStyleKeyboardAwareScrollView = React.forwardRef(({ style: styleProp, ...rest }, ref) => {
|
|
9
9
|
const { style, contentContainerStyle } = useSplitContentContainerStyles(styleProp);
|
|
10
|
-
return (React.createElement(KeyboardAwareScrollView, { style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
11
|
-
};
|
|
10
|
+
return (React.createElement(KeyboardAwareScrollView, { ref: ref, style: style, contentContainerStyle: contentContainerStyle, ...rest }));
|
|
11
|
+
});
|
|
12
12
|
export default SimpleStyleKeyboardAwareScrollView;
|
|
13
13
|
//# sourceMappingURL=SimpleStyleKeyboardAwareScrollView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleKeyboardAwareScrollView.js","sourceRoot":"","sources":["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,
|
|
1
|
+
{"version":3,"file":"SimpleStyleKeyboardAwareScrollView.js","sourceRoot":"","sources":["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,GAAG,KAAK,CAAC,UAAU,CACzD,CACE,EACE,KAAK,EAAE,SAAS,EAChB,GAAG,IAAI,EACqD,EAC9D,GAAuC,EACvC,EAAE;IACF,MAAM,EAAE,KAAK,EAAE,qBAAqB,EAAE,GACpC,8BAA8B,CAAC,SAAS,CAAC,CAAC;IAE5C,OAAO,CACL,oBAAC,uBAAuB,IACtB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,qBAAqB,EAAE,qBAAqB,KACxC,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kCAAkC,CAAC"}
|