@24i/bigscreen-sdk 1.0.34 → 1.0.35-alpha.2578

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 (1081) hide show
  1. package/README.md +47 -47
  2. package/__mocks__/@24i/bigscreen-sdk/animations.ts +2 -2
  3. package/package.json +1 -1
  4. package/packages/adobe-heartbeat/README.md +46 -46
  5. package/packages/adobe-heartbeat/src/AdobeHeartbeat.ts +244 -244
  6. package/packages/adobe-heartbeat/src/__external__/Adobe/Adobe.d.ts +24 -24
  7. package/packages/adobe-heartbeat/src/__external__/Adobe/MediaSDK.min.d.ts +126 -126
  8. package/packages/adobe-heartbeat/src/__external__/Adobe/MediaSDK.min.js +76 -76
  9. package/packages/adobe-heartbeat/src/index.ts +5 -5
  10. package/packages/adobe-heartbeat/src/types.ts +67 -67
  11. package/packages/analytics/README.md +7 -7
  12. package/packages/analytics/src/A.ts +1 -1
  13. package/packages/analytics/src/Analytics.ts +1 -1
  14. package/packages/analytics/src/analyticsOnScroll.ts +1 -1
  15. package/packages/analytics/src/clients/ConsoleAnalytics/ConsoleAnalytics.ts +1 -1
  16. package/packages/analytics/src/clients/ConsoleAnalytics/index.ts +1 -1
  17. package/packages/analytics/src/clients/GoogleAnalytics/GoogleAnalytics.ts +200 -200
  18. package/packages/analytics/src/clients/GoogleAnalytics/constants.ts +118 -118
  19. package/packages/analytics/src/clients/GoogleAnalytics/getUrl.ts +17 -17
  20. package/packages/analytics/src/clients/GoogleAnalytics/index.ts +2 -2
  21. package/packages/analytics/src/clients/GoogleAnalytics/interface.ts +77 -77
  22. package/packages/analytics/src/clients/GoogleAnalytics/mapPayload.ts +50 -50
  23. package/packages/analytics/src/clients/GoogleAnalytics/prepareBody.ts +14 -14
  24. package/packages/analytics/src/clients/TealiumAnalytics/TealiumAnalytics.ts +161 -161
  25. package/packages/analytics/src/clients/TealiumAnalytics/constants.ts +102 -102
  26. package/packages/analytics/src/clients/TealiumAnalytics/index.ts +3 -3
  27. package/packages/analytics/src/clients/TealiumAnalytics/interface.ts +33 -33
  28. package/packages/analytics/src/clients/TealiumAnalytics/mappers/__mocks__/mediaPayload.ts +40 -40
  29. package/packages/analytics/src/clients/TealiumAnalytics/mappers/helper.ts +21 -21
  30. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapAppError.ts +14 -14
  31. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapFavoriteAdd.ts +11 -11
  32. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapFavoriteRemove.ts +11 -11
  33. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapPlayerClose.ts +15 -15
  34. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapPlayerOpen.ts +15 -15
  35. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSceneView.ts +15 -15
  36. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSearch.ts +18 -18
  37. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSearchFailed.ts +8 -8
  38. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSearchSuccess.ts +8 -8
  39. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoPause.ts +15 -15
  40. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoProgress.ts +18 -18
  41. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoResume.ts +15 -15
  42. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoStart.ts +15 -15
  43. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoStop.ts +15 -15
  44. package/packages/analytics/src/clients/TealiumAnalytics/types.ts +139 -139
  45. package/packages/analytics/src/clients/TwentyFourIQ/TwentyFourIQClient.ts +116 -116
  46. package/packages/analytics/src/clients/TwentyFourIQ/constants.ts +99 -99
  47. package/packages/analytics/src/clients/TwentyFourIQ/helper.ts +34 -34
  48. package/packages/analytics/src/clients/TwentyFourIQ/index.ts +2 -2
  49. package/packages/analytics/src/clients/TwentyFourIQ/interface.ts +31 -31
  50. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapAdLoaded.ts +13 -13
  51. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapAdSkipped.ts +16 -16
  52. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapBase.ts +21 -21
  53. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapBuffering.ts +15 -15
  54. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapPlayerClose.ts +24 -24
  55. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapPlayerOpen.ts +18 -18
  56. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapSceneView.ts +15 -15
  57. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapScroll.ts +17 -17
  58. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoComplete.ts +21 -21
  59. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoPause.ts +24 -24
  60. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoProgress.ts +24 -24
  61. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoStart.ts +34 -34
  62. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoStop.ts +32 -32
  63. package/packages/analytics/src/clients/TwentyFourIQ/types.ts +115 -115
  64. package/packages/analytics/src/constants.ts +1 -1
  65. package/packages/analytics/src/index.ts +3 -3
  66. package/packages/analytics/src/interface.ts +1 -1
  67. package/packages/analytics/src/utils/generateSessionId.ts +8 -8
  68. package/packages/animations/README.md +85 -85
  69. package/packages/animations/src/AnimationUtils.ts +238 -238
  70. package/packages/animations/src/JSAnimations.ts +144 -144
  71. package/packages/animations/src/__mocks__/JSAnimations.ts +30 -30
  72. package/packages/animations/src/index.ts +3 -3
  73. package/packages/announcement-banner/README.md +49 -49
  74. package/packages/announcement-banner/src/AnnouncementBanner.scss +8 -8
  75. package/packages/announcement-banner/src/AnnouncementBanner.tsx +136 -136
  76. package/packages/announcement-banner/src/index.ts +1 -1
  77. package/packages/async-image/README.md +47 -47
  78. package/packages/async-image/src/AsyncImage.tsx +101 -101
  79. package/packages/async-image/src/index.ts +2 -2
  80. package/packages/conviva/README.md +47 -47
  81. package/packages/conviva/src/ConvivaSDK.ts +38 -38
  82. package/packages/conviva/src/__mocks__/ConvivaMock.ts +36 -36
  83. package/packages/conviva/src/index.ts +1 -1
  84. package/packages/conviva/src/theoPlugin/ConvivaConviguration.ts +19 -19
  85. package/packages/conviva/src/theoPlugin/__external__/Conviva_4.0.15.js +698 -698
  86. package/packages/conviva/src/theoPlugin/__external__/convivaTheoPlugin.d.ts +7 -7
  87. package/packages/conviva/src/theoPlugin/__external__/convivaTheoPlugin.js +635 -635
  88. package/packages/conviva/src/theoPlugin/convivaTheoPluginWrapper.ts +61 -61
  89. package/packages/conviva/src/theoPlugin/index.ts +2 -2
  90. package/packages/developer-tools/DeveloperConsole/README.md +114 -114
  91. package/packages/developer-tools/DeveloperConsole/index.ts +3 -3
  92. package/packages/developer-tools/DeveloperConsole/unstyled.ts +1 -1
  93. package/packages/developer-tools/DeveloperToolsService/README.md +54 -54
  94. package/packages/developer-tools/DeveloperToolsService/index.ts +3 -3
  95. package/packages/developer-tools/DeveloperToolsService/unstyled.ts +1 -1
  96. package/packages/developer-tools/EnvironmentSelection/README.md +77 -77
  97. package/packages/developer-tools/EnvironmentSelection/index.ts +3 -3
  98. package/packages/developer-tools/EnvironmentSelection/unstyled.ts +1 -1
  99. package/packages/developer-tools/PlayerDebugWindow/README.md +65 -65
  100. package/packages/developer-tools/PlayerDebugWindow/index.ts +3 -3
  101. package/packages/developer-tools/PlayerDebugWindow/unstyled.ts +1 -1
  102. package/packages/developer-tools/README.md +24 -24
  103. package/packages/developer-tools/TechnicalInfo/README.md +90 -90
  104. package/packages/developer-tools/TechnicalInfo/index.ts +9 -9
  105. package/packages/developer-tools/TechnicalInfo/unstyled.ts +6 -6
  106. package/packages/developer-tools/src/DeveloperConsole/ControlButton.tsx +16 -16
  107. package/packages/developer-tools/src/DeveloperConsole/DeveloperConsole.tsx +389 -389
  108. package/packages/developer-tools/src/DeveloperConsole/Panel.tsx +108 -108
  109. package/packages/developer-tools/src/DeveloperConsole/PanelMessage.tsx +33 -33
  110. package/packages/developer-tools/src/DeveloperConsole/helpers/Queue.ts +38 -38
  111. package/packages/developer-tools/src/DeveloperConsole/helpers/index.ts +2 -2
  112. package/packages/developer-tools/src/DeveloperConsole/helpers/instrumentHandler.ts +165 -165
  113. package/packages/developer-tools/src/DeveloperConsole/index.ts +2 -2
  114. package/packages/developer-tools/src/DeveloperConsole/initDeveloperConsole.tsx +8 -8
  115. package/packages/developer-tools/src/DeveloperConsole/styles/DeveloperConsole/DeveloperConsole.scss +91 -91
  116. package/packages/developer-tools/src/DeveloperConsole/styles/DeveloperConsole/DeveloperConsole.styles.1080.scss +2 -2
  117. package/packages/developer-tools/src/DeveloperConsole/styles/DeveloperConsole/DeveloperConsole.styles.scss +2 -2
  118. package/packages/developer-tools/src/DeveloperConsole/styles/DeveloperConsole/_sizes.1080.scss +16 -16
  119. package/packages/developer-tools/src/DeveloperConsole/styles/DeveloperConsole/_sizes.scss +16 -16
  120. package/packages/developer-tools/src/DeveloperConsole/styles/Panel/Panel.scss +87 -87
  121. package/packages/developer-tools/src/DeveloperConsole/styles/Panel/Panel.styles.1080.scss +2 -2
  122. package/packages/developer-tools/src/DeveloperConsole/styles/Panel/Panel.styles.scss +2 -2
  123. package/packages/developer-tools/src/DeveloperConsole/styles/Panel/_sizes.1080.scss +9 -9
  124. package/packages/developer-tools/src/DeveloperConsole/styles/Panel/_sizes.scss +9 -9
  125. package/packages/developer-tools/src/DeveloperConsole/styles.ts +2 -2
  126. package/packages/developer-tools/src/DeveloperConsole/types.ts +49 -49
  127. package/packages/developer-tools/src/DeveloperConsole/utils/formatTime.ts +13 -13
  128. package/packages/developer-tools/src/DeveloperConsole/utils/index.ts +3 -3
  129. package/packages/developer-tools/src/DeveloperConsole/utils/stringify.ts +10 -10
  130. package/packages/developer-tools/src/DeveloperConsole/utils/styles.ts +24 -24
  131. package/packages/developer-tools/src/DeveloperToolsService/DeveloperToolItem.tsx +21 -21
  132. package/packages/developer-tools/src/DeveloperToolsService/DeveloperToolsList.tsx +125 -125
  133. package/packages/developer-tools/src/DeveloperToolsService/DeveloperToolsService.tsx +122 -122
  134. package/packages/developer-tools/src/DeveloperToolsService/index.ts +1 -1
  135. package/packages/developer-tools/src/DeveloperToolsService/styles/DeveloperToolsService.scss +64 -64
  136. package/packages/developer-tools/src/DeveloperToolsService/styles/DeveloperToolsService.styles.1080.scss +2 -2
  137. package/packages/developer-tools/src/DeveloperToolsService/styles/DeveloperToolsService.styles.animated.1080.scss +3 -3
  138. package/packages/developer-tools/src/DeveloperToolsService/styles/DeveloperToolsService.styles.animated.scss +4 -4
  139. package/packages/developer-tools/src/DeveloperToolsService/styles/DeveloperToolsService.styles.scss +2 -2
  140. package/packages/developer-tools/src/DeveloperToolsService/styles/_animated.scss +5 -5
  141. package/packages/developer-tools/src/DeveloperToolsService/styles/_sizes.1080.scss +16 -16
  142. package/packages/developer-tools/src/DeveloperToolsService/styles/_sizes.scss +16 -16
  143. package/packages/developer-tools/src/DeveloperToolsService/styles.ts +1 -1
  144. package/packages/developer-tools/src/EnvironmentSelection/EnvironmentList.tsx +90 -90
  145. package/packages/developer-tools/src/EnvironmentSelection/EnvironmentListItem.tsx +106 -106
  146. package/packages/developer-tools/src/EnvironmentSelection/EnvironmentSelection.tsx +102 -102
  147. package/packages/developer-tools/src/EnvironmentSelection/assets/checkmark.svg +18 -18
  148. package/packages/developer-tools/src/EnvironmentSelection/config.ts +43 -43
  149. package/packages/developer-tools/src/EnvironmentSelection/constants.ts +1 -1
  150. package/packages/developer-tools/src/EnvironmentSelection/index.ts +2 -2
  151. package/packages/developer-tools/src/EnvironmentSelection/sizes.1080.ts +5 -5
  152. package/packages/developer-tools/src/EnvironmentSelection/sizes.ts +5 -5
  153. package/packages/developer-tools/src/EnvironmentSelection/styles/EnvironmentSelection.scss +141 -141
  154. package/packages/developer-tools/src/EnvironmentSelection/styles/EnvironmentSelection.styles.1080.scss +2 -2
  155. package/packages/developer-tools/src/EnvironmentSelection/styles/EnvironmentSelection.styles.animated.1080.scss +3 -3
  156. package/packages/developer-tools/src/EnvironmentSelection/styles/EnvironmentSelection.styles.animated.scss +3 -3
  157. package/packages/developer-tools/src/EnvironmentSelection/styles/EnvironmentSelection.styles.scss +2 -2
  158. package/packages/developer-tools/src/EnvironmentSelection/styles/_animated.scss +9 -9
  159. package/packages/developer-tools/src/EnvironmentSelection/styles/_sizes.1080.scss +26 -26
  160. package/packages/developer-tools/src/EnvironmentSelection/styles/_sizes.scss +26 -26
  161. package/packages/developer-tools/src/EnvironmentSelection/styles.ts +1 -1
  162. package/packages/developer-tools/src/EnvironmentSelection/types.ts +10 -10
  163. package/packages/developer-tools/src/EnvironmentSelection/utils/format.ts +4 -4
  164. package/packages/developer-tools/src/IDeveloperTool.ts +14 -14
  165. package/packages/developer-tools/src/PlayerDebugWindow/PlayerDebugWindow.tsx +115 -115
  166. package/packages/developer-tools/src/PlayerDebugWindow/constants.ts +128 -128
  167. package/packages/developer-tools/src/PlayerDebugWindow/index.ts +1 -1
  168. package/packages/developer-tools/src/PlayerDebugWindow/styles/PlayerDebugWindow.scss +29 -29
  169. package/packages/developer-tools/src/PlayerDebugWindow/styles/PlayerDebugWindow.styles.1080.scss +2 -2
  170. package/packages/developer-tools/src/PlayerDebugWindow/styles/PlayerDebugWindow.styles.scss +2 -2
  171. package/packages/developer-tools/src/PlayerDebugWindow/styles/_sizes.1080.scss +11 -11
  172. package/packages/developer-tools/src/PlayerDebugWindow/styles/_sizes.scss +11 -11
  173. package/packages/developer-tools/src/PlayerDebugWindow/styles.ts +1 -1
  174. package/packages/developer-tools/src/TechnicalInfo/ITechnicalInfoProvider.ts +5 -5
  175. package/packages/developer-tools/src/TechnicalInfo/TechnicalInfo.tsx +125 -125
  176. package/packages/developer-tools/src/TechnicalInfo/TechnicalInfoDetail.tsx +77 -77
  177. package/packages/developer-tools/src/TechnicalInfo/TechnicalInfoProvider.ts +349 -349
  178. package/packages/developer-tools/src/TechnicalInfo/__mocks__/Device.ts +55 -55
  179. package/packages/developer-tools/src/TechnicalInfo/__mocks__/Player.ts +7 -7
  180. package/packages/developer-tools/src/TechnicalInfo/__mocks__/Storage.ts +9 -9
  181. package/packages/developer-tools/src/TechnicalInfo/icons/arrow-down.svg +18 -18
  182. package/packages/developer-tools/src/TechnicalInfo/icons/arrow-up.svg +18 -18
  183. package/packages/developer-tools/src/TechnicalInfo/index.ts +5 -5
  184. package/packages/developer-tools/src/TechnicalInfo/sizes.1080.ts +1 -1
  185. package/packages/developer-tools/src/TechnicalInfo/sizes.ts +1 -1
  186. package/packages/developer-tools/src/TechnicalInfo/styles/TechnicalInfo.scss +187 -187
  187. package/packages/developer-tools/src/TechnicalInfo/styles/TechnicalInfo.styles.1080.scss +2 -2
  188. package/packages/developer-tools/src/TechnicalInfo/styles/TechnicalInfo.styles.animated.1080.scss +3 -3
  189. package/packages/developer-tools/src/TechnicalInfo/styles/TechnicalInfo.styles.animated.scss +3 -3
  190. package/packages/developer-tools/src/TechnicalInfo/styles/TechnicalInfo.styles.scss +2 -2
  191. package/packages/developer-tools/src/TechnicalInfo/styles/_animated.scss +16 -16
  192. package/packages/developer-tools/src/TechnicalInfo/styles/_sizes.1080.scss +50 -50
  193. package/packages/developer-tools/src/TechnicalInfo/styles/_sizes.scss +50 -50
  194. package/packages/developer-tools/src/TechnicalInfo/styles.ts +1 -1
  195. package/packages/developer-tools/src/TechnicalInfo/translations.ts +79 -79
  196. package/packages/developer-tools/src/TechnicalInfo/utils/eme01bSupport.ts +58 -58
  197. package/packages/developer-tools/src/TechnicalInfo/utils/emeSupport.ts +84 -84
  198. package/packages/developer-tools/src/TechnicalInfo/utils/formatTimezone.ts +15 -15
  199. package/packages/developer-tools/src/TechnicalInfo/utils/mseSupport.ts +14 -14
  200. package/packages/developer-tools/src/utils/reload.ts +6 -6
  201. package/packages/device/README.md +219 -219
  202. package/packages/device/keymap.ts +1 -1
  203. package/packages/device/resolver/index.ts +2 -2
  204. package/packages/device/resolver/keymap.ts +1 -1
  205. package/packages/device/src/DeviceEventMap.ts +1 -1
  206. package/packages/device/src/device.ts +6 -6
  207. package/packages/device/src/driver/index.android.tv.ts +1 -1
  208. package/packages/device/src/driver/index.entone.ts +1 -1
  209. package/packages/device/src/driver/index.firetv.ts +1 -1
  210. package/packages/device/src/driver/index.hbbtv.tv.ts +1 -1
  211. package/packages/device/src/driver/index.kreatv.ts +1 -1
  212. package/packages/device/src/driver/index.saphi.tv.ts +1 -1
  213. package/packages/device/src/driver/index.smartcast.tv.ts +1 -1
  214. package/packages/device/src/driver/index.tizen.tv.ts +1 -1
  215. package/packages/device/src/driver/index.ts +1 -1
  216. package/packages/device/src/driver/index.vidaa.tv.ts +1 -1
  217. package/packages/device/src/driver/index.webos.tv.ts +1 -1
  218. package/packages/device/src/getKeyDigit.ts +35 -35
  219. package/packages/device/src/getKeyMap.ts +4 -4
  220. package/packages/device/src/index.ts +8 -8
  221. package/packages/device/src/isClickOrEnter.ts +3 -3
  222. package/packages/device/src/resolver/index.ts +2 -2
  223. package/packages/device/src/resolver/resolver.ts +84 -84
  224. package/packages/digital-clock/README.md +26 -26
  225. package/packages/digital-clock/src/DigitalClock.tsx +78 -78
  226. package/packages/digital-clock/src/index.ts +1 -1
  227. package/packages/driver-androidtv/src/DeviceAndroidTV.ts +224 -224
  228. package/packages/driver-androidtv/src/__mocks__/javaScriptBridge.ts +36 -36
  229. package/packages/driver-androidtv/src/formatUserAgent.ts +11 -11
  230. package/packages/driver-androidtv/src/index.ts +1 -1
  231. package/packages/driver-androidtv/src/keymap.ts +27 -27
  232. package/packages/driver-androidtv/src/types.ts +113 -113
  233. package/packages/driver-base/DeviceBase.md +139 -139
  234. package/packages/driver-base/README.md +44 -44
  235. package/packages/driver-base/src/ConnectionType.ts +1 -1
  236. package/packages/driver-base/src/DeviceBase.ts +279 -279
  237. package/packages/driver-base/src/KeyMap/Key.ts +48 -48
  238. package/packages/driver-base/src/KeyMap/KeyMap.ts +390 -390
  239. package/packages/driver-base/src/KeyMap/generateKeyCodeKeyMap.ts +11 -11
  240. package/packages/driver-base/src/KeyMap/index.ts +5 -5
  241. package/packages/driver-base/src/KeyMap/interface.ts +8 -8
  242. package/packages/driver-base/src/KeyMap/overrideValues.ts +17 -17
  243. package/packages/driver-base/src/KeyMap/switchByKey.ts +18 -18
  244. package/packages/driver-base/src/ScreenSize.ts +1 -1
  245. package/packages/driver-base/src/VolumeRange.ts +5 -5
  246. package/packages/driver-base/src/__mocks__/DeviceBase.ts +100 -100
  247. package/packages/driver-base/src/__mocks__/keyMap.ts +42 -42
  248. package/packages/driver-base/src/bindPreventDefaultEvent.ts +5 -5
  249. package/packages/driver-base/src/errors.ts +32 -32
  250. package/packages/driver-base/src/index.ts +10 -10
  251. package/packages/driver-base/src/loadObject.ts +30 -30
  252. package/packages/driver-base/src/types/DeviceEvent.ts +11 -11
  253. package/packages/driver-base/src/types/ExitOptions.ts +1 -1
  254. package/packages/driver-base/src/types/KeycodeKeyMap.ts +86 -86
  255. package/packages/driver-base/src/types/ScreenSaverStatus.ts +3 -3
  256. package/packages/driver-base/src/utils.ts +10 -10
  257. package/packages/driver-browser/src/DeviceBrowser.ts +170 -170
  258. package/packages/driver-browser/src/getBrowser.ts +51 -51
  259. package/packages/driver-browser/src/getOsName.ts +30 -30
  260. package/packages/driver-browser/src/index.ts +1 -1
  261. package/packages/driver-browser/src/keymap.ts +22 -22
  262. package/packages/driver-browser/src/patchSuitestKeys.ts +27 -27
  263. package/packages/driver-entone/README.md +9 -9
  264. package/packages/driver-entone/src/DeviceEntone.ts +232 -232
  265. package/packages/driver-entone/src/IEntone.ts +460 -460
  266. package/packages/driver-entone/src/__mocks__/entone.ts +177 -177
  267. package/packages/driver-entone/src/constants.ts +73 -73
  268. package/packages/driver-entone/src/index.ts +1 -1
  269. package/packages/driver-entone/src/keymap.ts +57 -57
  270. package/packages/driver-firetv/src/DeviceFireTV.ts +18 -18
  271. package/packages/driver-firetv/src/__mocks__/javaScriptBridge.ts +36 -36
  272. package/packages/driver-firetv/src/index.ts +1 -1
  273. package/packages/driver-hbbtv/src/DeviceHbbTV.ts +313 -313
  274. package/packages/driver-hbbtv/src/__mocks__/hbbtv.ts +17 -17
  275. package/packages/driver-hbbtv/src/constants.ts +28 -28
  276. package/packages/driver-hbbtv/src/deviceInfo.ts +23 -23
  277. package/packages/driver-hbbtv/src/getVersion.ts +16 -16
  278. package/packages/driver-hbbtv/src/index.ts +1 -1
  279. package/packages/driver-hbbtv/src/keymap.ts +45 -45
  280. package/packages/driver-hbbtv/src/types.ts +366 -366
  281. package/packages/driver-kreatv/src/DeviceKreaTV.ts +271 -271
  282. package/packages/driver-kreatv/src/IToi.ts +379 -379
  283. package/packages/driver-kreatv/src/__mocks__/toi2.ts +76 -76
  284. package/packages/driver-kreatv/src/__mocks__/toi3.ts +43 -43
  285. package/packages/driver-kreatv/src/index.ts +1 -1
  286. package/packages/driver-kreatv/src/keymap.ts +31 -31
  287. package/packages/driver-kreatv/src/toi2.ts +107 -107
  288. package/packages/driver-kreatv/src/toi3.ts +102 -102
  289. package/packages/driver-kreatv/src/types.ts +35 -35
  290. package/packages/driver-saphi/src/DeviceSaphi.ts +144 -144
  291. package/packages/driver-saphi/src/__mocks__/SmartTvA_API.ts +11 -11
  292. package/packages/driver-saphi/src/__mocks__/userAgent.ts +4 -4
  293. package/packages/driver-saphi/src/constants.ts +1 -1
  294. package/packages/driver-saphi/src/formatUserAgent.ts +19 -19
  295. package/packages/driver-saphi/src/index.ts +1 -1
  296. package/packages/driver-saphi/src/keymap.ts +64 -64
  297. package/packages/driver-saphi/src/types.ts +75 -75
  298. package/packages/driver-smartcast/src/DeviceSmartCast.ts +316 -310
  299. package/packages/driver-smartcast/src/__mocks__/api.ts +49 -49
  300. package/packages/driver-smartcast/src/index.ts +1 -1
  301. package/packages/driver-smartcast/src/keymap.ts +9 -9
  302. package/packages/driver-smartcast/src/types.ts +65 -65
  303. package/packages/driver-tizen/src/DeviceTizen.ts +298 -298
  304. package/packages/driver-tizen/src/ITizen.ts +212 -212
  305. package/packages/driver-tizen/src/IWebapis.ts +95 -95
  306. package/packages/driver-tizen/src/TizenKeys.ts +96 -96
  307. package/packages/driver-tizen/src/__mocks__/tizen.ts +35 -35
  308. package/packages/driver-tizen/src/constants.ts +197 -197
  309. package/packages/driver-tizen/src/index.ts +1 -1
  310. package/packages/driver-tizen/src/types.ts +14 -14
  311. package/packages/driver-vidaa/src/DeviceVidaa.ts +141 -141
  312. package/packages/driver-vidaa/src/__mocks__/vidaa.ts +21 -21
  313. package/packages/driver-vidaa/src/constants.ts +8 -8
  314. package/packages/driver-vidaa/src/formatUserAgent.ts +16 -16
  315. package/packages/driver-vidaa/src/index.ts +1 -1
  316. package/packages/driver-vidaa/src/keymap.ts +56 -56
  317. package/packages/driver-vidaa/src/types.ts +90 -90
  318. package/packages/driver-webos/src/DeviceWebos.ts +313 -313
  319. package/packages/driver-webos/src/__mocks__/webos.ts +172 -172
  320. package/packages/driver-webos/src/constants.ts +20 -20
  321. package/packages/driver-webos/src/index.ts +1 -1
  322. package/packages/driver-webos/src/keymap.ts +10 -10
  323. package/packages/driver-webos/src/types.ts +344 -344
  324. package/packages/driver-webos/src/utils.ts +60 -60
  325. package/packages/driver-webos/src/webOSTVjs/webOSTVjs.js +12 -12
  326. package/packages/driver-xbox/__external__/winjs/directionalnavigation-1.0.0.0.js +1015 -1015
  327. package/packages/driver-xbox/src/DeviceXbox.ts +231 -231
  328. package/packages/driver-xbox/src/__mocks__/Windows.ts +94 -94
  329. package/packages/driver-xbox/src/index.ts +1 -1
  330. package/packages/driver-xbox/src/interfaces.ts +138 -138
  331. package/packages/driver-xbox/src/keymap.ts +96 -96
  332. package/packages/driver-xbox/src/utils.ts +23 -23
  333. package/packages/epg/IMPLEMENTATION.md +228 -228
  334. package/packages/epg/MockGenerator.md +102 -102
  335. package/packages/epg/README.md +585 -585
  336. package/packages/epg/src/v2/Cell.tsx +222 -222
  337. package/packages/epg/src/v2/CellsManager.ts +1 -1
  338. package/packages/epg/src/v2/DataManager.ts +372 -372
  339. package/packages/epg/src/v2/DatePicker.tsx +110 -110
  340. package/packages/epg/src/v2/DateToast/DateToast.scss +28 -28
  341. package/packages/epg/src/v2/DateToast/DateToast.styles.1080.scss +2 -2
  342. package/packages/epg/src/v2/DateToast/DateToast.styles.scss +2 -2
  343. package/packages/epg/src/v2/DateToast/DateToast.tsx +90 -90
  344. package/packages/epg/src/v2/DateToast/_sizes.1080.scss +7 -7
  345. package/packages/epg/src/v2/DateToast/_sizes.scss +7 -7
  346. package/packages/epg/src/v2/DateToast/index.tsx +1 -1
  347. package/packages/epg/src/v2/DateToast/styles.ts +1 -1
  348. package/packages/epg/src/v2/Day.tsx +33 -33
  349. package/packages/epg/src/v2/Epg.tsx +462 -462
  350. package/packages/epg/src/v2/Header.tsx +41 -41
  351. package/packages/epg/src/v2/IdleController.ts +25 -25
  352. package/packages/epg/src/v2/InputEvents.ts +301 -301
  353. package/packages/epg/src/v2/MockGenerator/config.1080.ts +2 -2
  354. package/packages/epg/src/v2/MockGenerator/config.ts +2 -2
  355. package/packages/epg/src/v2/MockGenerator/generator.ts +174 -174
  356. package/packages/epg/src/v2/MockGenerator/index.ts +2 -2
  357. package/packages/epg/src/v2/MockGenerator/mocks/data.ts +102 -102
  358. package/packages/epg/src/v2/MockGenerator/types.ts +25 -25
  359. package/packages/epg/src/v2/MockGenerator/utils.ts +28 -28
  360. package/packages/epg/src/v2/MouseNavigation/MouseNavigation.tsx +88 -88
  361. package/packages/epg/src/v2/MouseNavigation/MouseNavigationFallback.ts +4 -4
  362. package/packages/epg/src/v2/MouseNavigation/index.tizen.tv.ts +1 -1
  363. package/packages/epg/src/v2/MouseNavigation/index.ts +1 -1
  364. package/packages/epg/src/v2/MouseNavigation/index.web.ts +1 -1
  365. package/packages/epg/src/v2/MouseNavigation/index.webos.tv.ts +1 -1
  366. package/packages/epg/src/v2/NowLine.tsx +66 -66
  367. package/packages/epg/src/v2/Program.tsx +58 -58
  368. package/packages/epg/src/v2/ProgramInfo/ProgramInfo.scss +67 -67
  369. package/packages/epg/src/v2/ProgramInfo/ProgramInfo.styles.1080.scss +3 -3
  370. package/packages/epg/src/v2/ProgramInfo/ProgramInfo.styles.animated.1080.scss +2 -2
  371. package/packages/epg/src/v2/ProgramInfo/ProgramInfo.styles.animated.scss +2 -2
  372. package/packages/epg/src/v2/ProgramInfo/ProgramInfo.styles.scss +3 -3
  373. package/packages/epg/src/v2/ProgramInfo/ProgramInfo.tsx +149 -149
  374. package/packages/epg/src/v2/ProgramInfo/_animated.scss +8 -8
  375. package/packages/epg/src/v2/ProgramInfo/_mixins.scss +5 -5
  376. package/packages/epg/src/v2/ProgramInfo/_sizes.1080.scss +21 -21
  377. package/packages/epg/src/v2/ProgramInfo/_sizes.scss +21 -21
  378. package/packages/epg/src/v2/ProgramInfo/index.ts +1 -1
  379. package/packages/epg/src/v2/ProgramInfo/rtl.scss +7 -7
  380. package/packages/epg/src/v2/ProgramInfo/sizes.1080.ts +3 -3
  381. package/packages/epg/src/v2/ProgramInfo/sizes.ts +3 -3
  382. package/packages/epg/src/v2/ProgramInfo/styles.ts +1 -1
  383. package/packages/epg/src/v2/ProgramInfo/utils.ts +28 -28
  384. package/packages/epg/src/v2/Row.tsx +134 -134
  385. package/packages/epg/src/v2/RowsManager.ts +1 -1
  386. package/packages/epg/src/v2/TimeManager.ts +58 -58
  387. package/packages/epg/src/v2/Timeline.ts +1 -1
  388. package/packages/epg/src/v2/TimelineSection.tsx +50 -50
  389. package/packages/epg/src/v2/basic/CellsManager.tsx +300 -300
  390. package/packages/epg/src/v2/basic/RowsManager.tsx +503 -503
  391. package/packages/epg/src/v2/basic/Timeline.tsx +88 -88
  392. package/packages/epg/src/v2/index.ts +1 -1
  393. package/packages/epg/src/v2/interface.ts +1519 -1519
  394. package/packages/epg/src/v2/sizes.1080.ts +2 -2
  395. package/packages/epg/src/v2/sizes.ts +2 -2
  396. package/packages/epg/src/v2/styles/Basic/Basic.scss +116 -116
  397. package/packages/epg/src/v2/styles/Basic/index.ts +1 -1
  398. package/packages/epg/src/v2/styles/Whitelabel/index.ts +1 -1
  399. package/packages/epg/src/v2/utils.ts +40 -40
  400. package/packages/events-manager/src/EventsManager.ts +1 -1
  401. package/packages/events-manager/src/index.ts +2 -2
  402. package/packages/floating-focus/README.md +64 -64
  403. package/packages/floating-focus/src/FloatingFocus.ts +106 -106
  404. package/packages/floating-focus/src/Horizontal.tsx +20 -20
  405. package/packages/floating-focus/src/Vertical.tsx +20 -20
  406. package/packages/floating-focus/src/index.ts +4 -4
  407. package/packages/floating-focus/src/types.ts +20 -20
  408. package/packages/floating-focus/src/utils.ts +43 -43
  409. package/packages/focus/README.md +348 -348
  410. package/packages/focus/src/IFocusable.ts +5 -5
  411. package/packages/focus/src/Layout/Base.tsx +166 -166
  412. package/packages/focus/src/Layout/Horizontal.ts +15 -15
  413. package/packages/focus/src/Layout/Matrix.tsx +357 -357
  414. package/packages/focus/src/Layout/Vertical.ts +12 -12
  415. package/packages/focus/src/Layout/constants.ts +10 -10
  416. package/packages/focus/src/Layout/isRtl.ts +12 -12
  417. package/packages/focus/src/Layout/types.ts +7 -7
  418. package/packages/focus/src/candidate.ts +106 -106
  419. package/packages/focus/src/focusFirstExisting.ts +19 -19
  420. package/packages/focus/src/hasFocus.ts +36 -36
  421. package/packages/focus/src/index.ts +16 -16
  422. package/packages/focus/src/refocusAfterHashChange.ts +19 -19
  423. package/packages/focus/src/safeFocus.ts +15 -15
  424. package/packages/gallup/README.md +27 -27
  425. package/packages/gallup/src/Gallup.ts +80 -80
  426. package/packages/gallup/src/GallupMock.ts +7 -7
  427. package/packages/gallup/src/__external__/SpringStreams.d.ts +39 -39
  428. package/packages/gallup/src/__mocks__/SpringStreams.js +18 -18
  429. package/packages/gallup/src/index.ts +1 -1
  430. package/packages/grid/BasicGrid/README.md +78 -78
  431. package/packages/grid/BasicGrid/index.ts +1 -1
  432. package/packages/grid/FirstOnlyGrid/README.md +43 -43
  433. package/packages/grid/FirstOnlyGrid/index.ts +1 -1
  434. package/packages/grid/FixedToEndGrid/README.md +45 -45
  435. package/packages/grid/FixedToEndGrid/index.ts +1 -1
  436. package/packages/grid/Item/index.ts +1 -1
  437. package/packages/grid/README.md +169 -169
  438. package/packages/grid/src/Base/Base.tsx +492 -492
  439. package/packages/grid/src/Base/MouseNavigation/MouseNavigation.tsx +82 -82
  440. package/packages/grid/src/Base/MouseNavigation/MouseNavigationFallback.ts +4 -4
  441. package/packages/grid/src/Base/MouseNavigation/index.tizen.tv.ts +1 -1
  442. package/packages/grid/src/Base/MouseNavigation/index.ts +1 -1
  443. package/packages/grid/src/Base/MouseNavigation/index.webos.tv.ts +1 -1
  444. package/packages/grid/src/Base/MouseNavigation/index.webtv.ts +1 -1
  445. package/packages/grid/src/Base/index.ts +1 -1
  446. package/packages/grid/src/Base/interface.ts +47 -47
  447. package/packages/grid/src/BasicGrid/BasicGrid.tsx +137 -137
  448. package/packages/grid/src/BasicGrid/config.ts +13 -13
  449. package/packages/grid/src/FastFocusingOptimizer/FastFocusingOptimizer.ts +54 -54
  450. package/packages/grid/src/FirstOnlyGrid/FirstOnlyGrid.tsx +112 -112
  451. package/packages/grid/src/FirstOnlyGrid/config.ts +13 -13
  452. package/packages/grid/src/FirstOnlyGrid/controller.ts +10 -10
  453. package/packages/grid/src/FixedToEndGrid/FixedToEndGrid.tsx +112 -112
  454. package/packages/grid/src/FixedToEndGrid/config.ts +13 -13
  455. package/packages/grid/src/FixedToEndGrid/controller.ts +36 -36
  456. package/packages/grid/src/UnifiedGridController/UnifiedGridController.ts +555 -555
  457. package/packages/grid/src/UnifiedGridController/index.ts +2 -2
  458. package/packages/grid/src/UnifiedGridController/interface.ts +92 -92
  459. package/packages/grid/src/animate.animated.ts +1 -1
  460. package/packages/grid/src/animate.ts +1 -1
  461. package/packages/grid/src/interface.ts +30 -30
  462. package/packages/grid/src/mocks/index.tsx +41 -41
  463. package/packages/grid/src/types.ts +69 -69
  464. package/packages/grid/src/utils.ts +69 -69
  465. package/packages/i18n/README.md +460 -460
  466. package/packages/i18n/src/I18n.ts +246 -246
  467. package/packages/i18n/src/Translation.tsx +36 -36
  468. package/packages/i18n/src/addResourceBundle.ts +73 -73
  469. package/packages/i18n/src/direction.ts +33 -33
  470. package/packages/i18n/src/index.ts +4 -4
  471. package/packages/i18n/src/isRtl.ts +3 -3
  472. package/packages/i18n/src/middlewares/i18next/Context/Context.ts +25 -25
  473. package/packages/i18n/src/middlewares/i18next/Context/index.ts +1 -1
  474. package/packages/i18n/src/middlewares/i18next/Interpolation/Interpolation.ts +95 -95
  475. package/packages/i18n/src/middlewares/i18next/Interpolation/index.ts +1 -1
  476. package/packages/i18n/src/middlewares/i18next/Nesting/Nesting.ts +38 -38
  477. package/packages/i18n/src/middlewares/i18next/Nesting/index.ts +1 -1
  478. package/packages/i18n/src/middlewares/i18next/Plurals/Plurals.ts +123 -123
  479. package/packages/i18n/src/middlewares/i18next/Plurals/Resolvers.ts +124 -124
  480. package/packages/i18n/src/middlewares/i18next/Plurals/index.ts +1 -1
  481. package/packages/i18n/src/middlewares/i18next/Plurals/types.ts +6 -6
  482. package/packages/i18n/src/middlewares/icu/DateInterpolation/DateInterpolation.ts +64 -64
  483. package/packages/i18n/src/middlewares/icu/DateInterpolation/index.ts +1 -1
  484. package/packages/i18n/src/middlewares/icu/Interpolation/Interpolation.ts +39 -39
  485. package/packages/i18n/src/middlewares/icu/Interpolation/index.ts +1 -1
  486. package/packages/i18n/src/middlewares/icu/NumberInterpolation/NumberInterpolation.ts +41 -41
  487. package/packages/i18n/src/middlewares/icu/NumberInterpolation/index.ts +1 -1
  488. package/packages/i18n/src/middlewares/icu/Plurals/Plurals.ts +65 -65
  489. package/packages/i18n/src/middlewares/icu/Plurals/Resolvers.ts +130 -130
  490. package/packages/i18n/src/middlewares/icu/Plurals/index.ts +1 -1
  491. package/packages/i18n/src/middlewares/icu/Plurals/types.ts +15 -15
  492. package/packages/i18n/src/middlewares/icu/Select/Select.ts +36 -36
  493. package/packages/i18n/src/middlewares/icu/Select/index.ts +1 -1
  494. package/packages/i18n/src/middlewares/icu/TimeInterpolation/TimeInterpolation.ts +65 -65
  495. package/packages/i18n/src/middlewares/icu/TimeInterpolation/index.ts +1 -1
  496. package/packages/i18n/src/middlewares/icu/shared/hasVariable.ts +5 -5
  497. package/packages/i18n/src/middlewares/icu/shared/matchSwitchCase.ts +80 -80
  498. package/packages/i18n/src/middlewares/icu/shared/unwrap.ts +1 -1
  499. package/packages/i18n/src/pluralsCommon/PluralsHelper.ts +54 -54
  500. package/packages/i18n/src/pluralsCommon/ResolverByLanguage.ts +129 -129
  501. package/packages/i18n/src/t.tsx +6 -6
  502. package/packages/i18n/src/typedTranslate.ts +31 -31
  503. package/packages/i18n/src/types.ts +66 -66
  504. package/packages/i18n/src/utils.ts +76 -76
  505. package/packages/icon/README.md +107 -107
  506. package/packages/icon/src/Icon.tsx +71 -71
  507. package/packages/icon/src/index.ts +1 -1
  508. package/packages/ime/README.md +72 -72
  509. package/packages/ime/src/IKeyboard.ts +6 -6
  510. package/packages/ime/src/IKeyboardEvent.ts +7 -7
  511. package/packages/ime/src/ImeManager.ts +33 -33
  512. package/packages/ime/src/SystemKeyboard/SystemKeyboard.ts +33 -33
  513. package/packages/ime/src/SystemKeyboard/SystemKeyboardBase.ts +98 -98
  514. package/packages/ime/src/SystemKeyboard/TizenSystemKeyboard.ts +66 -66
  515. package/packages/ime/src/SystemKeyboard/WebosSystemKeyboard.ts +74 -74
  516. package/packages/ime/src/SystemKeyboard/index.tizen.tv.ts +1 -1
  517. package/packages/ime/src/SystemKeyboard/index.ts +1 -1
  518. package/packages/ime/src/SystemKeyboard/index.webos.tv.ts +1 -1
  519. package/packages/ime/src/index.ts +3 -3
  520. package/packages/input/README.md +65 -65
  521. package/packages/input/__mocks__/MockKeyboard.ts +40 -40
  522. package/packages/input/src/Input.scss +9 -9
  523. package/packages/input/src/Input.tsx +267 -267
  524. package/packages/input/src/index.ts +1 -1
  525. package/packages/input/src/utils.ts +71 -71
  526. package/packages/interactable/README.md +38 -38
  527. package/packages/interactable/src/Interactable.tsx +33 -33
  528. package/packages/interactable/src/index.ts +1 -1
  529. package/packages/interactable/src/interface.ts +7 -7
  530. package/packages/ipify/README.md +30 -30
  531. package/packages/ipify/src/index.ts +1 -1
  532. package/packages/ipify/src/ipify.ts +41 -41
  533. package/packages/jsx/README.md +388 -388
  534. package/packages/jsx/src/Component.ts +68 -68
  535. package/packages/jsx/src/createRef.ts +5 -5
  536. package/packages/jsx/src/forwardRef.ts +8 -8
  537. package/packages/jsx/src/index.ts +31 -31
  538. package/packages/jsx/src/jsx-runtime.ts +5 -5
  539. package/packages/jsx/src/manipulation/attachNode.ts +30 -30
  540. package/packages/jsx/src/manipulation/attachNodeBefore.ts +44 -44
  541. package/packages/jsx/src/manipulation/clearNode.ts +14 -14
  542. package/packages/jsx/src/manipulation/detachNode.ts +26 -26
  543. package/packages/jsx/src/manipulation/index.ts +7 -7
  544. package/packages/jsx/src/manipulation/removeNode.ts +18 -18
  545. package/packages/jsx/src/manipulation/replaceNode.ts +42 -42
  546. package/packages/jsx/src/manipulation/swapNodes.ts +53 -53
  547. package/packages/jsx/src/mount/guards.ts +26 -26
  548. package/packages/jsx/src/mount/handleLifecycle.ts +71 -71
  549. package/packages/jsx/src/mount/index.ts +1 -1
  550. package/packages/jsx/src/mount/lifecycle.ts +38 -38
  551. package/packages/jsx/src/mount/lifecycleHelpers.ts +29 -29
  552. package/packages/jsx/src/mount/mount.ts +141 -141
  553. package/packages/jsx/src/mount/namespaces.ts +7 -7
  554. package/packages/jsx/src/mount/props.ts +121 -121
  555. package/packages/jsx/src/nodeUtils.ts +69 -69
  556. package/packages/jsx/src/setText.ts +15 -15
  557. package/packages/jsx/src/test-utils/MountedComponent.ts +50 -50
  558. package/packages/jsx/src/test-utils/README.md +72 -72
  559. package/packages/jsx/src/test-utils/click.ts +7 -7
  560. package/packages/jsx/src/test-utils/enter.ts +4 -4
  561. package/packages/jsx/src/test-utils/index.ts +6 -6
  562. package/packages/jsx/src/test-utils/keydown.ts +27 -27
  563. package/packages/jsx/src/test-utils/keyup.ts +27 -27
  564. package/packages/jsx/src/test-utils/shallow.ts +33 -33
  565. package/packages/jsx/src/test-utils/spec-utils.ts +6 -6
  566. package/packages/jsx/src/textNode.ts +9 -9
  567. package/packages/jsx/src/types.ts +128 -128
  568. package/packages/jsx/src/utils.ts +35 -35
  569. package/packages/jsx/src/virtualDOM.ts +121 -121
  570. package/packages/key-sequence/README.md +44 -44
  571. package/packages/key-sequence/src/KeySequence.ts +56 -56
  572. package/packages/key-sequence/src/arrayEndsWithKeyCombo.ts +22 -22
  573. package/packages/key-sequence/src/index.ts +1 -1
  574. package/packages/key-sequence/src/types.ts +13 -13
  575. package/packages/keyboard/README.md +237 -237
  576. package/packages/keyboard/src/AndroidKeyboard/Keyboard.scss +140 -140
  577. package/packages/keyboard/src/AndroidKeyboard/Keyboard.styles.1080.scss +2 -2
  578. package/packages/keyboard/src/AndroidKeyboard/Keyboard.styles.animated.1080.scss +3 -3
  579. package/packages/keyboard/src/AndroidKeyboard/Keyboard.styles.animated.scss +3 -3
  580. package/packages/keyboard/src/AndroidKeyboard/Keyboard.styles.scss +2 -2
  581. package/packages/keyboard/src/AndroidKeyboard/Keyboard.tsx +235 -235
  582. package/packages/keyboard/src/AndroidKeyboard/_animated.scss +7 -7
  583. package/packages/keyboard/src/AndroidKeyboard/_sizes.1080.scss +15 -15
  584. package/packages/keyboard/src/AndroidKeyboard/_sizes.scss +15 -15
  585. package/packages/keyboard/src/AndroidKeyboard/icons/arrow_left.svg +6 -6
  586. package/packages/keyboard/src/AndroidKeyboard/icons/arrow_right.svg +6 -6
  587. package/packages/keyboard/src/AndroidKeyboard/icons/key_backspace.svg +12 -12
  588. package/packages/keyboard/src/AndroidKeyboard/index.ts +1 -1
  589. package/packages/keyboard/src/AndroidKeyboard/makeLayout.ts +19 -19
  590. package/packages/keyboard/src/Backdrop/Backdrop.scss +17 -17
  591. package/packages/keyboard/src/Backdrop/Backdrop.styles.1080.scss +2 -2
  592. package/packages/keyboard/src/Backdrop/Backdrop.styles.scss +2 -2
  593. package/packages/keyboard/src/Backdrop/Backdrop.tsx +31 -31
  594. package/packages/keyboard/src/Backdrop/_sizes.1080.scss +2 -2
  595. package/packages/keyboard/src/Backdrop/_sizes.scss +2 -2
  596. package/packages/keyboard/src/DefaultKeyboard/Keyboard.scss +73 -73
  597. package/packages/keyboard/src/DefaultKeyboard/Keyboard.styles.1080.scss +2 -2
  598. package/packages/keyboard/src/DefaultKeyboard/Keyboard.styles.scss +2 -2
  599. package/packages/keyboard/src/DefaultKeyboard/Keyboard.tsx +155 -155
  600. package/packages/keyboard/src/DefaultKeyboard/_sizes.1080.scss +12 -12
  601. package/packages/keyboard/src/DefaultKeyboard/_sizes.scss +12 -12
  602. package/packages/keyboard/src/DefaultKeyboard/index.ts +1 -1
  603. package/packages/keyboard/src/KeyboardBase.tsx +344 -344
  604. package/packages/keyboard/src/MobiKeyboard/Keyboard.scss +180 -180
  605. package/packages/keyboard/src/MobiKeyboard/Keyboard.styles.1080.scss +2 -2
  606. package/packages/keyboard/src/MobiKeyboard/Keyboard.styles.animated.1080.scss +3 -3
  607. package/packages/keyboard/src/MobiKeyboard/Keyboard.styles.animated.scss +3 -3
  608. package/packages/keyboard/src/MobiKeyboard/Keyboard.styles.scss +2 -2
  609. package/packages/keyboard/src/MobiKeyboard/Keyboard.tsx +278 -278
  610. package/packages/keyboard/src/MobiKeyboard/_animated.scss +7 -7
  611. package/packages/keyboard/src/MobiKeyboard/_sizes.1080.scss +10 -10
  612. package/packages/keyboard/src/MobiKeyboard/_sizes.scss +10 -10
  613. package/packages/keyboard/src/MobiKeyboard/icons/arrow_left.svg +6 -6
  614. package/packages/keyboard/src/MobiKeyboard/icons/arrow_right.svg +6 -6
  615. package/packages/keyboard/src/MobiKeyboard/icons/key_backspace.svg +12 -12
  616. package/packages/keyboard/src/MobiKeyboard/icons/key_space.svg +6 -6
  617. package/packages/keyboard/src/MobiKeyboard/index.ts +1 -1
  618. package/packages/keyboard/src/MobiKeyboard/utils.ts +19 -19
  619. package/packages/keyboard/src/QwertyKeyboardBase/QwertyKeyboardBase.tsx +54 -54
  620. package/packages/keyboard/src/ShiftMode.ts +25 -25
  621. package/packages/keyboard/src/WhitelabelKeyboard/Keyboard.scss +168 -168
  622. package/packages/keyboard/src/WhitelabelKeyboard/Keyboard.styles.1080.scss +2 -2
  623. package/packages/keyboard/src/WhitelabelKeyboard/Keyboard.styles.scss +2 -2
  624. package/packages/keyboard/src/WhitelabelKeyboard/Keyboard.tsx +353 -353
  625. package/packages/keyboard/src/WhitelabelKeyboard/WhitelabelStyles/_sizes.1080.scss +7 -7
  626. package/packages/keyboard/src/WhitelabelKeyboard/WhitelabelStyles/_sizes.scss +7 -7
  627. package/packages/keyboard/src/WhitelabelKeyboard/WhitelabelStyles/index.ts +1 -1
  628. package/packages/keyboard/src/WhitelabelKeyboard/WhitelabelStyles/whitelabel.scss +81 -81
  629. package/packages/keyboard/src/WhitelabelKeyboard/WhitelabelStyles/whitelabel.styles.1080.scss +2 -2
  630. package/packages/keyboard/src/WhitelabelKeyboard/WhitelabelStyles/whitelabel.styles.scss +2 -2
  631. package/packages/keyboard/src/WhitelabelKeyboard/_sizes.1080.scss +32 -32
  632. package/packages/keyboard/src/WhitelabelKeyboard/_sizes.scss +32 -32
  633. package/packages/keyboard/src/WhitelabelKeyboard/icons/arrow_left.svg +9 -9
  634. package/packages/keyboard/src/WhitelabelKeyboard/icons/arrow_right.svg +9 -9
  635. package/packages/keyboard/src/WhitelabelKeyboard/icons/key_backspace.svg +9 -9
  636. package/packages/keyboard/src/WhitelabelKeyboard/icons/key_language.svg +20 -20
  637. package/packages/keyboard/src/WhitelabelKeyboard/icons/key_shift.svg +9 -9
  638. package/packages/keyboard/src/WhitelabelKeyboard/icons/key_shift_active.svg +9 -9
  639. package/packages/keyboard/src/WhitelabelKeyboard/index.ts +2 -2
  640. package/packages/keyboard/src/WhitelabelKeyboard/layouts/arabic.ts +27 -27
  641. package/packages/keyboard/src/WhitelabelKeyboard/layouts/burmese.ts +27 -27
  642. package/packages/keyboard/src/WhitelabelKeyboard/layouts/dari.ts +28 -28
  643. package/packages/keyboard/src/WhitelabelKeyboard/layouts/hebrew.ts +28 -28
  644. package/packages/keyboard/src/WhitelabelKeyboard/layouts/index.ts +14 -14
  645. package/packages/keyboard/src/WhitelabelKeyboard/layouts/korean.ts +26 -26
  646. package/packages/keyboard/src/WhitelabelKeyboard/layouts/latin.ts +26 -26
  647. package/packages/keyboard/src/WhitelabelKeyboard/layouts/pashto.ts +27 -27
  648. package/packages/keyboard/src/WhitelabelKeyboard/layouts/persian.ts +27 -27
  649. package/packages/keyboard/src/WhitelabelKeyboard/layouts/russian.ts +27 -27
  650. package/packages/keyboard/src/WhitelabelKeyboard/layouts/special.ts +28 -28
  651. package/packages/keyboard/src/WhitelabelKeyboard/layouts/tibetan.ts +26 -26
  652. package/packages/keyboard/src/WhitelabelKeyboard/layouts/turkish.ts +26 -26
  653. package/packages/keyboard/src/WhitelabelKeyboard/layouts/ukrainian.ts +27 -27
  654. package/packages/keyboard/src/WhitelabelKeyboard/layouts/urdu.ts +26 -26
  655. package/packages/keyboard/src/WhitelabelKeyboard/types.ts +28 -28
  656. package/packages/keyboard/src/WhitelabelNumericKeyboard/NumericKeyboard.scss +105 -105
  657. package/packages/keyboard/src/WhitelabelNumericKeyboard/NumericKeyboard.styles.1080.scss +2 -2
  658. package/packages/keyboard/src/WhitelabelNumericKeyboard/NumericKeyboard.styles.scss +2 -2
  659. package/packages/keyboard/src/WhitelabelNumericKeyboard/NumericKeyboard.tsx +161 -161
  660. package/packages/keyboard/src/WhitelabelNumericKeyboard/WhitelabelStyles/_sizes.1080.scss +7 -7
  661. package/packages/keyboard/src/WhitelabelNumericKeyboard/WhitelabelStyles/_sizes.scss +7 -7
  662. package/packages/keyboard/src/WhitelabelNumericKeyboard/WhitelabelStyles/index.ts +1 -1
  663. package/packages/keyboard/src/WhitelabelNumericKeyboard/WhitelabelStyles/whitelabel.scss +62 -62
  664. package/packages/keyboard/src/WhitelabelNumericKeyboard/WhitelabelStyles/whitelabel.styles.1080.scss +2 -2
  665. package/packages/keyboard/src/WhitelabelNumericKeyboard/WhitelabelStyles/whitelabel.styles.scss +2 -2
  666. package/packages/keyboard/src/WhitelabelNumericKeyboard/_sizes.1080.scss +29 -29
  667. package/packages/keyboard/src/WhitelabelNumericKeyboard/_sizes.scss +29 -29
  668. package/packages/keyboard/src/WhitelabelNumericKeyboard/icons/key_backspace.svg +9 -9
  669. package/packages/keyboard/src/WhitelabelNumericKeyboard/index.ts +2 -2
  670. package/packages/keyboard/src/WhitelabelNumericKeyboard/layout.ts +14 -14
  671. package/packages/keyboard/src/hwKeyboardEventToChar.ts +11 -11
  672. package/packages/keyboard/src/types/index.ts +11 -11
  673. package/packages/keyboard/src/utils/caret.ts +48 -48
  674. package/packages/keyboard/src/utils/generateFocusMatrixFromStringMatrix.ts +12 -12
  675. package/packages/keyboard/src/utils/input.ts +40 -40
  676. package/packages/l10n/README.md +120 -120
  677. package/packages/l10n/interface.ts +1 -1
  678. package/packages/l10n/locales/cs.ts +4 -4
  679. package/packages/l10n/locales/en-001.ts +4 -4
  680. package/packages/l10n/locales/en-us.ts +4 -4
  681. package/packages/l10n/src/Locale.tsx +44 -44
  682. package/packages/l10n/src/date/common.ts +165 -165
  683. package/packages/l10n/src/date/cs.ts +89 -89
  684. package/packages/l10n/src/date/de.ts +97 -97
  685. package/packages/l10n/src/date/en-001.ts +76 -76
  686. package/packages/l10n/src/date/en-common.ts +55 -55
  687. package/packages/l10n/src/date/en-us.ts +83 -83
  688. package/packages/l10n/src/date/es.ts +71 -71
  689. package/packages/l10n/src/date/fr.ts +94 -94
  690. package/packages/l10n/src/date/he.ts +101 -101
  691. package/packages/l10n/src/date/iso.ts +63 -63
  692. package/packages/l10n/src/date/types.ts +56 -56
  693. package/packages/l10n/src/index.ts +2 -2
  694. package/packages/l10n/src/l10n.ts +112 -112
  695. package/packages/l10n/src/types.ts +22 -22
  696. package/packages/list/AttachDetachItem/README.md +128 -128
  697. package/packages/list/AttachDetachItem/index.ts +3 -3
  698. package/packages/list/BasicList/README.md +71 -71
  699. package/packages/list/BasicList/index.ts +1 -1
  700. package/packages/list/CenteredList/README.md +42 -42
  701. package/packages/list/CenteredList/index.ts +1 -1
  702. package/packages/list/EdgeOffsetList/README.md +58 -58
  703. package/packages/list/EdgeOffsetList/index.ts +1 -1
  704. package/packages/list/FirstOnlyList/README.md +39 -39
  705. package/packages/list/FirstOnlyList/index.ts +1 -1
  706. package/packages/list/FirstOnlyVariedList/README.md +105 -105
  707. package/packages/list/FirstOnlyVariedList/index.ts +1 -1
  708. package/packages/list/FixedToEndList/README.md +42 -42
  709. package/packages/list/FixedToEndList/index.ts +1 -1
  710. package/packages/list/Item/index.ts +1 -1
  711. package/packages/list/README.md +193 -193
  712. package/packages/list/src/AttachDetachItem/AttachDetachItem.tsx +96 -96
  713. package/packages/list/src/AttachDetachItem/prepareAttachDetachItemData.ts +13 -13
  714. package/packages/list/src/Base/Base.tsx +392 -392
  715. package/packages/list/src/Base/MouseNavigation/MouseNavigation.tsx +82 -82
  716. package/packages/list/src/Base/MouseNavigation/MouseNavigationFallback.ts +4 -4
  717. package/packages/list/src/Base/MouseNavigation/index.tizen.tv.ts +1 -1
  718. package/packages/list/src/Base/MouseNavigation/index.ts +1 -1
  719. package/packages/list/src/Base/MouseNavigation/index.webos.tv.ts +1 -1
  720. package/packages/list/src/Base/MouseNavigation/index.webtv.ts +1 -1
  721. package/packages/list/src/Base/index.ts +1 -1
  722. package/packages/list/src/Base/interface.ts +39 -39
  723. package/packages/list/src/BasicList/BasicList.tsx +178 -178
  724. package/packages/list/src/BasicList/config.ts +13 -13
  725. package/packages/list/src/CenteredList/CenteredList.tsx +116 -116
  726. package/packages/list/src/CenteredList/config.ts +13 -13
  727. package/packages/list/src/CenteredList/controller.ts +46 -46
  728. package/packages/list/src/CenteredList/interface.ts +10 -10
  729. package/packages/list/src/EdgeOffsetList/EdgeOffsetList.tsx +173 -173
  730. package/packages/list/src/EdgeOffsetList/config.ts +13 -13
  731. package/packages/list/src/FastFocusingOptimizer/FastFocusingOptimizer.ts +54 -54
  732. package/packages/list/src/FirstOnlyList/FirstOnlyList.tsx +122 -122
  733. package/packages/list/src/FirstOnlyList/config.ts +13 -13
  734. package/packages/list/src/FirstOnlyList/controller.ts +11 -11
  735. package/packages/list/src/FirstOnlyVariedList/FirstOnlyVariedList.tsx +132 -132
  736. package/packages/list/src/FirstOnlyVariedList/config.ts +13 -13
  737. package/packages/list/src/FixedToEndList/FixedToEndList.tsx +125 -125
  738. package/packages/list/src/FixedToEndList/config.ts +13 -13
  739. package/packages/list/src/FixedToEndList/controller.ts +44 -44
  740. package/packages/list/src/UnifiedListController/UnifiedListController.ts +258 -258
  741. package/packages/list/src/UnifiedListController/UnifiedListControllerBase.ts +241 -241
  742. package/packages/list/src/UnifiedListController/UnifiedVariedListController.ts +241 -241
  743. package/packages/list/src/UnifiedListController/interface.ts +81 -81
  744. package/packages/list/src/__test__/utils.spec.ts +59 -59
  745. package/packages/list/src/animate.animated.ts +1 -1
  746. package/packages/list/src/animate.ts +1 -1
  747. package/packages/list/src/index.ts +1 -1
  748. package/packages/list/src/interface.ts +48 -48
  749. package/packages/list/src/mocks/index.tsx +55 -55
  750. package/packages/list/src/types.ts +132 -132
  751. package/packages/list/src/utils.ts +142 -142
  752. package/packages/list/utils/index.ts +1 -1
  753. package/packages/logger/README.md +117 -117
  754. package/packages/logger/src/LoggerManager.ts +60 -60
  755. package/packages/logger/src/LoggerService.ts +43 -43
  756. package/packages/logger/src/__mocks__/LoggerBase.ts +13 -13
  757. package/packages/logger/src/index.ts +3 -3
  758. package/packages/logger/src/loggers/ConsoleLogger/ConsoleLogger.ts +51 -51
  759. package/packages/logger/src/loggers/ConsoleLogger/README.md +39 -39
  760. package/packages/logger/src/loggers/ConsoleLogger/index.ts +1 -1
  761. package/packages/logger/src/loggers/LoggerBase/LoggerBase.ts +67 -67
  762. package/packages/logger/src/loggers/LoggerBase/README.md +69 -69
  763. package/packages/logger/src/loggers/LoggerBase/index.ts +1 -1
  764. package/packages/logger/src/loggers/SentryLogger/README.md +98 -98
  765. package/packages/logger/src/loggers/SentryLogger/Sentry.ts +2 -2
  766. package/packages/logger/src/loggers/SentryLogger/SentryLogger.ts +179 -179
  767. package/packages/logger/src/loggers/SentryLogger/index.ts +2 -2
  768. package/packages/logger/src/loggers/SentryLogger/mock.ts +6 -6
  769. package/packages/logger/src/loggers/index.ts +2 -2
  770. package/packages/logger/src/types.ts +46 -46
  771. package/packages/logger/src/utils/deviceInfo.ts +25 -25
  772. package/packages/logger/src/utils/index.ts +1 -1
  773. package/packages/lottie-animations/README.md +217 -217
  774. package/packages/lottie-animations/src/LottieAnimation.tsx +125 -125
  775. package/packages/lottie-animations/src/index.ts +7 -7
  776. package/packages/menu/README.md +90 -90
  777. package/packages/menu/WhitelabelMenu/index.ts +1 -1
  778. package/packages/menu/WhitelabelMenu/interface.ts +2 -2
  779. package/packages/menu/WhitelabelMenu/styles.ts +2 -2
  780. package/packages/menu/interface.ts +3 -3
  781. package/packages/menu/src/MenuAndContentContainer/MenuAndContentContainer.tsx +211 -211
  782. package/packages/menu/src/MenuAndContentContainer/index.ts +1 -1
  783. package/packages/menu/src/MenuAndContentContainer/interface.ts +164 -164
  784. package/packages/menu/src/MenuAndContentContainer/service.ts +5 -5
  785. package/packages/menu/src/WhitelabelMenu/SideMenu.scss +41 -41
  786. package/packages/menu/src/WhitelabelMenu/SideMenu.styles.1080.scss +2 -2
  787. package/packages/menu/src/WhitelabelMenu/SideMenu.styles.animated.1080.scss +3 -3
  788. package/packages/menu/src/WhitelabelMenu/SideMenu.styles.animated.scss +3 -3
  789. package/packages/menu/src/WhitelabelMenu/SideMenu.styles.scss +2 -2
  790. package/packages/menu/src/WhitelabelMenu/SideMenu.tsx +248 -248
  791. package/packages/menu/src/WhitelabelMenu/SideMenuItem/SideMenuItem.scss +56 -56
  792. package/packages/menu/src/WhitelabelMenu/SideMenuItem/SideMenuItem.styles.1080.scss +2 -2
  793. package/packages/menu/src/WhitelabelMenu/SideMenuItem/SideMenuItem.styles.animated.1080.scss +3 -3
  794. package/packages/menu/src/WhitelabelMenu/SideMenuItem/SideMenuItem.styles.animated.scss +3 -3
  795. package/packages/menu/src/WhitelabelMenu/SideMenuItem/SideMenuItem.styles.scss +2 -2
  796. package/packages/menu/src/WhitelabelMenu/SideMenuItem/SideMenuItem.tsx +78 -78
  797. package/packages/menu/src/WhitelabelMenu/SideMenuItem/_animated.scss +12 -12
  798. package/packages/menu/src/WhitelabelMenu/SideMenuItem/_sizes.1080.scss +17 -17
  799. package/packages/menu/src/WhitelabelMenu/SideMenuItem/_sizes.scss +17 -17
  800. package/packages/menu/src/WhitelabelMenu/SideMenuItem/index.ts +1 -1
  801. package/packages/menu/src/WhitelabelMenu/SideMenuItem/interface.ts +49 -49
  802. package/packages/menu/src/WhitelabelMenu/SideMenuItem/rtl.scss +12 -12
  803. package/packages/menu/src/WhitelabelMenu/SideMenuItem/sizes.1080.ts +2 -2
  804. package/packages/menu/src/WhitelabelMenu/SideMenuItem/sizes.ts +2 -2
  805. package/packages/menu/src/WhitelabelMenu/SideMenuItem/styles.ts +1 -1
  806. package/packages/menu/src/WhitelabelMenu/VisualController.animated.ts +48 -48
  807. package/packages/menu/src/WhitelabelMenu/VisualController.ts +20 -20
  808. package/packages/menu/src/WhitelabelMenu/VisualControllerBase.ts +71 -71
  809. package/packages/menu/src/WhitelabelMenu/_animated.scss +39 -39
  810. package/packages/menu/src/WhitelabelMenu/_sizes.1080.scss +14 -14
  811. package/packages/menu/src/WhitelabelMenu/_sizes.scss +14 -14
  812. package/packages/menu/src/WhitelabelMenu/constants.animated.ts +1 -1
  813. package/packages/menu/src/WhitelabelMenu/constants.ts +1 -1
  814. package/packages/menu/src/WhitelabelMenu/index.ts +1 -1
  815. package/packages/menu/src/WhitelabelMenu/interface.ts +14 -14
  816. package/packages/menu/src/WhitelabelMenu/rtl.scss +22 -22
  817. package/packages/menu/src/WhitelabelMenu/sizes.1080.ts +1 -1
  818. package/packages/menu/src/WhitelabelMenu/sizes.ts +1 -1
  819. package/packages/menu/src/WhitelabelMenu/styles.ts +1 -1
  820. package/packages/menu/src/WhitelabelMenu/utils.ts +34 -34
  821. package/packages/menu/src/index.ts +2 -2
  822. package/packages/modal-service/README.md +50 -50
  823. package/packages/modal-service/src/IModal.ts +3 -3
  824. package/packages/modal-service/src/ModalService.scss +7 -7
  825. package/packages/modal-service/src/ModalService.styles.1080.scss +2 -2
  826. package/packages/modal-service/src/ModalService.styles.scss +2 -2
  827. package/packages/modal-service/src/ModalService.tsx +102 -102
  828. package/packages/modal-service/src/_sizes.1080.scss +2 -2
  829. package/packages/modal-service/src/_sizes.scss +2 -2
  830. package/packages/modal-service/src/index.ts +2 -2
  831. package/packages/mouse-navigation/README.md +105 -105
  832. package/packages/mouse-navigation/src/ArrowNavigation/Arrow.tsx +58 -58
  833. package/packages/mouse-navigation/src/ArrowNavigation/ArrowNavigation.tsx +95 -95
  834. package/packages/mouse-navigation/src/ArrowNavigation/__test__/Arrow.spec.tsx +35 -35
  835. package/packages/mouse-navigation/src/ArrowNavigation/__test__/ArrowNavigation.spec.tsx +45 -45
  836. package/packages/mouse-navigation/src/ArrowNavigation/index.tsx +1 -1
  837. package/packages/mouse-navigation/src/MouseElementWrapper.tsx +70 -70
  838. package/packages/mouse-navigation/src/MouseNavigation.tsx +157 -157
  839. package/packages/mouse-navigation/src/MouseNavigationInterface.ts +8 -8
  840. package/packages/mouse-navigation/src/index.ts +3 -3
  841. package/packages/numeric-zapper/README.md +153 -153
  842. package/packages/numeric-zapper/src/NumericZapper.scss +20 -20
  843. package/packages/numeric-zapper/src/NumericZapper.styles.1080.scss +2 -2
  844. package/packages/numeric-zapper/src/NumericZapper.styles.scss +2 -2
  845. package/packages/numeric-zapper/src/NumericZapper.tsx +257 -257
  846. package/packages/numeric-zapper/src/ZapperAllower.ts +15 -15
  847. package/packages/numeric-zapper/src/ZapperService.tsx +8 -8
  848. package/packages/numeric-zapper/src/_sizes.1080.scss +7 -7
  849. package/packages/numeric-zapper/src/_sizes.scss +7 -7
  850. package/packages/numeric-zapper/src/index.ts +4 -4
  851. package/packages/numeric-zapper/src/interface.ts +1 -1
  852. package/packages/numeric-zapper/src/styles.ts +1 -1
  853. package/packages/perf-utils/README.md +7 -7
  854. package/packages/perf-utils/src/array/filter.ts +1 -1
  855. package/packages/perf-utils/src/array/find.ts +1 -1
  856. package/packages/perf-utils/src/array/findIndex.ts +1 -1
  857. package/packages/perf-utils/src/array/forEach.ts +1 -1
  858. package/packages/perf-utils/src/array/includes.ts +1 -1
  859. package/packages/perf-utils/src/array/includesNaN.ts +1 -1
  860. package/packages/perf-utils/src/array/index.ts +1 -1
  861. package/packages/perf-utils/src/array/map.ts +1 -1
  862. package/packages/picker/README.md +70 -70
  863. package/packages/picker/src/DatePicker.tsx +55 -55
  864. package/packages/picker/src/ModalPicker/Checkbox.tsx +38 -38
  865. package/packages/picker/src/ModalPicker/PickerItem.tsx +86 -86
  866. package/packages/picker/src/ModalPicker/PickerModal.tsx +98 -98
  867. package/packages/picker/src/ModalPicker/index.ts +1 -1
  868. package/packages/picker/src/ModalPicker/modalPicker.tsx +48 -48
  869. package/packages/picker/src/Picker.tsx +127 -127
  870. package/packages/picker/src/index.ts +3 -3
  871. package/packages/picker/src/types.ts +25 -25
  872. package/packages/pin-input/README.md +55 -55
  873. package/packages/pin-input/src/PinInput.scss +5 -5
  874. package/packages/pin-input/src/PinInput.tsx +169 -169
  875. package/packages/pin-input/src/index.ts +1 -1
  876. package/packages/player-ui/README.md +207 -207
  877. package/packages/player-ui/src/BackwardButton.tsx +41 -41
  878. package/packages/player-ui/src/CurrentTime.tsx +56 -56
  879. package/packages/player-ui/src/Duration.tsx +60 -60
  880. package/packages/player-ui/src/ForwardButton.tsx +41 -41
  881. package/packages/player-ui/src/PauseButton.tsx +65 -65
  882. package/packages/player-ui/src/PlayButton.tsx +57 -57
  883. package/packages/player-ui/src/PlayPauseButton.tsx +63 -63
  884. package/packages/player-ui/src/PlayerInteractable.tsx +67 -67
  885. package/packages/player-ui/src/PlayerTime.tsx +57 -57
  886. package/packages/player-ui/src/PlayerUI.tsx +267 -267
  887. package/packages/player-ui/src/RemainingTime.tsx +74 -74
  888. package/packages/player-ui/src/Seekbar.tsx +274 -274
  889. package/packages/player-ui/src/Seeking.ts +163 -163
  890. package/packages/player-ui/src/StopButton.tsx +35 -35
  891. package/packages/player-ui/src/Subtitles.tsx +151 -151
  892. package/packages/player-ui/src/index.ts +15 -15
  893. package/packages/player-ui/src/mocks.ts +65 -65
  894. package/packages/player-ui/src/timeUtils.ts +142 -142
  895. package/packages/player-ui/src/types.ts +48 -48
  896. package/packages/progress-bar/README.md +31 -31
  897. package/packages/progress-bar/src/ProgressBar.tsx +41 -41
  898. package/packages/progress-bar/src/index.ts +1 -1
  899. package/packages/progress-bar/src/interface.ts +14 -14
  900. package/packages/qr-code/README.md +79 -79
  901. package/packages/qr-code/src/QRCode.tsx +39 -39
  902. package/packages/qr-code/src/index.ts +2 -2
  903. package/packages/qr-code/src/qrGenerator/__external__/constants.ts +23 -23
  904. package/packages/qr-code/src/qrGenerator/__external__/qrcode.d.ts +31 -31
  905. package/packages/qr-code/src/qrGenerator/__external__/qrcode.js +618 -618
  906. package/packages/qr-code/src/qrGenerator/generateQr.ts +7 -7
  907. package/packages/qr-code/src/qrGenerator/index.ts +3 -3
  908. package/packages/router/README.md +163 -163
  909. package/packages/router/src/Route.tsx +166 -166
  910. package/packages/router/src/Router.tsx +220 -220
  911. package/packages/router/src/focusActiveRoute.ts +5 -5
  912. package/packages/router/src/history.ts +31 -31
  913. package/packages/router/src/index.ts +6 -6
  914. package/packages/router/src/types.ts +13 -13
  915. package/packages/router/src/utils.ts +37 -35
  916. package/packages/runtime-config/README.md +37 -37
  917. package/packages/runtime-config/src/Config.ts +44 -44
  918. package/packages/runtime-config/src/index.ts +1 -1
  919. package/packages/sass-utils/README.md +197 -197
  920. package/packages/sass-utils/src/box-shadow.scss +5 -5
  921. package/packages/sass-utils/src/ellipsis.scss +15 -15
  922. package/packages/sass-utils/src/linear-gradient.scss +43 -43
  923. package/packages/sass-utils/src/prefix-property.scss +7 -7
  924. package/packages/sass-utils/src/prefix-value.scss +6 -6
  925. package/packages/sass-utils/src/prefix.scss +6 -6
  926. package/packages/sass-utils/src/scale.1080.scss +3 -3
  927. package/packages/sass-utils/src/scale.720.scss +5 -5
  928. package/packages/sass-utils/src/transform.scss +5 -5
  929. package/packages/sass-utils/src/transition.scss +6 -6
  930. package/packages/scheduler/README.md +55 -55
  931. package/packages/scheduler/src/Scheduler.ts +43 -43
  932. package/packages/scheduler/src/Task.ts +72 -72
  933. package/packages/scheduler/src/index.ts +4 -4
  934. package/packages/scheduler/src/timeProvider.ts +3 -3
  935. package/packages/scroll-text/README.md +77 -77
  936. package/packages/scroll-text/src/Base.tsx +146 -146
  937. package/packages/scroll-text/src/ScrollText.animated.tsx +80 -80
  938. package/packages/scroll-text/src/ScrollText.tsx +53 -53
  939. package/packages/scroll-text/src/ScrollTextBaseClass.tsx +86 -86
  940. package/packages/scroll-text/src/index.ts +1 -1
  941. package/packages/scroller/README.md +77 -77
  942. package/packages/scroller/src/Scroller.tsx +51 -51
  943. package/packages/scroller/src/index.ts +1 -1
  944. package/packages/splash/AnimatedSplash.ts +1 -1
  945. package/packages/splash/AnimatedSplashAnimated.ts +1 -1
  946. package/packages/splash/AnimatedSplashBasic.ts +1 -1
  947. package/packages/splash/AutomaticSplashAnimated.ts +1 -1
  948. package/packages/splash/AutomaticSplashBasic.ts +1 -1
  949. package/packages/splash/README.md +93 -93
  950. package/packages/splash/StaticSplash.ts +1 -1
  951. package/packages/splash/StaticSplashAnimated.ts +1 -1
  952. package/packages/splash/StaticSplashBasic.ts +1 -1
  953. package/packages/splash/src/AnimatedSplash.animated.tsx +78 -78
  954. package/packages/splash/src/AnimatedSplash.basic.tsx +37 -37
  955. package/packages/splash/src/AutomaticSplash.animated.tsx +20 -20
  956. package/packages/splash/src/AutomaticSplash.basic.tsx +20 -20
  957. package/packages/splash/src/Splash.scss +8 -8
  958. package/packages/splash/src/StaticSplash.animated.tsx +48 -48
  959. package/packages/splash/src/StaticSplash.basic.tsx +26 -26
  960. package/packages/splash/src/index.animated.ts +1 -1
  961. package/packages/splash/src/index.ts +1 -1
  962. package/packages/splash/src/styles.ts +1 -1
  963. package/packages/splash/src/types.ts +20 -20
  964. package/packages/storage/README.md +61 -61
  965. package/packages/storage/src/CookieStorage/CookieStorage.ts +57 -57
  966. package/packages/storage/src/CookieStorage/index.ts +1 -1
  967. package/packages/storage/src/LocalStorage/LocalStorage.ts +58 -58
  968. package/packages/storage/src/LocalStorage/index.ts +1 -1
  969. package/packages/storage/src/index.ts +2 -2
  970. package/packages/storage/src/shared.ts +41 -41
  971. package/packages/storage/src/types.ts +33 -33
  972. package/packages/throbber/README.md +53 -53
  973. package/packages/throbber/src/Throbber.scss +52 -52
  974. package/packages/throbber/src/Throbber.tsx +19 -19
  975. package/packages/throbber/src/ThrobberService.tsx +55 -55
  976. package/packages/throbber/src/controlsHandling.ts +14 -14
  977. package/packages/throbber/src/index.ts +2 -2
  978. package/packages/time/README.md +116 -116
  979. package/packages/time/src/Time.ts +257 -257
  980. package/packages/time/src/adapters/24iMediaTimeApi.ts +47 -47
  981. package/packages/time/src/adapters/worldTimeApi.ts +74 -74
  982. package/packages/time/src/constants.ts +14 -14
  983. package/packages/time/src/index.ts +1 -1
  984. package/packages/time/src/services/24iMediaTimeApi/24iMediaTimeApi.ts +43 -43
  985. package/packages/time/src/services/24iMediaTimeApi/index.ts +6 -6
  986. package/packages/time/src/services/worldTimeApi/index.ts +7 -7
  987. package/packages/time/src/services/worldTimeApi/types.ts +75 -75
  988. package/packages/time/src/services/worldTimeApi/worldTimeApi.ts +77 -77
  989. package/packages/time/src/types.ts +39 -39
  990. package/packages/time/src/utils.ts +79 -79
  991. package/packages/toast/README.md +116 -116
  992. package/packages/toast/src/Toast/IVisualController.ts +7 -7
  993. package/packages/toast/src/Toast/Toast.scss +22 -22
  994. package/packages/toast/src/Toast/Toast.styles.1080.scss +2 -2
  995. package/packages/toast/src/Toast/Toast.styles.scss +2 -2
  996. package/packages/toast/src/Toast/Toast.tsx +83 -83
  997. package/packages/toast/src/Toast/VisualController.animated.ts +20 -20
  998. package/packages/toast/src/Toast/VisualController.ts +9 -9
  999. package/packages/toast/src/Toast/_sizes.1080.scss +8 -8
  1000. package/packages/toast/src/Toast/_sizes.scss +8 -8
  1001. package/packages/toast/src/Toast/index.ts +2 -2
  1002. package/packages/toast/src/Toast/styles.ts +1 -1
  1003. package/packages/toast/src/ToastService.scss +8 -8
  1004. package/packages/toast/src/ToastService.styles.1080.scss +2 -2
  1005. package/packages/toast/src/ToastService.styles.scss +2 -2
  1006. package/packages/toast/src/ToastService.tsx +59 -59
  1007. package/packages/toast/src/_sizes.1080.scss +2 -2
  1008. package/packages/toast/src/_sizes.scss +2 -2
  1009. package/packages/toast/src/index.ts +4 -4
  1010. package/packages/toast/src/types.ts +4 -4
  1011. package/packages/types-bigscreen-jsx/README.md +12 -12
  1012. package/packages/types-bigscreen-jsx/global.d.ts +0 -0
  1013. package/packages/types-bigscreen-jsx/index.d.ts +32 -32
  1014. package/packages/types-bigscreen-jsx/src/copyTypes.js +14 -14
  1015. package/packages/utils/README.md +363 -363
  1016. package/packages/utils/src/addClass.ts +9 -9
  1017. package/packages/utils/src/counter.ts +49 -49
  1018. package/packages/utils/src/debounce.ts +54 -54
  1019. package/packages/utils/src/displayToggler.scss +3 -3
  1020. package/packages/utils/src/displayToggler.ts +38 -38
  1021. package/packages/utils/src/elementUtils.ts +105 -105
  1022. package/packages/utils/src/forceReflow.ts +14 -14
  1023. package/packages/utils/src/generateUuid.ts +19 -19
  1024. package/packages/utils/src/index.ts +43 -43
  1025. package/packages/utils/src/keyPress/index.ts +6 -6
  1026. package/packages/utils/src/keyPress/keyPressSimulator.ts +74 -74
  1027. package/packages/utils/src/keyPress/simulateKeyPress.ts +25 -25
  1028. package/packages/utils/src/memoryInfo.ts +21 -21
  1029. package/packages/utils/src/nTimes.ts +9 -9
  1030. package/packages/utils/src/noop.ts +1 -1
  1031. package/packages/utils/src/offsetPosition.ts +56 -56
  1032. package/packages/utils/src/removeClass.ts +9 -9
  1033. package/packages/utils/src/scaledImage.ts +24 -24
  1034. package/packages/utils/src/sizes.1080.ts +1 -1
  1035. package/packages/utils/src/sizes.ts +1 -1
  1036. package/packages/utils/src/stopEvent.ts +10 -10
  1037. package/packages/utils/src/textUtils.ts +57 -57
  1038. package/packages/utils/src/timeConstants.ts +11 -11
  1039. package/packages/utils/src/timers/createInterval.ts +19 -19
  1040. package/packages/utils/src/timers/createTimeout.ts +22 -22
  1041. package/packages/utils/src/timers/index.ts +4 -4
  1042. package/packages/utils/src/timers/runAsync.ts +3 -3
  1043. package/packages/utils/src/timers/types.ts +9 -9
  1044. package/packages/utils/src/wait.ts +3 -3
  1045. package/packages/utils/src/xhr/__mocks__/xhr.ts +29 -29
  1046. package/packages/utils/src/xhr/index.ts +11 -11
  1047. package/packages/utils/src/xhr/xhrSend.ts +141 -141
  1048. package/packages/utils/src/xhr/xhrSendRetry.ts +79 -79
  1049. package/packages/volume-control/README.md +79 -79
  1050. package/packages/volume-control/src/IVolumeControlUI.ts +26 -26
  1051. package/packages/volume-control/src/VolumeControlService.tsx +110 -110
  1052. package/packages/volume-control/src/VolumeControlUI/VisualController.animated.ts +28 -28
  1053. package/packages/volume-control/src/VolumeControlUI/VisualController.ts +3 -3
  1054. package/packages/volume-control/src/VolumeControlUI/VisualControllerBase.ts +26 -26
  1055. package/packages/volume-control/src/VolumeControlUI/VolumeControl.scss +18 -18
  1056. package/packages/volume-control/src/VolumeControlUI/VolumeControl.styles.animated.scss +2 -2
  1057. package/packages/volume-control/src/VolumeControlUI/VolumeControl.styles.scss +1 -1
  1058. package/packages/volume-control/src/VolumeControlUI/VolumeControlUI.tsx +80 -80
  1059. package/packages/volume-control/src/VolumeControlUI/_animated.scss +8 -8
  1060. package/packages/volume-control/src/VolumeControlUI/index.ts +1 -1
  1061. package/packages/volume-control/src/__mocks__/VolumeControlUIMock.tsx +22 -22
  1062. package/packages/volume-control/src/index.ts +2 -2
  1063. package/packages/zapping/README.md +87 -87
  1064. package/packages/zapping/src/ChannelZapping.ts +143 -143
  1065. package/packages/zapping/src/Zapping.tsx +115 -115
  1066. package/packages/zapping/src/index.ts +1 -1
  1067. package/packages/zapping/src/interface.ts +1 -1
  1068. package/utils/create-export-maps/index.ts +3 -3
  1069. package/utils/create-export-maps/src/__tests__/createExportMaps.spec.ts +50 -50
  1070. package/utils/create-export-maps/src/createExportMaps.ts +61 -61
  1071. package/utils/create-package/README.md +39 -39
  1072. package/utils/create-package/src/createPackage.ts +72 -72
  1073. package/utils/create-package/src/index.ts +3 -3
  1074. package/utils/create-package/src/questionnaire/questions.ts +19 -19
  1075. package/utils/create-package/src/settings/Settings.ts +5 -5
  1076. package/utils/create-package/src/types.ts +4 -4
  1077. package/utils/create-package/templates/typescript/README.md +8 -8
  1078. package/utils/create-package/templates/typescript/exports.json +6 -6
  1079. package/utils/run-scripts/index.ts +3 -3
  1080. package/utils/run-scripts/src/__tests__/runScripts.spec.ts +45 -45
  1081. package/utils/run-scripts/src/runScripts.ts +20 -20
