@expo/ui 58.0.15 → 58.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 +14 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +3 -0
- package/android/src/main/java/expo/modules/ui/ModifierRegistry.kt +2 -2
- package/android/src/main/java/expo/modules/ui/RNHostView.kt +95 -0
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenu.kt +8 -1
- package/android/src/main/java/expo/modules/ui/menu/DropdownMenuRecords.kt +13 -1
- package/build/NativeTreeContext.d.ts +10 -0
- package/build/NativeTreeContext.js +25 -0
- package/build/NativeTreeContext.js.map +1 -0
- package/build/community/bottom-sheet/BottomSheet.ios.js +11 -4
- package/build/community/bottom-sheet/BottomSheet.ios.js.map +1 -1
- package/build/community/menu/MenuView.android.js +6 -0
- package/build/community/menu/MenuView.android.js.map +1 -1
- package/build/jetpack-compose/DropdownMenu/index.d.ts +8 -1
- package/build/jetpack-compose/DropdownMenu/index.js.map +1 -1
- package/build/jetpack-compose/Host/index.js +8 -2
- package/build/jetpack-compose/Host/index.js.map +1 -1
- package/build/jetpack-compose/RNHostView/index.js +5 -1
- package/build/jetpack-compose/RNHostView/index.js.map +1 -1
- package/build/swift-ui/Chart/index.d.ts +10 -0
- package/build/swift-ui/Chart/index.js.map +1 -1
- package/build/swift-ui/Host/index.js +8 -2
- package/build/swift-ui/Host/index.js.map +1 -1
- package/build/swift-ui/RNHostView.js +5 -1
- package/build/swift-ui/RNHostView.js.map +1 -1
- package/build/swift-ui/modifiers/presentationModifiers.d.ts +17 -1
- package/build/swift-ui/modifiers/presentationModifiers.js +4 -2
- package/build/swift-ui/modifiers/presentationModifiers.js.map +1 -1
- package/build/types.d.ts +27 -0
- package/build/types.js +1 -1
- package/build/types.js.map +1 -1
- package/build/universal/BottomSheet/index.android.js +26 -18
- package/build/universal/BottomSheet/index.android.js.map +1 -1
- package/build/universal/BottomSheet/index.ios.js +20 -12
- package/build/universal/BottomSheet/index.ios.js.map +1 -1
- package/ios/ChartView.swift +7 -4
- package/ios/DataListForEachView.swift +1 -0
- package/ios/GridView.swift +1 -0
- package/ios/HostView.swift +27 -4
- package/ios/Modifiers/PresentationModifiers.swift +20 -4
- package/ios/NamespaceView.swift +1 -0
- package/ios/RNHostView.swift +19 -4
- package/ios/SlotView.swift +1 -0
- package/ios/TabView/TabView.swift +2 -0
- package/ios/ToolbarView.swift +2 -1
- package/ios/UIBaseView.swift +13 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.15/expo.modules.ui-58.0.15-sources.jar → 58.0.16/expo.modules.ui-58.0.16-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.15/expo.modules.ui-58.0.15.module → 58.0.16/expo.modules.ui-58.0.16.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{58.0.15/expo.modules.ui-58.0.15.pom → 58.0.16/expo.modules.ui-58.0.16.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.pom.sha512 +1 -0
- package/package.json +1 -1
- package/prebuilds/output/debug/xcframeworks/ExpoUI.tar.gz +0 -0
- package/prebuilds/output/release/xcframeworks/ExpoUI.tar.gz +0 -0
- package/src/NativeTreeContext.tsx +31 -0
- package/src/community/bottom-sheet/BottomSheet.ios.tsx +7 -6
- package/src/community/menu/MenuView.android.tsx +12 -2
- package/src/jetpack-compose/DropdownMenu/index.tsx +12 -1
- package/src/jetpack-compose/Host/index.tsx +6 -2
- package/src/jetpack-compose/RNHostView/index.tsx +3 -1
- package/src/swift-ui/Chart/index.tsx +10 -0
- package/src/swift-ui/Host/index.tsx +6 -2
- package/src/swift-ui/RNHostView.tsx +3 -1
- package/src/swift-ui/modifiers/presentationModifiers.ts +18 -2
- package/src/types.ts +28 -0
- package/src/universal/BottomSheet/index.android.tsx +23 -12
- package/src/universal/BottomSheet/index.ios.tsx +20 -9
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.15/expo.modules.ui-58.0.15.pom.sha512 +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["swift-ui/Host/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","I18nManager","TextInputHostProvider","useTextInputHostRef","useMergeRefs","createViewModifierEventListener","HostNativeView","Host","props","matchContents","onLayoutContent","ignoreSafeArea","modifiers","layoutDirection","seedColor","ref","restProps","hostRef","mergedRef","undefined","matchContentsVertical","vertical","matchContentsHorizontal","horizontal","getConstants","isRTL"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAEzC,SAASC,WAAW,QAAyD,eAAe;AAE5F,SAASC,qBAAqB,EAAEC,mBAAmB,QAAQ,iBAAiB;AAC5E,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SAASC,+BAA+B,QAAQ,qBAAqB;AAyDrE,MAAMC,
|
|
1
|
+
{"version":3,"sources":["swift-ui/Host/index.tsx"],"sourcesContent":[null],"names":["requireNativeView","I18nManager","NativeTreeContext","useWarnIfNestedHost","TextInputHostProvider","useTextInputHostRef","useMergeRefs","createViewModifierEventListener","HostNativeView","Host","props","matchContents","onLayoutContent","ignoreSafeArea","modifiers","layoutDirection","seedColor","ref","children","restProps","hostRef","mergedRef","undefined","matchContentsVertical","vertical","matchContentsHorizontal","horizontal","getConstants","isRTL","Provider","value"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAEzC,SAASC,WAAW,QAAyD,eAAe;AAE5F,SAASC,iBAAiB,EAAEC,mBAAmB,QAAQ,0BAA0B;AACjF,SAASC,qBAAqB,EAAEC,mBAAmB,QAAQ,iBAAiB;AAC5E,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SAASC,+BAA+B,QAAQ,qBAAqB;AAyDrE,MAAMC,iBAMFR,kBAAkB,UAAU;AAEhC;;CAEC,GACD,OAAO,SAASS,KAAKC,KAAgB;IACnC,MAAM,EACJC,aAAa,EACbC,eAAe,EACfC,cAAc,EACdC,SAAS,EACTC,eAAe,EACfC,SAAS,EACTC,GAAG,EACHC,QAAQ,EACR,GAAGC,WACJ,GAAGT;IACJ,MAAMU,UAAUf;IAChB,MAAMgB,YAAYf,aAAaW,KAAKG;IACpCjB,oBAAoB;IAEpB,qBACE,KAACC;QAAsBgB,SAASA;kBAC9B,cAAA,KAACZ;YACCM,WAAWA;YACV,GAAIA,YAAYP,gCAAgCO,aAAaQ,SAAS;YACvEC,uBACE,OAAOZ,kBAAkB,WAAWA,cAAca,QAAQ,GAAGb;YAE/Dc,yBACE,OAAOd,kBAAkB,WAAWA,cAAce,UAAU,GAAGf;YAEjEC,iBAAiBA;YACjBG,iBACEA,mBAAoBd,CAAAA,YAAY0B,YAAY,GAAGC,KAAK,GAAG,gBAAgB,aAAY;YAErFf,gBAAgBA;YAChBG,WAAWA;YACV,GAAGG,SAAS;YACbF,KAAKI;sBACL,cAAA,KAACnB,kBAAkB2B,QAAQ;gBAACC,KAAK;0BAAEZ;;;;AAI3C"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createElement as _createElement } from "react";
|
|
3
3
|
import { requireNativeView } from 'expo';
|
|
4
|
+
import { NativeTreeContext } from '../NativeTreeContext';
|
|
4
5
|
import { PresentedContentContext, useIsPresentedInOwnWindow } from '../PresentedContentContext';
|
|
5
6
|
import { resolveMatchContents } from '../utils/matchContents';
|
|
6
7
|
const RNHostNativeView = requireNativeView('ExpoUI', 'RNHostView');
|
|
@@ -22,7 +23,10 @@ export function RNHostView({ matchContents, ...props }) {
|
|
|
22
23
|
key: `${matchContentsHorizontal}-${matchContentsVertical}`
|
|
23
24
|
}, /*#__PURE__*/ _jsx(PresentedContentContext.Provider, {
|
|
24
25
|
value: false,
|
|
25
|
-
children:
|
|
26
|
+
children: /*#__PURE__*/ _jsx(NativeTreeContext.Provider, {
|
|
27
|
+
value: false,
|
|
28
|
+
children: props.children
|
|
29
|
+
})
|
|
26
30
|
}));
|
|
27
31
|
}
|
|
28
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["swift-ui/RNHostView.tsx"],"sourcesContent":[null],"names":["requireNativeView","PresentedContentContext","useIsPresentedInOwnWindow","resolveMatchContents","RNHostNativeView","RNHostView","matchContents","props","layoutRoot","horizontal","matchContentsHorizontal","vertical","matchContentsVertical","expoInternalSizeFromChildren","key","Provider","value","children"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAGzC,SAASC,uBAAuB,EAAEC,yBAAyB,QAAQ,6BAA6B;AAChG,SAASC,oBAAoB,QAAQ,yBAAyB;AAE9D,MAAMC,
|
|
1
|
+
{"version":3,"sources":["swift-ui/RNHostView.tsx"],"sourcesContent":[null],"names":["requireNativeView","NativeTreeContext","PresentedContentContext","useIsPresentedInOwnWindow","resolveMatchContents","RNHostNativeView","RNHostView","matchContents","props","layoutRoot","horizontal","matchContentsHorizontal","vertical","matchContentsVertical","expoInternalSizeFromChildren","key","Provider","value","children"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,OAAO;AAGzC,SAASC,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,uBAAuB,EAAEC,yBAAyB,QAAQ,6BAA6B;AAChG,SAASC,oBAAoB,QAAQ,yBAAyB;AAE9D,MAAMC,mBAA6CL,kBAAkB,UAAU;AAoB/E,OAAO,SAASM,WAAW,EAAEC,aAAa,EAAE,GAAGC,OAAwB;IACrE,6FAA6F;IAC7F,sEAAsE;IACtE,4FAA4F;IAC5F,0BAA0B;IAC1B,MAAMC,aAAaN;IACnB,MAAM,EAAEO,YAAYC,uBAAuB,EAAEC,UAAUC,qBAAqB,EAAE,GAC5ET,qBAAqBG;IAEvB,qBACE,eAACF;QACE,GAAGG,KAAK;QACTC,YAAYA;QACZE,yBAAyBA;QACzBE,uBAAuBA;QACvBC,8BAA8BH,2BAA2BE;QACzD,iDAAiD;QACjD,mEAAmE;QACnEE,KAAK,GAAGJ,wBAAwB,CAAC,EAAEE,uBAAuB;qBAE1D,KAACX,wBAAwBc,QAAQ;QAACC,OAAO;kBAEvC,cAAA,KAAChB,kBAAkBe,QAAQ;YAACC,OAAO;sBAAQT,MAAMU,QAAQ;;;AAIjE"}
|
|
@@ -87,11 +87,27 @@ export declare const interactiveDismissDisabled: (isDisabled?: boolean) => Modif
|
|
|
87
87
|
* sheets remain edge-attached and detents drive the height.
|
|
88
88
|
*/
|
|
89
89
|
export type PresentationSizingType = 'automatic' | 'fitted' | 'form' | 'page';
|
|
90
|
+
/**
|
|
91
|
+
* Options for the `presentationSizing` modifier.
|
|
92
|
+
*/
|
|
93
|
+
export type PresentationSizingOptions = {
|
|
94
|
+
/**
|
|
95
|
+
* The axes on which the sheet fits its content. An axis that is not set keeps the size from
|
|
96
|
+
* `sizing`. For example, `{ horizontal: false, vertical: true }` fits the height to the content
|
|
97
|
+
* and lets the system choose the width.
|
|
98
|
+
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/presentationsizing/fitted(horizontal:vertical:)).
|
|
99
|
+
*/
|
|
100
|
+
fitted?: {
|
|
101
|
+
horizontal?: boolean;
|
|
102
|
+
vertical?: boolean;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
90
105
|
/**
|
|
91
106
|
* Sets the sizing of a sheet presentation.
|
|
92
107
|
* @param sizing - The sizing behavior to apply.
|
|
108
|
+
* @param options - Additional sizing options.
|
|
93
109
|
* @platform ios 18.0+
|
|
94
110
|
* @platform tvos 18.0+
|
|
95
111
|
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/presentationsizing(_:)).
|
|
96
112
|
*/
|
|
97
|
-
export declare const presentationSizing: (sizing: PresentationSizingType) => ModifierConfig;
|
|
113
|
+
export declare const presentationSizing: (sizing: PresentationSizingType, options?: PresentationSizingOptions) => ModifierConfig;
|
|
@@ -81,11 +81,13 @@ documentation](https://developer.apple.com/documentation/swiftui/view/presentati
|
|
|
81
81
|
/**
|
|
82
82
|
* Sets the sizing of a sheet presentation.
|
|
83
83
|
* @param sizing - The sizing behavior to apply.
|
|
84
|
+
* @param options - Additional sizing options.
|
|
84
85
|
* @platform ios 18.0+
|
|
85
86
|
* @platform tvos 18.0+
|
|
86
87
|
* @see Official [SwiftUI documentation](https://developer.apple.com/documentation/swiftui/view/presentationsizing(_:)).
|
|
87
|
-
*/ export const presentationSizing = (sizing)=>createModifier('presentationSizing', {
|
|
88
|
-
sizing
|
|
88
|
+
*/ export const presentationSizing = (sizing, options)=>createModifier('presentationSizing', {
|
|
89
|
+
sizing,
|
|
90
|
+
...options
|
|
89
91
|
});
|
|
90
92
|
|
|
91
93
|
//# sourceMappingURL=presentationModifiers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["swift-ui/modifiers/presentationModifiers.ts"],"sourcesContent":[null],"names":["createModifier","createModifierWithEventListener","resolveShapeStyle","presentationDetents","detents","options","params","selection","onSelectionChange","args","detent","presentationDragIndicator","visibility","presentationCornerRadius","cornerRadius","presentationBackgroundInteraction","interaction","interactionType","presentationBackground","style","interactiveDismissDisabled","isDisabled","presentationSizing","sizing"],"mappings":"AAAA,SACEA,cAAc,EACdC,+BAA+B,QAE1B,mBAAmB;AAC1B,SAASC,iBAAiB,QAAyB,eAAe;AAWlE;;;;;;;;;CASC,GACD,OAAO,MAAMC,sBAAsB,CACjCC,SACAC;IAKA,MAAMC,SAAS;QAAEF;QAASG,WAAWF,SAASE;IAAU;IAExD,MAAM,EAAEC,iBAAiB,EAAE,GAAGH,WAAW,CAAC;IAC1C,IAAIG,mBAAmB;QACrB,OAAOP,gCACL,uBACA,CAACQ;YACCD,kBAAkBC,KAAKC,MAAM;QAC/B,GACAJ;IAEJ;IAEA,OAAON,eAAe,uBAAuBM;AAC/C,EAAE;AAEF;;;;;;CAMC,GACD,OAAO,MAAMK,4BAA4B,CAACC,aACxCZ,eAAe,6BAA6B;QAAEY;IAAW,GAAG;AAE9D;;;;;;CAMC,GACD,OAAO,MAAMC,2BAA2B,CAACC,eACvCd,eAAe,4BAA4B;QAAEc;IAAa,GAAG;AAW/D;;;;;;CAMC,GACD,OAAO,MAAMC,oCAAoC,CAC/CC;IAEA,IAAI,OAAOA,gBAAgB,UAAU;QACnC,OAAOhB,eAAe,qCAAqC;YAAEiB,iBAAiBD;QAAY;IAC5F;IACA,OAAOhB,eAAe,qCAAqC;QACzDiB,iBAAiB;QACjBP,QAAQM,YAAYN,MAAM;IAC5B;AACF,EAAE;AAEF;;;;;;;;;;;CAWC,GACD,OAAO,MAAMQ,yBAAyB,CAACC,QACrCnB,eAAe,0BAA0B;QAAEmB,OAAOjB,kBAAkBiB;IAAO,GAAG;AAEhF;;;;CAIC,GACD,OAAO,MAAMC,6BAA6B,CAACC,aAAsB,IAAI,GACnErB,eAAe,8BAA8B;QAAEqB;IAAW,GAAG;
|
|
1
|
+
{"version":3,"sources":["swift-ui/modifiers/presentationModifiers.ts"],"sourcesContent":[null],"names":["createModifier","createModifierWithEventListener","resolveShapeStyle","presentationDetents","detents","options","params","selection","onSelectionChange","args","detent","presentationDragIndicator","visibility","presentationCornerRadius","cornerRadius","presentationBackgroundInteraction","interaction","interactionType","presentationBackground","style","interactiveDismissDisabled","isDisabled","presentationSizing","sizing"],"mappings":"AAAA,SACEA,cAAc,EACdC,+BAA+B,QAE1B,mBAAmB;AAC1B,SAASC,iBAAiB,QAAyB,eAAe;AAWlE;;;;;;;;;CASC,GACD,OAAO,MAAMC,sBAAsB,CACjCC,SACAC;IAKA,MAAMC,SAAS;QAAEF;QAASG,WAAWF,SAASE;IAAU;IAExD,MAAM,EAAEC,iBAAiB,EAAE,GAAGH,WAAW,CAAC;IAC1C,IAAIG,mBAAmB;QACrB,OAAOP,gCACL,uBACA,CAACQ;YACCD,kBAAkBC,KAAKC,MAAM;QAC/B,GACAJ;IAEJ;IAEA,OAAON,eAAe,uBAAuBM;AAC/C,EAAE;AAEF;;;;;;CAMC,GACD,OAAO,MAAMK,4BAA4B,CAACC,aACxCZ,eAAe,6BAA6B;QAAEY;IAAW,GAAG;AAE9D;;;;;;CAMC,GACD,OAAO,MAAMC,2BAA2B,CAACC,eACvCd,eAAe,4BAA4B;QAAEc;IAAa,GAAG;AAW/D;;;;;;CAMC,GACD,OAAO,MAAMC,oCAAoC,CAC/CC;IAEA,IAAI,OAAOA,gBAAgB,UAAU;QACnC,OAAOhB,eAAe,qCAAqC;YAAEiB,iBAAiBD;QAAY;IAC5F;IACA,OAAOhB,eAAe,qCAAqC;QACzDiB,iBAAiB;QACjBP,QAAQM,YAAYN,MAAM;IAC5B;AACF,EAAE;AAEF;;;;;;;;;;;CAWC,GACD,OAAO,MAAMQ,yBAAyB,CAACC,QACrCnB,eAAe,0BAA0B;QAAEmB,OAAOjB,kBAAkBiB;IAAO,GAAG;AAEhF;;;;CAIC,GACD,OAAO,MAAMC,6BAA6B,CAACC,aAAsB,IAAI,GACnErB,eAAe,8BAA8B;QAAEqB;IAAW,GAAG;AA2B/D;;;;;;;CAOC,GACD,OAAO,MAAMC,qBAAqB,CAChCC,QACAlB,UACGL,eAAe,sBAAsB;QAAEuB;QAAQ,GAAGlB,OAAO;IAAC,GAAG"}
|
package/build/types.d.ts
CHANGED
|
@@ -44,3 +44,30 @@ export type DialogProperties = {
|
|
|
44
44
|
*/
|
|
45
45
|
decorFitsSystemWindows?: boolean;
|
|
46
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Properties for the popup window, matching `PopupProperties` in Compose.
|
|
49
|
+
*/
|
|
50
|
+
export type PopupProperties = {
|
|
51
|
+
/**
|
|
52
|
+
* Whether the popup is focusable. When `true`, the popup receives IME events and key presses,
|
|
53
|
+
* such as the back button.
|
|
54
|
+
* @default true
|
|
55
|
+
*/
|
|
56
|
+
focusable?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the popup can be dismissed by pressing the back button. Has no effect when `focusable` is `false`.
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
dismissOnBackPress?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Whether the popup can be dismissed by clicking outside of its bounds.
|
|
64
|
+
* @default true
|
|
65
|
+
*/
|
|
66
|
+
dismissOnClickOutside?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Whether the popup window is clipped to the screen boundaries. Set to `false` to let it extend
|
|
69
|
+
* beyond them, which positions the popup accurately.
|
|
70
|
+
* @default true
|
|
71
|
+
*/
|
|
72
|
+
clippingEnabled?: boolean;
|
|
73
|
+
};
|
package/build/types.js
CHANGED
package/build/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["types.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;CAEC,
|
|
1
|
+
{"version":3,"sources":["types.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;CAEC,GAmDD;;CAEC,GACD,WAuBE"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Column, Host, ModalBottomSheet } from '@expo/ui/jetpack-compose';
|
|
3
3
|
import { fillMaxHeight, padding, testID as testIDModifier } from '@expo/ui/jetpack-compose/modifiers';
|
|
4
4
|
import { useEffect, useRef, useState } from 'react';
|
|
5
|
+
import { useIsInsideNativeTree } from '../../NativeTreeContext';
|
|
5
6
|
import { resolveContentPadding } from './utils';
|
|
6
7
|
// M3 `ModalBottomSheet` only has partial/expanded states.
|
|
7
8
|
// Only allow the partial state when the consumer requested a partial-friendly snap point.
|
|
@@ -16,6 +17,7 @@ function shouldFillMaxHeight(snapPoints) {
|
|
|
16
17
|
return snapPoints.some((sp)=>sp === 'full' || typeof sp === 'object' && 'fraction' in sp && sp.fraction >= 1);
|
|
17
18
|
}
|
|
18
19
|
export function BottomSheet({ children, isPresented, onDismiss, showDragIndicator = true, snapPoints, testID, modifiers, shouldDismissOnBackPress = true, shouldDismissOnClickOutside = true, scrimColor, contentPadding, containerColor, contentColor }) {
|
|
20
|
+
const isInsideHost = useIsInsideNativeTree();
|
|
19
21
|
const sheetRef = useRef(null);
|
|
20
22
|
const [mount, setMount] = useState(isPresented);
|
|
21
23
|
useEffect(()=>{
|
|
@@ -49,29 +51,35 @@ export function BottomSheet({ children, isPresented, onDismiss, showDragIndicato
|
|
|
49
51
|
];
|
|
50
52
|
if (shouldFillMaxHeight(snapPoints)) contentModifiers.push(fillMaxHeight());
|
|
51
53
|
if (testID) contentModifiers.push(testIDModifier(testID));
|
|
54
|
+
const sheet = /*#__PURE__*/ _jsx(ModalBottomSheet, {
|
|
55
|
+
ref: sheetRef,
|
|
56
|
+
onDismissRequest: onDismiss,
|
|
57
|
+
showDragHandle: showDragIndicator,
|
|
58
|
+
skipPartiallyExpanded: shouldSkipPartiallyExpanded(snapPoints),
|
|
59
|
+
properties: {
|
|
60
|
+
shouldDismissOnBackPress,
|
|
61
|
+
shouldDismissOnClickOutside
|
|
62
|
+
},
|
|
63
|
+
scrimColor: scrimColor,
|
|
64
|
+
containerColor: containerColor,
|
|
65
|
+
contentColor: contentColor,
|
|
66
|
+
modifiers: modifiers,
|
|
67
|
+
children: /*#__PURE__*/ _jsx(Column, {
|
|
68
|
+
modifiers: contentModifiers,
|
|
69
|
+
children: children
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
// Already inside a `Host`, for example nested in another sheet's content: a `Host` of its own
|
|
73
|
+
// would be a `Host` directly inside Compose.
|
|
74
|
+
if (isInsideHost) {
|
|
75
|
+
return sheet;
|
|
76
|
+
}
|
|
52
77
|
return /*#__PURE__*/ _jsx(Host, {
|
|
53
78
|
style: {
|
|
54
79
|
position: 'absolute'
|
|
55
80
|
},
|
|
56
81
|
pointerEvents: "none",
|
|
57
|
-
children:
|
|
58
|
-
ref: sheetRef,
|
|
59
|
-
onDismissRequest: onDismiss,
|
|
60
|
-
showDragHandle: showDragIndicator,
|
|
61
|
-
skipPartiallyExpanded: shouldSkipPartiallyExpanded(snapPoints),
|
|
62
|
-
properties: {
|
|
63
|
-
shouldDismissOnBackPress,
|
|
64
|
-
shouldDismissOnClickOutside
|
|
65
|
-
},
|
|
66
|
-
scrimColor: scrimColor,
|
|
67
|
-
containerColor: containerColor,
|
|
68
|
-
contentColor: contentColor,
|
|
69
|
-
modifiers: modifiers,
|
|
70
|
-
children: /*#__PURE__*/ _jsx(Column, {
|
|
71
|
-
modifiers: contentModifiers,
|
|
72
|
-
children: children
|
|
73
|
-
})
|
|
74
|
-
})
|
|
82
|
+
children: sheet
|
|
75
83
|
});
|
|
76
84
|
}
|
|
77
85
|
export * from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["universal/BottomSheet/index.android.tsx"],"sourcesContent":[null],"names":["Column","Host","ModalBottomSheet","fillMaxHeight","padding","testID","testIDModifier","useEffect","useRef","useState","resolveContentPadding","shouldSkipPartiallyExpanded","snapPoints","length","some","sp","fraction","shouldFillMaxHeight","BottomSheet","children","isPresented","onDismiss","showDragIndicator","modifiers","shouldDismissOnBackPress","shouldDismissOnClickOutside","scrimColor","contentPadding","containerColor","contentColor","sheetRef","mount","setMount","cancelled","current","hide","then","top","bottom","left","right","contentModifiers","push","
|
|
1
|
+
{"version":3,"sources":["universal/BottomSheet/index.android.tsx"],"sourcesContent":[null],"names":["Column","Host","ModalBottomSheet","fillMaxHeight","padding","testID","testIDModifier","useEffect","useRef","useState","useIsInsideNativeTree","resolveContentPadding","shouldSkipPartiallyExpanded","snapPoints","length","some","sp","fraction","shouldFillMaxHeight","BottomSheet","children","isPresented","onDismiss","showDragIndicator","modifiers","shouldDismissOnBackPress","shouldDismissOnClickOutside","scrimColor","contentPadding","containerColor","contentColor","isInsideHost","sheetRef","mount","setMount","cancelled","current","hide","then","top","bottom","left","right","contentModifiers","push","sheet","ref","onDismissRequest","showDragHandle","skipPartiallyExpanded","properties","style","position","pointerEvents"],"mappings":";AAAA,SAASA,MAAM,EAAEC,IAAI,EAAEC,gBAAgB,QAAkC,2BAA2B;AACpG,SACEC,aAAa,EACbC,OAAO,EACPC,UAAUC,cAAc,QAEnB,qCAAqC;AAC5C,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAQ;AAEpD,SAASC,qBAAqB,QAAQ,0BAA0B;AAEhE,SAASC,qBAAqB,QAAQ,UAAU;AAEhD,0DAA0D;AAC1D,0FAA0F;AAC1F,SAASC,4BAA4BC,UAAmC;IACtE,IAAI,CAACA,cAAcA,WAAWC,MAAM,KAAK,GAAG,OAAO;IACnD,OAAO,CAACD,WAAWE,IAAI,CACrB,CAACC,KACCA,OAAO,UACN,OAAOA,OAAO,YAAY,cAAcA,MAAMA,GAAGC,QAAQ,GAAG,KAC5D,OAAOD,OAAO,YAAY,YAAYA;AAE7C;AAEA,wCAAwC;AACxC,uGAAuG;AACvG,SAASE,oBAAoBL,UAAmC;IAC9D,IAAI,CAACA,cAAcA,WAAWC,MAAM,KAAK,GAAG,OAAO;IACnD,OAAOD,WAAWE,IAAI,CACpB,CAACC,KAAOA,OAAO,UAAW,OAAOA,OAAO,YAAY,cAAcA,MAAMA,GAAGC,QAAQ,IAAI;AAE3F;AAEA,OAAO,SAASE,YAAY,EAC1BC,QAAQ,EACRC,WAAW,EACXC,SAAS,EACTC,oBAAoB,IAAI,EACxBV,UAAU,EACVR,MAAM,EACNmB,SAAS,EACTC,2BAA2B,IAAI,EAC/BC,8BAA8B,IAAI,EAClCC,UAAU,EACVC,cAAc,EACdC,cAAc,EACdC,YAAY,EACK;IACjB,MAAMC,eAAerB;IACrB,MAAMsB,WAAWxB,OAA4B;IAC7C,MAAM,CAACyB,OAAOC,SAAS,GAAGzB,SAASY;IAEnCd,UAAU;QACR,IAAIc,aAAa;YACfa,SAAS;YACT;QACF;QACA,IAAIC,YAAY;QAChBH,SAASI,OAAO,EAAEC,OAAOC,KAAK;YAC5B,IAAI,CAACH,WAAWD,SAAS;QAC3B;QACA,OAAO;YACLC,YAAY;QACd;IACF,GAAG;QAACd;KAAY;IAEhB,IAAI,CAACY,OAAO;QACV,OAAO;IACT;IAEA,6FAA6F;IAC7F,qCAAqC;IACrC,MAAM,EAAEM,GAAG,EAAEC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAG/B,sBAAsBiB,gBAAgB;QACzEW,KAAKhB,oBAAoB,IAAI;QAC7BiB,QAAQ;QACRC,MAAM;QACNC,OAAO;IACT;IACA,MAAMC,mBAAqC;QAACvC,QAAQqC,MAAMF,KAAKG,OAAOF;KAAQ;IAC9E,IAAItB,oBAAoBL,aAAa8B,iBAAiBC,IAAI,CAACzC;IAC3D,IAAIE,QAAQsC,iBAAiBC,IAAI,CAACtC,eAAeD;IAEjD,MAAMwC,sBACJ,KAAC3C;QACC4C,KAAKd;QACLe,kBAAkBzB;QAClB0B,gBAAgBzB;QAChB0B,uBAAuBrC,4BAA4BC;QACnDqC,YAAY;YAAEzB;YAA0BC;QAA4B;QACpEC,YAAYA;QACZE,gBAAgBA;QAChBC,cAAcA;QACdN,WAAWA;kBACX,cAAA,KAACxB;YAAOwB,WAAWmB;sBAAmBvB;;;IAI1C,8FAA8F;IAC9F,6CAA6C;IAC7C,IAAIW,cAAc;QAChB,OAAOc;IACT;IACA,qBACE,KAAC5C;QAAKkD,OAAO;YAAEC,UAAU;QAAW;QAAGC,eAAc;kBAClDR;;AAGP;AAEA,cAAc,UAAU"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { BottomSheet as SwiftUIBottomSheet, Group, Host } from '@expo/ui/swift-ui';
|
|
3
3
|
import { frame, padding, presentationBackground, presentationDetents, presentationDragIndicator } from '@expo/ui/swift-ui/modifiers';
|
|
4
|
+
import { useIsInsideNativeTree } from '../../NativeTreeContext';
|
|
4
5
|
import { resolveContentPadding } from './utils';
|
|
5
6
|
function snapPointToDetent(snapPoint) {
|
|
6
7
|
if (snapPoint === 'half') return 'medium';
|
|
@@ -8,6 +9,7 @@ function snapPointToDetent(snapPoint) {
|
|
|
8
9
|
return snapPoint;
|
|
9
10
|
}
|
|
10
11
|
export function BottomSheet({ children, isPresented, onDismiss, showDragIndicator = true, snapPoints, testID, modifiers, contentPadding, containerColor }) {
|
|
12
|
+
const isInsideHost = useIsInsideNativeTree();
|
|
11
13
|
const { top, bottom, left, right } = resolveContentPadding(contentPadding, {
|
|
12
14
|
top: 16,
|
|
13
15
|
bottom: 0,
|
|
@@ -36,23 +38,29 @@ export function BottomSheet({ children, isPresented, onDismiss, showDragIndicato
|
|
|
36
38
|
if (modifiers?.length) {
|
|
37
39
|
presentationModifiers.push(...modifiers);
|
|
38
40
|
}
|
|
41
|
+
const sheet = /*#__PURE__*/ _jsx(SwiftUIBottomSheet, {
|
|
42
|
+
isPresented: isPresented,
|
|
43
|
+
onIsPresentedChange: (presented)=>{
|
|
44
|
+
if (!presented) onDismiss();
|
|
45
|
+
},
|
|
46
|
+
fitToContents: !snapPoints || snapPoints.length === 0,
|
|
47
|
+
testID: testID,
|
|
48
|
+
children: /*#__PURE__*/ _jsx(Group, {
|
|
49
|
+
modifiers: presentationModifiers,
|
|
50
|
+
children: children
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
// Already inside a `Host`, for example nested in another sheet's content: a `Host` of its own
|
|
54
|
+
// would be a `Host` directly inside SwiftUI.
|
|
55
|
+
if (isInsideHost) {
|
|
56
|
+
return sheet;
|
|
57
|
+
}
|
|
39
58
|
return /*#__PURE__*/ _jsx(Host, {
|
|
40
59
|
style: {
|
|
41
60
|
position: 'absolute'
|
|
42
61
|
},
|
|
43
62
|
pointerEvents: "none",
|
|
44
|
-
children:
|
|
45
|
-
isPresented: isPresented,
|
|
46
|
-
onIsPresentedChange: (presented)=>{
|
|
47
|
-
if (!presented) onDismiss();
|
|
48
|
-
},
|
|
49
|
-
fitToContents: !snapPoints || snapPoints.length === 0,
|
|
50
|
-
testID: testID,
|
|
51
|
-
children: /*#__PURE__*/ _jsx(Group, {
|
|
52
|
-
modifiers: presentationModifiers,
|
|
53
|
-
children: children
|
|
54
|
-
})
|
|
55
|
-
})
|
|
63
|
+
children: sheet
|
|
56
64
|
});
|
|
57
65
|
}
|
|
58
66
|
export * from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["universal/BottomSheet/index.ios.tsx"],"sourcesContent":[null],"names":["BottomSheet","SwiftUIBottomSheet","Group","Host","frame","padding","presentationBackground","presentationDetents","presentationDragIndicator","resolveContentPadding","snapPointToDetent","snapPoint","children","isPresented","onDismiss","showDragIndicator","snapPoints","testID","modifiers","contentPadding","containerColor","top","bottom","left","right","presentationModifiers","maxWidth","Infinity","alignment","leading","trailing","length","push","map","
|
|
1
|
+
{"version":3,"sources":["universal/BottomSheet/index.ios.tsx"],"sourcesContent":[null],"names":["BottomSheet","SwiftUIBottomSheet","Group","Host","frame","padding","presentationBackground","presentationDetents","presentationDragIndicator","useIsInsideNativeTree","resolveContentPadding","snapPointToDetent","snapPoint","children","isPresented","onDismiss","showDragIndicator","snapPoints","testID","modifiers","contentPadding","containerColor","isInsideHost","top","bottom","left","right","presentationModifiers","maxWidth","Infinity","alignment","leading","trailing","length","push","map","sheet","onIsPresentedChange","presented","fitToContents","style","position","pointerEvents"],"mappings":";AAAA,SAASA,eAAeC,kBAAkB,EAAEC,KAAK,EAAEC,IAAI,QAAQ,oBAAoB;AACnF,SACEC,KAAK,EACLC,OAAO,EACPC,sBAAsB,EACtBC,mBAAmB,EACnBC,yBAAyB,QAGpB,8BAA8B;AAErC,SAASC,qBAAqB,QAAQ,0BAA0B;AAEhE,SAASC,qBAAqB,QAAQ,UAAU;AAEhD,SAASC,kBAAkBC,SAAoB;IAC7C,IAAIA,cAAc,QAAQ,OAAO;IACjC,IAAIA,cAAc,QAAQ,OAAO;IACjC,OAAOA;AACT;AAEA,OAAO,SAASZ,YAAY,EAC1Ba,QAAQ,EACRC,WAAW,EACXC,SAAS,EACTC,oBAAoB,IAAI,EACxBC,UAAU,EACVC,MAAM,EACNC,SAAS,EACTC,cAAc,EACdC,cAAc,EACG;IACjB,MAAMC,eAAeb;IACrB,MAAM,EAAEc,GAAG,EAAEC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGhB,sBAAsBU,gBAAgB;QACzEG,KAAK;QACLC,QAAQ;QACRC,MAAM;QACNC,OAAO;IACT;IACA,MAAMC,wBAA0C;QAC9CvB,MAAM;YAAEwB,UAAUC;YAAUC,WAAW;QAAa;QACpDzB,QAAQ;YAAEkB;YAAKC;YAAQO,SAASN;YAAMO,UAAUN;QAAM;QACtDlB,0BAA0BQ,oBAAoB,YAAY;KAC3D;IACD,IAAIC,cAAcA,WAAWgB,MAAM,GAAG,GAAG;QACvCN,sBAAsBO,IAAI,CAAC3B,oBAAoBU,WAAWkB,GAAG,CAACxB;IAChE;IACA,IAAIU,gBAAgB;QAClBM,sBAAsBO,IAAI,CAAC5B,uBAAuBe;IACpD;IACA,IAAIF,WAAWc,QAAQ;QACrBN,sBAAsBO,IAAI,IAAIf;IAChC;IAEA,MAAMiB,sBACJ,KAACnC;QACCa,aAAaA;QACbuB,qBAAqB,CAACC;YACpB,IAAI,CAACA,WAAWvB;QAClB;QACAwB,eAAe,CAACtB,cAAcA,WAAWgB,MAAM,KAAK;QACpDf,QAAQA;kBACR,cAAA,KAAChB;YAAMiB,WAAWQ;sBAAwBd;;;IAI9C,8FAA8F;IAC9F,6CAA6C;IAC7C,IAAIS,cAAc;QAChB,OAAOc;IACT;IACA,qBACE,KAACjC;QAAKqC,OAAO;YAAEC,UAAU;QAAW;QAAGC,eAAc;kBAClDN;;AAGP;AAEA,cAAc,UAAU"}
|
package/ios/ChartView.swift
CHANGED
|
@@ -59,6 +59,8 @@ struct BarChartStyle: Record {
|
|
|
59
59
|
struct PieChartStyle: Record {
|
|
60
60
|
@Field var innerRadius: Double = 0.3
|
|
61
61
|
@Field var angularInset: Double = 2.0
|
|
62
|
+
@Field var cornerRadius: Double = 0.0
|
|
63
|
+
@Field var opacity: Double = 0.8
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
struct PointChartStyle: Record {
|
|
@@ -115,10 +117,11 @@ public struct ChartView: ExpoSwiftUI.View {
|
|
|
115
117
|
|
|
116
118
|
@available(iOS 17.0, tvOS 17.0, *)
|
|
117
119
|
private func createBasePieMark(for dataPoint: ChartDataPoint) -> SectorMark {
|
|
118
|
-
|
|
119
|
-
return SectorMark(angle: .value("Value", dataPoint.y), innerRadius: .ratio(style.innerRadius), angularInset: style.angularInset)
|
|
120
|
+
return SectorMark(angle: .value("Value", dataPoint.y), innerRadius: .ratio(pieStyle.innerRadius), angularInset: pieStyle.angularInset)
|
|
120
121
|
}
|
|
121
122
|
|
|
123
|
+
private var pieStyle: PieChartStyle { props.pieStyle ?? PieChartStyle() }
|
|
124
|
+
|
|
122
125
|
@available(iOS 16.0, tvOS 16.0, *)
|
|
123
126
|
private func createAreaMark(for dataPoint: ChartDataPoint) -> some ChartContent {
|
|
124
127
|
if let numericX = dataPoint.xNumericValue {
|
|
@@ -212,9 +215,9 @@ public struct ChartView: ExpoSwiftUI.View {
|
|
|
212
215
|
case .pie:
|
|
213
216
|
if #available(iOS 17.0, tvOS 17.0, *) {
|
|
214
217
|
if hasIndividualColors {
|
|
215
|
-
createBasePieMark(for: dataPoint).foregroundStyle(dataPoint.color ?? .blue).opacity(
|
|
218
|
+
createBasePieMark(for: dataPoint).foregroundStyle(dataPoint.color ?? .blue).cornerRadius(CGFloat(pieStyle.cornerRadius)).opacity(pieStyle.opacity)
|
|
216
219
|
} else {
|
|
217
|
-
createBasePieMark(for: dataPoint).foregroundStyle(by: .value("Category", dataPoint.xValue)).opacity(
|
|
220
|
+
createBasePieMark(for: dataPoint).foregroundStyle(by: .value("Category", dataPoint.xValue)).cornerRadius(CGFloat(pieStyle.cornerRadius)).opacity(pieStyle.opacity)
|
|
218
221
|
}
|
|
219
222
|
}
|
|
220
223
|
case .rectangle:
|
package/ios/GridView.swift
CHANGED
package/ios/HostView.swift
CHANGED
|
@@ -3,11 +3,28 @@
|
|
|
3
3
|
import SwiftUI
|
|
4
4
|
import ExpoModulesCore
|
|
5
5
|
|
|
6
|
-
/// Coordinate space anchored at the `Host
|
|
7
|
-
///
|
|
8
|
-
///
|
|
6
|
+
/// Coordinate space anchored at the `Host`'s SwiftUI root, which macOS measures hosted React Native
|
|
7
|
+
/// views from. iOS uses `HostingViewReference` instead, because this space starts after the
|
|
8
|
+
/// safe-area inset that `UIHostingController` applies to the root.
|
|
9
9
|
internal let expoHostCoordinateSpace = "expo.ui.host"
|
|
10
10
|
|
|
11
|
+
/// The enclosing `Host`'s UIKit view, which Yoga laid out. iOS measures hosted React Native views
|
|
12
|
+
/// from it.
|
|
13
|
+
internal final class HostingViewReference {
|
|
14
|
+
weak var view: UIView?
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
private struct HostingViewEnvironmentKey: EnvironmentKey {
|
|
18
|
+
static let defaultValue: HostingViewReference? = nil
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
extension EnvironmentValues {
|
|
22
|
+
var expoHostingView: HostingViewReference? {
|
|
23
|
+
get { self[HostingViewEnvironmentKey.self] }
|
|
24
|
+
set { self[HostingViewEnvironmentKey.self] = newValue }
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
11
28
|
internal enum ExpoColorScheme: String, Enumerable {
|
|
12
29
|
case light
|
|
13
30
|
case dark
|
|
@@ -46,7 +63,11 @@ internal final class HostViewProps: ExpoSwiftUI.ViewProps, ExpoSwiftUI.SafeAreaC
|
|
|
46
63
|
@Field var ignoreSafeArea: ExpoSwiftUI.IgnoreSafeArea?
|
|
47
64
|
@Field var modifiers: ModifierArray?
|
|
48
65
|
var onLayoutContent = EventDispatcher()
|
|
49
|
-
|
|
66
|
+
let hostingViewReference = HostingViewReference()
|
|
67
|
+
var hostingView: UIView? {
|
|
68
|
+
get { hostingViewReference.view }
|
|
69
|
+
set { hostingViewReference.view = newValue }
|
|
70
|
+
}
|
|
50
71
|
}
|
|
51
72
|
|
|
52
73
|
struct HostView: ExpoSwiftUI.View, ExpoSwiftUI.WithHostingView {
|
|
@@ -68,6 +89,7 @@ struct HostView: ExpoSwiftUI.View, ExpoSwiftUI.WithHostingView {
|
|
|
68
89
|
HostLayout {
|
|
69
90
|
Children()
|
|
70
91
|
}
|
|
92
|
+
.environment(\.expoHostingView, props.hostingViewReference)
|
|
71
93
|
.fixedSize(horizontal: props.matchContentsHorizontal, vertical: props.matchContentsVertical)
|
|
72
94
|
.modifier(LayoutDirectionModifier(layoutDirection: layoutDirection))
|
|
73
95
|
.modifier(ColorSchemeModifier(colorScheme: props.colorScheme?.toColorScheme()))
|
|
@@ -90,6 +112,7 @@ struct HostView: ExpoSwiftUI.View, ExpoSwiftUI.WithHostingView {
|
|
|
90
112
|
ZStack(alignment: alignment) {
|
|
91
113
|
Children()
|
|
92
114
|
}
|
|
115
|
+
.environment(\.expoHostingView, props.hostingViewReference)
|
|
93
116
|
.fixedSize(horizontal: props.matchContentsHorizontal, vertical: props.matchContentsVertical)
|
|
94
117
|
.modifier(LayoutDirectionModifier(layoutDirection: layoutDirection))
|
|
95
118
|
.modifier(ColorSchemeModifier(colorScheme: props.colorScheme?.toColorScheme()))
|
|
@@ -238,23 +238,39 @@ internal enum PresentationSizingOption: String, Enumerable {
|
|
|
238
238
|
case page
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
+
internal struct PresentationSizingFittedAxes: Record {
|
|
242
|
+
@Field var horizontal: Bool = false
|
|
243
|
+
@Field var vertical: Bool = false
|
|
244
|
+
}
|
|
245
|
+
|
|
241
246
|
internal struct PresentationSizingModifier: ViewModifier, Record {
|
|
242
247
|
@Field var sizing: PresentationSizingOption = .automatic
|
|
248
|
+
@Field var fitted: PresentationSizingFittedAxes?
|
|
243
249
|
|
|
244
250
|
func body(content: Content) -> some View {
|
|
245
251
|
if #available(iOS 18.0, tvOS 18.0, macOS 15.0, *) {
|
|
246
252
|
switch sizing {
|
|
247
253
|
case .automatic:
|
|
248
|
-
content.
|
|
254
|
+
applySizing(content, .automatic)
|
|
249
255
|
case .fitted:
|
|
250
|
-
content.
|
|
256
|
+
applySizing(content, .fitted)
|
|
251
257
|
case .form:
|
|
252
|
-
content.
|
|
258
|
+
applySizing(content, .form)
|
|
253
259
|
case .page:
|
|
254
|
-
content.
|
|
260
|
+
applySizing(content, .page)
|
|
255
261
|
}
|
|
256
262
|
} else {
|
|
257
263
|
content
|
|
258
264
|
}
|
|
259
265
|
}
|
|
266
|
+
|
|
267
|
+
@available(iOS 18.0, tvOS 18.0, macOS 15.0, *)
|
|
268
|
+
@ViewBuilder
|
|
269
|
+
private func applySizing(_ content: Content, _ sizing: some PresentationSizing) -> some View {
|
|
270
|
+
if let fitted {
|
|
271
|
+
content.presentationSizing(sizing.fitted(horizontal: fitted.horizontal, vertical: fitted.vertical))
|
|
272
|
+
} else {
|
|
273
|
+
content.presentationSizing(sizing)
|
|
274
|
+
}
|
|
275
|
+
}
|
|
260
276
|
}
|
package/ios/NamespaceView.swift
CHANGED
|
@@ -21,6 +21,7 @@ internal struct NamespaceView: ExpoSwiftUI.View {
|
|
|
21
21
|
NamespaceRegistry.shared.registerNamespace(namespace, forKey: props.id)
|
|
22
22
|
|
|
23
23
|
return Children()
|
|
24
|
+
.publishZeroContentOrigin(props.shadowNodeProxy)
|
|
24
25
|
.onDisappear {
|
|
25
26
|
NamespaceRegistry.shared.unregisterNamespace(forKey: props.id)
|
|
26
27
|
}
|
package/ios/RNHostView.swift
CHANGED
|
@@ -107,14 +107,17 @@ struct RNHostView: ExpoSwiftUI.View {
|
|
|
107
107
|
private struct PublishContentOriginModifier: ViewModifier {
|
|
108
108
|
let shadowNodeProxy: ExpoSwiftUI.ShadowNodeProxy
|
|
109
109
|
let isEnabled: Bool
|
|
110
|
+
@Environment(\.expoHostingView) private var hostingView
|
|
110
111
|
|
|
111
112
|
func body(content: Content) -> some View {
|
|
112
113
|
if isEnabled {
|
|
113
114
|
content
|
|
114
|
-
.onGeometryChange(for:
|
|
115
|
-
proxy
|
|
116
|
-
} action: {
|
|
117
|
-
|
|
115
|
+
.onGeometryChange(for: CGPoint?.self) { proxy in
|
|
116
|
+
originInHost(proxy)
|
|
117
|
+
} action: { origin in
|
|
118
|
+
if let origin {
|
|
119
|
+
shadowNodeProxy.setContentOrigin?(origin)
|
|
120
|
+
}
|
|
118
121
|
}
|
|
119
122
|
.onDisappear {
|
|
120
123
|
shadowNodeProxy.clearContentOrigin?()
|
|
@@ -123,6 +126,18 @@ private struct PublishContentOriginModifier: ViewModifier {
|
|
|
123
126
|
content
|
|
124
127
|
}
|
|
125
128
|
}
|
|
129
|
+
|
|
130
|
+
// Relative to the `Host`'s UIKit view, which Yoga laid out, so a safe-area inset is included.
|
|
131
|
+
private func originInHost(_ proxy: GeometryProxy) -> CGPoint? {
|
|
132
|
+
#if os(macOS)
|
|
133
|
+
return proxy.frame(in: .named(expoHostCoordinateSpace)).origin
|
|
134
|
+
#else
|
|
135
|
+
guard let hostView = hostingView?.view, let window = hostView.window else {
|
|
136
|
+
return nil
|
|
137
|
+
}
|
|
138
|
+
return hostView.convert(proxy.frame(in: .global).origin, from: window)
|
|
139
|
+
#endif
|
|
140
|
+
}
|
|
126
141
|
}
|
|
127
142
|
|
|
128
143
|
// Tracks the `RCTSurfaceTouchHandler` attached to a hosted RN view so it can be detached when the
|
package/ios/SlotView.swift
CHANGED
|
@@ -56,7 +56,9 @@ internal struct TabView: ExpoSwiftUI.View {
|
|
|
56
56
|
systemImage: tab.props.systemImage ?? "",
|
|
57
57
|
value: tab.props.value
|
|
58
58
|
) {
|
|
59
|
+
// The tab's own body does not run here, so publish its zero content origin on its content.
|
|
59
60
|
Self.tabContent(for: tab.props.children ?? [])
|
|
61
|
+
.publishZeroContentOrigin(tab.props.shadowNodeProxy)
|
|
60
62
|
}
|
|
61
63
|
#if !os(tvOS)
|
|
62
64
|
.badge(Self.badgeText(from: tab.props.modifiers))
|
package/ios/ToolbarView.swift
CHANGED
|
@@ -15,7 +15,8 @@ private struct ToolbarContentView: View {
|
|
|
15
15
|
let children = props.children ?? []
|
|
16
16
|
|
|
17
17
|
if children.contains(where: isItem) {
|
|
18
|
-
|
|
18
|
+
// The content slot's own body does not run here, so publish its zero content origin on the base.
|
|
19
|
+
children.reduce(AnyView(base.publishZeroContentOrigin(props.shadowNodeProxy))) { view, child in
|
|
19
20
|
let childView: any View = child.childView
|
|
20
21
|
|
|
21
22
|
guard let slot = child.childView as? SlotView, slot.props.name == "item" else {
|
package/ios/UIBaseView.swift
CHANGED
|
@@ -19,6 +19,19 @@ public struct UIBaseView<Props: UIBaseViewProps, Content: ExpoSwiftUI.View<Props
|
|
|
19
19
|
innerView
|
|
20
20
|
.applyAccessibilityIdentifier(props.testID)
|
|
21
21
|
.applyModifiers(props.modifiers, appContext: props.appContext, globalEventDispatcher: props.globalEventDispatcher)
|
|
22
|
+
.publishZeroContentOrigin(props.shadowNodeProxy)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
extension View {
|
|
27
|
+
/**
|
|
28
|
+
SwiftUI places this view, so `measure()` must skip its Yoga origin. A zero content origin does that,
|
|
29
|
+
and `RNHostView` reports its own position inside the `Host`. Core clears the entry on teardown.
|
|
30
|
+
*/
|
|
31
|
+
func publishZeroContentOrigin(_ shadowNodeProxy: ExpoSwiftUI.ShadowNodeProxy) -> some View {
|
|
32
|
+
onAppear {
|
|
33
|
+
shadowNodeProxy.setContentOrigin?(.zero)
|
|
34
|
+
}
|
|
22
35
|
}
|
|
23
36
|
}
|
|
24
37
|
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
6b0b0d2a72178b6d25a038ee47271abb
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
aef15fcbe60dff9cbb6491595df9269d819f7065
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
101a40d45fc8e73887c9518fbc88c31e2a700ca6e62d2cc96dd65f72459a9d69
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
79141ef63c1b975a30858d8c1ca7bccde8d14a64d337883063b3c1cbe44f977cc40e0fda89d3076fd84b5e47308e86b3659c71744a4fc3cac2b858a0686f38c6
|
|
Binary file
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.aar.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
812db5879217f7bbe3b44b5ffcb0725a
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.aar.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
64369f3b1f16363a28412ac36309b53dc2a29752
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.aar.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b8e480f4d8449359c2f5686c3614c9aa82ef98af9b7ce0edd4d839d14de7696f
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/58.0.16/expo.modules.ui-58.0.16.aar.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9e42c8a718971e6d77015353c6747570385fe0c1d901cf388a50509e00c9ee8581a81ba88d0e83a611b7ec5a6d1dff4280ecf81ed92776d2cf7c26f48c0048c5
|