@use-voltra/ios-client 1.4.0 → 2.0.0-rc.1
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/.generated +8 -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 +91 -18
- 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,67 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@use-voltra/ios-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-rc.1",
|
|
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",
|
|
26
|
+
"expo-plugin",
|
|
27
|
+
"ios",
|
|
28
|
+
"!ios/.build",
|
|
29
|
+
"Voltra.podspec",
|
|
19
30
|
"README.md"
|
|
20
31
|
],
|
|
21
32
|
"scripts": {
|
|
22
|
-
"build": "
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
33
|
+
"build": "npm run clean && npm run build:expo-plugin && bob build",
|
|
34
|
+
"build:expo-plugin": "node ../../scripts/build-package.mjs packages/ios-client/expo-plugin",
|
|
35
|
+
"clean": "rm -rf build && npm run clean:expo-plugin",
|
|
36
|
+
"clean:expo-plugin": "rm -rf expo-plugin/build",
|
|
37
|
+
"format:check": "npm run format:swift:check",
|
|
38
|
+
"format:fix": "npm run format:swift:fix",
|
|
39
|
+
"format:swift:check": "swiftformat --lint ios",
|
|
40
|
+
"format:swift:fix": "swiftformat ios",
|
|
41
|
+
"lint": "oxlint src expo-plugin/src",
|
|
42
|
+
"typecheck": "tsc -p tsconfig.typecheck.json --noEmit && tsc -p expo-plugin/tsconfig.typecheck.json --noEmit",
|
|
43
|
+
"test": "jest --config expo-plugin/jest.config.js",
|
|
44
|
+
"test:swift": "cd ios && swift test"
|
|
26
45
|
},
|
|
27
46
|
"dependencies": {
|
|
28
|
-
"@
|
|
47
|
+
"@babel/core": "^7.27.4",
|
|
48
|
+
"@expo/config-plugins": "~10.1.2",
|
|
49
|
+
"@expo/plist": "^0.3.5",
|
|
50
|
+
"@use-voltra/expo-plugin": "2.0.0-rc.1",
|
|
51
|
+
"@use-voltra/ios": "2.0.0-rc.1",
|
|
52
|
+
"dedent": "^1.7.1",
|
|
53
|
+
"xcode": "^3.0.1"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"expo": "*",
|
|
57
|
+
"react": "*",
|
|
58
|
+
"react-native": "*"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@types/jest": "^29.5.14",
|
|
62
|
+
"@types/node": "^20.19.25",
|
|
63
|
+
"jest": "^29.7.0",
|
|
64
|
+
"ts-jest": "^29.3.4"
|
|
29
65
|
},
|
|
30
66
|
"keywords": [
|
|
31
67
|
"react-native",
|
|
@@ -45,9 +81,46 @@
|
|
|
45
81
|
},
|
|
46
82
|
"license": "MIT",
|
|
47
83
|
"homepage": "https://use-voltra.dev",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
84
|
+
"react-native-builder-bob": {
|
|
85
|
+
"source": "src",
|
|
86
|
+
"output": "build",
|
|
87
|
+
"exclude": "**/{__tests__,__fixtures__,__mocks__,__rsc_tests__}/**",
|
|
88
|
+
"targets": [
|
|
89
|
+
[
|
|
90
|
+
"module",
|
|
91
|
+
{
|
|
92
|
+
"esm": true,
|
|
93
|
+
"sourceMaps": true
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
[
|
|
97
|
+
"commonjs",
|
|
98
|
+
{
|
|
99
|
+
"esm": true,
|
|
100
|
+
"sourceMaps": true
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
[
|
|
104
|
+
"typescript",
|
|
105
|
+
{
|
|
106
|
+
"project": "tsconfig.build.json"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"codegenConfig": {
|
|
112
|
+
"name": "VoltraSpec",
|
|
113
|
+
"type": "all",
|
|
114
|
+
"jsSrcsDir": "src",
|
|
115
|
+
"ios": {
|
|
116
|
+
"modulesProvider": {
|
|
117
|
+
"NativeVoltra": "NativeVoltra"
|
|
118
|
+
},
|
|
119
|
+
"components": {
|
|
120
|
+
"VoltraView": {
|
|
121
|
+
"className": "VoltraViewComponentView"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
52
125
|
}
|
|
53
126
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VoltraModule.js","sourceRoot":"","sources":["../../src/VoltraModule.ts"],"names":[],"mappings":";;AAAA,+BAA0C;AAsD1C,MAAM,YAAY,GAAG,IAAA,0BAAmB,EAAsB,cAAc,CAAC,CAAA;AAE7E,kBAAe,YAAY,CAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VoltraLiveActivityPreview = VoltraLiveActivityPreview;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const VoltraView_js_1 = require("./VoltraView.js");
|
|
6
|
-
const LOCK_SCREEN_DIMENSIONS = {
|
|
7
|
-
width: 364,
|
|
8
|
-
height: 160,
|
|
9
|
-
};
|
|
10
|
-
function VoltraLiveActivityPreview({ style, children, ...voltraViewProps }) {
|
|
11
|
-
const previewStyle = [
|
|
12
|
-
{
|
|
13
|
-
width: LOCK_SCREEN_DIMENSIONS.width,
|
|
14
|
-
height: LOCK_SCREEN_DIMENSIONS.height,
|
|
15
|
-
},
|
|
16
|
-
style,
|
|
17
|
-
];
|
|
18
|
-
return ((0, jsx_runtime_1.jsx)(VoltraView_js_1.VoltraView, { ...voltraViewProps, style: previewStyle, children: children }));
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=VoltraLiveActivityPreview.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VoltraLiveActivityPreview.js","sourceRoot":"","sources":["../../../src/components/VoltraLiveActivityPreview.tsx"],"names":[],"mappings":";;AAcA,8DAcC;;AAzBD,mDAAkE;AAElE,MAAM,sBAAsB,GAAG;IAC7B,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;CACZ,CAAA;AAMD,SAAgB,yBAAyB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAkC;IAC/G,MAAM,YAAY,GAAyB;QACzC;YACE,KAAK,EAAE,sBAAsB,CAAC,KAAK;YACnC,MAAM,EAAE,sBAAsB,CAAC,MAAM;SACtC;QACD,KAAK;KACN,CAAA;IAED,OAAO,CACL,uBAAC,0BAAU,OAAK,eAAe,EAAE,KAAK,EAAE,YAAY,YACjD,QAAQ,GACE,CACd,CAAA;AACH,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VoltraView = VoltraView;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const expo_1 = require("expo");
|
|
6
|
-
const react_1 = require("react");
|
|
7
|
-
const react_native_1 = require("react-native");
|
|
8
|
-
const ios_1 = require("@use-voltra/ios");
|
|
9
|
-
const events_js_1 = require("../events.js");
|
|
10
|
-
const NativeVoltraView = (0, expo_1.requireNativeView)('VoltraModule');
|
|
11
|
-
const generateViewId = () => `voltra-view-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
12
|
-
const voltraViewStyle = {
|
|
13
|
-
flex: 1,
|
|
14
|
-
};
|
|
15
|
-
function VoltraView({ id, children, style, onInteraction, testID }) {
|
|
16
|
-
const viewId = (0, react_1.useMemo)(() => id || generateViewId(), [id]);
|
|
17
|
-
const json = (0, ios_1.renderVoltraVariantToJson)(children);
|
|
18
|
-
const payload = JSON.stringify(json);
|
|
19
|
-
(0, react_1.useEffect)(() => {
|
|
20
|
-
if (!onInteraction)
|
|
21
|
-
return;
|
|
22
|
-
const subscription = (0, events_js_1.addVoltraListener)('interaction', (event) => {
|
|
23
|
-
if (event.source === viewId) {
|
|
24
|
-
onInteraction({
|
|
25
|
-
type: 'interaction',
|
|
26
|
-
source: event.source,
|
|
27
|
-
timestamp: event.timestamp,
|
|
28
|
-
identifier: event.identifier,
|
|
29
|
-
payload: event.payload,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
return () => subscription.remove();
|
|
34
|
-
}, [viewId, onInteraction]);
|
|
35
|
-
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { testID: testID, style: style, children: (0, jsx_runtime_1.jsx)(NativeVoltraView, { payload: payload, viewId: viewId, style: voltraViewStyle }) }));
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=VoltraView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VoltraView.js","sourceRoot":"","sources":["../../../src/components/VoltraView.tsx"],"names":[],"mappings":";;AAwBA,gCA6BC;;AArDD,+BAAwC;AACxC,iCAAiE;AACjE,+CAAmE;AAEnE,yCAA2D;AAE3D,4CAA6E;AAE7E,MAAM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AE3B,OAAO,CACL,uBAAC,mBAAI,IAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,YAChC,uBAAC,gBAAgB,IAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAI,GACzE,CACR,CAAA;AACH,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VoltraWidgetPreview = VoltraWidgetPreview;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const VoltraView_js_1 = require("./VoltraView.js");
|
|
6
|
-
const WIDGET_DIMENSIONS = {
|
|
7
|
-
systemSmall: { width: 170, height: 170 },
|
|
8
|
-
systemMedium: { width: 364, height: 170 },
|
|
9
|
-
systemLarge: { width: 364, height: 382 },
|
|
10
|
-
systemExtraLarge: { width: 364, height: 768 },
|
|
11
|
-
accessoryCircular: { width: 76, height: 76 },
|
|
12
|
-
accessoryRectangular: { width: 172, height: 76 },
|
|
13
|
-
accessoryInline: { width: 172, height: 40 },
|
|
14
|
-
};
|
|
15
|
-
function VoltraWidgetPreview({ family, style, children, ...voltraViewProps }) {
|
|
16
|
-
const dimensions = WIDGET_DIMENSIONS[family];
|
|
17
|
-
const previewStyle = [
|
|
18
|
-
{
|
|
19
|
-
width: dimensions.width,
|
|
20
|
-
height: dimensions.height,
|
|
21
|
-
},
|
|
22
|
-
style,
|
|
23
|
-
];
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(VoltraView_js_1.VoltraView, { ...voltraViewProps, style: previewStyle, children: children }));
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=VoltraWidgetPreview.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VoltraWidgetPreview.js","sourceRoot":"","sources":["../../../src/components/VoltraWidgetPreview.tsx"],"names":[],"mappings":";;AAsBA,kDAeC;;AAhCD,mDAAkE;AAElE,MAAM,iBAAiB,GAA4D;IACjF,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;IACxC,YAAY,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;IACzC,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;IACxC,gBAAgB,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;IAC7C,iBAAiB,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IAC5C,oBAAoB,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE;IAChD,eAAe,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE;CAC5C,CAAA;AAOD,SAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,eAAe,EAA4B;IAC3G,MAAM,UAAU,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAA;IAC5C,MAAM,YAAY,GAAyB;QACzC;YACE,KAAK,EAAE,UAAU,CAAC,KAAK;YACvB,MAAM,EAAE,UAAU,CAAC,MAAM;SAC1B;QACD,KAAK;KACN,CAAA;IAED,OAAO,CACL,uBAAC,0BAAU,OAAK,eAAe,EAAE,KAAK,EAAE,YAAY,YACjD,QAAQ,GACE,CACd,CAAA;AACH,CAAC"}
|
package/build/cjs/events.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.addVoltraListener = addVoltraListener;
|
|
7
|
-
const react_native_1 = require("react-native");
|
|
8
|
-
const VoltraModule_js_1 = __importDefault(require("./VoltraModule.js"));
|
|
9
|
-
const noopSubscription = {
|
|
10
|
-
remove: () => { },
|
|
11
|
-
};
|
|
12
|
-
function addVoltraListener(event, listener) {
|
|
13
|
-
if (react_native_1.Platform.OS !== 'ios') {
|
|
14
|
-
console.warn(`[Voltra] Event '${event}' is only supported on iOS. Returning no-op subscription.`);
|
|
15
|
-
return noopSubscription;
|
|
16
|
-
}
|
|
17
|
-
return VoltraModule_js_1.default.addListener(event, listener);
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=events.js.map
|
package/build/cjs/events.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":";;;;;AA2CA,8CAUC;AArDD,+CAAuC;AAGvC,wEAA4C;AA6B5C,MAAM,gBAAgB,GAAsB;IAC1C,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;CACjB,CAAA;AASD,SAAgB,iBAAiB,CAC/B,KAAQ,EACR,QAA4C;IAE5C,IAAI,uBAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;QAC1B,OAAO,CAAC,IAAI,CAAC,mBAAmB,KAAK,2DAA2D,CAAC,CAAA;QACjG,OAAO,gBAAgB,CAAA;IACzB,CAAC;IAED,OAAO,yBAAY,CAAC,WAAW,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;AAClD,CAAC"}
|
package/build/cjs/helpers.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isGlassSupported = isGlassSupported;
|
|
7
|
-
exports.isHeadless = isHeadless;
|
|
8
|
-
const react_native_1 = require("react-native");
|
|
9
|
-
const VoltraModule_js_1 = __importDefault(require("./VoltraModule.js"));
|
|
10
|
-
function isGlassSupported() {
|
|
11
|
-
if (react_native_1.Platform.OS !== 'ios')
|
|
12
|
-
return false;
|
|
13
|
-
const v = react_native_1.Platform.Version;
|
|
14
|
-
let major = 0;
|
|
15
|
-
if (typeof v === 'string') {
|
|
16
|
-
const m = parseInt(v.split('.')[0] || '0', 10);
|
|
17
|
-
if (!Number.isNaN(m))
|
|
18
|
-
major = m;
|
|
19
|
-
}
|
|
20
|
-
else if (typeof v === 'number') {
|
|
21
|
-
major = Math.floor(v);
|
|
22
|
-
}
|
|
23
|
-
return major >= 26;
|
|
24
|
-
}
|
|
25
|
-
function isHeadless() {
|
|
26
|
-
if (react_native_1.Platform.OS !== 'ios')
|
|
27
|
-
return false;
|
|
28
|
-
return VoltraModule_js_1.default.isHeadless?.() ?? false;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=helpers.js.map
|
package/build/cjs/helpers.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":";;;;;AAIA,4CAWC;AAED,gCAGC;AApBD,+CAAuC;AAEvC,wEAA4C;AAE5C,SAAgB,gBAAgB;IAC9B,IAAI,uBAAQ,CAAC,EAAE,KAAK,KAAK;QAAE,OAAO,KAAK,CAAA;IACvC,MAAM,CAAC,GAAQ,uBAAQ,CAAC,OAAO,CAAA;IAC/B,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC1B,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC,CAAA;QAC9C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAAE,KAAK,GAAG,CAAC,CAAA;IACjC,CAAC;SAAM,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QACjC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACvB,CAAC;IACD,OAAO,KAAK,IAAI,EAAE,CAAA;AACpB,CAAC;AAED,SAAgB,UAAU;IACxB,IAAI,uBAAQ,CAAC,EAAE,KAAK,KAAK;QAAE,OAAO,KAAK,CAAA;IACvC,OAAO,yBAAY,CAAC,UAAU,EAAE,EAAE,IAAI,KAAK,CAAA;AAC7C,CAAC"}
|
package/build/cjs/index.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.updateWidget = exports.scheduleWidget = exports.reloadWidgets = exports.getActiveWidgets = exports.clearWidget = exports.clearAllWidgets = exports.setWidgetServerCredentials = exports.clearWidgetServerCredentials = exports.reloadLiveActivities = exports.preloadImages = exports.clearPreloadedImages = exports.useLiveActivity = exports.updateLiveActivity = exports.stopLiveActivity = exports.startLiveActivity = exports.isLiveActivityActive = exports.endAllLiveActivities = exports.isHeadless = exports.isGlassSupported = exports.VoltraWidgetPreview = exports.VoltraView = exports.VoltraLiveActivityPreview = void 0;
|
|
18
|
-
var VoltraLiveActivityPreview_js_1 = require("./components/VoltraLiveActivityPreview.js");
|
|
19
|
-
Object.defineProperty(exports, "VoltraLiveActivityPreview", { enumerable: true, get: function () { return VoltraLiveActivityPreview_js_1.VoltraLiveActivityPreview; } });
|
|
20
|
-
var VoltraView_js_1 = require("./components/VoltraView.js");
|
|
21
|
-
Object.defineProperty(exports, "VoltraView", { enumerable: true, get: function () { return VoltraView_js_1.VoltraView; } });
|
|
22
|
-
var VoltraWidgetPreview_js_1 = require("./components/VoltraWidgetPreview.js");
|
|
23
|
-
Object.defineProperty(exports, "VoltraWidgetPreview", { enumerable: true, get: function () { return VoltraWidgetPreview_js_1.VoltraWidgetPreview; } });
|
|
24
|
-
__exportStar(require("./events.js"), exports);
|
|
25
|
-
var helpers_js_1 = require("./helpers.js");
|
|
26
|
-
Object.defineProperty(exports, "isGlassSupported", { enumerable: true, get: function () { return helpers_js_1.isGlassSupported; } });
|
|
27
|
-
Object.defineProperty(exports, "isHeadless", { enumerable: true, get: function () { return helpers_js_1.isHeadless; } });
|
|
28
|
-
var api_js_1 = require("./live-activity/api.js");
|
|
29
|
-
Object.defineProperty(exports, "endAllLiveActivities", { enumerable: true, get: function () { return api_js_1.endAllLiveActivities; } });
|
|
30
|
-
Object.defineProperty(exports, "isLiveActivityActive", { enumerable: true, get: function () { return api_js_1.isLiveActivityActive; } });
|
|
31
|
-
Object.defineProperty(exports, "startLiveActivity", { enumerable: true, get: function () { return api_js_1.startLiveActivity; } });
|
|
32
|
-
Object.defineProperty(exports, "stopLiveActivity", { enumerable: true, get: function () { return api_js_1.stopLiveActivity; } });
|
|
33
|
-
Object.defineProperty(exports, "updateLiveActivity", { enumerable: true, get: function () { return api_js_1.updateLiveActivity; } });
|
|
34
|
-
Object.defineProperty(exports, "useLiveActivity", { enumerable: true, get: function () { return api_js_1.useLiveActivity; } });
|
|
35
|
-
var preload_js_1 = require("./preload.js");
|
|
36
|
-
Object.defineProperty(exports, "clearPreloadedImages", { enumerable: true, get: function () { return preload_js_1.clearPreloadedImages; } });
|
|
37
|
-
Object.defineProperty(exports, "preloadImages", { enumerable: true, get: function () { return preload_js_1.preloadImages; } });
|
|
38
|
-
Object.defineProperty(exports, "reloadLiveActivities", { enumerable: true, get: function () { return preload_js_1.reloadLiveActivities; } });
|
|
39
|
-
var server_credentials_js_1 = require("./widgets/server-credentials.js");
|
|
40
|
-
Object.defineProperty(exports, "clearWidgetServerCredentials", { enumerable: true, get: function () { return server_credentials_js_1.clearWidgetServerCredentials; } });
|
|
41
|
-
Object.defineProperty(exports, "setWidgetServerCredentials", { enumerable: true, get: function () { return server_credentials_js_1.setWidgetServerCredentials; } });
|
|
42
|
-
var widget_api_js_1 = require("./widgets/widget-api.js");
|
|
43
|
-
Object.defineProperty(exports, "clearAllWidgets", { enumerable: true, get: function () { return widget_api_js_1.clearAllWidgets; } });
|
|
44
|
-
Object.defineProperty(exports, "clearWidget", { enumerable: true, get: function () { return widget_api_js_1.clearWidget; } });
|
|
45
|
-
Object.defineProperty(exports, "getActiveWidgets", { enumerable: true, get: function () { return widget_api_js_1.getActiveWidgets; } });
|
|
46
|
-
Object.defineProperty(exports, "reloadWidgets", { enumerable: true, get: function () { return widget_api_js_1.reloadWidgets; } });
|
|
47
|
-
Object.defineProperty(exports, "scheduleWidget", { enumerable: true, get: function () { return widget_api_js_1.scheduleWidget; } });
|
|
48
|
-
Object.defineProperty(exports, "updateWidget", { enumerable: true, get: function () { return widget_api_js_1.updateWidget; } });
|
|
49
|
-
//# sourceMappingURL=index.js.map
|
package/build/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0FAGkD;AAFhD,yIAAA,yBAAyB,OAAA;AAG3B,4DAA6E;AAApE,2GAAA,UAAU,OAAA;AACnB,8EAAwG;AAA/F,6HAAA,mBAAmB,OAAA;AAC5B,8CAA2B;AAC3B,2CAA2D;AAAlD,8GAAA,gBAAgB,OAAA;AAAE,wGAAA,UAAU,OAAA;AACrC,iDAa+B;AAZ7B,8GAAA,oBAAoB,OAAA;AAEpB,8GAAA,oBAAoB,OAAA;AAEpB,2GAAA,iBAAiB,OAAA;AAEjB,0GAAA,gBAAgB,OAAA;AAChB,4GAAA,kBAAkB,OAAA;AAElB,yGAAA,eAAe,OAAA;AAKjB,2CAMqB;AALnB,kHAAA,oBAAoB,OAAA;AAEpB,2GAAA,aAAa,OAAA;AAEb,kHAAA,oBAAoB,OAAA;AAGtB,yEAIwC;AAHtC,qIAAA,4BAA4B,OAAA;AAC5B,mIAAA,0BAA0B,OAAA;AAI5B,yDASgC;AAR9B,gHAAA,eAAe,OAAA;AACf,4GAAA,WAAW,OAAA;AACX,iHAAA,gBAAgB,OAAA;AAChB,8GAAA,aAAa,OAAA;AAEb,+GAAA,cAAc,OAAA;AACd,6GAAA,YAAY,OAAA"}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isLiveActivityActive = exports.stopLiveActivity = exports.updateLiveActivity = exports.startLiveActivity = exports.useLiveActivity = void 0;
|
|
7
|
-
exports.endAllLiveActivities = endAllLiveActivities;
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const ios_1 = require("@use-voltra/ios");
|
|
10
|
-
const events_js_1 = require("../events.js");
|
|
11
|
-
const logger_js_1 = require("../logger.js");
|
|
12
|
-
const index_js_1 = require("../utils/index.js");
|
|
13
|
-
const VoltraModule_js_1 = __importDefault(require("../VoltraModule.js"));
|
|
14
|
-
const normalizeSharedLiveActivityOptions = (options) => {
|
|
15
|
-
if (!options)
|
|
16
|
-
return undefined;
|
|
17
|
-
const normalizedOptions = {};
|
|
18
|
-
if (options.staleDate !== undefined) {
|
|
19
|
-
if (options.staleDate < Date.now()) {
|
|
20
|
-
logger_js_1.logger.warn('Ignoring staleDate because it is in the past, the Live Activity would be dismissed immediately.');
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
normalizedOptions.staleDate = options.staleDate;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
const relevanceScore = options.relevanceScore ?? 0.0;
|
|
27
|
-
if (relevanceScore < 0 || relevanceScore > 1) {
|
|
28
|
-
logger_js_1.logger.warn('Ignoring relevanceScore because it is out of range [0.0, 1.0], using default 0.0');
|
|
29
|
-
normalizedOptions.relevanceScore = 0.0;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
normalizedOptions.relevanceScore = relevanceScore;
|
|
33
|
-
}
|
|
34
|
-
return Object.keys(normalizedOptions).length > 0 ? normalizedOptions : undefined;
|
|
35
|
-
};
|
|
36
|
-
const normalizeEndLiveActivityOptions = (options) => {
|
|
37
|
-
if (!options?.dismissalPolicy)
|
|
38
|
-
return undefined;
|
|
39
|
-
if (typeof options.dismissalPolicy === 'string') {
|
|
40
|
-
if (options.dismissalPolicy === 'immediate') {
|
|
41
|
-
return { dismissalPolicy: { type: 'immediate' } };
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
else if (typeof options.dismissalPolicy === 'object' && 'after' in options.dismissalPolicy) {
|
|
45
|
-
return { dismissalPolicy: { type: 'after', date: options.dismissalPolicy.after } };
|
|
46
|
-
}
|
|
47
|
-
return { dismissalPolicy: { type: 'immediate' } };
|
|
48
|
-
};
|
|
49
|
-
const useLiveActivity = (variants, options) => {
|
|
50
|
-
const [targetId, setTargetId] = (0, react_1.useState)(() => {
|
|
51
|
-
if (options?.activityName) {
|
|
52
|
-
return (0, exports.isLiveActivityActive)(options.activityName) ? options.activityName : null;
|
|
53
|
-
}
|
|
54
|
-
return null;
|
|
55
|
-
});
|
|
56
|
-
const isActive = targetId !== null;
|
|
57
|
-
const optionsRef = (0, react_1.useRef)(options);
|
|
58
|
-
const variantsRef = (0, react_1.useRef)(variants);
|
|
59
|
-
const lastUpdateOptionsRef = (0, react_1.useRef)(undefined);
|
|
60
|
-
(0, react_1.useEffect)(() => {
|
|
61
|
-
optionsRef.current = options;
|
|
62
|
-
}, [options]);
|
|
63
|
-
(0, react_1.useEffect)(() => {
|
|
64
|
-
variantsRef.current = variants;
|
|
65
|
-
}, [variants]);
|
|
66
|
-
(0, index_js_1.useUpdateOnHMR)();
|
|
67
|
-
const start = (0, react_1.useCallback)(async (options) => {
|
|
68
|
-
const id = await (0, exports.startLiveActivity)(variantsRef.current, { ...optionsRef.current, ...options });
|
|
69
|
-
setTargetId(id);
|
|
70
|
-
}, []);
|
|
71
|
-
const update = (0, react_1.useCallback)(async (options) => {
|
|
72
|
-
if (!targetId) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const updateOptions = { ...optionsRef.current, ...options };
|
|
76
|
-
lastUpdateOptionsRef.current = updateOptions;
|
|
77
|
-
await (0, exports.updateLiveActivity)(targetId, variantsRef.current, updateOptions);
|
|
78
|
-
}, [targetId]);
|
|
79
|
-
const end = (0, react_1.useCallback)(async (options) => {
|
|
80
|
-
if (!targetId) {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
await (0, exports.stopLiveActivity)(targetId, options);
|
|
84
|
-
setTargetId(null);
|
|
85
|
-
}, [targetId]);
|
|
86
|
-
(0, react_1.useEffect)(() => {
|
|
87
|
-
if (!options?.autoStart) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
start();
|
|
91
|
-
}, [options?.autoStart, start]);
|
|
92
|
-
(0, react_1.useEffect)(() => {
|
|
93
|
-
if (!options?.autoUpdate)
|
|
94
|
-
return;
|
|
95
|
-
update(lastUpdateOptionsRef.current);
|
|
96
|
-
}, [options?.autoUpdate, update, variants]);
|
|
97
|
-
(0, react_1.useEffect)(() => {
|
|
98
|
-
if (!targetId)
|
|
99
|
-
return;
|
|
100
|
-
const subscription = (0, events_js_1.addVoltraListener)('stateChange', (event) => {
|
|
101
|
-
if (event.activityName !== targetId)
|
|
102
|
-
return;
|
|
103
|
-
if (event.activityState === 'dismissed' || event.activityState === 'ended') {
|
|
104
|
-
setTargetId(null);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
return () => subscription.remove();
|
|
108
|
-
}, [targetId]);
|
|
109
|
-
return {
|
|
110
|
-
start,
|
|
111
|
-
update,
|
|
112
|
-
end,
|
|
113
|
-
isActive,
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
exports.useLiveActivity = useLiveActivity;
|
|
117
|
-
const startLiveActivity = async (variants, options) => {
|
|
118
|
-
if (!(0, index_js_1.assertRunningOnApple)())
|
|
119
|
-
return Promise.resolve('');
|
|
120
|
-
const payload = (0, ios_1.renderLiveActivityToString)(variants);
|
|
121
|
-
const normalizedSharedOptions = normalizeSharedLiveActivityOptions(options);
|
|
122
|
-
const targetId = await VoltraModule_js_1.default.startLiveActivity(payload, {
|
|
123
|
-
target: 'liveActivity',
|
|
124
|
-
deepLinkUrl: options?.deepLinkUrl,
|
|
125
|
-
activityName: options?.activityName,
|
|
126
|
-
channelId: options?.channelId,
|
|
127
|
-
...normalizedSharedOptions,
|
|
128
|
-
});
|
|
129
|
-
return targetId;
|
|
130
|
-
};
|
|
131
|
-
exports.startLiveActivity = startLiveActivity;
|
|
132
|
-
const updateLiveActivity = async (targetId, variants, options) => {
|
|
133
|
-
if (!(0, index_js_1.assertRunningOnApple)())
|
|
134
|
-
return Promise.resolve();
|
|
135
|
-
const payload = (0, ios_1.renderLiveActivityToString)(variants);
|
|
136
|
-
const normalizedSharedOptions = normalizeSharedLiveActivityOptions(options);
|
|
137
|
-
return VoltraModule_js_1.default.updateLiveActivity(targetId, payload, normalizedSharedOptions);
|
|
138
|
-
};
|
|
139
|
-
exports.updateLiveActivity = updateLiveActivity;
|
|
140
|
-
const stopLiveActivity = async (targetId, options) => {
|
|
141
|
-
if (!(0, index_js_1.assertRunningOnApple)())
|
|
142
|
-
return Promise.resolve();
|
|
143
|
-
const normalizedOptions = normalizeEndLiveActivityOptions(options);
|
|
144
|
-
return VoltraModule_js_1.default.endLiveActivity(targetId, normalizedOptions);
|
|
145
|
-
};
|
|
146
|
-
exports.stopLiveActivity = stopLiveActivity;
|
|
147
|
-
const isLiveActivityActive = (activityName) => {
|
|
148
|
-
if (!(0, index_js_1.assertRunningOnApple)())
|
|
149
|
-
return false;
|
|
150
|
-
return VoltraModule_js_1.default.isLiveActivityActive(activityName);
|
|
151
|
-
};
|
|
152
|
-
exports.isLiveActivityActive = isLiveActivityActive;
|
|
153
|
-
async function endAllLiveActivities() {
|
|
154
|
-
if (!(0, index_js_1.assertRunningOnApple)())
|
|
155
|
-
return Promise.resolve();
|
|
156
|
-
return VoltraModule_js_1.default.endAllLiveActivities();
|
|
157
|
-
}
|
|
158
|
-
//# sourceMappingURL=api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/live-activity/api.ts"],"names":[],"mappings":";;;;;;AA4NA,oDAGC;AA/ND,iCAAgE;AAEhE,yCAA6G;AAE7G,4CAAgD;AAChD,4CAAqC;AACrC,gDAAwE;AACxE,yEAA6C;AAmC7C,MAAM,kCAAkC,GAAG,CACzC,OAAmC,EACI,EAAE;IACzC,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAA;IAE9B,MAAM,iBAAiB,GAA8B,EAAE,CAAA;IAEvD,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACpC,IAAI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;YACnC,kBAAM,CAAC,IAAI,CAAC,iGAAiG,CAAC,CAAA;QAChH,CAAC;aAAM,CAAC;YACN,iBAAiB,C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,CAAC,CAAA;IAC3E,OAAO,yBAAY,CAAC,kBAAkB,CAAC,QAAQ,EAAE,OAAO,EAAE,uBAAuB,CAAC,CAAA;AACpF,CAAC,CAAA;AAXY,QAAA,kBAAkB,sBAW9B;AAEM,MAAM,gBAAgB,GAAG,KAAK,EAAE,QAAgB,EAAE,OAAgC,EAAiB,EAAE;IAC1G,IAAI,CAAC,IAAA,+BAAoB,GAAE;QAAE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAErD,MAAM,iBAAiB,GAAG,+BAA+B,CAAC,OAAO,CAAC,CAAA;IAClE,OAAO,yBAAY,CAAC,eAAe,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAA;AAClE,CAAC,CAAA;AALY,QAAA,gBAAgB,oBAK5B;AAEM,MAAM,oBAAoB,GAAG,CAAC,YAAoB,EAAW,EAAE;IACpE,IAAI,CAAC,IAAA,+BAAoB,GAAE;QAAE,OAAO,KAAK,CAAA;IAEzC,OAAO,yBAAY,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAA;AACxD,CAAC,CAAA;AAJY,QAAA,oBAAoB,wBAIhC;AAEM,KAAK,UAAU,oBAAoB;IACxC,IAAI,CAAC,IAAA,+BAAoB,GAAE;QAAE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IACrD,OAAO,yBAAY,CAAC,oBAAoB,EAAE,CAAA;AAC5C,CAAC"}
|
package/build/cjs/logger.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logger = void 0;
|
|
4
|
-
const LEVELS = {
|
|
5
|
-
debug: 0,
|
|
6
|
-
info: 1,
|
|
7
|
-
warn: 2,
|
|
8
|
-
error: 3,
|
|
9
|
-
};
|
|
10
|
-
let currentLevel = __DEV__ ? 'debug' : 'info';
|
|
11
|
-
exports.logger = {
|
|
12
|
-
debug: (message) => {
|
|
13
|
-
if (LEVELS.debug >= LEVELS[currentLevel]) {
|
|
14
|
-
console.log(`[Voltra] ${message}`);
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
info: (message) => {
|
|
18
|
-
if (LEVELS.info >= LEVELS[currentLevel]) {
|
|
19
|
-
console.info(`[Voltra] ${message}`);
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
warn: (message) => {
|
|
23
|
-
if (LEVELS.warn >= LEVELS[currentLevel]) {
|
|
24
|
-
console.warn(`[Voltra] ${message}`);
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
error: (message) => {
|
|
28
|
-
if (LEVELS.error >= LEVELS[currentLevel]) {
|
|
29
|
-
console.error(`[Voltra] ${message}`);
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
setLevel: (level) => {
|
|
33
|
-
currentLevel = level;
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=logger.js.map
|