@applicaster/zapp-react-native-utils 16.0.0-alpha.5402127570 → 16.0.0-alpha.5548956531
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/actionsExecutor/ActionExecutor.ts +8 -10
- package/actionsExecutor/ActionExecutorContext.tsx +45 -325
- package/actionsExecutor/actions/__tests__/dismissBottomSheet.test.ts +22 -0
- package/actionsExecutor/actions/__tests__/loadItemsFromSource.test.ts +88 -0
- package/actionsExecutor/actions/__tests__/openBottomSheet.customContent.test.ts +76 -0
- package/actionsExecutor/actions/__tests__/showToast.test.ts +63 -0
- package/actionsExecutor/actions/appRestart.ts +24 -0
- package/actionsExecutor/actions/confirmDialog.ts +53 -0
- package/actionsExecutor/actions/dismissBottomSheet.ts +22 -0
- package/actionsExecutor/actions/index.ts +34 -0
- package/actionsExecutor/actions/localStorageRemove.ts +27 -0
- package/actionsExecutor/actions/localStorageSet.ts +28 -0
- package/actionsExecutor/actions/localStorageToggleFlag.ts +28 -0
- package/actionsExecutor/actions/navigateToScreen.ts +123 -0
- package/actionsExecutor/actions/openBottomSheet.ts +318 -0
- package/actionsExecutor/actions/refreshComponent.ts +85 -0
- package/actionsExecutor/actions/screenSetVariable.ts +35 -0
- package/actionsExecutor/actions/screenToggleFlag.ts +38 -0
- package/actionsExecutor/actions/sendCloudEvent.ts +96 -0
- package/actionsExecutor/actions/sessionStorageRemove.ts +19 -0
- package/actionsExecutor/actions/sessionStorageSet.ts +20 -0
- package/actionsExecutor/actions/sessionStorageToggleFlag.ts +15 -0
- package/actionsExecutor/actions/showToast.ts +31 -0
- package/actionsExecutor/actions/switchLayout.ts +40 -0
- package/actionsExecutor/types.ts +59 -0
- package/analyticsUtils/PlayerAnalyticsManager.ts +1 -1
- package/appUtils/contextKeysManager/__tests__/getKey/failure.test.ts +1 -1
- package/appUtils/contextKeysManager/__tests__/removeKey/failure.test.ts +1 -1
- package/appUtils/contextKeysManager/__tests__/setKey/failure/invalidKey.test.ts +4 -4
- package/appUtils/contextKeysManager/index.ts +1 -1
- package/appUtils/playerManager/OverlayObserver/OverlaysObserver.ts +12 -6
- package/appUtils/playerManager/__tests__/playerFactory.test.ts +1 -1
- package/appUtils/playerManager/{conts.ts → const.ts} +20 -0
- package/appUtils/playerManager/index.ts +1 -1
- package/appUtils/playerManager/player.ts +1 -1
- package/appUtils/playerManager/playerFactory.ts +1 -1
- package/appUtils/playerManager/playerNative.ts +1 -1
- package/appUtils/playerManager/usePlayerControllerSetup.tsx +1 -1
- package/appUtils/playerManager/userLanguagePreference.ts +1 -1
- package/arrayUtils/__tests__/{anyThruthy.test.ts → anyTruthy.test.ts} +8 -0
- package/arrayUtils/__tests__/arrayUtils.test.ts +165 -108
- package/arrayUtils/__tests__/isEmptyArray.test.ts +11 -0
- package/arrayUtils/__tests__/isFilledArray.test.ts +12 -0
- package/arrayUtils/__tests__/isFirst.test.ts +17 -0
- package/arrayUtils/__tests__/isIndexInRange.test.ts +14 -0
- package/arrayUtils/__tests__/isLast.test.ts +31 -0
- package/arrayUtils/__tests__/makeListOf.test.ts +31 -0
- package/arrayUtils/__tests__/makeListOfIndexes.test.ts +20 -0
- package/arrayUtils/__tests__/sample.test.ts +61 -0
- package/arrayUtils/index.ts +57 -20
- package/bottomSheet/__tests__/scrollContext.test.tsx +35 -0
- package/bottomSheet/index.ts +17 -0
- package/cellUtils/index.ts +3 -5
- package/colorUtils/__tests__/isTransparentColor.test.ts +76 -0
- package/colorUtils/__tests__/isValidColor.test.ts +70 -0
- package/colorUtils/index.ts +50 -0
- package/manifestUtils/_internals/index.js +6 -0
- package/manifestUtils/defaultManifestConfigurations/player.js +19 -19
- package/manifestUtils/fieldUtils/__tests__/fieldUtils.test.js +84 -0
- package/manifestUtils/fieldUtils/index.js +125 -0
- package/manifestUtils/keys.js +9 -0
- package/manifestUtils/mobileAction/button/index.js +16 -0
- package/manifestUtils/mobileAction/container/index.js +3 -1
- package/manifestUtils/mobileAction/groups/defaults.js +3 -1
- package/manifestUtils/platformIsTV.js +1 -0
- package/modalState/ContentViewModel.ts +111 -0
- package/modalState/EditableCollection.ts +17 -0
- package/modalState/EditableCollectionRegistry.ts +51 -0
- package/modalState/ModalOrchestrator.ts +198 -0
- package/modalState/RemoteEditableCollection.ts +189 -0
- package/modalState/__tests__/ContentViewModel.editable.test.ts +69 -0
- package/modalState/__tests__/ContentViewModel.test.ts +165 -0
- package/modalState/__tests__/EditableCollectionRegistry.test.ts +112 -0
- package/modalState/__tests__/ModalOrchestrator.phase3.test.ts +28 -0
- package/modalState/__tests__/RemoteEditableCollection.test.ts +259 -0
- package/modalState/__tests__/useBottomSheetContent.test.ts +372 -0
- package/modalState/index.ts +30 -83
- package/modalState/store.ts +102 -0
- package/modalState/types.ts +110 -0
- package/modalState/useBottomSheetContent.ts +98 -0
- package/numberUtils/__tests__/isMinusZero.test.ts +20 -0
- package/numberUtils/__tests__/isZero.test.ts +27 -0
- package/numberUtils/__tests__/requireNumber.test.ts +50 -0
- package/numberUtils/__tests__/toNumber.test.ts +27 -0
- package/numberUtils/__tests__/toNumberWithDefault.test.ts +64 -0
- package/numberUtils/__tests__/toNumberWithDefaultZero.test.ts +48 -0
- package/numberUtils/index.ts +27 -8
- package/package.json +2 -2
- package/pipesUtils/__tests__/buildUrlWithQuery.test.ts +33 -0
- package/pipesUtils/__tests__/withPipesEndpoint.test.tsx +56 -0
- package/pipesUtils/index.ts +1 -0
- package/pipesUtils/withPipesEndpoint.tsx +54 -0
- package/reactHooks/actions/index.ts +51 -1
- package/reactHooks/cell-click/index.ts +3 -3
- package/reactHooks/feed/__mocks__/useMarkPipesDataStale.ts +4 -0
- package/reactHooks/feed/__tests__/useInflatedUrl.test.tsx +25 -0
- package/reactHooks/feed/index.ts +5 -1
- package/reactHooks/feed/useBatchLoading.ts +9 -1
- package/reactHooks/feed/{usePipesCacheReset.ts → useMarkPipesDataStale.ts} +12 -4
- package/reactHooks/layout/index.ts +1 -1
- package/reactHooks/navigation/__mocks__/index.ts +4 -0
- package/reactHooks/navigation/__tests__/useIsScreenActive.test.ts +42 -0
- package/reactHooks/navigation/index.ts +1 -1
- package/reactHooks/navigation/useIsScreenActive.ts +29 -8
- package/reactHooks/state/useComponentScreenState.ts +1 -1
- package/reactHooks/utils/index.ts +3 -2
- package/riverComponetsMeasurementProvider/index.tsx +12 -8
- package/stringUtils/__tests__/stringUtils.test.js +42 -0
- package/stringUtils/index.ts +2 -2
- package/uiActionsRegistrator/index.ts +203 -0
- package/zappFrameworkUtils/__tests__/localStorageHelper.test.ts +146 -0
- package/zappFrameworkUtils/localStorageHelper.ts +9 -13
- package/reactHooks/feed/__mocks__/usePipesCacheReset.ts +0 -1
- /package/reactHooks/actions/__tests__/{index.test.js → index.test.tsx} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="@applicaster/applicaster-types" />
|
|
2
|
+
import { localStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/LocalStorage";
|
|
3
|
+
import * as QuickBrickManager from "@applicaster/zapp-react-native-bridge/QuickBrick";
|
|
4
|
+
import { QUICK_BRICK_EVENTS } from "@applicaster/zapp-react-native-bridge/QuickBrick";
|
|
5
|
+
import { ACTIVE_LAYOUT_ID_STORAGE_KEY } from "@applicaster/quick-brick-core/App/remoteContextReloader/consts";
|
|
6
|
+
import { ActionResult } from "../ActionExecutor";
|
|
7
|
+
import { ActionHandler } from "../types";
|
|
8
|
+
import { createLogger } from "../../logger";
|
|
9
|
+
|
|
10
|
+
const { log_info } = createLogger({
|
|
11
|
+
subsystem: "ActionExecutorContext",
|
|
12
|
+
category: "General",
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Options for the switchLayout action.
|
|
17
|
+
*/
|
|
18
|
+
export interface SwitchLayoutOptions {
|
|
19
|
+
/** The ID of the layout to switch to */
|
|
20
|
+
layoutId: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Switches the active layout and triggers an app reload.
|
|
25
|
+
* Saves the new layout ID to local storage before reloading.
|
|
26
|
+
*/
|
|
27
|
+
export const switchLayoutAction: ActionHandler<SwitchLayoutOptions> = async (
|
|
28
|
+
action
|
|
29
|
+
): Promise<ActionResult> => {
|
|
30
|
+
log_info("handleAction: switchLayout event");
|
|
31
|
+
|
|
32
|
+
await localStorage.setItem(
|
|
33
|
+
ACTIVE_LAYOUT_ID_STORAGE_KEY,
|
|
34
|
+
action.options.layoutId
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
QuickBrickManager.sendQuickBrickEvent(QUICK_BRICK_EVENTS.FORCE_APP_RELOAD);
|
|
38
|
+
|
|
39
|
+
return ActionResult.Success;
|
|
40
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/// <reference types="@applicaster/applicaster-types" />
|
|
2
|
+
import { ActionResult } from "./ActionExecutor";
|
|
3
|
+
import { useScreenStateStore } from "../reactHooks/navigation/useScreenStateStore";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Base context object passed to action handlers during execution.
|
|
7
|
+
* Contains references to the current entry, screen, and other execution state.
|
|
8
|
+
*/
|
|
9
|
+
export interface ActionExecutionContext {
|
|
10
|
+
/** The entry associated with this action (e.g., the item that was tapped) */
|
|
11
|
+
entry?: ZappEntry;
|
|
12
|
+
|
|
13
|
+
/** The current screen/river data */
|
|
14
|
+
screenData?: ZappRiver;
|
|
15
|
+
|
|
16
|
+
/** The entry that defines the screen (if screen was opened from an entry) */
|
|
17
|
+
screenEntry?: ZappEntry;
|
|
18
|
+
|
|
19
|
+
/** The UI component that triggered the action.
|
|
20
|
+
* From UIComponentContext as `{ ...component, parent }`.
|
|
21
|
+
*/
|
|
22
|
+
component?: ZappUIComponent & { parent?: ZappUIComponent };
|
|
23
|
+
|
|
24
|
+
/** The route identifier for the current screen */
|
|
25
|
+
screenRoute?: string;
|
|
26
|
+
|
|
27
|
+
/** The screen state store for managing screen-level state (Zustand store) */
|
|
28
|
+
screenStateStore?: ReturnType<typeof useScreenStateStore>;
|
|
29
|
+
|
|
30
|
+
/** Context entry for additional data */
|
|
31
|
+
entryContext?: ZappEntry;
|
|
32
|
+
|
|
33
|
+
/** Callback function for action completion */
|
|
34
|
+
callback?: (result: { success: boolean; error: any; abort: boolean }) => void;
|
|
35
|
+
|
|
36
|
+
screenState?: Record<any, any>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Type for action handler functions.
|
|
41
|
+
* Handlers receive the action (which may have typed options) and execution context.
|
|
42
|
+
*
|
|
43
|
+
* @template _TOptions - Optional type hint for the action's options object (for documentation/intellisense)
|
|
44
|
+
* @param action - The action to execute
|
|
45
|
+
* @param context - The execution context
|
|
46
|
+
* @returns A promise that resolves to the action result
|
|
47
|
+
*/
|
|
48
|
+
export type ActionHandler<_TOptions = any> = (
|
|
49
|
+
action: ActionType,
|
|
50
|
+
context?: ActionExecutionContext
|
|
51
|
+
) => Promise<ActionResult>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Factory function that creates an action handler.
|
|
55
|
+
* Used for actions that need to capture dependencies at registration time.
|
|
56
|
+
*/
|
|
57
|
+
export type ActionHandlerFactory<_TOptions = any> = (
|
|
58
|
+
...dependencies: any[]
|
|
59
|
+
) => ActionHandler<_TOptions>;
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "../appUtils/playerManager";
|
|
9
9
|
import { Player } from "../appUtils/playerManager/player";
|
|
10
10
|
import { AnalyticPlayerListener } from "./AnalyticPlayerListener";
|
|
11
|
-
import { PlayerRole } from "../appUtils/playerManager/
|
|
11
|
+
import { PlayerRole } from "../appUtils/playerManager/const";
|
|
12
12
|
|
|
13
13
|
enum PlayerAnalyticsTrackerType {
|
|
14
14
|
PlayerAnalyticsTracker = "PlayerAnalyticsTracker",
|
|
@@ -46,7 +46,7 @@ describe("Context Keys Manager - getKey", () => {
|
|
|
46
46
|
|
|
47
47
|
expect(mockedLogger.warn).toHaveBeenCalledWith({
|
|
48
48
|
message:
|
|
49
|
-
"Provided key is not valid -
|
|
49
|
+
"Provided key is not valid - expecting an object with namespace and key properties",
|
|
50
50
|
data: { key: invalidKey },
|
|
51
51
|
});
|
|
52
52
|
|
|
@@ -47,7 +47,7 @@ describe("Context Keys Manager - removeKey", () => {
|
|
|
47
47
|
|
|
48
48
|
expect(mockedLogger.warn).toHaveBeenCalledWith({
|
|
49
49
|
message:
|
|
50
|
-
"Provided key is not valid -
|
|
50
|
+
"Provided key is not valid - expecting an object with namespace and key properties",
|
|
51
51
|
data: { key },
|
|
52
52
|
});
|
|
53
53
|
|
|
@@ -48,7 +48,7 @@ describe("Context Keys Manager - setKey", () => {
|
|
|
48
48
|
|
|
49
49
|
expect(mockedLogger.warn).toHaveBeenCalledWith({
|
|
50
50
|
message:
|
|
51
|
-
"Provided key is not valid -
|
|
51
|
+
"Provided key is not valid - expecting an object with namespace and key properties",
|
|
52
52
|
data: { key },
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -105,7 +105,7 @@ describe("Context Keys Manager - setKey", () => {
|
|
|
105
105
|
|
|
106
106
|
expect(mockedLogger.warn).toHaveBeenCalledWith({
|
|
107
107
|
message:
|
|
108
|
-
"Provided key is not valid -
|
|
108
|
+
"Provided key is not valid - expecting an object with namespace and key properties",
|
|
109
109
|
data: { key },
|
|
110
110
|
});
|
|
111
111
|
|
|
@@ -162,7 +162,7 @@ describe("Context Keys Manager - setKey", () => {
|
|
|
162
162
|
|
|
163
163
|
expect(mockedLogger.warn).toHaveBeenCalledWith({
|
|
164
164
|
message:
|
|
165
|
-
"Provided key is not valid -
|
|
165
|
+
"Provided key is not valid - expecting an object with namespace and key properties",
|
|
166
166
|
data: { key },
|
|
167
167
|
});
|
|
168
168
|
|
|
@@ -217,7 +217,7 @@ describe("Context Keys Manager - setKey", () => {
|
|
|
217
217
|
|
|
218
218
|
expect(mockedLogger.warn).toHaveBeenCalledWith({
|
|
219
219
|
message:
|
|
220
|
-
"Provided key is not valid -
|
|
220
|
+
"Provided key is not valid - expecting an object with namespace and key properties",
|
|
221
221
|
data: { key },
|
|
222
222
|
});
|
|
223
223
|
|
|
@@ -109,7 +109,7 @@ export class ContextKeysManager {
|
|
|
109
109
|
if (!keyIsValid(parsedKey)) {
|
|
110
110
|
this._logger.warn({
|
|
111
111
|
message:
|
|
112
|
-
"Provided key is not valid -
|
|
112
|
+
"Provided key is not valid - expecting an object with namespace and key properties",
|
|
113
113
|
data: { key },
|
|
114
114
|
});
|
|
115
115
|
|
|
@@ -59,6 +59,7 @@ type PlayNextConfig = {
|
|
|
59
59
|
export type PlayNextState = PlayNextConfig & {
|
|
60
60
|
triggerTime: number;
|
|
61
61
|
handleUserCancelPlayNext: () => void;
|
|
62
|
+
hidePlayNext: () => void;
|
|
62
63
|
};
|
|
63
64
|
|
|
64
65
|
export class OverlaysObserver {
|
|
@@ -76,7 +77,7 @@ export class OverlaysObserver {
|
|
|
76
77
|
private chapterMarkerEvents: ChapterMarkerEvent[];
|
|
77
78
|
readonly player: Player;
|
|
78
79
|
private playNextConfig?: PlayNextConfig;
|
|
79
|
-
private
|
|
80
|
+
private isPlayNextSuppressed = false;
|
|
80
81
|
|
|
81
82
|
constructor({ player }: ChapterMarkersObserverProps) {
|
|
82
83
|
this.chapterSubject = new BehaviorSubject(null);
|
|
@@ -143,11 +144,15 @@ export class OverlaysObserver {
|
|
|
143
144
|
return this.titleSummarySubject.asObservable().pipe(distinctUntilChanged());
|
|
144
145
|
}
|
|
145
146
|
|
|
146
|
-
|
|
147
|
-
this.
|
|
147
|
+
hidePlayNext = () => {
|
|
148
|
+
this.isPlayNextSuppressed = true;
|
|
148
149
|
this.playNextSubject.next(null);
|
|
149
150
|
};
|
|
150
151
|
|
|
152
|
+
handleUserCancelPlayNext = () => {
|
|
153
|
+
this.hidePlayNext();
|
|
154
|
+
};
|
|
155
|
+
|
|
151
156
|
preparePlayNext = async () => {
|
|
152
157
|
try {
|
|
153
158
|
const plugins = appStore.get("plugins");
|
|
@@ -270,7 +275,7 @@ export class OverlaysObserver {
|
|
|
270
275
|
|
|
271
276
|
// TODO: Hack for video end, will be replaced with playlist prev/next in the future
|
|
272
277
|
getPlayNextEntry = () =>
|
|
273
|
-
!this.
|
|
278
|
+
!this.isPlayNextSuppressed ? this.playNextConfig?.entry : null;
|
|
274
279
|
|
|
275
280
|
prepareChapterMarkers = () => {
|
|
276
281
|
const chapterMarkers: ChapterMarkerOriginal[] =
|
|
@@ -353,7 +358,7 @@ export class OverlaysObserver {
|
|
|
353
358
|
const shouldPlayNextBeVisible = currentTime > triggerTime;
|
|
354
359
|
|
|
355
360
|
if (shouldPlayNextBeVisible) {
|
|
356
|
-
if (this.
|
|
361
|
+
if (this.isPlayNextSuppressed) {
|
|
357
362
|
return;
|
|
358
363
|
}
|
|
359
364
|
|
|
@@ -361,10 +366,11 @@ export class OverlaysObserver {
|
|
|
361
366
|
...this.playNextConfig,
|
|
362
367
|
triggerTime,
|
|
363
368
|
handleUserCancelPlayNext: this.handleUserCancelPlayNext,
|
|
369
|
+
hidePlayNext: this.hidePlayNext,
|
|
364
370
|
});
|
|
365
371
|
} else {
|
|
366
372
|
this.playNextSubject.next(null);
|
|
367
|
-
this.
|
|
373
|
+
this.isPlayNextSuppressed = false;
|
|
368
374
|
}
|
|
369
375
|
};
|
|
370
376
|
|
|
@@ -10,7 +10,7 @@ jest.mock("@applicaster/zapp-react-native-utils/pluginUtils", () => ({
|
|
|
10
10
|
mockFindPluginByIdentifier(id, plugins),
|
|
11
11
|
}));
|
|
12
12
|
|
|
13
|
-
import { PlayerRole } from "../
|
|
13
|
+
import { PlayerRole } from "../const";
|
|
14
14
|
import { playerFactory } from "../playerFactory";
|
|
15
15
|
|
|
16
16
|
const fakeComponent = () => null;
|
|
@@ -67,3 +67,23 @@ export enum PlayerRole {
|
|
|
67
67
|
Chromecast = "Chromecast",
|
|
68
68
|
Unspecified = "Unspecified",
|
|
69
69
|
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The playback engine backing a web player. Published on
|
|
73
|
+
* `window.applicaster.playerType` when a player is created, so that plugins
|
|
74
|
+
* observing the player can tell which engine they are looking at instead of
|
|
75
|
+
* inferring it from the API the instance happens to expose.
|
|
76
|
+
*
|
|
77
|
+
* Keep in sync with `ApplicasterGlobals["playerType"]` in applicaster-types.
|
|
78
|
+
*/
|
|
79
|
+
export enum WebPlayerEngine {
|
|
80
|
+
Videojs = "videojs",
|
|
81
|
+
Hlsjs = "hlsjs",
|
|
82
|
+
Dashjs = "dashjs",
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export enum PLAYER_EVENTS {
|
|
86
|
+
PlayNextTriggered = "play_next_triggered",
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export type PlayNextTriggeredEvent = { id: string };
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
unsubscribeToDeviceNetworkChanges,
|
|
10
10
|
} from "@applicaster/quick-brick-core/App/NetworkStatusProvider/utils";
|
|
11
11
|
import { setUserLanguagePreference } from "./userLanguagePreference";
|
|
12
|
-
import { PlayerRole } from "./
|
|
12
|
+
import { PlayerRole } from "./const";
|
|
13
13
|
import { RNPlayerManager } from "./nativePlayerManager";
|
|
14
14
|
|
|
15
15
|
const { log_error, log_debug, log_warning } = createLogger({
|
|
@@ -3,7 +3,7 @@ import { BehaviorSubject } from "rxjs";
|
|
|
3
3
|
import { isEmptyOrNil } from "@applicaster/zapp-react-native-utils/cellUtils";
|
|
4
4
|
import { createLogger, utilsLogger } from "../../logger";
|
|
5
5
|
import { getBoolFromConfigValue } from "../../configurationUtils";
|
|
6
|
-
import { PlayerRole, SharedPlayerCallBacksKeys } from "./
|
|
6
|
+
import { PlayerRole, SharedPlayerCallBacksKeys } from "./const";
|
|
7
7
|
import { OverlaysObserver } from "./OverlayObserver/OverlaysObserver";
|
|
8
8
|
import { TVSeekController } from "../../reactHooks/player/TVSeekControlller/TVSeekController";
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { appStore } from "@applicaster/zapp-react-native-redux/AppStore";
|
|
2
2
|
import { findPluginByIdentifier } from "@applicaster/zapp-react-native-utils/pluginUtils";
|
|
3
3
|
import { Player } from "./player";
|
|
4
|
-
import { PlayerRole } from "./
|
|
4
|
+
import { PlayerRole } from "./const";
|
|
5
5
|
|
|
6
6
|
type PlayerFactoryItem = {
|
|
7
7
|
Component: any;
|
|
@@ -3,7 +3,7 @@ import { isEmptyOrNil } from "@applicaster/zapp-react-native-utils/cellUtils";
|
|
|
3
3
|
import { createLogger, utilsLogger } from "../../logger";
|
|
4
4
|
import { Player } from "./player";
|
|
5
5
|
import { findNodeHandle } from "react-native";
|
|
6
|
-
import { PlayerRole } from "./
|
|
6
|
+
import { PlayerRole } from "./const";
|
|
7
7
|
import { toBooleanWithDefaultFalse } from "../../booleanUtils";
|
|
8
8
|
import { RNPlayerManager } from "./nativePlayerManager";
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import { useConfiguration } from "../../reactHooks/useConfiguration";
|
|
|
3
3
|
import { useEffect } from "react";
|
|
4
4
|
import { playerManager } from "./index";
|
|
5
5
|
import { useValidatePlayerConfig } from "../../playerUtils/useValidatePlayerConfig";
|
|
6
|
-
import { PlayerRole } from "./
|
|
6
|
+
import { PlayerRole } from "./const";
|
|
7
7
|
import { isAppleTV } from "@applicaster/zapp-react-native-ui-components/Helpers/Platform";
|
|
8
8
|
import { TVSeekController } from "../../reactHooks/player/TVSeekControlller/TVSeekController";
|
|
9
9
|
import { KeyInputHandler } from "../keyInputHandler/KeyInputHandler";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { localStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/LocalStorage";
|
|
2
2
|
import { sessionStorage } from "@applicaster/zapp-react-native-bridge/ZappStorage/SessionStorage";
|
|
3
3
|
import { createLogger, utilsLogger } from "../../logger";
|
|
4
|
-
import { userPreferencesNamespace } from "./
|
|
4
|
+
import { userPreferencesNamespace } from "./const";
|
|
5
5
|
|
|
6
6
|
export const preferredAudioLanguageStorageKey = "preferred_audio_language";
|
|
7
7
|
|
|
@@ -21,4 +21,12 @@ describe("anyTruthy", () => {
|
|
|
21
21
|
expect(anyTruthy([true])).toBe(true);
|
|
22
22
|
expect(anyTruthy([false])).toBe(false);
|
|
23
23
|
});
|
|
24
|
+
|
|
25
|
+
it("should return true when the first value is true", () => {
|
|
26
|
+
expect(anyTruthy([true, false, false])).toBe(true);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("should return true when only the last value is true", () => {
|
|
30
|
+
expect(anyTruthy([false, false, true])).toBe(true);
|
|
31
|
+
});
|
|
24
32
|
});
|