@use-voltra/ios-client 2.1.1 → 2.3.0
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 +61 -8
- package/Voltra.podspec +1 -0
- package/build/commonjs/dynamic-widget/api.js +15 -0
- package/build/commonjs/dynamic-widget/api.js.map +1 -0
- package/build/commonjs/events.js +23 -0
- package/build/commonjs/events.js.map +1 -1
- package/build/commonjs/index.js +74 -7
- package/build/commonjs/index.js.map +1 -1
- package/build/commonjs/live-activity/api.js +3 -1
- package/build/commonjs/live-activity/api.js.map +1 -1
- package/build/commonjs/live-activity/dynamic-api.js +173 -0
- package/build/commonjs/live-activity/dynamic-api.js.map +1 -0
- package/build/commonjs/native/NativeVoltra.js.map +1 -1
- package/build/commonjs/utils/enableDynamicLiveActivityHotReload.js +47 -0
- package/build/commonjs/utils/enableDynamicLiveActivityHotReload.js.map +1 -0
- package/build/commonjs/utils/enableWidgetHotReload.js +8 -11
- package/build/commonjs/utils/enableWidgetHotReload.js.map +1 -1
- package/build/commonjs/utils/useUpdateOnHMR.js +3 -7
- package/build/commonjs/utils/useUpdateOnHMR.js.map +1 -1
- package/build/commonjs/widgets/server-credentials.js +9 -0
- package/build/commonjs/widgets/server-credentials.js.map +1 -1
- package/build/commonjs/widgets/server-update.js +78 -0
- package/build/commonjs/widgets/server-update.js.map +1 -0
- package/build/module/dynamic-widget/api.js +10 -0
- package/build/module/dynamic-widget/api.js.map +1 -0
- package/build/module/events.js +23 -0
- package/build/module/events.js.map +1 -1
- package/build/module/index.js +4 -0
- package/build/module/index.js.map +1 -1
- package/build/module/live-activity/api.js +2 -2
- package/build/module/live-activity/api.js.map +1 -1
- package/build/module/live-activity/dynamic-api.js +167 -0
- package/build/module/live-activity/dynamic-api.js.map +1 -0
- package/build/module/native/NativeVoltra.js.map +1 -1
- package/build/module/utils/enableDynamicLiveActivityHotReload.js +43 -0
- package/build/module/utils/enableDynamicLiveActivityHotReload.js.map +1 -0
- package/build/module/utils/enableWidgetHotReload.js +9 -11
- package/build/module/utils/enableWidgetHotReload.js.map +1 -1
- package/build/module/utils/useUpdateOnHMR.js +3 -7
- package/build/module/utils/useUpdateOnHMR.js.map +1 -1
- package/build/module/widgets/server-credentials.js +9 -0
- package/build/module/widgets/server-credentials.js.map +1 -1
- package/build/module/widgets/server-update.js +72 -0
- package/build/module/widgets/server-update.js.map +1 -0
- package/build/typescript/commonjs/dynamic-widget/api.d.ts +8 -0
- package/build/typescript/commonjs/dynamic-widget/api.d.ts.map +1 -0
- package/build/typescript/commonjs/events.d.ts +7 -0
- package/build/typescript/commonjs/events.d.ts.map +1 -1
- package/build/typescript/commonjs/index.d.ts +4 -0
- package/build/typescript/commonjs/index.d.ts.map +1 -1
- package/build/typescript/commonjs/live-activity/api.d.ts +7 -0
- package/build/typescript/commonjs/live-activity/api.d.ts.map +1 -1
- package/build/typescript/commonjs/live-activity/dynamic-api.d.ts +54 -0
- package/build/typescript/commonjs/live-activity/dynamic-api.d.ts.map +1 -0
- package/build/typescript/commonjs/native/NativeVoltra.d.ts +21 -0
- package/build/typescript/commonjs/native/NativeVoltra.d.ts.map +1 -1
- package/build/typescript/commonjs/types.d.ts +1 -1
- package/build/typescript/commonjs/types.d.ts.map +1 -1
- package/build/typescript/commonjs/utils/enableDynamicLiveActivityHotReload.d.ts +15 -0
- package/build/typescript/commonjs/utils/enableDynamicLiveActivityHotReload.d.ts.map +1 -0
- package/build/typescript/commonjs/utils/enableWidgetHotReload.d.ts +5 -7
- package/build/typescript/commonjs/utils/enableWidgetHotReload.d.ts.map +1 -1
- package/build/typescript/commonjs/utils/useUpdateOnHMR.d.ts +0 -3
- package/build/typescript/commonjs/utils/useUpdateOnHMR.d.ts.map +1 -1
- package/build/typescript/commonjs/widgets/server-credentials.d.ts +8 -0
- package/build/typescript/commonjs/widgets/server-credentials.d.ts.map +1 -1
- package/build/typescript/commonjs/widgets/server-update.d.ts +64 -0
- package/build/typescript/commonjs/widgets/server-update.d.ts.map +1 -0
- package/build/typescript/module/dynamic-widget/api.d.ts +8 -0
- package/build/typescript/module/dynamic-widget/api.d.ts.map +1 -0
- package/build/typescript/module/events.d.ts +7 -0
- package/build/typescript/module/events.d.ts.map +1 -1
- package/build/typescript/module/index.d.ts +4 -0
- package/build/typescript/module/index.d.ts.map +1 -1
- package/build/typescript/module/live-activity/api.d.ts +7 -0
- package/build/typescript/module/live-activity/api.d.ts.map +1 -1
- package/build/typescript/module/live-activity/dynamic-api.d.ts +54 -0
- package/build/typescript/module/live-activity/dynamic-api.d.ts.map +1 -0
- package/build/typescript/module/native/NativeVoltra.d.ts +21 -0
- package/build/typescript/module/native/NativeVoltra.d.ts.map +1 -1
- package/build/typescript/module/types.d.ts +1 -1
- package/build/typescript/module/types.d.ts.map +1 -1
- package/build/typescript/module/utils/enableDynamicLiveActivityHotReload.d.ts +15 -0
- package/build/typescript/module/utils/enableDynamicLiveActivityHotReload.d.ts.map +1 -0
- package/build/typescript/module/utils/enableWidgetHotReload.d.ts +5 -7
- package/build/typescript/module/utils/enableWidgetHotReload.d.ts.map +1 -1
- package/build/typescript/module/utils/useUpdateOnHMR.d.ts +0 -3
- package/build/typescript/module/utils/useUpdateOnHMR.d.ts.map +1 -1
- package/build/typescript/module/widgets/server-credentials.d.ts +8 -0
- package/build/typescript/module/widgets/server-credentials.d.ts.map +1 -1
- package/build/typescript/module/widgets/server-update.d.ts +64 -0
- package/build/typescript/module/widgets/server-update.d.ts.map +1 -0
- package/expo-plugin/build/cjs/constants.js +20 -1
- package/expo-plugin/build/cjs/constants.js.map +1 -1
- package/expo-plugin/build/cjs/index.js +9 -1
- package/expo-plugin/build/cjs/index.js.map +1 -1
- package/expo-plugin/build/cjs/ios/index.js +1 -0
- package/expo-plugin/build/cjs/ios/index.js.map +1 -1
- package/expo-plugin/build/cjs/ios/infoPlist.js +28 -5
- package/expo-plugin/build/cjs/ios/infoPlist.js.map +1 -1
- package/expo-plugin/build/cjs/ios/serverUpdate.js +25 -0
- package/expo-plugin/build/cjs/ios/serverUpdate.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/clientRendered.js +4 -4
- package/expo-plugin/build/cjs/ios-widget/clientRendered.js.map +1 -1
- package/expo-plugin/build/cjs/ios-widget/clientRenderedPrerender.js +5 -5
- package/expo-plugin/build/cjs/ios-widget/clientRenderedPrerender.js.map +1 -1
- package/expo-plugin/build/cjs/ios-widget/dynamic-live-activity/swift.js +130 -0
- package/expo-plugin/build/cjs/ios-widget/dynamic-live-activity/swift.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/index.js +9 -2
- package/expo-plugin/build/cjs/ios-widget/files/index.js.map +1 -1
- package/expo-plugin/build/cjs/ios-widget/files/infoPlist.js +6 -3
- package/expo-plugin/build/cjs/ios-widget/files/infoPlist.js.map +1 -1
- package/expo-plugin/build/cjs/ios-widget/files/manifest.js +24 -0
- package/expo-plugin/build/cjs/ios-widget/files/manifest.js.map +1 -1
- package/expo-plugin/build/cjs/ios-widget/files/swift-utils.js +7 -0
- package/expo-plugin/build/cjs/ios-widget/files/swift-utils.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/files/swift.js +56 -26
- package/expo-plugin/build/cjs/ios-widget/files/swift.js.map +1 -1
- package/expo-plugin/build/cjs/ios-widget/index.js +9 -3
- package/expo-plugin/build/cjs/ios-widget/index.js.map +1 -1
- package/expo-plugin/build/cjs/ios-widget/podfile.js +38 -12
- package/expo-plugin/build/cjs/ios-widget/podfile.js.map +1 -1
- package/expo-plugin/build/cjs/ios-widget/widgetPlist.js +34 -22
- package/expo-plugin/build/cjs/ios-widget/widgetPlist.js.map +1 -1
- package/expo-plugin/build/cjs/ios-widget/xcode/buildPhases.js +194 -118
- package/expo-plugin/build/cjs/ios-widget/xcode/buildPhases.js.map +1 -1
- package/expo-plugin/build/cjs/ios-widget/xcode/configurationList.js +30 -22
- package/expo-plugin/build/cjs/ios-widget/xcode/configurationList.js.map +1 -1
- package/expo-plugin/build/cjs/ios-widget/xcode/fileReferences.js +50 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/fileReferences.js.map +1 -0
- package/expo-plugin/build/cjs/ios-widget/xcode/groups.js +45 -43
- package/expo-plugin/build/cjs/ios-widget/xcode/groups.js.map +1 -1
- package/expo-plugin/build/cjs/ios-widget/xcode/index.js +93 -91
- package/expo-plugin/build/cjs/ios-widget/xcode/index.js.map +1 -1
- package/expo-plugin/build/cjs/ios-widget/xcode/mainAppSettings.js +41 -39
- package/expo-plugin/build/cjs/ios-widget/xcode/mainAppSettings.js.map +1 -1
- package/expo-plugin/build/cjs/ios-widget/xcode/productFile.js +2 -2
- package/expo-plugin/build/cjs/ios-widget/xcode/productFile.js.map +1 -1
- package/expo-plugin/build/cjs/ios-widget/xcode/target.js +29 -63
- package/expo-plugin/build/cjs/ios-widget/xcode/target.js.map +1 -1
- package/expo-plugin/build/cjs/utils/urlScheme.js +36 -14
- package/expo-plugin/build/cjs/utils/urlScheme.js.map +1 -1
- package/expo-plugin/build/cjs/validation.js +54 -0
- package/expo-plugin/build/cjs/validation.js.map +1 -1
- package/expo-plugin/build/esm/constants.js +17 -0
- package/expo-plugin/build/esm/constants.js.map +1 -1
- package/expo-plugin/build/esm/index.js +9 -1
- package/expo-plugin/build/esm/index.js.map +1 -1
- package/expo-plugin/build/esm/ios/index.js +1 -0
- package/expo-plugin/build/esm/ios/index.js.map +1 -1
- package/expo-plugin/build/esm/ios/infoPlist.js +28 -5
- package/expo-plugin/build/esm/ios/infoPlist.js.map +1 -1
- package/expo-plugin/build/esm/ios/serverUpdate.js +21 -0
- package/expo-plugin/build/esm/ios/serverUpdate.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/clientRendered.js +5 -5
- package/expo-plugin/build/esm/ios-widget/clientRendered.js.map +1 -1
- package/expo-plugin/build/esm/ios-widget/clientRenderedPrerender.js +6 -6
- package/expo-plugin/build/esm/ios-widget/clientRenderedPrerender.js.map +1 -1
- package/expo-plugin/build/esm/ios-widget/dynamic-live-activity/swift.js +122 -0
- package/expo-plugin/build/esm/ios-widget/dynamic-live-activity/swift.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/index.js +10 -3
- package/expo-plugin/build/esm/ios-widget/files/index.js.map +1 -1
- package/expo-plugin/build/esm/ios-widget/files/infoPlist.js +6 -3
- package/expo-plugin/build/esm/ios-widget/files/infoPlist.js.map +1 -1
- package/expo-plugin/build/esm/ios-widget/files/manifest.js +23 -1
- package/expo-plugin/build/esm/ios-widget/files/manifest.js.map +1 -1
- package/expo-plugin/build/esm/ios-widget/files/swift-utils.js +4 -0
- package/expo-plugin/build/esm/ios-widget/files/swift-utils.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/files/swift.js +50 -20
- package/expo-plugin/build/esm/ios-widget/files/swift.js.map +1 -1
- package/expo-plugin/build/esm/ios-widget/index.js +9 -3
- package/expo-plugin/build/esm/ios-widget/index.js.map +1 -1
- package/expo-plugin/build/esm/ios-widget/podfile.js +36 -11
- package/expo-plugin/build/esm/ios-widget/podfile.js.map +1 -1
- package/expo-plugin/build/esm/ios-widget/widgetPlist.js +34 -22
- package/expo-plugin/build/esm/ios-widget/widgetPlist.js.map +1 -1
- package/expo-plugin/build/esm/ios-widget/xcode/buildPhases.js +194 -117
- package/expo-plugin/build/esm/ios-widget/xcode/buildPhases.js.map +1 -1
- package/expo-plugin/build/esm/ios-widget/xcode/configurationList.js +31 -22
- package/expo-plugin/build/esm/ios-widget/xcode/configurationList.js.map +1 -1
- package/expo-plugin/build/esm/ios-widget/xcode/fileReferences.js +45 -0
- package/expo-plugin/build/esm/ios-widget/xcode/fileReferences.js.map +1 -0
- package/expo-plugin/build/esm/ios-widget/xcode/groups.js +45 -42
- package/expo-plugin/build/esm/ios-widget/xcode/groups.js.map +1 -1
- package/expo-plugin/build/esm/ios-widget/xcode/index.js +97 -96
- package/expo-plugin/build/esm/ios-widget/xcode/index.js.map +1 -1
- package/expo-plugin/build/esm/ios-widget/xcode/mainAppSettings.js +41 -39
- package/expo-plugin/build/esm/ios-widget/xcode/mainAppSettings.js.map +1 -1
- package/expo-plugin/build/esm/ios-widget/xcode/productFile.js +3 -2
- package/expo-plugin/build/esm/ios-widget/xcode/productFile.js.map +1 -1
- package/expo-plugin/build/esm/ios-widget/xcode/target.js +28 -62
- package/expo-plugin/build/esm/ios-widget/xcode/target.js.map +1 -1
- package/expo-plugin/build/esm/utils/urlScheme.js +34 -14
- package/expo-plugin/build/esm/utils/urlScheme.js.map +1 -1
- package/expo-plugin/build/esm/validation.js +54 -1
- package/expo-plugin/build/esm/validation.js.map +1 -1
- package/expo-plugin/build/types/constants.d.ts +10 -1
- package/expo-plugin/build/types/constants.d.ts.map +1 -1
- package/expo-plugin/build/types/index.d.ts +1 -1
- package/expo-plugin/build/types/index.d.ts.map +1 -1
- package/expo-plugin/build/types/ios/index.d.ts +2 -0
- package/expo-plugin/build/types/ios/index.d.ts.map +1 -1
- package/expo-plugin/build/types/ios/infoPlist.d.ts +2 -0
- package/expo-plugin/build/types/ios/infoPlist.d.ts.map +1 -1
- package/expo-plugin/build/types/ios/serverUpdate.d.ts +11 -0
- package/expo-plugin/build/types/ios/serverUpdate.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/clientRendered.d.ts.map +1 -1
- package/expo-plugin/build/types/ios-widget/clientRenderedPrerender.d.ts.map +1 -1
- package/expo-plugin/build/types/ios-widget/dynamic-live-activity/swift.d.ts +7 -0
- package/expo-plugin/build/types/ios-widget/dynamic-live-activity/swift.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/index.d.ts +3 -1
- package/expo-plugin/build/types/ios-widget/files/index.d.ts.map +1 -1
- package/expo-plugin/build/types/ios-widget/files/infoPlist.d.ts +2 -1
- package/expo-plugin/build/types/ios-widget/files/infoPlist.d.ts.map +1 -1
- package/expo-plugin/build/types/ios-widget/files/manifest.d.ts +9 -2
- package/expo-plugin/build/types/ios-widget/files/manifest.d.ts.map +1 -1
- package/expo-plugin/build/types/ios-widget/files/swift-utils.d.ts +2 -0
- package/expo-plugin/build/types/ios-widget/files/swift-utils.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/files/swift.d.ts +6 -2
- package/expo-plugin/build/types/ios-widget/files/swift.d.ts.map +1 -1
- package/expo-plugin/build/types/ios-widget/index.d.ts +3 -1
- package/expo-plugin/build/types/ios-widget/index.d.ts.map +1 -1
- package/expo-plugin/build/types/ios-widget/podfile.d.ts +19 -1
- package/expo-plugin/build/types/ios-widget/podfile.d.ts.map +1 -1
- package/expo-plugin/build/types/ios-widget/widgetPlist.d.ts.map +1 -1
- package/expo-plugin/build/types/ios-widget/xcode/buildPhases.d.ts +6 -8
- package/expo-plugin/build/types/ios-widget/xcode/buildPhases.d.ts.map +1 -1
- package/expo-plugin/build/types/ios-widget/xcode/configurationList.d.ts +15 -10
- package/expo-plugin/build/types/ios-widget/xcode/configurationList.d.ts.map +1 -1
- package/expo-plugin/build/types/ios-widget/xcode/fileReferences.d.ts +16 -0
- package/expo-plugin/build/types/ios-widget/xcode/fileReferences.d.ts.map +1 -0
- package/expo-plugin/build/types/ios-widget/xcode/groups.d.ts +0 -4
- package/expo-plugin/build/types/ios-widget/xcode/groups.d.ts.map +1 -1
- package/expo-plugin/build/types/ios-widget/xcode/index.d.ts +23 -3
- package/expo-plugin/build/types/ios-widget/xcode/index.d.ts.map +1 -1
- package/expo-plugin/build/types/ios-widget/xcode/mainAppSettings.d.ts +16 -4
- package/expo-plugin/build/types/ios-widget/xcode/mainAppSettings.d.ts.map +1 -1
- package/expo-plugin/build/types/ios-widget/xcode/productFile.d.ts +0 -4
- package/expo-plugin/build/types/ios-widget/xcode/productFile.d.ts.map +1 -1
- package/expo-plugin/build/types/ios-widget/xcode/target.d.ts +11 -26
- package/expo-plugin/build/types/ios-widget/xcode/target.d.ts.map +1 -1
- package/expo-plugin/build/types/types.d.ts +23 -4
- package/expo-plugin/build/types/types.d.ts.map +1 -1
- package/expo-plugin/build/types/utils/urlScheme.d.ts +16 -0
- package/expo-plugin/build/types/utils/urlScheme.d.ts.map +1 -1
- package/expo-plugin/build/types/validation.d.ts +2 -1
- package/expo-plugin/build/types/validation.d.ts.map +1 -1
- package/expo-plugin/src/constants.ts +24 -1
- package/expo-plugin/src/index.ts +14 -1
- package/expo-plugin/src/ios/index.ts +3 -0
- package/expo-plugin/src/ios/infoPlist.ts +33 -5
- package/expo-plugin/src/ios/serverUpdate.ts +29 -0
- package/expo-plugin/src/ios-widget/clientRendered.ts +9 -5
- package/expo-plugin/src/ios-widget/clientRenderedPrerender.ts +11 -6
- package/expo-plugin/src/ios-widget/dynamic-live-activity/swift.ts +138 -0
- package/expo-plugin/src/ios-widget/files/index.ts +15 -4
- package/expo-plugin/src/ios-widget/files/infoPlist.ts +17 -3
- package/expo-plugin/src/ios-widget/files/manifest.ts +42 -2
- package/expo-plugin/src/ios-widget/files/swift-utils.ts +3 -0
- package/expo-plugin/src/ios-widget/files/swift.ts +69 -22
- package/expo-plugin/src/ios-widget/index.ts +13 -3
- package/expo-plugin/src/ios-widget/podfile.ts +46 -13
- package/expo-plugin/src/ios-widget/widgetPlist.ts +37 -23
- package/expo-plugin/src/ios-widget/xcode/__fixtures__/fresh.pbxproj +197 -0
- package/expo-plugin/src/ios-widget/xcode/__fixtures__/with-existing-extension.pbxproj +321 -0
- package/expo-plugin/src/ios-widget/xcode/__fixtures__/with-per-config-signing.pbxproj +203 -0
- package/expo-plugin/src/ios-widget/xcode/__snapshots__/applyXcodeChanges.node.test.ts.snap +363 -0
- package/expo-plugin/src/ios-widget/xcode/__tests__/pbxConsistency.ts +130 -0
- package/expo-plugin/src/ios-widget/xcode/buildPhases.ts +210 -164
- package/expo-plugin/src/ios-widget/xcode/configurationList.ts +52 -35
- package/expo-plugin/src/ios-widget/xcode/fileReferences.ts +51 -0
- package/expo-plugin/src/ios-widget/xcode/groups.ts +52 -54
- package/expo-plugin/src/ios-widget/xcode/index.ts +124 -119
- package/expo-plugin/src/ios-widget/xcode/mainAppSettings.ts +59 -54
- package/expo-plugin/src/ios-widget/xcode/productFile.ts +3 -2
- package/expo-plugin/src/ios-widget/xcode/target.ts +31 -83
- package/expo-plugin/src/types.ts +28 -4
- package/expo-plugin/src/utils/urlScheme.ts +47 -17
- package/expo-plugin/src/validation.ts +76 -1
- package/ios/Package.swift +39 -4
- package/ios/VoltraWidget.podspec +1 -0
- package/ios/app/NativeVoltra.mm +126 -7
- package/ios/app/VoltraLiveActivityManager.swift +30 -0
- package/ios/app/VoltraLiveActivityService.swift +77 -5
- package/ios/app/VoltraModule.swift +117 -1
- package/ios/app/VoltraModuleImpl.swift +116 -2
- package/ios/app/VoltraViewComponentView.mm +3 -3
- package/ios/app/VoltraWidgetService.swift +147 -12
- package/ios/app/dynamic-live-activity/VoltraDynamicLiveActivityService.swift +97 -0
- package/ios/app/dynamic-live-activity/VoltraLiveActivityChronology.swift +68 -0
- package/ios/shared/DynamicWidgetPropsCodec.swift +51 -0
- package/ios/shared/DynamicWidgetPropsStorage.swift +53 -0
- package/ios/shared/DynamicWidgetPropsStore.swift +117 -0
- package/ios/shared/DynamicWidgetRenderCoordinator.swift +31 -0
- package/ios/shared/DynamicWidgetServerUpdate/DynamicWidgetServerFetchResolver.swift +34 -0
- package/ios/shared/DynamicWidgetServerUpdate/DynamicWidgetServerProps.swift +55 -0
- package/ios/shared/DynamicWidgetServerUpdate/DynamicWidgetServerPropsStore.swift +146 -0
- package/ios/shared/DynamicWidgetServerUpdate/DynamicWidgetServerUpdateRunner.swift +193 -0
- package/ios/shared/DynamicWidgetUpdater.swift +30 -0
- package/ios/shared/ServerWidgetContentResolver.swift +60 -0
- package/ios/shared/ServerWidgetResponseStore.swift +25 -0
- package/ios/shared/ShortNames.swift +6 -0
- package/ios/shared/VoltraConfig.swift +41 -0
- package/ios/shared/VoltraConstants.swift +19 -0
- package/ios/shared/VoltraElement.swift +127 -43
- package/ios/shared/VoltraEventBus.swift +52 -7
- package/ios/shared/VoltraJSRenderer.swift +93 -23
- package/ios/shared/VoltraNode.swift +7 -111
- package/ios/shared/VoltraRefreshIntent.swift +1 -1
- package/ios/shared/VoltraWidgetDefaults.swift +9 -1
- package/ios/shared/VoltraWidgetKind.swift +41 -0
- package/ios/shared/VoltraWidgetServerFetcher.swift +52 -107
- package/ios/shared/WidgetServer/VoltraWidgetAppearance.swift +17 -0
- package/ios/shared/WidgetServer/VoltraWidgetServer.swift +138 -0
- package/ios/shared/WidgetServer/WidgetCanonicalConfiguration.swift +77 -0
- package/ios/shared/WidgetServer/WidgetScope.swift +55 -0
- package/ios/shared/WidgetServer/WidgetServerEtagStore.swift +55 -0
- package/ios/shared/WidgetServer/WidgetServerFetcher.swift +179 -0
- package/ios/shared/WidgetServer/WidgetServerRequestBuilder.swift +114 -0
- package/ios/shared/WidgetServer/WidgetServerSettingsCodec.swift +47 -0
- package/ios/shared/WidgetServer/WidgetServerSettingsResolver.swift +129 -0
- package/ios/shared/WidgetServer/WidgetServerSettingsStore.swift +170 -0
- package/ios/shared/WidgetServer/WidgetServerSettingsValidator.swift +73 -0
- package/ios/shared/WidgetServer/WidgetServerUpdateSettings.swift +123 -0
- package/ios/shared/WidgetServer/WidgetServerUpdateSettingsJson.swift +115 -0
- package/ios/shared/dynamic-live-activity/DynamicLiveActivityPropsCodec.swift +13 -0
- package/ios/shared/dynamic-live-activity/VoltraDynamicLiveActivityBundleSource.swift +156 -0
- package/ios/shared/dynamic-live-activity/VoltraDynamicLiveActivityObserver.swift +97 -0
- package/ios/shared/dynamic-live-activity/VoltraDynamicLiveActivityOperations.swift +105 -0
- package/ios/shared/dynamic-live-activity/VoltraDynamicLiveActivityPayloadValidator.swift +55 -0
- package/ios/shared/dynamic-live-activity/VoltraDynamicLiveActivityRegistry.swift +143 -0
- package/ios/shared/dynamic-live-activity/VoltraDynamicLiveActivityRenderFailureQueue.swift +158 -0
- package/ios/shared/dynamic-live-activity/VoltraDynamicLiveActivityRenderFailureReporter.swift +120 -0
- package/ios/shared/dynamic-live-activity/VoltraDynamicLiveActivityRenderer.swift +370 -0
- package/ios/shared/dynamic-live-activity/VoltraDynamicLiveActivityTypes.swift +87 -0
- package/ios/shared/dynamic-live-activity/VoltraLiveActivityOrder.swift +19 -0
- package/ios/target/VoltraClientWidgetRuntime.swift +60 -10
- package/ios/target/VoltraDynamicWidgetServerUpdateProvider.swift +204 -0
- package/ios/target/VoltraHomeWidget.swift +91 -92
- package/ios/target/VoltraWidget.swift +3 -1
- package/ios/ui/Extensions/VoltraNode+View.swift +113 -0
- package/ios/ui/Generated/Parameters/ChartParameters.swift +3 -0
- package/ios/ui/Helpers/VoltraDeepLinkResolver.swift +5 -3
- package/ios/ui/Helpers/VoltraProgressDriver.swift +6 -2
- package/ios/ui/Layout/VoltraFlexStackLayout.swift +9 -3
- package/ios/ui/Style/JSColorParser.swift +24 -8
- package/ios/ui/Style/JSGradientParser.swift +36 -12
- package/ios/ui/Style/JSStyleParser.swift +36 -12
- package/ios/ui/Style/LayoutStyle.swift +12 -4
- package/ios/ui/Views/VoltraChart.swift +160 -16
- package/ios/ui/Views/VoltraLinearGradient.swift +6 -2
- package/package.json +5 -5
- package/src/dynamic-widget/api.ts +25 -0
- package/src/events.ts +34 -0
- package/src/index.ts +23 -0
- package/src/live-activity/api.ts +2 -2
- package/src/live-activity/dynamic-api.ts +240 -0
- package/src/native/NativeVoltra.ts +22 -0
- package/src/types.ts +4 -0
- package/src/utils/enableDynamicLiveActivityHotReload.ts +50 -0
- package/src/utils/enableWidgetHotReload.ts +9 -16
- package/src/utils/useUpdateOnHMR.ts +3 -12
- package/src/widgets/server-credentials.ts +8 -0
- package/src/widgets/server-update.ts +84 -0
- /package/ios/shared/{VoltraKeychainHelper.swift → WidgetServer/VoltraKeychainHelper.swift} +0 -0
|
@@ -4,25 +4,23 @@ import type { IOSWidgetExtensionFiles } from '../../types';
|
|
|
4
4
|
* Adds (idempotently) the release-only shell-script phase that bakes Dynamic Widget
|
|
5
5
|
* bundles into the extension. Safe to call on every prebuild; only added when absent.
|
|
6
6
|
*/
|
|
7
|
-
export declare function ensureWidgetBundleScriptPhase(xcodeProject: XcodeProject, targetUuid: string): void;
|
|
8
|
-
export interface
|
|
7
|
+
export declare function ensureWidgetBundleScriptPhase(xcodeProject: XcodeProject, targetUuid: string, content?: 'all' | 'live-activities'): void;
|
|
8
|
+
export interface EnsureBuildPhasesOptions {
|
|
9
9
|
targetUuid: string;
|
|
10
|
+
targetName: string;
|
|
10
11
|
groupName: string;
|
|
11
12
|
productFile: {
|
|
12
13
|
uuid: string;
|
|
14
|
+
fileRef?: string;
|
|
13
15
|
target?: string;
|
|
14
16
|
basename: string;
|
|
15
17
|
group: string;
|
|
16
18
|
};
|
|
17
19
|
widgetFiles: IOSWidgetExtensionFiles;
|
|
18
|
-
}
|
|
19
|
-
export interface EnsureBuildPhasesOptions extends AddBuildPhasesOptions {
|
|
20
20
|
mainTargetUuid?: string;
|
|
21
|
+
/** Generated ActivityKit types compiled into both the extension and the app. */
|
|
22
|
+
mainSwiftFiles?: string[];
|
|
21
23
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Adds all required build phases for the widget extension target.
|
|
24
|
-
*/
|
|
25
|
-
export declare function addBuildPhases(xcodeProject: XcodeProject, options: AddBuildPhasesOptions): void;
|
|
26
24
|
/**
|
|
27
25
|
* Ensures all required build phases and files exist for the widget extension target.
|
|
28
26
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildPhases.d.ts","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/buildPhases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"buildPhases.d.ts","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/buildPhases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAkE1D;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,KAAK,GAAG,iBAAyB,GACzC,IAAI,CAwDN;AAED,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,WAAW,EAAE,uBAAuB,CAAA;IACpC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,gFAAgF;IAChF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAC1B;AAqDD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,wBAAwB,GAAG,IAAI,CA4DrG"}
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import { XcodeProject } from '@expo/config-plugins';
|
|
2
|
-
|
|
2
|
+
import type { MainAppTargetSettings } from './mainAppSettings';
|
|
3
|
+
export interface EnsureConfigurationListOptions {
|
|
3
4
|
targetName: string;
|
|
4
5
|
bundleIdentifier: string;
|
|
5
6
|
deploymentTarget: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* App marketing version (CFBundleShortVersionString). App Store Connect expects the appex
|
|
9
|
+
* version to match the app's, so this becomes the widget's MARKETING_VERSION.
|
|
10
|
+
*/
|
|
11
|
+
version?: string;
|
|
12
|
+
/** App build number; becomes the widget's CURRENT_PROJECT_VERSION. */
|
|
13
|
+
buildNumber?: string;
|
|
14
|
+
/** Main app signing settings, applied per configuration name (Debug→Debug, Release→Release). */
|
|
15
|
+
mainAppSettings?: MainAppTargetSettings | null;
|
|
9
16
|
}
|
|
10
17
|
/**
|
|
11
|
-
*
|
|
18
|
+
* Ensures an existing XCConfigurationList is updated, or adds a new one if missing. Each widget
|
|
19
|
+
* configuration receives the build settings derived for its own name, so Debug and Release signing
|
|
20
|
+
* stay in sync with the main app's respective configurations.
|
|
12
21
|
*/
|
|
13
|
-
export declare function
|
|
14
|
-
/**
|
|
15
|
-
* Ensures an existing XCConfigurationList is updated, or adds a new one if missing.
|
|
16
|
-
*/
|
|
17
|
-
export declare function ensureXCConfigurationList(xcodeProject: XcodeProject, options: AddConfigurationListOptions, existingConfigurationListId?: string | {
|
|
22
|
+
export declare function ensureXCConfigurationList(xcodeProject: XcodeProject, options: EnsureConfigurationListOptions, existingConfigurationListId?: string | {
|
|
18
23
|
value?: string;
|
|
19
24
|
}): any;
|
|
20
25
|
//# sourceMappingURL=configurationList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurationList.d.ts","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/configurationList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"configurationList.d.ts","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/configurationList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGnD,OAAO,KAAK,EAA0B,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAEtF,MAAM,WAAW,8BAA8B;IAC7C,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gGAAgG;IAChG,eAAe,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAA;CAC/C;AAkFD;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,8BAA8B,EACvC,2BAA2B,CAAC,EAAE,MAAM,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,OAmC1D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { XcodeProject } from '@expo/config-plugins';
|
|
2
|
+
/** Strips surrounding quotes from a pbx path/name value. */
|
|
3
|
+
export declare function normalizePath(value: string | undefined): string;
|
|
4
|
+
/** Strips a trailing `/* comment *\/` and whitespace, yielding the bare UUID of a pbx reference. */
|
|
5
|
+
export declare function normalizeRef(value: unknown): string;
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the PBXFileReference UUID for a widget file, scoped to the widget's own PBXGroup.
|
|
8
|
+
*
|
|
9
|
+
* pbxproj paths are group-relative, so a bare path like `Assets.xcassets` collides with any other
|
|
10
|
+
* extension's identically named file. Scoping the lookup to the children of the widget group
|
|
11
|
+
* (identified by `targetName`) keeps the widget's references distinct from those, which is what
|
|
12
|
+
* prevents the shared-fileRef corruption behind issues #87/#32. When the widget group does not
|
|
13
|
+
* exist yet, a fresh reference is created.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ensureWidgetFileReference(xcodeProject: XcodeProject, filePath: string, targetName: string): string;
|
|
16
|
+
//# sourceMappingURL=fileReferences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileReferences.d.ts","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/fileReferences.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAInD,4DAA4D;AAC5D,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAK/D;AAED,oGAAoG;AACpG,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAInD;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAsBlH"}
|
|
@@ -4,10 +4,6 @@ export interface AddPbxGroupOptions {
|
|
|
4
4
|
targetName: string;
|
|
5
5
|
widgetFiles: IOSWidgetExtensionFiles;
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
8
|
-
* Adds a PBXGroup for the widget extension files.
|
|
9
|
-
*/
|
|
10
|
-
export declare function addPbxGroup(xcodeProject: XcodeProject, options: AddPbxGroupOptions): void;
|
|
11
7
|
/**
|
|
12
8
|
* Ensures a PBXGroup exists for the widget extension files.
|
|
13
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAK1D,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,uBAAuB,CAAA;CACrC;AA6DD;;GAEG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAwB5F"}
|
|
@@ -1,11 +1,29 @@
|
|
|
1
|
-
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
-
import type { IOSWidgetConfig } from '../../types';
|
|
1
|
+
import { ConfigPlugin, XcodeProject } from '@expo/config-plugins';
|
|
2
|
+
import type { IOSDynamicLiveActivityConfig, IOSWidgetConfig, IOSWidgetExtensionFiles } from '../../types';
|
|
3
3
|
export interface ConfigureXcodeProjectProps {
|
|
4
4
|
targetName: string;
|
|
5
5
|
bundleIdentifier: string;
|
|
6
6
|
deploymentTarget: string;
|
|
7
|
+
/** App marketing version; becomes the widget's MARKETING_VERSION so the appex matches the app. */
|
|
8
|
+
version?: string;
|
|
9
|
+
/** App build number; becomes the widget's CURRENT_PROJECT_VERSION. */
|
|
10
|
+
buildNumber?: string;
|
|
7
11
|
widgets?: IOSWidgetConfig[];
|
|
12
|
+
liveActivities?: IOSDynamicLiveActivityConfig[];
|
|
8
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Applies all widget-extension changes to an already-parsed Xcode project.
|
|
16
|
+
*
|
|
17
|
+
* This is the pure core of {@link configureXcodeProject}: it takes the parsed project, the plugin
|
|
18
|
+
* props, the discovered widget files, and whether any widget is client-rendered, then mutates the
|
|
19
|
+
* project in place. It performs no filesystem or `modRequest` access, which makes it directly
|
|
20
|
+
* testable against pbxproj fixtures.
|
|
21
|
+
*
|
|
22
|
+
* When the widget target does not exist yet, the minimal native-target skeleton is created first
|
|
23
|
+
* (targets cannot be "ensured" into existence); every other object is then reconciled by the same
|
|
24
|
+
* idempotent ensure pipeline that runs for an already-existing target.
|
|
25
|
+
*/
|
|
26
|
+
export declare function applyXcodeChanges(xcodeProject: XcodeProject, props: ConfigureXcodeProjectProps, widgetFiles: IOSWidgetExtensionFiles, hasClientRenderedWidgets?: boolean): void;
|
|
9
27
|
/**
|
|
10
28
|
* Plugin step that configures the Xcode project for the widget extension.
|
|
11
29
|
*
|
|
@@ -16,7 +34,9 @@ export interface ConfigureXcodeProjectProps {
|
|
|
16
34
|
* - Adds build phases (Sources, CopyFiles, Frameworks, Resources)
|
|
17
35
|
* - Adds PBXGroup for widget files
|
|
18
36
|
*
|
|
19
|
-
* This should run after generateWidgetExtensionFiles so the files exist.
|
|
37
|
+
* This should run after generateWidgetExtensionFiles so the files exist. The wrapper is kept thin:
|
|
38
|
+
* it discovers widget files and detects client-rendered widgets, then delegates the actual pbxproj
|
|
39
|
+
* mutation to {@link applyXcodeChanges}.
|
|
20
40
|
*/
|
|
21
41
|
export declare const configureXcodeProject: ConfigPlugin<ConfigureXcodeProjectProps>;
|
|
22
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGnF,OAAO,KAAK,EAAE,4BAA4B,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAUzG,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;IACxB,kGAAkG;IAClG,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,eAAe,EAAE,CAAA;IAC3B,cAAc,CAAC,EAAE,4BAA4B,EAAE,CAAA;CAChD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,0BAA0B,EACjC,WAAW,EAAE,uBAAuB,EACpC,wBAAwB,UAAQ,GAC/B,IAAI,CAwFN;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,0BAA0B,CAwB1E,CAAA"}
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import { XcodeProject } from '@expo/config-plugins';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/** Code-signing settings read from one of the main app target's build configurations. */
|
|
3
|
+
export interface MainAppSigningSettings {
|
|
4
4
|
codeSignStyle?: string;
|
|
5
5
|
developmentTeam?: string;
|
|
6
6
|
provisioningProfileSpecifier?: string;
|
|
7
7
|
}
|
|
8
|
+
export interface MainAppTargetSettings {
|
|
9
|
+
/**
|
|
10
|
+
* Signing settings keyed by build-configuration name (e.g. `Debug`, `Release`). Release
|
|
11
|
+
* provisioning often differs from Debug, so the widget must mirror the main app per
|
|
12
|
+
* configuration rather than copying one configuration's signing into both.
|
|
13
|
+
*/
|
|
14
|
+
byConfigurationName: Record<string, MainAppSigningSettings>;
|
|
15
|
+
/** The first configuration's settings, used for widget configurations with no name match. */
|
|
16
|
+
fallback: MainAppSigningSettings;
|
|
17
|
+
}
|
|
8
18
|
/**
|
|
9
|
-
* Reads build settings from the main app target
|
|
19
|
+
* Reads code-signing build settings from every build configuration of the main app target, so the
|
|
20
|
+
* widget extension can synchronize signing per configuration (Debug→Debug, Release→Release).
|
|
10
21
|
*
|
|
11
22
|
* @param xcodeProject The Xcode project instance
|
|
12
|
-
* @returns
|
|
23
|
+
* @returns Signing settings keyed by configuration name plus a first-configuration fallback, or
|
|
24
|
+
* null when the main app target or its configurations cannot be resolved
|
|
13
25
|
*/
|
|
14
26
|
export declare function getMainAppTargetSettings(xcodeProject: XcodeProject): MainAppTargetSettings | null;
|
|
15
27
|
//# sourceMappingURL=mainAppSettings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mainAppSettings.d.ts","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/mainAppSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"mainAppSettings.d.ts","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/mainAppSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,yFAAyF;AACzF,MAAM,WAAW,sBAAsB;IACrC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,4BAA4B,CAAC,EAAE,MAAM,CAAA;CACtC;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAA;IAC3D,6FAA6F;IAC7F,QAAQ,EAAE,sBAAsB,CAAA;CACjC;AAmBD;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,YAAY,GAAG,qBAAqB,GAAG,IAAI,CAsDjG"}
|
|
@@ -3,10 +3,6 @@ export interface AddProductFileOptions {
|
|
|
3
3
|
targetName: string;
|
|
4
4
|
groupName: string;
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
7
|
-
* Adds the product file (.appex) for the widget extension.
|
|
8
|
-
*/
|
|
9
|
-
export declare function addProductFile(xcodeProject: XcodeProject, options: AddProductFileOptions): any;
|
|
10
6
|
/**
|
|
11
7
|
* Ensures the product file (.appex) exists and returns it.
|
|
12
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productFile.d.ts","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/productFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;CAClB;
|
|
1
|
+
{"version":3,"file":"productFile.d.ts","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/productFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;CAClB;AA8DD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,qBAAqB,OAqB3F"}
|
|
@@ -1,36 +1,21 @@
|
|
|
1
1
|
import { XcodeProject } from '@expo/config-plugins';
|
|
2
|
-
export interface
|
|
2
|
+
export interface CreateTargetSkeletonOptions {
|
|
3
3
|
targetName: string;
|
|
4
4
|
targetUuid: string;
|
|
5
|
-
productFile: {
|
|
6
|
-
fileRef: string;
|
|
7
|
-
};
|
|
8
|
-
xCConfigurationList: {
|
|
9
|
-
uuid: string;
|
|
10
|
-
};
|
|
11
5
|
}
|
|
12
6
|
/**
|
|
13
|
-
*
|
|
7
|
+
* Creates the minimal widget-extension native target and registers it with the project.
|
|
14
8
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
9
|
+
* A target cannot be "ensured" into existence, so this is the one create-only step in
|
|
10
|
+
* {@link applyXcodeChanges}: it adds an empty `PBXNativeTarget` (no product reference, configuration
|
|
11
|
+
* list or build phases yet) to the `PBXNativeTarget` and `PBXProject` sections. The shared ensure
|
|
12
|
+
* pipeline then fills in the configuration list, product file, group, build phases, attributes and
|
|
13
|
+
* dependency — the same code that reconciles an already-existing target.
|
|
14
|
+
*
|
|
15
|
+
* @returns The freshly created native-target object (the value stored in the `PBXNativeTarget`
|
|
16
|
+
* section under `targetUuid`).
|
|
19
17
|
*/
|
|
20
|
-
export declare function
|
|
21
|
-
uuid: string;
|
|
22
|
-
pbxNativeTarget: {
|
|
23
|
-
isa: string;
|
|
24
|
-
name: string;
|
|
25
|
-
productName: string;
|
|
26
|
-
productReference: string;
|
|
27
|
-
productType: string;
|
|
28
|
-
buildConfigurationList: string;
|
|
29
|
-
buildPhases: never[];
|
|
30
|
-
buildRules: never[];
|
|
31
|
-
dependencies: never[];
|
|
32
|
-
};
|
|
33
|
-
};
|
|
18
|
+
export declare function createTargetSkeleton(xcodeProject: XcodeProject, options: CreateTargetSkeletonOptions): any;
|
|
34
19
|
/**
|
|
35
20
|
* Ensures target attributes (LastSwiftMigration) exist for the target.
|
|
36
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAQnD,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAQnD,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,2BAA2B,OAsBpG;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAa3F;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAqB3F"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
-
import type { DynamicWidgetEntryConfig, WidgetInitialStatePath, WidgetLabel } from '@use-voltra/expo-plugin';
|
|
2
|
+
import type { DynamicLiveActivityEntryConfig, DynamicWidgetEntryConfig, WidgetInitialStatePath, WidgetLabel } from '@use-voltra/expo-plugin';
|
|
3
3
|
/**
|
|
4
4
|
* Supported iOS Home Screen widget size families.
|
|
5
5
|
*/
|
|
@@ -30,9 +30,15 @@ export interface IOSWidgetAppIntentConfig {
|
|
|
30
30
|
*/
|
|
31
31
|
export interface IOSWidgetConfig extends DynamicWidgetEntryConfig {
|
|
32
32
|
/**
|
|
33
|
-
* Unique identifier for the widget (used
|
|
33
|
+
* Unique identifier for the widget (used in the JS API and, unless `kind` is set, as the widget kind)
|
|
34
34
|
*/
|
|
35
35
|
id: string;
|
|
36
|
+
/**
|
|
37
|
+
* WidgetKit `kind` of the generated widget. Defaults to `Voltra_Widget_<id>`.
|
|
38
|
+
* Pin it to the kind of a pre-Voltra widget so already placed instances survive the migration
|
|
39
|
+
* (WidgetKit identifies a placed widget by extension bundle id + kind).
|
|
40
|
+
*/
|
|
41
|
+
kind?: string;
|
|
36
42
|
displayName: WidgetLabel;
|
|
37
43
|
description: WidgetLabel;
|
|
38
44
|
/** @default ['systemSmall', 'systemMedium', 'systemLarge'] */
|
|
@@ -47,12 +53,22 @@ export interface IOSWidgetConfig extends DynamicWidgetEntryConfig {
|
|
|
47
53
|
*/
|
|
48
54
|
appIntent?: IOSWidgetAppIntentConfig;
|
|
49
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* A Dynamic Live Activity bundled with the app.
|
|
58
|
+
* @experimental
|
|
59
|
+
*/
|
|
60
|
+
export interface IOSDynamicLiveActivityConfig extends DynamicLiveActivityEntryConfig {
|
|
61
|
+
}
|
|
50
62
|
/**
|
|
51
63
|
* Server-driven iOS widget updates (WidgetKit background refresh).
|
|
52
64
|
*/
|
|
53
65
|
export interface IOSWidgetServerUpdateConfig {
|
|
54
|
-
|
|
55
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Server endpoint that returns widget state updates. Omit it to mark the widget
|
|
68
|
+
* server-driven and supply the URL at runtime with `setWidgetServerUpdate`.
|
|
69
|
+
*/
|
|
70
|
+
url?: string;
|
|
71
|
+
/** @default 15, or 15 when the widget has an `entry` */
|
|
56
72
|
intervalMinutes?: number;
|
|
57
73
|
/** @default false */
|
|
58
74
|
refresh?: boolean;
|
|
@@ -76,6 +92,8 @@ export interface IOSConfigPluginProps {
|
|
|
76
92
|
enablePushNotifications?: boolean;
|
|
77
93
|
groupIdentifier?: string;
|
|
78
94
|
widgets?: IOSWidgetConfig[];
|
|
95
|
+
/** @experimental Dynamic Live Activities rendered from bundled JavaScript entries. */
|
|
96
|
+
liveActivities?: IOSDynamicLiveActivityConfig[];
|
|
79
97
|
deploymentTarget?: string;
|
|
80
98
|
targetName?: string;
|
|
81
99
|
fonts?: string[];
|
|
@@ -93,6 +111,7 @@ export interface IOSWidgetExtensionPluginProps {
|
|
|
93
111
|
bundleIdentifier: string;
|
|
94
112
|
deploymentTarget: string;
|
|
95
113
|
widgets?: IOSWidgetConfig[];
|
|
114
|
+
liveActivities?: IOSDynamicLiveActivityConfig[];
|
|
96
115
|
groupIdentifier?: string;
|
|
97
116
|
keychainGroup?: string;
|
|
98
117
|
fonts?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,OAAO,KAAK,EACV,8BAA8B,EAC9B,wBAAwB,EACxB,sBAAsB,EACtB,WAAW,EACZ,MAAM,yBAAyB,CAAA;AAEhC;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB,aAAa,GACb,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,mBAAmB,GACnB,sBAAsB,GACtB,iBAAiB,CAAA;AAErB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAA;IACZ,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAA;IACb,0FAA0F;IAC1F,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,uFAAuF;IACvF,UAAU,EAAE,kBAAkB,EAAE,CAAA;CACjC;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAgB,SAAQ,wBAAwB;IAC/D;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,WAAW,CAAA;IACxB,WAAW,EAAE,WAAW,CAAA;IACxB,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,eAAe,EAAE,CAAA;IACrC,gBAAgB,CAAC,EAAE,sBAAsB,CAAA;IACzC,YAAY,CAAC,EAAE,2BAA2B,CAAA;IAC1C;;;;;OAKG;IACH,SAAS,CAAC,EAAE,wBAAwB,CAAA;CACrC;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA6B,SAAQ,8BAA8B;CAAG;AAEvF;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,qBAAqB;IACrB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,wFAAwF;IACxF,wBAAwB,EAAE,MAAM,EAAE,CAAA;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,eAAe,EAAE,CAAA;IAC3B,sFAAsF;IACtF,cAAc,CAAC,EAAE,4BAA4B,EAAE,CAAA;IAC/C,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAAA;AAElF,MAAM,WAAW,qBAAqB;IACpC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,OAAO,CAAC,EAAE,eAAe,EAAE,CAAA;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,6BAA6B;IAC5C,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,eAAe,EAAE,CAAA;IAC3B,cAAc,CAAC,EAAE,4BAA4B,EAAE,CAAA;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;CACpB"}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import type { ExpoConfig } from 'expo/config';
|
|
2
|
+
type URLType = {
|
|
3
|
+
CFBundleURLSchemes?: unknown;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* The URL schemes the app is configured with: every `scheme` and `ios.scheme` value (string or
|
|
7
|
+
* array), or the bundle identifier when neither is set.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getAppURLSchemes(config: ExpoConfig): string[];
|
|
10
|
+
/**
|
|
11
|
+
* Appends a URL type for every scheme not already listed. Returns `types` itself when nothing is
|
|
12
|
+
* missing.
|
|
13
|
+
*/
|
|
14
|
+
export declare function appendMissingURLSchemes<T extends URLType>(types: T[], schemes: string[]): (T | {
|
|
15
|
+
CFBundleURLSchemes: string[];
|
|
16
|
+
})[];
|
|
2
17
|
/**
|
|
3
18
|
* Ensures the main app has a URL scheme set so widgetURL can open it.
|
|
4
19
|
* This is an optional feature for deep linking from widgets.
|
|
@@ -7,4 +22,5 @@ import type { ExpoConfig } from 'expo/config';
|
|
|
7
22
|
* @returns The modified config with URL scheme ensured
|
|
8
23
|
*/
|
|
9
24
|
export declare function ensureURLScheme(config: ExpoConfig): ExpoConfig;
|
|
25
|
+
export {};
|
|
10
26
|
//# sourceMappingURL=urlScheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlScheme.d.ts","sourceRoot":"","sources":["../../../src/utils/urlScheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"urlScheme.d.ts","sourceRoot":"","sources":["../../../src/utils/urlScheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,KAAK,OAAO,GAAG;IAAE,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAE/C;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,EAAE,CAU7D;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,OAAO,EACvD,KAAK,EAAE,CAAC,EAAE,EACV,OAAO,EAAE,MAAM,EAAE,GAChB,CAAC,CAAC,GAAG;IAAE,kBAAkB,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,EAAE,CAU1C;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CA4B9D"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { IOSConfigPluginProps, IOSWidgetConfig } from './types';
|
|
1
|
+
import type { IOSConfigPluginProps, IOSDynamicLiveActivityConfig, IOSWidgetConfig } from './types';
|
|
2
|
+
export declare function validateIOSDynamicLiveActivityConfig(liveActivity: IOSDynamicLiveActivityConfig, projectRoot?: string): void;
|
|
2
3
|
export declare function validateIOSWidgetConfig(widget: IOSWidgetConfig, projectRoot?: string): void;
|
|
3
4
|
export declare function validateIOSConfigPluginProps(props: IOSConfigPluginProps, projectRoot?: string): void;
|
|
4
5
|
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/validation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/validation.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,eAAe,EAAmB,MAAM,SAAS,CAAA;AAanH,wBAAgB,oCAAoC,CAClD,YAAY,EAAE,4BAA4B,EAC1C,WAAW,CAAC,EAAE,MAAM,GACnB,IAAI,CAaN;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CA6B3F;AAED,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,oBAAoB,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAwEpG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IOSWidgetFamily } from './types'
|
|
1
|
+
import type { IOSWidgetConfig, IOSWidgetFamily } from './types'
|
|
2
2
|
|
|
3
3
|
export const IOS = {
|
|
4
4
|
DEPLOYMENT_TARGET: '17.0',
|
|
@@ -23,3 +23,26 @@ export const WIDGET_FAMILY_MAP: Record<IOSWidgetFamily, string> = {
|
|
|
23
23
|
accessoryRectangular: '.accessoryRectangular',
|
|
24
24
|
accessoryInline: '.accessoryInline',
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
/** Default prefix of a widget's WidgetKit `kind`: `Voltra_Widget_<id>`. Mirrors `VoltraStorageKeys.widgetKindPrefix`. */
|
|
28
|
+
export const WIDGET_KIND_PREFIX = 'Voltra_Widget_'
|
|
29
|
+
|
|
30
|
+
/** WidgetKit `kind` of a widget: the `kind` option when set, else `Voltra_Widget_<id>`. */
|
|
31
|
+
export const widgetKind = (widget: Pick<IOSWidgetConfig, 'id' | 'kind'>): string =>
|
|
32
|
+
widget.kind ?? `${WIDGET_KIND_PREFIX}${widget.id}`
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* `{ id: kind }` for the widgets that pin a custom `kind`, or undefined when none does.
|
|
36
|
+
* Written to both Info.plists (`Voltra_WidgetKinds`) so native code maps ids to kinds and back.
|
|
37
|
+
*/
|
|
38
|
+
export const widgetKindOverrides = (
|
|
39
|
+
widgets?: Pick<IOSWidgetConfig, 'id' | 'kind'>[]
|
|
40
|
+
): Record<string, string> | undefined => {
|
|
41
|
+
const overrides: Record<string, string> = {}
|
|
42
|
+
for (const widget of widgets ?? []) {
|
|
43
|
+
if (widget.kind !== undefined) {
|
|
44
|
+
overrides[widget.id] = widget.kind
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return Object.keys(overrides).length > 0 ? overrides : undefined
|
|
48
|
+
}
|
package/expo-plugin/src/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { IOSConfig } from 'expo/config-plugins'
|
|
2
2
|
|
|
3
|
+
import { resolveInstalledPackageVersion } from '@use-voltra/expo-plugin'
|
|
4
|
+
|
|
3
5
|
import { IOS } from './constants'
|
|
4
6
|
import { withIOS, withPushNotifications } from './ios'
|
|
5
7
|
import { withIOS as withIOSWidget } from './ios-widget'
|
|
@@ -16,9 +18,15 @@ const withVoltraIos: VoltraIosConfigPlugin = (config, props = {}) => {
|
|
|
16
18
|
const projectRoot = (config as { modRequest?: { projectRoot?: string } }).modRequest?.projectRoot
|
|
17
19
|
validateIOSConfigPluginProps(props, projectRoot)
|
|
18
20
|
|
|
21
|
+
const voltraVersion = resolveInstalledPackageVersion(projectRoot ?? process.cwd(), '@use-voltra/ios-client')
|
|
22
|
+
|
|
19
23
|
const iosBundleIdentifier = config.ios?.bundleIdentifier
|
|
20
24
|
if (!iosBundleIdentifier) {
|
|
21
|
-
|
|
25
|
+
throw new Error(
|
|
26
|
+
'The Voltra iOS config plugin requires "expo.ios.bundleIdentifier" to be set in the app config — ' +
|
|
27
|
+
'it derives the widget extension bundle identifier from it. ' +
|
|
28
|
+
'Set "ios.bundleIdentifier" (e.g. "com.example.app") in app.json or app.config.(js|ts) and run prebuild again.'
|
|
29
|
+
)
|
|
22
30
|
}
|
|
23
31
|
|
|
24
32
|
const deploymentTarget = props.deploymentTarget || IOS.DEPLOYMENT_TARGET
|
|
@@ -37,7 +45,9 @@ const withVoltraIos: VoltraIosConfigPlugin = (config, props = {}) => {
|
|
|
37
45
|
groupIdentifier: props.groupIdentifier,
|
|
38
46
|
widgetIds: props.widgets && props.widgets.length > 0 ? props.widgets.map((w) => w.id) : undefined,
|
|
39
47
|
widgets: props.widgets,
|
|
48
|
+
liveActivities: props.liveActivities,
|
|
40
49
|
keychainGroup,
|
|
50
|
+
voltraVersion,
|
|
41
51
|
})
|
|
42
52
|
|
|
43
53
|
config = withIOSWidget(config, {
|
|
@@ -45,8 +55,10 @@ const withVoltraIos: VoltraIosConfigPlugin = (config, props = {}) => {
|
|
|
45
55
|
bundleIdentifier,
|
|
46
56
|
deploymentTarget,
|
|
47
57
|
widgets: props.widgets,
|
|
58
|
+
liveActivities: props.liveActivities,
|
|
48
59
|
version,
|
|
49
60
|
buildNumber,
|
|
61
|
+
voltraVersion,
|
|
50
62
|
...(props.groupIdentifier ? { groupIdentifier: props.groupIdentifier } : {}),
|
|
51
63
|
...(keychainGroup ? { keychainGroup } : {}),
|
|
52
64
|
...(props.fonts ? { fonts: props.fonts } : {}),
|
|
@@ -63,6 +75,7 @@ export default withVoltraIos
|
|
|
63
75
|
|
|
64
76
|
export type {
|
|
65
77
|
IOSConfigPluginProps,
|
|
78
|
+
IOSDynamicLiveActivityConfig,
|
|
66
79
|
IOSMainAppPluginProps,
|
|
67
80
|
IOSWidgetConfig,
|
|
68
81
|
IOSWidgetExtensionFiles,
|
|
@@ -8,7 +8,9 @@ export interface IOSConfigProps {
|
|
|
8
8
|
groupIdentifier?: string
|
|
9
9
|
widgetIds?: string[]
|
|
10
10
|
widgets?: import('../types').IOSWidgetConfig[]
|
|
11
|
+
liveActivities?: import('../types').IOSDynamicLiveActivityConfig[]
|
|
11
12
|
keychainGroup?: string
|
|
13
|
+
voltraVersion: string
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
/**
|
|
@@ -27,6 +29,7 @@ export function withIOS(config: ExpoConfig, props: IOSConfigProps): ExpoConfig {
|
|
|
27
29
|
widgetIds: props.widgetIds,
|
|
28
30
|
widgets: props.widgets,
|
|
29
31
|
keychainGroup: props.keychainGroup,
|
|
32
|
+
voltraVersion: props.voltraVersion,
|
|
30
33
|
})
|
|
31
34
|
|
|
32
35
|
// Configure entitlements
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { ConfigPlugin, withInfoPlist } from '@expo/config-plugins'
|
|
2
2
|
|
|
3
|
+
import { widgetKindOverrides } from '../constants'
|
|
3
4
|
import type { IOSWidgetConfig } from '../types'
|
|
5
|
+
import { resolveIOSWidgetServerUpdate } from './serverUpdate'
|
|
4
6
|
|
|
5
7
|
export interface ConfigureInfoPlistProps {
|
|
6
8
|
groupIdentifier?: string
|
|
7
9
|
widgetIds?: string[]
|
|
8
10
|
widgets?: IOSWidgetConfig[]
|
|
9
11
|
keychainGroup?: string
|
|
12
|
+
voltraVersion: string
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
/**
|
|
@@ -16,14 +19,16 @@ export interface ConfigureInfoPlistProps {
|
|
|
16
19
|
* - NSSupportsLiveActivities: Enables Live Activities support
|
|
17
20
|
* - Voltra_AppGroupIdentifier: App group ID for widget communication (if provided)
|
|
18
21
|
* - Voltra_WidgetIds: Array of widget IDs for native module access (if provided)
|
|
22
|
+
* - Voltra_WidgetKinds: Map of widget IDs to custom WidgetKit kinds (if any widget sets `kind`)
|
|
19
23
|
* - Voltra_WidgetServerUrls: Map of widget IDs to server URLs (if any widgets have serverUpdate)
|
|
20
24
|
* - Voltra_WidgetServerIntervals: Map of widget IDs to update intervals (if any widgets have serverUpdate)
|
|
21
25
|
* - Voltra_KeychainGroup: Keychain access group for shared credentials (if provided)
|
|
22
26
|
*/
|
|
23
|
-
export const configureInfoPlist: ConfigPlugin<ConfigureInfoPlistProps> = (config, props
|
|
27
|
+
export const configureInfoPlist: ConfigPlugin<ConfigureInfoPlistProps> = (config, props) => {
|
|
24
28
|
return withInfoPlist(config, (mod) => {
|
|
25
29
|
mod.modResults.NSSupportsLiveActivities = true
|
|
26
30
|
mod.modResults.NSSupportsLiveActivitiesFrequentUpdates = false
|
|
31
|
+
mod.modResults.Voltra_Version = props.voltraVersion
|
|
27
32
|
|
|
28
33
|
// Only add group identifier if provided
|
|
29
34
|
if (props.groupIdentifier) {
|
|
@@ -35,21 +40,44 @@ export const configureInfoPlist: ConfigPlugin<ConfigureInfoPlistProps> = (config
|
|
|
35
40
|
mod.modResults.Voltra_WidgetIds = props.widgetIds
|
|
36
41
|
}
|
|
37
42
|
|
|
43
|
+
// Store custom widget kinds so native code can map ids to kinds and back. A prebuild over an
|
|
44
|
+
// existing ios/ directory keeps whatever the plist already holds, so a `kind` that was removed
|
|
45
|
+
// from the config has to be deleted here or the widget would keep a kind nobody configured.
|
|
46
|
+
const widgetKinds = widgetKindOverrides(props.widgets)
|
|
47
|
+
if (widgetKinds) {
|
|
48
|
+
mod.modResults.Voltra_WidgetKinds = widgetKinds
|
|
49
|
+
} else {
|
|
50
|
+
delete mod.modResults.Voltra_WidgetKinds
|
|
51
|
+
}
|
|
52
|
+
|
|
38
53
|
// Configure server update URLs and intervals for widgets
|
|
39
54
|
if (props.widgets && props.widgets.length > 0) {
|
|
40
55
|
const serverUrls: Record<string, string> = {}
|
|
41
56
|
const serverIntervals: Record<string, number> = {}
|
|
42
57
|
|
|
43
58
|
for (const widget of props.widgets) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
59
|
+
const serverUpdate = resolveIOSWidgetServerUpdate(widget)
|
|
60
|
+
|
|
61
|
+
if (!serverUpdate) {
|
|
62
|
+
continue
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Every server-driven widget gets an interval, so this dictionary's keys are the set of
|
|
66
|
+
// server-driven widget ids the runtime settings store validates against. A URL is written
|
|
67
|
+
// only when app.json set one; otherwise the app supplies it with setWidgetServerUpdate.
|
|
68
|
+
serverIntervals[widget.id] = serverUpdate.intervalMinutes
|
|
69
|
+
|
|
70
|
+
if (serverUpdate.url !== undefined) {
|
|
71
|
+
serverUrls[widget.id] = serverUpdate.url
|
|
47
72
|
}
|
|
48
73
|
}
|
|
49
74
|
|
|
75
|
+
if (Object.keys(serverIntervals).length > 0) {
|
|
76
|
+
mod.modResults.Voltra_WidgetServerIntervals = serverIntervals
|
|
77
|
+
}
|
|
78
|
+
|
|
50
79
|
if (Object.keys(serverUrls).length > 0) {
|
|
51
80
|
mod.modResults.Voltra_WidgetServerUrls = serverUrls
|
|
52
|
-
mod.modResults.Voltra_WidgetServerIntervals = serverIntervals
|
|
53
81
|
}
|
|
54
82
|
}
|
|
55
83
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { resolveWidgetServerUpdate } from '@use-voltra/expo-plugin'
|
|
2
|
+
|
|
3
|
+
import type { ResolvedWidgetServerUpdateConfig, WidgetServerUpdateRules } from '@use-voltra/expo-plugin'
|
|
4
|
+
|
|
5
|
+
import type { IOSWidgetConfig } from '../types'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* iOS payload widgets have always defaulted to 15 minutes and accepted anything down to 1, since
|
|
9
|
+
* WidgetKit stretches a timeline it cannot honour rather than refusing it. A widget with an
|
|
10
|
+
* `entry` follows ADR 0002 instead: default 15, floor 15 on both platforms.
|
|
11
|
+
*/
|
|
12
|
+
export function iosServerUpdateRules(widget: Pick<IOSWidgetConfig, 'entry'>): WidgetServerUpdateRules {
|
|
13
|
+
return {
|
|
14
|
+
hasEntry: widget.entry !== undefined,
|
|
15
|
+
defaultIntervalMinutes: 15,
|
|
16
|
+
minimumIntervalMinutes: 1,
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** `serverUpdate` with defaults applied, as the plist and Swift generators consume it. */
|
|
21
|
+
export function resolveIOSWidgetServerUpdate(
|
|
22
|
+
widget: Pick<IOSWidgetConfig, 'entry' | 'serverUpdate'>
|
|
23
|
+
): ResolvedWidgetServerUpdateConfig | undefined {
|
|
24
|
+
if (widget.serverUpdate === undefined) {
|
|
25
|
+
return undefined
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return resolveWidgetServerUpdate(widget.serverUpdate, iosServerUpdateRules(widget))
|
|
29
|
+
}
|