@fluentui/react-utilities 9.6.1 → 9.6.2

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 CHANGED
@@ -2,7 +2,22 @@
2
2
  "name": "@fluentui/react-utilities",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 08 Mar 2023 17:39:17 GMT",
5
+ "date": "Fri, 10 Mar 2023 07:11:10 GMT",
6
+ "tag": "@fluentui/react-utilities_v9.6.2",
7
+ "version": "9.6.2",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "bernardo.sunderhus@gmail.com",
12
+ "package": "@fluentui/react-utilities",
13
+ "commit": "e42e534acb58ef98a4a0ea1c7d8c0cf7a49d70ac",
14
+ "comment": "fix: ResolveShorthandOptions type to better reflect implementation"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Wed, 08 Mar 2023 17:42:49 GMT",
6
21
  "tag": "@fluentui/react-utilities_v9.6.1",
7
22
  "version": "9.6.1",
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 Wed, 08 Mar 2023 17:39:17 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 10 Mar 2023 07:11:10 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.6.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.6.2)
8
+
9
+ Fri, 10 Mar 2023 07:11:10 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.6.1..@fluentui/react-utilities_v9.6.2)
11
+
12
+ ### Patches
13
+
14
+ - fix: ResolveShorthandOptions type to better reflect implementation ([PR #27112](https://github.com/microsoft/fluentui/pull/27112) by bernardo.sunderhus@gmail.com)
15
+
7
16
  ## [9.6.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.6.1)
8
17
 
9
- Wed, 08 Mar 2023 17:39:17 GMT
18
+ Wed, 08 Mar 2023 17:42:49 GMT
10
19
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.6.0..@fluentui/react-utilities_v9.6.1)
11
20
 
12
21
  ### Patches
package/dist/index.d.ts CHANGED
@@ -377,11 +377,14 @@ export declare function resetIdsForTests(): void;
377
377
  export declare const resolveShorthand: ResolveShorthandFunction;
378
378
 
379
379
  export declare type ResolveShorthandFunction<Props extends UnknownSlotProps = UnknownSlotProps> = {
380
- <P extends Props | null>(value: P | SlotShorthandValue | undefined, options?: ResolveShorthandOptions<P, true>): ReplaceNullWithUndefined<P>;
381
- <P extends Props | null>(value: P | SlotShorthandValue | undefined, options?: ResolveShorthandOptions<P, boolean>): ReplaceNullWithUndefined<P> | undefined;
380
+ <P extends Props>(value: P | SlotShorthandValue | undefined, options: ResolveShorthandOptions<P, true>): P;
381
+ <P extends Props>(value: P | SlotShorthandValue | null | undefined, options?: ResolveShorthandOptions<P, boolean>): P | undefined;
382
382
  };
383
383
 
384
- export declare type ResolveShorthandOptions<Props, Required extends boolean = false> = {
384
+ export declare type ResolveShorthandOptions<Props, Required extends boolean = false> = Required extends true ? {
385
+ required: true;
386
+ defaultProps?: Props;
387
+ } : {
385
388
  required?: Required;
386
389
  defaultProps?: Props;
387
390
  };
@@ -1 +1 @@
1
- {"version":3,"names":["isValidElement","resolveShorthand","value","options","required","defaultProps","undefined","resolvedShorthand","Array","isArray","children"],"sources":["../src/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"],"mappings":"AAAA,SAASA,cAAc,QAAQ,OAAO;AAkBtC;;;;;;AAMA,OAAO,MAAMC,gBAAgB,GAA6BA,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"}
1
+ {"version":3,"names":["isValidElement","resolveShorthand","value","options","required","defaultProps","undefined","resolvedShorthand","Array","isArray","children"],"sources":["../src/packages/react-components/react-utilities/src/compose/resolveShorthand.ts"],"sourcesContent":["import { isValidElement } from 'react';\nimport type { SlotShorthandValue, UnknownSlotProps } from './types';\n\nexport type ResolveShorthandOptions<Props, Required extends boolean = false> = Required extends true\n ? { required: true; defaultProps?: Props }\n : { required?: Required; defaultProps?: Props };\n\nexport type ResolveShorthandFunction<Props extends UnknownSlotProps = UnknownSlotProps> = {\n <P extends Props>(value: P | SlotShorthandValue | undefined, options: ResolveShorthandOptions<P, true>): P;\n <P extends Props>(value: P | SlotShorthandValue | null | undefined, options?: ResolveShorthandOptions<P, boolean>):\n | 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"],"mappings":"AAAA,SAASA,cAAc,QAAQ,OAAO;AActC;;;;;;AAMA,OAAO,MAAMC,gBAAgB,GAA6BA,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"}
@@ -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,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"]}
1
+ {"version":3,"file":"resolveShorthand.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/compose/resolveShorthand.ts"],"names":[],"mappings":";;;;IAcA;;;;;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 { SlotShorthandValue, UnknownSlotProps } from './types';\n\nexport type ResolveShorthandOptions<Props, Required extends boolean = false> = Required extends true\n ? { required: true; defaultProps?: Props }\n : { required?: Required; defaultProps?: Props };\n\nexport type ResolveShorthandFunction<Props extends UnknownSlotProps = UnknownSlotProps> = {\n <P extends Props>(value: P | SlotShorthandValue | undefined, options: ResolveShorthandOptions<P, true>): P;\n <P extends Props>(value: P | SlotShorthandValue | null | undefined, options?: ResolveShorthandOptions<P, boolean>):\n | 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"]}
@@ -1 +1 @@
1
- {"version":3,"names":["react_1","require","resolveShorthand","value","options","required","defaultProps","undefined","resolvedShorthand","Array","isArray","isValidElement","children","exports"],"sources":["../src/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"],"mappings":";;;;;;AAAA,MAAAA,OAAA,gBAAAC,OAAA;AAkBA;;;;;;AAMO,MAAMC,gBAAgB,GAA6BA,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,IAAIH,OAAA,CAAAW,cAAc,CAACR,KAAK,CAAC,EAAE;IAC3GK,iBAAiB,CAACI,QAAQ,GAAGT,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;AAfYK,OAAA,CAAAX,gBAAgB,GAAAA,gBAAA"}
1
+ {"version":3,"names":["react_1","require","resolveShorthand","value","options","required","defaultProps","undefined","resolvedShorthand","Array","isArray","isValidElement","children","exports"],"sources":["../src/packages/react-components/react-utilities/src/compose/resolveShorthand.ts"],"sourcesContent":["import { isValidElement } from 'react';\nimport type { SlotShorthandValue, UnknownSlotProps } from './types';\n\nexport type ResolveShorthandOptions<Props, Required extends boolean = false> = Required extends true\n ? { required: true; defaultProps?: Props }\n : { required?: Required; defaultProps?: Props };\n\nexport type ResolveShorthandFunction<Props extends UnknownSlotProps = UnknownSlotProps> = {\n <P extends Props>(value: P | SlotShorthandValue | undefined, options: ResolveShorthandOptions<P, true>): P;\n <P extends Props>(value: P | SlotShorthandValue | null | undefined, options?: ResolveShorthandOptions<P, boolean>):\n | 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"],"mappings":";;;;;;AAAA,MAAAA,OAAA,gBAAAC,OAAA;AAcA;;;;;;AAMO,MAAMC,gBAAgB,GAA6BA,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,IAAIH,OAAA,CAAAW,cAAc,CAACR,KAAK,CAAC,EAAE;IAC3GK,iBAAiB,CAACI,QAAQ,GAAGT,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;AAfYK,OAAA,CAAAX,gBAAgB,GAAAA,gBAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-utilities",
3
- "version": "9.6.1",
3
+ "version": "9.6.2",
4
4
  "description": "A set of general React-specific utilities.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",