@expo/ui 55.0.1 → 55.0.3
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 +58 -0
- package/CONTRIBUTING.md +30 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/AnimatedVisibilityView.kt +130 -0
- package/android/src/main/java/expo/modules/ui/CardView.kt +138 -34
- package/android/src/main/java/expo/modules/ui/CheckboxView.kt +98 -0
- package/android/src/main/java/expo/modules/ui/ChipView.kt +267 -142
- package/android/src/main/java/expo/modules/ui/DatePickerView.kt +302 -31
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +204 -57
- package/android/src/main/java/expo/modules/ui/HorizontalFloatingToolbarView.kt +21 -8
- package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +149 -40
- package/android/src/main/java/expo/modules/ui/ProgressView.kt +189 -89
- package/android/src/main/java/expo/modules/ui/RNHostView.kt +204 -50
- package/android/src/main/java/expo/modules/ui/RadioButtonView.kt +3 -7
- package/android/src/main/java/expo/modules/ui/SegmentedButtonView.kt +115 -0
- package/android/src/main/java/expo/modules/ui/SegmentedControlView.kt +35 -0
- package/android/src/main/java/expo/modules/ui/SliderView.kt +70 -12
- package/android/src/main/java/expo/modules/ui/SwitchView.kt +62 -104
- package/android/src/main/java/expo/modules/ui/ToggleButtonView.kt +95 -57
- package/android/src/main/java/expo/modules/ui/button/Button.kt +117 -158
- package/android/src/main/java/expo/modules/ui/button/FloatingActionButton.kt +92 -0
- package/android/src/main/java/expo/modules/ui/button/IconButton.kt +73 -80
- package/android/src/main/java/expo/modules/ui/convertibles/AnimatableFloat.kt +26 -0
- package/android/src/main/java/expo/modules/ui/convertibles/AnimationSpecParams.kt +93 -0
- package/android/src/main/java/expo/modules/ui/convertibles/GraphicsLayerParams.kt +24 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenu.kt +39 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuItem.kt +70 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +18 -0
- package/build/jetpack-compose/AnimatedVisibility/index.d.ts +134 -0
- package/build/jetpack-compose/AnimatedVisibility/index.d.ts.map +1 -0
- package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts +3 -0
- package/build/jetpack-compose/AnimatedVisibility/symbols.d.ts.map +1 -0
- package/build/jetpack-compose/Button/index.d.ts +65 -51
- package/build/jetpack-compose/Button/index.d.ts.map +1 -1
- package/build/jetpack-compose/Card/index.d.ts +72 -14
- package/build/jetpack-compose/Card/index.d.ts.map +1 -1
- package/build/jetpack-compose/Checkbox/index.d.ts +73 -0
- package/build/jetpack-compose/Checkbox/index.d.ts.map +1 -0
- package/build/jetpack-compose/Chip/index.d.ts +247 -27
- package/build/jetpack-compose/Chip/index.d.ts.map +1 -1
- package/build/jetpack-compose/DatePicker/index.d.ts +137 -3
- package/build/jetpack-compose/DatePicker/index.d.ts.map +1 -1
- package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts +70 -0
- package/build/jetpack-compose/DropdownMenu/DropdownMenuItem.d.ts.map +1 -0
- package/build/jetpack-compose/DropdownMenu/index.d.ts +68 -0
- package/build/jetpack-compose/DropdownMenu/index.d.ts.map +1 -0
- package/build/jetpack-compose/FloatingActionButton/index.d.ts +150 -0
- package/build/jetpack-compose/FloatingActionButton/index.d.ts.map +1 -0
- package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts +2 -2
- package/build/jetpack-compose/HorizontalFloatingToolbar/index.d.ts.map +1 -1
- package/build/jetpack-compose/IconButton/index.d.ts +45 -29
- package/build/jetpack-compose/IconButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts +17 -0
- package/build/jetpack-compose/MultiChoiceSegmentedButtonRow/index.d.ts.map +1 -0
- package/build/jetpack-compose/Progress/index.d.ts +78 -35
- package/build/jetpack-compose/Progress/index.d.ts.map +1 -1
- package/build/jetpack-compose/RadioButton/index.d.ts +2 -2
- package/build/jetpack-compose/RadioButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/SegmentedButton/index.d.ts +74 -0
- package/build/jetpack-compose/SegmentedButton/index.d.ts.map +1 -0
- package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts +17 -0
- package/build/jetpack-compose/SingleChoiceSegmentedButtonRow/index.d.ts.map +1 -0
- package/build/jetpack-compose/Slider/index.d.ts +34 -10
- package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
- package/build/jetpack-compose/Spacer/index.d.ts +2 -2
- package/build/jetpack-compose/Switch/index.d.ts +25 -47
- package/build/jetpack-compose/Switch/index.d.ts.map +1 -1
- package/build/jetpack-compose/ToggleButton/index.d.ts +60 -32
- package/build/jetpack-compose/ToggleButton/index.d.ts.map +1 -1
- package/build/jetpack-compose/index.d.ts +5 -4
- package/build/jetpack-compose/index.d.ts.map +1 -1
- package/build/jetpack-compose/modifiers/animation.d.ts +44 -0
- package/build/jetpack-compose/modifiers/animation.d.ts.map +1 -0
- package/build/jetpack-compose/modifiers/index.d.ts +68 -4
- package/build/jetpack-compose/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/AccessoryWidgetBackground/index.d.ts +4 -0
- package/build/swift-ui/AccessoryWidgetBackground/index.d.ts.map +1 -0
- package/build/swift-ui/ConfirmationDialog/index.d.ts.map +1 -1
- package/build/swift-ui/ContextMenu/index.d.ts.map +1 -1
- package/build/swift-ui/ControlGroup/index.d.ts +29 -0
- package/build/swift-ui/ControlGroup/index.d.ts.map +1 -0
- package/build/swift-ui/Gauge/index.d.ts.map +1 -1
- package/build/swift-ui/Image/index.d.ts +7 -1
- package/build/swift-ui/Image/index.d.ts.map +1 -1
- package/build/swift-ui/Label/index.d.ts.map +1 -1
- package/build/swift-ui/LabeledContent/index.d.ts.map +1 -1
- package/build/swift-ui/Menu/index.d.ts.map +1 -1
- package/build/swift-ui/Picker/index.d.ts.map +1 -1
- package/build/swift-ui/Popover/index.d.ts.map +1 -1
- package/build/swift-ui/ProgressView/index.d.ts +1 -5
- package/build/swift-ui/ProgressView/index.d.ts.map +1 -1
- package/build/swift-ui/Section/index.d.ts.map +1 -1
- package/build/swift-ui/Slider/index.d.ts.map +1 -1
- package/build/swift-ui/SlotView.d.ts +5 -0
- package/build/swift-ui/SlotView.d.ts.map +1 -0
- package/build/swift-ui/Stepper/index.d.ts +3 -3
- package/build/swift-ui/Stepper/index.d.ts.map +1 -1
- package/build/swift-ui/Text/index.d.ts +33 -1
- package/build/swift-ui/Text/index.d.ts.map +1 -1
- package/build/swift-ui/index.d.ts +2 -0
- package/build/swift-ui/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +54 -1
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/shapes/index.d.ts +2 -2
- package/build/swift-ui/types.d.ts +7 -0
- package/build/swift-ui/types.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/AccessoryWidgetBackgroundView.swift +27 -0
- package/ios/BottomSheetView.swift +1 -6
- package/ios/ClosedRangeDateRecord.swift +10 -0
- package/ios/ColorPickerView.swift +9 -8
- package/ios/ConfirmationDialog/ConfirmationDialog.swift +7 -15
- package/ios/ConfirmationDialog/ConfirmationDialogProps.swift +0 -5
- package/ios/ContextMenu/ContextMenu.swift +27 -22
- package/ios/ContextMenu/ContextMenuRecords.swift +0 -6
- package/ios/ControlGroupView.swift +33 -0
- package/ios/DatePickerView.swift +7 -5
- package/ios/DisclosureGroupView.swift +5 -7
- package/ios/ExpoUIModule.swift +10 -32
- package/ios/GaugeView.swift +4 -26
- package/ios/HostView.swift +1 -2
- package/ios/ImageView.swift +22 -11
- package/ios/Label.swift +2 -17
- package/ios/LabeledContentView.swift +3 -27
- package/ios/ListView.swift +6 -14
- package/ios/Menu/MenuRecords.swift +0 -2
- package/ios/Menu/MenuView.swift +2 -5
- package/ios/Modifiers/DefaultScrollAnchorForRoleModifier.swift +32 -0
- package/ios/Modifiers/DefaultScrollAnchorModifier.swift +16 -0
- package/ios/Modifiers/ResizableModifier.swift +24 -0
- package/ios/Modifiers/Rotation3DEffectModifier.swift +20 -0
- package/ios/Modifiers/View+ModifierArray.swift +29 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +37 -3
- package/ios/Modifiers/WidgetModifiers.swift +46 -0
- package/ios/Picker/PickerView.swift +8 -16
- package/ios/Popover/PopoverProps.swift +0 -4
- package/ios/Popover/PopoverView.swift +5 -11
- package/ios/ProgressView.swift +0 -5
- package/ios/RNHostView.swift +91 -10
- package/ios/SectionView.swift +9 -17
- package/ios/SecureFieldView.swift +0 -1
- package/ios/ShareLink/ShareLinkView.swift +1 -1
- package/ios/SliderView.swift +16 -31
- package/ios/SlotView.swift +38 -0
- package/ios/StepperView.swift +12 -16
- package/ios/TextFieldView.swift +0 -1
- package/ios/TextView.swift +37 -1
- package/ios/Toggle/ToggleView.swift +5 -7
- package/ios/UIBaseView.swift +34 -3
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.1/expo.modules.ui-55.0.1.module → 55.0.3/expo.modules.ui-55.0.3.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{55.0.1/expo.modules.ui-55.0.1.pom → 55.0.3/expo.modules.ui-55.0.3.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.3/expo.modules.ui-55.0.3.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 +5 -2
- package/src/jetpack-compose/AnimatedVisibility/index.tsx +206 -0
- package/src/jetpack-compose/AnimatedVisibility/symbols.ts +8 -0
- package/src/jetpack-compose/Button/index.tsx +69 -92
- package/src/jetpack-compose/Card/index.tsx +105 -29
- package/src/jetpack-compose/Checkbox/index.tsx +126 -0
- package/src/jetpack-compose/Chip/index.tsx +391 -51
- package/src/jetpack-compose/DatePicker/index.tsx +215 -6
- package/src/jetpack-compose/DropdownMenu/DropdownMenuItem.tsx +126 -0
- package/src/jetpack-compose/DropdownMenu/index.tsx +107 -0
- package/src/jetpack-compose/FloatingActionButton/index.tsx +207 -0
- package/src/jetpack-compose/HorizontalFloatingToolbar/index.tsx +4 -2
- package/src/jetpack-compose/IconButton/index.tsx +49 -56
- package/src/jetpack-compose/MultiChoiceSegmentedButtonRow/index.tsx +34 -0
- package/src/jetpack-compose/Progress/index.tsx +120 -62
- package/src/jetpack-compose/RadioButton/index.tsx +8 -9
- package/src/jetpack-compose/SegmentedButton/index.tsx +109 -0
- package/src/jetpack-compose/SingleChoiceSegmentedButtonRow/index.tsx +34 -0
- package/src/jetpack-compose/Slider/index.tsx +76 -29
- package/src/jetpack-compose/Spacer/index.tsx +2 -2
- package/src/jetpack-compose/Switch/index.tsx +32 -84
- package/src/jetpack-compose/ToggleButton/index.tsx +67 -43
- package/src/jetpack-compose/index.ts +5 -4
- package/src/jetpack-compose/modifiers/animation.ts +37 -0
- package/src/jetpack-compose/modifiers/index.ts +86 -6
- package/src/swift-ui/AccessoryWidgetBackground/index.tsx +12 -0
- package/src/swift-ui/ConfirmationDialog/index.tsx +4 -12
- package/src/swift-ui/ContextMenu/index.tsx +6 -20
- package/src/swift-ui/ControlGroup/index.tsx +59 -0
- package/src/swift-ui/Gauge/index.tsx +5 -20
- package/src/swift-ui/Image/index.tsx +7 -1
- package/src/swift-ui/Label/index.tsx +2 -5
- package/src/swift-ui/LabeledContent/index.tsx +3 -12
- package/src/swift-ui/Menu/index.tsx +2 -6
- package/src/swift-ui/Picker/index.tsx +4 -11
- package/src/swift-ui/Popover/index.tsx +3 -12
- package/src/swift-ui/ProgressView/index.tsx +1 -3
- package/src/swift-ui/Section/index.tsx +4 -9
- package/src/swift-ui/Slider/index.tsx +4 -12
- package/src/swift-ui/SlotView.tsx +8 -0
- package/src/swift-ui/Stepper/index.tsx +7 -7
- package/src/swift-ui/Text/index.tsx +66 -2
- package/src/swift-ui/index.tsx +2 -0
- package/src/swift-ui/modifiers/index.ts +87 -1
- package/src/swift-ui/types.ts +5 -0
- package/android/src/main/java/expo/modules/ui/FilterChipView.kt +0 -59
- package/android/src/main/java/expo/modules/ui/PickerView.kt +0 -161
- package/android/src/main/java/expo/modules/ui/TextButtonView.kt +0 -33
- package/android/src/main/java/expo/modules/ui/menu/ContextMenu.kt +0 -183
- package/android/src/main/java/expo/modules/ui/menu/ContextMenuRecords.kt +0 -64
- package/build/jetpack-compose/Button/types.d.ts +0 -5
- package/build/jetpack-compose/Button/types.d.ts.map +0 -1
- package/build/jetpack-compose/ContextMenu/Submenu.d.ts +0 -17
- package/build/jetpack-compose/ContextMenu/Submenu.d.ts.map +0 -1
- package/build/jetpack-compose/ContextMenu/index.d.ts +0 -65
- package/build/jetpack-compose/ContextMenu/index.d.ts.map +0 -1
- package/build/jetpack-compose/ContextMenu/utils.d.ts +0 -24
- package/build/jetpack-compose/ContextMenu/utils.d.ts.map +0 -1
- package/build/jetpack-compose/FilterChip/index.d.ts +0 -49
- package/build/jetpack-compose/FilterChip/index.d.ts.map +0 -1
- package/build/jetpack-compose/Picker/index.d.ts +0 -62
- package/build/jetpack-compose/Picker/index.d.ts.map +0 -1
- package/build/jetpack-compose/TextButton/index.d.ts +0 -29
- package/build/jetpack-compose/TextButton/index.d.ts.map +0 -1
- package/ios/ConfirmationDialog/ConfirmationDialogComponents.swift +0 -26
- package/ios/ContextMenu/ContextMenuComponents.swift +0 -37
- package/ios/Menu/MenuComponents.swift +0 -12
- package/ios/Picker/PickerComponents.swift +0 -24
- package/ios/Popover/PopoverComponents.swift +0 -18
- package/ios/SectionComponents.swift +0 -34
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/55.0.1/expo.modules.ui-55.0.1.pom.sha512 +0 -1
- package/src/jetpack-compose/Button/types.ts +0 -57
- package/src/jetpack-compose/ContextMenu/Submenu.tsx +0 -21
- package/src/jetpack-compose/ContextMenu/index.tsx +0 -149
- package/src/jetpack-compose/ContextMenu/utils.ts +0 -144
- package/src/jetpack-compose/FilterChip/index.tsx +0 -89
- package/src/jetpack-compose/Picker/index.tsx +0 -90
- package/src/jetpack-compose/TextButton/index.tsx +0 -55
|
@@ -780,7 +780,6 @@ internal struct ListRowBackground: ViewModifier, Record {
|
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
782
|
|
|
783
|
-
|
|
784
783
|
internal enum VerticalEdgeOptions: String, Enumerable {
|
|
785
784
|
case all
|
|
786
785
|
case top
|
|
@@ -1106,7 +1105,7 @@ internal enum AxisOptions: String, Enumerable {
|
|
|
1106
1105
|
case horizontal
|
|
1107
1106
|
case vertical
|
|
1108
1107
|
case both
|
|
1109
|
-
|
|
1108
|
+
|
|
1110
1109
|
func toAxis() -> Axis.Set {
|
|
1111
1110
|
switch self {
|
|
1112
1111
|
case .vertical:
|
|
@@ -1307,7 +1306,7 @@ public class ViewModifierRegistry {
|
|
|
1307
1306
|
}
|
|
1308
1307
|
|
|
1309
1308
|
/**
|
|
1310
|
-
|
|
1309
|
+
* Applies Text returning modifiers. Useful for Text concatenation in TextView.
|
|
1311
1310
|
*/
|
|
1312
1311
|
func applyTextModifier(
|
|
1313
1312
|
_ type: String,
|
|
@@ -1353,6 +1352,29 @@ public class ViewModifierRegistry {
|
|
|
1353
1352
|
}
|
|
1354
1353
|
}
|
|
1355
1354
|
|
|
1355
|
+
/**
|
|
1356
|
+
* Applies Image returning modifiers.
|
|
1357
|
+
*/
|
|
1358
|
+
func applyImageModifier(
|
|
1359
|
+
_ type: String,
|
|
1360
|
+
to image: Image,
|
|
1361
|
+
appContext: AppContext,
|
|
1362
|
+
params: [String: Any]
|
|
1363
|
+
) -> Image {
|
|
1364
|
+
switch type {
|
|
1365
|
+
case "resizable":
|
|
1366
|
+
guard let modifier = try? ResizableModifier(from: params, appContext: appContext)
|
|
1367
|
+
else { return image.resizable() }
|
|
1368
|
+
return image.resizable(capInsets: EdgeInsets(top: modifier.top, leading: modifier.leading, bottom: modifier.bottom, trailing: modifier.trailing), resizingMode: modifier.resizingMode.toResizingMode)
|
|
1369
|
+
default:
|
|
1370
|
+
#if DEBUG
|
|
1371
|
+
return image
|
|
1372
|
+
#else
|
|
1373
|
+
return image
|
|
1374
|
+
#endif
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1356
1378
|
/**
|
|
1357
1379
|
* Checks if a modifier type is registered.
|
|
1358
1380
|
*/
|
|
@@ -1500,6 +1522,10 @@ extension ViewModifierRegistry {
|
|
|
1500
1522
|
return try RotationEffectModifier(from: params, appContext: appContext)
|
|
1501
1523
|
}
|
|
1502
1524
|
|
|
1525
|
+
register("rotation3DEffect") { params, appContext, _ in
|
|
1526
|
+
return try Rotation3DEffectModifier(from: params, appContext: appContext)
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1503
1529
|
register("offset") { params, appContext, _ in
|
|
1504
1530
|
return try OffsetModifier(from: params, appContext: appContext)
|
|
1505
1531
|
}
|
|
@@ -1816,6 +1842,14 @@ extension ViewModifierRegistry {
|
|
|
1816
1842
|
return try ScrollDisabledModifier(from: params, appContext: appContext)
|
|
1817
1843
|
}
|
|
1818
1844
|
|
|
1845
|
+
register("defaultScrollAnchor") { params, appContext, _ in
|
|
1846
|
+
return try DefaultScrollAnchorModifier(from: params, appContext: appContext)
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
register("defaultScrollAnchorForRole") { params, appContext, _ in
|
|
1850
|
+
return try DefaultScrollAnchorForRoleModifier(from: params, appContext: appContext)
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1819
1853
|
register("progressViewStyle") { params, appContext, _ in
|
|
1820
1854
|
return try ProgressViewStyleModifier(from: params, appContext: appContext)
|
|
1821
1855
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright 2015-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
import SwiftUI
|
|
5
|
+
#if !os(tvOS)
|
|
6
|
+
import WidgetKit
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
internal enum WidgetAccentedRenderingModeOptions: String, Enumerable {
|
|
10
|
+
case accented
|
|
11
|
+
case desaturated
|
|
12
|
+
case accentedDesaturated
|
|
13
|
+
case fullColor
|
|
14
|
+
|
|
15
|
+
#if !os(tvOS)
|
|
16
|
+
@available(iOS 18.0, *)
|
|
17
|
+
var toWidgetAccentedRenderingMode: WidgetAccentedRenderingMode {
|
|
18
|
+
switch self {
|
|
19
|
+
case .accented: return .accented
|
|
20
|
+
case .accentedDesaturated: return .accentedDesaturated
|
|
21
|
+
case .desaturated: return .desaturated
|
|
22
|
+
case .fullColor: return .fullColor
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
#endif
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* This is a unique modifier that exists only on Image, but returns some View, and for this reason it cannot be a ViewModifier.
|
|
30
|
+
*/
|
|
31
|
+
internal struct WidgetAccentedRenderingModeModifier: Record {
|
|
32
|
+
@Field var renderingMode: WidgetAccentedRenderingModeOptions?
|
|
33
|
+
|
|
34
|
+
@ViewBuilder
|
|
35
|
+
func apply(to image: Image) -> some View {
|
|
36
|
+
#if !os(tvOS)
|
|
37
|
+
if #available(iOS 18.0, *), renderingMode != nil {
|
|
38
|
+
image.widgetAccentedRenderingMode(renderingMode?.toWidgetAccentedRenderingMode)
|
|
39
|
+
} else {
|
|
40
|
+
image
|
|
41
|
+
}
|
|
42
|
+
#else
|
|
43
|
+
image
|
|
44
|
+
#endif
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -12,25 +12,17 @@ internal final class PickerProps: UIBaseViewProps {
|
|
|
12
12
|
|
|
13
13
|
internal struct PickerView: ExpoSwiftUI.View {
|
|
14
14
|
@State var selection: AnyHashable?
|
|
15
|
-
@State var prevSelection: AnyHashable?
|
|
16
15
|
@ObservedObject var props: PickerProps
|
|
17
|
-
|
|
16
|
+
|
|
18
17
|
init(props: PickerProps) {
|
|
19
18
|
self.props = props
|
|
20
|
-
let initialSelection = Self.getHashableFromEither(props.selection)
|
|
21
|
-
_selection = State(initialValue: initialSelection)
|
|
22
|
-
_prevSelection = State(initialValue: initialSelection)
|
|
23
19
|
}
|
|
24
20
|
|
|
25
21
|
@ViewBuilder
|
|
26
22
|
private func makePicker() -> some View {
|
|
27
|
-
let content =
|
|
28
|
-
.compactMap { $0.childView as? PickerContentView }
|
|
29
|
-
.first)
|
|
23
|
+
let content = props.children?.slot("content")
|
|
30
24
|
|
|
31
|
-
let labelContent = props.children
|
|
32
|
-
.compactMap { $0.childView as? PickerLabelView }
|
|
33
|
-
.first
|
|
25
|
+
let labelContent = props.children?.slot("label")
|
|
34
26
|
|
|
35
27
|
if let systemImage = props.systemImage, let label = props.label {
|
|
36
28
|
Picker(label, systemImage: systemImage, selection: $selection) { content }
|
|
@@ -61,11 +53,11 @@ internal struct PickerView: ExpoSwiftUI.View {
|
|
|
61
53
|
}
|
|
62
54
|
props.onSelectionChange(payload)
|
|
63
55
|
}
|
|
64
|
-
.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
.onChange(of: props.selection) { newValue in
|
|
57
|
+
selection = Self.getHashableFromEither(newValue)
|
|
58
|
+
}
|
|
59
|
+
.onAppear {
|
|
60
|
+
selection = Self.getHashableFromEither(props.selection)
|
|
69
61
|
}
|
|
70
62
|
}
|
|
71
63
|
|
|
@@ -8,10 +8,6 @@ internal class PopoverViewProps: UIBaseViewProps {
|
|
|
8
8
|
@Field var arrowEdge: PopoverArrowEdgeOption?
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
internal final class PopoverViewContentPorps: ExpoSwiftUI.ViewProps {}
|
|
12
|
-
|
|
13
|
-
internal final class PopoverViewPopContentPorps: ExpoSwiftUI.ViewProps {}
|
|
14
|
-
|
|
15
11
|
internal enum PopoverAttachmentAnchorOption: String, Enumerable {
|
|
16
12
|
case top
|
|
17
13
|
case center
|
|
@@ -7,11 +7,6 @@ internal struct PopoverView: ExpoSwiftUI.View {
|
|
|
7
7
|
@ObservedObject var props: PopoverViewProps
|
|
8
8
|
@State private var isPresented: Bool = false
|
|
9
9
|
|
|
10
|
-
init(props: PopoverViewProps) {
|
|
11
|
-
self.props = props
|
|
12
|
-
_isPresented = State(initialValue: props.isPresented)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
10
|
var body: some View {
|
|
16
11
|
#if os(tvOS)
|
|
17
12
|
triggerContent
|
|
@@ -40,23 +35,22 @@ internal struct PopoverView: ExpoSwiftUI.View {
|
|
|
40
35
|
.onChange(of: props.isPresented) { newValue in
|
|
41
36
|
isPresented = newValue
|
|
42
37
|
}
|
|
38
|
+
.onAppear {
|
|
39
|
+
isPresented = props.isPresented
|
|
40
|
+
}
|
|
43
41
|
#endif
|
|
44
42
|
}
|
|
45
43
|
|
|
46
44
|
@ViewBuilder
|
|
47
45
|
private var triggerContent: some View {
|
|
48
|
-
if let content = props.children
|
|
49
|
-
.compactMap({ $0.childView as? PopoverViewContent })
|
|
50
|
-
.first {
|
|
46
|
+
if let content = props.children?.slot("trigger") {
|
|
51
47
|
content
|
|
52
48
|
}
|
|
53
49
|
}
|
|
54
50
|
|
|
55
51
|
@ViewBuilder
|
|
56
52
|
private var popoverContent: some View {
|
|
57
|
-
if let content = props.children
|
|
58
|
-
.compactMap({ $0.childView as? PopoverViewPopContent })
|
|
59
|
-
.first {
|
|
53
|
+
if let content = props.children?.slot("popover") {
|
|
60
54
|
content
|
|
61
55
|
}
|
|
62
56
|
}
|
package/ios/ProgressView.swift
CHANGED
|
@@ -3,11 +3,6 @@
|
|
|
3
3
|
import ExpoModulesCore
|
|
4
4
|
import SwiftUI
|
|
5
5
|
|
|
6
|
-
final class ClosedRangeDate: Record {
|
|
7
|
-
@Field var lower: Date?
|
|
8
|
-
@Field var upper: Date?
|
|
9
|
-
}
|
|
10
|
-
|
|
11
6
|
public final class ProgressViewProps: UIBaseViewProps {
|
|
12
7
|
@Field var timerInterval: ClosedRangeDate?
|
|
13
8
|
@Field var countsDown: Bool?
|
package/ios/RNHostView.swift
CHANGED
|
@@ -1,21 +1,102 @@
|
|
|
1
1
|
// Copyright 2015-present 650 Industries. All rights reserved.
|
|
2
2
|
|
|
3
|
+
import SwiftUI
|
|
3
4
|
import ExpoModulesCore
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
internal final class RNHostViewProps: ExpoSwiftUI.ViewProps {
|
|
7
|
+
@Field var matchContents: Bool = false
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
struct RNHostView: ExpoSwiftUI.View {
|
|
11
|
+
|
|
12
|
+
@ObservedObject var props: RNHostViewProps
|
|
13
|
+
|
|
14
|
+
var body: some View {
|
|
15
|
+
if props.matchContents, let childUIView = firstChildUIView {
|
|
16
|
+
ApplySizeFromYogaNode(childUIView: childUIView) {
|
|
17
|
+
Children()
|
|
18
|
+
}
|
|
19
|
+
.onAppear {
|
|
20
|
+
ExpoUITouchHandlerHelper.createAndAttachTouchHandler(for: childUIView)
|
|
21
|
+
}
|
|
22
|
+
} else {
|
|
23
|
+
Children()
|
|
24
|
+
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
25
|
+
.modifier(ReportSizeToYogaNodeModifier(shadowNodeProxy: props.shadowNodeProxy))
|
|
26
|
+
.onAppear {
|
|
27
|
+
if let view = firstChildUIView {
|
|
28
|
+
ExpoUITouchHandlerHelper.createAndAttachTouchHandler(for: view)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
private var firstChildUIView: UIView? {
|
|
35
|
+
props.children?.first?.uiView
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Sets SwiftUI view size from Yoga node size
|
|
40
|
+
// Listens to Yoga node size changes and updates the SwiftUI view size
|
|
41
|
+
private struct ApplySizeFromYogaNode<Content: SwiftUI.View>: SwiftUI.View {
|
|
42
|
+
@StateObject private var observer: Observer
|
|
43
|
+
let content: Content
|
|
44
|
+
|
|
45
|
+
init(childUIView: UIView, @ViewBuilder content: () -> Content) {
|
|
46
|
+
_observer = StateObject(wrappedValue: Observer(view: childUIView))
|
|
47
|
+
self.content = content()
|
|
9
48
|
}
|
|
10
49
|
|
|
11
|
-
|
|
50
|
+
var body: some SwiftUI.View {
|
|
51
|
+
content
|
|
52
|
+
.frame(width: observer.size.width, height: observer.size.height)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@MainActor
|
|
56
|
+
fileprivate class Observer: ObservableObject {
|
|
57
|
+
@Published var size: CGSize
|
|
58
|
+
private var kvoToken: NSKeyValueObservation?
|
|
59
|
+
|
|
60
|
+
init(view: UIView) {
|
|
61
|
+
self.size = view.bounds.size
|
|
62
|
+
kvoToken = view.observe(\.bounds) { [weak self] view, _ in
|
|
63
|
+
MainActor.assumeIsolated {
|
|
64
|
+
self?.size = view.bounds.size
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
deinit {
|
|
70
|
+
kvoToken?.invalidate()
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Sets Yoga node size from SwiftUI view size
|
|
76
|
+
// Listens to SwiftUI view size changes and updates the Yoga node size
|
|
77
|
+
private struct ReportSizeToYogaNodeModifier: ViewModifier {
|
|
78
|
+
let shadowNodeProxy: ExpoSwiftUI.ShadowNodeProxy
|
|
79
|
+
|
|
80
|
+
private func handleSizeChange(_ size: CGSize) {
|
|
81
|
+
shadowNodeProxy.setViewSize?(size)
|
|
82
|
+
}
|
|
12
83
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
84
|
+
func body(content: Content) -> some View {
|
|
85
|
+
if #available(iOS 16.0, tvOS 16.0, macOS 13.0, *) {
|
|
86
|
+
content.onGeometryChange(for: CGSize.self, of: { proxy in proxy.size }) { size in
|
|
87
|
+
handleSizeChange(size)
|
|
88
|
+
}
|
|
17
89
|
} else {
|
|
18
|
-
|
|
90
|
+
content.overlay {
|
|
91
|
+
GeometryReader { geometry in
|
|
92
|
+
Color.clear
|
|
93
|
+
.hidden()
|
|
94
|
+
.onAppear {
|
|
95
|
+
handleSizeChange(geometry.size)
|
|
96
|
+
}
|
|
97
|
+
.onChange(of: geometry.size) { handleSizeChange($0) }
|
|
98
|
+
}
|
|
99
|
+
}
|
|
19
100
|
}
|
|
20
101
|
}
|
|
21
102
|
}
|
package/ios/SectionView.swift
CHANGED
|
@@ -13,14 +13,12 @@ internal struct SectionView: ExpoSwiftUI.View {
|
|
|
13
13
|
@ObservedObject var props: SectionProps
|
|
14
14
|
@State private var isExpanded: Bool = true
|
|
15
15
|
|
|
16
|
-
init(props: SectionProps) {
|
|
17
|
-
self.props = props
|
|
18
|
-
_isExpanded = State(initialValue: props.isExpanded ?? true)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
16
|
var body: some View {
|
|
22
17
|
if #available(iOS 17.0, macOS 14.0, tvOS 17.0, *), let propIsExpanded = props.isExpanded {
|
|
23
18
|
collapsibleSection
|
|
19
|
+
.onAppear {
|
|
20
|
+
isExpanded = props.isExpanded ?? true
|
|
21
|
+
}
|
|
24
22
|
.onChange(of: props.isExpanded) { newValue in
|
|
25
23
|
if let newValue {
|
|
26
24
|
isExpanded = newValue
|
|
@@ -95,21 +93,15 @@ internal struct SectionView: ExpoSwiftUI.View {
|
|
|
95
93
|
}
|
|
96
94
|
}
|
|
97
95
|
|
|
98
|
-
private var contentChildren:
|
|
99
|
-
props.children
|
|
100
|
-
.compactMap({ $0.childView as? SectionContent })
|
|
101
|
-
.first
|
|
96
|
+
private var contentChildren: SlotView? {
|
|
97
|
+
props.children?.slot("content")
|
|
102
98
|
}
|
|
103
99
|
|
|
104
|
-
private var headerView:
|
|
105
|
-
props.children
|
|
106
|
-
.compactMap({ $0.childView as? SectionHeader })
|
|
107
|
-
.first
|
|
100
|
+
private var headerView: SlotView? {
|
|
101
|
+
props.children?.slot("header")
|
|
108
102
|
}
|
|
109
103
|
|
|
110
|
-
private var footerView:
|
|
111
|
-
props.children
|
|
112
|
-
.compactMap({ $0.childView as? SectionFooter })
|
|
113
|
-
.first
|
|
104
|
+
private var footerView: SlotView? {
|
|
105
|
+
props.children?.slot("footer")
|
|
114
106
|
}
|
|
115
107
|
}
|
package/ios/SliderView.swift
CHANGED
|
@@ -6,15 +6,22 @@ import ExpoModulesCore
|
|
|
6
6
|
struct SliderView: ExpoSwiftUI.View {
|
|
7
7
|
@ObservedObject var props: SliderProps
|
|
8
8
|
@State var value: Float = 0.0
|
|
9
|
-
|
|
9
|
+
@State var isEditing: Bool = false
|
|
10
|
+
|
|
10
11
|
init(props: SliderProps) {
|
|
11
12
|
self.props = props
|
|
12
|
-
_value = State(initialValue: props.value ?? 0.0)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
var body: some View {
|
|
16
16
|
#if !os(tvOS)
|
|
17
17
|
sliderContent
|
|
18
|
+
.onAppear {
|
|
19
|
+
value = props.value ?? 0.0
|
|
20
|
+
}
|
|
21
|
+
.onChange(of: props.value) { newValue in
|
|
22
|
+
guard !isEditing else { return }
|
|
23
|
+
value = newValue ?? 0.0
|
|
24
|
+
}
|
|
18
25
|
.onChange(of: value) { newValue in
|
|
19
26
|
if props.value != newValue {
|
|
20
27
|
props.onValueChanged([
|
|
@@ -22,10 +29,6 @@ struct SliderView: ExpoSwiftUI.View {
|
|
|
22
29
|
])
|
|
23
30
|
}
|
|
24
31
|
}
|
|
25
|
-
.onReceive(props.value.publisher, perform: { newValue in
|
|
26
|
-
var sliderValue = newValue
|
|
27
|
-
value = sliderValue
|
|
28
|
-
})
|
|
29
32
|
#else
|
|
30
33
|
Text("Slider is not supported on tvOS")
|
|
31
34
|
#endif
|
|
@@ -34,14 +37,9 @@ struct SliderView: ExpoSwiftUI.View {
|
|
|
34
37
|
#if !os(tvOS)
|
|
35
38
|
@ViewBuilder
|
|
36
39
|
private var sliderContent: some View {
|
|
37
|
-
let label = props.children?.
|
|
38
|
-
|
|
39
|
-
let
|
|
40
|
-
.compactMap({ $0.childView as? SliderLabelView })
|
|
41
|
-
.first(where: { $0.props.kind == .minimum })
|
|
42
|
-
let maximumValueLabel = props.children?
|
|
43
|
-
.compactMap({ $0.childView as? SliderLabelView })
|
|
44
|
-
.first(where: { $0.props.kind == .maximum })
|
|
40
|
+
let label = props.children?.slot("label")
|
|
41
|
+
let minimumValueLabel = props.children?.slot("minimum")
|
|
42
|
+
let maximumValueLabel = props.children?.slot("maximum")
|
|
45
43
|
|
|
46
44
|
if let min = props.min, let max = props.max, let step = props.step {
|
|
47
45
|
Slider(
|
|
@@ -52,6 +50,7 @@ struct SliderView: ExpoSwiftUI.View {
|
|
|
52
50
|
minimumValueLabel: { minimumValueLabel },
|
|
53
51
|
maximumValueLabel: { maximumValueLabel }
|
|
54
52
|
) { isEditing in
|
|
53
|
+
self.isEditing = isEditing
|
|
55
54
|
props.onEditingChanged(["isEditing": isEditing])
|
|
56
55
|
}
|
|
57
56
|
} else if let min = props.min, let max = props.max {
|
|
@@ -62,6 +61,7 @@ struct SliderView: ExpoSwiftUI.View {
|
|
|
62
61
|
minimumValueLabel: { minimumValueLabel },
|
|
63
62
|
maximumValueLabel: { maximumValueLabel }
|
|
64
63
|
) { isEditing in
|
|
64
|
+
self.isEditing = isEditing
|
|
65
65
|
props.onEditingChanged(["isEditing": isEditing])
|
|
66
66
|
}
|
|
67
67
|
} else if let step = props.step {
|
|
@@ -73,6 +73,7 @@ struct SliderView: ExpoSwiftUI.View {
|
|
|
73
73
|
minimumValueLabel: { minimumValueLabel },
|
|
74
74
|
maximumValueLabel: { maximumValueLabel }
|
|
75
75
|
) { isEditing in
|
|
76
|
+
self.isEditing = isEditing
|
|
76
77
|
props.onEditingChanged(["isEditing": isEditing])
|
|
77
78
|
}
|
|
78
79
|
} else {
|
|
@@ -82,6 +83,7 @@ struct SliderView: ExpoSwiftUI.View {
|
|
|
82
83
|
minimumValueLabel: { minimumValueLabel },
|
|
83
84
|
maximumValueLabel: { maximumValueLabel }
|
|
84
85
|
) { isEditing in
|
|
86
|
+
self.isEditing = isEditing
|
|
85
87
|
props.onEditingChanged(["isEditing": isEditing])
|
|
86
88
|
}
|
|
87
89
|
}
|
|
@@ -98,20 +100,3 @@ final class SliderProps: UIBaseViewProps {
|
|
|
98
100
|
var onEditingChanged = EventDispatcher()
|
|
99
101
|
}
|
|
100
102
|
|
|
101
|
-
internal enum SliderLabelKind: String, Enumerable {
|
|
102
|
-
case label
|
|
103
|
-
case minimum
|
|
104
|
-
case maximum
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
internal final class SliderLabelProps: ExpoSwiftUI.ViewProps {
|
|
108
|
-
@Field var kind: SliderLabelKind = .minimum
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
internal struct SliderLabelView: ExpoSwiftUI.View {
|
|
112
|
-
@ObservedObject var props: SliderLabelProps
|
|
113
|
-
|
|
114
|
-
var body: some View {
|
|
115
|
-
Children()
|
|
116
|
-
}
|
|
117
|
-
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright 2025-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import SwiftUI
|
|
4
|
+
import ExpoModulesCore
|
|
5
|
+
|
|
6
|
+
internal final class SlotViewProps: ExpoSwiftUI.ViewProps {
|
|
7
|
+
@Field var name: String = ""
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
internal struct SlotView: ExpoSwiftUI.View {
|
|
11
|
+
@ObservedObject var props: SlotViewProps
|
|
12
|
+
|
|
13
|
+
init(props: SlotViewProps) {
|
|
14
|
+
self.props = props
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var body: some View {
|
|
18
|
+
Children()
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
extension [any ExpoSwiftUI.AnyChild] {
|
|
23
|
+
func slot(_ name: String) -> SlotView? {
|
|
24
|
+
compactMap { $0.childView as? SlotView }
|
|
25
|
+
.first { $0.props.name == name }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
func withoutSlot(_ name: String) -> [any ExpoSwiftUI.AnyChild] {
|
|
29
|
+
filter {
|
|
30
|
+
guard let slot = $0.childView as? SlotView else { return true }
|
|
31
|
+
return slot.props.name != name
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
func withoutSlots() -> [any ExpoSwiftUI.AnyChild] {
|
|
36
|
+
filter { !($0.childView is SlotView) }
|
|
37
|
+
}
|
|
38
|
+
}
|
package/ios/StepperView.swift
CHANGED
|
@@ -5,37 +5,33 @@ import ExpoModulesCore
|
|
|
5
5
|
|
|
6
6
|
final class StepperProps: UIBaseViewProps {
|
|
7
7
|
@Field var label: String
|
|
8
|
-
@Field var
|
|
8
|
+
@Field var value: Int = 0
|
|
9
9
|
@Field var min: Int = 0
|
|
10
10
|
@Field var max: Int = 100
|
|
11
11
|
@Field var step: Int = 1
|
|
12
|
-
var
|
|
12
|
+
var onValueChange = EventDispatcher()
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
struct StepperView: ExpoSwiftUI.View {
|
|
16
16
|
@ObservedObject var props: StepperProps
|
|
17
|
-
@State var value: Int
|
|
18
|
-
|
|
17
|
+
@State var value: Int = 0
|
|
18
|
+
|
|
19
19
|
init(props: StepperProps) {
|
|
20
20
|
self.props = props
|
|
21
|
-
let initialValue = props.defaultValue ?? 0
|
|
22
|
-
let clampedValue = max(props.min, min(props.max, initialValue))
|
|
23
|
-
self._value = State(initialValue: clampedValue)
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
var body: some View {
|
|
27
24
|
#if !os(tvOS)
|
|
28
25
|
Stepper(props.label, value: $value, in: props.min...props.max, step: props.step)
|
|
29
|
-
.onChange(of: value, perform: { newValue in
|
|
30
|
-
props.onValueChanged(([
|
|
31
|
-
"value": Int(newValue)
|
|
32
|
-
]))
|
|
33
|
-
})
|
|
34
26
|
.onAppear {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
value = max(props.min, min(props.max, props.value))
|
|
28
|
+
}
|
|
29
|
+
.onChange(of: props.value) { newValue in
|
|
30
|
+
value = max(props.min, min(props.max, newValue))
|
|
31
|
+
}
|
|
32
|
+
.onChange(of: value) { newValue in
|
|
33
|
+
if props.value != newValue {
|
|
34
|
+
props.onValueChange(["value": Int(newValue)])
|
|
39
35
|
}
|
|
40
36
|
}
|
|
41
37
|
#else
|
package/ios/TextFieldView.swift
CHANGED
|
@@ -161,7 +161,6 @@ struct TextFieldView: ExpoSwiftUI.View, ExpoSwiftUI.FocusableView {
|
|
|
161
161
|
)
|
|
162
162
|
}
|
|
163
163
|
return text.lineLimit((props.multiline && allowMultiLine()) ? props.numberOfLines : 1)
|
|
164
|
-
.modifier(UIBaseViewModifier(props: props))
|
|
165
164
|
.fixedSize(horizontal: false, vertical: true)
|
|
166
165
|
.keyboardType(getKeyboardType(props.keyboardType))
|
|
167
166
|
.autocorrectionDisabled(!props.autocorrection)
|
package/ios/TextView.swift
CHANGED
|
@@ -3,9 +3,28 @@
|
|
|
3
3
|
import SwiftUI
|
|
4
4
|
import ExpoModulesCore
|
|
5
5
|
|
|
6
|
+
public enum TextDateStyle: String, Enumerable {
|
|
7
|
+
case timer, relative, offset, date, time
|
|
8
|
+
|
|
9
|
+
func toSwiftUI() -> SwiftUI.Text.DateStyle {
|
|
10
|
+
switch self {
|
|
11
|
+
case .timer: return .timer
|
|
12
|
+
case .relative: return .relative
|
|
13
|
+
case .offset: return .offset
|
|
14
|
+
case .date: return .date
|
|
15
|
+
case .time: return .time
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
6
20
|
public final class TextViewProps: UIBaseViewProps {
|
|
7
21
|
@Field public var text: String = ""
|
|
8
22
|
@Field public var markdownEnabled: Bool = false
|
|
23
|
+
@Field public var date: Date?
|
|
24
|
+
@Field public var dateStyle: TextDateStyle?
|
|
25
|
+
@Field public var timerInterval: ClosedRangeDate?
|
|
26
|
+
@Field public var countsDown: Bool?
|
|
27
|
+
@Field public var pauseTime: Date?
|
|
9
28
|
|
|
10
29
|
// Override default frame alignment for text views
|
|
11
30
|
override var defaultFrameAlignment: Alignment { .leading }
|
|
@@ -24,7 +43,24 @@ public struct TextView: ExpoSwiftUI.View {
|
|
|
24
43
|
}
|
|
25
44
|
|
|
26
45
|
internal func buildText(applyModifiers: Bool = true) -> Text {
|
|
27
|
-
let text
|
|
46
|
+
let text: Text
|
|
47
|
+
|
|
48
|
+
if #available(iOS 16.0, tvOS 16.0, *),
|
|
49
|
+
let timerInterval = props.timerInterval,
|
|
50
|
+
let lower = timerInterval.lower,
|
|
51
|
+
let upper = timerInterval.upper,
|
|
52
|
+
lower <= upper {
|
|
53
|
+
text = Text(
|
|
54
|
+
timerInterval: ClosedRange(uncheckedBounds: (lower: lower, upper: upper)),
|
|
55
|
+
pauseTime: props.pauseTime,
|
|
56
|
+
countsDown: props.countsDown ?? true
|
|
57
|
+
)
|
|
58
|
+
} else if let date = props.date {
|
|
59
|
+
text = Text(date, style: props.dateStyle?.toSwiftUI() ?? .date)
|
|
60
|
+
} else {
|
|
61
|
+
text = props.markdownEnabled ? Text(LocalizedStringKey(props.text)) : Text(props.text)
|
|
62
|
+
}
|
|
63
|
+
|
|
28
64
|
var result = applyModifiers
|
|
29
65
|
? text.applyTextModifiers(props.modifiers, appContext: props.appContext)
|
|
30
66
|
: text
|