@uifabricshared/foundation-compose 1.15.3 → 1.15.5
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/compose.js +6 -10
- package/lib/compose.js.map +1 -1
- package/lib/useStyling.js +12 -12
- package/lib/useStyling.js.map +1 -1
- package/lib-commonjs/compose.js +9 -13
- package/lib-commonjs/compose.js.map +1 -1
- package/lib-commonjs/useStyling.js +18 -18
- package/lib-commonjs/useStyling.js.map +1 -1
- package/package.json +20 -11
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,48 @@
|
|
|
2
2
|
"name": "@uifabricshared/foundation-compose",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 11 Jul 2025 19:50:37 GMT",
|
|
6
|
+
"version": "1.15.5",
|
|
7
|
+
"tag": "@uifabricshared/foundation-compose_v1.15.5",
|
|
8
|
+
"comments": {
|
|
9
|
+
"none": [
|
|
10
|
+
{
|
|
11
|
+
"author": "sanajmi@microsoft.com",
|
|
12
|
+
"package": "@uifabricshared/foundation-compose",
|
|
13
|
+
"commit": "405ca368dc3f2963bfc252a1952b1e14ff503499",
|
|
14
|
+
"comment": "fix: run `beachball sync` to sync package versions with NPM"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "jasonmo@microsoft.com",
|
|
18
|
+
"package": "@uifabricshared/foundation-compose",
|
|
19
|
+
"commit": "54087dca787180bbf34630470cd0d06e88366b30",
|
|
20
|
+
"comment": "update eslint to 9.x and use new flat config format with security rules"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "4123478+tido64@users.noreply.github.com",
|
|
24
|
+
"package": "@uifabricshared/foundation-compose",
|
|
25
|
+
"commit": "79bb06f6bbfd0a36f9d2ef371f4857be9660f027",
|
|
26
|
+
"comment": "Fixed `align-deps` warnings"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "ruaraki@microsoft.com",
|
|
30
|
+
"package": "@uifabricshared/foundation-compose",
|
|
31
|
+
"commit": "a245202877ef7f2be9ab5f0e1356b2270957e693",
|
|
32
|
+
"comment": "Run bump-versions"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"patch": [
|
|
36
|
+
{
|
|
37
|
+
"author": "jasonmo@microsoft.com",
|
|
38
|
+
"package": "@uifabricshared/foundation-compose",
|
|
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:13 GMT",
|
|
6
47
|
"version": "1.15.3",
|
|
7
48
|
"tag": "@uifabricshared/foundation-compose_v1.15.3",
|
|
8
49
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
# Change Log - @uifabricshared/foundation-compose
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Fri, 11 Jul 2025 19:50:37 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.15.5
|
|
8
|
+
|
|
9
|
+
Fri, 11 Jul 2025 19:50:37 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- update builds to use node16 settings and modern export maps (jasonmo@microsoft.com)
|
|
14
|
+
|
|
7
15
|
## 1.15.3
|
|
8
16
|
|
|
9
|
-
Thu,
|
|
17
|
+
Thu, 10 Jul 2025 19:20:13 GMT
|
|
10
18
|
|
|
11
19
|
### Patches
|
|
12
20
|
|
package/eslint.config.js
ADDED
package/lib/compose.js
CHANGED
|
@@ -11,7 +11,7 @@ import { immutableMerge } from '@fluentui-react-native/immutable-merge';
|
|
|
11
11
|
*/
|
|
12
12
|
function _getComponentOptions(inputComponent, base) {
|
|
13
13
|
if (base) {
|
|
14
|
-
|
|
14
|
+
const mergedSettings = { settings: [].concat(base.settings || [], inputComponent.settings || []).filter((v) => v) };
|
|
15
15
|
return immutableMerge(base, inputComponent, mergedSettings);
|
|
16
16
|
}
|
|
17
17
|
return inputComponent;
|
|
@@ -26,24 +26,20 @@ function _getComponentOptions(inputComponent, base) {
|
|
|
26
26
|
*/
|
|
27
27
|
export function compose(inputComponent, base) {
|
|
28
28
|
// get merged options for the component
|
|
29
|
-
|
|
29
|
+
const options = _getComponentOptions(inputComponent, base && getOptionsFromObj(base));
|
|
30
30
|
// set up the styling injection function
|
|
31
31
|
options.useStyling = initializeStyling(options);
|
|
32
32
|
// use composable to create the function implementation
|
|
33
|
-
|
|
33
|
+
const Component = composable(options);
|
|
34
34
|
// attach extra information to the returned function component
|
|
35
35
|
Component.displayName = options.displayName;
|
|
36
36
|
Object.assign(Component, options.statics);
|
|
37
37
|
// set up the customize handler
|
|
38
|
-
Component.customize =
|
|
39
|
-
|
|
40
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
41
|
-
settings[_i] = arguments[_i];
|
|
42
|
-
}
|
|
43
|
-
return compose({ settings: settings }, Component);
|
|
38
|
+
Component.customize = (...settings) => {
|
|
39
|
+
return compose({ settings }, Component);
|
|
44
40
|
};
|
|
45
41
|
// set up the compose handler
|
|
46
|
-
Component.compose =
|
|
42
|
+
Component.compose = (newOptions) => {
|
|
47
43
|
return compose(newOptions, Component);
|
|
48
44
|
};
|
|
49
45
|
// now return the newly created component
|
package/lib/compose.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../src/compose.tsx"],"names":[],"mappings":"AAAA,oBAAoB;AAGpB,OAAO,EACL,UAAU,GAMX,MAAM,uCAAuC,CAAC;AAC/C,OAAO,E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AAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAC5C,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1C,+BAA+B;IAC/B,SAAS,CAAC,SAAS,GAAG,CAAC,GAAG,QAAuD,EAAE,EAAE;QACnF,OAAO,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC,CAAC;IAEF,6BAA6B;IAC7B,SAAS,CAAC,OAAO,GAAG,CAAC,UAAwF,EAAE,EAAE;QAC/G,OAAO,OAAO,CAAQ,UAAU,EAAE,SAAS,CAAC,CAAC;IAC/C,CAAC,CAAC;IAEF,yCAAyC;IACzC,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/lib/useStyling.js
CHANGED
|
@@ -7,30 +7,30 @@ import { defaultFluentTheme } from '@fluentui-react-native/default-theme';
|
|
|
7
7
|
import { getMemoCache } from '@fluentui-react-native/memo-cache';
|
|
8
8
|
/* tslint:disable-next-line no-any */
|
|
9
9
|
export function getOptionsFromObj(obj) {
|
|
10
|
-
|
|
10
|
+
const objType = obj && typeof obj;
|
|
11
11
|
return ((objType === 'object' || objType === 'function') && obj.__composable) || undefined;
|
|
12
12
|
}
|
|
13
13
|
function _getSettingsFromTheme(theme, name) {
|
|
14
14
|
return getSettings(theme, name);
|
|
15
15
|
}
|
|
16
16
|
function _getHasToken(slots) {
|
|
17
|
-
|
|
18
|
-
Object.keys(slots).forEach(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const slotTokens = {};
|
|
18
|
+
Object.keys(slots).forEach((slotName) => {
|
|
19
|
+
const slot = slots[slotName];
|
|
20
|
+
const slotType = (typeof slot !== 'object' ? slot : slot.slotType);
|
|
21
|
+
const options = getOptionsFromObj(slotType);
|
|
22
22
|
slotTokens[slotName] = (options && options.resolvedTokens && options.resolvedTokens.tokenKeys) || undefined;
|
|
23
23
|
});
|
|
24
|
-
return
|
|
24
|
+
return (target, key) => {
|
|
25
25
|
return slotTokens[target] && slotTokens[target].hasOwnProperty(key);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
function useStylingCore(props, options, instanceMemoCache, lookupOverride) {
|
|
29
29
|
// get the theme value from the context (or the default theme if it is not set)
|
|
30
|
-
|
|
30
|
+
const theme = useTheme() || defaultFluentTheme;
|
|
31
31
|
// resolve the array of settings for these options
|
|
32
32
|
lookupOverride = lookupOverride || props;
|
|
33
|
-
|
|
33
|
+
const { settings, getMemoValue } = getThemedSettings(options.settings, theme, instanceMemoCache, lookupOverride, _getSettingsFromTheme);
|
|
34
34
|
// finish by processing the tokens and turning IComponentSettings into ISlotProps (this removes things like _overrides)
|
|
35
35
|
return returnAsSlotProps(processTokens(props, theme, settings, options.resolvedTokens, getMemoValue));
|
|
36
36
|
}
|
|
@@ -43,12 +43,12 @@ function useStylingCore(props, options, instanceMemoCache, lookupOverride) {
|
|
|
43
43
|
*/
|
|
44
44
|
export function initializeStyling(options) {
|
|
45
45
|
// process the tokens and get them ready to render
|
|
46
|
-
|
|
46
|
+
const { styles, slots } = options;
|
|
47
47
|
options.resolvedTokens = buildComponentTokens(styles, _getHasToken(slots));
|
|
48
48
|
// memo cache root for this component, keyed on options
|
|
49
|
-
|
|
49
|
+
const getMemoValue = getMemoCache(options);
|
|
50
50
|
// create a useStyling implementation for this component type (per type, not per instance)
|
|
51
|
-
return
|
|
51
|
+
return (props, lookupOverride) => {
|
|
52
52
|
return useStylingCore(props, options, getMemoValue, lookupOverride);
|
|
53
53
|
};
|
|
54
54
|
}
|
package/lib/useStyling.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStyling.js","sourceRoot":"","sources":["../src/useStyling.ts"],"names":[],"mappings":"AAAA,oBAAoB;AAGpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAU,WAAW,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CA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O,CAAC,cAAc,GAAG,oBAAoB,CAA8B,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAExG,uDAAuD;IACvD,MAAM,YAAY,GAAG,YAAY,CAAa,OAAO,CAAC,CAAC;IAEvD,0FAA0F;IAC1F,OAAO,CAAC,KAAa,EAAE,cAAgC,EAAE,EAAE;QACzD,OAAO,cAAc,CAA8B,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;IACnG,CAAC,CAAC;AACJ,CAAC"}
|
package/lib-commonjs/compose.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.compose = void 0;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const foundation_composable_1 = require("@uifabricshared/foundation-composable");
|
|
6
|
+
const useStyling_1 = require("./useStyling");
|
|
7
|
+
const immutable_merge_1 = require("@fluentui-react-native/immutable-merge");
|
|
8
8
|
/**
|
|
9
9
|
* Merge current and base options together to form the new object definition. These objects will merge with the
|
|
10
10
|
* exception of settings which will be appended
|
|
@@ -14,7 +14,7 @@ var immutable_merge_1 = require("@fluentui-react-native/immutable-merge");
|
|
|
14
14
|
*/
|
|
15
15
|
function _getComponentOptions(inputComponent, base) {
|
|
16
16
|
if (base) {
|
|
17
|
-
|
|
17
|
+
const mergedSettings = { settings: [].concat(base.settings || [], inputComponent.settings || []).filter((v) => v) };
|
|
18
18
|
return (0, immutable_merge_1.immutableMerge)(base, inputComponent, mergedSettings);
|
|
19
19
|
}
|
|
20
20
|
return inputComponent;
|
|
@@ -29,24 +29,20 @@ function _getComponentOptions(inputComponent, base) {
|
|
|
29
29
|
*/
|
|
30
30
|
function compose(inputComponent, base) {
|
|
31
31
|
// get merged options for the component
|
|
32
|
-
|
|
32
|
+
const options = _getComponentOptions(inputComponent, base && (0, useStyling_1.getOptionsFromObj)(base));
|
|
33
33
|
// set up the styling injection function
|
|
34
34
|
options.useStyling = (0, useStyling_1.initializeStyling)(options);
|
|
35
35
|
// use composable to create the function implementation
|
|
36
|
-
|
|
36
|
+
const Component = (0, foundation_composable_1.composable)(options);
|
|
37
37
|
// attach extra information to the returned function component
|
|
38
38
|
Component.displayName = options.displayName;
|
|
39
39
|
Object.assign(Component, options.statics);
|
|
40
40
|
// set up the customize handler
|
|
41
|
-
Component.customize =
|
|
42
|
-
|
|
43
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
44
|
-
settings[_i] = arguments[_i];
|
|
45
|
-
}
|
|
46
|
-
return compose({ settings: settings }, Component);
|
|
41
|
+
Component.customize = (...settings) => {
|
|
42
|
+
return compose({ settings }, Component);
|
|
47
43
|
};
|
|
48
44
|
// set up the compose handler
|
|
49
|
-
Component.compose =
|
|
45
|
+
Component.compose = (newOptions) => {
|
|
50
46
|
return compose(newOptions, Component);
|
|
51
47
|
};
|
|
52
48
|
// now return the newly created component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../src/compose.tsx"],"names":[],"mappings":";AAAA,oBAAoB;;;AAGpB
|
|
1
|
+
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../src/compose.tsx"],"names":[],"mappings":";AAAA,oBAAoB;;;AAGpB,iFAO+C;AAC/C,6CAAoE;AACpE,4EAAwE;AAGxE;;;;;;GAMG;AACH,SAAS,oBAAoB,CAO3B,cAAuF,EACvF,IAAqE;IAErE,IAAI,IAAI,EAAE;QACR,MAAM,cAAc,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,EAAE,cAAc,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACpH,OAAO,IAAA,gCAAc,EAAC,IAAI,EAAE,cAAc,EAAE,cAAc,CAAmE,CAAC;KAC/H;IACD,OAAO,cAAgF,CAAC;AAC1F,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,OAAO,CACrB,cAEC,EACD,IAAsB;IAUtB,uCAAuC;IACvC,MAAM,OAAO,GAAG,oBAAoB,CAAqD,cAAc,EAAE,IAAI,IAAI,IAAA,8BAAiB,EAAC,IAAI,CAAC,CAAC,CAAC;IAE1I,wCAAwC;IACxC,OAAO,CAAC,UAAU,GAAG,IAAA,8BAAiB,EAAqD,OAAO,CAAC,CAAC;IAEpG,uDAAuD;IACvD,MAAM,SAAS,GAAG,IAAA,kCAAU,EAAiD,OAAc,CAAgB,CAAC;IAE5G,8DAA8D;IAC9D,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAC5C,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1C,+BAA+B;IAC/B,SAAS,CAAC,SAAS,GAAG,CAAC,GAAG,QAAuD,EAAE,EAAE;QACnF,OAAO,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC,CAAC;IAEF,6BAA6B;IAC7B,SAAS,CAAC,OAAO,GAAG,CAAC,UAAwF,EAAE,EAAE;QAC/G,OAAO,OAAO,CAAQ,UAAU,EAAE,SAAS,CAAC,CAAC;IAC/C,CAAC,CAAC;IAEF,yCAAyC;IACzC,OAAO,SAAS,CAAC;AACnB,CAAC;AAvCD,0BAuCC"}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.initializeStyling = exports.getOptionsFromObj = void 0;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const themed_settings_1 = require("@uifabricshared/themed-settings");
|
|
6
|
+
const theming_ramp_1 = require("@uifabricshared/theming-ramp");
|
|
7
|
+
const foundation_tokens_1 = require("@uifabricshared/foundation-tokens");
|
|
8
|
+
const theme_types_1 = require("@fluentui-react-native/theme-types");
|
|
9
|
+
const default_theme_1 = require("@fluentui-react-native/default-theme");
|
|
10
|
+
const memo_cache_1 = require("@fluentui-react-native/memo-cache");
|
|
11
11
|
/* tslint:disable-next-line no-any */
|
|
12
12
|
function getOptionsFromObj(obj) {
|
|
13
|
-
|
|
13
|
+
const objType = obj && typeof obj;
|
|
14
14
|
return ((objType === 'object' || objType === 'function') && obj.__composable) || undefined;
|
|
15
15
|
}
|
|
16
16
|
exports.getOptionsFromObj = getOptionsFromObj;
|
|
@@ -18,23 +18,23 @@ function _getSettingsFromTheme(theme, name) {
|
|
|
18
18
|
return (0, theming_ramp_1.getSettings)(theme, name);
|
|
19
19
|
}
|
|
20
20
|
function _getHasToken(slots) {
|
|
21
|
-
|
|
22
|
-
Object.keys(slots).forEach(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const slotTokens = {};
|
|
22
|
+
Object.keys(slots).forEach((slotName) => {
|
|
23
|
+
const slot = slots[slotName];
|
|
24
|
+
const slotType = (typeof slot !== 'object' ? slot : slot.slotType);
|
|
25
|
+
const options = getOptionsFromObj(slotType);
|
|
26
26
|
slotTokens[slotName] = (options && options.resolvedTokens && options.resolvedTokens.tokenKeys) || undefined;
|
|
27
27
|
});
|
|
28
|
-
return
|
|
28
|
+
return (target, key) => {
|
|
29
29
|
return slotTokens[target] && slotTokens[target].hasOwnProperty(key);
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
function useStylingCore(props, options, instanceMemoCache, lookupOverride) {
|
|
33
33
|
// get the theme value from the context (or the default theme if it is not set)
|
|
34
|
-
|
|
34
|
+
const theme = (0, theme_types_1.useTheme)() || default_theme_1.defaultFluentTheme;
|
|
35
35
|
// resolve the array of settings for these options
|
|
36
36
|
lookupOverride = lookupOverride || props;
|
|
37
|
-
|
|
37
|
+
const { settings, getMemoValue } = (0, themed_settings_1.getThemedSettings)(options.settings, theme, instanceMemoCache, lookupOverride, _getSettingsFromTheme);
|
|
38
38
|
// finish by processing the tokens and turning IComponentSettings into ISlotProps (this removes things like _overrides)
|
|
39
39
|
return (0, theming_ramp_1.returnAsSlotProps)((0, foundation_tokens_1.processTokens)(props, theme, settings, options.resolvedTokens, getMemoValue));
|
|
40
40
|
}
|
|
@@ -47,12 +47,12 @@ function useStylingCore(props, options, instanceMemoCache, lookupOverride) {
|
|
|
47
47
|
*/
|
|
48
48
|
function initializeStyling(options) {
|
|
49
49
|
// process the tokens and get them ready to render
|
|
50
|
-
|
|
50
|
+
const { styles, slots } = options;
|
|
51
51
|
options.resolvedTokens = (0, foundation_tokens_1.buildComponentTokens)(styles, _getHasToken(slots));
|
|
52
52
|
// memo cache root for this component, keyed on options
|
|
53
|
-
|
|
53
|
+
const getMemoValue = (0, memo_cache_1.getMemoCache)(options);
|
|
54
54
|
// create a useStyling implementation for this component type (per type, not per instance)
|
|
55
|
-
return
|
|
55
|
+
return (props, lookupOverride) => {
|
|
56
56
|
return useStylingCore(props, options, getMemoValue, lookupOverride);
|
|
57
57
|
};
|
|
58
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStyling.js","sourceRoot":"","sources":["../src/useStyling.ts"],"names":[],"mappings":";AAAA,oBAAoB;;;AAGpB,
|
|
1
|
+
{"version":3,"file":"useStyling.js","sourceRoot":"","sources":["../src/useStyling.ts"],"names":[],"mappings":";AAAA,oBAAoB;;;AAGpB,qEAAoE;AACpE,+DAAsF;AACtF,yEAA2H;AAC3H,oEAA8D;AAC9D,wEAA0E;AAG1E,kEAA+E;AAE/E,qCAAqC;AACrC,SAAgB,iBAAiB,CAAa,GAAQ;IACpD,MAAM,OAAO,GAAG,GAAG,IAAI,OAAO,GAAG,CAAC;IAClC,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,UAAU,CAAC,IAAK,GAA2C,CAAC,YAAY,CAA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,cAAc,EACd,qBAA4B,CAC7B,CAAC;IAEF,uHAAuH;IACvH,OAAO,IAAA,gCAAiB,EACtB,IAAA,iCAAa,EACX,KAA2B,EAC3B,KAAK,EACL,QAAe,EACf,OAAO,CAAC,cAAc,EACtB,YAAiC,CAClC,CACkC,CAAC;AACxC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,iBAAiB,CAM/B,OAAuE;IACvE,kDAAkD;IAClD,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAClC,OAAO,CAAC,cAAc,GAAG,IAAA,wCAAoB,EAA8B,MAAM,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAExG,uDAAuD;IACvD,MAAM,YAAY,GAAG,IAAA,yBAAY,EAAa,OAAO,CAAC,CAAC;IAEvD,0FAA0F;IAC1F,OAAO,CAAC,KAAa,EAAE,cAAgC,EAAE,EAAE;QACzD,OAAO,cAAc,CAA8B,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;IACnG,CAAC,CAAC;AACJ,CAAC;AAlBD,8CAkBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uifabricshared/foundation-compose",
|
|
3
|
-
"version": "1.15.
|
|
3
|
+
"version": "1.15.5",
|
|
4
4
|
"description": "Compose infrastructure",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,6 +10,13 @@
|
|
|
10
10
|
"main": "lib-commonjs/index.js",
|
|
11
11
|
"module": "lib/index.js",
|
|
12
12
|
"typings": "lib/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./lib/index.js",
|
|
16
|
+
"require": "./lib-commonjs/index.js",
|
|
17
|
+
"types": "./lib/index.d.ts"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
13
20
|
"scripts": {
|
|
14
21
|
"build": "fluentui-scripts build",
|
|
15
22
|
"just": "fluentui-scripts",
|
|
@@ -27,19 +34,20 @@
|
|
|
27
34
|
"author": "",
|
|
28
35
|
"license": "MIT",
|
|
29
36
|
"dependencies": {
|
|
30
|
-
"@fluentui-react-native/default-theme": "0.26.
|
|
31
|
-
"@fluentui-react-native/immutable-merge": "1.2.
|
|
32
|
-
"@fluentui-react-native/memo-cache": "1.3.
|
|
33
|
-
"@fluentui-react-native/theme-types": "0.39.
|
|
34
|
-
"@uifabricshared/foundation-composable": "0.13.
|
|
35
|
-
"@uifabricshared/foundation-settings": "0.15.
|
|
36
|
-
"@uifabricshared/foundation-tokens": "0.15.
|
|
37
|
-
"@uifabricshared/themed-settings": "0.12.
|
|
38
|
-
"@uifabricshared/theming-ramp": "0.20.
|
|
37
|
+
"@fluentui-react-native/default-theme": "0.26.5",
|
|
38
|
+
"@fluentui-react-native/immutable-merge": "1.2.4",
|
|
39
|
+
"@fluentui-react-native/memo-cache": "1.3.5",
|
|
40
|
+
"@fluentui-react-native/theme-types": "0.39.4",
|
|
41
|
+
"@uifabricshared/foundation-composable": "0.13.4",
|
|
42
|
+
"@uifabricshared/foundation-settings": "0.15.4",
|
|
43
|
+
"@uifabricshared/foundation-tokens": "0.15.5",
|
|
44
|
+
"@uifabricshared/themed-settings": "0.12.4",
|
|
45
|
+
"@uifabricshared/theming-ramp": "0.20.5"
|
|
39
46
|
},
|
|
40
47
|
"devDependencies": {
|
|
41
48
|
"@fluentui-react-native/eslint-config-rules": "0.1.1",
|
|
42
49
|
"@fluentui-react-native/scripts": "0.1.1",
|
|
50
|
+
"@office-iss/react-native-win32": "^0.74.0",
|
|
43
51
|
"@react-native/metro-config": "^0.74.0",
|
|
44
52
|
"@types/react": "~18.2.0",
|
|
45
53
|
"react": "18.2.0",
|
|
@@ -48,7 +56,7 @@
|
|
|
48
56
|
"react-native-windows": "^0.74.0"
|
|
49
57
|
},
|
|
50
58
|
"peerDependencies": {
|
|
51
|
-
"@office-iss/react-native-win32": "^0.74.0",
|
|
59
|
+
"@office-iss/react-native-win32": "^0.73.0 || ^0.74.0",
|
|
52
60
|
"react": "18.2.0",
|
|
53
61
|
"react-native": "^0.73.0 || ^0.74.0",
|
|
54
62
|
"react-native-macos": "^0.73.0 || ^0.74.0",
|
|
@@ -76,6 +84,7 @@
|
|
|
76
84
|
"kitType": "library",
|
|
77
85
|
"alignDeps": {
|
|
78
86
|
"presets": [
|
|
87
|
+
"@fluentui-react-native/scripts/align-deps-preset.js",
|
|
79
88
|
"microsoft/react-native"
|
|
80
89
|
],
|
|
81
90
|
"requirements": {
|