@fluentui/react-utilities 9.5.2 → 9.5.3
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 +16 -1
- package/CHANGELOG.md +11 -2
- package/lib/compose/resolveShorthand.js +3 -1
- package/lib/compose/resolveShorthand.js.map +1 -1
- package/lib-amd/compose/resolveShorthand.js +1 -1
- package/lib-amd/compose/resolveShorthand.js.map +1 -1
- package/lib-commonjs/compose/resolveShorthand.js +3 -1
- package/lib-commonjs/compose/resolveShorthand.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,22 @@
|
|
2
2
|
"name": "@fluentui/react-utilities",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Mon, 13 Feb 2023 23:40:49 GMT",
|
6
|
+
"tag": "@fluentui/react-utilities_v9.5.3",
|
7
|
+
"version": "9.5.3",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"author": "yuanboxue@microsoft.com",
|
12
|
+
"package": "@fluentui/react-utilities",
|
13
|
+
"commit": "3d12f79c3d790ac28b00f54dd8fc6d23970cf6ed",
|
14
|
+
"comment": "fix: `resolveShorthand` should resolve an object as its copy"
|
15
|
+
}
|
16
|
+
]
|
17
|
+
}
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"date": "Fri, 10 Feb 2023 08:50:01 GMT",
|
6
21
|
"tag": "@fluentui/react-utilities_v9.5.2",
|
7
22
|
"version": "9.5.2",
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,21 @@
|
|
1
1
|
# Change Log - @fluentui/react-utilities
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Mon, 13 Feb 2023 23:40:49 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.5.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.5.3)
|
8
|
+
|
9
|
+
Mon, 13 Feb 2023 23:40:49 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.5.2..@fluentui/react-utilities_v9.5.3)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- fix: `resolveShorthand` should resolve an object as its copy ([PR #26825](https://github.com/microsoft/fluentui/pull/26825) by yuanboxue@microsoft.com)
|
15
|
+
|
7
16
|
## [9.5.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.5.2)
|
8
17
|
|
9
|
-
Fri, 10 Feb 2023 08:
|
18
|
+
Fri, 10 Feb 2023 08:50:01 GMT
|
10
19
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.5.1..@fluentui/react-utilities_v9.5.2)
|
11
20
|
|
12
21
|
### Patches
|
@@ -17,7 +17,9 @@ export const resolveShorthand = (value, options) => {
|
|
17
17
|
if (typeof value === 'string' || typeof value === 'number' || Array.isArray(value) || /*#__PURE__*/isValidElement(value)) {
|
18
18
|
resolvedShorthand.children = value;
|
19
19
|
} else if (typeof value === 'object') {
|
20
|
-
resolvedShorthand =
|
20
|
+
resolvedShorthand = {
|
21
|
+
...value
|
22
|
+
};
|
21
23
|
}
|
22
24
|
return defaultProps ? {
|
23
25
|
...defaultProps,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"mappings":"AAAA,SAASA,cAAc,QAAQ,OAAO;AAkBtC;;;;;;AAMA,OAAO,MAAMC,gBAAgB,GAA6B,CAACC,KAAK,EAAEC,OAAO,KAAI;EAC3E,MAAM;IAAEC,QAAQ,GAAG,KAAK;IAAEC;EAAY,CAAE,GAAGF,OAAO,IAAI,EAAE;EACxD,IAAID,KAAK,KAAK,IAAI,IAAKA,KAAK,KAAKI,SAAS,IAAI,CAACF,QAAS,EAAE;IACxD,OAAOE,SAAS;;EAGlB,IAAIC,iBAAiB,GAAG,EAAsB;EAE9C,IAAI,OAAOL,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIM,KAAK,CAACC,OAAO,CAACP,KAAK,CAAC,iBAAIF,cAAc,CAACE,KAAK,CAAC,EAAE;IAC3GK,iBAAiB,CAACG,QAAQ,GAAGR,KAAK;GACnC,MAAM,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACpCK,iBAAiB,GAAGL,
|
1
|
+
{"version":3,"mappings":"AAAA,SAASA,cAAc,QAAQ,OAAO;AAkBtC;;;;;;AAMA,OAAO,MAAMC,gBAAgB,GAA6B,CAACC,KAAK,EAAEC,OAAO,KAAI;EAC3E,MAAM;IAAEC,QAAQ,GAAG,KAAK;IAAEC;EAAY,CAAE,GAAGF,OAAO,IAAI,EAAE;EACxD,IAAID,KAAK,KAAK,IAAI,IAAKA,KAAK,KAAKI,SAAS,IAAI,CAACF,QAAS,EAAE;IACxD,OAAOE,SAAS;;EAGlB,IAAIC,iBAAiB,GAAG,EAAsB;EAE9C,IAAI,OAAOL,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIM,KAAK,CAACC,OAAO,CAACP,KAAK,CAAC,iBAAIF,cAAc,CAACE,KAAK,CAAC,EAAE;IAC3GK,iBAAiB,CAACG,QAAQ,GAAGR,KAAK;GACnC,MAAM,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACpCK,iBAAiB,GAAG;MAAE,GAAGL;IAAK,CAAE;;EAGlC,OAAOG,YAAY,GAAG;IAAE,GAAGA,YAAY;IAAE,GAAGE;EAAiB,CAAE,GAAGA,iBAAiB;AACrF,CAAC","names":["isValidElement","resolveShorthand","value","options","required","defaultProps","undefined","resolvedShorthand","Array","isArray","children"],"sourceRoot":"../src/","sources":["packages/react-components/react-utilities/src/compose/resolveShorthand.ts"],"sourcesContent":["import { isValidElement } from 'react';\nimport type { ReplaceNullWithUndefined, SlotShorthandValue, UnknownSlotProps } from './types';\n\nexport type ResolveShorthandOptions<Props, Required extends boolean = false> = {\n required?: Required;\n defaultProps?: Props;\n};\n\nexport type ResolveShorthandFunction<Props extends UnknownSlotProps = UnknownSlotProps> = {\n <P extends Props | null>(\n value: P | SlotShorthandValue | undefined,\n options?: ResolveShorthandOptions<P, true>,\n ): ReplaceNullWithUndefined<P>;\n <P extends Props | null>(value: P | SlotShorthandValue | undefined, options?: ResolveShorthandOptions<P, boolean>):\n | ReplaceNullWithUndefined<P>\n | undefined;\n};\n\n/**\n * Resolves shorthands into slot props, to ensure normalization of the signature\n * being passed down to getSlots method\n * @param value - the base shorthand props\n * @param options - options to resolve shorthand props\n */\nexport const resolveShorthand: ResolveShorthandFunction = (value, options) => {\n const { required = false, defaultProps } = options || {};\n if (value === null || (value === undefined && !required)) {\n return undefined;\n }\n\n let resolvedShorthand = {} as UnknownSlotProps;\n\n if (typeof value === 'string' || typeof value === 'number' || Array.isArray(value) || isValidElement(value)) {\n resolvedShorthand.children = value;\n } else if (typeof value === 'object') {\n resolvedShorthand = { ...value };\n }\n\n return defaultProps ? { ...defaultProps, ...resolvedShorthand } : resolvedShorthand;\n};\n"]}
|
@@ -18,7 +18,7 @@ define(["require", "exports", "tslib", "react"], function (require, exports, tsl
|
|
18
18
|
resolvedShorthand.children = value;
|
19
19
|
}
|
20
20
|
else if (typeof value === 'object') {
|
21
|
-
resolvedShorthand = value;
|
21
|
+
resolvedShorthand = tslib_1.__assign({}, value);
|
22
22
|
}
|
23
23
|
return defaultProps ? tslib_1.__assign(tslib_1.__assign({}, defaultProps), resolvedShorthand) : resolvedShorthand;
|
24
24
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"resolveShorthand.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/compose/resolveShorthand.ts"],"names":[],"mappings":";;;;IAkBA;;;;;OAKG;IACI,IAAM,gBAAgB,GAA6B,UAAC,KAAK,EAAE,OAAO;QACjE,IAAA,KAAqC,OAAO,IAAI,EAAE,EAAhD,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAAE,YAAY,kBAAkB,CAAC;QACzD,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,EAAE;YACxD,OAAO,SAAS,CAAC;SAClB;QAED,IAAI,iBAAiB,GAAG,EAAsB,CAAC;QAE/C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,sBAAc,CAAC,KAAK,CAAC,EAAE;YAC3G,iBAAiB,CAAC,QAAQ,GAAG,KAAK,CAAC;SACpC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACpC,iBAAiB,
|
1
|
+
{"version":3,"file":"resolveShorthand.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/compose/resolveShorthand.ts"],"names":[],"mappings":";;;;IAkBA;;;;;OAKG;IACI,IAAM,gBAAgB,GAA6B,UAAC,KAAK,EAAE,OAAO;QACjE,IAAA,KAAqC,OAAO,IAAI,EAAE,EAAhD,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAAE,YAAY,kBAAkB,CAAC;QACzD,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,EAAE;YACxD,OAAO,SAAS,CAAC;SAClB;QAED,IAAI,iBAAiB,GAAG,EAAsB,CAAC;QAE/C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,sBAAc,CAAC,KAAK,CAAC,EAAE;YAC3G,iBAAiB,CAAC,QAAQ,GAAG,KAAK,CAAC;SACpC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACpC,iBAAiB,wBAAQ,KAAK,CAAE,CAAC;SAClC;QAED,OAAO,YAAY,CAAC,CAAC,uCAAM,YAAY,GAAK,iBAAiB,EAAG,CAAC,CAAC,iBAAiB,CAAC;IACtF,CAAC,CAAC;IAfW,QAAA,gBAAgB,oBAe3B","sourcesContent":["import { isValidElement } from 'react';\nimport type { ReplaceNullWithUndefined, SlotShorthandValue, UnknownSlotProps } from './types';\n\nexport type ResolveShorthandOptions<Props, Required extends boolean = false> = {\n required?: Required;\n defaultProps?: Props;\n};\n\nexport type ResolveShorthandFunction<Props extends UnknownSlotProps = UnknownSlotProps> = {\n <P extends Props | null>(\n value: P | SlotShorthandValue | undefined,\n options?: ResolveShorthandOptions<P, true>,\n ): ReplaceNullWithUndefined<P>;\n <P extends Props | null>(value: P | SlotShorthandValue | undefined, options?: ResolveShorthandOptions<P, boolean>):\n | ReplaceNullWithUndefined<P>\n | undefined;\n};\n\n/**\n * Resolves shorthands into slot props, to ensure normalization of the signature\n * being passed down to getSlots method\n * @param value - the base shorthand props\n * @param options - options to resolve shorthand props\n */\nexport const resolveShorthand: ResolveShorthandFunction = (value, options) => {\n const { required = false, defaultProps } = options || {};\n if (value === null || (value === undefined && !required)) {\n return undefined;\n }\n\n let resolvedShorthand = {} as UnknownSlotProps;\n\n if (typeof value === 'string' || typeof value === 'number' || Array.isArray(value) || isValidElement(value)) {\n resolvedShorthand.children = value;\n } else if (typeof value === 'object') {\n resolvedShorthand = { ...value };\n }\n\n return defaultProps ? { ...defaultProps, ...resolvedShorthand } : resolvedShorthand;\n};\n"]}
|
@@ -23,7 +23,9 @@ const resolveShorthand = (value, options) => {
|
|
23
23
|
if (typeof value === 'string' || typeof value === 'number' || Array.isArray(value) || react_1.isValidElement(value)) {
|
24
24
|
resolvedShorthand.children = value;
|
25
25
|
} else if (typeof value === 'object') {
|
26
|
-
resolvedShorthand =
|
26
|
+
resolvedShorthand = {
|
27
|
+
...value
|
28
|
+
};
|
27
29
|
}
|
28
30
|
return defaultProps ? {
|
29
31
|
...defaultProps,
|
@@ -1 +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,CAAE;;EAGlC,OAAOG,YAAY,GAAG;IAAE,GAAGA,YAAY;IAAE,GAAGE;EAAiB,CAAE,GAAGA,iBAAiB;AACrF,CAAC;AAfYK,wBAAgB","names":["resolveShorthand","value","options","required","defaultProps","undefined","resolvedShorthand","Array","isArray","react_1","children","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-utilities/src/compose/resolveShorthand.ts"],"sourcesContent":["import { isValidElement } from 'react';\nimport type { ReplaceNullWithUndefined, SlotShorthandValue, UnknownSlotProps } from './types';\n\nexport type ResolveShorthandOptions<Props, Required extends boolean = false> = {\n required?: Required;\n defaultProps?: Props;\n};\n\nexport type ResolveShorthandFunction<Props extends UnknownSlotProps = UnknownSlotProps> = {\n <P extends Props | null>(\n value: P | SlotShorthandValue | undefined,\n options?: ResolveShorthandOptions<P, true>,\n ): ReplaceNullWithUndefined<P>;\n <P extends Props | null>(value: P | SlotShorthandValue | undefined, options?: ResolveShorthandOptions<P, boolean>):\n | ReplaceNullWithUndefined<P>\n | undefined;\n};\n\n/**\n * Resolves shorthands into slot props, to ensure normalization of the signature\n * being passed down to getSlots method\n * @param value - the base shorthand props\n * @param options - options to resolve shorthand props\n */\nexport const resolveShorthand: ResolveShorthandFunction = (value, options) => {\n const { required = false, defaultProps } = options || {};\n if (value === null || (value === undefined && !required)) {\n return undefined;\n }\n\n let resolvedShorthand = {} as UnknownSlotProps;\n\n if (typeof value === 'string' || typeof value === 'number' || Array.isArray(value) || isValidElement(value)) {\n resolvedShorthand.children = value;\n } else if (typeof value === 'object') {\n resolvedShorthand = { ...value };\n }\n\n return defaultProps ? { ...defaultProps, ...resolvedShorthand } : resolvedShorthand;\n};\n"]}
|