vitest-native 0.7.0 → 0.9.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +373 -0
  2. package/README.md +32 -14
  3. package/dist/cli.cjs +506 -0
  4. package/dist/cli.d.cts +4 -0
  5. package/dist/cli.d.mts +4 -0
  6. package/dist/cli.mjs +502 -0
  7. package/dist/ecosystem-BIWaVwYL.cjs +294 -0
  8. package/dist/ecosystem-EFtHnKS9.mjs +256 -0
  9. package/dist/{index-DbfKy_bm.d.mts → index-CEgRDdhd.d.cts} +22 -3
  10. package/dist/{index-BgzErxHj.d.cts → index-j-0tueBr.d.mts} +20 -5
  11. package/dist/index.cjs +345 -200
  12. package/dist/index.d.cts +1 -1
  13. package/dist/index.d.mts +1 -1
  14. package/dist/index.mjs +341 -196
  15. package/dist/jest-compat/setup.mjs +65 -1
  16. package/dist/native/boundary.mjs +108 -30
  17. package/dist/native/compile-cache.mjs +45 -0
  18. package/dist/native/explain.mjs +69 -0
  19. package/dist/native/hooks.mjs +77 -4
  20. package/dist/native/loader.mjs +36 -7
  21. package/dist/native/match.mjs +107 -8
  22. package/dist/native/registry.mjs +471 -0
  23. package/dist/native/reset.mjs +18 -12
  24. package/dist/native/runner.mjs +13 -7
  25. package/dist/native/setup.mjs +44 -0
  26. package/dist/native/transform.mjs +88 -19
  27. package/dist/native/worker.mjs +13 -0
  28. package/dist/pool-CJmjRgsB.mjs +117 -0
  29. package/dist/pool-DzsEo9vv.cjs +121 -0
  30. package/dist/{preset-map-CNBOeqAu.cjs → preset-map-CG4FMtsl.cjs} +5 -1
  31. package/dist/{preset-map-C1UwEald.mjs → preset-map-CNsZKfvu.mjs} +5 -1
  32. package/dist/{presets-BTG8fiNF.cjs → presets-C4faM3ds.cjs} +838 -2
  33. package/dist/{presets-BFuAMwYQ.mjs → presets-CuDrNA_W.mjs} +761 -3
  34. package/dist/presets.cjs +5 -1
  35. package/dist/presets.d.cts +2 -2
  36. package/dist/presets.d.mts +2 -2
  37. package/dist/presets.mjs +2 -2
  38. package/dist/setup.cjs +327 -347
  39. package/dist/setup.mjs +318 -338
  40. package/docs/hot-default-design.md +129 -0
  41. package/docs/migrating-from-jest.md +43 -7
  42. package/docs/migrating-from-vitest-react-native.md +1 -1
  43. package/docs/release-readiness.md +2 -1
  44. package/package.json +23 -7
  45. package/dist/pool-B7LBfcMQ.mjs +0 -67
  46. package/dist/pool-p54QV1dQ.cjs +0 -69
@@ -440,7 +440,26 @@ function buildPressableHostProps(props, ref) {
440
440
  //#endregion
441
441
  //#region src/mocks/components/Pressable.ts
442
442
  function createPressableMock() {
443
- const Pressable = React.forwardRef((props, ref) => React.createElement("Pressable", buildPressableHostProps(props, ref)));
443
+ const Pressable = React.forwardRef((props, ref) => {
444
+ const { style, children, onPressIn, onPressOut, ...rest } = props;
445
+ const [pressed, setPressed] = React.useState(false);
446
+ const state = { pressed };
447
+ const resolvedStyle = typeof style === "function" ? style(state) : style;
448
+ const resolvedChildren = typeof children === "function" ? children(state) : children;
449
+ const hostProps = buildPressableHostProps({
450
+ ...rest,
451
+ style: resolvedStyle,
452
+ onPressIn: (e) => {
453
+ setPressed(true);
454
+ onPressIn?.(e);
455
+ },
456
+ onPressOut: (e) => {
457
+ setPressed(false);
458
+ onPressOut?.(e);
459
+ }
460
+ }, ref);
461
+ return React.createElement("Pressable", hostProps, resolvedChildren);
462
+ });
444
463
  Pressable.displayName = "Pressable";
445
464
  return Pressable;
446
465
  }
@@ -1800,12 +1819,750 @@ function vectorIcons() {
1800
1819
  };
1801
1820
  }
1802
1821
  //#endregion
