@24i/bigscreen-sdk 1.1.0 → 2.1.1-alpha.2133

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 (256) hide show
  1. package/README.md +1 -1
  2. package/package.json +34 -53
  3. package/packages/adobe-heartbeat/src/AdobeHeartbeat.ts +9 -9
  4. package/packages/async-image/src/AsyncImage.tsx +10 -15
  5. package/packages/developer-tools/PlayerDebugWindow/README.md +1 -1
  6. package/packages/developer-tools/src/DeveloperToolsService/DeveloperToolsList.tsx +0 -11
  7. package/packages/developer-tools/src/PlayerDebugWindow/PlayerDebugWindow.tsx +5 -5
  8. package/packages/developer-tools/src/PlayerDebugWindow/constants.ts +0 -15
  9. package/packages/developer-tools/src/TechnicalInfo/TechnicalInfoDetail.tsx +1 -2
  10. package/packages/developer-tools/src/TechnicalInfo/TechnicalInfoProvider.ts +3 -34
  11. package/packages/developer-tools/src/TechnicalInfo/__mocks__/Device.ts +0 -4
  12. package/packages/developer-tools/src/TechnicalInfo/translations.ts +0 -4
  13. package/packages/device/src/getKeyDigit.ts +2 -2
  14. package/packages/device/src/resolver/resolver.ts +5 -18
  15. package/packages/digital-clock/src/DigitalClock.tsx +4 -15
  16. package/packages/driver-androidtv/src/DeviceAndroidTV.ts +9 -54
  17. package/packages/driver-androidtv/src/__mocks__/javaScriptBridge.ts +5 -29
  18. package/packages/driver-androidtv/src/keymap.ts +0 -18
  19. package/packages/driver-androidtv/src/types.ts +16 -102
  20. package/packages/driver-base/src/DeviceBase.ts +2 -61
  21. package/packages/driver-base/src/KeyMap/Key.ts +1 -8
  22. package/packages/driver-base/src/KeyMap/KeyMap.ts +0 -4
  23. package/packages/driver-base/src/KeyMap/interface.ts +0 -1
  24. package/packages/driver-base/src/KeyMap/overrideValues.ts +1 -2
  25. package/packages/driver-base/src/__mocks__/keyMap.ts +0 -1
  26. package/packages/driver-base/src/types/DeviceEvent.ts +0 -2
  27. package/packages/driver-base/src/types/KeycodeKeyMap.ts +0 -1
  28. package/packages/driver-browser/src/keymap.ts +0 -8
  29. package/packages/driver-entone/src/keymap.ts +0 -1
  30. package/packages/driver-tizen/src/TizenKeys.ts +0 -2
  31. package/packages/driver-vidaa/src/DeviceVidaa.ts +2 -3
  32. package/packages/driver-vidaa/src/__mocks__/vidaa.ts +1 -1
  33. package/packages/driver-vidaa/src/keymap.ts +0 -2
  34. package/packages/driver-webos/src/DeviceWebos.ts +0 -8
  35. package/packages/driver-webos/src/keymap.ts +1 -2
  36. package/packages/driver-xbox/src/keymap.ts +1 -1
  37. package/packages/epg/README.md +1 -3
  38. package/packages/epg/src/v2/Cell.tsx +2 -16
  39. package/packages/epg/src/v2/DataManager.ts +41 -112
  40. package/packages/epg/src/v2/DatePicker.tsx +3 -9
  41. package/packages/epg/src/v2/DateToast/DateToast.tsx +9 -12
  42. package/packages/epg/src/v2/Day.tsx +3 -6
  43. package/packages/epg/src/v2/Epg.tsx +5 -5
  44. package/packages/epg/src/v2/MockGenerator/generator.ts +2 -3
  45. package/packages/epg/src/v2/ProgramInfo/utils.ts +3 -4
  46. package/packages/epg/src/v2/Row.tsx +1 -3
  47. package/packages/epg/src/v2/TimelineSection.tsx +1 -4
  48. package/packages/epg/src/v2/basic/CellsManager.tsx +2 -7
  49. package/packages/epg/src/v2/basic/RowsManager.tsx +1 -3
  50. package/packages/epg/src/v2/interface.ts +0 -13
  51. package/packages/events-manager/src/EventsManager.ts +56 -1
  52. package/packages/focus/README.md +0 -33
  53. package/packages/focus/src/IFocusable.ts +0 -1
  54. package/packages/focus/src/Layout/Base.tsx +6 -41
  55. package/packages/focus/src/Layout/Matrix.tsx +19 -51
  56. package/packages/focus/src/Layout/__test__/Base.spec.ts +180 -0
  57. package/packages/focus/src/Layout/__test__/Horizontal.spec.ts +94 -0
  58. package/packages/focus/src/Layout/__test__/Matrix.spec.ts +261 -0
  59. package/packages/focus/src/Layout/__test__/Vertical.spec.ts +46 -0
  60. package/packages/focus/src/Layout/__test__/isRtl.spec.ts +23 -0
  61. package/packages/focus/src/Layout/__test__/shared.ts +19 -0
  62. package/packages/focus/src/focusFirstExisting.ts +1 -7
  63. package/packages/focus/src/index.ts +1 -2
  64. package/packages/gallup/src/Gallup.ts +3 -3
  65. package/packages/grid/src/Base/Base.tsx +10 -15
  66. package/packages/grid/src/FirstOnlyGrid/FirstOnlyGrid.tsx +2 -4
  67. package/packages/icon/src/Icon.tsx +5 -27
  68. package/packages/input/README.md +1 -4
  69. package/packages/input/src/Input.tsx +29 -65
  70. package/packages/input/src/handleOverflow.ts +29 -0
  71. package/packages/interactable/README.md +1 -2
  72. package/packages/interactable/src/Interactable.tsx +3 -9
  73. package/packages/interactable/src/interface.ts +0 -1
  74. package/packages/jsx/src/index.ts +1 -1
  75. package/packages/jsx/src/test-utils/index.ts +0 -1
  76. package/packages/keyboard/src/Backdrop/Backdrop.scss +0 -2
  77. package/packages/keyboard/src/KeyboardBase.tsx +4 -16
  78. package/packages/keyboard/src/WhitelabelKeyboard/Keyboard.scss +0 -4
  79. package/packages/keyboard/src/WhitelabelKeyboard/Keyboard.tsx +20 -28
  80. package/packages/keyboard/src/WhitelabelKeyboard/_sizes.1080.scss +0 -1
  81. package/packages/keyboard/src/WhitelabelKeyboard/_sizes.scss +0 -1
  82. package/packages/keyboard/src/WhitelabelKeyboard/layouts/index.ts +0 -11
  83. package/packages/keyboard/src/WhitelabelKeyboard/types.ts +0 -1
  84. package/packages/l10n/README.md +0 -18
  85. package/packages/l10n/src/date/common.ts +6 -18
  86. package/packages/l10n/src/date/cs.ts +8 -2
  87. package/packages/l10n/src/date/en-001.ts +3 -3
  88. package/packages/l10n/src/date/en-common.ts +4 -5
  89. package/packages/l10n/src/date/en-us.ts +3 -3
  90. package/packages/l10n/src/date/iso.ts +13 -12
  91. package/packages/l10n/src/date/types.ts +0 -9
  92. package/packages/l10n/src/l10n.ts +3 -61
  93. package/packages/list/src/Base/Base.tsx +9 -19
  94. package/packages/list/src/Base/interface.ts +2 -2
  95. package/packages/list/src/CenteredList/controller.ts +1 -0
  96. package/packages/list/src/EdgeOffsetList/EdgeOffsetList.tsx +3 -3
  97. package/packages/list/src/UnifiedListController/UnifiedListController.ts +2 -6
  98. package/packages/logger/src/loggers/SentryLogger/Sentry.ts +0 -1
  99. package/packages/logger/src/loggers/SentryLogger/SentryLogger.ts +2 -2
  100. package/packages/menu/src/MenuAndContentContainer/MenuAndContentContainer.tsx +3 -31
  101. package/packages/menu/src/MenuAndContentContainer/interface.ts +0 -8
  102. package/packages/modal-service/README.md +1 -4
  103. package/packages/modal-service/src/ModalService.tsx +5 -29
  104. package/packages/perf-utils/README.md +120 -1
  105. package/packages/perf-utils/src/array/filter.ts +54 -1
  106. package/packages/perf-utils/src/array/find.ts +43 -1
  107. package/packages/perf-utils/src/array/findIndex.ts +43 -1
  108. package/packages/perf-utils/src/array/forEach.ts +48 -1
  109. package/packages/perf-utils/src/array/includes.ts +41 -1
  110. package/packages/perf-utils/src/array/includesNaN.ts +32 -1
  111. package/packages/perf-utils/src/array/index.ts +7 -1
  112. package/packages/perf-utils/src/array/map.ts +52 -1
  113. package/packages/player-ui/README.md +1 -1
  114. package/packages/player-ui/src/CurrentTime.tsx +2 -2
  115. package/packages/player-ui/src/Duration.tsx +2 -2
  116. package/packages/player-ui/src/PauseButton.tsx +0 -8
  117. package/packages/player-ui/src/PlayerInteractable.tsx +0 -1
  118. package/packages/player-ui/src/PlayerTime.tsx +1 -3
  119. package/packages/player-ui/src/PlayerUI.tsx +35 -68
  120. package/packages/player-ui/src/RemainingTime.tsx +2 -2
  121. package/packages/player-ui/src/Seekbar.tsx +18 -110
  122. package/packages/player-ui/src/Seeking.ts +16 -57
  123. package/packages/player-ui/src/Subtitles.tsx +2 -2
  124. package/packages/player-ui/src/index.ts +0 -1
  125. package/packages/player-ui/src/mocks.ts +8 -32
  126. package/packages/player-ui/src/timeUtils.ts +3 -3
  127. package/packages/player-ui/src/types.ts +3 -9
  128. package/packages/router/src/Route.tsx +27 -61
  129. package/packages/router/src/Router.tsx +13 -59
  130. package/packages/router/src/history.ts +1 -8
  131. package/packages/router/src/index.ts +1 -1
  132. package/packages/router/src/utils.ts +4 -9
  133. package/packages/sass-utils/src/linear-gradient.scss +4 -9
  134. package/packages/sass-utils/src/scale.1080.scss +1 -3
  135. package/packages/sass-utils/src/scale.720.scss +1 -1
  136. package/packages/time/README.md +1 -4
  137. package/packages/time/src/Time.ts +13 -35
  138. package/packages/time/src/constants.ts +0 -1
  139. package/packages/toast/src/ToastService.tsx +5 -16
  140. package/packages/types-bigscreen-jsx/README.md +4 -5
  141. package/packages/types-bigscreen-jsx/index.d.ts +67 -72
  142. package/packages/utils/README.md +0 -27
  143. package/packages/utils/src/elementUtils.ts +0 -25
  144. package/packages/utils/src/index.ts +0 -8
  145. package/packages/utils/src/scaledImage.ts +3 -6
  146. package/packages/utils/src/textUtils.ts +14 -46
  147. package/packages/utils/src/wait.ts +1 -3
  148. package/packages/utils/src/xhr/xhrSend.ts +1 -3
  149. package/packages/utils/src/xhr/xhrSendRetry.ts +1 -3
  150. package/packages/zapping/src/ChannelZapping.ts +0 -9
  151. package/packages/zapping/src/Zapping.tsx +0 -10
  152. package/.vscode/settings.json +0 -6
  153. package/packages/analytics/README.md +0 -8
  154. package/packages/analytics/src/A.ts +0 -1
  155. package/packages/analytics/src/Analytics.ts +0 -1
  156. package/packages/analytics/src/analyticsOnScroll.ts +0 -1
  157. package/packages/analytics/src/clients/ConsoleAnalytics/ConsoleAnalytics.ts +0 -1
  158. package/packages/analytics/src/clients/ConsoleAnalytics/index.ts +0 -1
  159. package/packages/analytics/src/clients/GoogleAnalytics/GoogleAnalytics.ts +0 -200
  160. package/packages/analytics/src/clients/GoogleAnalytics/constants.ts +0 -118
  161. package/packages/analytics/src/clients/GoogleAnalytics/getUrl.ts +0 -17
  162. package/packages/analytics/src/clients/GoogleAnalytics/index.ts +0 -2
  163. package/packages/analytics/src/clients/GoogleAnalytics/interface.ts +0 -77
  164. package/packages/analytics/src/clients/GoogleAnalytics/mapPayload.ts +0 -50
  165. package/packages/analytics/src/clients/GoogleAnalytics/prepareBody.ts +0 -14
  166. package/packages/analytics/src/clients/TealiumAnalytics/TealiumAnalytics.ts +0 -169
  167. package/packages/analytics/src/clients/TealiumAnalytics/constants.ts +0 -102
  168. package/packages/analytics/src/clients/TealiumAnalytics/findIdForLanguage.ts +0 -9
  169. package/packages/analytics/src/clients/TealiumAnalytics/index.ts +0 -4
  170. package/packages/analytics/src/clients/TealiumAnalytics/interface.ts +0 -33
  171. package/packages/analytics/src/clients/TealiumAnalytics/mappers/__mocks__/mediaPayload.ts +0 -70
  172. package/packages/analytics/src/clients/TealiumAnalytics/mappers/helper.ts +0 -36
  173. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapAppError.ts +0 -13
  174. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapFavoriteAdd.ts +0 -11
  175. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapFavoriteRemove.ts +0 -11
  176. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapPlayerClose.ts +0 -15
  177. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapPlayerOpen.ts +0 -15
  178. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSceneView.ts +0 -18
  179. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSearch.ts +0 -18
  180. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSearchFailed.ts +0 -8
  181. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSearchSuccess.ts +0 -8
  182. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoPause.ts +0 -15
  183. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoProgress.ts +0 -18
  184. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoResume.ts +0 -15
  185. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoStart.ts +0 -15
  186. package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapVideoStop.ts +0 -15
  187. package/packages/analytics/src/clients/TealiumAnalytics/types.ts +0 -156
  188. package/packages/analytics/src/clients/TwentyFourIQ/TwentyFourIQClient.ts +0 -116
  189. package/packages/analytics/src/clients/TwentyFourIQ/constants.ts +0 -99
  190. package/packages/analytics/src/clients/TwentyFourIQ/helper.ts +0 -34
  191. package/packages/analytics/src/clients/TwentyFourIQ/index.ts +0 -2
  192. package/packages/analytics/src/clients/TwentyFourIQ/interface.ts +0 -31
  193. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapAdLoaded.ts +0 -13
  194. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapAdSkipped.ts +0 -16
  195. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapBase.ts +0 -21
  196. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapBuffering.ts +0 -15
  197. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapPlayerClose.ts +0 -24
  198. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapPlayerOpen.ts +0 -18
  199. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapSceneView.ts +0 -15
  200. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapScroll.ts +0 -17
  201. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoComplete.ts +0 -21
  202. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoPause.ts +0 -24
  203. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoProgress.ts +0 -24
  204. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoStart.ts +0 -34
  205. package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoStop.ts +0 -32
  206. package/packages/analytics/src/clients/TwentyFourIQ/types.ts +0 -115
  207. package/packages/analytics/src/constants.ts +0 -1
  208. package/packages/analytics/src/index.ts +0 -3
  209. package/packages/analytics/src/interface.ts +0 -1
  210. package/packages/analytics/src/utils/generateSessionId.ts +0 -8
  211. package/packages/create-package/dist/createPackage.js +0 -66
  212. package/packages/create-package/dist/createPackage.js.map +0 -1
  213. package/packages/create-package/dist/index.js +0 -5
  214. package/packages/create-package/dist/index.js.map +0 -1
  215. package/packages/create-package/dist/questionnaire/questions.js +0 -35
  216. package/packages/create-package/dist/questionnaire/questions.js.map +0 -1
  217. package/packages/create-package/dist/settings/Settings.js +0 -10
  218. package/packages/create-package/dist/settings/Settings.js.map +0 -1
  219. package/packages/create-package/dist/types.js +0 -3
  220. package/packages/create-package/dist/types.js.map +0 -1
  221. package/packages/device/src/driver/index.firetv.ts +0 -1
  222. package/packages/device/src/driver/index.smartcast.tv.ts +0 -1
  223. package/packages/driver-firetv/src/DeviceFireTV.ts +0 -18
  224. package/packages/driver-firetv/src/__mocks__/javaScriptBridge.ts +0 -36
  225. package/packages/driver-firetv/src/index.ts +0 -1
  226. package/packages/driver-smartcast/src/DeviceSmartCast.ts +0 -317
  227. package/packages/driver-smartcast/src/__mocks__/api.ts +0 -49
  228. package/packages/driver-smartcast/src/index.ts +0 -1
  229. package/packages/driver-smartcast/src/keymap.ts +0 -9
  230. package/packages/driver-smartcast/src/types.ts +0 -65
  231. package/packages/focus/src/hasFocus.ts +0 -36
  232. package/packages/input/src/utils.ts +0 -71
  233. package/packages/jsx/src/test-utils/keyup.ts +0 -27
  234. package/packages/keyboard/src/WhitelabelKeyboard/layouts/arabic.ts +0 -27
  235. package/packages/keyboard/src/WhitelabelKeyboard/layouts/burmese.ts +0 -27
  236. package/packages/keyboard/src/WhitelabelKeyboard/layouts/dari.ts +0 -28
  237. package/packages/keyboard/src/WhitelabelKeyboard/layouts/korean.ts +0 -26
  238. package/packages/keyboard/src/WhitelabelKeyboard/layouts/pashto.ts +0 -27
  239. package/packages/keyboard/src/WhitelabelKeyboard/layouts/persian.ts +0 -27
  240. package/packages/keyboard/src/WhitelabelKeyboard/layouts/russian.ts +0 -27
  241. package/packages/keyboard/src/WhitelabelKeyboard/layouts/tibetan.ts +0 -26
  242. package/packages/keyboard/src/WhitelabelKeyboard/layouts/turkish.ts +0 -26
  243. package/packages/keyboard/src/WhitelabelKeyboard/layouts/ukrainian.ts +0 -27
  244. package/packages/keyboard/src/WhitelabelKeyboard/layouts/urdu.ts +0 -26
  245. package/packages/l10n/src/date/de.ts +0 -97
  246. package/packages/l10n/src/date/es.ts +0 -71
  247. package/packages/l10n/src/date/fr.ts +0 -94
  248. package/packages/l10n/src/date/he.ts +0 -101
  249. package/packages/time/src/adapters/24iMediaTimeApi.ts +0 -47
  250. package/packages/time/src/services/24iMediaTimeApi/24iMediaTimeApi.ts +0 -43
  251. package/packages/time/src/services/24iMediaTimeApi/index.ts +0 -6
  252. package/packages/utils/src/forceReflow.ts +0 -14
  253. package/packages/utils/src/keyPress/index.ts +0 -6
  254. package/packages/utils/src/keyPress/keyPressSimulator.ts +0 -74
  255. package/packages/utils/src/keyPress/simulateKeyPress.ts +0 -25
  256. package/utils/release/release.ts +0 -154
