@use-voltra/ios-client 1.4.1 → 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,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.endAllLiveActivities = endAllLiveActivities;
|
|
7
|
+
exports.useLiveActivity = exports.updateLiveActivity = exports.stopLiveActivity = exports.startLiveActivity = exports.isLiveActivityActive = void 0;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _ios = require("@use-voltra/ios");
|
|
10
|
+
var _events = require("../events.js");
|
|
11
|
+
var _logger = require("../logger.js");
|
|
12
|
+
var _index = require("../utils/index.js");
|
|
13
|
+
var _VoltraModule = require("../VoltraModule.js");
|
|
14
|
+
const normalizeSharedLiveActivityOptions = options => {
|
|
15
|
+
if (!options) return undefined;
|
|
16
|
+
const normalizedOptions = {};
|
|
17
|
+
if (options.staleDate !== undefined) {
|
|
18
|
+
if (options.staleDate < Date.now()) {
|
|
19
|
+
_logger.logger.warn('Ignoring staleDate because it is in the past, the Live Activity would be dismissed immediately.');
|
|
20
|
+
} else {
|
|
21
|
+
normalizedOptions.staleDate = options.staleDate;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const relevanceScore = options.relevanceScore ?? 0.0;
|
|
25
|
+
if (relevanceScore < 0 || relevanceScore > 1) {
|
|
26
|
+
_logger.logger.warn('Ignoring relevanceScore because it is out of range [0.0, 1.0], using default 0.0');
|
|
27
|
+
normalizedOptions.relevanceScore = 0.0;
|
|
28
|
+
} else {
|
|
29
|
+
normalizedOptions.relevanceScore = relevanceScore;
|
|
30
|
+
}
|
|
31
|
+
return Object.keys(normalizedOptions).length > 0 ? normalizedOptions : undefined;
|
|
32
|
+
};
|
|
33
|
+
const normalizeEndLiveActivityOptions = options => {
|
|
34
|
+
if (!options?.dismissalPolicy) return undefined;
|
|
35
|
+
if (typeof options.dismissalPolicy === 'string') {
|
|
36
|
+
if (options.dismissalPolicy === 'immediate') {
|
|
37
|
+
return {
|
|
38
|
+
dismissalPolicy: {
|
|
39
|
+
type: 'immediate'
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
} else if (typeof options.dismissalPolicy === 'object' && 'after' in options.dismissalPolicy) {
|
|
44
|
+
return {
|
|
45
|
+
dismissalPolicy: {
|
|
46
|
+
type: 'after',
|
|
47
|
+
date: options.dismissalPolicy.after
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
dismissalPolicy: {
|
|
53
|
+
type: 'immediate'
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
const useLiveActivity = (variants, options) => {
|
|
58
|
+
const [targetId, setTargetId] = (0, _react.useState)(() => {
|
|
59
|
+
if (options?.activityName) {
|
|
60
|
+
return isLiveActivityActive(options.activityName) ? options.activityName : null;
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
});
|
|
64
|
+
const isActive = targetId !== null;
|
|
65
|
+
const optionsRef = (0, _react.useRef)(options);
|
|
66
|
+
const variantsRef = (0, _react.useRef)(variants);
|
|
67
|
+
const lastUpdateOptionsRef = (0, _react.useRef)(undefined);
|
|
68
|
+
(0, _react.useEffect)(() => {
|
|
69
|
+
optionsRef.current = options;
|
|
70
|
+
}, [options]);
|
|
71
|
+
(0, _react.useEffect)(() => {
|
|
72
|
+
variantsRef.current = variants;
|
|
73
|
+
}, [variants]);
|
|
74
|
+
(0, _index.useUpdateOnHMR)();
|
|
75
|
+
const start = (0, _react.useCallback)(async options => {
|
|
76
|
+
const id = await startLiveActivity(variantsRef.current, {
|
|
77
|
+
...optionsRef.current,
|
|
78
|
+
...options
|
|
79
|
+
});
|
|
80
|
+
setTargetId(id);
|
|
81
|
+
}, []);
|
|
82
|
+
const update = (0, _react.useCallback)(async options => {
|
|
83
|
+
if (!targetId) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const updateOptions = {
|
|
87
|
+
...optionsRef.current,
|
|
88
|
+
...options
|
|
89
|
+
};
|
|
90
|
+
lastUpdateOptionsRef.current = updateOptions;
|
|
91
|
+
await updateLiveActivity(targetId, variantsRef.current, updateOptions);
|
|
92
|
+
}, [targetId]);
|
|
93
|
+
const end = (0, _react.useCallback)(async options => {
|
|
94
|
+
if (!targetId) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
await stopLiveActivity(targetId, options);
|
|
98
|
+
setTargetId(null);
|
|
99
|
+
}, [targetId]);
|
|
100
|
+
(0, _react.useEffect)(() => {
|
|
101
|
+
if (!options?.autoStart) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
start();
|
|
105
|
+
}, [options?.autoStart, start]);
|
|
106
|
+
(0, _react.useEffect)(() => {
|
|
107
|
+
if (!options?.autoUpdate) return;
|
|
108
|
+
update(lastUpdateOptionsRef.current);
|
|
109
|
+
}, [options?.autoUpdate, update, variants]);
|
|
110
|
+
(0, _react.useEffect)(() => {
|
|
111
|
+
if (!targetId) return;
|
|
112
|
+
const subscription = (0, _events.addVoltraListener)('stateChange', event => {
|
|
113
|
+
if (event.activityName !== targetId) return;
|
|
114
|
+
if (event.activityState === 'dismissed' || event.activityState === 'ended') {
|
|
115
|
+
setTargetId(null);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
return () => subscription.remove();
|
|
119
|
+
}, [targetId]);
|
|
120
|
+
return {
|
|
121
|
+
start,
|
|
122
|
+
update,
|
|
123
|
+
end,
|
|
124
|
+
isActive
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
exports.useLiveActivity = useLiveActivity;
|
|
128
|
+
const startLiveActivity = async (variants, options) => {
|
|
129
|
+
if (!(0, _index.assertRunningOnApple)()) return Promise.resolve('');
|
|
130
|
+
const payload = (0, _ios.renderLiveActivityToString)(variants);
|
|
131
|
+
const normalizedSharedOptions = normalizeSharedLiveActivityOptions(options);
|
|
132
|
+
const targetId = await (0, _VoltraModule.getNativeVoltra)().startLiveActivity(payload, {
|
|
133
|
+
target: 'liveActivity',
|
|
134
|
+
deepLinkUrl: options?.deepLinkUrl,
|
|
135
|
+
activityName: options?.activityName,
|
|
136
|
+
channelId: options?.channelId,
|
|
137
|
+
...normalizedSharedOptions
|
|
138
|
+
});
|
|
139
|
+
return targetId;
|
|
140
|
+
};
|
|
141
|
+
exports.startLiveActivity = startLiveActivity;
|
|
142
|
+
const updateLiveActivity = async (targetId, variants, options) => {
|
|
143
|
+
if (!(0, _index.assertRunningOnApple)()) return Promise.resolve();
|
|
144
|
+
const payload = (0, _ios.renderLiveActivityToString)(variants);
|
|
145
|
+
const normalizedSharedOptions = normalizeSharedLiveActivityOptions(options);
|
|
146
|
+
return (0, _VoltraModule.getNativeVoltra)().updateLiveActivity(targetId, payload, normalizedSharedOptions ?? {});
|
|
147
|
+
};
|
|
148
|
+
exports.updateLiveActivity = updateLiveActivity;
|
|
149
|
+
const stopLiveActivity = async (targetId, options) => {
|
|
150
|
+
if (!(0, _index.assertRunningOnApple)()) return Promise.resolve();
|
|
151
|
+
const normalizedOptions = normalizeEndLiveActivityOptions(options);
|
|
152
|
+
return (0, _VoltraModule.getNativeVoltra)().endLiveActivity(targetId, normalizedOptions ?? {
|
|
153
|
+
dismissalPolicy: {
|
|
154
|
+
type: 'immediate'
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
exports.stopLiveActivity = stopLiveActivity;
|
|
159
|
+
const isLiveActivityActive = activityName => {
|
|
160
|
+
if (!(0, _index.assertRunningOnApple)()) return false;
|
|
161
|
+
return (0, _VoltraModule.getNativeVoltra)().isLiveActivityActive(activityName);
|
|
162
|
+
};
|
|
163
|
+
exports.isLiveActivityActive = isLiveActivityActive;
|
|
164
|
+
async function endAllLiveActivities() {
|
|
165
|
+
if (!(0, _index.assertRunningOnApple)()) return Promise.resolve();
|
|
166
|
+
return (0, _VoltraModule.getNativeVoltra)().endAllLiveActivities();
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_ios","_events","_logger","_index","_VoltraModule","normalizeSharedLiveActivityOptions","options","undefined","normalizedOptions","staleDate","Date","now","logger","warn","relevanceScore","Object","keys","length","normalizeEndLiveActivityOptions","dismissalPolicy","type","date","after","useLiveActivity","variants","targetId","setTargetId","useState","activityName","isLiveActivityActive","isActive","optionsRef","useRef","variantsRef","lastUpdateOptionsRef","useEffect","current","useUpdateOnHMR","start","useCallback","id","startLiveActivity","update","updateOptions","updateLiveActivity","end","stopLiveActivity","autoStart","autoUpdate","subscription","addVoltraListener","event","activityState","remove","exports","assertRunningOnApple","Promise","resolve","payload","renderLiveActivityToString","normalizedSharedOptions","getNativeVoltra","target","deepLinkUrl","channelId","endLiveActivity","endAllLiveActivities"],"sourceRoot":"../../../src","sources":["live-activity/api.ts"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,IAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAmCA,MAAMM,kCAAkC,GACtCC,OAAmC,IACO;EAC1C,IAAI,CAACA,OAAO,EAAE,OAAOC,SAAS;EAE9B,MAAMC,iBAA4C,GAAG,CAAC,CAAC;EAEvD,IAAIF,OAAO,CAACG,SAAS,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N,OAAA,CAAAV,kBAAA,GAAAA,kBAAA;AAEM,MAAME,gBAAgB,GAAG,MAAAA,CAAOrB,QAAgB,EAAEnB,OAAgC,KAAoB;EAC3G,IAAI,CAAC,IAAAiD,2BAAoB,EAAC,CAAC,EAAE,OAAOC,OAAO,CAACC,OAAO,CAAC,CAAC;EAErD,MAAMjD,iBAAiB,GAAGU,+BAA+B,CAACZ,OAAO,CAAC;EAClE,OAAO,IAAAuD,6BAAe,EAAC,CAAC,CAACI,eAAe,CAACxC,QAAQ,EAAEjB,iBAAiB,IAAI;IAAEW,eAAe,EAAE;MAAEC,IAAI,EAAE;IAAY;EAAE,CAAC,CAAC;AACrH,CAAC;AAAAkC,OAAA,CAAAR,gBAAA,GAAAA,gBAAA;AAEM,MAAMjB,oBAAoB,GAAID,YAAoB,IAAc;EACrE,IAAI,CAAC,IAAA2B,2BAAoB,EAAC,CAAC,EAAE,OAAO,KAAK;EAEzC,OAAO,IAAAM,6BAAe,EAAC,CAAC,CAAChC,oBAAoB,CAACD,YAAY,CAAC;AAC7D,CAAC;AAAA0B,OAAA,CAAAzB,oBAAA,GAAAA,oBAAA;AAEM,eAAeqC,oBAAoBA,CAAA,EAAkB;EAC1D,IAAI,CAAC,IAAAX,2BAAoB,EAAC,CAAC,EAAE,OAAOC,OAAO,CAACC,OAAO,CAAC,CAAC;EACrD,OAAO,IAAAI,6BAAe,EAAC,CAAC,CAACK,oBAAoB,CAAC,CAAC;AACjD","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.logger = void 0;
|
|
7
|
+
const LEVELS = {
|
|
8
|
+
debug: 0,
|
|
9
|
+
info: 1,
|
|
10
|
+
warn: 2,
|
|
11
|
+
error: 3
|
|
12
|
+
};
|
|
13
|
+
let currentLevel = __DEV__ ? 'debug' : 'info';
|
|
14
|
+
const logger = exports.logger = {
|
|
15
|
+
debug: message => {
|
|
16
|
+
if (LEVELS.debug >= LEVELS[currentLevel]) {
|
|
17
|
+
console.log(`[Voltra] ${message}`);
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
info: message => {
|
|
21
|
+
if (LEVELS.info >= LEVELS[currentLevel]) {
|
|
22
|
+
console.info(`[Voltra] ${message}`);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
warn: message => {
|
|
26
|
+
if (LEVELS.warn >= LEVELS[currentLevel]) {
|
|
27
|
+
console.warn(`[Voltra] ${message}`);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
error: message => {
|
|
31
|
+
if (LEVELS.error >= LEVELS[currentLevel]) {
|
|
32
|
+
console.error(`[Voltra] ${message}`);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
setLevel: level => {
|
|
36
|
+
currentLevel = level;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LEVELS","debug","info","warn","error","currentLevel","__DEV__","logger","exports","message","console","log","setLevel","level"],"sourceRoot":"../../src","sources":["logger.ts"],"mappings":";;;;;;AAAA,MAAMA,MAAM,GAAG;EACbC,KAAK,EAAE,CAAC;EACRC,IAAI,EAAE,CAAC;EACPC,IAAI,EAAE,CAAC;EACPC,KAAK,EAAE;AACT,CAAU;AAGV,IAAIC,YAA4B,GAAGC,OAAO,GAAG,OAAO,GAAG,MAAM;AAEtD,MAAMC,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG;EACpBN,KAAK,EAAGQ,OAAe,IAAK;IAC1B,IAAIT,MAAM,CAACC,KAAK,IAAID,MAAM,CAACK,YAAY,CAAC,EAAE;MACxCK,OAAO,CAACC,GAAG,CAAC,YAAYF,OAAO,EAAE,CAAC;IACpC;EACF,CAAC;EACDP,IAAI,EAAGO,OAAe,IAAK;IACzB,IAAIT,MAAM,CAACE,IAAI,IAAIF,MAAM,CAACK,YAAY,CAAC,EAAE;MACvCK,OAAO,CAACR,IAAI,CAAC,YAAYO,OAAO,EAAE,CAAC;IACrC;EACF,CAAC;EACDN,IAAI,EAAGM,OAAe,IAAK;IACzB,IAAIT,MAAM,CAACG,IAAI,IAAIH,MAAM,CAACK,YAAY,CAAC,EAAE;MACvCK,OAAO,CAACP,IAAI,CAAC,YAAYM,OAAO,EAAE,CAAC;IACrC;EACF,CAAC;EACDL,KAAK,EAAGK,OAAe,IAAK;IAC1B,IAAIT,MAAM,CAACI,KAAK,IAAIJ,MAAM,CAACK,YAAY,CAAC,EAAE;MACxCK,OAAO,CAACN,KAAK,CAAC,YAAYK,OAAO,EAAE,CAAC;IACtC;EACF,CAAC;EACDG,QAAQ,EAAGC,KAAqB,IAAK;IACnCR,YAAY,GAAGQ,KAAK;EACtB;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getNativeVoltra = getNativeVoltra;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
function getNativeVoltra() {
|
|
9
|
+
const voltraModule = _reactNative.TurboModuleRegistry.get('NativeVoltra');
|
|
10
|
+
if (voltraModule == null) {
|
|
11
|
+
throw new Error('NativeVoltra is not available');
|
|
12
|
+
}
|
|
13
|
+
return voltraModule;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=NativeVoltra.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","getNativeVoltra","voltraModule","TurboModuleRegistry","get","Error"],"sourceRoot":"../../../src","sources":["native/NativeVoltra.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AA4GO,SAASC,eAAeA,CAAA,EAAS;EACtC,MAAMC,YAAY,GAAGC,gCAAmB,CAACC,GAAG,CAAO,cAAc,CAAC;EAElE,IAAIF,YAAY,IAAI,IAAI,EAAE;IACxB,MAAM,IAAIG,KAAK,CAAC,+BAA+B,CAAC;EAClD;EAEA,OAAOH,YAAY;AACrB","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HostComponent, ViewProps } from 'react-native'
|
|
2
|
+
import { codegenNativeComponent } from 'react-native'
|
|
3
|
+
|
|
4
|
+
export interface NativeProps extends ViewProps {
|
|
5
|
+
payload: string
|
|
6
|
+
viewId: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default codegenNativeComponent<NativeProps>('VoltraView') as HostComponent<NativeProps>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.clearPreloadedImages = clearPreloadedImages;
|
|
7
|
+
exports.preloadImages = preloadImages;
|
|
8
|
+
exports.reloadLiveActivities = reloadLiveActivities;
|
|
9
|
+
var _reactNative = require("react-native");
|
|
10
|
+
var _VoltraModule = require("./VoltraModule.js");
|
|
11
|
+
function assertIOS(name) {
|
|
12
|
+
const isIOS = _reactNative.Platform.OS === 'ios';
|
|
13
|
+
if (!isIOS) console.error(`${name} is only available on iOS`);
|
|
14
|
+
return isIOS;
|
|
15
|
+
}
|
|
16
|
+
async function preloadImages(images) {
|
|
17
|
+
if (!assertIOS('preloadImages')) {
|
|
18
|
+
return {
|
|
19
|
+
succeeded: [],
|
|
20
|
+
failed: images.map(img => ({
|
|
21
|
+
key: img.key,
|
|
22
|
+
error: 'Not available on this platform'
|
|
23
|
+
}))
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
return await (0, _VoltraModule.getNativeVoltra)().preloadImages(images);
|
|
28
|
+
} catch (error) {
|
|
29
|
+
return {
|
|
30
|
+
succeeded: [],
|
|
31
|
+
failed: images.map(img => ({
|
|
32
|
+
key: img.key,
|
|
33
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
34
|
+
}))
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async function reloadLiveActivities(activityNames) {
|
|
39
|
+
if (!assertIOS('reloadLiveActivities')) return;
|
|
40
|
+
try {
|
|
41
|
+
await (0, _VoltraModule.getNativeVoltra)().reloadLiveActivities(activityNames ?? null);
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.error('Failed to reload Live Activities:', error);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async function clearPreloadedImages(keys) {
|
|
47
|
+
if (!assertIOS('clearPreloadedImages')) return;
|
|
48
|
+
try {
|
|
49
|
+
await (0, _VoltraModule.getNativeVoltra)().clearPreloadedImages(keys ?? null);
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.error('Failed to clear preloaded images:', error);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=preload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_VoltraModule","assertIOS","name","isIOS","Platform","OS","console","error","preloadImages","images","succeeded","failed","map","img","key","getNativeVoltra","Error","message","reloadLiveActivities","activityNames","clearPreloadedImages","keys"],"sourceRoot":"../../src","sources":["preload.ts"],"mappings":";;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,IAAAC,aAAA,GAAAD,OAAA;AAIA,SAASE,SAASA,CAACC,IAAY,EAAW;EACxC,MAAMC,KAAK,GAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAK;EACnC,IAAI,CAACF,KAAK,EAAEG,OAAO,CAACC,KAAK,CAAC,GAAGL,IAAI,2BAA2B,CAAC;EAC7D,OAAOC,KAAK;AACd;AAEO,eAAeK,aAAaA,CAACC,MAA6B,EAAgC;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|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.assertRunningOnApple = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
const assertRunningOnApple = () => {
|
|
9
|
+
if (_reactNative.Platform.OS !== 'ios') {
|
|
10
|
+
console.error(`Voltra is available only on iOS!`);
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
return true;
|
|
14
|
+
};
|
|
15
|
+
exports.assertRunningOnApple = assertRunningOnApple;
|
|
16
|
+
//# sourceMappingURL=assertRunningOnApple.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","assertRunningOnApple","Platform","OS","console","error","exports"],"sourceRoot":"../../../src","sources":["utils/assertRunningOnApple.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,MAAMC,oBAAoB,GAAGA,CAAA,KAAe;EACjD,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IACzBC,OAAO,CAACC,KAAK,CAAC,kCAAkC,CAAC;IACjD,OAAO,KAAK;EACd;EAEA,OAAO,IAAI;AACb,CAAC;AAAAC,OAAA,CAAAL,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "isGlassSupported", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _helpers.isGlassSupported;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "isHeadless", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _helpers.isHeadless;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _helpers = require("../helpers.js");
|
|
19
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_helpers","require"],"sourceRoot":"../../../src","sources":["utils/helpers.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _assertRunningOnApple = require("./assertRunningOnApple.js");
|
|
7
|
+
Object.keys(_assertRunningOnApple).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _assertRunningOnApple[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _assertRunningOnApple[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _useUpdateOnHMR = require("./useUpdateOnHMR.js");
|
|
18
|
+
Object.keys(_useUpdateOnHMR).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _useUpdateOnHMR[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _useUpdateOnHMR[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_assertRunningOnApple","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_useUpdateOnHMR"],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,qBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,qBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,qBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,eAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,eAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,eAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,eAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useUpdateOnHMR = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
const useUpdateOnHMR = () => {
|
|
9
|
+
const [, forceUpdate] = (0, _react.useState)(0);
|
|
10
|
+
(0, _react.useEffect)(() => {
|
|
11
|
+
if (!__DEV__) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const oldAccept = global['__accept'];
|
|
15
|
+
global['__accept'] = (...args) => {
|
|
16
|
+
forceUpdate(prev => prev + 1);
|
|
17
|
+
oldAccept?.(...args);
|
|
18
|
+
};
|
|
19
|
+
return () => {
|
|
20
|
+
global['__accept'] = oldAccept;
|
|
21
|
+
};
|
|
22
|
+
}, []);
|
|
23
|
+
};
|
|
24
|
+
exports.useUpdateOnHMR = useUpdateOnHMR;
|
|
25
|
+
//# sourceMappingURL=useUpdateOnHMR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","useUpdateOnHMR","forceUpdate","useState","useEffect","__DEV__","oldAccept","global","args","prev","exports"],"sourceRoot":"../../../src","sources":["utils/useUpdateOnHMR.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMO,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAClC,MAAM,GAAGC,WAAW,CAAC,GAAG,IAAAC,eAAQ,EAAC,CAAC,CAAC;EAEnC,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAI,CAACC,OAAO,EAAE;MACZ;IACF;IAEA,MAAMC,SAAS,GAAGC,MAAM,CAAC,UAAU,CAAC;IACpCA,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,GAAGC,IAAI,KAAK;MAChCN,WAAW,CAAEO,IAAI,IAAKA,IAAI,GAAG,CAAC,CAAC;MAC/BH,SAAS,GAAG,GAAGE,IAAI,CAAC;IACtB,CAAC;IAED,OAAO,MAAM;MACXD,MAAM,CAAC,UAAU,CAAC,GAAGD,SAAS;IAChC,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;AACR,CAAC;AAAAI,OAAA,CAAAT,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.clearWidgetServerCredentials = clearWidgetServerCredentials;
|
|
7
|
+
exports.setWidgetServerCredentials = setWidgetServerCredentials;
|
|
8
|
+
var _VoltraModule = require("../VoltraModule.js");
|
|
9
|
+
async function setWidgetServerCredentials(credentials) {
|
|
10
|
+
if (!credentials.token) {
|
|
11
|
+
throw new Error('[Voltra][iOS] setWidgetServerCredentials: token is required');
|
|
12
|
+
}
|
|
13
|
+
return (0, _VoltraModule.getNativeVoltra)().setWidgetServerCredentials(credentials);
|
|
14
|
+
}
|
|
15
|
+
async function clearWidgetServerCredentials() {
|
|
16
|
+
return (0, _VoltraModule.getNativeVoltra)().clearWidgetServerCredentials();
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=server-credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_VoltraModule","require","setWidgetServerCredentials","credentials","token","Error","getNativeVoltra","clearWidgetServerCredentials"],"sourceRoot":"../../../src","sources":["widgets/server-credentials.ts"],"mappings":";;;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AAIO,eAAeC,0BAA0BA,CAACC,WAAoC,EAAiB;EACpG,IAAI,CAACA,WAAW,CAACC,KAAK,EAAE;IACtB,MAAM,IAAIC,KAAK,CAAC,6DAA6D,CAAC;EAChF;EAEA,OAAO,IAAAC,6BAAe,EAAC,CAAC,CAACJ,0BAA0B,CAACC,WAAW,CAAC;AAClE;AAEO,eAAeI,4BAA4BA,CAAA,EAAkB;EAClE,OAAO,IAAAD,6BAAe,EAAC,CAAC,CAACC,4BAA4B,CAAC,CAAC;AACzD","ignoreList":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.updateWidget = exports.scheduleWidget = exports.reloadWidgets = exports.getActiveWidgets = exports.clearWidget = exports.clearAllWidgets = void 0;
|
|
7
|
+
var _ios = require("@use-voltra/ios");
|
|
8
|
+
var _assertRunningOnApple = require("../utils/assertRunningOnApple.js");
|
|
9
|
+
var _VoltraModule = require("../VoltraModule.js");
|
|
10
|
+
const updateWidget = async (widgetId, variants, options) => {
|
|
11
|
+
if (!(0, _assertRunningOnApple.assertRunningOnApple)()) return Promise.resolve();
|
|
12
|
+
const payload = (0, _ios.renderWidgetToString)(variants);
|
|
13
|
+
return (0, _VoltraModule.getNativeVoltra)().updateWidget(widgetId, payload, {
|
|
14
|
+
deepLinkUrl: options?.deepLinkUrl
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
exports.updateWidget = updateWidget;
|
|
18
|
+
const reloadWidgets = async widgetIds => {
|
|
19
|
+
if (!(0, _assertRunningOnApple.assertRunningOnApple)()) return Promise.resolve();
|
|
20
|
+
return (0, _VoltraModule.getNativeVoltra)().reloadWidgets(widgetIds ?? null);
|
|
21
|
+
};
|
|
22
|
+
exports.reloadWidgets = reloadWidgets;
|
|
23
|
+
const clearWidget = async widgetId => {
|
|
24
|
+
if (!(0, _assertRunningOnApple.assertRunningOnApple)()) return Promise.resolve();
|
|
25
|
+
return (0, _VoltraModule.getNativeVoltra)().clearWidget(widgetId);
|
|
26
|
+
};
|
|
27
|
+
exports.clearWidget = clearWidget;
|
|
28
|
+
const clearAllWidgets = async () => {
|
|
29
|
+
if (!(0, _assertRunningOnApple.assertRunningOnApple)()) return Promise.resolve();
|
|
30
|
+
return (0, _VoltraModule.getNativeVoltra)().clearAllWidgets();
|
|
31
|
+
};
|
|
32
|
+
exports.clearAllWidgets = clearAllWidgets;
|
|
33
|
+
const scheduleWidget = async (widgetId, entries) => {
|
|
34
|
+
if (!(0, _assertRunningOnApple.assertRunningOnApple)()) return Promise.resolve();
|
|
35
|
+
const renderedEntries = entries.map(entry => ({
|
|
36
|
+
date: entry.date.getTime(),
|
|
37
|
+
json: (0, _ios.renderWidgetToString)(entry.variants),
|
|
38
|
+
deepLinkUrl: entry.deepLinkUrl
|
|
39
|
+
}));
|
|
40
|
+
const timelineData = {
|
|
41
|
+
entries: renderedEntries,
|
|
42
|
+
policy: {
|
|
43
|
+
type: 'never'
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const timelineJson = JSON.stringify(timelineData);
|
|
47
|
+
return (0, _VoltraModule.getNativeVoltra)().scheduleWidget(widgetId, timelineJson);
|
|
48
|
+
};
|
|
49
|
+
exports.scheduleWidget = scheduleWidget;
|
|
50
|
+
const getActiveWidgets = async () => {
|
|
51
|
+
if (!(0, _assertRunningOnApple.assertRunningOnApple)()) return [];
|
|
52
|
+
return (0, _VoltraModule.getNativeVoltra)().getActiveWidgets();
|
|
53
|
+
};
|
|
54
|
+
exports.getActiveWidgets = getActiveWidgets;
|
|
55
|
+
//# sourceMappingURL=widget-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_ios","require","_assertRunningOnApple","_VoltraModule","updateWidget","widgetId","variants","options","assertRunningOnApple","Promise","resolve","payload","renderWidgetToString","getNativeVoltra","deepLinkUrl","exports","reloadWidgets","widgetIds","clearWidget","clearAllWidgets","scheduleWidget","entries","renderedEntries","map","entry","date","getTime","json","timelineData","policy","type","timelineJson","JSON","stringify","getActiveWidgets"],"sourceRoot":"../../../src","sources":["widgets/widget-api.ts"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAGA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AAKO,MAAMG,YAAY,GAAG,MAAAA,CAC1BC,QAAgB,EAChBC,QAAwB,EACxBC,OAA6B,KACX;EAClB,IAAI,CAAC,IAAAC,0CAAoB,EAAC,CAAC,EAAE,OAAOC,OAAO,CAACC,OAAO,CAAC,CAAC;EAErD,MAAMC,OAAO,GAAG,IAAAC,yBAAoB,EAACN,QAAQ,CAAC;EAE9C,OAAO,IAAAO,6BAAe,EAAC,CAAC,CAACT,YAAY,CAACC,QAAQ,EAAEM,OAAO,EAAE;IACvDG,WAAW,EAAEP,OAAO,EAAEO;EACxB,CAAC,CAAC;AACJ,CAAC;AAAAC,OAAA,CAAAX,YAAA,GAAAA,YAAA;AAEM,MAA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;IACxBO,MAAM,EAAE;MAAEC,IAAI,EAAE;IAAQ;EAC1B,CAAC;EAED,MAAMC,YAAY,GAAGC,IAAI,CAACC,SAAS,CAACL,YAAY,CAAC;EAEjD,OAAO,IAAAf,6BAAe,EAAC,CAAC,CAACO,cAAc,CAACf,QAAQ,EAAE0B,YAAY,CAAC;AACjE,CAAC;AAAAhB,OAAA,CAAAK,cAAA,GAAAA,cAAA;AAEM,MAAMc,gBAAgB,GAAG,MAAAA,CAAA,KAAmC;EACjE,IAAI,CAAC,IAAA1B,0CAAoB,EAAC,CAAC,EAAE,OAAO,EAAE;EAEtC,OAAO,IAAAK,6BAAe,EAAC,CAAC,CAACqB,gBAAgB,CAAC,CAAC;AAC7C,CAAC;AAAAnB,OAAA,CAAAmB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getNativeVoltra"],"sourceRoot":"../../src","sources":["VoltraModule.ts"],"mappings":";;AACA,SAASA,eAAe,QAAQ,0BAAuB","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { VoltraView } from './VoltraView.js';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const LOCK_SCREEN_DIMENSIONS = {
|
|
7
|
+
width: 364,
|
|
8
|
+
height: 160
|
|
9
|
+
};
|
|
10
|
+
export function VoltraLiveActivityPreview({
|
|
11
|
+
style,
|
|
12
|
+
children,
|
|
13
|
+
...voltraViewProps
|
|
14
|
+
}) {
|
|
15
|
+
const previewStyle = [{
|
|
16
|
+
width: LOCK_SCREEN_DIMENSIONS.width,
|
|
17
|
+
height: LOCK_SCREEN_DIMENSIONS.height
|
|
18
|
+
}, style];
|
|
19
|
+
return /*#__PURE__*/_jsx(VoltraView, {
|
|
20
|
+
...voltraViewProps,
|
|
21
|
+
style: previewStyle,
|
|
22
|
+
children: children
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=VoltraLiveActivityPreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","VoltraView","jsx","_jsx","LOCK_SCREEN_DIMENSIONS","width","height","VoltraLiveActivityPreview","style","children","voltraViewProps","previewStyle"],"sourceRoot":"../../../src","sources":["components/VoltraLiveActivityPreview.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,SAASC,UAAU,QAA8B,iBAAiB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAElE,MAAMC,sBAAsB,GAAG;EAC7BC,KAAK,EAAE,GAAG;EACVC,MAAM,EAAE;AACV,CAAC;AAMD,OAAO,SAASC,yBAAyBA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAE,GAAGC;AAAgD,CAAC,EAAE;EACjH,MAAMC,YAAkC,GAAG,CACzC;IACEN,KAAK,EAAED,sBAAsB,CAACC,KAAK;IACnCC,MAAM,EAAEF,sBAAsB,CAACE;EACjC,CAAC,EACDE,KAAK,CACN;EAED,oBACEL,IAAA,CAACF,UAAU;IAAA,GAAKS,eAAe;IAAEF,KAAK,EAAEG,YAAa;IAAAF,QAAA,EAClDA;EAAQ,CACC,CAAC;AAEjB","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useMemo } from 'react';
|
|
4
|
+
import { renderVoltraVariantToJson } from '@use-voltra/ios';
|
|
5
|
+
import VoltraFabricView from '../native/VoltraRNNativeComponent';
|
|
6
|
+
import { addVoltraListener } from '../events.js';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const generateViewId = () => `voltra-view-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
|
|
9
|
+
const voltraViewStyle = {
|
|
10
|
+
flex: 1
|
|
11
|
+
};
|
|
12
|
+
export function VoltraView({
|
|
13
|
+
id,
|
|
14
|
+
children,
|
|
15
|
+
style,
|
|
16
|
+
onInteraction,
|
|
17
|
+
testID
|
|
18
|
+
}) {
|
|
19
|
+
const viewId = useMemo(() => id || generateViewId(), [id]);
|
|
20
|
+
const json = renderVoltraVariantToJson(children);
|
|
21
|
+
const payload = JSON.stringify(json);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (!onInteraction) return;
|
|
24
|
+
const subscription = addVoltraListener('interaction', event => {
|
|
25
|
+
if (event.source === viewId) {
|
|
26
|
+
onInteraction({
|
|
27
|
+
type: 'interaction',
|
|
28
|
+
source: event.source,
|
|
29
|
+
timestamp: event.timestamp,
|
|
30
|
+
identifier: event.identifier,
|
|
31
|
+
payload: event.payload
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return () => subscription.remove();
|
|
36
|
+
}, [viewId, onInteraction]);
|
|
37
|
+
return /*#__PURE__*/_jsx(VoltraFabricView, {
|
|
38
|
+
payload: payload,
|
|
39
|
+
style: [voltraViewStyle, style],
|
|
40
|
+
testID: testID,
|
|
41
|
+
viewId: viewId
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=VoltraView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","useMemo","renderVoltraVariantToJson","VoltraFabricView","addVoltraListener","jsx","_jsx","generateViewId","Date","now","Math","random","toString","substring","voltraViewStyle","flex","VoltraView","id","children","style","onInteraction","testID","viewId","json","payload","JSON","stringify","subscription","event","source","type","timestamp","identifier","remove"],"sourceRoot":"../../../src","sources":["components/VoltraView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAoBC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAGjE,SAASC,yBAAyB,QAAQ,iBAAiB;AAE3D,OAAOC,gBAAgB,MAAM,mCAAmC;AAEhE,SAASC,iBAAiB,QAAqC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AA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