@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
|
@@ -21,33 +21,38 @@ struct ContextMenuWithPreview<ActivationElement: View, Preview: View, MenuConten
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
struct
|
|
25
|
-
|
|
24
|
+
internal struct LongPressContextMenu<ActivationElement: View, MenuContent: View>: View {
|
|
25
|
+
let activationElement: ActivationElement
|
|
26
|
+
let menuContent: MenuContent
|
|
26
27
|
|
|
27
28
|
var body: some View {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
activationElement.contextMenu(menuItems: {
|
|
30
|
+
menuContent
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
}
|
|
31
34
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
.first) ?? ContextMenuContent(props: ContextMenuContentProps())
|
|
35
|
+
struct ContextMenu: ExpoSwiftUI.View {
|
|
36
|
+
@ObservedObject var props: ContextMenuProps
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
var body: some View {
|
|
39
|
+
let activationElement = props.children?.slot("trigger")
|
|
40
|
+
let menuContent = props.children?.slot("items")
|
|
41
|
+
let preview = props.children?.slot("preview")
|
|
39
42
|
|
|
40
|
-
if let
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
if let activationElement {
|
|
44
|
+
if let preview {
|
|
45
|
+
ContextMenuWithPreview(
|
|
46
|
+
activationElement: activationElement,
|
|
47
|
+
preview: preview,
|
|
48
|
+
menuContent: menuContent
|
|
49
|
+
)
|
|
50
|
+
} else {
|
|
51
|
+
LongPressContextMenu(
|
|
52
|
+
activationElement: activationElement,
|
|
53
|
+
menuContent: menuContent
|
|
54
|
+
)
|
|
55
|
+
}
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
58
|
}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import ExpoModulesCore
|
|
2
2
|
|
|
3
3
|
internal final class ContextMenuProps: UIBaseViewProps {}
|
|
4
|
-
|
|
5
|
-
internal final class ContextMenuPreviewProps: ExpoSwiftUI.ViewProps {}
|
|
6
|
-
|
|
7
|
-
internal final class ContextMenuActivationElementProps: ExpoSwiftUI.ViewProps {}
|
|
8
|
-
|
|
9
|
-
internal final class ContextMenuContentProps: ExpoSwiftUI.ViewProps {}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright 2025-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import SwiftUI
|
|
4
|
+
import ExpoModulesCore
|
|
5
|
+
|
|
6
|
+
internal final class ControlGroupViewProps: UIBaseViewProps {
|
|
7
|
+
@Field var label: String?
|
|
8
|
+
@Field var systemImage: String?
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
internal struct ControlGroupView: ExpoSwiftUI.View {
|
|
12
|
+
@ObservedObject var props: ControlGroupViewProps
|
|
13
|
+
|
|
14
|
+
var body: some View {
|
|
15
|
+
if #available(iOS 15.0, macOS 12.0, tvOS 17.0, *) {
|
|
16
|
+
if #available(iOS 16.0, macOS 13.0, tvOS 17.0, *) {
|
|
17
|
+
let labelContent = props.children?.slot("label")
|
|
18
|
+
|
|
19
|
+
if let systemImage = props.systemImage, let label = props.label {
|
|
20
|
+
ControlGroup(label, systemImage: systemImage) { Children() }
|
|
21
|
+
} else if let labelContent {
|
|
22
|
+
ControlGroup { Children() } label: { labelContent }
|
|
23
|
+
} else if let label = props.label {
|
|
24
|
+
ControlGroup(label) { Children() }
|
|
25
|
+
} else {
|
|
26
|
+
ControlGroup { Children() }
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
ControlGroup { Children() }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
package/ios/DatePickerView.swift
CHANGED
|
@@ -5,19 +5,21 @@ internal struct DatePickerView: ExpoSwiftUI.View {
|
|
|
5
5
|
@ObservedObject var props: DatePickerProps
|
|
6
6
|
@State private var date = Date()
|
|
7
7
|
|
|
8
|
-
init(props: DatePickerProps) {
|
|
9
|
-
self.props = props
|
|
10
|
-
_date = State(initialValue: props.selection ?? Date())
|
|
11
|
-
}
|
|
12
|
-
|
|
13
8
|
var body: some View {
|
|
14
9
|
#if os(tvOS)
|
|
15
10
|
Text("DatePicker is not supported on tvOS")
|
|
16
11
|
#else
|
|
17
12
|
createDatePicker()
|
|
18
13
|
.onChange(of: date) { newDate in
|
|
14
|
+
if props.selection == newDate { return }
|
|
19
15
|
props.onDateChange(["date": newDate.timeIntervalSince1970 * 1000])
|
|
20
16
|
}
|
|
17
|
+
.onChange(of: props.selection) { newValue in
|
|
18
|
+
date = newValue ?? Date()
|
|
19
|
+
}
|
|
20
|
+
.onAppear {
|
|
21
|
+
date = props.selection ?? Date()
|
|
22
|
+
}
|
|
21
23
|
.if(props.title == nil && !hasChildren) { $0.labelsHidden() }
|
|
22
24
|
#endif
|
|
23
25
|
}
|
|
@@ -13,11 +13,6 @@ internal struct DisclosureGroupView: ExpoSwiftUI.View {
|
|
|
13
13
|
@ObservedObject var props: DisclosureGroupViewProps
|
|
14
14
|
@State private var isExpanded: Bool = false
|
|
15
15
|
|
|
16
|
-
init(props: DisclosureGroupViewProps) {
|
|
17
|
-
self.props = props
|
|
18
|
-
_isExpanded = State(initialValue: props.isExpanded)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
16
|
var body: some View {
|
|
22
17
|
#if os(tvOS)
|
|
23
18
|
Text("DisclosureGroupView is not supported on tvOS")
|
|
@@ -26,12 +21,15 @@ internal struct DisclosureGroupView: ExpoSwiftUI.View {
|
|
|
26
21
|
Children()
|
|
27
22
|
}
|
|
28
23
|
.onChange(of: isExpanded) { newValue in
|
|
29
|
-
|
|
30
|
-
props.onIsExpandedChange(
|
|
24
|
+
if newValue == props.isExpanded { return }
|
|
25
|
+
props.onIsExpandedChange(["isExpanded": newValue])
|
|
31
26
|
}
|
|
32
27
|
.onChange(of: props.isExpanded) { newValue in
|
|
33
28
|
isExpanded = newValue
|
|
34
29
|
}
|
|
30
|
+
.onAppear {
|
|
31
|
+
isExpanded = props.isExpanded
|
|
32
|
+
}
|
|
35
33
|
#endif
|
|
36
34
|
}
|
|
37
35
|
}
|
package/ios/ExpoUIModule.swift
CHANGED
|
@@ -6,11 +6,7 @@ public final class ExpoUIModule: Module {
|
|
|
6
6
|
public func definition() -> ModuleDefinition {
|
|
7
7
|
Name("ExpoUI")
|
|
8
8
|
|
|
9
|
-
View(RNHostView.self)
|
|
10
|
-
Prop("matchContents") { (view, matchContents: Bool) in
|
|
11
|
-
view.matchContents = matchContents
|
|
12
|
-
}
|
|
13
|
-
}
|
|
9
|
+
View(RNHostView.self)
|
|
14
10
|
|
|
15
11
|
OnDestroy {
|
|
16
12
|
Task { @MainActor in
|
|
@@ -24,9 +20,9 @@ public final class ExpoUIModule: Module {
|
|
|
24
20
|
RefreshableManager.shared.completeRefresh(id: id)
|
|
25
21
|
}
|
|
26
22
|
|
|
27
|
-
// MARK: - Views with AsyncFunctions
|
|
23
|
+
// MARK: - Expo UI Views with AsyncFunctions
|
|
28
24
|
|
|
29
|
-
|
|
25
|
+
ExpoUIView(SecureFieldView.self) {
|
|
30
26
|
AsyncFunction("setText") { (view: SecureFieldView, text: String) in
|
|
31
27
|
view.setText(text)
|
|
32
28
|
}
|
|
@@ -37,7 +33,7 @@ public final class ExpoUIModule: Module {
|
|
|
37
33
|
view.focus()
|
|
38
34
|
}
|
|
39
35
|
}
|
|
40
|
-
|
|
36
|
+
ExpoUIView(TextFieldView.self) {
|
|
41
37
|
AsyncFunction("setText") { (view: TextFieldView, text: String) in
|
|
42
38
|
view.setText(text)
|
|
43
39
|
}
|
|
@@ -51,7 +47,7 @@ public final class ExpoUIModule: Module {
|
|
|
51
47
|
view.setSelection(start: start, end: end)
|
|
52
48
|
}
|
|
53
49
|
}
|
|
54
|
-
|
|
50
|
+
ExpoUIView(ShareLinkView.self) {
|
|
55
51
|
AsyncFunction("setItem") { (view: ShareLinkView, url: String?) in
|
|
56
52
|
guard let url, let validURL = URL(string: url) else {
|
|
57
53
|
view.rejectContinuation()
|
|
@@ -63,22 +59,9 @@ public final class ExpoUIModule: Module {
|
|
|
63
59
|
|
|
64
60
|
// MARK: - Views don't support common view modifiers
|
|
65
61
|
|
|
66
|
-
View(
|
|
67
|
-
View(ContextMenuPreview.self)
|
|
68
|
-
View(ContextMenuContent.self)
|
|
69
|
-
View(ConfirmationDialogTrigger.self)
|
|
70
|
-
View(ConfirmationDialogActions.self)
|
|
71
|
-
View(ConfirmationDialogMessage.self)
|
|
62
|
+
View(SlotView.self)
|
|
72
63
|
View(NamespaceView.self)
|
|
73
|
-
View(PopoverViewContent.self)
|
|
74
|
-
View(PopoverViewPopContent.self)
|
|
75
|
-
View(SectionContent.self)
|
|
76
|
-
View(SectionHeader.self)
|
|
77
|
-
View(SectionFooter.self)
|
|
78
64
|
View(GridRowView.self)
|
|
79
|
-
View(LabeledContentLabel.self)
|
|
80
|
-
View(LabeledContentContent.self)
|
|
81
|
-
View(LabelIcon.self)
|
|
82
65
|
View(HostView.self)
|
|
83
66
|
View(TextView.self)
|
|
84
67
|
|
|
@@ -93,14 +76,13 @@ public final class ExpoUIModule: Module {
|
|
|
93
76
|
ExpoUIView(ExpoUI.ContentUnavailableView.self)
|
|
94
77
|
ExpoUIView(ConfirmationDialogView.self)
|
|
95
78
|
ExpoUIView(ExpoUI.ContextMenu.self)
|
|
96
|
-
|
|
97
|
-
|
|
79
|
+
|
|
80
|
+
ExpoUIView(ControlGroupView.self)
|
|
81
|
+
|
|
98
82
|
ExpoUIView(MenuView.self)
|
|
99
|
-
View(MenuLabel.self)
|
|
100
83
|
|
|
101
84
|
ExpoUIView(FormView.self)
|
|
102
85
|
ExpoUIView(GaugeView.self)
|
|
103
|
-
View(GaugeLabelView.self)
|
|
104
86
|
ExpoUIView(GroupView.self)
|
|
105
87
|
ExpoUIView(HStackView.self)
|
|
106
88
|
ExpoUIView(ImageView.self)
|
|
@@ -108,17 +90,12 @@ public final class ExpoUIModule: Module {
|
|
|
108
90
|
ExpoUIView(ListView.self)
|
|
109
91
|
ExpoUIView(ListForEachView.self)
|
|
110
92
|
|
|
111
|
-
// Picker
|
|
112
93
|
ExpoUIView(PickerView.self)
|
|
113
|
-
View(PickerContentView.self)
|
|
114
|
-
View(PickerLabelView.self)
|
|
115
94
|
|
|
116
95
|
ExpoUIView(ExpoUI.ProgressView.self)
|
|
117
96
|
ExpoUIView(SectionView.self)
|
|
118
97
|
|
|
119
|
-
// Slider
|
|
120
98
|
ExpoUIView(SliderView.self)
|
|
121
|
-
View(SliderLabelView.self)
|
|
122
99
|
|
|
123
100
|
ExpoUIView(SpacerView.self)
|
|
124
101
|
ExpoUIView(StepperView.self)
|
|
@@ -138,5 +115,6 @@ public final class ExpoUIModule: Module {
|
|
|
138
115
|
ExpoUIView(DividerView.self)
|
|
139
116
|
ExpoUIView(PopoverView.self)
|
|
140
117
|
ExpoUIView(GridView.self)
|
|
118
|
+
ExpoUIView(AccessoryWidgetBackgroundView.self)
|
|
141
119
|
}
|
|
142
120
|
}
|
package/ios/GaugeView.swift
CHANGED
|
@@ -31,14 +31,10 @@ public struct GaugeView: ExpoSwiftUI.View {
|
|
|
31
31
|
@ViewBuilder
|
|
32
32
|
private var gaugeContent: some View {
|
|
33
33
|
let range = (props.min ?? 0.0)...(props.max ?? 1.0)
|
|
34
|
-
let label = props.children?.
|
|
35
|
-
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
let minimumValueLabel = props.children?.compactMap { $0.childView as? GaugeLabelView }
|
|
39
|
-
.first { $0.props.kind == .minimumValue }
|
|
40
|
-
let maximumValueLabel = props.children?.compactMap { $0.childView as? GaugeLabelView }
|
|
41
|
-
.first { $0.props.kind == .maximumValue }
|
|
34
|
+
let label = props.children?.slot("label")
|
|
35
|
+
let currentValueLabel = props.children?.slot("currentValue")
|
|
36
|
+
let minimumValueLabel = props.children?.slot("minimumValue")
|
|
37
|
+
let maximumValueLabel = props.children?.slot("maximumValue")
|
|
42
38
|
|
|
43
39
|
Gauge(value: props.value, in: range) {
|
|
44
40
|
label
|
|
@@ -53,21 +49,3 @@ public struct GaugeView: ExpoSwiftUI.View {
|
|
|
53
49
|
#endif
|
|
54
50
|
}
|
|
55
51
|
|
|
56
|
-
internal enum GaugeLabelKind: String, Enumerable {
|
|
57
|
-
case label
|
|
58
|
-
case currentValue
|
|
59
|
-
case minimumValue
|
|
60
|
-
case maximumValue
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
internal final class GaugeLabelProps: ExpoSwiftUI.ViewProps {
|
|
64
|
-
@Field var kind: GaugeLabelKind = .label
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
internal struct GaugeLabelView: ExpoSwiftUI.View {
|
|
68
|
-
@ObservedObject var props: GaugeLabelProps
|
|
69
|
-
|
|
70
|
-
var body: some View {
|
|
71
|
-
Children()
|
|
72
|
-
}
|
|
73
|
-
}
|
package/ios/HostView.swift
CHANGED
|
@@ -161,13 +161,12 @@ private struct ViewportSizeMeasurementLayout: Layout {
|
|
|
161
161
|
*/
|
|
162
162
|
private struct GeometryChangeModifier: ViewModifier {
|
|
163
163
|
let props: HostViewProps
|
|
164
|
-
@EnvironmentObject var shadowNodeProxy: ExpoSwiftUI.ShadowNodeProxy
|
|
165
164
|
|
|
166
165
|
private func dispatchOnLayoutContent(_ size: CGSize) {
|
|
167
166
|
if props.matchContentsHorizontal || props.matchContentsVertical {
|
|
168
167
|
let styleWidth = props.matchContentsHorizontal ? NSNumber(value: Float(size.width)) : nil
|
|
169
168
|
let styleHeight = props.matchContentsVertical ? NSNumber(value: Float(size.height)) : nil
|
|
170
|
-
shadowNodeProxy.setStyleSize?(styleWidth, styleHeight)
|
|
169
|
+
props.shadowNodeProxy.setStyleSize?(styleWidth, styleHeight)
|
|
171
170
|
}
|
|
172
171
|
|
|
173
172
|
props.onLayoutContent([
|
package/ios/ImageView.swift
CHANGED
|
@@ -4,7 +4,8 @@ import SwiftUI
|
|
|
4
4
|
import ExpoModulesCore
|
|
5
5
|
|
|
6
6
|
public final class ImageViewProps: UIBaseViewProps {
|
|
7
|
-
@Field var
|
|
7
|
+
@Field var uiImage: String?
|
|
8
|
+
@Field var systemName: String?
|
|
8
9
|
@Field var size: Double?
|
|
9
10
|
@Field var color: Color?
|
|
10
11
|
@Field var variableValue: Double?
|
|
@@ -19,18 +20,28 @@ public struct ImageView: ExpoSwiftUI.View {
|
|
|
19
20
|
self.props = props
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
@ViewBuilder
|
|
22
24
|
public var body: some View {
|
|
23
|
-
let
|
|
25
|
+
if let systemName = props.systemName {
|
|
26
|
+
let image: Image = {
|
|
27
|
+
if #available(iOS 16.0, tvOS 16.0, *) {
|
|
28
|
+
return Image(systemName: systemName, variableValue: props.variableValue)
|
|
29
|
+
}
|
|
30
|
+
return Image(systemName: systemName)
|
|
31
|
+
}()
|
|
24
32
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
image
|
|
34
|
+
.font(.system(size: CGFloat(props.size ?? 24)))
|
|
35
|
+
.foregroundColor(props.color)
|
|
36
|
+
.applyOnTapGesture(useTapGesture: props.useTapGesture, eventDispatcher: props.onTap)
|
|
37
|
+
} else if let url = props.uiImage,
|
|
38
|
+
let url = URL(string: url),
|
|
39
|
+
let data = try? Data(contentsOf: url),
|
|
40
|
+
let uiImage = UIImage(data: data) {
|
|
41
|
+
Image(uiImage: uiImage)
|
|
42
|
+
.applyImageModifiers(props.modifiers, appContext: props.appContext)
|
|
43
|
+
.foregroundColor(props.color)
|
|
44
|
+
.applyOnTapGesture(useTapGesture: props.useTapGesture, eventDispatcher: props.onTap)
|
|
29
45
|
}
|
|
30
|
-
|
|
31
|
-
return image
|
|
32
|
-
.font(.system(size: CGFloat(props.size ?? 24)))
|
|
33
|
-
.foregroundColor(props.color)
|
|
34
|
-
.applyOnTapGesture(useTapGesture: props.useTapGesture, eventDispatcher: props.onTap)
|
|
35
46
|
}
|
|
36
47
|
}
|
package/ios/Label.swift
CHANGED
|
@@ -8,19 +8,6 @@ public final class LabelViewProps: UIBaseViewProps {
|
|
|
8
8
|
@Field var systemImage: String?
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
public final class LabelIconProps: ExpoSwiftUI.ViewProps {}
|
|
12
|
-
public struct LabelIcon: ExpoSwiftUI.View {
|
|
13
|
-
@ObservedObject public var props: LabelIconProps
|
|
14
|
-
|
|
15
|
-
public init(props: LabelIconProps) {
|
|
16
|
-
self.props = props
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
public var body: some View {
|
|
20
|
-
Children()
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
11
|
public struct LabelView: ExpoSwiftUI.View {
|
|
25
12
|
@ObservedObject public var props: LabelViewProps
|
|
26
13
|
|
|
@@ -44,9 +31,7 @@ public struct LabelView: ExpoSwiftUI.View {
|
|
|
44
31
|
}
|
|
45
32
|
}
|
|
46
33
|
|
|
47
|
-
private var customIcon:
|
|
48
|
-
props.children
|
|
49
|
-
.compactMap({ $0.childView as? LabelIcon })
|
|
50
|
-
.first
|
|
34
|
+
private var customIcon: SlotView? {
|
|
35
|
+
props.children?.slot("icon")
|
|
51
36
|
}
|
|
52
37
|
}
|
|
@@ -7,24 +7,6 @@ final class LabeledContentProps: UIBaseViewProps {
|
|
|
7
7
|
@Field var label: String?
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
internal final class LabeledContentLabelProps: ExpoSwiftUI.ViewProps {}
|
|
11
|
-
internal struct LabeledContentLabel: ExpoSwiftUI.View {
|
|
12
|
-
@ObservedObject var props: LabeledContentLabelProps
|
|
13
|
-
|
|
14
|
-
var body: some View {
|
|
15
|
-
Children()
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
internal final class LabeledContentContentProps: ExpoSwiftUI.ViewProps {}
|
|
20
|
-
internal struct LabeledContentContent: ExpoSwiftUI.View {
|
|
21
|
-
@ObservedObject var props: LabeledContentContentProps
|
|
22
|
-
|
|
23
|
-
var body: some View {
|
|
24
|
-
Children()
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
10
|
internal struct LabeledContentView: ExpoSwiftUI.View {
|
|
29
11
|
@ObservedObject var props: LabeledContentProps
|
|
30
12
|
|
|
@@ -45,25 +27,19 @@ internal struct LabeledContentView: ExpoSwiftUI.View {
|
|
|
45
27
|
}
|
|
46
28
|
|
|
47
29
|
private var hasCustomLabel: Bool {
|
|
48
|
-
props.children
|
|
49
|
-
.compactMap({ $0.childView as? LabeledContentLabel })
|
|
50
|
-
.first != nil
|
|
30
|
+
props.children?.slot("label") != nil
|
|
51
31
|
}
|
|
52
32
|
|
|
53
33
|
@ViewBuilder
|
|
54
34
|
private var contentChildren: some View {
|
|
55
|
-
if let content = props.children
|
|
56
|
-
.compactMap({ $0.childView as? LabeledContentContent })
|
|
57
|
-
.first {
|
|
35
|
+
if let content = props.children?.slot("content") {
|
|
58
36
|
content
|
|
59
37
|
}
|
|
60
38
|
}
|
|
61
39
|
|
|
62
40
|
@ViewBuilder
|
|
63
41
|
private var customLabelContent: some View {
|
|
64
|
-
if let labelContent = props.children
|
|
65
|
-
.compactMap({ $0.childView as? LabeledContentLabel })
|
|
66
|
-
.first {
|
|
42
|
+
if let labelContent = props.children?.slot("label") {
|
|
67
43
|
labelContent
|
|
68
44
|
}
|
|
69
45
|
}
|
package/ios/ListView.swift
CHANGED
|
@@ -11,28 +11,20 @@ final class ListProps: UIBaseViewProps {
|
|
|
11
11
|
struct ListView: ExpoSwiftUI.View {
|
|
12
12
|
@ObservedObject var props: ListProps
|
|
13
13
|
@State private var selection = Set<AnyHashable>()
|
|
14
|
-
@State private var prevSelection = Set<AnyHashable>()
|
|
15
|
-
|
|
16
|
-
init(props: ListProps) {
|
|
17
|
-
self.props = props
|
|
18
|
-
let initialSelection = Self.getHashableSetFromEither(props.selection)
|
|
19
|
-
_selection = State(initialValue: initialSelection)
|
|
20
|
-
_prevSelection = State(initialValue: initialSelection)
|
|
21
|
-
}
|
|
22
14
|
|
|
23
15
|
var body: some View {
|
|
24
16
|
List(selection: $selection) {
|
|
25
17
|
Children()
|
|
26
18
|
}
|
|
19
|
+
.onAppear {
|
|
20
|
+
selection = Self.getHashableSetFromEither(props.selection)
|
|
21
|
+
}
|
|
22
|
+
.onChange(of: props.selection) { newValue in
|
|
23
|
+
selection = Self.getHashableSetFromEither(newValue)
|
|
24
|
+
}
|
|
27
25
|
.onChange(of: selection) { newSelection in
|
|
28
26
|
handleSelectionChange(selection: newSelection)
|
|
29
27
|
}
|
|
30
|
-
.onReceive(props.selection.publisher) { newValue in
|
|
31
|
-
let hashableSet = Self.getHashableSetFromEither(newValue)
|
|
32
|
-
if prevSelection == hashableSet { return }
|
|
33
|
-
selection = hashableSet
|
|
34
|
-
prevSelection = hashableSet
|
|
35
|
-
}
|
|
36
28
|
}
|
|
37
29
|
|
|
38
30
|
func handleSelectionChange(selection: Set<AnyHashable>) {
|
package/ios/Menu/MenuView.swift
CHANGED
|
@@ -9,8 +9,7 @@ internal struct MenuView: ExpoSwiftUI.View {
|
|
|
9
9
|
// If label is a component, it is passed as a child, so we need to exclude it in order to display the menu content
|
|
10
10
|
@ViewBuilder
|
|
11
11
|
func ChildrenWithoutLabel() -> some View {
|
|
12
|
-
|
|
13
|
-
ForEach(props.children?.filter { $0.id != labelView?.id } ?? [], id: \.id) { child in
|
|
12
|
+
ForEach(props.children?.withoutSlot("label") ?? [], id: \.id) { child in
|
|
14
13
|
let view: any View = child.childView
|
|
15
14
|
AnyView(view)
|
|
16
15
|
}
|
|
@@ -18,9 +17,7 @@ internal struct MenuView: ExpoSwiftUI.View {
|
|
|
18
17
|
|
|
19
18
|
var body: some View {
|
|
20
19
|
if #available(iOS 14.0, tvOS 17.0, *) {
|
|
21
|
-
let labelContent = props.children
|
|
22
|
-
.compactMap { $0.childView as? MenuLabel }
|
|
23
|
-
.first
|
|
20
|
+
let labelContent = props.children?.slot("label")
|
|
24
21
|
|
|
25
22
|
if props.hasPrimaryAction {
|
|
26
23
|
// With primaryAction, tap triggers callback and long-press shows menu
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright 2015-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
import SwiftUI
|
|
5
|
+
|
|
6
|
+
internal enum ScrollAnchorRoleOptions: String, Enumerable {
|
|
7
|
+
case initialOffset
|
|
8
|
+
case sizeChanges
|
|
9
|
+
case alignment
|
|
10
|
+
|
|
11
|
+
@available(iOS 18.0, tvOS 18.0, macOS 15.0, *)
|
|
12
|
+
var toScrollAnchorRole: ScrollAnchorRole {
|
|
13
|
+
switch self {
|
|
14
|
+
case .initialOffset: return .initialOffset
|
|
15
|
+
case .sizeChanges: return .sizeChanges
|
|
16
|
+
case .alignment: return .alignment
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
internal struct DefaultScrollAnchorForRoleModifier: ViewModifier, Record {
|
|
22
|
+
@Field var anchor: UnitPointOptions?
|
|
23
|
+
@Field var role: ScrollAnchorRoleOptions = .initialOffset
|
|
24
|
+
|
|
25
|
+
func body(content: Content) -> some View {
|
|
26
|
+
if #available(iOS 18.0, tvOS 18.0, macOS 15.0, *) {
|
|
27
|
+
content.defaultScrollAnchor(anchor?.toUnitPoint, for: role.toScrollAnchorRole)
|
|
28
|
+
} else {
|
|
29
|
+
content
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright 2015-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
import SwiftUI
|
|
5
|
+
|
|
6
|
+
internal struct DefaultScrollAnchorModifier: ViewModifier, Record {
|
|
7
|
+
@Field var anchor: UnitPointOptions?
|
|
8
|
+
|
|
9
|
+
func body(content: Content) -> some View {
|
|
10
|
+
if #available(iOS 17.0, tvOS 17.0, macOS 14.0, *) {
|
|
11
|
+
content.defaultScrollAnchor(anchor?.toUnitPoint)
|
|
12
|
+
} else {
|
|
13
|
+
content
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright 2025-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
import SwiftUI
|
|
5
|
+
|
|
6
|
+
internal enum ResizingModeOptions: String, Enumerable {
|
|
7
|
+
case stretch
|
|
8
|
+
case tile
|
|
9
|
+
|
|
10
|
+
var toResizingMode: Image.ResizingMode {
|
|
11
|
+
switch self {
|
|
12
|
+
case .stretch: return .stretch
|
|
13
|
+
case .tile: return .tile
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
internal struct ResizableModifier: Record {
|
|
19
|
+
@Field var top: CGFloat = 0
|
|
20
|
+
@Field var leading: CGFloat = 0
|
|
21
|
+
@Field var bottom: CGFloat = 0
|
|
22
|
+
@Field var trailing: CGFloat = 0
|
|
23
|
+
@Field var resizingMode: ResizingModeOptions = .stretch
|
|
24
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright 2015-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
import SwiftUI
|
|
5
|
+
|
|
6
|
+
internal struct Rotation3DEffectModifier: ViewModifier, Record {
|
|
7
|
+
@Field var angle: Double = 0
|
|
8
|
+
@Field var axisX: CGFloat = 0
|
|
9
|
+
@Field var axisY: CGFloat = 0
|
|
10
|
+
@Field var axisZ: CGFloat = 0
|
|
11
|
+
@Field var perspective: CGFloat = 1
|
|
12
|
+
|
|
13
|
+
func body(content: Content) -> some View {
|
|
14
|
+
content.rotation3DEffect(
|
|
15
|
+
.degrees(angle),
|
|
16
|
+
axis: (x: axisX, y: axisY, z: axisZ),
|
|
17
|
+
perspective: perspective
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -50,3 +50,32 @@ internal extension Text {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
+
|
|
54
|
+
internal extension Image {
|
|
55
|
+
@ViewBuilder
|
|
56
|
+
func applyImageModifiers(_ modifiers: ModifierArray?, appContext: AppContext?) -> some View {
|
|
57
|
+
if let modifiers, let appContext {
|
|
58
|
+
let image = modifiers.reduce(self) { currentImage, modifierConfig in
|
|
59
|
+
guard let type = modifierConfig["$type"] as? String else {
|
|
60
|
+
return currentImage
|
|
61
|
+
}
|
|
62
|
+
return ViewModifierRegistry.shared.applyImageModifier(
|
|
63
|
+
type,
|
|
64
|
+
to: currentImage,
|
|
65
|
+
appContext: appContext,
|
|
66
|
+
params: modifierConfig
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if #available(iOS 18.0, *),
|
|
71
|
+
let modifierConfig = modifiers.first(where: { $0["$type"] as? String == "widgetAccentedRenderingMode" }),
|
|
72
|
+
let modifier = try? WidgetAccentedRenderingModeModifier(from: modifierConfig, appContext: appContext) {
|
|
73
|
+
modifier.apply(to: image)
|
|
74
|
+
} else {
|
|
75
|
+
image
|
|
76
|
+
}
|
|
77
|
+
} else {
|
|
78
|
+
self
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|