@@ -1,317 +0,0 @@
1
- import {
2
- DeviceBase, ConnectionType, ScreenSaverStatus, VolumeRange,
3
- } from '@24i/bigscreen-sdk/driver-base';
4
- import { runAsync } from '@24i/bigscreen-sdk/utils/timers';
5
- import { ipify } from '@24i/bigscreen-sdk/ipify';
6
- import { getKeyMap } from './keymap';
7
- import { ISmartCastApi, IFA, DEFAULT_TTS_TIMEOUT, DevicePlaybackQuality } from './types';
8
-
9
- declare const window: Window & { VIZIO: ISmartCastApi };
10
-
11
- export class DeviceSmartCast extends DeviceBase {
12
- keyMap = getKeyMap();
13
-
14
- deviceId = '';
15
-
16
- deviceModel = '';
17
-
18
- deviceFirmware = '';
19
-
20
- readonly backAsBackspaceInSearch = true;
21
-
22
- devicePlaybackQualities: DevicePlaybackQuality[] = [];
23
-
24
- closedCaptionsStatus = false;
25
-
26
- textToSpeechStatus = false;
27
-
28
- textToSpeechTimeout?: null | number;
29
-
30
- lastTextToSpeechItem?: { delay: number, text: string } | null;
31
-
32
- API?: ISmartCastApi;
33
-
34
- IFA?: IFA;
35
-
36
- publicIpAddress?: string;
37
-
38
- async initDevice() {
39
- this.initNetworkChangeListener();
40
- this.initVisibilityChangeListener();
41
- this.initMouseActiveListener();
42
- await this.initPlatformApiListeners();
43
- }
44
-
45
- async initPlatformApiListeners(): Promise<void> {
46
- return new Promise((resolve) => {
47
- document.addEventListener('VIZIO_LIBRARY_DID_LOAD', async () => {
48
- const API = window.VIZIO;
49
- this.API = window.VIZIO;
50
- const promises = [];
51
-
52
- API.setClosedCaptionHandler((isEnabled: boolean) => {
53
- this.closedCaptionsStatus = isEnabled;
54
- this.triggerEvent('cctoggle', { isEnabled });
55
- });
56
-
57
- promises.push(new Promise<void>((r) => {
58
- API.setAdvertiserIDListener((advertiserID: IFA) => {
59
- this.IFA = advertiserID;
60
- r();
61
- });
62
- }));
63
-
64
- promises.push(new Promise<void>((r) => {
65
- API.getDeviceId((id: string) => {
66
- this.deviceId = id;
67
- r();
68
- });
69
- }));
70
-
71
- this.deviceModel = API.deviceModel;
72
-
73
- promises.push(new Promise<void>((r) => {
74
- API.getFirmwareVersion((version: string) => {
75
- this.deviceFirmware = version;
76
- r();
77
- });
78
- }));
79
-
80
- promises.push(new Promise<void>((r) => {
81
- API.getDevicePlaybackQualities((qualities: DevicePlaybackQuality[]) => {
82
- this.devicePlaybackQualities = qualities;
83
- r();
84
- });
85
- }));
86
-
87
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
88
- API.setContentChangeHandler(this.handleDeeplink);
89
-
90
- await Promise.all(promises);
91
-
92
- resolve();
93
- });
94
-
95
- document.addEventListener('VIZIO_TTS_ENABLED', () => {
96
- this.textToSpeechStatus = true;
97
- }, false);
98
-
99
- document.addEventListener('VIZIO_TTS_DISABLED', () => {
100
- this.lastTextToSpeechItem = null;
101
- this.textToSpeechStatus = false;
102
- window.clearTimeout(this.textToSpeechTimeout as any);
103
- this.API?.Chromevox.cancel();
104
- }, false);
105
-
106
- const object = document.createElement('script');
107
- object.src = 'http://127.0.0.1:12345/scfs/cl/js/vizio-companion-lib.js';
108
- document.body.appendChild(object);
109
- });
110
- }
111
-
112
- initNetworkChangeListener() {
113
- window.addEventListener('online', () => {
114
- this.triggerEvent('networkchange', { isConnected: true });
115
- });
116
- window.addEventListener('offline', () => {
117
- this.triggerEvent('networkchange', { isConnected: false });
118
- });
119
- }
120
-
121
- initVisibilityChangeListener() {
122
- document.addEventListener('visibilitychange', () => {
123
- this.triggerEvent('visibilitychange', {
124
- isVisible: document.visibilityState === 'visible',
125
- });
126
- });
127
- }
128
-
129
- initMouseActiveListener() {
130
- document.addEventListener('mousemove', this.onMouseActive);
131
- }
132
-
133
- onMouseActive = () => {
134
- document.removeEventListener('mousemove', this.onMouseActive);
135
- document.addEventListener('keydown', this.onMouseInactive, true);
136
- this.isMouseActive = true;
137
- this.triggerEvent('mouseactive', { isMouseActive: true });
138
- };
139
-
140
- onMouseInactive = (event: KeyboardEvent) => {
141
- if (!this.isDirectionalArrow(event)) return;
142
- document.removeEventListener('keydown', this.onMouseInactive);
143
- this.initMouseActiveListener();
144
-
145
- // to let other handlers to use this property before change
146
- runAsync(() => {
147
- this.isMouseActive = false;
148
- });
149
- this.triggerEvent('mouseactive', { isMouseActive: false });
150
- };
151
-
152
- handleDeeplink = (deeplinkUrl: string) => {
153
- if (typeof deeplinkUrl !== 'string') return;
154
- const newRoute = deeplinkUrl.split('#')[1];
155
- if (newRoute) {
156
- const currentUrl = window.location.href.split('#')[0];
157
- window.location.href = `${currentUrl}#${newRoute}`;
158
- }
159
- };
160
-
161
- /**
162
- * Reads provided text by the device internal reader.
163
- */
164
- readText({ text, delay = DEFAULT_TTS_TIMEOUT }: {
165
- text: string, delay?: number
166
- }) {
167
- if (this.textToSpeechStatus && text) {
168
- if (this.textToSpeechTimeout) {
169
- this.lastTextToSpeechItem = { text, delay };
170
- } else {
171
- this.API?.Chromevox.play(text);
172
-
173
- this.textToSpeechTimeout = window.setTimeout(() => {
174
- this.textToSpeechTimeout = null;
175
-
176
- if (this.lastTextToSpeechItem) {
177
- const last = this.lastTextToSpeechItem;
178
-
179
- this.API?.Chromevox.play(last.text);
180
- this.lastTextToSpeechItem = null;
181
- }
182
- }, delay);
183
- }
184
- }
185
- }
186
-
187
- exit() {
188
- this.API?.exitApplication();
189
- }
190
-
191
- reboot() {
192
- window.location.reload();
193
- }
194
-
195
- /**
196
- * Returns the status of Closed Captions feature.
197
- */
198
- async getClosedCaptionsStatus() {
199
- return this.closedCaptionsStatus;
200
- }
201
-
202
- /**
203
- * Returns the status of Text to Speech Engine if it is available by the device.
204
- */
205
- async getTextToSpeechStatus() {
206
- return this.textToSpeechStatus;
207
- }
208
-
209
- /**
210
- * Returns filled in Vast Tag URL.
211
- */
212
- async getVastTagUrl(template: string): Promise<null | string> {
213
- const IFAObject = this.IFA;
214
- const resolution = this.getResolution();
215
-
216
- if (!IFAObject) return null;
217
-
218
- this.publicIpAddress = this.publicIpAddress ?? await ipify();
219
-
220
- return template
221
- .replace('{{width}}', String(resolution.width))
222
- .replace('{{height}}', String(resolution.height))
223
- .replace('{{cb}}', String(Date.now()))
224
- .replace('{{user_agent}}', encodeURIComponent(window.navigator.userAgent))
225
- .replace('{{ifa}}', IFAObject.IFA)
226
- .replace('{{ifa_type}}', IFAObject.IFA_TYPE)
227
- .replace('{{ip_address}}', this.publicIpAddress!)
228
- .replace('{{lmt}}', IFAObject.LMT ? '1' : '0')
229
- .replace('{{us_privacy}}', IFAObject.LMT ? '1YYN' : '1YNN');
230
- }
231
-
232
- async getManufacturerName() {
233
- return 'VIZIO';
234
- }
235
-
236
- async getPlatformName() {
237
- return 'SmartCast';
238
- }
239
-
240
- async getPlatformVersion() {
241
- return '';
242
- }
243
-
244
- async getDeviceName() {
245
- return 'VIZIO SmartCast';
246
- }
247
-
248
- async getModelName() {
249
- return this.deviceModel;
250
- }
251
-
252
- async getFirmware() {
253
- return this.deviceFirmware;
254
- }
255
-
256
- async is4KSupported() {
257
- return this.devicePlaybackQualities.includes('UHD');
258
- }
259
-
260
- async is8KSupported() {
261
- return false;
262
- }
263
-
264
- async getUuid() {
265
- return this.deviceId;
266
- }
267
-
268
- async getVolume() {
269
- return VolumeRange.UNSUPPORTED;
270
- }
271
-
272
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
273
- async setVolume(volumePercentage: number) {
274
- // not supported on SmartCast platform
275
- }
276
-
277
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
278
- async mute(mute: boolean) {
279
- // not supported on SmartCast platform
280
- }
281
-
282
- async isMute() {
283
- return false;
284
- }
285
-
286
- async getScreenSaver() {
287
- return { enabled: false };
288
- }
289
-
290
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
291
- async setScreenSaver(status: ScreenSaverStatus) {
292
- // not supported on SmartCast platform
293
- }
294
-
295
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
296
- async setUserAgent(userAgent: string) {
297
- return false;
298
- }
299
-
300
- async getConnectionType() {
301
- return 'unknown' as ConnectionType;
302
- }
303
-
304
- async isNetworkConnected() {
305
- return window.navigator.onLine;
306
- }
307
-
308
- async getLocalIP() {
309
- // not supported on SmartCast platform
310
- return '';
311
- }
312
-
313
- async getMacAddress() {
314
- // not supported on SmartCast platform
315
- return '';
316
- }
317
- }
@@ -1,49 +0,0 @@
1
- import { IFA, ISmartCastApi, DevicePlaybackQuality } from '../types';
2
-
3
- export const deviceId = '2bd671ef-02cd-445f-9295-b3565dbaf1e8';
4
- export const deviceModel = 'D24f4-J01';
5
- export const firmware = '3.520.28.1-2';
6
- export const playbackQualities = ['UHD', 'HD'] as DevicePlaybackQuality[];
7
- // eslint-disable-next-line max-len
8
- export const deeplinkUrl = 'https://smartapps-bigscreen.24i.com/#/detail/SERIES/FO03OogBXRsigNB1VRz_/undefined/undefined/';
9
- // eslint-disable-next-line max-len
10
- export const deeplinkUrl2 = 'https://smartapps-bigscreen.24i.com/#/detail/SERIES/Ge1sO4gBXRsigNB1TBwy/undefined/undefined/';
11
- // eslint-disable-next-line max-len
12
- export const vastTagTemplate = 'w={{width}}&h={{height}}&did={{ifa}}&ifa_type={{ifa_type}}&lmt={{lmt}}&ip={{ip_address}}&us_privacy={{us_privacy}}';
13
-
14
- export const SmartCastMockApi: ISmartCastApi = {
15
- deviceModel,
16
-
17
- getDeviceId: (callback: (id: string) => void): void => callback(deviceId),
18
-
19
- getFirmwareVersion: (callback: (id: string) => void): void => callback(firmware),
20
-
21
- getDevicePlaybackQualities: (
22
- callback: (
23
- qualities: DevicePlaybackQuality[]
24
- ) => void,
25
- ): void => callback(playbackQualities),
26
-
27
- exitApplication: (): void => {},
28
-
29
- setClosedCaptionHandler: (callback: (isEnabled: boolean) => void): void => callback(false),
30
-
31
- setAdvertiserIDListener: (callback: (advertiserID: IFA) => void): void => callback({
32
- IFA: deviceId,
33
- IFA_TYPE: 'vida',
34
- LMT: false,
35
- }),
36
-
37
- setContentChangeHandler:
38
- (callback: (contentUrl: string) => void): void => callback(deeplinkUrl),
39
-
40
- Chromevox: {
41
- cancel: (): void => {
42
- throw new Error('Function not implemented.');
43
- },
44
- play: (text: string): void => {
45
- // eslint-disable-next-line no-console
46
- console.log(text);
47
- },
48
- },
49
- };
@@ -1 +0,0 @@
1
- export { DeviceSmartCast } from './DeviceSmartCast';
@@ -1,9 +0,0 @@
1
- import { generateKeyCodeKeyMap, overrideValues } from '@24i/bigscreen-sdk/driver-base/keymap';
2
-
3
- export const getKeyMap = () => {
4
- overrideValues({
5
- CHANNEL_PREVIOUS: { code: 'PrevCh', keyCode: 500 },
6
- SUBTITLES: { keyCode: 204 },
7
- });
8
- return generateKeyCodeKeyMap();
9
- };
@@ -1,65 +0,0 @@
1
- export type ISmartCastApi = {
2
- /**
3
- * Sets the callback to receive the device UID in standard 32 digits.
4
- */
5
- getDeviceId: (callback: (id: string) => void) => void;
6
-
7
- /**
8
- * Sets the callback to receive the device firmware version.
9
- */
10
- getFirmwareVersion: (callback: (firmwareVersion: string) => void) => void;
11
-
12
- /**
13
- * Sets the callback to receive the device playback qualities.
14
- */
15
- getDevicePlaybackQualities: (callback: (qualities: DevicePlaybackQuality[]) => void) => void;
16
-
17
- /**
18
- * Exits the application.
19
- */
20
- exitApplication: () => void;
21
-
22
- /**
23
- * Sets the callback to receive the device CC toggle event.
24
- */
25
- setClosedCaptionHandler: (callback: (isEnabled: boolean) => void) => void;
26
-
27
- /**
28
- * Sets the callback to receive IFA object with the device ads related parameters.
29
- */
30
- setAdvertiserIDListener: (callback: (advertiserID: IFA) => void) => void;
31
-
32
- /**
33
- * Sets the callback to receive the device content change event.
34
- */
35
- setContentChangeHandler: (callback: (contentUrl: string) => void) => void;
36
-
37
- /**
38
- * Device model.
39
- */
40
- deviceModel: string;
41
-
42
- /**
43
- * Chromevox Text-to-Speech accessibility playback engine.
44
- */
45
- Chromevox: {
46
- cancel: () => void,
47
- play: (text: string) => void,
48
- };
49
- };
50
-
51
- /**
52
- * Identifier For Advertising (IFA) and Limited Tracking parameter object
53
- */
54
- export type IFA = {
55
- /** Unique identifier string for advertising */
56
- IFA: string,
57
- /** String value for IFA type ("vida") */
58
- IFA_TYPE: string,
59
- /** true=Limited tracking enabled, false=Limited tracking disabled */
60
- LMT: boolean,
61
- };
62
-
63
- export type DevicePlaybackQuality = 'UHD' | 'HD' | 'SD';
64
-
65
- export const DEFAULT_TTS_TIMEOUT = 3000;
@@ -1,36 +0,0 @@
1
- import { Reference, unwrapReference } from '@24i/bigscreen-sdk/jsx';
2
- import { isElementWrappedBy } from '@24i/bigscreen-sdk/utils/elementUtils';
3
-
4
- /**
5
- * Test if the element (or element in the reference) has the `activeElement` inside or optionally,
6
- * if the element itself is the `activeElement`.
7
- * @param elementOrReference DOM element or reference to element on which we test focus
8
- * @param includeElementItself if true, active element is also tested with the provided element.
9
- * Default is true
10
- * @returns true if the element has focused element inside or is itself focused
11
- */
12
- export const hasFocus = (
13
- elementOrReference: HTMLElement | Reference<HTMLElement>,
14
- includeElementItself = true,
15
- ) => {
16
- const element = unwrapReference(elementOrReference);
17
- if (!element) return false;
18
- return isElementWrappedBy(
19
- document.activeElement as HTMLElement,
20
- element,
21
- includeElementItself,
22
- );
23
- };
24
-
25
- /**
26
- * Test if the element (or element in the reference) is the `activeElement`.
27
- * @param elementOrReference DOM element or reference to element on which we test focus
28
- * @returns true if the element is focused
29
- */
30
- export const isFocused = (
31
- elementOrReference: HTMLElement | Reference<HTMLElement>,
32
- ) => {
33
- const element = unwrapReference(elementOrReference);
34
- if (!element) return false;
35
- return document.activeElement === element;
36
- };
@@ -1,71 +0,0 @@
1
- import { isRtl } from '@24i/bigscreen-sdk/i18n';
2
-
3
- /**
4
- * Handles overflowing text in the input by moving with the inner
5
- * text element.
6
- * @param wrap input wrapper
7
- * @param caret caret element
8
- * @param text input inner text element
9
- * @returns value how much is text element moved
10
- */
11
- export const handleOverflow = (
12
- wrap: HTMLDivElement | null,
13
- caret: HTMLDivElement | null,
14
- text: HTMLDivElement | null,
15
- ) => {
16
- if (!wrap || !caret || !text) return 0;
17
- const { width: wrapWidth, left: wrapLeft } = wrap.getBoundingClientRect();
18
- const { width: caretWidth, left: caretLeft } = caret.getBoundingClientRect();
19
- const caretOffset = isRtl() ? caretLeft - caretWidth : caretLeft + caretWidth;
20
- if (!isRtl() && wrapWidth + wrapLeft < caretOffset) {
21
- const margin = -(caretOffset - wrapWidth - wrapLeft);
22
- text.style.marginLeft = `${margin}px`;
23
- text.style.marginRight = '0px';
24
- return margin;
25
- }
26
- if (isRtl() && caretOffset < wrapLeft) {
27
- const margin = -(wrapLeft - caretOffset);
28
- text.style.marginLeft = '0px';
29
- text.style.marginRight = `${margin}px`;
30
- return margin;
31
- }
32
- text.style.marginLeft = '0px';
33
- text.style.marginRight = '0px';
34
- return 0;
35
- };
36
-
37
- /**
38
- * Check for char element position mishmash in the input's text element. This is
39
- * necessary to recognize if the char is in the wrong direction than it's position
40
- * in children collection, this means that the char is LTR char in RTL scheme or RTL
41
- * char in LTR scheme.
42
- * @param text input inner text element
43
- * @param position position of the char in children collection
44
- * @returns true if char has position mishmash
45
- */
46
- export const checkCharOrderMishmash = (text: HTMLDivElement, position: number) => {
47
- const { children } = text!;
48
- if (!children.length) return false;
49
- const charOffsets: {
50
- index: number,
51
- offset: number,
52
- }[] = [];
53
- for (let i = 0; i < children.length; i++) {
54
- charOffsets.push({
55
- index: i,
56
- offset: (children[i] as HTMLElement).getBoundingClientRect().left,
57
- });
58
- }
59
- charOffsets.sort((a, b) => {
60
- if (a.offset < b.offset) return isRtl() ? 1 : -1;
61
- if (a.offset > b.offset) return isRtl() ? -1 : 1;
62
- return 0;
63
- });
64
- const lastPos = children.length - 1;
65
- const posBefore = position - 1;
66
- const mishmashBefore = posBefore < 0
67
- ? false : charOffsets[posBefore].index !== posBefore;
68
- const mishmashCurrent = charOffsets[position].index !== position;
69
- if (mishmashCurrent) return true;
70
- return !mishmashCurrent && mishmashBefore && position !== lastPos;
71
- };
@@ -1,27 +0,0 @@
1
- import { Reference, Component } from '../index';
2
- import { unwrapReference } from '../utils';
3
-
4
- type ToPress = Reference<HTMLElement> | HTMLElement | Window | Document | Component<any>;
5
-
6
- interface Key {
7
- keyCode: number,
8
- code: string,
9
- key?: string,
10
- }
11
-
12
- export const keyup = (toPress: ToPress, keyOrKeyCode: number | Key) => {
13
- const element = unwrapReference<ToPress>(toPress);
14
- let kbEventOptions: KeyboardEventInit;
15
- if (typeof keyOrKeyCode === 'number') {
16
- kbEventOptions = { keyCode: keyOrKeyCode };
17
- } else {
18
- const { keyCode, code, key } = keyOrKeyCode;
19
- kbEventOptions = { keyCode, code, key };
20
- }
21
- const event = new KeyboardEvent('keyup', kbEventOptions);
22
- if ((element as any).onKeyUp) {
23
- (element as any).onKeyUp(event);
24
- } else if ((element as any).dispatchEvent) {
25
- (element as Element).dispatchEvent(event);
26
- }
27
- };
@@ -1,27 +0,0 @@
1
- /* eslint-disable no-magic-numbers */
2
- import { KeyMatrixCell } from '../../types';
3
-
4
- const keyboardLayout = [
5
- ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', ',', '.'],
6
- ['ا', 'ب', 'ت', 'ث', 'ج', 'ح', 'خ', 'د', 'ذ', 'ر', 'ز', 'س'],
7
- ['ش', 'ص', 'ض', 'ط', 'ظ', 'ع', 'غ', 'ف', 'ق', 'ك', 'ل', 'م'],
8
- ['ن', 'ه', 'و', 'ي', 'ء', 'آ', 'إ', 'ة', 'ؤ', 'ئ', 'ى', 'أ'],
9
- ];
10
-
11
- /* eslint-disable max-len */
12
- const makeFocusStrings = (layout: KeyMatrixCell[][], hasLanguageLayout: boolean) => [
13
- ['', '', ...layout[0], 'backspace', 'backspace'],
14
- ['abc', 'abc', ...layout[1], 'clear', 'clear'],
15
- ['special', 'special', ...layout[2], 'left', 'right'],
16
- ['', '', ...layout[3], '', ''],
17
- [
18
- ...(hasLanguageLayout ? ['language', 'language'] : ['', '']),
19
- 'shift', 'shift', 'space', 'space', 'space', 'space', 'space', 'space', 'space', 'space', 'domain', 'domain', 'continue', 'continue'],
20
- ];
21
-
22
- export const arabic = {
23
- className: 'wide',
24
- keyText: 'ابت',
25
- layout: keyboardLayout,
26
- makeFocusStrings,
27
- };
@@ -1,27 +0,0 @@
1
- /* eslint-disable no-magic-numbers */
2
- import { KeyMatrixCell } from '../../types';
3
-
4
- const keyboardLayout = [
5
- ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '.'],
6
- ['က', 'ခ', 'ဂ', 'ဃ', 'င', 'စ', 'ဆ', 'ဇ', 'စ်', 'ည', 'ဋ'],
7
- ['႒', 'ဍ', 'ဏ', 'တ', 'ထ', 'ဒ', 'ဓ', 'န', 'ပ', 'ဖ', 'ဗ'],
8
- ['ဘ', 'မ', 'ယ', 'ရ', 'လ', 'ဝ', 'သ', 'ဟ', 'ဠ', 'အ', '-'],
9
- ];
10
-
11
- /* eslint-disable max-len */
12
- const makeFocusStrings = (layout: KeyMatrixCell[][], hasLanguageLayout: boolean) => [
13
- ['', '', ...layout[0], 'backspace', 'backspace'],
14
- ['abc', 'abc', ...layout[1], 'clear', 'clear'],
15
- ['special', 'special', ...layout[2], 'left', 'right'],
16
- ['', '', ...layout[3], '', ''],
17
- [
18
- ...(hasLanguageLayout ? ['language', 'language'] : ['', '']),
19
- 'shift', 'shift', 'space', 'space', 'space', 'space', 'space', 'space', 'space', 'domain', 'domain', 'continue', 'continue'],
20
- ];
21
-
22
- export const burmese = {
23
- className: 'wide',
24
- keyText: 'ကခဂ',
25
- layout: keyboardLayout,
26
- makeFocusStrings,
27
- };
@@ -1,28 +0,0 @@
1
- /* eslint-disable no-magic-numbers */
2
- import { KeyMatrixCell } from '../../types';
3
-
4
- const keyboardLayout = [
5
- ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '.'],
6
- ['ا', 'ب', 'پ', 'ت', 'ث', 'ج', 'چ', 'ح', 'خ', 'د', 'ذ'],
7
- ['ر', 'ز', 'ژ', 'س', 'ش', 'ص', 'ض', 'ط', 'ظ', 'ع', 'غ'],
8
- ['ف', 'ق', 'ک', 'گ', 'ل', 'م', 'ن', 'و', 'ه', 'ی', '-'],
9
-
10
- ];
11
-
12
- /* eslint-disable max-len */
13
- const makeFocusStrings = (layout: KeyMatrixCell[][], hasLanguageLayout: boolean) => [
14
- ['', '', ...layout[0], 'backspace', 'backspace'],
15
- ['abc', 'abc', ...layout[1], 'clear', 'clear'],
16
- ['special', 'special', ...layout[2], 'left', 'right'],
17
- ['', '', ...layout[3], '', ''],
18
- [
19
- ...(hasLanguageLayout ? ['language', 'language'] : ['', '']),
20
- 'shift', 'shift', 'space', 'space', 'space', 'space', 'space', 'space', 'space', 'domain', 'domain', 'continue', 'continue'],
21
- ];
22
-
23
- export const dari = {
24
- className: 'wide',
25
- keyText: 'ابپ',
26
- layout: keyboardLayout,
27
- makeFocusStrings,
28
- };