@applicaster/zapp-react-native-utils 15.0.0-alpha.1121049279 → 15.0.0-alpha.1123384087
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/README.md +0 -6
- package/actionsExecutor/ActionExecutorContext.tsx +3 -6
- package/actionsExecutor/feedDecorator.ts +6 -6
- package/adsUtils/__tests__/createVMAP.test.ts +419 -0
- package/adsUtils/index.ts +2 -2
- package/analyticsUtils/README.md +1 -1
- package/analyticsUtils/analyticsMapper.ts +10 -2
- package/appDataUtils/__tests__/urlScheme.test.ts +678 -0
- package/appUtils/HooksManager/__tests__/__snapshots__/hooksManager.test.js.snap +0 -188
- package/appUtils/HooksManager/__tests__/hooksManager.test.js +16 -2
- package/appUtils/HooksManager/index.ts +10 -10
- package/appUtils/RiverFocusManager/{index.js → index.ts} +25 -18
- package/appUtils/accessibilityManager/__tests__/utils.test.ts +360 -0
- package/appUtils/accessibilityManager/const.ts +4 -0
- package/appUtils/accessibilityManager/hooks.ts +20 -13
- package/appUtils/accessibilityManager/index.ts +28 -1
- package/appUtils/accessibilityManager/utils.ts +59 -8
- package/appUtils/contextKeysManager/__tests__/getKeys/failure.test.ts +7 -2
- package/appUtils/contextKeysManager/__tests__/getKeys/success.test.ts +48 -0
- package/appUtils/contextKeysManager/contextResolver.ts +51 -22
- package/appUtils/contextKeysManager/index.ts +65 -10
- package/appUtils/focusManager/__tests__/__snapshots__/focusManager.test.js.snap +4 -0
- package/appUtils/focusManager/index.ios.ts +59 -3
- package/appUtils/focusManager/treeDataStructure/Tree/__tests__/Tree.test.js +46 -0
- package/appUtils/focusManager/treeDataStructure/Tree/index.js +18 -18
- package/appUtils/focusManagerAux/utils/index.ios.ts +122 -0
- package/appUtils/focusManagerAux/utils/index.ts +21 -5
- package/appUtils/focusManagerAux/utils/utils.ios.ts +234 -0
- package/appUtils/keyCodes/keys/keys.web.ts +1 -4
- package/appUtils/orientationHelper.ts +2 -4
- package/appUtils/platform/platformUtils.ts +117 -18
- package/appUtils/playerManager/OverlayObserver/OverlaysObserver.ts +94 -4
- package/appUtils/playerManager/OverlayObserver/utils.ts +32 -20
- package/appUtils/playerManager/player.ts +4 -0
- package/appUtils/playerManager/playerNative.ts +31 -17
- package/appUtils/playerManager/usePlayerState.tsx +14 -2
- package/arrayUtils/__tests__/allTruthy.test.ts +24 -0
- package/arrayUtils/__tests__/anyThruthy.test.ts +24 -0
- package/arrayUtils/index.ts +5 -0
- package/cellUtils/index.ts +32 -0
- package/cloudEventsUtils/__tests__/index.test.ts +529 -0
- package/cloudEventsUtils/index.ts +65 -1
- package/configurationUtils/__tests__/imageSrcFromMediaItem.test.ts +38 -0
- package/configurationUtils/__tests__/manifestKeyParser.test.ts +26 -26
- package/configurationUtils/index.ts +17 -11
- package/dateUtils/__tests__/dayjs.test.ts +330 -0
- package/enumUtils/__tests__/getEnumKeyByEnumValue.test.ts +207 -0
- package/errorUtils/__tests__/GeneralError.test.ts +97 -0
- package/errorUtils/__tests__/HttpStatusCode.test.ts +344 -0
- package/errorUtils/__tests__/MissingPluginError.test.ts +113 -0
- package/errorUtils/__tests__/NetworkError.test.ts +202 -0
- package/errorUtils/__tests__/getParsedResponse.test.ts +188 -0
- package/errorUtils/__tests__/invariant.test.ts +112 -0
- package/focusManager/aux/index.ts +1 -1
- package/headersUtils/__tests__/headersUtils.test.js +11 -1
- package/headersUtils/index.ts +2 -1
- package/manifestUtils/_internals/__tests__/index.test.js +41 -0
- package/manifestUtils/_internals/index.js +33 -0
- package/manifestUtils/defaultManifestConfigurations/player.js +109 -11
- package/manifestUtils/fieldUtils/__tests__/fieldUtils.test.js +49 -0
- package/manifestUtils/fieldUtils/index.js +54 -0
- package/manifestUtils/index.js +6 -0
- package/manifestUtils/keys.js +261 -0
- package/manifestUtils/mobileAction/button/__tests__/mobileActionButton.test.js +168 -0
- package/manifestUtils/mobileAction/button/index.js +140 -0
- package/manifestUtils/mobileAction/container/__tests__/mobileActionButtonsContainer.test.js +104 -0
- package/manifestUtils/mobileAction/container/index.js +79 -0
- package/manifestUtils/mobileAction/groups/__tests__/buildMobileActionButtonGroups.test.js +127 -0
- package/manifestUtils/mobileAction/groups/defaults.js +77 -0
- package/manifestUtils/mobileAction/groups/index.js +80 -0
- package/manifestUtils/platformIsTV.js +13 -0
- package/manifestUtils/sharedConfiguration/screenPicker/utils.js +1 -0
- package/manifestUtils/tvAction/container/index.js +1 -1
- package/navigationUtils/index.ts +15 -5
- package/numberUtils/__tests__/toNumber.test.ts +27 -0
- package/numberUtils/__tests__/toPositiveNumber.test.ts +193 -0
- package/numberUtils/index.ts +23 -1
- package/package.json +4 -4
- package/playerUtils/usePlayerTTS.ts +8 -3
- package/pluginUtils/index.ts +4 -0
- package/reactHooks/advertising/index.ts +2 -2
- package/reactHooks/analytics/__tests__/useSendAnalyticsOnPress.test.ts +537 -0
- package/reactHooks/app/__tests__/useAppState.test.ts +1 -1
- package/reactHooks/autoscrolling/__tests__/useTrackCurrentAutoScrollingElement.test.ts +1 -1
- package/reactHooks/autoscrolling/__tests__/useTrackedView.test.tsx +1 -2
- package/reactHooks/cell-click/__tests__/index.test.js +1 -3
- package/reactHooks/configuration/__tests__/index.test.tsx +1 -1
- package/reactHooks/connection/__tests__/index.test.js +1 -1
- package/reactHooks/debugging/__tests__/index.test.js +4 -4
- package/reactHooks/dev/__tests__/useReRenderLog.test.ts +188 -0
- package/reactHooks/device/useIsTablet.tsx +14 -19
- package/reactHooks/device/useMemoizedIsTablet.ts +3 -3
- package/reactHooks/events/index.ts +20 -0
- package/reactHooks/feed/__tests__/useBatchLoading.test.tsx +32 -23
- package/reactHooks/feed/__tests__/useBuildPipesUrl.test.tsx +19 -19
- package/reactHooks/feed/__tests__/useEntryScreenId.test.tsx +4 -1
- package/reactHooks/feed/__tests__/useFeedLoader.test.tsx +42 -30
- package/reactHooks/feed/__tests__/{useInflatedUrl.test.ts → useInflatedUrl.test.tsx} +62 -7
- package/reactHooks/feed/index.ts +0 -2
- package/reactHooks/feed/useBatchLoading.ts +7 -1
- package/reactHooks/feed/useEntryScreenId.ts +2 -2
- package/reactHooks/feed/useInflatedUrl.ts +44 -18
- package/reactHooks/feed/usePipesCacheReset.ts +3 -1
- package/reactHooks/flatList/useLoadNextPageIfNeeded.ts +13 -16
- package/reactHooks/hookModal/hooks/useHookModalScreenData.ts +12 -8
- package/reactHooks/index.ts +2 -0
- package/reactHooks/layout/__tests__/index.test.tsx +1 -1
- package/reactHooks/layout/__tests__/useLayoutVersion.test.tsx +1 -1
- package/reactHooks/layout/index.ts +1 -1
- package/reactHooks/layout/useDimensions/__tests__/{useDimensions.test.ts → useDimensions.test.tsx} +105 -25
- package/reactHooks/layout/useDimensions/useDimensions.ts +2 -2
- package/reactHooks/navigation/__tests__/index.test.tsx +40 -9
- package/reactHooks/navigation/index.ts +27 -11
- package/reactHooks/navigation/useRoute.ts +11 -7
- package/reactHooks/player/TVSeekControlller/TVSeekController.ts +27 -10
- package/reactHooks/player/__tests__/useAutoSeek._test.tsx +1 -1
- package/reactHooks/player/__tests__/useTapSeek._test.ts +1 -1
- package/reactHooks/resolvers/__tests__/useCellResolver.test.tsx +1 -1
- package/reactHooks/resolvers/__tests__/useComponentResolver.test.tsx +1 -1
- package/reactHooks/resolvers/useCellResolver.ts +6 -2
- package/reactHooks/resolvers/useComponentResolver.ts +8 -2
- package/reactHooks/screen/__tests__/useCurrentScreenData.test.tsx +2 -2
- package/reactHooks/screen/__tests__/useScreenBackgroundColor.test.tsx +1 -1
- package/reactHooks/screen/__tests__/useScreenData.test.tsx +1 -1
- package/reactHooks/screen/__tests__/useTargetScreenData.test.tsx +12 -4
- package/reactHooks/screen/useTargetScreenData.ts +4 -2
- package/reactHooks/state/__tests__/useComponentScreenState.test.ts +246 -0
- package/reactHooks/state/index.ts +2 -0
- package/reactHooks/state/useComponentScreenState.ts +45 -0
- package/reactHooks/state/useRefWithInitialValue.ts +10 -0
- package/reactHooks/state/useRivers.ts +1 -1
- package/reactHooks/ui/__tests__/useFadeOutWhenBlurred.test.ts +580 -0
- package/reactHooks/usePluginConfiguration.ts +2 -2
- package/reactHooks/utils/__tests__/index.test.js +1 -1
- package/rectUtils/__tests__/index.test.ts +549 -0
- package/rectUtils/index.ts +2 -2
- package/refreshUtils/RefreshCoordinator/__tests__/refreshCoordinator.test.ts +161 -0
- package/refreshUtils/RefreshCoordinator/index.ts +216 -0
- package/refreshUtils/RefreshCoordinator/utils/__tests__/getDataRefreshConfig.test.ts +104 -0
- package/refreshUtils/RefreshCoordinator/utils/index.ts +29 -0
- package/screenPickerUtils/__tests__/index.test.ts +333 -0
- package/screenPickerUtils/index.ts +5 -0
- package/screenState/__tests__/index.test.ts +1 -1
- package/screenUtils/index.ts +3 -0
- package/searchUtils/const.ts +7 -0
- package/searchUtils/index.ts +3 -0
- package/services/storageServiceSync.web.ts +1 -1
- package/stringUtils/index.ts +1 -1
- package/testUtils/index.tsx +30 -21
- package/time/__tests__/BackgroundTimer.test.ts +156 -0
- package/time/__tests__/Timer.test.ts +236 -0
- package/typeGuards/__tests__/isString.test.ts +21 -0
- package/typeGuards/index.ts +4 -0
- package/utils/__tests__/clone.test.ts +158 -0
- package/utils/__tests__/mapAccum.test.ts +73 -0
- package/utils/__tests__/mergeRight.test.ts +48 -0
- package/utils/__tests__/path.test.ts +7 -0
- package/utils/__tests__/selectors.test.ts +124 -0
- package/utils/clone.ts +7 -0
- package/utils/index.ts +22 -1
- package/utils/mapAccum.ts +23 -0
- package/utils/mergeRight.ts +5 -0
- package/utils/path.ts +6 -3
- package/utils/pathOr.ts +5 -1
- package/utils/selectors.ts +46 -0
- package/zappFrameworkUtils/HookCallback/callbackNavigationAction.ts +49 -12
- package/zappFrameworkUtils/HookCallback/hookCallbackManifestExtensions.config.js +1 -1
- package/reactHooks/componentsMap/index.ts +0 -55
- package/reactHooks/feed/__tests__/useFeedRefresh.test.tsx +0 -75
- package/reactHooks/feed/useFeedRefresh.tsx +0 -65
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const {
|
|
2
|
+
isKeyHasSuffix,
|
|
3
|
+
isKeyHasAnyOfSuffixes,
|
|
4
|
+
getKeyWithPrefixGenerator,
|
|
5
|
+
} = require("..");
|
|
6
|
+
|
|
7
|
+
describe("manifestUtils/_internals helpers", () => {
|
|
8
|
+
it("checks a key suffix", () => {
|
|
9
|
+
expect(
|
|
10
|
+
isKeyHasSuffix("button_enabled", "mobile_button_1_button_enabled")
|
|
11
|
+
).toBe(true);
|
|
12
|
+
|
|
13
|
+
expect(
|
|
14
|
+
isKeyHasSuffix("button_enabled", "mobile_button_1_assign_action")
|
|
15
|
+
).toBe(false);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("checks key against multiple suffixes", () => {
|
|
19
|
+
const suffixes = ["font_color", "focused_font_color", "text_transform"];
|
|
20
|
+
|
|
21
|
+
expect(
|
|
22
|
+
isKeyHasAnyOfSuffixes(suffixes, "mobile_button_1_text_transform")
|
|
23
|
+
).toBe(true);
|
|
24
|
+
|
|
25
|
+
expect(
|
|
26
|
+
isKeyHasAnyOfSuffixes(suffixes, "mobile_button_1_asset_alignment")
|
|
27
|
+
).toBe(false);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("generates stable key names using a prefix", () => {
|
|
31
|
+
const withMobileButtonPrefix = getKeyWithPrefixGenerator("mobile_button_2");
|
|
32
|
+
|
|
33
|
+
expect(withMobileButtonPrefix("display_mode")).toBe(
|
|
34
|
+
"mobile_button_2_display_mode"
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
expect(withMobileButtonPrefix("asset_enabled")).toBe(
|
|
38
|
+
"mobile_button_2_asset_enabled"
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -174,6 +174,36 @@ function generateFieldsFromDefaultsWithoutPrefixedLabel(
|
|
|
174
174
|
)(fields);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
/**
|
|
178
|
+
* Checks whether a generated manifest field key ends with the given suffix.
|
|
179
|
+
*
|
|
180
|
+
* @param {string} suffix
|
|
181
|
+
* @param {string} key
|
|
182
|
+
* @returns {boolean}
|
|
183
|
+
*/
|
|
184
|
+
const isKeyHasSuffix = (suffix, key) => key.endsWith(`_${suffix}`);
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Checks whether a generated manifest field key ends with any supported suffix.
|
|
188
|
+
*
|
|
189
|
+
* @param {string[]} suffixes
|
|
190
|
+
* @param {string} key
|
|
191
|
+
* @returns {boolean}
|
|
192
|
+
*/
|
|
193
|
+
const isKeyHasAnyOfSuffixes = (suffixes, key) =>
|
|
194
|
+
suffixes.some((suffix) => key.endsWith(`_${suffix}`));
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Creates a helper that prefixes a manifest field suffix with a shared key stem.
|
|
198
|
+
*
|
|
199
|
+
* @param {string} prefix
|
|
200
|
+
* @returns {(suffix: string) => string}
|
|
201
|
+
*/
|
|
202
|
+
function getKeyWithPrefixGenerator(prefix) {
|
|
203
|
+
// expect prefix as lower snake case, e.g. "mobile_buttons_container"
|
|
204
|
+
return (suffix) => `${prefix}_${suffix}`;
|
|
205
|
+
}
|
|
206
|
+
|
|
177
207
|
module.exports = {
|
|
178
208
|
toSnakeCase,
|
|
179
209
|
toCamelCase,
|
|
@@ -185,4 +215,7 @@ module.exports = {
|
|
|
185
215
|
getDefaultConfiguration,
|
|
186
216
|
compact,
|
|
187
217
|
replaceUnderscoreToSpace,
|
|
218
|
+
isKeyHasSuffix,
|
|
219
|
+
isKeyHasAnyOfSuffixes,
|
|
220
|
+
getKeyWithPrefixGenerator,
|
|
188
221
|
};
|
|
@@ -331,10 +331,53 @@ function getPlayerConfiguration({ platform, version }) {
|
|
|
331
331
|
label_tooltip: "Hint for skip intro button accessibility",
|
|
332
332
|
type: "text_input",
|
|
333
333
|
},
|
|
334
|
+
{
|
|
335
|
+
type: "text_input",
|
|
336
|
+
label: "Text Tracks Label",
|
|
337
|
+
key: "text_tracks_label",
|
|
338
|
+
initial_value: "Subtitles",
|
|
339
|
+
label_tooltip: "Label for the text tracks list",
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
type: "text_input",
|
|
343
|
+
label: "Audio Tracks Label",
|
|
344
|
+
key: "audio_tracks_label",
|
|
345
|
+
initial_value: "Audio",
|
|
346
|
+
label_tooltip: "Label for the audio tracks list",
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
type: "text_input",
|
|
350
|
+
label: "Off Track Label",
|
|
351
|
+
key: "off_track_label",
|
|
352
|
+
initial_value: "Off",
|
|
353
|
+
label_tooltip: "Label for the 'Off' option in text tracks list",
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
type: "text_input",
|
|
357
|
+
label: "Default Track Label",
|
|
358
|
+
key: "default_track_label",
|
|
359
|
+
initial_value: "Default",
|
|
360
|
+
label_tooltip:
|
|
361
|
+
"Label for the 'Default' audio track in audio tracks list",
|
|
362
|
+
},
|
|
334
363
|
],
|
|
335
364
|
};
|
|
336
365
|
|
|
337
366
|
if (isTV(platform)) {
|
|
367
|
+
localizations.fields.push({
|
|
368
|
+
key: "back_to_live_label",
|
|
369
|
+
label: "Back to live label",
|
|
370
|
+
initial_value: "Back To Live",
|
|
371
|
+
type: "text_input",
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
localizations.fields.push({
|
|
375
|
+
key: "start_over_label",
|
|
376
|
+
label: "Start over label",
|
|
377
|
+
initial_value: "Start Over",
|
|
378
|
+
type: "text_input",
|
|
379
|
+
});
|
|
380
|
+
|
|
338
381
|
styles.fields.push(
|
|
339
382
|
fieldsGroup("Always Show Scrub Bar & Timestamp", "", [
|
|
340
383
|
{
|
|
@@ -447,7 +490,7 @@ function getPlayerConfiguration({ platform, version }) {
|
|
|
447
490
|
),
|
|
448
491
|
fieldsGroup(
|
|
449
492
|
"Skip Button",
|
|
450
|
-
"This section allows you to configure the skip button
|
|
493
|
+
"This section allows you to configure the skip button behaviour",
|
|
451
494
|
[
|
|
452
495
|
{
|
|
453
496
|
type: "switch",
|
|
@@ -464,6 +507,12 @@ function getPlayerConfiguration({ platform, version }) {
|
|
|
464
507
|
label: "Persistent Button Toggle",
|
|
465
508
|
initial_value: true,
|
|
466
509
|
},
|
|
510
|
+
]
|
|
511
|
+
),
|
|
512
|
+
fieldsGroup(
|
|
513
|
+
"Labeled Button Style",
|
|
514
|
+
"This section allows you to configure the labeled button styles",
|
|
515
|
+
[
|
|
467
516
|
{
|
|
468
517
|
type: "color_picker_rgba",
|
|
469
518
|
label_tooltip: "",
|
|
@@ -619,6 +668,44 @@ function getPlayerConfiguration({ platform, version }) {
|
|
|
619
668
|
);
|
|
620
669
|
}
|
|
621
670
|
|
|
671
|
+
if (isTV(platform)) {
|
|
672
|
+
general.fields.push(
|
|
673
|
+
{
|
|
674
|
+
key: "liveSeekingEnabled",
|
|
675
|
+
label: "Live Seeking Enabled",
|
|
676
|
+
initial_value: false,
|
|
677
|
+
type: "switch",
|
|
678
|
+
label_tooltip: "Enable Live Seek",
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
key: "minimumAllowedSeekableDurationInSeconds",
|
|
682
|
+
label: "Minimum allowed seekable duration in seconds",
|
|
683
|
+
initial_value: 300,
|
|
684
|
+
type: "number_input",
|
|
685
|
+
label_tooltip:
|
|
686
|
+
"If duration less than this value, player will disable 'liveSeekingEnabled' value",
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
key: "live_image",
|
|
690
|
+
label: "Live badge",
|
|
691
|
+
type: "uploader",
|
|
692
|
+
label_tooltip: "Override default live badge / icon",
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
key: "live_width",
|
|
696
|
+
label: "Live badge width",
|
|
697
|
+
type: "number_input",
|
|
698
|
+
initial_value: 85,
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
key: "live_height",
|
|
702
|
+
label: "Live badge height",
|
|
703
|
+
type: "number_input",
|
|
704
|
+
initial_value: 50,
|
|
705
|
+
}
|
|
706
|
+
);
|
|
707
|
+
}
|
|
708
|
+
|
|
622
709
|
if (isMobile(platform)) {
|
|
623
710
|
general.fields.push(
|
|
624
711
|
{
|
|
@@ -1142,40 +1229,35 @@ function getPlayerConfiguration({ platform, version }) {
|
|
|
1142
1229
|
label: "Playback Speed 0.8x",
|
|
1143
1230
|
type: "uploader",
|
|
1144
1231
|
label_tooltip: "Playback Speed 0.8x",
|
|
1145
|
-
initial_value:
|
|
1146
|
-
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAeMSURBVHgB7Z3/Vds6FMcvnPc/yQRVJyhM8MIEhQkaJihM8MIEwAQNE0AnwJ2g6QR1J4Au0D5dfHNqUuvqShbUcb+fc3R8Elm2oq9+3msrRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjx0qyP39/cQfZj44H175wJ8ffPjuw4rDdDqtaSAE8st8oya/tc/viraYIgL7gpr5w3/UFFaMyodrX3BL+gOIqHMf3pItvzU1eT4fUuW00ktgX1jOHz6QraA2qX04fMlCk4rI+XWUx8Ln95y2iGyBpbBu6Fe3lgN33ye+0G7pmfH55R5mQf3hLvt4W1pzlsC+sPb94TOVg1tyRc9EQXHX1D4c+Dw/0MDZpUSkW76hstzIdYvjrzunuLgsVOXDUo515HxHzZxj8CQL7LkgfQyrfDj2wVfwKfcQUx9OSC807uY/0POgCfE4RPjw2ueVe5ETOb723x2SnudTGaYGTVIXLa1BE4JnmgslPcdpBV60q/b3O6Jwb1OTYZLnr3FHgUnk7u7ucm9v74QGTGoLfh+8kP+xmriMxF8pp5Tu9mZKnHXZw71R51j748ePIxo4ZoFlYrUfiK79j7UuHxYUKDDPrHC39ybw/YN1HS4TqY+B6ImsqwdLSgueK3HX1mWDFJjWil+iVdSURq3EjUbgf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4h6Svk5OFjn53STtQXCBM8rWncfJUut5rtjrpWtvT9c9HTXidt7PpzvoSDORNFp3vPThatrxDrCk56XWaeQaJ5ZHcC3irieX4tDosngxNSX4k3MEdtRYXHrN7jbgH3YQynTuGxGRNxva1BLaDn9nSHdlMfqniNtKU0TkZFOlXNRkf03gJJJZRzqd8WKgsBg1HDW9y5EEZ0hTGcVlgZaB6E5xmZhZ0682TENMli1auqRS7+RY3g9e5caLSZIrpDazToVb7qHx3Gzzoyay9amXbGeDiKw9BhOjpqZbXhrO5XNCBXE7jeyjIU9hcF77LsEqakSJttzWvWv6vYyi4rbSh0T+RAaSx+AuZMmiLX/acIbZaHKZYrGSMelm4x4Vxbv3zes4aiZOvK7dNyThPHIPcz3NfPOxtdUFH7mSJf32rmtYnSVFBG5lggtsRk93ramp8e/ysZr23LVGJk6P1532fNW0NcN39LTiPEhIfmsDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArCn66soQkXd6+EXu9muhKwlb+Z/AKYxaYNkl/TJy2mLb/hM4hdHuNtvaJT3GwrpfxzYyyhZs+BPNLo6nL/BH1S/NWAXmzVccpRHcBGabGV0XLdv7OkrH3W/B/wGnMsYx2PLW/nOkHSRjFLjP9k590g6SMQrcZzedkjvxDIIxCtxnD5Be+4cMEcyif4FZ9BaRsxPfKK1ZoxQ4YQvDNefGDdm2jrHbohcU3xv6bJr+f4Rbw9/iTVpQ8/8I63VuTb9226tpxPwPlwURv/dAZk0AAAAASUVORK5CYII=",
|
|
1232
|
+
initial_value: null,
|
|
1147
1233
|
},
|
|
1148
1234
|
{
|
|
1149
1235
|
key: "speed_1",
|
|
1150
1236
|
label: "Playback Speed 1x",
|
|
1151
1237
|
type: "uploader",
|
|
1152
1238
|
label_tooltip: "Playback Speed 1x",
|
|
1153
|
-
initial_value:
|
|
1154
|
-
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAI4SURBVHgB7dzhcRJBGIDhT8cCkg6SDmIHsQNLiBUYKwAqUCtIC5ZACVqBdIAdxN3JMSLecXcE8Tt5npkdJlxyf97ZcLcLRAAAAAAAAAAAAAAAAAAAAAAAAADAMb2IiViv17fl4aGMq45fub68vFwFv3kVyZWwF+VhVsZ9MFrqwANmLT1SBm5mbQ37NniWl5FMifu+PHwPcY8izQwuYa/iadbeBkeTaQbfxf64P8r4GoyS7l90h89lXJfxLRgl+23Sqox35f52WX8o/8aDcTLP4EUZrzdxOUzGGbws40MJ6/X2CDIFrhdRNeyn4GjSBBb275jKVTQHEvg/d/aB69Lo+sljGR/jADvnmEUiZx242a2qr/0XzVP35bmHkeeY7Zxj3pw3hXOfwTctz90NjdzEnbccuo0kzj1w1712b+Q9cfed9+TOOnCzSrboONwZuSfuopz3SyRx9hdZJcY8RkQeELfr2D/hNimGR55a3Cr9m+5OpcZpdqvabnNq5HpBdtPx5ynjVmbwlp6ZPLm4lcA7eiLvSh23ErjFwMjp41YCd3t85vEUBG7Rc7W8Mc+27txG4B0D426kjyzwlp64y47nU0cWuDFgEeNNdF94pY0scAxfoeq5uk4Z2Yb/yOXHqUW24X/A2vKAyGk+OGfDv13vIsaBy5onZ8P/T4NXqPZEtuGfwdaG/yp+vfF+HiNsRV5tnSPNhv9kvoSlaj75f9F2zBewAAAAAAAAAAAAAAAAAAAAAAAAwHT8BNhH51wNSx95AAAAAElFTkSuQmCC",
|
|
1239
|
+
initial_value: null,
|
|
1155
1240
|
},
|
|
1156
1241
|
{
|
|
1157
1242
|
key: "speed_1_2",
|
|
1158
1243
|
label: "Playback Speed 1.2x",
|
|
1159
1244
|
type: "uploader",
|
|
1160
1245
|
label_tooltip: "Playback Speed 1.2x",
|
|
1161
|
-
initial_value:
|
|
1162
|
-
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAACXBIWXMAACE4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5LeChiuyD1jt70yt4dHCbTmGHDxckXXAKtzS8JbRw23xYMXW8hZbfb+/S5mKKVxLa7nl3a3pItiVDaGpoTs5NVf6YeW8qjuP300t3FbwKymiDLgrIJ4m3XXWfuGEwpX/p6slHTTk6AJWIzJlR5UsDDnR/tTwu7ZwGy6Vuo6qF9dTg1w6MR4eHireN3cNBwYLOcY1+MxQt5Khs661WF0/VJJZQbtrqPpquLyzvcm1h0pa1xwyjRlyjI0s29jnief0Sfl2P/r2XfuKMWDbeczRnvimdi9rTbX2ONch5N5f3hgDrgx1N8u4r/BbaaZbOzEsIRfUU3QBq0aMXEvUvKmS1m/s1+nWHdOce6gMIffeao3dyJJj10ZTp5v+beCcN0s17farsk9uHFqvFenPqAjFuPVQ813wjx/UJO+TBiRk/gz5Oxfq7w0a8AcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANif7B8Q/dOlJHI7iEJNvlcl+8tCsg5Y3R/Ldm1QuUz46aI2ud9lx+XCr1HubhOLLNdgh6eQdjn3uZNPKnIN+DP5XzQtl6ha77+Rmuw20eoOOgX5K4bcfSdWOe6Dh9yMJYobuYSUY8BDnj2Y1XMLRY4BD7lJS3LPJrTJMeAht1lK7tmENmhF/4BWdEI25C/L3qwsA1YdFj6BXcX0LOSQcu+LLvnF1g258b2XVUrmMppUcvmdfhznNlz+43Kd+2jSV0z9PFgMpokeAAAAAElFTkSuQmCC",
|
|
1246
|
+
initial_value: null,
|
|
1163
1247
|
},
|
|
1164
1248
|
{
|
|
1165
1249
|
key: "speed_1_5",
|
|
1166
1250
|
label: "Playback Speed 1.5x",
|
|
1167
1251
|
type: "uploader",
|
|
1168
1252
|
label_tooltip: "Playback Speed 1.5x",
|
|
1169
|
-
initial_value:
|
|
1170
|
-
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAVySURBVHgB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pRAjus5TXeHq8QshVY+m7FaaCh9jjE5O0Ry9erBKuF/GBKd3i6THn6iLsmuchZCqxfUm70hYYHj16VW0vaF5fIKq70GVeGXbrQkaIOcU21QVKRsxNYb8pqIKmxieRwUAgi8s12bSBVsp5TnuG15XhfS3idr01cMaiOKcDjFUt2vmgZSUH2UnRE5vNJ21LO6dNWXVvWPvtehzgePMRdbewr+wX5rkPIsYquItPkRyPV3jn54bsSgOTZkCch4gqhvutQchS4s6Q5rVgdLCddhqFt3yHEqPro245WC7wx5WVq53qIvKJIchT4OjLtDb5h0hd8fHBwcE9xiKDSNbgKdJLUhninEyPSrekkO4G1v3Xoi56HDGUVj9NisZCSLKM4pCT6CNXquY+WcTM1uoE4bw+VReRoB8vURlZNhuemSyyt7uSXK8/J+wh341CeH/R6NkuE5NtxaBOd44T6UZxy3VFdfmp4fdY8cpkWBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEEiW60WmRKfAyBvaZEpJpdGPGi5Le0fDNkULrG9Edc3rkZeLBM3enxPFLoS2sbC2i2bsquo5U2QJ1gnToTPjP+m84qIoVWDbOh8mrOt/zJXiqmjbnGQHled6XLOixGdw9HIHI4/NkhIF9l7uN/GxWVKiwGOWYUixMk9WlCjwmBVhxxybJbCifwArekb4rna3SZHerCIFVodFiGCXy0JeJ7tN6b7ohtyvpDsveR2qfelNajj8Rj/auR2Hvzhcld6b9D8EYh6U+B0kAAAAAABJRU5ErkJggg==",
|
|
1253
|
+
initial_value: null,
|
|
1171
1254
|
},
|
|
1172
1255
|
{
|
|
1173
1256
|
key: "speed_2",
|
|
1174
1257
|
label: "Playback Speed 2x",
|
|
1175
1258
|
type: "uploader",
|
|
1176
1259
|
label_tooltip: "Playback Speed 2x",
|
|
1177
|
-
initial_value:
|
|
1178
|
-
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAA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mVguI7/f9/h+lgyK+miuzGqwP+jjRiRkOnwN2JXh39yC1VPyFeSGQHLvwKYu3bLBd1IOwxELQP49U//28atZGahkFXJC9wcNvA+JwAAAAAAAAAAAAAAAAAAAAAAAIxWxIjvffytMW5M6e4ziO+fOTxkRNpZKjrgyGDh92oNeSOFKvbuQj9Ef8qQwrVft0hF7sEa2FpnQwdDyT78/nMoNeA7GT40RKMBv5XCFHeI9oO6VDJc5V9blBLPwWPGxcg+psbUSgx4X55uzGtNKjHgMcMcPvfItS+uxIDHDHySfdCUqVGKfkApekZSn3jWVWRrVpEB+waLIYFtSh1mqfS26FriD9U4G/KUtLlZSm9SrdM7eajnNjpd63Reem/SH2FDq35f8ateAAAAAElFTkSuQmCC",
|
|
1260
|
+
initial_value: null,
|
|
1179
1261
|
},
|
|
1180
1262
|
{
|
|
1181
1263
|
key: "sleep_timer",
|
|
@@ -3429,6 +3511,22 @@ function getPlayerConfiguration({ platform, version }) {
|
|
|
3429
3511
|
label_tooltip:
|
|
3430
3512
|
"This field allows you to override the player configuration / initialization options. i.e. html5: { vhs: { limitRenditionByPlayerDimensions: false } } Please ensure your configuration matches the player you are targeting, and that it is a valid json. See config options here: https://videojs.com/guides/options/",
|
|
3431
3513
|
},
|
|
3514
|
+
{
|
|
3515
|
+
key: "advanced_player_styles",
|
|
3516
|
+
label: "Advanced Player Styles",
|
|
3517
|
+
type: "text_input",
|
|
3518
|
+
multiline: true,
|
|
3519
|
+
initial_value: `.vjs-text-track-cue {
|
|
3520
|
+
inset: unset !important;
|
|
3521
|
+
top: 94% !important;
|
|
3522
|
+
bottom: 0 !important;
|
|
3523
|
+
left: 0 !important;
|
|
3524
|
+
right: 0 !important;
|
|
3525
|
+
width: 100% !important;
|
|
3526
|
+
}`,
|
|
3527
|
+
label_tooltip:
|
|
3528
|
+
"This field allows you to inject custom CSS styles to override default player styles. The styles will be injected into the document head and can be used to customize the appearance of the player. Leave empty to use only default styles.",
|
|
3529
|
+
},
|
|
3432
3530
|
{
|
|
3433
3531
|
key: "use_dashjs_player",
|
|
3434
3532
|
label: "Use Enhanced Player for DASH streams",
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const {
|
|
2
|
+
withConditional,
|
|
3
|
+
getConditionalKey,
|
|
4
|
+
createConditionalField,
|
|
5
|
+
} = require("..");
|
|
6
|
+
|
|
7
|
+
describe("manifestUtils/fieldUtils", () => {
|
|
8
|
+
it("appends conditions and adds all_conditions when there is more than one condition", () => {
|
|
9
|
+
const config = {
|
|
10
|
+
key: "mobile_button_1_width",
|
|
11
|
+
conditional_fields: [
|
|
12
|
+
{ key: "styles/mobile_button_1_button_enabled", condition_value: true },
|
|
13
|
+
],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const result = withConditional([
|
|
17
|
+
{ key: "styles/mobile_button_1_display_mode", condition_value: "fixed" },
|
|
18
|
+
])(config);
|
|
19
|
+
|
|
20
|
+
expect(result.conditional_fields).toEqual([
|
|
21
|
+
{ key: "styles/mobile_button_1_button_enabled", condition_value: true },
|
|
22
|
+
{ key: "styles/mobile_button_1_display_mode", condition_value: "fixed" },
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
expect(result.rules).toBe("all_conditions");
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("creates category-prefixed conditional key", () => {
|
|
29
|
+
expect(
|
|
30
|
+
getConditionalKey("mobile_buttons_container_position", "styles")
|
|
31
|
+
).toBe("styles/mobile_buttons_container_position");
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("creates conditional fields with default category and with raw key", () => {
|
|
35
|
+
expect(
|
|
36
|
+
createConditionalField("mobile_button_1_asset_enabled", true)
|
|
37
|
+
).toEqual({
|
|
38
|
+
key: "styles/mobile_button_1_asset_enabled",
|
|
39
|
+
condition_value: true,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
expect(
|
|
43
|
+
createConditionalField("mobile_button_1_asset_enabled", true, null)
|
|
44
|
+
).toEqual({
|
|
45
|
+
key: "mobile_button_1_asset_enabled",
|
|
46
|
+
condition_value: true,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Appends new conditional_fields from conditions array
|
|
3
|
+
* to config.conditional_fields
|
|
4
|
+
* if there are more than 1 condition, sets rules to "all_conditions"
|
|
5
|
+
*
|
|
6
|
+
* @param {Array<{key: string, condition_value: unknown}>} conditions
|
|
7
|
+
* @returns {(config: object) => object}
|
|
8
|
+
*/
|
|
9
|
+
const withConditional = (conditions) => (config) => {
|
|
10
|
+
const conditional_fields = [
|
|
11
|
+
...(config.conditional_fields || []),
|
|
12
|
+
...conditions,
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
const next = { ...config, conditional_fields };
|
|
16
|
+
|
|
17
|
+
if (conditional_fields.length > 1) {
|
|
18
|
+
return { ...next, rules: "all_conditions" };
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return next;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Builds key for conditional fields prepending category, e.g. "styles/mobile_buttons_container_position"
|
|
26
|
+
*
|
|
27
|
+
* @param {string} key
|
|
28
|
+
* @param {string} category
|
|
29
|
+
* @returns {string}
|
|
30
|
+
*/
|
|
31
|
+
function getConditionalKey(key, category) {
|
|
32
|
+
return `${category}/${key}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Returns a conditional field object for manifest visibility rules.
|
|
37
|
+
*
|
|
38
|
+
* @param {string} key
|
|
39
|
+
* @param {unknown} condition_value
|
|
40
|
+
* @param {string|null} [category="styles"] Pass `null` to use the key as-is.
|
|
41
|
+
* @returns {{key: string, condition_value: unknown}}
|
|
42
|
+
*/
|
|
43
|
+
function createConditionalField(key, condition_value, category = "styles") {
|
|
44
|
+
return {
|
|
45
|
+
key: category ? getConditionalKey(key, category) : key,
|
|
46
|
+
condition_value,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
module.exports = {
|
|
51
|
+
withConditional,
|
|
52
|
+
getConditionalKey,
|
|
53
|
+
createConditionalField,
|
|
54
|
+
};
|
package/manifestUtils/index.js
CHANGED
|
@@ -8,6 +8,9 @@ const {
|
|
|
8
8
|
|
|
9
9
|
const { tvActionButtonsContainer } = require("./tvAction/container");
|
|
10
10
|
const { tvActionButton } = require("./tvAction/button");
|
|
11
|
+
const { mobileActionButtonsContainer } = require("./mobileAction/container");
|
|
12
|
+
const { mobileActionButton } = require("./mobileAction/button");
|
|
13
|
+
const { buildMobileActionButtonGroups } = require("./mobileAction/groups");
|
|
11
14
|
const { compact } = require("./_internals");
|
|
12
15
|
|
|
13
16
|
const { spacingKey, absolutePositionElement } = require("./containers");
|
|
@@ -43,6 +46,9 @@ module.exports = {
|
|
|
43
46
|
tvMenuLabel,
|
|
44
47
|
tvActionButtonsContainer,
|
|
45
48
|
tvActionButton,
|
|
49
|
+
mobileActionButtonsContainer,
|
|
50
|
+
mobileActionButton,
|
|
51
|
+
buildMobileActionButtonGroups,
|
|
46
52
|
mobileCellLabel,
|
|
47
53
|
tvCellLabel,
|
|
48
54
|
tvBadges,
|
package/manifestUtils/keys.js
CHANGED
|
@@ -406,6 +406,244 @@ const TV_ACTION_BUTTON_FIELDS = [
|
|
|
406
406
|
},
|
|
407
407
|
];
|
|
408
408
|
|
|
409
|
+
const mobileActionButtonContainerFields = (positionOptions) => [
|
|
410
|
+
{
|
|
411
|
+
type: ZAPPIFEST_FIELDS.switch,
|
|
412
|
+
suffix: "buttons enabled",
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
type: ZAPPIFEST_FIELDS.switch,
|
|
416
|
+
suffix: "enable cell action",
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
type: ZAPPIFEST_FIELDS.select,
|
|
420
|
+
suffix: "position",
|
|
421
|
+
options: positionOptions,
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
type: ZAPPIFEST_FIELDS.select,
|
|
425
|
+
suffix: "align",
|
|
426
|
+
options: ["left", "center", "right"],
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
type: ZAPPIFEST_FIELDS.select,
|
|
430
|
+
suffix: "over image position",
|
|
431
|
+
options: ["center", "top_left", "top_right", "bottom_left", "bottom_right"],
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
435
|
+
suffix: "margin top",
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
439
|
+
suffix: "margin right",
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
443
|
+
suffix: "margin bottom",
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
447
|
+
suffix: "margin left",
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
type: ZAPPIFEST_FIELDS.select,
|
|
451
|
+
suffix: "stacking",
|
|
452
|
+
options: ["horizontal", "vertical"],
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
456
|
+
suffix: "horizontal gutter",
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
460
|
+
suffix: "vertical gutter",
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
type: ZAPPIFEST_FIELDS.select,
|
|
464
|
+
suffix: "cell action",
|
|
465
|
+
options: [
|
|
466
|
+
{ text: "primary navigation", value: "navigation_action" },
|
|
467
|
+
{ text: "secondary navigation", value: "secondary_navigation" },
|
|
468
|
+
],
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
type: ZAPPIFEST_FIELDS.switch,
|
|
472
|
+
suffix: "independent styles",
|
|
473
|
+
},
|
|
474
|
+
];
|
|
475
|
+
|
|
476
|
+
const MOBILE_ACTION_BUTTON_FIELDS = [
|
|
477
|
+
{
|
|
478
|
+
type: ZAPPIFEST_FIELDS.switch,
|
|
479
|
+
suffix: "button enabled",
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
type: ZAPPIFEST_FIELDS.select,
|
|
483
|
+
suffix: "assign action",
|
|
484
|
+
options: [
|
|
485
|
+
{ text: "primary navigation", value: "navigation_action" },
|
|
486
|
+
{ text: "secondary navigation", value: "secondary_navigation" },
|
|
487
|
+
{ text: "favorite", value: "local_storage_favourites_action" },
|
|
488
|
+
{ text: "more", value: "more" },
|
|
489
|
+
{ text: "add to calendar", value: "add_to_calendar" },
|
|
490
|
+
{ text: "share", value: "share" },
|
|
491
|
+
{ text: "downloads", value: "downloads" },
|
|
492
|
+
{ text: "trailer", value: "trailer_action" },
|
|
493
|
+
{ text: "mute/unmute", value: "mute_unmute" },
|
|
494
|
+
],
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
type: ZAPPIFEST_FIELDS.select,
|
|
498
|
+
suffix: "display mode",
|
|
499
|
+
options: ["dynamic", "fixed", "fill"],
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
503
|
+
suffix: "width",
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
type: ZAPPIFEST_FIELDS.select,
|
|
507
|
+
suffix: "contents alignment",
|
|
508
|
+
options: ["left", "center", "right"],
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
type: ZAPPIFEST_FIELDS.color_picker,
|
|
512
|
+
suffix: "background color",
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
type: ZAPPIFEST_FIELDS.color_picker,
|
|
516
|
+
suffix: "focused background color",
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
type: ZAPPIFEST_FIELDS.color_picker,
|
|
520
|
+
suffix: "border color",
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
type: ZAPPIFEST_FIELDS.color_picker,
|
|
524
|
+
suffix: "focused border color",
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
528
|
+
suffix: "border size",
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
532
|
+
suffix: "corner radius",
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
536
|
+
suffix: "padding top",
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
540
|
+
suffix: "padding right",
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
544
|
+
suffix: "padding bottom",
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
548
|
+
suffix: "padding left",
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
type: ZAPPIFEST_FIELDS.switch,
|
|
552
|
+
suffix: "asset enabled",
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
type: ZAPPIFEST_FIELDS.select,
|
|
556
|
+
suffix: "action asset flavor",
|
|
557
|
+
options: ["flavor_1", "flavor_2"],
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
type: ZAPPIFEST_FIELDS.select,
|
|
561
|
+
suffix: "asset alignment",
|
|
562
|
+
options: ["left", "right", "above", "below"],
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
566
|
+
suffix: "asset height",
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
570
|
+
suffix: "asset width",
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
574
|
+
suffix: "asset margin top",
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
578
|
+
suffix: "asset margin right",
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
582
|
+
suffix: "asset margin bottom",
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
586
|
+
suffix: "asset margin left",
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
type: ZAPPIFEST_FIELDS.switch,
|
|
590
|
+
suffix: "label enabled",
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
type: ZAPPIFEST_FIELDS.color_picker,
|
|
594
|
+
suffix: "font color",
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
type: ZAPPIFEST_FIELDS.color_picker,
|
|
598
|
+
suffix: "focused font color",
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
type: ZAPPIFEST_FIELDS.font_selector.ios,
|
|
602
|
+
suffix: "iOS font family",
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
type: ZAPPIFEST_FIELDS.font_selector.android,
|
|
606
|
+
suffix: "android font family",
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
610
|
+
suffix: "font size",
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
614
|
+
suffix: "line height",
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
618
|
+
suffix: "iOS letter spacing",
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
622
|
+
suffix: "android letter spacing",
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
type: ZAPPIFEST_FIELDS.select,
|
|
626
|
+
suffix: "text transform",
|
|
627
|
+
options: ["default", "lowercase", "uppercase", "capitalize"],
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
631
|
+
suffix: "margin top",
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
635
|
+
suffix: "margin right",
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
639
|
+
suffix: "margin bottom",
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
643
|
+
suffix: "margin left",
|
|
644
|
+
},
|
|
645
|
+
];
|
|
646
|
+
|
|
409
647
|
const TV_MENU_LABEL_FIELDS = [
|
|
410
648
|
{
|
|
411
649
|
type: ZAPPIFEST_FIELDS.switch,
|
|
@@ -959,6 +1197,27 @@ const TV_CELL_LABEL_FIELDS = [
|
|
|
959
1197
|
rules: "conditional",
|
|
960
1198
|
conditions: [{ key: "switch", section: "styles", value: true }],
|
|
961
1199
|
},
|
|
1200
|
+
{
|
|
1201
|
+
type: ZAPPIFEST_FIELDS.font_selector.roku,
|
|
1202
|
+
suffix: "roku font family",
|
|
1203
|
+
tooltip: "",
|
|
1204
|
+
rules: "conditional",
|
|
1205
|
+
conditions: [{ key: "switch", section: "styles", value: true }],
|
|
1206
|
+
},
|
|
1207
|
+
{
|
|
1208
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
1209
|
+
suffix: "roku font size",
|
|
1210
|
+
tooltip: "",
|
|
1211
|
+
rules: "conditional",
|
|
1212
|
+
conditions: [{ key: "switch", section: "styles", value: true }],
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
1216
|
+
suffix: "roku line height",
|
|
1217
|
+
tooltip: "",
|
|
1218
|
+
rules: "conditional",
|
|
1219
|
+
conditions: [{ key: "switch", section: "styles", value: true }],
|
|
1220
|
+
},
|
|
962
1221
|
{
|
|
963
1222
|
type: ZAPPIFEST_FIELDS.select,
|
|
964
1223
|
suffix: "text alignment",
|
|
@@ -2113,6 +2372,8 @@ module.exports = {
|
|
|
2113
2372
|
TV_COLOR_STATES,
|
|
2114
2373
|
TV_ACTION_BUTTON_FIELDS,
|
|
2115
2374
|
tvActionButtonContainerFields,
|
|
2375
|
+
MOBILE_ACTION_BUTTON_FIELDS,
|
|
2376
|
+
mobileActionButtonContainerFields,
|
|
2116
2377
|
MOBILE_CELL_LABEL_FIELDS,
|
|
2117
2378
|
TV_CELL_LABEL_FIELDS,
|
|
2118
2379
|
TV_CELL_BADGE_FIELDS,
|