@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,4 +1,4 @@
1
- import { createRef, Component, DeclareProps } from '@24i/bigscreen-sdk/jsx';
1
+ import { createRef, Component, setText, DeclareProps } from '@24i/bigscreen-sdk/jsx';
2
2
  import { Interactable } from '@24i/bigscreen-sdk/interactable';
3
3
  import { IFocusable } from '@24i/bigscreen-sdk/focus';
4
4
  import { isRtl } from '@24i/bigscreen-sdk/i18n';
@@ -9,7 +9,7 @@ import { stopEvent } from '@24i/bigscreen-sdk/utils/stopEvent';
9
9
  import { addClass } from '@24i/bigscreen-sdk/utils/addClass';
10
10
  import { removeClass } from '@24i/bigscreen-sdk/utils/removeClass';
11
11
  import { offsetPosition } from '@24i/bigscreen-sdk/utils/offsetPosition';
12
- import { checkCharOrderMishmash, handleOverflow } from './utils';
12
+ import { handleOverflow } from './handleOverflow';
13
13
  import './Input.scss';
14
14
 
15
15
  type Props = {
@@ -19,11 +19,13 @@ type Props = {
19
19
  passwordChar?: string,
20
20
  /** Moves text to the left (with negative margin-left) when caret overflows */
21
21
  shouldHandleOverflow?: boolean,
22
+ onChange?: (newValue: string) => void,
23
+ onFocus?: () => void,
24
+ onBlur?: () => void,
25
+ // eslint-disable-next-line react/no-unused-prop-types
22
26
  maxLength?: number,
23
- onFocus?: (event: FocusEvent) => void,
24
- onBlur?: (event: FocusEvent) => void,
27
+ // eslint-disable-next-line react/require-default-props
25
28
  onFinish?: (wasCancelled?: boolean) => void,
26
- onChange?: (newValue: string) => void,
27
29
  };
28
30
 
29
31
  const ACTIVE = 'active';
@@ -42,8 +44,6 @@ export class Input extends Component<Props> implements IFocusable {
42
44
 
43
45
  caret = createRef<HTMLDivElement>();
44
46
 
45
- caretPosition = 0;
46
-
47
47
  isInputting = false;
48
48
 
49
49
  lastValue: string;
@@ -70,11 +70,6 @@ export class Input extends Component<Props> implements IFocusable {
70
70
  this.isPlaceholderVisible = value.length === 0;
71
71
  }
72
72
 
73
- componentDidMount() {
74
- const { value } = this.props;
75
- if (value) this.setText(value);
76
- }
77
-
78
73
  getType() {
79
74
  return this.nativeInput.current?.type;
80
75
  }
@@ -92,10 +87,13 @@ export class Input extends Component<Props> implements IFocusable {
92
87
 
93
88
  onCaretPositionChange = (position: number | null) => {
94
89
  if (position === null) return;
90
+ const { shouldHandleOverflow } = this.props;
95
91
  const value = this.getValue();
96
- this.setText(value);
97
- this.updateCaretPosition(position);
98
- this.updateTextOverflow();
92
+ setText(this.text, this.filterText(value));
93
+ this.setCaretPosition(position);
94
+ if (shouldHandleOverflow) {
95
+ handleOverflow(this.wrap.current, this.caret.current, this.text.current);
96
+ }
99
97
  if (this.lastValue !== value) {
100
98
  const { onChange } = this.props;
101
99
  this.lastValue = value;
@@ -110,59 +108,31 @@ export class Input extends Component<Props> implements IFocusable {
110
108
 
111
109
  setValue(value: string) {
112
110
  this.nativeInput.current!.value = value;
113
- this.setText(value);
114
111
  }
115
112
 
116
113
  setType(type: Props['type']) {
117
114
  if (this.getType() === type) return;
118
115
  const value = this.getValue();
119
116
  this.nativeInput.current!.type = type;
120
- this.setText(value);
121
- }
122
-
123
- setText(text: string): void {
124
- const filtered = this.filterText(text);
125
- this.renderText(filtered);
117
+ setText(this.text, this.filterText(value));
126
118
  }
127
119
 
128
- updateCaretPosition(position: number) {
120
+ setCaretPosition(position: number) {
129
121
  const textNode = this.text.current!.firstChild;
130
- if (!textNode || position <= 0) {
131
- this.caretPosition = 0;
122
+ if (!textNode) {
132
123
  offsetPosition(this.caret, { x: 0 });
133
124
  return;
134
125
  }
135
- const wholeTextDimensions = this.text.current!.getBoundingClientRect();
136
- if (position >= this.text.current!.children.length) {
137
- const offset = wholeTextDimensions.right - wholeTextDimensions.left;
138
- this.caretPosition = isRtl() ? -offset : offset;
139
- offsetPosition(this.caret, { x: this.caretPosition }, false);
140
- return;
141
- }
142
- const charNode = this.text.current!.children[position - 1];
143
- const charDimensions = charNode!.getBoundingClientRect();
144
- const isCharMishmash = checkCharOrderMishmash(this.text.current!, position - 1);
145
- if (isRtl()) {
146
- if (isCharMishmash) {
147
- this.caretPosition = charDimensions.right - wholeTextDimensions.right;
148
- } else {
149
- this.caretPosition = charDimensions.left - wholeTextDimensions.right;
150
- }
151
- } else if (isCharMishmash) {
152
- this.caretPosition = charDimensions.left - wholeTextDimensions.left;
153
- } else {
154
- this.caretPosition = charDimensions.right - wholeTextDimensions.left;
155
- }
156
- offsetPosition(this.caret, { x: this.caretPosition }, false);
157
- }
158
-
159
- updateTextOverflow() {
160
- const { shouldHandleOverflow } = this.props;
161
- if (!shouldHandleOverflow) return;
162
- const textMargin = handleOverflow(
163
- this.wrap.current, this.caret.current, this.text.current,
164
- );
165
- offsetPosition(this.caret, { x: this.caretPosition - textMargin }, false);
126
+ const range = new Range();
127
+ range.selectNode(textNode);
128
+ const wholeText = range.getBoundingClientRect();
129
+ range.setStart(textNode, position);
130
+ range.setEnd(textNode, position);
131
+ const caretText = range.getBoundingClientRect();
132
+ const offset = isRtl()
133
+ ? wholeText.left - caretText.left
134
+ : wholeText.left + wholeText.width - caretText.left;
135
+ offsetPosition(this.caret, { x: -offset }, false);
166
136
  }
167
137
 
168
138
  /**
@@ -226,14 +196,6 @@ export class Input extends Component<Props> implements IFocusable {
226
196
  return text.replace(/ /g, NBSP);
227
197
  }
228
198
 
229
- renderText(text: string): void {
230
- const chars: JSX.Element[] = [];
231
- for (let i = 0; i < text.length; i++) {
232
- chars.push(<span className="char">{text[i]}</span>);
233
- }
234
- this.clearMount(chars, this.text);
235
- }
236
-
237
199
  render() {
238
200
  const { value, type, placeholder, onFocus, onBlur } = this.props;
239
201
  return (
@@ -258,7 +220,9 @@ export class Input extends Component<Props> implements IFocusable {
258
220
  >
259
221
  {placeholder}
260
222
  </div>
261
- <div ref={this.text} className="text" />
223
+ <div ref={this.text} className="text" dir="auto">
224
+ {this.filterText(value)}
225
+ </div>
262
226
  <div ref={this.caret} className="caret" />
263
227
  </div>
264
228
  </Interactable>
@@ -0,0 +1,29 @@
1
+ import { isRtl } from '@24i/bigscreen-sdk/i18n';
2
+
3
+ export const handleOverflow = (
4
+ wrap: HTMLDivElement | null,
5
+ caret: HTMLDivElement | null,
6
+ text: HTMLDivElement | null,
7
+ ) => {
8
+ if (!wrap || !caret || !text) return;
9
+ const { width: wrapWidth, left: wrapLeft } = wrap.getBoundingClientRect();
10
+ const { width: caretWidth, left: caretLeft } = caret.getBoundingClientRect();
11
+ const textMargin = parseInt(text.dataset.margin!, 10) || 0;
12
+ const caretOffset = isRtl()
13
+ ? caretLeft + textMargin - caretWidth
14
+ : caretLeft - textMargin + caretWidth;
15
+ if (!isRtl() && wrapWidth + wrapLeft < caretOffset) {
16
+ const margin = -(caretOffset - wrapWidth - wrapLeft);
17
+ text.style.marginLeft = `${margin}px`;
18
+ text.style.marginRight = '0px';
19
+ text.dataset.margin = margin.toString();
20
+ } else if (isRtl() && caretOffset < wrapLeft) {
21
+ const margin = -(wrapLeft - caretOffset);
22
+ text.style.marginLeft = '0px';
23
+ text.style.marginRight = `${margin}px`;
24
+ text.dataset.margin = margin.toString();
25
+ } else {
26
+ text.style.marginLeft = '0px';
27
+ text.style.marginRight = '0px';
28
+ }
29
+ };
@@ -12,7 +12,6 @@ It provides common functionality for you.
12
12
  ## Props
13
13
  - `onPress` - called for onClick and onKeyDown
14
14
  - `ref` is forwarded to underlying `div`
15
- - `blockRepeatedKeyDown` - interactable must suppress repeated onPress calls, until the key is released. This is because because keyDown event is repeatedly fired when user holds key on webTv and Adrodid Tv. This may lead to unpredictable behavior.
16
15
  - other `div` props
17
16
 
18
17
  ## Provided functionality
@@ -35,4 +34,4 @@ renders
35
34
  <div class="btn btn-primary" tabindex="0">
36
35
  Play video
37
36
  </div>
38
- ```
37
+ ```
@@ -3,20 +3,14 @@ import { isClickOrEnter } from '@24i/bigscreen-sdk/device';
3
3
  import { Props } from './interface';
4
4
 
5
5
  export const Interactable = forwardRef<Props>(
6
- ({ children, onPress, blockRepeatedKeyDown, ...otherProps },
7
- ref: Reference<HTMLDivElement> | null) => {
6
+ ({ children, onPress, ...otherProps }, ref: Reference<HTMLDivElement> | null) => {
8
7
  const domRef = ref || createRef<HTMLDivElement>();
9
-
10
- const onPressProxy = (e: MouseEvent | KeyboardEvent) => {
11
- if (typeof onPress === 'function' && isClickOrEnter(e)) {
12
- onPress(e);
13
- }
8
+ const onPressProxy = (e: KeyboardEvent | MouseEvent) => {
9
+ if (typeof onPress === 'function' && isClickOrEnter(e)) onPress(e);
14
10
  };
15
-
16
11
  const onMouseEnter = () => {
17
12
  domRef.current!.focus({ preventScroll: true });
18
13
  };
19
-
20
14
  return (
21
15
  <div
22
16
  {...otherProps}
@@ -3,5 +3,4 @@ import { Children } from '@24i/bigscreen-sdk/jsx';
3
3
  export type Props = {
4
4
  children?: Children,
5
5
  onPress?: (event: KeyboardEvent | MouseEvent) => void,
6
- blockRepeatedKeyDown?: boolean,
7
6
  } & Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>;
@@ -27,5 +27,5 @@ export type {
27
27
  ClassComponentInterface,
28
28
  DeclareProps,
29
29
  } from './types';
30
- // eslint-disable-next-line import/no-default-export, no-restricted-exports
30
+ // eslint-disable-next-line import/no-default-export
31
31
  export { createElement as default } from './virtualDOM';
@@ -1,6 +1,5 @@
1
1
  export { click } from './click';
2
2
  export { enter } from './enter';
3
3
  export { keydown } from './keydown';
4
- export { keyup } from './keyup';
5
4
  export { shallow } from './shallow';
6
5
  export { MountedComponent } from './MountedComponent';
@@ -1,7 +1,6 @@
1
1
  .keyboard-backdrop {
2
2
  position: fixed;
3
3
  left: 0;
4
- right: 0;
5
4
  top: 0;
6
5
  width: $backdrop-width;
7
6
  height: $backdrop-height;
@@ -10,7 +9,6 @@
10
9
  .keyboard-backdrop-disabled {
11
10
  position: absolute;
12
11
  left: 0;
13
- right: 0;
14
12
  top: 0;
15
13
  width: 100%;
16
14
  height: 100%;
@@ -1,6 +1,5 @@
1
1
  import { Component, createRef, Reference } from '@24i/bigscreen-sdk/jsx';
2
- import { getKeyDigit, device } from '@24i/bigscreen-sdk/device';
3
- import { isRtl } from '@24i/bigscreen-sdk/i18n';
2
+ import { getKeyDigit } from '@24i/bigscreen-sdk/device';
4
3
  import { EventsManager } from '@24i/bigscreen-sdk/events-manager';
5
4
  import {
6
5
  Matrix,
@@ -121,15 +120,8 @@ export abstract class KeyboardBase<
121
120
  */
122
121
  onKeyDown(event: KeyboardEvent) {
123
122
  const { handleRemoteDigits, handleHWKeyboard } = this.props;
124
- const preventBack = 'backAsBackspaceInSearch' in device && !!device.backAsBackspaceInSearch;
125
- const inputLength = this.inputElement?.value?.length;
126
-
127
123
  if (BACK.is(event)) {
128
- if (preventBack && inputLength) {
129
- this.onBackspace();
130
- } else {
131
- this.onCancel();
132
- }
124
+ this.onCancel();
133
125
  } else {
134
126
  let char: string | null = null;
135
127
  if (handleHWKeyboard) {
@@ -216,9 +208,7 @@ export abstract class KeyboardBase<
216
208
  * Moves caret 1 position to the left.
217
209
  */
218
210
  onLeft() {
219
- const newPosition = !isRtl()
220
- ? caretLeft(this.inputElement)
221
- : caretRight(this.inputElement);
211
+ const newPosition = caretLeft(this.inputElement);
222
212
  if (typeof newPosition === 'number') {
223
213
  this.updateCaretPosition(newPosition);
224
214
  }
@@ -228,9 +218,7 @@ export abstract class KeyboardBase<
228
218
  * Moves caret 1 position to the right.
229
219
  */
230
220
  onRight() {
231
- const newPosition = !isRtl()
232
- ? caretRight(this.inputElement)
233
- : caretLeft(this.inputElement);
221
+ const newPosition = caretRight(this.inputElement);
234
222
  if (typeof newPosition === 'number') {
235
223
  this.updateCaretPosition(newPosition);
236
224
  }
@@ -23,10 +23,6 @@
23
23
  padding-bottom: $keyboard-padding-bottom;
24
24
  height: 100%;
25
25
  width: 100%;
26
-
27
- &.wide .key.key-space {
28
- width: $key-space-wide-width;
29
- }
30
26
  }
31
27
 
32
28
  .keys-container {
@@ -56,19 +56,14 @@ export class Keyboard extends KeyboardBase<Layouts, Props> {
56
56
  createLanguageFocusMatrix() {
57
57
  const { languageLayout } = this.props;
58
58
  this.languageFocusMatrix = generateFocusMatrixFromStringMatrix(
59
- this.keyRefs, languageLayout!.makeFocusStrings(languageLayout!.layout, true),
59
+ this.keyRefs, languageLayout!.makeFocusStrings(languageLayout!.layout, true)
60
60
  );
61
61
  }
62
62
 
63
63
  show() {
64
64
  super.show();
65
65
  this.renderedLayout = 'normal';
66
- const { layouts, languageLayout } = this.props;
67
- if (this.isLanguageLayoutActive) {
68
- this.renderLayout(this.languageFocusMatrix, languageLayout!.layout);
69
- } else {
70
- this.renderLayout(this.focusMatrices.normal, layouts.normal);
71
- }
66
+ this.renderLayout(this.focusMatrices.normal, this.props.layouts.normal);
72
67
  }
73
68
 
74
69
  hide() {
@@ -208,7 +203,6 @@ export class Keyboard extends KeyboardBase<Layouts, Props> {
208
203
 
209
204
  renderKeyboard(layout: JSX.Element[]) {
210
205
  const { texts, shouldHideOnBackdropClick, languageLayout } = this.props;
211
- const layoutClassName = languageLayout?.className || '';
212
206
  const isSpecialLayout = this.renderedLayout === 'special';
213
207
  const isNormalLayout = this.renderedLayout === 'normal';
214
208
  return (
@@ -217,7 +211,7 @@ export class Keyboard extends KeyboardBase<Layouts, Props> {
217
211
  onClick={() => this.onCancel()}
218
212
  enableOnClick={shouldHideOnBackdropClick}
219
213
  />
220
- <div className={`keyboard-wrapper ${layoutClassName}`}>
214
+ <div className="keyboard-wrapper">
221
215
  <div className="keys-container side-bar layout-selector">
222
216
  <div className="key-row first-row">
223
217
  <div className="key key-wide key-empty">&nbsp;</div>
@@ -258,25 +252,23 @@ export class Keyboard extends KeyboardBase<Layouts, Props> {
258
252
  <div className="key-row">
259
253
  <div className="key key-wide key-empty">&nbsp;</div>
260
254
  </div>
261
- {languageLayout
262
- ? (
263
- <div className="key-row rounded-border-container">
264
- <Interactable
265
- ref={this.keyRefs.language}
266
- className="key key-wide key-with-icon key-language"
267
- onPress={() => this.onLanguage()}
268
- >
269
- <div className="key-background">
270
- <div className="key-mask-icon" />
271
- </div>
272
- </Interactable>
273
- </div>
274
- )
275
- : (
276
- <div className="key-row">
277
- <div className="key key-wide key-empty">&nbsp;</div>
278
- </div>
279
- )}
255
+ {!!languageLayout ?
256
+ <div className="key-row rounded-border-container">
257
+ <Interactable
258
+ ref={this.keyRefs.language}
259
+ className="key key-wide key-with-icon key-language"
260
+ onPress={() => this.onLanguage()}
261
+ >
262
+ <div className="key-background">
263
+ <div className="key-mask-icon" />
264
+ </div>
265
+ </Interactable>
266
+ </div>
267
+ :
268
+ <div className="key-row">
269
+ <div className="key key-wide key-empty">&nbsp;</div>
270
+ </div>
271
+ }
280
272
  </div>
281
273
  <div className="keys-container key-layout">
282
274
  {layout}
@@ -26,7 +26,6 @@ $icon-mask-size: 40px;
26
26
  $key-with-icon-padding: 17px 22px;
27
27
 
28
28
  $key-space-width: 528px;
29
- $key-space-wide-width: 609px;
30
29
 
31
30
  $focus-shadow-1: 0 1px 3px 0;
32
31
  $focus-shadow-2: 0 20px 32px 0;
@@ -26,7 +26,6 @@ $icon-mask-size: 27px;
26
26
  $key-with-icon-padding: 11px 15px;
27
27
 
28
28
  $key-space-width: 348px;
29
- $key-space-wide-width: 406px;
30
29
 
31
30
  $focus-shadow-1: 0 1px 2px 0;
32
31
  $focus-shadow-2: 0 13px 21px 0;
@@ -1,14 +1,3 @@
1
- export { arabic } from './arabic';
2
- export { burmese } from './burmese';
3
- export { dari } from './dari';
4
1
  export { hebrew } from './hebrew';
5
- export { korean } from './korean';
6
2
  export { latin } from './latin';
7
- export { pashto } from './pashto';
8
- export { persian } from './persian';
9
- export { russian } from './russian';
10
3
  export { special } from './special';
11
- export { tibetan } from './tibetan';
12
- export { turkish } from './turkish';
13
- export { ukrainian } from './ukrainian';
14
- export { urdu } from './urdu';
@@ -13,7 +13,6 @@ export type KeyTexts = {
13
13
  };
14
14
 
15
15
  export type LanguageLayout = {
16
- className? : string,
17
16
  keyText: KeyTexts['toNormalLayout'],
18
17
  layout: KeyMatrixCell[][],
19
18
  makeFocusStrings: (layout: KeyMatrixCell[][], hasLanguageLayout: boolean) => KeyMatrixCell[][],
@@ -76,24 +76,6 @@ type DateTimeFormatOptions = {
76
76
  }
77
77
  ```
78
78
 
79
- #### date-fns DateTime format
80
- It is also possible to use formatting provided by [date-fns](https://date-fns.org/v2.30.0/docs/format) library. First you need to globally configure the formats used (usually from backstage):
81
- ```ts
82
- l10n.init({
83
- dateFormatLong?: string | null, // e.g. 'eee, dd MMM' for "Wed, 09 Jul"
84
- dateFormatNumeric?: string | null, // e.g. 'EEEE, MMMM d' for "Wednesday, July 9"
85
- dateFormatShort?: string | null, // e.g. 'MM/dd/yyyy' for "07/09/2023"
86
- timeFormat?: string | null, // e.g. 'h:mm a' for "9:05 PM"
87
- });
88
- ```
89
- After that, `timeFormat` and `dateFormatShort` are used automatically where appropriate, in case the format string is _falsy_ the [default formatting implementation](#datetime-format) will be used. You can also specify which format you want to use in `DateTimeFormatOptions`:
90
- ```ts
91
- type DateTimeFormatOptions = {
92
- ...
93
- formatType: 'dateFormatLong' | 'dateFormatNumeric' | 'dateFormatShort' | 'timeFormat',
94
- }
95
- ```
96
-
97
79
  You can use both `timestamp` in `ms` or `Date` object directly for formatting.
98
80
 
99
81
  #### Examples
@@ -7,7 +7,7 @@ const NOON = 12;
7
7
 
8
8
  export const SECOND_FROM_END = 2;
9
9
 
10
- export const h24 = (date: Date) => date.getUTCHours().toString();
10
+ export const h24 = (date: Date) => date.getHours().toString();
11
11
 
12
12
  export const hh24 = (date: Date) => {
13
13
  const h = h24(date);
@@ -15,7 +15,7 @@ export const hh24 = (date: Date) => {
15
15
  };
16
16
 
17
17
  export const h12 = (date: Date) => {
18
- const h = date.getUTCHours() % NOON;
18
+ const h = date.getHours() % NOON;
19
19
  return h === 0 ? '12' : h.toString();
20
20
  };
21
21
 
@@ -24,14 +24,14 @@ export const hh12 = (date: Date) => {
24
24
  return h.length === 1 ? `0${h}` : h;
25
25
  };
26
26
 
27
- export const m = (date: Date) => date.getUTCMinutes().toString();
27
+ export const m = (date: Date) => date.getMinutes().toString();
28
28
 
29
29
  export const mm = (date: Date) => {
30
30
  const min = m(date);
31
31
  return min.length === 1 ? `0${min}` : min;
32
32
  };
33
33
 
34
- export const s = (date: Date) => date.getUTCSeconds().toString();
34
+ export const s = (date: Date) => date.getSeconds().toString();
35
35
 
36
36
  export const ss = (date: Date) => {
37
37
  const sec = s(date);
@@ -39,7 +39,7 @@ export const ss = (date: Date) => {
39
39
  };
40
40
 
41
41
  export const amOrPm = (date: Date) => (
42
- date.getUTCHours() < NOON ? 'AM' : 'PM'
42
+ date.getHours() < NOON ? 'AM' : 'PM'
43
43
  );
44
44
 
45
45
  export const h24Mm = (date: Date) => `${h24(date)}:${mm(date)}`;
@@ -107,7 +107,7 @@ export const collonSeparatedHour12MinuteSecond = (date: Date, options: DateTimeF
107
107
 
108
108
  export const processYear = (dateStringParts: string[], year: Year | undefined, date: Date) => {
109
109
  if (typeof year === 'undefined') return;
110
- const fullYear = date.getUTCFullYear().toString();
110
+ const fullYear = date.getFullYear().toString();
111
111
  dateStringParts.push(
112
112
  year === '2-digit'
113
113
  ? fullYear.substring(fullYear.length - SECOND_FROM_END)
@@ -151,15 +151,3 @@ export const dateFormatter = (
151
151
  )(date),
152
152
  };
153
153
  };
154
-
155
- export const toTwoDigitLocaleTimeString = (date: Date) => (
156
- options: DateTimeFormatOptions = {
157
- hour: '2-digit', minute: '2-digit', second: '2-digit',
158
- },
159
- ) => collonSeparatedHour24MinuteSecond(date, options);
160
-
161
- export const toNumericLocaleTimeString = (date: Date) => (
162
- options: DateTimeFormatOptions = {
163
- hour: 'numeric', minute: '2-digit', second: '2-digit',
164
- },
165
- ) => collonSeparatedHour24MinuteSecond(date, options);
@@ -1,4 +1,4 @@
1
- import { dateFormatter, processYear, toNumericLocaleTimeString } from './common';
1
+ import { collonSeparatedHour24MinuteSecond, dateFormatter, processYear } from './common';
2
2
  import type { DateTimeFormatOptions, Weekday, Day, Month, Year } from './types';
3
3
 
4
4
  const WEEKDAYS = {
@@ -86,4 +86,10 @@ const toLocaleDateString = (date: Date) => (
86
86
  return dateStringParts.join(' ');
87
87
  };
88
88
 
89
- export const csDateFormatter = dateFormatter(toNumericLocaleTimeString, toLocaleDateString, ' ');
89
+ const toLocaleTimeString = (date: Date) => (
90
+ options: DateTimeFormatOptions = {
91
+ hour: 'numeric', minute: '2-digit', second: '2-digit',
92
+ },
93
+ ) => collonSeparatedHour24MinuteSecond(date, options);
94
+
95
+ export const csDateFormatter = dateFormatter(toLocaleTimeString, toLocaleDateString, ' ');
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  collonSeparatedHour12MinuteSecond, dateFormatter, processYear, SECOND_FROM_END,
3
3
  } from './common';
4
- import { EN_MONTHS, processWeekday, isDdMmYyyy } from './en-common';
4
+ import { MONTHS, processWeekday, isDdMmYyyy } from './en-common';
5
5
  import type { DateTimeFormatOptions, Day, Month, Year } from './types';
6
6
 
7
7
  const processMonth = (
@@ -19,7 +19,7 @@ const processMonth = (
19
19
  : numericMonth
20
20
  }${typeof year !== 'undefined' ? ',' : ''}`);
21
21
  } else {
22
- dateStringParts.push(EN_MONTHS[month][date.getMonth()]);
22
+ dateStringParts.push(MONTHS[month][date.getMonth()]);
23
23
  }
24
24
  };
25
25
 
@@ -49,7 +49,7 @@ const getDdMmYyyy = (dateStringParts: string[], year: Year | undefined, date: Da
49
49
  dateStringParts.push(`${d}/${m}/${y}`);
50
50
  };
51
51
 
52
- const toLocaleDateString = (date: Date) => (
52
+ export const toLocaleDateString = (date: Date) => (
53
53
  { weekday, year, month, day }: DateTimeFormatOptions = {
54
54
  year: 'numeric', month: '2-digit', day: '2-digit',
55
55
  },
@@ -1,6 +1,6 @@
1
- import type { Day, Month, Weekday, LocaleData, Year } from './types';
1
+ import type { Day, Month, Weekday, Year } from './types';
2
2
 
3
- export const EN_MONTHS = {
3
+ export const MONTHS = {
4
4
  narrow: [
5
5
  'J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D',
6
6
  ],
@@ -13,7 +13,7 @@ export const EN_MONTHS = {
13
13
  ],
14
14
  };
15
15
 
16
- export const EN_WEEKDAYS = {
16
+ export const WEEKDAYS = {
17
17
  narrow: [
18
18
  'S', 'M', 'T', 'W', 'T', 'F', 'S',
19
19
  ],
@@ -32,10 +32,9 @@ export const processWeekday = (
32
32
  day: Day | undefined,
33
33
  weekday: Weekday | undefined,
34
34
  date: Date,
35
- weekdaysLocaleData: LocaleData = EN_WEEKDAYS,
36
35
  ) => {
37
36
  if (typeof weekday === 'undefined') return;
38
- let weekdayString = weekdaysLocaleData[weekday][date.getDay()];
37
+ let weekdayString = WEEKDAYS[weekday][date.getDay()];
39
38
  if (
40
39
  typeof year !== 'undefined'
41
40
  || typeof month !== 'undefined'
@@ -4,7 +4,7 @@ import {
4
4
  processYear,
5
5
  SECOND_FROM_END,
6
6
  } from './common';
7
- import { EN_MONTHS, processWeekday, isDdMmYyyy } from './en-common';
7
+ import { MONTHS, processWeekday, isDdMmYyyy } from './en-common';
8
8
  import type { DateTimeFormatOptions, Day, Month, Year } from './types';
9
9
 
10
10
  const processMonth = (dateStringParts: string[], month: Month | undefined, date: Date) => {
@@ -16,7 +16,7 @@ const processMonth = (dateStringParts: string[], month: Month | undefined, date:
16
16
  ? `0${numericMonth}` : numericMonth,
17
17
  );
18
18
  } else {
19
- dateStringParts.push(EN_MONTHS[month][date.getMonth()]);
19
+ dateStringParts.push(MONTHS[month][date.getMonth()]);
20
20
  }
21
21
  };
22
22
 
@@ -56,7 +56,7 @@ const getDdMmYyyy = (
56
56
  dateStringParts.push(`${m}/${d}/${y}`);
57
57
  };
58
58
 
59
- const toLocaleDateString = (date: Date) => (
59
+ export const toLocaleDateString = (date: Date) => (
60
60
  { weekday, year, month, day }: DateTimeFormatOptions = {
61
61
  year: 'numeric', month: 'numeric', day: 'numeric',
62
62
  },