@applicaster/zapp-react-native-utils 16.0.0-rc.33 → 16.0.0-rc.34
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/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/manifestUtils/keys.js +8 -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/package.json +2 -2
|
@@ -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
|
|
package/manifestUtils/keys.js
CHANGED
|
@@ -631,6 +631,14 @@ const MOBILE_ACTION_BUTTON_FIELDS = [
|
|
|
631
631
|
type: ZAPPIFEST_FIELDS.number_input,
|
|
632
632
|
suffix: "margin left",
|
|
633
633
|
},
|
|
634
|
+
{
|
|
635
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
636
|
+
suffix: "horizontal gutter",
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
type: ZAPPIFEST_FIELDS.number_input,
|
|
640
|
+
suffix: "vertical gutter",
|
|
641
|
+
},
|
|
634
642
|
];
|
|
635
643
|
|
|
636
644
|
const TV_MENU_LABEL_FIELDS = [
|
|
@@ -129,6 +129,22 @@ function mobileActionButton({ label, description, defaults, isFirstButton }) {
|
|
|
129
129
|
conditions.push(createConditionalField(labelEnabledKey, true));
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
const assetAlignmentKey = keyPrefixGenerator("asset_alignment");
|
|
133
|
+
|
|
134
|
+
// horizontal_gutter fields depends on [asset_alignment: left or asset_alignment: right]
|
|
135
|
+
if (isKeyHasSuffix("horizontal_gutter", key)) {
|
|
136
|
+
conditions.push(
|
|
137
|
+
createConditionalField(assetAlignmentKey, ["left", "right"])
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// vertical_gutter fields depends on [asset_alignment: above or asset_alignment: below]
|
|
142
|
+
if (isKeyHasSuffix("vertical_gutter", key)) {
|
|
143
|
+
conditions.push(
|
|
144
|
+
createConditionalField(assetAlignmentKey, ["above", "below"])
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
132
148
|
return withConditional(conditions)(field);
|
|
133
149
|
});
|
|
134
150
|
|
|
@@ -49,7 +49,9 @@ function mobileActionButtonsContainer({ label, description, defaults }) {
|
|
|
49
49
|
|
|
50
50
|
// over_image_position depends on [positionKey: over_image]
|
|
51
51
|
if (isKeyHasSuffix("over_image_position", key)) {
|
|
52
|
-
conditions.push(
|
|
52
|
+
conditions.push(
|
|
53
|
+
createConditionalField(positionKey, defaults.position[0])
|
|
54
|
+
);
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
// horizontal_gutter depends on [stackingKey: horizontal]
|
|
@@ -33,7 +33,7 @@ const DEFAULT_MOBILE_ACTION_BUTTON_SHARED_DEFAULTS = {
|
|
|
33
33
|
assetHeight: 24,
|
|
34
34
|
assetWidth: 24,
|
|
35
35
|
assetMarginTop: 0,
|
|
36
|
-
assetMarginRight:
|
|
36
|
+
assetMarginRight: 0,
|
|
37
37
|
assetMarginBottom: 0,
|
|
38
38
|
assetMarginLeft: 0,
|
|
39
39
|
labelEnabled: true,
|
|
@@ -50,6 +50,8 @@ const DEFAULT_MOBILE_ACTION_BUTTON_SHARED_DEFAULTS = {
|
|
|
50
50
|
marginRight: 0,
|
|
51
51
|
marginBottom: 0,
|
|
52
52
|
marginLeft: 0,
|
|
53
|
+
horizontalGutter: 8,
|
|
54
|
+
verticalGutter: 8,
|
|
53
55
|
};
|
|
54
56
|
|
|
55
57
|
const DEFAULT_MOBILE_ACTION_BUTTON_PRESETS = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-utils",
|
|
3
|
-
"version": "16.0.0-rc.
|
|
3
|
+
"version": "16.0.0-rc.34",
|
|
4
4
|
"description": "Applicaster Zapp React Native utilities package",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@applicaster/applicaster-types": "16.0.0-rc.
|
|
30
|
+
"@applicaster/applicaster-types": "16.0.0-rc.34",
|
|
31
31
|
"buffer": "^5.2.1",
|
|
32
32
|
"camelize": "^1.0.0",
|
|
33
33
|
"dayjs": "^1.11.10",
|