@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,103 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
public struct VoltraCircularProgressView: VoltraView {
|
|
4
|
+
public typealias Parameters = CircularProgressViewParameters
|
|
5
|
+
|
|
6
|
+
public let element: VoltraElement
|
|
7
|
+
|
|
8
|
+
public init(_ element: VoltraElement) {
|
|
9
|
+
self.element = element
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@ViewBuilder
|
|
13
|
+
public var body: some View {
|
|
14
|
+
let p = params
|
|
15
|
+
let progressColor = p.progressColor.flatMap { JSColorParser.parse($0) }
|
|
16
|
+
let trackColor = p.trackColor.flatMap { JSColorParser.parse($0) }
|
|
17
|
+
let lineWidth = p.lineWidth.map { CGFloat($0) }
|
|
18
|
+
|
|
19
|
+
// Circular variant does not support timer-based progress ring via built-in ProgressView on iOS.
|
|
20
|
+
// We remove the timer option as it would only display an indeterminate spinner.
|
|
21
|
+
let isDeterminate = p.value != nil
|
|
22
|
+
|
|
23
|
+
// Custom style provides the "ring" appearance for determinate progress.
|
|
24
|
+
let hasCustomProps = trackColor != nil || lineWidth != nil
|
|
25
|
+
let useCustomStyle = hasCustomProps && isDeterminate
|
|
26
|
+
|
|
27
|
+
if let value = p.value {
|
|
28
|
+
// Determinate progress
|
|
29
|
+
ProgressView(value: value, total: p.maximumValue) {
|
|
30
|
+
element.componentProp("label")
|
|
31
|
+
} currentValueLabel: {
|
|
32
|
+
element.componentProp("currentValueLabel")
|
|
33
|
+
}
|
|
34
|
+
.tint(progressColor)
|
|
35
|
+
.voltraIf(useCustomStyle) {
|
|
36
|
+
$0.progressViewStyle(VoltraCircularProgressStyle(
|
|
37
|
+
progressTint: progressColor,
|
|
38
|
+
trackTint: trackColor ?? Color.gray.opacity(0.2),
|
|
39
|
+
lineWidth: lineWidth,
|
|
40
|
+
staticFraction: nil
|
|
41
|
+
))
|
|
42
|
+
}
|
|
43
|
+
.voltraIf(!useCustomStyle) {
|
|
44
|
+
// Fallback to custom style for determinate even if no custom props,
|
|
45
|
+
// because built-in .circular is a spinner, not a ring.
|
|
46
|
+
$0.progressViewStyle(VoltraCircularProgressStyle(
|
|
47
|
+
progressTint: progressColor,
|
|
48
|
+
trackTint: Color.gray.opacity(0.2),
|
|
49
|
+
lineWidth: 4,
|
|
50
|
+
staticFraction: nil
|
|
51
|
+
))
|
|
52
|
+
}
|
|
53
|
+
.applyStyle(element.style)
|
|
54
|
+
} else {
|
|
55
|
+
// Indeterminate progress (Built-in spinner)
|
|
56
|
+
// Wrapping in VStack to ensure stable geometry for the animation
|
|
57
|
+
VStack(spacing: 0) {
|
|
58
|
+
ProgressView {
|
|
59
|
+
element.componentProp("label")
|
|
60
|
+
}
|
|
61
|
+
.progressViewStyle(.circular)
|
|
62
|
+
.tint(progressColor)
|
|
63
|
+
}
|
|
64
|
+
.applyStyle(element.style)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@available(iOS 16.0, macOS 13.0, *)
|
|
70
|
+
private struct VoltraCircularProgressStyle: ProgressViewStyle {
|
|
71
|
+
var progressTint: Color?
|
|
72
|
+
var trackTint: Color
|
|
73
|
+
var lineWidth: CGFloat?
|
|
74
|
+
var staticFraction: Double?
|
|
75
|
+
|
|
76
|
+
func makeBody(configuration: Configuration) -> some View {
|
|
77
|
+
let fraction = max(0, min(staticFraction ?? configuration.fractionCompleted ?? 0, 1))
|
|
78
|
+
let strokeWidth = lineWidth ?? 4
|
|
79
|
+
|
|
80
|
+
VStack(spacing: 8) {
|
|
81
|
+
configuration.label
|
|
82
|
+
|
|
83
|
+
ZStack {
|
|
84
|
+
// Track
|
|
85
|
+
Circle()
|
|
86
|
+
.stroke(trackTint, lineWidth: strokeWidth)
|
|
87
|
+
|
|
88
|
+
// Progress arc
|
|
89
|
+
Circle()
|
|
90
|
+
.trim(from: 0, to: fraction)
|
|
91
|
+
.stroke(
|
|
92
|
+
progressTint ?? Color.accentColor,
|
|
93
|
+
style: StrokeStyle(lineWidth: strokeWidth, lineCap: .round)
|
|
94
|
+
)
|
|
95
|
+
.rotationEffect(.degrees(-90))
|
|
96
|
+
.animation(.linear, value: fraction)
|
|
97
|
+
}
|
|
98
|
+
.aspectRatio(1, contentMode: .fit)
|
|
99
|
+
|
|
100
|
+
configuration.currentValueLabel
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
public struct VoltraDivider: VoltraView {
|
|
4
|
+
public typealias Parameters = EmptyParameters
|
|
5
|
+
|
|
6
|
+
public let element: VoltraElement
|
|
7
|
+
|
|
8
|
+
public init(_ element: VoltraElement) {
|
|
9
|
+
self.element = element
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public var body: some View {
|
|
13
|
+
Divider()
|
|
14
|
+
.applyStyle(element.style)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
public struct VoltraFlexView: VoltraView {
|
|
4
|
+
public typealias Parameters = ViewParameters
|
|
5
|
+
|
|
6
|
+
public let element: VoltraElement
|
|
7
|
+
|
|
8
|
+
public init(_ element: VoltraElement) {
|
|
9
|
+
self.element = element
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public var body: some View {
|
|
13
|
+
let anyStyle = element.style?.mapValues { $0.toAny() } ?? [:]
|
|
14
|
+
|
|
15
|
+
// flexDirection from style (default: column, matching RN's View behavior)
|
|
16
|
+
let directionStr = anyStyle["flexDirection"] as? String ?? "column"
|
|
17
|
+
let axis: Axis = directionStr == "row" ? .horizontal : .vertical
|
|
18
|
+
|
|
19
|
+
let values = FlexContainerHelper.parseValues(from: element)
|
|
20
|
+
|
|
21
|
+
VoltraFlexStackLayout(
|
|
22
|
+
axis: axis,
|
|
23
|
+
spacing: values.gap,
|
|
24
|
+
alignItems: values.alignItems,
|
|
25
|
+
justifyContent: values.justifyContent,
|
|
26
|
+
containerPadding: values.padding
|
|
27
|
+
) {
|
|
28
|
+
(element.children ?? .empty)
|
|
29
|
+
.environment(\.isInFlexContainer, true)
|
|
30
|
+
}
|
|
31
|
+
.modifier(FlexContainerStyleModifier(values: values))
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
public struct VoltraGauge: VoltraView {
|
|
4
|
+
public typealias Parameters = GaugeParameters
|
|
5
|
+
|
|
6
|
+
public let element: VoltraElement
|
|
7
|
+
|
|
8
|
+
public init(_ element: VoltraElement) {
|
|
9
|
+
self.element = element
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public var body: some View {
|
|
13
|
+
let label = element.componentProp("label")
|
|
14
|
+
let currentValueLabel = element.componentProp("currentValueLabel")
|
|
15
|
+
let minimumValueLabel = element.componentProp("minimumValueLabel")
|
|
16
|
+
let maximumValueLabel = element.componentProp("maximumValueLabel")
|
|
17
|
+
let value = params.value ?? 0.0
|
|
18
|
+
let range = (params.minimumValue ?? 0.0) ... (params.maximumValue ?? 1.0)
|
|
19
|
+
let gaugeStyle = params.gaugeStyle
|
|
20
|
+
let tintColor = params.tintColor
|
|
21
|
+
|
|
22
|
+
let gauge = Gauge(value: value, in: range) {
|
|
23
|
+
buildNestedView(label)
|
|
24
|
+
} currentValueLabel: {
|
|
25
|
+
buildNestedView(currentValueLabel)
|
|
26
|
+
} minimumValueLabel: {
|
|
27
|
+
buildNestedView(minimumValueLabel)
|
|
28
|
+
} maximumValueLabel: {
|
|
29
|
+
buildNestedView(maximumValueLabel)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
applyTint(applyGaugeStyle(gauge, gaugeStyle), tintColor)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@ViewBuilder
|
|
36
|
+
private func applyGaugeStyle(_ gauge: some View, _ gaugeStyle: String?) -> some View {
|
|
37
|
+
switch gaugeStyle {
|
|
38
|
+
case "automatic":
|
|
39
|
+
gauge.gaugeStyle(.automatic)
|
|
40
|
+
case "accessoryCircular":
|
|
41
|
+
gauge.gaugeStyle(.accessoryCircular)
|
|
42
|
+
case "accessoryCircularCapacity":
|
|
43
|
+
gauge.gaugeStyle(.accessoryCircularCapacity)
|
|
44
|
+
case "accessoryLinear":
|
|
45
|
+
gauge.gaugeStyle(.accessoryLinear)
|
|
46
|
+
case "accessoryLinearCapacity", "linearCapacity":
|
|
47
|
+
gauge.gaugeStyle(.accessoryLinearCapacity)
|
|
48
|
+
default:
|
|
49
|
+
gauge
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@ViewBuilder
|
|
54
|
+
private func applyTint(_ view: some View, _ optionalColor: String?) -> some View {
|
|
55
|
+
if let color = optionalColor {
|
|
56
|
+
view.tint(JSColorParser.parse(color))
|
|
57
|
+
} else {
|
|
58
|
+
view
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private func buildNestedView(_ nestedView: VoltraNode) -> some View {
|
|
63
|
+
nestedView
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
public struct VoltraGlassContainer: VoltraView {
|
|
4
|
+
public typealias Parameters = GlassContainerParameters
|
|
5
|
+
|
|
6
|
+
public let element: VoltraElement
|
|
7
|
+
@Environment(\.voltraEnvironment) private var voltraEnvironment
|
|
8
|
+
|
|
9
|
+
public init(_ element: VoltraElement) {
|
|
10
|
+
self.element = element
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public var body: some View {
|
|
14
|
+
if let children = element.children {
|
|
15
|
+
if voltraEnvironment.widget?.suppressesDecorativeContainerEffects == true {
|
|
16
|
+
children.applyStyle(element.style)
|
|
17
|
+
} else if #available(iOS 26.0, *) {
|
|
18
|
+
let spacing = params.spacing ?? 0.0
|
|
19
|
+
GlassEffectContainer(spacing: CGFloat(spacing)) {
|
|
20
|
+
children
|
|
21
|
+
}.applyStyle(element.style)
|
|
22
|
+
} else {
|
|
23
|
+
Group {
|
|
24
|
+
children
|
|
25
|
+
}.applyStyle(element.style)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
public struct VoltraGroupBox: VoltraView {
|
|
4
|
+
public typealias Parameters = EmptyParameters
|
|
5
|
+
|
|
6
|
+
public let element: VoltraElement
|
|
7
|
+
|
|
8
|
+
public init(_ element: VoltraElement) {
|
|
9
|
+
self.element = element
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public var body: some View {
|
|
13
|
+
let label = element.componentProp("label")
|
|
14
|
+
|
|
15
|
+
GroupBox {
|
|
16
|
+
element.children ?? .empty
|
|
17
|
+
} label: {
|
|
18
|
+
buildNestedView(label)
|
|
19
|
+
}
|
|
20
|
+
.applyStyle(element.style)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
private func buildNestedView(_ nestedView: VoltraNode) -> some View {
|
|
24
|
+
nestedView
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
public struct VoltraHStack: VoltraView {
|
|
4
|
+
public typealias Parameters = HStackParameters
|
|
5
|
+
|
|
6
|
+
public let element: VoltraElement
|
|
7
|
+
|
|
8
|
+
public init(_ element: VoltraElement) {
|
|
9
|
+
self.element = element
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public var body: some View {
|
|
13
|
+
if params.layout == "flex" {
|
|
14
|
+
flexBody(params: params)
|
|
15
|
+
} else {
|
|
16
|
+
legacyBody(params: params)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@ViewBuilder
|
|
21
|
+
private func legacyBody(params: HStackParameters) -> some View {
|
|
22
|
+
let alignmentStr = params.alignment.lowercased()
|
|
23
|
+
let alignment: VerticalAlignment = switch alignmentStr {
|
|
24
|
+
case "top": .top
|
|
25
|
+
case "bottom": .bottom
|
|
26
|
+
case "center": .center
|
|
27
|
+
case "firsttextbaseline": .firstTextBaseline
|
|
28
|
+
case "lasttextbaseline": .lastTextBaseline
|
|
29
|
+
default: .center
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Extract gap from style for legacy mode too
|
|
33
|
+
let anyStyle = element.style?.mapValues { $0.toAny() } ?? [:]
|
|
34
|
+
let (layout, _, _, _) = StyleConverter.convert(anyStyle)
|
|
35
|
+
// spacing prop takes precedence over gap style
|
|
36
|
+
let gap = params.spacing ?? layout.gap ?? 0
|
|
37
|
+
|
|
38
|
+
let hasFillHeight = layout.height == .fill
|
|
39
|
+
|
|
40
|
+
let frameAlignment = Alignment(horizontal: .center, vertical: alignment)
|
|
41
|
+
|
|
42
|
+
HStack(alignment: alignment, spacing: gap) {
|
|
43
|
+
element.children ?? .empty
|
|
44
|
+
}
|
|
45
|
+
.voltraIf(hasFillHeight) { content in
|
|
46
|
+
content.frame(maxHeight: .infinity, alignment: frameAlignment)
|
|
47
|
+
}
|
|
48
|
+
.applyStyle(element.style, contentAlignment: frameAlignment)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@ViewBuilder
|
|
52
|
+
private func flexBody(params: HStackParameters) -> some View {
|
|
53
|
+
let alignmentFallback = FlexContainerHelper.horizontalAlignmentFallback(params.alignment)
|
|
54
|
+
let values = FlexContainerHelper.parseValues(from: element, alignmentFallback: alignmentFallback)
|
|
55
|
+
// spacing prop takes precedence over gap style
|
|
56
|
+
let spacing = params.spacing ?? values.gap
|
|
57
|
+
|
|
58
|
+
VoltraFlexStackLayout(
|
|
59
|
+
axis: .horizontal,
|
|
60
|
+
spacing: spacing,
|
|
61
|
+
alignItems: values.alignItems,
|
|
62
|
+
justifyContent: values.justifyContent,
|
|
63
|
+
containerPadding: values.padding
|
|
64
|
+
) {
|
|
65
|
+
(element.children ?? .empty)
|
|
66
|
+
.environment(\.isInFlexContainer, true)
|
|
67
|
+
}
|
|
68
|
+
.modifier(FlexContainerStyleModifier(values: values))
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
import SwiftUI
|
|
3
|
+
import UIKit
|
|
4
|
+
|
|
5
|
+
public struct VoltraImage: VoltraView {
|
|
6
|
+
public typealias Parameters = ImageParameters
|
|
7
|
+
|
|
8
|
+
public let element: VoltraElement
|
|
9
|
+
|
|
10
|
+
public init(_ element: VoltraElement) {
|
|
11
|
+
self.element = element
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/// Creates an Image from the source parameter, returning nil if invalid or not found
|
|
15
|
+
private func createImage(from source: String?) -> Image? {
|
|
16
|
+
guard let sourceString = source,
|
|
17
|
+
let sourceData = sourceString.data(using: .utf8),
|
|
18
|
+
let sourceDict = try? JSONSerialization.jsonObject(with: sourceData) as? [String: Any]
|
|
19
|
+
else {
|
|
20
|
+
return nil
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Check for base64 first
|
|
24
|
+
if let base64String = sourceDict["base64"] as? String,
|
|
25
|
+
let base64Data = Data(base64Encoded: base64String),
|
|
26
|
+
let uiImage = UIImage(data: base64Data)
|
|
27
|
+
{
|
|
28
|
+
return Image(uiImage: uiImage)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Check for assetName - first try preloaded images from App Group, then asset catalog
|
|
32
|
+
if let assetName = sourceDict["assetName"] as? String,
|
|
33
|
+
!assetName.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty
|
|
34
|
+
{
|
|
35
|
+
let trimmedName = assetName.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
36
|
+
|
|
37
|
+
// First, check for preloaded image in App Group storage
|
|
38
|
+
if let preloadedImage = VoltraImageStore.loadImage(key: trimmedName) {
|
|
39
|
+
return Image(uiImage: preloadedImage)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Fall back to asset catalog
|
|
43
|
+
if let catalogImage = UIImage(named: trimmedName) {
|
|
44
|
+
return Image(uiImage: catalogImage)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Asset not found or invalid
|
|
49
|
+
return nil
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@ViewBuilder
|
|
53
|
+
public var body: some View {
|
|
54
|
+
let resizeMode = params.resizeMode.lowercased()
|
|
55
|
+
if let baseImage = createImage(from: params.source) {
|
|
56
|
+
switch resizeMode {
|
|
57
|
+
case "cover":
|
|
58
|
+
// Fill container, may crop
|
|
59
|
+
baseImage
|
|
60
|
+
.resizable()
|
|
61
|
+
.scaledToFill()
|
|
62
|
+
.clipped()
|
|
63
|
+
.applyStyle(element.style)
|
|
64
|
+
|
|
65
|
+
case "contain":
|
|
66
|
+
// Fit within container, may leave space
|
|
67
|
+
baseImage
|
|
68
|
+
.resizable()
|
|
69
|
+
.scaledToFit()
|
|
70
|
+
.applyStyle(element.style)
|
|
71
|
+
|
|
72
|
+
case "stretch":
|
|
73
|
+
// Stretch to fill, may distort
|
|
74
|
+
baseImage
|
|
75
|
+
.resizable()
|
|
76
|
+
.applyStyle(element.style)
|
|
77
|
+
|
|
78
|
+
case "repeat":
|
|
79
|
+
// Tile the image
|
|
80
|
+
baseImage
|
|
81
|
+
.resizable(resizingMode: .tile)
|
|
82
|
+
.applyStyle(element.style)
|
|
83
|
+
|
|
84
|
+
case "center":
|
|
85
|
+
// Center without scaling
|
|
86
|
+
baseImage
|
|
87
|
+
.applyStyle(element.style)
|
|
88
|
+
|
|
89
|
+
default:
|
|
90
|
+
// Default to cover
|
|
91
|
+
baseImage
|
|
92
|
+
.resizable()
|
|
93
|
+
.scaledToFill()
|
|
94
|
+
.clipped()
|
|
95
|
+
.applyStyle(element.style)
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
let fallbackNode = element.componentProp("fallback")
|
|
99
|
+
if !fallbackNode.isEmpty {
|
|
100
|
+
Color.clear
|
|
101
|
+
.overlay(fallbackNode)
|
|
102
|
+
.applyStyle(element.style)
|
|
103
|
+
} else {
|
|
104
|
+
Color.clear
|
|
105
|
+
.applyStyle(element.style)
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
public struct VoltraLabel: VoltraView {
|
|
4
|
+
public typealias Parameters = LabelParameters
|
|
5
|
+
|
|
6
|
+
public let element: VoltraElement
|
|
7
|
+
|
|
8
|
+
public init(_ element: VoltraElement) {
|
|
9
|
+
self.element = element
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public var body: some View {
|
|
13
|
+
if let systemImage = params.systemImage {
|
|
14
|
+
Label(
|
|
15
|
+
params.title ?? "Label",
|
|
16
|
+
systemImage: systemImage
|
|
17
|
+
)
|
|
18
|
+
.applyStyle(element.style)
|
|
19
|
+
} else {
|
|
20
|
+
VoltraText(element)
|
|
21
|
+
.applyStyle(element.style)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
public struct VoltraLinearGradient: VoltraView {
|
|
4
|
+
public typealias Parameters = LinearGradientParameters
|
|
5
|
+
|
|
6
|
+
public let element: VoltraElement
|
|
7
|
+
@Environment(\.voltraEnvironment) private var voltraEnvironment
|
|
8
|
+
|
|
9
|
+
public init(_ element: VoltraElement) {
|
|
10
|
+
self.element = element
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/// Map string to UnitPoint
|
|
14
|
+
private func parsePoint(_ s: String?) -> UnitPoint {
|
|
15
|
+
guard let raw = s else { return .center }
|
|
16
|
+
|
|
17
|
+
// Handle custom coordinates in "x,y" format
|
|
18
|
+
if raw.contains(",") {
|
|
19
|
+
let components = raw.split(separator: ",")
|
|
20
|
+
if components.count == 2,
|
|
21
|
+
let x = Double(components[0]),
|
|
22
|
+
let y = Double(components[1])
|
|
23
|
+
{
|
|
24
|
+
return UnitPoint(x: x, y: y)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Handle predefined string values
|
|
29
|
+
switch raw.lowercased() {
|
|
30
|
+
case "top": return .top
|
|
31
|
+
case "bottom": return .bottom
|
|
32
|
+
case "leading": return .leading
|
|
33
|
+
case "trailing": return .trailing
|
|
34
|
+
case "topleading": return .topLeading
|
|
35
|
+
case "toptrailing": return .topTrailing
|
|
36
|
+
case "bottomleading": return .bottomLeading
|
|
37
|
+
case "bottomtrailing": return .bottomTrailing
|
|
38
|
+
case "center": fallthrough
|
|
39
|
+
default: return .center
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/// Build Gradient from parameters
|
|
44
|
+
private func buildGradient(params: LinearGradientParameters) -> Gradient {
|
|
45
|
+
// Prefer explicit stops over color array
|
|
46
|
+
if let stopsStr = params.stops {
|
|
47
|
+
let parts = stopsStr.split(separator: "|")
|
|
48
|
+
var stops: [Gradient.Stop] = []
|
|
49
|
+
for part in parts {
|
|
50
|
+
let sub = part.split(separator: "@", maxSplits: 1).map(String.init)
|
|
51
|
+
if sub.count == 2 {
|
|
52
|
+
let colorStr = sub[0]
|
|
53
|
+
let locStr = sub[1]
|
|
54
|
+
if let color = JSColorParser.parse(colorStr) {
|
|
55
|
+
let loc = Double(locStr) ?? 0.0
|
|
56
|
+
stops.append(.init(color: color, location: loc))
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if !stops.isEmpty { return Gradient(stops: stops) }
|
|
61
|
+
}
|
|
62
|
+
if let colorsStr = params.colors {
|
|
63
|
+
let parts = colorsStr.split(separator: "|").map(String.init)
|
|
64
|
+
let colors: [Color] = parts.compactMap { JSColorParser.parse($0) }
|
|
65
|
+
if !colors.isEmpty { return Gradient(colors: colors) }
|
|
66
|
+
}
|
|
67
|
+
// Fallback neutral gradient
|
|
68
|
+
return Gradient(colors: [Color.black.opacity(0.25), Color.black.opacity(0.05)])
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
private func isFullBleedWidgetBackgroundCandidate() -> Bool {
|
|
72
|
+
guard let style = element.style, element.children != nil else {
|
|
73
|
+
return false
|
|
74
|
+
}
|
|
75
|
+
if let flex = style["flex"]?.doubleValue, flex > 0 {
|
|
76
|
+
return true
|
|
77
|
+
}
|
|
78
|
+
if let flexGrow = style["flexGrow"]?.doubleValue, flexGrow > 0 {
|
|
79
|
+
return true
|
|
80
|
+
}
|
|
81
|
+
let width = style["width"]?.stringValue?.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
82
|
+
let height = style["height"]?.stringValue?.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
83
|
+
return width == "100%" && height == "100%"
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public var body: some View {
|
|
87
|
+
let gradient = buildGradient(params: params)
|
|
88
|
+
let start = parsePoint(params.startPoint)
|
|
89
|
+
let end = parsePoint(params.endPoint)
|
|
90
|
+
let anyStyle = element.style?.mapValues { $0.toAny() } ?? [:]
|
|
91
|
+
let (layout, baseDecoration, rendering, text) = StyleConverter.convert(anyStyle)
|
|
92
|
+
|
|
93
|
+
var decoration = baseDecoration
|
|
94
|
+
decoration.backgroundColor = .linearGradient(gradient: gradient, startPoint: start, endPoint: end)
|
|
95
|
+
|
|
96
|
+
if let widget = voltraEnvironment.widget,
|
|
97
|
+
widget.isHomeScreenWidget,
|
|
98
|
+
widget.usesReducedBackgroundPresentation,
|
|
99
|
+
isFullBleedWidgetBackgroundCandidate(),
|
|
100
|
+
let children = element.children
|
|
101
|
+
{
|
|
102
|
+
return AnyView(children.applyStyle(element.style))
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if let children = element.children {
|
|
106
|
+
return AnyView(
|
|
107
|
+
children.applyStyle((layout, decoration, rendering, text))
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return AnyView(
|
|
112
|
+
Color.clear.applyStyle((layout, decoration, rendering, text))
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
}
|