@fluentui/react-positioning 9.0.0-rc.8 → 9.0.1

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.
Files changed (100) hide show
  1. package/CHANGELOG.json +201 -1
  2. package/CHANGELOG.md +77 -2
  3. package/dist/index.d.ts +78 -46
  4. package/{lib → dist}/tsdoc-metadata.json +0 -0
  5. package/lib/createArrowStyles.js +3 -1
  6. package/lib/createArrowStyles.js.map +1 -1
  7. package/lib/createVirtualElementFromClick.js +2 -0
  8. package/lib/createVirtualElementFromClick.js.map +1 -1
  9. package/lib/index.js +2 -2
  10. package/lib/index.js.map +1 -1
  11. package/lib/isIntersectingModifier.js.map +1 -1
  12. package/lib/types.js.map +1 -1
  13. package/lib/{usePopper.js → usePositioning.js} +10 -8
  14. package/lib/usePositioning.js.map +1 -0
  15. package/lib/{usePopperMouseTarget.js → usePositioningMouseTarget.js} +4 -3
  16. package/lib/usePositioningMouseTarget.js.map +1 -0
  17. package/lib/utils/fromPopperPlacement.js +40 -0
  18. package/lib/utils/fromPopperPlacement.js.map +1 -0
  19. package/lib/utils/getBoundary.js.map +1 -1
  20. package/lib/utils/getPopperOffset.js +44 -0
  21. package/lib/utils/getPopperOffset.js.map +1 -0
  22. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  23. package/lib/utils/getScrollParent.js.map +1 -1
  24. package/lib/utils/index.js +1 -1
  25. package/lib/utils/index.js.map +1 -1
  26. package/lib/utils/mergeArrowOffset.js +24 -22
  27. package/lib/utils/mergeArrowOffset.js.map +1 -1
  28. package/lib/utils/parsePopperPlacement.js +14 -0
  29. package/lib/utils/parsePopperPlacement.js.map +1 -0
  30. package/lib/utils/positioningHelper.js.map +1 -1
  31. package/lib/utils/resolvePositioningShorthand.js.map +1 -1
  32. package/lib/utils/useCallbackRef.js.map +1 -1
  33. package/lib-commonjs/createArrowStyles.js +3 -1
  34. package/lib-commonjs/createArrowStyles.js.map +1 -1
  35. package/lib-commonjs/createVirtualElementFromClick.js +2 -0
  36. package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
  37. package/lib-commonjs/index.js +7 -7
  38. package/lib-commonjs/index.js.map +1 -1
  39. package/lib-commonjs/isIntersectingModifier.js.map +1 -1
  40. package/lib-commonjs/{usePopper.js → usePositioning.js} +13 -10
  41. package/lib-commonjs/usePositioning.js.map +1 -0
  42. package/lib-commonjs/{usePopperMouseTarget.js → usePositioningMouseTarget.js} +6 -5
  43. package/lib-commonjs/usePositioningMouseTarget.js.map +1 -0
  44. package/lib-commonjs/utils/fromPopperPlacement.js +50 -0
  45. package/lib-commonjs/utils/fromPopperPlacement.js.map +1 -0
  46. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  47. package/lib-commonjs/utils/getPopperOffset.js +54 -0
  48. package/lib-commonjs/utils/getPopperOffset.js.map +1 -0
  49. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  50. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  51. package/lib-commonjs/utils/index.js +2 -2
  52. package/lib-commonjs/utils/index.js.map +1 -1
  53. package/lib-commonjs/utils/mergeArrowOffset.js +24 -22
  54. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  55. package/lib-commonjs/utils/parsePopperPlacement.js +23 -0
  56. package/lib-commonjs/utils/parsePopperPlacement.js.map +1 -0
  57. package/lib-commonjs/utils/positioningHelper.js.map +1 -1
  58. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  59. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  60. package/package.json +7 -9
  61. package/lib/createArrowStyles.d.ts +0 -64
  62. package/lib/createVirtualElementFromClick.d.ts +0 -6
  63. package/lib/index.d.ts +0 -7
  64. package/lib/isIntersectingModifier.d.ts +0 -4
  65. package/lib/types.d.ts +0 -89
  66. package/lib/usePopper.d.ts +0 -23
  67. package/lib/usePopper.js.map +0 -1
  68. package/lib/usePopperMouseTarget.d.ts +0 -11
  69. package/lib/usePopperMouseTarget.js.map +0 -1
  70. package/lib/utils/getBasePlacement.d.ts +0 -8
  71. package/lib/utils/getBasePlacement.js +0 -10
  72. package/lib/utils/getBasePlacement.js.map +0 -1
  73. package/lib/utils/getBoundary.d.ts +0 -6
  74. package/lib/utils/getReactFiberFromNode.d.ts +0 -108
  75. package/lib/utils/getScrollParent.d.ts +0 -12
  76. package/lib/utils/index.d.ts +0 -8
  77. package/lib/utils/mergeArrowOffset.d.ts +0 -10
  78. package/lib/utils/positioningHelper.d.ts +0 -7
  79. package/lib/utils/resolvePositioningShorthand.d.ts +0 -2
  80. package/lib/utils/useCallbackRef.d.ts +0 -19
  81. package/lib-commonjs/createArrowStyles.d.ts +0 -64
  82. package/lib-commonjs/createVirtualElementFromClick.d.ts +0 -6
  83. package/lib-commonjs/index.d.ts +0 -7
  84. package/lib-commonjs/isIntersectingModifier.d.ts +0 -4
  85. package/lib-commonjs/types.d.ts +0 -89
  86. package/lib-commonjs/usePopper.d.ts +0 -23
  87. package/lib-commonjs/usePopper.js.map +0 -1
  88. package/lib-commonjs/usePopperMouseTarget.d.ts +0 -11
  89. package/lib-commonjs/usePopperMouseTarget.js.map +0 -1
  90. package/lib-commonjs/utils/getBasePlacement.d.ts +0 -8
  91. package/lib-commonjs/utils/getBasePlacement.js +0 -19
  92. package/lib-commonjs/utils/getBasePlacement.js.map +0 -1
  93. package/lib-commonjs/utils/getBoundary.d.ts +0 -6
  94. package/lib-commonjs/utils/getReactFiberFromNode.d.ts +0 -108
  95. package/lib-commonjs/utils/getScrollParent.d.ts +0 -12
  96. package/lib-commonjs/utils/index.d.ts +0 -8
  97. package/lib-commonjs/utils/mergeArrowOffset.d.ts +0 -10
  98. package/lib-commonjs/utils/positioningHelper.d.ts +0 -7
  99. package/lib-commonjs/utils/resolvePositioningShorthand.d.ts +0 -2
  100. package/lib-commonjs/utils/useCallbackRef.d.ts +0 -19
