@fluentui-react-native/use-tokens 0.6.3 → 0.6.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 +36 -1
- package/CHANGELOG.md +10 -2
- package/eslint.config.js +3 -0
- package/lib/applyPropsToTokens.js +4 -13
- package/lib/applyPropsToTokens.js.map +1 -1
- package/lib/applyPropsToTokens.test.js +11 -12
- package/lib/applyPropsToTokens.test.js.map +1 -1
- package/lib/applyTokenLayers.js +6 -6
- package/lib/applyTokenLayers.js.map +1 -1
- package/lib/applyTokenLayers.test.js +15 -16
- package/lib/applyTokenLayers.test.js.map +1 -1
- package/lib/buildUseTokens.js +7 -16
- package/lib/buildUseTokens.js.map +1 -1
- package/lib/buildUseTokens.test.js +24 -25
- package/lib/buildUseTokens.test.js.map +1 -1
- package/lib/customizable.js +3 -7
- package/lib/customizable.js.map +1 -1
- package/lib/patchTokens.js +4 -13
- package/lib/patchTokens.js.map +1 -1
- package/lib/patchTokens.test.js +19 -19
- package/lib/patchTokens.test.js.map +1 -1
- package/lib/useTokens.samples.test.js +33 -34
- package/lib/useTokens.samples.test.js.map +1 -1
- package/lib-commonjs/applyPropsToTokens.js +4 -13
- package/lib-commonjs/applyPropsToTokens.js.map +1 -1
- package/lib-commonjs/applyPropsToTokens.test.js +13 -14
- package/lib-commonjs/applyPropsToTokens.test.js.map +1 -1
- package/lib-commonjs/applyTokenLayers.js +7 -7
- package/lib-commonjs/applyTokenLayers.js.map +1 -1
- package/lib-commonjs/applyTokenLayers.test.js +17 -18
- package/lib-commonjs/applyTokenLayers.test.js.map +1 -1
- package/lib-commonjs/buildUseTokens.js +9 -18
- package/lib-commonjs/buildUseTokens.js.map +1 -1
- package/lib-commonjs/buildUseTokens.test.js +25 -26
- package/lib-commonjs/buildUseTokens.test.js.map +1 -1
- package/lib-commonjs/customizable.js +3 -7
- package/lib-commonjs/customizable.js.map +1 -1
- package/lib-commonjs/patchTokens.js +4 -13
- package/lib-commonjs/patchTokens.js.map +1 -1
- package/lib-commonjs/patchTokens.test.js +21 -21
- package/lib-commonjs/patchTokens.test.js.map +1 -1
- package/lib-commonjs/useTokens.samples.test.js +40 -40
- package/lib-commonjs/useTokens.samples.test.js.map +1 -1
- package/package.json +12 -4
- package/.eslintrc.js +0 -3
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.patchTokens = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
4
|
/**
|
|
6
5
|
* Take a set of tokens (and a memo-cache) and apply changes to those tokens from an additional set of tokens. Only keys which are
|
|
7
6
|
* not undefined will be applied and if no changes are detected the token object will be unchanged.
|
|
@@ -13,21 +12,13 @@ var tslib_1 = require("tslib");
|
|
|
13
12
|
*/
|
|
14
13
|
function patchTokens(tokens, cache, patchValues) {
|
|
15
14
|
// reduce the patch values to the set of keys that are defined, and sort them to ensure consistent ordering
|
|
16
|
-
|
|
17
|
-
.filter(
|
|
15
|
+
const keys = Object.keys(patchValues)
|
|
16
|
+
.filter((v) => patchValues[v] !== undefined)
|
|
18
17
|
.sort();
|
|
19
|
-
var _loop_1 = function (key) {
|
|
20
|
-
var _a;
|
|
21
|
-
_a = cache(function () {
|
|
22
|
-
var _a;
|
|
23
|
-
return (tslib_1.__assign(tslib_1.__assign({}, tokens), (_a = {}, _a[key] = patchValues[key], _a)));
|
|
24
|
-
}, [key, patchValues[key]]), tokens = _a[0], cache = _a[1];
|
|
25
|
-
};
|
|
26
18
|
// for each key get an updated tokens collection based on key + value. Value alone isn't sufficient as the values
|
|
27
19
|
// are not necessarily unique. i.e. { a: 'blue' } and { b: 'blue' } would cache to the same without the key
|
|
28
|
-
for (
|
|
29
|
-
|
|
30
|
-
_loop_1(key);
|
|
20
|
+
for (const key of keys) {
|
|
21
|
+
[tokens, cache] = cache(() => ({ ...tokens, [key]: patchValues[key] }), [key, patchValues[key]]);
|
|
31
22
|
}
|
|
32
23
|
// return the updated tokens and cache (if there were any keys applied)
|
|
33
24
|
return [tokens, cache];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patchTokens.js","sourceRoot":"","sources":["../src/patchTokens.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"patchTokens.js","sourceRoot":"","sources":["../src/patchTokens.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;GAQG;AACH,SAAgB,WAAW,CACzB,MAAe,EACf,KAA4B,EAC5B,WAAoB;IAEpB,2GAA2G;IAC3G,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;SAClC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;SAC3C,IAAI,EAAE,CAAC;IAEV,iHAAiH;IACjH,2GAA2G;IAC3G,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;KAClG;IAED,uEAAuE;IACvE,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACzB,CAAC;AAlBD,kCAkBC"}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const memo_cache_1 = require("@fluentui-react-native/memo-cache");
|
|
4
|
+
const patchTokens_1 = require("./patchTokens");
|
|
5
|
+
const themeTokens = {
|
|
6
6
|
uno: 'uno',
|
|
7
7
|
dos: 'dos',
|
|
8
8
|
tres: 3,
|
|
9
9
|
quatro: 4,
|
|
10
10
|
cinco: true,
|
|
11
11
|
};
|
|
12
|
-
describe('patchTokens tests',
|
|
13
|
-
test('props get copied',
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
describe('patchTokens tests', () => {
|
|
13
|
+
test('props get copied', () => {
|
|
14
|
+
const cache = (0, memo_cache_1.getMemoCache)();
|
|
15
|
+
const patchValues = { uno: 'one', quatro: 'quatro' };
|
|
16
|
+
const [tokens] = (0, patchTokens_1.patchTokens)(themeTokens, cache, patchValues);
|
|
17
17
|
expect(tokens).not.toBe(themeTokens);
|
|
18
|
-
for (
|
|
18
|
+
for (const key in patchValues) {
|
|
19
19
|
expect(tokens[key]).toEqual(patchValues[key]);
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
test('no copied props does not change tokens',
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
test('no copied props does not change tokens', () => {
|
|
23
|
+
const cache = (0, memo_cache_1.getMemoCache)();
|
|
24
|
+
const patchValues1 = {};
|
|
25
|
+
const [tokens] = (0, patchTokens_1.patchTokens)(themeTokens, cache, patchValues1);
|
|
26
26
|
expect(tokens).toBe(themeTokens);
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const patchValues2 = { tres: undefined };
|
|
28
|
+
const [tokens2] = (0, patchTokens_1.patchTokens)(themeTokens, cache, patchValues2);
|
|
29
29
|
expect(tokens2).toBe(themeTokens);
|
|
30
30
|
});
|
|
31
|
-
test('patching tokens cache independent of order',
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
test('patching tokens cache independent of order', () => {
|
|
32
|
+
const cache = (0, memo_cache_1.getMemoCache)();
|
|
33
|
+
const patch1 = { uno: 'one', cinco: false };
|
|
34
|
+
const patch2 = { cinco: false, uno: 'one' };
|
|
35
|
+
const [tokens1] = (0, patchTokens_1.patchTokens)(themeTokens, cache, patch1);
|
|
36
|
+
const [tokens2] = (0, patchTokens_1.patchTokens)(themeTokens, cache, patch2);
|
|
37
37
|
expect(tokens1).toBe(tokens2);
|
|
38
38
|
});
|
|
39
39
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patchTokens.test.js","sourceRoot":"","sources":["../src/patchTokens.test.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"patchTokens.test.js","sourceRoot":"","sources":["../src/patchTokens.test.ts"],"names":[],"mappings":";;AAAA,kEAAiE;AAEjE,+CAA4C;AAU5C,MAAM,WAAW,GAAW;IAC1B,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,IAAI;CACZ,CAAC;AAEF,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAI,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAC5B,MAAM,KAAK,GAAG,IAAA,yBAAY,GAAE,CAAC;QAC7B,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;QACrD,MAAM,CAAC,MAAM,CAAC,GAAG,IAAA,yBAAW,EAAC,WAAW,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;QAC9D,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACrC,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE;YAC7B,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;SAC/C;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAClD,MAAM,KAAK,GAAG,IAAA,yBAAY,GAAE,CAAC;QAC7B,MAAM,YAAY,GAAG,EAAE,CAAC;QACxB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAA,yBAAW,EAAC,WAAW,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;QAC/D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEjC,MAAM,YAAY,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACzC,MAAM,CAAC,OAAO,CAAC,GAAG,IAAA,yBAAW,EAAC,WAAW,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;QAChE,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACtD,MAAM,KAAK,GAAG,IAAA,yBAAY,GAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;QAC5C,MAAM,MAAM,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;QAC5C,MAAM,CAAC,OAAO,CAAC,GAAG,IAAA,yBAAW,EAAC,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAC1D,MAAM,CAAC,OAAO,CAAC,GAAG,IAAA,yBAAW,EAAC,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAC1D,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const React = tslib_1.__importStar(require("react"));
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const immutable_merge_1 = require("@fluentui-react-native/immutable-merge");
|
|
7
|
+
const merge_props_1 = require("@fluentui-react-native/merge-props");
|
|
8
|
+
const renderer = tslib_1.__importStar(require("react-test-renderer"));
|
|
9
|
+
const buildUseTokens_1 = require("./buildUseTokens");
|
|
10
10
|
/**
|
|
11
11
|
* The default/base theme just contains base values
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
const baseTheme = {
|
|
14
14
|
globals: {
|
|
15
15
|
backgroundColor: 'white',
|
|
16
16
|
color: 'black',
|
|
@@ -20,48 +20,48 @@ var baseTheme = {
|
|
|
20
20
|
},
|
|
21
21
|
components: {},
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const current = { theme: baseTheme };
|
|
24
|
+
const useTheme = () => current.theme;
|
|
25
|
+
const setActiveTheme = (theme) => {
|
|
26
26
|
current.theme = (theme && (0, immutable_merge_1.immutableMerge)(baseTheme, theme)) || baseTheme;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
29
|
* Helper function used to look up a component in the theme. Having this injected allows this module to not be dependent on the shape of
|
|
30
30
|
* the theme used.
|
|
31
31
|
*/
|
|
32
|
-
|
|
33
|
-
describe('useTokens samples',
|
|
32
|
+
const getComponentInfo = (theme, name) => theme.components[name];
|
|
33
|
+
describe('useTokens samples', () => {
|
|
34
34
|
/**
|
|
35
35
|
* Sample #1 - Themeable text element
|
|
36
36
|
*
|
|
37
37
|
* This adds some default opinions for how a text element should be styled but only allows for customization
|
|
38
38
|
* via theming
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
const useTokensSample1 = (0, buildUseTokens_1.buildUseTokens)(getComponentInfo,
|
|
41
41
|
/** first the default values should come from the global theme section */
|
|
42
|
-
|
|
42
|
+
(t) => ({
|
|
43
43
|
color: t.globals.color,
|
|
44
44
|
fontFamily: t.globals.fontFamily,
|
|
45
45
|
fontSize: t.globals.fontSize,
|
|
46
|
-
})
|
|
46
|
+
}),
|
|
47
47
|
/** next we should look for a component reference to overlay */
|
|
48
48
|
'SampleText');
|
|
49
|
-
|
|
49
|
+
const SampleText1 = (props) => {
|
|
50
50
|
// standard props splitting
|
|
51
|
-
|
|
51
|
+
const { style, children, ...rest } = props;
|
|
52
52
|
// typically this would start with a call to retrieve the theme from the context via whatever method is appropriate
|
|
53
|
-
|
|
53
|
+
const theme = useTheme();
|
|
54
54
|
// next the tokens are resolved from the theme, a cache specific to this theme is returned as well to allow for
|
|
55
55
|
// style objects to not be rebuilt unnecessarily
|
|
56
|
-
|
|
56
|
+
const [tokens, cache] = useTokensSample1(theme);
|
|
57
57
|
// build up the text style, or the full props as appropriate
|
|
58
|
-
|
|
58
|
+
const styleFromTokens = cache(
|
|
59
59
|
/**
|
|
60
60
|
* first build the style object
|
|
61
61
|
* - this executes once for every unique set of keys.
|
|
62
62
|
* - The cache is already unique for this theme
|
|
63
63
|
*/
|
|
64
|
-
|
|
64
|
+
() => ({ ...tokens }),
|
|
65
65
|
/**
|
|
66
66
|
* now specify the keys
|
|
67
67
|
* - because the only changing variable is the theme
|
|
@@ -72,20 +72,20 @@ describe('useTokens samples', function () {
|
|
|
72
72
|
[]);
|
|
73
73
|
// merge the props from the tokens with anything passed in via style. This is internally cached via object identity
|
|
74
74
|
// so the merged style object won't change identity unless one of the two inputs changes identity.
|
|
75
|
-
|
|
75
|
+
const mergedStyle = (0, merge_props_1.mergeStyles)(styleFromTokens, style);
|
|
76
76
|
// now just render the element, forwarding the props, setting the merged style, then passing the children as appropriate
|
|
77
|
-
return (React.createElement(react_native_1.Text,
|
|
77
|
+
return (React.createElement(react_native_1.Text, { ...rest, style: mergedStyle }, children));
|
|
78
78
|
};
|
|
79
|
-
beforeEach(
|
|
79
|
+
beforeEach(() => {
|
|
80
80
|
setActiveTheme();
|
|
81
81
|
});
|
|
82
82
|
/** first render the component with no updates */
|
|
83
|
-
it('Sample1Text rendering with no overrides',
|
|
84
|
-
|
|
83
|
+
it('Sample1Text rendering with no overrides', () => {
|
|
84
|
+
const tree = renderer.create(React.createElement(SampleText1, null, "Sample1a")).toJSON();
|
|
85
85
|
expect(tree).toMatchSnapshot();
|
|
86
86
|
});
|
|
87
87
|
/** now re-theme the component via the components in the theme */
|
|
88
|
-
it('Sample1Text rendering with some custom settings in the theme',
|
|
88
|
+
it('Sample1Text rendering with some custom settings in the theme', () => {
|
|
89
89
|
setActiveTheme({
|
|
90
90
|
components: {
|
|
91
91
|
SampleText: {
|
|
@@ -94,28 +94,28 @@ describe('useTokens samples', function () {
|
|
|
94
94
|
},
|
|
95
95
|
},
|
|
96
96
|
});
|
|
97
|
-
|
|
97
|
+
const tree = renderer.create(React.createElement(SampleText1, null, "Sample1b")).toJSON();
|
|
98
98
|
expect(tree).toMatchSnapshot();
|
|
99
99
|
});
|
|
100
100
|
// the Sample2Text component is built the same way as sample1, just using the new hook that has been created
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
const SampleText2 = (props) => {
|
|
102
|
+
const { color, style, children, ...rest } = props;
|
|
103
|
+
const theme = useTheme();
|
|
104
104
|
// this starts the same as sample1, extract tokens from the theme and get a theme specific cache object
|
|
105
|
-
|
|
105
|
+
const [tokens, cache] = useTokensSample1(theme);
|
|
106
106
|
// now when building up the style this time, the resulting style object is based upon both the theme and the passed
|
|
107
107
|
// in value of colors. Because the theme is already part of the cache definition, only color needs to be a key
|
|
108
|
-
|
|
108
|
+
const styleFromTokens = cache(
|
|
109
109
|
/** build the style, only patch the color if it has a value, otherwise the theme value would get stomped if color was undefined */
|
|
110
|
-
|
|
110
|
+
() => ({ ...tokens, ...(color && { color }) }),
|
|
111
111
|
/** use color as an additional key for the style */
|
|
112
112
|
[color]);
|
|
113
113
|
// now just render, this time merging styles inline to make it a bit shorter
|
|
114
|
-
return (React.createElement(react_native_1.Text,
|
|
114
|
+
return (React.createElement(react_native_1.Text, { ...rest, style: (0, merge_props_1.mergeStyles)(styleFromTokens, style) }, children));
|
|
115
115
|
};
|
|
116
116
|
/** rendering the Sample2 component with the base theme */
|
|
117
|
-
it('Sample2Text rendering with defaults and a color override',
|
|
118
|
-
|
|
117
|
+
it('Sample2Text rendering with defaults and a color override', () => {
|
|
118
|
+
const tree = renderer
|
|
119
119
|
.create(React.createElement(react_native_1.View, null,
|
|
120
120
|
React.createElement(SampleText2, null, "Sample2 with defaults"),
|
|
121
121
|
React.createElement(SampleText2, { color: "green" }, "Sample2 with color override via prop")))
|
|
@@ -123,7 +123,7 @@ describe('useTokens samples', function () {
|
|
|
123
123
|
expect(tree).toMatchSnapshot();
|
|
124
124
|
});
|
|
125
125
|
/** now re-theme the component via the components in the theme */
|
|
126
|
-
it('Sample2Text rendering with some custom settings in the theme',
|
|
126
|
+
it('Sample2Text rendering with some custom settings in the theme', () => {
|
|
127
127
|
setActiveTheme({
|
|
128
128
|
components: {
|
|
129
129
|
SampleText: {
|
|
@@ -132,7 +132,7 @@ describe('useTokens samples', function () {
|
|
|
132
132
|
},
|
|
133
133
|
},
|
|
134
134
|
});
|
|
135
|
-
|
|
135
|
+
const tree = renderer
|
|
136
136
|
.create(React.createElement(react_native_1.View, null,
|
|
137
137
|
React.createElement(SampleText2, null, "Sample2 with theme overrides set"),
|
|
138
138
|
React.createElement(SampleText2, { color: "purple" }, "Sample2 with theme and color prop override")))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTokens.samples.test.js","sourceRoot":"","sources":["../src/useTokens.samples.test.tsx"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"useTokens.samples.test.js","sourceRoot":"","sources":["../src/useTokens.samples.test.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAE/B,+CAA0C;AAE1C,4EAAwE;AACxE,oEAAiE;AACjE,sEAAgD;AAEhD,qDAAkD;AAuBlD;;GAEG;AACH,MAAM,SAAS,GAAU;IACvB,OAAO,EAAE;QACP,eAAe,EAAE,OAAO;QACxB,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,MAAM;QACnB,UAA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C,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/use-tokens",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "Utilities and hook function for getting themed tokens for a component",
|
|
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,13 +34,13 @@
|
|
|
27
34
|
"author": "",
|
|
28
35
|
"license": "MIT",
|
|
29
36
|
"dependencies": {
|
|
30
|
-
"@fluentui-react-native/immutable-merge": "1.2.
|
|
31
|
-
"@fluentui-react-native/memo-cache": "1.3.
|
|
37
|
+
"@fluentui-react-native/immutable-merge": "1.2.3",
|
|
38
|
+
"@fluentui-react-native/memo-cache": "1.3.4",
|
|
32
39
|
"tslib": "^2.3.1"
|
|
33
40
|
},
|
|
34
41
|
"devDependencies": {
|
|
35
42
|
"@babel/core": "^7.20.0",
|
|
36
|
-
"@fluentui-react-native/merge-props": "0.9.
|
|
43
|
+
"@fluentui-react-native/merge-props": "0.9.3",
|
|
37
44
|
"@fluentui-react-native/scripts": "0.1.1",
|
|
38
45
|
"@react-native/babel-preset": "^0.74.0",
|
|
39
46
|
"@react-native/metro-config": "^0.74.0",
|
|
@@ -56,6 +63,7 @@
|
|
|
56
63
|
]
|
|
57
64
|
},
|
|
58
65
|
"capabilities": [
|
|
66
|
+
"babel-preset-react-native",
|
|
59
67
|
"core",
|
|
60
68
|
"core-android",
|
|
61
69
|
"core-ios",
|
package/.eslintrc.js
DELETED