@chipmobilesdk/rn-ads 0.6.0 → 0.8.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.
Files changed (340) hide show
  1. package/CHANGELOG.md +139 -0
  2. package/README.md +4 -2
  3. package/lib/commonjs/config/resolveAdUnit.js +80 -0
  4. package/lib/commonjs/config/resolveAdUnit.js.map +1 -0
  5. package/lib/commonjs/config/types.js +138 -0
  6. package/lib/commonjs/config/types.js.map +1 -0
  7. package/lib/commonjs/config/validate.js +150 -0
  8. package/lib/commonjs/config/validate.js.map +1 -0
  9. package/lib/commonjs/core/adOriginatedReturn.js +119 -0
  10. package/lib/commonjs/core/adOriginatedReturn.js.map +1 -0
  11. package/lib/commonjs/core/adsInstance.js +129 -0
  12. package/lib/commonjs/core/adsInstance.js.map +1 -0
  13. package/lib/commonjs/core/consentFlow.js +154 -0
  14. package/lib/commonjs/core/consentFlow.js.map +1 -0
  15. package/lib/commonjs/core/enablement.js +64 -0
  16. package/lib/commonjs/core/enablement.js.map +1 -0
  17. package/lib/commonjs/core/fullScreenLock.js +48 -0
  18. package/lib/commonjs/core/fullScreenLock.js.map +1 -0
  19. package/lib/commonjs/core/gates.js +95 -0
  20. package/lib/commonjs/core/gates.js.map +1 -0
  21. package/lib/commonjs/core/initMachine.js +159 -0
  22. package/lib/commonjs/core/initMachine.js.map +1 -0
  23. package/lib/commonjs/core/instance/consent.js +155 -0
  24. package/lib/commonjs/core/instance/consent.js.map +1 -0
  25. package/lib/commonjs/core/instance/context.js +217 -0
  26. package/lib/commonjs/core/instance/context.js.map +1 -0
  27. package/lib/commonjs/core/instance/gate.js +194 -0
  28. package/lib/commonjs/core/instance/gate.js.map +1 -0
  29. package/lib/commonjs/core/instance/init.js +326 -0
  30. package/lib/commonjs/core/instance/init.js.map +1 -0
  31. package/lib/commonjs/core/instance/internals.js +115 -0
  32. package/lib/commonjs/core/instance/internals.js.map +1 -0
  33. package/lib/commonjs/core/instance/load.js +458 -0
  34. package/lib/commonjs/core/instance/load.js.map +1 -0
  35. package/lib/commonjs/core/instance/show.js +243 -0
  36. package/lib/commonjs/core/instance/show.js.map +1 -0
  37. package/lib/commonjs/core/instance/types.js +6 -0
  38. package/lib/commonjs/core/instance/types.js.map +1 -0
  39. package/lib/commonjs/core/placementMachine.js +116 -0
  40. package/lib/commonjs/core/placementMachine.js.map +1 -0
  41. package/lib/commonjs/core/privacyGate.js +93 -0
  42. package/lib/commonjs/core/privacyGate.js.map +1 -0
  43. package/lib/commonjs/core/requestThrottle.js +152 -0
  44. package/lib/commonjs/core/requestThrottle.js.map +1 -0
  45. package/lib/commonjs/core/retryPolicy.js +120 -0
  46. package/lib/commonjs/core/retryPolicy.js.map +1 -0
  47. package/lib/commonjs/core/rewardedSession.js +65 -0
  48. package/lib/commonjs/core/rewardedSession.js.map +1 -0
  49. package/lib/commonjs/core/timers.js +162 -0
  50. package/lib/commonjs/core/timers.js.map +1 -0
  51. package/lib/commonjs/diagnostics/correlation.js +33 -0
  52. package/lib/commonjs/diagnostics/correlation.js.map +1 -0
  53. package/lib/commonjs/diagnostics/errors.js +152 -0
  54. package/lib/commonjs/diagnostics/errors.js.map +1 -0
  55. package/lib/commonjs/diagnostics/events.js +132 -0
  56. package/lib/commonjs/diagnostics/events.js.map +1 -0
  57. package/lib/commonjs/engine/admobBanner.js +58 -0
  58. package/lib/commonjs/engine/admobBanner.js.map +1 -0
  59. package/lib/commonjs/engine/admobEngine.js +343 -0
  60. package/lib/commonjs/engine/admobEngine.js.map +1 -0
  61. package/lib/commonjs/engine/admobErrors.js +45 -0
  62. package/lib/commonjs/engine/admobErrors.js.map +1 -0
  63. package/lib/commonjs/engine/port.js +6 -0
  64. package/lib/commonjs/engine/port.js.map +1 -0
  65. package/lib/commonjs/engine/testAdUnits.js +61 -0
  66. package/lib/commonjs/engine/testAdUnits.js.map +1 -0
  67. package/lib/commonjs/index.js +218 -0
  68. package/lib/commonjs/index.js.map +1 -0
  69. package/lib/commonjs/package.json +1 -0
  70. package/lib/commonjs/react/AdsBanner.js +317 -0
  71. package/lib/commonjs/react/AdsBanner.js.map +1 -0
  72. package/lib/commonjs/react/AdsProvider.js +54 -0
  73. package/lib/commonjs/react/AdsProvider.js.map +1 -0
  74. package/lib/commonjs/react/hooks.js +63 -0
  75. package/lib/commonjs/react/hooks.js.map +1 -0
  76. package/lib/commonjs/testing/clock.js +76 -0
  77. package/lib/commonjs/testing/clock.js.map +1 -0
  78. package/lib/commonjs/testing/conformance.js +99 -0
  79. package/lib/commonjs/testing/conformance.js.map +1 -0
  80. package/lib/commonjs/testing/index.js +389 -0
  81. package/lib/commonjs/testing/index.js.map +1 -0
  82. package/lib/module/config/resolveAdUnit.js +75 -0
  83. package/lib/module/config/resolveAdUnit.js.map +1 -0
  84. package/lib/module/config/types.js +134 -0
  85. package/lib/module/config/types.js.map +1 -0
  86. package/lib/module/config/validate.js +146 -0
  87. package/lib/module/config/validate.js.map +1 -0
  88. package/lib/module/core/adOriginatedReturn.js +115 -0
  89. package/lib/module/core/adOriginatedReturn.js.map +1 -0
  90. package/lib/module/core/adsInstance.js +121 -0
  91. package/lib/module/core/adsInstance.js.map +1 -0
  92. package/lib/module/core/consentFlow.js +143 -0
  93. package/lib/module/core/consentFlow.js.map +1 -0
  94. package/lib/module/core/enablement.js +58 -0
  95. package/lib/module/core/enablement.js.map +1 -0
  96. package/lib/module/core/fullScreenLock.js +44 -0
  97. package/lib/module/core/fullScreenLock.js.map +1 -0
  98. package/lib/module/core/gates.js +91 -0
  99. package/lib/module/core/gates.js.map +1 -0
  100. package/lib/module/core/initMachine.js +152 -0
  101. package/lib/module/core/initMachine.js.map +1 -0
  102. package/lib/module/core/instance/consent.js +151 -0
  103. package/lib/module/core/instance/consent.js.map +1 -0
  104. package/lib/module/core/instance/context.js +212 -0
  105. package/lib/module/core/instance/context.js.map +1 -0
  106. package/lib/module/core/instance/gate.js +183 -0
  107. package/lib/module/core/instance/gate.js.map +1 -0
  108. package/lib/module/core/instance/init.js +321 -0
  109. package/lib/module/core/instance/init.js.map +1 -0
  110. package/lib/module/core/instance/internals.js +109 -0
  111. package/lib/module/core/instance/internals.js.map +1 -0
  112. package/lib/module/core/instance/load.js +452 -0
  113. package/lib/module/core/instance/load.js.map +1 -0
  114. package/lib/module/core/instance/show.js +238 -0
  115. package/lib/module/core/instance/show.js.map +1 -0
  116. package/lib/module/core/instance/types.js +4 -0
  117. package/lib/module/core/instance/types.js.map +1 -0
  118. package/lib/module/core/placementMachine.js +109 -0
  119. package/lib/module/core/placementMachine.js.map +1 -0
  120. package/lib/module/core/privacyGate.js +86 -0
  121. package/lib/module/core/privacyGate.js.map +1 -0
  122. package/lib/module/core/requestThrottle.js +146 -0
  123. package/lib/module/core/requestThrottle.js.map +1 -0
  124. package/lib/module/core/retryPolicy.js +113 -0
  125. package/lib/module/core/retryPolicy.js.map +1 -0
  126. package/lib/module/core/rewardedSession.js +61 -0
  127. package/lib/module/core/rewardedSession.js.map +1 -0
  128. package/lib/module/core/timers.js +150 -0
  129. package/lib/module/core/timers.js.map +1 -0
  130. package/lib/module/diagnostics/correlation.js +29 -0
  131. package/lib/module/diagnostics/correlation.js.map +1 -0
  132. package/lib/module/diagnostics/errors.js +143 -0
  133. package/lib/module/diagnostics/errors.js.map +1 -0
  134. package/lib/module/diagnostics/events.js +128 -0
  135. package/lib/module/diagnostics/events.js.map +1 -0
  136. package/lib/module/engine/admobBanner.js +52 -0
  137. package/lib/module/engine/admobBanner.js.map +1 -0
  138. package/lib/module/engine/admobEngine.js +334 -0
  139. package/lib/module/engine/admobEngine.js.map +1 -0
  140. package/lib/module/engine/admobErrors.js +41 -0
  141. package/lib/module/engine/admobErrors.js.map +1 -0
  142. package/lib/module/engine/port.js +4 -0
  143. package/lib/module/engine/port.js.map +1 -0
  144. package/lib/module/engine/testAdUnits.js +56 -0
  145. package/lib/module/engine/testAdUnits.js.map +1 -0
  146. package/lib/module/index.js +59 -0
  147. package/lib/module/index.js.map +1 -0
  148. package/lib/module/package.json +1 -0
  149. package/lib/module/react/AdsBanner.js +312 -0
  150. package/lib/module/react/AdsBanner.js.map +1 -0
  151. package/lib/module/react/AdsProvider.js +48 -0
  152. package/lib/module/react/AdsProvider.js.map +1 -0
  153. package/lib/module/react/hooks.js +58 -0
  154. package/lib/module/react/hooks.js.map +1 -0
  155. package/lib/module/testing/clock.js +72 -0
  156. package/lib/module/testing/clock.js.map +1 -0
  157. package/lib/module/testing/conformance.js +93 -0
  158. package/lib/module/testing/conformance.js.map +1 -0
  159. package/lib/module/testing/index.js +366 -0
  160. package/lib/module/testing/index.js.map +1 -0
  161. package/lib/typescript/commonjs/config/resolveAdUnit.d.ts +43 -0
  162. package/lib/typescript/commonjs/config/resolveAdUnit.d.ts.map +1 -0
  163. package/lib/typescript/commonjs/config/types.d.ts +280 -0
  164. package/lib/typescript/commonjs/config/types.d.ts.map +1 -0
  165. package/lib/typescript/commonjs/config/validate.d.ts +49 -0
  166. package/lib/typescript/commonjs/config/validate.d.ts.map +1 -0
  167. package/lib/typescript/commonjs/core/adOriginatedReturn.d.ts +61 -0
  168. package/lib/typescript/commonjs/core/adOriginatedReturn.d.ts.map +1 -0
  169. package/lib/typescript/commonjs/core/adsInstance.d.ts +33 -0
  170. package/lib/typescript/commonjs/core/adsInstance.d.ts.map +1 -0
  171. package/lib/typescript/commonjs/core/consentFlow.d.ts +84 -0
  172. package/lib/typescript/commonjs/core/consentFlow.d.ts.map +1 -0
  173. package/lib/typescript/commonjs/core/enablement.d.ts +74 -0
  174. package/lib/typescript/commonjs/core/enablement.d.ts.map +1 -0
  175. package/lib/typescript/commonjs/core/fullScreenLock.d.ts +25 -0
  176. package/lib/typescript/commonjs/core/fullScreenLock.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/core/gates.d.ts +76 -0
  178. package/lib/typescript/commonjs/core/gates.d.ts.map +1 -0
  179. package/lib/typescript/commonjs/core/initMachine.d.ts +66 -0
  180. package/lib/typescript/commonjs/core/initMachine.d.ts.map +1 -0
  181. package/lib/typescript/commonjs/core/instance/consent.d.ts +4 -0
  182. package/lib/typescript/commonjs/core/instance/consent.d.ts.map +1 -0
  183. package/lib/typescript/commonjs/core/instance/context.d.ts +118 -0
  184. package/lib/typescript/commonjs/core/instance/context.d.ts.map +1 -0
  185. package/lib/typescript/commonjs/core/instance/gate.d.ts +38 -0
  186. package/lib/typescript/commonjs/core/instance/gate.d.ts.map +1 -0
  187. package/lib/typescript/commonjs/core/instance/init.d.ts +13 -0
  188. package/lib/typescript/commonjs/core/instance/init.d.ts.map +1 -0
  189. package/lib/typescript/commonjs/core/instance/internals.d.ts +60 -0
  190. package/lib/typescript/commonjs/core/instance/internals.d.ts.map +1 -0
  191. package/lib/typescript/commonjs/core/instance/load.d.ts +9 -0
  192. package/lib/typescript/commonjs/core/instance/load.d.ts.map +1 -0
  193. package/lib/typescript/commonjs/core/instance/show.d.ts +7 -0
  194. package/lib/typescript/commonjs/core/instance/show.d.ts.map +1 -0
  195. package/lib/typescript/commonjs/core/instance/types.d.ts +240 -0
  196. package/lib/typescript/commonjs/core/instance/types.d.ts.map +1 -0
  197. package/lib/typescript/commonjs/core/placementMachine.d.ts +55 -0
  198. package/lib/typescript/commonjs/core/placementMachine.d.ts.map +1 -0
  199. package/lib/typescript/commonjs/core/privacyGate.d.ts +40 -0
  200. package/lib/typescript/commonjs/core/privacyGate.d.ts.map +1 -0
  201. package/lib/typescript/commonjs/core/requestThrottle.d.ts +99 -0
  202. package/lib/typescript/commonjs/core/requestThrottle.d.ts.map +1 -0
  203. package/lib/typescript/commonjs/core/retryPolicy.d.ts +66 -0
  204. package/lib/typescript/commonjs/core/retryPolicy.d.ts.map +1 -0
  205. package/lib/typescript/commonjs/core/rewardedSession.d.ts +37 -0
  206. package/lib/typescript/commonjs/core/rewardedSession.d.ts.map +1 -0
  207. package/lib/typescript/commonjs/core/timers.d.ts +135 -0
  208. package/lib/typescript/commonjs/core/timers.d.ts.map +1 -0
  209. package/lib/typescript/commonjs/diagnostics/correlation.d.ts +18 -0
  210. package/lib/typescript/commonjs/diagnostics/correlation.d.ts.map +1 -0
  211. package/lib/typescript/commonjs/diagnostics/errors.d.ts +59 -0
  212. package/lib/typescript/commonjs/diagnostics/errors.d.ts.map +1 -0
  213. package/lib/typescript/commonjs/diagnostics/events.d.ts +126 -0
  214. package/lib/typescript/commonjs/diagnostics/events.d.ts.map +1 -0
  215. package/lib/typescript/commonjs/engine/admobBanner.d.ts +10 -0
  216. package/lib/typescript/commonjs/engine/admobBanner.d.ts.map +1 -0
  217. package/lib/typescript/commonjs/engine/admobEngine.d.ts +71 -0
  218. package/lib/typescript/commonjs/engine/admobEngine.d.ts.map +1 -0
  219. package/lib/typescript/commonjs/engine/admobErrors.d.ts +9 -0
  220. package/lib/typescript/commonjs/engine/admobErrors.d.ts.map +1 -0
  221. package/lib/typescript/commonjs/engine/port.d.ts +171 -0
  222. package/lib/typescript/commonjs/engine/port.d.ts.map +1 -0
  223. package/lib/typescript/commonjs/engine/testAdUnits.d.ts +33 -0
  224. package/lib/typescript/commonjs/engine/testAdUnits.d.ts.map +1 -0
  225. package/lib/typescript/commonjs/index.d.ts +42 -0
  226. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  227. package/lib/typescript/commonjs/package.json +1 -0
  228. package/lib/typescript/commonjs/react/AdsBanner.d.ts +29 -0
  229. package/lib/typescript/commonjs/react/AdsBanner.d.ts.map +1 -0
  230. package/lib/typescript/commonjs/react/AdsProvider.d.ts +36 -0
  231. package/lib/typescript/commonjs/react/AdsProvider.d.ts.map +1 -0
  232. package/lib/typescript/commonjs/react/hooks.d.ts +27 -0
  233. package/lib/typescript/commonjs/react/hooks.d.ts.map +1 -0
  234. package/lib/typescript/commonjs/testing/clock.d.ts +29 -0
  235. package/lib/typescript/commonjs/testing/clock.d.ts.map +1 -0
  236. package/lib/typescript/commonjs/testing/conformance.d.ts +26 -0
  237. package/lib/typescript/commonjs/testing/conformance.d.ts.map +1 -0
  238. package/lib/typescript/commonjs/testing/index.d.ts +133 -0
  239. package/lib/typescript/commonjs/testing/index.d.ts.map +1 -0
  240. package/lib/typescript/module/config/resolveAdUnit.d.ts +43 -0
  241. package/lib/typescript/module/config/resolveAdUnit.d.ts.map +1 -0
  242. package/lib/typescript/module/config/types.d.ts +280 -0
  243. package/lib/typescript/module/config/types.d.ts.map +1 -0
  244. package/lib/typescript/module/config/validate.d.ts +49 -0
  245. package/lib/typescript/module/config/validate.d.ts.map +1 -0
  246. package/lib/typescript/module/core/adOriginatedReturn.d.ts +61 -0
  247. package/lib/typescript/module/core/adOriginatedReturn.d.ts.map +1 -0
  248. package/lib/typescript/module/core/adsInstance.d.ts +33 -0
  249. package/lib/typescript/module/core/adsInstance.d.ts.map +1 -0
  250. package/lib/typescript/module/core/consentFlow.d.ts +84 -0
  251. package/lib/typescript/module/core/consentFlow.d.ts.map +1 -0
  252. package/lib/typescript/module/core/enablement.d.ts +74 -0
  253. package/lib/typescript/module/core/enablement.d.ts.map +1 -0
  254. package/lib/typescript/module/core/fullScreenLock.d.ts +25 -0
  255. package/lib/typescript/module/core/fullScreenLock.d.ts.map +1 -0
  256. package/lib/typescript/module/core/gates.d.ts +76 -0
  257. package/lib/typescript/module/core/gates.d.ts.map +1 -0
  258. package/lib/typescript/module/core/initMachine.d.ts +66 -0
  259. package/lib/typescript/module/core/initMachine.d.ts.map +1 -0
  260. package/lib/typescript/module/core/instance/consent.d.ts +4 -0
  261. package/lib/typescript/module/core/instance/consent.d.ts.map +1 -0
  262. package/lib/typescript/module/core/instance/context.d.ts +118 -0
  263. package/lib/typescript/module/core/instance/context.d.ts.map +1 -0
  264. package/lib/typescript/module/core/instance/gate.d.ts +38 -0
  265. package/lib/typescript/module/core/instance/gate.d.ts.map +1 -0
  266. package/lib/typescript/module/core/instance/init.d.ts +13 -0
  267. package/lib/typescript/module/core/instance/init.d.ts.map +1 -0
  268. package/lib/typescript/module/core/instance/internals.d.ts +60 -0
  269. package/lib/typescript/module/core/instance/internals.d.ts.map +1 -0
  270. package/lib/typescript/module/core/instance/load.d.ts +9 -0
  271. package/lib/typescript/module/core/instance/load.d.ts.map +1 -0
  272. package/lib/typescript/module/core/instance/show.d.ts +7 -0
  273. package/lib/typescript/module/core/instance/show.d.ts.map +1 -0
  274. package/lib/typescript/module/core/instance/types.d.ts +240 -0
  275. package/lib/typescript/module/core/instance/types.d.ts.map +1 -0
  276. package/lib/typescript/module/core/placementMachine.d.ts +55 -0
  277. package/lib/typescript/module/core/placementMachine.d.ts.map +1 -0
  278. package/lib/typescript/module/core/privacyGate.d.ts +40 -0
  279. package/lib/typescript/module/core/privacyGate.d.ts.map +1 -0
  280. package/lib/typescript/module/core/requestThrottle.d.ts +99 -0
  281. package/lib/typescript/module/core/requestThrottle.d.ts.map +1 -0
  282. package/lib/typescript/module/core/retryPolicy.d.ts +66 -0
  283. package/lib/typescript/module/core/retryPolicy.d.ts.map +1 -0
  284. package/lib/typescript/module/core/rewardedSession.d.ts +37 -0
  285. package/lib/typescript/module/core/rewardedSession.d.ts.map +1 -0
  286. package/lib/typescript/module/core/timers.d.ts +135 -0
  287. package/lib/typescript/module/core/timers.d.ts.map +1 -0
  288. package/lib/typescript/module/diagnostics/correlation.d.ts +18 -0
  289. package/lib/typescript/module/diagnostics/correlation.d.ts.map +1 -0
  290. package/lib/typescript/module/diagnostics/errors.d.ts +59 -0
  291. package/lib/typescript/module/diagnostics/errors.d.ts.map +1 -0
  292. package/lib/typescript/module/diagnostics/events.d.ts +126 -0
  293. package/lib/typescript/module/diagnostics/events.d.ts.map +1 -0
  294. package/lib/typescript/module/engine/admobBanner.d.ts +10 -0
  295. package/lib/typescript/module/engine/admobBanner.d.ts.map +1 -0
  296. package/lib/typescript/module/engine/admobEngine.d.ts +71 -0
  297. package/lib/typescript/module/engine/admobEngine.d.ts.map +1 -0
  298. package/lib/typescript/module/engine/admobErrors.d.ts +9 -0
  299. package/lib/typescript/module/engine/admobErrors.d.ts.map +1 -0
  300. package/lib/typescript/module/engine/port.d.ts +171 -0
  301. package/lib/typescript/module/engine/port.d.ts.map +1 -0
  302. package/lib/typescript/module/engine/testAdUnits.d.ts +33 -0
  303. package/lib/typescript/module/engine/testAdUnits.d.ts.map +1 -0
  304. package/lib/typescript/module/index.d.ts +42 -0
  305. package/lib/typescript/module/index.d.ts.map +1 -0
  306. package/lib/typescript/module/package.json +1 -0
  307. package/lib/typescript/module/react/AdsBanner.d.ts +29 -0
  308. package/lib/typescript/module/react/AdsBanner.d.ts.map +1 -0
  309. package/lib/typescript/module/react/AdsProvider.d.ts +36 -0
  310. package/lib/typescript/module/react/AdsProvider.d.ts.map +1 -0
  311. package/lib/typescript/module/react/hooks.d.ts +27 -0
  312. package/lib/typescript/module/react/hooks.d.ts.map +1 -0
  313. package/lib/typescript/module/testing/clock.d.ts +29 -0
  314. package/lib/typescript/module/testing/clock.d.ts.map +1 -0
  315. package/lib/typescript/module/testing/conformance.d.ts +26 -0
  316. package/lib/typescript/module/testing/conformance.d.ts.map +1 -0
  317. package/lib/typescript/module/testing/index.d.ts +133 -0
  318. package/lib/typescript/module/testing/index.d.ts.map +1 -0
  319. package/package.json +48 -12
  320. package/skills/sdk-rn-ads/SKILL.md +2 -1
  321. package/src/core/adsInstance.ts +72 -1829
  322. package/src/core/consentFlow.ts +1 -20
  323. package/src/core/instance/consent.ts +162 -0
  324. package/src/core/instance/context.ts +328 -0
  325. package/src/core/instance/gate.ts +147 -0
  326. package/src/core/instance/init.ts +262 -0
  327. package/src/core/instance/internals.ts +138 -0
  328. package/src/core/instance/load.ts +426 -0
  329. package/src/core/instance/show.ts +202 -0
  330. package/src/core/instance/types.ts +198 -0
  331. package/src/core/requestThrottle.ts +11 -17
  332. package/src/diagnostics/errors.ts +24 -5
  333. package/src/engine/admobBanner.tsx +55 -0
  334. package/src/engine/admobEngine.ts +21 -12
  335. package/src/engine/admobErrors.ts +44 -0
  336. package/src/engine/port.ts +46 -1
  337. package/src/engine/testAdUnits.ts +0 -5
  338. package/src/react/AdsBanner.tsx +81 -80
  339. package/src/testing/clock.ts +75 -0
  340. package/src/testing/index.ts +43 -68
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isOfficialTestAdUnit = isOfficialTestAdUnit;
7
+ exports.testAdUnitFor = testAdUnitFor;
8
+ /**
9
+ * Google's official test ad units (FR-013).
10
+ *
11
+ * PRIVATE. Never exported from `src/index.ts`.
12
+ *
13
+ * FR-013 forbids the package from carrying production identifiers, credentials,
14
+ * or host-app rules, and explicitly permits official test identifiers provided
15
+ * they are documented as such — this file is that documentation.
16
+ *
17
+ * They are hard-coded rather than read from configuration on purpose: FR-011's
18
+ * substitution guarantee must hold even when the app's configuration is the
19
+ * thing that is wrong, so it cannot depend on the app supplying anything. They
20
+ * are also not re-exported from the provider bridge's own `TestIds`, because
21
+ * that would put a provider symbol on this package's dependency path for a
22
+ * value that is really just four documented constants (FR-002).
23
+ *
24
+ * Source: Google Mobile Ads "Test ads" documentation, cross-checked against the
25
+ * bridge's `src/TestIds.ts` at version 16.0.3. These identifiers are public,
26
+ * are the same for every publisher, and always fill.
27
+ */
28
+
29
+ /** Android. iOS units are added alongside these when the iOS adapter lands (FR-006). */
30
+ const ANDROID_TEST_AD_UNITS = {
31
+ // The adaptive-banner unit, not the fixed-size one, because adaptive is the
32
+ // format this package actually requests (FR-038).
33
+ banner: 'ca-app-pub-3940256099942544/9214589741',
34
+ interstitial: 'ca-app-pub-3940256099942544/1033173712',
35
+ rewarded: 'ca-app-pub-3940256099942544/5224354917',
36
+ // Added in 0.2.0 alongside the app-open format. Cross-checked against the
37
+ // bridge's own `TestIds.APP_OPEN` at 16.0.3.
38
+ app_open: 'ca-app-pub-3940256099942544/9257395921'
39
+ };
40
+ function testAdUnitFor(format) {
41
+ return ANDROID_TEST_AD_UNITS[format];
42
+ }
43
+
44
+ /**
45
+ * Whether an identifier is one of ours.
46
+ *
47
+ * This is the structural test that drives substitution: anything that is not a
48
+ * known official test unit is treated as production-owned. Deliberately not a
49
+ * parse of AdMob's publisher-id format — a rule like that becomes wrong the day
50
+ * Google changes the format, and being wrong here means either sending a
51
+ * production request or blocking a legitimate one.
52
+ */
53
+ function isOfficialTestAdUnit(adUnitId) {
54
+ for (const value of Object.values(ANDROID_TEST_AD_UNITS)) {
55
+ if (value === adUnitId) {
56
+ return true;
57
+ }
58
+ }
59
+ return false;
60
+ }
61
+ //# sourceMappingURL=testAdUnits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ANDROID_TEST_AD_UNITS","banner","interstitial","rewarded","app_open","testAdUnitFor","format","isOfficialTestAdUnit","adUnitId","value","Object","values"],"sourceRoot":"../../../src","sources":["engine/testAdUnits.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA,MAAMA,qBAAyD,GAAG;EACjE;EACA;EACAC,MAAM,EAAE,wCAAwC;EAChDC,YAAY,EAAE,wCAAwC;EACtDC,QAAQ,EAAE,wCAAwC;EAClD;EACA;EACAC,QAAQ,EAAE;AACX,CAAC;AAEM,SAASC,aAAaA,CAACC,MAAgB,EAAU;EACvD,OAAON,qBAAqB,CAACM,MAAM,CAAC;AACrC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,oBAAoBA,CAACC,QAAgB,EAAW;EAC/D,KAAK,MAAMC,KAAK,IAAIC,MAAM,CAACC,MAAM,CAACX,qBAAqB,CAAC,EAAE;IACzD,IAAIS,KAAK,KAAKD,QAAQ,EAAE;MACvB,OAAO,IAAI;IACZ;EACD;EACA,OAAO,KAAK;AACb","ignoreList":[]}
@@ -0,0 +1,218 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "AD_VALIDITY_BOUNDS", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _timers.AD_VALIDITY_BOUNDS;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "APP_OPEN_VALIDITY_BOUNDS", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _timers.APP_OPEN_VALIDITY_BOUNDS;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "AdsBanner", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _AdsBanner.AdsBanner;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "AdsConfigError", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _errors.AdsConfigError;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "AdsError", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _errors.AdsError;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "AdsProvider", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _AdsProvider.AdsProvider;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "DEFAULT_AD_VALIDITY_MS", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _timers.DEFAULT_AD_VALIDITY_MS;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "DEFAULT_APP_OPEN_VALIDITY_MS", {
49
+ enumerable: true,
50
+ get: function () {
51
+ return _timers.DEFAULT_APP_OPEN_VALIDITY_MS;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "DEFAULT_BANNER_MIN_REQUEST_INTERVAL_MS", {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _requestThrottle.DEFAULT_BANNER_MIN_REQUEST_INTERVAL_MS;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "DEFAULT_FULL_SCREEN_MIN_REQUEST_INTERVAL_MS", {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _requestThrottle.DEFAULT_FULL_SCREEN_MIN_REQUEST_INTERVAL_MS;
64
+ }
65
+ });
66
+ Object.defineProperty(exports, "DEFAULT_LOAD_TIMEOUT_MS", {
67
+ enumerable: true,
68
+ get: function () {
69
+ return _timers.DEFAULT_LOAD_TIMEOUT_MS;
70
+ }
71
+ });
72
+ Object.defineProperty(exports, "DEFAULT_RETRY_POLICY", {
73
+ enumerable: true,
74
+ get: function () {
75
+ return _timers.DEFAULT_RETRY_POLICY;
76
+ }
77
+ });
78
+ Object.defineProperty(exports, "DEFAULT_SHOW_TIMEOUT_MS", {
79
+ enumerable: true,
80
+ get: function () {
81
+ return _timers.DEFAULT_SHOW_TIMEOUT_MS;
82
+ }
83
+ });
84
+ Object.defineProperty(exports, "DEFAULT_UNDECIDED_WARNING_MS", {
85
+ enumerable: true,
86
+ get: function () {
87
+ return _timers.DEFAULT_UNDECIDED_WARNING_MS;
88
+ }
89
+ });
90
+ Object.defineProperty(exports, "LOAD_TIMEOUT_BOUNDS", {
91
+ enumerable: true,
92
+ get: function () {
93
+ return _timers.LOAD_TIMEOUT_BOUNDS;
94
+ }
95
+ });
96
+ Object.defineProperty(exports, "MIN_REQUEST_INTERVAL_BOUNDS", {
97
+ enumerable: true,
98
+ get: function () {
99
+ return _requestThrottle.MIN_REQUEST_INTERVAL_BOUNDS;
100
+ }
101
+ });
102
+ Object.defineProperty(exports, "RETRY_BOUNDS", {
103
+ enumerable: true,
104
+ get: function () {
105
+ return _timers.RETRY_BOUNDS;
106
+ }
107
+ });
108
+ Object.defineProperty(exports, "SHOW_TIMEOUT_BOUNDS", {
109
+ enumerable: true,
110
+ get: function () {
111
+ return _timers.SHOW_TIMEOUT_BOUNDS;
112
+ }
113
+ });
114
+ Object.defineProperty(exports, "UNDECIDED_WARNING_BOUNDS", {
115
+ enumerable: true,
116
+ get: function () {
117
+ return _timers.UNDECIDED_WARNING_BOUNDS;
118
+ }
119
+ });
120
+ exports.createAds = createAds;
121
+ Object.defineProperty(exports, "defaultMinRequestIntervalMs", {
122
+ enumerable: true,
123
+ get: function () {
124
+ return _requestThrottle.defaultMinRequestIntervalMs;
125
+ }
126
+ });
127
+ Object.defineProperty(exports, "isAdsError", {
128
+ enumerable: true,
129
+ get: function () {
130
+ return _errors.isAdsError;
131
+ }
132
+ });
133
+ Object.defineProperty(exports, "isFullScreenFormat", {
134
+ enumerable: true,
135
+ get: function () {
136
+ return _types.isFullScreenFormat;
137
+ }
138
+ });
139
+ Object.defineProperty(exports, "useAds", {
140
+ enumerable: true,
141
+ get: function () {
142
+ return _AdsProvider.useAds;
143
+ }
144
+ });
145
+ Object.defineProperty(exports, "useAdsEvents", {
146
+ enumerable: true,
147
+ get: function () {
148
+ return _hooks.useAdsEvents;
149
+ }
150
+ });
151
+ Object.defineProperty(exports, "useAdsStatus", {
152
+ enumerable: true,
153
+ get: function () {
154
+ return _hooks.useAdsStatus;
155
+ }
156
+ });
157
+ Object.defineProperty(exports, "usePlacementState", {
158
+ enumerable: true,
159
+ get: function () {
160
+ return _hooks.usePlacementState;
161
+ }
162
+ });
163
+ var _adsInstance = require("./core/adsInstance.js");
164
+ var _admobEngine = require("./engine/admobEngine.js");
165
+ var _types = require("./config/types.js");
166
+ var _timers = require("./core/timers.js");
167
+ var _requestThrottle = require("./core/requestThrottle.js");
168
+ var _AdsBanner = require("./react/AdsBanner.js");
169
+ var _AdsProvider = require("./react/AdsProvider.js");
170
+ var _hooks = require("./react/hooks.js");
171
+ var _errors = require("./diagnostics/errors.js");
172
+ /**
173
+ * @chipmobilesdk/rn-ads — reusable advertising capability for
174
+ * ChipMobileSdk-family React Native apps.
175
+ *
176
+ * This is the public entrypoint (LIB-003). Modules under `config/`, `core/`,
177
+ * `engine/`, `react/`, and `diagnostics/` are private; import them only through
178
+ * this file. The fake engine lives behind `@chipmobilesdk/rn-ads/testing` so
179
+ * test doubles cannot reach a production bundle.
180
+ *
181
+ * Nothing exported here names Google, AdMob, or any provider type (FR-002).
182
+ * `src/__tests__/public-api.test.ts` asserts that mechanically.
183
+ *
184
+ * The package owns capability: a safe, consistent way to request and present
185
+ * ads. The consuming app owns policy — where ads appear, when, how often, under
186
+ * what consent, and whether they appear at all. There is no placement rule, no
187
+ * frequency cap, and no screen name in this package (FR-045).
188
+ */
189
+
190
+ // Configuration and state
191
+
192
+ // Timeout policy — exported so a consumer can read the defaults it is bound by
193
+ // rather than discovering them from a timeout in production (FR-032).
194
+
195
+ // Request throttle — account safety, added in 0.3.0 (FR-140). Exported so an app
196
+ // can read the floor it is bound by, and so the format-aware default is legible
197
+ // rather than something to discover from a `throttled` state in production.
198
+
199
+ // Enablement. `EnablementResult` is what `setEnabled` returns in place of
200
+ // 0.1.0's `void` — the defect that let a re-enable fail in silence (FR-122).
201
+
202
+ // Instance, lifecycle, and results
203
+
204
+ /**
205
+ * Creates an ads instance. This is the composition root: core's instance with
206
+ * the AdMob adapter as its default engine, so core/ itself never loads an
207
+ * adapter (ADS-14). The adapter resolves the provider bridge only on first use,
208
+ * so importing the package where there is no adapter, or no bridge, costs
209
+ * nothing and crashes nothing (FR-025, SC-004).
210
+ */
211
+ function createAds(config, options = {}) {
212
+ return (0, _adsInstance.createAds)(config, options, _admobEngine.createAdMobEngine);
213
+ }
214
+
215
+ // React surface
216
+
217
+ // Diagnostics
218
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_adsInstance","require","_admobEngine","_types","_timers","_requestThrottle","_AdsBanner","_AdsProvider","_hooks","_errors","createAds","config","options","createInstance","createAdMobEngine"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAyBA,IAAAE,MAAA,GAAAF,OAAA;AAIA,IAAAG,OAAA,GAAAH,OAAA;AAkBA,IAAAI,gBAAA,GAAAJ,OAAA;AAkCA,IAAAK,UAAA,GAAAL,OAAA;AAEA,IAAAM,YAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AAGA,IAAAQ,OAAA,GAAAR,OAAA;AAhHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;;AAyBA;AACA;;AAgBA;AACA;AACA;;AAQA;AACA;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASS,SAASA,CAACC,MAAiB,EAAEC,OAAyB,GAAG,CAAC,CAAC,EAAe;EACzF,OAAO,IAAAC,sBAAc,EAACF,MAAM,EAAEC,OAAO,EAAEE,8BAAiB,CAAC;AAC1D;;AAWA;;AAOA","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,317 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AdsBanner = AdsBanner;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _errors = require("../diagnostics/errors.js");
10
+ var _AdsProvider = require("./AdsProvider.js");
11
+ var _adsInstance = require("../core/adsInstance.js");
12
+ var _hooks = require("./hooks.js");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
15
+ /**
16
+ * Adaptive banner host (FR-038 – FR-042).
17
+ *
18
+ * The app puts this where it wants a banner. The component never inserts itself
19
+ * into the tree, never overlays app content, and ships no placeholder — the
20
+ * surrounding layout, and any loading or fallback presentation, belong to the
21
+ * app and its theme (FR-040, UX-001).
22
+ *
23
+ * When ads are disabled or unavailable it renders `null` rather than a
24
+ * zero-height view. That is not a micro-optimization: a rendered empty view
25
+ * still sits in the accessibility tree and can take screen-reader focus ahead of
26
+ * real content. `null` leaves the tree entirely (UX-003).
27
+ *
28
+ * The provider owns the banner's whole lifecycle through its own component, so
29
+ * this adapts those callbacks into the normalized event model instead of routing
30
+ * a banner through the load/show handle model, which does not fit it.
31
+ */
32
+
33
+ function AdsBanner({
34
+ placementKey,
35
+ onStateChange,
36
+ style
37
+ }) {
38
+ const ads = (0, _AdsProvider.useAds)();
39
+ // The instance's banner wiring (ADS-13). An instance the app wrote by hand has
40
+ // none, and is treated like a missing one.
41
+ const internals = (0, _react.useMemo)(() => ads ? (0, _adsInstance.getInternals)(ads) : null, [ads]);
42
+ // The throttle token for this mount: stable across renders and minted by React
43
+ // rather than by a counter, so a render that runs twice charges one slot.
44
+ const mountToken = (0, _react.useId)();
45
+ // The reported state lives in a ref rather than in component state: the host
46
+ // itself renders the same tree for every state, so storing it would only
47
+ // force re-renders the PERF-002 budget does not need to spend. The instance
48
+ // holds the authoritative value; `onStateChange` tells the app.
49
+ const stateRef = (0, _react.useRef)('idle');
50
+ const [containerWidth, setContainerWidth] = (0, _react.useState)(0);
51
+ // A new cycle id remounts the provider component, which is how a width change
52
+ // produces a genuinely re-adapted banner rather than a stretched old one.
53
+ const [cycle, setCycle] = (0, _react.useState)(0);
54
+ const correlationRef = (0, _react.useRef)(null);
55
+ // Whether the current correlation already reported `loaded`. The provider
56
+ // auto-refreshes a banner inside one mount; each refresh is a new cycle.
57
+ const loadedInCycleRef = (0, _react.useRef)(false);
58
+ const startedAtRef = (0, _react.useRef)(0);
59
+ // Whether this mount has already taken a throttle slot, and the refusal if it
60
+ // was refused. Resets with the mount, which is exactly the granularity FR-140
61
+ // needs.
62
+ const throttleRef = (0, _react.useRef)({
63
+ decided: false,
64
+ refusal: null
65
+ });
66
+ // Which attempt this mount is on. A refused mount asks again once the window
67
+ // passes (ADS-06), and each attempt needs its own token: the throttle replays
68
+ // the stored verdict for a token it has seen.
69
+ const throttleAttemptRef = (0, _react.useRef)(0);
70
+
71
+ // The engine's banner component (ADS-12): the host never names the provider.
72
+ const banner = (0, _react.useMemo)(() => internals?.banner() ?? null, [internals]);
73
+ // Initialization is asynchronous and a banner is almost always mounted before
74
+ // it finishes. Without this the resolution below would be computed once, while
75
+ // the instance was still `not_started`, be refused, and never be retried — the
76
+ // banner would sit at `unavailable` forever on a perfectly healthy app.
77
+ const status = (0, _hooks.useAdsStatus)();
78
+
79
+ // Keyed on `cycle` so a genuine width change starts a new, separately traceable
80
+ // load (FR-038, FR-052), and on `status` so the banner recovers the moment the
81
+ // instance becomes able to request. Pure: the cycle's correlation id is minted
82
+ // in the effect that starts it, not here (ADS-20).
83
+ const resolved = (0, _react.useMemo)(() => internals && status === 'ready' ? {
84
+ cycle,
85
+ value: internals.resolveBanner(placementKey)
86
+ } : null, [internals, placementKey, cycle, status]);
87
+ const resolution = resolved?.value ?? null;
88
+ const move = (0, _react.useCallback)(next => {
89
+ if (stateRef.current === next) {
90
+ return;
91
+ }
92
+ stateRef.current = next;
93
+ internals?.setPlacementState(placementKey, next);
94
+ onStateChange?.(next);
95
+ }, [internals, onStateChange, placementKey]);
96
+
97
+ // FR-140. Decided **during render**, not in the effect below, because the
98
+ // provider component requests an ad as part of this very render — an effect
99
+ // would refuse a request that had already gone out.
100
+ //
101
+ // Charged once per mount, guarded by the ref. That granularity is the whole
102
+ // distinction the throttle turns on: a fresh mount is the navigation burst it
103
+ // exists to stop (swiping between days, switching tabs, a row scrolling in and
104
+ // out), while a later cycle in the *same* mount is a width re-adaptation —
105
+ // rotation — which must not be refused or a rotated screen loses its banner
106
+ // for up to a minute.
107
+ if (internals && resolution?.ok && containerWidth > 0 && !throttleRef.current.decided) {
108
+ throttleRef.current = {
109
+ decided: true,
110
+ refusal: internals.commitBannerRequest(placementKey, `${mountToken}:${throttleAttemptRef.current}`)
111
+ };
112
+ }
113
+ const throttleRefusal = throttleRef.current.refusal;
114
+ const usable = Boolean(internals && banner && resolution?.ok && containerWidth > 0 && !throttleRefusal);
115
+ (0, _react.useEffect)(() => {
116
+ if (!internals || !banner) {
117
+ move('unavailable');
118
+ return;
119
+ }
120
+ // `not_started` and `initializing` are transient: the app is still on its
121
+ // way and the banner will resolve shortly, so report `idle` rather than
122
+ // `unavailable` and let the app keep its layout decision open. Every other
123
+ // non-ready status — disabled, blocked, failed, unsupported — means there
124
+ // will be no ad, and the app should reclaim the space (FR-039, FR-042).
125
+ //
126
+ // `undecided` is the exception added in 0.2.0, and it is the entire reason
127
+ // the third state exists. It is reported as itself rather than folded into
128
+ // either neighbour: `idle` would say "an ad is coming", which is not known
129
+ // yet, and `unavailable` would say "there will be none", which is also not
130
+ // known. Only by reporting it honestly can the app decide whether to hold
131
+ // the space — the choice that keeps a paying user from watching an ad
132
+ // flash in and out (FR-116).
133
+ if (status !== 'ready') {
134
+ move(status === 'undecided' ? 'undecided' : status === 'not_started' || status === 'initializing' ? 'idle' : 'unavailable');
135
+ return;
136
+ }
137
+ if (!resolution?.ok) {
138
+ move('unavailable');
139
+ return;
140
+ }
141
+ if (containerWidth <= 0) {
142
+ // FR-039: a zero-width container is reported rather than turned into a
143
+ // request for an ad at a nonsensical size.
144
+ move('idle');
145
+ return;
146
+ }
147
+ // The slot was taken during render; here is where the refusal becomes
148
+ // observable. Reported as `throttled` rather than folded into
149
+ // `unavailable`: that would say "there will be no ad here", when in fact
150
+ // this placement asked too recently and will work again shortly. Most apps
151
+ // collapse the space for both, but only one is worth investigating.
152
+ if (throttleRefusal) {
153
+ move('throttled');
154
+ internals.emit({
155
+ type: 'request_throttled',
156
+ timestamp: internals.now(),
157
+ placementKey,
158
+ format: 'banner',
159
+ retryAfterMs: throttleRefusal.retryAfterMs,
160
+ minRequestIntervalMs: internals.throttleFloorFor(placementKey)
161
+ });
162
+ // ADS-06: ask again in this same mount once the window has passed. Until
163
+ // 0.7.0 a refused banner stayed empty until it was remounted, so a banner
164
+ // pinned to a screen the user returned to within a minute never filled.
165
+ return internals.schedule(throttleRefusal.retryAfterMs, () => {
166
+ throttleRef.current = {
167
+ decided: false,
168
+ refusal: null
169
+ };
170
+ throttleAttemptRef.current += 1;
171
+ setCycle(value => value + 1);
172
+ });
173
+ }
174
+ const correlationId = internals.nextCorrelationId();
175
+ correlationRef.current = correlationId;
176
+ loadedInCycleRef.current = false;
177
+ startedAtRef.current = internals.now();
178
+ move('loading');
179
+ internals.emit({
180
+ type: 'load_started',
181
+ timestamp: startedAtRef.current,
182
+ placementKey,
183
+ format: 'banner',
184
+ correlationId
185
+ });
186
+ // Deliberately keyed on `cycle`, not on every render: FR-041 forbids a
187
+ // re-render from producing a second uncontrolled request.
188
+ // eslint-disable-next-line react-hooks/exhaustive-deps
189
+ }, [internals, banner, status, resolution, containerWidth, cycle]);
190
+ const onLayout = (0, _react.useCallback)(event => {
191
+ const width = Math.round(event.nativeEvent.layout.width);
192
+ setContainerWidth(previous => {
193
+ if (previous === width) {
194
+ return previous;
195
+ }
196
+ // FR-038: a genuine width or orientation change re-adapts. The
197
+ // rounding above stops sub-pixel layout jitter from doing so.
198
+ if (previous > 0 && width > 0) {
199
+ setCycle(value => value + 1);
200
+ }
201
+ return width;
202
+ });
203
+ }, []);
204
+ const emit = (0, _react.useCallback)(event => {
205
+ internals?.emit(event);
206
+ }, [internals]);
207
+ const clock = (0, _react.useCallback)(() => internals?.now() ?? Date.now(), [internals]);
208
+ const handleLoaded = (0, _react.useCallback)(() => {
209
+ // A second load in one correlation is the provider's auto-refresh: a new
210
+ // ad, so a new cycle. Under the old correlation its `loaded` and
211
+ // `impression` were deduplicated away and revenue went uncounted (ADS-05).
212
+ // For a refresh, `durationMs` is the time since the previous load.
213
+ if (loadedInCycleRef.current && internals) {
214
+ correlationRef.current = internals.nextCorrelationId();
215
+ }
216
+ loadedInCycleRef.current = true;
217
+ const loadedAt = clock();
218
+ move('ready');
219
+ emit({
220
+ type: 'loaded',
221
+ timestamp: loadedAt,
222
+ placementKey,
223
+ format: 'banner',
224
+ correlationId: correlationRef.current ?? undefined,
225
+ durationMs: loadedAt - startedAtRef.current
226
+ });
227
+ startedAtRef.current = loadedAt;
228
+ }, [internals, clock, emit, move, placementKey]);
229
+ const handleFailed = (0, _react.useCallback)((error, kind) => {
230
+ const normalized = (0, _errors.normalizeProviderError)(error, {
231
+ operation: 'load',
232
+ placementKey,
233
+ format: 'banner'
234
+ }, kind);
235
+ move('failed');
236
+ emit({
237
+ type: 'load_failed',
238
+ timestamp: clock(),
239
+ placementKey,
240
+ format: 'banner',
241
+ correlationId: correlationRef.current ?? undefined,
242
+ error: normalized
243
+ });
244
+ }, [clock, emit, move, placementKey]);
245
+ const handleImpression = (0, _react.useCallback)(() => {
246
+ emit({
247
+ type: 'impression',
248
+ timestamp: clock(),
249
+ placementKey,
250
+ format: 'banner',
251
+ correlationId: correlationRef.current ?? undefined,
252
+ // A real provider impression, unlike the derived one full-screen
253
+ // formats get. The distinction is load-bearing for revenue
254
+ // reconciliation, so it is recorded rather than flattened (R5).
255
+ source: 'provider'
256
+ });
257
+ }, [clock, emit, placementKey]);
258
+ const handleClicked = (0, _react.useCallback)(() => {
259
+ emit({
260
+ type: 'click',
261
+ timestamp: clock(),
262
+ placementKey,
263
+ format: 'banner',
264
+ correlationId: correlationRef.current ?? undefined
265
+ });
266
+ }, [clock, emit, placementKey]);
267
+
268
+ // FR-041: nothing survives unmount. No retained native view, no dangling
269
+ // correlation, no state written into a disposed instance.
270
+ (0, _react.useEffect)(() => {
271
+ return () => {
272
+ correlationRef.current = null;
273
+ };
274
+ }, []);
275
+ if (!internals || !banner) {
276
+ // FR-042, UX-003 — out of the tree entirely, blocking no touch.
277
+ return null;
278
+ }
279
+
280
+ // A terminal non-ready status means there will be no ad at all, so leave the
281
+ // tree rather than render an empty host. `not_started` and `initializing` are
282
+ // excluded on purpose: the host must stay mounted through them, because it is
283
+ // what measures the container and starts the load once the instance is ready.
284
+ //
285
+ // `undecided` is excluded for the same reason: the app may still resolve it to
286
+ // enabled, and a host that unmounted would have to re-measure the container
287
+ // from scratch when it did. It renders no ad meanwhile — it renders the same
288
+ // empty measuring host it renders while initializing — and it reports
289
+ // `undecided` so the app can size the space it decided to keep.
290
+ if (status === 'disabled' || status === 'unavailable' || status === 'failed') {
291
+ return null;
292
+ }
293
+ if (resolution && !resolution.ok) {
294
+ const refusal = resolution.result;
295
+ // `undecided` deliberately absent: unlike `disabled`, it is not a settled
296
+ // no, so the host stays mounted (FR-116).
297
+ if (refusal.status === 'disabled' || refusal.status === 'unavailable') {
298
+ return null;
299
+ }
300
+ }
301
+ const BannerComponent = banner.Component;
302
+ const adUnitId = resolution?.ok ? resolution.adUnitId : null;
303
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
304
+ style: style,
305
+ onLayout: onLayout,
306
+ testID: `ads-banner-${placementKey}`,
307
+ children: usable && adUnitId && resolution?.ok ? /*#__PURE__*/(0, _jsxRuntime.jsx)(BannerComponent, {
308
+ adUnitId: adUnitId,
309
+ personalizedAds: resolution.personalizedAds,
310
+ onLoaded: handleLoaded,
311
+ onFailed: handleFailed,
312
+ onImpression: handleImpression,
313
+ onClicked: handleClicked
314
+ }, `${placementKey}-${cycle}`) : null
315
+ });
316
+ }
317
+ //# sourceMappingURL=AdsBanner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_errors","_AdsProvider","_adsInstance","_hooks","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","AdsBanner","placementKey","onStateChange","style","ads","useAds","internals","useMemo","getInternals","mountToken","useId","stateRef","useRef","containerWidth","setContainerWidth","useState","cycle","setCycle","correlationRef","loadedInCycleRef","startedAtRef","throttleRef","decided","refusal","throttleAttemptRef","banner","status","useAdsStatus","resolved","value","resolveBanner","resolution","move","useCallback","next","current","setPlacementState","ok","commitBannerRequest","throttleRefusal","usable","Boolean","useEffect","emit","type","timestamp","now","format","retryAfterMs","minRequestIntervalMs","throttleFloorFor","schedule","correlationId","nextCorrelationId","onLayout","event","width","Math","round","nativeEvent","layout","previous","clock","Date","handleLoaded","loadedAt","undefined","durationMs","handleFailed","error","kind","normalized","normalizeProviderError","operation","handleImpression","source","handleClicked","result","BannerComponent","Component","adUnitId","jsx","View","testID","children","personalizedAds","onLoaded","onFailed","onImpression","onClicked"],"sourceRoot":"../../../src","sources":["react/AdsBanner.tsx"],"mappings":";;;;;;AAkBA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,OAAA,GAAAF,OAAA;AAGA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAAuC,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAD,wBAAAQ,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAV,uBAAA,YAAAA,CAAAQ,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAA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