react-native-terra-ui 0.4.0 → 0.4.1
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/CHANGELOG.md +13 -0
- package/lib/module/components/screen/Screen.js +4 -1
- package/lib/module/components/screen/Screen.js.map +1 -1
- package/lib/module/components/screen/ScreenFlashList.js +48 -35
- package/lib/module/components/screen/ScreenFlashList.js.map +1 -1
- package/lib/module/components/screen/ScreenFlatList.js +40 -31
- package/lib/module/components/screen/ScreenFlatList.js.map +1 -1
- package/lib/module/components/screen/ScreenList.js +160 -0
- package/lib/module/components/screen/ScreenList.js.map +1 -0
- package/lib/module/components/screen/ScreenScrollView.js +26 -14
- package/lib/module/components/screen/ScreenScrollView.js.map +1 -1
- package/lib/module/components/screen/index.js +1 -0
- package/lib/module/components/screen/index.js.map +1 -1
- package/lib/module/theme/tokens/primitives.js +3 -3
- package/lib/typescript/src/components/screen/Screen.d.ts +2 -0
- package/lib/typescript/src/components/screen/Screen.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenFlashList.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenFlatList.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenList.d.ts +64 -0
- package/lib/typescript/src/components/screen/ScreenList.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/index.d.ts +2 -0
- package/lib/typescript/src/components/screen/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/screen/Screen.tsx +5 -1
- package/src/components/screen/ScreenFlashList.tsx +51 -38
- package/src/components/screen/ScreenFlatList.tsx +41 -30
- package/src/components/screen/ScreenList.tsx +269 -0
- package/src/components/screen/ScreenScrollView.tsx +19 -10
- package/src/components/screen/index.ts +2 -0
- package/src/theme/tokens/primitives.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.1](https://github.com/earthlin9/react-native-terra-ui/compare/v0.4.0...v0.4.1) (2026-08-29)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **showcase:** use Screen.List for the gallery list ([45daf7f](https://github.com/earthlin9/react-native-terra-ui/commit/45daf7ffe77f401f77567ca394b343beca460314))
|
|
8
|
+
* **theme:** tune default header height and vertical margin scale ([3f8a73a](https://github.com/earthlin9/react-native-terra-ui/commit/3f8a73a68ccbf13d536534f1753cda66844ffdb3))
|
|
9
|
+
* **ui:** [screen] add Screen.List, a polymorphic list container ([ec2909f](https://github.com/earthlin9/react-native-terra-ui/commit/ec2909f4646c9a83259485e54e68d33c0dd99912))
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **showcase:** allow iPad to rotate ([bf081f5](https://github.com/earthlin9/react-native-terra-ui/commit/bf081f59477feaabaefe364df9e8eaabf1d42708))
|
|
14
|
+
* **ui:** [screen] keep breakpoint-derived margins reactive on rotation ([4b2f28b](https://github.com/earthlin9/react-native-terra-ui/commit/4b2f28be54a48e383eeed7708ac7eabbcf6ca62e))
|
|
15
|
+
|
|
3
16
|
## [0.4.0](https://github.com/earthlin9/react-native-terra-ui/compare/v0.3.0...v0.4.0) (2026-08-28)
|
|
4
17
|
|
|
5
18
|
### ⚠ BREAKING CHANGES
|
|
@@ -8,6 +8,7 @@ import { PortalProvider } from "../portal/index.js";
|
|
|
8
8
|
import { ScreenScrollProvider } from "./ScreenContext.js";
|
|
9
9
|
import { ScreenFlashList } from "./ScreenFlashList.js";
|
|
10
10
|
import { ScreenFlatList } from "./ScreenFlatList.js";
|
|
11
|
+
import { ScreenList } from "./ScreenList.js";
|
|
11
12
|
import { ScreenScrollView } from "./ScreenScrollView.js";
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
14
|
/**
|
|
@@ -47,7 +48,8 @@ function hasScreenHeader(children) {
|
|
|
47
48
|
/**
|
|
48
49
|
* Themed page container: solid themed background, safe-area handling, and a
|
|
49
50
|
* shared scroll context for headers. Pair with `Screen.ScrollView` /
|
|
50
|
-
* `Screen.
|
|
51
|
+
* `Screen.List` (or `Screen.FlatList` / `Screen.FlashList` directly) and a
|
|
52
|
+
* `Header.LargeTitle` / `Header.Title`.
|
|
51
53
|
*
|
|
52
54
|
* @example
|
|
53
55
|
* ```tsx
|
|
@@ -88,6 +90,7 @@ ScreenBase.Header = ScreenHeader;
|
|
|
88
90
|
ScreenBase.ScrollView = ScreenScrollView;
|
|
89
91
|
ScreenBase.FlatList = ScreenFlatList;
|
|
90
92
|
ScreenBase.FlashList = ScreenFlashList;
|
|
93
|
+
ScreenBase.List = ScreenList;
|
|
91
94
|
export const Screen = ScreenBase;
|
|
92
95
|
const styles = StyleSheet.create((_theme, _runtime) => ({
|
|
93
96
|
container: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Children","Fragment","forwardRef","isValidElement","useMemo","StyleSheet","useUnistyles","resolveThemeColor","PortalProvider","ScreenScrollProvider","ScreenFlashList","ScreenFlatList","ScreenScrollView","jsx","_jsx","ScreenHeader","children","as","rest","Component","displayName","hasScreenHeader","found","forEach","child","type","ScreenBase","Screen","bg","margins","hasMargins","style","_ref","hasHeader","resolvedMargins","theme","resolvedBg","color","background","View","styles","container","Header","ScrollView","FlatList","FlashList","create","_theme","_runtime","flex"],"sourceRoot":"../../../../src","sources":["components/screen/Screen.tsx"],"mappings":";;;AAAA,SACEA,QAAQ,EAIRC,QAAQ,EACRC,UAAU,EACVC,cAAc,EAGdC,OAAO,QACF,OAAO;AAGd,SAASC,UAAU,EAAEC,YAAY,QAAQ,wBAAwB;AAEjE,SAASC,iBAAiB;AAC1B,SAASC,cAAc;AACvB,SAASC,oBAAoB;AAC7B,SAASC,eAAe;AACxB,SAASC,cAAc;AACvB,SAASC,gBAAgB;AAA6B,SAAAC,GAAA,IAAAC,IAAA;AAetD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAA0C;EAC7DC,QAAQ;EACRC,EAAE;EACF,GAAGC;AACiB,CAAC,EAAE;EACvB,MAAMC,SAAS,GAAGF,EAAE,
|
|
1
|
+
{"version":3,"names":["Children","Fragment","forwardRef","isValidElement","useMemo","StyleSheet","useUnistyles","resolveThemeColor","PortalProvider","ScreenScrollProvider","ScreenFlashList","ScreenFlatList","ScreenList","ScreenScrollView","jsx","_jsx","ScreenHeader","children","as","rest","Component","displayName","hasScreenHeader","found","forEach","child","type","ScreenBase","Screen","bg","margins","hasMargins","style","_ref","hasHeader","resolvedMargins","theme","resolvedBg","color","background","View","styles","container","Header","ScrollView","FlatList","FlashList","List","create","_theme","_runtime","flex"],"sourceRoot":"../../../../src","sources":["components/screen/Screen.tsx"],"mappings":";;;AAAA,SACEA,QAAQ,EAIRC,QAAQ,EACRC,UAAU,EACVC,cAAc,EAGdC,OAAO,QACF,OAAO;AAGd,SAASC,UAAU,EAAEC,YAAY,QAAQ,wBAAwB;AAEjE,SAASC,iBAAiB;AAC1B,SAASC,cAAc;AACvB,SAASC,oBAAoB;AAC7B,SAASC,eAAe;AACxB,SAASC,cAAc;AACvB,SAASC,UAAU;AACnB,SAASC,gBAAgB;AAA6B,SAAAC,GAAA,IAAAC,IAAA;AAetD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAA0C;EAC7DC,QAAQ;EACRC,EAAE;EACF,GAAGC;AACiB,CAAC,EAAE;EACvB,MAAMC,SAAS,GAAGF,EAAE,IAAIjB,QAAQ;EAChC,oBAAOc,IAAA,CAACK,SAAS;IAAA,GAAKD,IAAI;IAAAF,QAAA,EAAGA;EAAQ,CAAY,CAAC;AACpD;AACAD,YAAY,CAACK,WAAW,GAAG,eAAe;;AAE1C;AACA,SAASC,eAAeA,CAACL,QAAmB,EAAW;EACrD,IAAIM,KAAK,GAAG,KAAK;EACjBvB,QAAQ,CAACwB,OAAO,CAACP,QAAQ,EAAGQ,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CAACgB,MAAM,GAAG3B,YAAY;AAChCW,UAAU,CAACiB,UAAU,GAAG/B,gBAAgB;AACxCc,UAAU,CAACkB,QAAQ,GAAGlC,cAAc;AACpCgB,UAAU,CAACmB,SAAS,GAAGpC,eAAe;AACtCiB,UAAU,CAACoB,IAAI,GAAGnC,UAAU;AAE5B,OAAO,MAAMgB,MAAM,GAAGD,UAAU;AAEhC,MAAMc,MAAM,GAAGpC,UAAU,CAAC2C,MAAM,CAAC,CAACC,MAAM,EAAEC,QAAQ,MAAM;EACtDR,SAAS,EAAE;IACTS,IAAI,EAAE;EACR;AACF,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -95,10 +95,12 @@ export function ScreenFlashList({
|
|
|
95
95
|
const footerComponent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
96
96
|
children: [renderListHeader(ListFooterComponent), needsBottomSafeArea ? /*#__PURE__*/_jsx(BottomSafeArea, {}) : null]
|
|
97
97
|
});
|
|
98
|
-
const headerComponent = /*#__PURE__*/_jsxs(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
const headerComponent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
99
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
100
|
+
style: styles.headerWrapper(resolvedMargins),
|
|
101
|
+
children: /*#__PURE__*/_jsx(PortalHost, {
|
|
102
|
+
name: SCREEN_HEADER_PORTAL_HOST
|
|
103
|
+
})
|
|
102
104
|
}), renderListHeader(ListHeaderComponent)]
|
|
103
105
|
});
|
|
104
106
|
return /*#__PURE__*/_jsx(AnimatedFlashList, {
|
|
@@ -119,35 +121,46 @@ export function ScreenFlashList({
|
|
|
119
121
|
onScroll: composedHandler
|
|
120
122
|
});
|
|
121
123
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
height
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
124
|
+
|
|
125
|
+
// `resolveScreenMargin` is called *inside* each dynamic function below, not
|
|
126
|
+
// hoisted to the factory's top level — the Babel plugin only attributes a
|
|
127
|
+
// runtime dependency (here, breakpoint) to a style key when the `rt`/
|
|
128
|
+
// `runtime` read it derives from sits inside that key's own value. Hoisting
|
|
129
|
+
// it would silently drop the dependency, so the margin would freeze at
|
|
130
|
+
// whatever breakpoint was active on mount and never update on rotation.
|
|
131
|
+
const styles = StyleSheet.create((theme, runtime) => ({
|
|
132
|
+
content: (margins, hasHeader, bottomInset) => {
|
|
133
|
+
const {
|
|
134
|
+
x: marginX,
|
|
135
|
+
y: marginY
|
|
136
|
+
} = resolveScreenMargin(theme, runtime.breakpoint);
|
|
137
|
+
return {
|
|
138
|
+
flexGrow: 1,
|
|
139
|
+
// The header is absolutely positioned, so the list reserves its full
|
|
140
|
+
// height — bar plus top safe area. This assumes the scroll view does not
|
|
141
|
+
// also get UIKit's automatic inset adjustment: on a native tab screen
|
|
142
|
+
// that means `disableAutomaticContentInsets` on the tab, or the two
|
|
143
|
+
// insets are counted twice.
|
|
144
|
+
paddingTop: (hasHeader ? theme.layout.header.height + runtime.insets.top : 0) + (hasYMargin(margins) ? marginY : 0),
|
|
145
|
+
paddingHorizontal: hasXMargin(margins) ? marginX : 0,
|
|
146
|
+
// The safe area is `BottomSafeArea`'s job; counting it here as well
|
|
147
|
+
// would leave a gap the height of the gesture bar.
|
|
148
|
+
paddingBottom: bottomInset ?? (hasYMargin(margins) ? marginY : 0),
|
|
149
|
+
uni__dependencies: [0, 3, 9]
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
safeArea: {
|
|
153
|
+
height: runtime.insets.top,
|
|
154
|
+
uni__dependencies: [9]
|
|
155
|
+
},
|
|
156
|
+
headerWrapper: margins => {
|
|
157
|
+
const {
|
|
158
|
+
x: marginX
|
|
159
|
+
} = resolveScreenMargin(theme, runtime.breakpoint);
|
|
160
|
+
return {
|
|
161
|
+
marginHorizontal: hasXMargin(margins) ? -marginX : 0,
|
|
162
|
+
uni__dependencies: [0, 3]
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
}));
|
|
153
166
|
//# sourceMappingURL=ScreenFlashList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FlashList","Animated","useAnimatedScrollHandler","useComposedEventHandler","StyleSheet","resolveScreenMargin","PortalHost","BottomSafeArea","renderScreenPlaceholder","SCREEN_HEADER_PORTAL_HOST","useScreen","hasXMargin","hasYMargin","renderListHeader","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","AnimatedFlashList","createAnimatedComponent","ScreenFlashList","data","style","contentContainerStyle","ListHeaderComponent","ListFooterComponent","ListEmptyComponent","horizontal","loading","LoadingComponent","EmptyComponent","margins","bottomInset","onScroll","rest","Error","background","scrollHandler","headerSnapOffsets","screenMargins","hasHeader","resolvedMargins","placeholder","isEmpty","length","jsScrollHandler","event","composedHandler","listProps","needsBottomSafeArea","undefined","footerComponent","children","headerComponent","View","styles","headerWrapper","name","backgroundColor","contentInsetAdjustmentBehavior","content","showsVerticalScrollIndicator","scrollEventThrottle","snapToOffsets","create","theme","runtime","x","marginX","y","marginY","breakpoint","flexGrow","paddingTop","layout","header","height","insets","top","paddingHorizontal","paddingBottom","uni__dependencies","safeArea","marginHorizontal"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenFlashList.tsx"],"mappings":";;;AAAA,SAASA,SAAS,QAA6B,qBAAqB;AAOpE,OAAOC,QAAQ,IACbC,wBAAwB,EACxBC,uBAAuB,QAClB,yBAAyB;AAEhC,SAASC,UAAU,QAAQ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AK,IAAK;IACT,IAAIb,QAAQ,EACVA,QAAQ,CAACa,KAA2D,CAAC;EACzE,CAAC,EACD,CAACb,QAAQ,CACX,CAAC;EAED,MAAMc,eAAe,GAAG9C,uBAAuB,CAAC,CAC9CoC,aAAa,EACbQ,eAAe,CAChB,CAAC;;EAEF;EACA;EACA;EACA,MAAMG,SAAS,GAAGd,IAA0D;;EAE5E;EACA;EACA,MAAMe,mBAAmB,GAAGjB,WAAW,KAAKkB,SAAS,IAAI,CAACvB,UAAU;EAEpE,MAAMwB,eAAe,gBACnBlC,KAAA,CAAAF,SAAA;IAAAqC,QAAA,GACGzC,gBAAgB,CAACc,mBAAmB,CAAC,EACrCwB,mBAAmB,gBAAGpC,IAAA,CAACR,cAAc,IAAE,CAAC,GAAG,IAAI;EAAA,CAChD,CACH;EAED,MAAMgD,eAAe,gBACnBpC,KAAA,
|
|
1
|
+
{"version":3,"names":["FlashList","Animated","useAnimatedScrollHandler","useComposedEventHandler","StyleSheet","resolveScreenMargin","PortalHost","BottomSafeArea","renderScreenPlaceholder","SCREEN_HEADER_PORTAL_HOST","useScreen","hasXMargin","hasYMargin","renderListHeader","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","AnimatedFlashList","createAnimatedComponent","ScreenFlashList","data","style","contentContainerStyle","ListHeaderComponent","ListFooterComponent","ListEmptyComponent","horizontal","loading","LoadingComponent","EmptyComponent","margins","bottomInset","onScroll","rest","Error","background","scrollHandler","headerSnapOffsets","screenMargins","hasHeader","resolvedMargins","placeholder","isEmpty","length","jsScrollHandler","event","composedHandler","listProps","needsBottomSafeArea","undefined","footerComponent","children","headerComponent","View","styles","headerWrapper","name","backgroundColor","contentInsetAdjustmentBehavior","content","showsVerticalScrollIndicator","scrollEventThrottle","snapToOffsets","create","theme","runtime","x","marginX","y","marginY","breakpoint","flexGrow","paddingTop","layout","header","height","insets","top","paddingHorizontal","paddingBottom","uni__dependencies","safeArea","marginHorizontal"],"sourceRoot":"../../../../src","sources":["components/screen/Sc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DzB,aAAa,EAAGzB,OAAsB,IAAK;IACzC,MAAM;MAAEoC,CAAC,EAAEC;IAAQ,CAAC,GAAGjE,mBAAmB,CAAC8D,KAAK,EAAEC,OAAO,CAACK,UAAU,CAAC;IACrE,OAAO;MACLY,gBAAgB,EAAE1E,UAAU,CAACsB,OAAO,CAAC,GAAG,CAACqC,OAAO,GAAG,CAAC;MAAAa,iBAAA;IACtD,CAAC;EACH;AACF,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -80,12 +80,12 @@ export function ScreenFlatList({
|
|
|
80
80
|
const footerComponent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
81
81
|
children: [renderListHeader(ListFooterComponent), needsBottomSafeArea ? /*#__PURE__*/_jsx(BottomSafeArea, {}) : null]
|
|
82
82
|
});
|
|
83
|
-
const headerComponent = /*#__PURE__*/_jsxs(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
const headerComponent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
84
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
85
|
+
style: styles.headerWrapper(resolvedMargins),
|
|
86
|
+
children: /*#__PURE__*/_jsx(PortalHost, {
|
|
87
|
+
name: SCREEN_HEADER_PORTAL_HOST
|
|
88
|
+
})
|
|
89
89
|
}), renderListHeader(ListHeaderComponent)]
|
|
90
90
|
});
|
|
91
91
|
return /*#__PURE__*/_jsx(Animated.FlatList, {
|
|
@@ -107,16 +107,23 @@ export function ScreenFlatList({
|
|
|
107
107
|
onScroll: composedHandler
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
110
|
+
|
|
111
|
+
// `resolveScreenMargin` is called *inside* each dynamic function below, not
|
|
112
|
+
// hoisted to the factory's top level — the Babel plugin only attributes a
|
|
113
|
+
// runtime dependency (here, breakpoint) to a style key when the `rt`/
|
|
114
|
+
// `runtime` read it derives from sits inside that key's own value. Hoisting
|
|
115
|
+
// it would silently drop the dependency, so the margin would freeze at
|
|
116
|
+
// whatever breakpoint was active on mount and never update on rotation.
|
|
117
|
+
const styles = StyleSheet.create((theme, runtime) => ({
|
|
118
|
+
scrollContent: {
|
|
119
|
+
flexGrow: 1
|
|
120
|
+
},
|
|
121
|
+
content: (margins, hasHeader, bottomInset) => {
|
|
122
|
+
const {
|
|
123
|
+
x: marginX,
|
|
124
|
+
y: marginY
|
|
125
|
+
} = resolveScreenMargin(theme, runtime.breakpoint);
|
|
126
|
+
return {
|
|
120
127
|
flexGrow: 1,
|
|
121
128
|
// The header is absolutely positioned, so the list reserves its full
|
|
122
129
|
// height — bar plus top safe area. This assumes the scroll view does not
|
|
@@ -128,19 +135,21 @@ const styles = StyleSheet.create((theme, runtime) => {
|
|
|
128
135
|
// The safe area is `BottomSafeArea`'s job; counting it here as well
|
|
129
136
|
// would leave a gap the height of the gesture bar.
|
|
130
137
|
paddingBottom: bottomInset ?? (hasYMargin(margins) ? marginY : 0),
|
|
131
|
-
uni__dependencies: [0, 9]
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
138
|
+
uni__dependencies: [0, 3, 9]
|
|
139
|
+
};
|
|
140
|
+
},
|
|
141
|
+
safeArea: {
|
|
142
|
+
height: runtime.insets.top,
|
|
143
|
+
uni__dependencies: [9]
|
|
144
|
+
},
|
|
145
|
+
headerWrapper: margins => {
|
|
146
|
+
const {
|
|
147
|
+
x: marginX
|
|
148
|
+
} = resolveScreenMargin(theme, runtime.breakpoint);
|
|
149
|
+
return {
|
|
150
|
+
marginHorizontal: hasXMargin(margins) ? -marginX : 0,
|
|
151
|
+
uni__dependencies: [0, 3]
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
}));
|
|
146
155
|
//# sourceMappingURL=ScreenFlatList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Animated","useAnimatedScrollHandler","useComposedEventHandler","StyleSheet","resolveScreenMargin","PortalHost","BottomSafeArea","renderScreenPlaceholder","SCREEN_HEADER_PORTAL_HOST","useScreen","hasXMargin","hasYMargin","renderListHeader","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ScreenFlatList","data","style","contentContainerStyle","ListHeaderComponent","ListFooterComponent","ListEmptyComponent","horizontal","loading","LoadingComponent","EmptyComponent","margins","bottomInset","onScroll","rest","background","scrollRef","scrollHandler","headerSnapOffsets","screenMargins","hasHeader","resolvedMargins","placeholder","isEmpty","length","jsScrollHandler","event","composedHandler","needsBottomSafeArea","undefined","footerComponent","children","headerComponent","View","styles","headerWrapper","
|
|
1
|
+
{"version":3,"names":["Animated","useAnimatedScrollHandler","useComposedEventHandler","StyleSheet","resolveScreenMargin","PortalHost","BottomSafeArea","renderScreenPlaceholder","SCREEN_HEADER_PORTAL_HOST","useScreen","hasXMargin","hasYMargin","renderListHeader","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ScreenFlatList","data","style","contentContainerStyle","ListHeaderComponent","ListFooterComponent","ListEmptyComponent","horizontal","loading","LoadingComponent","EmptyComponent","margins","bottomInset","onScroll","rest","background","scrollRef","scrollHandler","headerSnapOffsets","screenMargins","hasHeader","resolvedMargins","placeholder","isEmpty","length","jsScrollHandler","event","composedHandler","needsBottomSafeArea","undefined","footerComponent","children","headerComponent","View","styles","headerWrapper","name","FlatList","ref","backgroundColor","contentInsetAdjustmentBehavior","content","showsVerticalScrollIndicator","scrollEventThrottle","snapToOffsets","create","theme","runtime","scrollContent","flexGrow","x","marginX","y","marginY","breakpoint","paddingTop","layout","header","height","insets","top","paddingHorizontal","paddingBottom","uni__dependencies","safeArea","marginHorizontal"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenFlatList.tsx"],"mappings":";;;AAOA,OAAOA,QAAQ,IAEbC,wBAAwB,EACxBC,uBAAuB,QAClB,yBAAyB;AAChC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,mBAAmB;AAC5B,SAASC,UAAU;AACnB,SAASC,cAAc;AACvB,SAASC,uBAAuB;AAChC,SAASC,yBAAyB,EAAEC,SAAS;AAE7C,SAASC,UAAU,EAAEC,UAAU,EAAEC,gBAAgB;AAAkB,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAanE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAI;EAChCC,IAAI;EACJC,KAAK;EACLC,qBAAqB;EACrBC,mBAAmB;EACnBC,mBAAmB;EACnBC,kBAAkB;EAClBC,UAAU,GAAG,KAAK;EAClBC,OAAO,GAAG,KAAK;EACfC,gBAAgB;EAChBC,cAAc;EACdC,OAAO;EACPC,WAAW;EACXC,QAAQ;EACR,GAAGC;AACmB,CAAC,EAAE;EACzB,MAAM;IACJC,UAAU;IACVC,SAAS;IACTC,aAAa;IACbC,iBAAiB;IACjBP,OAAO,EAAEQ,aAAa;IACtBC;EACF,CAAC,GAAG9B,SAAS,CAAC,CAAC;EAEf,MAAM+B,eAAe,GAAGV,OAAO,IAAIQ,aAAa;EAChD;EACA;EACA;EACA;EACA,MAAMG,WAAW,GAAGlC,uBAAuB,CAAC;IAC1CoB,OAAO;IACPC,gBAAgB;IAChBC,cAAc;IACda,OAAO,EAAE,CAACtB,IAAI,IAAIA,IAAI,CAACuB,MAAM,KAAK;EACpC,CAAC,CAAC;EAEF,MAAMC,eAAe,GAAG3C,wBAAwB,CAC7C4C,KAAK,IAAK;IACT,IAAIb,QAAQ,EACV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C;IACrE,OAAO;MACLW,gBAAgB,EAAE1E,UAAU,CAACoB,OAAO,CAAC,GAAG,CAACwC,OAAO,GAAG,CAAC;MAAAY,iBAAA;IACtD,CAAC;EACH;AACF,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View } from "react-native-unistyles/components/native/View";
|
|
4
|
+
import { FlatList } from "react-native-unistyles/components/native/FlatList";
|
|
5
|
+
import { useMemo } from 'react';
|
|
6
|
+
import Animated, { useAnimatedScrollHandler, useComposedEventHandler } from 'react-native-reanimated';
|
|
7
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
8
|
+
import { resolveScreenMargin } from "../../theme/screen-margin.js";
|
|
9
|
+
import { PortalHost } from "../portal/index.js";
|
|
10
|
+
import { BottomSafeArea } from "./parts/BottomSafeArea.js";
|
|
11
|
+
import { renderScreenPlaceholder } from "./parts/ScreenPlaceholder.js";
|
|
12
|
+
import { SCREEN_HEADER_PORTAL_HOST, useScreen } from "./ScreenContext.js";
|
|
13
|
+
import { hasXMargin, hasYMargin, renderListHeader } from "./utils.js";
|
|
14
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
/**
|
|
16
|
+
* Polymorphic list container — renders whichever list `as` names (defaults
|
|
17
|
+
* to `FlatList`), applying the same margin/header/safe-area/scroll-handler
|
|
18
|
+
* chrome regardless of which one it is. A screen can swap list
|
|
19
|
+
* implementations by changing `as`, without relearning the surrounding API.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <Screen.List data={items} renderItem={({ item }) => <Row item={item} />} />
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example Any other list component
|
|
27
|
+
* ```tsx
|
|
28
|
+
* import { FlashList } from '@shopify/flash-list';
|
|
29
|
+
*
|
|
30
|
+
* <Screen.List
|
|
31
|
+
* as={FlashList}
|
|
32
|
+
* data={items}
|
|
33
|
+
* renderItem={({ item }) => <Row item={item} />}
|
|
34
|
+
* />
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export function ScreenList({
|
|
38
|
+
as,
|
|
39
|
+
data,
|
|
40
|
+
renderItem,
|
|
41
|
+
style,
|
|
42
|
+
contentContainerStyle,
|
|
43
|
+
ListHeaderComponent,
|
|
44
|
+
ListFooterComponent,
|
|
45
|
+
ListEmptyComponent,
|
|
46
|
+
horizontal = false,
|
|
47
|
+
loading = false,
|
|
48
|
+
LoadingComponent,
|
|
49
|
+
EmptyComponent,
|
|
50
|
+
margins,
|
|
51
|
+
bottomInset,
|
|
52
|
+
onScroll,
|
|
53
|
+
...rest
|
|
54
|
+
}) {
|
|
55
|
+
const isDefaultFlatList = as === undefined;
|
|
56
|
+
const Component = as ?? FlatList;
|
|
57
|
+
|
|
58
|
+
// `Animated.createAnimatedComponent` should only run once per component,
|
|
59
|
+
// not on every render — `as` is arbitrary here (not a fixed module-scope
|
|
60
|
+
// reference like `Screen.FlatList`/`Screen.FlashList` use), so it's
|
|
61
|
+
// memoized on the resolved component instead of hoisted to module scope.
|
|
62
|
+
const AnimatedComponent = useMemo(() => Animated.createAnimatedComponent(Component), [Component]);
|
|
63
|
+
const {
|
|
64
|
+
background,
|
|
65
|
+
scrollRef,
|
|
66
|
+
scrollHandler,
|
|
67
|
+
headerSnapOffsets,
|
|
68
|
+
margins: screenMargins,
|
|
69
|
+
hasHeader
|
|
70
|
+
} = useScreen();
|
|
71
|
+
const resolvedMargins = margins ?? screenMargins;
|
|
72
|
+
// The placeholder rides in on `ListEmptyComponent` rather than replacing the
|
|
73
|
+
// list, so the header portal, scroll binding and snap offsets all stay put.
|
|
74
|
+
// While loading the list is fed an empty `data` so that slot is the one that
|
|
75
|
+
// renders.
|
|
76
|
+
const placeholder = renderScreenPlaceholder({
|
|
77
|
+
loading,
|
|
78
|
+
LoadingComponent,
|
|
79
|
+
EmptyComponent,
|
|
80
|
+
isEmpty: !data || data.length === 0
|
|
81
|
+
});
|
|
82
|
+
const jsScrollHandler = useAnimatedScrollHandler(event => {
|
|
83
|
+
if (onScroll) onScroll(event);
|
|
84
|
+
}, [onScroll]);
|
|
85
|
+
const composedHandler = useComposedEventHandler([scrollHandler, jsScrollHandler]);
|
|
86
|
+
|
|
87
|
+
// A caller naming its own `bottomInset` has taken the bottom over entirely,
|
|
88
|
+
// and a horizontal list has no bottom edge to clear.
|
|
89
|
+
const needsBottomSafeArea = bottomInset === undefined && !horizontal;
|
|
90
|
+
const footerComponent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
91
|
+
children: [renderListHeader(ListFooterComponent), needsBottomSafeArea ? /*#__PURE__*/_jsx(BottomSafeArea, {}) : null]
|
|
92
|
+
});
|
|
93
|
+
const headerComponent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
94
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
95
|
+
style: styles.headerWrapper(resolvedMargins),
|
|
96
|
+
children: /*#__PURE__*/_jsx(PortalHost, {
|
|
97
|
+
name: SCREEN_HEADER_PORTAL_HOST
|
|
98
|
+
})
|
|
99
|
+
}), renderListHeader(ListHeaderComponent)]
|
|
100
|
+
});
|
|
101
|
+
return /*#__PURE__*/_jsx(AnimatedComponent, {
|
|
102
|
+
ref: isDefaultFlatList ? scrollRef : undefined,
|
|
103
|
+
data: loading ? [] : data,
|
|
104
|
+
renderItem: renderItem,
|
|
105
|
+
style: [{
|
|
106
|
+
backgroundColor: background
|
|
107
|
+
}, style],
|
|
108
|
+
horizontal: horizontal,
|
|
109
|
+
contentInsetAdjustmentBehavior: hasHeader ? 'never' : undefined,
|
|
110
|
+
contentContainerStyle: [styles.content(resolvedMargins, hasHeader, bottomInset), contentContainerStyle],
|
|
111
|
+
ListHeaderComponent: headerComponent,
|
|
112
|
+
ListFooterComponent: footerComponent,
|
|
113
|
+
ListEmptyComponent: placeholder ?? ListEmptyComponent,
|
|
114
|
+
showsVerticalScrollIndicator: false,
|
|
115
|
+
scrollEventThrottle: 16,
|
|
116
|
+
snapToOffsets: headerSnapOffsets,
|
|
117
|
+
...rest,
|
|
118
|
+
onScroll: composedHandler
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
ScreenList.displayName = 'Screen.List';
|
|
122
|
+
|
|
123
|
+
// `resolveScreenMargin` is called *inside* each dynamic function below, not
|
|
124
|
+
// hoisted to the factory's top level — the Babel plugin only attributes a
|
|
125
|
+
// runtime dependency (here, breakpoint) to a style key when the `rt`/
|
|
126
|
+
// `runtime` read it derives from sits inside that key's own value. Hoisting
|
|
127
|
+
// it would silently drop the dependency, so the margin would freeze at
|
|
128
|
+
// whatever breakpoint was active on mount and never update on rotation.
|
|
129
|
+
const styles = StyleSheet.create((theme, runtime) => ({
|
|
130
|
+
content: (margins, hasHeader, bottomInset) => {
|
|
131
|
+
const {
|
|
132
|
+
x: marginX,
|
|
133
|
+
y: marginY
|
|
134
|
+
} = resolveScreenMargin(theme, runtime.breakpoint);
|
|
135
|
+
return {
|
|
136
|
+
flexGrow: 1,
|
|
137
|
+
// The header is absolutely positioned, so the list reserves its full
|
|
138
|
+
// height — bar plus top safe area. This assumes the scroll view does not
|
|
139
|
+
// also get UIKit's automatic inset adjustment: on a native tab screen
|
|
140
|
+
// that means `disableAutomaticContentInsets` on the tab, or the two
|
|
141
|
+
// insets are counted twice.
|
|
142
|
+
paddingTop: (hasHeader ? theme.layout.header.height + runtime.insets.top : 0) + (hasYMargin(margins) ? marginY : 0),
|
|
143
|
+
paddingHorizontal: hasXMargin(margins) ? marginX : 0,
|
|
144
|
+
// The safe area is `BottomSafeArea`'s job; counting it here as well
|
|
145
|
+
// would leave a gap the height of the gesture bar.
|
|
146
|
+
paddingBottom: bottomInset ?? (hasYMargin(margins) ? marginY : 0),
|
|
147
|
+
uni__dependencies: [0, 3, 9]
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
headerWrapper: margins => {
|
|
151
|
+
const {
|
|
152
|
+
x: marginX
|
|
153
|
+
} = resolveScreenMargin(theme, runtime.breakpoint);
|
|
154
|
+
return {
|
|
155
|
+
marginHorizontal: hasXMargin(margins) ? -marginX : 0,
|
|
156
|
+
uni__dependencies: [0, 3]
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}));
|
|
160
|
+
//# sourceMappingURL=ScreenList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useMemo","Animated","useAnimatedScrollHandler","useComposedEventHandler","StyleSheet","resolveScreenMargin","PortalHost","BottomSafeArea","renderScreenPlaceholder","SCREEN_HEADER_PORTAL_HOST","useScreen","hasXMargin","hasYMargin","renderListHeader","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ScreenList","as","data","renderItem","style","contentContainerStyle","ListHeaderComponent","ListFooterComponent","ListEmptyComponent","horizontal","loading","LoadingComponent","EmptyComponent","margins","bottomInset","onScroll","rest","isDefaultFlatList","undefined","Component","FlatList","AnimatedComponent","createAnimatedComponent","background","scrollRef","scrollHandler","headerSnapOffsets","screenMargins","hasHeader","resolvedMargins","placeholder","isEmpty","length","jsScrollHandler","event","composedHandler","needsBottomSafeArea","footerComponent","children","headerComponent","View","styles","headerWrapper","name","ref","backgroundColor","contentInsetAdjustmentBehavior","content","showsVerticalScrollIndicator","scrollEventThrottle","snapToOffsets","displayName","create","theme","runtime","x","marginX","y","marginY","breakpoint","flexGrow","paddingTop","layout","header","height","insets","top","paddingHorizontal","paddingBottom","uni__dependencies","marginHorizontal"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenList.tsx"],"mappings":";;;;AAAA,SAKEA,OAAO,QACF,OAAO;AAUd,OAAOC,QAAQ,IAEbC,wBAAwB,EACxBC,uBAAuB,QAClB,yBAAyB;AAChC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,mBAAmB;AAC5B,SAASC,UAAU;AACnB,SAASC,cAAc;AACvB,SAASC,uBAAuB;AAChC,SAASC,yB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,GAAG,CAAC2C,OAAO,GAAG,CAAC;MAAAa,iBAAA;IACtD,CAAC;EACH;AACF,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -131,13 +131,19 @@ export function ScreenScrollView({
|
|
|
131
131
|
}), horizontal ? null : /*#__PURE__*/_jsx(BottomSafeArea, {})]
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
const styles = StyleSheet.create((theme, rt) => {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
134
|
+
const styles = StyleSheet.create((theme, rt) => ({
|
|
135
|
+
// `resolveScreenMargin` is called *inside* each dynamic function, not
|
|
136
|
+
// hoisted above `return` — the Babel plugin only attributes a runtime
|
|
137
|
+
// dependency (here, breakpoint) to a style key when the `rt` read it
|
|
138
|
+
// derives from sits inside that key's own value. Hoisting it to the
|
|
139
|
+
// factory's top level silently drops the dependency, so the margin would
|
|
140
|
+
// freeze at whatever breakpoint was active on mount and never update on
|
|
141
|
+
// rotation.
|
|
142
|
+
scrollContent: (hasHeader, margins) => {
|
|
143
|
+
const {
|
|
144
|
+
y: marginY
|
|
145
|
+
} = resolveScreenMargin(theme, rt.breakpoint);
|
|
146
|
+
return {
|
|
141
147
|
flexGrow: 1,
|
|
142
148
|
// The header inset and the safe area are structural — they apply
|
|
143
149
|
// whether or not margins are on; the y margin stacks on top of them.
|
|
@@ -145,13 +151,19 @@ const styles = StyleSheet.create((theme, rt) => {
|
|
|
145
151
|
// The safe area is `BottomSafeArea`'s job; counting it here as well
|
|
146
152
|
// would leave a gap the height of the gesture bar.
|
|
147
153
|
paddingBottom: hasYMargin(margins) ? marginY : 0,
|
|
148
|
-
uni__dependencies: [0, 9]
|
|
149
|
-
}
|
|
150
|
-
|
|
154
|
+
uni__dependencies: [0, 3, 9]
|
|
155
|
+
};
|
|
156
|
+
},
|
|
157
|
+
content: (horizontal, margins) => {
|
|
158
|
+
const {
|
|
159
|
+
x: marginX
|
|
160
|
+
} = resolveScreenMargin(theme, rt.breakpoint);
|
|
161
|
+
return {
|
|
151
162
|
flexGrow: 1,
|
|
152
163
|
paddingHorizontal: hasXMargin(margins) ? marginX : 0,
|
|
153
|
-
flexDirection: horizontal ? 'row' : 'column'
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
164
|
+
flexDirection: horizontal ? 'row' : 'column',
|
|
165
|
+
uni__dependencies: [0, 3]
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
}));
|
|
157
169
|
//# sourceMappingURL=ScreenScrollView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Children","Animated","useAnimatedScrollHandler","useComposedEventHandler","StyleSheet","scheduleOnRN","resolveScreenMargin","PortalHost","BottomSafeArea","renderScreenPlaceholder","SCREEN_HEADER_PORTAL_HOST","useScreen","hasXMargin","hasYMargin","jsx","_jsx","jsxs","_jsxs","ScreenScrollView","children","style","contentContainerStyle","scrollHandler","externalScrollHandler","onScroll","onScrollProp","horizontal","loading","LoadingComponent","EmptyComponent","margins","rest","scrollRef","screenScrollHandler","screenMargins","hasHeader","background","resolvedMargins","placeholder","isEmpty","toArray","length","jsScrollHandler","event","nativeEvent","handlers","composedHandler","ScrollView","ref","backgroundColor","contentInsetAdjustmentBehavior","undefined","showsVerticalScrollIndicator","scrollEventThrottle","styles","scrollContent","View","name","content","create","theme","rt","
|
|
1
|
+
{"version":3,"names":["Children","Animated","useAnimatedScrollHandler","useComposedEventHandler","StyleSheet","scheduleOnRN","resolveScreenMargin","PortalHost","BottomSafeArea","renderScreenPlaceholder","SCREEN_HEADER_PORTAL_HOST","useScreen","hasXMargin","hasYMargin","jsx","_jsx","jsxs","_jsxs","ScreenScrollView","children","style","contentContainerStyle","scrollHandler","externalScrollHandler","onScroll","onScrollProp","horizontal","loading","LoadingComponent","EmptyComponent","margins","rest","scrollRef","screenScrollHandler","screenMargins","hasHeader","background","resolvedMargins","placeholder","isEmpty","toArray","length","jsScrollHandler","event","nativeEvent","handlers","composedHandler","ScrollView","ref","backgroundColor","contentInsetAdjustmentBehavior","undefined","showsVerticalScrollIndicator","scrollEventThrottle","styles","scrollContent","View","name","content","create","theme","rt","y","marginY","breakpoint","flexGrow","paddingTop","layout","header","height","insets","top","paddingBottom","uni__dependencies","x","marginX","paddingHorizontal","flexDirection"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenScrollView.tsx"],"mappings":";;;AAAA,SAASA,QAAQ,QAAwB,OAAO;AAQhD,OAAOC,QAAQ,IAEbC,wBAAwB,EACxBC,uBAAuB,QAClB,yBAAyB;AAChC,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,YAAY,QAAQ,uBAAuB;AAEpD,SAASC,mBAAmB;AAC5B,SAASC,UAAU;AACnB,SAASC,cAAc;AACvB,SAASC,uBAAuB;AAChC,SAASC,yBAAyB,EAAEC,SAAS;AAE7C,SAASC,UAAU,EAAEC,UAAU;AAAkB,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAejD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAC;EAC/BC,QAAQ;EACRC,KAAK;EACLC,qBAAqB;EACrBC,aAAa,EAAEC,qBAAqB;EACpCC,QAAQ,EAAEC,YAAY;EACtBC,UAAU,GAAG,KAAK;EAClBC,OAAO,GAAG,KAAK;EACfC,gBAAgB;EAChBC,cAAc;EACdC,OAAO;EACP,GAAGC;AACkB,CAAC,EAAE;EACxB,MAAM;IACJC,SAAS;IACTV,aAAa,EAAEW,mBAAmB;IAClCH,OAAO,EAAE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OAAO,CAAC,GAAG6C,OAAO,GAAG,CAAC;MACpDE,aAAa,EAAEnD,UAAU,GAAG,KAAK,GAAG,QAAQ;MAAA+C,iBAAA;IAC9C,CAAC;EACH;AACF,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,5 +4,6 @@ export { Screen } from "./Screen.js";
|
|
|
4
4
|
export { useScreen } from "./ScreenContext.js";
|
|
5
5
|
export { ScreenFlashList } from "./ScreenFlashList.js";
|
|
6
6
|
export { ScreenFlatList } from "./ScreenFlatList.js";
|
|
7
|
+
export { ScreenList } from "./ScreenList.js";
|
|
7
8
|
export { ScreenScrollView } from "./ScreenScrollView.js";
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Screen","useScreen","ScreenFlashList","ScreenFlatList","ScreenScrollView"],"sourceRoot":"../../../../src","sources":["components/screen/index.ts"],"mappings":";;AACA,SAASA,MAAM;AAEf,SAASC,SAAS;AAElB,SAASC,eAAe;AAExB,SAASC,cAAc;AAEvB,SAASC,gBAAgB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Screen","useScreen","ScreenFlashList","ScreenFlatList","ScreenList","ScreenScrollView"],"sourceRoot":"../../../../src","sources":["components/screen/index.ts"],"mappings":";;AACA,SAASA,MAAM;AAEf,SAASC,SAAS;AAElB,SAASC,eAAe;AAExB,SAASC,cAAc;AAEvB,SAASC,UAAU;AAEnB,SAASC,gBAAgB","ignoreList":[]}
|
|
@@ -449,11 +449,11 @@ export const primitives = {
|
|
|
449
449
|
'layout.screen.margin.y.xs': 16,
|
|
450
450
|
'layout.screen.margin.y.sm': 16,
|
|
451
451
|
'layout.screen.margin.y.md': 24,
|
|
452
|
-
'layout.screen.margin.y.lg':
|
|
453
|
-
'layout.screen.margin.y.xl':
|
|
452
|
+
'layout.screen.margin.y.lg': 24,
|
|
453
|
+
'layout.screen.margin.y.xl': 24,
|
|
454
454
|
// ── header layout ─────────────────────────────────────────────────────────
|
|
455
455
|
// Header bar height (compact nav bar / collapsed large-title bar). 56dp aligns
|
|
456
456
|
// to the 4dp spacing grid (= spacing.14) and a standard app-bar height.
|
|
457
|
-
'layout.header.height':
|
|
457
|
+
'layout.header.height': 54
|
|
458
458
|
};
|
|
459
459
|
//# sourceMappingURL=primitives.js.map
|
|
@@ -4,6 +4,7 @@ import type { ViewProps } from 'react-native-svg/lib/typescript/fabric/utils';
|
|
|
4
4
|
import type { ColorToken } from '../../theme/types';
|
|
5
5
|
import { ScreenFlashList } from './ScreenFlashList.js';
|
|
6
6
|
import { ScreenFlatList } from './ScreenFlatList.js';
|
|
7
|
+
import { ScreenList } from './ScreenList.js';
|
|
7
8
|
import { ScreenScrollView } from './ScreenScrollView.js';
|
|
8
9
|
import type { ScreenMargins } from './types.js';
|
|
9
10
|
export type ScreenHeaderProps<T extends ElementType = typeof Fragment> = PropsWithChildren<{
|
|
@@ -52,6 +53,7 @@ type ScreenComponent = ReturnType<typeof forwardRef<ComponentRef<typeof View>, S
|
|
|
52
53
|
ScrollView: typeof ScreenScrollView;
|
|
53
54
|
FlatList: typeof ScreenFlatList;
|
|
54
55
|
FlashList: typeof ScreenFlashList;
|
|
56
|
+
List: typeof ScreenList;
|
|
55
57
|
};
|
|
56
58
|
export declare const Screen: ScreenComponent;
|
|
57
59
|
export {};
|