@expo/ui 58.0.22 → 58.0.23
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 +12 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/ComposeViews.kt +53 -29
- package/android/src/main/java/expo/modules/ui/HostView.kt +52 -8
- package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +40 -12
- package/android/src/main/java/expo/modules/ui/UniversalLayout.kt +610 -0
- package/android/src/main/java/expo/modules/ui/state/ObservableState.kt +2 -0
- package/android/src/main/java/expo/modules/ui/state/WorkletCallback.kt +2 -0
- package/build/jetpack-compose/Column/index.d.ts +5 -0
- package/build/jetpack-compose/Column/index.js.map +1 -1
- package/build/jetpack-compose/Row/index.d.ts +5 -0
- package/build/jetpack-compose/Row/index.js.map +1 -1
- package/build/recycling/useRecycledRows.d.ts +2 -0
- package/build/recycling/useRecycledRows.js +1 -0
- package/build/recycling/useRecycledRows.js.map +1 -1
- package/build/swift-ui/HStack/index.d.ts +6 -0
- package/build/swift-ui/HStack/index.js.map +1 -1
- package/build/swift-ui/VStack/index.d.ts +6 -0
- package/build/swift-ui/VStack/index.js.map +1 -1
- package/build/universal/Button/index.android.js +3 -1
- package/build/universal/Button/index.android.js.map +1 -1
- package/build/universal/Button/index.ios.js +3 -1
- package/build/universal/Button/index.ios.js.map +1 -1
- package/build/universal/Collapsible/index.ios.js +1 -0
- package/build/universal/Collapsible/index.ios.js.map +1 -1
- package/build/universal/Column/index.android.js +4 -1
- package/build/universal/Column/index.android.js.map +1 -1
- package/build/universal/Column/index.ios.js +2 -0
- package/build/universal/Column/index.ios.js.map +1 -1
- package/build/universal/Column/index.js +13 -4
- package/build/universal/Column/index.js.map +1 -1
- package/build/universal/FieldGroup/FieldGroup.android.js +3 -1
- package/build/universal/FieldGroup/FieldGroup.android.js.map +1 -1
- package/build/universal/FieldGroup/FieldGroup.ios.js +3 -1
- package/build/universal/FieldGroup/FieldGroup.ios.js.map +1 -1
- package/build/universal/FieldGroup/FieldSection.android.js +13 -4
- package/build/universal/FieldGroup/FieldSection.android.js.map +1 -1
- package/build/universal/FieldGroup/FieldSection.ios.js +3 -1
- package/build/universal/FieldGroup/FieldSection.ios.js.map +1 -1
- package/build/universal/Icon/index.android.js +3 -1
- package/build/universal/Icon/index.android.js.map +1 -1
- package/build/universal/Icon/index.ios.js +3 -1
- package/build/universal/Icon/index.ios.js.map +1 -1
- package/build/universal/List/ListForEach.android.d.ts +7 -0
- package/build/universal/List/ListForEach.android.js +6 -0
- package/build/universal/List/ListForEach.android.js.map +1 -0
- package/build/universal/List/ListForEach.d.ts +5 -0
- package/build/universal/List/ListForEach.ios.d.ts +5 -0
- package/build/universal/List/ListForEach.ios.js +11 -0
- package/build/universal/List/ListForEach.ios.js.map +1 -0
- package/build/universal/List/ListForEach.js +263 -0
- package/build/universal/List/ListForEach.js.map +1 -0
- package/build/universal/List/ListScrollContext.d.ts +5 -0
- package/build/universal/List/ListScrollContext.js +6 -0
- package/build/universal/List/ListScrollContext.js.map +1 -0
- package/build/universal/List/index.android.d.ts +5 -0
- package/build/universal/List/index.android.js +3 -0
- package/build/universal/List/index.android.js.map +1 -1
- package/build/universal/List/index.d.ts +5 -0
- package/build/universal/List/index.ios.d.ts +5 -0
- package/build/universal/List/index.ios.js +3 -0
- package/build/universal/List/index.ios.js.map +1 -1
- package/build/universal/List/index.js +12 -1
- package/build/universal/List/index.js.map +1 -1
- package/build/universal/List/types.d.ts +42 -1
- package/build/universal/List/types.js +1 -3
- package/build/universal/List/types.js.map +1 -1
- package/build/universal/RNHostView/index.android.js +3 -1
- package/build/universal/RNHostView/index.android.js.map +1 -1
- package/build/universal/Row/index.android.js +4 -1
- package/build/universal/Row/index.android.js.map +1 -1
- package/build/universal/Row/index.ios.js +2 -0
- package/build/universal/Row/index.ios.js.map +1 -1
- package/build/universal/Row/index.js +13 -7
- package/build/universal/Row/index.js.map +1 -1
- package/build/universal/ScrollView/index.android.js +8 -1
- package/build/universal/ScrollView/index.android.js.map +1 -1
- package/build/universal/ScrollView/index.ios.js +3 -1
- package/build/universal/ScrollView/index.ios.js.map +1 -1
- package/build/universal/Spacer/index.android.js +3 -1
- package/build/universal/Spacer/index.android.js.map +1 -1
- package/build/universal/Spacer/index.ios.js +3 -1
- package/build/universal/Spacer/index.ios.js.map +1 -1
- package/build/universal/Text/index.android.js +3 -1
- package/build/universal/Text/index.android.js.map +1 -1
- package/build/universal/Text/index.ios.js +3 -1
- package/build/universal/Text/index.ios.js.map +1 -1
- package/build/universal/TextInput/index.android.js +22 -7
- package/build/universal/TextInput/index.android.js.map +1 -1
- package/build/universal/TextInput/index.ios.js +1 -0
- package/build/universal/TextInput/index.ios.js.map +1 -1
- package/build/universal/index.d.ts +1 -1
- package/build/universal/modifierUtils.d.ts +34 -1
- package/build/universal/modifierUtils.js +98 -2
- package/build/universal/modifierUtils.js.map +1 -1
- package/build/universal/stackAxis.d.ts +9 -0
- package/build/universal/stackAxis.js +11 -0
- package/build/universal/stackAxis.js.map +1 -0
- package/build/universal/transformStyle.android.d.ts +6 -2
- package/build/universal/transformStyle.android.js +18 -11
- package/build/universal/transformStyle.android.js.map +1 -1
- package/build/universal/transformStyle.ios.d.ts +5 -1
- package/build/universal/transformStyle.ios.js +29 -11
- package/build/universal/transformStyle.ios.js.map +1 -1
- package/build/universal/types.d.ts +26 -1
- package/build/universal/types.js.map +1 -1
- package/ios/GroupView.swift +3 -0
- package/ios/HStackView.swift +26 -2
- package/ios/HostView.swift +21 -12
- package/ios/Modifiers/ViewModifierRegistry.swift +4 -0
- package/ios/ScrollViewComponent.swift +20 -0
- package/ios/UIBaseView.swift +4 -1
- package/ios/UniversalLayout.swift +691 -0
- package/ios/VStackView.swift +26 -2
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.22/expo.modules.ui-58.0.22-sources.jar → 58.0.23/expo.modules.ui-58.0.23-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.22/expo.modules.ui-58.0.22.module → 58.0.23/expo.modules.ui-58.0.23.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.22/expo.modules.ui-58.0.22.pom → 58.0.23/expo.modules.ui-58.0.23.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.23/expo.modules.ui-58.0.23.pom.sha512 +1 -0
- package/package.json +1 -1
- package/src/jetpack-compose/Column/index.tsx +5 -0
- package/src/jetpack-compose/Row/index.tsx +5 -0
- package/src/recycling/useRecycledRows.tsx +3 -0
- package/src/swift-ui/HStack/index.tsx +6 -0
- package/src/swift-ui/VStack/index.tsx +6 -0
- package/src/universal/Button/index.android.tsx +3 -1
- package/src/universal/Button/index.ios.tsx +2 -1
- package/src/universal/Collapsible/index.ios.tsx +4 -1
- package/src/universal/Column/index.android.tsx +3 -1
- package/src/universal/Column/index.ios.tsx +2 -1
- package/src/universal/Column/index.tsx +9 -4
- package/src/universal/FieldGroup/FieldGroup.android.tsx +8 -1
- package/src/universal/FieldGroup/FieldGroup.ios.tsx +2 -1
- package/src/universal/FieldGroup/FieldSection.android.tsx +17 -4
- package/src/universal/FieldGroup/FieldSection.ios.tsx +2 -1
- package/src/universal/Icon/index.android.tsx +2 -1
- package/src/universal/Icon/index.ios.tsx +2 -1
- package/src/universal/List/ListForEach.android.tsx +6 -0
- package/src/universal/List/ListForEach.ios.tsx +9 -0
- package/src/universal/List/ListForEach.tsx +246 -0
- package/src/universal/List/ListScrollContext.ts +6 -0
- package/src/universal/List/index.android.tsx +5 -0
- package/src/universal/List/index.ios.tsx +5 -0
- package/src/universal/List/index.tsx +11 -2
- package/src/universal/List/types.ts +45 -1
- package/src/universal/RNHostView/index.android.tsx +2 -1
- package/src/universal/Row/index.android.tsx +3 -1
- package/src/universal/Row/index.ios.tsx +2 -1
- package/src/universal/Row/index.tsx +9 -10
- package/src/universal/ScrollView/index.android.tsx +15 -3
- package/src/universal/ScrollView/index.ios.tsx +2 -1
- package/src/universal/Spacer/index.android.tsx +6 -4
- package/src/universal/Spacer/index.ios.tsx +2 -1
- package/src/universal/Text/index.android.tsx +2 -1
- package/src/universal/Text/index.ios.tsx +2 -1
- package/src/universal/TextInput/index.android.tsx +26 -5
- package/src/universal/TextInput/index.ios.tsx +1 -1
- package/src/universal/index.ts +6 -1
- package/src/universal/modifierUtils.ts +159 -2
- package/src/universal/stackAxis.ts +17 -0
- package/src/universal/transformStyle.android.ts +30 -12
- package/src/universal/transformStyle.ios.ts +41 -13
- package/src/universal/types.ts +27 -3
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.22/expo.modules.ui-58.0.22.pom.sha512 +0 -1
|
@@ -11,9 +11,15 @@ export function ScrollView({ children, direction = 'vertical', style, onPress, o
|
|
|
11
11
|
disabled,
|
|
12
12
|
hidden,
|
|
13
13
|
testID
|
|
14
|
-
}, extraModifiers
|
|
14
|
+
}, extraModifiers, {
|
|
15
|
+
componentName: 'ScrollView'
|
|
16
|
+
});
|
|
17
|
+
// verticalScroll and horizontalScroll clear the main-axis max before measure.
|
|
18
|
+
// A percentage on the scroll axis has no definite parent, so it is ignored.
|
|
19
|
+
// The cross axis still resolves.
|
|
15
20
|
if (direction === 'horizontal') {
|
|
16
21
|
return /*#__PURE__*/ _jsx(Row, {
|
|
22
|
+
resolvesChildPercentages: true,
|
|
17
23
|
modifiers: [
|
|
18
24
|
...modifiers,
|
|
19
25
|
horizontalScroll()
|
|
@@ -22,6 +28,7 @@ export function ScrollView({ children, direction = 'vertical', style, onPress, o
|
|
|
22
28
|
});
|
|
23
29
|
}
|
|
24
30
|
return /*#__PURE__*/ _jsx(Column, {
|
|
31
|
+
resolvesChildPercentages: true,
|
|
25
32
|
modifiers: [
|
|
26
33
|
...modifiers,
|
|
27
34
|
verticalScroll()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["universal/ScrollView/index.android.tsx"],"sourcesContent":[null],"names":["Column","Row","horizontalScroll","verticalScroll","useUniversalLifecycle","transformToModifiers","ScrollView","children","direction","style","onPress","onAppear","onDisappear","disabled","hidden","testID","modifiers","extraModifiers","undefined"],"mappings":";AAAA,SAASA,MAAM,EAAEC,GAAG,QAAQ,2BAA2B;AACvD,SAASC,gBAAgB,EAAEC,cAAc,QAAQ,qCAAqC;AAEtF,SAASC,qBAAqB,QAAQ,WAAW;AACjD,SAASC,oBAAoB,QAAQ,oBAAoB;AAGzD,OAAO,SAASC,WAAW,EACzBC,QAAQ,EACRC,YAAY,UAAU,EACtBC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,WAAWC,cAAc,EACT;IAChBb,sBAAsBO,UAAUC;IAEhC,IAAIE,QAAQ,OAAO;IAEnB,MAAME,YAAYX,qBAChBI,OACA;QAAEC,SAASG,WAAWK,YAAYR;QAASG;QAAUC;QAAQC;IAAO,GACpEE;
|
|
1
|
+
{"version":3,"sources":["universal/ScrollView/index.android.tsx"],"sourcesContent":[null],"names":["Column","Row","horizontalScroll","verticalScroll","useUniversalLifecycle","transformToModifiers","ScrollView","children","direction","style","onPress","onAppear","onDisappear","disabled","hidden","testID","modifiers","extraModifiers","undefined","componentName","resolvesChildPercentages"],"mappings":";AAAA,SAASA,MAAM,EAAEC,GAAG,QAAQ,2BAA2B;AACvD,SAASC,gBAAgB,EAAEC,cAAc,QAAQ,qCAAqC;AAEtF,SAASC,qBAAqB,QAAQ,WAAW;AACjD,SAASC,oBAAoB,QAAQ,oBAAoB;AAGzD,OAAO,SAASC,WAAW,EACzBC,QAAQ,EACRC,YAAY,UAAU,EACtBC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,WAAWC,cAAc,EACT;IAChBb,sBAAsBO,UAAUC;IAEhC,IAAIE,QAAQ,OAAO;IAEnB,MAAME,YAAYX,qBAChBI,OACA;QAAEC,SAASG,WAAWK,YAAYR;QAASG;QAAUC;QAAQC;IAAO,GACpEE,gBACA;QAAEE,eAAe;IAAa;IAGhC,8EAA8E;IAC9E,4EAA4E;IAC5E,iCAAiC;IACjC,IAAIX,cAAc,cAAc;QAC9B,qBACE,KAACP;YAAImB,wBAAwB;YAACJ,WAAW;mBAAIA;gBAAWd;aAAmB;sBACxEK;;IAGP;IAEA,qBACE,KAACP;QAAOoB,wBAAwB;QAACJ,WAAW;eAAIA;YAAWb;SAAiB;kBACzEI;;AAGP;AAEA,cAAc,UAAU"}
|
|
@@ -13,7 +13,9 @@ export function ScrollView({ children, direction = 'vertical', showsIndicators =
|
|
|
13
13
|
disabled,
|
|
14
14
|
hidden,
|
|
15
15
|
testID
|
|
16
|
-
}, extraModifiers
|
|
16
|
+
}, extraModifiers, {
|
|
17
|
+
componentName: 'ScrollView'
|
|
18
|
+
});
|
|
17
19
|
// SwiftUI ScrollView centers content by default. Stretch content to fill
|
|
18
20
|
// the scroll area to match Android/web behavior.
|
|
19
21
|
const innerModifiers = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["universal/ScrollView/index.ios.tsx"],"sourcesContent":[null],"names":["HStack","ScrollView","SwiftUIScrollView","VStack","frame","padding","transformToModifiers","children","direction","showsIndicators","style","onPress","onAppear","onDisappear","disabled","hidden","testID","modifiers","extraModifiers","paddingAll","paddingHorizontal","paddingVertical","paddingTop","paddingBottom","paddingLeft","paddingRight","styleWithoutPadding","scrollModifiers","Object","keys","length","undefined","innerModifiers","maxWidth","Infinity","alignment","hasPadding","push","all","horizontal","vertical","top","bottom","leading","trailing","stack","axes"],"mappings":";AAAA,SAASA,MAAM,EAAEC,cAAcC,iBAAiB,EAAEC,MAAM,QAAQ,oBAAoB;AACpF,SAASC,KAAK,EAAEC,OAAO,QAAQ,8BAA8B;AAG7D,SAASC,oBAAoB,QAAQ,oBAAoB;AAGzD,OAAO,SAASL,WAAW,EACzBM,QAAQ,EACRC,YAAY,UAAU,EACtBC,kBAAkB,IAAI,EACtBC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,WAAWC,cAAc,EACT;IAChB,wEAAwE;IACxE,wCAAwC;IACxC,MAAM,EACJb,SAASc,UAAU,EACnBC,iBAAiB,EACjBC,eAAe,EACfC,UAAU,EACVC,aAAa,EACbC,WAAW,EACXC,YAAY,EACZ,GAAGC,qBACJ,GAAGhB,SAAS,CAAC;IAEd,MAAMiB,kBAAkBrB,qBACtBsB,OAAOC,IAAI,CAACH,qBAAqBI,MAAM,GAAG,IAAKJ,sBAAuCK,WACtF;QAAEpB;QAASC;QAAUC;QAAaC;QAAUC;QAAQC;IAAO,GAC3DE;
|
|
1
|
+
{"version":3,"sources":["universal/ScrollView/index.ios.tsx"],"sourcesContent":[null],"names":["HStack","ScrollView","SwiftUIScrollView","VStack","frame","padding","transformToModifiers","children","direction","showsIndicators","style","onPress","onAppear","onDisappear","disabled","hidden","testID","modifiers","extraModifiers","paddingAll","paddingHorizontal","paddingVertical","paddingTop","paddingBottom","paddingLeft","paddingRight","styleWithoutPadding","scrollModifiers","Object","keys","length","undefined","componentName","innerModifiers","maxWidth","Infinity","alignment","hasPadding","push","all","horizontal","vertical","top","bottom","leading","trailing","stack","axes"],"mappings":";AAAA,SAASA,MAAM,EAAEC,cAAcC,iBAAiB,EAAEC,MAAM,QAAQ,oBAAoB;AACpF,SAASC,KAAK,EAAEC,OAAO,QAAQ,8BAA8B;AAG7D,SAASC,oBAAoB,QAAQ,oBAAoB;AAGzD,OAAO,SAASL,WAAW,EACzBM,QAAQ,EACRC,YAAY,UAAU,EACtBC,kBAAkB,IAAI,EACtBC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,WAAWC,cAAc,EACT;IAChB,wEAAwE;IACxE,wCAAwC;IACxC,MAAM,EACJb,SAASc,UAAU,EACnBC,iBAAiB,EACjBC,eAAe,EACfC,UAAU,EACVC,aAAa,EACbC,WAAW,EACXC,YAAY,EACZ,GAAGC,qBACJ,GAAGhB,SAAS,CAAC;IAEd,MAAMiB,kBAAkBrB,qBACtBsB,OAAOC,IAAI,CAACH,qBAAqBI,MAAM,GAAG,IAAKJ,sBAAuCK,WACtF;QAAEpB;QAASC;QAAUC;QAAaC;QAAUC;QAAQC;IAAO,GAC3DE,gBACA;QAAEc,eAAe;IAAa;IAGhC,yEAAyE;IACzE,iDAAiD;IACjD,MAAMC,iBAAmC;QAAC7B,MAAM;YAAE8B,UAAUC;YAAUC,WAAW;QAAa;KAAG;IAEjG,MAAMC,aACJlB,cAAc,QACdC,qBAAqB,QACrBC,mBAAmB,QACnBC,cAAc,QACdC,iBAAiB,QACjBC,eAAe,QACfC,gBAAgB;IAElB,IAAIY,YAAY;QACdJ,eAAeK,IAAI,CACjBjC,QAAQ;YACNkC,KAAKpB;YACLqB,YAAYpB;YACZqB,UAAUpB;YACVqB,KAAKpB;YACLqB,QAAQpB;YACRqB,SAASpB;YACTqB,UAAUpB;QACZ;IAEJ;IAEA,MAAMqB,QACJtC,cAAc,6BACZ,KAACR;QAAOoC,WAAU;QAAMnB,WAAWgB;kBAChC1B;uBAGH,KAACJ;QAAOiC,WAAU;QAAUnB,WAAWgB;kBACpC1B;;IAIP,qBACE,KAACL;QACC6C,MAAMvC;QACNC,iBAAiBA;QACjBQ,WAAWU;QACXX,QAAQA;kBACP8B;;AAGP;AAEA,cAAc,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["universal/Spacer/index.android.tsx"],"sourcesContent":[null],"names":["Spacer","ComposeSpacer","height","heightModifier","size","sizeModifier","weight","weightModifier","width","widthModifier","useUniversalLifecycle","transformToModifiers","flexible","style","onAppear","onDisappear","disabled","hidden","testID","modifiers","extraModifiers","layoutMods","push"],"mappings":";AAAA,SAASA,UAAUC,aAAa,QAAQ,2BAA2B;AACnE,SACEC,UAAUC,cAAc,EACxBC,QAAQC,YAAY,EACpBC,UAAUC,cAAc,EACxBC,SAASC,aAAa,QAEjB,qCAAqC;AAE5C,SAASC,qBAAqB,QAAQ,WAAW;AACjD,SAASC,oBAAoB,QAAQ,oBAAoB;AAGzD;;;;;;;CAOC,GACD,OAAO,SAASX,OAAO,EACrBI,IAAI,EACJQ,WAAW,KAAK,EAChBC,KAAK,EACLC,QAAQ,EACRC,WAAW,EACXC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,WAAWC,cAAc,EACb;IACZV,sBAAsBI,UAAUC;IAEhC,IAAIE,QAAQ,OAAO;IAEnB,MAAMI,aAA+B,EAAE;IACvC,IAAIT,UAAU;QACZS,WAAWC,IAAI,CAACf,eAAe;QAC/B,IAAIH,QAAQ,MAAM;YAChB,sEAAsE;YACtE,wEAAwE;YACxE,2DAA2D;YAC3DiB,WAAWC,IAAI,CAACb,cAAcL;YAC9BiB,WAAWC,IAAI,CAACnB,eAAeC;QACjC;IACF,OAAO,IAAIA,QAAQ,MAAM;QACvBiB,WAAWC,IAAI,CAACjB,aAAaD,MAAMA;IACrC;IAEA,MAAMe,YAAYR,
|
|
1
|
+
{"version":3,"sources":["universal/Spacer/index.android.tsx"],"sourcesContent":[null],"names":["Spacer","ComposeSpacer","height","heightModifier","size","sizeModifier","weight","weightModifier","width","widthModifier","useUniversalLifecycle","transformToModifiers","flexible","style","onAppear","onDisappear","disabled","hidden","testID","modifiers","extraModifiers","layoutMods","push","componentName"],"mappings":";AAAA,SAASA,UAAUC,aAAa,QAAQ,2BAA2B;AACnE,SACEC,UAAUC,cAAc,EACxBC,QAAQC,YAAY,EACpBC,UAAUC,cAAc,EACxBC,SAASC,aAAa,QAEjB,qCAAqC;AAE5C,SAASC,qBAAqB,QAAQ,WAAW;AACjD,SAASC,oBAAoB,QAAQ,oBAAoB;AAGzD;;;;;;;CAOC,GACD,OAAO,SAASX,OAAO,EACrBI,IAAI,EACJQ,WAAW,KAAK,EAChBC,KAAK,EACLC,QAAQ,EACRC,WAAW,EACXC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,WAAWC,cAAc,EACb;IACZV,sBAAsBI,UAAUC;IAEhC,IAAIE,QAAQ,OAAO;IAEnB,MAAMI,aAA+B,EAAE;IACvC,IAAIT,UAAU;QACZS,WAAWC,IAAI,CAACf,eAAe;QAC/B,IAAIH,QAAQ,MAAM;YAChB,sEAAsE;YACtE,wEAAwE;YACxE,2DAA2D;YAC3DiB,WAAWC,IAAI,CAACb,cAAcL;YAC9BiB,WAAWC,IAAI,CAACnB,eAAeC;QACjC;IACF,OAAO,IAAIA,QAAQ,MAAM;QACvBiB,WAAWC,IAAI,CAACjB,aAAaD,MAAMA;IACrC;IAEA,MAAMe,YAAYR,qBAChBE,OACA;QAAEG;QAAUC;QAAQC;IAAO,GAC3B;WAAIG;WAAgBD,kBAAkB,EAAE;KAAE,EAC1C;QAAEG,eAAe;IAAS;IAG5B,qBAAO,KAACtB;QAAckB,WAAWA;;AACnC;AAEA,cAAc,UAAU"}
|
|
@@ -20,7 +20,9 @@ import { transformToModifiers } from '../transformStyle';
|
|
|
20
20
|
disabled,
|
|
21
21
|
hidden,
|
|
22
22
|
testID
|
|
23
|
-
}, extraModifiers
|
|
23
|
+
}, extraModifiers, {
|
|
24
|
+
componentName: 'Spacer'
|
|
25
|
+
});
|
|
24
26
|
if (flexible) {
|
|
25
27
|
return /*#__PURE__*/ _jsx(SwiftUISpacer, {
|
|
26
28
|
minLength: size,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["universal/Spacer/index.ios.tsx"],"sourcesContent":[null],"names":["Spacer","SwiftUISpacer","frame","transformToModifiers","size","flexible","style","onAppear","onDisappear","disabled","hidden","testID","modifiers","extraModifiers","baseModifiers","minLength","sizeModifier","width","height"],"mappings":";AAAA,SAASA,UAAUC,aAAa,QAAQ,oBAAoB;AAC5D,SAASC,KAAK,QAAQ,8BAA8B;AAEpD,SAASC,oBAAoB,QAAQ,oBAAoB;AAGzD;;;;;;;;;;;CAWC,GACD,OAAO,SAASH,OAAO,EACrBI,IAAI,EACJC,WAAW,KAAK,EAChBC,KAAK,EACLC,QAAQ,EACRC,WAAW,EACXC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,WAAWC,cAAc,EACb;IACZ,MAAMC,gBAAgBX,qBACpBG,OACA;QAAEC;QAAUC;QAAaC;QAAUC;QAAQC;IAAO,GAClDE;
|
|
1
|
+
{"version":3,"sources":["universal/Spacer/index.ios.tsx"],"sourcesContent":[null],"names":["Spacer","SwiftUISpacer","frame","transformToModifiers","size","flexible","style","onAppear","onDisappear","disabled","hidden","testID","modifiers","extraModifiers","baseModifiers","componentName","minLength","sizeModifier","width","height"],"mappings":";AAAA,SAASA,UAAUC,aAAa,QAAQ,oBAAoB;AAC5D,SAASC,KAAK,QAAQ,8BAA8B;AAEpD,SAASC,oBAAoB,QAAQ,oBAAoB;AAGzD;;;;;;;;;;;CAWC,GACD,OAAO,SAASH,OAAO,EACrBI,IAAI,EACJC,WAAW,KAAK,EAChBC,KAAK,EACLC,QAAQ,EACRC,WAAW,EACXC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,WAAWC,cAAc,EACb;IACZ,MAAMC,gBAAgBX,qBACpBG,OACA;QAAEC;QAAUC;QAAaC;QAAUC;QAAQC;IAAO,GAClDE,gBACA;QAAEE,eAAe;IAAS;IAG5B,IAAIV,UAAU;QACZ,qBAAO,KAACJ;YAAce,WAAWZ;YAAMQ,WAAWE;YAAeH,QAAQA;;IAC3E;IAEA,MAAMM,eAAeb,QAAQ,OAAO;QAACF,MAAM;YAAEgB,OAAOd;YAAMe,QAAQf;QAAK;KAAG,GAAG,EAAE;IAC/E,qBAAO,KAACH;QAAcW,WAAW;eAAIK;eAAiBH;SAAc;QAAEH,QAAQA;;AAChF;AAEA,cAAc,UAAU"}
|
|
@@ -15,7 +15,9 @@ export function Text({ children, textStyle, numberOfLines, style, onPress, onApp
|
|
|
15
15
|
disabled,
|
|
16
16
|
hidden,
|
|
17
17
|
testID
|
|
18
|
-
}, extraModifiers
|
|
18
|
+
}, extraModifiers, {
|
|
19
|
+
componentName: 'Text'
|
|
20
|
+
});
|
|
19
21
|
// Build Compose Text style object
|
|
20
22
|
const composeTextStyle = {};
|
|
21
23
|
if (textStyle?.fontSize != null) composeTextStyle.fontSize = textStyle.fontSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["universal/Text/index.android.tsx"],"sourcesContent":[null],"names":["Text","ComposeText","useUniversalLifecycle","transformToModifiers","textAlignMap","left","center","right","children","textStyle","numberOfLines","style","onPress","onAppear","onDisappear","disabled","hidden","testID","modifiers","extraModifiers","undefined","composeTextStyle","fontSize","fontWeight","fontFamily","textAlign","letterSpacing","lineHeight","color","maxLines","Object","keys","length"],"mappings":";AAAA,SAASA,QAAQC,WAAW,QAAQ,2BAA2B;AAE/D,SAASC,qBAAqB,QAAQ,WAAW;AACjD,SAASC,oBAAoB,QAAQ,oBAAoB;AAGzD,MAAMC,eAA2D;IAC/DC,MAAM;IACNC,QAAQ;IACRC,OAAO;AACT;AAEA,OAAO,SAASP,KAAK,EACnBQ,QAAQ,EACRC,SAAS,EACTC,aAAa,EACbC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,WAAWC,cAAc,EACf;IACVjB,sBAAsBW,UAAUC;IAEhC,IAAIE,QAAQ,OAAO;IAEnB,MAAME,YAAYf,qBAChBQ,OACA;QAAEC,SAASG,WAAWK,YAAYR;QAASG;QAAUC;QAAQC;IAAO,GACpEE;
|
|
1
|
+
{"version":3,"sources":["universal/Text/index.android.tsx"],"sourcesContent":[null],"names":["Text","ComposeText","useUniversalLifecycle","transformToModifiers","textAlignMap","left","center","right","children","textStyle","numberOfLines","style","onPress","onAppear","onDisappear","disabled","hidden","testID","modifiers","extraModifiers","undefined","componentName","composeTextStyle","fontSize","fontWeight","fontFamily","textAlign","letterSpacing","lineHeight","color","maxLines","Object","keys","length"],"mappings":";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@@ export function Text({ children, textStyle, numberOfLines, style, onPress, onApp
|
|
|
60
60
|
disabled,
|
|
61
61
|
hidden,
|
|
62
62
|
testID
|
|
63
|
-
}, extraModifiers
|
|
63
|
+
}, extraModifiers, {
|
|
64
|
+
componentName: 'Text'
|
|
65
|
+
});
|
|
64
66
|
// A user-supplied modifier replaces any text-derived modifier of the same type.
|
|
65
67
|
const modifiers = [
|
|
66
68
|
...omitUserOverridden(textModifiers, extraModifiers),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["universal/Text/index.ios.tsx"],"sourcesContent":[null],"names":["Text","SwiftUIText","font","foregroundStyle","kerning","lineLimit","lineSpacing","multilineTextAlignment","omitUserOverridden","transformToModifiers","fontWeightMap","normal","bold","textAlignMap","left","center","right","children","textStyle","numberOfLines","style","onPress","onAppear","onDisappear","disabled","hidden","testID","modifiers","extraModifiers","textModifiers","fontSize","fontWeight","fontFamily","push","size","weight","undefined","family","color","mappedAlignment","textAlign","lineHeight","baseFontSize","spacing","Math","max","letterSpacing","universalModifiers"],"mappings":";AAAA,SAASA,QAAQC,WAAW,QAAQ,oBAAoB;AACxD,SACEC,IAAI,EACJC,eAAe,EACfC,OAAO,EACPC,SAAS,EACTC,WAAW,EACXC,sBAAsB,QACjB,8BAA8B;AAGrC,SAASC,kBAAkB,QAAQ,mBAAmB;AACtD,SAASC,oBAAoB,QAAQ,oBAAoB;AAGzD,MAAMC,gBAGF;IACFC,QAAQ;IACRC,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;AACT;AAEA,MAAMC,eAAkE;IACtEC,MAAM;IACNC,QAAQ;IACRC,OAAO;AACT;AAEA,OAAO,SAAShB,KAAK,EACnBiB,QAAQ,EACRC,SAAS,EACTC,aAAa,EACbC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,QAAQ,EACRC,MAAM,EACNC,MAA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","lineLimit","lineSpacing","multilineTextAlignment","omitUserOverridden","transformToModifiers","fontWeightMap","normal","bold","textAlignMap","left","center","right","children","textStyle","numberOfLines","style","onPress","onAppear","onDisappear","disabled","hidden","testID","modifiers","extraModifiers","textModifiers","fontSize","fontWeight","fontFamily","push","size","weight","undefined","family","color","mappedAlignment","textAlign","lineHeight","baseFontSize","spacing","Math","max","letterSpacing","universalModifiers","componentName"],"mappings":";AAAA,SAASA,QAAQC,WAAW,QAAQ,oBAAoB;AACxD,SACEC,IAAI,EACJC,eAAe,EACfC,OAAO,EACPC,SAAS,EACTC,WAAW,EACXC,sBAAsB,QACjB,8BAA8B;AAGrC,SAASC,kBAAkB,QAAQ,mBAAmB;AACtD,SAASC,oBAAoB,QAAQ,oBAAoB;AAGzD,MAAMC,gBAGF;IACFC,QAAQ;IACRC,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;AACT;AAEA,MAAMC,eAAkE;IACtEC,MAAM;IACNC,QAAQ;IACRC,OAAO;AACT;AAEA,OAAO,SAAShB,KAAK,EACnBiB,QAAQ,EACRC,SAAS,EACTC,aAAa,EACbC,KAAK,EACLC,OAAO,EACPC,QAAQ,EACRC,WAAW,EACXC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,WAAWC,cAAc,EACf;IACV,0DAA0D;IAC1D,MAAMC,gBAAkC,EAAE;IAE1C,IAAIX,WAAW;QACb,IACE,OAAOA,UAAUY,QAAQ,KAAK,YAC9BZ,UAAUa,UAAU,IAAI,QACxBb,UAAUc,UAAU,IAAI,MACxB;YACAH,cAAcI,IAAI,CAChB/B,KAAK;gBACHgC,MAAMhB,UAAUY,QAAQ;gBACxBK,QAAQjB,UAAUa,UAAU,GAAGrB,aAAa,CAACQ,UAAUa,UAAU,CAAC,GAAGK;gBACrEC,QAAQnB,UAAUc,UAAU;YAC9B;QAEJ;QAEA,IAAId,UAAUoB,KAAK,EAAE;YACnBT,cAAcI,IAAI,CAAC9B,gBAAgBe,UAAUoB,KAAK;QACpD;QAEA,MAAMC,kBAAkBrB,UAAUsB,SAAS,GAAG3B,YAAY,CAACK,UAAUsB,SAAS,CAAC,GAAGJ;QAClF,IAAIG,iBAAiB;YACnBV,cAAcI,IAAI,CAAC1B,uBAAuBgC;QAC5C;QAEA,IAAI,OAAOrB,UAAUuB,UAAU,KAAK,UAAU;YAC5C,kFAAkF;YAClF,oEAAoE;YACpE,MAAMC,eAAexB,UAAUY,QAAQ,IAAI;YAC3C,MAAMa,UAAUC,KAAKC,GAAG,CAAC,GAAG3B,UAAUuB,UAAU,GAAGC;YACnDb,cAAcI,IAAI,CAAC3B,YAAYqC;QACjC;QAEA,IAAI,OAAOzB,UAAU4B,aAAa,KAAK,UAAU;YAC/CjB,cAAcI,IAAI,CAAC7B,QAAQc,UAAU4B,aAAa;QACpD;IACF;IAEA,IAAI,OAAO3B,kBAAkB,UAAU;QACrCU,cAAcI,IAAI,CAAC5B,UAAUc;IAC/B;IAEA,MAAM4B,qBAAqBtC,qBACzBW,OACA;QAAEC;QAASC;QAAUC;QAAaC;QAAUC;QAAQC;IAAO,GAC3DE,gBACA;QAAEoB,eAAe;IAAO;IAG1B,gFAAgF;IAChF,MAAMrB,YAAY;WAAInB,mBAAmBqB,eAAeD;WAAoBmB;KAAmB;IAE/F,qBACE,KAAC9C;QAAY0B,WAAWA;QAAWD,QAAQA;kBACxCT;;AAGP;AAEA,cAAc,UAAU"}
|
|
@@ -9,6 +9,16 @@ function mapReturnKeyType(value) {
|
|
|
9
9
|
if (value === 'join' || value === 'route' || value === 'emergency-call') return 'default';
|
|
10
10
|
return value;
|
|
11
11
|
}
|
|
12
|
+
function mapSecureKeyboardType(value) {
|
|
13
|
+
switch(value){
|
|
14
|
+
case 'numeric':
|
|
15
|
+
case 'number-pad':
|
|
16
|
+
case 'decimal-pad':
|
|
17
|
+
return 'numberPassword';
|
|
18
|
+
default:
|
|
19
|
+
return 'password';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
12
22
|
function mapKeyboardType(value) {
|
|
13
23
|
switch(value){
|
|
14
24
|
case 'default':
|
|
@@ -67,15 +77,19 @@ export function TextInput({ ref, value, onChangeText, placeholder, autoFocus, ed
|
|
|
67
77
|
if (focused) onFocus?.();
|
|
68
78
|
else onBlur?.();
|
|
69
79
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
80
|
+
// `visualTransformation` only masks the text. The keyboard reads the keyboard type,
|
|
81
|
+
// so a secure field also needs a password type.
|
|
82
|
+
const resolvedKeyboardType = secureTextEntry ? mapSecureKeyboardType(keyboardType) : keyboardType ? mapKeyboardType(keyboardType) : undefined;
|
|
83
|
+
const resolvedAutoCorrect = secureTextEntry ? false : autoCorrect;
|
|
84
|
+
const keyboardOptions = resolvedKeyboardType || autoCapitalize || resolvedAutoCorrect !== undefined || returnKeyType ? {
|
|
85
|
+
...resolvedKeyboardType ? {
|
|
86
|
+
keyboardType: resolvedKeyboardType
|
|
73
87
|
} : null,
|
|
74
88
|
...autoCapitalize ? {
|
|
75
89
|
capitalization: autoCapitalize
|
|
76
90
|
} : null,
|
|
77
|
-
...
|
|
78
|
-
autoCorrectEnabled:
|
|
91
|
+
...resolvedAutoCorrect !== undefined ? {
|
|
92
|
+
autoCorrectEnabled: resolvedAutoCorrect
|
|
79
93
|
} : null,
|
|
80
94
|
...returnKeyType ? {
|
|
81
95
|
imeAction: mapReturnKeyType(returnKeyType)
|
|
@@ -92,8 +106,9 @@ export function TextInput({ ref, value, onChangeText, placeholder, autoFocus, ed
|
|
|
92
106
|
return /*#__PURE__*/ _jsx(BasicTextField, {
|
|
93
107
|
ref: innerRef,
|
|
94
108
|
modifiers: [
|
|
95
|
-
...
|
|
96
|
-
|
|
109
|
+
...transformToModifiers(style, {}, userModifiers, {
|
|
110
|
+
componentName: 'TextInput'
|
|
111
|
+
}),
|
|
97
112
|
...testID ? [
|
|
98
113
|
testIDModifier(testID)
|
|
99
114
|
] : [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["universal/TextInput/index.android.tsx"],"sourcesContent":[null],"names":["BasicTextField","Box","Text","useNativeState","fillMaxWidth","onSizeChanged","semantics","testID","testIDModifier","useImperativeHandle","useRef","transformToModifiers","enterKeyHintToReturnKeyType","inputModeToKeyboardType","resolveEditable","mapReturnKeyType","value","mapKeyboardType","TextInput","ref","onChangeText","placeholder","autoFocus","editable","editableProp","multiline","keyboardType","keyboardTypeProp","autoCapitalize","autoCorrect","returnKeyType","returnKeyTypeProp","onSubmitEditing","onFocus","onBlur","cursorColor","textAlign","readOnly","inputMode","enterKeyHint","defaultValue","numberOfLines","numberOfLinesProp","rows","underlineColorAndroid","placeholderTextColor","textStyle","style","secureTextEntry","autoComplete","onContentSizeChange","maxLength","caretHidden","selectionColor","selectionHandleColor","selection","onSelectionChange","selectTextOnFocus","modifiers","userModifiers","initialFallbackRef","fallback","current","state","innerRef","isFocusedRef","focus","blur","clear","isFocused","setSelection","start","end","Promise","resolve","handleFocusChanged","focused","length","
|
|
1
|
+
{"version":3,"sources":["universal/TextInput/index.android.tsx"],"sourcesContent":[null],"names":["BasicTextField","Box","Text","useNativeState","fillMaxWidth","onSizeChanged","semantics","testID","testIDModifier","useImperativeHandle","useRef","transformToModifiers","enterKeyHintToReturnKeyType","inputModeToKeyboardType","resolveEditable","mapReturnKeyType","value","mapSecureKeyboardType","mapKeyboardType","TextInput","ref","onChangeText","placeholder","autoFocus","editable","editableProp","multiline","keyboardType","keyboardTypeProp","autoCapitalize","autoCorrect","returnKeyType","returnKeyTypeProp","onSubmitEditing","onFocus","onBlur","cursorColor","textAlign","readOnly","inputMode","enterKeyHint","defaultValue","numberOfLines","numberOfLinesProp","rows","underlineColorAndroid","placeholderTextColor","textStyle","style","secureTextEntry","autoComplete","onContentSizeChange","maxLength","caretHidden","selectionColor","selectionHandleColor","selection","onSelectionChange","selectTextOnFocus","modifiers","userModifiers","initialFallbackRef","fallback","current","state","innerRef","isFocusedRef","focus","blur","clear","isFocused","setSelection","start","end","Promise","resolve","handleFocusChanged","focused","length","resolvedKeyboardType","undefined","resolvedAutoCorrect","keyboardOptions","capitalization","autoCorrectEnabled","imeAction","keyboardActions","onDone","onGo","onNext","onSearch","onSend","onPrevious","componentName","contentType","singleLine","maxLines","minLines","visualTransformation","textSelectionColors","handleColor","backgroundColor","onValueChange","onFocusChanged","DecorationBox","contentAlignment","Placeholder","color","InnerTextField"],"mappings":";AAAA,SACEA,cAAc,EACdC,GAAG,EACHC,IAAI,EAIJC,cAAc,QACT,2BAA2B;AAClC,SACEC,YAAY,EACZC,aAAa,EACbC,SAAS,EACTC,UAAUC,cAAc,QACnB,qCAAqC;AAC5C,SAASC,mBAAmB,EAAEC,MAAM,QAAQ,QAAQ;AAGpD,SAASC,oBAAoB,QAAQ,oBAAoB;AAEzD,SAASC,2BAA2B,EAAEC,uBAAuB,EAAEC,eAAe,QAAQ,UAAU;AAEhG,SAASC,iBAAiBC,KAA2B;IACnD,IAAIA,UAAU,YAAYA,UAAU,SAAS,OAAO;IACpD,IAAIA,UAAU,UAAUA,UAAU,WAAWA,UAAU,kBAAkB,OAAO;IAChF,OAAOA;AACT;AAEA,SAASC,sBAAsBD,KAAsC;IACnE,OAAQA;QACN,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAEA,SAASE,gBAAgBF,KAA0B;IACjD,OAAQA;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAEA,OAAO,SAASG,UAAU,EACxBC,GAAG,EACHJ,KAAK,EACLK,YAAY,EACZC,WA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cAAc,gBAAiBjB,eAAekB;QAC3DP,WACEA,aAAcV,aAAaA,cAAc,SACrC;YACE,GAAGU,SAAS;YACZ,GAAIV,aAAaA,cAAc,SAAS;gBAAEA;YAAU,IAAI,IAAI;QAC9D,IACA2C;QAENkB,sBAAsBjD,kBAAkB,aAAa+B;QACrDmB,qBACE7C,kBAAkBC,uBACd;YACE6C,aAAa7C,wBAAwBD;YACrC+C,iBAAiB/C;QACnB,IACA0B;QAENE,iBAAiBA;QACjBI,iBAAiBA;QACjBgB,eAAejF;QACf+B,WAAWA;QACXmD,gBAAgB3B;QAChBpB,WAAWA;QACXC,mBAAmBA;kBACnB,cAAA,KAACzD,eAAewG,aAAa;sBAC3B,cAAA,MAACvG;gBACC0D,WAAW;oBAACvD;iBAAe;gBAC3BqG,kBACEpE,cAAc,WAAW,cAAcA,cAAc,UAAU,WAAW2C;;oBAE3E1D,eAAe,qBACd,KAACtB,eAAe0G,WAAW;kCACzB,cAAA,KAACxG;4BACCyG,OAAO7D;4BACPa,WAAW;gCAACvD;6BAAe;4BAC3B4C,OACED,aAAcV,aAAaA,cAAc,SACrC;gCACE,GAAGU,SAAS;gCACZ,GAAIV,aAAaA,cAAc,SAAS;oCAAEA;gCAAU,IAAI,IAAI;4BAC9D,IACA2C;sCAEL1D;;yBAGH;kCACJ,KAACtB,eAAe4G,cAAc;;;;;AAKxC;AAEA,cAAc,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["universal/TextInput/index.ios.tsx"],"sourcesContent":[null],"names":["SecureField","Text","TextField","useNativeState","autocorrectionDisabled","disabled","disabledMod","foregroundStyle","keyboardType","keyboardTypeMod","lineLimit","multilineTextAlignment","onGeometryChange","onSubmit","submitLabel","textContentType","textInputAutocapitalization","tint","useImperativeHandle","useRef","transformToModifiers","autoCompleteToTextContentType","enterKeyHintToReturnKeyType","inputModeToKeyboardType","resolveEditable","mapReturnKeyType","value","mapKeyboardType","TextInput","ref","onChangeText","placeholder","autoFocus","editable","editableProp","multiline","keyboardTypeProp","autoCapitalize","autoCorrect","returnKeyType","returnKeyTypeProp","onSubmitEditing","onFocus","onBlur","cursorColor","textAlign","readOnly","inputMode","enterKeyHint","defaultValue","numberOfLines","numberOfLinesProp","rows","testID","placeholderTextColor","style","textStyle","secureTextEntry","autoComplete","onContentSizeChange","maxLength","caretHidden","selectionColor","selection","onSelectionChange","selectTextOnFocus","modifiers","userModifiers","initialFallbackRef","fallback","current","state","textFieldRef","secureFieldRef","isFocusedRef","focus","blur","clear","isFocused","setSelection","start","end","__DEV__","console","warn","Promise","resolve","handleFocusChange","focused","length","undefined","push","reservesSpace","mappedContentType","text","onTextChange","onFocusChange","Placeholder","axis"],"mappings":";AAAA,SACEA,WAAW,EAEXC,IAAI,EACJC,SAAS,EAETC,cAAc,QACT,oBAAoB;AAC3B,SACEC,sBAAsB,EACtBC,YAAYC,WAAW,EACvBC,eAAe,EACfC,gBAAgBC,eAAe,EAC/BC,SAAS,EACTC,sBAAsB,EACtBC,gBAAgB,EAChBC,QAAQ,EACRC,WAAW,EACXC,eAAe,EACfC,2BAA2B,EAC3BC,IAAI,QAEC,8BAA8B;AACrC,SAASC,mBAAmB,EAAEC,MAAM,QAAQ,QAAQ;AAGpD,SAASC,oBAAoB,QAAQ,oBAAoB;AAEzD,SACEC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,uBAAuB,EACvBC,eAAe,QACV,UAAU;AAKjB,SAASC,iBAAiBC,KAA2B;IACnD,IAAIA,UAAU,YAAYA,UAAU,SAAS,OAAO;IACpD,IACEA,UAAU,aACVA,UAAU,UACVA,UAAU,cACVA,UAAU,kBACV;QACA,OAAO;IACT;IACA,OAAOA;AACT;AAEA,SAASC,gBAAgBD,KAA0B;IACjD,IAAIA,UAAU,WAAW,OAAO;IAChC,IAAIA,UAAU,cAAc,OAAO;IACnC,IAAIA,UAAU,oBAAoB,OAAO;IACzC,OAAOA;AACT;AAEA,OAAO,SAASE,UAAU,EACxBC,GAAG,EACHH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ACnB,IAAIyB,SAAS;wBACXC,QAAQC,IAAI,CACV,gFACE,2EACA;oBAEN;oBACA,OAAOC,QAAQC,OAAO;gBACxB;gBACA,OAAOd,aAAaF,OAAO,EAAES,aAAaC,OAAOC,QAAQI,QAAQC,OAAO;YAC1E;QACF,CAAA,GACA;QAAC7B;KAAgB;IAGnB,MAAM8B,oBAAoB,CAACC;QACzBd,aAAaJ,OAAO,GAAGkB;QACvB,IAAIA,WAAWvB,qBAAqB,CAACR,iBAAiB;YACpDe,aAAaF,OAAO,EAAES,aAAa,GAAGR,MAAM7C,KAAK,CAAC+D,MAAM;QAC1D;QACA,IAAID,SAAS9C;aACRC;IACP;IAEA,MAAMuB,YAA8B;WAC9BC,iBAAiB,EAAE;WACpB/C,qBAAqBmC,OAAO,CAAC,GAAGmC,WAAW;
|
|
1
|
+
{"version":3,"sources":["universal/TextInput/index.ios.tsx"],"sourcesContent":[null],"names":["SecureField","Text","TextField","useNativeState","autocorrectionDisabled","disabled","disabledMod","foregroundStyle","keyboardType","keyboardTypeMod","lineLimit","multilineTextAlignment","onGeometryChange","onSubmit","submitLabel","textContentType","textInputAutocapitalization","tint","useImperativeHandle","useRef","transformToModifiers","autoCompleteToTextContentType","enterKeyHintToReturnKeyType","inputModeToKeyboardType","resolveEditable","mapReturnKeyType","value","mapKeyboardType","TextInput","ref","onChangeText","placeholder","autoFocus","editable","editableProp","multiline","keyboardTypeProp","autoCapitalize","autoCorrect","returnKeyType","returnKeyTypeProp","onSubmitEditing","onFocus","onBlur","cursorColor","textAlign","readOnly","inputMode","enterKeyHint","defaultValue","numberOfLines","numberOfLinesProp","rows","testID","placeholderTextColor","style","textStyle","secureTextEntry","autoComplete","onContentSizeChange","maxLength","caretHidden","selectionColor","selection","onSelectionChange","selectTextOnFocus","modifiers","userModifiers","initialFallbackRef","fallback","current","state","textFieldRef","secureFieldRef","isFocusedRef","focus","blur","clear","isFocused","setSelection","start","end","__DEV__","console","warn","Promise","resolve","handleFocusChange","focused","length","undefined","componentName","push","reservesSpace","mappedContentType","text","onTextChange","onFocusChange","Placeholder","axis"],"mappings":";AAAA,SACEA,WAAW,EAEXC,IAAI,EACJC,SAAS,EAETC,cAAc,QACT,oBAAoB;AAC3B,SACEC,sBAAsB,EACtBC,YAAYC,WAAW,EACvBC,eAAe,EACfC,gBAAgBC,eAAe,EAC/BC,SAAS,EACTC,sBAAsB,EACtBC,gBAAgB,EAChBC,QAAQ,EACRC,WAAW,EACXC,eAAe,EACfC,2BAA2B,EAC3BC,IAAI,QAEC,8BAA8B;AACrC,SAASC,mBAAmB,EAAEC,MAAM,QAAQ,QAAQ;AAGpD,SAASC,oBAAoB,QAAQ,oBAAoB;AAEzD,SACEC,6BAA6B,EAC7BC,2BAA2B,EAC3BC,uBAAuB,EACvBC,eAAe,QACV,UAAU;AAKjB,SAASC,iBAAiBC,KAA2B;IACnD,IAAIA,UAAU,YAAYA,UAAU,SAAS,OAAO;IACpD,IACEA,UAAU,aACVA,UAAU,UACVA,UAAU,cACVA,UAAU,kBACV;QACA,OAAO;IACT;IACA,OAAOA;AACT;AAEA,SAASC,gBAAgBD,KAA0B;IACjD,IAAIA,UAAU,WAAW,OAAO;IAChC,IAAIA,UAAU,cAAc,OAAO;IACnC,IAAIA,UAAU,oBAAoB,OAAO;IACzC,OAAOA;AACT;AAEA,OAAO,SAASE,UAAU,EACxBC,GAAG,EACHH,KAAK,EACLI,YAAY,EACZC,WAAW,EACXC,SAAS,EACTC,UAAUC,YAAY,EACtBC,SAAS,EACT3B,cAAc4B,gBAAgB,EAC9BC,cAAc,EACdC,WAAW,EACXC,eAAeC,iBAAiB,EAChCC,eAAe,EACfC,OAAO,EACPC,MAAM,EACNC,WAAW,EACXC,SAAS,EACTC,QAAQ,EACRC,SAAS,EACTC,YAAY,EACZC,YAAY,EACZC,eAAeC,iBAAiB,EAChCC,IAAI,EACJC,MAAM,EACNC,oBAAoB,EACpBC,KAAK,EACLC,SAAS,EACTC,eAAe,EACfC,YAAY,EACZC,mBA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C;IAEzD,IAAIF,iBAAiB;QACnB,qBACE,KAACzD;YACC6B,KAAK4C;YACLsB,MAAMxB;YACNxC,aAAaA;YACbC,WAAWA;YACXgE,cAAclE;YACdmE,eAAeV;YACf3B,WAAWA;YACXM,WAAWA,UAAUuB,MAAM,GAAG,IAAIvB,YAAYwB;YAC9CrC,QAAQA;sBACPC,wBAAwBvB,4BACvB,KAAC/B,YAAYkG,WAAW;0BACtB,cAAA,KAACjG;oBAAKiE,WAAW;wBAAC3D,gBAAgB+C;qBAAsB;8BAAGvB;;iBAE3D;;IAGV;IAEA,qBACE,KAAC7B;QACC2B,KAAK2C;QACLuB,MAAMxB;QACNxC,aAAaA;QACbC,WAAWA;QACXmE,MAAMhE,YAAY,aAAa;QAC/B6D,cAAclE;QACdmE,eAAeV;QACfxB,WAAWA;QACXC,mBAAmBA;QACnBJ,WAAWA;QACXM,WAAWA,UAAUuB,MAAM,GAAG,IAAIvB,YAAYwB;QAC9CrC,QAAQA;kBACPC,wBAAwBvB,4BACvB,KAAC7B,UAAUgG,WAAW;sBACpB,cAAA,KAACjG;gBAAKiE,WAAW;oBAAC3D,gBAAgB+C;iBAAsB;0BAAGvB;;aAE3D;;AAGV;AAEA,cAAc,UAAU"}
|
|
@@ -18,4 +18,4 @@ export * from './RNHostView';
|
|
|
18
18
|
export * from './Spacer';
|
|
19
19
|
export * from './State';
|
|
20
20
|
export { TextInput, type TextInputProps, type TextInputRef } from './TextInput';
|
|
21
|
-
export type { UniversalStyle, UniversalAlignment, UniversalBaseProps } from './types';
|
|
21
|
+
export type { UniversalStyle, UniversalAlignment, UniversalBaseProps, UniversalDimension, } from './types';
|
|
@@ -12,4 +12,37 @@ import type { ModifierConfig } from '../types';
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function omitUserOverridden<T extends {
|
|
14
14
|
$type: string;
|
|
15
|
-
}>(derived: T[], userModifiers?: readonly ModifierConfig[]): T[];
|
|
15
|
+
}>(derived: T[], userModifiers?: readonly ModifierConfig[], preservedTypes?: ReadonlySet<string>): T[];
|
|
16
|
+
/**
|
|
17
|
+
* A fixed size in density-independent pixels, or a percentage of the parent.
|
|
18
|
+
* `'50%'` is half of the parent's content size on that axis.
|
|
19
|
+
* @docsInline
|
|
20
|
+
*/
|
|
21
|
+
export type UniversalDimension = number | `${number}%` | null;
|
|
22
|
+
export type SerializedUniversalDimensions = {
|
|
23
|
+
widthPoints?: number;
|
|
24
|
+
widthFraction?: number;
|
|
25
|
+
heightPoints?: number;
|
|
26
|
+
heightFraction?: number;
|
|
27
|
+
};
|
|
28
|
+
export type UniversalLayoutPlatform = 'android' | 'ios';
|
|
29
|
+
type UniversalDimensionStyle = {
|
|
30
|
+
width?: unknown;
|
|
31
|
+
height?: unknown;
|
|
32
|
+
};
|
|
33
|
+
export declare function serializeUniversalDimensions(style: UniversalDimensionStyle | undefined, componentName?: string): SerializedUniversalDimensions;
|
|
34
|
+
/**
|
|
35
|
+
* Which axes a user modifier already owns.
|
|
36
|
+
* `weight` applies to the parent's main axis, so the cross axis still comes from `style`.
|
|
37
|
+
* `defaultMinSize` only applies when the incoming constraint is 0, so it does not replace a size.
|
|
38
|
+
* A `frame` owns an axis only when it sets `width` or `height`.
|
|
39
|
+
* A minimum or maximum limits that size.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getUserSizingOverrides(userModifiers: readonly ModifierConfig[] | undefined, platform: UniversalLayoutPlatform): {
|
|
42
|
+
width: boolean;
|
|
43
|
+
height: boolean;
|
|
44
|
+
};
|
|
45
|
+
export declare function omitUserOverriddenDimensions(dimensions: SerializedUniversalDimensions, userModifiers: readonly ModifierConfig[] | undefined, platform: UniversalLayoutPlatform): SerializedUniversalDimensions;
|
|
46
|
+
export declare function createUniversalLayoutModifier(dimensions: SerializedUniversalDimensions): ModifierConfig | undefined;
|
|
47
|
+
export declare function resetUniversalDimensionWarningsForTests(): void;
|
|
48
|
+
export {};
|
|
@@ -8,12 +8,108 @@
|
|
|
8
8
|
* functional props (for example `onPress`, `onAppear`, `disabled`) must not
|
|
9
9
|
* go through this filter, or a user modifier of the same type would silently
|
|
10
10
|
* disable the prop.
|
|
11
|
-
*/ export function omitUserOverridden(derived, userModifiers) {
|
|
11
|
+
*/ export function omitUserOverridden(derived, userModifiers, preservedTypes) {
|
|
12
12
|
if (!userModifiers?.length) {
|
|
13
13
|
return derived;
|
|
14
14
|
}
|
|
15
15
|
const userTypes = new Set(userModifiers.map((modifier)=>modifier.$type));
|
|
16
|
-
return derived.filter((modifier)
|
|
16
|
+
return derived.filter((modifier)=>preservedTypes?.has(modifier.$type) || !userTypes.has(modifier.$type));
|
|
17
|
+
}
|
|
18
|
+
const PERCENTAGE_PATTERN = /^(?:\d+(?:\.\d+)?|\.\d+)%$/;
|
|
19
|
+
const warnedInvalidDimensions = new Set();
|
|
20
|
+
function warnInvalidDimension(componentName, axis, value) {
|
|
21
|
+
if (!__DEV__) return;
|
|
22
|
+
const warningKey = `${componentName}:${axis}`;
|
|
23
|
+
if (warnedInvalidDimensions.has(warningKey)) return;
|
|
24
|
+
warnedInvalidDimensions.add(warningKey);
|
|
25
|
+
console.warn(`[Expo UI] Ignoring invalid ${axis} on ${componentName}: ${String(value)}. ` + 'Expected a finite, non-negative number or percentage.');
|
|
26
|
+
}
|
|
27
|
+
function serializeDimension(value, componentName, axis) {
|
|
28
|
+
if (value == null) return {};
|
|
29
|
+
if (typeof value === 'number') {
|
|
30
|
+
if (Number.isFinite(value) && value >= 0) return {
|
|
31
|
+
points: value
|
|
32
|
+
};
|
|
33
|
+
warnInvalidDimension(componentName, axis, value);
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
if (typeof value === 'string' && PERCENTAGE_PATTERN.test(value)) {
|
|
37
|
+
const percentage = Number(value.slice(0, -1));
|
|
38
|
+
if (Number.isFinite(percentage) && percentage >= 0) {
|
|
39
|
+
return {
|
|
40
|
+
fraction: percentage / 100
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
warnInvalidDimension(componentName, axis, value);
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
export function serializeUniversalDimensions(style, componentName = 'universal component') {
|
|
48
|
+
const width = serializeDimension(style?.width, componentName, 'width');
|
|
49
|
+
const height = serializeDimension(style?.height, componentName, 'height');
|
|
50
|
+
return {
|
|
51
|
+
widthPoints: width.points,
|
|
52
|
+
widthFraction: width.fraction,
|
|
53
|
+
heightPoints: height.points,
|
|
54
|
+
heightFraction: height.fraction
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Which axes a user modifier already owns.
|
|
59
|
+
* `weight` applies to the parent's main axis, so the cross axis still comes from `style`.
|
|
60
|
+
* `defaultMinSize` only applies when the incoming constraint is 0, so it does not replace a size.
|
|
61
|
+
* A `frame` owns an axis only when it sets `width` or `height`.
|
|
62
|
+
* A minimum or maximum limits that size.
|
|
63
|
+
*/ export function getUserSizingOverrides(userModifiers, platform) {
|
|
64
|
+
let width = false;
|
|
65
|
+
let height = false;
|
|
66
|
+
for (const modifier of userModifiers ?? []){
|
|
67
|
+
if (platform === 'android') {
|
|
68
|
+
if (modifier.$type === 'size' || modifier.$type === 'fillMaxSize') {
|
|
69
|
+
width = true;
|
|
70
|
+
height = true;
|
|
71
|
+
} else if (modifier.$type === 'width' || modifier.$type === 'fillMaxWidth' || modifier.$type === 'wrapContentWidth') {
|
|
72
|
+
width = true;
|
|
73
|
+
} else if (modifier.$type === 'height' || modifier.$type === 'fillMaxHeight' || modifier.$type === 'wrapContentHeight') {
|
|
74
|
+
height = true;
|
|
75
|
+
}
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
if (modifier.$type === 'frame') {
|
|
79
|
+
width ||= modifier.width != null;
|
|
80
|
+
height ||= modifier.height != null;
|
|
81
|
+
} else if (modifier.$type === 'containerRelativeFrame') {
|
|
82
|
+
width ||= modifier.axes === 'horizontal' || modifier.axes === 'both';
|
|
83
|
+
height ||= modifier.axes === 'vertical' || modifier.axes === 'both';
|
|
84
|
+
} else if (modifier.$type === 'fixedSize') {
|
|
85
|
+
const hasExplicitAxis = modifier.horizontal != null || modifier.vertical != null;
|
|
86
|
+
width ||= hasExplicitAxis ? modifier.horizontal === true : true;
|
|
87
|
+
height ||= hasExplicitAxis ? modifier.vertical === true : true;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
width,
|
|
92
|
+
height
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export function omitUserOverriddenDimensions(dimensions, userModifiers, platform) {
|
|
96
|
+
const overrides = getUserSizingOverrides(userModifiers, platform);
|
|
97
|
+
return {
|
|
98
|
+
widthPoints: overrides.width ? undefined : dimensions.widthPoints,
|
|
99
|
+
widthFraction: overrides.width ? undefined : dimensions.widthFraction,
|
|
100
|
+
heightPoints: overrides.height ? undefined : dimensions.heightPoints,
|
|
101
|
+
heightFraction: overrides.height ? undefined : dimensions.heightFraction
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export function createUniversalLayoutModifier(dimensions) {
|
|
105
|
+
const hasDimension = Object.values(dimensions).some((value)=>value != null);
|
|
106
|
+
return hasDimension ? {
|
|
107
|
+
$type: 'universalLayout',
|
|
108
|
+
...dimensions
|
|
109
|
+
} : undefined;
|
|
110
|
+
}
|
|
111
|
+
export function resetUniversalDimensionWarningsForTests() {
|
|
112
|
+
warnedInvalidDimensions.clear();
|
|
17
113
|
}
|
|
18
114
|
|
|
19
115
|
//# sourceMappingURL=modifierUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["universal/modifierUtils.ts"],"sourcesContent":[null],"names":["omitUserOverridden","derived","userModifiers","length","userTypes","Set","map","modifier","$type","filter","has"],"mappings":"AAEA;;;;;;;;;;CAUC,GACD,OAAO,SAASA,mBACdC,OAAY,EACZC,aAAyC;
|
|
1
|
+
{"version":3,"sources":["universal/modifierUtils.ts"],"sourcesContent":[null],"names":["omitUserOverridden","derived","userModifiers","preservedTypes","length","userTypes","Set","map","modifier","$type","filter","has","PERCENTAGE_PATTERN","warnedInvalidDimensions","warnInvalidDimension","componentName","axis","value","__DEV__","warningKey","add","console","warn","String","serializeDimension","Number","isFinite","points","test","percentage","slice","fraction","serializeUniversalDimensions","style","width","height","widthPoints","widthFraction","heightPoints","heightFraction","getUserSizingOverrides","platform","axes","hasExplicitAxis","horizontal","vertical","omitUserOverriddenDimensions","dimensions","overrides","undefined","createUniversalLayoutModifier","hasDimension","Object","values","some","resetUniversalDimensionWarningsForTests","clear"],"mappings":"AAEA;;;;;;;;;;CAUC,GACD,OAAO,SAASA,mBACdC,OAAY,EACZC,aAAyC,EACzCC,cAAoC;IAEpC,IAAI,CAACD,eAAeE,QAAQ;QAC1B,OAAOH;IACT;IACA,MAAMI,YAAY,IAAIC,IAAIJ,cAAcK,GAAG,CAAC,CAACC,WAAaA,SAASC,KAAK;IACxE,OAAOR,QAAQS,MAAM,CACnB,CAACF,WAAaL,gBAAgBQ,IAAIH,SAASC,KAAK,KAAK,CAACJ,UAAUM,GAAG,CAACH,SAASC,KAAK;AAEtF;AAyBA,MAAMG,qBAAqB;AAC3B,MAAMC,0BAA0B,IAAIP;AAEpC,SAASQ,qBAAqBC,aAAqB,EAAEC,IAAmB,EAAEC,KAAc;IACtF,IAAI,CAACC,SAAS;IAEd,MAAMC,aAAa,GAAGJ,cAAc,CAAC,EAAEC,MAAM;IAC7C,IAAIH,wBAAwBF,GAAG,CAACQ,aAAa;IAC7CN,wBAAwBO,GAAG,CAACD;IAE5BE,QAAQC,IAAI,CACV,CAAC,2BAA2B,EAAEN,KAAK,IAAI,EAAED,cAAc,EAAE,EAAEQ,OAAON,OAAO,EAAE,CAAC,GAC1E;AAEN;AAEA,SAASO,mBACPP,KAAc,EACdF,aAAqB,EACrBC,IAAmB;IAEnB,IAAIC,SAAS,MAAM,OAAO,CAAC;IAE3B,IAAI,OAAOA,UAAU,UAAU;QAC7B,IAAIQ,OAAOC,QAAQ,CAACT,UAAUA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
+
/**
|
|
4
|
+
* Main axis of the nearest universal `Row` or `Column` on web.
|
|
5
|
+
* A plain view lays its children out vertically, so that is the default.
|
|
6
|
+
*/
|
|
7
|
+
export declare const StackAxisContext: import("react").Context<StackAxis>;
|
|
8
|
+
/** The size `style` sets on the parent's cross axis, if any. */
|
|
9
|
+
export declare function useCrossAxisSize(style: UniversalStyle | undefined): import("./modifierUtils").UniversalDimension | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Main axis of the nearest universal `Row` or `Column` on web.
|
|
4
|
+
* A plain view lays its children out vertically, so that is the default.
|
|
5
|
+
*/ export const StackAxisContext = createContext('vertical');
|
|
6
|
+
/** The size `style` sets on the parent's cross axis, if any. */ export function useCrossAxisSize(style) {
|
|
7
|
+
const parentAxis = useContext(StackAxisContext);
|
|
8
|
+
return parentAxis === 'horizontal' ? style?.height : style?.width;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=stackAxis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["universal/stackAxis.ts"],"sourcesContent":[null],"names":["createContext","useContext","StackAxisContext","useCrossAxisSize","style","parentAxis","height","width"],"mappings":"AAAA,SAASA,aAAa,EAAEC,UAAU,QAAQ,QAAQ;AAMlD;;;CAGC,GACD,OAAO,MAAMC,mBAAmBF,cAAyB,YAAY;AAErE,8DAA8D,GAC9D,OAAO,SAASG,iBAAiBC,KAAiC;IAChE,MAAMC,aAAaJ,WAAWC;IAC9B,OAAOG,eAAe,eAAeD,OAAOE,SAASF,OAAOG;AAC9D"}
|
|
@@ -6,10 +6,14 @@ import type { UniversalBaseProps, UniversalStyle } from './types';
|
|
|
6
6
|
*
|
|
7
7
|
* Compose modifiers apply outside-in (left to right). To match React Native's
|
|
8
8
|
* box model where background includes the padding area and border is outermost:
|
|
9
|
-
*
|
|
9
|
+
* universal layout → fixed size → border → clip → background → padding → opacity
|
|
10
10
|
* → events → behavior → user escape-hatch
|
|
11
11
|
*
|
|
12
|
+
* Fixed sizes become `size`, `width`, or `height`.
|
|
13
|
+
* Percentages stay on `universalLayout` so the parent stack can resolve them.
|
|
12
14
|
* Style-derived modifiers yield to user-supplied modifiers of the same
|
|
13
15
|
* `$type`, so the escape hatch can override anything derived from props.
|
|
14
16
|
*/
|
|
15
|
-
export declare function transformToModifiers(style: UniversalStyle | undefined, props: Pick<UniversalBaseProps, 'onPress' | 'disabled' | 'hidden' | 'testID'>, extraModifiers?: ModifierConfig[]
|
|
17
|
+
export declare function transformToModifiers(style: UniversalStyle | undefined, props: Pick<UniversalBaseProps, 'onPress' | 'disabled' | 'hidden' | 'testID'>, extraModifiers?: ModifierConfig[], options?: {
|
|
18
|
+
componentName?: string;
|
|
19
|
+
}): ModifierConfig[];
|
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
import { alpha, background, border, clickable, clip, height, padding, paddingAll, Shapes, size, testID as testIDModifier, width } from '@expo/ui/jetpack-compose/modifiers';
|
|
2
|
-
import { omitUserOverridden } from './modifierUtils';
|
|
2
|
+
import { createUniversalLayoutModifier, omitUserOverridden, omitUserOverriddenDimensions, serializeUniversalDimensions } from './modifierUtils';
|
|
3
3
|
/**
|
|
4
4
|
* Converts universal style/event/lifecycle/behavior props into a Jetpack
|
|
5
5
|
* Compose modifier array.
|
|
6
6
|
*
|
|
7
7
|
* Compose modifiers apply outside-in (left to right). To match React Native's
|
|
8
8
|
* box model where background includes the padding area and border is outermost:
|
|
9
|
-
*
|
|
9
|
+
* universal layout → fixed size → border → clip → background → padding → opacity
|
|
10
10
|
* → events → behavior → user escape-hatch
|
|
11
11
|
*
|
|
12
|
+
* Fixed sizes become `size`, `width`, or `height`.
|
|
13
|
+
* Percentages stay on `universalLayout` so the parent stack can resolve them.
|
|
12
14
|
* Style-derived modifiers yield to user-supplied modifiers of the same
|
|
13
15
|
* `$type`, so the escape hatch can override anything derived from props.
|
|
14
|
-
*/ export function transformToModifiers(style, props, extraModifiers) {
|
|
16
|
+
*/ export function transformToModifiers(style, props, extraModifiers, options) {
|
|
15
17
|
let mods = [];
|
|
18
|
+
const dimensions = omitUserOverriddenDimensions(serializeUniversalDimensions(style, options?.componentName), extraModifiers, 'android');
|
|
19
|
+
const fixedWidth = dimensions.widthPoints;
|
|
20
|
+
const fixedHeight = dimensions.heightPoints;
|
|
21
|
+
const universalLayoutModifier = createUniversalLayoutModifier(dimensions);
|
|
22
|
+
if (universalLayoutModifier) mods.push(universalLayoutModifier);
|
|
23
|
+
// Fixed sizing is applied directly. Percentages remain as parent data for
|
|
24
|
+
// the owning universal layout to resolve against its content box.
|
|
25
|
+
if (fixedWidth != null && fixedHeight != null) {
|
|
26
|
+
mods.push(size(fixedWidth, fixedHeight));
|
|
27
|
+
} else {
|
|
28
|
+
if (fixedWidth != null) mods.push(width(fixedWidth));
|
|
29
|
+
if (fixedHeight != null) mods.push(height(fixedHeight));
|
|
30
|
+
}
|
|
16
31
|
if (style) {
|
|
17
|
-
// Sizing (outermost)
|
|
18
|
-
if (style.width != null && style.height != null) {
|
|
19
|
-
mods.push(size(style.width, style.height));
|
|
20
|
-
} else if (style.width != null) {
|
|
21
|
-
mods.push(width(style.width));
|
|
22
|
-
} else if (style.height != null) {
|
|
23
|
-
mods.push(height(style.height));
|
|
24
|
-
}
|
|
25
32
|
// Border + background + borderRadius handling.
|
|
26
33
|
// Compose's border() doesn't accept a shape, so when borderRadius is set
|
|
27
34
|
// alongside border, we simulate a rounded border using layered backgrounds:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["universal/transformStyle.android.ts"],"sourcesContent":[null],"names":["alpha","background","border","clickable","clip","height","padding","paddingAll","Shapes","size","testID","testIDModifier","width","omitUserOverridden","transformToModifiers","style","props","extraModifiers","mods","push","hasBorder","borderWidth","borderColor","hasRadius","borderRadius","radius","bw","RoundedCorner","String","Math","max","backgroundColor","all","top","paddingTop","paddingVertical","bottom","paddingBottom","start","paddingLeft","paddingHorizontal","end","paddingRight","opacity","onPress","hidden"],"mappings":"AAAA,SACEA,KAAK,EACLC,UAAU,EACVC,MAAM,EACNC,SAAS,EACTC,IAAI,EACJC,MAAM,EACNC,OAAO,EACPC,UAAU,EACVC,MAAM,EACNC,IAAI,EACJC,UAAUC,cAAc,EACxBC,KAAK,QAEA,qCAAqC;AAE5C,
|
|
1
|
+
{"version":3,"sources":["universal/transformStyle.android.ts"],"sourcesContent":[null],"names":["alpha","background","border","clickable","clip","height","padding","paddingAll","Shapes","size","testID","testIDModifier","width","createUniversalLayoutModifier","omitUserOverridden","omitUserOverriddenDimensions","serializeUniversalDimensions","transformToModifiers","style","props","extraModifiers","options","mods","dimensions","componentName","fixedWidth","widthPoints","fixedHeight","heightPoints","universalLayoutModifier","push","hasBorder","borderWidth","borderColor","hasRadius","borderRadius","radius","bw","RoundedCorner","String","Math","max","backgroundColor","all","top","paddingTop","paddingVertical","bottom","paddingBottom","start","paddingLeft","paddingHorizontal","end","paddingRight","opacity","onPress","hidden"],"mappings":"AAAA,SACEA,KAAK,EACLC,UAAU,EACVC,MAAM,EACNC,SAAS,EACTC,IAAI,EACJC,MAAM,EACNC,OAAO,EACPC,UAAU,EACVC,MAAM,EACNC,IAAI,EACJC,UAAUC,cAAc,EACxBC,KAAK,QAEA,qCAAqC;AAE5C,SACEC,6BAA6B,EAC7BC,kBAAkB,EAClBC,4BAA4B,EAC5BC,4BAA4B,QACvB,kBAAkB;AAGzB;;;;;;;;;;;;;CAaC,GACD,OAAO,SAASC,qBACdC,KAAiC,EACjCC,KAA6E,EAC7EC,cAAiC,EACjCC,OAAoC;IAEpC,IAAIC,OAAyB,EAAE;IAC/B,MAAMC,aAAaR,6BACjBC,6BAA6BE,OAAOG,SAASG,gBAC7CJ,gBACA;IAEF,MAAMK,aAAaF,WAAWG,WAAW;IACzC,MAAMC,cAAcJ,WAAWK,YAAY;IAC3C,MAAMC,0BAA0BhB,8BAA8BU;IAE9D,IAAIM,y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8
|
* SwiftUI modifiers apply inside-out (each modifier wraps the previous).
|
|
9
9
|
* To match React Native's box model (background fills the full box):
|
|
10
|
-
* padding →
|
|
10
|
+
* padding → fixed frame → universal layout → background → border → clip → opacity
|
|
11
11
|
* → events → lifecycle → behavior → user escape-hatch
|
|
12
12
|
*
|
|
13
|
+
* Fixed sizes become a `frame`.
|
|
14
|
+
* Percentages stay on `universalLayout` so the parent stack can resolve them.
|
|
13
15
|
* Style-derived modifiers yield to user-supplied modifiers of the same
|
|
14
16
|
* `$type`, so the escape hatch can override anything derived from props.
|
|
15
17
|
*/
|
|
16
18
|
export declare function transformToModifiers(style: UniversalStyle | undefined, props: Pick<UniversalBaseProps, 'onPress' | 'onAppear' | 'onDisappear' | 'disabled' | 'hidden' | 'testID'>, extraModifiers?: ModifierConfig[], options?: {
|
|
19
|
+
/** Component name included in invalid-dimension development warnings. */
|
|
20
|
+
componentName?: string;
|
|
17
21
|
/** Alignment for the frame modifier (used by Column/Row). */
|
|
18
22
|
frameAlignment?: Parameters<typeof frame>[0]['alignment'];
|
|
19
23
|
/** Text-styling props for text-rendering components. */
|