@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createTargetSkeleton = createTargetSkeleton;
|
|
4
4
|
exports.ensureTargetAttributes = ensureTargetAttributes;
|
|
5
5
|
exports.ensureTargetDependency = ensureTargetDependency;
|
|
6
6
|
const constants_1 = require("../../constants");
|
|
@@ -8,18 +8,36 @@ const constants_1 = require("../../constants");
|
|
|
8
8
|
// Main Function
|
|
9
9
|
// ============================================================================
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Creates the minimal widget-extension native target and registers it with the project.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* A target cannot be "ensured" into existence, so this is the one create-only step in
|
|
14
|
+
* {@link applyXcodeChanges}: it adds an empty `PBXNativeTarget` (no product reference, configuration
|
|
15
|
+
* list or build phases yet) to the `PBXNativeTarget` and `PBXProject` sections. The shared ensure
|
|
16
|
+
* pipeline then fills in the configuration list, product file, group, build phases, attributes and
|
|
17
|
+
* dependency — the same code that reconciles an already-existing target.
|
|
18
|
+
*
|
|
19
|
+
* @returns The freshly created native-target object (the value stored in the `PBXNativeTarget`
|
|
20
|
+
* section under `targetUuid`).
|
|
17
21
|
*/
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
function createTargetSkeleton(xcodeProject, options) {
|
|
23
|
+
const { targetName, targetUuid } = options;
|
|
24
|
+
const target = {
|
|
25
|
+
uuid: targetUuid,
|
|
26
|
+
pbxNativeTarget: {
|
|
27
|
+
isa: 'PBXNativeTarget',
|
|
28
|
+
name: targetName,
|
|
29
|
+
productName: targetName,
|
|
30
|
+
productType: `"com.apple.product-type.app-extension"`,
|
|
31
|
+
buildConfigurationList: '',
|
|
32
|
+
productReference: '',
|
|
33
|
+
buildPhases: [],
|
|
34
|
+
buildRules: [],
|
|
35
|
+
dependencies: [],
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
xcodeProject.addToPbxNativeTargetSection(target);
|
|
39
|
+
xcodeProject.addToPbxProjectSection(target);
|
|
40
|
+
return xcodeProject.pbxNativeTargetSection()[targetUuid];
|
|
23
41
|
}
|
|
24
42
|
/**
|
|
25
43
|
* Ensures target attributes (LastSwiftMigration) exist for the target.
|
|
@@ -58,56 +76,4 @@ function ensureTargetDependency(xcodeProject, targetUuid) {
|
|
|
58
76
|
xcodeProject.addTargetDependency(mainTargetUuid, [targetUuid]);
|
|
59
77
|
}
|
|
60
78
|
}
|
|
61
|
-
// ============================================================================
|
|
62
|
-
// Helper Functions
|
|
63
|
-
// ============================================================================
|
|
64
|
-
/**
|
|
65
|
-
* Adds the widget extension target to the PBXNativeTarget section.
|
|
66
|
-
*/
|
|
67
|
-
function addToPbxNativeTargetSection(xcodeProject, options) {
|
|
68
|
-
const { targetName, targetUuid, productFile, xCConfigurationList } = options;
|
|
69
|
-
const target = {
|
|
70
|
-
uuid: targetUuid,
|
|
71
|
-
pbxNativeTarget: {
|
|
72
|
-
isa: 'PBXNativeTarget',
|
|
73
|
-
name: targetName,
|
|
74
|
-
productName: targetName,
|
|
75
|
-
productReference: productFile.fileRef,
|
|
76
|
-
productType: `"com.apple.product-type.app-extension"`,
|
|
77
|
-
buildConfigurationList: xCConfigurationList.uuid,
|
|
78
|
-
buildPhases: [],
|
|
79
|
-
buildRules: [],
|
|
80
|
-
dependencies: [],
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
xcodeProject.addToPbxNativeTargetSection(target);
|
|
84
|
-
return target;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Adds the target to the PBXProject section.
|
|
88
|
-
*/
|
|
89
|
-
function addToPbxProjectSection(xcodeProject, target) {
|
|
90
|
-
xcodeProject.addToPbxProjectSection(target);
|
|
91
|
-
// Add target attributes to project section
|
|
92
|
-
const projectSection = xcodeProject.pbxProjectSection();
|
|
93
|
-
const firstProject = xcodeProject.getFirstProject();
|
|
94
|
-
if (!projectSection[firstProject.uuid].attributes.TargetAttributes) {
|
|
95
|
-
projectSection[firstProject.uuid].attributes.TargetAttributes = {};
|
|
96
|
-
}
|
|
97
|
-
projectSection[firstProject.uuid].attributes.TargetAttributes[target.uuid] = {
|
|
98
|
-
LastSwiftMigration: constants_1.IOS.LAST_SWIFT_MIGRATION,
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Adds a target dependency so the main app depends on the widget extension.
|
|
103
|
-
*/
|
|
104
|
-
function addTargetDependency(xcodeProject, target) {
|
|
105
|
-
if (!xcodeProject.hash.project.objects['PBXTargetDependency']) {
|
|
106
|
-
xcodeProject.hash.project.objects['PBXTargetDependency'] = {};
|
|
107
|
-
}
|
|
108
|
-
if (!xcodeProject.hash.project.objects['PBXContainerItemProxy']) {
|
|
109
|
-
xcodeProject.hash.project.objects['PBXContainerItemProxy'] = {};
|
|
110
|
-
}
|
|
111
|
-
xcodeProject.addTargetDependency(xcodeProject.getFirstTarget().uuid, [target.uuid]);
|
|
112
|
-
}
|
|
113
79
|
//# sourceMappingURL=target.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"target.js","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/target.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"target.js","sourceRoot":"","sources":["../../../../src/ios-widget/xcode/target.ts"],"names":[],"mappings":";;AA6BA,oDAsBC;AAKD,wDAaC;AAKD,wDAqBC;AA7FD,+CAAqC;AAWrC,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E;;;;;;;;;;;GAWG;AACH,SAAgB,oBAAoB,CAAC,YAA0B,EAAE,OAAoC;IACnG,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,OAAO,CAAA;IAE1C,MAAM,MAAM,GAAG;QACb,IAAI,EAAE,UAAU;QAChB,eAAe,EAAE;YACf,GAAG,EAAE,iBAAiB;YACtB,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,wCAAwC;YACrD,sBAAsB,EAAE,EAAE;YAC1B,gBAAgB,EAAE,EAAE;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CAAC,EAAE,CAAC;QAChE,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,GAAG,EAAE,CAAA;IACjE,CAAC;IAED,MAAM,cAAc,GAAG,YAAY,CAAC,cAAc,EAAE,CAAC,IAAI,CAAA;IACzD,MAAM,UAAU,GAAG,YAAY,CAAC,sBAAsB,EAAE,CAAC,cAAc,CAAC,CAAA;IACxE,MAAM,YAAY,GAAG,UAAU,EAAE,YAAY,IAAI,EAAE,CAAA;IACnD,MAAM,uBAAuB,GAAG,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAA;IAE9F,MAAM,aAAa,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,GAAQ,EAAE,EAAE;QACnD,MAAM,UAAU,GAAG,uBAAuB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QACrD,OAAO,UAAU,EAAE,MAAM,KAAK,UAAU,CAAA;IAC1C,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,YAAY,CAAC,mBAAmB,CAAC,cAAc,EAAE,CAAC,UAAU,CAAC,CAAC,CAAA;IAChE,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAppURLSchemes = getAppURLSchemes;
|
|
4
|
+
exports.appendMissingURLSchemes = appendMissingURLSchemes;
|
|
3
5
|
exports.ensureURLScheme = ensureURLScheme;
|
|
6
|
+
/**
|
|
7
|
+
* The URL schemes the app is configured with: every `scheme` and `ios.scheme` value (string or
|
|
8
|
+
* array), or the bundle identifier when neither is set.
|
|
9
|
+
*/
|
|
10
|
+
function getAppURLSchemes(config) {
|
|
11
|
+
const configured = [config.scheme, config.ios?.scheme]
|
|
12
|
+
.flat()
|
|
13
|
+
.filter((scheme) => typeof scheme === 'string' && scheme.length > 0);
|
|
14
|
+
if (configured.length > 0) {
|
|
15
|
+
return [...new Set(configured)];
|
|
16
|
+
}
|
|
17
|
+
return config.ios?.bundleIdentifier ? [config.ios.bundleIdentifier] : [];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Appends a URL type for every scheme not already listed. Returns `types` itself when nothing is
|
|
21
|
+
* missing.
|
|
22
|
+
*/
|
|
23
|
+
function appendMissingURLSchemes(types, schemes) {
|
|
24
|
+
const missingSchemes = schemes.filter((scheme) => !types.some((t) => Array.isArray(t?.CFBundleURLSchemes) && t.CFBundleURLSchemes.includes(scheme)));
|
|
25
|
+
if (missingSchemes.length === 0) {
|
|
26
|
+
return types;
|
|
27
|
+
}
|
|
28
|
+
return [...types, ...missingSchemes.map((scheme) => ({ CFBundleURLSchemes: [scheme] }))];
|
|
29
|
+
}
|
|
4
30
|
/**
|
|
5
31
|
* Ensures the main app has a URL scheme set so widgetURL can open it.
|
|
6
32
|
* This is an optional feature for deep linking from widgets.
|
|
@@ -9,30 +35,26 @@ exports.ensureURLScheme = ensureURLScheme;
|
|
|
9
35
|
* @returns The modified config with URL scheme ensured
|
|
10
36
|
*/
|
|
11
37
|
function ensureURLScheme(config) {
|
|
12
|
-
const
|
|
13
|
-
|
|
38
|
+
const existingInfoPlist = config.ios?.infoPlist;
|
|
39
|
+
const existingTypes = existingInfoPlist?.CFBundleURLTypes;
|
|
40
|
+
// Expo's own withScheme fills CFBundleURLTypes from `scheme` / `ios.scheme` and always appends
|
|
41
|
+
// ios.bundleIdentifier, but it skips the app entirely once ios.infoPlist.CFBundleURLTypes is set
|
|
42
|
+
// (createInfoPlistPluginWithPropertyGuard). Writing the key here when the app hasn't set it
|
|
43
|
+
// therefore drops every configured scheme instead of adding one. Only top up a list the app owns.
|
|
44
|
+
if (!existingTypes) {
|
|
14
45
|
return config;
|
|
15
46
|
}
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
// Check if scheme already exists
|
|
19
|
-
const hasScheme = existingTypes.some((t) => Array.isArray(t?.CFBundleURLSchemes) && t.CFBundleURLSchemes.includes(scheme));
|
|
20
|
-
if (hasScheme) {
|
|
47
|
+
const types = appendMissingURLSchemes(existingTypes, getAppURLSchemes(config));
|
|
48
|
+
if (types === existingTypes) {
|
|
21
49
|
return config;
|
|
22
50
|
}
|
|
23
|
-
// Add the URL scheme
|
|
24
51
|
return {
|
|
25
52
|
...config,
|
|
26
53
|
ios: {
|
|
27
54
|
...config.ios,
|
|
28
55
|
infoPlist: {
|
|
29
56
|
...existingInfoPlist,
|
|
30
|
-
CFBundleURLTypes:
|
|
31
|
-
...existingTypes,
|
|
32
|
-
{
|
|
33
|
-
CFBundleURLSchemes: [scheme],
|
|
34
|
-
},
|
|
35
|
-
],
|
|
57
|
+
CFBundleURLTypes: types,
|
|
36
58
|
},
|
|
37
59
|
},
|
|
38
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlScheme.js","sourceRoot":"","sources":["../../../src/utils/urlScheme.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"urlScheme.js","sourceRoot":"","sources":["../../../src/utils/urlScheme.ts"],"names":[],"mappings":";;AAQA,4CAUC;AAMD,0DAaC;AASD,0CA4BC;AAtED;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,MAAkB;IACjD,MAAM,UAAU,GAAG,CAAC,MAAM,CAAC,MAAM,EAAG,MAAM,CAAC,GAAkD,EAAE,MAAM,CAAC;SACnG,IAAI,EAAE;SACN,MAAM,CAAC,CAAC,MAAM,EAAoB,EAAE,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IAExF,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,CAAA;IACjC,CAAC;IAED,OAAO,MAAM,CAAC,GAAG,EAAE,gBAAgB,C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AAG;YACb,SAAS,EAAE;gBACT,GAAG,iBAAiB;gBACpB,gBAAgB,EAAE,KAAK;aACxB;SACF;KACF,CAAA;AACH,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateIOSDynamicLiveActivityConfig = validateIOSDynamicLiveActivityConfig;
|
|
3
4
|
exports.validateIOSWidgetConfig = validateIOSWidgetConfig;
|
|
4
5
|
exports.validateIOSConfigPluginProps = validateIOSConfigPluginProps;
|
|
5
6
|
const expo_plugin_1 = require("@use-voltra/expo-plugin");
|
|
7
|
+
const serverUpdate_1 = require("./ios/serverUpdate");
|
|
8
|
+
const expo_plugin_2 = require("@use-voltra/expo-plugin");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
6
10
|
const VALID_FAMILIES = new Set([
|
|
7
11
|
'systemSmall',
|
|
8
12
|
'systemMedium',
|
|
@@ -12,14 +16,29 @@ const VALID_FAMILIES = new Set([
|
|
|
12
16
|
'accessoryRectangular',
|
|
13
17
|
'accessoryInline',
|
|
14
18
|
]);
|
|
19
|
+
const DYNAMIC_LIVE_ACTIVITY_ID_PATTERN = /^[a-zA-Z0-9_]+$/;
|
|
20
|
+
function validateIOSDynamicLiveActivityConfig(liveActivity, projectRoot) {
|
|
21
|
+
if (!liveActivity.id || typeof liveActivity.id !== 'string') {
|
|
22
|
+
throw new Error('Dynamic Live Activity ID is required and must be a string');
|
|
23
|
+
}
|
|
24
|
+
if (!DYNAMIC_LIVE_ACTIVITY_ID_PATTERN.test(liveActivity.id)) {
|
|
25
|
+
throw new Error(`Dynamic Live Activity ID '${liveActivity.id}' is invalid. ` +
|
|
26
|
+
'It must be non-empty and contain only alphanumeric characters and underscores.');
|
|
27
|
+
}
|
|
28
|
+
(0, expo_plugin_1.validateWidgetEntry)(liveActivity.entry, liveActivity.id, projectRoot);
|
|
29
|
+
}
|
|
15
30
|
function validateIOSWidgetConfig(widget, projectRoot) {
|
|
16
31
|
(0, expo_plugin_1.validateHomeScreenWidgetId)(widget.id);
|
|
32
|
+
if (widget.kind !== undefined && (typeof widget.kind !== 'string' || widget.kind.trim() === '')) {
|
|
33
|
+
throw new Error(`Widget '${widget.id}': kind must be a non-empty string`);
|
|
34
|
+
}
|
|
17
35
|
(0, expo_plugin_1.validateWidgetLabel)(widget.displayName, widget.id, 'displayName');
|
|
18
36
|
(0, expo_plugin_1.validateWidgetLabel)(widget.description, widget.id, 'description');
|
|
19
37
|
(0, expo_plugin_1.validateInitialStatePath)(widget.initialStatePath, widget.id, projectRoot);
|
|
20
38
|
if (widget.entry !== undefined) {
|
|
21
39
|
(0, expo_plugin_1.validateWidgetEntry)(widget.entry, widget.id, projectRoot);
|
|
22
40
|
}
|
|
41
|
+
(0, expo_plugin_1.validateWidgetServerUpdate)(widget.serverUpdate, widget.id, (0, serverUpdate_1.iosServerUpdateRules)(widget));
|
|
23
42
|
if (widget.supportedFamilies) {
|
|
24
43
|
if (!Array.isArray(widget.supportedFamilies)) {
|
|
25
44
|
throw new Error(`Widget '${widget.id}': supportedFamilies must be an array`);
|
|
@@ -46,12 +65,47 @@ function validateIOSConfigPluginProps(props, projectRoot) {
|
|
|
46
65
|
throw new Error('widgets must be an array');
|
|
47
66
|
}
|
|
48
67
|
const seenIds = new Set();
|
|
68
|
+
const seenKinds = new Set();
|
|
49
69
|
for (const widget of props.widgets) {
|
|
50
70
|
validateIOSWidgetConfig(widget, projectRoot);
|
|
71
|
+
// A server-driven Dynamic Widget commits fetched props to the App Group so the widget
|
|
72
|
+
// extension can read them. Without one it would fetch and have nowhere to put the result.
|
|
73
|
+
if (widget.entry !== undefined && widget.serverUpdate !== undefined && !props.groupIdentifier) {
|
|
74
|
+
throw new Error(`Widget '${widget.id}' has both entry and serverUpdate, which requires groupIdentifier ` +
|
|
75
|
+
'so fetched props can be shared with the widget extension.');
|
|
76
|
+
}
|
|
51
77
|
if (seenIds.has(widget.id)) {
|
|
52
78
|
throw new Error(`Duplicate widget ID: '${widget.id}'`);
|
|
53
79
|
}
|
|
54
80
|
seenIds.add(widget.id);
|
|
81
|
+
const kind = (0, constants_1.widgetKind)(widget);
|
|
82
|
+
if (seenKinds.has(kind)) {
|
|
83
|
+
throw new Error(`Duplicate widget kind: '${kind}'`);
|
|
84
|
+
}
|
|
85
|
+
seenKinds.add(kind);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (props.liveActivities !== undefined) {
|
|
89
|
+
if (!Array.isArray(props.liveActivities)) {
|
|
90
|
+
throw new Error('liveActivities must be an array');
|
|
91
|
+
}
|
|
92
|
+
if (props.liveActivities.length > 0 && !props.groupIdentifier) {
|
|
93
|
+
throw new Error('groupIdentifier is required when liveActivities is non-empty');
|
|
94
|
+
}
|
|
95
|
+
const seenIds = new Set();
|
|
96
|
+
const seenAttributesTypes = new Map();
|
|
97
|
+
for (const liveActivity of props.liveActivities) {
|
|
98
|
+
validateIOSDynamicLiveActivityConfig(liveActivity, projectRoot);
|
|
99
|
+
if (seenIds.has(liveActivity.id)) {
|
|
100
|
+
throw new Error(`Duplicate Dynamic Live Activity ID: '${liveActivity.id}'`);
|
|
101
|
+
}
|
|
102
|
+
seenIds.add(liveActivity.id);
|
|
103
|
+
const attributesType = (0, expo_plugin_2.getDynamicLiveActivityAttributesType)(liveActivity.id);
|
|
104
|
+
const conflictingId = seenAttributesTypes.get(attributesType);
|
|
105
|
+
if (conflictingId) {
|
|
106
|
+
throw new Error(`Dynamic Live Activity IDs '${conflictingId}' and '${liveActivity.id}' generate the same ActivityKit attributes type '${attributesType}'`);
|
|
107
|
+
}
|
|
108
|
+
seenAttributesTypes.set(attributesType, liveActivity.id);
|
|
55
109
|
}
|
|
56
110
|
}
|
|
57
111
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/validation.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","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mBAAmB,CAAC,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,EAAE,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -17,4 +17,21 @@ export const WIDGET_FAMILY_MAP = {
|
|
|
17
17
|
accessoryRectangular: '.accessoryRectangular',
|
|
18
18
|
accessoryInline: '.accessoryInline',
|
|
19
19
|
};
|
|
20
|
+
/** Default prefix of a widget's WidgetKit `kind`: `Voltra_Widget_<id>`. Mirrors `VoltraStorageKeys.widgetKindPrefix`. */
|
|
21
|
+
export const WIDGET_KIND_PREFIX = 'Voltra_Widget_';
|
|
22
|
+
/** WidgetKit `kind` of a widget: the `kind` option when set, else `Voltra_Widget_<id>`. */
|
|
23
|
+
export const widgetKind = (widget) => widget.kind ?? `${WIDGET_KIND_PREFIX}${widget.id}`;
|
|
24
|
+
/**
|
|
25
|
+
* `{ id: kind }` for the widgets that pin a custom `kind`, or undefined when none does.
|
|
26
|
+
* Written to both Info.plists (`Voltra_WidgetKinds`) so native code maps ids to kinds and back.
|
|
27
|
+
*/
|
|
28
|
+
export const widgetKindOverrides = (widgets) => {
|
|
29
|
+
const overrides = {};
|
|
30
|
+
for (const widget of widgets ?? []) {
|
|
31
|
+
if (widget.kind !== undefined) {
|
|
32
|
+
overrides[widget.id] = widget.kind;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return Object.keys(overrides).length > 0 ? overrides : undefined;
|
|
36
|
+
};
|
|
20
37
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,GAAG,GAAG;IACjB,iBAAiB,EAAE,MAAM;IACzB,aAAa,EAAE,KAAK;IACpB,aAAa,EAAE,KAAK;IACpB,oBAAoB,EAAE,IAAI;CAClB,CAAA;AAEV,mDAAmD;AACnD,MAAM,CAAC,MAAM,wBAAwB,GAA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,CAAC,IAAI,IAAI,GAAG,kBAAkB,GAAG,MAAM,CAAC,EAAE,EAAE,CAAA;AAEpD;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,OAAgD,EACZ,EAAE;IACtC,MAAM,SAAS,GAA2B,EAAE,CAAA;IAC5C,KAAK,MAAM,MAAM,IAAI,OAAO,IAAI,EAAE,EAAE,CAAC;QACnC,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC9B,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,CAAA;QACpC,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;AAClE,CAAC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IOSConfig } from 'expo/config-plugins';
|
|
2
|
+
import { resolveInstalledPackageVersion } from '@use-voltra/expo-plugin';
|
|
2
3
|
import { IOS } from './constants';
|
|
3
4
|
import { withIOS, withPushNotifications } from './ios';
|
|
4
5
|
import { withIOS as withIOSWidget } from './ios-widget';
|
|
@@ -12,9 +13,12 @@ import { validateIOSConfigPluginProps } from './validation';
|
|
|
12
13
|
const withVoltraIos = (config, props = {}) => {
|
|
13
14
|
const projectRoot = config.modRequest?.projectRoot;
|
|
14
15
|
validateIOSConfigPluginProps(props, projectRoot);
|
|
16
|
+
const voltraVersion = resolveInstalledPackageVersion(projectRoot ?? process.cwd(), '@use-voltra/ios-client');
|
|
15
17
|
const iosBundleIdentifier = config.ios?.bundleIdentifier;
|
|
16
18
|
if (!iosBundleIdentifier) {
|
|
17
|
-
|
|
19
|
+
throw new Error('The Voltra iOS config plugin requires "expo.ios.bundleIdentifier" to be set in the app config — ' +
|
|
20
|
+
'it derives the widget extension bundle identifier from it. ' +
|
|
21
|
+
'Set "ios.bundleIdentifier" (e.g. "com.example.app") in app.json or app.config.(js|ts) and run prebuild again.');
|
|
18
22
|
}
|
|
19
23
|
const deploymentTarget = props.deploymentTarget || IOS.DEPLOYMENT_TARGET;
|
|
20
24
|
const targetName = props.targetName || `${IOSConfig.XcodeUtils.sanitizedName(config.name)}LiveActivity`;
|
|
@@ -28,15 +32,19 @@ const withVoltraIos = (config, props = {}) => {
|
|
|
28
32
|
groupIdentifier: props.groupIdentifier,
|
|
29
33
|
widgetIds: props.widgets && props.widgets.length > 0 ? props.widgets.map((w) => w.id) : undefined,
|
|
30
34
|
widgets: props.widgets,
|
|
35
|
+
liveActivities: props.liveActivities,
|
|
31
36
|
keychainGroup,
|
|
37
|
+
voltraVersion,
|
|
32
38
|
});
|
|
33
39
|
config = withIOSWidget(config, {
|
|
34
40
|
targetName,
|
|
35
41
|
bundleIdentifier,
|
|
36
42
|
deploymentTarget,
|
|
37
43
|
widgets: props.widgets,
|
|
44
|
+
liveActivities: props.liveActivities,
|
|
38
45
|
version,
|
|
39
46
|
buildNumber,
|
|
47
|
+
voltraVersion,
|
|
40
48
|
...(props.groupIdentifier ? { groupIdentifier: props.groupIdentifier } : {}),
|
|
41
49
|
...(keychainGroup ? { keychainGroup } : {}),
|
|
42
50
|
...(props.fonts ? { fonts: props.fonts } : {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,cAAc,CAAA;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAA;AAE3D;;;;GAI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ChB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,OAAO;QACP,WAAW;QACX,aAAa;QACb,GAAG,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5E,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3C,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/C,CAAC,CAAA;IAEF,IAAI,KAAK,CAAC,uBAAuB,EAAE,CAAC;QAClC,MAAM,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAA;IACxC,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ios/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ios/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAWhD;;;;;;;;GAQG;AACH,MAAM,UAAU,OAAO,CAAC,MAAkB,EAAE,KAAqB;IAC/D,uBAAuB;IACvB,MAAM,GAAG,kBAAkB,CAAC,MAAM,EAAE;QAClC,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,aAAa,EAAE,KAAK,CAAC,aAAa;KACnC,CAAC,CAAA;IAEF,yBAAyB;IACzB,MAAM,GAAG,qBAAqB,CAAC,MAAM,EAAE;QACrC,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,aAAa,EAAE,KAAK,CAAC,aAAa;KACnC,CAAC,CAAA;IAEF,gBAAgB;IAChB,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE;QAC5B,eAAe,EAAE,KAAK,CAAC,eAAe;KACvC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC;AAED,4BAA4B;AAC5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { withInfoPlist } from '@expo/config-plugins';
|
|
2
|
+
import { widgetKindOverrides } from '../constants';
|
|
3
|
+
import { resolveIOSWidgetServerUpdate } from './serverUpdate';
|
|
2
4
|
/**
|
|
3
5
|
* Configures main app Info.plist for Live Activities and widgets.
|
|
4
6
|
*
|
|
@@ -6,14 +8,16 @@ import { withInfoPlist } from '@expo/config-plugins';
|
|
|
6
8
|
* - NSSupportsLiveActivities: Enables Live Activities support
|
|
7
9
|
* - Voltra_AppGroupIdentifier: App group ID for widget communication (if provided)
|
|
8
10
|
* - Voltra_WidgetIds: Array of widget IDs for native module access (if provided)
|
|
11
|
+
* - Voltra_WidgetKinds: Map of widget IDs to custom WidgetKit kinds (if any widget sets `kind`)
|
|
9
12
|
* - Voltra_WidgetServerUrls: Map of widget IDs to server URLs (if any widgets have serverUpdate)
|
|
10
13
|
* - Voltra_WidgetServerIntervals: Map of widget IDs to update intervals (if any widgets have serverUpdate)
|
|
11
14
|
* - Voltra_KeychainGroup: Keychain access group for shared credentials (if provided)
|
|
12
15
|
*/
|
|
13
|
-
export const configureInfoPlist = (config, props
|
|
16
|
+
export const configureInfoPlist = (config, props) => {
|
|
14
17
|
return withInfoPlist(config, (mod) => {
|
|
15
18
|
mod.modResults.NSSupportsLiveActivities = true;
|
|
16
19
|
mod.modResults.NSSupportsLiveActivitiesFrequentUpdates = false;
|
|
20
|
+
mod.modResults.Voltra_Version = props.voltraVersion;
|
|
17
21
|
// Only add group identifier if provided
|
|
18
22
|
if (props.groupIdentifier) {
|
|
19
23
|
mod.modResults.Voltra_AppGroupIdentifier = props.groupIdentifier;
|
|
@@ -22,19 +26,38 @@ export const configureInfoPlist = (config, props = {}) => {
|
|
|
22
26
|
if (props.widgetIds && props.widgetIds.length > 0) {
|
|
23
27
|
mod.modResults.Voltra_WidgetIds = props.widgetIds;
|
|
24
28
|
}
|
|
29
|
+
// Store custom widget kinds so native code can map ids to kinds and back. A prebuild over an
|
|
30
|
+
// existing ios/ directory keeps whatever the plist already holds, so a `kind` that was removed
|
|
31
|
+
// from the config has to be deleted here or the widget would keep a kind nobody configured.
|
|
32
|
+
const widgetKinds = widgetKindOverrides(props.widgets);
|
|
33
|
+
if (widgetKinds) {
|
|
34
|
+
mod.modResults.Voltra_WidgetKinds = widgetKinds;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
delete mod.modResults.Voltra_WidgetKinds;
|
|
38
|
+
}
|
|
25
39
|
// Configure server update URLs and intervals for widgets
|
|
26
40
|
if (props.widgets && props.widgets.length > 0) {
|
|
27
41
|
const serverUrls = {};
|
|
28
42
|
const serverIntervals = {};
|
|
29
43
|
for (const widget of props.widgets) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
44
|
+
const serverUpdate = resolveIOSWidgetServerUpdate(widget);
|
|
45
|
+
if (!serverUpdate) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
// Every server-driven widget gets an interval, so this dictionary's keys are the set of
|
|
49
|
+
// server-driven widget ids the runtime settings store validates against. A URL is written
|
|
50
|
+
// only when app.json set one; otherwise the app supplies it with setWidgetServerUpdate.
|
|
51
|
+
serverIntervals[widget.id] = serverUpdate.intervalMinutes;
|
|
52
|
+
if (serverUpdate.url !== undefined) {
|
|
53
|
+
serverUrls[widget.id] = serverUpdate.url;
|
|
33
54
|
}
|
|
34
55
|
}
|
|
56
|
+
if (Object.keys(serverIntervals).length > 0) {
|
|
57
|
+
mod.modResults.Voltra_WidgetServerIntervals = serverIntervals;
|
|
58
|
+
}
|
|
35
59
|
if (Object.keys(serverUrls).length > 0) {
|
|
36
60
|
mod.modResults.Voltra_WidgetServerUrls = serverUrls;
|
|
37
|
-
mod.modResults.Voltra_WidgetServerIntervals = serverIntervals;
|
|
38
61
|
}
|
|
39
62
|
}
|
|
40
63
|
// Store Keychain group identifier for shared credential access
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infoPlist.js","sourceRoot":"","sources":["../../../src/ios/infoPlist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,aAAa,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"infoPlist.js","sourceRoot":"","sources":["../../../src/ios/infoPlist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAElD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AAU7D;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA0C,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;IACzF,OAAO,aAAa,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;QACnC,GAAG,CAAC,UAAU,CAAC,wBAAwB,GAAG,IAAI,CAAA;QAC9C,GAAG,CAAC,UAAU,CAAC,uCAAuC,GAAG,KAAK,CAAA;QAC9D,GAAG,CAAC,UAAU,CAAC,cAAc,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YAAY,CAAC,GAAG,CAAA;gBAC1C,CAAC;YACH,CAAC;YAED,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC5C,GAAG,CAAC,UAAU,CAAC,4BAA4B,GAAG,eAAe,CAAA;YAC/D,CAAC;YAED,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACvC,GAAG,CAAC,UAAU,CAAC,uBAAuB,GAAG,UAAU,CAAA;YACrD,CAAC;QACH,CAAC;QAED,+DAA+D;QAC/D,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;YACxB,GAAG,CAAC,UAAU,CAAC,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAAA;QAC3D,CAAC;QAED,OAAO,GAAG,CAAA;IACZ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { resolveWidgetServerUpdate } from '@use-voltra/expo-plugin';
|
|
2
|
+
/**
|
|
3
|
+
* iOS payload widgets have always defaulted to 15 minutes and accepted anything down to 1, since
|
|
4
|
+
* WidgetKit stretches a timeline it cannot honour rather than refusing it. A widget with an
|
|
5
|
+
* `entry` follows ADR 0002 instead: default 15, floor 15 on both platforms.
|
|
6
|
+
*/
|
|
7
|
+
export function iosServerUpdateRules(widget) {
|
|
8
|
+
return {
|
|
9
|
+
hasEntry: widget.entry !== undefined,
|
|
10
|
+
defaultIntervalMinutes: 15,
|
|
11
|
+
minimumIntervalMinutes: 1,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/** `serverUpdate` with defaults applied, as the plist and Swift generators consume it. */
|
|
15
|
+
export function resolveIOSWidgetServerUpdate(widget) {
|
|
16
|
+
if (widget.serverUpdate === undefined) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
return resolveWidgetServerUpdate(widget.serverUpdate, iosServerUpdateRules(widget));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=serverUpdate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverUpdate.js","sourceRoot":"","sources":["../../../src/ios/serverUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AAMnE;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAsC;IACzE,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,KAAK,KAAK,SAAS;QACpC,sBAAsB,EAAE,EAAE;QAC1B,sBAAsB,EAAE,CAAC;KAC1B,CAAA;AACH,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,4BAA4B,CAC1C,MAAuD;IAEvD,IAAI,MAAM,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QACtC,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,OAAO,yBAAyB,CAAC,MAAM,CAAC,YAAY,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAA;AACrF,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
|
-
import {
|
|
3
|
+
import { createPrerenderWidgetModuleLoader } from '@use-voltra/expo-plugin';
|
|
4
4
|
// Emit the experimental notice at most once per prebuild process (detection runs from several
|
|
5
5
|
// plugin steps).
|
|
6
6
|
let hasWarnedExperimental = false;
|
|
7
7
|
/** Inspect every widget once and tag entry-backed widgets as Dynamic Widgets. */
|
|
8
8
|
export function detectClientRenderedWidgets(widgets, projectRoot) {
|
|
9
|
-
const
|
|
9
|
+
const loader = createPrerenderWidgetModuleLoader(projectRoot, 'ios');
|
|
10
|
+
const detected = widgets.map((widget) => detectSingleWidget(widget, projectRoot, loader));
|
|
10
11
|
if (!hasWarnedExperimental) {
|
|
11
12
|
const clientWidgetIds = detected.filter((widget) => widget.clientRendered).map((widget) => widget.id);
|
|
12
13
|
if (clientWidgetIds.length > 0) {
|
|
@@ -18,7 +19,7 @@ export function detectClientRenderedWidgets(widgets, projectRoot) {
|
|
|
18
19
|
}
|
|
19
20
|
return detected;
|
|
20
21
|
}
|
|
21
|
-
function detectSingleWidget(widget, projectRoot) {
|
|
22
|
+
function detectSingleWidget(widget, projectRoot, loader) {
|
|
22
23
|
if (widget.entry === undefined) {
|
|
23
24
|
return {
|
|
24
25
|
...widget,
|
|
@@ -29,8 +30,7 @@ function detectSingleWidget(widget, projectRoot) {
|
|
|
29
30
|
if (!sourcePath || !fs.existsSync(sourcePath)) {
|
|
30
31
|
throw new Error(`[voltra] Dynamic Widget "${widget.id}" entry not found at ${path.relative(projectRoot, sourcePath ?? widget.entry)}`);
|
|
31
32
|
}
|
|
32
|
-
const
|
|
33
|
-
const widgetFn = widgetModule?.default ?? widgetModule;
|
|
33
|
+
const widgetFn = loader.loadDefaultExport(sourcePath);
|
|
34
34
|
if (typeof widgetFn !== 'function') {
|
|
35
35
|
throw new Error(`[voltra] Dynamic Widget "${widget.id}" at ${path.relative(projectRoot, sourcePath)} must default-export a function or component.`);
|
|
36
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientRendered.js","sourceRoot":"","sources":["../../../src/ios-widget/clientRendered.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"clientRendered.js","sourceRoot":"","sources":["../../../src/ios-widget/clientRendered.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,iCAAiC,EAA2B,MAAM,yBAAyB,CAAA;AAuBpG,8FAA8F;AAC9F,iBAAiB;AACjB,IAAI,qBAAqB,GAAG,KAAK,CAAA;AAEjC,iFAAiF;AAC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C,KAAK,CAC3B,EAAE,CACJ,CAAA;IACH,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAA;IACrD,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CACb,4BAA4B,MAAM,CAAC,EAAE,QAAQ,IAAI,CAAC,QAAQ,CACxD,WAAW,EACX,UAAU,CACX,+CAA+C,CACjD,CAAA;IACH,CAAC;IAED,OAAO;QACL,GAAG,MAAM;QACT,cAAc,EAAE,IAAI;QACpB,gBAAgB,EAAE,UAAU;KAC7B,CAAA;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAa,EAAE,WAAmB;IAChE,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAAA;AACzC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createPrerenderWidgetModuleLoader, logger, resolveInstalledPackageVersion, } from '@use-voltra/expo-plugin';
|
|
2
2
|
/**
|
|
3
3
|
* Initial-state prerender for Dynamic Widgets.
|
|
4
4
|
*
|
|
@@ -26,7 +26,7 @@ const SINGLE_LOCALE_KEY = '__default';
|
|
|
26
26
|
* mirror `WidgetEnvironment` from packages/core/src/widget-environment.ts so the widget
|
|
27
27
|
* function sees the same shape it gets at runtime.
|
|
28
28
|
*/
|
|
29
|
-
function buildPlaceholderEnv() {
|
|
29
|
+
function buildPlaceholderEnv(voltraVersion) {
|
|
30
30
|
return {
|
|
31
31
|
date: Date.now(),
|
|
32
32
|
widgetFamily: 'systemMedium',
|
|
@@ -39,7 +39,7 @@ function buildPlaceholderEnv() {
|
|
|
39
39
|
isDev: false,
|
|
40
40
|
metroUrl: null,
|
|
41
41
|
appVersion: 'unknown',
|
|
42
|
-
voltraVersion
|
|
42
|
+
voltraVersion,
|
|
43
43
|
},
|
|
44
44
|
};
|
|
45
45
|
}
|
|
@@ -59,11 +59,11 @@ export async function prerenderClientRenderedWidgets(widgets, projectRoot) {
|
|
|
59
59
|
// @use-voltra/android in a future phase.
|
|
60
60
|
const iosModuleId = '@use-voltra/ios';
|
|
61
61
|
const { renderVoltraVariantToJson } = (await import(iosModuleId));
|
|
62
|
-
const placeholderEnv = buildPlaceholderEnv();
|
|
62
|
+
const placeholderEnv = buildPlaceholderEnv(resolveInstalledPackageVersion(projectRoot, '@use-voltra/ios-client'));
|
|
63
|
+
const loader = createPrerenderWidgetModuleLoader(projectRoot, 'ios');
|
|
63
64
|
for (const widget of clientWidgets) {
|
|
64
65
|
try {
|
|
65
|
-
const
|
|
66
|
-
const widgetFn = widgetModule?.default ?? widgetModule;
|
|
66
|
+
const widgetFn = loader.loadDefaultExport(widget.clientSourcePath);
|
|
67
67
|
if (typeof widgetFn !== 'function') {
|
|
68
68
|
throw new Error(`Expected the entry module at ${widget.clientSourcePath} to default-export a function or component.`);
|
|
69
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientRenderedPrerender.js","sourceRoot":"","sources":["../../../src/ios-widget/clientRenderedPrerender.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"clientRenderedPrerender.js","sourceRoot":"","sources":["../../../src/ios-widget/clientRenderedPrerender.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,MAAM,EACN,8BAA8B,GAE/B,MAAM,yBAAyB,CAAA;AAIhC;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4FAA4F;AAC5F,MAAM,iBAAiB,GAAG,WAAW,CAAA;AAErC;;;;GAIG;AACH,SAAS,mBAAmB,CAAC,aAAqB;IAChD,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE;QAChB,YAAY,EAAE,cAAc;QAC5B,WAAW,EAAE,OAAO;QACpB,MAAM,EAAE,OAAO;QACf,mBAAmB,EAAE,WAAW;QAChC,8BAA8B,EAAE,IAAI;QACpC,aAAa,EAAE,S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