@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,86 @@
|
|
|
1
|
+
import SwiftUI
|
|
2
|
+
|
|
3
|
+
public enum VoltraWidgetRenderingMode {
|
|
4
|
+
case fullColor
|
|
5
|
+
case accented
|
|
6
|
+
case vibrant
|
|
7
|
+
case unknown
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
public struct VoltraWidgetEnvironment {
|
|
11
|
+
public let isHomeScreenWidget: Bool
|
|
12
|
+
public let renderingMode: VoltraWidgetRenderingMode
|
|
13
|
+
public let showsContainerBackground: Bool
|
|
14
|
+
|
|
15
|
+
var usesReducedBackgroundPresentation: Bool {
|
|
16
|
+
renderingMode != .fullColor || !showsContainerBackground
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
var suppressesDecorativeContainerEffects: Bool {
|
|
20
|
+
isHomeScreenWidget && usesReducedBackgroundPresentation
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public init(
|
|
24
|
+
isHomeScreenWidget: Bool,
|
|
25
|
+
renderingMode: VoltraWidgetRenderingMode,
|
|
26
|
+
showsContainerBackground: Bool
|
|
27
|
+
) {
|
|
28
|
+
self.isHomeScreenWidget = isHomeScreenWidget
|
|
29
|
+
self.renderingMode = renderingMode
|
|
30
|
+
self.showsContainerBackground = showsContainerBackground
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
struct VoltraEnvironment {
|
|
35
|
+
/// Activity ID for Live Activity interactions
|
|
36
|
+
let activityId: String
|
|
37
|
+
|
|
38
|
+
/// Widget-specific presentation context, when rendering inside WidgetKit.
|
|
39
|
+
let widget: VoltraWidgetEnvironment?
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public struct Voltra: View {
|
|
43
|
+
/// Pre-parsed root node
|
|
44
|
+
public var root: VoltraNode
|
|
45
|
+
|
|
46
|
+
/// Activity ID for Live Activity interactions
|
|
47
|
+
public var activityId: String
|
|
48
|
+
|
|
49
|
+
/// Widget-specific presentation context, when rendering inside WidgetKit.
|
|
50
|
+
var widget: VoltraWidgetEnvironment?
|
|
51
|
+
|
|
52
|
+
/// Initialize Voltra
|
|
53
|
+
///
|
|
54
|
+
/// - Parameter root: Pre-parsed root VoltraNode
|
|
55
|
+
/// - Parameter callback: Handler for element interactions
|
|
56
|
+
/// - Parameter activityId: Activity ID for Live Activity interactions
|
|
57
|
+
/// - Parameter widget: Widget rendering context used to adapt Voltra output for WidgetKit surfaces
|
|
58
|
+
public init(root: VoltraNode, activityId: String, widget: VoltraWidgetEnvironment? = nil) {
|
|
59
|
+
self.root = root
|
|
60
|
+
self.activityId = activityId
|
|
61
|
+
self.widget = widget
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/// Generated body for SwiftUI
|
|
65
|
+
public var body: some View {
|
|
66
|
+
root
|
|
67
|
+
.environment(\.voltraEnvironment, VoltraEnvironment(
|
|
68
|
+
activityId: activityId,
|
|
69
|
+
widget: widget
|
|
70
|
+
))
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
private struct VoltraEnvironmentKey: EnvironmentKey {
|
|
75
|
+
static let defaultValue: VoltraEnvironment = .init(
|
|
76
|
+
activityId: "",
|
|
77
|
+
widget: nil
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
extension EnvironmentValues {
|
|
82
|
+
var voltraEnvironment: VoltraEnvironment {
|
|
83
|
+
get { self[VoltraEnvironmentKey.self] }
|
|
84
|
+
set { self[VoltraEnvironmentKey.self] = newValue }
|
|
85
|
+
}
|
|
86
|
+
}
|
package/package.json
CHANGED
|
@@ -1,31 +1,80 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@use-voltra/ios-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-rc.2",
|
|
4
4
|
"description": "Client-only Voltra APIs for iOS",
|
|
5
|
-
"main": "build/
|
|
6
|
-
"module": "build/
|
|
7
|
-
"types": "build/
|
|
5
|
+
"main": "./build/commonjs/index.js",
|
|
6
|
+
"module": "./build/module/index.js",
|
|
7
|
+
"types": "./build/typescript/module/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
"source": "./src/index.ts",
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./build/typescript/module/index.d.ts",
|
|
13
|
+
"default": "./build/module/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./build/typescript/commonjs/index.d.ts",
|
|
17
|
+
"default": "./build/commonjs/index.js"
|
|
18
|
+
},
|
|
19
|
+
"default": "./build/module/index.js"
|
|
14
20
|
},
|
|
15
|
-
"./package.json": "./package.json"
|
|
21
|
+
"./package.json": "./package.json",
|
|
22
|
+
"./app.plugin.js": "./expo-plugin/app.plugin.js"
|
|
16
23
|
},
|
|
17
24
|
"files": [
|
|
18
25
|
"build",
|
|
19
|
-
"
|
|
26
|
+
"expo-plugin",
|
|
27
|
+
"ios",
|
|
28
|
+
"src",
|
|
29
|
+
"!ios/.build",
|
|
30
|
+
"Voltra.podspec",
|
|
31
|
+
"README.md",
|
|
32
|
+
"*.podspec",
|
|
33
|
+
"react-native.config.js",
|
|
34
|
+
"!ios/build",
|
|
35
|
+
"!android/build",
|
|
36
|
+
"!android/gradle",
|
|
37
|
+
"!android/gradlew",
|
|
38
|
+
"!android/gradlew.bat",
|
|
39
|
+
"!android/local.properties",
|
|
40
|
+
"!**/__tests__",
|
|
41
|
+
"!**/__fixtures__",
|
|
42
|
+
"!**/__mocks__",
|
|
43
|
+
"!**/.*"
|
|
20
44
|
],
|
|
21
45
|
"scripts": {
|
|
22
|
-
"build": "
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
46
|
+
"build": "npm run clean && npm run build:expo-plugin && bob build",
|
|
47
|
+
"build:expo-plugin": "node ../../scripts/build-package.mjs packages/ios-client/expo-plugin",
|
|
48
|
+
"clean": "rm -rf build && npm run clean:expo-plugin",
|
|
49
|
+
"clean:expo-plugin": "rm -rf expo-plugin/build",
|
|
50
|
+
"format:check": "npm run format:swift:check",
|
|
51
|
+
"format:fix": "npm run format:swift:fix",
|
|
52
|
+
"format:swift:check": "swiftformat --lint ios",
|
|
53
|
+
"format:swift:fix": "swiftformat ios",
|
|
54
|
+
"lint": "oxlint src expo-plugin/src",
|
|
55
|
+
"typecheck": "tsc -p tsconfig.typecheck.json --noEmit && tsc -p expo-plugin/tsconfig.typecheck.json --noEmit",
|
|
56
|
+
"test": "jest --config expo-plugin/jest.config.js",
|
|
57
|
+
"test:swift": "cd ios && swift test"
|
|
26
58
|
},
|
|
27
59
|
"dependencies": {
|
|
28
|
-
"@
|
|
60
|
+
"@babel/core": "^7.27.4",
|
|
61
|
+
"@expo/config-plugins": "~10.1.2",
|
|
62
|
+
"@expo/plist": "^0.3.5",
|
|
63
|
+
"@use-voltra/expo-plugin": "2.0.0-rc.2",
|
|
64
|
+
"@use-voltra/ios": "2.0.0-rc.2",
|
|
65
|
+
"dedent": "^1.7.1",
|
|
66
|
+
"xcode": "^3.0.1"
|
|
67
|
+
},
|
|
68
|
+
"peerDependencies": {
|
|
69
|
+
"expo": "*",
|
|
70
|
+
"react": "*",
|
|
71
|
+
"react-native": "*"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@types/jest": "^29.5.14",
|
|
75
|
+
"@types/node": "^20.19.25",
|
|
76
|
+
"jest": "^29.7.0",
|
|
77
|
+
"ts-jest": "^29.3.4"
|
|
29
78
|
},
|
|
30
79
|
"keywords": [
|
|
31
80
|
"react-native",
|
|
@@ -45,9 +94,46 @@
|
|
|
45
94
|
},
|
|
46
95
|
"license": "MIT",
|
|
47
96
|
"homepage": "https://use-voltra.dev",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
97
|
+
"react-native-builder-bob": {
|
|
98
|
+
"source": "src",
|
|
99
|
+
"output": "build",
|
|
100
|
+
"exclude": "**/{__tests__,__fixtures__,__mocks__,__rsc_tests__}/**",
|
|
101
|
+
"targets": [
|
|
102
|
+
[
|
|
103
|
+
"module",
|
|
104
|
+
{
|
|
105
|
+
"esm": true,
|
|
106
|
+
"sourceMaps": true
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
[
|
|
110
|
+
"commonjs",
|
|
111
|
+
{
|
|
112
|
+
"esm": true,
|
|
113
|
+
"sourceMaps": true
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
"typescript",
|
|
118
|
+
{
|
|
119
|
+
"project": "tsconfig.build.json"
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"codegenConfig": {
|
|
125
|
+
"name": "VoltraSpec",
|
|
126
|
+
"type": "all",
|
|
127
|
+
"jsSrcsDir": "src",
|
|
128
|
+
"ios": {
|
|
129
|
+
"modulesProvider": {
|
|
130
|
+
"NativeVoltra": "NativeVoltra"
|
|
131
|
+
},
|
|
132
|
+
"components": {
|
|
133
|
+
"VoltraView": {
|
|
134
|
+
"className": "VoltraViewComponentView"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
52
138
|
}
|
|
53
139
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native'
|
|
3
|
+
|
|
4
|
+
import { VoltraView, type VoltraViewProps } from './VoltraView.js'
|
|
5
|
+
|
|
6
|
+
const LOCK_SCREEN_DIMENSIONS = {
|
|
7
|
+
width: 364,
|
|
8
|
+
height: 160,
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type VoltraLiveActivityPreviewProps = Omit<VoltraViewProps, 'style'> & {
|
|
12
|
+
style?: StyleProp<ViewStyle>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function VoltraLiveActivityPreview({ style, children, ...voltraViewProps }: VoltraLiveActivityPreviewProps) {
|
|
16
|
+
const previewStyle: StyleProp<ViewStyle> = [
|
|
17
|
+
{
|
|
18
|
+
width: LOCK_SCREEN_DIMENSIONS.width,
|
|
19
|
+
height: LOCK_SCREEN_DIMENSIONS.height,
|
|
20
|
+
},
|
|
21
|
+
style,
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<VoltraView {...voltraViewProps} style={previewStyle}>
|
|
26
|
+
{children}
|
|
27
|
+
</VoltraView>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React, { type ReactNode, useEffect, useMemo } from 'react'
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native'
|
|
3
|
+
|
|
4
|
+
import { renderVoltraVariantToJson } from '@use-voltra/ios'
|
|
5
|
+
|
|
6
|
+
import VoltraFabricView from '../native/VoltraRNNativeComponent'
|
|
7
|
+
|
|
8
|
+
import { addVoltraListener, type VoltraInteractionEvent } from '../events.js'
|
|
9
|
+
|
|
10
|
+
const generateViewId = () => `voltra-view-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`
|
|
11
|
+
|
|
12
|
+
const voltraViewStyle: ViewStyle = {
|
|
13
|
+
flex: 1,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type VoltraViewProps = {
|
|
17
|
+
id?: string
|
|
18
|
+
children: ReactNode
|
|
19
|
+
style?: StyleProp<ViewStyle>
|
|
20
|
+
onInteraction?: (event: VoltraInteractionEvent) => void
|
|
21
|
+
testID?: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function VoltraView({ id, children, style, onInteraction, testID }: VoltraViewProps) {
|
|
25
|
+
const viewId = useMemo(() => id || generateViewId(), [id])
|
|
26
|
+
|
|
27
|
+
const json = renderVoltraVariantToJson(children)
|
|
28
|
+
const payload = JSON.stringify(json)
|
|
29
|
+
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (!onInteraction) return
|
|
32
|
+
|
|
33
|
+
const subscription = addVoltraListener('interaction', (event) => {
|
|
34
|
+
if (event.source === viewId) {
|
|
35
|
+
onInteraction({
|
|
36
|
+
type: 'interaction',
|
|
37
|
+
source: event.source,
|
|
38
|
+
timestamp: event.timestamp,
|
|
39
|
+
identifier: event.identifier,
|
|
40
|
+
payload: event.payload,
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
return () => subscription.remove()
|
|
46
|
+
}, [viewId, onInteraction])
|
|
47
|
+
|
|
48
|
+
return <VoltraFabricView payload={payload} style={[voltraViewStyle, style]} testID={testID} viewId={viewId} />
|
|
49
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { type StyleProp, type ViewStyle } from 'react-native'
|
|
3
|
+
|
|
4
|
+
import type { WidgetFamily } from '@use-voltra/ios'
|
|
5
|
+
|
|
6
|
+
import { VoltraView, type VoltraViewProps } from './VoltraView.js'
|
|
7
|
+
|
|
8
|
+
const WIDGET_DIMENSIONS: Record<WidgetFamily, { width: number; height: number }> = {
|
|
9
|
+
systemSmall: { width: 170, height: 170 },
|
|
10
|
+
systemMedium: { width: 364, height: 170 },
|
|
11
|
+
systemLarge: { width: 364, height: 382 },
|
|
12
|
+
systemExtraLarge: { width: 364, height: 768 },
|
|
13
|
+
accessoryCircular: { width: 76, height: 76 },
|
|
14
|
+
accessoryRectangular: { width: 172, height: 76 },
|
|
15
|
+
accessoryInline: { width: 172, height: 40 },
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type VoltraWidgetPreviewProps = Omit<VoltraViewProps, 'style'> & {
|
|
19
|
+
family: WidgetFamily
|
|
20
|
+
style?: StyleProp<ViewStyle>
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function VoltraWidgetPreview({ family, style, children, ...voltraViewProps }: VoltraWidgetPreviewProps) {
|
|
24
|
+
const dimensions = WIDGET_DIMENSIONS[family]
|
|
25
|
+
const previewStyle: StyleProp<ViewStyle> = [
|
|
26
|
+
{
|
|
27
|
+
width: dimensions.width,
|
|
28
|
+
height: dimensions.height,
|
|
29
|
+
},
|
|
30
|
+
style,
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<VoltraView {...voltraViewProps} style={previewStyle}>
|
|
35
|
+
{children}
|
|
36
|
+
</VoltraView>
|
|
37
|
+
)
|
|
38
|
+
}
|
package/src/events.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Platform } from 'react-native'
|
|
2
|
+
|
|
3
|
+
import type { EventSubscription } from './types.js'
|
|
4
|
+
import { getNativeVoltra } from './VoltraModule.js'
|
|
5
|
+
|
|
6
|
+
export type BasicVoltraEvent = {
|
|
7
|
+
source: string
|
|
8
|
+
timestamp: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type VoltraActivityState = 'active' | 'dismissed' | 'pending' | 'stale' | 'ended' | string
|
|
12
|
+
export type VoltraActivityTokenReceivedEvent = BasicVoltraEvent & {
|
|
13
|
+
type: 'activityTokenReceived'
|
|
14
|
+
activityName: string
|
|
15
|
+
pushToken: string
|
|
16
|
+
}
|
|
17
|
+
export type VoltraActivityPushToStartTokenReceivedEvent = BasicVoltraEvent & {
|
|
18
|
+
type: 'activityPushToStartTokenReceived'
|
|
19
|
+
pushToStartToken: string
|
|
20
|
+
}
|
|
21
|
+
export type VoltraActivityUpdateEvent = BasicVoltraEvent & {
|
|
22
|
+
type: 'stateChange'
|
|
23
|
+
activityName: string
|
|
24
|
+
activityState: VoltraActivityState
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type VoltraInteractionEvent = BasicVoltraEvent & {
|
|
28
|
+
type: 'interaction'
|
|
29
|
+
identifier: string
|
|
30
|
+
payload: string
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const noopSubscription: EventSubscription = {
|
|
34
|
+
remove: () => {},
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type VoltraEventMap = {
|
|
38
|
+
activityTokenReceived: VoltraActivityTokenReceivedEvent
|
|
39
|
+
activityPushToStartTokenReceived: VoltraActivityPushToStartTokenReceivedEvent
|
|
40
|
+
stateChange: VoltraActivityUpdateEvent
|
|
41
|
+
interaction: VoltraInteractionEvent
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function addVoltraListener<K extends keyof VoltraEventMap>(
|
|
45
|
+
event: K,
|
|
46
|
+
listener: (event: VoltraEventMap[K]) => void
|
|
47
|
+
): EventSubscription {
|
|
48
|
+
if (Platform.OS !== 'ios') {
|
|
49
|
+
console.warn(`[Voltra] Event '${event}' is only supported on iOS. Returning no-op subscription.`)
|
|
50
|
+
return noopSubscription
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const voltraModule = getNativeVoltra()
|
|
54
|
+
|
|
55
|
+
switch (event) {
|
|
56
|
+
case 'activityTokenReceived':
|
|
57
|
+
return voltraModule.onActivityTokenReceived(listener as (arg: VoltraActivityTokenReceivedEvent) => void)
|
|
58
|
+
case 'activityPushToStartTokenReceived':
|
|
59
|
+
return voltraModule.onActivityPushToStartTokenReceived(
|
|
60
|
+
listener as (arg: VoltraActivityPushToStartTokenReceivedEvent) => void
|
|
61
|
+
)
|
|
62
|
+
case 'stateChange':
|
|
63
|
+
return voltraModule.onStateChanged(listener as (arg: VoltraActivityUpdateEvent) => void)
|
|
64
|
+
case 'interaction':
|
|
65
|
+
return voltraModule.onInteraction(listener as (arg: VoltraInteractionEvent) => void)
|
|
66
|
+
default:
|
|
67
|
+
console.warn(`[Voltra] Event '${event}' is not supported. Returning no-op subscription.`)
|
|
68
|
+
return noopSubscription
|
|
69
|
+
}
|
|
70
|
+
}
|
package/src/helpers.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Platform } from 'react-native'
|
|
2
|
+
|
|
3
|
+
import { getNativeVoltra } from './VoltraModule.js'
|
|
4
|
+
|
|
5
|
+
export function isGlassSupported(): boolean {
|
|
6
|
+
if (Platform.OS !== 'ios') return false
|
|
7
|
+
const v: any = Platform.Version
|
|
8
|
+
let major = 0
|
|
9
|
+
if (typeof v === 'string') {
|
|
10
|
+
const m = parseInt(v.split('.')[0] || '0', 10)
|
|
11
|
+
if (!Number.isNaN(m)) major = m
|
|
12
|
+
} else if (typeof v === 'number') {
|
|
13
|
+
major = Math.floor(v)
|
|
14
|
+
}
|
|
15
|
+
return major >= 26
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function isHeadless(): boolean {
|
|
19
|
+
if (Platform.OS !== 'ios') return false
|
|
20
|
+
return getNativeVoltra().isHeadless?.() ?? false
|
|
21
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export { Voltra } from '@use-voltra/ios'
|
|
2
|
+
export {
|
|
3
|
+
VoltraLiveActivityPreview,
|
|
4
|
+
type VoltraLiveActivityPreviewProps,
|
|
5
|
+
} from './components/VoltraLiveActivityPreview.js'
|
|
6
|
+
export { VoltraView, type VoltraViewProps } from './components/VoltraView.js'
|
|
7
|
+
export { VoltraWidgetPreview, type VoltraWidgetPreviewProps } from './components/VoltraWidgetPreview.js'
|
|
8
|
+
export * from './events.js'
|
|
9
|
+
export { isGlassSupported, isHeadless } from './helpers.js'
|
|
10
|
+
export { logger, type VoltraLogLevel } from './logger.js'
|
|
11
|
+
export {
|
|
12
|
+
endAllLiveActivities,
|
|
13
|
+
type EndLiveActivityOptions,
|
|
14
|
+
isLiveActivityActive,
|
|
15
|
+
type SharedLiveActivityOptions,
|
|
16
|
+
startLiveActivity,
|
|
17
|
+
type StartLiveActivityOptions,
|
|
18
|
+
stopLiveActivity,
|
|
19
|
+
updateLiveActivity,
|
|
20
|
+
type UpdateLiveActivityOptions,
|
|
21
|
+
useLiveActivity,
|
|
22
|
+
type UseLiveActivityOptions,
|
|
23
|
+
type UseLiveActivityResult,
|
|
24
|
+
} from './live-activity/api.js'
|
|
25
|
+
export type { DismissalPolicy, LiveActivityVariants } from '@use-voltra/ios'
|
|
26
|
+
export {
|
|
27
|
+
clearPreloadedImages,
|
|
28
|
+
type PreloadImageOptions,
|
|
29
|
+
preloadImages,
|
|
30
|
+
type PreloadImagesResult,
|
|
31
|
+
reloadLiveActivities,
|
|
32
|
+
} from './preload.js'
|
|
33
|
+
export { assertRunningOnApple } from './utils/assertRunningOnApple.js'
|
|
34
|
+
export { useUpdateOnHMR } from './utils/useUpdateOnHMR.js'
|
|
35
|
+
export * from './utils/helpers.js'
|
|
36
|
+
export type { VoltraElementJson, VoltraNodeJson } from './types.js'
|
|
37
|
+
export {
|
|
38
|
+
clearWidgetServerCredentials,
|
|
39
|
+
setWidgetServerCredentials,
|
|
40
|
+
type WidgetServerCredentials,
|
|
41
|
+
} from './widgets/server-credentials.js'
|
|
42
|
+
export type { WidgetFamily, WidgetInfo, WidgetVariants } from '@use-voltra/ios'
|
|
43
|
+
export {
|
|
44
|
+
clearAllWidgets,
|
|
45
|
+
clearWidget,
|
|
46
|
+
getActiveWidgets,
|
|
47
|
+
reloadWidgets,
|
|
48
|
+
type ScheduledWidgetEntry,
|
|
49
|
+
scheduleWidget,
|
|
50
|
+
updateWidget,
|
|
51
|
+
type UpdateWidgetOptions,
|
|
52
|
+
} from './widgets/widget-api.js'
|