@24i/bigscreen-sdk 1.0.40-alpha.2687 → 1.0.41-alpha.2695

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 (1095) hide show
  1. package/.vscode/settings.json +6 -0
  2. package/README.md +47 -47
  3. package/__mocks__/@24i/bigscreen-sdk/animations.ts +2 -2
  4. package/package.json +1 -1
  5. package/packages/adobe-heartbeat/README.md +46 -46
  6. package/packages/adobe-heartbeat/src/AdobeHeartbeat.ts +244 -244
  7. package/packages/adobe-heartbeat/src/__external__/Adobe/Adobe.d.ts +24 -24
  8. package/packages/adobe-heartbeat/src/__external__/Adobe/MediaSDK.min.d.ts +126 -126
  9. package/packages/adobe-heartbeat/src/__external__/Adobe/MediaSDK.min.js +76 -76
  10. package/packages/adobe-heartbeat/src/index.ts +5 -5
  11. package/packages/adobe-heartbeat/src/types.ts +67 -67
  12. package/packages/analytics/README.md +7 -7
  13. package/packages/analytics/src/A.ts +1 -1
  14. package/packages/analytics/src/Analytics.ts +1 -1
  15. package/packages/analytics/src/analyticsOnScroll.ts +1 -1
  16. package/packages/analytics/src/clients/ConsoleAnalytics/ConsoleAnalytics.ts +1 -1
  17. package/packages/analytics/src/clients/ConsoleAnalytics/index.ts +1 -1
  18. package/packages/analytics/src/clients/GoogleAnalytics/GoogleAnalytics.ts +200 -200
  19. package/packages/analytics/src/clients/GoogleAnalytics/constants.ts +118 -118
  20. package/packages/analytics/src/clients/GoogleAnalytics/getUrl.ts +17 -17
  21. package/packages/analytics/src/clients/GoogleAnalytics/index.ts +2 -2
  22. package/packages/analytics/src/clients/GoogleAnalytics/interface.ts +77 -77
  23. package/packages/analytics/src/clients/GoogleAnalytics/mapPayload.ts +50 -50
  24. package/packages/analytics/src/clients/GoogleAnalytics/prepareBody.ts +14 -14
  25. package/packages/analytics/src/clients/TealiumAnalytics/TealiumAnalytics.ts +178 -169
  26. package/packages/analytics/src/clients/TealiumAnalytics/constants.ts +102 -102
  27. package/packages/analytics/src/clients/TealiumAnalytics/findIdForLanguage.ts +9 -9
  28. package/packages/analytics/src/clients/TealiumAnalytics/index.ts +4 -4
  29. package/packages/analytics/src/clients/TealiumAnalytics/interface.ts +33 -33
  30. package/packages/analytics/src/clients/TealiumAnalytics/mappers/__mocks__/mediaPayload.ts +70 -70
  31. package/packages/analytics/src/clients/TealiumAnalytics/mappers/helper.ts +36 -36
  32. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapAppError.ts +13 -13
  33. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapFavoriteAdd.ts +11 -11
  34. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapFavoriteRemove.ts +11 -11
  35. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapPlayerClose.ts +15 -15
  36. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapPlayerOpen.ts +15 -15
  37. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSceneView.ts +18 -18
  38. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSearch.ts +18 -18
  39. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSearchFailed.ts +8 -8
  40. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSearchSuccess.ts +8 -8
  41. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoPause.ts +15 -15
  42. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoProgress.ts +18 -18
  43. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoResume.ts +15 -15
  44. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoStart.ts +15 -15
  45. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoStop.ts +15 -15
  46. package/packages/analytics/src/clients/TealiumAnalytics/types.ts +156 -156
  47. package/packages/analytics/src/clients/TwentyFourIQ/TwentyFourIQClient.ts +116 -116
  48. package/packages/analytics/src/clients/TwentyFourIQ/constants.ts +99 -99
  49. package/packages/analytics/src/clients/TwentyFourIQ/helper.ts +34 -34
  50. package/packages/analytics/src/clients/TwentyFourIQ/index.ts +2 -2
  51. package/packages/analytics/src/clients/TwentyFourIQ/interface.ts +31 -31
  52. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapAdLoaded.ts +13 -13
  53. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapAdSkipped.ts +16 -16
  54. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapBase.ts +21 -21
  55. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapBuffering.ts +15 -15
  56. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapPlayerClose.ts +24 -24
  57. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapPlayerOpen.ts +18 -18
  58. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapSceneView.ts +15 -15
  59. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapScroll.ts +17 -17
  60. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoComplete.ts +21 -21
  61. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoPause.ts +24 -24
  62. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoProgress.ts +24 -24
  63. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoStart.ts +34 -34
  64. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoStop.ts +32 -32
  65. package/packages/analytics/src/clients/TwentyFourIQ/types.ts +115 -115
  66. package/packages/analytics/src/constants.ts +1 -1
  67. package/packages/analytics/src/index.ts +3 -3
  68. package/packages/analytics/src/interface.ts +1 -1
  69. package/packages/analytics/src/utils/generateSessionId.ts +8 -8
  70. package/packages/animations/README.md +85 -85
  71. package/packages/animations/src/AnimationUtils.ts +238 -238
  72. package/packages/animations/src/JSAnimations.ts +144 -144
  73. package/packages/animations/src/__mocks__/JSAnimations.ts +30 -30
  74. package/packages/animations/src/index.ts +3 -3
  75. package/packages/announcement-banner/README.md +49 -49
  76. package/packages/announcement-banner/src/AnnouncementBanner.scss +8 -8
  77. package/packages/announcement-banner/src/AnnouncementBanner.tsx +136 -136
  78. package/packages/announcement-banner/src/index.ts +1 -1
  79. package/packages/async-image/README.md +47 -47
  80. package/packages/async-image/src/AsyncImage.tsx +101 -101
  81. package/packages/async-image/src/index.ts +2 -2
  82. package/packages/conviva/README.md +47 -47
  83. package/packages/conviva/src/ConvivaSDK.ts +38 -38
  84. package/packages/conviva/src/__mocks__/ConvivaMock.ts +36 -36
  85. package/packages/conviva/src/index.ts +1 -1
  86. package/packages/conviva/src/theoPlugin/ConvivaConviguration.ts +19 -19
  87. package/packages/conviva/src/theoPlugin/__external__/Conviva_4.0.15.js +698 -698
  88. package/packages/conviva/src/theoPlugin/__external__/convivaTheoPlugin.d.ts +7 -7
  89. package/packages/conviva/src/theoPlugin/__external__/convivaTheoPlugin.js +635 -635
  90. package/packages/conviva/src/theoPlugin/convivaTheoPluginWrapper.ts +61 -61
  91. package/packages/conviva/src/theoPlugin/index.ts +2 -2
  92. package/packages/create-package/dist/createPackage.js +66 -0
  93. package/packages/create-package/dist/createPackage.js.map +1 -0
  94. package/packages/create-package/dist/index.js +5 -0
  95. package/packages/create-package/dist/index.js.map +1 -0
  96. package/packages/create-package/dist/questionnaire/questions.js +35 -0
  97. package/packages/create-package/dist/questionnaire/questions.js.map +1 -0
  98. package/packages/create-package/dist/settings/Settings.js +10 -0
  99. package/packages/create-package/dist/settings/Settings.js.map +1 -0
  100. package/packages/create-package/dist/types.js +3 -0
  101. package/packages/create-package/dist/types.js.map +1 -0
  102. package/packages/developer-tools/DeveloperConsole/README.md +114 -114
  103. package/packages/developer-tools/DeveloperConsole/index.ts +3 -3
  104. package/packages/developer-tools/DeveloperConsole/unstyled.ts +1 -1
  105. package/packages/developer-tools/DeveloperToolsService/README.md +54 -54
  106. package/packages/developer-tools/DeveloperToolsService/index.ts +3 -3
  107. package/packages/developer-tools/DeveloperToolsService/unstyled.ts +1 -1
  108. package/packages/developer-tools/EnvironmentSelection/README.md +77 -77
  109. package/packages/developer-tools/EnvironmentSelection/index.ts +3 -3
  110. package/packages/developer-tools/EnvironmentSelection/unstyled.ts +1 -1
  111. package/packages/developer-tools/PlayerDebugWindow/README.md +65 -65
  112. package/packages/developer-tools/PlayerDebugWindow/index.ts +3 -3
  113. package/packages/developer-tools/PlayerDebugWindow/unstyled.ts +1 -1
  114. package/packages/developer-tools/README.md +24 -24
  115. package/packages/developer-tools/TechnicalInfo/README.md +90 -90
  116. package/packages/developer-tools/TechnicalInfo/index.ts +9 -9
  117. package/packages/developer-tools/TechnicalInfo/unstyled.ts +6 -6
  118. package/packages/developer-tools/src/DeveloperConsole/ControlButton.tsx +16 -16
  119. package/packages/developer-tools/src/DeveloperConsole/DeveloperConsole.tsx +389 -389
  120. package/packages/developer-tools/src/DeveloperConsole/Panel.tsx +108 -108
  121. package/packages/developer-tools/src/DeveloperConsole/PanelMessage.tsx +33 -33
  122. package/packages/developer-tools/src/DeveloperConsole/helpers/Queue.ts +38 -38
  123. package/packages/developer-tools/src/DeveloperConsole/helpers/index.ts +2 -2
  124. package/packages/developer-tools/src/DeveloperConsole/helpers/instrumentHandler.ts +165 -165
  125. package/packages/developer-tools/src/DeveloperConsole/index.ts +2 -2
  126. package/packages/developer-tools/src/DeveloperConsole/initDeveloperConsole.tsx +8 -8
  127. package/packages/developer-tools/src/DeveloperConsole/styles/DeveloperConsole/DeveloperConsole.scss +91 -91
  128. package/packages/developer-tools/src/DeveloperConsole/styles/DeveloperConsole/DeveloperConsole.styles.1080.scss +2 -2
  129. package/packages/developer-tools/src/DeveloperConsole/styles/DeveloperConsole/DeveloperConsole.styles.scss +2 -2
  130. package/packages/developer-tools/src/DeveloperConsole/styles/DeveloperConsole/_sizes.1080.scss +16 -16
  131. package/packages/developer-tools/src/DeveloperConsole/styles/DeveloperConsole/_sizes.scss +16 -16
  132. package/packages/developer-tools/src/DeveloperConsole/styles/Panel/Panel.scss +87 -87
  133. package/packages/developer-tools/src/DeveloperConsole/styles/Panel/Panel.styles.1080.scss +2 -2
  134. package/packages/developer-tools/src/DeveloperConsole/styles/Panel/Panel.styles.scss +2 -2
  135. package/packages/developer-tools/src/DeveloperConsole/styles/Panel/_sizes.1080.scss +9 -9
  136. package/packages/developer-tools/src/DeveloperConsole/styles/Panel/_sizes.scss +9 -9
  137. package/packages/developer-tools/src/DeveloperConsole/styles.ts +2 -2
  138. package/packages/developer-tools/src/DeveloperConsole/types.ts +49 -49
  139. package/packages/developer-tools/src/DeveloperConsole/utils/formatTime.ts +13 -13
  140. package/packages/developer-tools/src/DeveloperConsole/utils/index.ts +3 -3
  141. package/packages/developer-tools/src/DeveloperConsole/utils/stringify.ts +10 -10
  142. package/packages/developer-tools/src/DeveloperConsole/utils/styles.ts +24 -24
  143. package/packages/developer-tools/src/DeveloperToolsService/DeveloperToolItem.tsx +21 -21
  144. package/packages/developer-tools/src/DeveloperToolsService/DeveloperToolsList.tsx +125 -125
  145. package/packages/developer-tools/src/DeveloperToolsService/DeveloperToolsService.tsx +122 -122
  146. package/packages/developer-tools/src/DeveloperToolsService/index.ts +1 -1
  147. package/packages/developer-tools/src/DeveloperToolsService/styles/DeveloperToolsService.scss +64 -64
  148. package/packages/developer-tools/src/DeveloperToolsService/styles/DeveloperToolsService.styles.1080.scss +2 -2
  149. package/packages/developer-tools/src/DeveloperToolsService/styles/DeveloperToolsService.styles.animated.1080.scss +3 -3
  150. package/packages/developer-tools/src/DeveloperToolsService/styles/DeveloperToolsService.styles.animated.scss +4 -4
  151. package/packages/developer-tools/src/DeveloperToolsService/styles/DeveloperToolsService.styles.scss +2 -2
  152. package/packages/developer-tools/src/DeveloperToolsService/styles/_animated.scss +5 -5
  153. package/packages/developer-tools/src/DeveloperToolsService/styles/_sizes.1080.scss +16 -16
  154. package/packages/developer-tools/src/DeveloperToolsService/styles/_sizes.scss +16 -16
  155. package/packages/developer-tools/src/DeveloperToolsService/styles.ts +1 -1
  156. package/packages/developer-tools/src/EnvironmentSelection/EnvironmentList.tsx +90 -90
  157. package/packages/developer-tools/src/EnvironmentSelection/EnvironmentListItem.tsx +106 -106
  158. package/packages/developer-tools/src/EnvironmentSelection/EnvironmentSelection.tsx +102 -102
  159. package/packages/developer-tools/src/EnvironmentSelection/assets/checkmark.svg +18 -18
  160. package/packages/developer-tools/src/EnvironmentSelection/config.ts +43 -43
  161. package/packages/developer-tools/src/EnvironmentSelection/constants.ts +1 -1
  162. package/packages/developer-tools/src/EnvironmentSelection/index.ts +2 -2
  163. package/packages/developer-tools/src/EnvironmentSelection/sizes.1080.ts +5 -5
  164. package/packages/developer-tools/src/EnvironmentSelection/sizes.ts +5 -5
  165. package/packages/developer-tools/src/EnvironmentSelection/styles/EnvironmentSelection.scss +141 -141
  166. package/packages/developer-tools/src/EnvironmentSelection/styles/EnvironmentSelection.styles.1080.scss +2 -2
  167. package/packages/developer-tools/src/EnvironmentSelection/styles/EnvironmentSelection.styles.animated.1080.scss +3 -3
  168. package/packages/developer-tools/src/EnvironmentSelection/styles/EnvironmentSelection.styles.animated.scss +3 -3
  169. package/packages/developer-tools/src/EnvironmentSelection/styles/EnvironmentSelection.styles.scss +2 -2
  170. package/packages/developer-tools/src/EnvironmentSelection/styles/_animated.scss +9 -9
  171. package/packages/developer-tools/src/EnvironmentSelection/styles/_sizes.1080.scss +26 -26
  172. package/packages/developer-tools/src/EnvironmentSelection/styles/_sizes.scss +26 -26
  173. package/packages/developer-tools/src/EnvironmentSelection/styles.ts +1 -1
  174. package/packages/developer-tools/src/EnvironmentSelection/types.ts +10 -10
  175. package/packages/developer-tools/src/EnvironmentSelection/utils/format.ts +4 -4
  176. package/packages/developer-tools/src/IDeveloperTool.ts +14 -14
  177. package/packages/developer-tools/src/PlayerDebugWindow/PlayerDebugWindow.tsx +115 -115
  178. package/packages/developer-tools/src/PlayerDebugWindow/constants.ts +128 -128
  179. package/packages/developer-tools/src/PlayerDebugWindow/index.ts +1 -1
  180. package/packages/developer-tools/src/PlayerDebugWindow/styles/PlayerDebugWindow.scss +29 -29
  181. package/packages/developer-tools/src/PlayerDebugWindow/styles/PlayerDebugWindow.styles.1080.scss +2 -2
  182. package/packages/developer-tools/src/PlayerDebugWindow/styles/PlayerDebugWindow.styles.scss +2 -2
  183. package/packages/developer-tools/src/PlayerDebugWindow/styles/_sizes.1080.scss +11 -11
  184. package/packages/developer-tools/src/PlayerDebugWindow/styles/_sizes.scss +11 -11
  185. package/packages/developer-tools/src/PlayerDebugWindow/styles.ts +1 -1
  186. package/packages/developer-tools/src/TechnicalInfo/ITechnicalInfoProvider.ts +5 -5
  187. package/packages/developer-tools/src/TechnicalInfo/TechnicalInfo.tsx +125 -125
  188. package/packages/developer-tools/src/TechnicalInfo/TechnicalInfoDetail.tsx +77 -77
  189. package/packages/developer-tools/src/TechnicalInfo/TechnicalInfoProvider.ts +349 -349
  190. package/packages/developer-tools/src/TechnicalInfo/__mocks__/Device.ts +55 -55
  191. package/packages/developer-tools/src/TechnicalInfo/__mocks__/Player.ts +7 -7
  192. package/packages/developer-tools/src/TechnicalInfo/__mocks__/Storage.ts +9 -9
  193. package/packages/developer-tools/src/TechnicalInfo/icons/arrow-down.svg +18 -18
  194. package/packages/developer-tools/src/TechnicalInfo/icons/arrow-up.svg +18 -18
  195. package/packages/developer-tools/src/TechnicalInfo/index.ts +5 -5
  196. package/packages/developer-tools/src/TechnicalInfo/sizes.1080.ts +1 -1
  197. package/packages/developer-tools/src/TechnicalInfo/sizes.ts +1 -1
  198. package/packages/developer-tools/src/TechnicalInfo/styles/TechnicalInfo.scss +187 -187
  199. package/packages/developer-tools/src/TechnicalInfo/styles/TechnicalInfo.styles.1080.scss +2 -2
  200. package/packages/developer-tools/src/TechnicalInfo/styles/TechnicalInfo.styles.animated.1080.scss +3 -3
  201. package/packages/developer-tools/src/TechnicalInfo/styles/TechnicalInfo.styles.animated.scss +3 -3
  202. package/packages/developer-tools/src/TechnicalInfo/styles/TechnicalInfo.styles.scss +2 -2
  203. package/packages/developer-tools/src/TechnicalInfo/styles/_animated.scss +16 -16
  204. package/packages/developer-tools/src/TechnicalInfo/styles/_sizes.1080.scss +50 -50
  205. package/packages/developer-tools/src/TechnicalInfo/styles/_sizes.scss +50 -50
  206. package/packages/developer-tools/src/TechnicalInfo/styles.ts +1 -1
  207. package/packages/developer-tools/src/TechnicalInfo/translations.ts +79 -79
  208. package/packages/developer-tools/src/TechnicalInfo/utils/eme01bSupport.ts +58 -58
  209. package/packages/developer-tools/src/TechnicalInfo/utils/emeSupport.ts +84 -84
  210. package/packages/developer-tools/src/TechnicalInfo/utils/formatTimezone.ts +15 -15
  211. package/packages/developer-tools/src/TechnicalInfo/utils/mseSupport.ts +14 -14
  212. package/packages/developer-tools/src/utils/reload.ts +6 -6
  213. package/packages/device/README.md +219 -219
  214. package/packages/device/keymap.ts +1 -1
  215. package/packages/device/resolver/index.ts +2 -2
  216. package/packages/device/resolver/keymap.ts +1 -1
  217. package/packages/device/src/DeviceEventMap.ts +1 -1
  218. package/packages/device/src/device.ts +6 -6
  219. package/packages/device/src/driver/index.android.tv.ts +1 -1
  220. package/packages/device/src/driver/index.entone.ts +1 -1
  221. package/packages/device/src/driver/index.firetv.ts +1 -1
  222. package/packages/device/src/driver/index.hbbtv.tv.ts +1 -1
  223. package/packages/device/src/driver/index.kreatv.ts +1 -1
  224. package/packages/device/src/driver/index.saphi.tv.ts +1 -1
  225. package/packages/device/src/driver/index.smartcast.tv.ts +1 -1
  226. package/packages/device/src/driver/index.tizen.tv.ts +1 -1
  227. package/packages/device/src/driver/index.ts +1 -1
  228. package/packages/device/src/driver/index.vidaa.tv.ts +1 -1
  229. package/packages/device/src/driver/index.webos.tv.ts +1 -1
  230. package/packages/device/src/getKeyDigit.ts +35 -35
  231. package/packages/device/src/getKeyMap.ts +4 -4
  232. package/packages/device/src/index.ts +8 -8
  233. package/packages/device/src/isClickOrEnter.ts +3 -3
  234. package/packages/device/src/resolver/index.ts +2 -2
  235. package/packages/device/src/resolver/resolver.ts +84 -84
  236. package/packages/digital-clock/README.md +26 -26
  237. package/packages/digital-clock/src/DigitalClock.tsx +78 -78
  238. package/packages/digital-clock/src/index.ts +1 -1
  239. package/packages/driver-androidtv/src/DeviceAndroidTV.ts +224 -224
  240. package/packages/driver-androidtv/src/__mocks__/javaScriptBridge.ts +36 -36
  241. package/packages/driver-androidtv/src/formatUserAgent.ts +11 -11
  242. package/packages/driver-androidtv/src/index.ts +1 -1
  243. package/packages/driver-androidtv/src/keymap.ts +27 -27
  244. package/packages/driver-androidtv/src/types.ts +113 -113
  245. package/packages/driver-base/DeviceBase.md +139 -139
  246. package/packages/driver-base/README.md +44 -44
  247. package/packages/driver-base/src/ConnectionType.ts +1 -1
  248. package/packages/driver-base/src/DeviceBase.ts +279 -279
  249. package/packages/driver-base/src/KeyMap/Key.ts +48 -48
  250. package/packages/driver-base/src/KeyMap/KeyMap.ts +390 -390
  251. package/packages/driver-base/src/KeyMap/generateKeyCodeKeyMap.ts +11 -11
  252. package/packages/driver-base/src/KeyMap/index.ts +5 -5
  253. package/packages/driver-base/src/KeyMap/interface.ts +8 -8
  254. package/packages/driver-base/src/KeyMap/overrideValues.ts +17 -17
  255. package/packages/driver-base/src/KeyMap/switchByKey.ts +18 -18
  256. package/packages/driver-base/src/ScreenSize.ts +1 -1
  257. package/packages/driver-base/src/VolumeRange.ts +5 -5
  258. package/packages/driver-base/src/__mocks__/DeviceBase.ts +100 -100
  259. package/packages/driver-base/src/__mocks__/keyMap.ts +42 -42
  260. package/packages/driver-base/src/bindPreventDefaultEvent.ts +5 -5
  261. package/packages/driver-base/src/errors.ts +32 -32
  262. package/packages/driver-base/src/index.ts +10 -10
  263. package/packages/driver-base/src/loadObject.ts +30 -30
  264. package/packages/driver-base/src/types/DeviceEvent.ts +11 -11
  265. package/packages/driver-base/src/types/ExitOptions.ts +1 -1
  266. package/packages/driver-base/src/types/KeycodeKeyMap.ts +86 -86
  267. package/packages/driver-base/src/types/ScreenSaverStatus.ts +3 -3
  268. package/packages/driver-base/src/utils.ts +10 -10
  269. package/packages/driver-browser/src/DeviceBrowser.ts +170 -170
  270. package/packages/driver-browser/src/getBrowser.ts +51 -51
  271. package/packages/driver-browser/src/getOsName.ts +30 -30
  272. package/packages/driver-browser/src/index.ts +1 -1
  273. package/packages/driver-browser/src/keymap.ts +22 -22
  274. package/packages/driver-browser/src/patchSuitestKeys.ts +27 -27
  275. package/packages/driver-entone/README.md +9 -9
  276. package/packages/driver-entone/src/DeviceEntone.ts +232 -232
  277. package/packages/driver-entone/src/IEntone.ts +460 -460
  278. package/packages/driver-entone/src/__mocks__/entone.ts +177 -177
  279. package/packages/driver-entone/src/constants.ts +73 -73
  280. package/packages/driver-entone/src/index.ts +1 -1
  281. package/packages/driver-entone/src/keymap.ts +57 -57
  282. package/packages/driver-firetv/src/DeviceFireTV.ts +18 -18
  283. package/packages/driver-firetv/src/__mocks__/javaScriptBridge.ts +36 -36
  284. package/packages/driver-firetv/src/index.ts +1 -1
  285. package/packages/driver-hbbtv/src/DeviceHbbTV.ts +313 -313
  286. package/packages/driver-hbbtv/src/__mocks__/hbbtv.ts +17 -17
  287. package/packages/driver-hbbtv/src/constants.ts +28 -28
  288. package/packages/driver-hbbtv/src/deviceInfo.ts +23 -23
  289. package/packages/driver-hbbtv/src/getVersion.ts +16 -16
  290. package/packages/driver-hbbtv/src/index.ts +1 -1
  291. package/packages/driver-hbbtv/src/keymap.ts +45 -45
  292. package/packages/driver-hbbtv/src/types.ts +366 -366
  293. package/packages/driver-kreatv/src/DeviceKreaTV.ts +271 -271
  294. package/packages/driver-kreatv/src/IToi.ts +379 -379
  295. package/packages/driver-kreatv/src/__mocks__/toi2.ts +76 -76
  296. package/packages/driver-kreatv/src/__mocks__/toi3.ts +43 -43
  297. package/packages/driver-kreatv/src/index.ts +1 -1
  298. package/packages/driver-kreatv/src/keymap.ts +31 -31
  299. package/packages/driver-kreatv/src/toi2.ts +107 -107
  300. package/packages/driver-kreatv/src/toi3.ts +102 -102
  301. package/packages/driver-kreatv/src/types.ts +35 -35
  302. package/packages/driver-saphi/src/DeviceSaphi.ts +144 -144
  303. package/packages/driver-saphi/src/__mocks__/SmartTvA_API.ts +11 -11
  304. package/packages/driver-saphi/src/__mocks__/userAgent.ts +4 -4
  305. package/packages/driver-saphi/src/constants.ts +1 -1
  306. package/packages/driver-saphi/src/formatUserAgent.ts +19 -19
  307. package/packages/driver-saphi/src/index.ts +1 -1
  308. package/packages/driver-saphi/src/keymap.ts +64 -64
  309. package/packages/driver-saphi/src/types.ts +75 -75
  310. package/packages/driver-smartcast/src/DeviceSmartCast.ts +317 -317
  311. package/packages/driver-smartcast/src/__mocks__/api.ts +49 -49
  312. package/packages/driver-smartcast/src/index.ts +1 -1
  313. package/packages/driver-smartcast/src/keymap.ts +9 -9
  314. package/packages/driver-smartcast/src/types.ts +65 -65
  315. package/packages/driver-tizen/src/DeviceTizen.ts +298 -298
  316. package/packages/driver-tizen/src/ITizen.ts +212 -212
  317. package/packages/driver-tizen/src/IWebapis.ts +95 -95
  318. package/packages/driver-tizen/src/TizenKeys.ts +96 -96
  319. package/packages/driver-tizen/src/__mocks__/tizen.ts +35 -35
  320. package/packages/driver-tizen/src/constants.ts +197 -197
  321. package/packages/driver-tizen/src/index.ts +1 -1
  322. package/packages/driver-tizen/src/types.ts +14 -14
  323. package/packages/driver-vidaa/src/DeviceVidaa.ts +141 -141
  324. package/packages/driver-vidaa/src/__mocks__/vidaa.ts +21 -21
  325. package/packages/driver-vidaa/src/constants.ts +8 -8
  326. package/packages/driver-vidaa/src/formatUserAgent.ts +16 -16
  327. package/packages/driver-vidaa/src/index.ts +1 -1
  328. package/packages/driver-vidaa/src/keymap.ts +56 -56
  329. package/packages/driver-vidaa/src/types.ts +90 -90
  330. package/packages/driver-webos/src/DeviceWebos.ts +313 -313
  331. package/packages/driver-webos/src/__mocks__/webos.ts +172 -172
  332. package/packages/driver-webos/src/constants.ts +20 -20
  333. package/packages/driver-webos/src/index.ts +1 -1
  334. package/packages/driver-webos/src/keymap.ts +10 -10
  335. package/packages/driver-webos/src/types.ts +344 -344
  336. package/packages/driver-webos/src/utils.ts +60 -60
  337. package/packages/driver-webos/src/webOSTVjs/webOSTVjs.js +12 -12
  338. package/packages/driver-xbox/__external__/winjs/directionalnavigation-1.0.0.0.js +1015 -1015
  339. package/packages/driver-xbox/src/DeviceXbox.ts +231 -231
  340. package/packages/driver-xbox/src/__mocks__/Windows.ts +94 -94
  341. package/packages/driver-xbox/src/index.ts +1 -1
  342. package/packages/driver-xbox/src/interfaces.ts +138 -138
  343. package/packages/driver-xbox/src/keymap.ts +96 -96
  344. package/packages/driver-xbox/src/utils.ts +23 -23
  345. package/packages/epg/IMPLEMENTATION.md +228 -228
  346. package/packages/epg/MockGenerator.md +102 -102
  347. package/packages/epg/README.md +585 -585
  348. package/packages/epg/src/v2/Cell.tsx +222 -222
  349. package/packages/epg/src/v2/CellsManager.ts +1 -1
  350. package/packages/epg/src/v2/DataManager.ts +372 -372
  351. package/packages/epg/src/v2/DatePicker.tsx +110 -110
  352. package/packages/epg/src/v2/DateToast/DateToast.scss +28 -28
  353. package/packages/epg/src/v2/DateToast/DateToast.styles.1080.scss +2 -2
  354. package/packages/epg/src/v2/DateToast/DateToast.styles.scss +2 -2
  355. package/packages/epg/src/v2/DateToast/DateToast.tsx +90 -90
  356. package/packages/epg/src/v2/DateToast/_sizes.1080.scss +7 -7
  357. package/packages/epg/src/v2/DateToast/_sizes.scss +7 -7
  358. package/packages/epg/src/v2/DateToast/index.tsx +1 -1
  359. package/packages/epg/src/v2/DateToast/styles.ts +1 -1
  360. package/packages/epg/src/v2/Day.tsx +33 -33
  361. package/packages/epg/src/v2/Epg.tsx +462 -462
  362. package/packages/epg/src/v2/Header.tsx +41 -41
  363. package/packages/epg/src/v2/IdleController.ts +25 -25
  364. package/packages/epg/src/v2/InputEvents.ts +301 -301
  365. package/packages/epg/src/v2/MockGenerator/config.1080.ts +2 -2
  366. package/packages/epg/src/v2/MockGenerator/config.ts +2 -2
  367. package/packages/epg/src/v2/MockGenerator/generator.ts +174 -174
  368. package/packages/epg/src/v2/MockGenerator/index.ts +2 -2
  369. package/packages/epg/src/v2/MockGenerator/mocks/data.ts +102 -102
  370. package/packages/epg/src/v2/MockGenerator/types.ts +25 -25
  371. package/packages/epg/src/v2/MockGenerator/utils.ts +28 -28
  372. package/packages/epg/src/v2/MouseNavigation/MouseNavigation.tsx +88 -88
  373. package/packages/epg/src/v2/MouseNavigation/MouseNavigationFallback.ts +4 -4
  374. package/packages/epg/src/v2/MouseNavigation/index.tizen.tv.ts +1 -1
  375. package/packages/epg/src/v2/MouseNavigation/index.ts +1 -1
  376. package/packages/epg/src/v2/MouseNavigation/index.web.ts +1 -1
  377. package/packages/epg/src/v2/MouseNavigation/index.webos.tv.ts +1 -1
  378. package/packages/epg/src/v2/NowLine.tsx +66 -66
  379. package/packages/epg/src/v2/Program.tsx +58 -58
  380. package/packages/epg/src/v2/ProgramInfo/ProgramInfo.scss +67 -67
  381. package/packages/epg/src/v2/ProgramInfo/ProgramInfo.styles.1080.scss +3 -3
  382. package/packages/epg/src/v2/ProgramInfo/ProgramInfo.styles.animated.1080.scss +2 -2
  383. package/packages/epg/src/v2/ProgramInfo/ProgramInfo.styles.animated.scss +2 -2
  384. package/packages/epg/src/v2/ProgramInfo/ProgramInfo.styles.scss +3 -3
  385. package/packages/epg/src/v2/ProgramInfo/ProgramInfo.tsx +149 -149
  386. package/packages/epg/src/v2/ProgramInfo/_animated.scss +8 -8
  387. package/packages/epg/src/v2/ProgramInfo/_mixins.scss +5 -5
  388. package/packages/epg/src/v2/ProgramInfo/_sizes.1080.scss +21 -21
  389. package/packages/epg/src/v2/ProgramInfo/_sizes.scss +21 -21
  390. package/packages/epg/src/v2/ProgramInfo/index.ts +1 -1
  391. package/packages/epg/src/v2/ProgramInfo/rtl.scss +7 -7
  392. package/packages/epg/src/v2/ProgramInfo/sizes.1080.ts +3 -3
  393. package/packages/epg/src/v2/ProgramInfo/sizes.ts +3 -3
  394. package/packages/epg/src/v2/ProgramInfo/styles.ts +1 -1
  395. package/packages/epg/src/v2/ProgramInfo/utils.ts +28 -28
  396. package/packages/epg/src/v2/Row.tsx +134 -134
  397. package/packages/epg/src/v2/RowsManager.ts +1 -1
  398. package/packages/epg/src/v2/TimeManager.ts +58 -58
  399. package/packages/epg/src/v2/Timeline.ts +1 -1
  400. package/packages/epg/src/v2/TimelineSection.tsx +50 -50
  401. package/packages/epg/src/v2/basic/CellsManager.tsx +300 -300
  402. package/packages/epg/src/v2/basic/RowsManager.tsx +503 -503
  403. package/packages/epg/src/v2/basic/Timeline.tsx +88 -88
  404. package/packages/epg/src/v2/index.ts +1 -1
  405. package/packages/epg/src/v2/interface.ts +1519 -1519
  406. package/packages/epg/src/v2/sizes.1080.ts +2 -2
  407. package/packages/epg/src/v2/sizes.ts +2 -2
  408. package/packages/epg/src/v2/styles/Basic/Basic.scss +116 -116
  409. package/packages/epg/src/v2/styles/Basic/index.ts +1 -1
  410. package/packages/epg/src/v2/styles/Whitelabel/index.ts +1 -1
  411. package/packages/epg/src/v2/utils.ts +40 -40
  412. package/packages/events-manager/src/EventsManager.ts +1 -1
  413. package/packages/events-manager/src/index.ts +2 -2
  414. package/packages/floating-focus/README.md +64 -64
  415. package/packages/floating-focus/src/FloatingFocus.ts +106 -106
  416. package/packages/floating-focus/src/Horizontal.tsx +20 -20
  417. package/packages/floating-focus/src/Vertical.tsx +20 -20
  418. package/packages/floating-focus/src/index.ts +4 -4
  419. package/packages/floating-focus/src/types.ts +20 -20
  420. package/packages/floating-focus/src/utils.ts +43 -43
  421. package/packages/focus/README.md +348 -348
  422. package/packages/focus/src/IFocusable.ts +5 -5
  423. package/packages/focus/src/Layout/Base.tsx +166 -166
  424. package/packages/focus/src/Layout/Horizontal.ts +15 -15
  425. package/packages/focus/src/Layout/Matrix.tsx +357 -357
  426. package/packages/focus/src/Layout/Vertical.ts +12 -12
  427. package/packages/focus/src/Layout/constants.ts +10 -10
  428. package/packages/focus/src/Layout/isRtl.ts +12 -12
  429. package/packages/focus/src/Layout/types.ts +7 -7
  430. package/packages/focus/src/candidate.ts +106 -106
  431. package/packages/focus/src/focusFirstExisting.ts +19 -19
  432. package/packages/focus/src/hasFocus.ts +36 -36
  433. package/packages/focus/src/index.ts +16 -16
  434. package/packages/focus/src/refocusAfterHashChange.ts +19 -19
  435. package/packages/focus/src/safeFocus.ts +15 -15
  436. package/packages/gallup/README.md +27 -27
  437. package/packages/gallup/src/Gallup.ts +80 -80
  438. package/packages/gallup/src/GallupMock.ts +7 -7
  439. package/packages/gallup/src/__external__/SpringStreams.d.ts +39 -39
  440. package/packages/gallup/src/__mocks__/SpringStreams.js +18 -18
  441. package/packages/gallup/src/index.ts +1 -1
  442. package/packages/grid/BasicGrid/README.md +78 -78
  443. package/packages/grid/BasicGrid/index.ts +1 -1
  444. package/packages/grid/FirstOnlyGrid/README.md +43 -43
  445. package/packages/grid/FirstOnlyGrid/index.ts +1 -1
  446. package/packages/grid/FixedToEndGrid/README.md +45 -45
  447. package/packages/grid/FixedToEndGrid/index.ts +1 -1
  448. package/packages/grid/Item/index.ts +1 -1
  449. package/packages/grid/README.md +169 -169
  450. package/packages/grid/src/Base/Base.tsx +492 -492
  451. package/packages/grid/src/Base/MouseNavigation/MouseNavigation.tsx +82 -82
  452. package/packages/grid/src/Base/MouseNavigation/MouseNavigationFallback.ts +4 -4
  453. package/packages/grid/src/Base/MouseNavigation/index.tizen.tv.ts +1 -1
  454. package/packages/grid/src/Base/MouseNavigation/index.ts +1 -1
  455. package/packages/grid/src/Base/MouseNavigation/index.webos.tv.ts +1 -1
  456. package/packages/grid/src/Base/MouseNavigation/index.webtv.ts +1 -1
  457. package/packages/grid/src/Base/index.ts +1 -1
  458. package/packages/grid/src/Base/interface.ts +47 -47
  459. package/packages/grid/src/BasicGrid/BasicGrid.tsx +137 -137
  460. package/packages/grid/src/BasicGrid/config.ts +13 -13
  461. package/packages/grid/src/FastFocusingOptimizer/FastFocusingOptimizer.ts +54 -54
  462. package/packages/grid/src/FirstOnlyGrid/FirstOnlyGrid.tsx +112 -112
  463. package/packages/grid/src/FirstOnlyGrid/config.ts +13 -13
  464. package/packages/grid/src/FirstOnlyGrid/controller.ts +10 -10
  465. package/packages/grid/src/FixedToEndGrid/FixedToEndGrid.tsx +112 -112
  466. package/packages/grid/src/FixedToEndGrid/config.ts +13 -13
  467. package/packages/grid/src/FixedToEndGrid/controller.ts +36 -36
  468. package/packages/grid/src/UnifiedGridController/UnifiedGridController.ts +555 -555
  469. package/packages/grid/src/UnifiedGridController/index.ts +2 -2
  470. package/packages/grid/src/UnifiedGridController/interface.ts +92 -92
  471. package/packages/grid/src/animate.animated.ts +1 -1
  472. package/packages/grid/src/animate.ts +1 -1
  473. package/packages/grid/src/interface.ts +30 -30
  474. package/packages/grid/src/mocks/index.tsx +41 -41
  475. package/packages/grid/src/types.ts +69 -69
  476. package/packages/grid/src/utils.ts +69 -69
  477. package/packages/i18n/README.md +460 -460
  478. package/packages/i18n/src/I18n.ts +246 -246
  479. package/packages/i18n/src/Translation.tsx +36 -36
  480. package/packages/i18n/src/addResourceBundle.ts +73 -73
  481. package/packages/i18n/src/direction.ts +33 -33
  482. package/packages/i18n/src/index.ts +4 -4
  483. package/packages/i18n/src/isRtl.ts +3 -3
  484. package/packages/i18n/src/middlewares/i18next/Context/Context.ts +25 -25
  485. package/packages/i18n/src/middlewares/i18next/Context/index.ts +1 -1
  486. package/packages/i18n/src/middlewares/i18next/Interpolation/Interpolation.ts +95 -95
  487. package/packages/i18n/src/middlewares/i18next/Interpolation/index.ts +1 -1
  488. package/packages/i18n/src/middlewares/i18next/Nesting/Nesting.ts +38 -38
  489. package/packages/i18n/src/middlewares/i18next/Nesting/index.ts +1 -1
  490. package/packages/i18n/src/middlewares/i18next/Plurals/Plurals.ts +123 -123
  491. package/packages/i18n/src/middlewares/i18next/Plurals/Resolvers.ts +124 -124
  492. package/packages/i18n/src/middlewares/i18next/Plurals/index.ts +1 -1
  493. package/packages/i18n/src/middlewares/i18next/Plurals/types.ts +6 -6
  494. package/packages/i18n/src/middlewares/icu/DateInterpolation/DateInterpolation.ts +64 -64
  495. package/packages/i18n/src/middlewares/icu/DateInterpolation/index.ts +1 -1
  496. package/packages/i18n/src/middlewares/icu/Interpolation/Interpolation.ts +39 -39
  497. package/packages/i18n/src/middlewares/icu/Interpolation/index.ts +1 -1
  498. package/packages/i18n/src/middlewares/icu/NumberInterpolation/NumberInterpolation.ts +41 -41
  499. package/packages/i18n/src/middlewares/icu/NumberInterpolation/index.ts +1 -1
  500. package/packages/i18n/src/middlewares/icu/Plurals/Plurals.ts +65 -65
  501. package/packages/i18n/src/middlewares/icu/Plurals/Resolvers.ts +130 -130
  502. package/packages/i18n/src/middlewares/icu/Plurals/index.ts +1 -1
  503. package/packages/i18n/src/middlewares/icu/Plurals/types.ts +15 -15
  504. package/packages/i18n/src/middlewares/icu/Select/Select.ts +36 -36
  505. package/packages/i18n/src/middlewares/icu/Select/index.ts +1 -1
  506. package/packages/i18n/src/middlewares/icu/TimeInterpolation/TimeInterpolation.ts +65 -65
  507. package/packages/i18n/src/middlewares/icu/TimeInterpolation/index.ts +1 -1
  508. package/packages/i18n/src/middlewares/icu/shared/hasVariable.ts +5 -5
  509. package/packages/i18n/src/middlewares/icu/shared/matchSwitchCase.ts +80 -80
  510. package/packages/i18n/src/middlewares/icu/shared/unwrap.ts +1 -1
  511. package/packages/i18n/src/pluralsCommon/PluralsHelper.ts +54 -54
  512. package/packages/i18n/src/pluralsCommon/ResolverByLanguage.ts +129 -129
  513. package/packages/i18n/src/t.tsx +6 -6
  514. package/packages/i18n/src/typedTranslate.ts +31 -31
  515. package/packages/i18n/src/types.ts +66 -66
  516. package/packages/i18n/src/utils.ts +76 -76
  517. package/packages/icon/README.md +107 -107
  518. package/packages/icon/src/Icon.tsx +71 -71
  519. package/packages/icon/src/index.ts +1 -1
  520. package/packages/ime/README.md +72 -72
  521. package/packages/ime/src/IKeyboard.ts +6 -6
  522. package/packages/ime/src/IKeyboardEvent.ts +7 -7
  523. package/packages/ime/src/ImeManager.ts +33 -33
  524. package/packages/ime/src/SystemKeyboard/SystemKeyboard.ts +33 -33
  525. package/packages/ime/src/SystemKeyboard/SystemKeyboardBase.ts +98 -98
  526. package/packages/ime/src/SystemKeyboard/TizenSystemKeyboard.ts +66 -66
  527. package/packages/ime/src/SystemKeyboard/WebosSystemKeyboard.ts +74 -74
  528. package/packages/ime/src/SystemKeyboard/index.tizen.tv.ts +1 -1
  529. package/packages/ime/src/SystemKeyboard/index.ts +1 -1
  530. package/packages/ime/src/SystemKeyboard/index.webos.tv.ts +1 -1
  531. package/packages/ime/src/index.ts +3 -3
  532. package/packages/input/README.md +65 -65
  533. package/packages/input/__mocks__/MockKeyboard.ts +40 -40
  534. package/packages/input/src/Input.scss +9 -9
  535. package/packages/input/src/Input.tsx +267 -267
  536. package/packages/input/src/index.ts +1 -1
  537. package/packages/input/src/utils.ts +71 -71
  538. package/packages/interactable/README.md +38 -38
  539. package/packages/interactable/src/Interactable.tsx +33 -33
  540. package/packages/interactable/src/index.ts +1 -1
  541. package/packages/interactable/src/interface.ts +7 -7
  542. package/packages/ipify/README.md +30 -30
  543. package/packages/ipify/src/index.ts +1 -1
  544. package/packages/ipify/src/ipify.ts +41 -41
  545. package/packages/jsx/README.md +388 -388
  546. package/packages/jsx/src/Component.ts +68 -68
  547. package/packages/jsx/src/createRef.ts +5 -5
  548. package/packages/jsx/src/forwardRef.ts +8 -8
  549. package/packages/jsx/src/index.ts +31 -31
  550. package/packages/jsx/src/jsx-runtime.ts +5 -5
  551. package/packages/jsx/src/manipulation/attachNode.ts +30 -30
  552. package/packages/jsx/src/manipulation/attachNodeBefore.ts +44 -44
  553. package/packages/jsx/src/manipulation/clearNode.ts +14 -14
  554. package/packages/jsx/src/manipulation/detachNode.ts +26 -26
  555. package/packages/jsx/src/manipulation/index.ts +7 -7
  556. package/packages/jsx/src/manipulation/removeNode.ts +18 -18
  557. package/packages/jsx/src/manipulation/replaceNode.ts +42 -42
  558. package/packages/jsx/src/manipulation/swapNodes.ts +53 -53
  559. package/packages/jsx/src/mount/guards.ts +26 -26
  560. package/packages/jsx/src/mount/handleLifecycle.ts +71 -71
  561. package/packages/jsx/src/mount/index.ts +1 -1
  562. package/packages/jsx/src/mount/lifecycle.ts +38 -38
  563. package/packages/jsx/src/mount/lifecycleHelpers.ts +29 -29
  564. package/packages/jsx/src/mount/mount.ts +141 -141
  565. package/packages/jsx/src/mount/namespaces.ts +7 -7
  566. package/packages/jsx/src/mount/props.ts +121 -121
  567. package/packages/jsx/src/nodeUtils.ts +69 -69
  568. package/packages/jsx/src/setText.ts +15 -15
  569. package/packages/jsx/src/test-utils/MountedComponent.ts +50 -50
  570. package/packages/jsx/src/test-utils/README.md +72 -72
  571. package/packages/jsx/src/test-utils/click.ts +7 -7
  572. package/packages/jsx/src/test-utils/enter.ts +4 -4
  573. package/packages/jsx/src/test-utils/index.ts +6 -6
  574. package/packages/jsx/src/test-utils/keydown.ts +27 -27
  575. package/packages/jsx/src/test-utils/keyup.ts +27 -27
  576. package/packages/jsx/src/test-utils/shallow.ts +33 -33
  577. package/packages/jsx/src/test-utils/spec-utils.ts +6 -6
  578. package/packages/jsx/src/textNode.ts +9 -9
  579. package/packages/jsx/src/types.ts +128 -128
  580. package/packages/jsx/src/utils.ts +35 -35
  581. package/packages/jsx/src/virtualDOM.ts +121 -121
  582. package/packages/key-sequence/README.md +44 -44
  583. package/packages/key-sequence/src/KeySequence.ts +56 -56
  584. package/packages/key-sequence/src/arrayEndsWithKeyCombo.ts +22 -22
  585. package/packages/key-sequence/src/index.ts +1 -1
  586. package/packages/key-sequence/src/types.ts +13 -13
  587. package/packages/keyboard/README.md +237 -237
  588. package/packages/keyboard/src/AndroidKeyboard/Keyboard.scss +140 -140
  589. package/packages/keyboard/src/AndroidKeyboard/Keyboard.styles.1080.scss +2 -2
  590. package/packages/keyboard/src/AndroidKeyboard/Keyboard.styles.animated.1080.scss +3 -3
  591. package/packages/keyboard/src/AndroidKeyboard/Keyboard.styles.animated.scss +3 -3
  592. package/packages/keyboard/src/AndroidKeyboard/Keyboard.styles.scss +2 -2
  593. package/packages/keyboard/src/AndroidKeyboard/Keyboard.tsx +235 -235
  594. package/packages/keyboard/src/AndroidKeyboard/_animated.scss +7 -7
  595. package/packages/keyboard/src/AndroidKeyboard/_sizes.1080.scss +15 -15
  596. package/packages/keyboard/src/AndroidKeyboard/_sizes.scss +15 -15
  597. package/packages/keyboard/src/AndroidKeyboard/icons/arrow_left.svg +6 -6
  598. package/packages/keyboard/src/AndroidKeyboard/icons/arrow_right.svg +6 -6
  599. package/packages/keyboard/src/AndroidKeyboard/icons/key_backspace.svg +12 -12
  600. package/packages/keyboard/src/AndroidKeyboard/index.ts +1 -1
  601. package/packages/keyboard/src/AndroidKeyboard/makeLayout.ts +19 -19
  602. package/packages/keyboard/src/Backdrop/Backdrop.scss +17 -17
  603. package/packages/keyboard/src/Backdrop/Backdrop.styles.1080.scss +2 -2
  604. package/packages/keyboard/src/Backdrop/Backdrop.styles.scss +2 -2
  605. package/packages/keyboard/src/Backdrop/Backdrop.tsx +31 -31
  606. package/packages/keyboard/src/Backdrop/_sizes.1080.scss +2 -2
  607. package/packages/keyboard/src/Backdrop/_sizes.scss +2 -2
  608. package/packages/keyboard/src/DefaultKeyboard/Keyboard.scss +73 -73
  609. package/packages/keyboard/src/DefaultKeyboard/Keyboard.styles.1080.scss +2 -2
  610. package/packages/keyboard/src/DefaultKeyboard/Keyboard.styles.scss +2 -2
  611. package/packages/keyboard/src/DefaultKeyboard/Keyboard.tsx +155 -155
  612. package/packages/keyboard/src/DefaultKeyboard/_sizes.1080.scss +12 -12
  613. package/packages/keyboard/src/DefaultKeyboard/_sizes.scss +12 -12
  614. package/packages/keyboard/src/DefaultKeyboard/index.ts +1 -1
  615. package/packages/keyboard/src/KeyboardBase.tsx +344 -344
  616. package/packages/keyboard/src/MobiKeyboard/Keyboard.scss +180 -180
  617. package/packages/keyboard/src/MobiKeyboard/Keyboard.styles.1080.scss +2 -2
  618. package/packages/keyboard/src/MobiKeyboard/Keyboard.styles.animated.1080.scss +3 -3
  619. package/packages/keyboard/src/MobiKeyboard/Keyboard.styles.animated.scss +3 -3
  620. package/packages/keyboard/src/MobiKeyboard/Keyboard.styles.scss +2 -2
  621. package/packages/keyboard/src/MobiKeyboard/Keyboard.tsx +278 -278
  622. package/packages/keyboard/src/MobiKeyboard/_animated.scss +7 -7
  623. package/packages/keyboard/src/MobiKeyboard/_sizes.1080.scss +10 -10
  624. package/packages/keyboard/src/MobiKeyboard/_sizes.scss +10 -10
  625. package/packages/keyboard/src/MobiKeyboard/icons/arrow_left.svg +6 -6
  626. package/packages/keyboard/src/MobiKeyboard/icons/arrow_right.svg +6 -6
  627. package/packages/keyboard/src/MobiKeyboard/icons/key_backspace.svg +12 -12
  628. package/packages/keyboard/src/MobiKeyboard/icons/key_space.svg +6 -6
  629. package/packages/keyboard/src/MobiKeyboard/index.ts +1 -1
  630. package/packages/keyboard/src/MobiKeyboard/utils.ts +19 -19
  631. package/packages/keyboard/src/QwertyKeyboardBase/QwertyKeyboardBase.tsx +54 -54
  632. package/packages/keyboard/src/ShiftMode.ts +25 -25
  633. package/packages/keyboard/src/WhitelabelKeyboard/Keyboard.scss +168 -168
  634. package/packages/keyboard/src/WhitelabelKeyboard/Keyboard.styles.1080.scss +2 -2
  635. package/packages/keyboard/src/WhitelabelKeyboard/Keyboard.styles.scss +2 -2
  636. package/packages/keyboard/src/WhitelabelKeyboard/Keyboard.tsx +353 -353
  637. package/packages/keyboard/src/WhitelabelKeyboard/WhitelabelStyles/_sizes.1080.scss +7 -7
  638. package/packages/keyboard/src/WhitelabelKeyboard/WhitelabelStyles/_sizes.scss +7 -7
  639. package/packages/keyboard/src/WhitelabelKeyboard/WhitelabelStyles/index.ts +1 -1
  640. package/packages/keyboard/src/WhitelabelKeyboard/WhitelabelStyles/whitelabel.scss +81 -81
  641. package/packages/keyboard/src/WhitelabelKeyboard/WhitelabelStyles/whitelabel.styles.1080.scss +2 -2
  642. package/packages/keyboard/src/WhitelabelKeyboard/WhitelabelStyles/whitelabel.styles.scss +2 -2
  643. package/packages/keyboard/src/WhitelabelKeyboard/_sizes.1080.scss +32 -32
  644. package/packages/keyboard/src/WhitelabelKeyboard/_sizes.scss +32 -32
  645. package/packages/keyboard/src/WhitelabelKeyboard/icons/arrow_left.svg +9 -9
  646. package/packages/keyboard/src/WhitelabelKeyboard/icons/arrow_right.svg +9 -9
  647. package/packages/keyboard/src/WhitelabelKeyboard/icons/key_backspace.svg +9 -9
  648. package/packages/keyboard/src/WhitelabelKeyboard/icons/key_language.svg +20 -20
  649. package/packages/keyboard/src/WhitelabelKeyboard/icons/key_shift.svg +9 -9
  650. package/packages/keyboard/src/WhitelabelKeyboard/icons/key_shift_active.svg +9 -9
  651. package/packages/keyboard/src/WhitelabelKeyboard/index.ts +2 -2
  652. package/packages/keyboard/src/WhitelabelKeyboard/layouts/arabic.ts +27 -27
  653. package/packages/keyboard/src/WhitelabelKeyboard/layouts/burmese.ts +27 -27
  654. package/packages/keyboard/src/WhitelabelKeyboard/layouts/dari.ts +28 -28
  655. package/packages/keyboard/src/WhitelabelKeyboard/layouts/hebrew.ts +28 -28
  656. package/packages/keyboard/src/WhitelabelKeyboard/layouts/index.ts +15 -15
  657. package/packages/keyboard/src/WhitelabelKeyboard/layouts/korean.ts +26 -26
  658. package/packages/keyboard/src/WhitelabelKeyboard/layouts/latin.ts +26 -26
  659. package/packages/keyboard/src/WhitelabelKeyboard/layouts/pashto.ts +27 -27
  660. package/packages/keyboard/src/WhitelabelKeyboard/layouts/persian.ts +27 -27
  661. package/packages/keyboard/src/WhitelabelKeyboard/layouts/russian.ts +27 -27
  662. package/packages/keyboard/src/WhitelabelKeyboard/layouts/spanish.ts +26 -26
  663. package/packages/keyboard/src/WhitelabelKeyboard/layouts/special.ts +28 -28
  664. package/packages/keyboard/src/WhitelabelKeyboard/layouts/tibetan.ts +26 -26
  665. package/packages/keyboard/src/WhitelabelKeyboard/layouts/turkish.ts +26 -26
  666. package/packages/keyboard/src/WhitelabelKeyboard/layouts/ukrainian.ts +27 -27
  667. package/packages/keyboard/src/WhitelabelKeyboard/layouts/urdu.ts +26 -26
  668. package/packages/keyboard/src/WhitelabelKeyboard/types.ts +28 -28
  669. package/packages/keyboard/src/WhitelabelNumericKeyboard/NumericKeyboard.scss +105 -105
  670. package/packages/keyboard/src/WhitelabelNumericKeyboard/NumericKeyboard.styles.1080.scss +2 -2
  671. package/packages/keyboard/src/WhitelabelNumericKeyboard/NumericKeyboard.styles.scss +2 -2
  672. package/packages/keyboard/src/WhitelabelNumericKeyboard/NumericKeyboard.tsx +161 -161
  673. package/packages/keyboard/src/WhitelabelNumericKeyboard/WhitelabelStyles/_sizes.1080.scss +7 -7
  674. package/packages/keyboard/src/WhitelabelNumericKeyboard/WhitelabelStyles/_sizes.scss +7 -7
  675. package/packages/keyboard/src/WhitelabelNumericKeyboard/WhitelabelStyles/index.ts +1 -1
  676. package/packages/keyboard/src/WhitelabelNumericKeyboard/WhitelabelStyles/whitelabel.scss +62 -62
  677. package/packages/keyboard/src/WhitelabelNumericKeyboard/WhitelabelStyles/whitelabel.styles.1080.scss +2 -2
  678. package/packages/keyboard/src/WhitelabelNumericKeyboard/WhitelabelStyles/whitelabel.styles.scss +2 -2
  679. package/packages/keyboard/src/WhitelabelNumericKeyboard/_sizes.1080.scss +29 -29
  680. package/packages/keyboard/src/WhitelabelNumericKeyboard/_sizes.scss +29 -29
  681. package/packages/keyboard/src/WhitelabelNumericKeyboard/icons/key_backspace.svg +9 -9
  682. package/packages/keyboard/src/WhitelabelNumericKeyboard/index.ts +2 -2
  683. package/packages/keyboard/src/WhitelabelNumericKeyboard/layout.ts +14 -14
  684. package/packages/keyboard/src/hwKeyboardEventToChar.ts +11 -11
  685. package/packages/keyboard/src/types/index.ts +11 -11
  686. package/packages/keyboard/src/utils/caret.ts +48 -48
  687. package/packages/keyboard/src/utils/generateFocusMatrixFromStringMatrix.ts +12 -12
  688. package/packages/keyboard/src/utils/input.ts +40 -40
  689. package/packages/l10n/README.md +120 -120
  690. package/packages/l10n/interface.ts +1 -1
  691. package/packages/l10n/locales/cs.ts +4 -4
  692. package/packages/l10n/locales/en-001.ts +4 -4
  693. package/packages/l10n/locales/en-us.ts +4 -4
  694. package/packages/l10n/src/Locale.tsx +44 -44
  695. package/packages/l10n/src/date/common.ts +165 -165
  696. package/packages/l10n/src/date/cs.ts +89 -89
  697. package/packages/l10n/src/date/de.ts +97 -97
  698. package/packages/l10n/src/date/en-001.ts +76 -76
  699. package/packages/l10n/src/date/en-common.ts +55 -55
  700. package/packages/l10n/src/date/en-us.ts +83 -83
  701. package/packages/l10n/src/date/es.ts +71 -71
  702. package/packages/l10n/src/date/fr.ts +94 -94
  703. package/packages/l10n/src/date/he.ts +101 -101
  704. package/packages/l10n/src/date/iso.ts +63 -63
  705. package/packages/l10n/src/date/types.ts +56 -56
  706. package/packages/l10n/src/index.ts +2 -2
  707. package/packages/l10n/src/l10n.ts +112 -112
  708. package/packages/l10n/src/types.ts +22 -22
  709. package/packages/list/AttachDetachItem/README.md +128 -128
  710. package/packages/list/AttachDetachItem/index.ts +3 -3
  711. package/packages/list/BasicList/README.md +71 -71
  712. package/packages/list/BasicList/index.ts +1 -1
  713. package/packages/list/CenteredList/README.md +42 -42
  714. package/packages/list/CenteredList/index.ts +1 -1
  715. package/packages/list/EdgeOffsetList/README.md +58 -58
  716. package/packages/list/EdgeOffsetList/index.ts +1 -1
  717. package/packages/list/FirstOnlyList/README.md +39 -39
  718. package/packages/list/FirstOnlyList/index.ts +1 -1
  719. package/packages/list/FirstOnlyVariedList/README.md +105 -105
  720. package/packages/list/FirstOnlyVariedList/index.ts +1 -1
  721. package/packages/list/FixedToEndList/README.md +42 -42
  722. package/packages/list/FixedToEndList/index.ts +1 -1
  723. package/packages/list/Item/index.ts +1 -1
  724. package/packages/list/README.md +193 -193
  725. package/packages/list/src/AttachDetachItem/AttachDetachItem.tsx +96 -96
  726. package/packages/list/src/AttachDetachItem/prepareAttachDetachItemData.ts +13 -13
  727. package/packages/list/src/Base/Base.tsx +392 -392
  728. package/packages/list/src/Base/MouseNavigation/MouseNavigation.tsx +82 -82
  729. package/packages/list/src/Base/MouseNavigation/MouseNavigationFallback.ts +4 -4
  730. package/packages/list/src/Base/MouseNavigation/index.tizen.tv.ts +1 -1
  731. package/packages/list/src/Base/MouseNavigation/index.ts +1 -1
  732. package/packages/list/src/Base/MouseNavigation/index.webos.tv.ts +1 -1
  733. package/packages/list/src/Base/MouseNavigation/index.webtv.ts +1 -1
  734. package/packages/list/src/Base/index.ts +1 -1
  735. package/packages/list/src/Base/interface.ts +39 -39
  736. package/packages/list/src/BasicList/BasicList.tsx +178 -178
  737. package/packages/list/src/BasicList/config.ts +13 -13
  738. package/packages/list/src/CenteredList/CenteredList.tsx +116 -116
  739. package/packages/list/src/CenteredList/config.ts +13 -13
  740. package/packages/list/src/CenteredList/controller.ts +46 -46
  741. package/packages/list/src/CenteredList/interface.ts +10 -10
  742. package/packages/list/src/EdgeOffsetList/EdgeOffsetList.tsx +173 -173
  743. package/packages/list/src/EdgeOffsetList/config.ts +13 -13
  744. package/packages/list/src/FastFocusingOptimizer/FastFocusingOptimizer.ts +54 -54
  745. package/packages/list/src/FirstOnlyList/FirstOnlyList.tsx +122 -122
  746. package/packages/list/src/FirstOnlyList/config.ts +13 -13
  747. package/packages/list/src/FirstOnlyList/controller.ts +11 -11
  748. package/packages/list/src/FirstOnlyVariedList/FirstOnlyVariedList.tsx +132 -132
  749. package/packages/list/src/FirstOnlyVariedList/config.ts +13 -13
  750. package/packages/list/src/FixedToEndList/FixedToEndList.tsx +125 -125
  751. package/packages/list/src/FixedToEndList/config.ts +13 -13
  752. package/packages/list/src/FixedToEndList/controller.ts +44 -44
  753. package/packages/list/src/UnifiedListController/UnifiedListController.ts +258 -258
  754. package/packages/list/src/UnifiedListController/UnifiedListControllerBase.ts +241 -241
  755. package/packages/list/src/UnifiedListController/UnifiedVariedListController.ts +241 -241
  756. package/packages/list/src/UnifiedListController/interface.ts +81 -81
  757. package/packages/list/src/__test__/utils.spec.ts +59 -59
  758. package/packages/list/src/animate.animated.ts +1 -1
  759. package/packages/list/src/animate.ts +1 -1
  760. package/packages/list/src/index.ts +1 -1
  761. package/packages/list/src/interface.ts +48 -48
  762. package/packages/list/src/mocks/index.tsx +55 -55
  763. package/packages/list/src/types.ts +132 -132
  764. package/packages/list/src/utils.ts +142 -142
  765. package/packages/list/utils/index.ts +1 -1
  766. package/packages/logger/README.md +117 -117
  767. package/packages/logger/src/LoggerManager.ts +60 -60
  768. package/packages/logger/src/LoggerService.ts +43 -43
  769. package/packages/logger/src/__mocks__/LoggerBase.ts +13 -13
  770. package/packages/logger/src/index.ts +3 -3
  771. package/packages/logger/src/loggers/ConsoleLogger/ConsoleLogger.ts +51 -51
  772. package/packages/logger/src/loggers/ConsoleLogger/README.md +39 -39
  773. package/packages/logger/src/loggers/ConsoleLogger/index.ts +1 -1
  774. package/packages/logger/src/loggers/LoggerBase/LoggerBase.ts +67 -67
  775. package/packages/logger/src/loggers/LoggerBase/README.md +69 -69
  776. package/packages/logger/src/loggers/LoggerBase/index.ts +1 -1
  777. package/packages/logger/src/loggers/SentryLogger/README.md +98 -98
  778. package/packages/logger/src/loggers/SentryLogger/Sentry.ts +2 -2
  779. package/packages/logger/src/loggers/SentryLogger/SentryLogger.ts +179 -179
  780. package/packages/logger/src/loggers/SentryLogger/index.ts +2 -2
  781. package/packages/logger/src/loggers/SentryLogger/mock.ts +6 -6
  782. package/packages/logger/src/loggers/index.ts +2 -2
  783. package/packages/logger/src/types.ts +46 -46
  784. package/packages/logger/src/utils/deviceInfo.ts +25 -25
  785. package/packages/logger/src/utils/index.ts +1 -1
  786. package/packages/lottie-animations/README.md +217 -217
  787. package/packages/lottie-animations/src/LottieAnimation.tsx +125 -125
  788. package/packages/lottie-animations/src/index.ts +7 -7
  789. package/packages/menu/README.md +90 -90
  790. package/packages/menu/WhitelabelMenu/index.ts +1 -1
  791. package/packages/menu/WhitelabelMenu/interface.ts +2 -2
  792. package/packages/menu/WhitelabelMenu/styles.ts +2 -2
  793. package/packages/menu/interface.ts +3 -3
  794. package/packages/menu/src/MenuAndContentContainer/MenuAndContentContainer.tsx +211 -211
  795. package/packages/menu/src/MenuAndContentContainer/index.ts +1 -1
  796. package/packages/menu/src/MenuAndContentContainer/interface.ts +164 -164
  797. package/packages/menu/src/MenuAndContentContainer/service.ts +5 -5
  798. package/packages/menu/src/WhitelabelMenu/SideMenu.scss +41 -41
  799. package/packages/menu/src/WhitelabelMenu/SideMenu.styles.1080.scss +2 -2
  800. package/packages/menu/src/WhitelabelMenu/SideMenu.styles.animated.1080.scss +3 -3
  801. package/packages/menu/src/WhitelabelMenu/SideMenu.styles.animated.scss +3 -3
  802. package/packages/menu/src/WhitelabelMenu/SideMenu.styles.scss +2 -2
  803. package/packages/menu/src/WhitelabelMenu/SideMenu.tsx +248 -248
  804. package/packages/menu/src/WhitelabelMenu/SideMenuItem/SideMenuItem.scss +56 -56
  805. package/packages/menu/src/WhitelabelMenu/SideMenuItem/SideMenuItem.styles.1080.scss +2 -2
  806. package/packages/menu/src/WhitelabelMenu/SideMenuItem/SideMenuItem.styles.animated.1080.scss +3 -3
  807. package/packages/menu/src/WhitelabelMenu/SideMenuItem/SideMenuItem.styles.animated.scss +3 -3
  808. package/packages/menu/src/WhitelabelMenu/SideMenuItem/SideMenuItem.styles.scss +2 -2
  809. package/packages/menu/src/WhitelabelMenu/SideMenuItem/SideMenuItem.tsx +78 -78
  810. package/packages/menu/src/WhitelabelMenu/SideMenuItem/_animated.scss +12 -12
  811. package/packages/menu/src/WhitelabelMenu/SideMenuItem/_sizes.1080.scss +17 -17
  812. package/packages/menu/src/WhitelabelMenu/SideMenuItem/_sizes.scss +17 -17
  813. package/packages/menu/src/WhitelabelMenu/SideMenuItem/index.ts +1 -1
  814. package/packages/menu/src/WhitelabelMenu/SideMenuItem/interface.ts +49 -49
  815. package/packages/menu/src/WhitelabelMenu/SideMenuItem/rtl.scss +12 -12
  816. package/packages/menu/src/WhitelabelMenu/SideMenuItem/sizes.1080.ts +2 -2
  817. package/packages/menu/src/WhitelabelMenu/SideMenuItem/sizes.ts +2 -2
  818. package/packages/menu/src/WhitelabelMenu/SideMenuItem/styles.ts +1 -1
  819. package/packages/menu/src/WhitelabelMenu/VisualController.animated.ts +48 -48
  820. package/packages/menu/src/WhitelabelMenu/VisualController.ts +20 -20
  821. package/packages/menu/src/WhitelabelMenu/VisualControllerBase.ts +71 -71
  822. package/packages/menu/src/WhitelabelMenu/_animated.scss +39 -39
  823. package/packages/menu/src/WhitelabelMenu/_sizes.1080.scss +14 -14
  824. package/packages/menu/src/WhitelabelMenu/_sizes.scss +14 -14
  825. package/packages/menu/src/WhitelabelMenu/constants.animated.ts +1 -1
  826. package/packages/menu/src/WhitelabelMenu/constants.ts +1 -1
  827. package/packages/menu/src/WhitelabelMenu/index.ts +1 -1
  828. package/packages/menu/src/WhitelabelMenu/interface.ts +14 -14
  829. package/packages/menu/src/WhitelabelMenu/rtl.scss +22 -22
  830. package/packages/menu/src/WhitelabelMenu/sizes.1080.ts +1 -1
  831. package/packages/menu/src/WhitelabelMenu/sizes.ts +1 -1
  832. package/packages/menu/src/WhitelabelMenu/styles.ts +1 -1
  833. package/packages/menu/src/WhitelabelMenu/utils.ts +34 -34
  834. package/packages/menu/src/index.ts +2 -2
  835. package/packages/modal-service/README.md +50 -50
  836. package/packages/modal-service/src/IModal.ts +3 -3
  837. package/packages/modal-service/src/ModalService.scss +7 -7
  838. package/packages/modal-service/src/ModalService.styles.1080.scss +2 -2
  839. package/packages/modal-service/src/ModalService.styles.scss +2 -2
  840. package/packages/modal-service/src/ModalService.tsx +102 -102
  841. package/packages/modal-service/src/_sizes.1080.scss +2 -2
  842. package/packages/modal-service/src/_sizes.scss +2 -2
  843. package/packages/modal-service/src/index.ts +2 -2
  844. package/packages/mouse-navigation/README.md +105 -105
  845. package/packages/mouse-navigation/src/ArrowNavigation/Arrow.tsx +58 -58
  846. package/packages/mouse-navigation/src/ArrowNavigation/ArrowNavigation.tsx +95 -95
  847. package/packages/mouse-navigation/src/ArrowNavigation/__test__/Arrow.spec.tsx +35 -35
  848. package/packages/mouse-navigation/src/ArrowNavigation/__test__/ArrowNavigation.spec.tsx +45 -45
  849. package/packages/mouse-navigation/src/ArrowNavigation/index.tsx +1 -1
  850. package/packages/mouse-navigation/src/MouseElementWrapper.tsx +70 -70
  851. package/packages/mouse-navigation/src/MouseNavigation.tsx +157 -157
  852. package/packages/mouse-navigation/src/MouseNavigationInterface.ts +8 -8
  853. package/packages/mouse-navigation/src/index.ts +3 -3
  854. package/packages/numeric-zapper/README.md +153 -153
  855. package/packages/numeric-zapper/src/NumericZapper.scss +20 -20
  856. package/packages/numeric-zapper/src/NumericZapper.styles.1080.scss +2 -2
  857. package/packages/numeric-zapper/src/NumericZapper.styles.scss +2 -2
  858. package/packages/numeric-zapper/src/NumericZapper.tsx +257 -257
  859. package/packages/numeric-zapper/src/ZapperAllower.ts +15 -15
  860. package/packages/numeric-zapper/src/ZapperService.tsx +8 -8
  861. package/packages/numeric-zapper/src/_sizes.1080.scss +7 -7
  862. package/packages/numeric-zapper/src/_sizes.scss +7 -7
  863. package/packages/numeric-zapper/src/index.ts +4 -4
  864. package/packages/numeric-zapper/src/interface.ts +1 -1
  865. package/packages/numeric-zapper/src/styles.ts +1 -1
  866. package/packages/perf-utils/README.md +7 -7
  867. package/packages/perf-utils/src/array/filter.ts +1 -1
  868. package/packages/perf-utils/src/array/find.ts +1 -1
  869. package/packages/perf-utils/src/array/findIndex.ts +1 -1
  870. package/packages/perf-utils/src/array/forEach.ts +1 -1
  871. package/packages/perf-utils/src/array/includes.ts +1 -1
  872. package/packages/perf-utils/src/array/includesNaN.ts +1 -1
  873. package/packages/perf-utils/src/array/index.ts +1 -1
  874. package/packages/perf-utils/src/array/map.ts +1 -1
  875. package/packages/picker/README.md +70 -70
  876. package/packages/picker/src/DatePicker.tsx +55 -55
  877. package/packages/picker/src/ModalPicker/Checkbox.tsx +38 -38
  878. package/packages/picker/src/ModalPicker/PickerItem.tsx +86 -86
  879. package/packages/picker/src/ModalPicker/PickerModal.tsx +98 -98
  880. package/packages/picker/src/ModalPicker/index.ts +1 -1
  881. package/packages/picker/src/ModalPicker/modalPicker.tsx +48 -48
  882. package/packages/picker/src/Picker.tsx +127 -127
  883. package/packages/picker/src/index.ts +3 -3
  884. package/packages/picker/src/types.ts +25 -25
  885. package/packages/pin-input/README.md +55 -55
  886. package/packages/pin-input/src/PinInput.scss +5 -5
  887. package/packages/pin-input/src/PinInput.tsx +169 -169
  888. package/packages/pin-input/src/index.ts +1 -1
  889. package/packages/player-ui/README.md +207 -207
  890. package/packages/player-ui/src/BackwardButton.tsx +41 -41
  891. package/packages/player-ui/src/CurrentTime.tsx +56 -56
  892. package/packages/player-ui/src/Duration.tsx +60 -60
  893. package/packages/player-ui/src/ForwardButton.tsx +41 -41
  894. package/packages/player-ui/src/PauseButton.tsx +65 -65
  895. package/packages/player-ui/src/PlayButton.tsx +57 -57
  896. package/packages/player-ui/src/PlayPauseButton.tsx +63 -63
  897. package/packages/player-ui/src/PlayerInteractable.tsx +67 -67
  898. package/packages/player-ui/src/PlayerTime.tsx +57 -57
  899. package/packages/player-ui/src/PlayerUI.tsx +267 -267
  900. package/packages/player-ui/src/RemainingTime.tsx +74 -74
  901. package/packages/player-ui/src/Seekbar.tsx +276 -276
  902. package/packages/player-ui/src/Seeking.ts +163 -163
  903. package/packages/player-ui/src/StopButton.tsx +35 -35
  904. package/packages/player-ui/src/Subtitles.tsx +151 -151
  905. package/packages/player-ui/src/index.ts +15 -15
  906. package/packages/player-ui/src/mocks.ts +65 -65
  907. package/packages/player-ui/src/timeUtils.ts +142 -142
  908. package/packages/player-ui/src/types.ts +48 -48
  909. package/packages/progress-bar/README.md +31 -31
  910. package/packages/progress-bar/src/ProgressBar.tsx +41 -41
  911. package/packages/progress-bar/src/index.ts +1 -1
  912. package/packages/progress-bar/src/interface.ts +14 -14
  913. package/packages/qr-code/README.md +79 -79
  914. package/packages/qr-code/src/QRCode.tsx +39 -39
  915. package/packages/qr-code/src/index.ts +2 -2
  916. package/packages/qr-code/src/qrGenerator/__external__/constants.ts +23 -23
  917. package/packages/qr-code/src/qrGenerator/__external__/qrcode.d.ts +31 -31
  918. package/packages/qr-code/src/qrGenerator/__external__/qrcode.js +618 -618
  919. package/packages/qr-code/src/qrGenerator/generateQr.ts +7 -7
  920. package/packages/qr-code/src/qrGenerator/index.ts +3 -3
  921. package/packages/router/README.md +163 -163
  922. package/packages/router/src/Route.tsx +166 -166
  923. package/packages/router/src/Router.tsx +220 -220
  924. package/packages/router/src/focusActiveRoute.ts +5 -5
  925. package/packages/router/src/history.ts +31 -31
  926. package/packages/router/src/index.ts +6 -6
  927. package/packages/router/src/types.ts +13 -13
  928. package/packages/router/src/utils.ts +37 -37
  929. package/packages/runtime-config/README.md +37 -37
  930. package/packages/runtime-config/src/Config.ts +44 -44
  931. package/packages/runtime-config/src/index.ts +1 -1
  932. package/packages/sass-utils/README.md +197 -197
  933. package/packages/sass-utils/src/box-shadow.scss +5 -5
  934. package/packages/sass-utils/src/ellipsis.scss +15 -15
  935. package/packages/sass-utils/src/linear-gradient.scss +48 -48
  936. package/packages/sass-utils/src/prefix-property.scss +7 -7
  937. package/packages/sass-utils/src/prefix-value.scss +6 -6
  938. package/packages/sass-utils/src/prefix.scss +6 -6
  939. package/packages/sass-utils/src/scale.1080.scss +5 -5
  940. package/packages/sass-utils/src/scale.720.scss +5 -5
  941. package/packages/sass-utils/src/transform.scss +5 -5
  942. package/packages/sass-utils/src/transition.scss +6 -6
  943. package/packages/scheduler/README.md +55 -55
  944. package/packages/scheduler/src/Scheduler.ts +43 -43
  945. package/packages/scheduler/src/Task.ts +72 -72
  946. package/packages/scheduler/src/index.ts +4 -4
  947. package/packages/scheduler/src/timeProvider.ts +3 -3
  948. package/packages/scroll-text/README.md +77 -77
  949. package/packages/scroll-text/src/Base.tsx +146 -146
  950. package/packages/scroll-text/src/ScrollText.animated.tsx +80 -80
  951. package/packages/scroll-text/src/ScrollText.tsx +53 -53
  952. package/packages/scroll-text/src/ScrollTextBaseClass.tsx +86 -86
  953. package/packages/scroll-text/src/index.ts +1 -1
  954. package/packages/scroller/README.md +77 -77
  955. package/packages/scroller/src/Scroller.tsx +51 -51
  956. package/packages/scroller/src/index.ts +1 -1
  957. package/packages/splash/AnimatedSplash.ts +1 -1
  958. package/packages/splash/AnimatedSplashAnimated.ts +1 -1
  959. package/packages/splash/AnimatedSplashBasic.ts +1 -1
  960. package/packages/splash/AutomaticSplashAnimated.ts +1 -1
  961. package/packages/splash/AutomaticSplashBasic.ts +1 -1
  962. package/packages/splash/README.md +93 -93
  963. package/packages/splash/StaticSplash.ts +1 -1
  964. package/packages/splash/StaticSplashAnimated.ts +1 -1
  965. package/packages/splash/StaticSplashBasic.ts +1 -1
  966. package/packages/splash/src/AnimatedSplash.animated.tsx +78 -78
  967. package/packages/splash/src/AnimatedSplash.basic.tsx +37 -37
  968. package/packages/splash/src/AutomaticSplash.animated.tsx +20 -20
  969. package/packages/splash/src/AutomaticSplash.basic.tsx +20 -20
  970. package/packages/splash/src/Splash.scss +8 -8
  971. package/packages/splash/src/StaticSplash.animated.tsx +48 -48
  972. package/packages/splash/src/StaticSplash.basic.tsx +26 -26
  973. package/packages/splash/src/index.animated.ts +1 -1
  974. package/packages/splash/src/index.ts +1 -1
  975. package/packages/splash/src/styles.ts +1 -1
  976. package/packages/splash/src/types.ts +20 -20
  977. package/packages/storage/README.md +61 -61
  978. package/packages/storage/src/CookieStorage/CookieStorage.ts +57 -57
  979. package/packages/storage/src/CookieStorage/index.ts +1 -1
  980. package/packages/storage/src/LocalStorage/LocalStorage.ts +58 -58
  981. package/packages/storage/src/LocalStorage/index.ts +1 -1
  982. package/packages/storage/src/index.ts +2 -2
  983. package/packages/storage/src/shared.ts +41 -41
  984. package/packages/storage/src/types.ts +33 -33
  985. package/packages/throbber/README.md +53 -53
  986. package/packages/throbber/src/Throbber.scss +52 -52
  987. package/packages/throbber/src/Throbber.tsx +19 -19
  988. package/packages/throbber/src/ThrobberService.tsx +55 -55
  989. package/packages/throbber/src/controlsHandling.ts +14 -14
  990. package/packages/throbber/src/index.ts +2 -2
  991. package/packages/time/README.md +116 -116
  992. package/packages/time/src/Time.ts +267 -267
  993. package/packages/time/src/adapters/24iMediaTimeApi.ts +47 -47
  994. package/packages/time/src/adapters/worldTimeApi.ts +74 -74
  995. package/packages/time/src/constants.ts +14 -14
  996. package/packages/time/src/index.ts +1 -1
  997. package/packages/time/src/services/24iMediaTimeApi/24iMediaTimeApi.ts +43 -43
  998. package/packages/time/src/services/24iMediaTimeApi/index.ts +6 -6
  999. package/packages/time/src/services/worldTimeApi/index.ts +7 -7
  1000. package/packages/time/src/services/worldTimeApi/types.ts +75 -75
  1001. package/packages/time/src/services/worldTimeApi/worldTimeApi.ts +77 -77
  1002. package/packages/time/src/types.ts +39 -39
  1003. package/packages/time/src/utils.ts +79 -79
  1004. package/packages/toast/README.md +116 -116
  1005. package/packages/toast/src/Toast/IVisualController.ts +7 -7
  1006. package/packages/toast/src/Toast/Toast.scss +22 -22
  1007. package/packages/toast/src/Toast/Toast.styles.1080.scss +2 -2
  1008. package/packages/toast/src/Toast/Toast.styles.scss +2 -2
  1009. package/packages/toast/src/Toast/Toast.tsx +83 -83
  1010. package/packages/toast/src/Toast/VisualController.animated.ts +20 -20
  1011. package/packages/toast/src/Toast/VisualController.ts +9 -9
  1012. package/packages/toast/src/Toast/_sizes.1080.scss +8 -8
  1013. package/packages/toast/src/Toast/_sizes.scss +8 -8
  1014. package/packages/toast/src/Toast/index.ts +2 -2
  1015. package/packages/toast/src/Toast/styles.ts +1 -1
  1016. package/packages/toast/src/ToastService.scss +8 -8
  1017. package/packages/toast/src/ToastService.styles.1080.scss +2 -2
  1018. package/packages/toast/src/ToastService.styles.scss +2 -2
  1019. package/packages/toast/src/ToastService.tsx +59 -59
  1020. package/packages/toast/src/_sizes.1080.scss +2 -2
  1021. package/packages/toast/src/_sizes.scss +2 -2
  1022. package/packages/toast/src/index.ts +4 -4
  1023. package/packages/toast/src/types.ts +4 -4
  1024. package/packages/types-bigscreen-jsx/README.md +12 -12
  1025. package/packages/types-bigscreen-jsx/global.d.ts +0 -0
  1026. package/packages/types-bigscreen-jsx/index.d.ts +32 -32
  1027. package/packages/types-bigscreen-jsx/src/copyTypes.js +14 -14
  1028. package/packages/utils/README.md +363 -363
  1029. package/packages/utils/src/addClass.ts +9 -9
  1030. package/packages/utils/src/counter.ts +49 -49
  1031. package/packages/utils/src/debounce.ts +54 -54
  1032. package/packages/utils/src/displayToggler.scss +3 -3
  1033. package/packages/utils/src/displayToggler.ts +38 -38
  1034. package/packages/utils/src/elementUtils.ts +105 -105
  1035. package/packages/utils/src/forceReflow.ts +14 -14
  1036. package/packages/utils/src/generateUuid.ts +19 -19
  1037. package/packages/utils/src/index.ts +43 -43
  1038. package/packages/utils/src/keyPress/index.ts +6 -6
  1039. package/packages/utils/src/keyPress/keyPressSimulator.ts +74 -74
  1040. package/packages/utils/src/keyPress/simulateKeyPress.ts +25 -25
  1041. package/packages/utils/src/memoryInfo.ts +21 -21
  1042. package/packages/utils/src/nTimes.ts +9 -9
  1043. package/packages/utils/src/noop.ts +1 -1
  1044. package/packages/utils/src/offsetPosition.ts +56 -56
  1045. package/packages/utils/src/removeClass.ts +9 -9
  1046. package/packages/utils/src/scaledImage.ts +24 -24
  1047. package/packages/utils/src/sizes.1080.ts +1 -1
  1048. package/packages/utils/src/sizes.ts +1 -1
  1049. package/packages/utils/src/stopEvent.ts +10 -10
  1050. package/packages/utils/src/textUtils.ts +57 -57
  1051. package/packages/utils/src/timeConstants.ts +11 -11
  1052. package/packages/utils/src/timers/createInterval.ts +19 -19
  1053. package/packages/utils/src/timers/createTimeout.ts +22 -22
  1054. package/packages/utils/src/timers/index.ts +4 -4
  1055. package/packages/utils/src/timers/runAsync.ts +3 -3
  1056. package/packages/utils/src/timers/types.ts +9 -9
  1057. package/packages/utils/src/wait.ts +3 -3
  1058. package/packages/utils/src/xhr/__mocks__/xhr.ts +29 -29
  1059. package/packages/utils/src/xhr/index.ts +11 -11
  1060. package/packages/utils/src/xhr/xhrSend.ts +141 -141
  1061. package/packages/utils/src/xhr/xhrSendRetry.ts +79 -79
  1062. package/packages/volume-control/README.md +79 -79
  1063. package/packages/volume-control/src/IVolumeControlUI.ts +26 -26
  1064. package/packages/volume-control/src/VolumeControlService.tsx +110 -110
  1065. package/packages/volume-control/src/VolumeControlUI/VisualController.animated.ts +28 -28
  1066. package/packages/volume-control/src/VolumeControlUI/VisualController.ts +3 -3
  1067. package/packages/volume-control/src/VolumeControlUI/VisualControllerBase.ts +26 -26
  1068. package/packages/volume-control/src/VolumeControlUI/VolumeControl.scss +18 -18
  1069. package/packages/volume-control/src/VolumeControlUI/VolumeControl.styles.animated.scss +2 -2
  1070. package/packages/volume-control/src/VolumeControlUI/VolumeControl.styles.scss +1 -1
  1071. package/packages/volume-control/src/VolumeControlUI/VolumeControlUI.tsx +80 -80
  1072. package/packages/volume-control/src/VolumeControlUI/_animated.scss +8 -8
  1073. package/packages/volume-control/src/VolumeControlUI/index.ts +1 -1
  1074. package/packages/volume-control/src/__mocks__/VolumeControlUIMock.tsx +22 -22
  1075. package/packages/volume-control/src/index.ts +2 -2
  1076. package/packages/zapping/README.md +87 -87
  1077. package/packages/zapping/src/ChannelZapping.ts +143 -143
  1078. package/packages/zapping/src/Zapping.tsx +115 -115
  1079. package/packages/zapping/src/index.ts +1 -1
  1080. package/packages/zapping/src/interface.ts +1 -1
  1081. package/utils/create-export-maps/index.ts +3 -3
  1082. package/utils/create-export-maps/src/__tests__/createExportMaps.spec.ts +50 -50
  1083. package/utils/create-export-maps/src/createExportMaps.ts +61 -61
  1084. package/utils/create-package/README.md +39 -39
  1085. package/utils/create-package/src/createPackage.ts +72 -72
  1086. package/utils/create-package/src/index.ts +3 -3
  1087. package/utils/create-package/src/questionnaire/questions.ts +19 -19
  1088. package/utils/create-package/src/settings/Settings.ts +5 -5
  1089. package/utils/create-package/src/types.ts +4 -4
  1090. package/utils/create-package/templates/typescript/README.md +8 -8
  1091. package/utils/create-package/templates/typescript/exports.json +6 -6
  1092. package/utils/release/release.ts +156 -156
  1093. package/utils/run-scripts/index.ts +3 -3
  1094. package/utils/run-scripts/src/__tests__/runScripts.spec.ts +45 -45
  1095. package/utils/run-scripts/src/runScripts.ts +20 -20
