@expo/ui 56.0.9 → 56.0.11
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 +17 -0
- package/CLAUDE.md +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +11 -5
- package/android/src/main/java/expo/modules/ui/HorizontalPagerView.kt +97 -16
- package/android/src/main/java/expo/modules/ui/colors/MaterialColors.kt +2 -0
- package/build/State/index.d.ts +6 -0
- package/build/State/index.d.ts.map +1 -0
- package/build/community/pager-view/PagerView.android.d.ts +7 -0
- package/build/community/pager-view/PagerView.android.d.ts.map +1 -0
- package/build/community/pager-view/PagerView.d.ts +8 -0
- package/build/community/pager-view/PagerView.d.ts.map +1 -0
- package/build/community/pager-view/PagerView.ios.d.ts +15 -0
- package/build/community/pager-view/PagerView.ios.d.ts.map +1 -0
- package/build/community/pager-view/index.d.ts +3 -0
- package/build/community/pager-view/index.d.ts.map +1 -0
- package/build/community/pager-view/types.d.ts +122 -0
- package/build/community/pager-view/types.d.ts.map +1 -0
- package/build/community/segmented-control/vendor/SegmentsSeparators.d.ts.map +1 -1
- package/build/jetpack-compose/HorizontalPager/index.d.ts +27 -0
- package/build/jetpack-compose/HorizontalPager/index.d.ts.map +1 -1
- package/build/jetpack-compose/Host/index.d.ts +1 -0
- package/build/jetpack-compose/Host/index.d.ts.map +1 -1
- package/build/jetpack-compose/LoadingIndicator/index.d.ts +1 -1
- package/build/jetpack-compose/LoadingIndicator/index.d.ts.map +1 -1
- package/build/jetpack-compose/SyncSwitch/index.d.ts +1 -1
- package/build/jetpack-compose/SyncSwitch/index.d.ts.map +1 -1
- package/build/jetpack-compose/TextField/index.d.ts +1 -1
- package/build/jetpack-compose/TextField/index.d.ts.map +1 -1
- package/build/jetpack-compose/index.d.ts +1 -2
- package/build/jetpack-compose/index.d.ts.map +1 -1
- package/build/swift-ui/Host/index.d.ts +1 -0
- package/build/swift-ui/Host/index.d.ts.map +1 -1
- package/build/swift-ui/ScrollView/index.d.ts +30 -0
- package/build/swift-ui/ScrollView/index.d.ts.map +1 -1
- package/build/swift-ui/SecureField/index.d.ts +1 -1
- package/build/swift-ui/SecureField/index.d.ts.map +1 -1
- package/build/swift-ui/SyncToggle/index.d.ts +1 -1
- package/build/swift-ui/SyncToggle/index.d.ts.map +1 -1
- package/build/swift-ui/TextField/index.d.ts +1 -1
- package/build/swift-ui/TextField/index.d.ts.map +1 -1
- package/build/swift-ui/index.d.ts +1 -2
- package/build/swift-ui/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +25 -15
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/scrollObservation.d.ts +52 -0
- package/build/swift-ui/modifiers/scrollObservation.d.ts.map +1 -0
- package/build/swift-ui/modifiers/scrollPosition.d.ts +1 -1
- package/build/swift-ui/modifiers/scrollPosition.d.ts.map +1 -1
- package/build/swift-ui/modifiers/symbolEffect.d.ts +1 -1
- package/build/swift-ui/modifiers/symbolEffect.d.ts.map +1 -1
- package/build/universal/BottomSheet/index.android.d.ts.map +1 -1
- package/build/universal/BottomSheet/index.d.ts.map +1 -1
- package/build/universal/BottomSheet/index.ios.d.ts.map +1 -1
- package/build/universal/Checkbox/index.d.ts.map +1 -1
- package/build/universal/Collapsible/index.d.ts.map +1 -1
- package/build/universal/ListItem/ListItem.d.ts.map +1 -1
- package/build/universal/RNHostView/index.android.d.ts +7 -0
- package/build/universal/RNHostView/index.android.d.ts.map +1 -0
- package/build/universal/RNHostView/index.d.ts +7 -0
- package/build/universal/RNHostView/index.d.ts.map +1 -0
- package/build/universal/RNHostView/index.ios.d.ts +7 -0
- package/build/universal/RNHostView/index.ios.d.ts.map +1 -0
- package/build/universal/RNHostView/types.d.ts +23 -0
- package/build/universal/RNHostView/types.d.ts.map +1 -0
- package/build/universal/Switch/index.d.ts.map +1 -1
- package/build/universal/TextInput/index.d.ts.map +1 -1
- package/build/universal/index.d.ts +1 -0
- package/build/universal/index.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/ExpoUIModule.swift +6 -3
- package/ios/HostView.swift +21 -18
- package/ios/Modifiers/FontModifier.swift +72 -20
- package/ios/Modifiers/ScrollObservationModifiers.swift +107 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +8 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{56.0.9/expo.modules.ui-56.0.9-sources.jar → 56.0.11/expo.modules.ui-56.0.11-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{56.0.9/expo.modules.ui-56.0.9.module → 56.0.11/expo.modules.ui-56.0.11.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{56.0.9/expo.modules.ui-56.0.9.pom → 56.0.11/expo.modules.ui-56.0.11.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.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 +7 -3
- package/src/State/index.ts +10 -0
- package/src/State/useNativeState.ts +8 -0
- package/src/community/pager-view/PagerView.android.tsx +224 -0
- package/src/community/pager-view/PagerView.ios.tsx +273 -0
- package/src/community/pager-view/PagerView.tsx +14 -0
- package/src/community/pager-view/index.tsx +13 -0
- package/src/community/pager-view/types.tsx +131 -0
- package/src/community/picker/Picker.android.tsx +1 -1
- package/src/community/segmented-control/vendor/SegmentsSeparators.tsx +3 -6
- package/src/jetpack-compose/HorizontalPager/index.tsx +89 -18
- package/src/jetpack-compose/Host/index.tsx +1 -0
- package/src/jetpack-compose/LoadingIndicator/index.tsx +1 -2
- package/src/jetpack-compose/SyncSwitch/index.tsx +1 -3
- package/src/jetpack-compose/TextField/index.tsx +1 -4
- package/src/jetpack-compose/index.ts +1 -2
- package/src/swift-ui/Host/index.tsx +1 -0
- package/src/swift-ui/ScrollView/index.tsx +33 -0
- package/src/swift-ui/SecureField/index.tsx +1 -4
- package/src/swift-ui/SyncToggle/index.tsx +1 -3
- package/src/swift-ui/TextField/index.tsx +1 -4
- package/src/swift-ui/index.tsx +1 -3
- package/src/swift-ui/modifiers/index.ts +37 -14
- package/src/swift-ui/modifiers/scrollObservation.ts +80 -0
- package/src/swift-ui/modifiers/scrollPosition.ts +1 -2
- package/src/swift-ui/modifiers/symbolEffect.ts +1 -2
- package/src/swift-ui/withAnimation.ts +1 -1
- package/src/universal/BottomSheet/index.android.tsx +33 -10
- package/src/universal/BottomSheet/index.ios.tsx +12 -10
- package/src/universal/BottomSheet/index.tsx +3 -0
- package/src/universal/Checkbox/index.tsx +14 -2
- package/src/universal/Collapsible/index.tsx +17 -4
- package/src/universal/ListItem/ListItem.tsx +7 -2
- package/src/universal/RNHostView/index.android.tsx +33 -0
- package/src/universal/RNHostView/index.ios.tsx +12 -0
- package/src/universal/RNHostView/index.tsx +39 -0
- package/src/universal/RNHostView/types.ts +25 -0
- package/src/universal/Switch/index.tsx +7 -2
- package/src/universal/TextInput/index.tsx +12 -2
- package/src/universal/index.ts +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.pom.sha512 +0 -1
package/ios/HostView.swift
CHANGED
|
@@ -38,6 +38,7 @@ internal final class HostViewProps: ExpoSwiftUI.ViewProps, ExpoSwiftUI.SafeAreaC
|
|
|
38
38
|
@Field var matchContentsHorizontal = false
|
|
39
39
|
@Field var matchContentsVertical = false
|
|
40
40
|
@Field var ignoreSafeArea: ExpoSwiftUI.IgnoreSafeArea?
|
|
41
|
+
@Field var modifiers: ModifierArray?
|
|
41
42
|
var onLayoutContent = EventDispatcher()
|
|
42
43
|
}
|
|
43
44
|
|
|
@@ -45,38 +46,40 @@ struct HostView: ExpoSwiftUI.View, ExpoSwiftUI.WithHostingView {
|
|
|
45
46
|
@ObservedObject var props: HostViewProps
|
|
46
47
|
|
|
47
48
|
var body: some View {
|
|
48
|
-
var useViewportSizeMeasurement: Bool = props.useViewportSizeMeasurement
|
|
49
|
-
if #available(iOS 16.0, tvOS 16.0, macOS 13.0, *) {
|
|
50
|
-
useViewportSizeMeasurement = props.useViewportSizeMeasurement
|
|
51
|
-
} else {
|
|
52
|
-
log.warn("useViewportSizeMeasurement is not supported on iOS/tvOS < 16.0")
|
|
53
|
-
useViewportSizeMeasurement = false
|
|
54
|
-
}
|
|
55
|
-
|
|
56
49
|
let layoutDirection = props.layoutDirection.toLayoutDirection()
|
|
57
50
|
let alignment: Alignment = layoutDirection == .rightToLeft ? .topTrailing : .topLeading
|
|
58
51
|
|
|
59
52
|
if #available(iOS 16.0, tvOS 16.0, macOS 13.0, *) {
|
|
60
53
|
// swiftlint:disable:next identifier_name
|
|
61
|
-
let HostLayout = useViewportSizeMeasurement
|
|
54
|
+
let HostLayout = props.useViewportSizeMeasurement
|
|
62
55
|
? AnyLayout(ViewportSizeMeasurementLayout(layoutDirection: layoutDirection))
|
|
63
56
|
: AnyLayout(ZStackLayout(alignment: alignment))
|
|
64
|
-
|
|
57
|
+
HostLayout {
|
|
65
58
|
Children()
|
|
66
59
|
}
|
|
67
60
|
.fixedSize(horizontal: props.matchContentsHorizontal, vertical: props.matchContentsVertical)
|
|
68
61
|
.modifier(LayoutDirectionModifier(layoutDirection: layoutDirection))
|
|
69
62
|
.modifier(ColorSchemeModifier(colorScheme: props.colorScheme?.toColorScheme()))
|
|
63
|
+
.applyModifiers(
|
|
64
|
+
props.modifiers,
|
|
65
|
+
appContext: props.appContext,
|
|
66
|
+
globalEventDispatcher: props.globalEventDispatcher
|
|
67
|
+
)
|
|
68
|
+
.modifier(GeometryChangeModifier(props: props))
|
|
69
|
+
} else {
|
|
70
|
+
ZStack(alignment: alignment) {
|
|
71
|
+
Children()
|
|
72
|
+
}
|
|
73
|
+
.fixedSize(horizontal: props.matchContentsHorizontal, vertical: props.matchContentsVertical)
|
|
74
|
+
.modifier(LayoutDirectionModifier(layoutDirection: layoutDirection))
|
|
75
|
+
.modifier(ColorSchemeModifier(colorScheme: props.colorScheme?.toColorScheme()))
|
|
76
|
+
.applyModifiers(
|
|
77
|
+
props.modifiers,
|
|
78
|
+
appContext: props.appContext,
|
|
79
|
+
globalEventDispatcher: props.globalEventDispatcher
|
|
80
|
+
)
|
|
70
81
|
.modifier(GeometryChangeModifier(props: props))
|
|
71
82
|
}
|
|
72
|
-
|
|
73
|
-
return ZStack(alignment: alignment) {
|
|
74
|
-
Children()
|
|
75
|
-
}
|
|
76
|
-
.fixedSize(horizontal: props.matchContentsHorizontal, vertical: props.matchContentsVertical)
|
|
77
|
-
.modifier(LayoutDirectionModifier(layoutDirection: layoutDirection))
|
|
78
|
-
.modifier(ColorSchemeModifier(colorScheme: props.colorScheme?.toColorScheme()))
|
|
79
|
-
.modifier(GeometryChangeModifier(props: props))
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
private func safeAreaSize() -> CGSize {
|
|
@@ -16,15 +16,15 @@ internal enum FontWeight: String, Enumerable {
|
|
|
16
16
|
|
|
17
17
|
func toSwiftUI() -> Font.Weight {
|
|
18
18
|
switch self {
|
|
19
|
-
case .ultraLight:
|
|
20
|
-
case .thin:
|
|
21
|
-
case .light:
|
|
22
|
-
case .regular:
|
|
23
|
-
case .medium:
|
|
24
|
-
case .semibold:
|
|
25
|
-
case .bold:
|
|
26
|
-
case .heavy:
|
|
27
|
-
case .black:
|
|
19
|
+
case .ultraLight: .ultraLight
|
|
20
|
+
case .thin: .thin
|
|
21
|
+
case .light: .light
|
|
22
|
+
case .regular: .regular
|
|
23
|
+
case .medium: .medium
|
|
24
|
+
case .semibold: .semibold
|
|
25
|
+
case .bold: .bold
|
|
26
|
+
case .heavy: .heavy
|
|
27
|
+
case .black: .black
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -37,10 +37,40 @@ internal enum FontDesign: String, Enumerable {
|
|
|
37
37
|
|
|
38
38
|
func toSwiftUI() -> Font.Design {
|
|
39
39
|
switch self {
|
|
40
|
-
case .default:
|
|
41
|
-
case .rounded:
|
|
42
|
-
case .serif:
|
|
43
|
-
case .monospaced:
|
|
40
|
+
case .default: .default
|
|
41
|
+
case .rounded: .rounded
|
|
42
|
+
case .serif: .serif
|
|
43
|
+
case .monospaced: .monospaced
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
internal enum FontTextStyle: String, Enumerable {
|
|
49
|
+
case largeTitle
|
|
50
|
+
case title
|
|
51
|
+
case title2
|
|
52
|
+
case title3
|
|
53
|
+
case headline
|
|
54
|
+
case subheadline
|
|
55
|
+
case body
|
|
56
|
+
case callout
|
|
57
|
+
case footnote
|
|
58
|
+
case caption
|
|
59
|
+
case caption2
|
|
60
|
+
|
|
61
|
+
func toSwiftUI() -> Font.TextStyle {
|
|
62
|
+
switch self {
|
|
63
|
+
case .largeTitle: .largeTitle
|
|
64
|
+
case .title: .title
|
|
65
|
+
case .title2: .title2
|
|
66
|
+
case .title3: .title3
|
|
67
|
+
case .headline: .headline
|
|
68
|
+
case .subheadline: .subheadline
|
|
69
|
+
case .body: .body
|
|
70
|
+
case .callout: .callout
|
|
71
|
+
case .footnote: .footnote
|
|
72
|
+
case .caption: .caption
|
|
73
|
+
case .caption2: .caption2
|
|
44
74
|
}
|
|
45
75
|
}
|
|
46
76
|
}
|
|
@@ -50,16 +80,38 @@ internal struct FontModifier: ViewModifier, Record {
|
|
|
50
80
|
@Field var size: CGFloat?
|
|
51
81
|
@Field var weight: FontWeight?
|
|
52
82
|
@Field var design: FontDesign?
|
|
83
|
+
@Field var textStyle: FontTextStyle?
|
|
53
84
|
|
|
54
85
|
func body(content: Content) -> some View {
|
|
86
|
+
content.font(resolveFont())
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
private func resolveFont() -> Font {
|
|
55
90
|
if let family = family {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
91
|
+
let baseSize = size ?? 17
|
|
92
|
+
var font: Font = if let textStyle = textStyle {
|
|
93
|
+
Font.custom(family, size: baseSize, relativeTo: textStyle.toSwiftUI())
|
|
94
|
+
} else {
|
|
95
|
+
Font.custom(family, size: baseSize)
|
|
96
|
+
}
|
|
97
|
+
if let weight = weight {
|
|
98
|
+
font = font.weight(weight.toSwiftUI())
|
|
99
|
+
}
|
|
100
|
+
return font
|
|
63
101
|
}
|
|
102
|
+
|
|
103
|
+
if let textStyle = textStyle {
|
|
104
|
+
var font = Font.system(textStyle.toSwiftUI(), design: design?.toSwiftUI() ?? .default)
|
|
105
|
+
if let weight = weight {
|
|
106
|
+
font = font.weight(weight.toSwiftUI())
|
|
107
|
+
}
|
|
108
|
+
return font
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return .system(
|
|
112
|
+
size: size ?? 17,
|
|
113
|
+
weight: weight?.toSwiftUI() ?? .regular,
|
|
114
|
+
design: design?.toSwiftUI() ?? .default
|
|
115
|
+
)
|
|
64
116
|
}
|
|
65
117
|
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// Copyright 2026-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
import SwiftUI
|
|
5
|
+
|
|
6
|
+
internal struct OnScrollGeometryChangeModifier: ViewModifier, Record {
|
|
7
|
+
// Worklet path: synchronous invocation on the UI runtime (no JS-thread dispatch).
|
|
8
|
+
@Field var workletCallback: WorkletCallback?
|
|
9
|
+
// JS-thread path: async event via the global modifier event dispatcher.
|
|
10
|
+
var eventDispatcher: EventDispatcher?
|
|
11
|
+
|
|
12
|
+
init() {}
|
|
13
|
+
|
|
14
|
+
init(from params: Dict, appContext: AppContext, eventDispatcher: EventDispatcher) throws {
|
|
15
|
+
try self = .init(from: params, appContext: appContext)
|
|
16
|
+
self.eventDispatcher = eventDispatcher
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
func body(content: Content) -> some View {
|
|
20
|
+
if #available(iOS 18.0, tvOS 18.0, *) {
|
|
21
|
+
content
|
|
22
|
+
.onScrollGeometryChange(for: ScrollGeometryPayload.self) { ScrollGeometryPayload($0) }
|
|
23
|
+
action: { [workletCallback, eventDispatcher] _, payload in
|
|
24
|
+
let geometry = payload.dictionary
|
|
25
|
+
if let workletCallback {
|
|
26
|
+
workletCallback.invoke(arguments: [geometry])
|
|
27
|
+
} else {
|
|
28
|
+
eventDispatcher?(["onScrollGeometryChange": geometry])
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
content
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
internal struct OnScrollPhaseChangeModifier: ViewModifier, Record {
|
|
38
|
+
var eventDispatcher: EventDispatcher?
|
|
39
|
+
|
|
40
|
+
init() {}
|
|
41
|
+
|
|
42
|
+
init(from params: Dict, appContext: AppContext, eventDispatcher: EventDispatcher) throws {
|
|
43
|
+
try self = .init(from: params, appContext: appContext)
|
|
44
|
+
self.eventDispatcher = eventDispatcher
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
func body(content: Content) -> some View {
|
|
48
|
+
if #available(iOS 18.0, tvOS 18.0, *) {
|
|
49
|
+
content.onScrollPhaseChange { [eventDispatcher] _, newPhase, context in
|
|
50
|
+
eventDispatcher?([
|
|
51
|
+
"onScrollPhaseChange": [
|
|
52
|
+
"phase": Self.phaseString(newPhase),
|
|
53
|
+
"geometry": ScrollGeometryPayload(context.geometry).dictionary
|
|
54
|
+
]
|
|
55
|
+
])
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
content
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@available(iOS 18.0, tvOS 18.0, *)
|
|
63
|
+
private static func phaseString(_ phase: ScrollPhase) -> String {
|
|
64
|
+
return switch phase {
|
|
65
|
+
case .idle: "idle"
|
|
66
|
+
case .tracking: "tracking"
|
|
67
|
+
case .interacting: "interacting"
|
|
68
|
+
case .animating: "animating"
|
|
69
|
+
case .decelerating: "decelerating"
|
|
70
|
+
@unknown default: "idle"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
internal struct ScrollGeometryPayload: Equatable {
|
|
76
|
+
let contentOffsetX: CGFloat
|
|
77
|
+
let contentOffsetY: CGFloat
|
|
78
|
+
let containerWidth: CGFloat
|
|
79
|
+
let containerHeight: CGFloat
|
|
80
|
+
let contentWidth: CGFloat
|
|
81
|
+
let contentHeight: CGFloat
|
|
82
|
+
|
|
83
|
+
var dictionary: [String: Any] {
|
|
84
|
+
[
|
|
85
|
+
"contentOffsetX": contentOffsetX,
|
|
86
|
+
"contentOffsetY": contentOffsetY,
|
|
87
|
+
"containerWidth": containerWidth,
|
|
88
|
+
"containerHeight": containerHeight,
|
|
89
|
+
"contentWidth": contentWidth,
|
|
90
|
+
"contentHeight": contentHeight
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@available(iOS 18.0, tvOS 18.0, *)
|
|
96
|
+
extension ScrollGeometryPayload {
|
|
97
|
+
init(_ geometry: ScrollGeometry) {
|
|
98
|
+
self.init(
|
|
99
|
+
contentOffsetX: geometry.contentOffset.x,
|
|
100
|
+
contentOffsetY: geometry.contentOffset.y,
|
|
101
|
+
containerWidth: geometry.containerSize.width,
|
|
102
|
+
containerHeight: geometry.containerSize.height,
|
|
103
|
+
contentWidth: geometry.contentSize.width,
|
|
104
|
+
contentHeight: geometry.contentSize.height
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -1850,5 +1850,13 @@ extension ViewModifierRegistry {
|
|
|
1850
1850
|
register("symbolEffect") { params, appContext, _ in
|
|
1851
1851
|
return try SymbolEffectModifier(from: params, appContext: appContext)
|
|
1852
1852
|
}
|
|
1853
|
+
|
|
1854
|
+
register("onScrollPhaseChange") { params, appContext, eventDispatcher in
|
|
1855
|
+
return try OnScrollPhaseChangeModifier(from: params, appContext: appContext, eventDispatcher: eventDispatcher)
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
register("onScrollGeometryChange") { params, appContext, eventDispatcher in
|
|
1859
|
+
return try OnScrollGeometryChangeModifier(from: params, appContext: appContext, eventDispatcher: eventDispatcher)
|
|
1860
|
+
}
|
|
1853
1861
|
}
|
|
1854
1862
|
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3c31f1e06290c7a6bd79ca48f3891a26
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
641e106db443c60a45679ceeb012d91ec9a8f92f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
d6ac0beac572ce308b1132edea5636af62174f38717a944fe96c577764fe15d0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
767b2296610e6f8c7a584cc65177bb80da1d6ac06ca34fab03e1ecc261103e45b6ea3cc85df9b91d984dcfa8707392dc9353135245a7b88c25d7416498c9d57b
|
|
Binary file
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.aar.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fc36f9fce95048c28a4acc8b50509b30
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.aar.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
750d3c439cf2196017543dbf4c28e442c895c557
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.aar.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ed094af4f078c995d22d917c31585c648c1183e1da60401608f75e3ad29bf052
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.aar.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b5c54535d0b6873bef37012f7f7e42c19624a7db690cac6b557fa7133c58d7bf2254857248138d5bed3283045f0cbf73312aa4b55842b1d7e550f6a7dc45bad9
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "expo.modules.ui",
|
|
5
5
|
"module": "expo.modules.ui",
|
|
6
|
-
"version": "56.0.
|
|
6
|
+
"version": "56.0.11",
|
|
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-56.0.
|
|
28
|
-
"url": "expo.modules.ui-56.0.
|
|
29
|
-
"size":
|
|
30
|
-
"sha512": "
|
|
31
|
-
"sha256": "
|
|
32
|
-
"sha1": "
|
|
33
|
-
"md5": "
|
|
27
|
+
"name": "expo.modules.ui-56.0.11.aar",
|
|
28
|
+
"url": "expo.modules.ui-56.0.11.aar",
|
|
29
|
+
"size": 1836627,
|
|
30
|
+
"sha512": "b5c54535d0b6873bef37012f7f7e42c19624a7db690cac6b557fa7133c58d7bf2254857248138d5bed3283045f0cbf73312aa4b55842b1d7e550f6a7dc45bad9",
|
|
31
|
+
"sha256": "ed094af4f078c995d22d917c31585c648c1183e1da60401608f75e3ad29bf052",
|
|
32
|
+
"sha1": "750d3c439cf2196017543dbf4c28e442c895c557",
|
|
33
|
+
"md5": "fc36f9fce95048c28a4acc8b50509b30"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
},
|
|
@@ -141,13 +141,13 @@
|
|
|
141
141
|
],
|
|
142
142
|
"files": [
|
|
143
143
|
{
|
|
144
|
-
"name": "expo.modules.ui-56.0.
|
|
145
|
-
"url": "expo.modules.ui-56.0.
|
|
146
|
-
"size":
|
|
147
|
-
"sha512": "
|
|
148
|
-
"sha256": "
|
|
149
|
-
"sha1": "
|
|
150
|
-
"md5": "
|
|
144
|
+
"name": "expo.modules.ui-56.0.11.aar",
|
|
145
|
+
"url": "expo.modules.ui-56.0.11.aar",
|
|
146
|
+
"size": 1836627,
|
|
147
|
+
"sha512": "b5c54535d0b6873bef37012f7f7e42c19624a7db690cac6b557fa7133c58d7bf2254857248138d5bed3283045f0cbf73312aa4b55842b1d7e550f6a7dc45bad9",
|
|
148
|
+
"sha256": "ed094af4f078c995d22d917c31585c648c1183e1da60401608f75e3ad29bf052",
|
|
149
|
+
"sha1": "750d3c439cf2196017543dbf4c28e442c895c557",
|
|
150
|
+
"md5": "fc36f9fce95048c28a4acc8b50509b30"
|
|
151
151
|
}
|
|
152
152
|
]
|
|
153
153
|
},
|
|
@@ -161,13 +161,13 @@
|
|
|
161
161
|
},
|
|
162
162
|
"files": [
|
|
163
163
|
{
|
|
164
|
-
"name": "expo.modules.ui-56.0.
|
|
165
|
-
"url": "expo.modules.ui-56.0.
|
|
166
|
-
"size":
|
|
167
|
-
"sha512": "
|
|
168
|
-
"sha256": "
|
|
169
|
-
"sha1": "
|
|
170
|
-
"md5": "
|
|
164
|
+
"name": "expo.modules.ui-56.0.11-sources.jar",
|
|
165
|
+
"url": "expo.modules.ui-56.0.11-sources.jar",
|
|
166
|
+
"size": 87285,
|
|
167
|
+
"sha512": "767b2296610e6f8c7a584cc65177bb80da1d6ac06ca34fab03e1ecc261103e45b6ea3cc85df9b91d984dcfa8707392dc9353135245a7b88c25d7416498c9d57b",
|
|
168
|
+
"sha256": "d6ac0beac572ce308b1132edea5636af62174f38717a944fe96c577764fe15d0",
|
|
169
|
+
"sha1": "641e106db443c60a45679ceeb012d91ec9a8f92f",
|
|
170
|
+
"md5": "3c31f1e06290c7a6bd79ca48f3891a26"
|
|
171
171
|
}
|
|
172
172
|
]
|
|
173
173
|
}
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.module.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9d04eb342dfecd00aadfdd6cd5ca4624
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.module.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e54da6a8f4c5614b03cf960b765dbc6962e92743
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4237fbd60df02ebfeb492f239f30bd98327eb64c048237d7a78aa2c494bf133f
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0953de9bfce047c8a3f69fcda08b6884bf2c7c1dc74a5537814b3a580a875df612ede15c4873749479241abbb8558d20dd9bfaa04777bba13450bc65d1d99bbc
|
|
@@ -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>56.0.
|
|
12
|
+
<version>56.0.11</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/56.0.11/expo.modules.ui-56.0.11.pom.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
262857ce0a972b0152c232d2feae7f02
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.pom.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5ed08c51f53cfba04ce5414d252a7746999b8a95
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.pom.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3f5a93004533c20ee341ae03df5832ead01eba61329c871bc243831ce3866f5c
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.11/expo.modules.ui-56.0.11.pom.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
51695fff37ba0700e54a64449552bd6fe4118f3e82b7ace9e0e09941a3da29bd90efc8f42c0dbf4a74bad2ecdebe528ebf9ec8eb9311ff844a9874f2e3743b50
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>expo.modules.ui</groupId>
|
|
4
4
|
<artifactId>expo.modules.ui</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>56.0.
|
|
7
|
-
<release>56.0.
|
|
6
|
+
<latest>56.0.11</latest>
|
|
7
|
+
<release>56.0.11</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>56.0.
|
|
9
|
+
<version>56.0.11</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20260521154000</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
0c2096ba9dad6e44877d562572fc348c
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
973942344e0d7f0eec07bad49df8f2b00c47e32d
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
63bb21425d4bd45ba53b359dca1b31170f8809a5a97f56a995c4b272db62de06
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
9ef5563aa7553792ac85cd3695b5b0f9442e89a522276d4143228da43e4552173cfc40e5c01d2d8da7d10f42cf92d52c6a6bcae0f155ac709bee2490caf677d6
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/ui",
|
|
3
|
-
"version": "56.0.
|
|
3
|
+
"version": "56.0.11",
|
|
4
4
|
"description": "A collection of UI components",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.fx.js"
|
|
@@ -55,6 +55,10 @@
|
|
|
55
55
|
"types": "./build/community/menu/index.d.ts",
|
|
56
56
|
"default": "./src/community/menu/index.tsx"
|
|
57
57
|
},
|
|
58
|
+
"./community/pager-view": {
|
|
59
|
+
"types": "./build/community/pager-view/index.d.ts",
|
|
60
|
+
"default": "./src/community/pager-view/index.tsx"
|
|
61
|
+
},
|
|
58
62
|
"./babel-plugin": {
|
|
59
63
|
"types": "./plugin/babel-plugin.d.ts",
|
|
60
64
|
"default": "./plugin/babel-plugin.js"
|
|
@@ -91,7 +95,7 @@
|
|
|
91
95
|
"@types/react": "~19.2.0",
|
|
92
96
|
"react-native-reanimated": "4.3.1",
|
|
93
97
|
"react-native-worklets": "0.8.3",
|
|
94
|
-
"expo": "56.0.
|
|
98
|
+
"expo": "56.0.3",
|
|
95
99
|
"expo-module-scripts": "56.0.2"
|
|
96
100
|
},
|
|
97
101
|
"jest": {
|
|
@@ -120,7 +124,7 @@
|
|
|
120
124
|
"optional": true
|
|
121
125
|
}
|
|
122
126
|
},
|
|
123
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "125e8225bf36a4b9b2a159441d9ea724bcf1110f",
|
|
124
128
|
"scripts": {
|
|
125
129
|
"build": "expo-module build",
|
|
126
130
|
"clean": "expo-module clean",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Side-effect: installs the iOS UI worklet runtime and SharedObject
|
|
2
|
+
// support in the worklet runtime. Routed through this barrel so the
|
|
3
|
+
// installation happens exactly once per the bundler's module cache,
|
|
4
|
+
// regardless of which entry consumers import from.
|
|
5
|
+
import './index.fx';
|
|
6
|
+
|
|
7
|
+
export { useNativeState, type ObservableState } from './useNativeState';
|
|
8
|
+
export { useWorkletProp } from './useWorkletProp';
|
|
9
|
+
export { worklets } from './optionalWorklets';
|
|
10
|
+
export { getStateId } from './utils';
|
|
@@ -71,11 +71,19 @@ type NativeObservableState = {
|
|
|
71
71
|
* Adds a `value` property that delegates to the native `getValue`/`setValue` functions.
|
|
72
72
|
*/
|
|
73
73
|
function defineValueProperty(state: NativeObservableState): void {
|
|
74
|
+
let warnedOnJSWrite = false;
|
|
74
75
|
Object.defineProperty(state, 'value', {
|
|
75
76
|
get() {
|
|
76
77
|
return state.getValue();
|
|
77
78
|
},
|
|
78
79
|
set(v: unknown) {
|
|
80
|
+
if (__DEV__ && !warnedOnJSWrite && worklets && !worklets.isUIRuntime()) {
|
|
81
|
+
warnedOnJSWrite = true;
|
|
82
|
+
console.warn(
|
|
83
|
+
'ObservableState.value was set from the JS thread, the result may be unexpected. ' +
|
|
84
|
+
'Use a worklet to update the state.'
|
|
85
|
+
);
|
|
86
|
+
}
|
|
79
87
|
state.setValue({ value: v });
|
|
80
88
|
},
|
|
81
89
|
});
|