react-native-terra-ui 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/lib/module/components/avatar/Avatar.js +7 -2
- package/lib/module/components/avatar/Avatar.js.map +1 -1
- package/lib/module/components/header/header-buttons.js +1 -1
- package/lib/module/components/header/header-buttons.js.map +1 -1
- package/lib/module/components/icon/Icon.js +2 -2
- package/lib/module/components/screen/Screen.js +87 -27
- package/lib/module/components/screen/Screen.js.map +1 -1
- package/lib/module/components/screen/ScreenContext.js +5 -1
- package/lib/module/components/screen/ScreenContext.js.map +1 -1
- package/lib/module/components/screen/ScreenList.js +11 -3
- package/lib/module/components/screen/ScreenList.js.map +1 -1
- package/lib/module/components/screen/ScreenScrollView.js +11 -3
- package/lib/module/components/screen/ScreenScrollView.js.map +1 -1
- package/lib/module/components/screen/hooks/use-nested-container-warning.js +39 -0
- package/lib/module/components/screen/hooks/use-nested-container-warning.js.map +1 -0
- package/lib/module/components/screen/parts/ScreenFrame.js +1 -0
- package/lib/module/components/screen/parts/ScreenFrame.js.map +1 -1
- package/lib/module/components/toast/Toast.js +1 -1
- package/lib/module/components/toast/Toast.js.map +1 -1
- package/lib/module/theme/defaults/icons.js +26 -19
- package/lib/module/theme/defaults/icons.js.map +1 -1
- package/lib/typescript/src/components/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/src/components/icon/Icon.d.ts +2 -2
- package/lib/typescript/src/components/screen/Screen.d.ts +6 -0
- package/lib/typescript/src/components/screen/Screen.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenContext.d.ts +27 -1
- package/lib/typescript/src/components/screen/ScreenContext.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenList.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/hooks/use-nested-container-warning.d.ts +24 -0
- package/lib/typescript/src/components/screen/hooks/use-nested-container-warning.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/parts/ScreenFrame.d.ts.map +1 -1
- package/lib/typescript/src/theme/defaults/icons.d.ts.map +1 -1
- package/lib/typescript/src/theme/types.d.ts +1 -1
- package/lib/typescript/src/theme/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/avatar/Avatar.tsx +6 -1
- package/src/components/header/header-buttons.tsx +1 -1
- package/src/components/icon/Icon.tsx +2 -2
- package/src/components/screen/Screen.tsx +81 -17
- package/src/components/screen/ScreenContext.tsx +32 -0
- package/src/components/screen/ScreenList.tsx +9 -1
- package/src/components/screen/ScreenScrollView.tsx +9 -1
- package/src/components/screen/hooks/use-nested-container-warning.ts +40 -0
- package/src/components/screen/parts/ScreenFrame.tsx +8 -1
- package/src/components/toast/Toast.tsx +1 -1
- package/src/theme/defaults/icons.tsx +22 -15
- package/src/theme/types.ts +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.10.0](https://github.com/earthlin9/react-native-terra-ui/compare/v0.9.1...v0.10.0) (2026-09-08)
|
|
4
|
+
|
|
5
|
+
### ⚠ BREAKING CHANGES
|
|
6
|
+
|
|
7
|
+
* **theme:** four semantic icon names have been renamed. Update any
|
|
8
|
+
`<Icon name>`, `Chip.Icon`, `Button.Icon`, `Toolbar.Button icon`, or
|
|
9
|
+
`configureTerraUI({ icons })` override that uses the old names:
|
|
10
|
+
|
|
11
|
+
navigation.back -> terra.chevron-left
|
|
12
|
+
navigation.forward -> terra.chevron-right
|
|
13
|
+
navigation.close -> terra.x
|
|
14
|
+
person -> terra.person
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **theme:** move semantic icons into the terra namespace, add terra.check ([#20](https://github.com/earthlin9/react-native-terra-ui/issues/20))
|
|
19
|
+
|
|
20
|
+
## [0.9.1](https://github.com/earthlin9/react-native-terra-ui/compare/v0.9.0...v0.9.1) (2026-09-07)
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **ui:** [screen] hand vertical insets to UIKit on header-less screens ([4f1a95c](https://github.com/earthlin9/react-native-terra-ui/commit/4f1a95c31bfbcf6d8424095b3961ee28ea1743ab))
|
|
25
|
+
* **ui:** [screen] require both vertical edges before handing insets over ([f135e01](https://github.com/earthlin9/react-native-terra-ui/commit/f135e010c372b0812171bd6b9771503acf094f47))
|
|
26
|
+
|
|
3
27
|
## [0.9.0](https://github.com/earthlin9/react-native-terra-ui/compare/v0.8.1...v0.9.0) (2026-09-07)
|
|
4
28
|
|
|
5
29
|
### ⚠ BREAKING CHANGES
|
|
@@ -21,6 +21,11 @@ const INITIALS_FONT_SIZE = {
|
|
|
21
21
|
lg: 18,
|
|
22
22
|
xl: 24
|
|
23
23
|
};
|
|
24
|
+
|
|
25
|
+
// The person fallback glyph fills 55% of the avatar diameter. The ratio lives
|
|
26
|
+
// here rather than inside the icon so `terra.person` scales like every other
|
|
27
|
+
// registry icon at a given `size`.
|
|
28
|
+
const PERSON_ICON_RATIO = 0.55;
|
|
24
29
|
function getInitials(name) {
|
|
25
30
|
const parts = name.trim().split(/\s+/);
|
|
26
31
|
const first = parts[0]?.[0] ?? "";
|
|
@@ -79,8 +84,8 @@ export function Avatar({
|
|
|
79
84
|
numberOfLines: 1,
|
|
80
85
|
children: getInitials(name)
|
|
81
86
|
}) : /*#__PURE__*/_jsx(Icon, {
|
|
82
|
-
name: "person",
|
|
83
|
-
size: sizePx,
|
|
87
|
+
name: "terra.person",
|
|
88
|
+
size: sizePx * PERSON_ICON_RATIO,
|
|
84
89
|
color: fg
|
|
85
90
|
});
|
|
86
91
|
return /*#__PURE__*/_jsx(View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useState","StyleSheet","useUnistyles","Icon","Image","jsx","_jsx","SIZE_PX","xs","sm","md","lg","xl","INITIALS_FONT_SIZE","getInitials","name","parts","trim","split","first","last","length","toUpperCase","getBorderRadius","shape","sizePx","radiusMd","getImageRadius","Avatar","size","source","fallback","contentFit","color","variant","style","rest","theme","hasError","setHasError","_styles","styles","useVariants","borderRadius","radius","showFallback","bg","base","backgroundColor","fg","fallbackContent","undefined","Text","fontSize","fontWeight","includeFontPadding","numberOfLines","children","View","width","height","alignItems","justifyContent","overflow","accessibilityLabel","onError","create","c","variants","secondary","primary","success","warning","danger","solid","soft","compoundVariants","uni__dependencies"],"sourceRoot":"../../../../src","sources":["components/avatar/Avatar.tsx"],"mappings":";;;;AAAA,SAASA,QAAQ,QAAQ,OAAO;AAGhC,SAASC,UAAU,EAAEC,YAAY,QAAQ,wBAAwB;AAGjE,SAASC,IAAI;AACb,SAASC,KAAK;AAAmB,SAAAC,GAAA,IAAAC,IAAA;AAGjC,MAAMC,OAAmC,GAAG;EAC1CC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE;AACN,CAAC;AAED,MAAMC,kBAA8C,GAAG;EACrDL,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE;AACN,CAAC;
|
|
1
|
+
{"version":3,"names":["useState","StyleSheet","useUnistyles","Icon","Image","jsx","_jsx","SIZE_PX","xs","sm","md","lg","xl","INITIALS_FONT_SIZE","PERSON_ICON_RATIO","getInitials","name","parts","trim","split","first","last","length","toUpperCase","getBorderRadius","shape","sizePx","radiusMd","getImageRadius","Avatar","size","source","fallback","contentFit","color","variant","style","rest","theme","hasError","setHasError","_styles","styles","useVariants","borderRadius","radius","showFallback","bg","base","backgroundColor","fg","fallbackContent","undefined","Text","fontSize","fontWeight","includeFontPadding","numberOfLines","children","View","width","height","alignItems","justifyContent","overflow","accessibilityLabel","onError","create","c","variants","secondary","primary","success","warning","danger","solid","soft","compoundVariants","uni__dependencies"],"sourceRoot":"../../../../src","sources":["components/avatar/Avatar.tsx"],"mappings":";;;;AAAA,SAASA,QAAQ,QAAQ,OAAO;AAGhC,SAASC,UAAU,EAAEC,YAAY,QAAQ,wBAAwB;AAGjE,SAASC,IAAI;AACb,SAASC,KAAK;AAAmB,SAAAC,GAAA,IAAAC,IAAA;AAGjC,MAAMC,OAAmC,GAAG;EAC1CC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE;AACN,CAAC;AAED,MAAMC,kBAA8C,GAAG;EACrDL,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE;AACN,CAAC;;AAED;AACA;AACA;AACA,MAAME,iBAAiB,GAAG,IAAI;AAE9B,SAASC,WAAWA,CAACC,IAAY,EAAU;EACzC,MAAMC,KAAK,GAAGD,IAAI,CAACE,IAAI,CAAC,CAAC,CAACC,KAAK,CAAC,KAAK,CAAC;EACtC,MAAMC,KAAK,GAAGH,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;EACjC,MAAMI,IAAI,GAAGJ,KAAK,CAACK,MAAM,GAAG,CAAC,GAAIL,KAAK,CAACA,KAAK,CAACK,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,GAAI,EAAE;EACzE,OAAO,CAACF,KAAK,GAAGC,IAAI,EAAEE,WAAW,CAAC,CAAC;AACrC;AAEA,SAASC,eAAeA,CAACC,KAAkB,EAAEC,MAAc,EAAEC,QAAgB,EAAU;EACrF,IAAIF,KAAK,KAAK,QAAQ,EAAE,OAAOC,MAAM,GAAG,CAAC;EACzC,IAAID,KAAK,KAAK,SAAS,EAAE,OAAOE,QAAQ;EACxC,OAAO,CAAC;AACV;;AAEA;AACA;AACA;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CAAC,EACD;QACElC,KAAK,EAAE,SAAS;QAChBC,OAAO,EAAE,OAAO;QAChBO,MAAM,EAAE;UACNO,eAAe,EAAEmB,CAAC,CAAC,kBAAkB,CAAC;UACtClC,KAAK,EAAEkC,CAAC,CAAC,kBAAkB;QAC7B;MACF,CAAC,EACD;QACElC,KAAK,EAAE,SAAS;QAChBC,OAAO,EAAE,MAAM;QACfO,MAAM,EAAE;UACNO,eAAe,EAAEmB,CAAC,CAAC,iBAAiB,CAAC;UACrClC,KAAK,EAAEkC,CAAC,CAAC,iBAAiB;QAC5B;MACF,CAAC,EACD;QACElC,KAAK,EAAE,QAAQ;QACfC,OAAO,EAAE,OAAO;QAChBO,MAAM,EAAE;UACNO,eAAe,EAAEmB,CAAC,CAAC,iBAAiB,CAAC;UACrClC,KAAK,EAAEkC,CAAC,CAAC,iBAAiB;QAC5B;MACF,CAAC,EACD;QACElC,KAAK,EAAE,QAAQ;QACfC,OAAO,EAAE,MAAM;QACfO,MAAM,EAAE;UACNO,eAAe,EAAEmB,CAAC,CAAC,gBAAgB,CAAC;UACpClC,KAAK,EAAEkC,CAAC,CAAC,gBAAgB;QAC3B;MACF,CAAC,CACF;MAAAU,iBAAA;IACH;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]}
|
|
@@ -29,7 +29,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
29
29
|
*/
|
|
30
30
|
export const HeaderButton = Toolbar.Button;
|
|
31
31
|
const getDismissAccessibilityLabel = dismissAction => dismissAction === "close" ? "Close" : "Back";
|
|
32
|
-
const getDismissIconName = dismissAction => dismissAction === "close" ? "
|
|
32
|
+
const getDismissIconName = dismissAction => dismissAction === "close" ? "terra.x" : "terra.chevron-left";
|
|
33
33
|
export function HeaderDismissButton({
|
|
34
34
|
dismissAction = "none",
|
|
35
35
|
navigation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Toolbar","jsx","_jsx","HeaderButton","Button","getDismissAccessibilityLabel","dismissAction","getDismissIconName","HeaderDismissButton","navigation","onDismiss","handlePress","dismiss","goBack","canGoBack","icon","iconSize","accessibilityLabel","onPress"],"sourceRoot":"../../../../src","sources":["components/header/header-buttons.tsx"],"mappings":";;AACA,SAASA,OAAO;;AAEhB;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,GAAA,IAAAC,IAAA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAGH,OAAO,CAACI,MAAM;AAmB1C,MAAMC,4BAA4B,GAAIC,aAAkC,IACtEA,aAAa,KAAK,OAAO,GAAG,OAAO,GAAG,MAAM;AAE9C,MAAMC,kBAAkB,GAAID,aAAkC,IAC5DA,aAAa,KAAK,OAAO,GAAG,
|
|
1
|
+
{"version":3,"names":["Toolbar","jsx","_jsx","HeaderButton","Button","getDismissAccessibilityLabel","dismissAction","getDismissIconName","HeaderDismissButton","navigation","onDismiss","handlePress","dismiss","goBack","canGoBack","icon","iconSize","accessibilityLabel","onPress"],"sourceRoot":"../../../../src","sources":["components/header/header-buttons.tsx"],"mappings":";;AACA,SAASA,OAAO;;AAEhB;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,GAAA,IAAAC,IAAA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAGH,OAAO,CAACI,MAAM;AAmB1C,MAAMC,4BAA4B,GAAIC,aAAkC,IACtEA,aAAa,KAAK,OAAO,GAAG,OAAO,GAAG,MAAM;AAE9C,MAAMC,kBAAkB,GAAID,aAAkC,IAC5DA,aAAa,KAAK,OAAO,GAAG,SAAS,GAAG,oBAAoB;AAE9D,OAAO,SAASE,mBAAmBA,CAAC;EAAEF,aAAa,GAAG,MAAM;EAAEG,UAAU;EAAEC;AAA8B,CAAC,EAAE;EACzG,IAAIJ,aAAa,KAAK,MAAM,EAAE,OAAO,IAAI;EAEzC,MAAMK,WAAW,GAAGA,CAAA,KAAM;IACxB,IAAID,SAAS,EAAE;MACbA,SAAS,CAAC,CAAC;MACX;IACF;IAEA,IAAIJ,aAAa,KAAK,OAAO,IAAIG,UAAU,EAAEG,OAAO,EAAE;MACpDH,UAAU,CAACG,OAAO,CAAC,CAAC;MACpB;IACF;IAEA,IAAIH,UAAU,EAAEI,MAAM,IAAIJ,UAAU,CAACK,SAAS,GAAG,CAAC,KAAK,KAAK,EAAE;MAC5DL,UAAU,CAACI,MAAM,CAAC,CAAC;MACnB;IACF;EACF,CAAC;EAED,oBACEX,IAAA,CAACF,OAAO,CAACI,MAAM;IACbW,IAAI,EAAER,kBAAkB,CAACD,aAAa,CAAE;IACxCU,QAAQ,EAAE,EAAG;IACbC,kBAAkB,EAAEZ,4BAA4B,CAACC,aAAa,CAAE;IAChEY,OAAO,EAAEP;EAAY,CACtB,CAAC;AAEN","ignoreList":[]}
|
|
@@ -8,11 +8,11 @@ import { resolveThemeColor } from "../../utils/resolve-theme-color.js";
|
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
/**
|
|
10
10
|
* Renders an icon from the Terra UI icon registry (`configureTerraUI({ icons })`
|
|
11
|
-
* plus built-in semantic names like `
|
|
11
|
+
* plus built-in semantic names like `terra.chevron-left`).
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```tsx
|
|
15
|
-
* <Icon name="
|
|
15
|
+
* <Icon name="terra.x" size={24} color="text.primary" />
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
18
|
export const Icon = /*#__PURE__*/forwardRef(function Icon({
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { View } from "react-native-unistyles/components/native/View";
|
|
4
4
|
import { Children, Fragment, forwardRef, isValidElement, useMemo } from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { Platform } from "react-native";
|
|
6
|
+
import { useUnistyles } from "react-native-unistyles";
|
|
6
7
|
import { resolveThemeColor } from "../../utils/resolve-theme-color.js";
|
|
7
8
|
import { PortalProvider } from "../portal/index.js";
|
|
8
9
|
import { ScreenFrame } from "./parts/ScreenFrame.js";
|
|
@@ -105,43 +106,108 @@ const ScreenBase = /*#__PURE__*/forwardRef(function Screen({
|
|
|
105
106
|
const hasHeader = useMemo(() => hasScreenHeader(children), [children]);
|
|
106
107
|
const resolvedMargins = contentPadding ?? margins ?? (hasMargins === false ? "none" : "all");
|
|
107
108
|
const edges = useMemo(() => resolveSafeAreaEdges(safeArea), [safeArea]);
|
|
109
|
+
const hasVerticalScrollContainer = useMemo(() => hasScrollContainerOwningBottom(children), [children]);
|
|
108
110
|
/*
|
|
109
|
-
|
|
111
|
+
A screen with no `Screen.Header` wears UIKit's own navigation bar, and only
|
|
112
|
+
UIKit can inset a scroll view for one.
|
|
113
|
+
A native large title changes height on every frame of its collapse, and the
|
|
114
|
+
bar is a sibling view this screen cannot measure — so an inset computed in JS
|
|
115
|
+
is always a frame late and always the wrong size. Worse, UIKit will not
|
|
116
|
+
collapse the title at all unless the scroll view it finds fills the screen:
|
|
117
|
+
padding the top edge on the frame starts that view 168pt down (measured on an
|
|
118
|
+
iPhone 17, expanded title), and the title then stays full size while rows
|
|
119
|
+
scroll up and overprint it.
|
|
120
|
+
So the frame keeps no vertical edge on such a screen, the container turns
|
|
121
|
+
UIKit's `contentInsetAdjustmentBehavior` back on, and UIKit pays the top and
|
|
122
|
+
the bottom both — which is why `ScreenBottomInset` stands down here rather
|
|
123
|
+
than paying that edge a second time. iOS only: this is UIKit's mechanism, and
|
|
124
|
+
Android has no navigation bar to track.
|
|
125
|
+
Both vertical edges have to be protected to hand them over, because UIKit
|
|
126
|
+
adjusts for both or for neither. A policy that asks for one and not the other
|
|
127
|
+
cannot be expressed this way, so it keeps the ordinary treatment below and
|
|
128
|
+
is honoured exactly as written — at the cost of the title collapse, which is
|
|
129
|
+
the better trade: an edge list is an explicit instruction, and silently
|
|
130
|
+
insetting an edge the caller excluded would be the worse surprise.
|
|
131
|
+
*/
|
|
132
|
+
const platformInsetsEligible = Platform.OS === "ios" && !hasHeader && edges.top && edges.bottom;
|
|
133
|
+
const platformAdjustsInsets = platformInsetsEligible && hasVerticalScrollContainer;
|
|
134
|
+
/*
|
|
135
|
+
Otherwise the bottom edge goes to the scroll container when there is one to
|
|
136
|
+
take it.
|
|
110
137
|
Applied to the frame, the bottom inset shrinks the scroll viewport, so content
|
|
111
138
|
stops above a tab bar rather than passing beneath it — and on iOS that inset
|
|
112
139
|
includes the bar itself, which UIKit folds into a tab screen's safe area. The
|
|
113
140
|
container reaches the same resting position by padding the end of its content
|
|
114
141
|
instead, which is how the platform's own content-inset adjustment behaves.
|
|
115
142
|
*/
|
|
116
|
-
const contentOwnsBottomInset =
|
|
117
|
-
const frameEdges = useMemo(() =>
|
|
143
|
+
const contentOwnsBottomInset = !platformAdjustsInsets && edges.bottom && hasVerticalScrollContainer;
|
|
144
|
+
const frameEdges = useMemo(() => platformAdjustsInsets ? {
|
|
118
145
|
...edges,
|
|
146
|
+
top: false,
|
|
119
147
|
bottom: false
|
|
120
|
-
} :
|
|
148
|
+
} : contentOwnsBottomInset ? {
|
|
149
|
+
...edges,
|
|
150
|
+
bottom: false
|
|
151
|
+
} : edges, [platformAdjustsInsets, contentOwnsBottomInset, edges]);
|
|
121
152
|
const {
|
|
122
153
|
theme
|
|
123
154
|
} = useUnistyles();
|
|
124
155
|
const resolvedBackground = resolveThemeColor(background, theme) ?? theme.color["surface.canvas"];
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
156
|
+
/*
|
|
157
|
+
A plain object, not a Unistyles stylesheet, and the background belongs in it
|
|
158
|
+
rather than arriving later.
|
|
159
|
+
Unistyles applies a dynamic function's style after mount. UIKit resolves a
|
|
160
|
+
screen's scroll view once, while it is being presented, and a scroll area
|
|
161
|
+
that was not yet the size of the screen at that moment never drives the
|
|
162
|
+
navigation bar afterwards — the large title stays expanded for the rest of
|
|
163
|
+
the screen's life.
|
|
164
|
+
*/
|
|
165
|
+
const rootStyle = useMemo(() => ({
|
|
166
|
+
flex: 1,
|
|
167
|
+
backgroundColor: resolvedBackground
|
|
168
|
+
}), [resolvedBackground]);
|
|
169
|
+
return (
|
|
170
|
+
/*#__PURE__*/
|
|
171
|
+
/*
|
|
172
|
+
`collapsable={false}`, because a background colour alone is the worst of
|
|
173
|
+
both worlds here.
|
|
174
|
+
Fabric decides two things separately: whether a view is mounted at all, and
|
|
175
|
+
whether it *keeps* its children. A `View` with only layout styles is
|
|
176
|
+
dropped and its children are re-parented to its own parent — harmless. Give
|
|
177
|
+
it a background and it is mounted, but it still does not form a stacking
|
|
178
|
+
context, so the children are mounted *beside* it instead of inside it. The
|
|
179
|
+
screen's view then begins with an empty full-screen view, and UIKit — which
|
|
180
|
+
finds the scroll view by walking first subviews down from the view
|
|
181
|
+
controller (`RNSScrollViewFinder` mirrors the same walk) — reaches that dead
|
|
182
|
+
end and finds nothing. Measured on an iPhone 17: no content-inset
|
|
183
|
+
adjustment and no large-title collapse at all.
|
|
184
|
+
`collapsable={false}` forms the stacking context, so the frame, the safe
|
|
185
|
+
areas, and the scroll container stay in one unbroken first-subview chain.
|
|
186
|
+
*/
|
|
187
|
+
_jsx(View, {
|
|
188
|
+
collapsable: false,
|
|
189
|
+
ref: ref,
|
|
190
|
+
style: [rootStyle, style],
|
|
191
|
+
...rest,
|
|
192
|
+
children: /*#__PURE__*/_jsx(ScreenScrollProvider, {
|
|
193
|
+
background: resolvedBackground,
|
|
194
|
+
contentPadding: resolvedMargins,
|
|
195
|
+
safeArea: safeArea,
|
|
196
|
+
contentOwnsBottomInset: contentOwnsBottomInset,
|
|
197
|
+
platformAdjustsInsets: platformAdjustsInsets,
|
|
198
|
+
platformInsetsEligible: platformInsetsEligible,
|
|
199
|
+
hasHeader: hasHeader,
|
|
200
|
+
children: /*#__PURE__*/_jsx(ScreenHeaderAppearanceProvider, {
|
|
201
|
+
children: /*#__PURE__*/_jsx(ScreenFrame, {
|
|
202
|
+
edges: frameEdges,
|
|
203
|
+
children: /*#__PURE__*/_jsx(PortalProvider, {
|
|
204
|
+
children: children
|
|
205
|
+
})
|
|
140
206
|
})
|
|
141
207
|
})
|
|
142
208
|
})
|
|
143
209
|
})
|
|
144
|
-
|
|
210
|
+
);
|
|
145
211
|
});
|
|
146
212
|
ScreenBase.Header = ScreenHeader;
|
|
147
213
|
ScreenBase.ScrollView = ScreenScrollView;
|
|
@@ -167,10 +233,4 @@ ScreenBase.List = ScreenList;
|
|
|
167
233
|
* ```
|
|
168
234
|
*/
|
|
169
235
|
export const Screen = ScreenBase;
|
|
170
|
-
const styles = StyleSheet.create(() => ({
|
|
171
|
-
container: backgroundColor => ({
|
|
172
|
-
flex: 1,
|
|
173
|
-
backgroundColor
|
|
174
|
-
})
|
|
175
|
-
}));
|
|
176
236
|
//# sourceMappingURL=Screen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Children","Fragment","forwardRef","isValidElement","useMemo","
|
|
1
|
+
{"version":3,"names":["Children","Fragment","forwardRef","isValidElement","useMemo","Platform","useUnistyles","resolveThemeColor","PortalProvider","ScreenFrame","ScreenHeaderAppearanceProvider","ScreenHeaderAppearanceSlot","ScreenScrollProvider","ScreenFlatList","ScreenList","ScreenScrollView","resolveSafeAreaEdges","jsx","_jsx","ScreenHeader","children","as","rest","Component","displayName","ownsBottomInset","child","props","horizontal","type","hasScrollContainerOwningBottom","found","forEach","hasScreenHeader","ScreenBase","Screen","background","contentPadding","safeArea","margins","hasMargins","inTabView","_inTabView","style","ref","hasHeader","resolvedMargins","edges","hasVerticalScrollContainer","platformInsetsEligible","OS","top","bottom","platformAdjustsInsets","contentOwnsBottomInset","frameEdges","theme","resolvedBackground","color","rootStyle","flex","backgroundColor","View","collapsable","Header","ScrollView","FlatList","List"],"sourceRoot":"../../../../src","sources":["components/screen/Screen.tsx"],"mappings":";;;AAAA,SACEA,QAAQ,EAIRC,QAAQ,EACRC,UAAU,EACVC,cAAc,EAIdC,OAAO,QACF,OAAO;AACd,SAASC,QAAQ,QAA8B,cAAc;AAE7D,SAASC,YAAY,QAAQ,wBAAwB;AAGrD,SAASC,iBAAiB;AAC1B,SAASC,cAAc;AACvB,SAASC,WAAW;AACpB,SAASC,8BAA8B,EAAEC,0BAA0B;AACnE,SAASC,oBAAoB;AAC7B,SAASC,cAAc;AACvB,SAASC,UAAU;AACnB,SAASC,gBAAgB;AAEzB,SAASC,oBAAoB;;AAE7B;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAYA;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,IAAIpB,QAAQ;EAChC,oBACEiB,IAAA,CAACP,0BAA0B;IAAAS,QAAA,eACzBF,IAAA,CAACK,SAAS;MAAA,GAAKD,IAAI;MAAAF,QAAA,EAAGA;IAAQ,CAAY;EAAC,CACjB,CAAC;AAEjC;AACAD,YAAY,CAACK,WAAW,GAAG,eAAe;;AAE1C;AACA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAACC,KAAmB,EAAW;EACrD,IAAKA,KAAK,CAACC,KAAK,CAA8BC,UAAU,EAAE,OAAO,KAAK;EACtE,IAAIF,KAAK,CAACG,IAAI,KAAKd,gBAAgB,IAAIW,KAAK,CAACG,IAAI,KAAKf,UAAU,EAAE,OAAO,IAAI;EAC7E;EACA,MAAM;IAAEU;EAAY,CAAC,GAAGE,KAAK,CAACG,IAAgC;EAC9D,OAAOL,WAAW,KAAK,mBAAmB,IAAIA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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMqB,MAAM,GAAGD,UAAU","ignoreList":[]}
|
|
@@ -24,6 +24,8 @@ export function ScreenScrollProvider({
|
|
|
24
24
|
contentPadding = "all",
|
|
25
25
|
safeArea = "auto",
|
|
26
26
|
contentOwnsBottomInset = false,
|
|
27
|
+
platformAdjustsInsets = false,
|
|
28
|
+
platformInsetsEligible = false,
|
|
27
29
|
hasHeader = false
|
|
28
30
|
}) {
|
|
29
31
|
const scrollY = useSharedValue(0);
|
|
@@ -45,6 +47,8 @@ export function ScreenScrollProvider({
|
|
|
45
47
|
contentPadding,
|
|
46
48
|
safeArea,
|
|
47
49
|
contentOwnsBottomInset,
|
|
50
|
+
platformAdjustsInsets,
|
|
51
|
+
platformInsetsEligible,
|
|
48
52
|
margins: contentPadding,
|
|
49
53
|
hasHeader,
|
|
50
54
|
scrollY,
|
|
@@ -53,7 +57,7 @@ export function ScreenScrollProvider({
|
|
|
53
57
|
setHeaderCollapseHeight,
|
|
54
58
|
scrollRef,
|
|
55
59
|
scrollHandler
|
|
56
|
-
}), [background, contentPadding, safeArea, contentOwnsBottomInset, hasHeader, scrollY, headerCollapseHeight, headerSnapOffsets, setHeaderCollapseHeight, scrollRef, scrollHandler]);
|
|
60
|
+
}), [background, contentPadding, safeArea, contentOwnsBottomInset, platformAdjustsInsets, platformInsetsEligible, hasHeader, scrollY, headerCollapseHeight, headerSnapOffsets, setHeaderCollapseHeight, scrollRef, scrollHandler]);
|
|
57
61
|
return /*#__PURE__*/_jsx(ScreenContext.Provider, {
|
|
58
62
|
value: value,
|
|
59
63
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","useCallback","useContext","useMemo","useState","useAnimatedRef","useAnimatedScrollHandler","useSharedValue","jsx","_jsx","SCREEN_HEADER_PORTAL_HOST","ScreenContext","ScreenScrollProvider","background","children","contentPadding","safeArea","contentOwnsBottomInset","hasHeader","scrollY","headerCollapseHeight","headerSnapOffsets","setHeaderSnapOffsets","scrollRef","setHeaderCollapseHeight","height","rounded","Math","round","value","undefined","scrollHandler","onScroll","event","contentOffset","y","margins","Provider","useScreen","context","Error"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenContext.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAkBC,WAAW,EAAEC,UAAU,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAEjG,SAIEC,cAAc,EACdC,wBAAwB,EACxBC,cAAc,QACT,yBAAyB;;AAIhC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGA;AACA,OAAO,MAAMC,yBAAyB,GAAG,eAAe;;AAExD;;
|
|
1
|
+
{"version":3,"names":["createContext","useCallback","useContext","useMemo","useState","useAnimatedRef","useAnimatedScrollHandler","useSharedValue","jsx","_jsx","SCREEN_HEADER_PORTAL_HOST","ScreenContext","ScreenScrollProvider","background","children","contentPadding","safeArea","contentOwnsBottomInset","platformAdjustsInsets","platformInsetsEligible","hasHeader","scrollY","headerCollapseHeight","headerSnapOffsets","setHeaderSnapOffsets","scrollRef","setHeaderCollapseHeight","height","rounded","Math","round","value","undefined","scrollHandler","onScroll","event","contentOffset","y","margins","Provider","useScreen","context","Error"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenContext.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAkBC,WAAW,EAAEC,UAAU,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAEjG,SAIEC,cAAc,EACdC,wBAAwB,EACxBC,cAAc,QACT,yBAAyB;;AAIhC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGA;AACA,OAAO,MAAMC,yBAAyB,GAAG,eAAe;;AAExD;;AAyEA,OAAO,MAAMC,aAAa,gBAAGX,aAAa,CAA4B,IAAI,CAAC;;AAE3E;;AAmBA;AACA;AACA;AACA;AACA,OAAO,SAASY,oBAAoBA,CAAC;EACnCC,UAAU,GAAG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,EACrBC,sBAAsB,EACtBC,SAAS,EACTC,OAAO,EACPC,oBAAoB,EACpBC,iBAAiB,EACjBG,uBAAuB,EACvBD,SAAS,EACTQ,aAAa,CAEjB,CAAC;EAED,oBAAOxB,IAAA,CAACE,aAAa,CAAC4B,QAAQ;IAACR,KAAK,EAAEA,KAAM;IAAAjB,QAAA,EAAEA;EAAQ,CAAyB,CAAC;AAClF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS0B,SAASA,CAAA,EAAuB;EAC9C,MAAMC,OAAO,GAAGvC,UAAU,CAACS,aAAa,CAAC;EACzC,IAAI,CAAC8B,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CAAC,kDAAkD,CAAC;EACrE;EACA,OAAOD,OAAO;AAChB","ignoreList":[]}
|
|
@@ -7,6 +7,7 @@ import Animated from "react-native-reanimated";
|
|
|
7
7
|
import { StyleSheet } from "react-native-unistyles";
|
|
8
8
|
import { resolveScreenPadding } from "../../theme/screen-padding.js";
|
|
9
9
|
import { PortalHost } from "../portal/index.js";
|
|
10
|
+
import { useNestedContainerWarning } from "./hooks/use-nested-container-warning.js";
|
|
10
11
|
import { useScreenRef } from "./hooks/use-screen-ref.js";
|
|
11
12
|
import { useScreenScrollHandler } from "./hooks/use-screen-scroll-handler.js";
|
|
12
13
|
import { ScreenBottomInset } from "./parts/ScreenBottomInset";
|
|
@@ -61,11 +62,13 @@ const ScreenListBase = /*#__PURE__*/forwardRef(function ScreenList({
|
|
|
61
62
|
headerSnapOffsets,
|
|
62
63
|
contentPadding: screenPadding,
|
|
63
64
|
hasHeader,
|
|
64
|
-
contentOwnsBottomInset
|
|
65
|
+
contentOwnsBottomInset,
|
|
66
|
+
platformAdjustsInsets
|
|
65
67
|
} = useScreen();
|
|
66
68
|
// The root yields the bottom edge only to a vertical container, so a horizontal
|
|
67
69
|
// one here is a secondary container and must not pay the inset a second time.
|
|
68
70
|
const ownsBottomInset = contentOwnsBottomInset && !horizontal;
|
|
71
|
+
useNestedContainerWarning("Screen.List", horizontal);
|
|
69
72
|
const mergedRef = useScreenRef(isDefaultFlatList ? scrollRef : undefined, ref);
|
|
70
73
|
const resolvedPadding = contentPadding ?? margins ?? screenPadding;
|
|
71
74
|
const resolvedLoading = isLoading ?? loading;
|
|
@@ -94,8 +97,13 @@ const ScreenListBase = /*#__PURE__*/forwardRef(function ScreenList({
|
|
|
94
97
|
style: [{
|
|
95
98
|
backgroundColor: background
|
|
96
99
|
}, style],
|
|
97
|
-
horizontal: horizontal
|
|
98
|
-
|
|
100
|
+
horizontal: horizontal
|
|
101
|
+
/*
|
|
102
|
+
UIKit owns the vertical insets on a header-less iOS screen — see
|
|
103
|
+
`platformAdjustsInsets`. Everywhere else the frame has already paid them,
|
|
104
|
+
so a second adjustment here would count them twice.
|
|
105
|
+
*/,
|
|
106
|
+
contentInsetAdjustmentBehavior: platformAdjustsInsets ? "automatic" : "never",
|
|
99
107
|
automaticallyAdjustContentInsets: false,
|
|
100
108
|
automaticallyAdjustsScrollIndicatorInsets: false,
|
|
101
109
|
contentContainerStyle: [styles.content(resolvedPadding, hasHeader, bottomInset, extraBottomPadding), contentContainerStyle],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","useMemo","Animated","StyleSheet","resolveScreenPadding","PortalHost","useScreenRef","useScreenScrollHandler","ScreenBottomInset","renderScreenPlaceholder","SCREEN_HEADER_PORTAL_HOST","useScreen","hasHorizontalPadding","hasVerticalPadding","renderListComponent","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ScreenListBase","ScreenList","as","data","renderItem","style","contentContainerStyle","ListHeaderComponent","ListFooterComponent","ListEmptyComponent","horizontal","isLoading","loading","loadingContent","LoadingComponent","emptyContent","EmptyComponent","contentPadding","margins","bottomInset","extraBottomPadding","scrollHandler","externalScrollHandler","onScroll","rest","ref","isDefaultFlatList","undefined","FlatList","Component","AnimatedComponent","createAnimatedComponent","background","scrollRef","headerSnapOffsets","screenPadding","hasHeader","contentOwnsBottomInset","ownsBottomInset","mergedRef","resolvedPadding","resolvedLoading","placeholder","isEmpty","length","composedScrollHandler","header","children","View","styles","headerWrapper","name","footer","backgroundColor","contentInsetAdjustmentBehavior","automaticallyAdjustContentInsets","automaticallyAdjustsScrollIndicatorInsets","content","showsVerticalScrollIndicator","scrollEventThrottle","snapToOffsets","displayName","create","theme","runtime","padding","x","y","breakpoint","flexGrow","paddingTop","layout","height","paddingHorizontal","paddingBottom","uni__dependencies","marginHorizontal"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenList.tsx"],"mappings":";;;;AAAA,SAKEA,UAAU,EAIVC,OAAO,QACF,OAAO;AAGd,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,oBAAoB;AAC7B,SAASC,UAAU;AACnB,SAASC,YAAY;AACrB,SAASC,sBAAsB;AAC/B,SAASC,iBAAiB;AAC1B,SAASC,uBAAuB;AAChC,SAASC,yBAAyB,EAAEC,SAAS;AAE7C,SAASC,oBAAoB,EAAEC,kBAAkB,EAAEC,mBAAmB;;AAEtE;;AAKA;;AAgBA;;AAyBA;;AA+BA;;AAiBA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAiBA,MAAMC,cAAc,
|
|
1
|
+
{"version":3,"names":["forwardRef","useMemo","Animated","StyleSheet","resolveScreenPadding","PortalHost","useNestedContainerWarning","useScreenRef","useScreenScrollHandler","ScreenBottomInset","renderScreenPlaceholder","SCREEN_HEADER_PORTAL_HOST","useScreen","hasHorizontalPadding","hasVerticalPadding","renderListComponent","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ScreenListBase","ScreenList","as","data","renderItem","style","contentContainerStyle","ListHeaderComponent","ListFooterComponent","ListEmptyComponent","horizontal","isLoading","loading","loadingContent","LoadingComponent","emptyContent","EmptyComponent","contentPadding","margins","bottomInset","extraBottomPadding","scrollHandler","externalScrollHandler","onScroll","rest","ref","isDefaultFlatList","undefined","FlatList","Component","AnimatedComponent","createAnimatedComponent","background","scrollRef","headerSnapOffsets","screenPadding","hasHeader","contentOwnsBottomInset","platformAdjustsInsets","ownsBottomInset","mergedRef","resolvedPadding","resolvedLoading","placeholder","isEmpty","length","composedScrollHandler","header","children","View","styles","headerWrapper","name","footer","backgroundColor","contentInsetAdjustmentBehavior","automaticallyAdjustContentInsets","automaticallyAdjustsScrollIndicatorInsets","content","showsVerticalScrollIndicator","scrollEventThrottle","snapToOffsets","displayName","create","theme","runtime","padding","x","y","breakpoint","flexGrow","paddingTop","layout","height","paddingHorizontal","paddingBottom","uni__dependencies","marginHorizontal"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenList.tsx"],"mappings":";;;;AAAA,SAKEA,UAAU,EAIVC,OAAO,QACF,OAAO;AAGd,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,oBAAoB;AAC7B,SAASC,UAAU;AACnB,SAASC,yBAAyB;AAClC,SAASC,YAAY;AACrB,SAASC,sBAAsB;AAC/B,SAASC,iBAAiB;AAC1B,SAASC,uBAAuB;AAChC,SAASC,yBAAyB,EAAEC,SAAS;AAE7C,SAASC,oBAAoB,EAAEC,kBAAkB,EAAEC,mBAAmB;;AAEtE;;AAKA;;AAgBA;;AAyBA;;AA+BA;;AAiBA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAiBA,MAAMC,cAAc,gBAAGtB,UAAU,CAAC,SAASuB,UAAUA,CACnD;EACEC,EAAE;EACFC,IAAI;EACJC,UAAU;EACVC,KAAK;EACLC,qBAAqB;EACrBC,mBAAmB;EACnBC,mBAAmB;EACnBC,kBAAkB;EAClBC,UAAU,GAAG,KAAK;EAClBC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AU,CAAC,CAACF,CAAC,GAAG,CAAC;IAAAS,iBAAA;EAC1G,CAAC;AACH,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -6,6 +6,7 @@ import Animated from "react-native-reanimated";
|
|
|
6
6
|
import { StyleSheet } from "react-native-unistyles";
|
|
7
7
|
import { resolveScreenPadding } from "../../theme/screen-padding.js";
|
|
8
8
|
import { PortalHost } from "../portal/index.js";
|
|
9
|
+
import { useNestedContainerWarning } from "./hooks/use-nested-container-warning.js";
|
|
9
10
|
import { useScreenRef } from "./hooks/use-screen-ref.js";
|
|
10
11
|
import { useScreenScrollHandler } from "./hooks/use-screen-scroll-handler.js";
|
|
11
12
|
import { ScreenBottomInset } from "./parts/ScreenBottomInset";
|
|
@@ -58,11 +59,13 @@ export const ScreenScrollView = /*#__PURE__*/forwardRef(function ScreenScrollVie
|
|
|
58
59
|
contentPadding: screenPadding,
|
|
59
60
|
hasHeader,
|
|
60
61
|
background,
|
|
61
|
-
contentOwnsBottomInset
|
|
62
|
+
contentOwnsBottomInset,
|
|
63
|
+
platformAdjustsInsets
|
|
62
64
|
} = useScreen();
|
|
63
65
|
// The root yields the bottom edge only to a vertical container, so a horizontal
|
|
64
66
|
// one here is a secondary container and must not pay the inset a second time.
|
|
65
67
|
const ownsBottomInset = contentOwnsBottomInset && !horizontal;
|
|
68
|
+
useNestedContainerWarning("Screen.ScrollView", horizontal);
|
|
66
69
|
const resolvedPadding = contentPadding ?? margins ?? screenPadding;
|
|
67
70
|
const mergedRef = useScreenRef(scrollRef, ref);
|
|
68
71
|
const placeholder = renderScreenPlaceholder({
|
|
@@ -77,8 +80,13 @@ export const ScreenScrollView = /*#__PURE__*/forwardRef(function ScreenScrollVie
|
|
|
77
80
|
style: [{
|
|
78
81
|
backgroundColor: background
|
|
79
82
|
}, style],
|
|
80
|
-
horizontal: horizontal
|
|
81
|
-
|
|
83
|
+
horizontal: horizontal
|
|
84
|
+
/*
|
|
85
|
+
UIKit owns the vertical insets on a header-less iOS screen — see
|
|
86
|
+
`platformAdjustsInsets`. Everywhere else the frame has already paid
|
|
87
|
+
them, so a second adjustment here would count them twice.
|
|
88
|
+
*/,
|
|
89
|
+
contentInsetAdjustmentBehavior: platformAdjustsInsets ? "automatic" : "never",
|
|
82
90
|
automaticallyAdjustContentInsets: false,
|
|
83
91
|
automaticallyAdjustsScrollIndicatorInsets: false,
|
|
84
92
|
showsVerticalScrollIndicator: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Children","forwardRef","Animated","StyleSheet","resolveScreenPadding","PortalHost","useScreenRef","useScreenScrollHandler","ScreenBottomInset","renderScreenPlaceholder","SCREEN_HEADER_PORTAL_HOST","useScreen","hasHorizontalPadding","hasVerticalPadding","jsx","_jsx","jsxs","_jsxs","ScreenScrollView","children","style","contentContainerStyle","contentStyle","scrollHandler","externalScrollHandler","onScroll","horizontal","isLoading","loading","loadingContent","LoadingComponent","emptyContent","EmptyComponent","contentPadding","margins","extraBottomPadding","isEmpty","rest","ref","scrollRef","screenPadding","hasHeader","background","contentOwnsBottomInset","ownsBottomInset","resolvedPadding","mergedRef","placeholder","undefined","toArray","length","composedScrollHandler","ScrollView","backgroundColor","contentInsetAdjustmentBehavior","automaticallyAdjustContentInsets","automaticallyAdjustsScrollIndicatorInsets","showsVerticalScrollIndicator","scrollEventThrottle","styles","scrollContent","View","headerWrapper","name","content","displayName","create","theme","runtime","padding","x","y","breakpoint","flexGrow","paddingTop","layout","header","height","paddingHorizontal","paddingBottom","uni__dependencies","marginHorizontal","flexDirection"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenScrollView.tsx"],"mappings":";;;AAAA,SAASA,QAAQ,EAAqBC,UAAU,QAAwB,OAAO;AAG/E,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,oBAAoB;AAC7B,SAASC,UAAU;AACnB,SAASC,YAAY;AACrB,SAASC,sBAAsB;AAC/B,SAASC,iBAAiB;AAC1B,SAASC,uBAAuB;AAChC,SAASC,yBAAyB,EAAEC,SAAS;AAE7C,SAASC,oBAAoB,EAAEC,kBAAkB;;AAEjD;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,
|
|
1
|
+
{"version":3,"names":["Children","forwardRef","Animated","StyleSheet","resolveScreenPadding","PortalHost","useNestedContainerWarning","useScreenRef","useScreenScrollHandler","ScreenBottomInset","renderScreenPlaceholder","SCREEN_HEADER_PORTAL_HOST","useScreen","hasHorizontalPadding","hasVerticalPadding","jsx","_jsx","jsxs","_jsxs","ScreenScrollView","children","style","contentContainerStyle","contentStyle","scrollHandler","externalScrollHandler","onScroll","horizontal","isLoading","loading","loadingContent","LoadingComponent","emptyContent","EmptyComponent","contentPadding","margins","extraBottomPadding","isEmpty","rest","ref","scrollRef","screenPadding","hasHeader","background","contentOwnsBottomInset","platformAdjustsInsets","ownsBottomInset","resolvedPadding","mergedRef","placeholder","undefined","toArray","length","composedScrollHandler","ScrollView","backgroundColor","contentInsetAdjustmentBehavior","automaticallyAdjustContentInsets","automaticallyAdjustsScrollIndicatorInsets","showsVerticalScrollIndicator","scrollEventThrottle","styles","scrollContent","View","headerWrapper","name","content","displayName","create","theme","runtime","padding","x","y","breakpoint","flexGrow","paddingTop","layout","header","height","paddingHorizontal","paddingBottom","uni__dependencies","marginHorizontal","flexDirection"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenScrollView.tsx"],"mappings":";;;AAAA,SAASA,QAAQ,EAAqBC,UAAU,QAAwB,OAAO;AAG/E,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,oBAAoB;AAC7B,SAASC,UAAU;AACnB,SAASC,yBAAyB;AAClC,SAASC,YAAY;AACrB,SA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ScreenContext.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Warns, in development, when this container is the one the screen root failed
|
|
8
|
+
* to find.
|
|
9
|
+
*
|
|
10
|
+
* The root inspects its own children and fragments but does not execute
|
|
11
|
+
* component children, so a container rendered inside one is invisible to it (see
|
|
12
|
+
* `hasScrollContainerOwningBottom`). On a header-less iOS screen that changes
|
|
13
|
+
* behaviour rather than just bookkeeping: the frame pads the top edge, the scroll
|
|
14
|
+
* view no longer fills the screen, and UIKit stops collapsing the native large
|
|
15
|
+
* title — silently, with the screen otherwise looking correct.
|
|
16
|
+
*
|
|
17
|
+
* The container is the only place that can tell. `platformInsetsEligible` says
|
|
18
|
+
* the screen qualified; a container mounting while `platformAdjustsInsets` is
|
|
19
|
+
* false says the root never saw it. Both true together mean exactly this mistake,
|
|
20
|
+
* so there is nothing here to false-positive on: a screen with no scroll
|
|
21
|
+
* container at all never runs this hook, and a deliberate `safeArea` opt-out is
|
|
22
|
+
* not eligible in the first place.
|
|
23
|
+
*
|
|
24
|
+
* @param container Name to report, e.g. `"Screen.List"`.
|
|
25
|
+
* @param horizontal Whether this container scrolls horizontally; those are never
|
|
26
|
+
* candidates for the vertical insets and never warn.
|
|
27
|
+
*/
|
|
28
|
+
export function useNestedContainerWarning(container, horizontal) {
|
|
29
|
+
const {
|
|
30
|
+
platformAdjustsInsets,
|
|
31
|
+
platformInsetsEligible
|
|
32
|
+
} = useScreen();
|
|
33
|
+
const isNested = platformInsetsEligible && !platformAdjustsInsets && !horizontal;
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!__DEV__ || !isNested) return;
|
|
36
|
+
console.warn(`[react-native-terra-ui] ${container} is nested inside another component, so its Screen could not find it. ` + "On iOS a Screen with no Screen.Header hands its vertical insets to UIKit, but only when the scroll " + "container is among its own children — nested, the frame pads the top instead and a native large title " + `will not collapse. Render ${container} as a direct child of Screen; fragments are fine.`);
|
|
37
|
+
}, [container, isNested]);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=use-nested-container-warning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useScreen","useNestedContainerWarning","container","horizontal","platformAdjustsInsets","platformInsetsEligible","isNested","__DEV__","console","warn"],"sourceRoot":"../../../../../src","sources":["components/screen/hooks/use-nested-container-warning.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AAEjC,SAASC,SAAS;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CAACC,SAAiB,EAAEC,UAAmB,EAAQ;EACtF,MAAM;IAAEC,qBAAqB;IAAEC;EAAuB,CAAC,GAAGL,SAAS,CAAC,CAAC;EACrE,MAAMM,QAAQ,GAAGD,sBAAsB,IAAI,CAACD,qBAAqB,IAAI,CAACD,UAAU;EAEhFJ,SAAS,CAAC,MAAM;IACd,IAAI,CAACQ,OAAO,IAAI,CAACD,QAAQ,EAAE;IAC3BE,OAAO,CAACC,IAAI,CACV,2BAA2BP,SAAS,wEAAwE,GAC1G,qGAAqG,GACrG,wGAAwG,GACxG,6BAA6BA,SAAS,mDAC1C,CAAC;EACH,CAAC,EAAE,CAACA,SAAS,EAAEI,QAAQ,CAAC,CAAC;AAC3B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useContext","useState","Animated","StyleSheet","ScreenHeaderAppearanceContext","ScreenSafeArea","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ScreenFrame","children","edges","appearance","topInset","setTopInset","onLayout","event","nativeEvent","layout","y","View","style","styles","content","top","background","undefined","pointerEvents","topSafeArea","color","animatedStyle","create","flex","height","backgroundColor","position","left","right"],"sourceRoot":"../../../../../src","sources":["components/screen/parts/ScreenFrame.tsx"],"mappings":";;;AAAA,SAAiCA,WAAW,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AAGjF,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,UAAU,QAAQ,wBAAwB;AAGnD,SAASC,6BAA6B;AACtC,SAASC,cAAc;AAA2B,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAElD,OAAO,SAASC,WAAWA,CAAC;EAAEC,QAAQ;EAAEC;AAAyD,CAAC,EAAE;EAClG,MAAMC,UAAU,GAAGf,UAAU,CAACI,6BAA6B,CAAC;EAC5D,MAAM,CAACY,QAAQ,EAAEC,WAAW,CAAC,GAAGhB,QAAQ,CAAC,CAAC,CAAC;EAC3C,MAAMiB,QAAQ,GAAGnB,WAAW,CAAEoB,KAAwB,IAAK;IACzD;IACAF,WAAW,CAACE,KAAK,CAACC,WAAW,CAACC,MAAM,CAACC,CAAC,CAAC;EACzC,CAAC,EAAE,EAAE,CAAC;EAEN,oBACEX,KAAA,CAAAF,SAAA;IAAAI,QAAA,gBACEN,IAAA,CAACF,cAAc;MAACS,KAAK,EAAEA,KAAM;MAAAD,QAAA,
|
|
1
|
+
{"version":3,"names":["useCallback","useContext","useState","Animated","StyleSheet","ScreenHeaderAppearanceContext","ScreenSafeArea","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ScreenFrame","children","edges","appearance","topInset","setTopInset","onLayout","event","nativeEvent","layout","y","View","collapsable","style","styles","content","top","background","undefined","pointerEvents","topSafeArea","color","animatedStyle","create","flex","height","backgroundColor","position","left","right"],"sourceRoot":"../../../../../src","sources":["components/screen/parts/ScreenFrame.tsx"],"mappings":";;;AAAA,SAAiCA,WAAW,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AAGjF,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,UAAU,QAAQ,wBAAwB;AAGnD,SAASC,6BAA6B;AACtC,SAASC,cAAc;AAA2B,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC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AK,EAAE,CAAC;IACRJ,MAAM;IACNC;EACF,CAAC;AACH,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -236,7 +236,7 @@ const ToastClose = /*#__PURE__*/forwardRef(function ToastClose({
|
|
|
236
236
|
variant: variant,
|
|
237
237
|
...rest,
|
|
238
238
|
children: children ?? /*#__PURE__*/_jsx(Icon, {
|
|
239
|
-
name: "
|
|
239
|
+
name: "terra.x",
|
|
240
240
|
size: iconProps?.size ?? 20,
|
|
241
241
|
color: iconProps?.color ?? colors.icon,
|
|
242
242
|
strokeWidth: iconProps?.strokeWidth,
|