1822
+ //#region src/presets/flash-list.ts
1823
+ function flashList() {
1824
+ return {
1825
+ name: "flashList",
1826
+ modules: { "@shopify/flash-list": {
1827
+ exports: [
1828
+ "FlashList",
1829
+ "AnimatedFlashList",
1830
+ "LayoutCommitObserver",
1831
+ "ViewToken",
1832
+ "RenderTargetOptions",
1833
+ "useRecyclingState",
1834
+ "useLayoutState",
1835
+ "useMappingHelper",
1836
+ "useFlashListContext",
1837
+ "useBenchmark"
1838
+ ],
1839
+ factory: () => {
1840
+ const renderElement = (Component) => {
1841
+ if (Component == null) return null;
1842
+ if (React.isValidElement(Component)) return Component;
1843
+ return React.createElement(Component);
1844
+ };
1845
+ function createFlashList(name) {
1846
+ const List = React.forwardRef((props, ref) => {
1847
+ const { data, renderItem, keyExtractor, extraData, ListHeaderComponent, ListFooterComponent, ListEmptyComponent, ...rest } = props;
1848
+ React.useImperativeHandle(ref, () => ({
1849
+ scrollToEnd: () => {},
1850
+ scrollToIndex: () => {},
1851
+ scrollToItem: () => {},
1852
+ scrollToOffset: () => {},
1853
+ scrollToTop: () => {},
1854
+ flashScrollIndicators: () => {},
1855
+ recordInteraction: () => {},
1856
+ recomputeViewableItems: () => {},
1857
+ prepareForLayoutAnimationRender: () => {},
1858
+ getScrollableNode: () => null,
1859
+ getNativeScrollRef: () => null
1860
+ }));
1861
+ const items = Array.isArray(data) ? data : [];
1862
+ const rows = items.length === 0 ? renderElement(ListEmptyComponent) : items.map((item, index) => {
1863
+ const element = renderItem ? renderItem({
1864
+ item,
1865
+ index,
1866
+ extraData,
1867
+ target: "Cell"
1868
+ }) : null;
1869
+ if (element == null) return null;
1870
+ const key = keyExtractor ? keyExtractor(item, index) : String(index);
1871
+ return React.createElement(React.Fragment, { key }, element);
1872
+ });
1873
+ return React.createElement(name, rest, renderElement(ListHeaderComponent), rows, renderElement(ListFooterComponent));
1874
+ });
1875
+ List.displayName = name;
1876
+ return List;
1877
+ }
1878
+ const FlashList = createFlashList("FlashList");
1879
+ const LayoutCommitObserver = React.forwardRef((props, ref) => React.createElement("LayoutCommitObserver", {
1880
+ ...props,
1881
+ ref
1882
+ }, props.children));
1883
+ LayoutCommitObserver.displayName = "LayoutCommitObserver";
1884
+ return {
1885
+ __esModule: true,
1886
+ default: FlashList,
1887
+ FlashList,
1888
+ AnimatedFlashList: createFlashList("AnimatedFlashList"),
1889
+ LayoutCommitObserver,
1890
+ RenderTargetOptions: {
1891
+ Cell: "Cell",
1892
+ StickyHeader: "StickyHeader",
1893
+ Measurement: "Measurement"
1894
+ },
1895
+ ViewToken: function ViewToken() {},
1896
+ useRecyclingState: (initialState) => React.useState(initialState),
1897
+ useLayoutState: (initialState) => React.useState(initialState),
1898
+ useMappingHelper: () => ({ getMappingKey: (_item, index) => String(index) }),
1899
+ useFlashListContext: () => void 0,
1900
+ useBenchmark: () => {}
1901
+ };
1902
+ }
1903
+ } }
1904
+ };
1905
+ }
1906
+ //#endregion
1907
+ //#region src/mocks/components/TextInput.ts
1908
+ function createTextInputMock() {
1909
+ const TextInput = React.forwardRef((props, ref) => {
1910
+ const instanceMethods = {
1911
+ focus: vi.fn(),
1912
+ blur: vi.fn(),
1913
+ clear: vi.fn(),
1914
+ isFocused: vi.fn(() => false),
1915
+ setNativeProps: vi.fn()
1916
+ };
1917
+ React.useImperativeHandle(ref, () => instanceMethods);
1918
+ return React.createElement("TextInput", {
1919
+ ...props,
1920
+ ref
1921
+ });
1922
+ });
1923
+ TextInput.displayName = "TextInput";
1924
+ return TextInput;
1925
+ }
1926
+ //#endregion
1927
+ //#region src/mocks/components/ScrollView.ts
1928
+ function createScrollViewMock() {
1929
+ const ScrollView = React.forwardRef((props, ref) => {
1930
+ const { children, refreshControl, ...rest } = props;
1931
+ const instanceMethods = {
1932
+ scrollTo: vi.fn(),
1933
+ scrollToEnd: vi.fn(),
1934
+ flashScrollIndicators: vi.fn(),
1935
+ getScrollResponder: vi.fn(() => ({})),
1936
+ getInnerViewNode: vi.fn(),
1937
+ setNativeProps: vi.fn()
1938
+ };
1939
+ React.useImperativeHandle(ref, () => instanceMethods);
1940
+ return React.createElement("RCTScrollView", {
1941
+ ...rest,
1942
+ ref
1943
+ }, refreshControl, React.createElement("View", null, children));
1944
+ });
1945
+ ScrollView.displayName = "ScrollView";
1946
+ return ScrollView;
1947
+ }
1948
+ //#endregion
1949
+ //#region src/mocks/components/FlatList.ts
1950
+ function createFlatListMock() {
1951
+ const FlatList = React.forwardRef((props, ref) => {
1952
+ const { data, renderItem, keyExtractor, ListHeaderComponent, ListFooterComponent, ListEmptyComponent, ItemSeparatorComponent, refreshControl, ...rest } = props;
1953
+ const instanceMethods = {
1954
+ scrollToEnd: vi.fn(),
1955
+ scrollToIndex: vi.fn(),
1956
+ scrollToItem: vi.fn(),
1957
+ scrollToOffset: vi.fn(),
1958
+ recordInteraction: vi.fn(),
1959
+ flashScrollIndicators: vi.fn(),
1960
+ getScrollResponder: vi.fn(() => ({})),
1961
+ getNativeScrollRef: vi.fn(),
1962
+ getScrollableNode: vi.fn(),
1963
+ setNativeProps: vi.fn()
1964
+ };
1965
+ React.useImperativeHandle(ref, () => instanceMethods);
1966
+ const children = [];
1967
+ if (ListHeaderComponent) children.push(React.createElement("FlatList-Header", { key: "__header" }, typeof ListHeaderComponent === "function" ? React.createElement(ListHeaderComponent) : ListHeaderComponent));
1968
+ if (data && data.length > 0) data.forEach((item, index) => {
1969
+ const key = keyExtractor ? keyExtractor(item, index) : String(index);
1970
+ children.push(React.createElement(React.Fragment, { key }, renderItem({
1971
+ item,
1972
+ index,
1973
+ separators: {
1974
+ highlight: vi.fn(),
1975
+ unhighlight: vi.fn(),
1976
+ updateProps: vi.fn()
1977
+ }
1978
+ })));
1979
+ if (ItemSeparatorComponent && index < data.length - 1) children.push(React.createElement(React.Fragment, { key: `separator-${index}` }, typeof ItemSeparatorComponent === "function" ? React.createElement(ItemSeparatorComponent) : ItemSeparatorComponent));
1980
+ });
1981
+ else if (ListEmptyComponent) children.push(React.createElement("FlatList-Empty", { key: "__empty" }, typeof ListEmptyComponent === "function" ? React.createElement(ListEmptyComponent) : ListEmptyComponent));
1982
+ if (ListFooterComponent) children.push(React.createElement("FlatList-Footer", { key: "__footer" }, typeof ListFooterComponent === "function" ? React.createElement(ListFooterComponent) : ListFooterComponent));
1983
+ if (refreshControl) children.unshift(refreshControl);
1984
+ return React.createElement("FlatList", {
1985
+ ...rest,
1986
+ ref
1987
+ }, ...children);
1988
+ });
1989
+ FlatList.displayName = "FlatList";
1990
+ return FlatList;
1991
+ }
1992
+ //#endregion
1993
+ //#region src/mocks/components/SectionList.ts
1994
+ function createSectionListMock() {
1995
+ const SectionList = React.forwardRef((props, ref) => {
1996
+ const { sections, renderItem, renderSectionHeader, renderSectionFooter, keyExtractor, refreshControl, ListEmptyComponent, ListHeaderComponent, ListFooterComponent, ItemSeparatorComponent, SectionSeparatorComponent, ...rest } = props;
1997
+ const instanceMethods = {
1998
+ scrollToEnd: vi.fn(),
1999
+ scrollToIndex: vi.fn(),
2000
+ scrollToLocation: vi.fn(),
2001
+ recordInteraction: vi.fn(),
2002
+ flashScrollIndicators: vi.fn(),
2003
+ getScrollResponder: vi.fn(() => ({})),
2004
+ getNativeScrollRef: vi.fn(),
2005
+ getScrollableNode: vi.fn(),
2006
+ setNativeProps: vi.fn()
2007
+ };
2008
+ React.useImperativeHandle(ref, () => instanceMethods);
2009
+ const children = [];
2010
+ if (ListHeaderComponent) children.push(React.createElement("SectionList-Header", { key: "__header" }, typeof ListHeaderComponent === "function" ? React.createElement(ListHeaderComponent) : ListHeaderComponent));
2011
+ if (sections) sections.forEach((section, sectionIndex) => {
2012
+ if (renderSectionHeader) children.push(React.createElement(React.Fragment, { key: `header-${sectionIndex}` }, renderSectionHeader({ section })));
2013
+ if (SectionSeparatorComponent && sectionIndex > 0) children.push(React.createElement(React.Fragment, { key: `section-sep-${sectionIndex}` }, typeof SectionSeparatorComponent === "function" ? React.createElement(SectionSeparatorComponent) : SectionSeparatorComponent));
2014
+ if (section.data) section.data.forEach((item, index) => {
2015
+ const key = keyExtractor ? keyExtractor(item, index) : `${sectionIndex}-${index}`;
2016
+ children.push(React.createElement(React.Fragment, { key }, renderItem({
2017
+ item,
2018
+ index,
2019
+ section,
2020
+ separators: {
2021
+ highlight: vi.fn(),
2022
+ unhighlight: vi.fn(),
2023
+ updateProps: vi.fn()
2024
+ }
2025
+ })));
2026
+ if (ItemSeparatorComponent && index < section.data.length - 1) children.push(React.createElement(React.Fragment, { key: `sep-${sectionIndex}-${index}` }, typeof ItemSeparatorComponent === "function" ? React.createElement(ItemSeparatorComponent) : ItemSeparatorComponent));
2027
+ });
2028
+ if (renderSectionFooter) children.push(React.createElement(React.Fragment, { key: `footer-${sectionIndex}` }, renderSectionFooter({ section })));
2029
+ });
2030
+ if (ListFooterComponent) children.push(React.createElement("SectionList-Footer", { key: "__footer" }, typeof ListFooterComponent === "function" ? React.createElement(ListFooterComponent) : ListFooterComponent));
2031
+ if (refreshControl) children.unshift(refreshControl);
2032
+ if ((!sections || sections.length === 0) && ListEmptyComponent) children.push(React.createElement("SectionList-Empty", { key: "__empty" }, typeof ListEmptyComponent === "function" ? React.createElement(ListEmptyComponent) : ListEmptyComponent));
2033
+ return React.createElement("SectionList", {
2034
+ ...rest,
2035
+ ref
2036
+ }, ...children);
2037
+ });
2038
+ SectionList.displayName = "SectionList";
2039
+ return SectionList;
2040
+ }
2041
+ //#endregion
2042
+ //#region src/mocks/components/VirtualizedList.ts
2043
+ function createVirtualizedListMock() {
2044
+ const VirtualizedList = React.forwardRef((props, ref) => {
2045
+ const { data, renderItem, keyExtractor, getItemCount, getItem, ListHeaderComponent, ListFooterComponent, ListEmptyComponent, ...rest } = props;
2046
+ const instanceMethods = {
2047
+ scrollToEnd: vi.fn(),
2048
+ scrollToIndex: vi.fn(),
2049
+ scrollToItem: vi.fn(),
2050
+ scrollToOffset: vi.fn(),
2051
+ recordInteraction: vi.fn(),
2052
+ flashScrollIndicators: vi.fn(),
2053
+ getScrollResponder: vi.fn(() => ({})),
2054
+ getNativeScrollRef: vi.fn(),
2055
+ getScrollableNode: vi.fn(),
2056
+ setNativeProps: vi.fn()
2057
+ };
2058
+ React.useImperativeHandle(ref, () => instanceMethods);
2059
+ const children = [];
2060
+ if (ListHeaderComponent) children.push(React.createElement("VirtualizedList-Header", { key: "__header" }, typeof ListHeaderComponent === "function" ? React.createElement(ListHeaderComponent) : ListHeaderComponent));
2061
+ const itemCount = getItemCount ? getItemCount(data) : data ? data.length : 0;
2062
+ if (itemCount > 0) for (let index = 0; index < itemCount; index++) {
2063
+ const item = getItem ? getItem(data, index) : data[index];
2064
+ const key = keyExtractor ? keyExtractor(item, index) : String(index);
2065
+ children.push(React.createElement(React.Fragment, { key }, renderItem({
2066
+ item,
2067
+ index,
2068
+ separators: {}
2069
+ })));
2070
+ }
2071
+ else if (ListEmptyComponent) children.push(React.createElement("VirtualizedList-Empty", { key: "__empty" }, typeof ListEmptyComponent === "function" ? React.createElement(ListEmptyComponent) : ListEmptyComponent));
2072
+ if (ListFooterComponent) children.push(React.createElement("VirtualizedList-Footer", { key: "__footer" }, typeof ListFooterComponent === "function" ? React.createElement(ListFooterComponent) : ListFooterComponent));
2073
+ return React.createElement("VirtualizedList", {
2074
+ ...rest,
2075
+ ref
2076
+ }, ...children);
2077
+ });
2078
+ VirtualizedList.displayName = "VirtualizedList";
2079
+ return VirtualizedList;
2080
+ }
2081
+ //#endregion
2082
+ //#region src/mocks/components/TouchableOpacity.ts
2083
+ function createTouchableOpacityMock() {
2084
+ const TouchableOpacity = React.forwardRef((props, ref) => React.createElement("TouchableOpacity", buildPressableHostProps(props, ref)));
2085
+ TouchableOpacity.displayName = "TouchableOpacity";
2086
+ return TouchableOpacity;
2087
+ }
2088
+ //#endregion
2089
+ //#region src/mocks/components/TouchableHighlight.ts
2090
+ function createTouchableHighlightMock() {
2091
+ const TouchableHighlight = React.forwardRef((props, ref) => React.createElement("TouchableHighlight", buildPressableHostProps(props, ref)));
2092
+ TouchableHighlight.displayName = "TouchableHighlight";
2093
+ return TouchableHighlight;
2094
+ }
2095
+ //#endregion
2096
+ //#region src/mocks/components/TouchableWithoutFeedback.ts
2097
+ function createTouchableWithoutFeedbackMock() {
2098
+ const TouchableWithoutFeedback = React.forwardRef((props, ref) => React.createElement("TouchableWithoutFeedback", buildPressableHostProps(props, ref)));
2099
+ TouchableWithoutFeedback.displayName = "TouchableWithoutFeedback";
2100
+ return TouchableWithoutFeedback;
2101
+ }
2102
+ //#endregion
2103
+ //#region src/presets/bottom-sheet.ts
2104
+ function bottomSheet() {
2105
+ return {
2106
+ name: "bottomSheet",
2107
+ modules: { "@gorhom/bottom-sheet": {
2108
+ exports: [
2109
+ "BottomSheetModal",
2110
+ "BottomSheetModalProvider",
2111
+ "BottomSheetView",
2112
+ "BottomSheetDraggableView",
2113
+ "BottomSheetScrollView",
2114
+ "BottomSheetFlatList",
2115
+ "BottomSheetSectionList",
2116
+ "BottomSheetVirtualizedList",
2117
+ "BottomSheetFlashList",
2118
+ "BottomSheetTextInput",
2119
+ "BottomSheetBackdrop",
2120
+ "BottomSheetFooter",
2121
+ "BottomSheetFooterContainer",
2122
+ "BottomSheetHandle",
2123
+ "TouchableOpacity",
2124
+ "TouchableHighlight",
2125
+ "TouchableWithoutFeedback",
2126
+ "useBottomSheet",
2127
+ "useBottomSheetModal",
2128
+ "useBottomSheetInternal",
2129
+ "useBottomSheetModalInternal",
2130
+ "useBottomSheetSpringConfigs",
2131
+ "useBottomSheetTimingConfigs",
2132
+ "useBottomSheetDynamicSnapPoints",
2133
+ "createBottomSheetScrollableComponent",
2134
+ "enableLogging",
2135
+ "SNAP_POINT_TYPE",
2136
+ "SHEET_STATE",
2137
+ "SCROLLABLE_TYPE",
2138
+ "SCROLLABLE_STATUS",
2139
+ "ANIMATION_STATUS",
2140
+ "ANIMATION_SOURCE",
2141
+ "ANIMATION_METHOD",
2142
+ "KEYBOARD_STATUS",
2143
+ "GESTURE_SOURCE"
2144
+ ],
2145
+ factory: () => {
2146
+ function container(name, methods = {}) {
2147
+ const Component = React.forwardRef((props, ref) => {
2148
+ React.useImperativeHandle(ref, () => methods);
2149
+ return React.createElement(name, props, props.children);
2150
+ });
2151
+ Component.displayName = name;
2152
+ return Component;
2153
+ }
2154
+ const sheetMethods = {
2155
+ expand: () => {},
2156
+ collapse: () => {},
2157
+ close: () => {},
2158
+ forceClose: () => {},
2159
+ snapToIndex: () => {},
2160
+ snapToPosition: () => {}
2161
+ };
2162
+ const modalMethods = {
2163
+ ...sheetMethods,
2164
+ present: () => {},
2165
+ dismiss: () => {}
2166
+ };
2167
+ return {
2168
+ __esModule: true,
2169
+ default: container("BottomSheet", sheetMethods),
2170
+ BottomSheetModal: container("BottomSheetModal", modalMethods),
2171
+ BottomSheetModalProvider: container("BottomSheetModalProvider"),
2172
+ BottomSheetView: container("BottomSheetView"),
2173
+ BottomSheetDraggableView: container("BottomSheetDraggableView"),
2174
+ BottomSheetBackdrop: container("BottomSheetBackdrop"),
2175
+ BottomSheetFooter: container("BottomSheetFooter"),
2176
+ BottomSheetFooterContainer: container("BottomSheetFooterContainer"),
2177
+ BottomSheetHandle: container("BottomSheetHandle"),
2178
+ BottomSheetScrollView: createScrollViewMock(),
2179
+ BottomSheetFlatList: createFlatListMock(),
2180
+ BottomSheetSectionList: createSectionListMock(),
2181
+ BottomSheetVirtualizedList: createVirtualizedListMock(),
2182
+ BottomSheetFlashList: createFlatListMock(),
2183
+ BottomSheetTextInput: createTextInputMock(),
2184
+ TouchableOpacity: createTouchableOpacityMock(),
2185
+ TouchableHighlight: createTouchableHighlightMock(),
2186
+ TouchableWithoutFeedback: createTouchableWithoutFeedbackMock(),
2187
+ useBottomSheet: () => ({
2188
+ ...sheetMethods,
2189
+ animatedIndex: { value: 0 },
2190
+ animatedPosition: { value: 0 }
2191
+ }),
2192
+ useBottomSheetModal: () => ({
2193
+ dismiss: vi.fn(),
2194
+ dismissAll: vi.fn()
2195
+ }),
2196
+ useBottomSheetInternal: () => ({}),
2197
+ useBottomSheetModalInternal: () => ({}),
2198
+ useBottomSheetSpringConfigs: (config) => config,
2199
+ useBottomSheetTimingConfigs: (config) => config,
2200
+ useBottomSheetDynamicSnapPoints: () => ({
2201
+ animatedHandleHeight: { value: 0 },
2202
+ animatedSnapPoints: { value: [] },
2203
+ animatedContentHeight: { value: 0 },
2204
+ handleContentLayout: vi.fn()
2205
+ }),
2206
+ createBottomSheetScrollableComponent: vi.fn(() => createScrollViewMock()),
2207
+ enableLogging: vi.fn(),
2208
+ SNAP_POINT_TYPE: {
2209
+ PROVIDED: 0,
2210
+ DYNAMIC: 1
2211
+ },
2212
+ SHEET_STATE: {
2213
+ CLOSED: 0,
2214
+ OPENED: 1,
2215
+ EXTENDED: 2,
2216
+ OVER_EXTENDED: 3,
2217
+ FILL_PARENT: 4
2218
+ },
2219
+ SCROLLABLE_TYPE: {
2220
+ UNDETERMINED: 0,
2221
+ VIEW: 1,
2222
+ FLATLIST: 2,
2223
+ SCROLLVIEW: 3,
2224
+ SECTIONLIST: 4,
2225
+ VIRTUALIZEDLIST: 5
2226
+ },
2227
+ SCROLLABLE_STATUS: {
2228
+ LOCKED: 0,
2229
+ UNLOCKED: 1,
2230
+ UNDETERMINED: 2
2231
+ },
2232
+ ANIMATION_STATUS: {
2233
+ UNDETERMINED: 0,
2234
+ RUNNING: 1,
2235
+ STOPPED: 2,
2236
+ INTERRUPTED: 3
2237
+ },
2238
+ ANIMATION_SOURCE: {
2239
+ NONE: 0,
2240
+ MOUNT: 1,
2241
+ GESTURE: 2,
2242
+ USER: 3,
2243
+ CONTAINER_RESIZE: 4,
2244
+ SNAP_POINT_CHANGE: 5,
2245
+ KEYBOARD: 6
2246
+ },
2247
+ ANIMATION_METHOD: {
2248
+ TIMING: 0,
2249
+ SPRING: 1
2250
+ },
2251
+ KEYBOARD_STATUS: {
2252
+ UNDETERMINED: 0,
2253
+ SHOWN: 1,
2254
+ HIDDEN: 2
2255
+ },
2256
+ GESTURE_SOURCE: {
2257
+ UNDETERMINED: 0,
2258
+ SCROLLABLE: 1,
2259
+ HANDLE: 2,
2260
+ CONTENT: 3
2261
+ }
2262
+ };
2263
+ }
2264
+ } }
2265
+ };
2266
+ }
2267
+ //#endregion
2268
+ //#region src/mocks/components/View.ts
2269
+ function createViewMock() {
2270
+ const View = React.forwardRef((props, ref) => {
2271
+ return React.createElement("View", {
2272
+ ...props,
2273
+ ref
2274
+ });
2275
+ });
2276
+ View.displayName = "View";
2277
+ return View;
2278
+ }
2279
+ //#endregion
2280
+ //#region src/presets/keyboard-controller.ts
2281
+ function keyboardController() {
2282
+ return {
2283
+ name: "keyboardController",
2284
+ modules: { "react-native-keyboard-controller": {
2285
+ exports: [
2286
+ "KeyboardProvider",
2287
+ "KeyboardControllerView",
2288
+ "KeyboardGestureArea",
2289
+ "OverKeyboardView",
2290
+ "KeyboardBackgroundView",
2291
+ "KeyboardExtender",
2292
+ "KeyboardStickyView",
2293
+ "KeyboardAvoidingView",
2294
+ "KeyboardAwareScrollView",
2295
+ "KeyboardChatScrollView",
2296
+ "KeyboardToolbar",
2297
+ "KeyboardController",
2298
+ "KeyboardEvents",
2299
+ "AndroidSoftInputModes",
2300
+ "DefaultKeyboardToolbarTheme",
2301
+ "useKeyboardAnimation",
2302
+ "useReanimatedKeyboardAnimation",
2303
+ "useResizeMode",
2304
+ "useGenericKeyboardHandler",
2305
+ "useKeyboardHandler",
2306
+ "useKeyboardContext",
2307
+ "useKeyboardState",
2308
+ "useReanimatedFocusedInput",
2309
+ "useFocusedInputHandler",
2310
+ "useKeyboardController",
2311
+ "useWindowDimensions"
2312
+ ],
2313
+ factory: () => {
2314
+ function hostComponent(name) {
2315
+ const Component = React.forwardRef((props, ref) => React.createElement(name, {
2316
+ ...props,
2317
+ ref
2318
+ }, props.children));
2319
+ Component.displayName = name;
2320
+ return Component;
2321
+ }
2322
+ const sharedValue = (value) => ({
2323
+ value,
2324
+ get: () => value,
2325
+ set: () => {}
2326
+ });
2327
+ const animationValues = {
2328
+ animated: {
2329
+ progress: sharedValue(0),
2330
+ height: sharedValue(0)
2331
+ },
2332
+ reanimated: {
2333
+ progress: sharedValue(0),
2334
+ height: sharedValue(0)
2335
+ }
2336
+ };
2337
+ const lastKeyboardEvent = {
2338
+ height: 0,
2339
+ duration: 0,
2340
+ timestamp: 0,
2341
+ target: 0,
2342
+ type: "default",
2343
+ appearance: "default"
2344
+ };
2345
+ const keyboardState = {
2346
+ ...lastKeyboardEvent,
2347
+ isVisible: false
2348
+ };
2349
+ const focusedInput = { input: sharedValue({
2350
+ target: 1,
2351
+ parentScrollViewTarget: -1,
2352
+ layout: {
2353
+ x: 0,
2354
+ y: 0,
2355
+ width: 200,
2356
+ height: 40,
2357
+ absoluteX: 0,
2358
+ absoluteY: 100
2359
+ }
2360
+ }) };
2361
+ const KeyboardToolbar = Object.assign(createViewMock(), {
2362
+ Background: hostComponent("KeyboardToolbar.Background"),
2363
+ Content: hostComponent("KeyboardToolbar.Content"),
2364
+ Prev: hostComponent("KeyboardToolbar.Prev"),
2365
+ Next: hostComponent("KeyboardToolbar.Next"),
2366
+ Done: hostComponent("KeyboardToolbar.Done"),
2367
+ Group: hostComponent("KeyboardToolbar.Group")
2368
+ });
2369
+ return {
2370
+ KeyboardProvider: hostComponent("KeyboardProvider"),
2371
+ KeyboardControllerView: hostComponent("KeyboardControllerView"),
2372
+ KeyboardGestureArea: hostComponent("KeyboardGestureArea"),
2373
+ OverKeyboardView: hostComponent("OverKeyboardView"),
2374
+ KeyboardBackgroundView: hostComponent("KeyboardBackgroundView"),
2375
+ KeyboardExtender: hostComponent("KeyboardExtender"),
2376
+ KeyboardStickyView: createViewMock(),
2377
+ KeyboardAvoidingView: createViewMock(),
2378
+ KeyboardAwareScrollView: createScrollViewMock(),
2379
+ KeyboardChatScrollView: createScrollViewMock(),
2380
+ KeyboardToolbar,
2381
+ KeyboardController: {
2382
+ setInputMode: vi.fn(),
2383
+ setDefaultMode: vi.fn(),
2384
+ preload: vi.fn(),
2385
+ dismiss: vi.fn(() => Promise.resolve()),
2386
+ setFocusTo: vi.fn(),
2387
+ isVisible: vi.fn(() => false),
2388
+ state: vi.fn(() => lastKeyboardEvent),
2389
+ viewPositionInWindow: vi.fn(() => Promise.resolve({
2390
+ x: 0,
2391
+ y: 0,
2392
+ width: 0,
2393
+ height: 0
2394
+ }))
2395
+ },
2396
+ KeyboardEvents: { addListener: vi.fn(() => ({ remove: vi.fn() })) },
2397
+ AndroidSoftInputModes: {
2398
+ SOFT_INPUT_ADJUST_NOTHING: 48,
2399
+ SOFT_INPUT_ADJUST_PAN: 32,
2400
+ SOFT_INPUT_ADJUST_RESIZE: 16,
2401
+ SOFT_INPUT_ADJUST_UNSPECIFIED: 0,
2402
+ SOFT_INPUT_IS_FORWARD_NAVIGATION: 256,
2403
+ SOFT_INPUT_MASK_ADJUST: 240,
2404
+ SOFT_INPUT_MASK_STATE: 15,
2405
+ SOFT_INPUT_MODE_CHANGED: 512,
2406
+ SOFT_INPUT_STATE_ALWAYS_HIDDEN: 3,
2407
+ SOFT_INPUT_STATE_ALWAYS_VISIBLE: 5,
2408
+ SOFT_INPUT_STATE_HIDDEN: 2,
2409
+ SOFT_INPUT_STATE_UNCHANGED: 1,
2410
+ SOFT_INPUT_STATE_UNSPECIFIED: 0,
2411
+ SOFT_INPUT_STATE_VISIBLE: 4
2412
+ },
2413
+ DefaultKeyboardToolbarTheme: {
2414
+ light: {
2415
+ primary: "#2c2c2c",
2416
+ disabled: "#B0BEC5",
2417
+ background: "#f3f3f4",
2418
+ ripple: "#bcbcbcbc"
2419
+ },
2420
+ dark: {
2421
+ primary: "#fafafa",
2422
+ disabled: "#707070",
2423
+ background: "#2C2C2E",
2424
+ ripple: "#F8F8F888"
2425
+ }
2426
+ },
2427
+ useKeyboardAnimation: () => animationValues.animated,
2428
+ useReanimatedKeyboardAnimation: () => animationValues.reanimated,
2429
+ useResizeMode: () => {},
2430
+ useGenericKeyboardHandler: () => {},
2431
+ useKeyboardHandler: () => {},
2432
+ useKeyboardContext: () => animationValues,
2433
+ useKeyboardState: (selector) => selector ? selector(keyboardState) : keyboardState,
2434
+ useReanimatedFocusedInput: () => focusedInput,
2435
+ useFocusedInputHandler: () => {},
2436
+ useKeyboardController: () => ({
2437
+ enabled: true,
2438
+ setEnabled: vi.fn()
2439
+ }),
2440
+ useWindowDimensions: () => ({
2441
+ width: 390,
2442
+ height: 844,
2443
+ scale: 3,
2444
+ fontScale: 1
2445
+ })
2446
+ };
2447
+ }
2448
+ } }
2449
+ };
2450
+ }
2451
+ //#endregion
2452
+ //#region src/presets/worklets.ts
2453
+ const RuntimeKind = {
2454
+ ReactNative: 1,
2455
+ UI: 2,
2456
+ Worker: 3
2457
+ };
2458
+ const NOOP = () => {};
2459
+ const ID = (value) => value;
2460
+ const invoke = (callback) => callback();
2461
+ function worklets() {
2462
+ return {
2463
+ name: "worklets",
2464
+ modules: { "react-native-worklets": {
2465
+ exports: [
2466
+ "runOnJS",
2467
+ "runOnUI",
2468
+ "runOnUIAsync",
2469
+ "runOnUISync",
2470
+ "scheduleOnRN",
2471
+ "scheduleOnUI",
2472
+ "runOnRuntime",
2473
+ "runOnRuntimeAsync",
2474
+ "runOnRuntimeSync",
2475
+ "scheduleOnRuntime",
2476
+ "executeOnUIRuntimeSync",
2477
+ "createWorkletRuntime",
2478
+ "getRuntimeKind",
2479
+ "isRNRuntime",
2480
+ "isUIRuntime",
2481
+ "isWorkerRuntime",
2482
+ "isWorkletRuntime",
2483
+ "RuntimeKind",
2484
+ "makeShareable",
2485
+ "makeShareableCloneRecursive",
2486
+ "makeShareableCloneOnUIRecursive",
2487
+ "isShareable",
2488
+ "isShareableRef",
2489
+ "createShareable",
2490
+ "shareableMappingCache",
2491
+ "createSerializable",
2492
+ "isSerializableRef",
2493
+ "registerCustomSerializable",
2494
+ "serializableMappingCache",
2495
+ "createSynchronizable",
2496
+ "isSynchronizable",
2497
+ "getStaticFeatureFlag",
2498
+ "getDynamicFeatureFlag",
2499
+ "setDynamicFeatureFlag",
2500
+ "callMicrotasks",
2501
+ "isWorkletFunction",
2502
+ "WorkletsModule",
2503
+ "UIRuntimeId"
2504
+ ],
2505
+ factory: () => {
2506
+ const runOnJS = (fn) => fn;
2507
+ const runOnUI = (fn) => fn;
2508
+ const runOnUIAsync = (worklet, ...args) => Promise.resolve(worklet(...args));
2509
+ const api = {
2510
+ __esModule: true,
2511
+ runOnJS,
2512
+ runOnUI,
2513
+ runOnUIAsync,
2514
+ runOnUISync: invoke,
2515
+ scheduleOnRN: (fn, ...args) => fn(...args),
2516
+ scheduleOnUI: (worklet, ...args) => worklet(...args),
2517
+ runOnRuntime: ID,
2518
+ runOnRuntimeAsync: (_runtime, worklet, ...args) => Promise.resolve(worklet(...args)),
2519
+ runOnRuntimeSync: (_runtime, worklet, ...args) => worklet(...args),
2520
+ scheduleOnRuntime: invoke,
2521
+ executeOnUIRuntimeSync: ID,
2522
+ callMicrotasks: NOOP,
2523
+ createWorkletRuntime: () => ({}),
2524
+ getRuntimeKind: () => RuntimeKind.ReactNative,
2525
+ RuntimeKind,
2526
+ isRNRuntime: () => true,
2527
+ isUIRuntime: () => false,
2528
+ isWorkerRuntime: () => false,
2529
+ isWorkletRuntime: () => false,
2530
+ UIRuntimeId: 1,
2531
+ makeShareable: ID,
2532
+ makeShareableCloneRecursive: ID,
2533
+ makeShareableCloneOnUIRecursive: ID,
2534
+ createShareable: ID,
2535
+ isShareable: () => false,
2536
+ isShareableRef: () => true,
2537
+ shareableMappingCache: /* @__PURE__ */ new Map(),
2538
+ createSerializable: ID,
2539
+ isSerializableRef: ID,
2540
+ registerCustomSerializable: NOOP,
2541
+ serializableMappingCache: /* @__PURE__ */ new Map(),
2542
+ createSynchronizable: ID,
2543
+ isSynchronizable: () => false,
2544
+ getStaticFeatureFlag: () => false,
2545
+ getDynamicFeatureFlag: () => false,
2546
+ setDynamicFeatureFlag: NOOP,
2547
+ isWorkletFunction: () => false,
2548
+ WorkletsModule: {}
2549
+ };
2550
+ api.default = api;
2551
+ return api;
2552
+ }
2553
+ } }
2554
+ };
2555
+ }
2556
+ //#endregion
1803
2557
  //#region src/presets/index.ts
