@24i/bigscreen-sdk 1.0.54-alpha.2835 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +6 -0
- package/README.md +3 -2
- package/package.json +10 -10
- package/packages/analytics/src/clients/GoogleAnalytics/GoogleAnalytics.ts +14 -10
- package/packages/analytics/src/clients/GoogleAnalytics/constants.ts +2 -10
- package/packages/analytics/src/clients/GoogleAnalytics/interface.ts +1 -6
- package/packages/analytics/src/clients/GoogleAnalytics/mapPayload.ts +0 -1
- package/packages/analytics/src/clients/TealiumAnalytics/TealiumAnalytics.ts +24 -36
- package/packages/analytics/src/clients/TealiumAnalytics/constants.ts +1 -5
- package/packages/analytics/src/clients/TealiumAnalytics/findIdForLanguage.ts +9 -0
- package/packages/analytics/src/clients/TealiumAnalytics/index.ts +1 -1
- package/packages/analytics/src/clients/TealiumAnalytics/interface.ts +1 -3
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/__mocks__/mediaPayload.ts +14 -16
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapSceneView.ts +1 -1
- package/packages/analytics/src/clients/TealiumAnalytics/types.ts +14 -19
- package/packages/analytics/src/clients/TwentyFourIQ/TwentyFourIQClient.ts +22 -13
- package/packages/analytics/src/clients/TwentyFourIQ/constants.ts +3 -15
- package/packages/analytics/src/clients/TwentyFourIQ/interface.ts +4 -7
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapAdLoaded.ts +13 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapAdSkipped.ts +16 -0
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapBase.ts +3 -6
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapBuffering.ts +2 -2
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapPlayerClose.ts +3 -4
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapPlayerOpen.ts +3 -2
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapSceneView.ts +2 -2
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapScroll.ts +2 -2
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoComplete.ts +3 -4
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoPause.ts +3 -4
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoProgress.ts +3 -4
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoStart.ts +2 -2
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapVideoStop.ts +2 -2
- package/packages/analytics/src/clients/TwentyFourIQ/types.ts +28 -45
- package/packages/create-package/dist/createPackage.js +66 -0
- package/packages/create-package/dist/createPackage.js.map +1 -0
- package/packages/create-package/dist/index.js +5 -0
- package/packages/create-package/dist/index.js.map +1 -0
- package/packages/create-package/dist/questionnaire/questions.js +35 -0
- package/packages/create-package/dist/questionnaire/questions.js.map +1 -0
- package/packages/create-package/dist/settings/Settings.js +10 -0
- package/packages/create-package/dist/settings/Settings.js.map +1 -0
- package/packages/create-package/dist/types.js +3 -0
- package/packages/create-package/dist/types.js.map +1 -0
- package/packages/developer-tools/src/TechnicalInfo/TechnicalInfoProvider.ts +2 -23
- package/packages/developer-tools/src/TechnicalInfo/__mocks__/Device.ts +0 -8
- package/packages/developer-tools/src/TechnicalInfo/translations.ts +0 -4
- package/packages/driver-androidtv/src/DeviceAndroidTV.ts +0 -38
- package/packages/driver-androidtv/src/__mocks__/javaScriptBridge.ts +0 -9
- package/packages/driver-androidtv/src/index.ts +0 -1
- package/packages/driver-androidtv/src/types.ts +0 -42
- package/packages/driver-base/src/DeviceBase.ts +0 -19
- package/packages/driver-base/src/__mocks__/DeviceBase.ts +0 -24
- package/packages/driver-base/src/index.ts +0 -3
- package/packages/driver-browser/src/DeviceBrowser.ts +0 -26
- package/packages/driver-entone/src/DeviceEntone.ts +1 -31
- package/packages/driver-firetv/src/DeviceFireTV.ts +1 -74
- package/packages/driver-firetv/src/__mocks__/javaScriptBridge.ts +0 -9
- package/packages/driver-hbbtv/src/DeviceHbbTV.ts +0 -26
- package/packages/driver-kreatv/src/DeviceKreaTV.ts +0 -26
- package/packages/driver-saphi/src/DeviceSaphi.ts +0 -26
- package/packages/driver-smartcast/src/DeviceSmartCast.ts +1 -78
- package/packages/driver-smartcast/src/__mocks__/api.ts +2 -32
- package/packages/driver-smartcast/src/types.ts +2 -48
- package/packages/driver-tizen/src/DeviceTizen.ts +7 -126
- package/packages/driver-tizen/src/ITizen.ts +202 -15116
- package/packages/driver-tizen/src/IWebapis.ts +87 -8643
- package/packages/driver-tizen/src/TizenKeys.ts +2 -2
- package/packages/driver-tizen/src/__mocks__/tizen.ts +8 -7
- package/packages/driver-tizen/src/constants.ts +195 -1
- package/packages/driver-tizen/src/types.ts +14 -0
- package/packages/driver-vidaa/src/DeviceVidaa.ts +0 -26
- package/packages/driver-webos/src/DeviceWebos.ts +0 -47
- package/packages/driver-webos/src/__mocks__/webos.ts +0 -33
- package/packages/driver-webos/src/constants.ts +0 -1
- package/packages/driver-webos/src/types.ts +0 -30
- package/packages/driver-xbox/src/DeviceXbox.ts +1 -30
- package/packages/grid/src/UnifiedGridController/UnifiedGridController.ts +6 -6
- package/packages/input/README.md +3 -0
- package/packages/input/src/Input.tsx +62 -26
- package/packages/input/src/utils.ts +71 -0
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/index.ts +0 -1
- package/packages/keyboard/src/utils/caret.ts +8 -5
- package/packages/keyboard/src/utils/input.ts +6 -5
- package/packages/list/src/BasicList/BasicList.tsx +7 -7
- package/packages/list/src/CenteredList/CenteredList.tsx +2 -2
- package/packages/list/src/EdgeOffsetList/EdgeOffsetList.tsx +7 -7
- package/packages/list/src/FirstOnlyList/FirstOnlyList.tsx +2 -2
- package/packages/list/src/FirstOnlyVariedList/FirstOnlyVariedList.tsx +2 -2
- package/packages/list/src/FixedToEndList/FixedToEndList.tsx +2 -2
- package/packages/list/src/interface.ts +2 -2
- package/packages/logger/src/loggers/ConsoleLogger/ConsoleLogger.ts +1 -7
- package/packages/logger/src/loggers/SentryLogger/SentryLogger.ts +1 -3
- package/packages/router/README.md +0 -1
- package/packages/router/src/Router.tsx +1 -4
- package/packages/router/src/utils.ts +1 -1
- package/utils/release/release.ts +5 -7
- package/ci/is_ci_job_skippable.sh +0 -153
- package/packages/analytics/src/clients/TealiumAnalytics/findForLanguage.ts +0 -9
- package/packages/analytics/src/clients/TealiumAnalytics/mappers/mapAppOpen.ts +0 -13
- package/packages/analytics/src/clients/TwentyFourIQ/mappers/mapAdEvent.ts +0 -20
- package/packages/driver-base/src/types/AdInfo.ts +0 -5
- package/packages/driver-base/src/types/InAppPurchase.ts +0 -25
- package/packages/driver-firetv/src/types.ts +0 -1
- package/packages/input/src/handleOverflow.ts +0 -29
- package/packages/keyboard/src/WhitelabelKeyboard/layouts/spanish.ts +0 -26
- package/packages/keyboard/src/utils/setInputSelectionRange.ts +0 -10
|
@@ -8,10 +8,6 @@ export const webapis = {
|
|
|
8
8
|
getModelCode: () => 'model code',
|
|
9
9
|
getFirmware: () => 'firmware',
|
|
10
10
|
},
|
|
11
|
-
adinfo: {
|
|
12
|
-
getTIFA: () => 'adid',
|
|
13
|
-
isLATEnabled: () => true,
|
|
14
|
-
},
|
|
15
11
|
};
|
|
16
12
|
|
|
17
13
|
export const application = {
|
|
@@ -28,7 +24,12 @@ export const tizen = {
|
|
|
28
24
|
unregisterKey: () => {},
|
|
29
25
|
registerKey: () => {},
|
|
30
26
|
},
|
|
31
|
-
systeminfo: {
|
|
32
|
-
getPropertyValue: async () => {},
|
|
33
|
-
},
|
|
34
27
|
};
|
|
28
|
+
|
|
29
|
+
declare global {
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
31
|
+
interface Window {
|
|
32
|
+
webapis: typeof webapis,
|
|
33
|
+
tizen: typeof tizen,
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -1,3 +1,197 @@
|
|
|
1
|
+
/* eslint-disable no-magic-numbers */
|
|
2
|
+
|
|
1
3
|
export const VENDOR = 'Samsung Tizen';
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
// MARK: TVAudioControl
|
|
6
|
+
|
|
7
|
+
export type AudioOutputMode = (
|
|
8
|
+
| 'PCM'
|
|
9
|
+
| 'DOLBY'
|
|
10
|
+
| 'DTS'
|
|
11
|
+
| 'AAC'
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export type AudioBeepType = (
|
|
15
|
+
| 'UP'
|
|
16
|
+
| 'DOWN'
|
|
17
|
+
| 'LEFT'
|
|
18
|
+
| 'RIGHT'
|
|
19
|
+
| 'PAGE_LEFT'
|
|
20
|
+
| 'PAGE_RIGHT'
|
|
21
|
+
| 'BACK'
|
|
22
|
+
| 'SELECT'
|
|
23
|
+
| 'CANCEL'
|
|
24
|
+
| 'KEYPAD'
|
|
25
|
+
| 'KEYPAD_ENTER'
|
|
26
|
+
| 'KEYPAD_DEL'
|
|
27
|
+
| 'MOVE'
|
|
28
|
+
| 'PREPARING'
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
// MARK: SystemInfo
|
|
32
|
+
|
|
33
|
+
export type SystemInfoPropertyId = (
|
|
34
|
+
| 'BATTERY'
|
|
35
|
+
| 'CPU'
|
|
36
|
+
| 'STORAGE'
|
|
37
|
+
| 'DISPLAY'
|
|
38
|
+
| 'DEVICE_ORIENTATION'
|
|
39
|
+
| 'BUILD'
|
|
40
|
+
| 'LOCALE'
|
|
41
|
+
| 'NETWORK'
|
|
42
|
+
| 'WIFI_NETWORK'
|
|
43
|
+
| 'ETHERNET_NETWORK'
|
|
44
|
+
| 'CELLULAR_NETWORK'
|
|
45
|
+
| 'NET_PROXY_NETWORK'
|
|
46
|
+
| 'SIM'
|
|
47
|
+
| 'PERIPHERAL'
|
|
48
|
+
| 'MEMORY'
|
|
49
|
+
| 'VIDEOSOURCE'
|
|
50
|
+
| 'CAMERA_FLASH'
|
|
51
|
+
| 'ADS'
|
|
52
|
+
| 'SERVICE_COUNTRY'
|
|
53
|
+
| 'SOURCE_INFO'
|
|
54
|
+
| 'PANEL'
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
export type SystemInfoNetworkType = (
|
|
58
|
+
| 'NONE'
|
|
59
|
+
| '2G'
|
|
60
|
+
| '2.5G'
|
|
61
|
+
| '3G'
|
|
62
|
+
| '4G'
|
|
63
|
+
| 'WIFI'
|
|
64
|
+
| 'ETHERNET'
|
|
65
|
+
| 'NET_PROXY'
|
|
66
|
+
| 'UNKNOWN'
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
export type SystemInfoWifiSecurityMode = (
|
|
70
|
+
| 'NONE'
|
|
71
|
+
| 'WEP'
|
|
72
|
+
| 'WPA_PSK'
|
|
73
|
+
| 'WPA2_PSK'
|
|
74
|
+
| 'EAP'
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
export type SystemInfoWifiEncryptionType = (
|
|
78
|
+
| 'NONE'
|
|
79
|
+
| 'WEP'
|
|
80
|
+
| 'TKIP'
|
|
81
|
+
| 'AES'
|
|
82
|
+
| 'TKIP_AES_MIXED'
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
export type SystemInfoNetworkIpMode = (
|
|
86
|
+
| 'NONE'
|
|
87
|
+
| 'STATIC'
|
|
88
|
+
| 'DYNAMIC'
|
|
89
|
+
| 'AUTO'
|
|
90
|
+
| 'FIXED'
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
export type SystemInfoDeviceOrientationStatus = (
|
|
94
|
+
| 'PORTRAIT_PRIMARY'
|
|
95
|
+
| 'PORTRAIT_SECONDARY'
|
|
96
|
+
| 'LANDSCAPE_PRIMARY'
|
|
97
|
+
| 'LANDSCAPE_SECONDARY'
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
export type SystemInfoSimState = (
|
|
101
|
+
| 'ABSENT'
|
|
102
|
+
| 'INITIALIZING'
|
|
103
|
+
| 'READY'
|
|
104
|
+
| 'PIN_REQUIRED'
|
|
105
|
+
| 'PUK_REQUIRED'
|
|
106
|
+
| 'NETWORK_LOCKED'
|
|
107
|
+
| 'SIM_LOCKED'
|
|
108
|
+
| 'UNKNOWN'
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
export type SystemInfoProfile = 'MOBILE_FULL' | 'MOBILE_WEB' | 'MOBILE' | 'WEARABLE' | 'TV';
|
|
112
|
+
|
|
113
|
+
export type SystemInfoLowMemoryStatus = 'NORMAL' | 'WARNING';
|
|
114
|
+
|
|
115
|
+
export type SystemInfoVideoSourceType = (
|
|
116
|
+
| 'TV'
|
|
117
|
+
| 'AV'
|
|
118
|
+
| 'SVIDEO'
|
|
119
|
+
| 'COMP'
|
|
120
|
+
| 'PC'
|
|
121
|
+
| 'HDMI'
|
|
122
|
+
| 'SCART'
|
|
123
|
+
| 'DVI'
|
|
124
|
+
| 'MEDIA'
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
// MARK: ProductInfo
|
|
128
|
+
|
|
129
|
+
export enum ProductInfoConfigKey {
|
|
130
|
+
CONFIG_KEY_DATA_SERVICE = 0,
|
|
131
|
+
CONFIG_KEY_SERVICE_COUNTRY = 1,
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export enum ProductInfoNoGlass3dSupport {
|
|
135
|
+
NO_GLASS_3D_NOT_SUPPORTED = 0,
|
|
136
|
+
NO_GLASS_3D_SUPPORTED = 1,
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export enum ProductInfoSiServerType {
|
|
140
|
+
SI_TYPE_OPERATIING_SERVER = 0,
|
|
141
|
+
SI_TYPE_DEVELOPMENT_SERVER = 1,
|
|
142
|
+
SI_TYPE_DEVELOPING_SERVER = 2,
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// MARK: Network
|
|
146
|
+
|
|
147
|
+
export enum NetworkActiveConnectionType {
|
|
148
|
+
DISCONNECTED = 0,
|
|
149
|
+
WIFI = 1,
|
|
150
|
+
CELLULAR = 2,
|
|
151
|
+
ETHERNET = 3,
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export enum NetworkIpMode {
|
|
155
|
+
NONE = 0,
|
|
156
|
+
STATIC = 1,
|
|
157
|
+
DYNAMIC = 2,
|
|
158
|
+
AUTO = 3,
|
|
159
|
+
FIXED = 4,
|
|
160
|
+
UNKNOWN = 5,
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export enum NetworkState {
|
|
164
|
+
LAN_CABLE_ATTACHED = 1,
|
|
165
|
+
LAN_CABLE_DETACHED = 2,
|
|
166
|
+
LAN_CABLE_STATE_UNKNOWN = 3,
|
|
167
|
+
GATEWAY_CONNECTED = 4,
|
|
168
|
+
GATEWAY_DISCONNECTED = 5,
|
|
169
|
+
WIFI_MODULE_STATE_ATTACHED = 6,
|
|
170
|
+
WIFI_MODULE_STATE_DETACHED = 7,
|
|
171
|
+
WIFI_MODULE_STATE_UNKNOWN = 8,
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export enum NetworkWiFiSecurityMode {
|
|
175
|
+
WEP = 1,
|
|
176
|
+
WPA_PSK = 2,
|
|
177
|
+
WPA2_PSK = 3,
|
|
178
|
+
EAP = 4,
|
|
179
|
+
NONE = 5,
|
|
180
|
+
UNKNOWN = 6,
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export enum NetworkWiFiEncryptionType {
|
|
184
|
+
WEP = 1,
|
|
185
|
+
TKIP = 2,
|
|
186
|
+
AES = 3,
|
|
187
|
+
TKIP_AES_MIXED = 4,
|
|
188
|
+
NONE = 5,
|
|
189
|
+
UNKNOWN = 6,
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// MARK: AppCommon
|
|
193
|
+
|
|
194
|
+
export enum AppCommonScreenSaverState {
|
|
195
|
+
SCREEN_SAVER_OFF = 0,
|
|
196
|
+
SCREEN_SAVER_ON = 1,
|
|
197
|
+
}
|
|
@@ -3,10 +3,7 @@ import {
|
|
|
3
3
|
ConnectionType,
|
|
4
4
|
ScreenSaverStatus,
|
|
5
5
|
VolumeRange,
|
|
6
|
-
IAPSuccessPayload,
|
|
7
|
-
IAPPurchaseProductData,
|
|
8
6
|
} from '@24i/bigscreen-sdk/driver-base';
|
|
9
|
-
import { generateUuid } from '@24i/bigscreen-sdk/utils';
|
|
10
7
|
import { NetworkConnectionTypeMap } from './constants';
|
|
11
8
|
import { getPlatformInfo } from './formatUserAgent';
|
|
12
9
|
import { HisenseVidaaApi } from './types';
|
|
@@ -83,17 +80,6 @@ export class DeviceVidaa extends DeviceBase {
|
|
|
83
80
|
return window.Hisense_GetDeviceID() || '';
|
|
84
81
|
}
|
|
85
82
|
|
|
86
|
-
async getAdInfo() {
|
|
87
|
-
const adId = generateUuid();
|
|
88
|
-
const type = 'sessionid';
|
|
89
|
-
const latEnabled = null;
|
|
90
|
-
return { adId, type, latEnabled };
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
async getOsLanguage() {
|
|
94
|
-
return (window.navigator.language || '').slice(0, 2);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
83
|
async getVolume(): Promise<number> {
|
|
98
84
|
return VolumeRange.UNSUPPORTED;
|
|
99
85
|
}
|
|
@@ -152,16 +138,4 @@ export class DeviceVidaa extends DeviceBase {
|
|
|
152
138
|
// not supported on Hisense VIDAA platform
|
|
153
139
|
return '';
|
|
154
140
|
}
|
|
155
|
-
|
|
156
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
157
|
-
async purchaseProduct(data: IAPPurchaseProductData): Promise<IAPSuccessPayload> {
|
|
158
|
-
// not supported
|
|
159
|
-
throw new Error('Not supported');
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
163
|
-
async cancelSubscription(data: IAPPurchaseProductData): Promise<void> {
|
|
164
|
-
// not supported
|
|
165
|
-
throw new Error('Not supported');
|
|
166
|
-
}
|
|
167
141
|
}
|
|
@@ -4,8 +4,6 @@ import {
|
|
|
4
4
|
ScreenSaverStatus,
|
|
5
5
|
VolumeRange,
|
|
6
6
|
ExitOptions,
|
|
7
|
-
IAPSuccessPayload,
|
|
8
|
-
IAPPurchaseProductData,
|
|
9
7
|
} from '@24i/bigscreen-sdk/driver-base';
|
|
10
8
|
import { Storage } from '@24i/bigscreen-sdk/storage';
|
|
11
9
|
import { initWebOSTVjs } from './webOSTVjs/webOSTVjs';
|
|
@@ -247,39 +245,6 @@ export class DeviceWebos extends DeviceBase {
|
|
|
247
245
|
return this.duid!;
|
|
248
246
|
}
|
|
249
247
|
|
|
250
|
-
async getAdInfo() {
|
|
251
|
-
const adId = await this.getLgDeviceId() ?? null;
|
|
252
|
-
const type = 'lgudid';
|
|
253
|
-
const latEnabled = null;
|
|
254
|
-
return { adId, type, latEnabled };
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
async getOsLanguage(): Promise<string> {
|
|
258
|
-
return new Promise<string>((resolve) => {
|
|
259
|
-
webOS.service.request(ApiUrls.SETTINGS_SERVICE, {
|
|
260
|
-
method: 'getSystemSettings',
|
|
261
|
-
parameters: {
|
|
262
|
-
keys: ['localeInfo'],
|
|
263
|
-
},
|
|
264
|
-
onSuccess: (response) => {
|
|
265
|
-
if (response.returnValue) {
|
|
266
|
-
const uiLanguage = response?.settings?.localeInfo?.locales?.UI;
|
|
267
|
-
resolve((uiLanguage || '').slice(0, 2));
|
|
268
|
-
}
|
|
269
|
-
resolve('');
|
|
270
|
-
},
|
|
271
|
-
onFailure: (error) => {
|
|
272
|
-
// ex. returns error for webOS 1.0, 2.0 as not supported
|
|
273
|
-
const { errorCode = '0', errorText } = error || {};
|
|
274
|
-
console.error(
|
|
275
|
-
`[DeviceWebos] getOsLanguage onFailure: [${errorCode}] ${errorText}`,
|
|
276
|
-
);
|
|
277
|
-
resolve('');
|
|
278
|
-
},
|
|
279
|
-
});
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
|
|
283
248
|
async getVolume() {
|
|
284
249
|
// TODO: not yet implemented
|
|
285
250
|
return VolumeRange.UNSUPPORTED;
|
|
@@ -345,16 +310,4 @@ export class DeviceWebos extends DeviceBase {
|
|
|
345
310
|
// Not supported on LG webOS platform (for date 12.4.2021, latest webOS TV 5.x)
|
|
346
311
|
return '';
|
|
347
312
|
}
|
|
348
|
-
|
|
349
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
350
|
-
async purchaseProduct(data: IAPPurchaseProductData): Promise<IAPSuccessPayload> {
|
|
351
|
-
// not supported
|
|
352
|
-
throw new Error('Not supported');
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
356
|
-
async cancelSubscription(data: IAPPurchaseProductData): Promise<void> {
|
|
357
|
-
// not supported
|
|
358
|
-
throw new Error('Not supported');
|
|
359
|
-
}
|
|
360
313
|
}
|
|
@@ -63,39 +63,6 @@ const mockServices = {
|
|
|
63
63
|
callbackName: 'onSuccess',
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
|
-
'luna://com.webos.settingsservice#getSystemSettings': {
|
|
67
|
-
responses: {
|
|
68
|
-
success: {
|
|
69
|
-
returnValue: true,
|
|
70
|
-
method: 'getSystemSettings',
|
|
71
|
-
settings: {
|
|
72
|
-
localeInfo: {
|
|
73
|
-
locales: {
|
|
74
|
-
UI: 'en-GB',
|
|
75
|
-
TV: 'en-GB',
|
|
76
|
-
FMT: 'en-GB',
|
|
77
|
-
NLP: 'en-GB',
|
|
78
|
-
STT: 'fr-FR',
|
|
79
|
-
AUD: 'fr-FR',
|
|
80
|
-
AUD2: 'en-GB',
|
|
81
|
-
},
|
|
82
|
-
clock: 'locale',
|
|
83
|
-
keyboards: ['en'],
|
|
84
|
-
timezone: '',
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
error: {
|
|
89
|
-
returnValue: false,
|
|
90
|
-
errorCode: 'ERR.001',
|
|
91
|
-
errorText: 'There is no matched result from DB',
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
selected: {
|
|
95
|
-
responseId: 'success',
|
|
96
|
-
callbackName: 'onSuccess',
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
66
|
'luna://com.webos.service.connectionmanager#getStatus': {
|
|
100
67
|
responses: {
|
|
101
68
|
successWired: {
|
|
@@ -17,5 +17,4 @@ export const ApiUrls = {
|
|
|
17
17
|
CONNECTION_MANAGER_WEBOS: 'luna://com.webos.service.connectionmanager',
|
|
18
18
|
SYSTEM_PROPERTY: 'luna://com.webos.service.tv.systemproperty',
|
|
19
19
|
SM: 'luna://com.webos.service.sm',
|
|
20
|
-
SETTINGS_SERVICE: 'luna://com.webos.settingsservice',
|
|
21
20
|
} as const;
|
|
@@ -331,41 +331,11 @@ export type DuidOptions = {
|
|
|
331
331
|
onComplete?: (response: NegativeResponse | DuidResponse) => any,
|
|
332
332
|
};
|
|
333
333
|
|
|
334
|
-
type SettingsService = {
|
|
335
|
-
method: 'getSystemSettings',
|
|
336
|
-
settings: {
|
|
337
|
-
localeInfo: {
|
|
338
|
-
locales: {
|
|
339
|
-
UI: string,
|
|
340
|
-
TV: string,
|
|
341
|
-
FMT: string,
|
|
342
|
-
NLP: string,
|
|
343
|
-
STT: string,
|
|
344
|
-
AUD: string,
|
|
345
|
-
AUD2: string,
|
|
346
|
-
},
|
|
347
|
-
clock: string,
|
|
348
|
-
keyboards: string[],
|
|
349
|
-
timezone: string,
|
|
350
|
-
},
|
|
351
|
-
},
|
|
352
|
-
};
|
|
353
|
-
export type SettingsServiceResponse = PositiveResponse & SettingsService;
|
|
354
|
-
export type SettingsServiceOptions = {
|
|
355
|
-
method: 'getSystemSettings',
|
|
356
|
-
parameters: {
|
|
357
|
-
keys: ['localeInfo'],
|
|
358
|
-
},
|
|
359
|
-
onSuccess?: (response: NegativeResponse | SettingsServiceResponse) => any,
|
|
360
|
-
onFailure?: (response: NegativeResponse) => any,
|
|
361
|
-
};
|
|
362
|
-
|
|
363
334
|
interface RequestTypeMap {
|
|
364
335
|
[ApiUrls.CONNECTION_MANAGER_PALM]: ConnectionManagerOptions,
|
|
365
336
|
[ApiUrls.CONNECTION_MANAGER_WEBOS]: ConnectionManagerOptions,
|
|
366
337
|
[ApiUrls.SYSTEM_PROPERTY]: SystemPropertyOptions,
|
|
367
338
|
[ApiUrls.SM]: DuidOptions,
|
|
368
|
-
[ApiUrls.SETTINGS_SERVICE]: SettingsServiceOptions,
|
|
369
339
|
}
|
|
370
340
|
|
|
371
341
|
// MARK: IPalmSystem
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DeviceBase,
|
|
3
|
-
IAPPurchaseProductData,
|
|
4
|
-
IAPSuccessPayload,
|
|
5
|
-
ScreenSaverStatus,
|
|
6
|
-
VolumeRange,
|
|
7
|
-
} from '@24i/bigscreen-sdk/driver-base';
|
|
1
|
+
import { DeviceBase, ScreenSaverStatus, VolumeRange } from '@24i/bigscreen-sdk/driver-base';
|
|
8
2
|
import { runAsync } from '@24i/bigscreen-sdk/utils/timers';
|
|
9
3
|
import { generateUuid } from '@24i/bigscreen-sdk/utils/generateUuid';
|
|
10
4
|
import { find } from '@24i/bigscreen-sdk/perf-utils/array';
|
|
@@ -158,17 +152,6 @@ export class DeviceXbox extends DeviceBase {
|
|
|
158
152
|
return uuid;
|
|
159
153
|
}
|
|
160
154
|
|
|
161
|
-
async getAdInfo() {
|
|
162
|
-
const adId = generateUuid();
|
|
163
|
-
const type = 'sessionid';
|
|
164
|
-
const latEnabled = null;
|
|
165
|
-
return { adId, type, latEnabled };
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
async getOsLanguage() {
|
|
169
|
-
return (window.navigator.language || '').slice(0, 2);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
155
|
async getVolume() {
|
|
173
156
|
return VolumeRange.UNSUPPORTED;
|
|
174
157
|
}
|
|
@@ -245,16 +228,4 @@ export class DeviceXbox extends DeviceBase {
|
|
|
245
228
|
getDeviceClass(): string {
|
|
246
229
|
return 'xbox';
|
|
247
230
|
}
|
|
248
|
-
|
|
249
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
250
|
-
async purchaseProduct(data: IAPPurchaseProductData): Promise<IAPSuccessPayload> {
|
|
251
|
-
// not supported
|
|
252
|
-
throw new Error('Not supported');
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
256
|
-
async cancelSubscription(data: IAPPurchaseProductData): Promise<void> {
|
|
257
|
-
// not supported
|
|
258
|
-
throw new Error('Not supported');
|
|
259
|
-
}
|
|
260
231
|
}
|
|
@@ -298,13 +298,13 @@ export class UnifiedGridController<T> implements IUnifiedGridController<T> {
|
|
|
298
298
|
const { grid } = this;
|
|
299
299
|
const base = grid.base.current!;
|
|
300
300
|
const targetScrollIndex = this.itemIndexToScrollIndex(dataIndex);
|
|
301
|
+
if (targetScrollIndex > this.scrollIndex) {
|
|
302
|
+
this.adjustGroupsOffsetsForward(targetScrollIndex);
|
|
303
|
+
} else if (targetScrollIndex < this.scrollIndex) {
|
|
304
|
+
this.adjustGroupsOffsetsBackward(targetScrollIndex);
|
|
305
|
+
}
|
|
301
306
|
if (targetScrollIndex !== this.scrollIndex) {
|
|
302
|
-
|
|
303
|
-
const lastScrollIndex = this.scrollIndex;
|
|
304
|
-
const scrollToIndex = Math.abs(targetScrollIndex - this.scrollIndex);
|
|
305
|
-
for (let i = 1; i <= scrollToIndex; i++) {
|
|
306
|
-
this.scroll(backwards ? lastScrollIndex - i : lastScrollIndex + i, animate);
|
|
307
|
-
}
|
|
307
|
+
this.scroll(targetScrollIndex, animate);
|
|
308
308
|
}
|
|
309
309
|
base.index = dataIndex;
|
|
310
310
|
this.focusCurrentItem();
|
package/packages/input/README.md
CHANGED
|
@@ -60,3 +60,6 @@ The reason for no styling is to limit unnecessary CSS code that would be overrid
|
|
|
60
60
|
`.native-input-wrap` is set to `display: none`. This is the native input used on the background.
|
|
61
61
|
|
|
62
62
|
`.input-field` is a custom component that should look like input field with possibility of custom styling.
|
|
63
|
+
|
|
64
|
+
`.caret` position is counted from the left side of the input in LTR layout and from the right side of the
|
|
65
|
+
input in RTL layout.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRef, Component,
|
|
1
|
+
import { createRef, Component, 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 { handleOverflow } from './
|
|
12
|
+
import { checkCharOrderMishmash, handleOverflow } from './utils';
|
|
13
13
|
import './Input.scss';
|
|
14
14
|
|
|
15
15
|
type Props = {
|
|
@@ -42,6 +42,8 @@ export class Input extends Component<Props> implements IFocusable {
|
|
|
42
42
|
|
|
43
43
|
caret = createRef<HTMLDivElement>();
|
|
44
44
|
|
|
45
|
+
caretPosition = 0;
|
|
46
|
+
|
|
45
47
|
isInputting = false;
|
|
46
48
|
|
|
47
49
|
lastValue: string;
|
|
@@ -68,6 +70,11 @@ export class Input extends Component<Props> implements IFocusable {
|
|
|
68
70
|
this.isPlaceholderVisible = value.length === 0;
|
|
69
71
|
}
|
|
70
72
|
|
|
73
|
+
componentDidMount() {
|
|
74
|
+
const { value } = this.props;
|
|
75
|
+
if (value) this.setText(value);
|
|
76
|
+
}
|
|
77
|
+
|
|
71
78
|
getType() {
|
|
72
79
|
return this.nativeInput.current?.type;
|
|
73
80
|
}
|
|
@@ -85,13 +92,10 @@ export class Input extends Component<Props> implements IFocusable {
|
|
|
85
92
|
|
|
86
93
|
onCaretPositionChange = (position: number | null) => {
|
|
87
94
|
if (position === null) return;
|
|
88
|
-
const { shouldHandleOverflow } = this.props;
|
|
89
95
|
const value = this.getValue();
|
|
90
|
-
|
|
91
|
-
this.
|
|
92
|
-
|
|
93
|
-
handleOverflow(this.wrap.current, this.caret.current, this.text.current);
|
|
94
|
-
}
|
|
96
|
+
this.setText(value);
|
|
97
|
+
this.updateCaretPosition(position);
|
|
98
|
+
this.updateTextOverflow();
|
|
95
99
|
if (this.lastValue !== value) {
|
|
96
100
|
const { onChange } = this.props;
|
|
97
101
|
this.lastValue = value;
|
|
@@ -106,33 +110,59 @@ export class Input extends Component<Props> implements IFocusable {
|
|
|
106
110
|
|
|
107
111
|
setValue(value: string) {
|
|
108
112
|
this.nativeInput.current!.value = value;
|
|
113
|
+
this.setText(value);
|
|
109
114
|
}
|
|
110
115
|
|
|
111
116
|
setType(type: Props['type']) {
|
|
112
117
|
if (this.getType() === type) return;
|
|
113
118
|
const value = this.getValue();
|
|
114
119
|
this.nativeInput.current!.type = type;
|
|
115
|
-
|
|
120
|
+
this.setText(value);
|
|
116
121
|
}
|
|
117
122
|
|
|
118
|
-
|
|
123
|
+
setText(text: string): void {
|
|
124
|
+
const filtered = this.filterText(text);
|
|
125
|
+
this.renderText(filtered);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
updateCaretPosition(position: number) {
|
|
119
129
|
const textNode = this.text.current!.firstChild;
|
|
120
|
-
if (!textNode) {
|
|
130
|
+
if (!textNode || position <= 0) {
|
|
131
|
+
this.caretPosition = 0;
|
|
121
132
|
offsetPosition(this.caret, { x: 0 });
|
|
122
133
|
return;
|
|
123
134
|
}
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
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);
|
|
136
166
|
}
|
|
137
167
|
|
|
138
168
|
/**
|
|
@@ -196,6 +226,14 @@ export class Input extends Component<Props> implements IFocusable {
|
|
|
196
226
|
return text.replace(/ /g, NBSP);
|
|
197
227
|
}
|
|
198
228
|
|
|
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
|
+
|
|
199
237
|
render() {
|
|
200
238
|
const { value, type, placeholder, onFocus, onBlur } = this.props;
|
|
201
239
|
return (
|
|
@@ -220,9 +258,7 @@ export class Input extends Component<Props> implements IFocusable {
|
|
|
220
258
|
>
|
|
221
259
|
{placeholder}
|
|
222
260
|
</div>
|
|
223
|
-
<div ref={this.text} className="text"
|
|
224
|
-
{this.filterText(value)}
|
|
225
|
-
</div>
|
|
261
|
+
<div ref={this.text} className="text" />
|
|
226
262
|
<div ref={this.caret} className="caret" />
|
|
227
263
|
</div>
|
|
228
264
|
</Interactable>
|