@expo/ui 57.0.14 → 57.0.16
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 +28 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +8 -0
- package/android/src/main/java/expo/modules/ui/HostView.kt +8 -1
- package/android/src/main/java/expo/modules/ui/RNHostView.kt +20 -0
- package/android/src/main/java/expo/modules/ui/VerticalSliderView.kt +145 -0
- package/android/src/main/java/expo/modules/ui/textfield/BasicTextField.kt +2 -0
- package/build/jetpack-compose/RNHostView/index.d.ts +6 -0
- package/build/jetpack-compose/RNHostView/index.d.ts.map +1 -1
- package/build/jetpack-compose/Slider/index.d.ts +21 -0
- package/build/jetpack-compose/Slider/index.d.ts.map +1 -1
- package/build/swift-ui/RNHostView.d.ts +2 -0
- package/build/swift-ui/RNHostView.d.ts.map +1 -1
- package/build/swift-ui/modifiers/background.d.ts +32 -5
- package/build/swift-ui/modifiers/background.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +13 -34
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/presentationModifiers.d.ts +3 -2
- package/build/swift-ui/modifiers/presentationModifiers.d.ts.map +1 -1
- package/build/swift-ui/modifiers/shapeStyle.d.ts +54 -0
- package/build/swift-ui/modifiers/shapeStyle.d.ts.map +1 -0
- package/build/universal/BottomSheet/index.android.d.ts +1 -1
- package/build/universal/BottomSheet/index.android.d.ts.map +1 -1
- package/build/universal/BottomSheet/index.d.ts +1 -1
- package/build/universal/BottomSheet/index.d.ts.map +1 -1
- package/build/universal/BottomSheet/index.ios.d.ts +1 -1
- package/build/universal/BottomSheet/index.ios.d.ts.map +1 -1
- package/build/universal/BottomSheet/types.d.ts +20 -0
- package/build/universal/BottomSheet/types.d.ts.map +1 -1
- package/build/universal/ListItem/ListItem.android.d.ts.map +1 -1
- package/build/universal/ListItem/types.d.ts +19 -0
- package/build/universal/ListItem/types.d.ts.map +1 -1
- package/build/universal/RNHostView/index.android.d.ts +1 -1
- package/build/universal/RNHostView/index.android.d.ts.map +1 -1
- package/build/universal/RNHostView/index.d.ts +1 -1
- package/build/universal/RNHostView/index.d.ts.map +1 -1
- package/build/universal/RNHostView/index.ios.d.ts +1 -1
- package/build/universal/RNHostView/index.ios.d.ts.map +1 -1
- package/build/universal/RNHostView/types.d.ts +2 -0
- package/build/universal/RNHostView/types.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/Convertibles/ShapeStyleValue.swift +129 -0
- package/ios/Modifiers/BackgroundModifier.swift +10 -10
- package/ios/Modifiers/ForegroundStyleModifier.swift +12 -105
- package/ios/Modifiers/ViewModifierRegistry.swift +29 -5
- package/ios/RNHostView.swift +4 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.14/expo.modules.ui-57.0.14-sources.jar → 57.0.16/expo.modules.ui-57.0.16-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.14/expo.modules.ui-57.0.14.module → 57.0.16/expo.modules.ui-57.0.16.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{57.0.14/expo.modules.ui-57.0.14.pom → 57.0.16/expo.modules.ui-57.0.16.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.16/expo.modules.ui-57.0.16.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 +4 -4
- package/src/jetpack-compose/RNHostView/index.tsx +12 -0
- package/src/jetpack-compose/Slider/index.tsx +33 -2
- package/src/swift-ui/RNHostView.tsx +3 -0
- package/src/swift-ui/modifiers/background.ts +49 -7
- package/src/swift-ui/modifiers/index.ts +14 -39
- package/src/swift-ui/modifiers/presentationModifiers.ts +3 -2
- package/src/swift-ui/modifiers/shapeStyle.ts +55 -0
- package/src/universal/BottomSheet/index.android.tsx +4 -0
- package/src/universal/BottomSheet/index.ios.tsx +5 -0
- package/src/universal/BottomSheet/index.tsx +4 -0
- package/src/universal/BottomSheet/types.ts +22 -0
- package/src/universal/ListItem/ListItem.android.tsx +2 -1
- package/src/universal/ListItem/types.ts +21 -0
- package/src/universal/RNHostView/index.android.tsx +2 -1
- package/src/universal/RNHostView/index.ios.tsx +6 -2
- package/src/universal/RNHostView/index.tsx +2 -0
- package/src/universal/RNHostView/types.ts +3 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/57.0.14/expo.modules.ui-57.0.14.pom.sha512 +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentationModifiers.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/modifiers/presentationModifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"presentationModifiers.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/modifiers/presentationModifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,OAAO,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhG;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,kBAAkB,EAAE,EAC7B,UAAU;IACR,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAC1D,KACA,cAeF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GAAI,YAAY,WAAW,GAAG,SAAS,GAAG,QAAQ,mBAC3B,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAC7C,WAAW,GACX,SAAS,GACT,UAAU,GACV;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,CAAC;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC,GAC5C,aAAa,qCAAqC,mBASnD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,KAAK,mBACE,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GAAI,aAAY,OAAc,mBACP,CAAC;AAE/D;;;;;;;;;GASG;AACH,MAAM,MAAM,sBAAsB,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9E;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,sBAAsB,mBACf,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Color } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* A style that paints an area, mirroring SwiftUI's `ShapeStyle`.
|
|
4
|
+
* A bare color is a shorthand for `{ type: 'color', color }`.
|
|
5
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/shapestyle).
|
|
6
|
+
*/
|
|
7
|
+
export type ShapeStyle = Color | {
|
|
8
|
+
type: 'color';
|
|
9
|
+
color: Color;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'hierarchical';
|
|
12
|
+
style: 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'quinary';
|
|
13
|
+
} | {
|
|
14
|
+
/**
|
|
15
|
+
* A blurred backdrop that samples the content behind the view and adapts to the current
|
|
16
|
+
* color scheme. `'bar'` has no tvOS counterpart and is ignored there.
|
|
17
|
+
*/
|
|
18
|
+
type: 'material';
|
|
19
|
+
material: 'ultraThin' | 'thin' | 'regular' | 'thick' | 'ultraThick' | 'bar';
|
|
20
|
+
} | {
|
|
21
|
+
type: 'linearGradient';
|
|
22
|
+
colors: Color[];
|
|
23
|
+
startPoint: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
};
|
|
27
|
+
endPoint: {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
};
|
|
31
|
+
} | {
|
|
32
|
+
type: 'radialGradient';
|
|
33
|
+
colors: Color[];
|
|
34
|
+
center: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
};
|
|
38
|
+
startRadius: number;
|
|
39
|
+
endRadius: number;
|
|
40
|
+
} | {
|
|
41
|
+
type: 'angularGradient';
|
|
42
|
+
colors: Color[];
|
|
43
|
+
center: {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Normalizes a style into the shape the native side reads. A `Color` may itself be an object
|
|
50
|
+
* (for example the one returned by `PlatformColor`), so a style is only treated as a tagged
|
|
51
|
+
* variant when it carries a `type` field.
|
|
52
|
+
*/
|
|
53
|
+
export declare function resolveShapeStyle(style: ShapeStyle): Record<string, any>;
|
|
54
|
+
//# sourceMappingURL=shapeStyle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shapeStyle.d.ts","sourceRoot":"","sources":["../../../src/swift-ui/modifiers/shapeStyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAClB,KAAK,GACL;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GAC/B;IACE,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,CAAC;CACxE,GACD;IACE;;;OAGG;IACH,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,KAAK,CAAC;CAC7E,GACD;IACE,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,UAAU,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpC,GACD;IACE,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,GACD;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAClC,CAAC;AAEN;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAQxE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { BottomSheetProps } from './types';
|
|
2
|
-
export declare function BottomSheet({ children, isPresented, onDismiss, showDragIndicator, snapPoints, testID, modifiers, shouldDismissOnBackPress, shouldDismissOnClickOutside, scrimColor, contentPadding, }: BottomSheetProps): import("react/jsx-runtime").JSX.Element | null;
|
|
2
|
+
export declare function BottomSheet({ children, isPresented, onDismiss, showDragIndicator, snapPoints, testID, modifiers, shouldDismissOnBackPress, shouldDismissOnClickOutside, scrimColor, contentPadding, containerColor, contentColor, }: BottomSheetProps): import("react/jsx-runtime").JSX.Element | null;
|
|
3
3
|
export * from './types';
|
|
4
4
|
//# sourceMappingURL=index.android.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.android.d.ts","sourceRoot":"","sources":["../../../src/universal/BottomSheet/index.android.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,SAAS,CAAC;AAwB3D,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAwB,EACxB,UAAU,EACV,MAAM,EACN,SAAS,EACT,wBAA+B,EAC/B,2BAAkC,EAClC,UAAU,EACV,cAAc,
|
|
1
|
+
{"version":3,"file":"index.android.d.ts","sourceRoot":"","sources":["../../../src/universal/BottomSheet/index.android.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,SAAS,CAAC;AAwB3D,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAwB,EACxB,UAAU,EACV,MAAM,EACN,SAAS,EACT,wBAA+B,EAC/B,2BAAkC,EAClC,UAAU,EACV,cAAc,EACd,cAAc,EACd,YAAY,GACb,EAAE,gBAAgB,kDAkDlB;AAED,cAAc,SAAS,CAAC"}
|
|
@@ -2,6 +2,6 @@ import type { BottomSheetProps } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* A modal sheet that slides up from the bottom of the screen.
|
|
4
4
|
*/
|
|
5
|
-
export declare function BottomSheet({ children, isPresented, onDismiss, showDragIndicator, snapPoints, testID, contentPadding, }: BottomSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function BottomSheet({ children, isPresented, onDismiss, showDragIndicator, snapPoints, testID, contentPadding, containerColor, }: BottomSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export * from './types';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/universal/BottomSheet/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,SAAS,CAAC;AAuB3D;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAwB,EACxB,UAAU,EACV,MAAM,EACN,cAAc,GACf,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/universal/BottomSheet/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,SAAS,CAAC;AAuB3D;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAwB,EACxB,UAAU,EACV,MAAM,EACN,cAAc,EACd,cAAc,GACf,EAAE,gBAAgB,2CAmDlB;AAuCD,cAAc,SAAS,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { BottomSheetProps } from './types';
|
|
2
|
-
export declare function BottomSheet({ children, isPresented, onDismiss, showDragIndicator, snapPoints, testID, modifiers, contentPadding, }: BottomSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function BottomSheet({ children, isPresented, onDismiss, showDragIndicator, snapPoints, testID, modifiers, contentPadding, containerColor, }: BottomSheetProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export * from './types';
|
|
4
4
|
//# sourceMappingURL=index.ios.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.ios.d.ts","sourceRoot":"","sources":["../../../src/universal/BottomSheet/index.ios.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.ios.d.ts","sourceRoot":"","sources":["../../../src/universal/BottomSheet/index.ios.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,SAAS,CAAC;AAS3D,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,WAAW,EACX,SAAS,EACT,iBAAwB,EACxB,UAAU,EACV,MAAM,EACN,SAAS,EACT,cAAc,EACd,cAAc,GACf,EAAE,gBAAgB,2CAmClB;AAED,cAAc,SAAS,CAAC"}
|
|
@@ -98,5 +98,25 @@ export interface BottomSheetProps {
|
|
|
98
98
|
* from `@expo/ui/swift-ui/modifiers` or `@expo/ui/jetpack-compose/modifiers`.
|
|
99
99
|
*/
|
|
100
100
|
modifiers?: ModifierConfig[];
|
|
101
|
+
/**
|
|
102
|
+
* The sheet's own background color, painting its full chrome (including the
|
|
103
|
+
* drag-indicator zone and, on iOS, the home-indicator safe-area inset).
|
|
104
|
+
* When omitted, each platform keeps its own default.
|
|
105
|
+
*
|
|
106
|
+
* This only paints the background. `children` are React Native views on
|
|
107
|
+
* every platform, so they don't pick up a contrasting text color
|
|
108
|
+
* automatically -- set one explicitly if you use a dark `containerColor`.
|
|
109
|
+
* @platform android
|
|
110
|
+
* @platform ios 16.4+
|
|
111
|
+
* @platform web
|
|
112
|
+
*/
|
|
113
|
+
containerColor?: ColorValue;
|
|
114
|
+
/**
|
|
115
|
+
* The preferred color for native Compose content that doesn't set its own
|
|
116
|
+
* color. Doesn't reach a `BottomSheet`'s (React Native) `children` -- see
|
|
117
|
+
* `containerColor`'s doc.
|
|
118
|
+
* @platform android
|
|
119
|
+
*/
|
|
120
|
+
contentColor?: ColorValue;
|
|
101
121
|
}
|
|
102
122
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/universal/BottomSheet/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GACjC,MAAM,GACN;IACE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEN;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IAEzB;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,yBAAyB,CAAC;IAE3C;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;;;OAKG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAEtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/universal/BottomSheet/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GACjC,MAAM,GACN;IACE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEN;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IAEzB;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,yBAAyB,CAAC;IAE3C;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;;;OAKG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAEtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAE7B;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAE5B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;CAC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.android.d.ts","sourceRoot":"","sources":["../../../src/universal/ListItem/ListItem.android.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAW7C;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"ListItem.android.d.ts","sourceRoot":"","sources":["../../../src/universal/ListItem/ListItem.android.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAW7C;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAsC5C;AAED,cAAc,SAAS,CAAC"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ColorValue } from 'react-native';
|
|
2
3
|
import type { ModifierConfig } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* Colors for a `ListItem`'s row elements, matching Jetpack Compose's
|
|
6
|
+
* `ListItemDefaults.colors()` on Android.
|
|
7
|
+
* @platform android
|
|
8
|
+
*/
|
|
9
|
+
export interface ListItemColors {
|
|
10
|
+
containerColor?: ColorValue;
|
|
11
|
+
contentColor?: ColorValue;
|
|
12
|
+
leadingContentColor?: ColorValue;
|
|
13
|
+
trailingContentColor?: ColorValue;
|
|
14
|
+
supportingContentColor?: ColorValue;
|
|
15
|
+
overlineContentColor?: ColorValue;
|
|
16
|
+
}
|
|
3
17
|
/**
|
|
4
18
|
* Props for the [`ListItem.Leading`](#listitemleading) slot marker.
|
|
5
19
|
*/
|
|
@@ -63,5 +77,10 @@ export interface ListItemProps {
|
|
|
63
77
|
* its default `buttonStyle(.plain)`.
|
|
64
78
|
*/
|
|
65
79
|
modifiers?: ModifierConfig[];
|
|
80
|
+
/**
|
|
81
|
+
* Row colors. Applied on Android via Compose's `ListItem.colors`.
|
|
82
|
+
* @platform android
|
|
83
|
+
*/
|
|
84
|
+
colors?: ListItemColors;
|
|
66
85
|
}
|
|
67
86
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/universal/ListItem/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/universal/ListItem/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,mBAAmB,CAAC,EAAE,UAAU,CAAC;IACjC,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAClC,sBAAsB,CAAC,EAAE,UAAU,CAAC;IACpC,oBAAoB,CAAC,EAAE,UAAU,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAEpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEpC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,CAAC;IAE7B;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB"}
|
|
@@ -2,6 +2,6 @@ import type { RNHostViewProps } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Hosts React Native views inside Jetpack Compose views.
|
|
4
4
|
*/
|
|
5
|
-
export declare function RNHostView({ children, matchContents, style, onAppear, onDisappear, disabled, hidden, testID, modifiers: extraModifiers, }: RNHostViewProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function RNHostView({ children, matchContents, style, onAppear, onDisappear, disabled, hidden, testID, onLayout, modifiers: extraModifiers, }: RNHostViewProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export * from './types';
|
|
7
7
|
//# sourceMappingURL=index.android.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.android.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/index.android.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,aAAa,EACb,KAAK,EACL,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,MAAM,EACN,MAAM,EACN,SAAS,EAAE,cAAc,GAC1B,EAAE,eAAe,2CAYjB;AAED,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.android.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/index.android.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,aAAa,EACb,KAAK,EACL,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,EAAE,cAAc,GAC1B,EAAE,eAAe,2CAYjB;AAED,cAAc,SAAS,CAAC"}
|
|
@@ -2,6 +2,6 @@ import type { RNHostViewProps } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Hosts React Native views inside Jetpack Compose or SwiftUI views.
|
|
4
4
|
*/
|
|
5
|
-
export declare function RNHostView({ children, style, onAppear, onDisappear, hidden, testID, matchContents, }: RNHostViewProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function RNHostView({ children, style, onAppear, onDisappear, hidden, testID, matchContents, onLayout, }: RNHostViewProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export * from './types';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAS/C;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,WAAW,EACX,MAAc,EACd,MAAM,EACN,aAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAS/C;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,WAAW,EACX,MAAc,EACd,MAAM,EACN,aAAqB,EACrB,QAAQ,GACT,EAAE,eAAe,2CAejB;AAED,cAAc,SAAS,CAAC"}
|
|
@@ -2,6 +2,6 @@ import type { RNHostViewProps } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Hosts React Native views inside SwiftUI views.
|
|
4
4
|
*/
|
|
5
|
-
export declare function RNHostView({ children, matchContents }: RNHostViewProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function RNHostView({ children, matchContents, onLayout }: RNHostViewProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export * from './types';
|
|
7
7
|
//# sourceMappingURL=index.ios.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.ios.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/index.ios.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"index.ios.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/index.ios.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,eAAe,2CAMhF;AAED,cAAc,SAAS,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
|
+
import type { LayoutChangeEvent } from 'react-native';
|
|
2
3
|
import type { UniversalBaseProps } from '../types';
|
|
3
4
|
/**
|
|
4
5
|
* Props for the [`RNHostView`](#rnhostview) component.
|
|
@@ -15,6 +16,7 @@ export interface RNHostViewProps extends UniversalBaseProps {
|
|
|
15
16
|
* @platform ios
|
|
16
17
|
*/
|
|
17
18
|
matchContents?: boolean;
|
|
19
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
18
20
|
/**
|
|
19
21
|
* The React Native view to host.
|
|
20
22
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/universal/RNHostView/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAE9C;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;CACxB"}
|
package/expo-module.config.json
CHANGED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// Copyright 2015-present 650 Industries. All rights reserved.
|
|
2
|
+
|
|
3
|
+
import ExpoModulesCore
|
|
4
|
+
import SwiftUI
|
|
5
|
+
|
|
6
|
+
internal enum ShapeStyleType: String, Enumerable {
|
|
7
|
+
case color
|
|
8
|
+
case hierarchical
|
|
9
|
+
case material
|
|
10
|
+
case linearGradient
|
|
11
|
+
case radialGradient
|
|
12
|
+
case angularGradient
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
internal enum HierarchicalShapeStyleOptions: String, Enumerable {
|
|
16
|
+
case primary
|
|
17
|
+
case secondary
|
|
18
|
+
case tertiary
|
|
19
|
+
case quaternary
|
|
20
|
+
case quinary
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
Returns `nil` when the style is not available on the running platform.
|
|
24
|
+
*/
|
|
25
|
+
func toShapeStyle() -> AnyShapeStyle? {
|
|
26
|
+
switch self {
|
|
27
|
+
case .primary:
|
|
28
|
+
return AnyShapeStyle(HierarchicalShapeStyle.primary)
|
|
29
|
+
case .secondary:
|
|
30
|
+
return AnyShapeStyle(HierarchicalShapeStyle.secondary)
|
|
31
|
+
case .tertiary:
|
|
32
|
+
return AnyShapeStyle(HierarchicalShapeStyle.tertiary)
|
|
33
|
+
case .quaternary:
|
|
34
|
+
return AnyShapeStyle(HierarchicalShapeStyle.quaternary)
|
|
35
|
+
case .quinary:
|
|
36
|
+
if #available(iOS 16.0, tvOS 17.0, *) {
|
|
37
|
+
return AnyShapeStyle(HierarchicalShapeStyle.quinary)
|
|
38
|
+
}
|
|
39
|
+
return nil
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
internal enum MaterialOptions: String, Enumerable {
|
|
45
|
+
case ultraThin
|
|
46
|
+
case thin
|
|
47
|
+
case regular
|
|
48
|
+
case thick
|
|
49
|
+
case ultraThick
|
|
50
|
+
case bar
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
Returns `nil` when the material is not available on the running platform.
|
|
54
|
+
*/
|
|
55
|
+
func toShapeStyle() -> AnyShapeStyle? {
|
|
56
|
+
switch self {
|
|
57
|
+
case .ultraThin:
|
|
58
|
+
return AnyShapeStyle(Material.ultraThin)
|
|
59
|
+
case .thin:
|
|
60
|
+
return AnyShapeStyle(Material.thin)
|
|
61
|
+
case .regular:
|
|
62
|
+
return AnyShapeStyle(Material.regular)
|
|
63
|
+
case .thick:
|
|
64
|
+
return AnyShapeStyle(Material.thick)
|
|
65
|
+
case .ultraThick:
|
|
66
|
+
return AnyShapeStyle(Material.ultraThick)
|
|
67
|
+
case .bar:
|
|
68
|
+
// The bar material has no tvOS counterpart.
|
|
69
|
+
#if os(tvOS)
|
|
70
|
+
return nil
|
|
71
|
+
#else
|
|
72
|
+
return AnyShapeStyle(Material.bar)
|
|
73
|
+
#endif
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
A style that fills or paints an area, mirroring SwiftUI's `ShapeStyle`. Every style is erased to
|
|
80
|
+
`AnyShapeStyle` because the concrete type is only known at runtime — an opaque `some ShapeStyle`
|
|
81
|
+
would have to be a single type across all the branches below.
|
|
82
|
+
*/
|
|
83
|
+
internal struct ShapeStyleValue: Record {
|
|
84
|
+
@Field var type: ShapeStyleType = .color
|
|
85
|
+
@Field var color: Color?
|
|
86
|
+
@Field var hierarchical: HierarchicalShapeStyleOptions?
|
|
87
|
+
@Field var material: MaterialOptions?
|
|
88
|
+
@Field var colors: [Color]?
|
|
89
|
+
@Field var startPoint: UnitPoint?
|
|
90
|
+
@Field var endPoint: UnitPoint?
|
|
91
|
+
@Field var center: UnitPoint?
|
|
92
|
+
@Field var startRadius: CGFloat?
|
|
93
|
+
@Field var endRadius: CGFloat?
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
Resolves the style, or returns `nil` when the fields it needs are missing or the style is not
|
|
97
|
+
available on the running platform. Callers leave the view untouched in that case.
|
|
98
|
+
*/
|
|
99
|
+
func toAnyShapeStyle() -> AnyShapeStyle? {
|
|
100
|
+
switch type {
|
|
101
|
+
case .color:
|
|
102
|
+
guard let color else {
|
|
103
|
+
return nil
|
|
104
|
+
}
|
|
105
|
+
return AnyShapeStyle(color)
|
|
106
|
+
case .hierarchical:
|
|
107
|
+
return (hierarchical ?? .primary).toShapeStyle()
|
|
108
|
+
case .material:
|
|
109
|
+
return material?.toShapeStyle()
|
|
110
|
+
case .linearGradient:
|
|
111
|
+
guard let colors, let startPoint, let endPoint else {
|
|
112
|
+
return nil
|
|
113
|
+
}
|
|
114
|
+
return AnyShapeStyle(LinearGradient(colors: colors, startPoint: startPoint, endPoint: endPoint))
|
|
115
|
+
case .radialGradient:
|
|
116
|
+
guard let colors, let center, let startRadius, let endRadius else {
|
|
117
|
+
return nil
|
|
118
|
+
}
|
|
119
|
+
return AnyShapeStyle(
|
|
120
|
+
RadialGradient(colors: colors, center: center, startRadius: startRadius, endRadius: endRadius)
|
|
121
|
+
)
|
|
122
|
+
case .angularGradient:
|
|
123
|
+
guard let colors, let center else {
|
|
124
|
+
return nil
|
|
125
|
+
}
|
|
126
|
+
return AnyShapeStyle(AngularGradient(colors: colors, center: center))
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -4,33 +4,33 @@ import ExpoModulesCore
|
|
|
4
4
|
import SwiftUI
|
|
5
5
|
|
|
6
6
|
internal struct BackgroundModifier: ViewModifier, Record {
|
|
7
|
-
@Field var
|
|
7
|
+
@Field var style: ShapeStyleValue?
|
|
8
8
|
@Field var shape: ShapeType?
|
|
9
9
|
@Field var cornerRadius: CGFloat = 0
|
|
10
10
|
@Field var roundedCornerStyle: RoundedCornerStyle?
|
|
11
11
|
@Field var cornerSize: CornerSize?
|
|
12
|
+
@Field var ignoresSafeAreaEdges: EdgeOptions = .all
|
|
12
13
|
|
|
13
14
|
@ViewBuilder
|
|
14
15
|
func body(content: Content) -> some View {
|
|
15
|
-
if let
|
|
16
|
+
if let shapeStyle = style?.toAnyShapeStyle() {
|
|
16
17
|
if let shapeType = shape {
|
|
17
18
|
switch shapeType {
|
|
18
19
|
case .capsule:
|
|
19
|
-
content.background(
|
|
20
|
+
content.background(shapeStyle, in: makeCapsule(style: roundedCornerStyle))
|
|
20
21
|
case .circle:
|
|
21
|
-
content.background(
|
|
22
|
+
content.background(shapeStyle, in: Circle())
|
|
22
23
|
case .containerRelativeShape:
|
|
23
|
-
content.background(
|
|
24
|
+
content.background(shapeStyle, in: ContainerRelativeShape())
|
|
24
25
|
case .ellipse:
|
|
25
|
-
content.background(
|
|
26
|
+
content.background(shapeStyle, in: Ellipse())
|
|
26
27
|
case .rectangle:
|
|
27
|
-
content.background(
|
|
28
|
+
content.background(shapeStyle, in: Rectangle())
|
|
28
29
|
case .roundedRectangle:
|
|
29
|
-
content.background(
|
|
30
|
+
content.background(shapeStyle, in: makeRoundedRectangle(cornerRadius: cornerRadius, cornerSize: cornerSize, style: roundedCornerStyle))
|
|
30
31
|
}
|
|
31
32
|
} else {
|
|
32
|
-
|
|
33
|
-
content.background(color)
|
|
33
|
+
content.background(shapeStyle, ignoresSafeAreaEdges: ignoresSafeAreaEdges.toEdge())
|
|
34
34
|
}
|
|
35
35
|
} else {
|
|
36
36
|
content
|
|
@@ -3,122 +3,29 @@
|
|
|
3
3
|
import ExpoModulesCore
|
|
4
4
|
import SwiftUI
|
|
5
5
|
|
|
6
|
-
internal enum ForegroundStyleType: String, Enumerable {
|
|
7
|
-
case color
|
|
8
|
-
case hierarchical
|
|
9
|
-
case linearGradient
|
|
10
|
-
case radialGradient
|
|
11
|
-
case angularGradient
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
internal enum ForegroundHierarchicalStyleType: String, Enumerable {
|
|
15
|
-
case primary
|
|
16
|
-
case secondary
|
|
17
|
-
case tertiary
|
|
18
|
-
case quaternary
|
|
19
|
-
case quinary
|
|
20
|
-
}
|
|
21
|
-
|
|
22
6
|
internal struct ForegroundStyleModifier: ViewModifier, Record {
|
|
23
|
-
@Field var
|
|
24
|
-
@Field var hierarchicalStyle: ForegroundHierarchicalStyleType = .primary
|
|
25
|
-
@Field var color: Color?
|
|
26
|
-
@Field var colors: [Color]?
|
|
27
|
-
@Field var startPoint: UnitPoint?
|
|
28
|
-
@Field var endPoint: UnitPoint?
|
|
29
|
-
@Field var center: UnitPoint?
|
|
30
|
-
@Field var startRadius: CGFloat?
|
|
31
|
-
@Field var endRadius: CGFloat?
|
|
7
|
+
@Field var style: ShapeStyleValue?
|
|
32
8
|
|
|
33
9
|
func body(content: Content) -> some View {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@ViewBuilder
|
|
39
|
-
internal func applyForegroundStyle<V: View>(_ modifier: ForegroundStyleModifier, to content: V) -> some View {
|
|
40
|
-
switch modifier.styleType {
|
|
41
|
-
case .color:
|
|
42
|
-
if let color = modifier.color {
|
|
43
|
-
content.foregroundStyle(color)
|
|
44
|
-
} else {
|
|
45
|
-
content
|
|
46
|
-
}
|
|
47
|
-
case .hierarchical:
|
|
48
|
-
switch modifier.hierarchicalStyle {
|
|
49
|
-
case .primary:
|
|
50
|
-
content.foregroundStyle(.primary)
|
|
51
|
-
case .secondary:
|
|
52
|
-
content.foregroundStyle(.secondary)
|
|
53
|
-
case .tertiary:
|
|
54
|
-
content.foregroundStyle(.tertiary)
|
|
55
|
-
case .quaternary:
|
|
56
|
-
content.foregroundStyle(.quaternary)
|
|
57
|
-
case .quinary:
|
|
58
|
-
if #available(iOS 16.0, tvOS 17.0, *) {
|
|
59
|
-
content.foregroundStyle(.quinary)
|
|
60
|
-
} else {
|
|
61
|
-
content
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
case .linearGradient:
|
|
65
|
-
if let colors = modifier.colors, let startPoint = modifier.startPoint, let endPoint = modifier.endPoint {
|
|
66
|
-
content.foregroundStyle(LinearGradient(colors: colors, startPoint: startPoint, endPoint: endPoint))
|
|
67
|
-
} else {
|
|
68
|
-
content
|
|
69
|
-
}
|
|
70
|
-
case .radialGradient:
|
|
71
|
-
if let colors = modifier.colors, let center = modifier.center,
|
|
72
|
-
let startRadius = modifier.startRadius, let endRadius = modifier.endRadius {
|
|
73
|
-
content.foregroundStyle(RadialGradient(colors: colors, center: center, startRadius: startRadius, endRadius: endRadius))
|
|
74
|
-
} else {
|
|
75
|
-
content
|
|
76
|
-
}
|
|
77
|
-
case .angularGradient:
|
|
78
|
-
if let colors = modifier.colors, let center = modifier.center {
|
|
79
|
-
content.foregroundStyle(AngularGradient(colors: colors, center: center))
|
|
10
|
+
if let shapeStyle = style?.toAnyShapeStyle() {
|
|
11
|
+
content.foregroundStyle(shapeStyle)
|
|
80
12
|
} else {
|
|
81
13
|
content
|
|
82
14
|
}
|
|
83
15
|
}
|
|
84
16
|
}
|
|
85
17
|
|
|
18
|
+
/**
|
|
19
|
+
`Text` keeps its own type through `foregroundStyle(_:)`, which lets the caller apply further
|
|
20
|
+
text-only modifiers, so the text overload is applied separately from the view one.
|
|
21
|
+
|
|
22
|
+
TODO: `Text.foregroundStyle(_:)` requires iOS 17. Once the package drops iOS 16, inline this
|
|
23
|
+
into the `foregroundStyle` case of `applyTextModifier` and delete the color-only fallback there.
|
|
24
|
+
*/
|
|
86
25
|
@available(iOS 17.0, tvOS 17.0, *)
|
|
87
26
|
internal func applyForegroundStyle(_ modifier: ForegroundStyleModifier, to text: Text) -> Text {
|
|
88
|
-
|
|
89
|
-
case .color:
|
|
90
|
-
if let color = modifier.color {
|
|
91
|
-
return text.foregroundStyle(color)
|
|
92
|
-
}
|
|
93
|
-
return text
|
|
94
|
-
case .hierarchical:
|
|
95
|
-
switch modifier.hierarchicalStyle {
|
|
96
|
-
case .primary:
|
|
97
|
-
return text.foregroundStyle(.primary)
|
|
98
|
-
case .secondary:
|
|
99
|
-
return text.foregroundStyle(.secondary)
|
|
100
|
-
case .tertiary:
|
|
101
|
-
return text.foregroundStyle(.tertiary)
|
|
102
|
-
case .quaternary:
|
|
103
|
-
return text.foregroundStyle(.quaternary)
|
|
104
|
-
case .quinary:
|
|
105
|
-
return text.foregroundStyle(.quinary)
|
|
106
|
-
}
|
|
107
|
-
case .linearGradient:
|
|
108
|
-
if let colors = modifier.colors, let startPoint = modifier.startPoint, let endPoint = modifier.endPoint {
|
|
109
|
-
return text.foregroundStyle(LinearGradient(colors: colors, startPoint: startPoint, endPoint: endPoint))
|
|
110
|
-
}
|
|
111
|
-
return text
|
|
112
|
-
case .radialGradient:
|
|
113
|
-
if let colors = modifier.colors, let center = modifier.center,
|
|
114
|
-
let startRadius = modifier.startRadius, let endRadius = modifier.endRadius {
|
|
115
|
-
return text.foregroundStyle(RadialGradient(colors: colors, center: center, startRadius: startRadius, endRadius: endRadius))
|
|
116
|
-
}
|
|
117
|
-
return text
|
|
118
|
-
case .angularGradient:
|
|
119
|
-
if let colors = modifier.colors, let center = modifier.center {
|
|
120
|
-
return text.foregroundStyle(AngularGradient(colors: colors, center: center))
|
|
121
|
-
}
|
|
27
|
+
guard let shapeStyle = modifier.style?.toAnyShapeStyle() else {
|
|
122
28
|
return text
|
|
123
29
|
}
|
|
30
|
+
return text.foregroundStyle(shapeStyle)
|
|
124
31
|
}
|
|
@@ -910,6 +910,26 @@ internal struct AnyViewModifier: ViewModifier {
|
|
|
910
910
|
}
|
|
911
911
|
}
|
|
912
912
|
|
|
913
|
+
/**
|
|
914
|
+
* Prunability-stable wrapper for `AnyViewModifier`
|
|
915
|
+
*/
|
|
916
|
+
internal struct StableViewModifier: ViewModifier {
|
|
917
|
+
let params: [String: Any]
|
|
918
|
+
weak var appContext: AppContext?
|
|
919
|
+
let dispatcher: EventDispatcher
|
|
920
|
+
|
|
921
|
+
func body(content: Content) -> some View {
|
|
922
|
+
if let type = params["$type"] as? String,
|
|
923
|
+
let appContext,
|
|
924
|
+
let factory = ViewModifierRegistry.shared.modifierFactories[type],
|
|
925
|
+
let modifier = try? factory(params, appContext, dispatcher) {
|
|
926
|
+
content.modifier(AnyViewModifier(modifier))
|
|
927
|
+
} else {
|
|
928
|
+
content
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
|
|
913
933
|
internal struct AnimationModifier: ViewModifier, Record {
|
|
914
934
|
@Field var animation: AnimationConfig
|
|
915
935
|
@Field var animatedValue: Either<Double, Bool>?
|
|
@@ -1562,10 +1582,14 @@ public class ViewModifierRegistry {
|
|
|
1562
1582
|
globalEventDispatcher: EventDispatcher,
|
|
1563
1583
|
params: [String: Any]
|
|
1564
1584
|
) -> AnyView {
|
|
1565
|
-
guard
|
|
1585
|
+
guard modifierFactories[type] != nil else {
|
|
1566
1586
|
return view
|
|
1567
1587
|
}
|
|
1568
|
-
return AnyView(view.modifier(
|
|
1588
|
+
return AnyView(view.modifier(StableViewModifier(
|
|
1589
|
+
params: params,
|
|
1590
|
+
appContext: appContext,
|
|
1591
|
+
dispatcher: globalEventDispatcher
|
|
1592
|
+
)))
|
|
1569
1593
|
}
|
|
1570
1594
|
|
|
1571
1595
|
/**
|
|
@@ -1595,9 +1619,9 @@ public class ViewModifierRegistry {
|
|
|
1595
1619
|
guard let modifier = try? ForegroundStyleModifier(from: params, appContext: appContext) else { return text }
|
|
1596
1620
|
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
1597
1621
|
return applyForegroundStyle(modifier, to: text)
|
|
1598
|
-
} else if modifier.
|
|
1599
|
-
|
|
1600
|
-
}
|
|
1622
|
+
} else if modifier.style?.type == .color, let color = modifier.style?.color {
|
|
1623
|
+
return text.foregroundColor(color)
|
|
1624
|
+
}
|
|
1601
1625
|
return text
|
|
1602
1626
|
default:
|
|
1603
1627
|
#if DEBUG
|
package/ios/RNHostView.swift
CHANGED
|
@@ -5,6 +5,10 @@ import ExpoModulesCore
|
|
|
5
5
|
|
|
6
6
|
internal final class RNHostViewProps: ExpoSwiftUI.ViewProps {
|
|
7
7
|
@Field var matchContents: Bool = false
|
|
8
|
+
/**
|
|
9
|
+
Adds LeafNode and MeasurableYogaNode trait in Shadow node
|
|
10
|
+
*/
|
|
11
|
+
@Field var expoInternalSizeFromChildren: Bool = false
|
|
8
12
|
/**
|
|
9
13
|
Whether this view owns its subtree's touches and is the origin its content is measured from. Set
|
|
10
14
|
by the JavaScript side for content presented in its own view controller — see `RNHostView.tsx`,
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
56549744b9307aa46758e19db9dabf90
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6b28263e7e0227478fe261eeffb9f640dced8ca0
|