1804
2558
  var presets_exports = /* @__PURE__ */ __exportAll({
1805
2559
  asyncStorage: () => asyncStorage,
2560
+ bottomSheet: () => bottomSheet,
1806
2561
  deviceInfo: () => deviceInfo,
1807
2562
  expo: () => expo,
2563
+ flashList: () => flashList,
1808
2564
  gestureHandler: () => gestureHandler,
2565
+ keyboardController: () => keyboardController,
1809
2566
  mmkv: () => mmkv,
1810
2567
  navigation: () => navigation,
1811
2568
  reanimated: () => reanimated,
@@ -1813,7 +2570,8 @@ var presets_exports = /* @__PURE__ */ __exportAll({
1813
2570
  screens: () => screens,
1814
2571
  svg: () => svg,
1815
2572
  vectorIcons: () => vectorIcons,
1816
- webview: () => webview
2573
+ webview: () => webview,
2574
+ worklets: () => worklets
1817
2575
  });
1818
2576
  //#endregion
1819
- export { mmkv as a, screens as c, safeAreaContext as d, gestureHandler as f, reanimated as h, svg as i, asyncStorage as l, buildPressableHostProps as m, vectorIcons as n, deviceInfo as o, createPressableMock as p, webview as r, expo as s, presets_exports as t, navigation as u };
2577
+ export { navigation as C, buildPressableHostProps as D, createPressableMock as E, reanimated as O, asyncStorage as S, gestureHandler as T, svg as _, bottomSheet as a, expo as b, createTouchableOpacityMock as c, createFlatListMock as d, createScrollViewMock as f, webview as g, vectorIcons as h, createViewMock as i, createVirtualizedListMock as l, flashList as m, worklets as n, createTouchableWithoutFeedbackMock as o, createTextInputMock as p, keyboardController as r, createTouchableHighlightMock as s, presets_exports as t, createSectionListMock as u, mmkv as v, safeAreaContext as w, screens as x, deviceInfo as y };