@use-voltra/ios-client 1.4.1 → 2.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (577) hide show
  1. package/README.md +113 -0
  2. package/Voltra.podspec +28 -0
  3. package/build/commonjs/VoltraModule.js +13 -0
  4. package/build/commonjs/VoltraModule.js.map +1 -0
  5. package/build/commonjs/components/VoltraLiveActivityPreview.js +30 -0
  6. package/build/commonjs/components/VoltraLiveActivityPreview.js.map +1 -0
  7. package/build/commonjs/components/VoltraView.js +50 -0
  8. package/build/commonjs/components/VoltraView.js.map +1 -0
  9. package/build/commonjs/components/VoltraWidgetPreview.js +58 -0
  10. package/build/commonjs/components/VoltraWidgetPreview.js.map +1 -0
  11. package/build/commonjs/events.js +32 -0
  12. package/build/commonjs/events.js.map +1 -0
  13. package/build/commonjs/helpers.js +26 -0
  14. package/build/commonjs/helpers.js.map +1 -0
  15. package/build/commonjs/index.js +226 -0
  16. package/build/commonjs/index.js.map +1 -0
  17. package/build/commonjs/live-activity/api.js +168 -0
  18. package/build/commonjs/live-activity/api.js.map +1 -0
  19. package/build/commonjs/logger.js +39 -0
  20. package/build/commonjs/logger.js.map +1 -0
  21. package/build/commonjs/native/NativeVoltra.js +15 -0
  22. package/build/commonjs/native/NativeVoltra.js.map +1 -0
  23. package/build/commonjs/native/VoltraRNNativeComponent.ts +9 -0
  24. package/build/commonjs/package.json +1 -0
  25. package/build/commonjs/preload.js +54 -0
  26. package/build/commonjs/preload.js.map +1 -0
  27. package/build/commonjs/types.js +2 -0
  28. package/build/commonjs/types.js.map +1 -0
  29. package/build/commonjs/utils/assertRunningOnApple.js +16 -0
  30. package/build/commonjs/utils/assertRunningOnApple.js.map +1 -0
  31. package/build/commonjs/utils/helpers.js +19 -0
  32. package/build/commonjs/utils/helpers.js.map +1 -0
  33. package/build/commonjs/utils/index.js +28 -0
  34. package/build/commonjs/utils/index.js.map +1 -0
  35. package/build/commonjs/utils/useUpdateOnHMR.js +25 -0
  36. package/build/commonjs/utils/useUpdateOnHMR.js.map +1 -0
  37. package/build/commonjs/widgets/server-credentials.js +18 -0
  38. package/build/commonjs/widgets/server-credentials.js.map +1 -0
  39. package/build/commonjs/widgets/widget-api.js +55 -0
  40. package/build/commonjs/widgets/widget-api.js.map +1 -0
  41. package/build/module/VoltraModule.js +4 -0
  42. package/build/module/VoltraModule.js.map +1 -0
  43. package/build/module/components/VoltraLiveActivityPreview.js +25 -0
  44. package/build/module/components/VoltraLiveActivityPreview.js.map +1 -0
  45. package/build/module/components/VoltraView.js +44 -0
  46. package/build/module/components/VoltraView.js.map +1 -0
  47. package/build/module/components/VoltraWidgetPreview.js +53 -0
  48. package/build/module/components/VoltraWidgetPreview.js.map +1 -0
  49. package/build/module/events.js +28 -0
  50. package/build/module/events.js.map +1 -0
  51. package/build/module/helpers.js +21 -0
  52. package/build/module/helpers.js.map +1 -0
  53. package/build/module/index.js +17 -0
  54. package/build/module/index.js.map +1 -0
  55. package/build/module/live-activity/api.js +158 -0
  56. package/build/module/live-activity/api.js.map +1 -0
  57. package/build/module/logger.js +35 -0
  58. package/build/module/logger.js.map +1 -0
  59. package/build/module/native/NativeVoltra.js +11 -0
  60. package/build/module/native/NativeVoltra.js.map +1 -0
  61. package/build/module/native/VoltraRNNativeComponent.ts +9 -0
  62. package/build/module/package.json +1 -0
  63. package/build/module/preload.js +48 -0
  64. package/build/module/preload.js.map +1 -0
  65. package/build/module/types.js +2 -0
  66. package/build/module/types.js.map +1 -0
  67. package/build/module/utils/assertRunningOnApple.js +11 -0
  68. package/build/module/utils/assertRunningOnApple.js.map +1 -0
  69. package/build/module/utils/helpers.js +4 -0
  70. package/build/module/utils/helpers.js.map +1 -0
  71. package/build/module/utils/index.js +5 -0
  72. package/build/module/utils/index.js.map +1 -0
  73. package/build/module/utils/useUpdateOnHMR.js +20 -0
  74. package/build/module/utils/useUpdateOnHMR.js.map +1 -0
  75. package/build/module/widgets/server-credentials.js +13 -0
  76. package/build/module/widgets/server-credentials.js.map +1 -0
  77. package/build/module/widgets/widget-api.js +45 -0
  78. package/build/module/widgets/widget-api.js.map +1 -0
  79. package/build/typescript/commonjs/VoltraModule.d.ts +3 -0
  80. package/build/typescript/commonjs/VoltraModule.d.ts.map +1 -0
  81. package/build/typescript/commonjs/components/VoltraLiveActivityPreview.d.ts.map +1 -0
  82. package/build/typescript/commonjs/components/VoltraView.d.ts.map +1 -0
  83. package/build/typescript/commonjs/components/VoltraWidgetPreview.d.ts.map +1 -0
  84. package/build/typescript/commonjs/events.d.ts.map +1 -0
  85. package/build/typescript/commonjs/helpers.d.ts.map +1 -0
  86. package/build/{types → typescript/commonjs}/index.d.ts +5 -0
  87. package/build/typescript/commonjs/index.d.ts.map +1 -0
  88. package/build/typescript/commonjs/live-activity/api.d.ts.map +1 -0
  89. package/build/typescript/commonjs/logger.d.ts.map +1 -0
  90. package/build/typescript/commonjs/native/NativeVoltra.d.ts +100 -0
  91. package/build/typescript/commonjs/native/NativeVoltra.d.ts.map +1 -0
  92. package/build/typescript/commonjs/native/VoltraRNNativeComponent.d.ts +8 -0
  93. package/build/typescript/commonjs/native/VoltraRNNativeComponent.d.ts.map +1 -0
  94. package/build/typescript/commonjs/package.json +1 -0
  95. package/build/typescript/commonjs/preload.d.ts.map +1 -0
  96. package/build/typescript/commonjs/types.d.ts.map +1 -0
  97. package/build/typescript/commonjs/utils/assertRunningOnApple.d.ts.map +1 -0
  98. package/build/typescript/commonjs/utils/helpers.d.ts.map +1 -0
  99. package/build/typescript/commonjs/utils/index.d.ts.map +1 -0
  100. package/build/typescript/commonjs/utils/useUpdateOnHMR.d.ts.map +1 -0
  101. package/build/typescript/commonjs/widgets/server-credentials.d.ts.map +1 -0
  102. package/build/typescript/commonjs/widgets/widget-api.d.ts.map +1 -0
  103. package/build/typescript/module/VoltraModule.d.ts +3 -0
  104. package/build/typescript/module/VoltraModule.d.ts.map +1 -0
  105. package/build/typescript/module/components/VoltraLiveActivityPreview.d.ts +7 -0
  106. package/build/typescript/module/components/VoltraLiveActivityPreview.d.ts.map +1 -0
  107. package/build/typescript/module/components/VoltraView.d.ts +12 -0
  108. package/build/typescript/module/components/VoltraView.d.ts.map +1 -0
  109. package/build/typescript/module/components/VoltraWidgetPreview.d.ts +9 -0
  110. package/build/typescript/module/components/VoltraWidgetPreview.d.ts.map +1 -0
  111. package/build/typescript/module/events.d.ts +33 -0
  112. package/build/typescript/module/events.d.ts.map +1 -0
  113. package/build/typescript/module/helpers.d.ts +3 -0
  114. package/build/typescript/module/helpers.d.ts.map +1 -0
  115. package/build/typescript/module/index.d.ts +18 -0
  116. package/build/typescript/module/index.d.ts.map +1 -0
  117. package/build/typescript/module/live-activity/api.d.ts +35 -0
  118. package/build/typescript/module/live-activity/api.d.ts.map +1 -0
  119. package/build/typescript/module/logger.d.ts +16 -0
  120. package/build/typescript/module/logger.d.ts.map +1 -0
  121. package/build/typescript/module/native/NativeVoltra.d.ts +100 -0
  122. package/build/typescript/module/native/NativeVoltra.d.ts.map +1 -0
  123. package/build/typescript/module/native/VoltraRNNativeComponent.d.ts +8 -0
  124. package/build/typescript/module/native/VoltraRNNativeComponent.d.ts.map +1 -0
  125. package/build/typescript/module/package.json +1 -0
  126. package/build/typescript/module/preload.d.ts +6 -0
  127. package/build/typescript/module/preload.d.ts.map +1 -0
  128. package/build/typescript/module/types.d.ts +2 -0
  129. package/build/typescript/module/types.d.ts.map +1 -0
  130. package/build/typescript/module/utils/assertRunningOnApple.d.ts +2 -0
  131. package/build/typescript/module/utils/assertRunningOnApple.d.ts.map +1 -0
  132. package/build/{esm/utils/helpers.js → typescript/module/utils/helpers.d.ts} +1 -1
  133. package/build/typescript/module/utils/helpers.d.ts.map +1 -0
  134. package/build/{esm/utils/index.js → typescript/module/utils/index.d.ts} +1 -1
  135. package/build/typescript/module/utils/index.d.ts.map +1 -0
  136. package/build/typescript/module/utils/useUpdateOnHMR.d.ts +5 -0
  137. package/build/typescript/module/utils/useUpdateOnHMR.d.ts.map +1 -0
  138. package/build/typescript/module/widgets/server-credentials.d.ts +5 -0
  139. package/build/typescript/module/widgets/server-credentials.d.ts.map +1 -0
  140. package/build/typescript/module/widgets/widget-api.d.ts +11 -0
  141. package/build/typescript/module/widgets/widget-api.d.ts.map +1 -0
  142. package/expo-plugin/app.plugin.js +3 -0
  143. package/expo-plugin/build/cjs/constants.js +23 -0
  144. package/expo-plugin/build/cjs/constants.js.map +1 -0
  145. package/expo-plugin/build/cjs/index.js +51 -0
  146. package/expo-plugin/build/cjs/index.js.map +1 -0
  147. package/expo-plugin/build/cjs/ios/eas.js +28 -0
  148. package/expo-plugin/build/cjs/ios/eas.js.map +1 -0
  149. package/expo-plugin/build/cjs/ios/entitlements.js +46 -0
  150. package/expo-plugin/build/cjs/ios/entitlements.js.map +1 -0
  151. package/expo-plugin/build/cjs/ios/index.js +39 -0
  152. package/expo-plugin/build/cjs/ios/index.js.map +1 -0
  153. package/expo-plugin/build/cjs/ios/infoPlist.js +51 -0
  154. package/expo-plugin/build/cjs/ios/infoPlist.js.map +1 -0
  155. package/expo-plugin/build/cjs/ios/pushNotifications.js +22 -0
  156. package/expo-plugin/build/cjs/ios/pushNotifications.js.map +1 -0
  157. package/expo-plugin/build/cjs/ios-widget/eas.js +66 -0
  158. package/expo-plugin/build/cjs/ios-widget/eas.js.map +1 -0
  159. package/expo-plugin/build/cjs/ios-widget/files/assets.js +199 -0
  160. package/expo-plugin/build/cjs/ios-widget/files/assets.js.map +1 -0
  161. package/expo-plugin/build/cjs/ios-widget/files/entitlements.js +77 -0
  162. package/expo-plugin/build/cjs/ios-widget/files/entitlements.js.map +1 -0
  163. package/expo-plugin/build/cjs/ios-widget/files/index.js +92 -0
  164. package/expo-plugin/build/cjs/ios-widget/files/index.js.map +1 -0
  165. package/expo-plugin/build/cjs/ios-widget/files/infoPlist.js +91 -0
  166. package/expo-plugin/build/cjs/ios-widget/files/infoPlist.js.map +1 -0
  167. package/expo-plugin/build/cjs/ios-widget/files/swift.js +443 -0
  168. package/expo-plugin/build/cjs/ios-widget/files/swift.js.map +1 -0
  169. package/expo-plugin/build/cjs/ios-widget/fonts.js +151 -0
  170. package/expo-plugin/build/cjs/ios-widget/fonts.js.map +1 -0
  171. package/expo-plugin/build/cjs/ios-widget/index.js +46 -0
  172. package/expo-plugin/build/cjs/ios-widget/index.js.map +1 -0
  173. package/expo-plugin/build/cjs/ios-widget/podfile.js +41 -0
  174. package/expo-plugin/build/cjs/ios-widget/podfile.js.map +1 -0
  175. package/expo-plugin/build/cjs/ios-widget/widgetPlist.js +99 -0
  176. package/expo-plugin/build/cjs/ios-widget/widgetPlist.js.map +1 -0
  177. package/expo-plugin/build/cjs/ios-widget/xcode/buildPhases.js +247 -0
  178. package/expo-plugin/build/cjs/ios-widget/xcode/buildPhases.js.map +1 -0
  179. package/expo-plugin/build/cjs/ios-widget/xcode/configurationList.js +91 -0
  180. package/expo-plugin/build/cjs/ios-widget/xcode/configurationList.js.map +1 -0
  181. package/expo-plugin/build/cjs/ios-widget/xcode/groups.js +79 -0
  182. package/expo-plugin/build/cjs/ios-widget/xcode/groups.js.map +1 -0
  183. package/expo-plugin/build/cjs/ios-widget/xcode/index.js +155 -0
  184. package/expo-plugin/build/cjs/ios-widget/xcode/index.js.map +1 -0
  185. package/expo-plugin/build/cjs/ios-widget/xcode/mainAppSettings.js +71 -0
  186. package/expo-plugin/build/cjs/ios-widget/xcode/mainAppSettings.js.map +1 -0
  187. package/expo-plugin/build/cjs/ios-widget/xcode/productFile.js +74 -0
  188. package/expo-plugin/build/cjs/ios-widget/xcode/productFile.js.map +1 -0
  189. package/expo-plugin/build/cjs/ios-widget/xcode/target.js +113 -0
  190. package/expo-plugin/build/cjs/ios-widget/xcode/target.js.map +1 -0
  191. package/expo-plugin/build/cjs/utils/fileDiscovery.js +120 -0
  192. package/expo-plugin/build/cjs/utils/fileDiscovery.js.map +1 -0
  193. package/expo-plugin/build/cjs/utils/urlScheme.js +40 -0
  194. package/expo-plugin/build/cjs/utils/urlScheme.js.map +1 -0
  195. package/expo-plugin/build/cjs/validation.js +55 -0
  196. package/expo-plugin/build/cjs/validation.js.map +1 -0
  197. package/expo-plugin/build/esm/constants.js +20 -0
  198. package/expo-plugin/build/esm/constants.js.map +1 -0
  199. package/expo-plugin/build/esm/index.js +49 -0
  200. package/expo-plugin/build/esm/index.js.map +1 -0
  201. package/expo-plugin/build/esm/ios/eas.js +24 -0
  202. package/expo-plugin/build/esm/ios/eas.js.map +1 -0
  203. package/expo-plugin/build/esm/ios/entitlements.js +42 -0
  204. package/expo-plugin/build/esm/ios/entitlements.js.map +1 -0
  205. package/expo-plugin/build/esm/ios/index.js +34 -0
  206. package/expo-plugin/build/esm/ios/index.js.map +1 -0
  207. package/expo-plugin/build/esm/ios/infoPlist.js +47 -0
  208. package/expo-plugin/build/esm/ios/infoPlist.js.map +1 -0
  209. package/expo-plugin/build/esm/ios/pushNotifications.js +18 -0
  210. package/expo-plugin/build/esm/ios/pushNotifications.js.map +1 -0
  211. package/expo-plugin/build/esm/ios-widget/eas.js +62 -0
  212. package/expo-plugin/build/esm/ios-widget/eas.js.map +1 -0
  213. package/expo-plugin/build/esm/ios-widget/files/assets.js +163 -0
  214. package/expo-plugin/build/esm/ios-widget/files/assets.js.map +1 -0
  215. package/expo-plugin/build/esm/ios-widget/files/entitlements.js +37 -0
  216. package/expo-plugin/build/esm/ios-widget/files/entitlements.js.map +1 -0
  217. package/expo-plugin/build/esm/ios-widget/files/index.js +55 -0
  218. package/expo-plugin/build/esm/ios-widget/files/index.js.map +1 -0
  219. package/expo-plugin/build/esm/ios-widget/files/infoPlist.js +55 -0
  220. package/expo-plugin/build/esm/ios-widget/files/infoPlist.js.map +1 -0
  221. package/expo-plugin/build/esm/ios-widget/files/swift.js +403 -0
  222. package/expo-plugin/build/esm/ios-widget/files/swift.js.map +1 -0
  223. package/expo-plugin/build/esm/ios-widget/fonts.js +111 -0
  224. package/expo-plugin/build/esm/ios-widget/fonts.js.map +1 -0
  225. package/expo-plugin/build/esm/ios-widget/index.js +42 -0
  226. package/expo-plugin/build/esm/ios-widget/index.js.map +1 -0
  227. package/expo-plugin/build/esm/ios-widget/podfile.js +37 -0
  228. package/expo-plugin/build/esm/ios-widget/podfile.js.map +1 -0
  229. package/expo-plugin/build/esm/ios-widget/widgetPlist.js +92 -0
  230. package/expo-plugin/build/esm/ios-widget/widgetPlist.js.map +1 -0
  231. package/expo-plugin/build/esm/ios-widget/xcode/buildPhases.js +210 -0
  232. package/expo-plugin/build/esm/ios-widget/xcode/buildPhases.js.map +1 -0
  233. package/expo-plugin/build/esm/ios-widget/xcode/configurationList.js +87 -0
  234. package/expo-plugin/build/esm/ios-widget/xcode/configurationList.js.map +1 -0
  235. package/expo-plugin/build/esm/ios-widget/xcode/groups.js +75 -0
  236. package/expo-plugin/build/esm/ios-widget/xcode/groups.js.map +1 -0
  237. package/expo-plugin/build/esm/ios-widget/xcode/index.js +118 -0
  238. package/expo-plugin/build/esm/ios-widget/xcode/index.js.map +1 -0
  239. package/expo-plugin/build/esm/ios-widget/xcode/mainAppSettings.js +68 -0
  240. package/expo-plugin/build/esm/ios-widget/xcode/mainAppSettings.js.map +1 -0
  241. package/expo-plugin/build/esm/ios-widget/xcode/productFile.js +70 -0
  242. package/expo-plugin/build/esm/ios-widget/xcode/productFile.js.map +1 -0
  243. package/expo-plugin/build/esm/ios-widget/xcode/target.js +108 -0
  244. package/expo-plugin/build/esm/ios-widget/xcode/target.js.map +1 -0
  245. package/expo-plugin/build/esm/utils/fileDiscovery.js +83 -0
  246. package/expo-plugin/build/esm/utils/fileDiscovery.js.map +1 -0
  247. package/expo-plugin/build/esm/utils/urlScheme.js +37 -0
  248. package/expo-plugin/build/esm/utils/urlScheme.js.map +1 -0
  249. package/expo-plugin/build/esm/validation.js +51 -0
  250. package/expo-plugin/build/esm/validation.js.map +1 -0
  251. package/expo-plugin/build/types/constants.d.ts +13 -0
  252. package/expo-plugin/build/types/constants.d.ts.map +1 -0
  253. package/expo-plugin/build/types/index.d.ts +10 -0
  254. package/expo-plugin/build/types/index.d.ts.map +1 -0
  255. package/expo-plugin/build/types/ios/eas.d.ts +12 -0
  256. package/expo-plugin/build/types/ios/eas.d.ts.map +1 -0
  257. package/expo-plugin/build/types/ios/entitlements.d.ts +14 -0
  258. package/expo-plugin/build/types/ios/entitlements.d.ts.map +1 -0
  259. package/expo-plugin/build/types/ios/index.d.ts +19 -0
  260. package/expo-plugin/build/types/ios/index.d.ts.map +1 -0
  261. package/expo-plugin/build/types/ios/infoPlist.d.ts +21 -0
  262. package/expo-plugin/build/types/ios/infoPlist.d.ts.map +1 -0
  263. package/expo-plugin/build/types/ios/pushNotifications.d.ts +10 -0
  264. package/expo-plugin/build/types/ios/pushNotifications.d.ts.map +1 -0
  265. package/expo-plugin/build/types/ios-widget/eas.d.ts +15 -0
  266. package/expo-plugin/build/types/ios-widget/eas.d.ts.map +1 -0
  267. package/expo-plugin/build/types/ios-widget/files/assets.d.ts +13 -0
  268. package/expo-plugin/build/types/ios-widget/files/assets.d.ts.map +1 -0
  269. package/expo-plugin/build/types/ios-widget/files/entitlements.d.ts +17 -0
  270. package/expo-plugin/build/types/ios-widget/files/entitlements.d.ts.map +1 -0
  271. package/expo-plugin/build/types/ios-widget/files/index.d.ts +24 -0
  272. package/expo-plugin/build/types/ios-widget/files/index.d.ts.map +1 -0
  273. package/expo-plugin/build/types/ios-widget/files/infoPlist.d.ts +10 -0
  274. package/expo-plugin/build/types/ios-widget/files/infoPlist.d.ts.map +1 -0
  275. package/expo-plugin/build/types/ios-widget/files/swift.d.ts +24 -0
  276. package/expo-plugin/build/types/ios-widget/files/swift.d.ts.map +1 -0
  277. package/expo-plugin/build/types/ios-widget/fonts.d.ts +22 -0
  278. package/expo-plugin/build/types/ios-widget/fonts.d.ts.map +1 -0
  279. package/expo-plugin/build/types/ios-widget/index.d.ts +31 -0
  280. package/expo-plugin/build/types/ios-widget/index.d.ts.map +1 -0
  281. package/expo-plugin/build/types/ios-widget/podfile.d.ts +9 -0
  282. package/expo-plugin/build/types/ios-widget/podfile.d.ts.map +1 -0
  283. package/expo-plugin/build/types/ios-widget/widgetPlist.d.ts +20 -0
  284. package/expo-plugin/build/types/ios-widget/widgetPlist.d.ts.map +1 -0
  285. package/expo-plugin/build/types/ios-widget/xcode/buildPhases.d.ts +25 -0
  286. package/expo-plugin/build/types/ios-widget/xcode/buildPhases.d.ts.map +1 -0
  287. package/expo-plugin/build/types/ios-widget/xcode/configurationList.d.ts +20 -0
  288. package/expo-plugin/build/types/ios-widget/xcode/configurationList.d.ts.map +1 -0
  289. package/expo-plugin/build/types/ios-widget/xcode/groups.d.ts +15 -0
  290. package/expo-plugin/build/types/ios-widget/xcode/groups.d.ts.map +1 -0
  291. package/expo-plugin/build/types/ios-widget/xcode/index.d.ts +20 -0
  292. package/expo-plugin/build/types/ios-widget/xcode/index.d.ts.map +1 -0
  293. package/expo-plugin/build/types/ios-widget/xcode/mainAppSettings.d.ts +15 -0
  294. package/expo-plugin/build/types/ios-widget/xcode/mainAppSettings.d.ts.map +1 -0
  295. package/expo-plugin/build/types/ios-widget/xcode/productFile.d.ts +14 -0
  296. package/expo-plugin/build/types/ios-widget/xcode/productFile.d.ts.map +1 -0
  297. package/expo-plugin/build/types/ios-widget/xcode/target.d.ts +42 -0
  298. package/expo-plugin/build/types/ios-widget/xcode/target.d.ts.map +1 -0
  299. package/expo-plugin/build/types/types.d.ts +74 -0
  300. package/expo-plugin/build/types/types.d.ts.map +1 -0
  301. package/expo-plugin/build/types/utils/fileDiscovery.d.ts +15 -0
  302. package/expo-plugin/build/types/utils/fileDiscovery.d.ts.map +1 -0
  303. package/expo-plugin/build/types/utils/urlScheme.d.ts +10 -0
  304. package/expo-plugin/build/types/utils/urlScheme.d.ts.map +1 -0
  305. package/expo-plugin/build/types/validation.d.ts +4 -0
  306. package/expo-plugin/build/types/validation.d.ts.map +1 -0
  307. package/expo-plugin/jest.config.js +18 -0
  308. package/expo-plugin/src/constants.ts +25 -0
  309. package/expo-plugin/src/index.ts +72 -0
  310. package/expo-plugin/src/ios/eas.ts +33 -0
  311. package/expo-plugin/src/ios/entitlements.ts +59 -0
  312. package/expo-plugin/src/ios/index.ts +47 -0
  313. package/expo-plugin/src/ios/infoPlist.ts +63 -0
  314. package/expo-plugin/src/ios/pushNotifications.ts +22 -0
  315. package/expo-plugin/src/ios-widget/eas.ts +79 -0
  316. package/expo-plugin/src/ios-widget/files/assets.ts +201 -0
  317. package/expo-plugin/src/ios-widget/files/entitlements.ts +48 -0
  318. package/expo-plugin/src/ios-widget/files/index.ts +74 -0
  319. package/expo-plugin/src/ios-widget/files/infoPlist.ts +57 -0
  320. package/expo-plugin/src/ios-widget/files/swift.node.test.ts +22 -0
  321. package/expo-plugin/src/ios-widget/files/swift.ts +476 -0
  322. package/expo-plugin/src/ios-widget/fonts.ts +132 -0
  323. package/expo-plugin/src/ios-widget/index.ts +73 -0
  324. package/expo-plugin/src/ios-widget/podfile.ts +44 -0
  325. package/expo-plugin/src/ios-widget/widgetPlist.ts +115 -0
  326. package/expo-plugin/src/ios-widget/xcode/buildPhases.ts +301 -0
  327. package/expo-plugin/src/ios-widget/xcode/configurationList.ts +127 -0
  328. package/expo-plugin/src/ios-widget/xcode/groups.ts +101 -0
  329. package/expo-plugin/src/ios-widget/xcode/index.ts +149 -0
  330. package/expo-plugin/src/ios-widget/xcode/mainAppSettings.ts +95 -0
  331. package/expo-plugin/src/ios-widget/xcode/productFile.ts +91 -0
  332. package/expo-plugin/src/ios-widget/xcode/target.ts +148 -0
  333. package/expo-plugin/src/types.ts +89 -0
  334. package/expo-plugin/src/utils/fileDiscovery.ts +96 -0
  335. package/expo-plugin/src/utils/urlScheme.ts +45 -0
  336. package/expo-plugin/src/validation.node.test.ts +19 -0
  337. package/expo-plugin/src/validation.ts +63 -0
  338. package/expo-plugin/tsconfig.base.json +17 -0
  339. package/expo-plugin/tsconfig.cjs.json +9 -0
  340. package/expo-plugin/tsconfig.esm.json +9 -0
  341. package/expo-plugin/tsconfig.jest.json +8 -0
  342. package/expo-plugin/tsconfig.typecheck.json +12 -0
  343. package/expo-plugin/tsconfig.types.json +10 -0
  344. package/ios/Package.swift +68 -0
  345. package/ios/Tests/JSGradientParserTests.swift +201 -0
  346. package/ios/Tests/VoltraSharedTests/SmokeTests.swift +8 -0
  347. package/ios/VoltraWidget.podspec +30 -0
  348. package/ios/app/NativeVoltra.h +5 -0
  349. package/ios/app/NativeVoltra.mm +211 -0
  350. package/ios/app/VoltraActivity.swift +5 -0
  351. package/ios/app/VoltraImagePreload.swift +154 -0
  352. package/ios/app/VoltraLiveActivityManager.swift +228 -0
  353. package/ios/app/VoltraLiveActivityService.swift +306 -0
  354. package/ios/app/VoltraModule.swift +215 -0
  355. package/ios/app/VoltraModuleImpl.swift +331 -0
  356. package/ios/app/VoltraOptions.swift +27 -0
  357. package/ios/app/VoltraViewComponentView.h +10 -0
  358. package/ios/app/VoltraViewComponentView.mm +67 -0
  359. package/ios/app/VoltraViewRoot.swift +63 -0
  360. package/ios/app/VoltraWidgetService.swift +154 -0
  361. package/ios/shared/BrotliCompression.swift +81 -0
  362. package/ios/shared/ComponentTypeID.swift +117 -0
  363. package/ios/shared/Data+hexString.swift +8 -0
  364. package/ios/shared/Date+toTimerInterval.swift +25 -0
  365. package/ios/shared/JSONValue.swift +128 -0
  366. package/ios/shared/ShortNames.swift +180 -0
  367. package/ios/shared/VoltraAttributes.swift +58 -0
  368. package/ios/shared/VoltraConfig.swift +18 -0
  369. package/ios/shared/VoltraConstants.swift +45 -0
  370. package/ios/shared/VoltraElement.swift +153 -0
  371. package/ios/shared/VoltraEvent.swift +72 -0
  372. package/ios/shared/VoltraEventBus.swift +80 -0
  373. package/ios/shared/VoltraImageStore.swift +119 -0
  374. package/ios/shared/VoltraInitialStateLocale.swift +54 -0
  375. package/ios/shared/VoltraInteractionIntent.swift +39 -0
  376. package/ios/shared/VoltraKeychainHelper.swift +178 -0
  377. package/ios/shared/VoltraLiveActivityPayload.swift +113 -0
  378. package/ios/shared/VoltraLogger.swift +30 -0
  379. package/ios/shared/VoltraNode.swift +194 -0
  380. package/ios/shared/VoltraPayloadMigrator.swift +63 -0
  381. package/ios/shared/VoltraPersistentEventQueue.swift +67 -0
  382. package/ios/shared/VoltraRefreshIntent.swift +29 -0
  383. package/ios/shared/VoltraRegion.swift +37 -0
  384. package/ios/shared/VoltraWidgetDefaults.swift +114 -0
  385. package/ios/shared/VoltraWidgetServerFetcher.swift +166 -0
  386. package/ios/target/VoltraHomeWidget.swift +508 -0
  387. package/ios/target/VoltraWidget.swift +158 -0
  388. package/ios/ui/Extensions/View.modifiers.swift +28 -0
  389. package/ios/ui/Extensions/VoltraNode+Parameters.swift +18 -0
  390. package/ios/ui/Generated/Parameters/ButtonParameters.swift +15 -0
  391. package/ios/ui/Generated/Parameters/ChartParameters.swift +33 -0
  392. package/ios/ui/Generated/Parameters/CircularProgressViewParameters.swift +59 -0
  393. package/ios/ui/Generated/Parameters/ComponentParameters.swift +12 -0
  394. package/ios/ui/Generated/Parameters/DividerParameters.swift +12 -0
  395. package/ios/ui/Generated/Parameters/GaugeParameters.swift +54 -0
  396. package/ios/ui/Generated/Parameters/GlassContainerParameters.swift +15 -0
  397. package/ios/ui/Generated/Parameters/GroupBoxParameters.swift +12 -0
  398. package/ios/ui/Generated/Parameters/HStackParameters.swift +34 -0
  399. package/ios/ui/Generated/Parameters/ImageParameters.swift +29 -0
  400. package/ios/ui/Generated/Parameters/LabelParameters.swift +18 -0
  401. package/ios/ui/Generated/Parameters/LinearGradientParameters.swift +27 -0
  402. package/ios/ui/Generated/Parameters/LinearProgressViewParameters.swift +64 -0
  403. package/ios/ui/Generated/Parameters/LinkParameters.swift +15 -0
  404. package/ios/ui/Generated/Parameters/MaskParameters.swift +12 -0
  405. package/ios/ui/Generated/Parameters/SpacerParameters.swift +15 -0
  406. package/ios/ui/Generated/Parameters/SymbolParameters.swift +59 -0
  407. package/ios/ui/Generated/Parameters/TextParameters.swift +18 -0
  408. package/ios/ui/Generated/Parameters/TimerParameters.swift +54 -0
  409. package/ios/ui/Generated/Parameters/ToggleParameters.swift +24 -0
  410. package/ios/ui/Generated/Parameters/VStackParameters.swift +34 -0
  411. package/ios/ui/Generated/Parameters/ViewParameters.swift +12 -0
  412. package/ios/ui/Generated/Parameters/ZStackParameters.swift +15 -0
  413. package/ios/ui/Helpers/VoltraDeepLinkResolver.swift +43 -0
  414. package/ios/ui/Helpers/VoltraProgressDriver.swift +52 -0
  415. package/ios/ui/Layout/FlexContainerHelper.swift +114 -0
  416. package/ios/ui/Layout/VoltraFlexStackLayout.swift +417 -0
  417. package/ios/ui/Protocols/VoltraView.swift +29 -0
  418. package/ios/ui/Style/BackgroundValue.swift +27 -0
  419. package/ios/ui/Style/CompositeStyle.swift +81 -0
  420. package/ios/ui/Style/DecorationStyle.swift +207 -0
  421. package/ios/ui/Style/FlexEnvironment.swift +35 -0
  422. package/ios/ui/Style/FontVariant.swift +4 -0
  423. package/ios/ui/Style/GlassEffect.swift +6 -0
  424. package/ios/ui/Style/JSColorParser.swift +517 -0
  425. package/ios/ui/Style/JSGradientParser.swift +674 -0
  426. package/ios/ui/Style/JSStyleParser.swift +223 -0
  427. package/ios/ui/Style/LayoutStyle.swift +184 -0
  428. package/ios/ui/Style/Overflow.swift +4 -0
  429. package/ios/ui/Style/RenderingStyle.swift +33 -0
  430. package/ios/ui/Style/StyleConverter.swift +202 -0
  431. package/ios/ui/Style/TextDecoration.swift +6 -0
  432. package/ios/ui/Style/TextStyle.swift +50 -0
  433. package/ios/ui/Style/View+applyStyle.swift +38 -0
  434. package/ios/ui/Views/VoltraButton.swift +57 -0
  435. package/ios/ui/Views/VoltraChart.swift +840 -0
  436. package/ios/ui/Views/VoltraCircularProgressView.swift +103 -0
  437. package/ios/ui/Views/VoltraDivider.swift +16 -0
  438. package/ios/ui/Views/VoltraFlexView.swift +33 -0
  439. package/ios/ui/Views/VoltraGauge.swift +65 -0
  440. package/ios/ui/Views/VoltraGlassContainer.swift +29 -0
  441. package/ios/ui/Views/VoltraGroupBox.swift +26 -0
  442. package/ios/ui/Views/VoltraHStack.swift +70 -0
  443. package/ios/ui/Views/VoltraImage.swift +109 -0
  444. package/ios/ui/Views/VoltraLabel.swift +24 -0
  445. package/ios/ui/Views/VoltraLinearGradient.swift +115 -0
  446. package/ios/ui/Views/VoltraLinearProgressView.swift +118 -0
  447. package/ios/ui/Views/VoltraLink.swift +25 -0
  448. package/ios/ui/Views/VoltraMask.swift +23 -0
  449. package/ios/ui/Views/VoltraSpacer.swift +16 -0
  450. package/ios/ui/Views/VoltraSymbol.swift +160 -0
  451. package/ios/ui/Views/VoltraText.swift +87 -0
  452. package/ios/ui/Views/VoltraTimer.swift +131 -0
  453. package/ios/ui/Views/VoltraToggle.swift +39 -0
  454. package/ios/ui/Views/VoltraVStack.swift +68 -0
  455. package/ios/ui/Views/VoltraZStack.swift +33 -0
  456. package/ios/ui/Voltra.swift +86 -0
  457. package/package.json +105 -19
  458. package/src/VoltraModule.ts +2 -0
  459. package/src/components/VoltraLiveActivityPreview.tsx +29 -0
  460. package/src/components/VoltraView.tsx +49 -0
  461. package/src/components/VoltraWidgetPreview.tsx +38 -0
  462. package/src/events.ts +70 -0
  463. package/src/helpers.ts +21 -0
  464. package/src/index.ts +52 -0
  465. package/src/live-activity/api.ts +224 -0
  466. package/src/logger.ts +35 -0
  467. package/src/native/NativeVoltra.ts +118 -0
  468. package/src/native/VoltraRNNativeComponent.ts +9 -0
  469. package/src/preload.ts +50 -0
  470. package/src/types.ts +12 -0
  471. package/src/utils/assertRunningOnApple.ts +10 -0
  472. package/src/utils/helpers.ts +1 -0
  473. package/src/utils/index.ts +2 -0
  474. package/src/utils/useUpdateOnHMR.ts +25 -0
  475. package/src/widgets/server-credentials.ts +16 -0
  476. package/src/widgets/widget-api.ts +65 -0
  477. package/build/cjs/VoltraModule.js +0 -6
  478. package/build/cjs/VoltraModule.js.map +0 -1
  479. package/build/cjs/components/VoltraLiveActivityPreview.js +0 -20
  480. package/build/cjs/components/VoltraLiveActivityPreview.js.map +0 -1
  481. package/build/cjs/components/VoltraView.js +0 -37
  482. package/build/cjs/components/VoltraView.js.map +0 -1
  483. package/build/cjs/components/VoltraWidgetPreview.js +0 -26
  484. package/build/cjs/components/VoltraWidgetPreview.js.map +0 -1
  485. package/build/cjs/events.js +0 -19
  486. package/build/cjs/events.js.map +0 -1
  487. package/build/cjs/helpers.js +0 -30
  488. package/build/cjs/helpers.js.map +0 -1
  489. package/build/cjs/index.js +0 -49
  490. package/build/cjs/index.js.map +0 -1
  491. package/build/cjs/live-activity/api.js +0 -158
  492. package/build/cjs/live-activity/api.js.map +0 -1
  493. package/build/cjs/logger.js +0 -36
  494. package/build/cjs/logger.js.map +0 -1
  495. package/build/cjs/preload.js +0 -54
  496. package/build/cjs/preload.js.map +0 -1
  497. package/build/cjs/utils/assertRunningOnApple.js +0 -13
  498. package/build/cjs/utils/assertRunningOnApple.js.map +0 -1
  499. package/build/cjs/utils/helpers.js +0 -7
  500. package/build/cjs/utils/helpers.js.map +0 -1
  501. package/build/cjs/utils/index.js +0 -19
  502. package/build/cjs/utils/index.js.map +0 -1
  503. package/build/cjs/utils/useUpdateOnHMR.js +0 -22
  504. package/build/cjs/utils/useUpdateOnHMR.js.map +0 -1
  505. package/build/cjs/widgets/server-credentials.js +0 -18
  506. package/build/cjs/widgets/server-credentials.js.map +0 -1
  507. package/build/cjs/widgets/widget-api.js +0 -59
  508. package/build/cjs/widgets/widget-api.js.map +0 -1
  509. package/build/esm/VoltraModule.js +0 -4
  510. package/build/esm/VoltraModule.js.map +0 -1
  511. package/build/esm/components/VoltraLiveActivityPreview.js +0 -17
  512. package/build/esm/components/VoltraLiveActivityPreview.js.map +0 -1
  513. package/build/esm/components/VoltraView.js +0 -34
  514. package/build/esm/components/VoltraView.js.map +0 -1
  515. package/build/esm/components/VoltraWidgetPreview.js +0 -23
  516. package/build/esm/components/VoltraWidgetPreview.js.map +0 -1
  517. package/build/esm/events.js +0 -13
  518. package/build/esm/events.js.map +0 -1
  519. package/build/esm/helpers.js +0 -23
  520. package/build/esm/helpers.js.map +0 -1
  521. package/build/esm/index.js +0 -10
  522. package/build/esm/index.js.map +0 -1
  523. package/build/esm/live-activity/api.js +0 -146
  524. package/build/esm/live-activity/api.js.map +0 -1
  525. package/build/esm/logger.js +0 -33
  526. package/build/esm/logger.js.map +0 -1
  527. package/build/esm/preload.js +0 -46
  528. package/build/esm/preload.js.map +0 -1
  529. package/build/esm/utils/assertRunningOnApple.js +0 -9
  530. package/build/esm/utils/assertRunningOnApple.js.map +0 -1
  531. package/build/esm/utils/helpers.js.map +0 -1
  532. package/build/esm/utils/index.js.map +0 -1
  533. package/build/esm/utils/useUpdateOnHMR.js +0 -18
  534. package/build/esm/utils/useUpdateOnHMR.js.map +0 -1
  535. package/build/esm/widgets/server-credentials.js +0 -11
  536. package/build/esm/widgets/server-credentials.js.map +0 -1
  537. package/build/esm/widgets/widget-api.js +0 -47
  538. package/build/esm/widgets/widget-api.js.map +0 -1
  539. package/build/types/VoltraModule.d.ts +0 -44
  540. package/build/types/VoltraModule.d.ts.map +0 -1
  541. package/build/types/components/VoltraLiveActivityPreview.d.ts.map +0 -1
  542. package/build/types/components/VoltraView.d.ts.map +0 -1
  543. package/build/types/components/VoltraWidgetPreview.d.ts.map +0 -1
  544. package/build/types/events.d.ts.map +0 -1
  545. package/build/types/helpers.d.ts.map +0 -1
  546. package/build/types/index.d.ts.map +0 -1
  547. package/build/types/live-activity/api.d.ts.map +0 -1
  548. package/build/types/logger.d.ts.map +0 -1
  549. package/build/types/preload.d.ts.map +0 -1
  550. package/build/types/types.d.ts.map +0 -1
  551. package/build/types/utils/assertRunningOnApple.d.ts.map +0 -1
  552. package/build/types/utils/helpers.d.ts.map +0 -1
  553. package/build/types/utils/index.d.ts.map +0 -1
  554. package/build/types/utils/useUpdateOnHMR.d.ts.map +0 -1
  555. package/build/types/widgets/server-credentials.d.ts.map +0 -1
  556. package/build/types/widgets/widget-api.d.ts.map +0 -1
  557. /package/build/{types → typescript/commonjs}/components/VoltraLiveActivityPreview.d.ts +0 -0
  558. /package/build/{types → typescript/commonjs}/components/VoltraView.d.ts +0 -0
  559. /package/build/{types → typescript/commonjs}/components/VoltraWidgetPreview.d.ts +0 -0
  560. /package/build/{types → typescript/commonjs}/events.d.ts +0 -0
  561. /package/build/{types → typescript/commonjs}/helpers.d.ts +0 -0
  562. /package/build/{types → typescript/commonjs}/live-activity/api.d.ts +0 -0
  563. /package/build/{types → typescript/commonjs}/logger.d.ts +0 -0
  564. /package/build/{types → typescript/commonjs}/preload.d.ts +0 -0
  565. /package/build/{types → typescript/commonjs}/types.d.ts +0 -0
  566. /package/build/{types → typescript/commonjs}/utils/assertRunningOnApple.d.ts +0 -0
  567. /package/build/{types → typescript/commonjs}/utils/helpers.d.ts +0 -0
  568. /package/build/{types → typescript/commonjs}/utils/index.d.ts +0 -0
  569. /package/build/{types → typescript/commonjs}/utils/useUpdateOnHMR.d.ts +0 -0
  570. /package/build/{types → typescript/commonjs}/widgets/server-credentials.d.ts +0 -0
  571. /package/build/{types → typescript/commonjs}/widgets/widget-api.d.ts +0 -0
  572. /package/{build → expo-plugin/build}/cjs/package.json +0 -0
  573. /package/{build → expo-plugin/build}/cjs/types.js +0 -0
  574. /package/{build → expo-plugin/build}/cjs/types.js.map +0 -0
  575. /package/{build → expo-plugin/build}/esm/package.json +0 -0
  576. /package/{build → expo-plugin/build}/esm/types.js +0 -0
  577. /package/{build → expo-plugin/build}/esm/types.js.map +0 -0
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.generateWidgetExtensionFiles = void 0;
37
+ const config_plugins_1 = require("@expo/config-plugins");
38
+ const fs = __importStar(require("fs"));
39
+ const path = __importStar(require("path"));
40
+ const assets_1 = require("./assets");
41
+ const entitlements_1 = require("./entitlements");
42
+ const infoPlist_1 = require("./infoPlist");
43
+ const swift_1 = require("./swift");
44
+ /**
45
+ * Plugin step that generates all widget extension files.
46
+ *
47
+ * This creates:
48
+ * - Info.plist (required extension manifest)
49
+ * - Assets.xcassets/ (asset catalog with user images)
50
+ * - VoltraWidgetBundle.swift (widget bundle definition)
51
+ * - VoltraWidgetInitialStates.swift (pre-rendered widget states)
52
+ * - {targetName}.entitlements (entitlements file)
53
+ *
54
+ * This should run before configureXcodeProject so the files exist when Xcode project is configured.
55
+ */
56
+ const generateWidgetExtensionFiles = (config, props) => {
57
+ const { targetName, widgets, groupIdentifier, keychainGroup, version, buildNumber } = props;
58
+ return (0, config_plugins_1.withDangerousMod)(config, [
59
+ 'ios',
60
+ async (config) => {
61
+ if (config.modRequest.introspect) {
62
+ return config;
63
+ }
64
+ const { platformProjectRoot, projectRoot } = config.modRequest;
65
+ const targetPath = path.join(platformProjectRoot, targetName);
66
+ // Ensure target directory exists
67
+ if (!fs.existsSync(targetPath)) {
68
+ fs.mkdirSync(targetPath, { recursive: true });
69
+ }
70
+ // Generate Info.plist
71
+ (0, infoPlist_1.generateInfoPlist)(targetPath, targetName, version, buildNumber);
72
+ // Generate Assets.xcassets and copy user images
73
+ (0, assets_1.generateAssets)({ targetPath });
74
+ // Generate Swift files (widget bundle, initial states)
75
+ await (0, swift_1.generateSwiftFiles)({
76
+ targetPath,
77
+ projectRoot,
78
+ widgets,
79
+ });
80
+ // Generate entitlements file (may be empty if no groupIdentifier or keychainGroup)
81
+ (0, entitlements_1.generateEntitlements)({
82
+ targetPath,
83
+ targetName,
84
+ groupIdentifier,
85
+ keychainGroup,
86
+ });
87
+ return config;
88
+ },
89
+ ]);
90
+ };
91
+ exports.generateWidgetExtensionFiles = generateWidgetExtensionFiles;
92
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ios-widget/files/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAAqE;AACrE,uCAAwB;AACxB,2CAA4B;AAG5B,qCAAyC;AACzC,iDAAqD;AACrD,2CAA+C;AAC/C,mCAA4C;AAW5C;;;;;;;;;;;GAWG;AACI,MAAM,4BAA4B,GAAoD,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;IAC7G,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IAE3F,OAAO,IAAA,iCAAgB,EAAC,MAAM,EAAE;QAC9B,KAAK;QACL,KAAK,EAAE,MAAM,EAAE,EAAE;YACf,IAAI,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC;gBACjC,OAAO,MAAM,CAAA;YACf,CAAC;YAED,MAAM,EAAE,mBAAmB,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,UAAU,CAAA;YAC9D,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAA;YAE7D,iCAAiC;YACjC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC/B,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;YAC/C,CAAC;YAED,sBAAsB;YACtB,IAAA,6BAAiB,EAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC,CAAA;YAE/D,gDAAgD;YAChD,IAAA,uBAAc,EAAC,EAAE,UAAU,EAAE,CAAC,CAAA;YAE9B,uDAAuD;YACvD,MAAM,IAAA,0BAAkB,EAAC;gBACvB,UAAU;gBACV,WAAW;gBACX,OAAO;aACR,CAAC,CAAA;YAEF,mFAAmF;YACnF,IAAA,mCAAoB,EAAC;gBACnB,UAAU;gBACV,UAAU;gBACV,eAAe;gBACf,aAAa;aACd,CAAC,CAAA;YAEF,OAAO,MAAM,CAAA;QACf,CAAC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AA1CY,QAAA,4BAA4B,gCA0CxC"}
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.generateInfoPlist = generateInfoPlist;
37
+ const fs = __importStar(require("fs"));
38
+ const path = __importStar(require("path"));
39
+ const expo_plugin_1 = require("@use-voltra/expo-plugin");
40
+ /**
41
+ * Generates the Info.plist content for a WidgetKit extension.
42
+ *
43
+ * This includes version information and the required WidgetKit extension point.
44
+ * Version keys are written directly to the plist following the Expo pattern.
45
+ */
46
+ function generateInfoPlistContent(targetName, version, buildNumber) {
47
+ return `<?xml version="1.0" encoding="UTF-8"?>
48
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
49
+ <plist version="1.0">
50
+ <dict>
51
+ <key>CFBundleDevelopmentRegion</key>
52
+ <string>$(DEVELOPMENT_LANGUAGE)</string>
53
+ <key>CFBundleDisplayName</key>
54
+ <string>${targetName}</string>
55
+ <key>CFBundleExecutable</key>
56
+ <string>$(EXECUTABLE_NAME)</string>
57
+ <key>CFBundleIdentifier</key>
58
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
59
+ <key>CFBundleInfoDictionaryVersion</key>
60
+ <string>6.0</string>
61
+ <key>CFBundleName</key>
62
+ <string>$(PRODUCT_NAME)</string>
63
+ <key>CFBundlePackageType</key>
64
+ <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
65
+ <key>CFBundleShortVersionString</key>
66
+ <string>${version}</string>
67
+ <key>CFBundleVersion</key>
68
+ <string>${buildNumber}</string>
69
+ <key>NSExtension</key>
70
+ <dict>
71
+ <key>NSExtensionPointIdentifier</key>
72
+ <string>com.apple.widgetkit-extension</string>
73
+ </dict>
74
+ </dict>
75
+ </plist>
76
+ `;
77
+ }
78
+ /**
79
+ * Generates the Info.plist file for the widget extension.
80
+ *
81
+ * @param targetPath - Path to the widget extension target directory
82
+ * @param targetName - The widget extension target name (used for CFBundleDisplayName)
83
+ * @param version - The app version (CFBundleShortVersionString)
84
+ * @param buildNumber - The build number (CFBundleVersion)
85
+ */
86
+ function generateInfoPlist(targetPath, targetName, version, buildNumber) {
87
+ const infoPlistPath = path.join(targetPath, 'Info.plist');
88
+ fs.writeFileSync(infoPlistPath, generateInfoPlistContent(targetName, version, buildNumber));
89
+ expo_plugin_1.logger.info('Generated Info.plist');
90
+ }
91
+ //# sourceMappingURL=infoPlist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infoPlist.js","sourceRoot":"","sources":["../../../../src/ios-widget/files/infoPlist.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,8CAIC;AAxDD,uCAAwB;AACxB,2CAA4B;AAE5B,yDAAgD;AAEhD;;;;;GAKG;AACH,SAAS,wBAAwB,CAAC,UAAkB,EAAE,OAAe,EAAE,WAAmB;IACxF,OAAO;;;;;;;WAOE,UAAU;;;;;;;;;;;;WAYV,OAAO;;WAEP,WAAW;;;;;;;;CAQrB,CAAA;AACD,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAAC,UAAkB,EAAE,UAAkB,EAAE,OAAe,EAAE,WAAmB;IAC5G,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAA;IACzD,EAAE,CAAC,aAAa,CAAC,aAAa,EAAE,wBAAwB,CAAC,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAA;IAC3F,oBAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA;AACrC,CAAC"}
@@ -0,0 +1,443 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.__test__ = void 0;
40
+ exports.generateSwiftFiles = generateSwiftFiles;
41
+ const dedent_1 = __importDefault(require("dedent"));
42
+ const fs = __importStar(require("fs"));
43
+ const path = __importStar(require("path"));
44
+ const expo_plugin_1 = require("@use-voltra/expo-plugin");
45
+ const constants_1 = require("../../constants");
46
+ const fileDiscovery_1 = require("../../utils/fileDiscovery");
47
+ // ============================================================================
48
+ // Main Function
49
+ // ============================================================================
50
+ /**
51
+ * Generates all Swift files for the widget extension.
52
+ *
53
+ * This creates:
54
+ * - VoltraWidgetInitialStates.swift (pre-rendered widget states)
55
+ * - VoltraWidgetBundle.swift (widget bundle definition)
56
+ */
57
+ async function generateSwiftFiles(options) {
58
+ const { targetPath, projectRoot, widgets } = options;
59
+ // Dynamic import keeps the plugin CommonJS-compatible while resolving the current package entry.
60
+ const serverModuleId = '@use-voltra/ios/server';
61
+ const { renderWidgetToString } = (await Promise.resolve(`${serverModuleId}`).then(s => __importStar(require(s))));
62
+ // Prerender widget initial states if any widgets have initialStatePath configured
63
+ const prerenderedStates = await (0, expo_plugin_1.prerenderWidgetState)(widgets || [], projectRoot, renderWidgetToString);
64
+ syncVoltraWidgetGalleryStrings(targetPath, widgets);
65
+ // Generate the initial states Swift file
66
+ const initialStatesContent = generateInitialStatesSwift(prerenderedStates);
67
+ const initialStatesPath = path.join(targetPath, 'VoltraWidgetInitialStates.swift');
68
+ fs.writeFileSync(initialStatesPath, initialStatesContent);
69
+ expo_plugin_1.logger.info(`Generated VoltraWidgetInitialStates.swift with ${prerenderedStates.size} widget(s) (localized initial states where configured)`);
70
+ // Generate the widget bundle Swift file
71
+ const widgetBundleContent = widgets && widgets.length > 0 ? generateWidgetBundleSwift(widgets) : generateDefaultWidgetBundleSwift();
72
+ const widgetBundlePath = path.join(targetPath, 'VoltraWidgetBundle.swift');
73
+ fs.writeFileSync(widgetBundlePath, widgetBundleContent);
74
+ expo_plugin_1.logger.info(`Generated VoltraWidgetBundle.swift with ${widgets?.length ?? 0} home screen widgets`);
75
+ }
76
+ const GENERATED_INITIAL_STATE_LOCALE_HELPER = (0, dedent_1.default) `
77
+ private enum VoltraGeneratedInitialStateLocale {
78
+ static func pickJson(from perLocale: [String: String], preferredLanguages: [String]) -> String? {
79
+ let entries = perLocale.filter { !$0.value.isEmpty }
80
+ if entries.isEmpty {
81
+ return nil
82
+ }
83
+
84
+ func normalize(_ tag: String) -> String {
85
+ tag.trimmingCharacters(in: .whitespacesAndNewlines)
86
+ .lowercased()
87
+ .replacingOccurrences(of: "_", with: "-")
88
+ }
89
+
90
+ var byNorm: [String: String] = [:]
91
+ for (k, v) in entries {
92
+ byNorm[normalize(k)] = v
93
+ }
94
+
95
+ for pref in preferredLanguages {
96
+ let n = normalize(pref)
97
+ if let direct = byNorm[n] {
98
+ return direct
99
+ }
100
+ let lang = n.split(separator: "-").first.map(String.init) ?? n
101
+ for (key, val) in entries {
102
+ let kn = normalize(key)
103
+ let keyLang = kn.split(separator: "-").first.map(String.init) ?? kn
104
+ if keyLang == lang {
105
+ return val
106
+ }
107
+ }
108
+ }
109
+
110
+ if let en = byNorm["en"] {
111
+ return en
112
+ }
113
+ if let englishFamily = entries.keys.sorted().first(where: {
114
+ let normalized = normalize($0)
115
+ return normalized == "en" || normalized.hasPrefix("en-")
116
+ }) {
117
+ return entries[englishFamily]
118
+ }
119
+ if let def = byNorm["__default"] {
120
+ return def
121
+ }
122
+
123
+ let sorted = entries.keys.sorted()
124
+ guard let firstKey = sorted.first else {
125
+ return nil
126
+ }
127
+ return entries[firstKey]
128
+ }
129
+
130
+ static func preferredLanguageTags() -> [String] {
131
+ Locale.preferredLanguages
132
+ }
133
+ }
134
+ `;
135
+ // ============================================================================
136
+ // Widget gallery localization: *.lproj/VoltraWidgets.strings + LocalizedStringResource
137
+ //
138
+ // We use classic .strings tables (not .xcstrings): the `xcode` npm library assigns
139
+ // unknown lastKnownFileType to .xcstrings, so Xcode may not treat them as string tables
140
+ // and lookups fall back to English defaultValue.
141
+ //
142
+ // LocalizedStringResource is still appropriate for extensions (deferred resolution).
143
+ // https://developer.apple.com/documentation/foundation/localizedstringresource
144
+ // ============================================================================
145
+ function escapeForSwiftStringLiteral(s) {
146
+ return s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r');
147
+ }
148
+ function escapeDotStringsValue(s) {
149
+ return escapeForSwiftStringLiteral(s);
150
+ }
151
+ function collectGalleryStringsByLocale(widgets) {
152
+ const byLocale = new Map();
153
+ const add = (locale, key, value) => {
154
+ let bucket = byLocale.get(locale);
155
+ if (!bucket) {
156
+ bucket = {};
157
+ byLocale.set(locale, bucket);
158
+ }
159
+ bucket[key] = value;
160
+ };
161
+ for (const w of widgets) {
162
+ if ((0, expo_plugin_1.isWidgetLocalizedMap)(w.displayName)) {
163
+ const key = `voltra_widget_${w.id}_displayName`;
164
+ for (const [locale, val] of Object.entries(w.displayName)) {
165
+ if (typeof val === 'string' && val.trim()) {
166
+ add(locale, key, val);
167
+ }
168
+ }
169
+ }
170
+ if ((0, expo_plugin_1.isWidgetLocalizedMap)(w.description)) {
171
+ const key = `voltra_widget_${w.id}_description`;
172
+ for (const [locale, val] of Object.entries(w.description)) {
173
+ if (typeof val === 'string' && val.trim()) {
174
+ add(locale, key, val);
175
+ }
176
+ }
177
+ }
178
+ }
179
+ return byLocale;
180
+ }
181
+ function formatVoltraWidgetsStringsFile(entries) {
182
+ const sortedKeys = Object.keys(entries).sort();
183
+ const lines = sortedKeys.map((k) => `"${k}" = "${escapeDotStringsValue(entries[k])}";`);
184
+ return `/* Voltra widget gallery strings (auto-generated) */\n${lines.join('\n')}\n`;
185
+ }
186
+ /** Remove generated gallery strings and obsolete string catalog before rewriting. */
187
+ function clearVoltraWidgetGalleryStringArtifacts(targetPath) {
188
+ const catalogPath = path.join(targetPath, 'VoltraWidgets.xcstrings');
189
+ if (fs.existsSync(catalogPath)) {
190
+ fs.unlinkSync(catalogPath);
191
+ }
192
+ if (!fs.existsSync(targetPath)) {
193
+ return;
194
+ }
195
+ for (const entry of fs.readdirSync(targetPath)) {
196
+ if (!entry.endsWith('.lproj')) {
197
+ continue;
198
+ }
199
+ const stringsPath = path.join(targetPath, entry, fileDiscovery_1.VOLTRA_WIDGET_STRINGS_BASENAME);
200
+ if (fs.existsSync(stringsPath)) {
201
+ fs.unlinkSync(stringsPath);
202
+ }
203
+ const dirPath = path.join(targetPath, entry);
204
+ try {
205
+ if (fs.existsSync(dirPath) && fs.readdirSync(dirPath).length === 0) {
206
+ fs.rmdirSync(dirPath);
207
+ }
208
+ }
209
+ catch {
210
+ /* ignore */
211
+ }
212
+ }
213
+ }
214
+ /**
215
+ * Writes `<locale>.lproj/VoltraWidgets.strings` for locale-map gallery labels.
216
+ */
217
+ function syncVoltraWidgetGalleryStrings(targetPath, widgets) {
218
+ const list = widgets ?? [];
219
+ clearVoltraWidgetGalleryStringArtifacts(targetPath);
220
+ if (list.length === 0) {
221
+ return;
222
+ }
223
+ const byLocale = collectGalleryStringsByLocale(list);
224
+ if (byLocale.size === 0) {
225
+ return;
226
+ }
227
+ for (const [locale, kv] of byLocale) {
228
+ const lproj = path.join(targetPath, `${locale}.lproj`);
229
+ fs.mkdirSync(lproj, { recursive: true });
230
+ fs.writeFileSync(path.join(lproj, fileDiscovery_1.VOLTRA_WIDGET_STRINGS_BASENAME), formatVoltraWidgetsStringsFile(kv), 'utf8');
231
+ }
232
+ }
233
+ function widgetUsesGalleryLocalization(widget) {
234
+ return (0, expo_plugin_1.isWidgetLocalizedMap)(widget.displayName) || (0, expo_plugin_1.isWidgetLocalizedMap)(widget.description);
235
+ }
236
+ /**
237
+ * Widget gallery title / description: deferred lookup via LocalizedStringResource when using a locale map
238
+ * (recommended for extensions); plain Text for single-string config.
239
+ */
240
+ function iosWidgetGalleryLabelSwiftExpr(widgetId, field, label) {
241
+ if (!(0, expo_plugin_1.isWidgetLocalizedMap)(label)) {
242
+ return `Text("${escapeForSwiftStringLiteral(label)}")`;
243
+ }
244
+ const key = `voltra_widget_${widgetId}_${field}`;
245
+ const defaultEnglish = escapeForSwiftStringLiteral((0, expo_plugin_1.widgetLabelEnglish)(label));
246
+ return `Text(LocalizedStringResource("${key}", defaultValue: String.LocalizationValue("${defaultEnglish}"), table: "VoltraWidgets"))`;
247
+ }
248
+ /**
249
+ * Generates Swift code for a single widget struct
250
+ */
251
+ function generateWidgetStruct(widget) {
252
+ const families = widget.supportedFamilies ?? constants_1.DEFAULT_WIDGET_FAMILIES;
253
+ const familiesSwift = families.map((f) => constants_1.WIDGET_FAMILY_MAP[f]).join(', ');
254
+ // Sanitize the widget id for use as a Swift identifier
255
+ const structName = `VoltraWidget_${widget.id}`;
256
+ const displayNameExpr = iosWidgetGalleryLabelSwiftExpr(widget.id, 'displayName', widget.displayName);
257
+ const descriptionExpr = iosWidgetGalleryLabelSwiftExpr(widget.id, 'description', widget.description);
258
+ return (0, dedent_1.default) `
259
+ public struct ${structName}: Widget {
260
+ private let widgetId = "${widget.id}"
261
+
262
+ public init() {}
263
+
264
+ public var body: some WidgetConfiguration {
265
+ StaticConfiguration(
266
+ kind: "Voltra_Widget_${widget.id}",
267
+ provider: VoltraHomeWidgetProvider(
268
+ widgetId: widgetId,
269
+ initialState: VoltraWidgetInitialStates.getInitialState(for: widgetId)
270
+ )
271
+ ) { entry in
272
+ VoltraHomeWidgetView(entry: entry)
273
+ }
274
+ .configurationDisplayName(${displayNameExpr})
275
+ .description(${descriptionExpr})
276
+ .supportedFamilies([${familiesSwift}])
277
+ .contentMarginsDisabled()
278
+ }
279
+ }
280
+ `;
281
+ }
282
+ /**
283
+ * Generates the VoltraWidgetBundle.swift file content with configured widgets
284
+ */
285
+ function generateWidgetBundleSwift(widgets) {
286
+ // Generate widget structs
287
+ const widgetStructs = widgets.map(generateWidgetStruct).join('\n\n');
288
+ // Generate widget bundle body entries
289
+ const widgetInstances = widgets.map((w) => `VoltraWidget_${w.id}()`).join('\n ');
290
+ const needsFoundation = widgets.some(widgetUsesGalleryLocalization);
291
+ const foundationImport = needsFoundation ? 'import Foundation\n' : '';
292
+ return (0, dedent_1.default) `
293
+ //
294
+ // VoltraWidgetBundle.swift
295
+ //
296
+ // Auto-generated by Voltra config plugin.
297
+ // This file defines which Voltra widgets are available in your app.
298
+ //
299
+
300
+ ${foundationImport}import SwiftUI
301
+ import WidgetKit
302
+ import VoltraWidget
303
+
304
+ @main
305
+ struct VoltraWidgetBundle: WidgetBundle {
306
+ var body: some Widget {
307
+ // Live Activity (with Watch/CarPlay support)
308
+ VoltraWidget()
309
+
310
+ // Home Screen Widgets
311
+ ${widgetInstances}
312
+ }
313
+ }
314
+
315
+ // MARK: - Home Screen Widget Definitions
316
+
317
+ ${widgetStructs}
318
+ `;
319
+ }
320
+ /**
321
+ * Generates the VoltraWidgetBundle.swift file content when no widgets are configured
322
+ * (only Live Activities)
323
+ */
324
+ function generateDefaultWidgetBundleSwift() {
325
+ return (0, dedent_1.default) `
326
+ //
327
+ // VoltraWidgetBundle.swift
328
+ //
329
+ // This file defines which Voltra widgets are available in your app.
330
+ // You can customize which widgets to include by adding or removing them below.
331
+ //
332
+
333
+ import SwiftUI
334
+ import WidgetKit
335
+ import VoltraWidget // Import Voltra widgets
336
+
337
+ @main
338
+ struct VoltraWidgetBundle: WidgetBundle {
339
+ var body: some Widget {
340
+ // Live Activity (with Watch/CarPlay support)
341
+ VoltraWidget()
342
+ }
343
+ }
344
+ `;
345
+ }
346
+ // ============================================================================
347
+ // Initial States
348
+ // ============================================================================
349
+ /**
350
+ * Generates Swift code that bundles pre-rendered widget initial states (per locale when configured).
351
+ */
352
+ function generateInitialStatesSwift(prerenderedStates) {
353
+ if (prerenderedStates.size === 0) {
354
+ return generateEmptyInitialStatesSwift();
355
+ }
356
+ const widgetEntries = Array.from(prerenderedStates.entries())
357
+ .map(([widgetId, perLocale]) => {
358
+ const localeEntries = Array.from(perLocale.entries())
359
+ .map(([localeKey, json]) => {
360
+ const delimiter = getSwiftRawStringDelimiter(json);
361
+ return `"${escapeForSwiftStringLiteral(localeKey)}": ${delimiter}"${json}"${delimiter}`;
362
+ })
363
+ .join(',\n ');
364
+ return `"${widgetId}": [\n ${localeEntries}\n ]`;
365
+ })
366
+ .join(',\n ');
367
+ return (0, dedent_1.default) `
368
+ //
369
+ // VoltraWidgetInitialStates.swift
370
+ //
371
+ // Auto-generated by Voltra config plugin.
372
+ // Contains pre-rendered initial states for home screen widgets.
373
+ //
374
+
375
+ import Foundation
376
+
377
+ ${GENERATED_INITIAL_STATE_LOCALE_HELPER}
378
+
379
+ public enum VoltraWidgetInitialStates {
380
+ private static let bundledLocalizedStates: [String: [String: String]] = [
381
+ ${widgetEntries}
382
+ ]
383
+
384
+ /// Get the bundled initial state JSON for a widget, matching the device locale when multiple locales were built.
385
+ /// Returns nil if no initial state was configured for the widget.
386
+ public static func getInitialState(for widgetId: String) -> Data? {
387
+ guard let perLocale = bundledLocalizedStates[widgetId] else { return nil }
388
+ let tags = VoltraGeneratedInitialStateLocale.preferredLanguageTags()
389
+ guard let jsonString = VoltraGeneratedInitialStateLocale.pickJson(from: perLocale, preferredLanguages: tags) else {
390
+ return nil
391
+ }
392
+ return jsonString.data(using: .utf8)
393
+ }
394
+ }
395
+ `;
396
+ }
397
+ /**
398
+ * Generates empty Swift code when no widgets have initial states configured.
399
+ */
400
+ function generateEmptyInitialStatesSwift() {
401
+ return (0, dedent_1.default) `
402
+ //
403
+ // VoltraWidgetInitialStates.swift
404
+ //
405
+ // Auto-generated by Voltra config plugin.
406
+ // No widget initial states configured.
407
+ //
408
+
409
+ import Foundation
410
+
411
+ public enum VoltraWidgetInitialStates {
412
+ /// Get the bundled initial state JSON for a widget.
413
+ /// Always returns nil since no initial states are configured.
414
+ public static func getInitialState(for widgetId: String) -> Data? {
415
+ return nil
416
+ }
417
+ }
418
+ `;
419
+ }
420
+ /**
421
+ * Determines the appropriate Swift raw string delimiter for a given string.
422
+ * Counts the maximum consecutive '#' characters after a '"' in the content
423
+ * and returns a delimiter with one more '#' than that maximum.
424
+ *
425
+ * For example:
426
+ * - Content has no '"#' → returns '#'
427
+ * - Content has '"#' (1 hash) → returns '##'
428
+ * - Content has '"##' (2 hashes) → returns '###'
429
+ */
430
+ function getSwiftRawStringDelimiter(str) {
431
+ // Find all sequences of '#' that follow a '"'
432
+ const matches = str.match(/"#+/g);
433
+ if (!matches) {
434
+ return '#';
435
+ }
436
+ // Find the maximum number of consecutive '#' after a '"'
437
+ const maxHashes = Math.max(...matches.map((m) => m.length - 1)); // -1 to exclude the '"'
438
+ return '#'.repeat(maxHashes + 1);
439
+ }
440
+ exports.__test__ = {
441
+ generateInitialStatesSwift,
442
+ };
443
+ //# sourceMappingURL=swift.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swift.js","sourceRoot":"","sources":["../../../../src/ios-widget/files/swift.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,gDA+BC;AAnED,oDAA2B;AAC3B,uCAAwB;AACxB,2CAA4B;AAE5B,yDAOgC;AAEhC,+CAA4E;AAE5E,6DAA0E;AAU1E,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E;;;;;;GAMG;AACI,KAAK,UAAU,kBAAkB,CAAC,OAAkC;IACzE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;IAEpD,iGAAiG;IACjG,MAAM,cAAc,GAAG,wBAAwB,CAAA;IAC/C,MAAM,EAAE,oBAAoB,EAAE,GAAG,CAAC,yBAAa,cAAc,uCAAC,CAE7D,CAAA;IAED,kFAAkF;IAClF,MAAM,iBAAiB,GAAG,MAAM,IAAA,kCAAoB,EAAC,OAAO,IAAI,EAAE,EAAE,WAAW,EAAE,oBAAoB,CAAC,CAAA;IAEtG,8BAA8B,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IAEnD,yCAAyC;IACzC,MAAM,oBAAoB,GAAG,0BAA0B,CAAC,iBAAiB,CAAC,CAAA;IAC1E,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,iCAAiC,C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