@fluentui-react-native/themed-stylesheet 1.7.2 → 1.7.4
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/CHANGELOG.json +42 -1
- package/CHANGELOG.md +10 -2
- package/eslint.config.js +3 -0
- package/lib/themedStyleSheet.js +3 -3
- package/lib/themedStyleSheet.js.map +1 -1
- package/lib/themedStyleSheet.test.js +21 -21
- package/lib/themedStyleSheet.test.js.map +1 -1
- package/lib-commonjs/themedStyleSheet.js +5 -5
- package/lib-commonjs/themedStyleSheet.js.map +1 -1
- package/lib-commonjs/themedStyleSheet.test.js +22 -22
- package/lib-commonjs/themedStyleSheet.test.js.map +1 -1
- package/package.json +10 -2
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,48 @@
|
|
|
2
2
|
"name": "@fluentui-react-native/themed-stylesheet",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 11 Jul 2025 19:50:41 GMT",
|
|
6
|
+
"version": "1.7.4",
|
|
7
|
+
"tag": "@fluentui-react-native/themed-stylesheet_v1.7.4",
|
|
8
|
+
"comments": {
|
|
9
|
+
"none": [
|
|
10
|
+
{
|
|
11
|
+
"author": "4123478+tido64@users.noreply.github.com",
|
|
12
|
+
"package": "@fluentui-react-native/themed-stylesheet",
|
|
13
|
+
"commit": "79bb06f6bbfd0a36f9d2ef371f4857be9660f027",
|
|
14
|
+
"comment": "Fixed `align-deps` warnings"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "jasonmo@microsoft.com",
|
|
18
|
+
"package": "@fluentui-react-native/themed-stylesheet",
|
|
19
|
+
"commit": "54087dca787180bbf34630470cd0d06e88366b30",
|
|
20
|
+
"comment": "update eslint to 9.x and use new flat config format with security rules"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "ruaraki@microsoft.com",
|
|
24
|
+
"package": "@fluentui-react-native/themed-stylesheet",
|
|
25
|
+
"commit": "a245202877ef7f2be9ab5f0e1356b2270957e693",
|
|
26
|
+
"comment": "Run bump-versions"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "sanajmi@microsoft.com",
|
|
30
|
+
"package": "@fluentui-react-native/themed-stylesheet",
|
|
31
|
+
"commit": "405ca368dc3f2963bfc252a1952b1e14ff503499",
|
|
32
|
+
"comment": "fix: run `beachball sync` to sync package versions with NPM"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"patch": [
|
|
36
|
+
{
|
|
37
|
+
"author": "jasonmo@microsoft.com",
|
|
38
|
+
"package": "@fluentui-react-native/themed-stylesheet",
|
|
39
|
+
"commit": "479b93cea460a26df70c55b5d3335927ed374713",
|
|
40
|
+
"comment": "update builds to use node16 settings and modern export maps"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"date": "Thu, 10 Jul 2025 19:20:15 GMT",
|
|
6
47
|
"version": "1.7.2",
|
|
7
48
|
"tag": "@fluentui-react-native/themed-stylesheet_v1.7.2",
|
|
8
49
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/themed-stylesheet
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Fri, 11 Jul 2025 19:50:41 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.7.4
|
|
8
|
+
|
|
9
|
+
Fri, 11 Jul 2025 19:50:41 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- update builds to use node16 settings and modern export maps (jasonmo@microsoft.com)
|
|
14
|
+
|
|
7
15
|
## 1.7.2
|
|
8
16
|
|
|
9
|
-
Thu,
|
|
17
|
+
Thu, 10 Jul 2025 19:20:15 GMT
|
|
10
18
|
|
|
11
19
|
### Patches
|
|
12
20
|
|
package/eslint.config.js
ADDED
package/lib/themedStyleSheet.js
CHANGED
|
@@ -31,10 +31,10 @@ import { getMemoCache } from '@fluentui-react-native/memo-cache';
|
|
|
31
31
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
32
32
|
export function themedStyleSheet(generator) {
|
|
33
33
|
// create a memo cache for this themed stylesheet
|
|
34
|
-
|
|
34
|
+
const cache = getMemoCache();
|
|
35
35
|
// now return a theme => styles function
|
|
36
|
-
return
|
|
37
|
-
return cache(
|
|
36
|
+
return (theme) => {
|
|
37
|
+
return cache(() => StyleSheet.create(generator(theme)), [theme])[0];
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
//# sourceMappingURL=themedStyleSheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themedStyleSheet.js","sourceRoot":"","sources":["../src/themedStyleSheet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AASjE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wDAAwD;AACxD,MAAM,UAAU,gBAAgB,CAC9B,SAAkD;IAElD,iDAAiD;IACjD,
|
|
1
|
+
{"version":3,"file":"themedStyleSheet.js","sourceRoot":"","sources":["../src/themedStyleSheet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AASjE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wDAAwD;AACxD,MAAM,UAAU,gBAAgB,CAC9B,SAAkD;IAElD,iDAAiD;IACjD,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;IAE7B,wCAAwC;IACxC,OAAO,CAAC,KAAa,EAAE,EAAE;QACvB,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -13,7 +13,7 @@ function _createTheme2() {
|
|
|
13
13
|
fontSize: 12,
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
const getStyles1 = themedStyleSheet((t) => {
|
|
17
17
|
return {
|
|
18
18
|
style1: {
|
|
19
19
|
backgroundColor: t.color1,
|
|
@@ -27,7 +27,7 @@ var getStyles1 = themedStyleSheet(function (t) {
|
|
|
27
27
|
},
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
|
-
|
|
30
|
+
const getThemeOptionalStyles = themedStyleSheet((t) => {
|
|
31
31
|
return {
|
|
32
32
|
style3: {
|
|
33
33
|
backgroundColor: (t && t.color1) || 'white',
|
|
@@ -36,32 +36,32 @@ var getThemeOptionalStyles = themedStyleSheet(function (t) {
|
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
38
|
});
|
|
39
|
-
describe('Themed style sheet tests',
|
|
40
|
-
test('get no theme stylesheet',
|
|
41
|
-
|
|
39
|
+
describe('Themed style sheet tests', () => {
|
|
40
|
+
test('get no theme stylesheet', () => {
|
|
41
|
+
const styles = getThemeOptionalStyles(undefined);
|
|
42
42
|
expect(styles.style3).toEqual({
|
|
43
43
|
backgroundColor: 'white',
|
|
44
44
|
color: 'black',
|
|
45
45
|
fontSize: 8,
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
|
-
test('get no theme stylesheet caches',
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
test('get no theme stylesheet caches', () => {
|
|
49
|
+
const styles1 = getThemeOptionalStyles(undefined);
|
|
50
|
+
const styles2 = getThemeOptionalStyles(undefined);
|
|
51
51
|
expect(styles1).toBe(styles2);
|
|
52
52
|
});
|
|
53
|
-
test('get conditional stylesheet works with theme',
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
test('get conditional stylesheet works with theme', () => {
|
|
54
|
+
const theme = _createTheme1();
|
|
55
|
+
const styles = getThemeOptionalStyles(theme);
|
|
56
56
|
expect(styles.style3).toEqual({
|
|
57
57
|
backgroundColor: 'blue',
|
|
58
58
|
color: 'red',
|
|
59
59
|
fontSize: 10,
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
|
-
test('get themed stylesheet works for multiples',
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
test('get themed stylesheet works for multiples', () => {
|
|
63
|
+
const theme = _createTheme1();
|
|
64
|
+
const styles = getStyles1(theme);
|
|
65
65
|
expect(styles.style1).toEqual({
|
|
66
66
|
backgroundColor: 'blue',
|
|
67
67
|
color: 'red',
|
|
@@ -73,13 +73,13 @@ describe('Themed style sheet tests', function () {
|
|
|
73
73
|
fontSize: 50,
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
|
-
test('get themed stylesheet caches correctly',
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
test('get themed stylesheet caches correctly', () => {
|
|
77
|
+
const theme1 = _createTheme1();
|
|
78
|
+
const theme2 = _createTheme2();
|
|
79
|
+
const stylest1a = getStyles1(theme1);
|
|
80
|
+
const stylest2a = getStyles1(theme2);
|
|
81
|
+
const stylest1b = getStyles1(theme1);
|
|
82
|
+
const stylest2b = getStyles1(theme2);
|
|
83
83
|
expect(stylest1a).toBe(stylest1b);
|
|
84
84
|
expect(stylest2a).toBe(stylest2b);
|
|
85
85
|
expect(stylest1a).not.toBe(stylest2a);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themedStyleSheet.test.js","sourceRoot":"","sources":["../src/themedStyleSheet.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAQtD,SAAS,aAAa;IACpB,OAAO;QACL,MAAM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;SACb,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;YAC5B,KAAK,EAAE,MAAM;YACb,eAAe,EAAE,QAAQ;YACzB,QAAQ,EAAE,EAAE;SACb,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAClD,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;QAC/B,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClC,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.themedStyleSheet = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const react_native_1 = require("react-native");
|
|
5
|
+
const memo_cache_1 = require("@fluentui-react-native/memo-cache");
|
|
6
6
|
/**
|
|
7
7
|
* A convenience wrapper to create style sheets which depend upon values in a theme, and use them in a manner
|
|
8
8
|
* where they are built and cached once per theme. The return value of this routine will be a function
|
|
@@ -34,10 +34,10 @@ var memo_cache_1 = require("@fluentui-react-native/memo-cache");
|
|
|
34
34
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
35
35
|
function themedStyleSheet(generator) {
|
|
36
36
|
// create a memo cache for this themed stylesheet
|
|
37
|
-
|
|
37
|
+
const cache = (0, memo_cache_1.getMemoCache)();
|
|
38
38
|
// now return a theme => styles function
|
|
39
|
-
return
|
|
40
|
-
return cache(
|
|
39
|
+
return (theme) => {
|
|
40
|
+
return cache(() => react_native_1.StyleSheet.create(generator(theme)), [theme])[0];
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
exports.themedStyleSheet = themedStyleSheet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themedStyleSheet.js","sourceRoot":"","sources":["../src/themedStyleSheet.ts"],"names":[],"mappings":";;;AACA
|
|
1
|
+
{"version":3,"file":"themedStyleSheet.js","sourceRoot":"","sources":["../src/themedStyleSheet.ts"],"names":[],"mappings":";;;AACA,+CAA0C;AAE1C,kEAAiE;AASjE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wDAAwD;AACxD,SAAgB,gBAAgB,CAC9B,SAAkD;IAElD,iDAAiD;IACjD,MAAM,KAAK,GAAG,IAAA,yBAAY,GAAE,CAAC;IAE7B,wCAAwC;IACxC,OAAO,CAAC,KAAa,EAAE,EAAE;QACvB,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC,yBAAU,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC,CAAC;AACJ,CAAC;AAVD,4CAUC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const themedStyleSheet_1 = require("./themedStyleSheet");
|
|
4
4
|
function _createTheme1() {
|
|
5
5
|
return {
|
|
6
6
|
color1: 'blue',
|
|
@@ -15,7 +15,7 @@ function _createTheme2() {
|
|
|
15
15
|
fontSize: 12,
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
const getStyles1 = (0, themedStyleSheet_1.themedStyleSheet)((t) => {
|
|
19
19
|
return {
|
|
20
20
|
style1: {
|
|
21
21
|
backgroundColor: t.color1,
|
|
@@ -29,7 +29,7 @@ var getStyles1 = (0, themedStyleSheet_1.themedStyleSheet)(function (t) {
|
|
|
29
29
|
},
|
|
30
30
|
};
|
|
31
31
|
});
|
|
32
|
-
|
|
32
|
+
const getThemeOptionalStyles = (0, themedStyleSheet_1.themedStyleSheet)((t) => {
|
|
33
33
|
return {
|
|
34
34
|
style3: {
|
|
35
35
|
backgroundColor: (t && t.color1) || 'white',
|
|
@@ -38,32 +38,32 @@ var getThemeOptionalStyles = (0, themedStyleSheet_1.themedStyleSheet)(function (
|
|
|
38
38
|
},
|
|
39
39
|
};
|
|
40
40
|
});
|
|
41
|
-
describe('Themed style sheet tests',
|
|
42
|
-
test('get no theme stylesheet',
|
|
43
|
-
|
|
41
|
+
describe('Themed style sheet tests', () => {
|
|
42
|
+
test('get no theme stylesheet', () => {
|
|
43
|
+
const styles = getThemeOptionalStyles(undefined);
|
|
44
44
|
expect(styles.style3).toEqual({
|
|
45
45
|
backgroundColor: 'white',
|
|
46
46
|
color: 'black',
|
|
47
47
|
fontSize: 8,
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
|
-
test('get no theme stylesheet caches',
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
test('get no theme stylesheet caches', () => {
|
|
51
|
+
const styles1 = getThemeOptionalStyles(undefined);
|
|
52
|
+
const styles2 = getThemeOptionalStyles(undefined);
|
|
53
53
|
expect(styles1).toBe(styles2);
|
|
54
54
|
});
|
|
55
|
-
test('get conditional stylesheet works with theme',
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
test('get conditional stylesheet works with theme', () => {
|
|
56
|
+
const theme = _createTheme1();
|
|
57
|
+
const styles = getThemeOptionalStyles(theme);
|
|
58
58
|
expect(styles.style3).toEqual({
|
|
59
59
|
backgroundColor: 'blue',
|
|
60
60
|
color: 'red',
|
|
61
61
|
fontSize: 10,
|
|
62
62
|
});
|
|
63
63
|
});
|
|
64
|
-
test('get themed stylesheet works for multiples',
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
test('get themed stylesheet works for multiples', () => {
|
|
65
|
+
const theme = _createTheme1();
|
|
66
|
+
const styles = getStyles1(theme);
|
|
67
67
|
expect(styles.style1).toEqual({
|
|
68
68
|
backgroundColor: 'blue',
|
|
69
69
|
color: 'red',
|
|
@@ -75,13 +75,13 @@ describe('Themed style sheet tests', function () {
|
|
|
75
75
|
fontSize: 50,
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
|
-
test('get themed stylesheet caches correctly',
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
test('get themed stylesheet caches correctly', () => {
|
|
79
|
+
const theme1 = _createTheme1();
|
|
80
|
+
const theme2 = _createTheme2();
|
|
81
|
+
const stylest1a = getStyles1(theme1);
|
|
82
|
+
const stylest2a = getStyles1(theme2);
|
|
83
|
+
const stylest1b = getStyles1(theme1);
|
|
84
|
+
const stylest2b = getStyles1(theme2);
|
|
85
85
|
expect(stylest1a).toBe(stylest1b);
|
|
86
86
|
expect(stylest2a).toBe(stylest2b);
|
|
87
87
|
expect(stylest1a).not.toBe(stylest2a);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themedStyleSheet.test.js","sourceRoot":"","sources":["../src/themedStyleSheet.test.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"themedStyleSheet.test.js","sourceRoot":"","sources":["../src/themedStyleSheet.test.ts"],"names":[],"mappings":";;AAAA,yDAAsD;AAQtD,SAAS,aAAa;IACpB,OAAO;QACL,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,EAAE;KACb,CAAC;AACJ,CAAC;AAED,SAAS,aAAa;IACp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ACrC,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClC,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/themed-stylesheet",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.4",
|
|
4
4
|
"description": "Helper for using react-native StyleSheets with themes",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,6 +9,13 @@
|
|
|
9
9
|
},
|
|
10
10
|
"main": "lib-commonjs/index.js",
|
|
11
11
|
"module": "lib/index.js",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./lib/index.js",
|
|
15
|
+
"require": "./lib-commonjs/index.js",
|
|
16
|
+
"types": "./lib/index.d.ts"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
12
19
|
"typings": "lib/index.d.ts",
|
|
13
20
|
"scripts": {
|
|
14
21
|
"build": "fluentui-scripts build",
|
|
@@ -27,7 +34,7 @@
|
|
|
27
34
|
"author": "",
|
|
28
35
|
"license": "MIT",
|
|
29
36
|
"dependencies": {
|
|
30
|
-
"@fluentui-react-native/memo-cache": "1.3.
|
|
37
|
+
"@fluentui-react-native/memo-cache": "1.3.5"
|
|
31
38
|
},
|
|
32
39
|
"devDependencies": {
|
|
33
40
|
"@babel/core": "^7.20.0",
|
|
@@ -57,6 +64,7 @@
|
|
|
57
64
|
]
|
|
58
65
|
},
|
|
59
66
|
"capabilities": [
|
|
67
|
+
"babel-preset-react-native",
|
|
60
68
|
"core",
|
|
61
69
|
"core-android",
|
|
62
70
|
"core-ios"
|