@@ -1,10 +0,0 @@
1
- import type { Offset } from '../types';
2
- /**
3
- * Generally when adding an arrow to popper, it's necessary to offset the position of the popper by the
4
- * height of the arrow. A simple utility to merge a provided offset with an arrow height to return the final offset
5
- *
6
- * @param userOffset - The offset provided by the user
7
- * @param arrowHeight - The height of the arrow in px
8
- * @returns User offset augmented with arrow height
9
- */
10
- export declare function mergeArrowOffset(userOffset: Offset | undefined | null, arrowHeight: number): Offset;
@@ -1,7 +0,0 @@
1
- import * as PopperJs from '@popperjs/core';
2
- import type { Alignment, Offset, Position } from '../types';
3
- /**
4
- * @see positioninHelper.test.ts for expected placement values
5
- */
6
- export declare const getPlacement: (align?: Alignment | undefined, position?: Position | undefined, rtl?: boolean | undefined) => PopperJs.Placement;
7
- export declare const applyRtlToOffset: (offset: Offset | undefined) => Offset | undefined;
@@ -1,2 +0,0 @@
1
- import type { PositioningShorthand, PositioningProps } from '../types';
2
- export declare function resolvePositioningShorthand(shorthand: PositioningShorthand | undefined | null): Readonly<PositioningProps>;
@@ -1,19 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * Creates a MutableRef with ref change callback. Is useful as React.useRef() doesn't notify you when its content
4
- * changes and mutating the .current property doesn't cause a re-render. An opt-out will be use a callback ref via
5
- * React.useState(), but it will cause re-renders always.
6
- *
7
- * https://reactjs.org/docs/hooks-reference.html#useref
8
- * https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref
9
- *
10
- * @param initialValue - initial ref value
11
- * @param callback - a callback to run when value changes
12
- * @param skipInitialResolve - a flag to skip an initial ref report
13
- *
14
- * @example
15
- * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);
16
- * ref.current = 1;
17
- * // prints 0 -> 1
18
- */
19
- export declare function useCallbackRef<T>(initialValue: T | null, callback: (newValue: T | null, lastValue: T | null) => void, skipInitialResolve?: boolean): React.MutableRefObject<T | null>;