@@ -1,460 +1,460 @@
1
- ---
2
- id: README
3
- title: i18n
4
- hide_title: true
5
- sidebar_label: i18n
6
- ---
7
-
8
- # i18n
9
- Internationalization for SmartApps BIGscreens is written with i18n used on SmartApps in mind.
10
- This means that it can use the same resources as their SmartApps counterparts.
11
- References:
12
- - [i18next](https://www.i18next.com/translation-function/essentials)
13
- - [smartapps i18n](https://github.com/24i/prd-nxg-sdk-ui/tree/develop/packages/sdk%40quarks/src/i18n)
14
-
15
- It is based on i18next interface (smartapps uses i18next directly under the hood). But since the i18next
16
- is a very large library and not all its features are utilized, the smartapps-bigscreen version
17
- is code and feature split for smaller bundle size and better performance.
18
-
19
- ## Usage
20
-
21
- ### Initialization
22
- ```ts
23
- import { i18n } from '@24i/bigscreen-sdk/i18n';
24
- import { en } from '../i18n/en';
25
- import { de } from '../i18n/de';
26
-
27
- const DICTIONARY = { en, de };
28
-
29
- i18n.init({
30
- resources: DICTIONARY, // i18next format of resources, optional
31
- lng: 'cs', // default language, mandatory, should be ISO 639-1 to have plurals working correctly
32
- fallbackLng: 'en', // fallback language if default not found, optional, defaults to 'en'
33
- defaultNS: 'common', // default NS in resources, optional, defaults to 'translation'
34
- keySeparator: '_', // default key separator, optional, defaults to '.'
35
- nsSeparator: '|', // default ns separator, optional, defaults to ':'
36
- });
37
- ```
38
-
39
- ### Translating
40
- ```tsx
41
- import { t } from '@24i/bigscreen-sdk/i18n';
42
-
43
- const FetchError = ({ errorCode }) => (
44
- <div className="error">
45
- {t([`errors:server.${errorCode}`, 'errors:server.unknown'])}
46
- </div>
47
- );
48
- ```
49
- `t` is a function that under the hood returns a component. It takes two parameters:
50
- - `key: string | string[]` - translation key or an array of translation keys
51
- - `options: TranslationOptions | string` - options for a single translation or a default value.
52
-
53
- When the language changes it should update the translation automatically.
54
-
55
- ### Typed translation functions
56
- If you want to have more security, you can try using typed translation functions:
57
- - `getTypedT` - for typed `t` function for use in JSX
58
- - `getTypedI18nT` - for typed `i18n.t` function for getting simple string
59
-
60
- #### Usage
61
- ```ts
62
- // For global functions
63
- import { getTypedT, getTypedI18nT } from '@24i/bigscreen-sdk/i18n';
64
- import { en } from './dictionaries/en';
65
-
66
- export const t = getTypedT<typeof en>();
67
- export const i18nT = getTypedT<typeof en>();
68
-
69
- // Namespaced in components for example
70
- import { getTypedT } from '@24i/bigscreen-sdk/i18n';
71
- import { en } from '../../i18n/dictionaries/en';
72
-
73
- const t = getTypedT<typeof en['components']['epg']>('components.epg.');
74
- ```
75
- Try it at: [https://tsplay.dev/Nd4VdN](https://tsplay.dev/Nd4VdN)
76
-
77
- ### Text direction
78
- ```tsx
79
- import { isRtl } from '@24i/bigscreen-sdk/i18n';
80
-
81
- const offset = isRtl() ? -100 : 100;
82
- ```
83
-
84
- ### Translation Key
85
- Translation key is a string in the format: `namespace:path.to.key`.
86
- - namespace - optional, overrides `defaultNS` setting, has higher priority than `ns` in options
87
- - path - optional, path in resources to find the key
88
- - key - name of the key in the path to choose the translation
89
-
90
- If no translation is found, the full-length translation key (including namespace and path) will be
91
- returned instead.
92
-
93
- If you use an array of translation keys, the first found translation will be used. If none of them is found,
94
- the last key in its full length will be returned.
95
-
96
- ### Translation Options
97
- Translation Options is an object that can change the behaviour of the translating. Supported:
98
- - `lng: string` - set language to use
99
- - `defaultValue?: string` - default value to use
100
- - `fallbackLng?: string` - override i18n fallback language
101
- - `ns?: string` - override namespace (ns in key has higher priority)
102
- - `keySeparator?: string` - change key separator
103
- - `nsSeparator?: string` - change ns separator
104
- - `middlewares?: MiddlewareSetup[]` - list of middlewares to be used with this translation
105
-
106
- ## addResourceBundle
107
- This utility allows you to dynamically add new resources. It is useful if you download resources from the API.
108
- If you want to add more languages/namespace, you will have to call `addResourceBundle` for each language/namespace.
109
- ```ts
110
- import { addResourceBundle } from '@24i/bigscreen-sdk/i18n/utils/addResourceBundle';
111
-
112
- addResourceBundle(
113
- language: string, // language of the bundle
114
- namespace: string, // namespace of the bundle
115
- resources: NamespaceResource, // dictionary of the given namespace
116
- deep: boolean = false, // If set to true will deeply add/replace current dictionary, false will overwrite it at the root level
117
- overwrite: boolean = false, // If deep set to true, this sets whether you only add (false) or also replace existing (true) translations
118
- ) => void;
119
- ```
120
-
121
- ## i18n interface
122
- - `init(options: InitOptions) => void` - see [Initialization](#Initialization)
123
- - `t(translationKey: string | string[], options?: TranslationOptions | string) => string` - translating function
124
- - `getLanguage() => string` - returns current language
125
- - `getLanguages() => string[]` - returns all languages found in resources
126
- - `setLanguage(language: string) => void` - sets the current language
127
- - `middleware(...middlewares: MiddlewareSetup[]) => void` - see [Middlewares](#Middlewares)
128
- - `addEventListener(event: 'languagechange', listener: () => void) => void` - adding a listener on language change
129
- - `removeEventListener(event: 'languagechange', listener: () => void) => void` - removing a listener on language change
130
- - `getResources() => Resources` - returns a complete dictionary currently in use
131
- - `setResources(resources: Resources) => void` - sets complete dictionary (equivalent of resources field in init)
132
- - `dir(language: string = currentLanguage) => 'ltr' | 'rtl'` - returns direction of the language
133
-
134
- ## Middlewares
135
- There are two types of middlewares supported. One are more legacy compatible with i18next translation formats.
136
- I18next was the utility and format that got used in early days of NextGen (former name for SmartApps).
137
- Nowadays the translation format has been changed to Unicode ICU and unified across all platforms.
138
- If you start new project, it is recommended to use ICU format to make it compatible with other platforms more
139
- easily.
140
-
141
- ## Middlewares - ICU
142
- All the middlewares you need for your project need to be enabled together with init or during the translation.
143
- They are separated to reduce the size of the bundle and to increase the performance.
144
-
145
- They all come with a performance hit:
146
- - *Interpolation* - <b style="color: #fb0;">MEDIUM</b>
147
- - *DateInterpolation* - <b style="color: #f60;">MEDIUM-HIGH</b>
148
- - *TimeInterpolation* - <b style="color: #f60;">MEDIUM-HIGH</b>
149
- - *NumberInterpolation* - <b style="color: #f60;">MEDIUM-HIGH</b>
150
- - *Plurals* - <b style="color: #f00;">HIGH</b>
151
- - *Select* - <b style="color: #f00;">HIGH</b>
152
-
153
- ```tsx
154
- import { i18n } from '@24i/bigscreen-sdk/i18n';
155
- import { Interpolation } from '@24i/bigscreen-sdk/i18n/middlewares/icu/Interpolation';
156
- import { Plurals } from '@24i/bigscreen-sdk/i18n/middlewares/icu/Plurals';
157
- import { Select } from '@24i/bigscreen-sdk/i18n/middlewares/icu/Select';
158
-
159
- i18n.init(/* ... */);
160
- /**
161
- * Because middlewares come with a performance impact you have two options:
162
- * 1 - Initialize them for all translations - use this when the middleware is used a lot in dictionary
163
- * 2 - Use it through translation options - use this if the middleware is needed only for a handful of keys
164
- */
165
-
166
- /**
167
- * Option 1 - the order of middlewares is not important
168
- */
169
- i18n.middleware(Interpolation, Plurals, Select);
170
-
171
- /**
172
- * Option 2 - used with t function inside JSX, the order is not important
173
- */
174
- <h1>
175
- {
176
- t('friend', {
177
- name: user.name,
178
- gender: user.gender,
179
- friendsCount: 2,
180
- middlewares: [Interpolation, Select, Plurals],
181
- })
182
- }
183
- </h1>
184
- ```
185
-
186
- ### Interpolation - ICU
187
- Interpolation allows you to pass variable into translation.
188
-
189
- #### Usage
190
- ```ts
191
- resource = { introduction: 'Hello, {name}!' };
192
- i18n.t('introduction', { name: 'Petr' }); // --> 'Hello, Petr!'
193
- ```
194
-
195
- ### DateInterpolation - ICU
196
- Allows you to format a variable date into translation.
197
-
198
- #### Options
199
- ```
200
- {nameOfKeyInOptions, date, dateFormat}
201
- ```
202
- - `nameOfKeyInOptions` - name of variable that you pass
203
- - `date` - identifier of DateInterpolation (fixed value)
204
- - `dateFormat` - one of `short`, `medium`, `long`, `full` or string from these letters (e.g. `dMy`):
205
- - - `y` - for using numeric year
206
- - - `M` - for using 2-digit month
207
- - - `L` - for using long month name
208
- - - `d` - for using 2-digit day
209
- - - `e` - for using long weekday name
210
-
211
- #### Usage
212
- ```ts
213
- resource = { today: 'Today is, {dateToDisplay, date, full}' };
214
- i18n.t('today', { dateToDisplay: new Date('2021-09-23') }); // --> 'Today is, Thursday 23 September 2021'
215
- ```
216
-
217
- ### TimeInterpolation - ICU
218
- Allows you to format a variable time into translation.
219
-
220
- #### Options
221
- ```
222
- {nameOfKeyInOptions, time, timeFormat}
223
- ```
224
- - `nameOfKeyInOptions` - name of variable that you pass
225
- - `time` - identifier of TimeInterpolation (fixed value)
226
- - `timeFormat` - one of `short`, `medium`, `long`, `full` or string from these letters (e.g. `hm`):
227
- - - `h` - for using numeric hour
228
- - - `H` - for using 2-digit hour
229
- - - `k` - for using numeric hour
230
- - - `K` - for using 2-digit hour
231
- - - `m` - for using 2-digit minute
232
- - - `s` - for using 2-digit second
233
-
234
- #### Usage
235
- ```ts
236
- resource = { now: 'Now is, {timeToDisplay, time, short}' };
237
- i18n.t('now', { timeToDisplay: new Date('2021-09-23T09:45') }); // --> 'Now is, 9:45'
238
- ```
239
-
240
- ### NumberInterpolation - ICU
241
- Allows you to format a variable number into translation.
242
-
243
- <b style="color: #f00;">!IMPORTANT!</b> Formatting is not yet supported. If you need support, please,
244
- implement it in l10n package.
245
- It is better to use basic Interpolation instead as it might be faster. This is kept for minimal compatibility.
246
-
247
- #### Options
248
- ```
249
- {myNumber, number, ::formatting-options}
250
- ```
251
- - `myNumber` - name of variable that you pass
252
- - `number` - identifier of NumberInterpolation (fixed value)
253
- - `format` - refer to [ICU spec](https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html)
254
-
255
- #### Usage
256
- Limited to just number passing without any format.
257
- ```ts
258
- resource = { moneyTotal: 'In total, you need to pay {sum, number, ::currency/USD}.' };
259
- i18n.t('moneyTotal', { sum: 99 }); // --> 'In total, you need to pay 99.'
260
- ```
261
-
262
- ### Plurals - ICU
263
- Plurals make it possible to support different translations based on the count.
264
-
265
- #### Options
266
- ```
267
- {count, plural, offset:1, =0 {Nothing} few {Few things} other {# things}}
268
- ```
269
- - `count` - name of variable you pass
270
- - `plural` - identifier of Plurals (fixed value)
271
- - `offset:1` - optional offset for worded amount and `#` replacement
272
- - cases in format `count {translation}`
273
- - - `=0` - or any other number for concrete amount
274
- - - `zero` - for languages that have special grammar for zero
275
- - - `one` - for languages that have special grammar for one
276
- - - `two` - for languages that have special grammar for two
277
- - - `few` - for languages that have special grammar for few items (e.g. czech for 2-4)
278
- - - `many` - for languages that have special grammar for many items
279
- - - `other` - required value for other cases
280
-
281
- #### Usage
282
- ```ts
283
- resource = {
284
- simple: 'I have {numCats, plural, =0 {no cat} =1 {a cat} other {# cats}}.',
285
- complex: 'I invited {count, plural, offset:1, =0 {no one} =1 {{name}} =2 {{name} and someone else} other {{name} and # more people}}.',
286
- };
287
- i18n.t('simple', { numCats: 4 }); // --> I have 4 cats.
288
- i18n.t('complex', { count: 5, name: 'Lucy' }); // --> I invited Lucy and 4 more people.
289
- ```
290
-
291
- ### Select - ICU
292
- Select makes it possible to provide different translations based on variable (e.g. gender).
293
-
294
- #### Options
295
- ```
296
- {variableName, select, case1 {translation1} case2 {translation2} other {translation3}}
297
- ```
298
- - `variableName` - name of variable you pass
299
- - `select` - identifier of Select (fixed value)
300
- - cases in format `caseName {translation}` - `other` is required
301
-
302
- #### Usage
303
- ```ts
304
- resource = { arrived: '{gender, select, male {He} female {She} other {They}} arrived.' };
305
- i18n.t('arrived', { gender: 'female' }); // --> She arrived.
306
- ```
307
-
308
- ### ICU - Complex examples
309
- Translation needs to be written in top-down: 'Select', 'Plurals', 'Interpolations'.
310
- ```ts
311
- const resource = {
312
- example: [
313
- '{gender_of_host, select, ',
314
- 'female {',
315
- '{num_guests, plural, offset:1, ',
316
- '=0 {{host} does not give a party.}',
317
- '=1 {{host} invites {guest} to her party.}',
318
- '=2 {{host} invites {guest} and one other person to her party.}',
319
- 'other {{host} invites {guest} and # other people to her party.}}}',
320
- 'male {',
321
- '{num_guests, plural, offset:1, ',
322
- '=0 {{host} does not give a party.}',
323
- '=1 {{host} invites {guest} to his party.}',
324
- '=2 {{host} invites {guest} and one other person to his party.}',
325
- 'other {{host} invites {guest} and # other people to his party.}}}',
326
- 'other {',
327
- '{num_guests, plural, offset:1, ',
328
- '=0 {{host} does not give a party.}',
329
- '=1 {{host} invites {guest} to their party.}',
330
- '=2 {{host} invites {guest} and one other person to their party.}',
331
- 'other {{host} invites {guest} and # other people to their party.}}}}',
332
- ].join(''),
333
- };
334
- i18n.t('example', { gender_of_host: 'robot', host: 'Bastion', num_guests: 5, guest: 'Reinhardt' });
335
- // --> Bastion invites Reinhardt and 4 other people to their party.
336
- ```
337
-
338
- ## Middlewares - i18next
339
- All the middlewares you need for your project need to enabled together with init or during the translation.
340
- They are separated to reduce the size of the bundle and to increase the performance.
341
-
342
- They all come with a performance hit:
343
- - *Interpolation* - <b style="color: #f80;">MEDIUM</b>
344
- - *Plurals* - <b style="color: #f00;">HIGH</b>
345
- - *Nesting* - <b style="color: #ff0;">LOW-MEDIUM</b> for simple keys, but higher if combined with interpolation or plurals
346
- - *Context* - <b style="color: #0f0;">LOW</b> for simple keys, but higher if combined with interpolation or plurals
347
-
348
- ```tsx
349
- import { i18n } from '@24i/bigscreen-sdk/i18n';
350
- import { Interpolation } from '@24i/bigscreen-sdk/i18n/middlewares/i18next/Interpolation';
351
- import { Plurals } from '@24i/bigscreen-sdk/i18n/middlewares/i18next/Plurals';
352
- import { Nesting } from '@24i/bigscreen-sdk/i18n/middlewares/i18next/Nesting';
353
- import { Context } from '@24i/bigscreen-sdk/i18n/middlewares/i18next/Context';
354
-
355
- i18n.init(/* ... */);
356
- /**
357
- * Because middlewares come with a performance impact you have two options:
358
- * 1 - Initialize them for all translations - use this when the middleware is used a lot in dictionary
359
- * 2 - Use it through translation options - use this if the middleware is needed only for a handful of keys
360
- */
361
-
362
- /**
363
- * Option 1 - the order of middlewares is not important
364
- */
365
- i18n.middleware(Interpolation, Plurals, Nesting, Context);
366
-
367
- /**
368
- * Option 2 - used with t function inside JSX, the order is not important
369
- */
370
- <h1>{t('friend', { context: friend.gender, middlewares: [Interpolation, Context, Plurals] })}</h1>
371
- ```
372
-
373
- ### Interpolation - i18next
374
- Interpolation allows you to replace parts of the translation.
375
- #### Options
376
- - `format(value: any, valueFormat: string) => string` - optional, formats the value before replacement
377
- - `formatSeparator: string` - optional, sets the separator char(s), defaults to `,`
378
- - `prefix: string` - optional, sets custom prefix to separate values for interpolation, defaults to `{{`
379
- - `suffix: string` - optional, sets custom suffix to separate values for interpolation, defaults to `}}`
380
- #### Usage
381
- ```ts
382
- // simple
383
- resource = { introduction: 'Hello, {{name}}!' };
384
- i18n.t('introduction', { name: 'Petr' }); // --> 'Hello, Petr!'
385
-
386
- // from object
387
- resource = { introduction: 'Hello, {{user.names.first}}!' };
388
- i18n.t('introduction', { user: { names: { first: 'Petr' } } }); // --> 'Hello, Petr!'
389
-
390
- // format
391
- resource = { shout: '{{topic, lowercase}}! {{topic}}!! {{topic, uppercase}}!!!' };
392
- i18n.t('shout', { topic: 'SmartApps', interpolation: { format: (value: string, format: string) => {
393
- if (format === 'uppercase') return value.toUpperCase();
394
- if (format === 'lowercase') return value.toLowerCase();
395
- return value;
396
- } } }); // --> 'smartapps! SmartApps!! SMARTAPPS!!!'
397
- ```
398
-
399
- ### Plurals - i18next
400
- Plurals allows you to automatically choose correct translation based on the `count` option.
401
- It supports basic plurals (`[[key]]_plural`), form plurals (`[[key]]_1`) and intervals.
402
- Form plurals are supported for all languages.
403
- See [http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html?id=l10n/pluralforms](http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html?id=l10n/pluralforms)
404
- for the rules and forms for each language.
405
- #### Usage
406
- ```ts
407
- // basic
408
- resource = {
409
- item: 'Item',
410
- item_plural: 'Items',
411
- };
412
- i18n.t('item'); // --> 'Item'
413
- i18n.t('item', { count: 1 }); // --> 'Item'
414
- i18n.t('item', { count: 2 }); // --> 'Items'
415
-
416
- // form
417
- resource = { // CS
418
- 'item': 'Polozka',
419
- 'item_1': 'Polozky',
420
- 'item_2': 'Polozek',
421
- };
422
- i18n.t('item'); // --> 'Polozka'
423
- i18n.t('item', { count: 3 }); // --> 'Polozky'
424
- i18n.t('item', { count: 5 }); // --> 'Polozek'
425
- i18n.t('item', { count: 0 }); // --> 'Polozek'
426
-
427
- // interval
428
- resource = {
429
- 'item': 'Item',
430
- 'item_interval': '(1){One item};(2-5){Two to five items};(6-inf){More than 5 items};';
431
- };
432
- i18n.t('item'); // --> 'Item'
433
- i18n.t('item', { count: 1 }); // --> 'One item'
434
- i18n.t('item', { count: 3 }); // --> 'Two to five items'
435
- i18n.t('item', { count: 8 }); // --> 'More than 5 items'
436
- ```
437
-
438
- ### Nesting - i18next
439
- Nesting allows you to place a translation key into a translation value and have it translated.
440
- #### Usage
441
- ```ts
442
- resource = {
443
- welcome: 'Welcome, {{name}}!',
444
- introduction: '$t(welcome) I am your i18n module',
445
- };
446
- i18n.t('introduction', { name: 'Radim' }); // --> 'Welcome, Radim! I am your i18n module.'
447
- ```
448
-
449
- ### Context - i18next
450
- Context middleware allows you to have one translation in multiple contexts. Useful for gender for example.
451
- ```ts
452
- resource = {
453
- friend: 'A friend',
454
- friend_male: 'A boyfriend',
455
- friend_female: 'A girlfriend',
456
- };
457
- i18n.t('friend'); // --> 'A friend'
458
- i18n.t('friend', { context: 'male' }); // --> 'A boyfriend'
459
- i18n.t('friend', { context: 'female' }); // --> 'A girlfriend'
460
- ```
1
+ ---
2
+ id: README
3
+ title: i18n
4
+ hide_title: true
5
+ sidebar_label: i18n
6
+ ---
7
+
8
+ # i18n
9
+ Internationalization for SmartApps BIGscreens is written with i18n used on SmartApps in mind.
10
+ This means that it can use the same resources as their SmartApps counterparts.
11
+ References:
12
+ - [i18next](https://www.i18next.com/translation-function/essentials)
13
+ - [smartapps i18n](https://github.com/24i/prd-nxg-sdk-ui/tree/develop/packages/sdk%40quarks/src/i18n)
14
+
15
+ It is based on i18next interface (smartapps uses i18next directly under the hood). But since the i18next
16
+ is a very large library and not all its features are utilized, the smartapps-bigscreen version
17
+ is code and feature split for smaller bundle size and better performance.
18
+
19
+ ## Usage
20
+
21
+ ### Initialization
22
+ ```ts
23
+ import { i18n } from '@24i/bigscreen-sdk/i18n';
24
+ import { en } from '../i18n/en';
25
+ import { de } from '../i18n/de';
26
+
27
+ const DICTIONARY = { en, de };
28
+
29
+ i18n.init({
30
+ resources: DICTIONARY, // i18next format of resources, optional
31
+ lng: 'cs', // default language, mandatory, should be ISO 639-1 to have plurals working correctly
32
+ fallbackLng: 'en', // fallback language if default not found, optional, defaults to 'en'
33
+ defaultNS: 'common', // default NS in resources, optional, defaults to 'translation'
34
+ keySeparator: '_', // default key separator, optional, defaults to '.'
35
+ nsSeparator: '|', // default ns separator, optional, defaults to ':'
36
+ });
37
+ ```
38
+
39
+ ### Translating
40
+ ```tsx
41
+ import { t } from '@24i/bigscreen-sdk/i18n';
42
+
43
+ const FetchError = ({ errorCode }) => (
44
+ <div className="error">
45
+ {t([`errors:server.${errorCode}`, 'errors:server.unknown'])}
46
+ </div>
47
+ );
48
+ ```
49
+ `t` is a function that under the hood returns a component. It takes two parameters:
50
+ - `key: string | string[]` - translation key or an array of translation keys
51
+ - `options: TranslationOptions | string` - options for a single translation or a default value.
52
+
53
+ When the language changes it should update the translation automatically.
54
+
55
+ ### Typed translation functions
56
+ If you want to have more security, you can try using typed translation functions:
57
+ - `getTypedT` - for typed `t` function for use in JSX
58
+ - `getTypedI18nT` - for typed `i18n.t` function for getting simple string
59
+
60
+ #### Usage
61
+ ```ts
62
+ // For global functions
63
+ import { getTypedT, getTypedI18nT } from '@24i/bigscreen-sdk/i18n';
64
+ import { en } from './dictionaries/en';
65
+
66
+ export const t = getTypedT<typeof en>();
67
+ export const i18nT = getTypedT<typeof en>();
68
+
69
+ // Namespaced in components for example
70
+ import { getTypedT } from '@24i/bigscreen-sdk/i18n';
71
+ import { en } from '../../i18n/dictionaries/en';
72
+
73
+ const t = getTypedT<typeof en['components']['epg']>('components.epg.');
74
+ ```
75
+ Try it at: [https://tsplay.dev/Nd4VdN](https://tsplay.dev/Nd4VdN)
76
+
77
+ ### Text direction
78
+ ```tsx
79
+ import { isRtl } from '@24i/bigscreen-sdk/i18n';
80
+
81
+ const offset = isRtl() ? -100 : 100;
82
+ ```
83
+
84
+ ### Translation Key
85
+ Translation key is a string in the format: `namespace:path.to.key`.
86
+ - namespace - optional, overrides `defaultNS` setting, has higher priority than `ns` in options
87
+ - path - optional, path in resources to find the key
88
+ - key - name of the key in the path to choose the translation
89
+
90
+ If no translation is found, the full-length translation key (including namespace and path) will be
91
+ returned instead.
92
+
93
+ If you use an array of translation keys, the first found translation will be used. If none of them is found,
94
+ the last key in its full length will be returned.
95
+
96
+ ### Translation Options
97
+ Translation Options is an object that can change the behaviour of the translating. Supported:
98
+ - `lng: string` - set language to use
99
+ - `defaultValue?: string` - default value to use
100
+ - `fallbackLng?: string` - override i18n fallback language
101
+ - `ns?: string` - override namespace (ns in key has higher priority)
102
+ - `keySeparator?: string` - change key separator
103
+ - `nsSeparator?: string` - change ns separator
104
+ - `middlewares?: MiddlewareSetup[]` - list of middlewares to be used with this translation
105
+
106
+ ## addResourceBundle
107
+ This utility allows you to dynamically add new resources. It is useful if you download resources from the API.
108
+ If you want to add more languages/namespace, you will have to call `addResourceBundle` for each language/namespace.
109
+ ```ts
110
+ import { addResourceBundle } from '@24i/bigscreen-sdk/i18n/utils/addResourceBundle';
111
+
112
+ addResourceBundle(
113
+ language: string, // language of the bundle
114
+ namespace: string, // namespace of the bundle
115
+ resources: NamespaceResource, // dictionary of the given namespace
116
+ deep: boolean = false, // If set to true will deeply add/replace current dictionary, false will overwrite it at the root level
117
+ overwrite: boolean = false, // If deep set to true, this sets whether you only add (false) or also replace existing (true) translations
118
+ ) => void;
119
+ ```
120
+
121
+ ## i18n interface
122
+ - `init(options: InitOptions) => void` - see [Initialization](#Initialization)
123
+ - `t(translationKey: string | string[], options?: TranslationOptions | string) => string` - translating function
124
+ - `getLanguage() => string` - returns current language
125
+ - `getLanguages() => string[]` - returns all languages found in resources
126
+ - `setLanguage(language: string) => void` - sets the current language
127
+ - `middleware(...middlewares: MiddlewareSetup[]) => void` - see [Middlewares](#Middlewares)
128
+ - `addEventListener(event: 'languagechange', listener: () => void) => void` - adding a listener on language change
129
+ - `removeEventListener(event: 'languagechange', listener: () => void) => void` - removing a listener on language change
130
+ - `getResources() => Resources` - returns a complete dictionary currently in use
131
+ - `setResources(resources: Resources) => void` - sets complete dictionary (equivalent of resources field in init)
132
+ - `dir(language: string = currentLanguage) => 'ltr' | 'rtl'` - returns direction of the language
133
+
134
+ ## Middlewares
135
+ There are two types of middlewares supported. One are more legacy compatible with i18next translation formats.
136
+ I18next was the utility and format that got used in early days of NextGen (former name for SmartApps).
137
+ Nowadays the translation format has been changed to Unicode ICU and unified across all platforms.
138
+ If you start new project, it is recommended to use ICU format to make it compatible with other platforms more
139
+ easily.
140
+
141
+ ## Middlewares - ICU
142
+ All the middlewares you need for your project need to be enabled together with init or during the translation.
143
+ They are separated to reduce the size of the bundle and to increase the performance.
144
+
145
+ They all come with a performance hit:
146
+ - *Interpolation* - <b style="color: #fb0;">MEDIUM</b>
147
+ - *DateInterpolation* - <b style="color: #f60;">MEDIUM-HIGH</b>
148
+ - *TimeInterpolation* - <b style="color: #f60;">MEDIUM-HIGH</b>
149
+ - *NumberInterpolation* - <b style="color: #f60;">MEDIUM-HIGH</b>
150
+ - *Plurals* - <b style="color: #f00;">HIGH</b>
151
+ - *Select* - <b style="color: #f00;">HIGH</b>
152
+
153
+ ```tsx
154
+ import { i18n } from '@24i/bigscreen-sdk/i18n';
155
+ import { Interpolation } from '@24i/bigscreen-sdk/i18n/middlewares/icu/Interpolation';
156
+ import { Plurals } from '@24i/bigscreen-sdk/i18n/middlewares/icu/Plurals';
157
+ import { Select } from '@24i/bigscreen-sdk/i18n/middlewares/icu/Select';
158
+
159
+ i18n.init(/* ... */);
160
+ /**
161
+ * Because middlewares come with a performance impact you have two options:
162
+ * 1 - Initialize them for all translations - use this when the middleware is used a lot in dictionary
163
+ * 2 - Use it through translation options - use this if the middleware is needed only for a handful of keys
164
+ */
165
+
166
+ /**
167
+ * Option 1 - the order of middlewares is not important
168
+ */
169
+ i18n.middleware(Interpolation, Plurals, Select);
170
+
171
+ /**
172
+ * Option 2 - used with t function inside JSX, the order is not important
173
+ */
174
+ <h1>
175
+ {
176
+ t('friend', {
177
+ name: user.name,
178
+ gender: user.gender,
179
+ friendsCount: 2,
180
+ middlewares: [Interpolation, Select, Plurals],
181
+ })
182
+ }
183
+ </h1>
184
+ ```
185
+
186
+ ### Interpolation - ICU
187
+ Interpolation allows you to pass variable into translation.
188
+
189
+ #### Usage
190
+ ```ts
191
+ resource = { introduction: 'Hello, {name}!' };
192
+ i18n.t('introduction', { name: 'Petr' }); // --> 'Hello, Petr!'
193
+ ```
194
+
195
+ ### DateInterpolation - ICU
196
+ Allows you to format a variable date into translation.
197
+
198
+ #### Options
199
+ ```
200
+ {nameOfKeyInOptions, date, dateFormat}
201
+ ```
202
+ - `nameOfKeyInOptions` - name of variable that you pass
203
+ - `date` - identifier of DateInterpolation (fixed value)
204
+ - `dateFormat` - one of `short`, `medium`, `long`, `full` or string from these letters (e.g. `dMy`):
205
+ - - `y` - for using numeric year
206
+ - - `M` - for using 2-digit month
207
+ - - `L` - for using long month name
208
+ - - `d` - for using 2-digit day
209
+ - - `e` - for using long weekday name
210
+
211
+ #### Usage
212
+ ```ts
213
+ resource = { today: 'Today is, {dateToDisplay, date, full}' };
214
+ i18n.t('today', { dateToDisplay: new Date('2021-09-23') }); // --> 'Today is, Thursday 23 September 2021'
215
+ ```
216
+
217
+ ### TimeInterpolation - ICU
218
+ Allows you to format a variable time into translation.
219
+
220
+ #### Options
221
+ ```
222
+ {nameOfKeyInOptions, time, timeFormat}
223
+ ```
224
+ - `nameOfKeyInOptions` - name of variable that you pass
225
+ - `time` - identifier of TimeInterpolation (fixed value)
226
+ - `timeFormat` - one of `short`, `medium`, `long`, `full` or string from these letters (e.g. `hm`):
227
+ - - `h` - for using numeric hour
228
+ - - `H` - for using 2-digit hour
229
+ - - `k` - for using numeric hour
230
+ - - `K` - for using 2-digit hour
231
+ - - `m` - for using 2-digit minute
232
+ - - `s` - for using 2-digit second
233
+
234
+ #### Usage
235
+ ```ts
236
+ resource = { now: 'Now is, {timeToDisplay, time, short}' };
237
+ i18n.t('now', { timeToDisplay: new Date('2021-09-23T09:45') }); // --> 'Now is, 9:45'
238
+ ```
239
+
240
+ ### NumberInterpolation - ICU
241
+ Allows you to format a variable number into translation.
242
+
243
+ <b style="color: #f00;">!IMPORTANT!</b> Formatting is not yet supported. If you need support, please,
244
+ implement it in l10n package.
245
+ It is better to use basic Interpolation instead as it might be faster. This is kept for minimal compatibility.
246
+
247
+ #### Options
248
+ ```
249
+ {myNumber, number, ::formatting-options}
250
+ ```
251
+ - `myNumber` - name of variable that you pass
252
+ - `number` - identifier of NumberInterpolation (fixed value)
253
+ - `format` - refer to [ICU spec](https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html)
254
+
255
+ #### Usage
256
+ Limited to just number passing without any format.
257
+ ```ts
258
+ resource = { moneyTotal: 'In total, you need to pay {sum, number, ::currency/USD}.' };
259
+ i18n.t('moneyTotal', { sum: 99 }); // --> 'In total, you need to pay 99.'
260
+ ```
261
+
262
+ ### Plurals - ICU
263
+ Plurals make it possible to support different translations based on the count.
264
+
265
+ #### Options
266
+ ```
267
+ {count, plural, offset:1, =0 {Nothing} few {Few things} other {# things}}
268
+ ```
269
+ - `count` - name of variable you pass
270
+ - `plural` - identifier of Plurals (fixed value)
271
+ - `offset:1` - optional offset for worded amount and `#` replacement
272
+ - cases in format `count {translation}`
273
+ - - `=0` - or any other number for concrete amount
274
+ - - `zero` - for languages that have special grammar for zero
275
+ - - `one` - for languages that have special grammar for one
276
+ - - `two` - for languages that have special grammar for two
277
+ - - `few` - for languages that have special grammar for few items (e.g. czech for 2-4)
278
+ - - `many` - for languages that have special grammar for many items
279
+ - - `other` - required value for other cases
280
+
281
+ #### Usage
282
+ ```ts
283
+ resource = {
284
+ simple: 'I have {numCats, plural, =0 {no cat} =1 {a cat} other {# cats}}.',
285
+ complex: 'I invited {count, plural, offset:1, =0 {no one} =1 {{name}} =2 {{name} and someone else} other {{name} and # more people}}.',
286
+ };
287
+ i18n.t('simple', { numCats: 4 }); // --> I have 4 cats.
288
+ i18n.t('complex', { count: 5, name: 'Lucy' }); // --> I invited Lucy and 4 more people.
289
+ ```
290
+
291
+ ### Select - ICU
292
+ Select makes it possible to provide different translations based on variable (e.g. gender).
293
+
294
+ #### Options
295
+ ```
296
+ {variableName, select, case1 {translation1} case2 {translation2} other {translation3}}
297
+ ```
298
+ - `variableName` - name of variable you pass
299
+ - `select` - identifier of Select (fixed value)
300
+ - cases in format `caseName {translation}` - `other` is required
301
+
302
+ #### Usage
303
+ ```ts
304
+ resource = { arrived: '{gender, select, male {He} female {She} other {They}} arrived.' };
305
+ i18n.t('arrived', { gender: 'female' }); // --> She arrived.
306
+ ```
307
+
308
+ ### ICU - Complex examples
309
+ Translation needs to be written in top-down: 'Select', 'Plurals', 'Interpolations'.
310
+ ```ts
311
+ const resource = {
312
+ example: [
313
+ '{gender_of_host, select, ',
314
+ 'female {',
315
+ '{num_guests, plural, offset:1, ',
316
+ '=0 {{host} does not give a party.}',
317
+ '=1 {{host} invites {guest} to her party.}',
318
+ '=2 {{host} invites {guest} and one other person to her party.}',
319
+ 'other {{host} invites {guest} and # other people to her party.}}}',
320
+ 'male {',
321
+ '{num_guests, plural, offset:1, ',
322
+ '=0 {{host} does not give a party.}',
323
+ '=1 {{host} invites {guest} to his party.}',
324
+ '=2 {{host} invites {guest} and one other person to his party.}',
325
+ 'other {{host} invites {guest} and # other people to his party.}}}',
326
+ 'other {',
327
+ '{num_guests, plural, offset:1, ',
328
+ '=0 {{host} does not give a party.}',
329
+ '=1 {{host} invites {guest} to their party.}',
330
+ '=2 {{host} invites {guest} and one other person to their party.}',
331
+ 'other {{host} invites {guest} and # other people to their party.}}}}',
332
+ ].join(''),
333
+ };
334
+ i18n.t('example', { gender_of_host: 'robot', host: 'Bastion', num_guests: 5, guest: 'Reinhardt' });
335
+ // --> Bastion invites Reinhardt and 4 other people to their party.
336
+ ```
337
+
338
+ ## Middlewares - i18next
339
+ All the middlewares you need for your project need to enabled together with init or during the translation.
340
+ They are separated to reduce the size of the bundle and to increase the performance.
341
+
342
+ They all come with a performance hit:
343
+ - *Interpolation* - <b style="color: #f80;">MEDIUM</b>
344
+ - *Plurals* - <b style="color: #f00;">HIGH</b>
345
+ - *Nesting* - <b style="color: #ff0;">LOW-MEDIUM</b> for simple keys, but higher if combined with interpolation or plurals
346
+ - *Context* - <b style="color: #0f0;">LOW</b> for simple keys, but higher if combined with interpolation or plurals
347
+
348
+ ```tsx
349
+ import { i18n } from '@24i/bigscreen-sdk/i18n';
350
+ import { Interpolation } from '@24i/bigscreen-sdk/i18n/middlewares/i18next/Interpolation';
351
+ import { Plurals } from '@24i/bigscreen-sdk/i18n/middlewares/i18next/Plurals';
352
+ import { Nesting } from '@24i/bigscreen-sdk/i18n/middlewares/i18next/Nesting';
353
+ import { Context } from '@24i/bigscreen-sdk/i18n/middlewares/i18next/Context';
354
+
355
+ i18n.init(/* ... */);
356
+ /**
357
+ * Because middlewares come with a performance impact you have two options:
358
+ * 1 - Initialize them for all translations - use this when the middleware is used a lot in dictionary
359
+ * 2 - Use it through translation options - use this if the middleware is needed only for a handful of keys
360
+ */
361
+
362
+ /**
363
+ * Option 1 - the order of middlewares is not important
364
+ */
365
+ i18n.middleware(Interpolation, Plurals, Nesting, Context);
366
+
367
+ /**
368
+ * Option 2 - used with t function inside JSX, the order is not important
369
+ */
370
+ <h1>{t('friend', { context: friend.gender, middlewares: [Interpolation, Context, Plurals] })}</h1>
371
+ ```
372
+
373
+ ### Interpolation - i18next
374
+ Interpolation allows you to replace parts of the translation.
375
+ #### Options
376
+ - `format(value: any, valueFormat: string) => string` - optional, formats the value before replacement
377
+ - `formatSeparator: string` - optional, sets the separator char(s), defaults to `,`
378
+ - `prefix: string` - optional, sets custom prefix to separate values for interpolation, defaults to `{{`
379
+ - `suffix: string` - optional, sets custom suffix to separate values for interpolation, defaults to `}}`
380
+ #### Usage
381
+ ```ts
382
+ // simple
383
+ resource = { introduction: 'Hello, {{name}}!' };
384
+ i18n.t('introduction', { name: 'Petr' }); // --> 'Hello, Petr!'
385
+
386
+ // from object
387
+ resource = { introduction: 'Hello, {{user.names.first}}!' };
388
+ i18n.t('introduction', { user: { names: { first: 'Petr' } } }); // --> 'Hello, Petr!'
389
+
390
+ // format
391
+ resource = { shout: '{{topic, lowercase}}! {{topic}}!! {{topic, uppercase}}!!!' };
392
+ i18n.t('shout', { topic: 'SmartApps', interpolation: { format: (value: string, format: string) => {
393
+ if (format === 'uppercase') return value.toUpperCase();
394
+ if (format === 'lowercase') return value.toLowerCase();
395
+ return value;
396
+ } } }); // --> 'smartapps! SmartApps!! SMARTAPPS!!!'
397
+ ```
398
+
399
+ ### Plurals - i18next
400
+ Plurals allows you to automatically choose correct translation based on the `count` option.
401
+ It supports basic plurals (`[[key]]_plural`), form plurals (`[[key]]_1`) and intervals.
402
+ Form plurals are supported for all languages.
403
+ See [http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html?id=l10n/pluralforms](http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html?id=l10n/pluralforms)
404
+ for the rules and forms for each language.
405
+ #### Usage
406
+ ```ts
407
+ // basic
408
+ resource = {
409
+ item: 'Item',
410
+ item_plural: 'Items',
411
+ };
412
+ i18n.t('item'); // --> 'Item'
413
+ i18n.t('item', { count: 1 }); // --> 'Item'
414
+ i18n.t('item', { count: 2 }); // --> 'Items'
415
+
416
+ // form
417
+ resource = { // CS
418
+ 'item': 'Polozka',
419
+ 'item_1': 'Polozky',
420
+ 'item_2': 'Polozek',
421
+ };
422
+ i18n.t('item'); // --> 'Polozka'
423
+ i18n.t('item', { count: 3 }); // --> 'Polozky'
424
+ i18n.t('item', { count: 5 }); // --> 'Polozek'
425
+ i18n.t('item', { count: 0 }); // --> 'Polozek'
426
+
427
+ // interval
428
+ resource = {
429
+ 'item': 'Item',
430
+ 'item_interval': '(1){One item};(2-5){Two to five items};(6-inf){More than 5 items};';
431
+ };
432
+ i18n.t('item'); // --> 'Item'
433
+ i18n.t('item', { count: 1 }); // --> 'One item'
434
+ i18n.t('item', { count: 3 }); // --> 'Two to five items'
435
+ i18n.t('item', { count: 8 }); // --> 'More than 5 items'
436
+ ```
437
+
438
+ ### Nesting - i18next
439
+ Nesting allows you to place a translation key into a translation value and have it translated.
440
+ #### Usage
441
+ ```ts
442
+ resource = {
443
+ welcome: 'Welcome, {{name}}!',
444
+ introduction: '$t(welcome) I am your i18n module',
445
+ };
446
+ i18n.t('introduction', { name: 'Radim' }); // --> 'Welcome, Radim! I am your i18n module.'
447
+ ```
448
+
449
+ ### Context - i18next
450
+ Context middleware allows you to have one translation in multiple contexts. Useful for gender for example.
451
+ ```ts
452
+ resource = {
453
+ friend: 'A friend',
454
+ friend_male: 'A boyfriend',
455
+ friend_female: 'A girlfriend',
456
+ };
457
+ i18n.t('friend'); // --> 'A friend'
458
+ i18n.t('friend', { context: 'male' }); // --> 'A boyfriend'
459
+ i18n.t('friend', { context: 'female' }); // --> 'A girlfriend'
460
+ ```