@draftbit/core 50.2.3 → 50.2.4-573471.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/FlatList.js +1 -0
- package/lib/commonjs/components/SectionList/SectionList.js +1 -1
- package/lib/commonjs/components/SimpleStyleScrollables/SimpleStyleFlatList.js +1 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableList.js +1 -1
- package/lib/typescript/src/components/FlatList.d.ts +5 -0
- package/lib/typescript/src/components/FlatList.js +7 -0
- package/lib/typescript/src/components/FlatList.js.map +1 -0
- package/lib/typescript/src/components/SectionList/SectionList.d.ts +2 -2
- package/lib/typescript/src/components/SectionList/SectionList.js +1 -1
- package/lib/typescript/src/components/SectionList/SectionList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.d.ts +2 -2
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +1 -1
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSectionList.d.ts +2 -2
- package/lib/typescript/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.d.ts +2 -2
- package/lib/typescript/src/components/SwipeableItem/SwipeableList.d.ts +2 -2
- package/lib/typescript/src/components/SwipeableItem/SwipeableList.js +1 -1
- package/lib/typescript/src/components/SwipeableItem/SwipeableList.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/FlatList.js +7 -0
- package/src/components/FlatList.js.map +1 -0
- package/src/components/FlatList.tsx +21 -0
- package/src/components/SectionList/SectionList.js +1 -1
- package/src/components/SectionList/SectionList.js.map +1 -1
- package/src/components/SectionList/SectionList.tsx +4 -3
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.js.map +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleFlatList.tsx +3 -2
- package/src/components/SimpleStyleScrollables/SimpleStyleSectionList.tsx +1 -1
- package/src/components/SimpleStyleScrollables/SimpleStyleSwipeableList.tsx +1 -1
- package/src/components/SwipeableItem/SwipeableList.js +1 -1
- package/src/components/SwipeableItem/SwipeableList.js.map +1 -1
- package/src/components/SwipeableItem/SwipeableList.tsx +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "50.2.
|
|
3
|
+
"version": "50.2.4-573471.2+5734718",
|
|
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": "50.2.
|
|
44
|
+
"@draftbit/theme": "^50.2.4-573471.2+5734718",
|
|
45
45
|
"@expo/vector-icons": "^14.0.0",
|
|
46
46
|
"@gorhom/bottom-sheet": "5.0.0-alpha.7",
|
|
47
47
|
"@material-ui/core": "^4.11.0",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
],
|
|
119
119
|
"testEnvironment": "node"
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "573471846185606d2bd86e2332082b4e765a1c76"
|
|
122
122
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FlatList as FlatListstComponent } from "react-native";
|
|
3
|
+
const FlatList = React.forwardRef(({ numColumns, ...rest }, ref) => {
|
|
4
|
+
return (React.createElement(FlatListstComponent, { key: numColumns, numColumns: numColumns, ref: ref, ...rest }));
|
|
5
|
+
});
|
|
6
|
+
export default FlatList;
|
|
7
|
+
//# sourceMappingURL=FlatList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlatList.js","sourceRoot":"","sources":["FlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,IAAI,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAG/D,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAC/B,CACE,EAAE,UAAU,EAAE,GAAG,IAAI,EAAoB,EACzC,GAAmC,EACnC,EAAE;IACF,OAAO,CACL,oBAAC,mBAAmB,IAClB,GAAG,EAAE,UAAU,EACf,UAAU,EAAE,UAAU,EACtB,GAAG,EAAE,GAAG,KACJ,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FlatList as FlatListstComponent } from "react-native";
|
|
3
|
+
import type { FlatListProps } from "react-native";
|
|
4
|
+
|
|
5
|
+
const FlatList = React.forwardRef<FlatListstComponent, FlatListProps<any>>(
|
|
6
|
+
<T extends any>(
|
|
7
|
+
{ numColumns, ...rest }: FlatListProps<T>,
|
|
8
|
+
ref: React.Ref<FlatListstComponent>
|
|
9
|
+
) => {
|
|
10
|
+
return (
|
|
11
|
+
<FlatListstComponent
|
|
12
|
+
key={numColumns} // Changing numColumns requires re-rendering, setting it as the key ensures list is re-rendered when it changes
|
|
13
|
+
numColumns={numColumns}
|
|
14
|
+
ref={ref}
|
|
15
|
+
{...rest}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export default FlatList;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FlashList } from "@shopify/flash-list";
|
|
3
|
-
import { FlatList } from "react-native";
|
|
4
3
|
import SectionHeader, { DefaultSectionHeader } from "./SectionHeader";
|
|
5
4
|
import { flattenReactFragments } from "../../utilities";
|
|
5
|
+
import FlatList from "../FlatList";
|
|
6
6
|
export const DEFAULT_SECTION = "Uncategorized";
|
|
7
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]);
|
|
@@ -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;
|
|
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;AAEhE,OAAO,aAAa,EAAE,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,QAAQ,MAAM,aAAa,CAAC;AAqCnC,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;AAE/C,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAClC,CACE,EACE,UAAU,EACV,YAAY,GAAG,KAAK,EACpB,aAAa,GAAG,UAAU,EAC1B,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,cAAc,EAC1B,YAAY,EAAE,gBAAgB,EAC9B,GAAG,IAAI,EACoD,EAC7D,GAAkD,EAClD,EAAE;IACF,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CACxB,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAA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oBAAC,QAAQ,IACP,GAAG,EAAE,GAAmC,EACxC,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"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FlashListProps, FlashList } from "@shopify/flash-list";
|
|
3
|
-
import { FlatListProps, FlatList } from "react-native";
|
|
3
|
+
import { FlatListProps, FlatList as FlatListComponent } from "react-native";
|
|
4
4
|
import SectionHeader, { DefaultSectionHeader } from "./SectionHeader";
|
|
5
5
|
import { flattenReactFragments } from "../../utilities";
|
|
6
|
+
import FlatList from "../FlatList";
|
|
6
7
|
|
|
7
8
|
type ListComponentType = "FlatList" | "FlashList";
|
|
8
9
|
|
|
@@ -52,7 +53,7 @@ const SectionList = React.forwardRef(
|
|
|
52
53
|
keyExtractor: keyExtractorProp,
|
|
53
54
|
...rest
|
|
54
55
|
}: FlatListSectionListProps<T> | FlashListSectionListProps<T>,
|
|
55
|
-
ref: React.Ref<
|
|
56
|
+
ref: React.Ref<FlatListComponent | FlashList<any>>
|
|
56
57
|
) => {
|
|
57
58
|
const data = React.useMemo(
|
|
58
59
|
() => (Array.isArray(dataProp) ? dataProp : []) as T[],
|
|
@@ -189,7 +190,7 @@ const SectionList = React.forwardRef(
|
|
|
189
190
|
case "FlatList":
|
|
190
191
|
return (
|
|
191
192
|
<FlatList
|
|
192
|
-
ref={ref as React.Ref<
|
|
193
|
+
ref={ref as React.Ref<FlatListComponent>}
|
|
193
194
|
stickyHeaderIndices={sectionHeaderIndicies}
|
|
194
195
|
{...(rest as FlatListProps<SectionListItem<T>>)}
|
|
195
196
|
data={dataWithSections}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import FlatList from "../FlatList";
|
|
3
3
|
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
4
4
|
/**
|
|
5
5
|
* A FlatList wrapper that takes a single `style` prop and internally extracts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleStyleFlatList.js","sourceRoot":"","sources":["SimpleStyleFlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"SimpleStyleFlatList.js","sourceRoot":"","sources":["SimpleStyleFlatList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,aAAa,CAAC;AAGnC,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,GAAiC,EACjC,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"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
2
|
+
import FlatList from "../FlatList";
|
|
3
|
+
import { FlatList as FlatListComponent } from "react-native";
|
|
3
4
|
import type { FlatListProps } from "react-native";
|
|
4
5
|
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
5
6
|
|
|
@@ -14,7 +15,7 @@ const SimpleStyleFlatList = React.forwardRef(
|
|
|
14
15
|
data,
|
|
15
16
|
...rest
|
|
16
17
|
}: Omit<FlatListProps<T>, "contentContainerStyle">,
|
|
17
|
-
ref: React.Ref<
|
|
18
|
+
ref: React.Ref<FlatListComponent>
|
|
18
19
|
) => {
|
|
19
20
|
const { style, contentContainerStyle } =
|
|
20
21
|
useSplitContentContainerStyles(styleProp);
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
FlashListSectionListProps,
|
|
6
6
|
} from "../SectionList";
|
|
7
7
|
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
8
|
-
import { FlatList } from "react-native
|
|
8
|
+
import { FlatList } from "react-native";
|
|
9
9
|
import { FlashList } from "@shopify/flash-list";
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
FlatListSwipeableListProps,
|
|
6
6
|
} from "../SwipeableItem";
|
|
7
7
|
import useSplitContentContainerStyles from "./useSplitContentContainerStyles";
|
|
8
|
-
import { FlatList } from "react-native
|
|
8
|
+
import { FlatList } from "react-native";
|
|
9
9
|
import { FlashList } from "@shopify/flash-list";
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FlashList } from "@shopify/flash-list";
|
|
3
|
-
import
|
|
3
|
+
import FlatList from "../FlatList";
|
|
4
4
|
export const SwipeableListContext = React.createContext({
|
|
5
5
|
onStartSwiping: () => { },
|
|
6
6
|
onStopSwiping: () => { },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeableList.js","sourceRoot":"","sources":["SwipeableList.tsx"],"names":[],"mappings":"AAAA,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B,IAA0B,GAC/B,CACH,CAAC;SACL;IACH,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,cAAc,EAAE,aAAa,EAAE;QACrE,0CAAG,mBAAmB,EAAE,CAAI,CACE,CACjC,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FlashListProps, FlashList } from "@shopify/flash-list";
|
|
3
|
-
import { FlatListProps, FlatList } from "react-native";
|
|
3
|
+
import { FlatListProps, FlatList as FlatListComponent } from "react-native";
|
|
4
|
+
import FlatList from "../FlatList";
|
|
4
5
|
|
|
5
6
|
type ListComponentType = "FlatList" | "FlashList";
|
|
6
7
|
|
|
@@ -33,7 +34,7 @@ const SwipeableList = React.forwardRef(
|
|
|
33
34
|
listComponent = "FlatList",
|
|
34
35
|
...rest
|
|
35
36
|
}: FlashListSwipeableListProps<T> | FlatListSwipeableListProps<T>,
|
|
36
|
-
ref: React.Ref<
|
|
37
|
+
ref: React.Ref<FlatListComponent | FlashList<any>>
|
|
37
38
|
) => {
|
|
38
39
|
const [isSwiping, setIsSwiping] = React.useState(false);
|
|
39
40
|
|
|
@@ -52,7 +53,7 @@ const SwipeableList = React.forwardRef(
|
|
|
52
53
|
case "FlatList":
|
|
53
54
|
return (
|
|
54
55
|
<FlatList
|
|
55
|
-
ref={ref as React.Ref<
|
|
56
|
+
ref={ref as React.Ref<FlatListComponent>}
|
|
56
57
|
{...(rest as FlatListProps<T>)}
|
|
57
58
|
/>
|
|
58
59
|
);
|