@fluentui/react-utilities 9.3.1 → 9.4.0

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, 04 Jan 2023 01:36:04 GMT",
5
+ "date": "Mon, 09 Jan 2023 14:31:49 GMT",
6
+ "tag": "@fluentui/react-utilities_v9.4.0",
7
+ "version": "9.4.0",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "author": "lingfangao@hotmail.com",
12
+ "package": "@fluentui/react-utilities",
13
+ "commit": "3c3291c008824d45e18580d51b6eb1526ea3792d",
14
+ "comment": "feat: implement `useScrollbarWidth` utility hook"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Wed, 04 Jan 2023 01:40:43 GMT",
6
21
  "tag": "@fluentui/react-utilities_v9.3.1",
7
22
  "version": "9.3.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, 04 Jan 2023 01:36:04 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 09 Jan 2023 14:31:49 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.4.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.4.0)
8
+
9
+ Mon, 09 Jan 2023 14:31:49 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.3.1..@fluentui/react-utilities_v9.4.0)
11
+
12
+ ### Minor changes
13
+
14
+ - feat: implement `useScrollbarWidth` utility hook ([PR #26144](https://github.com/microsoft/fluentui/pull/26144) by lingfangao@hotmail.com)
15
+
7
16
  ## [9.3.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.3.1)
8
17
 
9
- Wed, 04 Jan 2023 01:36:04 GMT
18
+ Wed, 04 Jan 2023 01:40:43 GMT
10
19
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.3.0..@fluentui/react-utilities_v9.3.1)
11
20
 
12
21
  ### Patches
package/dist/index.d.ts CHANGED
@@ -575,6 +575,22 @@ export declare const useOnScrollOutside: (options: UseOnClickOrScrollOutsideOpti
575
575
  */
576
576
  export declare const usePrevious: <ValueType = unknown>(value: ValueType) => ValueType | null;
577
577
 
578
+ /**
579
+ * @returns The width in pixels of the scrollbar in the user agent
580
+ */
581
+ export declare function useScrollbarWidth(options: UseScrollbarWidthOptions): number | undefined;
582
+
583
+ declare interface UseScrollbarWidthOptions {
584
+ /**
585
+ * Reference document to measure the scrollbar width
586
+ */
587
+ targetDocument: Document | null | undefined;
588
+ /**
589
+ * Does not use the cache and recalculates the scrollbar width
590
+ */
591
+ force?: boolean;
592
+ }
593
+
578
594
  /**
579
595
  * @internal
580
596
  * Helper to manage a browser timeout.
@@ -8,5 +8,6 @@ export * from './useMergedRefs';
8
8
  export * from './useOnClickOutside';
9
9
  export * from './useOnScrollOutside';
10
10
  export * from './usePrevious';
11
+ export * from './useScrollbarWidth';
11
12
  export * from './useTimeout';
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-utilities/src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC","sourcesContent":["export * from './useControllableState';\nexport * from './useEventCallback';\nexport * from './useFirstMount';\nexport * from './useForceUpdate';\nexport * from './useId';\nexport * from './useIsomorphicLayoutEffect';\nexport * from './useMergedRefs';\nexport * from './useOnClickOutside';\nexport * from './useOnScrollOutside';\nexport * from './usePrevious';\nexport * from './useTimeout';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["packages/react-components/react-utilities/src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC","sourcesContent":["export * from './useControllableState';\nexport * from './useEventCallback';\nexport * from './useFirstMount';\nexport * from './useForceUpdate';\nexport * from './useId';\nexport * from './useIsomorphicLayoutEffect';\nexport * from './useMergedRefs';\nexport * from './useOnClickOutside';\nexport * from './useOnScrollOutside';\nexport * from './usePrevious';\nexport * from './useScrollbarWidth';\nexport * from './useTimeout';\n"]}
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ const cache = /*#__PURE__*/new WeakMap();
3
+ /**
4
+ * @returns The width in pixels of the scrollbar in the user agent
5
+ */
6
+ export function useScrollbarWidth(options) {
7
+ const {
8
+ targetDocument,
9
+ force
10
+ } = options;
11
+ return React.useMemo(() => {
12
+ if (!targetDocument) {
13
+ return 0;
14
+ }
15
+ if (!force && cache.has(targetDocument)) {
16
+ return cache.get(targetDocument);
17
+ }
18
+ const outer = targetDocument.createElement('div');
19
+ outer.style.visibility = 'hidden';
20
+ outer.style.overflow = 'scroll';
21
+ const inner = targetDocument.createElement('div');
22
+ outer.appendChild(inner);
23
+ targetDocument.body.appendChild(outer);
24
+ const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
25
+ outer.remove();
26
+ cache.set(targetDocument, scrollbarWidth);
27
+ return scrollbarWidth;
28
+ }, [targetDocument, force]);
29
+ }
30
+ //# sourceMappingURL=useScrollbarWidth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,MAAMC,KAAK,gBAAG,IAAIC,OAAO,EAAoB;AAc7C;;;AAGA,OAAM,SAAUC,iBAAiB,CAACC,OAAiC;EACjE,MAAM;IAAEC,cAAc;IAAEC;EAAK,CAAE,GAAGF,OAAO;EACzC,OAAOJ,KAAK,CAACO,OAAO,CAAC,MAAK;IACxB,IAAI,CAACF,cAAc,EAAE;MACnB,OAAO,CAAC;;IAGV,IAAI,CAACC,KAAK,IAAIL,KAAK,CAACO,GAAG,CAACH,cAAc,CAAC,EAAE;MACvC,OAAOJ,KAAK,CAACQ,GAAG,CAACJ,cAAc,CAAC;;IAGlC,MAAMK,KAAK,GAAGL,cAAc,CAACM,aAAa,CAAC,KAAK,CAAC;IACjDD,KAAK,CAACE,KAAK,CAACC,UAAU,GAAG,QAAQ;IACjCH,KAAK,CAACE,KAAK,CAACE,QAAQ,GAAG,QAAQ;IAE/B,MAAMC,KAAK,GAAGV,cAAc,CAACM,aAAa,CAAC,KAAK,CAAC;IACjDD,KAAK,CAACM,WAAW,CAACD,KAAK,CAAC;IAExBV,cAAc,CAACY,IAAI,CAACD,WAAW,CAACN,KAAK,CAAC;IACtC,MAAMQ,cAAc,GAAGR,KAAK,CAACS,WAAW,GAAGJ,KAAK,CAACI,WAAW;IAC5DT,KAAK,CAACU,MAAM,EAAE;IACdnB,KAAK,CAACoB,GAAG,CAAChB,cAAc,EAAEa,cAAc,CAAC;IACzC,OAAOA,cAAc;EACvB,CAAC,EAAE,CAACb,cAAc,EAAEC,KAAK,CAAC,CAAC;AAC7B","names":["React","cache","WeakMap","useScrollbarWidth","options","targetDocument","force","useMemo","has","get","outer","createElement","style","visibility","overflow","inner","appendChild","body","scrollbarWidth","offsetWidth","remove","set"],"sourceRoot":"../src/","sources":["packages/react-components/react-utilities/src/hooks/useScrollbarWidth.ts"],"sourcesContent":["import * as React from 'react';\n\nconst cache = new WeakMap<Document, number>();\n\ninterface UseScrollbarWidthOptions {\n /**\n * Reference document to measure the scrollbar width\n */\n targetDocument: Document | null | undefined;\n\n /**\n * Does not use the cache and recalculates the scrollbar width\n */\n force?: boolean;\n}\n\n/**\n * @returns The width in pixels of the scrollbar in the user agent\n */\nexport function useScrollbarWidth(options: UseScrollbarWidthOptions) {\n const { targetDocument, force } = options;\n return React.useMemo(() => {\n if (!targetDocument) {\n return 0;\n }\n\n if (!force && cache.has(targetDocument)) {\n return cache.get(targetDocument);\n }\n\n const outer = targetDocument.createElement('div');\n outer.style.visibility = 'hidden';\n outer.style.overflow = 'scroll';\n\n const inner = targetDocument.createElement('div');\n outer.appendChild(inner);\n\n targetDocument.body.appendChild(outer);\n const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;\n outer.remove();\n cache.set(targetDocument, scrollbarWidth);\n return scrollbarWidth;\n }, [targetDocument, force]);\n}\n"]}
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { getSlots, resolveShorthand, isResolvedShorthand } from './compose/index';
2
- export { resetIdsForTests, useControllableState, useEventCallback, useFirstMount, useForceUpdate, useId, useIsomorphicLayoutEffect, useMergedRefs, useOnClickOutside, useOnScrollOutside, usePrevious, useTimeout } from './hooks/index';
2
+ export { resetIdsForTests, useControllableState, useEventCallback, useFirstMount, useForceUpdate, useId, useIsomorphicLayoutEffect, useMergedRefs, useOnClickOutside, useOnScrollOutside, usePrevious, useScrollbarWidth, useTimeout } from './hooks/index';
3
3
  export { canUseDOM, useIsSSR, SSRProvider } from './ssr/index';
4
4
  export { clamp, getNativeElementProps, getPartitionedNativeProps, getRTLSafeKey, mergeCallbacks, isHTMLElement, isInteractiveHTMLElement } from './utils/index';
5
5
  export { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from './trigger/index';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"mappings":"AAAA,SAASA,QAAQ,EAAEC,gBAAgB,EAAEC,mBAAmB,QAAQ,iBAAiB;AAgBjF,SACEC,gBAAgB,EAChBC,oBAAoB,EACpBC,gBAAgB,EAChBC,aAAa,EACbC,cAAc,EACdC,KAAK,EACLC,yBAAyB,EACzBC,aAAa,EACbC,iBAAiB,EACjBC,kBAAkB,EAClBC,WAAW,EACXC,UAAU,QACL,eAAe;AAGtB,SAASC,SAAS,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,aAAa;AAE9D,SACEC,KAAK,EACLC,qBAAqB,EACrBC,yBAAyB,EACzBC,aAAa,EACbC,cAAc,EACdC,aAAa,EACbC,wBAAwB,QACnB,eAAe;AAEtB,SAASC,2BAA2B,EAAEC,eAAe,EAAEC,eAAe,QAAQ,iBAAiB","names":["getSlots","resolveShorthand","isResolvedShorthand","resetIdsForTests","useControllableState","useEventCallback","useFirstMount","useForceUpdate","useId","useIsomorphicLayoutEffect","useMergedRefs","useOnClickOutside","useOnScrollOutside","usePrevious","useTimeout","canUseDOM","useIsSSR","SSRProvider","clamp","getNativeElementProps","getPartitionedNativeProps","getRTLSafeKey","mergeCallbacks","isHTMLElement","isInteractiveHTMLElement","applyTriggerPropsToChildren","getTriggerChild","isFluentTrigger"],"sourceRoot":"../src/","sources":["packages/react-components/react-utilities/src/index.ts"],"sourcesContent":["export { getSlots, resolveShorthand, isResolvedShorthand } from './compose/index';\nexport type {\n ExtractSlotProps,\n ComponentProps,\n ComponentState,\n ForwardRefComponent,\n ResolveShorthandFunction,\n ResolveShorthandOptions,\n Slot,\n Slots,\n SlotClassNames,\n SlotPropsRecord,\n SlotRenderFunction,\n SlotShorthandValue,\n} from './compose/index';\n\nexport {\n resetIdsForTests,\n useControllableState,\n useEventCallback,\n useFirstMount,\n useForceUpdate,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n usePrevious,\n useTimeout,\n} from './hooks/index';\nexport type { RefObjectFunction, UseControllableStateOptions, UseOnClickOrScrollOutsideOptions } from './hooks/index';\n\nexport { canUseDOM, useIsSSR, SSRProvider } from './ssr/index';\n\nexport {\n clamp,\n getNativeElementProps,\n getPartitionedNativeProps,\n getRTLSafeKey,\n mergeCallbacks,\n isHTMLElement,\n isInteractiveHTMLElement,\n} from './utils/index';\n\nexport { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from './trigger/index';\n\nexport type { FluentTriggerComponent, TriggerProps } from './trigger/index';\n"]}
1
+ {"version":3,"mappings":"AAAA,SAASA,QAAQ,EAAEC,gBAAgB,EAAEC,mBAAmB,QAAQ,iBAAiB;AAgBjF,SACEC,gBAAgB,EAChBC,oBAAoB,EACpBC,gBAAgB,EAChBC,aAAa,EACbC,cAAc,EACdC,KAAK,EACLC,yBAAyB,EACzBC,aAAa,EACbC,iBAAiB,EACjBC,kBAAkB,EAClBC,WAAW,EACXC,iBAAiB,EACjBC,UAAU,QACL,eAAe;AAGtB,SAASC,SAAS,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,aAAa;AAE9D,SACEC,KAAK,EACLC,qBAAqB,EACrBC,yBAAyB,EACzBC,aAAa,EACbC,cAAc,EACdC,aAAa,EACbC,wBAAwB,QACnB,eAAe;AAEtB,SAASC,2BAA2B,EAAEC,eAAe,EAAEC,eAAe,QAAQ,iBAAiB","names":["getSlots","resolveShorthand","isResolvedShorthand","resetIdsForTests","useControllableState","useEventCallback","useFirstMount","useForceUpdate","useId","useIsomorphicLayoutEffect","useMergedRefs","useOnClickOutside","useOnScrollOutside","usePrevious","useScrollbarWidth","useTimeout","canUseDOM","useIsSSR","SSRProvider","clamp","getNativeElementProps","getPartitionedNativeProps","getRTLSafeKey","mergeCallbacks","isHTMLElement","isInteractiveHTMLElement","applyTriggerPropsToChildren","getTriggerChild","isFluentTrigger"],"sourceRoot":"../src/","sources":["packages/react-components/react-utilities/src/index.ts"],"sourcesContent":["export { getSlots, resolveShorthand, isResolvedShorthand } from './compose/index';\nexport type {\n ExtractSlotProps,\n ComponentProps,\n ComponentState,\n ForwardRefComponent,\n ResolveShorthandFunction,\n ResolveShorthandOptions,\n Slot,\n Slots,\n SlotClassNames,\n SlotPropsRecord,\n SlotRenderFunction,\n SlotShorthandValue,\n} from './compose/index';\n\nexport {\n resetIdsForTests,\n useControllableState,\n useEventCallback,\n useFirstMount,\n useForceUpdate,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n usePrevious,\n useScrollbarWidth,\n useTimeout,\n} from './hooks/index';\nexport type { RefObjectFunction, UseControllableStateOptions, UseOnClickOrScrollOutsideOptions } from './hooks/index';\n\nexport { canUseDOM, useIsSSR, SSRProvider } from './ssr/index';\n\nexport {\n clamp,\n getNativeElementProps,\n getPartitionedNativeProps,\n getRTLSafeKey,\n mergeCallbacks,\n isHTMLElement,\n isInteractiveHTMLElement,\n} from './utils/index';\n\nexport { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from './trigger/index';\n\nexport type { FluentTriggerComponent, TriggerProps } from './trigger/index';\n"]}
@@ -1,4 +1,4 @@
1
- define(["require", "exports", "tslib", "./useControllableState", "./useEventCallback", "./useFirstMount", "./useForceUpdate", "./useId", "./useIsomorphicLayoutEffect", "./useMergedRefs", "./useOnClickOutside", "./useOnScrollOutside", "./usePrevious", "./useTimeout"], function (require, exports, tslib_1, useControllableState_1, useEventCallback_1, useFirstMount_1, useForceUpdate_1, useId_1, useIsomorphicLayoutEffect_1, useMergedRefs_1, useOnClickOutside_1, useOnScrollOutside_1, usePrevious_1, useTimeout_1) {
1
+ define(["require", "exports", "tslib", "./useControllableState", "./useEventCallback", "./useFirstMount", "./useForceUpdate", "./useId", "./useIsomorphicLayoutEffect", "./useMergedRefs", "./useOnClickOutside", "./useOnScrollOutside", "./usePrevious", "./useScrollbarWidth", "./useTimeout"], function (require, exports, tslib_1, useControllableState_1, useEventCallback_1, useFirstMount_1, useForceUpdate_1, useId_1, useIsomorphicLayoutEffect_1, useMergedRefs_1, useOnClickOutside_1, useOnScrollOutside_1, usePrevious_1, useScrollbarWidth_1, useTimeout_1) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  tslib_1.__exportStar(useControllableState_1, exports);
@@ -11,6 +11,7 @@ define(["require", "exports", "tslib", "./useControllableState", "./useEventCall
11
11
  tslib_1.__exportStar(useOnClickOutside_1, exports);
12
12
  tslib_1.__exportStar(useOnScrollOutside_1, exports);
13
13
  tslib_1.__exportStar(usePrevious_1, exports);
14
+ tslib_1.__exportStar(useScrollbarWidth_1, exports);
14
15
  tslib_1.__exportStar(useTimeout_1, exports);
15
16
  });
16
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/hooks/index.ts"],"names":[],"mappings":";;;IAAA,sDAAuC;IACvC,kDAAmC;IACnC,+CAAgC;IAChC,gDAAiC;IACjC,uCAAwB;IACxB,2DAA4C;IAC5C,+CAAgC;IAChC,mDAAoC;IACpC,oDAAqC;IACrC,6CAA8B;IAC9B,4CAA6B","sourcesContent":["export * from './useControllableState';\nexport * from './useEventCallback';\nexport * from './useFirstMount';\nexport * from './useForceUpdate';\nexport * from './useId';\nexport * from './useIsomorphicLayoutEffect';\nexport * from './useMergedRefs';\nexport * from './useOnClickOutside';\nexport * from './useOnScrollOutside';\nexport * from './usePrevious';\nexport * from './useTimeout';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/hooks/index.ts"],"names":[],"mappings":";;;IAAA,sDAAuC;IACvC,kDAAmC;IACnC,+CAAgC;IAChC,gDAAiC;IACjC,uCAAwB;IACxB,2DAA4C;IAC5C,+CAAgC;IAChC,mDAAoC;IACpC,oDAAqC;IACrC,6CAA8B;IAC9B,mDAAoC;IACpC,4CAA6B","sourcesContent":["export * from './useControllableState';\nexport * from './useEventCallback';\nexport * from './useFirstMount';\nexport * from './useForceUpdate';\nexport * from './useId';\nexport * from './useIsomorphicLayoutEffect';\nexport * from './useMergedRefs';\nexport * from './useOnClickOutside';\nexport * from './useOnScrollOutside';\nexport * from './usePrevious';\nexport * from './useScrollbarWidth';\nexport * from './useTimeout';\n"]}
@@ -0,0 +1,32 @@
1
+ define(["require", "exports", "react"], function (require, exports, React) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useScrollbarWidth = void 0;
5
+ var cache = new WeakMap();
6
+ /**
7
+ * @returns The width in pixels of the scrollbar in the user agent
8
+ */
9
+ function useScrollbarWidth(options) {
10
+ var targetDocument = options.targetDocument, force = options.force;
11
+ return React.useMemo(function () {
12
+ if (!targetDocument) {
13
+ return 0;
14
+ }
15
+ if (!force && cache.has(targetDocument)) {
16
+ return cache.get(targetDocument);
17
+ }
18
+ var outer = targetDocument.createElement('div');
19
+ outer.style.visibility = 'hidden';
20
+ outer.style.overflow = 'scroll';
21
+ var inner = targetDocument.createElement('div');
22
+ outer.appendChild(inner);
23
+ targetDocument.body.appendChild(outer);
24
+ var scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
25
+ outer.remove();
26
+ cache.set(targetDocument, scrollbarWidth);
27
+ return scrollbarWidth;
28
+ }, [targetDocument, force]);
29
+ }
30
+ exports.useScrollbarWidth = useScrollbarWidth;
31
+ });
32
+ //# sourceMappingURL=useScrollbarWidth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScrollbarWidth.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/hooks/useScrollbarWidth.ts"],"names":[],"mappings":";;;;IAEA,IAAM,KAAK,GAAG,IAAI,OAAO,EAAoB,CAAC;IAc9C;;OAEG;IACH,SAAgB,iBAAiB,CAAC,OAAiC;QACzD,IAAA,cAAc,GAAY,OAAO,eAAnB,EAAE,KAAK,GAAK,OAAO,MAAZ,CAAa;QAC1C,OAAO,KAAK,CAAC,OAAO,CAAC;YACnB,IAAI,CAAC,cAAc,EAAE;gBACnB,OAAO,CAAC,CAAC;aACV;YAED,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;gBACvC,OAAO,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;aAClC;YAED,IAAM,KAAK,GAAG,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAClD,KAAK,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;YAClC,KAAK,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAEhC,IAAM,KAAK,GAAG,cAAc,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAClD,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAEzB,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YACvC,IAAM,cAAc,GAAG,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;YAC7D,KAAK,CAAC,MAAM,EAAE,CAAC;YACf,KAAK,CAAC,GAAG,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;YAC1C,OAAO,cAAc,CAAC;QACxB,CAAC,EAAE,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC,CAAC;IAC9B,CAAC;IAxBD,8CAwBC","sourcesContent":["import * as React from 'react';\n\nconst cache = new WeakMap<Document, number>();\n\ninterface UseScrollbarWidthOptions {\n /**\n * Reference document to measure the scrollbar width\n */\n targetDocument: Document | null | undefined;\n\n /**\n * Does not use the cache and recalculates the scrollbar width\n */\n force?: boolean;\n}\n\n/**\n * @returns The width in pixels of the scrollbar in the user agent\n */\nexport function useScrollbarWidth(options: UseScrollbarWidthOptions) {\n const { targetDocument, force } = options;\n return React.useMemo(() => {\n if (!targetDocument) {\n return 0;\n }\n\n if (!force && cache.has(targetDocument)) {\n return cache.get(targetDocument);\n }\n\n const outer = targetDocument.createElement('div');\n outer.style.visibility = 'hidden';\n outer.style.overflow = 'scroll';\n\n const inner = targetDocument.createElement('div');\n outer.appendChild(inner);\n\n targetDocument.body.appendChild(outer);\n const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;\n outer.remove();\n cache.set(targetDocument, scrollbarWidth);\n return scrollbarWidth;\n }, [targetDocument, force]);\n}\n"]}
package/lib-amd/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  define(["require", "exports", "./compose/index", "./hooks/index", "./ssr/index", "./utils/index", "./trigger/index"], function (require, exports, index_1, index_2, index_3, index_4, index_5) {
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.isFluentTrigger = exports.getTriggerChild = exports.applyTriggerPropsToChildren = exports.isInteractiveHTMLElement = exports.isHTMLElement = exports.mergeCallbacks = exports.getRTLSafeKey = exports.getPartitionedNativeProps = exports.getNativeElementProps = exports.clamp = exports.SSRProvider = exports.useIsSSR = exports.canUseDOM = exports.useTimeout = exports.usePrevious = exports.useOnScrollOutside = exports.useOnClickOutside = exports.useMergedRefs = exports.useIsomorphicLayoutEffect = exports.useId = exports.useForceUpdate = exports.useFirstMount = exports.useEventCallback = exports.useControllableState = exports.resetIdsForTests = exports.isResolvedShorthand = exports.resolveShorthand = exports.getSlots = void 0;
4
+ exports.isFluentTrigger = exports.getTriggerChild = exports.applyTriggerPropsToChildren = exports.isInteractiveHTMLElement = exports.isHTMLElement = exports.mergeCallbacks = exports.getRTLSafeKey = exports.getPartitionedNativeProps = exports.getNativeElementProps = exports.clamp = exports.SSRProvider = exports.useIsSSR = exports.canUseDOM = exports.useTimeout = exports.useScrollbarWidth = exports.usePrevious = exports.useOnScrollOutside = exports.useOnClickOutside = exports.useMergedRefs = exports.useIsomorphicLayoutEffect = exports.useId = exports.useForceUpdate = exports.useFirstMount = exports.useEventCallback = exports.useControllableState = exports.resetIdsForTests = exports.isResolvedShorthand = exports.resolveShorthand = exports.getSlots = void 0;
5
5
  Object.defineProperty(exports, "getSlots", { enumerable: true, get: function () { return index_1.getSlots; } });
6
6
  Object.defineProperty(exports, "resolveShorthand", { enumerable: true, get: function () { return index_1.resolveShorthand; } });
7
7
  Object.defineProperty(exports, "isResolvedShorthand", { enumerable: true, get: function () { return index_1.isResolvedShorthand; } });
@@ -16,6 +16,7 @@ define(["require", "exports", "./compose/index", "./hooks/index", "./ssr/index",
16
16
  Object.defineProperty(exports, "useOnClickOutside", { enumerable: true, get: function () { return index_2.useOnClickOutside; } });
17
17
  Object.defineProperty(exports, "useOnScrollOutside", { enumerable: true, get: function () { return index_2.useOnScrollOutside; } });
18
18
  Object.defineProperty(exports, "usePrevious", { enumerable: true, get: function () { return index_2.usePrevious; } });
19
+ Object.defineProperty(exports, "useScrollbarWidth", { enumerable: true, get: function () { return index_2.useScrollbarWidth; } });
19
20
  Object.defineProperty(exports, "useTimeout", { enumerable: true, get: function () { return index_2.useTimeout; } });
20
21
  Object.defineProperty(exports, "canUseDOM", { enumerable: true, get: function () { return index_3.canUseDOM; } });
21
22
  Object.defineProperty(exports, "useIsSSR", { enumerable: true, get: function () { return index_3.useIsSSR; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-utilities/src/index.ts"],"names":[],"mappings":";;;;IAAS,iGAAA,QAAQ,OAAA;IAAE,yGAAA,gBAAgB,OAAA;IAAE,4GAAA,mBAAmB,OAAA;IAiBtD,yGAAA,gBAAgB,OAAA;IAChB,6GAAA,oBAAoB,OAAA;IACpB,yGAAA,gBAAgB,OAAA;IAChB,sGAAA,aAAa,OAAA;IACb,uGAAA,cAAc,OAAA;IACd,8FAAA,KAAK,OAAA;IACL,kHAAA,yBAAyB,OAAA;IACzB,sGAAA,aAAa,OAAA;IACb,0GAAA,iBAAiB,OAAA;IACjB,2GAAA,kBAAkB,OAAA;IAClB,oGAAA,WAAW,OAAA;IACX,mGAAA,UAAU,OAAA;IAIH,kGAAA,SAAS,OAAA;IAAE,iGAAA,QAAQ,OAAA;IAAE,oGAAA,WAAW,OAAA;IAGvC,8FAAA,KAAK,OAAA;IACL,8GAAA,qBAAqB,OAAA;IACrB,kHAAA,yBAAyB,OAAA;IACzB,sGAAA,aAAa,OAAA;IACb,uGAAA,cAAc,OAAA;IACd,sGAAA,aAAa,OAAA;IACb,iHAAA,wBAAwB,OAAA;IAGjB,oHAAA,2BAA2B,OAAA;IAAE,wGAAA,eAAe,OAAA;IAAE,wGAAA,eAAe,OAAA","sourcesContent":["export { getSlots, resolveShorthand, isResolvedShorthand } from './compose/index';\nexport type {\n ExtractSlotProps,\n ComponentProps,\n ComponentState,\n ForwardRefComponent,\n ResolveShorthandFunction,\n ResolveShorthandOptions,\n Slot,\n Slots,\n SlotClassNames,\n SlotPropsRecord,\n SlotRenderFunction,\n SlotShorthandValue,\n} from './compose/index';\n\nexport {\n resetIdsForTests,\n useControllableState,\n useEventCallback,\n useFirstMount,\n useForceUpdate,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n usePrevious,\n useTimeout,\n} from './hooks/index';\nexport type { RefObjectFunction, UseControllableStateOptions, UseOnClickOrScrollOutsideOptions } from './hooks/index';\n\nexport { canUseDOM, useIsSSR, SSRProvider } from './ssr/index';\n\nexport {\n clamp,\n getNativeElementProps,\n getPartitionedNativeProps,\n getRTLSafeKey,\n mergeCallbacks,\n isHTMLElement,\n isInteractiveHTMLElement,\n} from './utils/index';\n\nexport { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from './trigger/index';\n\nexport type { FluentTriggerComponent, TriggerProps } from './trigger/index';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-utilities/src/index.ts"],"names":[],"mappings":";;;;IAAS,iGAAA,QAAQ,OAAA;IAAE,yGAAA,gBAAgB,OAAA;IAAE,4GAAA,mBAAmB,OAAA;IAiBtD,yGAAA,gBAAgB,OAAA;IAChB,6GAAA,oBAAoB,OAAA;IACpB,yGAAA,gBAAgB,OAAA;IAChB,sGAAA,aAAa,OAAA;IACb,uGAAA,cAAc,OAAA;IACd,8FAAA,KAAK,OAAA;IACL,kHAAA,yBAAyB,OAAA;IACzB,sGAAA,aAAa,OAAA;IACb,0GAAA,iBAAiB,OAAA;IACjB,2GAAA,kBAAkB,OAAA;IAClB,oGAAA,WAAW,OAAA;IACX,0GAAA,iBAAiB,OAAA;IACjB,mGAAA,UAAU,OAAA;IAIH,kGAAA,SAAS,OAAA;IAAE,iGAAA,QAAQ,OAAA;IAAE,oGAAA,WAAW,OAAA;IAGvC,8FAAA,KAAK,OAAA;IACL,8GAAA,qBAAqB,OAAA;IACrB,kHAAA,yBAAyB,OAAA;IACzB,sGAAA,aAAa,OAAA;IACb,uGAAA,cAAc,OAAA;IACd,sGAAA,aAAa,OAAA;IACb,iHAAA,wBAAwB,OAAA;IAGjB,oHAAA,2BAA2B,OAAA;IAAE,wGAAA,eAAe,OAAA;IAAE,wGAAA,eAAe,OAAA","sourcesContent":["export { getSlots, resolveShorthand, isResolvedShorthand } from './compose/index';\nexport type {\n ExtractSlotProps,\n ComponentProps,\n ComponentState,\n ForwardRefComponent,\n ResolveShorthandFunction,\n ResolveShorthandOptions,\n Slot,\n Slots,\n SlotClassNames,\n SlotPropsRecord,\n SlotRenderFunction,\n SlotShorthandValue,\n} from './compose/index';\n\nexport {\n resetIdsForTests,\n useControllableState,\n useEventCallback,\n useFirstMount,\n useForceUpdate,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n usePrevious,\n useScrollbarWidth,\n useTimeout,\n} from './hooks/index';\nexport type { RefObjectFunction, UseControllableStateOptions, UseOnClickOrScrollOutsideOptions } from './hooks/index';\n\nexport { canUseDOM, useIsSSR, SSRProvider } from './ssr/index';\n\nexport {\n clamp,\n getNativeElementProps,\n getPartitionedNativeProps,\n getRTLSafeKey,\n mergeCallbacks,\n isHTMLElement,\n isInteractiveHTMLElement,\n} from './utils/index';\n\nexport { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from './trigger/index';\n\nexport type { FluentTriggerComponent, TriggerProps } from './trigger/index';\n"]}
@@ -14,5 +14,6 @@ tslib_1.__exportStar(require("./useMergedRefs"), exports);
14
14
  tslib_1.__exportStar(require("./useOnClickOutside"), exports);
15
15
  tslib_1.__exportStar(require("./useOnScrollOutside"), exports);
16
16
  tslib_1.__exportStar(require("./usePrevious"), exports);
17
+ tslib_1.__exportStar(require("./useScrollbarWidth"), exports);
17
18
  tslib_1.__exportStar(require("./useTimeout"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-utilities/src/hooks/index.ts"],"sourcesContent":["export * from './useControllableState';\nexport * from './useEventCallback';\nexport * from './useFirstMount';\nexport * from './useForceUpdate';\nexport * from './useId';\nexport * from './useIsomorphicLayoutEffect';\nexport * from './useMergedRefs';\nexport * from './useOnClickOutside';\nexport * from './useOnScrollOutside';\nexport * from './usePrevious';\nexport * from './useTimeout';\n"]}
1
+ {"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-utilities/src/hooks/index.ts"],"sourcesContent":["export * from './useControllableState';\nexport * from './useEventCallback';\nexport * from './useFirstMount';\nexport * from './useForceUpdate';\nexport * from './useId';\nexport * from './useIsomorphicLayoutEffect';\nexport * from './useMergedRefs';\nexport * from './useOnClickOutside';\nexport * from './useOnScrollOutside';\nexport * from './usePrevious';\nexport * from './useScrollbarWidth';\nexport * from './useTimeout';\n"]}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useScrollbarWidth = void 0;
7
+ const React = /*#__PURE__*/require("react");
8
+ const cache = /*#__PURE__*/new WeakMap();
9
+ /**
10
+ * @returns The width in pixels of the scrollbar in the user agent
11
+ */
12
+ function useScrollbarWidth(options) {
13
+ const {
14
+ targetDocument,
15
+ force
16
+ } = options;
17
+ return React.useMemo(() => {
18
+ if (!targetDocument) {
19
+ return 0;
20
+ }
21
+ if (!force && cache.has(targetDocument)) {
22
+ return cache.get(targetDocument);
23
+ }
24
+ const outer = targetDocument.createElement('div');
25
+ outer.style.visibility = 'hidden';
26
+ outer.style.overflow = 'scroll';
27
+ const inner = targetDocument.createElement('div');
28
+ outer.appendChild(inner);
29
+ targetDocument.body.appendChild(outer);
30
+ const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
31
+ outer.remove();
32
+ cache.set(targetDocument, scrollbarWidth);
33
+ return scrollbarWidth;
34
+ }, [targetDocument, force]);
35
+ }
36
+ exports.useScrollbarWidth = useScrollbarWidth;
37
+ //# sourceMappingURL=useScrollbarWidth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"mappings":";;;;;;AAAA;AAEA,MAAMA,KAAK,gBAAG,IAAIC,OAAO,EAAoB;AAc7C;;;AAGA,SAAgBC,iBAAiB,CAACC,OAAiC;EACjE,MAAM;IAAEC,cAAc;IAAEC;EAAK,CAAE,GAAGF,OAAO;EACzC,OAAOG,KAAK,CAACC,OAAO,CAAC,MAAK;IACxB,IAAI,CAACH,cAAc,EAAE;MACnB,OAAO,CAAC;;IAGV,IAAI,CAACC,KAAK,IAAIL,KAAK,CAACQ,GAAG,CAACJ,cAAc,CAAC,EAAE;MACvC,OAAOJ,KAAK,CAACS,GAAG,CAACL,cAAc,CAAC;;IAGlC,MAAMM,KAAK,GAAGN,cAAc,CAACO,aAAa,CAAC,KAAK,CAAC;IACjDD,KAAK,CAACE,KAAK,CAACC,UAAU,GAAG,QAAQ;IACjCH,KAAK,CAACE,KAAK,CAACE,QAAQ,GAAG,QAAQ;IAE/B,MAAMC,KAAK,GAAGX,cAAc,CAACO,aAAa,CAAC,KAAK,CAAC;IACjDD,KAAK,CAACM,WAAW,CAACD,KAAK,CAAC;IAExBX,cAAc,CAACa,IAAI,CAACD,WAAW,CAACN,KAAK,CAAC;IACtC,MAAMQ,cAAc,GAAGR,KAAK,CAACS,WAAW,GAAGJ,KAAK,CAACI,WAAW;IAC5DT,KAAK,CAACU,MAAM,EAAE;IACdpB,KAAK,CAACqB,GAAG,CAACjB,cAAc,EAAEc,cAAc,CAAC;IACzC,OAAOA,cAAc;EACvB,CAAC,EAAE,CAACd,cAAc,EAAEC,KAAK,CAAC,CAAC;AAC7B;AAxBAiB","names":["cache","WeakMap","useScrollbarWidth","options","targetDocument","force","React","useMemo","has","get","outer","createElement","style","visibility","overflow","inner","appendChild","body","scrollbarWidth","offsetWidth","remove","set","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-utilities/src/hooks/useScrollbarWidth.ts"],"sourcesContent":["import * as React from 'react';\n\nconst cache = new WeakMap<Document, number>();\n\ninterface UseScrollbarWidthOptions {\n /**\n * Reference document to measure the scrollbar width\n */\n targetDocument: Document | null | undefined;\n\n /**\n * Does not use the cache and recalculates the scrollbar width\n */\n force?: boolean;\n}\n\n/**\n * @returns The width in pixels of the scrollbar in the user agent\n */\nexport function useScrollbarWidth(options: UseScrollbarWidthOptions) {\n const { targetDocument, force } = options;\n return React.useMemo(() => {\n if (!targetDocument) {\n return 0;\n }\n\n if (!force && cache.has(targetDocument)) {\n return cache.get(targetDocument);\n }\n\n const outer = targetDocument.createElement('div');\n outer.style.visibility = 'hidden';\n outer.style.overflow = 'scroll';\n\n const inner = targetDocument.createElement('div');\n outer.appendChild(inner);\n\n targetDocument.body.appendChild(outer);\n const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;\n outer.remove();\n cache.set(targetDocument, scrollbarWidth);\n return scrollbarWidth;\n }, [targetDocument, force]);\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isFluentTrigger = exports.getTriggerChild = exports.applyTriggerPropsToChildren = exports.isInteractiveHTMLElement = exports.isHTMLElement = exports.mergeCallbacks = exports.getRTLSafeKey = exports.getPartitionedNativeProps = exports.getNativeElementProps = exports.clamp = exports.SSRProvider = exports.useIsSSR = exports.canUseDOM = exports.useTimeout = exports.usePrevious = exports.useOnScrollOutside = exports.useOnClickOutside = exports.useMergedRefs = exports.useIsomorphicLayoutEffect = exports.useId = exports.useForceUpdate = exports.useFirstMount = exports.useEventCallback = exports.useControllableState = exports.resetIdsForTests = exports.isResolvedShorthand = exports.resolveShorthand = exports.getSlots = void 0;
6
+ exports.isFluentTrigger = exports.getTriggerChild = exports.applyTriggerPropsToChildren = exports.isInteractiveHTMLElement = exports.isHTMLElement = exports.mergeCallbacks = exports.getRTLSafeKey = exports.getPartitionedNativeProps = exports.getNativeElementProps = exports.clamp = exports.SSRProvider = exports.useIsSSR = exports.canUseDOM = exports.useTimeout = exports.useScrollbarWidth = exports.usePrevious = exports.useOnScrollOutside = exports.useOnClickOutside = exports.useMergedRefs = exports.useIsomorphicLayoutEffect = exports.useId = exports.useForceUpdate = exports.useFirstMount = exports.useEventCallback = exports.useControllableState = exports.resetIdsForTests = exports.isResolvedShorthand = exports.resolveShorthand = exports.getSlots = void 0;
7
7
  var index_1 = /*#__PURE__*/require("./compose/index");
8
8
  Object.defineProperty(exports, "getSlots", {
9
9
  enumerable: true,
@@ -90,6 +90,12 @@ Object.defineProperty(exports, "usePrevious", {
90
90
  return index_2.usePrevious;
91
91
  }
92
92
  });
93
+ Object.defineProperty(exports, "useScrollbarWidth", {
94
+ enumerable: true,
95
+ get: function () {
96
+ return index_2.useScrollbarWidth;
97
+ }
98
+ });
93
99
  Object.defineProperty(exports, "useTimeout", {
94
100
  enumerable: true,
95
101
  get: function () {
@@ -1 +1 @@
1
- {"version":3,"mappings":";;;;;;AAAA;AAASA;EAAAC;EAAAC;IAAA,uBAAQ;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,+BAAgB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,kCAAmB;EAAA;AAAA;AAgBxD;AACEF;EAAAC;EAAAC;IAAA,+BAAgB;EAAA;AAAA;AAChBF;EAAAC;EAAAC;IAAA,mCAAoB;EAAA;AAAA;AACpBF;EAAAC;EAAAC;IAAA,+BAAgB;EAAA;AAAA;AAChBF;EAAAC;EAAAC;IAAA,4BAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,6BAAc;EAAA;AAAA;AACdF;EAAAC;EAAAC;IAAA,oBAAK;EAAA;AAAA;AACLF;EAAAC;EAAAC;IAAA,wCAAyB;EAAA;AAAA;AACzBF;EAAAC;EAAAC;IAAA,4BAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,gCAAiB;EAAA;AAAA;AACjBF;EAAAC;EAAAC;IAAA,iCAAkB;EAAA;AAAA;AAClBF;EAAAC;EAAAC;IAAA,0BAAW;EAAA;AAAA;AACXF;EAAAC;EAAAC;IAAA,yBAAU;EAAA;AAAA;AAIZ;AAASF;EAAAC;EAAAC;IAAA,wBAAS;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,uBAAQ;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,0BAAW;EAAA;AAAA;AAEzC;AACEF;EAAAC;EAAAC;IAAA,oBAAK;EAAA;AAAA;AACLF;EAAAC;EAAAC;IAAA,oCAAqB;EAAA;AAAA;AACrBF;EAAAC;EAAAC;IAAA,wCAAyB;EAAA;AAAA;AACzBF;EAAAC;EAAAC;IAAA,4BAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,6BAAc;EAAA;AAAA;AACdF;EAAAC;EAAAC;IAAA,4BAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,uCAAwB;EAAA;AAAA;AAG1B;AAASF;EAAAC;EAAAC;IAAA,0CAA2B;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,8BAAe;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,8BAAe;EAAA;AAAA","names":["Object","enumerable","get"],"sourceRoot":"../src/","sources":["packages/react-components/react-utilities/src/index.ts"],"sourcesContent":["export { getSlots, resolveShorthand, isResolvedShorthand } from './compose/index';\nexport type {\n ExtractSlotProps,\n ComponentProps,\n ComponentState,\n ForwardRefComponent,\n ResolveShorthandFunction,\n ResolveShorthandOptions,\n Slot,\n Slots,\n SlotClassNames,\n SlotPropsRecord,\n SlotRenderFunction,\n SlotShorthandValue,\n} from './compose/index';\n\nexport {\n resetIdsForTests,\n useControllableState,\n useEventCallback,\n useFirstMount,\n useForceUpdate,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n usePrevious,\n useTimeout,\n} from './hooks/index';\nexport type { RefObjectFunction, UseControllableStateOptions, UseOnClickOrScrollOutsideOptions } from './hooks/index';\n\nexport { canUseDOM, useIsSSR, SSRProvider } from './ssr/index';\n\nexport {\n clamp,\n getNativeElementProps,\n getPartitionedNativeProps,\n getRTLSafeKey,\n mergeCallbacks,\n isHTMLElement,\n isInteractiveHTMLElement,\n} from './utils/index';\n\nexport { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from './trigger/index';\n\nexport type { FluentTriggerComponent, TriggerProps } from './trigger/index';\n"]}
1
+ {"version":3,"mappings":";;;;;;AAAA;AAASA;EAAAC;EAAAC;IAAA,uBAAQ;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,+BAAgB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,kCAAmB;EAAA;AAAA;AAgBxD;AACEF;EAAAC;EAAAC;IAAA,+BAAgB;EAAA;AAAA;AAChBF;EAAAC;EAAAC;IAAA,mCAAoB;EAAA;AAAA;AACpBF;EAAAC;EAAAC;IAAA,+BAAgB;EAAA;AAAA;AAChBF;EAAAC;EAAAC;IAAA,4BAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,6BAAc;EAAA;AAAA;AACdF;EAAAC;EAAAC;IAAA,oBAAK;EAAA;AAAA;AACLF;EAAAC;EAAAC;IAAA,wCAAyB;EAAA;AAAA;AACzBF;EAAAC;EAAAC;IAAA,4BAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,gCAAiB;EAAA;AAAA;AACjBF;EAAAC;EAAAC;IAAA,iCAAkB;EAAA;AAAA;AAClBF;EAAAC;EAAAC;IAAA,0BAAW;EAAA;AAAA;AACXF;EAAAC;EAAAC;IAAA,gCAAiB;EAAA;AAAA;AACjBF;EAAAC;EAAAC;IAAA,yBAAU;EAAA;AAAA;AAIZ;AAASF;EAAAC;EAAAC;IAAA,wBAAS;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,uBAAQ;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,0BAAW;EAAA;AAAA;AAEzC;AACEF;EAAAC;EAAAC;IAAA,oBAAK;EAAA;AAAA;AACLF;EAAAC;EAAAC;IAAA,oCAAqB;EAAA;AAAA;AACrBF;EAAAC;EAAAC;IAAA,wCAAyB;EAAA;AAAA;AACzBF;EAAAC;EAAAC;IAAA,4BAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,6BAAc;EAAA;AAAA;AACdF;EAAAC;EAAAC;IAAA,4BAAa;EAAA;AAAA;AACbF;EAAAC;EAAAC;IAAA,uCAAwB;EAAA;AAAA;AAG1B;AAASF;EAAAC;EAAAC;IAAA,0CAA2B;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,8BAAe;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,8BAAe;EAAA;AAAA","names":["Object","enumerable","get"],"sourceRoot":"../src/","sources":["packages/react-components/react-utilities/src/index.ts"],"sourcesContent":["export { getSlots, resolveShorthand, isResolvedShorthand } from './compose/index';\nexport type {\n ExtractSlotProps,\n ComponentProps,\n ComponentState,\n ForwardRefComponent,\n ResolveShorthandFunction,\n ResolveShorthandOptions,\n Slot,\n Slots,\n SlotClassNames,\n SlotPropsRecord,\n SlotRenderFunction,\n SlotShorthandValue,\n} from './compose/index';\n\nexport {\n resetIdsForTests,\n useControllableState,\n useEventCallback,\n useFirstMount,\n useForceUpdate,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n usePrevious,\n useScrollbarWidth,\n useTimeout,\n} from './hooks/index';\nexport type { RefObjectFunction, UseControllableStateOptions, UseOnClickOrScrollOutsideOptions } from './hooks/index';\n\nexport { canUseDOM, useIsSSR, SSRProvider } from './ssr/index';\n\nexport {\n clamp,\n getNativeElementProps,\n getPartitionedNativeProps,\n getRTLSafeKey,\n mergeCallbacks,\n isHTMLElement,\n isInteractiveHTMLElement,\n} from './utils/index';\n\nexport { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from './trigger/index';\n\nexport type { FluentTriggerComponent, TriggerProps } from './trigger/index';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-utilities",
3
- "version": "9.3.1",
3
+ "version": "9.4.0",
4
4
  "description": "A set of general React-specific utilities.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",