@use-voltra/ios-client 1.4.1 → 2.0.0-rc.2
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/README.md +113 -0
- package/Voltra.podspec +28 -0
- package/build/commonjs/VoltraModule.js +13 -0
- package/build/commonjs/VoltraModule.js.map +1 -0
- package/build/commonjs/components/VoltraLiveActivityPreview.js +30 -0
- package/build/commonjs/components/VoltraLiveActivityPreview.js.map +1 -0
- package/build/commonjs/components/VoltraView.js +50 -0
- package/build/commonjs/components/VoltraView.js.map +1 -0
- package/build/commonjs/components/VoltraWidgetPreview.js +58 -0
- package/build/commonjs/components/VoltraWidgetPreview.js.map +1 -0
- package/build/commonjs/events.js +32 -0
- package/build/commonjs/events.js.map +1 -0
- package/build/commonjs/helpers.js +26 -0
- package/build/commonjs/helpers.js.map +1 -0
- package/build/commonjs/index.js +226 -0
- package/build/commonjs/index.js.map +1 -0
- package/build/commonjs/live-activity/api.js +168 -0
- package/build/commonjs/live-activity/api.js.map +1 -0
- package/build/commonjs/logger.js +39 -0
- package/build/commonjs/logger.js.map +1 -0
- package/build/commonjs/native/NativeVoltra.js +15 -0
- package/build/commonjs/native/NativeVoltra.js.map +1 -0
- package/build/commonjs/native/VoltraRNNativeComponent.ts +9 -0
- package/build/commonjs/package.json +1 -0
- package/build/commonjs/preload.js +54 -0
- package/build/commonjs/preload.js.map +1 -0
- package/build/commonjs/types.js +2 -0
- package/build/commonjs/types.js.map +1 -0
- package/build/commonjs/utils/assertRunningOnApple.js +16 -0
- package/build/commonjs/utils/assertRunningOnApple.js.map +1 -0
- package/build/commonjs/utils/helpers.js +19 -0
- package/build/commonjs/utils/helpers.js.map +1 -0
- package/build/commonjs/utils/index.js +28 -0
- package/build/commonjs/utils/index.js.map +1 -0
- package/build/commonjs/utils/useUpdateOnHMR.js +25 -0
- package/build/commonjs/utils/useUpdateOnHMR.js.map +1 -0
- package/build/commonjs/widgets/server-credentials.js +18 -0
- package/build/commonjs/widgets/server-credentials.js.map +1 -0
- package/build/commonjs/widgets/widget-api.js +55 -0
- package/build/commonjs/widgets/widget-api.js.map +1 -0
- package/build/module/VoltraModule.js +4 -0
- package/build/module/VoltraModule.js.map +1 -0
- package/build/module/components/VoltraLiveActivityPreview.js +25 -0
- package/build/module/components/VoltraLiveActivityPreview.js.map +1 -0
- package/build/module/components/VoltraView.js +44 -0
- package/build/module/components/VoltraView.js.map +1 -0
- package/build/module/components/VoltraWidgetPreview.js +53 -0
- package/build/module/components/VoltraWidgetPreview.js.map +1 -0
- package/build/module/events.js +28 -0
- package/build/module/events.js.map +1 -0
- package/build/module/helpers.js +21 -0
- package/build/module/helpers.js.map +1 -0
- package/build/module/index.js +17 -0
- package/build/module/index.js.map +1 -0
- package/build/module/live-activity/api.js +158 -0
- package/build/module/live-activity/api.js.map +1 -0
- package/build/module/logger.js +35 -0
- package/build/module/logger.js.map +1 -0
- package/build/module/native/NativeVoltra.js +11 -0
- package/build/module/native/NativeVoltra.js.map +1 -0
- package/build/module/native/VoltraRNNativeComponent.ts +9 -0
- package/build/module/package.json +1 -0
- package/build/module/preload.js +48 -0
- package/build/module/preload.js.map +1 -0
- package/build/module/types.js +2 -0
- package/build/module/types.js.map +1 -0
- package/build/module/utils/assertRunningOnApple.js +11 -0
- package/build/module/utils/assertRunningOnApple.js.map +1 -0
- package/build/module/utils/helpers.js +4 -0
- package/build/module/utils/helpers.js.map +1 -0
- package/build/module/utils/index.js +5 -0
- package/build/module/utils/index.js.map +1 -0
- package/build/module/utils/useUpdateOnHMR.js +20 -0
- package/build/module/utils/useUpdateOnHMR.js.map +1 -0
- package/build/module/widgets/server-credentials.js +13 -0
- package/build/module/widgets/server-credentials.js.map +1 -0
- package/build/module/widgets/widget-api.js +45 -0
- package/build/module/widgets/widget-api.js.map +1 -0
- package/build/typescript/commonjs/VoltraModule.d.ts +3 -0
- package/build/typescript/commonjs/VoltraModule.d.ts.map +1 -0
- package/build/typescript/commonjs/components/VoltraLiveActivityPreview.d.ts.map +1 -0
- package/build/typescript/commonjs/components/VoltraView.d.ts.map +1 -0
- package/build/typescript/commonjs/components/VoltraWidgetPreview.d.ts.map +1 -0
- package/build/typescript/commonjs/events.d.ts.map +1 -0
- package/build/typescript/commonjs/helpers.d.ts.map +1 -0
- package/build/{types → typescript/commonjs}/index.d.ts +5 -0
- package/build/typescript/commonjs/index.d.ts.map +1 -0
- package/build/typescript/commonjs/live-activity/api.d.ts.map +1 -0
- package/build/typescript/commonjs/logger.d.ts.map +1 -0
- package/build/typescript/commonjs/native/NativeVoltra.d.ts +100 -0
- package/build/typescript/commonjs/native/NativeVoltra.d.ts.map +1 -0
- package/build/typescript/commonjs/native/VoltraRNNativeComponent.d.ts +8 -0
- package/build/typescript/commonjs/native/VoltraRNNativeComponent.d.ts.map +1 -0
- package/build/typescript/commonjs/package.json +1 -0
- package/build/typescript/commonjs/preload.d.ts.map +1 -0
- package/build/typescript/commonjs/types.d.ts.map +1 -0
- package/build/typescript/commonjs/utils/assertRunningOnApple.d.ts.map +1 -0
- package/build/typescript/commonjs/utils/helpers.d.ts.map +1 -0
- package/build/typescript/commonjs/utils/index.d.ts.map +1 -0
- package/build/typescript/commonjs/utils/useUpdateOnHMR.d.ts.map +1 -0
- package/build/typescript/commonjs/widgets/server-credentials.d.ts.map +1 -0
- package/build/typescript/commonjs/widgets/widget-api.d.ts.map +1 -0
- package/build/typescript/module/VoltraModule.d.ts +3 -0
- package/build/typescript/module/VoltraModule.d.ts.map +1 -0
- package/build/typescript/module/components/VoltraLiveActivityPreview.d.ts +7 -0
- package/build/typescript/module/components/VoltraLiveActivityPreview.d.ts.map +1 -0
- package/build/typescript/module/components/VoltraView.d.ts +12 -0
- package/build/typescript/module/components/VoltraView.d.ts.map +1 -0
- package/build/typescript/module/components/VoltraWidgetPreview.d.ts +9 -0
- package/build/typescript/module/components/VoltraWidgetPreview.d.ts.map +1 -0
- package/build/typescript/module/events.d.ts +33 -0
- package/build/typescript/module/events.d.ts.map +1 -0
- package/build/typescript/module/helpers.d.ts +3 -0
- package/build/typescript/module/helpers.d.ts.map +1 -0
- package/build/typescript/module/index.d.ts +18 -0
- package/build/typescript/module/index.d.ts.map +1 -0
- package/build/typescript/module/live-activity/api.d.ts +35 -0
- package/build/typescript/module/live-activity/api.d.ts.map +1 -0
- package/build/typescript/module/logger.d.ts +16 -0
- package/build/typescript/module/logger.d.ts.map +1 -0
- package/build/typescript/module/native/NativeVoltra.d.ts +100 -0
- package/build/typescript/module/native/NativeVoltra.d.ts.map +1 -0
- package/build/typescript/module/native/VoltraRNNativeComponent.d.ts +8 -0
- package/build/typescript/module/native/VoltraRNNativeComponent.d.ts.map +1 -0
- package/build/typescript/module/package.json +1 -0
- package/build/typescript/module/preload.d.ts +6 -0
- package/build/typescript/module/preload.d.ts.map +1 -0
- package/build/typescript/module/types.d.ts +2 -0
- package/build/typescript/module/types.d.ts.map +1 -0
- package/build/typescript/module/utils/assertRunningOnApple.d.ts +2 -0
- package/build/typescript/module/utils/assertRunningOnApple.d.ts.map +1 -0
- package/build/{esm/utils/helpers.js → typescript/module/utils/helpers.d.ts} +1 -1
- package/build/typescript/module/utils/helpers.d.ts.map +1 -0
- package/build/{esm/utils/index.js → typescript/module/utils/index.d.ts} +1 -1
- package/build/typescript/module/utils/index.d.ts.map +1 -0
- package/build/typescript/module/utils/useUpdateOnHMR.d.ts +5 -0
- package/build/typescript/module/utils/useUpdateOnHMR.d.ts.map +1 -0
- package/build/typescript/module/widgets/server-credentials.d.ts +5 -0
- package/build/typescript/module/widgets/server-credentials.d.ts.map +1 -0
- package/build/typescript/module/widgets/widget-api.d.ts +11 -0
- package/build/typescript/module/widgets/widget-api.d.ts.map +1 -0
- package/expo-plugin/app.plugin.js +3 -0
- package/expo-plugin/build/cjs/constants.js +23 -0
- package/expo-plugin/build/cjs/constants.js.map +1 -0
- package/expo-plugin/build/cjs/index.js +51 -0
- package/expo-plugin/build/cjs/index.js.map +1 -0
- package/expo-plugin/build/cjs/ios/eas.js +28 -0
- package/expo-plugin/build/cjs/ios/eas.js.map +1 -0
- package/expo-plugin/build/cjs/ios/entitlements.js +46 -0
- package/expo-plugin/build/cjs/ios/entitlements.js.map +1 -0
- package/expo-plugin/build/cjs/ios/index.js +39 -0
- package/expo-plugin/build/cjs/ios/index.js.map +1 -0
- package/expo-plugin/build/cjs/ios/infoPlist.js +51 -0
- package/expo-plugin/build/cjs/ios/infoPlist.js.map +1 -0
- package/expo-plugin/build/cjs/ios/pushNotifications.js +22 -0
- package/expo-plugin/build/cjs/ios/pushNotifications.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/eas.js +66 -0
- package/expo-plugin/build/cjs/ios-widget/eas.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/assets.js +199 -0
- package/expo-plugin/build/cjs/ios-widget/files/assets.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/entitlements.js +77 -0
- package/expo-plugin/build/cjs/ios-widget/files/entitlements.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/index.js +92 -0
- package/expo-plugin/build/cjs/ios-widget/files/index.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/infoPlist.js +91 -0
- package/expo-plugin/build/cjs/ios-widget/files/infoPlist.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/swift.js +443 -0
- package/expo-plugin/build/cjs/ios-widget/files/swift.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/fonts.js +151 -0
- package/expo-plugin/build/cjs/ios-widget/fonts.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/index.js +46 -0
- package/expo-plugin/build/cjs/ios-widget/index.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/podfile.js +41 -0
- package/expo-plugin/build/cjs/ios-widget/podfile.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/widgetPlist.js +99 -0
- package/expo-plugin/build/cjs/ios-widget/widgetPlist.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/buildPhases.js +247 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/buildPhases.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/configurationList.js +91 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/configurationList.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/groups.js +79 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/groups.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/index.js +155 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/index.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/mainAppSettings.js +71 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/mainAppSettings.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/productFile.js +74 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/productFile.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/target.js +113 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/target.js.map +1 -0
- package/expo-plugin/build/cjs/utils/fileDiscovery.js +120 -0
- package/expo-plugin/build/cjs/utils/fileDiscovery.js.map +1 -0
- package/expo-plugin/build/cjs/utils/urlScheme.js +40 -0
- package/expo-plugin/build/cjs/utils/urlScheme.js.map +1 -0
- package/expo-plugin/build/cjs/validation.js +55 -0
- package/expo-plugin/build/cjs/validation.js.map +1 -0
- package/expo-plugin/build/esm/constants.js +20 -0
- package/expo-plugin/build/esm/constants.js.map +1 -0
- package/expo-plugin/build/esm/index.js +49 -0
- package/expo-plugin/build/esm/index.js.map +1 -0
- package/expo-plugin/build/esm/ios/eas.js +24 -0
- package/expo-plugin/build/esm/ios/eas.js.map +1 -0
- package/expo-plugin/build/esm/ios/entitlements.js +42 -0
- package/expo-plugin/build/esm/ios/entitlements.js.map +1 -0
- package/expo-plugin/build/esm/ios/index.js +34 -0
- package/expo-plugin/build/esm/ios/index.js.map +1 -0
- package/expo-plugin/build/esm/ios/infoPlist.js +47 -0
- package/expo-plugin/build/esm/ios/infoPlist.js.map +1 -0
- package/expo-plugin/build/esm/ios/pushNotifications.js +18 -0
- package/expo-plugin/build/esm/ios/pushNotifications.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/eas.js +62 -0
- package/expo-plugin/build/esm/ios-widget/eas.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/assets.js +163 -0
- package/expo-plugin/build/esm/ios-widget/files/assets.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/entitlements.js +37 -0
- package/expo-plugin/build/esm/ios-widget/files/entitlements.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/index.js +55 -0
- package/expo-plugin/build/esm/ios-widget/files/index.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/infoPlist.js +55 -0
- package/expo-plugin/build/esm/ios-widget/files/infoPlist.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/swift.js +403 -0
- package/expo-plugin/build/esm/ios-widget/files/swift.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/fonts.js +111 -0
- package/expo-plugin/build/esm/ios-widget/fonts.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/index.js +42 -0
- package/expo-plugin/build/esm/ios-widget/index.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/podfile.js +37 -0
- package/expo-plugin/build/esm/ios-widget/podfile.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/widgetPlist.js +92 -0
- package/expo-plugin/build/esm/ios-widget/widgetPlist.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/buildPhases.js +210 -0
- package/expo-plugin/build/esm/ios-widget/xcode/buildPhases.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/configurationList.js +87 -0
- package/expo-plugin/build/esm/ios-widget/xcode/configurationList.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/groups.js +75 -0
- package/expo-plugin/build/esm/ios-widget/xcode/groups.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/index.js +118 -0
- package/expo-plugin/build/esm/ios-widget/xcode/index.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/mainAppSettings.js +68 -0
- package/expo-plugin/build/esm/ios-widget/xcode/mainAppSettings.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/productFile.js +70 -0
- package/expo-plugin/build/esm/ios-widget/xcode/productFile.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/target.js +108 -0
- package/expo-plugin/build/esm/ios-widget/xcode/target.js.map +1 -0
- package/expo-plugin/build/esm/utils/fileDiscovery.js +83 -0
- package/expo-plugin/build/esm/utils/fileDiscovery.js.map +1 -0
- package/expo-plugin/build/esm/utils/urlScheme.js +37 -0
- package/expo-plugin/build/esm/utils/urlScheme.js.map +1 -0
- package/expo-plugin/build/esm/validation.js +51 -0
- package/expo-plugin/build/esm/validation.js.map +1 -0
- package/expo-plugin/build/types/constants.d.ts +13 -0
- package/expo-plugin/build/types/constants.d.ts.map +1 -0
- package/expo-plugin/build/types/index.d.ts +10 -0
- package/expo-plugin/build/types/index.d.ts.map +1 -0
- package/expo-plugin/build/types/ios/eas.d.ts +12 -0
- package/expo-plugin/build/types/ios/eas.d.ts.map +1 -0
- package/expo-plugin/build/types/ios/entitlements.d.ts +14 -0
- package/expo-plugin/build/types/ios/entitlements.d.ts.map +1 -0
- package/expo-plugin/build/types/ios/index.d.ts +19 -0
- package/expo-plugin/build/types/ios/index.d.ts.map +1 -0
- package/expo-plugin/build/types/ios/infoPlist.d.ts +21 -0
- package/expo-plugin/build/types/ios/infoPlist.d.ts.map +1 -0
- package/expo-plugin/build/types/ios/pushNotifications.d.ts +10 -0
- package/expo-plugin/build/types/ios/pushNotifications.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/eas.d.ts +15 -0
- package/expo-plugin/build/types/ios-widget/eas.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/assets.d.ts +13 -0
- package/expo-plugin/build/types/ios-widget/files/assets.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/entitlements.d.ts +17 -0
- package/expo-plugin/build/types/ios-widget/files/entitlements.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/index.d.ts +24 -0
- package/expo-plugin/build/types/ios-widget/files/index.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/infoPlist.d.ts +10 -0
- package/expo-plugin/build/types/ios-widget/files/infoPlist.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/swift.d.ts +24 -0
- package/expo-plugin/build/types/ios-widget/files/swift.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/fonts.d.ts +22 -0
- package/expo-plugin/build/types/ios-widget/fonts.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/index.d.ts +31 -0
- package/expo-plugin/build/types/ios-widget/index.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/podfile.d.ts +9 -0
- package/expo-plugin/build/types/ios-widget/podfile.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/widgetPlist.d.ts +20 -0
- package/expo-plugin/build/types/ios-widget/widgetPlist.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/buildPhases.d.ts +25 -0
- package/expo-plugin/build/types/ios-widget/xcode/buildPhases.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/configurationList.d.ts +20 -0
- package/expo-plugin/build/types/ios-widget/xcode/configurationList.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/groups.d.ts +15 -0
- package/expo-plugin/build/types/ios-widget/xcode/groups.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/index.d.ts +20 -0
- package/expo-plugin/build/types/ios-widget/xcode/index.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/mainAppSettings.d.ts +15 -0
- package/expo-plugin/build/types/ios-widget/xcode/mainAppSettings.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/productFile.d.ts +14 -0
- package/expo-plugin/build/types/ios-widget/xcode/productFile.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/target.d.ts +42 -0
- package/expo-plugin/build/types/ios-widget/xcode/target.d.ts.map +1 -0
- package/expo-plugin/build/types/types.d.ts +74 -0
- package/expo-plugin/build/types/types.d.ts.map +1 -0
- package/expo-plugin/build/types/utils/fileDiscovery.d.ts +15 -0
- package/expo-plugin/build/types/utils/fileDiscovery.d.ts.map +1 -0
- package/expo-plugin/build/types/utils/urlScheme.d.ts +10 -0
- package/expo-plugin/build/types/utils/urlScheme.d.ts.map +1 -0
- package/expo-plugin/build/types/validation.d.ts +4 -0
- package/expo-plugin/build/types/validation.d.ts.map +1 -0
- package/expo-plugin/jest.config.js +18 -0
- package/expo-plugin/src/constants.ts +25 -0
- package/expo-plugin/src/index.ts +72 -0
- package/expo-plugin/src/ios/eas.ts +33 -0
- package/expo-plugin/src/ios/entitlements.ts +59 -0
- package/expo-plugin/src/ios/index.ts +47 -0
- package/expo-plugin/src/ios/infoPlist.ts +63 -0
- package/expo-plugin/src/ios/pushNotifications.ts +22 -0
- package/expo-plugin/src/ios-widget/eas.ts +79 -0
- package/expo-plugin/src/ios-widget/files/assets.ts +201 -0
- package/expo-plugin/src/ios-widget/files/entitlements.ts +48 -0
- package/expo-plugin/src/ios-widget/files/index.ts +74 -0
- package/expo-plugin/src/ios-widget/files/infoPlist.ts +57 -0
- package/expo-plugin/src/ios-widget/files/swift.node.test.ts +22 -0
- package/expo-plugin/src/ios-widget/files/swift.ts +476 -0
- package/expo-plugin/src/ios-widget/fonts.ts +132 -0
- package/expo-plugin/src/ios-widget/index.ts +73 -0
- package/expo-plugin/src/ios-widget/podfile.ts +44 -0
- package/expo-plugin/src/ios-widget/widgetPlist.ts +115 -0
- package/expo-plugin/src/ios-widget/xcode/buildPhases.ts +301 -0
- package/expo-plugin/src/ios-widget/xcode/configurationList.ts +127 -0
- package/expo-plugin/src/ios-widget/xcode/groups.ts +101 -0
- package/expo-plugin/src/ios-widget/xcode/index.ts +149 -0
- package/expo-plugin/src/ios-widget/xcode/mainAppSettings.ts +95 -0
- package/expo-plugin/src/ios-widget/xcode/productFile.ts +91 -0
- package/expo-plugin/src/ios-widget/xcode/target.ts +148 -0
- package/expo-plugin/src/types.ts +89 -0
- package/expo-plugin/src/utils/fileDiscovery.ts +96 -0
- package/expo-plugin/src/utils/urlScheme.ts +45 -0
- package/expo-plugin/src/validation.node.test.ts +19 -0
- package/expo-plugin/src/validation.ts +63 -0
- package/expo-plugin/tsconfig.base.json +17 -0
- package/expo-plugin/tsconfig.cjs.json +9 -0
- package/expo-plugin/tsconfig.esm.json +9 -0
- package/expo-plugin/tsconfig.jest.json +8 -0
- package/expo-plugin/tsconfig.typecheck.json +12 -0
- package/expo-plugin/tsconfig.types.json +10 -0
- package/ios/Package.swift +68 -0
- package/ios/Tests/JSGradientParserTests.swift +201 -0
- package/ios/Tests/VoltraSharedTests/SmokeTests.swift +8 -0
- package/ios/VoltraWidget.podspec +30 -0
- package/ios/app/NativeVoltra.h +5 -0
- package/ios/app/NativeVoltra.mm +211 -0
- package/ios/app/VoltraActivity.swift +5 -0
- package/ios/app/VoltraImagePreload.swift +154 -0
- package/ios/app/VoltraLiveActivityManager.swift +228 -0
- package/ios/app/VoltraLiveActivityService.swift +306 -0
- package/ios/app/VoltraModule.swift +215 -0
- package/ios/app/VoltraModuleImpl.swift +331 -0
- package/ios/app/VoltraOptions.swift +27 -0
- package/ios/app/VoltraViewComponentView.h +10 -0
- package/ios/app/VoltraViewComponentView.mm +67 -0
- package/ios/app/VoltraViewRoot.swift +63 -0
- package/ios/app/VoltraWidgetService.swift +154 -0
- package/ios/shared/BrotliCompression.swift +81 -0
- package/ios/shared/ComponentTypeID.swift +117 -0
- package/ios/shared/Data+hexString.swift +8 -0
- package/ios/shared/Date+toTimerInterval.swift +25 -0
- package/ios/shared/JSONValue.swift +128 -0
- package/ios/shared/ShortNames.swift +180 -0
- package/ios/shared/VoltraAttributes.swift +58 -0
- package/ios/shared/VoltraConfig.swift +18 -0
- package/ios/shared/VoltraConstants.swift +45 -0
- package/ios/shared/VoltraElement.swift +153 -0
- package/ios/shared/VoltraEvent.swift +72 -0
- package/ios/shared/VoltraEventBus.swift +80 -0
- package/ios/shared/VoltraImageStore.swift +119 -0
- package/ios/shared/VoltraInitialStateLocale.swift +54 -0
- package/ios/shared/VoltraInteractionIntent.swift +39 -0
- package/ios/shared/VoltraKeychainHelper.swift +178 -0
- package/ios/shared/VoltraLiveActivityPayload.swift +113 -0
- package/ios/shared/VoltraLogger.swift +30 -0
- package/ios/shared/VoltraNode.swift +194 -0
- package/ios/shared/VoltraPayloadMigrator.swift +63 -0
- package/ios/shared/VoltraPersistentEventQueue.swift +67 -0
- package/ios/shared/VoltraRefreshIntent.swift +29 -0
- package/ios/shared/VoltraRegion.swift +37 -0
- package/ios/shared/VoltraWidgetDefaults.swift +114 -0
- package/ios/shared/VoltraWidgetServerFetcher.swift +166 -0
- package/ios/target/VoltraHomeWidget.swift +508 -0
- package/ios/target/VoltraWidget.swift +158 -0
- package/ios/ui/Extensions/View.modifiers.swift +28 -0
- package/ios/ui/Extensions/VoltraNode+Parameters.swift +18 -0
- package/ios/ui/Generated/Parameters/ButtonParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/ChartParameters.swift +33 -0
- package/ios/ui/Generated/Parameters/CircularProgressViewParameters.swift +59 -0
- package/ios/ui/Generated/Parameters/ComponentParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/DividerParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/GaugeParameters.swift +54 -0
- package/ios/ui/Generated/Parameters/GlassContainerParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/GroupBoxParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/HStackParameters.swift +34 -0
- package/ios/ui/Generated/Parameters/ImageParameters.swift +29 -0
- package/ios/ui/Generated/Parameters/LabelParameters.swift +18 -0
- package/ios/ui/Generated/Parameters/LinearGradientParameters.swift +27 -0
- package/ios/ui/Generated/Parameters/LinearProgressViewParameters.swift +64 -0
- package/ios/ui/Generated/Parameters/LinkParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/MaskParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/SpacerParameters.swift +15 -0
- package/ios/ui/Generated/Parameters/SymbolParameters.swift +59 -0
- package/ios/ui/Generated/Parameters/TextParameters.swift +18 -0
- package/ios/ui/Generated/Parameters/TimerParameters.swift +54 -0
- package/ios/ui/Generated/Parameters/ToggleParameters.swift +24 -0
- package/ios/ui/Generated/Parameters/VStackParameters.swift +34 -0
- package/ios/ui/Generated/Parameters/ViewParameters.swift +12 -0
- package/ios/ui/Generated/Parameters/ZStackParameters.swift +15 -0
- package/ios/ui/Helpers/VoltraDeepLinkResolver.swift +43 -0
- package/ios/ui/Helpers/VoltraProgressDriver.swift +52 -0
- package/ios/ui/Layout/FlexContainerHelper.swift +114 -0
- package/ios/ui/Layout/VoltraFlexStackLayout.swift +417 -0
- package/ios/ui/Protocols/VoltraView.swift +29 -0
- package/ios/ui/Style/BackgroundValue.swift +27 -0
- package/ios/ui/Style/CompositeStyle.swift +81 -0
- package/ios/ui/Style/DecorationStyle.swift +207 -0
- package/ios/ui/Style/FlexEnvironment.swift +35 -0
- package/ios/ui/Style/FontVariant.swift +4 -0
- package/ios/ui/Style/GlassEffect.swift +6 -0
- package/ios/ui/Style/JSColorParser.swift +517 -0
- package/ios/ui/Style/JSGradientParser.swift +674 -0
- package/ios/ui/Style/JSStyleParser.swift +223 -0
- package/ios/ui/Style/LayoutStyle.swift +184 -0
- package/ios/ui/Style/Overflow.swift +4 -0
- package/ios/ui/Style/RenderingStyle.swift +33 -0
- package/ios/ui/Style/StyleConverter.swift +202 -0
- package/ios/ui/Style/TextDecoration.swift +6 -0
- package/ios/ui/Style/TextStyle.swift +50 -0
- package/ios/ui/Style/View+applyStyle.swift +38 -0
- package/ios/ui/Views/VoltraButton.swift +57 -0
- package/ios/ui/Views/VoltraChart.swift +840 -0
- package/ios/ui/Views/VoltraCircularProgressView.swift +103 -0
- package/ios/ui/Views/VoltraDivider.swift +16 -0
- package/ios/ui/Views/VoltraFlexView.swift +33 -0
- package/ios/ui/Views/VoltraGauge.swift +65 -0
- package/ios/ui/Views/VoltraGlassContainer.swift +29 -0
- package/ios/ui/Views/VoltraGroupBox.swift +26 -0
- package/ios/ui/Views/VoltraHStack.swift +70 -0
- package/ios/ui/Views/VoltraImage.swift +109 -0
- package/ios/ui/Views/VoltraLabel.swift +24 -0
- package/ios/ui/Views/VoltraLinearGradient.swift +115 -0
- package/ios/ui/Views/VoltraLinearProgressView.swift +118 -0
- package/ios/ui/Views/VoltraLink.swift +25 -0
- package/ios/ui/Views/VoltraMask.swift +23 -0
- package/ios/ui/Views/VoltraSpacer.swift +16 -0
- package/ios/ui/Views/VoltraSymbol.swift +160 -0
- package/ios/ui/Views/VoltraText.swift +87 -0
- package/ios/ui/Views/VoltraTimer.swift +131 -0
- package/ios/ui/Views/VoltraToggle.swift +39 -0
- package/ios/ui/Views/VoltraVStack.swift +68 -0
- package/ios/ui/Views/VoltraZStack.swift +33 -0
- package/ios/ui/Voltra.swift +86 -0
- package/package.json +105 -19
- package/src/VoltraModule.ts +2 -0
- package/src/components/VoltraLiveActivityPreview.tsx +29 -0
- package/src/components/VoltraView.tsx +49 -0
- package/src/components/VoltraWidgetPreview.tsx +38 -0
- package/src/events.ts +70 -0
- package/src/helpers.ts +21 -0
- package/src/index.ts +52 -0
- package/src/live-activity/api.ts +224 -0
- package/src/logger.ts +35 -0
- package/src/native/NativeVoltra.ts +118 -0
- package/src/native/VoltraRNNativeComponent.ts +9 -0
- package/src/preload.ts +50 -0
- package/src/types.ts +12 -0
- package/src/utils/assertRunningOnApple.ts +10 -0
- package/src/utils/helpers.ts +1 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/useUpdateOnHMR.ts +25 -0
- package/src/widgets/server-credentials.ts +16 -0
- package/src/widgets/widget-api.ts +65 -0
- package/build/cjs/VoltraModule.js +0 -6
- package/build/cjs/VoltraModule.js.map +0 -1
- package/build/cjs/components/VoltraLiveActivityPreview.js +0 -20
- package/build/cjs/components/VoltraLiveActivityPreview.js.map +0 -1
- package/build/cjs/components/VoltraView.js +0 -37
- package/build/cjs/components/VoltraView.js.map +0 -1
- package/build/cjs/components/VoltraWidgetPreview.js +0 -26
- package/build/cjs/components/VoltraWidgetPreview.js.map +0 -1
- package/build/cjs/events.js +0 -19
- package/build/cjs/events.js.map +0 -1
- package/build/cjs/helpers.js +0 -30
- package/build/cjs/helpers.js.map +0 -1
- package/build/cjs/index.js +0 -49
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/live-activity/api.js +0 -158
- package/build/cjs/live-activity/api.js.map +0 -1
- package/build/cjs/logger.js +0 -36
- package/build/cjs/logger.js.map +0 -1
- package/build/cjs/preload.js +0 -54
- package/build/cjs/preload.js.map +0 -1
- package/build/cjs/utils/assertRunningOnApple.js +0 -13
- package/build/cjs/utils/assertRunningOnApple.js.map +0 -1
- package/build/cjs/utils/helpers.js +0 -7
- package/build/cjs/utils/helpers.js.map +0 -1
- package/build/cjs/utils/index.js +0 -19
- package/build/cjs/utils/index.js.map +0 -1
- package/build/cjs/utils/useUpdateOnHMR.js +0 -22
- package/build/cjs/utils/useUpdateOnHMR.js.map +0 -1
- package/build/cjs/widgets/server-credentials.js +0 -18
- package/build/cjs/widgets/server-credentials.js.map +0 -1
- package/build/cjs/widgets/widget-api.js +0 -59
- package/build/cjs/widgets/widget-api.js.map +0 -1
- package/build/esm/VoltraModule.js +0 -4
- package/build/esm/VoltraModule.js.map +0 -1
- package/build/esm/components/VoltraLiveActivityPreview.js +0 -17
- package/build/esm/components/VoltraLiveActivityPreview.js.map +0 -1
- package/build/esm/components/VoltraView.js +0 -34
- package/build/esm/components/VoltraView.js.map +0 -1
- package/build/esm/components/VoltraWidgetPreview.js +0 -23
- package/build/esm/components/VoltraWidgetPreview.js.map +0 -1
- package/build/esm/events.js +0 -13
- package/build/esm/events.js.map +0 -1
- package/build/esm/helpers.js +0 -23
- package/build/esm/helpers.js.map +0 -1
- package/build/esm/index.js +0 -10
- package/build/esm/index.js.map +0 -1
- package/build/esm/live-activity/api.js +0 -146
- package/build/esm/live-activity/api.js.map +0 -1
- package/build/esm/logger.js +0 -33
- package/build/esm/logger.js.map +0 -1
- package/build/esm/preload.js +0 -46
- package/build/esm/preload.js.map +0 -1
- package/build/esm/utils/assertRunningOnApple.js +0 -9
- package/build/esm/utils/assertRunningOnApple.js.map +0 -1
- package/build/esm/utils/helpers.js.map +0 -1
- package/build/esm/utils/index.js.map +0 -1
- package/build/esm/utils/useUpdateOnHMR.js +0 -18
- package/build/esm/utils/useUpdateOnHMR.js.map +0 -1
- package/build/esm/widgets/server-credentials.js +0 -11
- package/build/esm/widgets/server-credentials.js.map +0 -1
- package/build/esm/widgets/widget-api.js +0 -47
- package/build/esm/widgets/widget-api.js.map +0 -1
- package/build/types/VoltraModule.d.ts +0 -44
- package/build/types/VoltraModule.d.ts.map +0 -1
- package/build/types/components/VoltraLiveActivityPreview.d.ts.map +0 -1
- package/build/types/components/VoltraView.d.ts.map +0 -1
- package/build/types/components/VoltraWidgetPreview.d.ts.map +0 -1
- package/build/types/events.d.ts.map +0 -1
- package/build/types/helpers.d.ts.map +0 -1
- package/build/types/index.d.ts.map +0 -1
- package/build/types/live-activity/api.d.ts.map +0 -1
- package/build/types/logger.d.ts.map +0 -1
- package/build/types/preload.d.ts.map +0 -1
- package/build/types/types.d.ts.map +0 -1
- package/build/types/utils/assertRunningOnApple.d.ts.map +0 -1
- package/build/types/utils/helpers.d.ts.map +0 -1
- package/build/types/utils/index.d.ts.map +0 -1
- package/build/types/utils/useUpdateOnHMR.d.ts.map +0 -1
- package/build/types/widgets/server-credentials.d.ts.map +0 -1
- package/build/types/widgets/widget-api.d.ts.map +0 -1
- /package/build/{types → typescript/commonjs}/components/VoltraLiveActivityPreview.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/components/VoltraView.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/components/VoltraWidgetPreview.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/events.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/helpers.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/live-activity/api.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/logger.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/preload.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/types.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/utils/assertRunningOnApple.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/utils/helpers.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/utils/index.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/utils/useUpdateOnHMR.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/widgets/server-credentials.d.ts +0 -0
- /package/build/{types → typescript/commonjs}/widgets/widget-api.d.ts +0 -0
- /package/{build → expo-plugin/build}/cjs/package.json +0 -0
- /package/{build → expo-plugin/build}/cjs/types.js +0 -0
- /package/{build → expo-plugin/build}/cjs/types.js.map +0 -0
- /package/{build → expo-plugin/build}/esm/package.json +0 -0
- /package/{build → expo-plugin/build}/esm/types.js +0 -0
- /package/{build → expo-plugin/build}/esm/types.js.map +0 -0
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
// MARK: - Voltra Flex Stack Layout
|
|
4
|
+
|
|
5
|
+
/// SwiftUI Layout implementing RN-like flexbox for a single axis
|
|
6
|
+
struct VoltraFlexStackLayout: Layout {
|
|
7
|
+
let axis: Axis // .vertical or .horizontal
|
|
8
|
+
let spacing: CGFloat
|
|
9
|
+
let alignItems: FlexAlign // Default: .stretch
|
|
10
|
+
let justifyContent: FlexJustify // Default: .flexStart
|
|
11
|
+
let containerPadding: EdgeInsets // From container's style
|
|
12
|
+
|
|
13
|
+
// MARK: - sizeThatFits
|
|
14
|
+
|
|
15
|
+
func sizeThatFits(
|
|
16
|
+
proposal: ProposedViewSize,
|
|
17
|
+
subviews: Subviews,
|
|
18
|
+
cache _: inout ()
|
|
19
|
+
) -> CGSize {
|
|
20
|
+
let available = availableSize(from: proposal)
|
|
21
|
+
let resolved = resolveChildren(subviews: subviews, available: available)
|
|
22
|
+
let totalMain = resolved.reduce(0) { $0 + $1.mainSize + $1.mainMargin }
|
|
23
|
+
+ spacing * CGFloat(max(0, subviews.count - 1))
|
|
24
|
+
let maxCross = resolved.reduce(0) { max($0, $1.crossSize + $1.crossMargin) }
|
|
25
|
+
|
|
26
|
+
let mainSize = main(from: proposal) ?? (totalMain + mainPadding)
|
|
27
|
+
let crossSize = cross(from: proposal) ?? (maxCross + crossPadding)
|
|
28
|
+
|
|
29
|
+
return size(main: mainSize, cross: crossSize)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// MARK: - placeSubviews
|
|
33
|
+
|
|
34
|
+
func placeSubviews(
|
|
35
|
+
in bounds: CGRect,
|
|
36
|
+
proposal _: ProposedViewSize,
|
|
37
|
+
subviews: Subviews,
|
|
38
|
+
cache _: inout ()
|
|
39
|
+
) {
|
|
40
|
+
let available = CGSize(
|
|
41
|
+
width: bounds.width - leadingPad - trailingPad,
|
|
42
|
+
height: bounds.height - topPad - bottomPad
|
|
43
|
+
)
|
|
44
|
+
let resolved = resolveChildren(subviews: subviews, available: available)
|
|
45
|
+
|
|
46
|
+
// Compute main-axis positions based on justifyContent
|
|
47
|
+
let totalChildrenAndMargins = resolved.reduce(CGFloat(0)) { $0 + $1.mainSize + $1.mainMargin }
|
|
48
|
+
let baseSpacing = spacing * CGFloat(max(0, subviews.count - 1))
|
|
49
|
+
let usesJustifySpacing = justifyContent == .spaceBetween || justifyContent == .spaceAround || justifyContent == .spaceEvenly
|
|
50
|
+
// For spacing-based justify modes, remaining space includes base spacing (justify replaces it)
|
|
51
|
+
let totalMain = totalChildrenAndMargins + (usesJustifySpacing ? 0 : baseSpacing)
|
|
52
|
+
let remainingMain = mainAxis(available) - totalMain
|
|
53
|
+
let (startOffset, gapSpacing) = justifyOffsets(
|
|
54
|
+
remaining: remainingMain, count: subviews.count
|
|
55
|
+
)
|
|
56
|
+
// For spacing-based justify, gapSpacing replaces base spacing; otherwise add extraSpacing (0) to base
|
|
57
|
+
let effectiveSpacing = usesJustifySpacing ? gapSpacing : (spacing + gapSpacing)
|
|
58
|
+
|
|
59
|
+
var mainCursor = mainStart(bounds) + startOffset
|
|
60
|
+
|
|
61
|
+
for (index, subview) in subviews.enumerated() {
|
|
62
|
+
let child = resolved[index]
|
|
63
|
+
|
|
64
|
+
// Main-axis: advance by leading margin
|
|
65
|
+
mainCursor += child.mainMarginLeading
|
|
66
|
+
|
|
67
|
+
// Cross-axis: align based on alignItems / alignSelf
|
|
68
|
+
let crossPos = crossPosition(
|
|
69
|
+
child: child,
|
|
70
|
+
availableCross: crossAxis(available),
|
|
71
|
+
boundsOrigin: crossStart(bounds)
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
let point = position(main: mainCursor, cross: crossPos)
|
|
75
|
+
let childProposal = ProposedViewSize(
|
|
76
|
+
width: axis == .horizontal ? child.mainSize : child.crossSize,
|
|
77
|
+
height: axis == .vertical ? child.mainSize : child.crossSize
|
|
78
|
+
)
|
|
79
|
+
subview.place(at: point, anchor: .topLeading, proposal: childProposal)
|
|
80
|
+
|
|
81
|
+
mainCursor += child.mainSize + child.mainMarginTrailing + effectiveSpacing
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// MARK: - Child Resolution
|
|
86
|
+
|
|
87
|
+
private struct ResolvedChild {
|
|
88
|
+
let mainSize: CGFloat
|
|
89
|
+
let crossSize: CGFloat
|
|
90
|
+
let mainMarginLeading: CGFloat
|
|
91
|
+
let mainMarginTrailing: CGFloat
|
|
92
|
+
let crossMarginLeading: CGFloat
|
|
93
|
+
let crossMarginTrailing: CGFloat
|
|
94
|
+
var mainMargin: CGFloat {
|
|
95
|
+
mainMarginLeading + mainMarginTrailing
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
var crossMargin: CGFloat {
|
|
99
|
+
crossMarginLeading + crossMarginTrailing
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
let alignSelf: FlexAlign?
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
private func resolveChildren(
|
|
106
|
+
subviews: Subviews,
|
|
107
|
+
available: CGSize
|
|
108
|
+
) -> [ResolvedChild] {
|
|
109
|
+
let availableMain = mainAxis(available)
|
|
110
|
+
let availableCross = crossAxis(available)
|
|
111
|
+
|
|
112
|
+
// Step 1: Compute base sizes
|
|
113
|
+
var items: [(index: Int, baseMain: CGFloat, flexGrow: CGFloat, flexShrink: CGFloat,
|
|
114
|
+
minMain: CGFloat?, maxMain: CGFloat?, crossSize: CGFloat,
|
|
115
|
+
margin: EdgeInsets?, alignSelf: FlexAlign?)] = []
|
|
116
|
+
|
|
117
|
+
for (i, subview) in subviews.enumerated() {
|
|
118
|
+
let values = subview[FlexItemLayoutKey.self]
|
|
119
|
+
let margin = values.margin ?? EdgeInsets()
|
|
120
|
+
|
|
121
|
+
// Determine main-axis basis
|
|
122
|
+
let mainBasis: CGFloat
|
|
123
|
+
if let basis = values.flexBasis {
|
|
124
|
+
switch basis {
|
|
125
|
+
case let .fixed(v): mainBasis = v
|
|
126
|
+
case .fill: mainBasis = availableMain.isFinite ? availableMain : measureIntrinsicMain(subview, availableCross: availableCross, values: values)
|
|
127
|
+
case .wrap: mainBasis = measureIntrinsicMain(subview, availableCross: availableCross, values: values)
|
|
128
|
+
}
|
|
129
|
+
} else {
|
|
130
|
+
// flexBasis: auto → use width/height if set, else intrinsic
|
|
131
|
+
mainBasis = resolveAutoMainBasis(subview, values: values, availableMain: availableMain, availableCross: availableCross)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Determine cross-axis size
|
|
135
|
+
// Only stretch to a finite available cross; infinite means intrinsic measurement
|
|
136
|
+
let effectiveAlign = values.alignSelf ?? alignItems
|
|
137
|
+
let crossProposal: CGFloat? = (effectiveAlign == .stretch && availableCross.isFinite) ? availableCross : nil
|
|
138
|
+
let crossSize = resolveCrossSize(subview, values: values, proposal: crossProposal, availableCross: availableCross)
|
|
139
|
+
|
|
140
|
+
// Min/max on main axis
|
|
141
|
+
let (minMain, maxMain) = mainMinMax(values)
|
|
142
|
+
|
|
143
|
+
let clampedBase = clamp(mainBasis, min: minMain, max: maxMain)
|
|
144
|
+
|
|
145
|
+
items.append((i, clampedBase, values.flexGrow, values.flexShrink,
|
|
146
|
+
minMain, maxMain, crossSize, values.margin, values.alignSelf))
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Step 2: Compute total base + margins + spacing
|
|
150
|
+
let totalMargins = items.reduce(CGFloat(0)) { total, item in
|
|
151
|
+
total + mainMarginSum(item.margin ?? EdgeInsets())
|
|
152
|
+
}
|
|
153
|
+
let totalSpacing = spacing * CGFloat(max(0, items.count - 1))
|
|
154
|
+
let totalBase = items.reduce(CGFloat(0)) { $0 + $1.baseMain }
|
|
155
|
+
let usedSpace = totalBase + totalMargins + totalSpacing
|
|
156
|
+
let freeSpace = availableMain - usedSpace
|
|
157
|
+
|
|
158
|
+
// Step 3: Distribute free space
|
|
159
|
+
var finalMainSizes = items.map(\.baseMain)
|
|
160
|
+
|
|
161
|
+
if freeSpace > 0 {
|
|
162
|
+
// Grow
|
|
163
|
+
let totalGrow = items.reduce(CGFloat(0)) { $0 + $1.flexGrow }
|
|
164
|
+
if totalGrow > 0 {
|
|
165
|
+
for (j, item) in items.enumerated() {
|
|
166
|
+
if item.flexGrow > 0 {
|
|
167
|
+
let share = freeSpace * (item.flexGrow / totalGrow)
|
|
168
|
+
finalMainSizes[j] = clamp(item.baseMain + share, min: item.minMain, max: item.maxMain)
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
} else if freeSpace < 0 {
|
|
173
|
+
// Shrink
|
|
174
|
+
let totalShrink = items.reduce(CGFloat(0)) { $0 + $1.flexShrink }
|
|
175
|
+
if totalShrink > 0 {
|
|
176
|
+
let deficit = -freeSpace
|
|
177
|
+
for (j, item) in items.enumerated() {
|
|
178
|
+
if item.flexShrink > 0 {
|
|
179
|
+
let share = deficit * (item.flexShrink / totalShrink)
|
|
180
|
+
finalMainSizes[j] = clamp(item.baseMain - share, min: item.minMain, max: item.maxMain)
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Step 4: Build resolved children
|
|
187
|
+
return items.enumerated().map { j, item in
|
|
188
|
+
let m = item.margin ?? EdgeInsets()
|
|
189
|
+
return ResolvedChild(
|
|
190
|
+
mainSize: max(0, finalMainSizes[j]),
|
|
191
|
+
crossSize: item.crossSize,
|
|
192
|
+
mainMarginLeading: mainLeadingMargin(m),
|
|
193
|
+
mainMarginTrailing: mainTrailingMargin(m),
|
|
194
|
+
crossMarginLeading: crossLeadingMargin(m),
|
|
195
|
+
crossMarginTrailing: crossTrailingMargin(m),
|
|
196
|
+
alignSelf: item.alignSelf
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// MARK: - Measurement Helpers
|
|
202
|
+
|
|
203
|
+
/// Measure child's intrinsic main-axis size (flexBasis: auto, no explicit size)
|
|
204
|
+
private func measureIntrinsicMain(
|
|
205
|
+
_ subview: LayoutSubview,
|
|
206
|
+
availableCross: CGFloat,
|
|
207
|
+
values _: FlexItemValues
|
|
208
|
+
) -> CGFloat {
|
|
209
|
+
let proposal: ProposedViewSize
|
|
210
|
+
if axis == .horizontal {
|
|
211
|
+
proposal = ProposedViewSize(width: nil, height: availableCross)
|
|
212
|
+
} else {
|
|
213
|
+
proposal = ProposedViewSize(width: availableCross, height: nil)
|
|
214
|
+
}
|
|
215
|
+
let size = subview.sizeThatFits(proposal)
|
|
216
|
+
return mainAxis(size)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/// Resolve auto basis: use explicit width/height if set, else intrinsic
|
|
220
|
+
private func resolveAutoMainBasis(
|
|
221
|
+
_ subview: LayoutSubview,
|
|
222
|
+
values: FlexItemValues,
|
|
223
|
+
availableMain: CGFloat,
|
|
224
|
+
availableCross: CGFloat
|
|
225
|
+
) -> CGFloat {
|
|
226
|
+
let explicitMain = axis == .horizontal ? values.width : values.height
|
|
227
|
+
if let explicit = explicitMain {
|
|
228
|
+
switch explicit {
|
|
229
|
+
case let .fixed(v): return v
|
|
230
|
+
case .fill: return availableMain.isFinite ? availableMain : measureIntrinsicMain(subview, availableCross: availableCross, values: values)
|
|
231
|
+
case .wrap: break
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return measureIntrinsicMain(subview, availableCross: availableCross, values: values)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/// Resolve cross-axis size
|
|
238
|
+
private func resolveCrossSize(
|
|
239
|
+
_ subview: LayoutSubview,
|
|
240
|
+
values: FlexItemValues,
|
|
241
|
+
proposal: CGFloat?,
|
|
242
|
+
availableCross: CGFloat
|
|
243
|
+
) -> CGFloat {
|
|
244
|
+
let explicitCross = axis == .horizontal ? values.height : values.width
|
|
245
|
+
if let explicit = explicitCross {
|
|
246
|
+
switch explicit {
|
|
247
|
+
case let .fixed(v): return v
|
|
248
|
+
case .fill: return availableCross.isFinite ? availableCross : crossAxis(subview.sizeThatFits(ProposedViewSize(width: nil, height: nil)))
|
|
249
|
+
case .wrap: break
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
// If stretch and no explicit cross size, use full cross axis (only finite values)
|
|
253
|
+
if let proposal = proposal, proposal.isFinite { return proposal }
|
|
254
|
+
// Otherwise, measure intrinsic
|
|
255
|
+
let size = subview.sizeThatFits(ProposedViewSize(width: nil, height: nil))
|
|
256
|
+
return crossAxis(size)
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
private func mainMinMax(_ values: FlexItemValues) -> (CGFloat?, CGFloat?) {
|
|
260
|
+
if axis == .horizontal {
|
|
261
|
+
return (values.minWidth, values.maxWidth)
|
|
262
|
+
} else {
|
|
263
|
+
return (values.minHeight, values.maxHeight)
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
private func clamp(_ value: CGFloat, min: CGFloat?, max: CGFloat?) -> CGFloat {
|
|
268
|
+
var result = value
|
|
269
|
+
if let min = min { result = Swift.max(result, min) }
|
|
270
|
+
if let max = max { result = Swift.min(result, max) }
|
|
271
|
+
return result
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// MARK: - Justify Content
|
|
275
|
+
|
|
276
|
+
private func justifyOffsets(remaining: CGFloat, count: Int) -> (start: CGFloat, extraSpacing: CGFloat) {
|
|
277
|
+
guard count > 0 else { return (0, 0) }
|
|
278
|
+
switch justifyContent {
|
|
279
|
+
case .flexStart: return (0, 0)
|
|
280
|
+
case .flexEnd: return (max(0, remaining), 0)
|
|
281
|
+
case .center: return (max(0, remaining / 2), 0)
|
|
282
|
+
case .spaceBetween:
|
|
283
|
+
guard count > 1 else { return (0, 0) }
|
|
284
|
+
return (0, max(0, remaining / CGFloat(count - 1)))
|
|
285
|
+
case .spaceAround:
|
|
286
|
+
let gap = remaining / CGFloat(count)
|
|
287
|
+
return (max(0, gap / 2), max(0, gap))
|
|
288
|
+
case .spaceEvenly:
|
|
289
|
+
let gap = remaining / CGFloat(count + 1)
|
|
290
|
+
return (max(0, gap), max(0, gap))
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// MARK: - Cross-Axis Positioning
|
|
295
|
+
|
|
296
|
+
private func crossPosition(
|
|
297
|
+
child: ResolvedChild,
|
|
298
|
+
availableCross: CGFloat,
|
|
299
|
+
boundsOrigin: CGFloat
|
|
300
|
+
) -> CGFloat {
|
|
301
|
+
let effectiveAlign = child.alignSelf ?? alignItems
|
|
302
|
+
let childCrossWithMargin = child.crossSize + child.crossMargin
|
|
303
|
+
let remaining = availableCross - childCrossWithMargin
|
|
304
|
+
|
|
305
|
+
let alignedPos: CGFloat
|
|
306
|
+
switch effectiveAlign {
|
|
307
|
+
case .flexStart:
|
|
308
|
+
alignedPos = 0
|
|
309
|
+
case .flexEnd:
|
|
310
|
+
alignedPos = max(0, remaining)
|
|
311
|
+
case .center:
|
|
312
|
+
alignedPos = max(0, remaining / 2)
|
|
313
|
+
case .stretch:
|
|
314
|
+
alignedPos = 0 // stretch already applied in size
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
return boundsOrigin + alignedPos + child.crossMarginLeading + crossPaddingLeading
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// MARK: - Axis Helpers
|
|
321
|
+
|
|
322
|
+
private var mainPadding: CGFloat {
|
|
323
|
+
axis == .horizontal
|
|
324
|
+
? containerPadding.leading + containerPadding.trailing
|
|
325
|
+
: containerPadding.top + containerPadding.bottom
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
private var crossPadding: CGFloat {
|
|
329
|
+
axis == .horizontal
|
|
330
|
+
? containerPadding.top + containerPadding.bottom
|
|
331
|
+
: containerPadding.leading + containerPadding.trailing
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
private var leadingPad: CGFloat {
|
|
335
|
+
containerPadding.leading
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
private var trailingPad: CGFloat {
|
|
339
|
+
containerPadding.trailing
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
private var topPad: CGFloat {
|
|
343
|
+
containerPadding.top
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
private var bottomPad: CGFloat {
|
|
347
|
+
containerPadding.bottom
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
private var crossPaddingLeading: CGFloat {
|
|
351
|
+
axis == .horizontal ? containerPadding.top : containerPadding.leading
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
private func mainAxis(_ size: CGSize) -> CGFloat {
|
|
355
|
+
axis == .horizontal ? size.width : size.height
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
private func crossAxis(_ size: CGSize) -> CGFloat {
|
|
359
|
+
axis == .horizontal ? size.height : size.width
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
private func main(from proposal: ProposedViewSize) -> CGFloat? {
|
|
363
|
+
axis == .horizontal ? proposal.width : proposal.height
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
private func cross(from proposal: ProposedViewSize) -> CGFloat? {
|
|
367
|
+
axis == .horizontal ? proposal.height : proposal.width
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
private func size(main: CGFloat, cross: CGFloat) -> CGSize {
|
|
371
|
+
axis == .horizontal ? CGSize(width: main, height: cross) : CGSize(width: cross, height: main)
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
private func position(main: CGFloat, cross: CGFloat) -> CGPoint {
|
|
375
|
+
axis == .horizontal ? CGPoint(x: main, y: cross) : CGPoint(x: cross, y: main)
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
private func mainStart(_ bounds: CGRect) -> CGFloat {
|
|
379
|
+
axis == .horizontal ? bounds.minX + containerPadding.leading : bounds.minY + containerPadding.top
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
private func crossStart(_ bounds: CGRect) -> CGFloat {
|
|
383
|
+
axis == .horizontal ? bounds.minY : bounds.minX
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
private func availableSize(from proposal: ProposedViewSize) -> CGSize {
|
|
387
|
+
// nil proposal = intrinsic sizing → treat as unconstrained (.infinity)
|
|
388
|
+
CGSize(
|
|
389
|
+
width: max(0, (proposal.width ?? .infinity) - containerPadding.leading - containerPadding.trailing),
|
|
390
|
+
height: max(0, (proposal.height ?? .infinity) - containerPadding.top - containerPadding.bottom)
|
|
391
|
+
)
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// MARK: - Margin Helpers
|
|
395
|
+
|
|
396
|
+
private func mainMarginSum(_ margin: EdgeInsets) -> CGFloat {
|
|
397
|
+
axis == .horizontal
|
|
398
|
+
? margin.leading + margin.trailing
|
|
399
|
+
: margin.top + margin.bottom
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
private func mainLeadingMargin(_ margin: EdgeInsets) -> CGFloat {
|
|
403
|
+
axis == .horizontal ? margin.leading : margin.top
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
private func mainTrailingMargin(_ margin: EdgeInsets) -> CGFloat {
|
|
407
|
+
axis == .horizontal ? margin.trailing : margin.bottom
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
private func crossLeadingMargin(_ margin: EdgeInsets) -> CGFloat {
|
|
411
|
+
axis == .horizontal ? margin.top : margin.leading
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
private func crossTrailingMargin(_ margin: EdgeInsets) -> CGFloat {
|
|
415
|
+
axis == .horizontal ? margin.bottom : margin.trailing
|
|
416
|
+
}
|
|
417
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
/// Protocol for Voltra component views with typed parameters
|
|
4
|
+
public protocol VoltraView: View {
|
|
5
|
+
/// The parameters type for this component
|
|
6
|
+
associatedtype Parameters: ComponentParameters
|
|
7
|
+
|
|
8
|
+
/// The backing element
|
|
9
|
+
var element: VoltraElement { get }
|
|
10
|
+
|
|
11
|
+
init(_ element: VoltraElement)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public extension VoltraView {
|
|
15
|
+
/// Automatically typed parameters accessor
|
|
16
|
+
var params: Parameters {
|
|
17
|
+
element.parameters(Parameters.self)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/// Empty parameters for components that don't need any
|
|
22
|
+
public struct EmptyParameters: ComponentParameters {}
|
|
23
|
+
|
|
24
|
+
/// Convenience extension for views with no parameters
|
|
25
|
+
public extension VoltraView where Parameters == EmptyParameters {
|
|
26
|
+
var params: EmptyParameters {
|
|
27
|
+
EmptyParameters()
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
enum RadialGradientShape {
|
|
4
|
+
case circle
|
|
5
|
+
case ellipse
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
enum RadialGradientExtent {
|
|
9
|
+
case closestSide
|
|
10
|
+
case farthestSide
|
|
11
|
+
case closestCorner
|
|
12
|
+
case farthestCorner
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
struct RadialGradientSpec {
|
|
16
|
+
var gradient: Gradient
|
|
17
|
+
var center: UnitPoint
|
|
18
|
+
var shape: RadialGradientShape
|
|
19
|
+
var extent: RadialGradientExtent
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
enum BackgroundValue {
|
|
23
|
+
case color(Color)
|
|
24
|
+
case linearGradient(gradient: Gradient, startPoint: UnitPoint, endPoint: UnitPoint)
|
|
25
|
+
case radialGradient(spec: RadialGradientSpec)
|
|
26
|
+
case angularGradient(gradient: Gradient, center: UnitPoint, angle: Angle)
|
|
27
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
struct CompositeStyleModifier: ViewModifier {
|
|
4
|
+
@Environment(\.isInFlexContainer) var isInFlexContainer
|
|
5
|
+
|
|
6
|
+
let layout: LayoutStyle
|
|
7
|
+
let decoration: DecorationStyle
|
|
8
|
+
let rendering: RenderingStyle
|
|
9
|
+
var contentAlignment: Alignment = .topLeading
|
|
10
|
+
|
|
11
|
+
func body(content: Content) -> some View {
|
|
12
|
+
Group {
|
|
13
|
+
if isInFlexContainer {
|
|
14
|
+
// FLEX CHILD PATH:
|
|
15
|
+
// 1. Skip LayoutModifier (no .frame() — parent layout controls sizing)
|
|
16
|
+
// 2. Apply padding (inner spacing is still the child's responsibility)
|
|
17
|
+
// 3. Apply decoration + rendering
|
|
18
|
+
// 4. Attach LayoutValueKey for parent flex layout to read
|
|
19
|
+
|
|
20
|
+
content
|
|
21
|
+
.voltraIfLet(layout.padding) { c, p in c.padding(p) }
|
|
22
|
+
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: contentAlignment)
|
|
23
|
+
.modifier(DecorationModifier(style: decoration, layout: layout))
|
|
24
|
+
.modifier(RenderingModifier(style: rendering))
|
|
25
|
+
.layoutValue(key: FlexItemLayoutKey.self, value: FlexItemValues(
|
|
26
|
+
flexGrow: layout.flexGrow,
|
|
27
|
+
flexShrink: layout.flexShrink,
|
|
28
|
+
flexBasis: layout.flexBasis,
|
|
29
|
+
width: layout.width,
|
|
30
|
+
height: layout.height,
|
|
31
|
+
minWidth: layout.minWidth,
|
|
32
|
+
maxWidth: layout.maxWidth,
|
|
33
|
+
minHeight: layout.minHeight,
|
|
34
|
+
maxHeight: layout.maxHeight,
|
|
35
|
+
alignSelf: layout.alignSelf,
|
|
36
|
+
margin: layout.margin,
|
|
37
|
+
aspectRatio: layout.aspectRatio
|
|
38
|
+
))
|
|
39
|
+
} else {
|
|
40
|
+
// LEGACY PATH
|
|
41
|
+
content
|
|
42
|
+
.modifier(LayoutModifier(style: layout, contentAlignment: contentAlignment))
|
|
43
|
+
.voltraIfLet(layout.alignSelf) { content, alignSelf in
|
|
44
|
+
let alignment: Alignment = switch alignSelf {
|
|
45
|
+
case .flexStart: .topLeading
|
|
46
|
+
case .center: .center
|
|
47
|
+
case .flexEnd: .bottomTrailing
|
|
48
|
+
case .stretch: .center
|
|
49
|
+
}
|
|
50
|
+
content.frame(
|
|
51
|
+
maxWidth: alignSelf == .stretch ? .infinity : nil,
|
|
52
|
+
maxHeight: alignSelf == .stretch ? .infinity : nil,
|
|
53
|
+
alignment: alignment
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
.modifier(DecorationModifier(style: decoration, layout: layout))
|
|
57
|
+
.modifier(RenderingModifier(style: rendering))
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Margin (flex engine handles margin via LayoutValueKey;
|
|
61
|
+
// in legacy mode, applied as SwiftUI padding)
|
|
62
|
+
.voltraIf(!isInFlexContainer) { content in
|
|
63
|
+
content.voltraIfLet(layout.margin) { c, margin in
|
|
64
|
+
c.background(.clear).padding(margin)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Apply relative positioning (offset from natural position)
|
|
68
|
+
.voltraIfLet(layout.relativeOffset) { content, offset in
|
|
69
|
+
content.offset(x: offset.x, y: offset.y)
|
|
70
|
+
}
|
|
71
|
+
// Apply absolute positioning (center-based)
|
|
72
|
+
.voltraIfLet(layout.absolutePosition) { content, position in
|
|
73
|
+
content.position(x: position.x, y: position.y)
|
|
74
|
+
}
|
|
75
|
+
.voltraIfLet(layout.zIndex) { content, zIndex in
|
|
76
|
+
content.zIndex(zIndex)
|
|
77
|
+
}
|
|
78
|
+
// CRITICAL: Reset environment so nested children behave normally
|
|
79
|
+
.environment(\.isInFlexContainer, false)
|
|
80
|
+
}
|
|
81
|
+
}
|