@expo/ui 57.0.14 → 57.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/RNHostView.kt +20 -0
- package/build/jetpack-compose/RNHostView/index.d.ts +6 -0
- package/build/jetpack-compose/RNHostView/index.d.ts.map +1 -1
- package/build/swift-ui/RNHostView.d.ts +2 -0
- package/build/swift-ui/RNHostView.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +9 -34
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/presentationModifiers.d.ts +3 -2
- package/build/swift-ui/modifiers/presentationModifiers.d.ts.map +1 -1
- package/build/swift-ui/modifiers/shapeStyle.d.ts +54 -0
- package/build/swift-ui/modifiers/shapeStyle.d.ts.map +1 -0
- package/build/universal/BottomSheet/index.android.d.ts +1 -1
- package/build/universal/BottomSheet/index.android.d.ts.map +1 -1
- package/build/universal/BottomSheet/index.d.ts +1 -1
- package/build/universal/BottomSheet/index.d.ts.map +1 -1
- package/build/universal/BottomSheet/index.ios.d.ts +1 -1
- package/build/universal/BottomSheet/index.ios.d.ts.map +1 -1
- package/build/universal/BottomSheet/types.d.ts +20 -0
- package/build/universal/BottomSheet/types.d.ts.map +1 -1
- package/build/universal/ListItem/ListItem.android.d.ts.map +1 -1
- package/build/universal/ListItem/types.d.ts +19 -0
- package/build/universal/ListItem/types.d.ts.map +1 -1
- package/build/universal/RNHostView/index.android.d.ts +1 -1
- package/build/universal/RNHostView/index.android.d.ts.map +1 -1
- package/build/universal/RNHostView/index.d.ts +1 -1
- package/build/universal/RNHostView/index.d.ts.map +1 -1
- package/build/universal/RNHostView/index.ios.d.ts +1 -1
- package/build/universal/RNHostView/index.ios.d.ts.map +1 -1
- package/build/universal/RNHostView/types.d.ts +2 -0
- package/build/universal/RNHostView/types.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/Convertibles/ShapeStyleValue.swift +129 -0
- package/ios/Modifiers/ForegroundStyleModifier.swift +12 -105
- package/ios/Modifiers/ViewModifierRegistry.swift +29 -5
- package/ios/RNHostView.swift +4 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.14/expo.modules.ui-57.0.14-sources.jar → 57.0.15/expo.modules.ui-57.0.15-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.14/expo.modules.ui-57.0.14.aar → 57.0.15/expo.modules.ui-57.0.15.aar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.14/expo.modules.ui-57.0.14.module → 57.0.15/expo.modules.ui-57.0.15.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.14/expo.modules.ui-57.0.14.pom → 57.0.15/expo.modules.ui-57.0.15.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
- package/package.json +3 -3
- package/src/jetpack-compose/RNHostView/index.tsx +12 -0
- package/src/swift-ui/RNHostView.tsx +3 -0
- package/src/swift-ui/modifiers/index.ts +10 -39
- package/src/swift-ui/modifiers/presentationModifiers.ts +3 -2
- package/src/swift-ui/modifiers/shapeStyle.ts +55 -0
- package/src/universal/BottomSheet/index.android.tsx +4 -0
- package/src/universal/BottomSheet/index.ios.tsx +5 -0
- package/src/universal/BottomSheet/index.tsx +4 -0
- package/src/universal/BottomSheet/types.ts +22 -0
- package/src/universal/ListItem/ListItem.android.tsx +2 -1
- package/src/universal/ListItem/types.ts +21 -0
- package/src/universal/RNHostView/index.android.tsx +2 -1
- package/src/universal/RNHostView/index.ios.tsx +6 -2
- package/src/universal/RNHostView/index.tsx +2 -0
- package/src/universal/RNHostView/types.ts +3 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.sha512 +0 -1
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// Copyright 2015-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
import SwiftUI
|
|
5
|
+
|
|
6
|
+
internal enum ShapeStyleType: String, Enumerable {
|
|
7
|
+
case color
|
|
8
|
+
case hierarchical
|
|
9
|
+
case material
|
|
10
|
+
case linearGradient
|
|
11
|
+
case radialGradient
|
|
12
|
+
case angularGradient
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
internal enum HierarchicalShapeStyleOptions: String, Enumerable {
|
|
16
|
+
case primary
|
|
17
|
+
case secondary
|
|
18
|
+
case tertiary
|
|
19
|
+
case quaternary
|
|
20
|
+
case quinary
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
Returns `nil` when the style is not available on the running platform.
|
|
24
|
+
*/
|
|
25
|
+
func toShapeStyle() -> AnyShapeStyle? {
|
|
26
|
+
switch self {
|
|
27
|
+
case .primary:
|
|
28
|
+
return AnyShapeStyle(HierarchicalShapeStyle.primary)
|
|
29
|
+
case .secondary:
|
|
30
|
+
return AnyShapeStyle(HierarchicalShapeStyle.secondary)
|
|
31
|
+
case .tertiary:
|
|
32
|
+
return AnyShapeStyle(HierarchicalShapeStyle.tertiary)
|
|
33
|
+
case .quaternary:
|
|
34
|
+
return AnyShapeStyle(HierarchicalShapeStyle.quaternary)
|
|
35
|
+
case .quinary:
|
|
36
|
+
if #available(iOS 16.0, tvOS 17.0, *) {
|
|
37
|
+
return AnyShapeStyle(HierarchicalShapeStyle.quinary)
|
|
38
|
+
}
|
|
39
|
+
return nil
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
internal enum MaterialOptions: String, Enumerable {
|
|
45
|
+
case ultraThin
|
|
46
|
+
case thin
|
|
47
|
+
case regular
|
|
48
|
+
case thick
|
|
49
|
+
case ultraThick
|
|
50
|
+
case bar
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
Returns `nil` when the material is not available on the running platform.
|
|
54
|
+
*/
|
|
55
|
+
func toShapeStyle() -> AnyShapeStyle? {
|
|
56
|
+
switch self {
|
|
57
|
+
case .ultraThin:
|
|
58
|
+
return AnyShapeStyle(Material.ultraThin)
|
|
59
|
+
case .thin:
|
|
60
|
+
return AnyShapeStyle(Material.thin)
|
|
61
|
+
case .regular:
|
|
62
|
+
return AnyShapeStyle(Material.regular)
|
|
63
|
+
case .thick:
|
|
64
|
+
return AnyShapeStyle(Material.thick)
|
|
65
|
+
case .ultraThick:
|
|
66
|
+
return AnyShapeStyle(Material.ultraThick)
|
|
67
|
+
case .bar:
|
|
68
|
+
// The bar material has no tvOS counterpart.
|
|
69
|
+
#if os(tvOS)
|
|
70
|
+
return nil
|
|
71
|
+
#else
|
|
72
|
+
return AnyShapeStyle(Material.bar)
|
|
73
|
+
#endif
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
A style that fills or paints an area, mirroring SwiftUI's `ShapeStyle`. Every style is erased to
|
|
80
|
+
`AnyShapeStyle` because the concrete type is only known at runtime — an opaque `some ShapeStyle`
|
|
81
|
+
would have to be a single type across all the branches below.
|
|
82
|
+
*/
|
|
83
|
+
internal struct ShapeStyleValue: Record {
|
|
84
|
+
@Field var type: ShapeStyleType = .color
|
|
85
|
+
@Field var color: Color?
|
|
86
|
+
@Field var hierarchical: HierarchicalShapeStyleOptions?
|
|
87
|
+
@Field var material: MaterialOptions?
|
|
88
|
+
@Field var colors: [Color]?
|
|
89
|
+
@Field var startPoint: UnitPoint?
|
|
90
|
+
@Field var endPoint: UnitPoint?
|
|
91
|
+
@Field var center: UnitPoint?
|
|
92
|
+
@Field var startRadius: CGFloat?
|
|
93
|
+
@Field var endRadius: CGFloat?
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
Resolves the style, or returns `nil` when the fields it needs are missing or the style is not
|
|
97
|
+
available on the running platform. Callers leave the view untouched in that case.
|
|
98
|
+
*/
|
|
99
|
+
func toAnyShapeStyle() -> AnyShapeStyle? {
|
|
100
|
+
switch type {
|
|
101
|
+
case .color:
|
|
102
|
+
guard let color else {
|
|
103
|
+
return nil
|
|
104
|
+
}
|
|
105
|
+
return AnyShapeStyle(color)
|
|
106
|
+
case .hierarchical:
|
|
107
|
+
return (hierarchical ?? .primary).toShapeStyle()
|
|
108
|
+
case .material:
|
|
109
|
+
return material?.toShapeStyle()
|
|
110
|
+
case .linearGradient:
|
|
111
|
+
guard let colors, let startPoint, let endPoint else {
|
|
112
|
+
return nil
|
|
113
|
+
}
|
|
114
|
+
return AnyShapeStyle(LinearGradient(colors: colors, startPoint: startPoint, endPoint: endPoint))
|
|
115
|
+
case .radialGradient:
|
|
116
|
+
guard let colors, let center, let startRadius, let endRadius else {
|
|
117
|
+
return nil
|
|
118
|
+
}
|
|
119
|
+
return AnyShapeStyle(
|
|
120
|
+
RadialGradient(colors: colors, center: center, startRadius: startRadius, endRadius: endRadius)
|
|
121
|
+
)
|
|
122
|
+
case .angularGradient:
|
|
123
|
+
guard let colors, let center else {
|
|
124
|
+
return nil
|
|
125
|
+
}
|
|
126
|
+
return AnyShapeStyle(AngularGradient(colors: colors, center: center))
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -3,122 +3,29 @@
|
|
|
3
3
|
import ExpoModulesCore
|
|
4
4
|
import SwiftUI
|
|
5
5
|
|
|
6
|
-
internal enum ForegroundStyleType: String, Enumerable {
|
|
7
|
-
case color
|
|
8
|
-
case hierarchical
|
|
9
|
-
case linearGradient
|
|
10
|
-
case radialGradient
|
|
11
|
-
case angularGradient
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
internal enum ForegroundHierarchicalStyleType: String, Enumerable {
|
|
15
|
-
case primary
|
|
16
|
-
case secondary
|
|
17
|
-
case tertiary
|
|
18
|
-
case quaternary
|
|
19
|
-
case quinary
|
|
20
|
-
}
|
|
21
|
-
|
|
22
6
|
internal struct ForegroundStyleModifier: ViewModifier, Record {
|
|
23
|
-
@Field var
|
|
24
|
-
@Field var hierarchicalStyle: ForegroundHierarchicalStyleType = .primary
|
|
25
|
-
@Field var color: Color?
|
|
26
|
-
@Field var colors: [Color]?
|
|
27
|
-
@Field var startPoint: UnitPoint?
|
|
28
|
-
@Field var endPoint: UnitPoint?
|
|
29
|
-
@Field var center: UnitPoint?
|
|
30
|
-
@Field var startRadius: CGFloat?
|
|
31
|
-
@Field var endRadius: CGFloat?
|
|
7
|
+
@Field var style: ShapeStyleValue?
|
|
32
8
|
|
|
33
9
|
func body(content: Content) -> some View {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@ViewBuilder
|
|
39
|
-
internal func applyForegroundStyle<V: View>(_ modifier: ForegroundStyleModifier, to content: V) -> some View {
|
|
40
|
-
switch modifier.styleType {
|
|
41
|
-
case .color:
|
|
42
|
-
if let color = modifier.color {
|
|
43
|
-
content.foregroundStyle(color)
|
|
44
|
-
} else {
|
|
45
|
-
content
|
|
46
|
-
}
|
|
47
|
-
case .hierarchical:
|
|
48
|
-
switch modifier.hierarchicalStyle {
|
|
49
|
-
case .primary:
|
|
50
|
-
content.foregroundStyle(.primary)
|
|
51
|
-
case .secondary:
|
|
52
|
-
content.foregroundStyle(.secondary)
|
|
53
|
-
case .tertiary:
|
|
54
|
-
content.foregroundStyle(.tertiary)
|
|
55
|
-
case .quaternary:
|
|
56
|
-
content.foregroundStyle(.quaternary)
|
|
57
|
-
case .quinary:
|
|
58
|
-
if #available(iOS 16.0, tvOS 17.0, *) {
|
|
59
|
-
content.foregroundStyle(.quinary)
|
|
60
|
-
} else {
|
|
61
|
-
content
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
case .linearGradient:
|
|
65
|
-
if let colors = modifier.colors, let startPoint = modifier.startPoint, let endPoint = modifier.endPoint {
|
|
66
|
-
content.foregroundStyle(LinearGradient(colors: colors, startPoint: startPoint, endPoint: endPoint))
|
|
67
|
-
} else {
|
|
68
|
-
content
|
|
69
|
-
}
|
|
70
|
-
case .radialGradient:
|
|
71
|
-
if let colors = modifier.colors, let center = modifier.center,
|
|
72
|
-
let startRadius = modifier.startRadius, let endRadius = modifier.endRadius {
|
|
73
|
-
content.foregroundStyle(RadialGradient(colors: colors, center: center, startRadius: startRadius, endRadius: endRadius))
|
|
74
|
-
} else {
|
|
75
|
-
content
|
|
76
|
-
}
|
|
77
|
-
case .angularGradient:
|
|
78
|
-
if let colors = modifier.colors, let center = modifier.center {
|
|
79
|
-
content.foregroundStyle(AngularGradient(colors: colors, center: center))
|
|
10
|
+
if let shapeStyle = style?.toAnyShapeStyle() {
|
|
11
|
+
content.foregroundStyle(shapeStyle)
|
|
80
12
|
} else {
|
|
81
13
|
content
|
|
82
14
|
}
|
|
83
15
|
}
|
|
84
16
|
}
|
|
85
17
|
|
|
18
|
+
/**
|
|
19
|
+
`Text` keeps its own type through `foregroundStyle(_:)`, which lets the caller apply further
|
|
20
|
+
text-only modifiers, so the text overload is applied separately from the view one.
|
|
21
|
+
|
|
22
|
+
TODO: `Text.foregroundStyle(_:)` requires iOS 17. Once the package drops iOS 16, inline this
|
|
23
|
+
into the `foregroundStyle` case of `applyTextModifier` and delete the color-only fallback there.
|
|
24
|
+
*/
|
|
86
25
|
@available(iOS 17.0, tvOS 17.0, *)
|
|
87
26
|
internal func applyForegroundStyle(_ modifier: ForegroundStyleModifier, to text: Text) -> Text {
|
|
88
|
-
|
|
89
|
-
case .color:
|
|
90
|
-
if let color = modifier.color {
|
|
91
|
-
return text.foregroundStyle(color)
|
|
92
|
-
}
|
|
93
|
-
return text
|
|
94
|
-
case .hierarchical:
|
|
95
|
-
switch modifier.hierarchicalStyle {
|
|
96
|
-
case .primary:
|
|
97
|
-
return text.foregroundStyle(.primary)
|
|
98
|
-
case .secondary:
|
|
99
|
-
return text.foregroundStyle(.secondary)
|
|
100
|
-
case .tertiary:
|
|
101
|
-
return text.foregroundStyle(.tertiary)
|
|
102
|
-
case .quaternary:
|
|
103
|
-
return text.foregroundStyle(.quaternary)
|
|
104
|
-
case .quinary:
|
|
105
|
-
return text.foregroundStyle(.quinary)
|
|
106
|
-
}
|
|
107
|
-
case .linearGradient:
|
|
108
|
-
if let colors = modifier.colors, let startPoint = modifier.startPoint, let endPoint = modifier.endPoint {
|
|
109
|
-
return text.foregroundStyle(LinearGradient(colors: colors, startPoint: startPoint, endPoint: endPoint))
|
|
110
|
-
}
|
|
111
|
-
return text
|
|
112
|
-
case .radialGradient:
|
|
113
|
-
if let colors = modifier.colors, let center = modifier.center,
|
|
114
|
-
let startRadius = modifier.startRadius, let endRadius = modifier.endRadius {
|
|
115
|
-
return text.foregroundStyle(RadialGradient(colors: colors, center: center, startRadius: startRadius, endRadius: endRadius))
|
|
116
|
-
}
|
|
117
|
-
return text
|
|
118
|
-
case .angularGradient:
|
|
119
|
-
if let colors = modifier.colors, let center = modifier.center {
|
|
120
|
-
return text.foregroundStyle(AngularGradient(colors: colors, center: center))
|
|
121
|
-
}
|
|
27
|
+
guard let shapeStyle = modifier.style?.toAnyShapeStyle() else {
|
|
122
28
|
return text
|
|
123
29
|
}
|
|
30
|
+
return text.foregroundStyle(shapeStyle)
|
|
124
31
|
}
|
|
@@ -910,6 +910,26 @@ internal struct AnyViewModifier: ViewModifier {
|
|
|
910
910
|
}
|
|
911
911
|
}
|
|
912
912
|
|
|
913
|
+
/**
|
|
914
|
+
* Prunability-stable wrapper for `AnyViewModifier`
|
|
915
|
+
*/
|
|
916
|
+
internal struct StableViewModifier: ViewModifier {
|
|
917
|
+
let params: [String: Any]
|
|
918
|
+
weak var appContext: AppContext?
|
|
919
|
+
let dispatcher: EventDispatcher
|
|
920
|
+
|
|
921
|
+
func body(content: Content) -> some View {
|
|
922
|
+
if let type = params["$type"] as? String,
|
|
923
|
+
let appContext,
|
|
924
|
+
let factory = ViewModifierRegistry.shared.modifierFactories[type],
|
|
925
|
+
let modifier = try? factory(params, appContext, dispatcher) {
|
|
926
|
+
content.modifier(AnyViewModifier(modifier))
|
|
927
|
+
} else {
|
|
928
|
+
content
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
|
|
913
933
|
internal struct AnimationModifier: ViewModifier, Record {
|
|
914
934
|
@Field var animation: AnimationConfig
|
|
915
935
|
@Field var animatedValue: Either<Double, Bool>?
|
|
@@ -1562,10 +1582,14 @@ public class ViewModifierRegistry {
|
|
|
1562
1582
|
globalEventDispatcher: EventDispatcher,
|
|
1563
1583
|
params: [String: Any]
|
|
1564
1584
|
) -> AnyView {
|
|
1565
|
-
guard
|
|
1585
|
+
guard modifierFactories[type] != nil else {
|
|
1566
1586
|
return view
|
|
1567
1587
|
}
|
|
1568
|
-
return AnyView(view.modifier(
|
|
1588
|
+
return AnyView(view.modifier(StableViewModifier(
|
|
1589
|
+
params: params,
|
|
1590
|
+
appContext: appContext,
|
|
1591
|
+
dispatcher: globalEventDispatcher
|
|
1592
|
+
)))
|
|
1569
1593
|
}
|
|
1570
1594
|
|
|
1571
1595
|
/**
|
|
@@ -1595,9 +1619,9 @@ public class ViewModifierRegistry {
|
|
|
1595
1619
|
guard let modifier = try? ForegroundStyleModifier(from: params, appContext: appContext) else { return text }
|
|
1596
1620
|
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
1597
1621
|
return applyForegroundStyle(modifier, to: text)
|
|
1598
|
-
} else if modifier.
|
|
1599
|
-
|
|
1600
|
-
}
|
|
1622
|
+
} else if modifier.style?.type == .color, let color = modifier.style?.color {
|
|
1623
|
+
return text.foregroundColor(color)
|
|
1624
|
+
}
|
|
1601
1625
|
return text
|
|
1602
1626
|
default:
|
|
1603
1627
|
#if DEBUG
|
package/ios/RNHostView.swift
CHANGED
|
@@ -5,6 +5,10 @@ import ExpoModulesCore
|
|
|
5
5
|
|
|
6
6
|
internal final class RNHostViewProps: ExpoSwiftUI.ViewProps {
|
|
7
7
|
@Field var matchContents: Bool = false
|
|
8
|
+
/**
|
|
9
|
+
Adds LeafNode and MeasurableYogaNode trait in Shadow node
|
|
10
|
+
*/
|
|
11
|
+
@Field var expoInternalSizeFromChildren: Bool = false
|
|
8
12
|
/**
|
|
9
13
|
Whether this view owns its subtree's touches and is the origin its content is measured from. Set
|
|
10
14
|
by the JavaScript side for content presented in its own view controller — see `RNHostView.tsx`,
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
727cf7bc8ccb03288f429d152d19ebb8
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8f8ba3c03ae3deb578a50866e3aa7c1da0a1608a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c0de9f779e4c1fa3758abcbbee8831628a015e11cc4d7242fd1c1ead65a62eef
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
20a3c1eb5e1bddbb7b3708606f314fbffaa9165cff2e148826fd2e7cd7e1def14e2b3e7ef1190ba853b66f5a71f3d32c05c71f7c7e98dc8470d2e5c2bfccd752
|
|
Binary file
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
edd3e3bac5983521c3fb8ba7a1830f75
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
413330dc1478358eefbcd2ad21a352e69567b868
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3954246789a3258d28107744fc6c8ffb721f105c6403279b0e93ca1a961bcddb
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.aar.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0fed5da498418bb5841100fac2b2f04d302598b81abd4159f62c8f1caecca14b831712cfff61039087834f9f1f32fe6b695cbab710e70a1b969e0bae70e471f0
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "expo.modules.ui",
|
|
5
5
|
"module": "expo.modules.ui",
|
|
6
|
-
"version": "57.0.
|
|
6
|
+
"version": "57.0.15",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.ui-57.0.
|
|
28
|
-
"url": "expo.modules.ui-57.0.
|
|
29
|
-
"size":
|
|
30
|
-
"sha512": "
|
|
31
|
-
"sha256": "
|
|
32
|
-
"sha1": "
|
|
33
|
-
"md5": "
|
|
27
|
+
"name": "expo.modules.ui-57.0.15.aar",
|
|
28
|
+
"url": "expo.modules.ui-57.0.15.aar",
|
|
29
|
+
"size": 1996194,
|
|
30
|
+
"sha512": "0fed5da498418bb5841100fac2b2f04d302598b81abd4159f62c8f1caecca14b831712cfff61039087834f9f1f32fe6b695cbab710e70a1b969e0bae70e471f0",
|
|
31
|
+
"sha256": "3954246789a3258d28107744fc6c8ffb721f105c6403279b0e93ca1a961bcddb",
|
|
32
|
+
"sha1": "413330dc1478358eefbcd2ad21a352e69567b868",
|
|
33
|
+
"md5": "edd3e3bac5983521c3fb8ba7a1830f75"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
},
|
|
@@ -141,13 +141,13 @@
|
|
|
141
141
|
],
|
|
142
142
|
"files": [
|
|
143
143
|
{
|
|
144
|
-
"name": "expo.modules.ui-57.0.
|
|
145
|
-
"url": "expo.modules.ui-57.0.
|
|
146
|
-
"size":
|
|
147
|
-
"sha512": "
|
|
148
|
-
"sha256": "
|
|
149
|
-
"sha1": "
|
|
150
|
-
"md5": "
|
|
144
|
+
"name": "expo.modules.ui-57.0.15.aar",
|
|
145
|
+
"url": "expo.modules.ui-57.0.15.aar",
|
|
146
|
+
"size": 1996194,
|
|
147
|
+
"sha512": "0fed5da498418bb5841100fac2b2f04d302598b81abd4159f62c8f1caecca14b831712cfff61039087834f9f1f32fe6b695cbab710e70a1b969e0bae70e471f0",
|
|
148
|
+
"sha256": "3954246789a3258d28107744fc6c8ffb721f105c6403279b0e93ca1a961bcddb",
|
|
149
|
+
"sha1": "413330dc1478358eefbcd2ad21a352e69567b868",
|
|
150
|
+
"md5": "edd3e3bac5983521c3fb8ba7a1830f75"
|
|
151
151
|
}
|
|
152
152
|
]
|
|
153
153
|
},
|
|
@@ -161,13 +161,13 @@
|
|
|
161
161
|
},
|
|
162
162
|
"files": [
|
|
163
163
|
{
|
|
164
|
-
"name": "expo.modules.ui-57.0.
|
|
165
|
-
"url": "expo.modules.ui-57.0.
|
|
166
|
-
"size":
|
|
167
|
-
"sha512": "
|
|
168
|
-
"sha256": "
|
|
169
|
-
"sha1": "
|
|
170
|
-
"md5": "
|
|
164
|
+
"name": "expo.modules.ui-57.0.15-sources.jar",
|
|
165
|
+
"url": "expo.modules.ui-57.0.15-sources.jar",
|
|
166
|
+
"size": 101673,
|
|
167
|
+
"sha512": "20a3c1eb5e1bddbb7b3708606f314fbffaa9165cff2e148826fd2e7cd7e1def14e2b3e7ef1190ba853b66f5a71f3d32c05c71f7c7e98dc8470d2e5c2bfccd752",
|
|
168
|
+
"sha256": "c0de9f779e4c1fa3758abcbbee8831628a015e11cc4d7242fd1c1ead65a62eef",
|
|
169
|
+
"sha1": "8f8ba3c03ae3deb578a50866e3aa7c1da0a1608a",
|
|
170
|
+
"md5": "727cf7bc8ccb03288f429d152d19ebb8"
|
|
171
171
|
}
|
|
172
172
|
]
|
|
173
173
|
}
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.module.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2795adc5211a8fc7f863c991f23d839d
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.module.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0b9ff6c6054311175dc6bd90b07c314a7ede6f84
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
78e5605f43fc4b0f3d2f9a15f1c4fdec5c2ea8cd318b91c420b6eb15dd5eb494
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5f05356766b79d9fdcf15c07d42f0d07954b8ccf6603f68f05ce2c1520ef4a7be053913ea4dc39f8c9d778ab0e844d3933e057b56073a68eecb6acbc4dffca05
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>expo.modules.ui</groupId>
|
|
11
11
|
<artifactId>expo.modules.ui</artifactId>
|
|
12
|
-
<version>57.0.
|
|
12
|
+
<version>57.0.15</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.ui</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5a8652e710f6244614c44748103be21e
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
20bca33f9608309fa2b6d4b60f481576201db951
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
05310f77cf9090370c199b477a3a20040419deaf872950d919fe112d9820ca3b
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.15/expo.modules.ui-57.0.15.pom.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
872bf3ee828e9dcea87db32b2396a6eb3cccacffdedf263d0f85a7943ca20d09fbb5e97c6f20bcd2852e128597f47f67ed957b76350335de57c13f5a103cd67f
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>expo.modules.ui</groupId>
|
|
4
4
|
<artifactId>expo.modules.ui</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>57.0.
|
|
7
|
-
<release>57.0.
|
|
6
|
+
<latest>57.0.15</latest>
|
|
7
|
+
<release>57.0.15</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>57.0.
|
|
9
|
+
<version>57.0.15</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20260901160721</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
ef804b0b5130bf45649f48809235610b
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
00c505224838ff5cfc459029b30fbe70426dc730
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
0f4c9b5ca861ed3f22c5b000a3022934d9956a512c8c28ddb6b70f883ba75503
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
786895d2586ce5fb37d448df152d909e98c025c03aaf2270c419fd12255f58901f577deb0cb4d9f63fad7d3c591b528caee5583839c481d23c1737e8646dd681
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/ui",
|
|
3
|
-
"version": "57.0.
|
|
3
|
+
"version": "57.0.15",
|
|
4
4
|
"description": "A collection of UI components",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.fx.js",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"react-native-reanimated": "4.5.1",
|
|
98
98
|
"react-native-worklets": "0.10.1",
|
|
99
99
|
"expo-module-scripts": "56.0.3",
|
|
100
|
-
"expo": "57.0.
|
|
100
|
+
"expo": "57.0.19"
|
|
101
101
|
},
|
|
102
102
|
"jest": {
|
|
103
103
|
"preset": "expo-module-scripts"
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"optional": true
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
|
-
"gitHead": "
|
|
124
|
+
"gitHead": "b76ecf192c5325793bcea31dd9bb8efd91f9ad7f",
|
|
125
125
|
"scripts": {
|
|
126
126
|
"build": "expo-module build",
|
|
127
127
|
"clean": "expo-module clean",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
2
|
import type { ReactElement, ComponentType } from 'react';
|
|
3
|
+
import type { LayoutChangeEvent } from 'react-native';
|
|
3
4
|
|
|
4
5
|
import { PresentedContentContext, useIsPresentedInOwnWindow } from '../../PresentedContentContext';
|
|
5
6
|
import type { ModifierConfig } from '../../types';
|
|
@@ -14,6 +15,11 @@ export interface RNHostProps extends PrimitiveBaseProps {
|
|
|
14
15
|
* @default false
|
|
15
16
|
*/
|
|
16
17
|
matchContents?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Called on mount and whenever this view's layout in the React Native view tree changes.
|
|
20
|
+
* With `matchContents`, the reported size is the one measured from the hosted view.
|
|
21
|
+
*/
|
|
22
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
17
23
|
/**
|
|
18
24
|
* The RN View to be hosted.
|
|
19
25
|
*/
|
|
@@ -26,6 +32,11 @@ export interface RNHostProps extends PrimitiveBaseProps {
|
|
|
26
32
|
|
|
27
33
|
type NativeRNHostProps = RNHostProps & {
|
|
28
34
|
layoutRoot: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Internal. Drives the shadow node's content measurement, see
|
|
37
|
+
* `ExpoViewShadowNode::sizesToContent`.
|
|
38
|
+
*/
|
|
39
|
+
expoInternalSizeFromChildren?: boolean;
|
|
29
40
|
};
|
|
30
41
|
const NativeRNHostView: ComponentType<NativeRNHostProps> = requireNativeView(
|
|
31
42
|
'ExpoUI',
|
|
@@ -39,6 +50,7 @@ function transformProps(props: RNHostProps, layoutRoot: boolean): NativeRNHostPr
|
|
|
39
50
|
...(modifiers ? createViewModifierEventListener(modifiers) : undefined),
|
|
40
51
|
...restProps,
|
|
41
52
|
layoutRoot,
|
|
53
|
+
expoInternalSizeFromChildren: props.matchContents,
|
|
42
54
|
};
|
|
43
55
|
}
|
|
44
56
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { requireNativeView } from 'expo';
|
|
2
|
+
import type { LayoutChangeEvent } from 'react-native';
|
|
2
3
|
|
|
3
4
|
import { PresentedContentContext, useIsPresentedInOwnWindow } from '../PresentedContentContext';
|
|
4
5
|
|
|
@@ -13,6 +14,7 @@ export interface RNHostViewProps {
|
|
|
13
14
|
* @default false
|
|
14
15
|
*/
|
|
15
16
|
matchContents?: boolean;
|
|
17
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
16
18
|
/**
|
|
17
19
|
* The RN View to be hosted.
|
|
18
20
|
*/
|
|
@@ -30,6 +32,7 @@ export function RNHostView(props: RNHostViewProps) {
|
|
|
30
32
|
<RNHostNativeView
|
|
31
33
|
{...props}
|
|
32
34
|
layoutRoot={layoutRoot}
|
|
35
|
+
expoInternalSizeFromChildren={props.matchContents}
|
|
33
36
|
// `matchContents` can only be used once on mount
|
|
34
37
|
// So we force unmount when it changes to prevent unexpected layout
|
|
35
38
|
key={props.matchContents ? 'matchContents' : 'noMatchContents'}>
|