@@ -1,1519 +1,1519 @@
1
- import { Reference, Component, Children } from '@24i/bigscreen-sdk/jsx';
2
- import { IFocusable } from '@24i/bigscreen-sdk/focus';
3
- import { ModalService } from '@24i/bigscreen-sdk/modal-service';
4
- import { IEvents, EventMapType } from '@24i/bigscreen-sdk/events-manager';
5
- import { Asset } from '@24i/smartapps-datalayer/models';
6
- import { ICheckbox, PickerMode } from '@24i/bigscreen-sdk/picker';
7
-
8
- // MARK: Shared Props (alphabetical order)
9
-
10
- type AdditionalRowsProp = {
11
- /**
12
- * The number of rows that are rendered at the bottom below navigatable rows
13
- * These can get covered sometimes by ProgramInfo for example
14
- */
15
- additionalRows: number,
16
- };
17
-
18
- type ChannelDataProp = {
19
- /**
20
- * An array with channel data
21
- */
22
- channelData: Asset[],
23
- };
24
-
25
- type ChannelHeaderWidthPxProp = {
26
- /**
27
- * The width of the channel header column in pixels
28
- */
29
- channelHeaderWidthPx: number,
30
- };
31
-
32
- type ChannelLessOnFocusChangeProp<T extends Program> = {
33
- /**
34
- * Called every time focus moves to different cell (even after mouse focuses the cell)
35
- */
36
- onFocusChange: ChannelLessFocusChangeCallback<T>,
37
- };
38
-
39
- type ChannelLessOnItemPressProp<T extends Program> = {
40
- /**
41
- * Called after pressing any item with data (not loading ones)
42
- */
43
- onItemPress: ChannelLessItemPressCallback<T>,
44
- };
45
-
46
- type DataGetterProp = {
47
- dataGetter: (range: DataRange) => Asset[],
48
- };
49
-
50
- type DataProp = {
51
- /**
52
- * A Data Manager
53
- */
54
- data: DataManager,
55
- };
56
-
57
- type DataManagersProp = {
58
- /**
59
- * An array of Data Managers
60
- */
61
- dataManagers: DataManager[],
62
- };
63
-
64
- type DatePickerProp = {
65
- /**
66
- * Props for the DatePicker component
67
- * If omitted the Day component will be rendered instead
68
- */
69
- datePickerProps: OutsideDatePickerProps,
70
- };
71
-
72
- type FetchProgramsProp = {
73
- /**
74
- * Function called by EPG to fetch more data for a channel
75
- */
76
- fetchPrograms: ProgramsFetcher,
77
- };
78
-
79
- type InitialChannelIndexProp = {
80
- /**
81
- * The initial index in the channels list that should be scrolled to and focus after
82
- * rendering the EPG
83
- */
84
- initialChannelIndex: number,
85
- };
86
-
87
- type InitialTimestampProp = {
88
- /**
89
- * The initial timestamp that should be used to render in the center of the EPG
90
- */
91
- initialTimestamp: number,
92
- };
93
-
94
- type IsLoadingProp = {
95
- /**
96
- * Flag to distinguish a cell that is intended to be used only for loading placeholder purposes
97
- */
98
- isLoading: boolean,
99
- };
100
-
101
- type ItemProp = {
102
- /**
103
- * Data for the program
104
- */
105
- item: Asset,
106
- };
107
-
108
- type LimitFromMsProp = {
109
- /**
110
- * The lowest timestamp in ms that can be navigated by EPG
111
- * Render, as well as fetch, can go slightly more into history
112
- */
113
- limitFromMs: number,
114
- };
115
-
116
- type LimitToMsProp = {
117
- /**
118
- * The highest timestamp in ms that can be navigated by EPG
119
- * Render, as well as fetch, can go slightly more into future
120
- */
121
- limitToMs: number,
122
- };
123
-
124
- type NavigatableRowsProp = {
125
- /**
126
- * The number of rows that can be navigated with focus up/down
127
- */
128
- navigatableRows: number,
129
- };
130
-
131
- type OnFocusChangeProp<T extends Program> = {
132
- /**
133
- * Called every time focus moves to different cell (even after mouse focuses the cell)
134
- */
135
- onFocusChange: FocusChangeCallback<T>,
136
- };
137
-
138
- type OnItemPressProp<T extends Program> = {
139
- /**
140
- * Called after pressing any item with data (not loading ones)
141
- */
142
- onItemPress: ItemPressCallback<T>,
143
- };
144
-
145
- type OnMouseEnterProp = {
146
- /**
147
- * onMouseEnter listener used only on the inside to synchronize keyboard and mouse navigation
148
- */
149
- onMouseEnter: (data: Asset | undefined) => void,
150
- };
151
-
152
- type OnScrolledToTimestampProp = {
153
- /**
154
- * Callback for scrolling left/right
155
- * @param timestamp Current timestamp of the center of the EPG in milliseconds
156
- */
157
- onScrolledToTimestamp: (timestamp: number) => void,
158
- };
159
-
160
- type PixelInMsProp = {
161
- /**
162
- * The ratio between pixels and milliseconds used in the EPG
163
- */
164
- pixelInMs: number,
165
- };
166
-
167
- type PluginsProp<T extends Program> = {
168
- /**
169
- * Prop for extending the EPG functionality
170
- */
171
- plugins: (PluginComponent<T> | PluginFC)[],
172
- };
173
-
174
- type ProgramTextModeResolverProp = {
175
- /**
176
- * Prop for resolving the text mode of the component based on the cell width
177
- * @param widthPx the width of the cell in pixels
178
- * @returns ProgramTextMode to use
179
- */
180
- programTextModeResolver: (widthPx: number) => ProgramTextMode,
181
- };
182
-
183
- type RenderChannelHeaderProp<T extends Header> = {
184
- /**
185
- * Function to render custom channel header item
186
- */
187
- renderChannelHeader: ChannelHeaderRenderer<T>,
188
- };
189
-
190
- type RenderDayProp<X extends Day> = {
191
- /**
192
- * Function to render custom day displaying component
193
- */
194
- renderDay?: DayRenderer<X>,
195
- };
196
-
197
- type RenderNowLineHeaderProp = {
198
- /**
199
- * Function to render custom now line header (e.g. LIVE arrow pointer at the top of the line)
200
- */
201
- renderNowLineHeader: (timestamp: number, ref: Reference<NowLineHeader>) => JSX.Element,
202
- };
203
-
204
- type RenderProgramProp<T extends Program> = {
205
- renderProgram: ProgramRenderer<T>,
206
- };
207
-
208
- type RenderTimeProp<T extends TimelineSection> = {
209
- /**
210
- * Custom function to render time inside the timeline section
211
- */
212
- renderTime: TimeRenderer<T>,
213
- };
214
-
215
- type IsFocusInRowsProp = {
216
- /**
217
- * Returns whether the focus is in Rows part of the epg.
218
- * @returns true fif cosu is in rows part, false otherwise
219
- */
220
- isFocusInRows: () => boolean,
221
- };
222
-
223
- type RowHeightPxProp = {
224
- /**
225
- * The height of the EPG row in pixels
226
- */
227
- rowHeightPx: number,
228
- };
229
-
230
- type SectionWidthMsProp = {
231
- /**
232
- * The width of the section in upper timeline header
233
- */
234
- sectionWidthMs: number,
235
- };
236
-
237
- type ScrollStepMsProp = {
238
- /**
239
- * The number of milliseconds that should be scrolled when moving left and right
240
- */
241
- scrollStepMs: number,
242
- };
243
-
244
- type SmallestAllowedCellPxProp = {
245
- /**
246
- * If the width of the cell is smaller than this the cell will have a special
247
- * class `too-small`. Value in pixels.
248
- */
249
- smallestAllowedCellPx: number,
250
- };
251
-
252
- type IdleTimerMsProp = {
253
- /**
254
- * The number of milliseconds of inactivity (no input) after which EPG starts jumps
255
- * to the current time.
256
- */
257
- idleTimerMs: number,
258
- };
259
-
260
- type TimeProp = {
261
- /**
262
- * The time interface that provides current time and time change events
263
- */
264
- time: Time,
265
- };
266
-
267
- type TimeProviderProp = {
268
- /**
269
- * Function for providing current time
270
- */
271
- timeProvider: TimeProvider,
272
- };
273
-
274
- type TimelineSectionWidthMsProp = {
275
- /**
276
- * The width of the timeline section (time distance between markers)
277
- */
278
- timelineSectionWidthMs: number,
279
- };
280
-
281
- type TimelineWidthMsProp = {
282
- /**
283
- * The width of the visible epg section with data in milliseconds
284
- */
285
- timelineWidthMs: number,
286
- };
287
-
288
- type TimelineWidthPxProp = {
289
- /**
290
- * The width of the visible epg section with data in pixels
291
- */
292
- timelineWidthPx: number,
293
- };
294
-
295
- type TimestampProp = {
296
- /**
297
- * The current timestamp of the center of the EPG
298
- */
299
- timestamp: number,
300
- };
301
-
302
- type XOffsetPxProp = {
303
- /**
304
- * The initial x-axis offset in pixels to set during the render
305
- */
306
- xOffsetPx: number,
307
- };
308
-
309
- type WidthPxProp = {
310
- /**
311
- * The initial width in pixels to set during the render
312
- */
313
- widthPx: number,
314
- };
315
-
316
- // MARK: shared types and interfaces
317
-
318
- /**
319
- * This function should return rendered ChannelHeader.
320
- * ChannelHeader usually consists of channel number and channel icon or name.
321
- * @typeparam T Channel header component - defaults to Header component
322
- * @param data Channel data
323
- * @param ref Reference to the component
324
- * @returns JSX.Element
325
- */
326
- export type ChannelHeaderRenderer<T extends Header> = (
327
- (data: Asset, ref: Reference<T>) => JSX.Element
328
- );
329
-
330
- /**
331
- * This function should fetch and asynchronously return more programs for given channel
332
- * and timeframe.
333
- * @param channel Channel data
334
- * @param from Timestamp for the start of the timeframe
335
- * @param to Timestamp for the end of the timeframe
336
- * @returns Promise<Asset[]>
337
- */
338
- export type ProgramsFetcher<
339
- > = (channel: Asset, from: number, to: number) => Promise<Asset[]>;
340
-
341
- export type FetchCallback = () => void;
342
-
343
- /**
344
- * This function should return custom visual for Program.
345
- * @typeparam T Program component - defaults to EpgProgram component
346
- * @param isLoading Flag to mark whether it is just a loading placeholder
347
- * @param data Program data or undefined for loading placeholder
348
- * @param ref Reference to the component
349
- * @param widthPx The initial width of the Program component to render with
350
- * @param xOffsetPx The initial offset of the Program component to render with
351
- * @param textMode The initial program text mode during the render
352
- * @returns JSX.Element
353
- */
354
- export type ProgramRenderer<T extends Program> = (
355
- isLoading: boolean,
356
- data: Asset | undefined,
357
- ref: Reference<T>,
358
- widthPx: number,
359
- xOffsetPx: number,
360
- textMode: ProgramTextMode,
361
- ) => JSX.Element;
362
-
363
- /**
364
- * This function should return custom visual of the time in Timeline.
365
- * This component must implement TimelineSection interface.
366
- * @param timestamp Timestamp of the time for formatting
367
- * @param offset Initial offset to render with in pixels
368
- * @param width width of the section to render in pixels
369
- * @param ref Reference to TimelineSection component
370
- * @returns JSX.Element
371
- */
372
- export type TimeRenderer<
373
- T extends TimelineSection = TimelineSection,
374
- > = (
375
- timestamp: number, offset: number, width: number, ref: Reference<T>,
376
- ) => JSX.Element;
377
-
378
- /**
379
- * This function will be called when an Item with Program Data is pressed.
380
- * @typeparam T extension of a Program component
381
- * @param data Current Program data
382
- * @param channel The program's channel
383
- * @param component Pressed Program component
384
- */
385
- export type ItemPressCallback<T extends Program> = (
386
- (data: Asset, channel: Asset, component: T) => void
387
- );
388
-
389
- /**
390
- * This function will be called when an Item with Program Data is pressed.
391
- * @typeparam T extension of a Program component
392
- * @param data Current EpgProgram data
393
- * @param component Pressed Program component
394
- */
395
- export type ChannelLessItemPressCallback<T extends Program> = (
396
- (data: Asset, component: T) => void
397
- );
398
-
399
- /**
400
- * This function will be called when any item is focused
401
- * @typeparam T extension of a Program component
402
- * @param data Current EpgProgram data or undefined if the focus is on loading cell
403
- * @param channel The program's channel
404
- * @param component Program component of the focused Cell
405
- */
406
- export type FocusChangeCallback<T extends Program> = (
407
- (data: Asset | undefined, channel: Asset, component: T) => void
408
- );
409
-
410
- /**
411
- * This function will be called when any item is focused
412
- * @typeparam T extension of a Program component
413
- * @param data Current EpgProgram data or undefined if the focus is on loading cell
414
- * @param component Program component of the focused Cell
415
- */
416
- export type ChannelLessFocusChangeCallback<T extends Program> = (
417
- (data: Asset | undefined, component: T) => void
418
- );
419
-
420
- export type DayRenderer<
421
- T extends Day = Day,
422
- > = (timestamp: number, ref: Reference<T>) => JSX.Element;
423
-
424
- /**
425
- * Simple functions that returns current unix time in milliseconds
426
- */
427
- export type TimeProvider = () => number;
428
-
429
- // MARK: DataManager
430
-
431
- export type DataRange = [number, number];
432
-
433
- export type DataUpdateCallback = () => void;
434
-
435
- export interface DataManager {
436
- getChannel: () => Asset,
437
- getData: () => Asset[],
438
- getDataFromRange: (range: DataRange) => Asset[],
439
- getNextProgramStart: (timestamp: number) => number | null,
440
- getPreviousProgramEnd: (timestamp: number, scrollStepMs: number) => number | null,
441
- setOnDataUpdated: (callback: DataUpdateCallback) => void,
442
- removeOnDataUpdated: () => void,
443
- fetchAroundTimestampIfNeeded: (timestamp: number) => void,
444
- }
445
-
446
- // MARK: Time Events
447
-
448
- export interface TimeEvents extends EventMapType {
449
- 'onminute': (timestamp: number) => void,
450
- 'onsecond': (timestamp: number) => void,
451
- }
452
-
453
- /**
454
- * Interface for managing time updates inside EPG
455
- */
456
- export interface Time extends IEvents<TimeEvents> {
457
- /**
458
- * This function starts the timer that fires the events every time interval
459
- */
460
- initialize: () => void,
461
- /**
462
- * This function stops the timer
463
- */
464
- destroy: () => void,
465
- /**
466
- * Returns current timestamp in ms
467
- */
468
- getCurrentTime: () => number,
469
- }
470
-
471
- // MARK: EPG Program Component
472
-
473
- export type ProgramTextMode = 'full' | 'ellipsis_only' | 'empty';
474
-
475
- /**
476
- * Props passed to custom rendered Program Component.
477
- */
478
- export type ProgramProps = {
479
- /**
480
- * Program data
481
- */
482
- data?: Asset,
483
- /**
484
- * Flag that it is a loading placeholder
485
- */
486
- isLoading?: boolean,
487
- /**
488
- * Initial width of the Component
489
- */
490
- widthPx: number,
491
- /**
492
- * Initial x offset of the Component
493
- */
494
- xOffsetPx: number,
495
- /**
496
- * The text mode for the initial Program render
497
- */
498
- textMode: ProgramTextMode,
499
- };
500
-
501
- /**
502
- * Custom visual component for a program.
503
- * This component should render a pure div and shouldn't handle any events
504
- * like onPress or onMouseEnter. This is done by Cell component in EPG core.
505
- * This component can be reused for multiple programs during its lifetime.
506
- */
507
- export interface Program
508
- extends Component<any> {
509
- /**
510
- * Function to offset the Program component inside the cell.
511
- * This is so the cells at the start of the viewport show text from the beginning
512
- * even though the Cell itself goes more to the past.
513
- * @param offset offset in x axis in px
514
- */
515
- setOffset?(offset: number): void,
516
- /**
517
- * Function to change width of the Program component inside the cell.
518
- * This is so the cells at the start of the viewport show text from the beginning
519
- * even though the Cell itself goes more to the past.
520
- * @param width width in px
521
- */
522
- setWidth?(width: number): void,
523
- /**
524
- * Function to change data and the visuals.
525
- * (E.g. Use setText to change the name)
526
- * @param data New Program data
527
- * @param textMode the text mode to use to display the program
528
- * @param widthPx the full width of the cell in pixels that can be used to alter styling
529
- * @param xOffsetPx the offset of the cell in pixels that can be used to alter styling
530
- */
531
- updateData(data: Asset, textMode: ProgramTextMode, widthPx: number, xOffsetPx: number): void,
532
- }
533
-
534
- export interface ProgramComponent {
535
- new (props: any): Program,
536
- }
537
-
538
- // MARK: EPG Header Component
539
-
540
- /**
541
- * Props for the Channel Header Component
542
- */
543
- export type HeaderProps = {
544
- /**
545
- * Channel Data
546
- */
547
- data: Asset,
548
- };
549
-
550
- /**
551
- * Channel Header component.
552
- * This component represents the channel header aka channel number and name/icon.
553
- * It can be reused by multiple headers.
554
- */
555
- export interface Header
556
- extends Component<any> {
557
- /**
558
- * Function to show the header element
559
- */
560
- show(): void,
561
- /**
562
- * Function to hide the header element
563
- */
564
- hide(): void,
565
- /**
566
- * Function to update the visuals
567
- */
568
- updateData(data: Asset): void,
569
- }
570
-
571
- export interface HeaderComponent {
572
- new (props: any): Header,
573
- }
574
-
575
- // MARK: EPG NowLineHeader Component
576
-
577
- export interface NowLineHeader extends Component<any> {
578
- /**
579
- * Function to display the displayed time in the timeline header
580
- * @param timestamp current time in ms
581
- */
582
- updateData: (timestamp: number) => void,
583
- }
584
-
585
- export interface NowLineHeaderComponent {
586
- new (props: any): NowLineHeader,
587
- }
588
-
589
- // MARK: EPG Day Component
590
-
591
- /**
592
- * Props for the Day Component
593
- */
594
- export type DayProps = (
595
- TimestampProp
596
- );
597
-
598
- export interface Day extends Component<any> {
599
- /**
600
- * Function to update the displayed date when the visible day changes in EPG
601
- * @param timestamp New timestamp for the date
602
- */
603
- updateData: (timestamp: number) => void,
604
- }
605
-
606
- export interface DayComponent {
607
- new (props: DayProps): Day,
608
- }
609
-
610
- // MARK: EPG DatePicker Component
611
-
612
- /**
613
- * Props for the EPG DatePicker Component
614
- */
615
- export type DatePickerProps = {
616
- /**
617
- * Number of days into the past to show (today excluded)
618
- */
619
- daysInPast: number,
620
- /**
621
- * Number of days to future to show (today excluded)
622
- */
623
- daysToFuture: number,
624
- /**
625
- * Number of milliseconds since the day start to scroll to
626
- * @example (8 * 60 + 30) * 1000 will scroll directly to 8:30 on date picker day selected
627
- */
628
- dayStartOffsetMs?: number,
629
- /**
630
- * Current selected value
631
- */
632
- timestamp: number,
633
- /**
634
- * Number of visible items
635
- */
636
- visibleItems: number,
637
- /**
638
- * Number of pixels to scroll
639
- */
640
- scrollStep: number,
641
- /**
642
- * Reference to the modal service
643
- */
644
- modalService: Reference<ModalService>,
645
- /**
646
- * Function to call when the picker value changes
647
- * @param timestamp currently selected value as timestamp in ms
648
- */
649
- onValueChange: (timestamp: number) => void,
650
- /**
651
- * Function to format the date string in DatePicker
652
- * @param date Date object of the value to format
653
- * @returns string to display
654
- */
655
- format?: (date: Date) => string,
656
- /**
657
- * Custom overrides for the DatePicker
658
- */
659
- overrides?: Record<number, string>,
660
- /**
661
- * Optional setting for Picker Mode (defaults to MODAL)
662
- */
663
- mode?: PickerMode,
664
- /**
665
- * Optional className to pass to DatePicker
666
- */
667
- className?: string,
668
- /**
669
- * Optional className to pass to PickerModal dialog
670
- */
671
- modalClassName?: string,
672
- /**
673
- * Optional override for checkbox
674
- */
675
- Checkbox?: ICheckbox<any>,
676
- /**
677
- * Optional override for checkmark
678
- */
679
- checkmark?: Children,
680
- /**
681
- * Custom render method for picker button
682
- */
683
- render?: (
684
- buttonRef: Reference<HTMLElement>,
685
- textRef: Reference<HTMLElement>,
686
- openCallback: () => void,
687
- text?: string,
688
- ) => JSX.Element,
689
- };
690
-
691
- export type OutsideDatePickerProps = Omit<
692
- DatePickerProps, 'timestamp' | 'onValueChange'
693
- >;
694
-
695
- export type DatePickerDateProps = 'daysInPast' | 'daysToFuture' | 'dayStartOffsetMs' | 'timestamp';
696
-
697
- /**
698
- * EPG DatePicker Component
699
- */
700
- export interface DatePicker extends Component<DatePickerProps>, IFocusable {
701
- /**
702
- * Function to update current DatePicker value when the day changes
703
- */
704
- updateData: (timestamp: number) => void,
705
- }
706
-
707
- export interface DatePickerComponent {
708
- new (props: DatePickerProps): DatePicker,
709
- }
710
-
711
- // MARK: EPG NowLine Component
712
-
713
- /**
714
- * Props for NowLine Component (Vertical line marking current time across the rows).
715
- */
716
- export type NowLineProps = (
717
- & TimelineWidthPxProp
718
- & TimestampProp
719
- & TimeProp
720
- & PixelInMsProp
721
- & ChannelHeaderWidthPxProp
722
- & Partial<RenderNowLineHeaderProp>
723
- );
724
-
725
- /**
726
- * NowLine component renders vertical line marking current time.
727
- */
728
- export interface NowLine extends Component<NowLineProps> {
729
- /**
730
- * Function to update NowLine position when EPG scrolls left/right
731
- * @param timestamp Current timestamp of the EPG
732
- */
733
- scrollToTimestamp: (timestamp: number) => void,
734
- }
735
-
736
- export interface NowLineComponent {
737
- new (props: NowLineProps): NowLine,
738
- }
739
-
740
- // MARK: EPG Timeline Component
741
-
742
- /**
743
- * Props for the Timeline Component
744
- * @typeparam T TimelineSection component
745
- */
746
- export type TimelineProps<
747
- T extends TimelineSection,
748
- > = (
749
- & PixelInMsProp
750
- & TimelineWidthPxProp
751
- & ChannelHeaderWidthPxProp
752
- & TimestampProp
753
- & RenderTimeProp<T>
754
- & SectionWidthMsProp
755
- );
756
-
757
- /**
758
- * Timeline Component
759
- * This component renders the timeline at the top of the EPG
760
- * @typeparam T TimelineSection component
761
- */
762
- export interface Timeline<
763
- T extends TimelineSection,
764
- > extends Component<TimelineProps<T>> {
765
- /**
766
- * Function to set the current timestamp and scroll to it.
767
- */
768
- scrollToTimestamp: (timestamp: number) => void,
769
- }
770
-
771
- export interface TimelineComponent<
772
- T extends TimelineSection,
773
- > {
774
- new (props: TimelineProps<T>): Timeline<T>,
775
- }
776
-
777
- // MARK: TimelineSection Component
778
-
779
- /**
780
- * Props for the TimelineSection Component
781
- */
782
- export type TimelineSectionProps = (
783
- & TimestampProp
784
- & XOffsetPxProp
785
- & WidthPxProp
786
- );
787
-
788
- /**
789
- * TimelineSection Component
790
- * This component displays the time on the Timeline
791
- * It can be reused to display multiple times.
792
- */
793
- export interface TimelineSection extends Component<any> {
794
- /**
795
- * Function to set offset in x direction.
796
- * @param x x direction offset in pixels
797
- */
798
- setOffset: (x: number) => void,
799
- /**
800
- * Function to update displayed time
801
- * @param timestamp New timestamp to format and render
802
- */
803
- updateData: (timestamp: number) => void,
804
- }
805
-
806
- export interface TimelineSectionComponent {
807
- new (props: TimelineSectionProps): TimelineSection,
808
- }
809
-
810
- // MARK: EPG RowsManager Component
811
-
812
- export type RowsManagerProps<
813
- T extends Header,
814
- U extends Program,
815
- > = (
816
- & DataManagersProp
817
- & InitialChannelIndexProp
818
- & NavigatableRowsProp
819
- & AdditionalRowsProp
820
- & PixelInMsProp
821
- & TimelineWidthPxProp
822
- & TimelineWidthMsProp
823
- & TimestampProp
824
- & TimeProp
825
- & ScrollStepMsProp
826
- & RowHeightPxProp
827
- & ProgramTextModeResolverProp
828
- & OnItemPressProp<U>
829
- & OnMouseEnterProp
830
- & OnFocusChangeProp<U>
831
- & RenderChannelHeaderProp<T>
832
- & RenderProgramProp<U>
833
- & IsFocusInRowsProp
834
- & SmallestAllowedCellPxProp
835
- );
836
-
837
- /**
838
- * RowsManager Component
839
- * It does heavy lifting for maintaining and managing rows
840
- * so it could be better split from the main EPG Component
841
- */
842
- export interface RowsManager<
843
- T extends Header,
844
- U extends Program,
845
- > extends Component<RowsManagerProps<T, U>> {
846
- /**
847
- * Function called on pressing UP. Used to navigate up in the channels list.
848
- */
849
- onUp: () => boolean,
850
- /**
851
- * Function called on pressing DOWN. Used to navigate down in the channels list.
852
- */
853
- onDown: () => boolean,
854
- /**
855
- * Function called on pressing CHANNEL_UP. Used to navigate page up in the channels list.
856
- */
857
- onChannelUp: () => boolean,
858
- /**
859
- * Function called on pressing CHANNEL_DOWN. Used to navigate page down in the channels list.
860
- */
861
- onChannelDown: () => boolean,
862
- /**
863
- * Function to call when fast scrolling starts
864
- * - to optimize cell rendering during the fast scroll
865
- */
866
- onFastScrollingStart: () => void,
867
- /**
868
- * Function to call when fast vertical scrolling ends
869
- * - to render cell data after being optimized for fast scroll
870
- * - to call fetch in data managers connected to rows
871
- */
872
- onFastScrollingEnd: () => void,
873
- /**
874
- * Function to find the start of the next program on the active row.
875
- * @param timestamp timestamp to search from
876
- * @returns timestamp of the start of the next program or end loading cell
877
- */
878
- getNextProgramStart: (timestamp: number) => number | null,
879
- /**
880
- * Function to find the end of the previous program on the active row.
881
- * @param timestamp timestamp to search from
882
- * @param customScrollStepMs optional custom offset from previous program end
883
- * @returns timestamp of the end of the previous program or start loading cell
884
- */
885
- getPreviousProgramEnd: (timestamp: number, customScrollStepMs?: number) => number | null,
886
- /**
887
- * Sets the channel index to scroll to.
888
- */
889
- setCurrentChannelIndex: (index: number) => void,
890
- /**
891
- * Sets the focus timestamp
892
- */
893
- setFocusTimestamp: (timestamp: number) => void,
894
- /**
895
- * Function that returns whether there are rows higher that could be navigated.
896
- */
897
- canGoUp: () => boolean,
898
- /**
899
- * Function that returns whether there are rows lower that could be navigated.
900
- */
901
- canGoDown: () => boolean,
902
- /**
903
- * Focuses the active row at a given timestamp.
904
- */
905
- focus: (timestamp: number, options?: FocusOptions) => void,
906
- /**
907
- * Scrolls the rows to the given timestamp.
908
- */
909
- scrollRowsToTimestamp: (timestamp: number) => void,
910
- /**
911
- * Function to scroll up
912
- * @returns true if it was scrolled, false otherwise
913
- */
914
- scrollUp: () => boolean,
915
- /**
916
- * Function to scroll down
917
- * @returns true if it was scrolled, false otherwise
918
- */
919
- scrollDown: () => boolean,
920
- }
921
-
922
- export interface RowsManagerComponent<
923
- T extends Header,
924
- U extends Program,
925
- > {
926
- new (props: RowsManagerProps<T, U>): RowsManager<T, U>,
927
- }
928
-
929
- // MARK: EPG Row Component
930
-
931
- /**
932
- * Props for EPG Row component
933
- * @typeparam T Program component - defaults to EpgProgram
934
- */
935
- export type RowProps<
936
- T extends Program,
937
- > = (
938
- & DataProp
939
- & PixelInMsProp
940
- & TimelineWidthPxProp
941
- & TimelineWidthMsProp
942
- & TimestampProp
943
- & TimeProp
944
- & ScrollStepMsProp
945
- & SmallestAllowedCellPxProp
946
- & ProgramTextModeResolverProp
947
- & OnItemPressProp<T>
948
- & OnMouseEnterProp
949
- & OnFocusChangeProp<T>
950
- & RenderProgramProp<T>
951
- );
952
-
953
- /**
954
- * EPG Row component
955
- * It can be reused by multiple rows
956
- * @typeparam T Program component - defaults to EpgProgram
957
- */
958
- export interface Row<
959
- T extends Program,
960
- > extends Component<RowProps<T>> {
961
- /**
962
- * Timestamp for the center of the row
963
- */
964
- timestamp: number;
965
- /**
966
- * Function to call when fast scrolling starts
967
- * - to optimize cell rendering during the fast scroll
968
- */
969
- onFastScrollingStart: () => void,
970
- /**
971
- * Function to call when fast vertical scrolling ends
972
- * - to render cell data after being optimized for fast scroll
973
- * - to call fetch in data managers connected to rows
974
- */
975
- onFastScrollingEnd: () => void,
976
- /**
977
- * Function to find the start of the next program on the active row.
978
- * @param timestamp timestamp to search from
979
- * @returns timestamp of the start of the next program or end loading cell
980
- */
981
- getNextProgramStart: (timestamp: number) => number | null,
982
- /**
983
- * Function to find the end of the previous program on the active row.
984
- * @param timestamp timestamp to search from
985
- * @param customScrollStepMs optional custom offset from previous program end
986
- * @returns timestamp of the end of the previous program or end loading cell
987
- */
988
- getPreviousProgramEnd: (timestamp: number, customScrollStepMs?: number) => number | null,
989
- /**
990
- * Function to set the row as active (the one with focus)
991
- */
992
- setActive: () => void,
993
- /**
994
- * Function to set the row as inactive (the one without focus)
995
- */
996
- setInactive: () => void,
997
- /**
998
- * Function to offset the row for vertucal scrolling
999
- * @param yOffsetPx number of pixels to set as y axis offset
1000
- */
1001
- setOffset: (yOffsetPx: number) => void,
1002
- /**
1003
- * Function to return true if row already has this data manager
1004
- * @param dataManager DataManager that gets compared to the current dataManager
1005
- * @returns true if they are the same reference, false otherwise
1006
- */
1007
- hasDataManager: (dataManager: DataManager) => boolean,
1008
- /**
1009
- * Function to focus the EPG Row
1010
- * @param timestamp timestamp where the focus should happen
1011
- * @param options FocusOptions to pass down
1012
- */
1013
- focus: (timestamp: number, options?: FocusOptions) => void,
1014
- /**
1015
- * Function to set the current timestamp and scroll to it.
1016
- * @param timestamp timestamp to scroll to
1017
- */
1018
- scrollToTimestamp: (timestamp: number) => void,
1019
- /**
1020
- * Function to show the row
1021
- */
1022
- show: () => void,
1023
- /**
1024
- * Function to hide the row
1025
- */
1026
- hide: () => void,
1027
- /**
1028
- * Updates the row with new channel and data for cells
1029
- * @param data new data to update the row with
1030
- */
1031
- updateData: (data: DataManager) => void,
1032
- }
1033
-
1034
- export interface RowComponent<
1035
- T extends Program,
1036
- > {
1037
- new (props: RowProps<T>): Row<T>,
1038
- }
1039
-
1040
- // MARK: EPG CellsManager Component
1041
-
1042
- /**
1043
- * Props for CellsManager Component
1044
- */
1045
- export type CellsManagerProps<
1046
- T extends Program,
1047
- > = (
1048
- & DataGetterProp
1049
- & TimelineWidthMsProp
1050
- & TimelineWidthPxProp
1051
- & TimestampProp
1052
- & TimeProp
1053
- & PixelInMsProp
1054
- & ChannelLessOnItemPressProp<T>
1055
- & ChannelLessOnFocusChangeProp<T>
1056
- & ProgramTextModeResolverProp
1057
- & OnMouseEnterProp
1058
- & RenderProgramProp<T>
1059
- & SmallestAllowedCellPxProp
1060
- );
1061
-
1062
- /**
1063
- * CellsManager Component is a part of Row that is responsible for rendering and handling the cells.
1064
- * @typeparam T EpgProgram component rendered by cells
1065
- */
1066
- export interface CellsManager<
1067
- T extends Program,
1068
- > extends Component<CellsManagerProps<T>> {
1069
- /**
1070
- * Current timestamp of the manager
1071
- */
1072
- timestamp: number,
1073
- /**
1074
- * Function to call when fast scrolling starts
1075
- * - to optimize cell rendering during the fast scroll
1076
- */
1077
- onFastScrollingStart: () => void,
1078
- /**
1079
- * Function to call when fast vertical scrolling ends
1080
- * - to render cell data after being optimized for fast scroll
1081
- */
1082
- onFastScrollingEnd: () => void,
1083
- /**
1084
- * Function to make the row active (the one with focus)
1085
- */
1086
- setActive: () => void,
1087
- /**
1088
- * Function to make the row inactive (the one without focus)
1089
- */
1090
- setInactive: () => void,
1091
- /**
1092
- * Function to offset wrapping div in y axis
1093
- * @param yOffsetPx number of pixels to set as offset
1094
- */
1095
- setOffset: (yOffsetPx: number) => void,
1096
- /**
1097
- * Function to focus the cell at given timestamp with given options
1098
- */
1099
- focus: (timestamp: number, options?: FocusOptions) => void,
1100
- /**
1101
- * Function to scroll to the given timestamp
1102
- */
1103
- scrollToTimestamp: (timestamp: number) => void,
1104
- /**
1105
- * Function to show the whole row
1106
- */
1107
- show: () => void,
1108
- /**
1109
- * Function to hide the whole row
1110
- */
1111
- hide: () => void,
1112
- /**
1113
- * Function to return whether the cells are visible or hidden
1114
- */
1115
- isVisible: () => boolean,
1116
- /**
1117
- * Function to initialize cells update (e.g. after new data fetch)
1118
- */
1119
- updateCellsData: () => void,
1120
- }
1121
-
1122
- export interface CellsManagerComponent<
1123
- T extends Program,
1124
- > {
1125
- new (props: CellsManagerProps<T>): CellsManager<T>,
1126
- }
1127
-
1128
- // MARK: EPG Cell Component
1129
-
1130
- /**
1131
- * Props for any EPG Cell component
1132
- * @typeparam T Program component - defaults to EpgProgram
1133
- */
1134
- export type CellProps<
1135
- T extends Program,
1136
- > = (
1137
- & WidthPxProp
1138
- & XOffsetPxProp
1139
- & TimeProp
1140
- & Partial<ItemProp>
1141
- & Partial<IsLoadingProp>
1142
- & ChannelLessOnItemPressProp<T>
1143
- & ChannelLessOnFocusChangeProp<T>
1144
- & ProgramTextModeResolverProp
1145
- & OnMouseEnterProp
1146
- & RenderProgramProp<T>
1147
- & SmallestAllowedCellPxProp
1148
- );
1149
-
1150
- /**
1151
- * EPG Cell component
1152
- * @typeparam T Program component - defaults to EpgProgram
1153
- */
1154
- export interface Cell<
1155
- T extends Program,
1156
- > extends Component<CellProps<T>>, IFocusable {
1157
- /**
1158
- * DOM wrapper element
1159
- */
1160
- div: Reference<HTMLDivElement>,
1161
- /**
1162
- * Current Program data
1163
- */
1164
- item?: Asset,
1165
- /**
1166
- * Reference to custom visuals component
1167
- */
1168
- programComponent: Reference<T>,
1169
- /**
1170
- * Function to get width of the cell in pixels
1171
- * @returns width of the cell in pixels
1172
- */
1173
- getWidth: () => number,
1174
- /**
1175
- * Function to get x offset position of the cell in pixels
1176
- * @returns x direction offset in pixels
1177
- */
1178
- getOffset: () => number,
1179
- /**
1180
- * Function to set width of the cell in pixels
1181
- * @param width width of the cell to set
1182
- */
1183
- setWidth: (width: number) => void,
1184
- /**
1185
- * Function to offset x position of the cell in pixels
1186
- * @param x x direction offset in pixels
1187
- */
1188
- setOffset: (x: number) => void,
1189
- /**
1190
- * Function to show the cell
1191
- */
1192
- show: () => void,
1193
- /**
1194
- * Function to hide the cell
1195
- */
1196
- hide: () => void,
1197
- /**
1198
- * Function to return whether the cell is visible (does not have .display-none class)
1199
- */
1200
- isVisible: () => boolean,
1201
- /**
1202
- * Function to return whether the element belongs to the cell's Interactable component.
1203
- * @param element HTMLElement to compare with Interactable
1204
- * @returns true if element matches Interactable, false otherwise
1205
- */
1206
- hasDom: (element: HTMLElement) => boolean,
1207
- /**
1208
- * Function to update data and visuals
1209
- * @param data New Program data
1210
- */
1211
- updateData: (data: Asset) => void,
1212
- }
1213
-
1214
- export interface CellComponent<
1215
- T extends Program,
1216
- > {
1217
- new (props: CellProps<T>): Cell<T>,
1218
- }
1219
-
1220
- // MARK: EPG Mouse Navigation
1221
-
1222
- export type EpgMouseNavigationProps = {
1223
- /**
1224
- * Function to call on the press of up arrow
1225
- */
1226
- onUp: () => void,
1227
- /**
1228
- * Function to call on the press of down arrow
1229
- */
1230
- onDown: () => void,
1231
- /**
1232
- * Function to call on the press of left arrow
1233
- */
1234
- onLeft: () => void,
1235
- /**
1236
- * Function to call on the press of right arrow
1237
- */
1238
- onRight: () => void,
1239
- };
1240
-
1241
- export interface EpgMouseNavigation extends Component<EpgMouseNavigationProps> {
1242
- /**
1243
- * Function to enable showing an arrow in given direction
1244
- */
1245
- enableDirection: (direction: MouseArrowDirection) => void,
1246
- /**
1247
- * Function to disable showing an arrow in given direction
1248
- */
1249
- disableDirection: (direction: MouseArrowDirection) => void,
1250
- }
1251
-
1252
- export interface EpgMouseNavigationComponent {
1253
- new (props: EpgMouseNavigationProps): EpgMouseNavigation,
1254
- }
1255
-
1256
- export type MouseArrowDirection = 'up' | 'down' | 'left' | 'right';
1257
-
1258
- // MARK: EPG Component
1259
-
1260
- /**
1261
- * Props for the main EPG component
1262
- * @typeparam T Channel header component - defaults to Header
1263
- * @typeparam U Program component - defaults to Program
1264
- * @typeparam V Day component - default to Day
1265
- * @typeparam W Timeline section component - default to TimelineSection
1266
- */
1267
- export type Props<
1268
- T extends Header,
1269
- U extends Program,
1270
- V extends Day,
1271
- W extends TimelineSection,
1272
- > = (
1273
- & TimelineWidthPxProp
1274
- & RowHeightPxProp
1275
- & NavigatableRowsProp
1276
- & AdditionalRowsProp
1277
- & ChannelHeaderWidthPxProp
1278
- & ChannelDataProp
1279
- & FetchProgramsProp
1280
- & Partial<TimelineWidthMsProp>
1281
- & Partial<ScrollStepMsProp>
1282
- & Partial<IdleTimerMsProp>
1283
- & Partial<TimelineSectionWidthMsProp>
1284
- & Partial<LimitFromMsProp>
1285
- & Partial<LimitToMsProp>
1286
- & Partial<TimeProviderProp>
1287
- & Partial<InitialTimestampProp>
1288
- & Partial<InitialChannelIndexProp>
1289
- & Partial<ProgramTextModeResolverProp>
1290
- & Partial<SmallestAllowedCellPxProp>
1291
- & OnItemPressProp<U>
1292
- & Partial<OnFocusChangeProp<U>>
1293
- & Partial<OnScrolledToTimestampProp>
1294
- & Partial<RenderNowLineHeaderProp>
1295
- & Partial<RenderChannelHeaderProp<T>>
1296
- & Partial<RenderProgramProp<U>>
1297
- & Partial<RenderDayProp<V>>
1298
- & Partial<RenderTimeProp<W>>
1299
- & Partial<DatePickerProp>
1300
- & Partial<PluginsProp<U>>
1301
- );
1302
-
1303
- /**
1304
- * Main EPG component
1305
- * @typeparam T Channel header component - defaults to Header
1306
- * @typeparam U Program component - defaults to Program
1307
- * @typeparam V Day component - default to Day
1308
- * @typeparam W Timeline section component - default to TimelineSection
1309
- */
1310
- export interface Epg<
1311
- T extends Header,
1312
- U extends Program,
1313
- V extends Day,
1314
- W extends TimelineSection,
1315
- > extends Component<Props<T, U, V, W>>, IFocusable {
1316
- /**
1317
- * Function to return whether EPG is fast scrolling
1318
- * @returns true if is fast scrolling in any axis, false otherwise
1319
- */
1320
- isFastScrolling: () => boolean,
1321
- /**
1322
- * Function to return whether EPG is fast scrolling horizontally
1323
- * @returns true if is fast scrolling horizontally, false otherwise
1324
- */
1325
- isHorizontallyFastScrolling: () => boolean,
1326
- /**
1327
- * Function to return whether EPG is fast scrolling
1328
- * @returns true if is fast scrolling vertically, false otherwise
1329
- */
1330
- isVerticallyFastScrolling: () => boolean,
1331
- /**
1332
- * Scrolls to given timestamp if possible
1333
- * @param timestamp Timestamp to scroll to
1334
- * @throws when the timestamp is outside of limitFromMs and limitToMs range
1335
- */
1336
- scrollToTimestamp: (timestamp: number) => void,
1337
- /**
1338
- * Scrolls to given channel index if possible
1339
- * @param index Index of the channel to scroll to
1340
- * @throws when the index is outside of 0 and channels.length - 1 range
1341
- */
1342
- scrollToChannelIndex: (index: number) => void,
1343
- }
1344
-
1345
- /**
1346
- * Internal interface of the Main EPG Component for internal components
1347
- * but should not be used from the outside.
1348
- * @typeparam T Channel header component - defaults to Header
1349
- * @typeparam U Program component - defaults to Program
1350
- * @typeparam V Day component - default to Day
1351
- * @typeparam W Timeline section component - default to TimelineSection
1352
- */
1353
- export interface InternalEpg<
1354
- T extends Header,
1355
- U extends Program,
1356
- V extends Day,
1357
- W extends TimelineSection,
1358
- > extends Epg<T, U, V, W> {
1359
- /**
1360
- * Current focused part of EPG
1361
- */
1362
- focused: EpgFocus,
1363
- /**
1364
- * Reference to the RowsManager
1365
- */
1366
- rows: Reference<RowsManager<T, U>>,
1367
- /**
1368
- * Current timestamp of the EPG
1369
- */
1370
- timestamp: number,
1371
- /**
1372
- * Current timestamp of the EPG focus
1373
- */
1374
- focusTimestamp: number,
1375
- /**
1376
- * TimeManager instance
1377
- */
1378
- time: Time,
1379
- /**
1380
- * Function to set the current EPG timestamp
1381
- * @param timestamp timestamp to set
1382
- */
1383
- setCurrentTime: (timestamp: number) => void,
1384
- /**
1385
- * Function to set current focus time
1386
- * @param timestamp the timestamp to set as focus time
1387
- */
1388
- setFocusTimestamp: (timestamp: number) => void,
1389
- /**
1390
- * Function to set focus to DatePicker
1391
- */
1392
- setFocusToDatePicker: () => void,
1393
- /**
1394
- * Function to set focus to Epg rows
1395
- */
1396
- setFocusToEpg: () => void,
1397
- /**
1398
- * Function to set state of the up/down mouse arrows
1399
- */
1400
- setVerticalMouseArrows: () => void,
1401
- /**
1402
- * Function to set state of the left/right mouse arrows
1403
- */
1404
- setHorizontalMouseArrows: () => void,
1405
- /**
1406
- * Function to let EPG and its components know that the EPG
1407
- * switched to fast vertical scrolling (up/down between channels)
1408
- */
1409
- startFastVerticalScrolling: () => void,
1410
- /**
1411
- * Function to let EPG and its components know that the EPG
1412
- * switched to fast horizontal scrolling (left/right in time)
1413
- */
1414
- startFastHorizontalScrolling: () => void,
1415
- /**
1416
- * Function to let EPG and its components know that the EPG
1417
- * switched to normal vertical scrolling (up/down between channels)
1418
- */
1419
- stopFastVerticalScrolling: () => void,
1420
- /**
1421
- * Function to let EPG and its components know that the EPG
1422
- * switched to normal horizontal scrolling (left/right in time)
1423
- */
1424
- stopFastHorizontalScrolling: () => void,
1425
- /**
1426
- * Function that returns true if DatePicker is rendered
1427
- * @returns true if DatePicker is rendered, false otherwise
1428
- */
1429
- isDatePickerRendered: () => boolean,
1430
- }
1431
-
1432
- export interface EpgComponent<
1433
- T extends Header,
1434
- U extends Program,
1435
- V extends Day,
1436
- W extends TimelineSection,
1437
- > {
1438
- new (props: Props<T, U, V, W>): Epg<T, U, V, W>,
1439
- }
1440
-
1441
- /**
1442
- * Enumerator for current focus positions for EPG or DatePicker
1443
- */
1444
- export type EpgFocus = 'datepicker' | 'epg';
1445
-
1446
- // MARK: EPG Plugin
1447
-
1448
- export type PluginProps<
1449
- T extends Program = Program,
1450
- > = {
1451
- /**
1452
- * Reference to the EPG component so it could be controlled from the plugin
1453
- */
1454
- epg?: Epg<any, T, any, any>
1455
- };
1456
-
1457
- /**
1458
- * EPG stores references to all plugins and on certain events it calls these
1459
- * methods if they are implemented by the plugin
1460
- */
1461
- export interface Plugin<
1462
- T extends Program = Program,
1463
- > extends Component<any> {
1464
- /**
1465
- * Called each time a focus changes. Due to implementation this can result
1466
- * in focus to different element with same data as before as same element
1467
- * but different data. And also same element and same data
1468
- */
1469
- onFocusChange?: FocusChangeCallback<T>,
1470
- /**
1471
- * Called each time EPG scrolls left/right in time
1472
- * @param timestamp current time of EPG in ms
1473
- */
1474
- onScrolledToTimestamp?: (timestamp: number) => void,
1475
- /**
1476
- * Called each time the Item is pressed. This is called before the outside
1477
- * callback from props. However, it cannot stop the event. Intended more for
1478
- * logging purposes than actual overrides.
1479
- */
1480
- onItemPress?: ItemPressCallback<T>,
1481
- /**
1482
- * Called each time EPG switches to fast scrolling in either direction.
1483
- * Called after onFast[Vertical/Horizontal]ScrollingStart.
1484
- * If both are implemented, then both (directional and general) methods are called.
1485
- */
1486
- onFastScrollingStart?: () => void,
1487
- /**
1488
- * Called each time EPG switches to fast scrolling in vertical (channels) direction.
1489
- */
1490
- onFastVerticalScrollingStart?: () => void,
1491
- /**
1492
- * Called each time EPG switches to fast scrolling in horizontal (time) direction.
1493
- */
1494
- onFastHorizontalScrollingStart?: () => void,
1495
- /**
1496
- * Called each time EPG switches back to normal scrolling in either direction.
1497
- * Called after onFast[Vertical/Horizontal]ScrollingEnd.
1498
- * If both are implemented, then both (directional and general) methods are called.
1499
- */
1500
- onFastScrollingEnd?: () => void,
1501
- /**
1502
- * Called each time EPG switches back to normal scrolling in vertical (channels) direction.
1503
- */
1504
- onFastVerticalScrollingEnd?: () => void,
1505
- /**
1506
- * Called each time EPG switches back to normal scrolling in horizontal (time) direction.
1507
- */
1508
- onFastHorizontalScrollingEnd?: () => void,
1509
- }
1510
-
1511
- export interface PluginComponent<
1512
- T extends Program,
1513
- > {
1514
- new (props: any): Plugin<T>,
1515
- }
1516
-
1517
- export interface PluginFC {
1518
- (props: any): JSX.Element,
1519
- }
1
+ import { Reference, Component, Children } from '@24i/bigscreen-sdk/jsx';
2
+ import { IFocusable } from '@24i/bigscreen-sdk/focus';
3
+ import { ModalService } from '@24i/bigscreen-sdk/modal-service';
4
+ import { IEvents, EventMapType } from '@24i/bigscreen-sdk/events-manager';
5
+ import { Asset } from '@24i/smartapps-datalayer/models';
6
+ import { ICheckbox, PickerMode } from '@24i/bigscreen-sdk/picker';
7
+
8
+ // MARK: Shared Props (alphabetical order)
9
+
10
+ type AdditionalRowsProp = {
11
+ /**
12
+ * The number of rows that are rendered at the bottom below navigatable rows
13
+ * These can get covered sometimes by ProgramInfo for example
14
+ */
15
+ additionalRows: number,
16
+ };
17
+
18
+ type ChannelDataProp = {
19
+ /**
20
+ * An array with channel data
21
+ */
22
+ channelData: Asset[],
23
+ };
24
+
25
+ type ChannelHeaderWidthPxProp = {
26
+ /**
27
+ * The width of the channel header column in pixels
28
+ */
29
+ channelHeaderWidthPx: number,
30
+ };
31
+
32
+ type ChannelLessOnFocusChangeProp<T extends Program> = {
33
+ /**
34
+ * Called every time focus moves to different cell (even after mouse focuses the cell)
35
+ */
36
+ onFocusChange: ChannelLessFocusChangeCallback<T>,
37
+ };
38
+
39
+ type ChannelLessOnItemPressProp<T extends Program> = {
40
+ /**
41
+ * Called after pressing any item with data (not loading ones)
42
+ */
43
+ onItemPress: ChannelLessItemPressCallback<T>,
44
+ };
45
+
46
+ type DataGetterProp = {
47
+ dataGetter: (range: DataRange) => Asset[],
48
+ };
49
+
50
+ type DataProp = {
51
+ /**
52
+ * A Data Manager
53
+ */
54
+ data: DataManager,
55
+ };
56
+
57
+ type DataManagersProp = {
58
+ /**
59
+ * An array of Data Managers
60
+ */
61
+ dataManagers: DataManager[],
62
+ };
63
+
64
+ type DatePickerProp = {
65
+ /**
66
+ * Props for the DatePicker component
67
+ * If omitted the Day component will be rendered instead
68
+ */
69
+ datePickerProps: OutsideDatePickerProps,
70
+ };
71
+
72
+ type FetchProgramsProp = {
73
+ /**
74
+ * Function called by EPG to fetch more data for a channel
75
+ */
76
+ fetchPrograms: ProgramsFetcher,
77
+ };
78
+
79
+ type InitialChannelIndexProp = {
80
+ /**
81
+ * The initial index in the channels list that should be scrolled to and focus after
82
+ * rendering the EPG
83
+ */
84
+ initialChannelIndex: number,
85
+ };
86
+
87
+ type InitialTimestampProp = {
88
+ /**
89
+ * The initial timestamp that should be used to render in the center of the EPG
90
+ */
91
+ initialTimestamp: number,
92
+ };
93
+
94
+ type IsLoadingProp = {
95
+ /**
96
+ * Flag to distinguish a cell that is intended to be used only for loading placeholder purposes
97
+ */
98
+ isLoading: boolean,
99
+ };
100
+
101
+ type ItemProp = {
102
+ /**
103
+ * Data for the program
104
+ */
105
+ item: Asset,
106
+ };
107
+
108
+ type LimitFromMsProp = {
109
+ /**
110
+ * The lowest timestamp in ms that can be navigated by EPG
111
+ * Render, as well as fetch, can go slightly more into history
112
+ */
113
+ limitFromMs: number,
114
+ };
115
+
116
+ type LimitToMsProp = {
117
+ /**
118
+ * The highest timestamp in ms that can be navigated by EPG
119
+ * Render, as well as fetch, can go slightly more into future
120
+ */
121
+ limitToMs: number,
122
+ };
123
+
124
+ type NavigatableRowsProp = {
125
+ /**
126
+ * The number of rows that can be navigated with focus up/down
127
+ */
128
+ navigatableRows: number,
129
+ };
130
+
131
+ type OnFocusChangeProp<T extends Program> = {
132
+ /**
133
+ * Called every time focus moves to different cell (even after mouse focuses the cell)
134
+ */
135
+ onFocusChange: FocusChangeCallback<T>,
136
+ };
137
+
138
+ type OnItemPressProp<T extends Program> = {
139
+ /**
140
+ * Called after pressing any item with data (not loading ones)
141
+ */
142
+ onItemPress: ItemPressCallback<T>,
143
+ };
144
+
145
+ type OnMouseEnterProp = {
146
+ /**
147
+ * onMouseEnter listener used only on the inside to synchronize keyboard and mouse navigation
148
+ */
149
+ onMouseEnter: (data: Asset | undefined) => void,
150
+ };
151
+
152
+ type OnScrolledToTimestampProp = {
153
+ /**
154
+ * Callback for scrolling left/right
155
+ * @param timestamp Current timestamp of the center of the EPG in milliseconds
156
+ */
157
+ onScrolledToTimestamp: (timestamp: number) => void,
158
+ };
159
+
160
+ type PixelInMsProp = {
161
+ /**
162
+ * The ratio between pixels and milliseconds used in the EPG
163
+ */
164
+ pixelInMs: number,
165
+ };
166
+
167
+ type PluginsProp<T extends Program> = {
168
+ /**
169
+ * Prop for extending the EPG functionality
170
+ */
171
+ plugins: (PluginComponent<T> | PluginFC)[],
172
+ };
173
+
174
+ type ProgramTextModeResolverProp = {
175
+ /**
176
+ * Prop for resolving the text mode of the component based on the cell width
177
+ * @param widthPx the width of the cell in pixels
178
+ * @returns ProgramTextMode to use
179
+ */
180
+ programTextModeResolver: (widthPx: number) => ProgramTextMode,
181
+ };
182
+
183
+ type RenderChannelHeaderProp<T extends Header> = {
184
+ /**
185
+ * Function to render custom channel header item
186
+ */
187
+ renderChannelHeader: ChannelHeaderRenderer<T>,
188
+ };
189
+
190
+ type RenderDayProp<X extends Day> = {
191
+ /**
192
+ * Function to render custom day displaying component
193
+ */
194
+ renderDay?: DayRenderer<X>,
195
+ };
196
+
197
+ type RenderNowLineHeaderProp = {
198
+ /**
199
+ * Function to render custom now line header (e.g. LIVE arrow pointer at the top of the line)
200
+ */
201
+ renderNowLineHeader: (timestamp: number, ref: Reference<NowLineHeader>) => JSX.Element,
202
+ };
203
+
204
+ type RenderProgramProp<T extends Program> = {
205
+ renderProgram: ProgramRenderer<T>,
206
+ };
207
+
208
+ type RenderTimeProp<T extends TimelineSection> = {
209
+ /**
210
+ * Custom function to render time inside the timeline section
211
+ */
212
+ renderTime: TimeRenderer<T>,
213
+ };
214
+
215
+ type IsFocusInRowsProp = {
216
+ /**
217
+ * Returns whether the focus is in Rows part of the epg.
218
+ * @returns true fif cosu is in rows part, false otherwise
219
+ */
220
+ isFocusInRows: () => boolean,
221
+ };
222
+
223
+ type RowHeightPxProp = {
224
+ /**
225
+ * The height of the EPG row in pixels
226
+ */
227
+ rowHeightPx: number,
228
+ };
229
+
230
+ type SectionWidthMsProp = {
231
+ /**
232
+ * The width of the section in upper timeline header
233
+ */
234
+ sectionWidthMs: number,
235
+ };
236
+
237
+ type ScrollStepMsProp = {
238
+ /**
239
+ * The number of milliseconds that should be scrolled when moving left and right
240
+ */
241
+ scrollStepMs: number,
242
+ };
243
+
244
+ type SmallestAllowedCellPxProp = {
245
+ /**
246
+ * If the width of the cell is smaller than this the cell will have a special
247
+ * class `too-small`. Value in pixels.
248
+ */
249
+ smallestAllowedCellPx: number,
250
+ };
251
+
252
+ type IdleTimerMsProp = {
253
+ /**
254
+ * The number of milliseconds of inactivity (no input) after which EPG starts jumps
255
+ * to the current time.
256
+ */
257
+ idleTimerMs: number,
258
+ };
259
+
260
+ type TimeProp = {
261
+ /**
262
+ * The time interface that provides current time and time change events
263
+ */
264
+ time: Time,
265
+ };
266
+
267
+ type TimeProviderProp = {
268
+ /**
269
+ * Function for providing current time
270
+ */
271
+ timeProvider: TimeProvider,
272
+ };
273
+
274
+ type TimelineSectionWidthMsProp = {
275
+ /**
276
+ * The width of the timeline section (time distance between markers)
277
+ */
278
+ timelineSectionWidthMs: number,
279
+ };
280
+
281
+ type TimelineWidthMsProp = {
282
+ /**
283
+ * The width of the visible epg section with data in milliseconds
284
+ */
285
+ timelineWidthMs: number,
286
+ };
287
+
288
+ type TimelineWidthPxProp = {
289
+ /**
290
+ * The width of the visible epg section with data in pixels
291
+ */
292
+ timelineWidthPx: number,
293
+ };
294
+
295
+ type TimestampProp = {
296
+ /**
297
+ * The current timestamp of the center of the EPG
298
+ */
299
+ timestamp: number,
300
+ };
301
+
302
+ type XOffsetPxProp = {
303
+ /**
304
+ * The initial x-axis offset in pixels to set during the render
305
+ */
306
+ xOffsetPx: number,
307
+ };
308
+
309
+ type WidthPxProp = {
310
+ /**
311
+ * The initial width in pixels to set during the render
312
+ */
313
+ widthPx: number,
314
+ };
315
+
316
+ // MARK: shared types and interfaces
317
+
318
+ /**
319
+ * This function should return rendered ChannelHeader.
320
+ * ChannelHeader usually consists of channel number and channel icon or name.
321
+ * @typeparam T Channel header component - defaults to Header component
322
+ * @param data Channel data
323
+ * @param ref Reference to the component
324
+ * @returns JSX.Element
325
+ */
326
+ export type ChannelHeaderRenderer<T extends Header> = (
327
+ (data: Asset, ref: Reference<T>) => JSX.Element
328
+ );
329
+
330
+ /**
331
+ * This function should fetch and asynchronously return more programs for given channel
332
+ * and timeframe.
333
+ * @param channel Channel data
334
+ * @param from Timestamp for the start of the timeframe
335
+ * @param to Timestamp for the end of the timeframe
336
+ * @returns Promise<Asset[]>
337
+ */
338
+ export type ProgramsFetcher<
339
+ > = (channel: Asset, from: number, to: number) => Promise<Asset[]>;
340
+
341
+ export type FetchCallback = () => void;
342
+
343
+ /**
344
+ * This function should return custom visual for Program.
345
+ * @typeparam T Program component - defaults to EpgProgram component
346
+ * @param isLoading Flag to mark whether it is just a loading placeholder
347
+ * @param data Program data or undefined for loading placeholder
348
+ * @param ref Reference to the component
349
+ * @param widthPx The initial width of the Program component to render with
350
+ * @param xOffsetPx The initial offset of the Program component to render with
351
+ * @param textMode The initial program text mode during the render
352
+ * @returns JSX.Element
353
+ */
354
+ export type ProgramRenderer<T extends Program> = (
355
+ isLoading: boolean,
356
+ data: Asset | undefined,
357
+ ref: Reference<T>,
358
+ widthPx: number,
359
+ xOffsetPx: number,
360
+ textMode: ProgramTextMode,
361
+ ) => JSX.Element;
362
+
363
+ /**
364
+ * This function should return custom visual of the time in Timeline.
365
+ * This component must implement TimelineSection interface.
366
+ * @param timestamp Timestamp of the time for formatting
367
+ * @param offset Initial offset to render with in pixels
368
+ * @param width width of the section to render in pixels
369
+ * @param ref Reference to TimelineSection component
370
+ * @returns JSX.Element
371
+ */
372
+ export type TimeRenderer<
373
+ T extends TimelineSection = TimelineSection,
374
+ > = (
375
+ timestamp: number, offset: number, width: number, ref: Reference<T>,
376
+ ) => JSX.Element;
377
+
378
+ /**
379
+ * This function will be called when an Item with Program Data is pressed.
380
+ * @typeparam T extension of a Program component
381
+ * @param data Current Program data
382
+ * @param channel The program's channel
383
+ * @param component Pressed Program component
384
+ */
385
+ export type ItemPressCallback<T extends Program> = (
386
+ (data: Asset, channel: Asset, component: T) => void
387
+ );
388
+
389
+ /**
390
+ * This function will be called when an Item with Program Data is pressed.
391
+ * @typeparam T extension of a Program component
392
+ * @param data Current EpgProgram data
393
+ * @param component Pressed Program component
394
+ */
395
+ export type ChannelLessItemPressCallback<T extends Program> = (
396
+ (data: Asset, component: T) => void
397
+ );
398
+
399
+ /**
400
+ * This function will be called when any item is focused
401
+ * @typeparam T extension of a Program component
402
+ * @param data Current EpgProgram data or undefined if the focus is on loading cell
403
+ * @param channel The program's channel
404
+ * @param component Program component of the focused Cell
405
+ */
406
+ export type FocusChangeCallback<T extends Program> = (
407
+ (data: Asset | undefined, channel: Asset, component: T) => void
408
+ );
409
+
410
+ /**
411
+ * This function will be called when any item is focused
412
+ * @typeparam T extension of a Program component
413
+ * @param data Current EpgProgram data or undefined if the focus is on loading cell
414
+ * @param component Program component of the focused Cell
415
+ */
416
+ export type ChannelLessFocusChangeCallback<T extends Program> = (
417
+ (data: Asset | undefined, component: T) => void
418
+ );
419
+
420
+ export type DayRenderer<
421
+ T extends Day = Day,
422
+ > = (timestamp: number, ref: Reference<T>) => JSX.Element;
423
+
424
+ /**
425
+ * Simple functions that returns current unix time in milliseconds
426
+ */
427
+ export type TimeProvider = () => number;
428
+
429
+ // MARK: DataManager
430
+
431
+ export type DataRange = [number, number];
432
+
433
+ export type DataUpdateCallback = () => void;
434
+
435
+ export interface DataManager {
436
+ getChannel: () => Asset,
437
+ getData: () => Asset[],
438
+ getDataFromRange: (range: DataRange) => Asset[],
439
+ getNextProgramStart: (timestamp: number) => number | null,
440
+ getPreviousProgramEnd: (timestamp: number, scrollStepMs: number) => number | null,
441
+ setOnDataUpdated: (callback: DataUpdateCallback) => void,
442
+ removeOnDataUpdated: () => void,
443
+ fetchAroundTimestampIfNeeded: (timestamp: number) => void,
444
+ }
445
+
446
+ // MARK: Time Events
447
+
448
+ export interface TimeEvents extends EventMapType {
449
+ 'onminute': (timestamp: number) => void,
450
+ 'onsecond': (timestamp: number) => void,
451
+ }
452
+
453
+ /**
454
+ * Interface for managing time updates inside EPG
455
+ */
456
+ export interface Time extends IEvents<TimeEvents> {
457
+ /**
458
+ * This function starts the timer that fires the events every time interval
459
+ */
460
+ initialize: () => void,
461
+ /**
462
+ * This function stops the timer
463
+ */
464
+ destroy: () => void,
465
+ /**
466
+ * Returns current timestamp in ms
467
+ */
468
+ getCurrentTime: () => number,
469
+ }
470
+
471
+ // MARK: EPG Program Component
472
+
473
+ export type ProgramTextMode = 'full' | 'ellipsis_only' | 'empty';
474
+
475
+ /**
476
+ * Props passed to custom rendered Program Component.
477
+ */
478
+ export type ProgramProps = {
479
+ /**
480
+ * Program data
481
+ */
482
+ data?: Asset,
483
+ /**
484
+ * Flag that it is a loading placeholder
485
+ */
486
+ isLoading?: boolean,
487
+ /**
488
+ * Initial width of the Component
489
+ */
490
+ widthPx: number,
491
+ /**
492
+ * Initial x offset of the Component
493
+ */
494
+ xOffsetPx: number,
495
+ /**
496
+ * The text mode for the initial Program render
497
+ */
498
+ textMode: ProgramTextMode,
499
+ };
500
+
501
+ /**
502
+ * Custom visual component for a program.
503
+ * This component should render a pure div and shouldn't handle any events
504
+ * like onPress or onMouseEnter. This is done by Cell component in EPG core.
505
+ * This component can be reused for multiple programs during its lifetime.
506
+ */
507
+ export interface Program
508
+ extends Component<any> {
509
+ /**
510
+ * Function to offset the Program component inside the cell.
511
+ * This is so the cells at the start of the viewport show text from the beginning
512
+ * even though the Cell itself goes more to the past.
513
+ * @param offset offset in x axis in px
514
+ */
515
+ setOffset?(offset: number): void,
516
+ /**
517
+ * Function to change width of the Program component inside the cell.
518
+ * This is so the cells at the start of the viewport show text from the beginning
519
+ * even though the Cell itself goes more to the past.
520
+ * @param width width in px
521
+ */
522
+ setWidth?(width: number): void,
523
+ /**
524
+ * Function to change data and the visuals.
525
+ * (E.g. Use setText to change the name)
526
+ * @param data New Program data
527
+ * @param textMode the text mode to use to display the program
528
+ * @param widthPx the full width of the cell in pixels that can be used to alter styling
529
+ * @param xOffsetPx the offset of the cell in pixels that can be used to alter styling
530
+ */
531
+ updateData(data: Asset, textMode: ProgramTextMode, widthPx: number, xOffsetPx: number): void,
532
+ }
533
+
534
+ export interface ProgramComponent {
535
+ new (props: any): Program,
536
+ }
537
+
538
+ // MARK: EPG Header Component
539
+
540
+ /**
541
+ * Props for the Channel Header Component
542
+ */
543
+ export type HeaderProps = {
544
+ /**
545
+ * Channel Data
546
+ */
547
+ data: Asset,
548
+ };
549
+
550
+ /**
551
+ * Channel Header component.
552
+ * This component represents the channel header aka channel number and name/icon.
553
+ * It can be reused by multiple headers.
554
+ */
555
+ export interface Header
556
+ extends Component<any> {
557
+ /**
558
+ * Function to show the header element
559
+ */
560
+ show(): void,
561
+ /**
562
+ * Function to hide the header element
563
+ */
564
+ hide(): void,
565
+ /**
566
+ * Function to update the visuals
567
+ */
568
+ updateData(data: Asset): void,
569
+ }
570
+
571
+ export interface HeaderComponent {
572
+ new (props: any): Header,
573
+ }
574
+
575
+ // MARK: EPG NowLineHeader Component
576
+
577
+ export interface NowLineHeader extends Component<any> {
578
+ /**
579
+ * Function to display the displayed time in the timeline header
580
+ * @param timestamp current time in ms
581
+ */
582
+ updateData: (timestamp: number) => void,
583
+ }
584
+
585
+ export interface NowLineHeaderComponent {
586
+ new (props: any): NowLineHeader,
587
+ }
588
+
589
+ // MARK: EPG Day Component
590
+
591
+ /**
592
+ * Props for the Day Component
593
+ */
594
+ export type DayProps = (
595
+ TimestampProp
596
+ );
597
+
598
+ export interface Day extends Component<any> {
599
+ /**
600
+ * Function to update the displayed date when the visible day changes in EPG
601
+ * @param timestamp New timestamp for the date
602
+ */
603
+ updateData: (timestamp: number) => void,
604
+ }
605
+
606
+ export interface DayComponent {
607
+ new (props: DayProps): Day,
608
+ }
609
+
610
+ // MARK: EPG DatePicker Component
611
+
612
+ /**
613
+ * Props for the EPG DatePicker Component
614
+ */
615
+ export type DatePickerProps = {
616
+ /**
617
+ * Number of days into the past to show (today excluded)
618
+ */
619
+ daysInPast: number,
620
+ /**
621
+ * Number of days to future to show (today excluded)
622
+ */
623
+ daysToFuture: number,
624
+ /**
625
+ * Number of milliseconds since the day start to scroll to
626
+ * @example (8 * 60 + 30) * 1000 will scroll directly to 8:30 on date picker day selected
627
+ */
628
+ dayStartOffsetMs?: number,
629
+ /**
630
+ * Current selected value
631
+ */
632
+ timestamp: number,
633
+ /**
634
+ * Number of visible items
635
+ */
636
+ visibleItems: number,
637
+ /**
638
+ * Number of pixels to scroll
639
+ */
640
+ scrollStep: number,
641
+ /**
642
+ * Reference to the modal service
643
+ */
644
+ modalService: Reference<ModalService>,
645
+ /**
646
+ * Function to call when the picker value changes
647
+ * @param timestamp currently selected value as timestamp in ms
648
+ */
649
+ onValueChange: (timestamp: number) => void,
650
+ /**
651
+ * Function to format the date string in DatePicker
652
+ * @param date Date object of the value to format
653
+ * @returns string to display
654
+ */
655
+ format?: (date: Date) => string,
656
+ /**
657
+ * Custom overrides for the DatePicker
658
+ */
659
+ overrides?: Record<number, string>,
660
+ /**
661
+ * Optional setting for Picker Mode (defaults to MODAL)
662
+ */
663
+ mode?: PickerMode,
664
+ /**
665
+ * Optional className to pass to DatePicker
666
+ */
667
+ className?: string,
668
+ /**
669
+ * Optional className to pass to PickerModal dialog
670
+ */
671
+ modalClassName?: string,
672
+ /**
673
+ * Optional override for checkbox
674
+ */
675
+ Checkbox?: ICheckbox<any>,
676
+ /**
677
+ * Optional override for checkmark
678
+ */
679
+ checkmark?: Children,
680
+ /**
681
+ * Custom render method for picker button
682
+ */
683
+ render?: (
684
+ buttonRef: Reference<HTMLElement>,
685
+ textRef: Reference<HTMLElement>,
686
+ openCallback: () => void,
687
+ text?: string,
688
+ ) => JSX.Element,
689
+ };
690
+
691
+ export type OutsideDatePickerProps = Omit<
692
+ DatePickerProps, 'timestamp' | 'onValueChange'
693
+ >;
694
+
695
+ export type DatePickerDateProps = 'daysInPast' | 'daysToFuture' | 'dayStartOffsetMs' | 'timestamp';
696
+
697
+ /**
698
+ * EPG DatePicker Component
699
+ */
700
+ export interface DatePicker extends Component<DatePickerProps>, IFocusable {
701
+ /**
702
+ * Function to update current DatePicker value when the day changes
703
+ */
704
+ updateData: (timestamp: number) => void,
705
+ }
706
+
707
+ export interface DatePickerComponent {
708
+ new (props: DatePickerProps): DatePicker,
709
+ }
710
+
711
+ // MARK: EPG NowLine Component
712
+
713
+ /**
714
+ * Props for NowLine Component (Vertical line marking current time across the rows).
715
+ */
716
+ export type NowLineProps = (
717
+ & TimelineWidthPxProp
718
+ & TimestampProp
719
+ & TimeProp
720
+ & PixelInMsProp
721
+ & ChannelHeaderWidthPxProp
722
+ & Partial<RenderNowLineHeaderProp>
723
+ );
724
+
725
+ /**
726
+ * NowLine component renders vertical line marking current time.
727
+ */
728
+ export interface NowLine extends Component<NowLineProps> {
729
+ /**
730
+ * Function to update NowLine position when EPG scrolls left/right
731
+ * @param timestamp Current timestamp of the EPG
732
+ */
733
+ scrollToTimestamp: (timestamp: number) => void,
734
+ }
735
+
736
+ export interface NowLineComponent {
737
+ new (props: NowLineProps): NowLine,
738
+ }
739
+
740
+ // MARK: EPG Timeline Component
741
+
742
+ /**
743
+ * Props for the Timeline Component
744
+ * @typeparam T TimelineSection component
745
+ */
746
+ export type TimelineProps<
747
+ T extends TimelineSection,
748
+ > = (
749
+ & PixelInMsProp
750
+ & TimelineWidthPxProp
751
+ & ChannelHeaderWidthPxProp
752
+ & TimestampProp
753
+ & RenderTimeProp<T>
754
+ & SectionWidthMsProp
755
+ );
756
+
757
+ /**
758
+ * Timeline Component
759
+ * This component renders the timeline at the top of the EPG
760
+ * @typeparam T TimelineSection component
761
+ */
762
+ export interface Timeline<
763
+ T extends TimelineSection,
764
+ > extends Component<TimelineProps<T>> {
765
+ /**
766
+ * Function to set the current timestamp and scroll to it.
767
+ */
768
+ scrollToTimestamp: (timestamp: number) => void,
769
+ }
770
+
771
+ export interface TimelineComponent<
772
+ T extends TimelineSection,
773
+ > {
774
+ new (props: TimelineProps<T>): Timeline<T>,
775
+ }
776
+
777
+ // MARK: TimelineSection Component
778
+
779
+ /**
780
+ * Props for the TimelineSection Component
781
+ */
782
+ export type TimelineSectionProps = (
783
+ & TimestampProp
784
+ & XOffsetPxProp
785
+ & WidthPxProp
786
+ );
787
+
788
+ /**
789
+ * TimelineSection Component
790
+ * This component displays the time on the Timeline
791
+ * It can be reused to display multiple times.
792
+ */
793
+ export interface TimelineSection extends Component<any> {
794
+ /**
795
+ * Function to set offset in x direction.
796
+ * @param x x direction offset in pixels
797
+ */
798
+ setOffset: (x: number) => void,
799
+ /**
800
+ * Function to update displayed time
801
+ * @param timestamp New timestamp to format and render
802
+ */
803
+ updateData: (timestamp: number) => void,
804
+ }
805
+
806
+ export interface TimelineSectionComponent {
807
+ new (props: TimelineSectionProps): TimelineSection,
808
+ }
809
+
810
+ // MARK: EPG RowsManager Component
811
+
812
+ export type RowsManagerProps<
813
+ T extends Header,
814
+ U extends Program,
815
+ > = (
816
+ & DataManagersProp
817
+ & InitialChannelIndexProp
818
+ & NavigatableRowsProp
819
+ & AdditionalRowsProp
820
+ & PixelInMsProp
821
+ & TimelineWidthPxProp
822
+ & TimelineWidthMsProp
823
+ & TimestampProp
824
+ & TimeProp
825
+ & ScrollStepMsProp
826
+ & RowHeightPxProp
827
+ & ProgramTextModeResolverProp
828
+ & OnItemPressProp<U>
829
+ & OnMouseEnterProp
830
+ & OnFocusChangeProp<U>
831
+ & RenderChannelHeaderProp<T>
832
+ & RenderProgramProp<U>
833
+ & IsFocusInRowsProp
834
+ & SmallestAllowedCellPxProp
835
+ );
836
+
837
+ /**
838
+ * RowsManager Component
839
+ * It does heavy lifting for maintaining and managing rows
840
+ * so it could be better split from the main EPG Component
841
+ */
842
+ export interface RowsManager<
843
+ T extends Header,
844
+ U extends Program,
845
+ > extends Component<RowsManagerProps<T, U>> {
846
+ /**
847
+ * Function called on pressing UP. Used to navigate up in the channels list.
848
+ */
849
+ onUp: () => boolean,
850
+ /**
851
+ * Function called on pressing DOWN. Used to navigate down in the channels list.
852
+ */
853
+ onDown: () => boolean,
854
+ /**
855
+ * Function called on pressing CHANNEL_UP. Used to navigate page up in the channels list.
856
+ */
857
+ onChannelUp: () => boolean,
858
+ /**
859
+ * Function called on pressing CHANNEL_DOWN. Used to navigate page down in the channels list.
860
+ */
861
+ onChannelDown: () => boolean,
862
+ /**
863
+ * Function to call when fast scrolling starts
864
+ * - to optimize cell rendering during the fast scroll
865
+ */
866
+ onFastScrollingStart: () => void,
867
+ /**
868
+ * Function to call when fast vertical scrolling ends
869
+ * - to render cell data after being optimized for fast scroll
870
+ * - to call fetch in data managers connected to rows
871
+ */
872
+ onFastScrollingEnd: () => void,
873
+ /**
874
+ * Function to find the start of the next program on the active row.
875
+ * @param timestamp timestamp to search from
876
+ * @returns timestamp of the start of the next program or end loading cell
877
+ */
878
+ getNextProgramStart: (timestamp: number) => number | null,
879
+ /**
880
+ * Function to find the end of the previous program on the active row.
881
+ * @param timestamp timestamp to search from
882
+ * @param customScrollStepMs optional custom offset from previous program end
883
+ * @returns timestamp of the end of the previous program or start loading cell
884
+ */
885
+ getPreviousProgramEnd: (timestamp: number, customScrollStepMs?: number) => number | null,
886
+ /**
887
+ * Sets the channel index to scroll to.
888
+ */
889
+ setCurrentChannelIndex: (index: number) => void,
890
+ /**
891
+ * Sets the focus timestamp
892
+ */
893
+ setFocusTimestamp: (timestamp: number) => void,
894
+ /**
895
+ * Function that returns whether there are rows higher that could be navigated.
896
+ */
897
+ canGoUp: () => boolean,
898
+ /**
899
+ * Function that returns whether there are rows lower that could be navigated.
900
+ */
901
+ canGoDown: () => boolean,
902
+ /**
903
+ * Focuses the active row at a given timestamp.
904
+ */
905
+ focus: (timestamp: number, options?: FocusOptions) => void,
906
+ /**
907
+ * Scrolls the rows to the given timestamp.
908
+ */
909
+ scrollRowsToTimestamp: (timestamp: number) => void,
910
+ /**
911
+ * Function to scroll up
912
+ * @returns true if it was scrolled, false otherwise
913
+ */
914
+ scrollUp: () => boolean,
915
+ /**
916
+ * Function to scroll down
917
+ * @returns true if it was scrolled, false otherwise
918
+ */
919
+ scrollDown: () => boolean,
920
+ }
921
+
922
+ export interface RowsManagerComponent<
923
+ T extends Header,
924
+ U extends Program,
925
+ > {
926
+ new (props: RowsManagerProps<T, U>): RowsManager<T, U>,
927
+ }
928
+
929
+ // MARK: EPG Row Component
930
+
931
+ /**
932
+ * Props for EPG Row component
933
+ * @typeparam T Program component - defaults to EpgProgram
934
+ */
935
+ export type RowProps<
936
+ T extends Program,
937
+ > = (
938
+ & DataProp
939
+ & PixelInMsProp
940
+ & TimelineWidthPxProp
941
+ & TimelineWidthMsProp
942
+ & TimestampProp
943
+ & TimeProp
944
+ & ScrollStepMsProp
945
+ & SmallestAllowedCellPxProp
946
+ & ProgramTextModeResolverProp
947
+ & OnItemPressProp<T>
948
+ & OnMouseEnterProp
949
+ & OnFocusChangeProp<T>
950
+ & RenderProgramProp<T>
951
+ );
952
+
953
+ /**
954
+ * EPG Row component
955
+ * It can be reused by multiple rows
956
+ * @typeparam T Program component - defaults to EpgProgram
957
+ */
958
+ export interface Row<
959
+ T extends Program,
960
+ > extends Component<RowProps<T>> {
961
+ /**
962
+ * Timestamp for the center of the row
963
+ */
964
+ timestamp: number;
965
+ /**
966
+ * Function to call when fast scrolling starts
967
+ * - to optimize cell rendering during the fast scroll
968
+ */
969
+ onFastScrollingStart: () => void,
970
+ /**
971
+ * Function to call when fast vertical scrolling ends
972
+ * - to render cell data after being optimized for fast scroll
973
+ * - to call fetch in data managers connected to rows
974
+ */
975
+ onFastScrollingEnd: () => void,
976
+ /**
977
+ * Function to find the start of the next program on the active row.
978
+ * @param timestamp timestamp to search from
979
+ * @returns timestamp of the start of the next program or end loading cell
980
+ */
981
+ getNextProgramStart: (timestamp: number) => number | null,
982
+ /**
983
+ * Function to find the end of the previous program on the active row.
984
+ * @param timestamp timestamp to search from
985
+ * @param customScrollStepMs optional custom offset from previous program end
986
+ * @returns timestamp of the end of the previous program or end loading cell
987
+ */
988
+ getPreviousProgramEnd: (timestamp: number, customScrollStepMs?: number) => number | null,
989
+ /**
990
+ * Function to set the row as active (the one with focus)
991
+ */
992
+ setActive: () => void,
993
+ /**
994
+ * Function to set the row as inactive (the one without focus)
995
+ */
996
+ setInactive: () => void,
997
+ /**
998
+ * Function to offset the row for vertucal scrolling
999
+ * @param yOffsetPx number of pixels to set as y axis offset
1000
+ */
1001
+ setOffset: (yOffsetPx: number) => void,
1002
+ /**
1003
+ * Function to return true if row already has this data manager
1004
+ * @param dataManager DataManager that gets compared to the current dataManager
1005
+ * @returns true if they are the same reference, false otherwise
1006
+ */
1007
+ hasDataManager: (dataManager: DataManager) => boolean,
1008
+ /**
1009
+ * Function to focus the EPG Row
1010
+ * @param timestamp timestamp where the focus should happen
1011
+ * @param options FocusOptions to pass down
1012
+ */
1013
+ focus: (timestamp: number, options?: FocusOptions) => void,
1014
+ /**
1015
+ * Function to set the current timestamp and scroll to it.
1016
+ * @param timestamp timestamp to scroll to
1017
+ */
1018
+ scrollToTimestamp: (timestamp: number) => void,
1019
+ /**
1020
+ * Function to show the row
1021
+ */
1022
+ show: () => void,
1023
+ /**
1024
+ * Function to hide the row
1025
+ */
1026
+ hide: () => void,
1027
+ /**
1028
+ * Updates the row with new channel and data for cells
1029
+ * @param data new data to update the row with
1030
+ */
1031
+ updateData: (data: DataManager) => void,
1032
+ }
1033
+
1034
+ export interface RowComponent<
1035
+ T extends Program,
1036
+ > {
1037
+ new (props: RowProps<T>): Row<T>,
1038
+ }
1039
+
1040
+ // MARK: EPG CellsManager Component
1041
+
1042
+ /**
1043
+ * Props for CellsManager Component
1044
+ */
1045
+ export type CellsManagerProps<
1046
+ T extends Program,
1047
+ > = (
1048
+ & DataGetterProp
1049
+ & TimelineWidthMsProp
1050
+ & TimelineWidthPxProp
1051
+ & TimestampProp
1052
+ & TimeProp
1053
+ & PixelInMsProp
1054
+ & ChannelLessOnItemPressProp<T>
1055
+ & ChannelLessOnFocusChangeProp<T>
1056
+ & ProgramTextModeResolverProp
1057
+ & OnMouseEnterProp
1058
+ & RenderProgramProp<T>
1059
+ & SmallestAllowedCellPxProp
1060
+ );
1061
+
1062
+ /**
1063
+ * CellsManager Component is a part of Row that is responsible for rendering and handling the cells.
1064
+ * @typeparam T EpgProgram component rendered by cells
1065
+ */
1066
+ export interface CellsManager<
1067
+ T extends Program,
1068
+ > extends Component<CellsManagerProps<T>> {
1069
+ /**
1070
+ * Current timestamp of the manager
1071
+ */
1072
+ timestamp: number,
1073
+ /**
1074
+ * Function to call when fast scrolling starts
1075
+ * - to optimize cell rendering during the fast scroll
1076
+ */
1077
+ onFastScrollingStart: () => void,
1078
+ /**
1079
+ * Function to call when fast vertical scrolling ends
1080
+ * - to render cell data after being optimized for fast scroll
1081
+ */
1082
+ onFastScrollingEnd: () => void,
1083
+ /**
1084
+ * Function to make the row active (the one with focus)
1085
+ */
1086
+ setActive: () => void,
1087
+ /**
1088
+ * Function to make the row inactive (the one without focus)
1089
+ */
1090
+ setInactive: () => void,
1091
+ /**
1092
+ * Function to offset wrapping div in y axis
1093
+ * @param yOffsetPx number of pixels to set as offset
1094
+ */
1095
+ setOffset: (yOffsetPx: number) => void,
1096
+ /**
1097
+ * Function to focus the cell at given timestamp with given options
1098
+ */
1099
+ focus: (timestamp: number, options?: FocusOptions) => void,
1100
+ /**
1101
+ * Function to scroll to the given timestamp
1102
+ */
1103
+ scrollToTimestamp: (timestamp: number) => void,
1104
+ /**
1105
+ * Function to show the whole row
1106
+ */
1107
+ show: () => void,
1108
+ /**
1109
+ * Function to hide the whole row
1110
+ */
1111
+ hide: () => void,
1112
+ /**
1113
+ * Function to return whether the cells are visible or hidden
1114
+ */
1115
+ isVisible: () => boolean,
1116
+ /**
1117
+ * Function to initialize cells update (e.g. after new data fetch)
1118
+ */
1119
+ updateCellsData: () => void,
1120
+ }
1121
+
1122
+ export interface CellsManagerComponent<
1123
+ T extends Program,
1124
+ > {
1125
+ new (props: CellsManagerProps<T>): CellsManager<T>,
1126
+ }
1127
+
1128
+ // MARK: EPG Cell Component
1129
+
1130
+ /**
1131
+ * Props for any EPG Cell component
1132
+ * @typeparam T Program component - defaults to EpgProgram
1133
+ */
1134
+ export type CellProps<
1135
+ T extends Program,
1136
+ > = (
1137
+ & WidthPxProp
1138
+ & XOffsetPxProp
1139
+ & TimeProp
1140
+ & Partial<ItemProp>
1141
+ & Partial<IsLoadingProp>
1142
+ & ChannelLessOnItemPressProp<T>
1143
+ & ChannelLessOnFocusChangeProp<T>
1144
+ & ProgramTextModeResolverProp
1145
+ & OnMouseEnterProp
1146
+ & RenderProgramProp<T>
1147
+ & SmallestAllowedCellPxProp
1148
+ );
1149
+
1150
+ /**
1151
+ * EPG Cell component
1152
+ * @typeparam T Program component - defaults to EpgProgram
1153
+ */
1154
+ export interface Cell<
1155
+ T extends Program,
1156
+ > extends Component<CellProps<T>>, IFocusable {
1157
+ /**
1158
+ * DOM wrapper element
1159
+ */
1160
+ div: Reference<HTMLDivElement>,
1161
+ /**
1162
+ * Current Program data
1163
+ */
1164
+ item?: Asset,
1165
+ /**
1166
+ * Reference to custom visuals component
1167
+ */
1168
+ programComponent: Reference<T>,
1169
+ /**
1170
+ * Function to get width of the cell in pixels
1171
+ * @returns width of the cell in pixels
1172
+ */
1173
+ getWidth: () => number,
1174
+ /**
1175
+ * Function to get x offset position of the cell in pixels
1176
+ * @returns x direction offset in pixels
1177
+ */
1178
+ getOffset: () => number,
1179
+ /**
1180
+ * Function to set width of the cell in pixels
1181
+ * @param width width of the cell to set
1182
+ */
1183
+ setWidth: (width: number) => void,
1184
+ /**
1185
+ * Function to offset x position of the cell in pixels
1186
+ * @param x x direction offset in pixels
1187
+ */
1188
+ setOffset: (x: number) => void,
1189
+ /**
1190
+ * Function to show the cell
1191
+ */
1192
+ show: () => void,
1193
+ /**
1194
+ * Function to hide the cell
1195
+ */
1196
+ hide: () => void,
1197
+ /**
1198
+ * Function to return whether the cell is visible (does not have .display-none class)
1199
+ */
1200
+ isVisible: () => boolean,
1201
+ /**
1202
+ * Function to return whether the element belongs to the cell's Interactable component.
1203
+ * @param element HTMLElement to compare with Interactable
1204
+ * @returns true if element matches Interactable, false otherwise
1205
+ */
1206
+ hasDom: (element: HTMLElement) => boolean,
1207
+ /**
1208
+ * Function to update data and visuals
1209
+ * @param data New Program data
1210
+ */
1211
+ updateData: (data: Asset) => void,
1212
+ }
1213
+
1214
+ export interface CellComponent<
1215
+ T extends Program,
1216
+ > {
1217
+ new (props: CellProps<T>): Cell<T>,
1218
+ }
1219
+
1220
+ // MARK: EPG Mouse Navigation
1221
+
1222
+ export type EpgMouseNavigationProps = {
1223
+ /**
1224
+ * Function to call on the press of up arrow
1225
+ */
1226
+ onUp: () => void,
1227
+ /**
1228
+ * Function to call on the press of down arrow
1229
+ */
1230
+ onDown: () => void,
1231
+ /**
1232
+ * Function to call on the press of left arrow
1233
+ */
1234
+ onLeft: () => void,
1235
+ /**
1236
+ * Function to call on the press of right arrow
1237
+ */
1238
+ onRight: () => void,
1239
+ };
1240
+
1241
+ export interface EpgMouseNavigation extends Component<EpgMouseNavigationProps> {
1242
+ /**
1243
+ * Function to enable showing an arrow in given direction
1244
+ */
1245
+ enableDirection: (direction: MouseArrowDirection) => void,
1246
+ /**
1247
+ * Function to disable showing an arrow in given direction
1248
+ */
1249
+ disableDirection: (direction: MouseArrowDirection) => void,
1250
+ }
1251
+
1252
+ export interface EpgMouseNavigationComponent {
1253
+ new (props: EpgMouseNavigationProps): EpgMouseNavigation,
1254
+ }
1255
+
1256
+ export type MouseArrowDirection = 'up' | 'down' | 'left' | 'right';
1257
+
1258
+ // MARK: EPG Component
1259
+
1260
+ /**
1261
+ * Props for the main EPG component
1262
+ * @typeparam T Channel header component - defaults to Header
1263
+ * @typeparam U Program component - defaults to Program
1264
+ * @typeparam V Day component - default to Day
1265
+ * @typeparam W Timeline section component - default to TimelineSection
1266
+ */
1267
+ export type Props<
1268
+ T extends Header,
1269
+ U extends Program,
1270
+ V extends Day,
1271
+ W extends TimelineSection,
1272
+ > = (
1273
+ & TimelineWidthPxProp
1274
+ & RowHeightPxProp
1275
+ & NavigatableRowsProp
1276
+ & AdditionalRowsProp
1277
+ & ChannelHeaderWidthPxProp
1278
+ & ChannelDataProp
1279
+ & FetchProgramsProp
1280
+ & Partial<TimelineWidthMsProp>
1281
+ & Partial<ScrollStepMsProp>
1282
+ & Partial<IdleTimerMsProp>
1283
+ & Partial<TimelineSectionWidthMsProp>
1284
+ & Partial<LimitFromMsProp>
1285
+ & Partial<LimitToMsProp>
1286
+ & Partial<TimeProviderProp>
1287
+ & Partial<InitialTimestampProp>
1288
+ & Partial<InitialChannelIndexProp>
1289
+ & Partial<ProgramTextModeResolverProp>
1290
+ & Partial<SmallestAllowedCellPxProp>
1291
+ & OnItemPressProp<U>
1292
+ & Partial<OnFocusChangeProp<U>>
1293
+ & Partial<OnScrolledToTimestampProp>
1294
+ & Partial<RenderNowLineHeaderProp>
1295
+ & Partial<RenderChannelHeaderProp<T>>
1296
+ & Partial<RenderProgramProp<U>>
1297
+ & Partial<RenderDayProp<V>>
1298
+ & Partial<RenderTimeProp<W>>
1299
+ & Partial<DatePickerProp>
1300
+ & Partial<PluginsProp<U>>
1301
+ );
1302
+
1303
+ /**
1304
+ * Main EPG component
1305
+ * @typeparam T Channel header component - defaults to Header
1306
+ * @typeparam U Program component - defaults to Program
1307
+ * @typeparam V Day component - default to Day
1308
+ * @typeparam W Timeline section component - default to TimelineSection
1309
+ */
1310
+ export interface Epg<
1311
+ T extends Header,
1312
+ U extends Program,
1313
+ V extends Day,
1314
+ W extends TimelineSection,
1315
+ > extends Component<Props<T, U, V, W>>, IFocusable {
1316
+ /**
1317
+ * Function to return whether EPG is fast scrolling
1318
+ * @returns true if is fast scrolling in any axis, false otherwise
1319
+ */
1320
+ isFastScrolling: () => boolean,
1321
+ /**
1322
+ * Function to return whether EPG is fast scrolling horizontally
1323
+ * @returns true if is fast scrolling horizontally, false otherwise
1324
+ */
1325
+ isHorizontallyFastScrolling: () => boolean,
1326
+ /**
1327
+ * Function to return whether EPG is fast scrolling
1328
+ * @returns true if is fast scrolling vertically, false otherwise
1329
+ */
1330
+ isVerticallyFastScrolling: () => boolean,
1331
+ /**
1332
+ * Scrolls to given timestamp if possible
1333
+ * @param timestamp Timestamp to scroll to
1334
+ * @throws when the timestamp is outside of limitFromMs and limitToMs range
1335
+ */
1336
+ scrollToTimestamp: (timestamp: number) => void,
1337
+ /**
1338
+ * Scrolls to given channel index if possible
1339
+ * @param index Index of the channel to scroll to
1340
+ * @throws when the index is outside of 0 and channels.length - 1 range
1341
+ */
1342
+ scrollToChannelIndex: (index: number) => void,
1343
+ }
1344
+
1345
+ /**
1346
+ * Internal interface of the Main EPG Component for internal components
1347
+ * but should not be used from the outside.
1348
+ * @typeparam T Channel header component - defaults to Header
1349
+ * @typeparam U Program component - defaults to Program
1350
+ * @typeparam V Day component - default to Day
1351
+ * @typeparam W Timeline section component - default to TimelineSection
1352
+ */
1353
+ export interface InternalEpg<
1354
+ T extends Header,
1355
+ U extends Program,
1356
+ V extends Day,
1357
+ W extends TimelineSection,
1358
+ > extends Epg<T, U, V, W> {
1359
+ /**
1360
+ * Current focused part of EPG
1361
+ */
1362
+ focused: EpgFocus,
1363
+ /**
1364
+ * Reference to the RowsManager
1365
+ */
1366
+ rows: Reference<RowsManager<T, U>>,
1367
+ /**
1368
+ * Current timestamp of the EPG
1369
+ */
1370
+ timestamp: number,
1371
+ /**
1372
+ * Current timestamp of the EPG focus
1373
+ */
1374
+ focusTimestamp: number,
1375
+ /**
1376
+ * TimeManager instance
1377
+ */
1378
+ time: Time,
1379
+ /**
1380
+ * Function to set the current EPG timestamp
1381
+ * @param timestamp timestamp to set
1382
+ */
1383
+ setCurrentTime: (timestamp: number) => void,
1384
+ /**
1385
+ * Function to set current focus time
1386
+ * @param timestamp the timestamp to set as focus time
1387
+ */
1388
+ setFocusTimestamp: (timestamp: number) => void,
1389
+ /**
1390
+ * Function to set focus to DatePicker
1391
+ */
1392
+ setFocusToDatePicker: () => void,
1393
+ /**
1394
+ * Function to set focus to Epg rows
1395
+ */
1396
+ setFocusToEpg: () => void,
1397
+ /**
1398
+ * Function to set state of the up/down mouse arrows
1399
+ */
1400
+ setVerticalMouseArrows: () => void,
1401
+ /**
1402
+ * Function to set state of the left/right mouse arrows
1403
+ */
1404
+ setHorizontalMouseArrows: () => void,
1405
+ /**
1406
+ * Function to let EPG and its components know that the EPG
1407
+ * switched to fast vertical scrolling (up/down between channels)
1408
+ */
1409
+ startFastVerticalScrolling: () => void,
1410
+ /**
1411
+ * Function to let EPG and its components know that the EPG
1412
+ * switched to fast horizontal scrolling (left/right in time)
1413
+ */
1414
+ startFastHorizontalScrolling: () => void,
1415
+ /**
1416
+ * Function to let EPG and its components know that the EPG
1417
+ * switched to normal vertical scrolling (up/down between channels)
1418
+ */
1419
+ stopFastVerticalScrolling: () => void,
1420
+ /**
1421
+ * Function to let EPG and its components know that the EPG
1422
+ * switched to normal horizontal scrolling (left/right in time)
1423
+ */
1424
+ stopFastHorizontalScrolling: () => void,
1425
+ /**
1426
+ * Function that returns true if DatePicker is rendered
1427
+ * @returns true if DatePicker is rendered, false otherwise
1428
+ */
1429
+ isDatePickerRendered: () => boolean,
1430
+ }
1431
+
1432
+ export interface EpgComponent<
1433
+ T extends Header,
1434
+ U extends Program,
1435
+ V extends Day,
1436
+ W extends TimelineSection,
1437
+ > {
1438
+ new (props: Props<T, U, V, W>): Epg<T, U, V, W>,
1439
+ }
1440
+
1441
+ /**
1442
+ * Enumerator for current focus positions for EPG or DatePicker
1443
+ */
1444
+ export type EpgFocus = 'datepicker' | 'epg';
1445
+
1446
+ // MARK: EPG Plugin
1447
+
1448
+ export type PluginProps<
1449
+ T extends Program = Program,
1450
+ > = {
1451
+ /**
1452
+ * Reference to the EPG component so it could be controlled from the plugin
1453
+ */
1454
+ epg?: Epg<any, T, any, any>
1455
+ };
1456
+
1457
+ /**
1458
+ * EPG stores references to all plugins and on certain events it calls these
1459
+ * methods if they are implemented by the plugin
1460
+ */
1461
+ export interface Plugin<
1462
+ T extends Program = Program,
1463
+ > extends Component<any> {
1464
+ /**
1465
+ * Called each time a focus changes. Due to implementation this can result
1466
+ * in focus to different element with same data as before as same element
1467
+ * but different data. And also same element and same data
1468
+ */
1469
+ onFocusChange?: FocusChangeCallback<T>,
1470
+ /**
1471
+ * Called each time EPG scrolls left/right in time
1472
+ * @param timestamp current time of EPG in ms
1473
+ */
1474
+ onScrolledToTimestamp?: (timestamp: number) => void,
1475
+ /**
1476
+ * Called each time the Item is pressed. This is called before the outside
1477
+ * callback from props. However, it cannot stop the event. Intended more for
1478
+ * logging purposes than actual overrides.
1479
+ */
1480
+ onItemPress?: ItemPressCallback<T>,
1481
+ /**
1482
+ * Called each time EPG switches to fast scrolling in either direction.
1483
+ * Called after onFast[Vertical/Horizontal]ScrollingStart.
1484
+ * If both are implemented, then both (directional and general) methods are called.
1485
+ */
1486
+ onFastScrollingStart?: () => void,
1487
+ /**
1488
+ * Called each time EPG switches to fast scrolling in vertical (channels) direction.
1489
+ */
1490
+ onFastVerticalScrollingStart?: () => void,
1491
+ /**
1492
+ * Called each time EPG switches to fast scrolling in horizontal (time) direction.
1493
+ */
1494
+ onFastHorizontalScrollingStart?: () => void,
1495
+ /**
1496
+ * Called each time EPG switches back to normal scrolling in either direction.
1497
+ * Called after onFast[Vertical/Horizontal]ScrollingEnd.
1498
+ * If both are implemented, then both (directional and general) methods are called.
1499
+ */
1500
+ onFastScrollingEnd?: () => void,
1501
+ /**
1502
+ * Called each time EPG switches back to normal scrolling in vertical (channels) direction.
1503
+ */
1504
+ onFastVerticalScrollingEnd?: () => void,
1505
+ /**
1506
+ * Called each time EPG switches back to normal scrolling in horizontal (time) direction.
1507
+ */
1508
+ onFastHorizontalScrollingEnd?: () => void,
1509
+ }
1510
+
1511
+ export interface PluginComponent<
1512
+ T extends Program,
1513
+ > {
1514
+ new (props: any): Plugin<T>,
1515
+ }
1516
+
1517
+ export interface PluginFC {
1518
+ (props: any): JSX.Element,
1519
+ }