@fluentui/react-positioning 9.22.0 → 9.22.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.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,21 @@
1
1
  # Change Log - @fluentui/react-positioning
2
2
 
3
- This log was last generated on Tue, 03 Mar 2026 09:41:32 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 23 Apr 2026 11:59:29 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.22.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.22.1)
8
+
9
+ Thu, 23 Apr 2026 11:59:29 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.22.0..@fluentui/react-positioning_v9.22.1)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-utilities to v9.26.3 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
15
+
7
16
  ## [9.22.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.22.0)
8
17
 
9
- Tue, 03 Mar 2026 09:41:32 GMT
18
+ Tue, 03 Mar 2026 09:43:41 GMT
10
19
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.21.0..@fluentui/react-positioning_v9.22.0)
11
20
 
12
21
  ### Minor changes
package/dist/index.d.ts CHANGED
@@ -13,16 +13,16 @@ export declare type AutoSize = 'height' | 'height-always' | 'width' | 'width-alw
13
13
  export declare type Boundary = PositioningBoundary;
14
14
 
15
15
  /**
16
- * @internal
17
16
  * Creates CSS styles to size the arrow created by createArrowStyles to the given height.
18
17
  *
19
18
  * Use this when you need to create classes for several different arrow sizes. If you only need a
20
19
  * constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.
20
+ *
21
+ * @internal
21
22
  */
22
23
  export declare function createArrowHeightStyles(arrowHeight: number): GriffelStyle;
23
24
 
24
25
  /**
25
- * @internal
26
26
  * Helper that creates a makeStyles rule for an arrow element.
27
27
  * For runtime arrow size toggling simply create extra classnames to apply to the arrow element
28
28
  *
@@ -43,12 +43,15 @@ export declare function createArrowHeightStyles(arrowHeight: number): GriffelSty
43
43
  * state.mediumArrow && styles.mediumArrow,
44
44
  * )
45
45
  * ```
46
+ *
47
+ * @internal
46
48
  */
47
49
  export declare function createArrowStyles(options: CreateArrowStylesOptions): GriffelStyle;
48
50
 
49
51
  /**
50
- * @internal
51
52
  * Options parameter for the createArrowStyles function
53
+ *
54
+ * @internal
52
55
  */
53
56
  export declare type CreateArrowStylesOptions = {
54
57
  /**
@@ -346,11 +349,11 @@ declare type TargetElement = HTMLElement | PositioningVirtualElement;
346
349
  export declare function usePositioning(options: PositioningProps & PositioningOptions): UsePositioningReturn;
347
350
 
348
351
  /**
349
- * @internal
350
352
  * A state hook that manages a popper virtual element from mouseevents.
351
353
  * Useful for scenarios where a component needs to be positioned by mouse click (e.g. contextmenu)
352
354
  * React synthetic events are not persisted by this hook
353
355
  *
356
+ * @internal
354
357
  * @param initialState - initializes a user provided state similare to useState
355
358
  * @returns state and dispatcher for a Popper virtual element that uses native/synthetic mouse events
356
359
  */
@@ -1,6 +1,5 @@
1
1
  import { tokens } from '@fluentui/react-theme';
2
2
  /**
3
- * @internal
4
3
  * Helper that creates a makeStyles rule for an arrow element.
5
4
  * For runtime arrow size toggling simply create extra classnames to apply to the arrow element
6
5
  *
@@ -21,6 +20,8 @@ import { tokens } from '@fluentui/react-theme';
21
20
  * state.mediumArrow && styles.mediumArrow,
22
21
  * )
23
22
  * ```
23
+ *
24
+ * @internal
24
25
  */ export function createArrowStyles(options) {
25
26
  const { arrowHeight, borderWidth = '1px', borderStyle = 'solid', borderColor = tokens.colorTransparentStroke } = options;
26
27
  return {
@@ -65,11 +66,12 @@ import { tokens } from '@fluentui/react-theme';
65
66
  };
66
67
  }
67
68
  /**
68
- * @internal
69
69
  * Creates CSS styles to size the arrow created by createArrowStyles to the given height.
70
70
  *
71
71
  * Use this when you need to create classes for several different arrow sizes. If you only need a
72
72
  * constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.
73
+ *
74
+ * @internal
73
75
  */ export function createArrowHeightStyles(arrowHeight) {
74
76
  // The arrow is a square rotated 45 degrees to have its bottom and right edges form a right triangle.
75
77
  // Multiply the triangle's height by sqrt(2) to get length of its edges.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/createArrowStyles.ts"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport type { GriffelStyle } from '@griffel/react';\n\n/**\n * @internal\n * Options parameter for the createArrowStyles function\n */\nexport type CreateArrowStylesOptions = {\n /**\n * The height of the arrow from the base to the tip, in px. The base width of the arrow is always twice its height.\n *\n * This can be undefined to leave out the arrow size styles. You must then add styles created by\n * createArrowHeightStyles to set the arrow's size correctly. This can be useful if the arrow can be different sizes.\n */\n arrowHeight: number | undefined;\n\n /**\n * The borderWidth of the arrow. Should be the same borderWidth as the parent element.\n *\n * @defaultvalue 1px\n */\n borderWidth?: GriffelStyle['borderBottomWidth'];\n\n /**\n * The borderStyle for the arrow. Should be the same borderStyle as the parent element.\n *\n * @defaultvalue solid\n */\n borderStyle?: GriffelStyle['borderBottomStyle'];\n\n /**\n * The borderColor of the arrow. Should be the same borderColor as the parent element.\n *\n * @defaultvalue tokens.colorTransparentStroke\n */\n borderColor?: GriffelStyle['borderBottomColor'];\n};\n\n/**\n * @internal\n * Helper that creates a makeStyles rule for an arrow element.\n * For runtime arrow size toggling simply create extra classnames to apply to the arrow element\n *\n * ```ts\n * makeStyles({\n * arrowWithSize: createArrowStyles({ arrowHeight: 6 }),\n *\n * arrowWithoutSize: createArrowStyles({ arrowHeight: undefined }),\n * mediumArrow: createArrowHeightStyles(4),\n * smallArrow: createArrowHeightStyles(2),\n * })\n * ...\n *\n * state.arrowWithSize.className = styles.arrowWithSize;\n * state.arrowWithoutSize.className = mergeClasses(\n * styles.arrowWithoutSize,\n * state.smallArrow && styles.smallArrow,\n * state.mediumArrow && styles.mediumArrow,\n * )\n * ```\n */\nexport function createArrowStyles(options: CreateArrowStylesOptions): GriffelStyle {\n const {\n arrowHeight,\n borderWidth = '1px',\n borderStyle = 'solid',\n borderColor = tokens.colorTransparentStroke,\n } = options;\n\n return {\n boxSizing: 'border-box',\n position: 'absolute',\n zIndex: -1,\n\n ...(arrowHeight && createArrowHeightStyles(arrowHeight)),\n\n backgroundColor: 'inherit',\n backgroundClip: 'content-box',\n\n borderBottomLeftRadius: `${tokens.borderRadiusSmall} /* @noflip */`,\n transform: 'rotate(var(--fui-positioning-arrow-angle)) /* @noflip */',\n\n height: 'var(--fui-positioning-arrow-height)',\n width: 'var(--fui-positioning-arrow-height)',\n\n '::before': {\n content: '\"\"',\n\n display: 'block',\n backgroundColor: 'inherit',\n margin: `-${borderWidth}`,\n width: '100%',\n height: '100%',\n\n border: `${borderWidth} ${borderStyle} ${borderColor}`,\n borderBottomLeftRadius: `${tokens.borderRadiusSmall} /* @noflip */`,\n\n clipPath: 'polygon(0% 0%, 100% 100%, 0% 100%)',\n },\n\n // Popper sets data-popper-placement on the root element, which is used to align the arrow\n ':global([data-popper-placement^=\"top\"])': {\n bottom: 'var(--fui-positioning-arrow-offset)',\n '--fui-positioning-arrow-angle': '-45deg',\n },\n ':global([data-popper-placement^=\"right\"])': {\n left: `var(--fui-positioning-arrow-offset) /* @noflip */`,\n '--fui-positioning-arrow-angle': '45deg',\n },\n ':global([data-popper-placement^=\"bottom\"])': {\n top: 'var(--fui-positioning-arrow-offset)',\n '--fui-positioning-arrow-angle': '135deg',\n },\n ':global([data-popper-placement^=\"left\"])': {\n right: `var(--fui-positioning-arrow-offset) /* @noflip */`,\n '--fui-positioning-arrow-angle': '225deg',\n },\n };\n}\n\n/**\n * @internal\n * Creates CSS styles to size the arrow created by createArrowStyles to the given height.\n *\n * Use this when you need to create classes for several different arrow sizes. If you only need a\n * constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.\n */\nexport function createArrowHeightStyles(arrowHeight: number): GriffelStyle {\n // The arrow is a square rotated 45 degrees to have its bottom and right edges form a right triangle.\n // Multiply the triangle's height by sqrt(2) to get length of its edges.\n const edgeLength = 1.414 * arrowHeight;\n\n return {\n '--fui-positioning-arrow-height': `${edgeLength}px`,\n '--fui-positioning-arrow-offset': `${(edgeLength / 2) * -1}px`,\n };\n}\n"],"names":["tokens","createArrowStyles","options","arrowHeight","borderWidth","borderStyle","borderColor","colorTransparentStroke","boxSizing","position","zIndex","createArrowHeightStyles","backgroundColor","backgroundClip","borderBottomLeftRadius","borderRadiusSmall","transform","height","width","content","display","margin","border","clipPath","bottom","left","top","right","edgeLength"],"mappings":"AAAA,SAASA,MAAM,QAAQ,wBAAwB;AAsC/C;;;;;;;;;;;;;;;;;;;;;;CAsBC,GACD,OAAO,SAASC,kBAAkBC,OAAiC;IACjE,MAAM,EACJC,WAAW,EACXC,cAAc,KAAK,EACnBC,cAAc,OAAO,EACrBC,cAAcN,OAAOO,sBAAsB,EAC5C,GAAGL;IAEJ,OAAO;QACLM,WAAW;QACXC,UAAU;QACVC,QAAQ,CAAC;QAET,GAAIP,eAAeQ,wBAAwBR,YAAY;QAEvDS,iBAAiB;QACjBC,gBAAgB;QAEhBC,wBAAwB,GAAGd,OAAOe,iBAAiB,CAAC,cAAc,CAAC;QACnEC,WAAW;QAEXC,QAAQ;QACRC,OAAO;QAEP,YAAY;YACVC,SAAS;YAETC,SAAS;YACTR,iBAAiB;YACjBS,QAAQ,CAAC,CAAC,EAAEjB,aAAa;YACzBc,OAAO;YACPD,QAAQ;YAERK,QAAQ,GAAGlB,YAAY,CAAC,EAAEC,YAAY,CAAC,EAAEC,aAAa;YACtDQ,wBAAwB,GAAGd,OAAOe,iBAAiB,CAAC,cAAc,CAAC;YAEnEQ,UAAU;QACZ;QAEA,0FAA0F;QAC1F,2CAA2C;YACzCC,QAAQ;YACR,iCAAiC;QACnC;QACA,6CAA6C;YAC3CC,MAAM,CAAC,iDAAiD,CAAC;YACzD,iCAAiC;QACnC;QACA,8CAA8C;YAC5CC,KAAK;YACL,iCAAiC;QACnC;QACA,4CAA4C;YAC1CC,OAAO,CAAC,iDAAiD,CAAC;YAC1D,iCAAiC;QACnC;IACF;AACF;AAEA;;;;;;CAMC,GACD,OAAO,SAAShB,wBAAwBR,WAAmB;IACzD,qGAAqG;IACrG,wEAAwE;IACxE,MAAMyB,aAAa,QAAQzB;IAE3B,OAAO;QACL,kCAAkC,GAAGyB,WAAW,EAAE,CAAC;QACnD,kCAAkC,GAAG,AAACA,aAAa,IAAK,CAAC,EAAE,EAAE,CAAC;IAChE;AACF"}
1
+ {"version":3,"sources":["../src/createArrowStyles.ts"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport type { GriffelStyle } from '@griffel/react';\n\n/**\n * Options parameter for the createArrowStyles function\n *\n * @internal\n */\nexport type CreateArrowStylesOptions = {\n /**\n * The height of the arrow from the base to the tip, in px. The base width of the arrow is always twice its height.\n *\n * This can be undefined to leave out the arrow size styles. You must then add styles created by\n * createArrowHeightStyles to set the arrow's size correctly. This can be useful if the arrow can be different sizes.\n */\n arrowHeight: number | undefined;\n\n /**\n * The borderWidth of the arrow. Should be the same borderWidth as the parent element.\n *\n * @defaultvalue 1px\n */\n borderWidth?: GriffelStyle['borderBottomWidth'];\n\n /**\n * The borderStyle for the arrow. Should be the same borderStyle as the parent element.\n *\n * @defaultvalue solid\n */\n borderStyle?: GriffelStyle['borderBottomStyle'];\n\n /**\n * The borderColor of the arrow. Should be the same borderColor as the parent element.\n *\n * @defaultvalue tokens.colorTransparentStroke\n */\n borderColor?: GriffelStyle['borderBottomColor'];\n};\n\n/**\n * Helper that creates a makeStyles rule for an arrow element.\n * For runtime arrow size toggling simply create extra classnames to apply to the arrow element\n *\n * ```ts\n * makeStyles({\n * arrowWithSize: createArrowStyles({ arrowHeight: 6 }),\n *\n * arrowWithoutSize: createArrowStyles({ arrowHeight: undefined }),\n * mediumArrow: createArrowHeightStyles(4),\n * smallArrow: createArrowHeightStyles(2),\n * })\n * ...\n *\n * state.arrowWithSize.className = styles.arrowWithSize;\n * state.arrowWithoutSize.className = mergeClasses(\n * styles.arrowWithoutSize,\n * state.smallArrow && styles.smallArrow,\n * state.mediumArrow && styles.mediumArrow,\n * )\n * ```\n *\n * @internal\n */\nexport function createArrowStyles(options: CreateArrowStylesOptions): GriffelStyle {\n const {\n arrowHeight,\n borderWidth = '1px',\n borderStyle = 'solid',\n borderColor = tokens.colorTransparentStroke,\n } = options;\n\n return {\n boxSizing: 'border-box',\n position: 'absolute',\n zIndex: -1,\n\n ...(arrowHeight && createArrowHeightStyles(arrowHeight)),\n\n backgroundColor: 'inherit',\n backgroundClip: 'content-box',\n\n borderBottomLeftRadius: `${tokens.borderRadiusSmall} /* @noflip */`,\n transform: 'rotate(var(--fui-positioning-arrow-angle)) /* @noflip */',\n\n height: 'var(--fui-positioning-arrow-height)',\n width: 'var(--fui-positioning-arrow-height)',\n\n '::before': {\n content: '\"\"',\n\n display: 'block',\n backgroundColor: 'inherit',\n margin: `-${borderWidth}`,\n width: '100%',\n height: '100%',\n\n border: `${borderWidth} ${borderStyle} ${borderColor}`,\n borderBottomLeftRadius: `${tokens.borderRadiusSmall} /* @noflip */`,\n\n clipPath: 'polygon(0% 0%, 100% 100%, 0% 100%)',\n },\n\n // Popper sets data-popper-placement on the root element, which is used to align the arrow\n ':global([data-popper-placement^=\"top\"])': {\n bottom: 'var(--fui-positioning-arrow-offset)',\n '--fui-positioning-arrow-angle': '-45deg',\n },\n ':global([data-popper-placement^=\"right\"])': {\n left: `var(--fui-positioning-arrow-offset) /* @noflip */`,\n '--fui-positioning-arrow-angle': '45deg',\n },\n ':global([data-popper-placement^=\"bottom\"])': {\n top: 'var(--fui-positioning-arrow-offset)',\n '--fui-positioning-arrow-angle': '135deg',\n },\n ':global([data-popper-placement^=\"left\"])': {\n right: `var(--fui-positioning-arrow-offset) /* @noflip */`,\n '--fui-positioning-arrow-angle': '225deg',\n },\n };\n}\n\n/**\n * Creates CSS styles to size the arrow created by createArrowStyles to the given height.\n *\n * Use this when you need to create classes for several different arrow sizes. If you only need a\n * constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.\n *\n * @internal\n */\nexport function createArrowHeightStyles(arrowHeight: number): GriffelStyle {\n // The arrow is a square rotated 45 degrees to have its bottom and right edges form a right triangle.\n // Multiply the triangle's height by sqrt(2) to get length of its edges.\n const edgeLength = 1.414 * arrowHeight;\n\n return {\n '--fui-positioning-arrow-height': `${edgeLength}px`,\n '--fui-positioning-arrow-offset': `${(edgeLength / 2) * -1}px`,\n };\n}\n"],"names":["tokens","createArrowStyles","options","arrowHeight","borderWidth","borderStyle","borderColor","colorTransparentStroke","boxSizing","position","zIndex","createArrowHeightStyles","backgroundColor","backgroundClip","borderBottomLeftRadius","borderRadiusSmall","transform","height","width","content","display","margin","border","clipPath","bottom","left","top","right","edgeLength"],"mappings":"AAAA,SAASA,MAAM,QAAQ,wBAAwB;AAuC/C;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GACD,OAAO,SAASC,kBAAkBC,OAAiC;IACjE,MAAM,EACJC,WAAW,EACXC,cAAc,KAAK,EACnBC,cAAc,OAAO,EACrBC,cAAcN,OAAOO,sBAAsB,EAC5C,GAAGL;IAEJ,OAAO;QACLM,WAAW;QACXC,UAAU;QACVC,QAAQ,CAAC;QAET,GAAIP,eAAeQ,wBAAwBR,YAAY;QAEvDS,iBAAiB;QACjBC,gBAAgB;QAEhBC,wBAAwB,GAAGd,OAAOe,iBAAiB,CAAC,cAAc,CAAC;QACnEC,WAAW;QAEXC,QAAQ;QACRC,OAAO;QAEP,YAAY;YACVC,SAAS;YAETC,SAAS;YACTR,iBAAiB;YACjBS,QAAQ,CAAC,CAAC,EAAEjB,aAAa;YACzBc,OAAO;YACPD,QAAQ;YAERK,QAAQ,GAAGlB,YAAY,CAAC,EAAEC,YAAY,CAAC,EAAEC,aAAa;YACtDQ,wBAAwB,GAAGd,OAAOe,iBAAiB,CAAC,cAAc,CAAC;YAEnEQ,UAAU;QACZ;QAEA,0FAA0F;QAC1F,2CAA2C;YACzCC,QAAQ;YACR,iCAAiC;QACnC;QACA,6CAA6C;YAC3CC,MAAM,CAAC,iDAAiD,CAAC;YACzD,iCAAiC;QACnC;QACA,8CAA8C;YAC5CC,KAAK;YACL,iCAAiC;QACnC;QACA,4CAA4C;YAC1CC,OAAO,CAAC,iDAAiD,CAAC;YAC1D,iCAAiC;QACnC;IACF;AACF;AAEA;;;;;;;CAOC,GACD,OAAO,SAAShB,wBAAwBR,WAAmB;IACzD,qGAAqG;IACrG,wEAAwE;IACxE,MAAMyB,aAAa,QAAQzB;IAE3B,OAAO;QACL,kCAAkC,GAAGyB,WAAW,EAAE,CAAC;QACnD,kCAAkC,GAAG,AAACA,aAAa,IAAK,CAAC,EAAE,EAAE,CAAC;IAChE;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/middleware/flip.ts"],"sourcesContent":["import { flip as baseFlip, Placement, Middleware } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary, resolvePositioningShorthand, toFloatingUIPlacement } from '../utils/index';\n\nexport interface FlipMiddlewareOptions extends Pick<PositioningOptions, 'flipBoundary' | 'fallbackPositions'> {\n hasScrollableElement?: boolean;\n container: HTMLElement | null;\n isRtl?: boolean;\n}\n\nexport function flip(options: FlipMiddlewareOptions): Middleware {\n const { hasScrollableElement, flipBoundary, container, fallbackPositions = [], isRtl } = options;\n\n const fallbackPlacements = fallbackPositions.reduce<Placement[]>((acc, shorthand) => {\n const { position, align } = resolvePositioningShorthand(shorthand);\n const placement = toFloatingUIPlacement(align, position, isRtl);\n if (placement) {\n acc.push(placement);\n }\n return acc;\n }, []);\n\n return baseFlip({\n ...(hasScrollableElement && { boundary: 'clippingAncestors' }),\n ...(flipBoundary && { altBoundary: true, boundary: getBoundary(container, flipBoundary) }),\n fallbackStrategy: 'bestFit',\n ...(fallbackPlacements.length && { fallbackPlacements }),\n });\n}\n"],"names":["flip","baseFlip","getBoundary","resolvePositioningShorthand","toFloatingUIPlacement","options","hasScrollableElement","flipBoundary","container","fallbackPositions","isRtl","fallbackPlacements","reduce","acc","shorthand","position","align","placement","push","boundary","altBoundary","fallbackStrategy","length"],"mappings":"AAAA,SAASA,QAAQC,QAAQ,QAA+B,mBAAmB;AAE3E,SAASC,WAAW,EAAEC,2BAA2B,EAAEC,qBAAqB,QAAQ,iBAAiB;AAQjG,OAAO,SAASJ,KAAKK,OAA8B;IACjD,MAAM,EAAEC,oBAAoB,EAAEC,YAAY,EAAEC,SAAS,EAAEC,oBAAoB,EAAE,EAAEC,KAAK,EAAE,GAAGL;IAEzF,MAAMM,qBAAqBF,kBAAkBG,MAAM,CAAc,CAACC,KAAKC;QACrE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGb,4BAA4BW;QACxD,MAAMG,YAAYb,sBAAsBY,OAAOD,UAAUL;QACzD,IAAIO,WAAW;YACbJ,IAAIK,IAAI,CAACD;QACX;QACA,OAAOJ;IACT,GAAG,EAAE;IAEL,OAAOZ,SAAS;QACd,GAAIK,wBAAwB;YAAEa,UAAU;QAAoB,CAAC;QAC7D,GAAIZ,gBAAgB;YAAEa,aAAa;YAAMD,UAAUjB,YAAYM,WAAWD;QAAc,CAAC;QACzFc,kBAAkB;QAClB,GAAIV,mBAAmBW,MAAM,IAAI;YAAEX;QAAmB,CAAC;IACzD;AACF"}
1
+ {"version":3,"sources":["../src/middleware/flip.ts"],"sourcesContent":["import type { Placement, Middleware } from '@floating-ui/dom';\nimport { flip as baseFlip } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary, resolvePositioningShorthand, toFloatingUIPlacement } from '../utils/index';\n\nexport interface FlipMiddlewareOptions extends Pick<PositioningOptions, 'flipBoundary' | 'fallbackPositions'> {\n hasScrollableElement?: boolean;\n container: HTMLElement | null;\n isRtl?: boolean;\n}\n\nexport function flip(options: FlipMiddlewareOptions): Middleware {\n const { hasScrollableElement, flipBoundary, container, fallbackPositions = [], isRtl } = options;\n\n const fallbackPlacements = fallbackPositions.reduce<Placement[]>((acc, shorthand) => {\n const { position, align } = resolvePositioningShorthand(shorthand);\n const placement = toFloatingUIPlacement(align, position, isRtl);\n if (placement) {\n acc.push(placement);\n }\n return acc;\n }, []);\n\n return baseFlip({\n ...(hasScrollableElement && { boundary: 'clippingAncestors' }),\n ...(flipBoundary && { altBoundary: true, boundary: getBoundary(container, flipBoundary) }),\n fallbackStrategy: 'bestFit',\n ...(fallbackPlacements.length && { fallbackPlacements }),\n });\n}\n"],"names":["flip","baseFlip","getBoundary","resolvePositioningShorthand","toFloatingUIPlacement","options","hasScrollableElement","flipBoundary","container","fallbackPositions","isRtl","fallbackPlacements","reduce","acc","shorthand","position","align","placement","push","boundary","altBoundary","fallbackStrategy","length"],"mappings":"AACA,SAASA,QAAQC,QAAQ,QAAQ,mBAAmB;AAEpD,SAASC,WAAW,EAAEC,2BAA2B,EAAEC,qBAAqB,QAAQ,iBAAiB;AAQjG,OAAO,SAASJ,KAAKK,OAA8B;IACjD,MAAM,EAAEC,oBAAoB,EAAEC,YAAY,EAAEC,SAAS,EAAEC,oBAAoB,EAAE,EAAEC,KAAK,EAAE,GAAGL;IAEzF,MAAMM,qBAAqBF,kBAAkBG,MAAM,CAAc,CAACC,KAAKC;QACrE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGb,4BAA4BW;QACxD,MAAMG,YAAYb,sBAAsBY,OAAOD,UAAUL;QACzD,IAAIO,WAAW;YACbJ,IAAIK,IAAI,CAACD;QACX;QACA,OAAOJ;IACT,GAAG,EAAE;IAEL,OAAOZ,SAAS;QACd,GAAIK,wBAAwB;YAAEa,UAAU;QAAoB,CAAC;QAC7D,GAAIZ,gBAAgB;YAAEa,aAAa;YAAMD,UAAUjB,YAAYM,WAAWD;QAAc,CAAC;QACzFc,kBAAkB;QAClB,GAAIV,mBAAmBW,MAAM,IAAI;YAAEX;QAAmB,CAAC;IACzD;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/middleware/offset.ts"],"sourcesContent":["import { offset as baseOffset, Middleware } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getFloatingUIOffset } from '../utils/getFloatingUIOffset';\n\n/**\n * Wraps floating UI offset middleware to transform offset value.\n */\nexport function offset(offsetValue: PositioningOptions['offset']): Middleware {\n const floatingUIOffset = getFloatingUIOffset(offsetValue);\n return baseOffset(floatingUIOffset);\n}\n"],"names":["offset","baseOffset","getFloatingUIOffset","offsetValue","floatingUIOffset"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAoB,mBAAmB;AAEpE,SAASC,mBAAmB,QAAQ,+BAA+B;AAEnE;;CAEC,GACD,OAAO,SAASF,OAAOG,WAAyC;IAC9D,MAAMC,mBAAmBF,oBAAoBC;IAC7C,OAAOF,WAAWG;AACpB"}
1
+ {"version":3,"sources":["../src/middleware/offset.ts"],"sourcesContent":["import type { Middleware } from '@floating-ui/dom';\nimport { offset as baseOffset } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getFloatingUIOffset } from '../utils/getFloatingUIOffset';\n\n/**\n * Wraps floating UI offset middleware to transform offset value.\n */\nexport function offset(offsetValue: PositioningOptions['offset']): Middleware {\n const floatingUIOffset = getFloatingUIOffset(offsetValue);\n return baseOffset(floatingUIOffset);\n}\n"],"names":["offset","baseOffset","getFloatingUIOffset","offsetValue","floatingUIOffset"],"mappings":"AACA,SAASA,UAAUC,UAAU,QAAQ,mBAAmB;AAExD,SAASC,mBAAmB,QAAQ,+BAA+B;AAEnE;;CAEC,GACD,OAAO,SAASF,OAAOG,WAAyC;IAC9D,MAAMC,mBAAmBF,oBAAoBC;IAC7C,OAAOF,WAAWG;AACpB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/middleware/shift.ts"],"sourcesContent":["import { shift as baseShift, limitShift, Middleware } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary, toFloatingUIPadding } from '../utils/index';\n\nexport interface ShiftMiddlewareOptions\n extends Pick<PositioningOptions, 'overflowBoundary' | 'overflowBoundaryPadding' | 'shiftToCoverTarget'> {\n hasScrollableElement?: boolean;\n disableTether?: PositioningOptions['unstable_disableTether'];\n container: HTMLElement | null;\n isRtl: boolean;\n}\n\n/**\n * Wraps the floating UI shift middleware for easier usage of our options\n */\nexport function shift(options: ShiftMiddlewareOptions): Middleware {\n const {\n hasScrollableElement,\n shiftToCoverTarget,\n disableTether,\n overflowBoundary,\n container,\n overflowBoundaryPadding,\n isRtl,\n } = options;\n\n return baseShift({\n ...(hasScrollableElement && { boundary: 'clippingAncestors' }),\n ...(shiftToCoverTarget && {\n crossAxis: true,\n limiter: limitShift({ crossAxis: true, mainAxis: false }),\n }),\n ...(disableTether && {\n crossAxis: disableTether === 'all',\n limiter: limitShift({ crossAxis: disableTether !== 'all', mainAxis: false }),\n }),\n ...(overflowBoundaryPadding && { padding: toFloatingUIPadding(overflowBoundaryPadding, isRtl) }),\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n });\n}\n"],"names":["shift","baseShift","limitShift","getBoundary","toFloatingUIPadding","options","hasScrollableElement","shiftToCoverTarget","disableTether","overflowBoundary","container","overflowBoundaryPadding","isRtl","boundary","crossAxis","limiter","mainAxis","padding","altBoundary"],"mappings":"AAAA,SAASA,SAASC,SAAS,EAAEC,UAAU,QAAoB,mBAAmB;AAE9E,SAASC,WAAW,EAAEC,mBAAmB,QAAQ,iBAAiB;AAUlE;;CAEC,GACD,OAAO,SAASJ,MAAMK,OAA+B;IACnD,MAAM,EACJC,oBAAoB,EACpBC,kBAAkB,EAClBC,aAAa,EACbC,gBAAgB,EAChBC,SAAS,EACTC,uBAAuB,EACvBC,KAAK,EACN,GAAGP;IAEJ,OAAOJ,UAAU;QACf,GAAIK,wBAAwB;YAAEO,UAAU;QAAoB,CAAC;QAC7D,GAAIN,sBAAsB;YACxBO,WAAW;YACXC,SAASb,WAAW;gBAAEY,WAAW;gBAAME,UAAU;YAAM;QACzD,CAAC;QACD,GAAIR,iBAAiB;YACnBM,WAAWN,kBAAkB;YAC7BO,SAASb,WAAW;gBAAEY,WAAWN,kBAAkB;gBAAOQ,UAAU;YAAM;QAC5E,CAAC;QACD,GAAIL,2BAA2B;YAAEM,SAASb,oBAAoBO,yBAAyBC;QAAO,CAAC;QAC/F,GAAIH,oBAAoB;YAAES,aAAa;YAAML,UAAUV,YAAYO,WAAWD;QAAkB,CAAC;IACnG;AACF"}
1
+ {"version":3,"sources":["../src/middleware/shift.ts"],"sourcesContent":["import type { Middleware } from '@floating-ui/dom';\nimport { shift as baseShift, limitShift } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary, toFloatingUIPadding } from '../utils/index';\n\nexport interface ShiftMiddlewareOptions\n extends Pick<PositioningOptions, 'overflowBoundary' | 'overflowBoundaryPadding' | 'shiftToCoverTarget'> {\n hasScrollableElement?: boolean;\n disableTether?: PositioningOptions['unstable_disableTether'];\n container: HTMLElement | null;\n isRtl: boolean;\n}\n\n/**\n * Wraps the floating UI shift middleware for easier usage of our options\n */\nexport function shift(options: ShiftMiddlewareOptions): Middleware {\n const {\n hasScrollableElement,\n shiftToCoverTarget,\n disableTether,\n overflowBoundary,\n container,\n overflowBoundaryPadding,\n isRtl,\n } = options;\n\n return baseShift({\n ...(hasScrollableElement && { boundary: 'clippingAncestors' }),\n ...(shiftToCoverTarget && {\n crossAxis: true,\n limiter: limitShift({ crossAxis: true, mainAxis: false }),\n }),\n ...(disableTether && {\n crossAxis: disableTether === 'all',\n limiter: limitShift({ crossAxis: disableTether !== 'all', mainAxis: false }),\n }),\n ...(overflowBoundaryPadding && { padding: toFloatingUIPadding(overflowBoundaryPadding, isRtl) }),\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n });\n}\n"],"names":["shift","baseShift","limitShift","getBoundary","toFloatingUIPadding","options","hasScrollableElement","shiftToCoverTarget","disableTether","overflowBoundary","container","overflowBoundaryPadding","isRtl","boundary","crossAxis","limiter","mainAxis","padding","altBoundary"],"mappings":"AACA,SAASA,SAASC,SAAS,EAAEC,UAAU,QAAQ,mBAAmB;AAElE,SAASC,WAAW,EAAEC,mBAAmB,QAAQ,iBAAiB;AAUlE;;CAEC,GACD,OAAO,SAASJ,MAAMK,OAA+B;IACnD,MAAM,EACJC,oBAAoB,EACpBC,kBAAkB,EAClBC,aAAa,EACbC,gBAAgB,EAChBC,SAAS,EACTC,uBAAuB,EACvBC,KAAK,EACN,GAAGP;IAEJ,OAAOJ,UAAU;QACf,GAAIK,wBAAwB;YAAEO,UAAU;QAAoB,CAAC;QAC7D,GAAIN,sBAAsB;YACxBO,WAAW;YACXC,SAASb,WAAW;gBAAEY,WAAW;gBAAME,UAAU;YAAM;QACzD,CAAC;QACD,GAAIR,iBAAiB;YACnBM,WAAWN,kBAAkB;YAC7BO,SAASb,WAAW;gBAAEY,WAAWN,kBAAkB;gBAAOQ,UAAU;YAAM;QAC5E,CAAC;QACD,GAAIL,2BAA2B;YAAEM,SAASb,oBAAoBO,yBAAyBC;QAAO,CAAC;QAC/F,GAAIH,oBAAoB;YAAES,aAAa;YAAML,UAAUV,YAAYO,WAAWD;QAAkB,CAAC;IACnG;AACF"}
package/lib/types.js CHANGED
@@ -1 +1 @@
1
- import * as React from 'react';
1
+ export { };
package/lib/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * Physical placement of a positioned element relative to its target, as computed by Floating UI.\n * This is a Fluent-owned equivalent of Floating UI's `Placement` type, avoiding a transitive\n * dependency on `@floating-ui/dom` in the public API surface.\n */\nexport type PositioningPlacement =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end';\n\n/**\n * Detail payload of the positioning end event, providing the final computed placement\n * after all middleware (flip, shift, etc.) have run.\n */\nexport type OnPositioningEndEventDetail = {\n /**\n * The computed placement of the positioned element. May differ from the requested\n * placement if flip or other middleware adjusted it.\n */\n placement: PositioningPlacement;\n};\n\n/**\n * Custom DOM event dispatched on the positioned container element when a\n * positioning update completes. Carries placement information in `event.detail`.\n */\nexport type OnPositioningEndEvent = CustomEvent<OnPositioningEndEventDetail>;\n\nexport type PositioningRect = {\n width: number;\n height: number;\n x: number;\n y: number;\n};\n\nexport type OffsetFunctionParam = {\n positionedRect: PositioningRect;\n targetRect: PositioningRect;\n position: Position;\n alignment?: Alignment;\n};\n\nexport type TargetElement = HTMLElement | PositioningVirtualElement;\n\n/**\n * @internal\n */\nexport interface PositionManager {\n updatePosition: () => void;\n dispose: () => void;\n}\n\nexport interface UsePositioningReturn {\n // React refs are supposed to be contravariant\n // (allows a more general type to be passed rather than a more specific one)\n // However, Typescript currently can't infer that fact for refs\n // See https://github.com/microsoft/TypeScript/issues/30748 for more information\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-deprecated\n targetRef: React.MutableRefObject<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-deprecated\n containerRef: React.MutableRefObject<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-deprecated\n arrowRef: React.MutableRefObject<any>;\n}\n\nexport type OffsetObject = { crossAxis?: number; mainAxis: number };\n\nexport type OffsetShorthand = number;\n\nexport type OffsetFunction = (param: OffsetFunctionParam) => OffsetObject | OffsetShorthand;\n\nexport type Offset = OffsetFunction | OffsetObject | OffsetShorthand;\n\nexport type Position = 'above' | 'below' | 'before' | 'after';\nexport type Alignment = 'top' | 'bottom' | 'start' | 'end' | 'center';\n\nexport type AutoSize = 'height' | 'height-always' | 'width' | 'width-always' | 'always' | boolean;\nexport type NormalizedAutoSize = { applyMaxWidth: boolean; applyMaxHeight: boolean };\n\nexport type PositioningBoundary =\n | PositioningRect\n | HTMLElement\n | Array<HTMLElement>\n | 'clippingParents'\n | 'scrollParent'\n | 'window';\n/**\n * @deprecated use PositioningBoundary instead\n */\nexport type Boundary = PositioningBoundary;\n\nexport type PositioningImperativeRef = {\n /**\n * Updates the position imperatively.\n * Useful when the position of the target changes from other factors than scrolling of window resize.\n */\n updatePosition: () => void;\n\n /**\n * Sets the target and updates positioning imperatively.\n * Useful for avoiding double renders with the target option.\n */\n setTarget: (target: TargetElement | null) => void;\n};\n\nexport type PositioningVirtualElement = {\n getBoundingClientRect: () => {\n x: number;\n y: number;\n top: number;\n left: number;\n bottom: number;\n right: number;\n width: number;\n height: number;\n };\n contextElement?: Element;\n};\n\nexport type SetVirtualMouseTarget = (event: React.MouseEvent | MouseEvent | undefined | null) => void;\n\n/**\n * Internal options for positioning\n */\nexport interface PositioningOptions {\n /** Alignment for the component. Only has an effect if used with the @see position option */\n align?: Alignment;\n\n /** The element which will define the boundaries of the positioned element for the flip behavior. */\n flipBoundary?: PositioningBoundary | null;\n\n /** The element which will define the boundaries of the positioned element for the overflow behavior. */\n overflowBoundary?: PositioningBoundary | null;\n\n /**\n * Applies a padding to the overflow bounadry, so that overflow is detected earlier before the\n * positioned surface hits the overflow boundary.\n */\n overflowBoundaryPadding?: number | Partial<{ top: number; end: number; bottom: number; start: number }>;\n\n /**\n * Position for the component. Position has higher priority than align. If position is vertical ('above' | 'below')\n * and align is also vertical ('top' | 'bottom') or if both position and align are horizontal ('before' | 'after'\n * and 'start' | 'end' respectively),\n * then provided value for 'align' will be ignored and 'center' will be used instead.\n */\n position?: Position;\n\n /**\n * Enables the position element to be positioned with 'fixed' (default value is position: 'absolute')\n * @default false\n * @deprecated use `strategy` instead\n */\n positionFixed?: boolean;\n\n /**\n * Specifies the type of CSS position property to use.\n * @default absolute\n */\n strategy?: 'absolute' | 'fixed';\n\n /**\n * Lets you displace a positioned element from its reference element.\n * This can be useful if you need to apply some margin between them or if you need to fine tune the\n * position according to some custom logic.\n */\n offset?: Offset;\n\n /**\n * Defines padding between the corner of the popup element and the arrow.\n * Use to prevent the arrow from overlapping a rounded corner, for example.\n */\n arrowPadding?: number;\n\n /**\n * Applies styles on the positioned element to fit it within the available space in viewport.\n * - true: set styles for max height/width.\n * - 'height': set styles for max height.\n * - 'width'': set styles for max width.\n * Note that options 'always'/'height-always'/'width-always' are now obsolete, and equivalent to true/'height'/'width'.\n */\n autoSize?: AutoSize;\n\n /**\n * Modifies position and alignment to cover the target\n */\n coverTarget?: boolean;\n\n /**\n * Disables automatic repositioning of the component; it will always be placed according to the values of `align` and\n * `position` props, regardless of the size of the component, the reference element or the viewport.\n */\n pinned?: boolean;\n\n /**\n * When the reference element or the viewport is outside viewport allows a positioned element to be fully in viewport.\n * \"all\" enables this behavior for all axis.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether?: boolean | 'all';\n\n /**\n * If flip fails to stop the positioned element from overflowing\n * its boundaries, use a specified fallback positions.\n */\n fallbackPositions?: PositioningShorthandValue[];\n\n /**\n * Modifies whether popover is positioned using transform.\n * @default true\n */\n useTransform?: boolean;\n\n /**\n * If false, does not position anything\n */\n enabled?: boolean;\n\n /**\n * When set, the positioned element matches the chosen dimension(s) of the target element\n */\n matchTargetSize?: 'width';\n\n /**\n * Called when a position update has finished. Multiple position updates can happen in a single render,\n * since positioning happens outside of the React lifecycle.\n * The event's `detail.placement` indicates the final computed placement after middleware adjustments.\n *\n * It's also possible to listen to the custom DOM event `fui-positioningend`\n */\n onPositioningEnd?: (e: OnPositioningEndEvent) => void;\n\n /**\n * Disables the resize observer that updates position on target or dimension change\n */\n disableUpdateOnResize?: boolean;\n\n /**\n * When true, the positioned element will shift to cover the target element when there's not enough space.\n * @default false\n */\n shiftToCoverTarget?: boolean;\n}\n\n/**\n * Public api that allows components using react-positioning to specify positioning options\n */\nexport interface PositioningProps\n extends Pick<\n PositioningOptions,\n | 'align'\n | 'arrowPadding'\n | 'autoSize'\n | 'coverTarget'\n | 'fallbackPositions'\n | 'flipBoundary'\n | 'offset'\n | 'overflowBoundary'\n | 'overflowBoundaryPadding'\n | 'pinned'\n | 'position'\n | 'strategy'\n | 'useTransform'\n | 'matchTargetSize'\n | 'onPositioningEnd'\n | 'disableUpdateOnResize'\n | 'shiftToCoverTarget'\n > {\n /** An imperative handle to Popper methods. */\n positioningRef?: React.Ref<PositioningImperativeRef>;\n\n /**\n * Manual override for the target element. Useful for scenarios where a component accepts user prop to override target\n */\n target?: TargetElement | null;\n}\n\nexport type PositioningShorthandValue =\n | 'above'\n | 'above-start'\n | 'above-end'\n | 'below'\n | 'below-start'\n | 'below-end'\n | 'before'\n | 'before-top'\n | 'before-bottom'\n | 'after'\n | 'after-top'\n | 'after-bottom';\n\nexport type PositioningShorthand = PositioningProps | PositioningShorthandValue;\n\n// ---\n\nexport type PositioningConfigurationFnOptions = Omit<\n PositioningOptions,\n // Excluded as the function will never be called if disabled\n | 'enabled'\n // Callback is not subscribed from options\n | 'onPositioningEnd'\n // Is deprecated, no need to bloat the interface\n | 'positionFixed'\n>;\nexport type PositioningConfigurationFn = (params: {\n container: HTMLElement;\n arrow: HTMLElement | null;\n options: PositioningConfigurationFnOptions;\n}) => PositioningConfigurationFnOptions;\n"],"names":["React"],"mappings":"AAAA,YAAYA,WAAW,QAAQ"}
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type * as React from 'react';\n\n/**\n * Physical placement of a positioned element relative to its target, as computed by Floating UI.\n * This is a Fluent-owned equivalent of Floating UI's `Placement` type, avoiding a transitive\n * dependency on `@floating-ui/dom` in the public API surface.\n */\nexport type PositioningPlacement =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end';\n\n/**\n * Detail payload of the positioning end event, providing the final computed placement\n * after all middleware (flip, shift, etc.) have run.\n */\nexport type OnPositioningEndEventDetail = {\n /**\n * The computed placement of the positioned element. May differ from the requested\n * placement if flip or other middleware adjusted it.\n */\n placement: PositioningPlacement;\n};\n\n/**\n * Custom DOM event dispatched on the positioned container element when a\n * positioning update completes. Carries placement information in `event.detail`.\n */\nexport type OnPositioningEndEvent = CustomEvent<OnPositioningEndEventDetail>;\n\nexport type PositioningRect = {\n width: number;\n height: number;\n x: number;\n y: number;\n};\n\nexport type OffsetFunctionParam = {\n positionedRect: PositioningRect;\n targetRect: PositioningRect;\n position: Position;\n alignment?: Alignment;\n};\n\nexport type TargetElement = HTMLElement | PositioningVirtualElement;\n\n/**\n * @internal\n */\nexport interface PositionManager {\n updatePosition: () => void;\n dispose: () => void;\n}\n\nexport interface UsePositioningReturn {\n // React refs are supposed to be contravariant\n // (allows a more general type to be passed rather than a more specific one)\n // However, Typescript currently can't infer that fact for refs\n // See https://github.com/microsoft/TypeScript/issues/30748 for more information\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-deprecated\n targetRef: React.MutableRefObject<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-deprecated\n containerRef: React.MutableRefObject<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-deprecated\n arrowRef: React.MutableRefObject<any>;\n}\n\nexport type OffsetObject = { crossAxis?: number; mainAxis: number };\n\nexport type OffsetShorthand = number;\n\nexport type OffsetFunction = (param: OffsetFunctionParam) => OffsetObject | OffsetShorthand;\n\nexport type Offset = OffsetFunction | OffsetObject | OffsetShorthand;\n\nexport type Position = 'above' | 'below' | 'before' | 'after';\nexport type Alignment = 'top' | 'bottom' | 'start' | 'end' | 'center';\n\nexport type AutoSize = 'height' | 'height-always' | 'width' | 'width-always' | 'always' | boolean;\nexport type NormalizedAutoSize = { applyMaxWidth: boolean; applyMaxHeight: boolean };\n\nexport type PositioningBoundary =\n | PositioningRect\n | HTMLElement\n | Array<HTMLElement>\n | 'clippingParents'\n | 'scrollParent'\n | 'window';\n/**\n * @deprecated use PositioningBoundary instead\n */\nexport type Boundary = PositioningBoundary;\n\nexport type PositioningImperativeRef = {\n /**\n * Updates the position imperatively.\n * Useful when the position of the target changes from other factors than scrolling of window resize.\n */\n updatePosition: () => void;\n\n /**\n * Sets the target and updates positioning imperatively.\n * Useful for avoiding double renders with the target option.\n */\n setTarget: (target: TargetElement | null) => void;\n};\n\nexport type PositioningVirtualElement = {\n getBoundingClientRect: () => {\n x: number;\n y: number;\n top: number;\n left: number;\n bottom: number;\n right: number;\n width: number;\n height: number;\n };\n contextElement?: Element;\n};\n\nexport type SetVirtualMouseTarget = (event: React.MouseEvent | MouseEvent | undefined | null) => void;\n\n/**\n * Internal options for positioning\n */\nexport interface PositioningOptions {\n /** Alignment for the component. Only has an effect if used with the @see position option */\n align?: Alignment;\n\n /** The element which will define the boundaries of the positioned element for the flip behavior. */\n flipBoundary?: PositioningBoundary | null;\n\n /** The element which will define the boundaries of the positioned element for the overflow behavior. */\n overflowBoundary?: PositioningBoundary | null;\n\n /**\n * Applies a padding to the overflow bounadry, so that overflow is detected earlier before the\n * positioned surface hits the overflow boundary.\n */\n overflowBoundaryPadding?: number | Partial<{ top: number; end: number; bottom: number; start: number }>;\n\n /**\n * Position for the component. Position has higher priority than align. If position is vertical ('above' | 'below')\n * and align is also vertical ('top' | 'bottom') or if both position and align are horizontal ('before' | 'after'\n * and 'start' | 'end' respectively),\n * then provided value for 'align' will be ignored and 'center' will be used instead.\n */\n position?: Position;\n\n /**\n * Enables the position element to be positioned with 'fixed' (default value is position: 'absolute')\n * @default false\n * @deprecated use `strategy` instead\n */\n positionFixed?: boolean;\n\n /**\n * Specifies the type of CSS position property to use.\n * @default absolute\n */\n strategy?: 'absolute' | 'fixed';\n\n /**\n * Lets you displace a positioned element from its reference element.\n * This can be useful if you need to apply some margin between them or if you need to fine tune the\n * position according to some custom logic.\n */\n offset?: Offset;\n\n /**\n * Defines padding between the corner of the popup element and the arrow.\n * Use to prevent the arrow from overlapping a rounded corner, for example.\n */\n arrowPadding?: number;\n\n /**\n * Applies styles on the positioned element to fit it within the available space in viewport.\n * - true: set styles for max height/width.\n * - 'height': set styles for max height.\n * - 'width'': set styles for max width.\n * Note that options 'always'/'height-always'/'width-always' are now obsolete, and equivalent to true/'height'/'width'.\n */\n autoSize?: AutoSize;\n\n /**\n * Modifies position and alignment to cover the target\n */\n coverTarget?: boolean;\n\n /**\n * Disables automatic repositioning of the component; it will always be placed according to the values of `align` and\n * `position` props, regardless of the size of the component, the reference element or the viewport.\n */\n pinned?: boolean;\n\n /**\n * When the reference element or the viewport is outside viewport allows a positioned element to be fully in viewport.\n * \"all\" enables this behavior for all axis.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether?: boolean | 'all';\n\n /**\n * If flip fails to stop the positioned element from overflowing\n * its boundaries, use a specified fallback positions.\n */\n fallbackPositions?: PositioningShorthandValue[];\n\n /**\n * Modifies whether popover is positioned using transform.\n * @default true\n */\n useTransform?: boolean;\n\n /**\n * If false, does not position anything\n */\n enabled?: boolean;\n\n /**\n * When set, the positioned element matches the chosen dimension(s) of the target element\n */\n matchTargetSize?: 'width';\n\n /**\n * Called when a position update has finished. Multiple position updates can happen in a single render,\n * since positioning happens outside of the React lifecycle.\n * The event's `detail.placement` indicates the final computed placement after middleware adjustments.\n *\n * It's also possible to listen to the custom DOM event `fui-positioningend`\n */\n onPositioningEnd?: (e: OnPositioningEndEvent) => void;\n\n /**\n * Disables the resize observer that updates position on target or dimension change\n */\n disableUpdateOnResize?: boolean;\n\n /**\n * When true, the positioned element will shift to cover the target element when there's not enough space.\n * @default false\n */\n shiftToCoverTarget?: boolean;\n}\n\n/**\n * Public api that allows components using react-positioning to specify positioning options\n */\nexport interface PositioningProps\n extends Pick<\n PositioningOptions,\n | 'align'\n | 'arrowPadding'\n | 'autoSize'\n | 'coverTarget'\n | 'fallbackPositions'\n | 'flipBoundary'\n | 'offset'\n | 'overflowBoundary'\n | 'overflowBoundaryPadding'\n | 'pinned'\n | 'position'\n | 'strategy'\n | 'useTransform'\n | 'matchTargetSize'\n | 'onPositioningEnd'\n | 'disableUpdateOnResize'\n | 'shiftToCoverTarget'\n > {\n /** An imperative handle to Popper methods. */\n positioningRef?: React.Ref<PositioningImperativeRef>;\n\n /**\n * Manual override for the target element. Useful for scenarios where a component accepts user prop to override target\n */\n target?: TargetElement | null;\n}\n\nexport type PositioningShorthandValue =\n | 'above'\n | 'above-start'\n | 'above-end'\n | 'below'\n | 'below-start'\n | 'below-end'\n | 'before'\n | 'before-top'\n | 'before-bottom'\n | 'after'\n | 'after-top'\n | 'after-bottom';\n\nexport type PositioningShorthand = PositioningProps | PositioningShorthandValue;\n\n// ---\n\nexport type PositioningConfigurationFnOptions = Omit<\n PositioningOptions,\n // Excluded as the function will never be called if disabled\n | 'enabled'\n // Callback is not subscribed from options\n | 'onPositioningEnd'\n // Is deprecated, no need to bloat the interface\n | 'positionFixed'\n>;\nexport type PositioningConfigurationFn = (params: {\n container: HTMLElement;\n arrow: HTMLElement | null;\n options: PositioningConfigurationFnOptions;\n}) => PositioningConfigurationFnOptions;\n"],"names":[],"mappings":"AA2TA,WAIwC"}
@@ -2,11 +2,11 @@
2
2
  import * as React from 'react';
3
3
  import { createVirtualElementFromClick } from './createVirtualElementFromClick';
4
4
  /**
5
- * @internal
6
5
  * A state hook that manages a popper virtual element from mouseevents.
7
6
  * Useful for scenarios where a component needs to be positioned by mouse click (e.g. contextmenu)
8
7
  * React synthetic events are not persisted by this hook
9
8
  *
9
+ * @internal
10
10
  * @param initialState - initializes a user provided state similare to useState
11
11
  * @returns state and dispatcher for a Popper virtual element that uses native/synthetic mouse events
12
12
  */ export const usePositioningMouseTarget = (initialState)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/usePositioningMouseTarget.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createVirtualElementFromClick } from './createVirtualElementFromClick';\nimport { PositioningVirtualElement, SetVirtualMouseTarget } from './types';\n\n/**\n * @internal\n * A state hook that manages a popper virtual element from mouseevents.\n * Useful for scenarios where a component needs to be positioned by mouse click (e.g. contextmenu)\n * React synthetic events are not persisted by this hook\n *\n * @param initialState - initializes a user provided state similare to useState\n * @returns state and dispatcher for a Popper virtual element that uses native/synthetic mouse events\n */\nexport const usePositioningMouseTarget = (\n initialState?: PositioningVirtualElement | (() => PositioningVirtualElement),\n): readonly [PositioningVirtualElement | undefined, SetVirtualMouseTarget] => {\n const [virtualElement, setVirtualElement] = React.useState<PositioningVirtualElement | undefined>(initialState);\n\n const setVirtualMouseTarget: SetVirtualMouseTarget = event => {\n if (event === undefined || event === null) {\n setVirtualElement(undefined);\n return;\n }\n\n let mouseevent: MouseEvent;\n if (!(event instanceof MouseEvent)) {\n mouseevent = event.nativeEvent;\n } else {\n mouseevent = event;\n }\n\n if (!(mouseevent instanceof MouseEvent) && process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error('usePositioningMouseTarget should only be used with MouseEvent');\n }\n\n const contextTarget = createVirtualElementFromClick(mouseevent);\n setVirtualElement(contextTarget);\n };\n\n return [virtualElement, setVirtualMouseTarget] as const;\n};\n"],"names":["React","createVirtualElementFromClick","usePositioningMouseTarget","initialState","virtualElement","setVirtualElement","useState","setVirtualMouseTarget","event","undefined","mouseevent","MouseEvent","nativeEvent","process","env","NODE_ENV","console","error","contextTarget"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,6BAA6B,QAAQ,kCAAkC;AAGhF;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC;IAEA,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGL,MAAMM,QAAQ,CAAwCH;IAElG,MAAMI,wBAA+CC,CAAAA;QACnD,IAAIA,UAAUC,aAAaD,UAAU,MAAM;YACzCH,kBAAkBI;YAClB;QACF;QAEA,IAAIC;QACJ,IAAI,CAAEF,CAAAA,iBAAiBG,UAAS,GAAI;YAClCD,aAAaF,MAAMI,WAAW;QAChC,OAAO;YACLF,aAAaF;QACf;QAEA,IAAI,CAAEE,CAAAA,sBAAsBC,UAAS,KAAME,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YAChF,sCAAsC;YACtCC,QAAQC,KAAK,CAAC;QAChB;QAEA,MAAMC,gBAAgBjB,8BAA8BS;QACpDL,kBAAkBa;IACpB;IAEA,OAAO;QAACd;QAAgBG;KAAsB;AAChD,EAAE"}
1
+ {"version":3,"sources":["../src/usePositioningMouseTarget.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createVirtualElementFromClick } from './createVirtualElementFromClick';\nimport type { PositioningVirtualElement, SetVirtualMouseTarget } from './types';\n\n/**\n * A state hook that manages a popper virtual element from mouseevents.\n * Useful for scenarios where a component needs to be positioned by mouse click (e.g. contextmenu)\n * React synthetic events are not persisted by this hook\n *\n * @internal\n * @param initialState - initializes a user provided state similare to useState\n * @returns state and dispatcher for a Popper virtual element that uses native/synthetic mouse events\n */\nexport const usePositioningMouseTarget = (\n initialState?: PositioningVirtualElement | (() => PositioningVirtualElement),\n): readonly [PositioningVirtualElement | undefined, SetVirtualMouseTarget] => {\n const [virtualElement, setVirtualElement] = React.useState<PositioningVirtualElement | undefined>(initialState);\n\n const setVirtualMouseTarget: SetVirtualMouseTarget = event => {\n if (event === undefined || event === null) {\n setVirtualElement(undefined);\n return;\n }\n\n let mouseevent: MouseEvent;\n if (!(event instanceof MouseEvent)) {\n mouseevent = event.nativeEvent;\n } else {\n mouseevent = event;\n }\n\n if (!(mouseevent instanceof MouseEvent) && process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error('usePositioningMouseTarget should only be used with MouseEvent');\n }\n\n const contextTarget = createVirtualElementFromClick(mouseevent);\n setVirtualElement(contextTarget);\n };\n\n return [virtualElement, setVirtualMouseTarget] as const;\n};\n"],"names":["React","createVirtualElementFromClick","usePositioningMouseTarget","initialState","virtualElement","setVirtualElement","useState","setVirtualMouseTarget","event","undefined","mouseevent","MouseEvent","nativeEvent","process","env","NODE_ENV","console","error","contextTarget"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,6BAA6B,QAAQ,kCAAkC;AAGhF;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC;IAEA,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGL,MAAMM,QAAQ,CAAwCH;IAElG,MAAMI,wBAA+CC,CAAAA;QACnD,IAAIA,UAAUC,aAAaD,UAAU,MAAM;YACzCH,kBAAkBI;YAClB;QACF;QAEA,IAAIC;QACJ,IAAI,CAAEF,CAAAA,iBAAiBG,UAAS,GAAI;YAClCD,aAAaF,MAAMI,WAAW;QAChC,OAAO;YACLF,aAAaF;QACf;QAEA,IAAI,CAAEE,CAAAA,sBAAsBC,UAAS,KAAME,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YAChF,sCAAsC;YACtCC,QAAQC,KAAK,CAAC;QAChB;QAEA,MAAMC,gBAAgBjB,8BAA8BS;QACpDL,kBAAkBa;IACpB;IAEA,OAAO;QAACd;QAAgBG;KAAsB;AAChD,EAAE"}
@@ -8,10 +8,10 @@ import { toFloatingUIPlacement, hasScrollParent, normalizeAutoSize } from './uti
8
8
  import { devtoolsCallback } from './utils/devtools';
9
9
  import { usePositioningConfiguration } from './PositioningConfigurationContext';
10
10
  /**
11
- * @internal
12
- *
13
11
  * This is redundant and exists only to manage React dependencies properly & avoid leaking individual options to the
14
12
  * scope of `usePositioningOptions`.
13
+ *
14
+ * @internal
15
15
  */ function usePositioningConfigFn(configFn, options) {
16
16
  const { align, arrowPadding, autoSize, coverTarget, disableUpdateOnResize, flipBoundary, offset, overflowBoundary, pinned, position, // eslint-disable-next-line @typescript-eslint/naming-convention
17
17
  unstable_disableTether, strategy, overflowBoundaryPadding, fallbackPositions, useTransform, matchTargetSize, shiftToCoverTarget } = options;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/usePositioningOptions.ts"],"sourcesContent":["'use client';\n\nimport { devtools } from '@floating-ui/devtools';\nimport { hide as hideMiddleware, arrow as arrowMiddleware } from '@floating-ui/dom';\nimport type { Middleware, Placement, Strategy } from '@floating-ui/dom';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport * as React from 'react';\n\nimport {\n shift as shiftMiddleware,\n flip as flipMiddleware,\n coverTarget as coverTargetMiddleware,\n maxSize as maxSizeMiddleware,\n resetMaxSize as resetMaxSizeMiddleware,\n offset as offsetMiddleware,\n intersecting as intersectingMiddleware,\n matchTargetSize as matchTargetSizeMiddleware,\n} from './middleware';\nimport type { PositioningConfigurationFn, PositioningConfigurationFnOptions, PositioningOptions } from './types';\nimport { toFloatingUIPlacement, hasScrollParent, normalizeAutoSize } from './utils';\nimport { devtoolsCallback } from './utils/devtools';\nimport { usePositioningConfiguration } from './PositioningConfigurationContext';\n\n/**\n * @internal\n *\n * This is redundant and exists only to manage React dependencies properly & avoid leaking individual options to the\n * scope of `usePositioningOptions`.\n */\nfunction usePositioningConfigFn(\n configFn: PositioningConfigurationFn,\n options: PositioningOptions,\n): (container: HTMLElement, arrow: HTMLElement | null) => PositioningConfigurationFnOptions {\n const {\n align,\n arrowPadding,\n autoSize,\n coverTarget,\n disableUpdateOnResize,\n flipBoundary,\n offset,\n overflowBoundary,\n pinned,\n position,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether,\n strategy,\n overflowBoundaryPadding,\n fallbackPositions,\n useTransform,\n matchTargetSize,\n shiftToCoverTarget,\n } = options;\n\n return React.useCallback(\n (container: HTMLElement, arrow: HTMLElement | null) => {\n return configFn({\n container,\n arrow,\n options: {\n autoSize,\n disableUpdateOnResize,\n matchTargetSize,\n offset,\n strategy,\n coverTarget,\n flipBoundary,\n overflowBoundary,\n useTransform,\n overflowBoundaryPadding,\n pinned,\n arrowPadding,\n align,\n fallbackPositions,\n shiftToCoverTarget,\n position,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether,\n },\n });\n },\n [\n autoSize,\n disableUpdateOnResize,\n matchTargetSize,\n offset,\n strategy,\n coverTarget,\n flipBoundary,\n overflowBoundary,\n useTransform,\n overflowBoundaryPadding,\n pinned,\n arrowPadding,\n align,\n fallbackPositions,\n shiftToCoverTarget,\n position,\n unstable_disableTether,\n configFn,\n ],\n );\n}\n\n/**\n * @internal\n */\nexport function usePositioningOptions(options: PositioningOptions): (\n container: HTMLElement,\n arrow: HTMLElement | null,\n) => {\n placement: Placement | undefined;\n middleware: Middleware[];\n strategy: Strategy;\n disableUpdateOnResize?: boolean;\n useTransform?: boolean;\n} {\n const { dir, targetDocument } = useFluent();\n const isRtl = dir === 'rtl';\n\n const configFn = usePositioningConfigFn(usePositioningConfiguration(), options);\n const {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n positionFixed,\n } = options;\n\n return React.useCallback(\n (container: HTMLElement, arrow: HTMLElement | null) => {\n const hasScrollableElement = hasScrollParent(container);\n\n const optionsAfterEnhancement = configFn(container, arrow);\n const {\n autoSize,\n disableUpdateOnResize,\n matchTargetSize,\n offset,\n coverTarget,\n flipBoundary,\n overflowBoundary,\n useTransform,\n overflowBoundaryPadding,\n pinned,\n position,\n arrowPadding,\n strategy,\n align,\n fallbackPositions,\n shiftToCoverTarget,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether,\n } = optionsAfterEnhancement;\n const normalizedAutoSize = normalizeAutoSize(autoSize);\n\n const middleware = [\n normalizedAutoSize && resetMaxSizeMiddleware(normalizedAutoSize),\n matchTargetSize && matchTargetSizeMiddleware(),\n offset && offsetMiddleware(offset),\n coverTarget && coverTargetMiddleware(),\n !pinned && flipMiddleware({ container, flipBoundary, hasScrollableElement, isRtl, fallbackPositions }),\n shiftMiddleware({\n container,\n hasScrollableElement,\n overflowBoundary,\n disableTether: unstable_disableTether,\n overflowBoundaryPadding,\n isRtl,\n shiftToCoverTarget,\n }),\n normalizedAutoSize &&\n maxSizeMiddleware(normalizedAutoSize, { container, overflowBoundary, overflowBoundaryPadding, isRtl }),\n intersectingMiddleware(),\n arrow && arrowMiddleware({ element: arrow, padding: arrowPadding }),\n hideMiddleware({ strategy: 'referenceHidden' }),\n hideMiddleware({ strategy: 'escaped' }),\n process.env.NODE_ENV !== 'production' &&\n targetDocument &&\n devtools(targetDocument, devtoolsCallback(optionsAfterEnhancement)),\n ].filter(Boolean) as Middleware[];\n\n const placement = toFloatingUIPlacement(align, position, isRtl);\n\n return {\n placement,\n middleware,\n strategy: strategy ?? positionFixed ? ('fixed' as const) : ('absolute' as const),\n\n disableUpdateOnResize,\n useTransform,\n };\n },\n [configFn, isRtl, targetDocument, positionFixed],\n );\n}\n"],"names":["devtools","hide","hideMiddleware","arrow","arrowMiddleware","useFluent_unstable","useFluent","React","shift","shiftMiddleware","flip","flipMiddleware","coverTarget","coverTargetMiddleware","maxSize","maxSizeMiddleware","resetMaxSize","resetMaxSizeMiddleware","offset","offsetMiddleware","intersecting","intersectingMiddleware","matchTargetSize","matchTargetSizeMiddleware","toFloatingUIPlacement","hasScrollParent","normalizeAutoSize","devtoolsCallback","usePositioningConfiguration","usePositioningConfigFn","configFn","options","align","arrowPadding","autoSize","disableUpdateOnResize","flipBoundary","overflowBoundary","pinned","position","unstable_disableTether","strategy","overflowBoundaryPadding","fallbackPositions","useTransform","shiftToCoverTarget","useCallback","container","usePositioningOptions","dir","targetDocument","isRtl","positionFixed","hasScrollableElement","optionsAfterEnhancement","normalizedAutoSize","middleware","disableTether","element","padding","process","env","NODE_ENV","filter","Boolean","placement"],"mappings":"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"}
1
+ {"version":3,"sources":["../src/usePositioningOptions.ts"],"sourcesContent":["'use client';\n\nimport { devtools } from '@floating-ui/devtools';\nimport { hide as hideMiddleware, arrow as arrowMiddleware } from '@floating-ui/dom';\nimport type { Middleware, Placement, Strategy } from '@floating-ui/dom';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport * as React from 'react';\n\nimport {\n shift as shiftMiddleware,\n flip as flipMiddleware,\n coverTarget as coverTargetMiddleware,\n maxSize as maxSizeMiddleware,\n resetMaxSize as resetMaxSizeMiddleware,\n offset as offsetMiddleware,\n intersecting as intersectingMiddleware,\n matchTargetSize as matchTargetSizeMiddleware,\n} from './middleware';\nimport type { PositioningConfigurationFn, PositioningConfigurationFnOptions, PositioningOptions } from './types';\nimport { toFloatingUIPlacement, hasScrollParent, normalizeAutoSize } from './utils';\nimport { devtoolsCallback } from './utils/devtools';\nimport { usePositioningConfiguration } from './PositioningConfigurationContext';\n\n/**\n * This is redundant and exists only to manage React dependencies properly & avoid leaking individual options to the\n * scope of `usePositioningOptions`.\n *\n * @internal\n */\nfunction usePositioningConfigFn(\n configFn: PositioningConfigurationFn,\n options: PositioningOptions,\n): (container: HTMLElement, arrow: HTMLElement | null) => PositioningConfigurationFnOptions {\n const {\n align,\n arrowPadding,\n autoSize,\n coverTarget,\n disableUpdateOnResize,\n flipBoundary,\n offset,\n overflowBoundary,\n pinned,\n position,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether,\n strategy,\n overflowBoundaryPadding,\n fallbackPositions,\n useTransform,\n matchTargetSize,\n shiftToCoverTarget,\n } = options;\n\n return React.useCallback(\n (container: HTMLElement, arrow: HTMLElement | null) => {\n return configFn({\n container,\n arrow,\n options: {\n autoSize,\n disableUpdateOnResize,\n matchTargetSize,\n offset,\n strategy,\n coverTarget,\n flipBoundary,\n overflowBoundary,\n useTransform,\n overflowBoundaryPadding,\n pinned,\n arrowPadding,\n align,\n fallbackPositions,\n shiftToCoverTarget,\n position,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether,\n },\n });\n },\n [\n autoSize,\n disableUpdateOnResize,\n matchTargetSize,\n offset,\n strategy,\n coverTarget,\n flipBoundary,\n overflowBoundary,\n useTransform,\n overflowBoundaryPadding,\n pinned,\n arrowPadding,\n align,\n fallbackPositions,\n shiftToCoverTarget,\n position,\n unstable_disableTether,\n configFn,\n ],\n );\n}\n\n/**\n * @internal\n */\nexport function usePositioningOptions(options: PositioningOptions): (\n container: HTMLElement,\n arrow: HTMLElement | null,\n) => {\n placement: Placement | undefined;\n middleware: Middleware[];\n strategy: Strategy;\n disableUpdateOnResize?: boolean;\n useTransform?: boolean;\n} {\n const { dir, targetDocument } = useFluent();\n const isRtl = dir === 'rtl';\n\n const configFn = usePositioningConfigFn(usePositioningConfiguration(), options);\n const {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n positionFixed,\n } = options;\n\n return React.useCallback(\n (container: HTMLElement, arrow: HTMLElement | null) => {\n const hasScrollableElement = hasScrollParent(container);\n\n const optionsAfterEnhancement = configFn(container, arrow);\n const {\n autoSize,\n disableUpdateOnResize,\n matchTargetSize,\n offset,\n coverTarget,\n flipBoundary,\n overflowBoundary,\n useTransform,\n overflowBoundaryPadding,\n pinned,\n position,\n arrowPadding,\n strategy,\n align,\n fallbackPositions,\n shiftToCoverTarget,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether,\n } = optionsAfterEnhancement;\n const normalizedAutoSize = normalizeAutoSize(autoSize);\n\n const middleware = [\n normalizedAutoSize && resetMaxSizeMiddleware(normalizedAutoSize),\n matchTargetSize && matchTargetSizeMiddleware(),\n offset && offsetMiddleware(offset),\n coverTarget && coverTargetMiddleware(),\n !pinned && flipMiddleware({ container, flipBoundary, hasScrollableElement, isRtl, fallbackPositions }),\n shiftMiddleware({\n container,\n hasScrollableElement,\n overflowBoundary,\n disableTether: unstable_disableTether,\n overflowBoundaryPadding,\n isRtl,\n shiftToCoverTarget,\n }),\n normalizedAutoSize &&\n maxSizeMiddleware(normalizedAutoSize, { container, overflowBoundary, overflowBoundaryPadding, isRtl }),\n intersectingMiddleware(),\n arrow && arrowMiddleware({ element: arrow, padding: arrowPadding }),\n hideMiddleware({ strategy: 'referenceHidden' }),\n hideMiddleware({ strategy: 'escaped' }),\n process.env.NODE_ENV !== 'production' &&\n targetDocument &&\n devtools(targetDocument, devtoolsCallback(optionsAfterEnhancement)),\n ].filter(Boolean) as Middleware[];\n\n const placement = toFloatingUIPlacement(align, position, isRtl);\n\n return {\n placement,\n middleware,\n strategy: strategy ?? positionFixed ? ('fixed' as const) : ('absolute' as const),\n\n disableUpdateOnResize,\n useTransform,\n };\n },\n [configFn, isRtl, targetDocument, positionFixed],\n );\n}\n"],"names":["devtools","hide","hideMiddleware","arrow","arrowMiddleware","useFluent_unstable","useFluent","React","shift","shiftMiddleware","flip","flipMiddleware","coverTarget","coverTargetMiddleware","maxSize","maxSizeMiddleware","resetMaxSize","resetMaxSizeMiddleware","offset","offsetMiddleware","intersecting","intersectingMiddleware","matchTargetSize","matchTargetSizeMiddleware","toFloatingUIPlacement","hasScrollParent","normalizeAutoSize","devtoolsCallback","usePositioningConfiguration","usePositioningConfigFn","configFn","options","align","arrowPadding","autoSize","disableUpdateOnResize","flipBoundary","overflowBoundary","pinned","position","unstable_disableTether","strategy","overflowBoundaryPadding","fallbackPositions","useTransform","shiftToCoverTarget","useCallback","container","usePositioningOptions","dir","targetDocument","isRtl","positionFixed","hasScrollableElement","optionsAfterEnhancement","normalizedAutoSize","middleware","disableTether","element","padding","process","env","NODE_ENV","filter","Boolean","placement"],"mappings":"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"}
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  var WorkTag = /*#__PURE__*/ function(WorkTag) {
3
2
  WorkTag[WorkTag["FunctionComponent"] = 0] = "FunctionComponent";
4
3
  WorkTag[WorkTag["ClassComponent"] = 1] = "ClassComponent";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/getReactFiberFromNode.ts"],"sourcesContent":["import * as React from 'react';\n\n// ========================================================\n// react/packages/shared/ReactTypes.js\n// ========================================================\n\ntype ReactEventResponder<E, C> = {\n $$typeof: Symbol | number;\n displayName: string;\n targetEventTypes: null | string[];\n rootEventTypes: null | string[];\n getInitialState: null | ((props: Object) => Object);\n onEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onRootEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onMount: null | ((context: C, props: Object, state: Object) => void);\n onUnmount: null | ((context: C, props: Object, state: Object) => void);\n};\n\ntype ReactEventResponderInstance<E, C> = {\n fiber: Object;\n props: Object;\n responder: ReactEventResponder<E, C>;\n rootEventTypes: null | Set<string>;\n state: Object;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiberHooks.js\n// ========================================================\n\nexport type HookType =\n | 'useState'\n | 'useReducer'\n | 'useContext'\n | 'useRef'\n | 'useEffect'\n | 'useLayoutEffect'\n | 'useCallback'\n | 'useMemo'\n | 'useImperativeHandle'\n | 'useDebugValue'\n | 'useResponder';\n\ntype ReactProviderType<T> = {\n $$typeof: Symbol | number;\n _context: ReactContext<T>;\n};\n\ntype ReactContext<T> = {\n $$typeof: Symbol | number;\n Consumer: ReactContext<T>;\n Provider: ReactProviderType<T>;\n\n _calculateChangedBits: ((a: T, b: T) => number) | null;\n\n _currentValue: T;\n _currentValue2: T;\n _threadCount: number;\n\n // DEV only\n _currentRenderer?: Object | null;\n _currentRenderer2?: Object | null;\n};\n\ntype ContextDependency<T> = {\n context: ReactContext<T>;\n observedBits: number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n next: ContextDependency<any> | null;\n};\n\nenum WorkTag {\n FunctionComponent = 0,\n ClassComponent = 1,\n IndeterminateComponent = 2, // Before we know whether it is function or class\n HostRoot = 3, // Root of a host tree. Could be nested inside another node.\n HostPortal = 4, // A subtree. Could be an entry point to a different renderer.\n HostComponent = 5,\n HostText = 6,\n Fragment = 7,\n Mode = 8,\n ContextConsumer = 9,\n ContextProvider = 10,\n ForwardRef = 11,\n Profiler = 12,\n SuspenseComponent = 13,\n MemoComponent = 14,\n SimpleMemoComponent = 15,\n LazyComponent = 16,\n IncompleteClassComponent = 17,\n DehydratedFragment = 18,\n SuspenseListComponent = 19,\n FundamentalComponent = 20,\n ScopeComponent = 21,\n}\n\ntype Source = {\n fileName: string;\n lineNumber: number;\n};\n\ntype ExpirationTime = number;\n\ntype Dependencies = {\n expirationTime: ExpirationTime;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n firstContext: ContextDependency<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n responders: Map<ReactEventResponder<any, any>, ReactEventResponderInstance<any, any>> | null;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiber.js\n// ========================================================\n\n// A Fiber is work on a Component that needs to be done or was done. There can\n// be more than one per component.\n\nexport type Fiber = {\n // These first fields are conceptually members of an Instance. This used to\n // be split into a separate type and intersected with the other Fiber fields,\n // but until Flow fixes its intersection bugs, we've merged them into a\n // single type.\n\n // An Instance is shared between all versions of a component. We can easily\n // break this out into a separate object to avoid copying so much to the\n // alternate versions of the tree. We put this on a single object for now to\n // minimize the number of objects created during the initial render.\n\n // Tag identifying the type of fiber.\n tag: WorkTag;\n\n // Unique identifier of this child.\n key: null | string;\n\n // The value of element.type which is used to preserve the identity during\n // reconciliation of this child.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n elementType: any;\n\n // The resolved function/class/ associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n\n // The local state associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stateNode: any;\n\n // Conceptual aliases\n // parent : Instance -> return The parent happens to be the same as the\n // return fiber since we've merged the fiber and instance.\n\n // Remaining fields belong to Fiber\n\n // The Fiber to return to after finishing processing this one.\n // This is effectively the parent, but there can be multiple parents (two)\n // so this is only the parent of the thing we're currently processing.\n // It is conceptually the same as the return address of a stack frame.\n return: Fiber | null;\n\n // Singly Linked List Tree Structure.\n child: Fiber | null;\n sibling: Fiber | null;\n index: number;\n\n // The ref last used to attach this node.\n // I'll avoid adding an owner field for prod and model that as functions.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: React.Ref<any>;\n\n // Input is the data coming into process this fiber. Arguments. Props.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n pendingProps: any; // This type will be more specific once we overload the tag.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedProps: any; // The props used to create the output.\n\n // A queue of state updates and callbacks.\n // updateQueue: UpdateQueue<any> | null,\n\n // The state used to create the output\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedState: any;\n\n // Dependencies (contexts, events) for this fiber, if it has any\n dependencies: Dependencies | null;\n\n // // Bitfield that describes properties about the fiber and its subtree. E.g.\n // // the ConcurrentMode flag indicates whether the subtree should be async-by-\n // // default. When a fiber is created, it inherits the mode of its\n // // parent. Additional flags can be set at creation time, but after that the\n // // value should remain unchanged throughout the fiber's lifetime, particularly\n // // before its child fibers are created.\n // mode: TypeOfMode\n //\n // // Effect\n // effectTag: SideEffectTag\n\n // Singly linked list fast path to the next fiber with side-effects.\n nextEffect: Fiber | null;\n\n // The first and last fiber with side-effect within this subtree. This allows\n // us to reuse a slice of the linked list when we reuse the work done within\n // this fiber.\n firstEffect: Fiber | null;\n lastEffect: Fiber | null;\n\n // Represents a time in the future by which this work should be completed.\n // Does not include work found in its subtree.\n expirationTime: ExpirationTime;\n\n // This is used to quickly determine if a subtree has no pending changes.\n childExpirationTime: ExpirationTime;\n\n // This is a pooled version of a Fiber. Every fiber that gets updated will\n // eventually have a pair. There are cases when we can clean up pairs to save\n // memory if we need to.\n alternate: Fiber | null;\n\n // Time spent rendering this Fiber and its descendants for the current update.\n // This tells us how well the tree makes use of sCU for memoization.\n // It is reset to 0 each time we render and only updated when we don't bailout.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualDuration?: number;\n\n // If the Fiber is currently active in the \"render\" phase,\n // This marks the time at which the work began.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualStartTime?: number;\n\n // Duration of the most recent render time for this Fiber.\n // This value is not updated when we bailout for memoization purposes.\n // This field is only set when the enableProfilerTimer flag is enabled.\n selfBaseDuration?: number;\n\n // Sum of base times for all descendants of this Fiber.\n // This value bubbles up during the \"complete\" phase.\n // This field is only set when the enableProfilerTimer flag is enabled.\n treeBaseDuration?: number;\n\n // Conceptual aliases\n // workInProgress : Fiber -> alternate The alternate used for reuse happens\n // to be the same as work in progress.\n // __DEV__ only\n _debugID?: number;\n _debugSource?: Source | null;\n _debugOwner?: Fiber | null;\n _debugIsCurrentlyTiming?: boolean;\n _debugNeedsRemount?: boolean;\n\n // Used to verify that the order of hooks does not change between renders.\n _debugHookTypes?: HookType[] | null;\n};\n\nexport function getReactFiberFromNode(elm: Node | undefined): Fiber | null {\n if (!elm) {\n return null;\n }\n\n for (const k in elm) {\n // React 16 uses \"__reactInternalInstance$\" prefix\n // React 17 uses \"__reactFiber$\" prefix\n // https://github.com/facebook/react/pull/18377\n if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return elm[k];\n }\n }\n\n throw new Error('getReactFiber(): Failed to find a React Fiber on a node');\n}\n"],"names":["React","WorkTag","getReactFiberFromNode","elm","k","indexOf","Error"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAuE/B,IAAA,AAAKC,iCAAAA;;;;;;;;;;;;;;;;;;;;;;;WAAAA;EAAAA;AAsLL,OAAO,SAASC,sBAAsBC,GAAqB;IACzD,IAAI,CAACA,KAAK;QACR,OAAO;IACT;IAEA,IAAK,MAAMC,KAAKD,IAAK;QACnB,kDAAkD;QAClD,uCAAuC;QACvC,+CAA+C;QAC/C,IAAIC,EAAEC,OAAO,CAAC,gCAAgC,KAAKD,EAAEC,OAAO,CAAC,qBAAqB,GAAG;YACnF,6DAA6D;YAC7D,aAAa;YACb,OAAOF,GAAG,CAACC,EAAE;QACf;IACF;IAEA,MAAM,IAAIE,MAAM;AAClB"}
1
+ {"version":3,"sources":["../src/utils/getReactFiberFromNode.ts"],"sourcesContent":["import type * as React from 'react';\n\n// ========================================================\n// react/packages/shared/ReactTypes.js\n// ========================================================\n\ntype ReactEventResponder<E, C> = {\n $$typeof: Symbol | number;\n displayName: string;\n targetEventTypes: null | string[];\n rootEventTypes: null | string[];\n getInitialState: null | ((props: Object) => Object);\n onEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onRootEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onMount: null | ((context: C, props: Object, state: Object) => void);\n onUnmount: null | ((context: C, props: Object, state: Object) => void);\n};\n\ntype ReactEventResponderInstance<E, C> = {\n fiber: Object;\n props: Object;\n responder: ReactEventResponder<E, C>;\n rootEventTypes: null | Set<string>;\n state: Object;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiberHooks.js\n// ========================================================\n\nexport type HookType =\n | 'useState'\n | 'useReducer'\n | 'useContext'\n | 'useRef'\n | 'useEffect'\n | 'useLayoutEffect'\n | 'useCallback'\n | 'useMemo'\n | 'useImperativeHandle'\n | 'useDebugValue'\n | 'useResponder';\n\ntype ReactProviderType<T> = {\n $$typeof: Symbol | number;\n _context: ReactContext<T>;\n};\n\ntype ReactContext<T> = {\n $$typeof: Symbol | number;\n Consumer: ReactContext<T>;\n Provider: ReactProviderType<T>;\n\n _calculateChangedBits: ((a: T, b: T) => number) | null;\n\n _currentValue: T;\n _currentValue2: T;\n _threadCount: number;\n\n // DEV only\n _currentRenderer?: Object | null;\n _currentRenderer2?: Object | null;\n};\n\ntype ContextDependency<T> = {\n context: ReactContext<T>;\n observedBits: number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n next: ContextDependency<any> | null;\n};\n\nenum WorkTag {\n FunctionComponent = 0,\n ClassComponent = 1,\n IndeterminateComponent = 2, // Before we know whether it is function or class\n HostRoot = 3, // Root of a host tree. Could be nested inside another node.\n HostPortal = 4, // A subtree. Could be an entry point to a different renderer.\n HostComponent = 5,\n HostText = 6,\n Fragment = 7,\n Mode = 8,\n ContextConsumer = 9,\n ContextProvider = 10,\n ForwardRef = 11,\n Profiler = 12,\n SuspenseComponent = 13,\n MemoComponent = 14,\n SimpleMemoComponent = 15,\n LazyComponent = 16,\n IncompleteClassComponent = 17,\n DehydratedFragment = 18,\n SuspenseListComponent = 19,\n FundamentalComponent = 20,\n ScopeComponent = 21,\n}\n\ntype Source = {\n fileName: string;\n lineNumber: number;\n};\n\ntype ExpirationTime = number;\n\ntype Dependencies = {\n expirationTime: ExpirationTime;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n firstContext: ContextDependency<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n responders: Map<ReactEventResponder<any, any>, ReactEventResponderInstance<any, any>> | null;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiber.js\n// ========================================================\n\n// A Fiber is work on a Component that needs to be done or was done. There can\n// be more than one per component.\n\nexport type Fiber = {\n // These first fields are conceptually members of an Instance. This used to\n // be split into a separate type and intersected with the other Fiber fields,\n // but until Flow fixes its intersection bugs, we've merged them into a\n // single type.\n\n // An Instance is shared between all versions of a component. We can easily\n // break this out into a separate object to avoid copying so much to the\n // alternate versions of the tree. We put this on a single object for now to\n // minimize the number of objects created during the initial render.\n\n // Tag identifying the type of fiber.\n tag: WorkTag;\n\n // Unique identifier of this child.\n key: null | string;\n\n // The value of element.type which is used to preserve the identity during\n // reconciliation of this child.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n elementType: any;\n\n // The resolved function/class/ associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n\n // The local state associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stateNode: any;\n\n // Conceptual aliases\n // parent : Instance -> return The parent happens to be the same as the\n // return fiber since we've merged the fiber and instance.\n\n // Remaining fields belong to Fiber\n\n // The Fiber to return to after finishing processing this one.\n // This is effectively the parent, but there can be multiple parents (two)\n // so this is only the parent of the thing we're currently processing.\n // It is conceptually the same as the return address of a stack frame.\n return: Fiber | null;\n\n // Singly Linked List Tree Structure.\n child: Fiber | null;\n sibling: Fiber | null;\n index: number;\n\n // The ref last used to attach this node.\n // I'll avoid adding an owner field for prod and model that as functions.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: React.Ref<any>;\n\n // Input is the data coming into process this fiber. Arguments. Props.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n pendingProps: any; // This type will be more specific once we overload the tag.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedProps: any; // The props used to create the output.\n\n // A queue of state updates and callbacks.\n // updateQueue: UpdateQueue<any> | null,\n\n // The state used to create the output\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedState: any;\n\n // Dependencies (contexts, events) for this fiber, if it has any\n dependencies: Dependencies | null;\n\n // // Bitfield that describes properties about the fiber and its subtree. E.g.\n // // the ConcurrentMode flag indicates whether the subtree should be async-by-\n // // default. When a fiber is created, it inherits the mode of its\n // // parent. Additional flags can be set at creation time, but after that the\n // // value should remain unchanged throughout the fiber's lifetime, particularly\n // // before its child fibers are created.\n // mode: TypeOfMode\n //\n // // Effect\n // effectTag: SideEffectTag\n\n // Singly linked list fast path to the next fiber with side-effects.\n nextEffect: Fiber | null;\n\n // The first and last fiber with side-effect within this subtree. This allows\n // us to reuse a slice of the linked list when we reuse the work done within\n // this fiber.\n firstEffect: Fiber | null;\n lastEffect: Fiber | null;\n\n // Represents a time in the future by which this work should be completed.\n // Does not include work found in its subtree.\n expirationTime: ExpirationTime;\n\n // This is used to quickly determine if a subtree has no pending changes.\n childExpirationTime: ExpirationTime;\n\n // This is a pooled version of a Fiber. Every fiber that gets updated will\n // eventually have a pair. There are cases when we can clean up pairs to save\n // memory if we need to.\n alternate: Fiber | null;\n\n // Time spent rendering this Fiber and its descendants for the current update.\n // This tells us how well the tree makes use of sCU for memoization.\n // It is reset to 0 each time we render and only updated when we don't bailout.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualDuration?: number;\n\n // If the Fiber is currently active in the \"render\" phase,\n // This marks the time at which the work began.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualStartTime?: number;\n\n // Duration of the most recent render time for this Fiber.\n // This value is not updated when we bailout for memoization purposes.\n // This field is only set when the enableProfilerTimer flag is enabled.\n selfBaseDuration?: number;\n\n // Sum of base times for all descendants of this Fiber.\n // This value bubbles up during the \"complete\" phase.\n // This field is only set when the enableProfilerTimer flag is enabled.\n treeBaseDuration?: number;\n\n // Conceptual aliases\n // workInProgress : Fiber -> alternate The alternate used for reuse happens\n // to be the same as work in progress.\n // __DEV__ only\n _debugID?: number;\n _debugSource?: Source | null;\n _debugOwner?: Fiber | null;\n _debugIsCurrentlyTiming?: boolean;\n _debugNeedsRemount?: boolean;\n\n // Used to verify that the order of hooks does not change between renders.\n _debugHookTypes?: HookType[] | null;\n};\n\nexport function getReactFiberFromNode(elm: Node | undefined): Fiber | null {\n if (!elm) {\n return null;\n }\n\n for (const k in elm) {\n // React 16 uses \"__reactInternalInstance$\" prefix\n // React 17 uses \"__reactFiber$\" prefix\n // https://github.com/facebook/react/pull/18377\n if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return elm[k];\n }\n }\n\n throw new Error('getReactFiber(): Failed to find a React Fiber on a node');\n}\n"],"names":["WorkTag","getReactFiberFromNode","elm","k","indexOf","Error"],"mappings":"AAuEA,IAAA,AAAKA,iCAAAA;;;;;;;;;;;;;;;;;;;;;;;WAAAA;EAAAA;AAsLL,OAAO,SAASC,sBAAsBC,GAAqB;IACzD,IAAI,CAACA,KAAK;QACR,OAAO;IACT;IAEA,IAAK,MAAMC,KAAKD,IAAK;QACnB,kDAAkD;QAClD,uCAAuC;QACvC,+CAA+C;QAC/C,IAAIC,EAAEC,OAAO,CAAC,gCAAgC,KAAKD,EAAEC,OAAO,CAAC,qBAAqB,GAAG;YACnF,6DAA6D;YAC7D,aAAa;YACb,OAAOF,GAAG,CAACC,EAAE;QACf;IACF;IAEA,MAAM,IAAIE,MAAM;AAClB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/toFloatingUIPadding.ts"],"sourcesContent":["import type { SideObject } from '@floating-ui/dom';\nimport { PositioningOptions } from '../types';\n\nexport function toFloatingUIPadding(\n padding: NonNullable<PositioningOptions['overflowBoundaryPadding']>,\n isRtl: boolean,\n): number | Partial<SideObject> {\n if (typeof padding === 'number') {\n return padding;\n }\n\n const { start, end, ...verticalPadding } = padding;\n\n const paddingObject: Partial<SideObject> = verticalPadding;\n\n const left = isRtl ? 'end' : 'start';\n const right = isRtl ? 'start' : 'end';\n\n // assign properties explicitly since undefined values are actually handled by floating UI\n // TODO create floating UI issue\n if (padding[left]) {\n paddingObject.left = padding[left];\n }\n\n if (padding[right]) {\n paddingObject.right = padding[right];\n }\n\n return paddingObject;\n}\n"],"names":["toFloatingUIPadding","padding","isRtl","start","end","verticalPadding","paddingObject","left","right"],"mappings":"AAGA,OAAO,SAASA,oBACdC,OAAmE,EACnEC,KAAc;IAEd,IAAI,OAAOD,YAAY,UAAU;QAC/B,OAAOA;IACT;IAEA,MAAM,EAAEE,KAAK,EAAEC,GAAG,EAAE,GAAGC,iBAAiB,GAAGJ;IAE3C,MAAMK,gBAAqCD;IAE3C,MAAME,OAAOL,QAAQ,QAAQ;IAC7B,MAAMM,QAAQN,QAAQ,UAAU;IAEhC,0FAA0F;IAC1F,gCAAgC;IAChC,IAAID,OAAO,CAACM,KAAK,EAAE;QACjBD,cAAcC,IAAI,GAAGN,OAAO,CAACM,KAAK;IACpC;IAEA,IAAIN,OAAO,CAACO,MAAM,EAAE;QAClBF,cAAcE,KAAK,GAAGP,OAAO,CAACO,MAAM;IACtC;IAEA,OAAOF;AACT"}
1
+ {"version":3,"sources":["../src/utils/toFloatingUIPadding.ts"],"sourcesContent":["import type { SideObject } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\n\nexport function toFloatingUIPadding(\n padding: NonNullable<PositioningOptions['overflowBoundaryPadding']>,\n isRtl: boolean,\n): number | Partial<SideObject> {\n if (typeof padding === 'number') {\n return padding;\n }\n\n const { start, end, ...verticalPadding } = padding;\n\n const paddingObject: Partial<SideObject> = verticalPadding;\n\n const left = isRtl ? 'end' : 'start';\n const right = isRtl ? 'start' : 'end';\n\n // assign properties explicitly since undefined values are actually handled by floating UI\n // TODO create floating UI issue\n if (padding[left]) {\n paddingObject.left = padding[left];\n }\n\n if (padding[right]) {\n paddingObject.right = padding[right];\n }\n\n return paddingObject;\n}\n"],"names":["toFloatingUIPadding","padding","isRtl","start","end","verticalPadding","paddingObject","left","right"],"mappings":"AAGA,OAAO,SAASA,oBACdC,OAAmE,EACnEC,KAAc;IAEd,IAAI,OAAOD,YAAY,UAAU;QAC/B,OAAOA;IACT;IAEA,MAAM,EAAEE,KAAK,EAAEC,GAAG,EAAE,GAAGC,iBAAiB,GAAGJ;IAE3C,MAAMK,gBAAqCD;IAE3C,MAAME,OAAOL,QAAQ,QAAQ;IAC7B,MAAMM,QAAQN,QAAQ,UAAU;IAEhC,0FAA0F;IAC1F,gCAAgC;IAChC,IAAID,OAAO,CAACM,KAAK,EAAE;QACjBD,cAAcC,IAAI,GAAGN,OAAO,CAACM,KAAK;IACpC;IAEA,IAAIN,OAAO,CAACO,MAAM,EAAE;QAClBF,cAAcE,KAAK,GAAGP,OAAO,CAACO,MAAM;IACtC;IAEA,OAAOF;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/writeArrowUpdates.ts"],"sourcesContent":["import { MiddlewareData } from '@floating-ui/dom';\n\n/**\n * Writes all DOM element updates after position is computed\n */\nexport function writeArrowUpdates(options: { arrow: HTMLElement | null; middlewareData: MiddlewareData }): void {\n const { arrow, middlewareData } = options;\n if (!middlewareData.arrow || !arrow) {\n return;\n }\n\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n Object.assign(arrow.style, {\n left: arrowX !== null && arrowX !== undefined ? `${arrowX}px` : '',\n top: arrowY !== null && arrowY !== undefined ? `${arrowY}px` : '',\n });\n}\n"],"names":["writeArrowUpdates","options","arrow","middlewareData","x","arrowX","y","arrowY","Object","assign","style","left","undefined","top"],"mappings":"AAEA;;CAEC,GACD,OAAO,SAASA,kBAAkBC,OAAsE;IACtG,MAAM,EAAEC,KAAK,EAAEC,cAAc,EAAE,GAAGF;IAClC,IAAI,CAACE,eAAeD,KAAK,IAAI,CAACA,OAAO;QACnC;IACF;IAEA,MAAM,EAAEE,GAAGC,MAAM,EAAEC,GAAGC,MAAM,EAAE,GAAGJ,eAAeD,KAAK;IAErDM,OAAOC,MAAM,CAACP,MAAMQ,KAAK,EAAE;QACzBC,MAAMN,WAAW,QAAQA,WAAWO,YAAY,GAAGP,OAAO,EAAE,CAAC,GAAG;QAChEQ,KAAKN,WAAW,QAAQA,WAAWK,YAAY,GAAGL,OAAO,EAAE,CAAC,GAAG;IACjE;AACF"}
1
+ {"version":3,"sources":["../src/utils/writeArrowUpdates.ts"],"sourcesContent":["import type { MiddlewareData } from '@floating-ui/dom';\n\n/**\n * Writes all DOM element updates after position is computed\n */\nexport function writeArrowUpdates(options: { arrow: HTMLElement | null; middlewareData: MiddlewareData }): void {\n const { arrow, middlewareData } = options;\n if (!middlewareData.arrow || !arrow) {\n return;\n }\n\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n Object.assign(arrow.style, {\n left: arrowX !== null && arrowX !== undefined ? `${arrowX}px` : '',\n top: arrowY !== null && arrowY !== undefined ? `${arrowY}px` : '',\n });\n}\n"],"names":["writeArrowUpdates","options","arrow","middlewareData","x","arrowX","y","arrowY","Object","assign","style","left","undefined","top"],"mappings":"AAEA;;CAEC,GACD,OAAO,SAASA,kBAAkBC,OAAsE;IACtG,MAAM,EAAEC,KAAK,EAAEC,cAAc,EAAE,GAAGF;IAClC,IAAI,CAACE,eAAeD,KAAK,IAAI,CAACA,OAAO;QACnC;IACF;IAEA,MAAM,EAAEE,GAAGC,MAAM,EAAEC,GAAGC,MAAM,EAAE,GAAGJ,eAAeD,KAAK;IAErDM,OAAOC,MAAM,CAACP,MAAMQ,KAAK,EAAE;QACzBC,MAAMN,WAAW,QAAQA,WAAWO,YAAY,GAAGP,OAAO,EAAE,CAAC,GAAG;QAChEQ,KAAKN,WAAW,QAAQA,WAAWK,YAAY,GAAGL,OAAO,EAAE,CAAC,GAAG;IACjE;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/createArrowStyles.ts"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport type { GriffelStyle } from '@griffel/react';\n\n/**\n * @internal\n * Options parameter for the createArrowStyles function\n */\nexport type CreateArrowStylesOptions = {\n /**\n * The height of the arrow from the base to the tip, in px. The base width of the arrow is always twice its height.\n *\n * This can be undefined to leave out the arrow size styles. You must then add styles created by\n * createArrowHeightStyles to set the arrow's size correctly. This can be useful if the arrow can be different sizes.\n */\n arrowHeight: number | undefined;\n\n /**\n * The borderWidth of the arrow. Should be the same borderWidth as the parent element.\n *\n * @defaultvalue 1px\n */\n borderWidth?: GriffelStyle['borderBottomWidth'];\n\n /**\n * The borderStyle for the arrow. Should be the same borderStyle as the parent element.\n *\n * @defaultvalue solid\n */\n borderStyle?: GriffelStyle['borderBottomStyle'];\n\n /**\n * The borderColor of the arrow. Should be the same borderColor as the parent element.\n *\n * @defaultvalue tokens.colorTransparentStroke\n */\n borderColor?: GriffelStyle['borderBottomColor'];\n};\n\n/**\n * @internal\n * Helper that creates a makeStyles rule for an arrow element.\n * For runtime arrow size toggling simply create extra classnames to apply to the arrow element\n *\n * ```ts\n * makeStyles({\n * arrowWithSize: createArrowStyles({ arrowHeight: 6 }),\n *\n * arrowWithoutSize: createArrowStyles({ arrowHeight: undefined }),\n * mediumArrow: createArrowHeightStyles(4),\n * smallArrow: createArrowHeightStyles(2),\n * })\n * ...\n *\n * state.arrowWithSize.className = styles.arrowWithSize;\n * state.arrowWithoutSize.className = mergeClasses(\n * styles.arrowWithoutSize,\n * state.smallArrow && styles.smallArrow,\n * state.mediumArrow && styles.mediumArrow,\n * )\n * ```\n */\nexport function createArrowStyles(options: CreateArrowStylesOptions): GriffelStyle {\n const {\n arrowHeight,\n borderWidth = '1px',\n borderStyle = 'solid',\n borderColor = tokens.colorTransparentStroke,\n } = options;\n\n return {\n boxSizing: 'border-box',\n position: 'absolute',\n zIndex: -1,\n\n ...(arrowHeight && createArrowHeightStyles(arrowHeight)),\n\n backgroundColor: 'inherit',\n backgroundClip: 'content-box',\n\n borderBottomLeftRadius: `${tokens.borderRadiusSmall} /* @noflip */`,\n transform: 'rotate(var(--fui-positioning-arrow-angle)) /* @noflip */',\n\n height: 'var(--fui-positioning-arrow-height)',\n width: 'var(--fui-positioning-arrow-height)',\n\n '::before': {\n content: '\"\"',\n\n display: 'block',\n backgroundColor: 'inherit',\n margin: `-${borderWidth}`,\n width: '100%',\n height: '100%',\n\n border: `${borderWidth} ${borderStyle} ${borderColor}`,\n borderBottomLeftRadius: `${tokens.borderRadiusSmall} /* @noflip */`,\n\n clipPath: 'polygon(0% 0%, 100% 100%, 0% 100%)',\n },\n\n // Popper sets data-popper-placement on the root element, which is used to align the arrow\n ':global([data-popper-placement^=\"top\"])': {\n bottom: 'var(--fui-positioning-arrow-offset)',\n '--fui-positioning-arrow-angle': '-45deg',\n },\n ':global([data-popper-placement^=\"right\"])': {\n left: `var(--fui-positioning-arrow-offset) /* @noflip */`,\n '--fui-positioning-arrow-angle': '45deg',\n },\n ':global([data-popper-placement^=\"bottom\"])': {\n top: 'var(--fui-positioning-arrow-offset)',\n '--fui-positioning-arrow-angle': '135deg',\n },\n ':global([data-popper-placement^=\"left\"])': {\n right: `var(--fui-positioning-arrow-offset) /* @noflip */`,\n '--fui-positioning-arrow-angle': '225deg',\n },\n };\n}\n\n/**\n * @internal\n * Creates CSS styles to size the arrow created by createArrowStyles to the given height.\n *\n * Use this when you need to create classes for several different arrow sizes. If you only need a\n * constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.\n */\nexport function createArrowHeightStyles(arrowHeight: number): GriffelStyle {\n // The arrow is a square rotated 45 degrees to have its bottom and right edges form a right triangle.\n // Multiply the triangle's height by sqrt(2) to get length of its edges.\n const edgeLength = 1.414 * arrowHeight;\n\n return {\n '--fui-positioning-arrow-height': `${edgeLength}px`,\n '--fui-positioning-arrow-offset': `${(edgeLength / 2) * -1}px`,\n };\n}\n"],"names":["tokens","createArrowStyles","options","arrowHeight","borderWidth","borderStyle","borderColor","colorTransparentStroke","boxSizing","position","zIndex","createArrowHeightStyles","backgroundColor","backgroundClip","borderBottomLeftRadius","borderRadiusSmall","transform","height","width","content","display","margin","border","clipPath","bottom","left","top","right","edgeLength"],"mappings":";;;;;;;;;;;2BA+HgBW;eAAAA;;IAlEAV,iBAAAA;;;;4BA7DO,wBAAwB;AA6DxC,2BAA2BC,OAAiC;IACjE,MAAM,EACJC,WAAW,EACXC,cAAc,KAAK,EACnBC,cAAc,OAAO,EACrBC,cAAcN,kBAAAA,CAAOO,sBAAsB,EAC5C,GAAGL;IAEJ,OAAO;QACLM,WAAW;QACXC,UAAU;QACVC,QAAQ,CAAC;QAET,GAAIP,eAAeQ,wBAAwBR,YAAY;QAEvDS,iBAAiB;QACjBC,gBAAgB;QAEhBC,wBAAwB,GAAGd,kBAAAA,CAAOe,iBAAiB,CAAC,cAAc,CAAC;QACnEC,WAAW;QAEXC,QAAQ;QACRC,OAAO;QAEP,YAAY;YACVC,SAAS;YAETC,SAAS;YACTR,iBAAiB;YACjBS,QAAQ,CAAC,CAAC,EAAEjB,aAAa;YACzBc,OAAO;YACPD,QAAQ;YAERK,QAAQ,GAAGlB,YAAY,CAAC,EAAEC,YAAY,CAAC,EAAEC,aAAa;YACtDQ,wBAAwB,GAAGd,kBAAAA,CAAOe,iBAAiB,CAAC,cAAc,CAAC;YAEnEQ,UAAU;QACZ;QAEA,0FAA0F;QAC1F,2CAA2C;YACzCC,QAAQ;YACR,iCAAiC;QACnC;QACA,6CAA6C;YAC3CC,MAAM,CAAC,iDAAiD,CAAC;YACzD,iCAAiC;QACnC;QACA,8CAA8C;YAC5CC,KAAK;YACL,iCAAiC;QACnC;QACA,4CAA4C;YAC1CC,OAAO,CAAC,iDAAiD,CAAC;YAC1D,iCAAiC;QACnC;IACF;AACF;AASO,iCAAiCxB,WAAmB;IACzD,qGAAqG;IACrG,wEAAwE;IACxE,MAAMyB,aAAa,QAAQzB;IAE3B,OAAO;QACL,kCAAkC,GAAGyB,WAAW,EAAE,CAAC;QACnD,kCAAkC,GAAIA,aAAa,IAAK,CAAC,EAAE,EAAE,CAAC;IAChE;AACF"}
1
+ {"version":3,"sources":["../src/createArrowStyles.ts"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport type { GriffelStyle } from '@griffel/react';\n\n/**\n * Options parameter for the createArrowStyles function\n *\n * @internal\n */\nexport type CreateArrowStylesOptions = {\n /**\n * The height of the arrow from the base to the tip, in px. The base width of the arrow is always twice its height.\n *\n * This can be undefined to leave out the arrow size styles. You must then add styles created by\n * createArrowHeightStyles to set the arrow's size correctly. This can be useful if the arrow can be different sizes.\n */\n arrowHeight: number | undefined;\n\n /**\n * The borderWidth of the arrow. Should be the same borderWidth as the parent element.\n *\n * @defaultvalue 1px\n */\n borderWidth?: GriffelStyle['borderBottomWidth'];\n\n /**\n * The borderStyle for the arrow. Should be the same borderStyle as the parent element.\n *\n * @defaultvalue solid\n */\n borderStyle?: GriffelStyle['borderBottomStyle'];\n\n /**\n * The borderColor of the arrow. Should be the same borderColor as the parent element.\n *\n * @defaultvalue tokens.colorTransparentStroke\n */\n borderColor?: GriffelStyle['borderBottomColor'];\n};\n\n/**\n * Helper that creates a makeStyles rule for an arrow element.\n * For runtime arrow size toggling simply create extra classnames to apply to the arrow element\n *\n * ```ts\n * makeStyles({\n * arrowWithSize: createArrowStyles({ arrowHeight: 6 }),\n *\n * arrowWithoutSize: createArrowStyles({ arrowHeight: undefined }),\n * mediumArrow: createArrowHeightStyles(4),\n * smallArrow: createArrowHeightStyles(2),\n * })\n * ...\n *\n * state.arrowWithSize.className = styles.arrowWithSize;\n * state.arrowWithoutSize.className = mergeClasses(\n * styles.arrowWithoutSize,\n * state.smallArrow && styles.smallArrow,\n * state.mediumArrow && styles.mediumArrow,\n * )\n * ```\n *\n * @internal\n */\nexport function createArrowStyles(options: CreateArrowStylesOptions): GriffelStyle {\n const {\n arrowHeight,\n borderWidth = '1px',\n borderStyle = 'solid',\n borderColor = tokens.colorTransparentStroke,\n } = options;\n\n return {\n boxSizing: 'border-box',\n position: 'absolute',\n zIndex: -1,\n\n ...(arrowHeight && createArrowHeightStyles(arrowHeight)),\n\n backgroundColor: 'inherit',\n backgroundClip: 'content-box',\n\n borderBottomLeftRadius: `${tokens.borderRadiusSmall} /* @noflip */`,\n transform: 'rotate(var(--fui-positioning-arrow-angle)) /* @noflip */',\n\n height: 'var(--fui-positioning-arrow-height)',\n width: 'var(--fui-positioning-arrow-height)',\n\n '::before': {\n content: '\"\"',\n\n display: 'block',\n backgroundColor: 'inherit',\n margin: `-${borderWidth}`,\n width: '100%',\n height: '100%',\n\n border: `${borderWidth} ${borderStyle} ${borderColor}`,\n borderBottomLeftRadius: `${tokens.borderRadiusSmall} /* @noflip */`,\n\n clipPath: 'polygon(0% 0%, 100% 100%, 0% 100%)',\n },\n\n // Popper sets data-popper-placement on the root element, which is used to align the arrow\n ':global([data-popper-placement^=\"top\"])': {\n bottom: 'var(--fui-positioning-arrow-offset)',\n '--fui-positioning-arrow-angle': '-45deg',\n },\n ':global([data-popper-placement^=\"right\"])': {\n left: `var(--fui-positioning-arrow-offset) /* @noflip */`,\n '--fui-positioning-arrow-angle': '45deg',\n },\n ':global([data-popper-placement^=\"bottom\"])': {\n top: 'var(--fui-positioning-arrow-offset)',\n '--fui-positioning-arrow-angle': '135deg',\n },\n ':global([data-popper-placement^=\"left\"])': {\n right: `var(--fui-positioning-arrow-offset) /* @noflip */`,\n '--fui-positioning-arrow-angle': '225deg',\n },\n };\n}\n\n/**\n * Creates CSS styles to size the arrow created by createArrowStyles to the given height.\n *\n * Use this when you need to create classes for several different arrow sizes. If you only need a\n * constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.\n *\n * @internal\n */\nexport function createArrowHeightStyles(arrowHeight: number): GriffelStyle {\n // The arrow is a square rotated 45 degrees to have its bottom and right edges form a right triangle.\n // Multiply the triangle's height by sqrt(2) to get length of its edges.\n const edgeLength = 1.414 * arrowHeight;\n\n return {\n '--fui-positioning-arrow-height': `${edgeLength}px`,\n '--fui-positioning-arrow-offset': `${(edgeLength / 2) * -1}px`,\n };\n}\n"],"names":["tokens","createArrowStyles","options","arrowHeight","borderWidth","borderStyle","borderColor","colorTransparentStroke","boxSizing","position","zIndex","createArrowHeightStyles","backgroundColor","backgroundClip","borderBottomLeftRadius","borderRadiusSmall","transform","height","width","content","display","margin","border","clipPath","bottom","left","top","right","edgeLength"],"mappings":";;;;;;;;;;;2BAkIgBW;eAAAA;;IAnEAV,iBAAAA;;;;4BA/DO,wBAAwB;AA+DxC,2BAA2BC,OAAiC;IACjE,MAAM,EACJC,WAAW,EACXC,cAAc,KAAK,EACnBC,cAAc,OAAO,EACrBC,cAAcN,kBAAAA,CAAOO,sBAAsB,EAC5C,GAAGL;IAEJ,OAAO;QACLM,WAAW;QACXC,UAAU;QACVC,QAAQ,CAAC;QAET,GAAIP,eAAeQ,wBAAwBR,YAAY;QAEvDS,iBAAiB;QACjBC,gBAAgB;QAEhBC,wBAAwB,GAAGd,kBAAAA,CAAOe,iBAAiB,CAAC,cAAc,CAAC;QACnEC,WAAW;QAEXC,QAAQ;QACRC,OAAO;QAEP,YAAY;YACVC,SAAS;YAETC,SAAS;YACTR,iBAAiB;YACjBS,QAAQ,CAAC,CAAC,EAAEjB,aAAa;YACzBc,OAAO;YACPD,QAAQ;YAERK,QAAQ,GAAGlB,YAAY,CAAC,EAAEC,YAAY,CAAC,EAAEC,aAAa;YACtDQ,wBAAwB,GAAGd,kBAAAA,CAAOe,iBAAiB,CAAC,cAAc,CAAC;YAEnEQ,UAAU;QACZ;QAEA,0FAA0F;QAC1F,2CAA2C;YACzCC,QAAQ;YACR,iCAAiC;QACnC;QACA,6CAA6C;YAC3CC,MAAM,CAAC,iDAAiD,CAAC;YACzD,iCAAiC;QACnC;QACA,8CAA8C;YAC5CC,KAAK;YACL,iCAAiC;QACnC;QACA,4CAA4C;YAC1CC,OAAO,CAAC,iDAAiD,CAAC;YAC1D,iCAAiC;QACnC;IACF;AACF;AAUO,iCAAiCxB,WAAmB;IACzD,qGAAqG;IACrG,wEAAwE;IACxE,MAAMyB,aAAa,QAAQzB;IAE3B,OAAO;QACL,kCAAkC,GAAGyB,WAAW,EAAE,CAAC;QACnD,kCAAkC,GAAIA,aAAa,IAAK,CAAC,EAAE,EAAE,CAAC;IAChE;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/middleware/flip.ts"],"sourcesContent":["import { flip as baseFlip, Placement, Middleware } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary, resolvePositioningShorthand, toFloatingUIPlacement } from '../utils/index';\n\nexport interface FlipMiddlewareOptions extends Pick<PositioningOptions, 'flipBoundary' | 'fallbackPositions'> {\n hasScrollableElement?: boolean;\n container: HTMLElement | null;\n isRtl?: boolean;\n}\n\nexport function flip(options: FlipMiddlewareOptions): Middleware {\n const { hasScrollableElement, flipBoundary, container, fallbackPositions = [], isRtl } = options;\n\n const fallbackPlacements = fallbackPositions.reduce<Placement[]>((acc, shorthand) => {\n const { position, align } = resolvePositioningShorthand(shorthand);\n const placement = toFloatingUIPlacement(align, position, isRtl);\n if (placement) {\n acc.push(placement);\n }\n return acc;\n }, []);\n\n return baseFlip({\n ...(hasScrollableElement && { boundary: 'clippingAncestors' }),\n ...(flipBoundary && { altBoundary: true, boundary: getBoundary(container, flipBoundary) }),\n fallbackStrategy: 'bestFit',\n ...(fallbackPlacements.length && { fallbackPlacements }),\n });\n}\n"],"names":["flip","baseFlip","getBoundary","resolvePositioningShorthand","toFloatingUIPlacement","options","hasScrollableElement","flipBoundary","container","fallbackPositions","isRtl","fallbackPlacements","reduce","acc","shorthand","position","align","placement","push","boundary","altBoundary","fallbackStrategy","length"],"mappings":";;;;+BAUgBA;;;;;;qBAVwC,mBAAmB;uBAEK,iBAAiB;AAQ1F,cAAcK,OAA8B;IACjD,MAAM,EAAEC,oBAAoB,EAAEC,YAAY,EAAEC,SAAS,EAAEC,oBAAoB,EAAE,EAAEC,KAAK,EAAE,GAAGL;IAEzF,MAAMM,qBAAqBF,kBAAkBG,MAAM,CAAc,CAACC,KAAKC;QACrE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,OAAGb,kCAAAA,EAA4BW;QACxD,MAAMG,gBAAYb,4BAAAA,EAAsBY,OAAOD,UAAUL;QACzD,IAAIO,WAAW;YACbJ,IAAIK,IAAI,CAACD;QACX;QACA,OAAOJ;IACT,GAAG,EAAE;IAEL,WAAOZ,SAAAA,EAAS;QACd,GAAIK,wBAAwB;YAAEa,UAAU;QAAoB,CAAC;QAC7D,GAAIZ,gBAAgB;YAAEa,aAAa;YAAMD,cAAUjB,kBAAAA,EAAYM,WAAWD;QAAc,CAAC;QACzFc,kBAAkB;QAClB,GAAIV,mBAAmBW,MAAM,IAAI;YAAEX;QAAmB,CAAC;IACzD;AACF"}
1
+ {"version":3,"sources":["../src/middleware/flip.ts"],"sourcesContent":["import type { Placement, Middleware } from '@floating-ui/dom';\nimport { flip as baseFlip } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary, resolvePositioningShorthand, toFloatingUIPlacement } from '../utils/index';\n\nexport interface FlipMiddlewareOptions extends Pick<PositioningOptions, 'flipBoundary' | 'fallbackPositions'> {\n hasScrollableElement?: boolean;\n container: HTMLElement | null;\n isRtl?: boolean;\n}\n\nexport function flip(options: FlipMiddlewareOptions): Middleware {\n const { hasScrollableElement, flipBoundary, container, fallbackPositions = [], isRtl } = options;\n\n const fallbackPlacements = fallbackPositions.reduce<Placement[]>((acc, shorthand) => {\n const { position, align } = resolvePositioningShorthand(shorthand);\n const placement = toFloatingUIPlacement(align, position, isRtl);\n if (placement) {\n acc.push(placement);\n }\n return acc;\n }, []);\n\n return baseFlip({\n ...(hasScrollableElement && { boundary: 'clippingAncestors' }),\n ...(flipBoundary && { altBoundary: true, boundary: getBoundary(container, flipBoundary) }),\n fallbackStrategy: 'bestFit',\n ...(fallbackPlacements.length && { fallbackPlacements }),\n });\n}\n"],"names":["flip","baseFlip","getBoundary","resolvePositioningShorthand","toFloatingUIPlacement","options","hasScrollableElement","flipBoundary","container","fallbackPositions","isRtl","fallbackPlacements","reduce","acc","shorthand","position","align","placement","push","boundary","altBoundary","fallbackStrategy","length"],"mappings":";;;;+BAWgBA;;;;;;qBAViB,mBAAmB;uBAE4B,iBAAiB;AAQ1F,cAAcK,OAA8B;IACjD,MAAM,EAAEC,oBAAoB,EAAEC,YAAY,EAAEC,SAAS,EAAEC,oBAAoB,EAAE,EAAEC,KAAK,EAAE,GAAGL;IAEzF,MAAMM,qBAAqBF,kBAAkBG,MAAM,CAAc,CAACC,KAAKC;QACrE,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAE,OAAGb,kCAAAA,EAA4BW;QACxD,MAAMG,gBAAYb,4BAAAA,EAAsBY,OAAOD,UAAUL;QACzD,IAAIO,WAAW;YACbJ,IAAIK,IAAI,CAACD;QACX;QACA,OAAOJ;IACT,GAAG,EAAE;IAEL,WAAOZ,SAAAA,EAAS;QACd,GAAIK,wBAAwB;YAAEa,UAAU;QAAoB,CAAC;QAC7D,GAAIZ,gBAAgB;YAAEa,aAAa;YAAMD,cAAUjB,kBAAAA,EAAYM,WAAWD;QAAc,CAAC;QACzFc,kBAAkB;QAClB,GAAIV,mBAAmBW,MAAM,IAAI;YAAEX;QAAmB,CAAC;IACzD;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/middleware/offset.ts"],"sourcesContent":["import { offset as baseOffset, Middleware } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getFloatingUIOffset } from '../utils/getFloatingUIOffset';\n\n/**\n * Wraps floating UI offset middleware to transform offset value.\n */\nexport function offset(offsetValue: PositioningOptions['offset']): Middleware {\n const floatingUIOffset = getFloatingUIOffset(offsetValue);\n return baseOffset(floatingUIOffset);\n}\n"],"names":["offset","baseOffset","getFloatingUIOffset","offsetValue","floatingUIOffset"],"mappings":";;;;;;;;;;qBAAiD,mBAAmB;qCAEhC,+BAA+B;AAK5D,SAASA,OAAOG,WAAyC;IAC9D,MAAMC,uBAAmBF,wCAAAA,EAAoBC;IAC7C,WAAOF,WAAAA,EAAWG;AACpB"}
1
+ {"version":3,"sources":["../src/middleware/offset.ts"],"sourcesContent":["import type { Middleware } from '@floating-ui/dom';\nimport { offset as baseOffset } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getFloatingUIOffset } from '../utils/getFloatingUIOffset';\n\n/**\n * Wraps floating UI offset middleware to transform offset value.\n */\nexport function offset(offsetValue: PositioningOptions['offset']): Middleware {\n const floatingUIOffset = getFloatingUIOffset(offsetValue);\n return baseOffset(floatingUIOffset);\n}\n"],"names":["offset","baseOffset","getFloatingUIOffset","offsetValue","floatingUIOffset"],"mappings":";;;;;;;;;;qBACqC,mBAAmB;qCAEpB,+BAA+B;AAK5D,SAASA,OAAOG,WAAyC;IAC9D,MAAMC,uBAAmBF,wCAAAA,EAAoBC;IAC7C,WAAOF,WAAAA,EAAWG;AACpB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/middleware/shift.ts"],"sourcesContent":["import { shift as baseShift, limitShift, Middleware } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary, toFloatingUIPadding } from '../utils/index';\n\nexport interface ShiftMiddlewareOptions\n extends Pick<PositioningOptions, 'overflowBoundary' | 'overflowBoundaryPadding' | 'shiftToCoverTarget'> {\n hasScrollableElement?: boolean;\n disableTether?: PositioningOptions['unstable_disableTether'];\n container: HTMLElement | null;\n isRtl: boolean;\n}\n\n/**\n * Wraps the floating UI shift middleware for easier usage of our options\n */\nexport function shift(options: ShiftMiddlewareOptions): Middleware {\n const {\n hasScrollableElement,\n shiftToCoverTarget,\n disableTether,\n overflowBoundary,\n container,\n overflowBoundaryPadding,\n isRtl,\n } = options;\n\n return baseShift({\n ...(hasScrollableElement && { boundary: 'clippingAncestors' }),\n ...(shiftToCoverTarget && {\n crossAxis: true,\n limiter: limitShift({ crossAxis: true, mainAxis: false }),\n }),\n ...(disableTether && {\n crossAxis: disableTether === 'all',\n limiter: limitShift({ crossAxis: disableTether !== 'all', mainAxis: false }),\n }),\n ...(overflowBoundaryPadding && { padding: toFloatingUIPadding(overflowBoundaryPadding, isRtl) }),\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n });\n}\n"],"names":["shift","baseShift","limitShift","getBoundary","toFloatingUIPadding","options","hasScrollableElement","shiftToCoverTarget","disableTether","overflowBoundary","container","overflowBoundaryPadding","isRtl","boundary","crossAxis","limiter","mainAxis","padding","altBoundary"],"mappings":";;;;+BAegBA;;;;;;qBAf2C,mBAAmB;uBAE7B,iBAAiB;AAa3D,eAAeK,OAA+B;IACnD,MAAM,EACJC,oBAAoB,EACpBC,kBAAkB,EAClBC,aAAa,EACbC,gBAAgB,EAChBC,SAAS,EACTC,uBAAuB,EACvBC,KAAK,EACN,GAAGP;IAEJ,WAAOJ,UAAAA,EAAU;QACf,GAAIK,wBAAwB;YAAEO,UAAU;QAAoB,CAAC;QAC7D,GAAIN,sBAAsB;YACxBO,WAAW;YACXC,aAASb,eAAAA,EAAW;gBAAEY,WAAW;gBAAME,UAAU;YAAM;QACzD,CAAC;QACD,GAAIR,iBAAiB;YACnBM,WAAWN,kBAAkB;YAC7BO,aAASb,eAAAA,EAAW;gBAAEY,WAAWN,kBAAkB;gBAAOQ,UAAU;YAAM;QAC5E,CAAC;QACD,GAAIL,2BAA2B;YAAEM,aAASb,0BAAAA,EAAoBO,yBAAyBC;QAAO,CAAC;QAC/F,GAAIH,oBAAoB;YAAES,aAAa;YAAML,cAAUV,kBAAAA,EAAYO,WAAWD;QAAkB,CAAC;IACnG;AACF"}
1
+ {"version":3,"sources":["../src/middleware/shift.ts"],"sourcesContent":["import type { Middleware } from '@floating-ui/dom';\nimport { shift as baseShift, limitShift } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary, toFloatingUIPadding } from '../utils/index';\n\nexport interface ShiftMiddlewareOptions\n extends Pick<PositioningOptions, 'overflowBoundary' | 'overflowBoundaryPadding' | 'shiftToCoverTarget'> {\n hasScrollableElement?: boolean;\n disableTether?: PositioningOptions['unstable_disableTether'];\n container: HTMLElement | null;\n isRtl: boolean;\n}\n\n/**\n * Wraps the floating UI shift middleware for easier usage of our options\n */\nexport function shift(options: ShiftMiddlewareOptions): Middleware {\n const {\n hasScrollableElement,\n shiftToCoverTarget,\n disableTether,\n overflowBoundary,\n container,\n overflowBoundaryPadding,\n isRtl,\n } = options;\n\n return baseShift({\n ...(hasScrollableElement && { boundary: 'clippingAncestors' }),\n ...(shiftToCoverTarget && {\n crossAxis: true,\n limiter: limitShift({ crossAxis: true, mainAxis: false }),\n }),\n ...(disableTether && {\n crossAxis: disableTether === 'all',\n limiter: limitShift({ crossAxis: disableTether !== 'all', mainAxis: false }),\n }),\n ...(overflowBoundaryPadding && { padding: toFloatingUIPadding(overflowBoundaryPadding, isRtl) }),\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n });\n}\n"],"names":["shift","baseShift","limitShift","getBoundary","toFloatingUIPadding","options","hasScrollableElement","shiftToCoverTarget","disableTether","overflowBoundary","container","overflowBoundaryPadding","isRtl","boundary","crossAxis","limiter","mainAxis","padding","altBoundary"],"mappings":";;;;+BAgBgBA;;;;;;qBAf+B,mBAAmB;uBAEjB,iBAAiB;AAa3D,eAAeK,OAA+B;IACnD,MAAM,EACJC,oBAAoB,EACpBC,kBAAkB,EAClBC,aAAa,EACbC,gBAAgB,EAChBC,SAAS,EACTC,uBAAuB,EACvBC,KAAK,EACN,GAAGP;IAEJ,WAAOJ,UAAAA,EAAU;QACf,GAAIK,wBAAwB;YAAEO,UAAU;QAAoB,CAAC;QAC7D,GAAIN,sBAAsB;YACxBO,WAAW;YACXC,aAASb,eAAAA,EAAW;gBAAEY,WAAW;gBAAME,UAAU;YAAM;QACzD,CAAC;QACD,GAAIR,iBAAiB;YACnBM,WAAWN,kBAAkB;YAC7BO,aAASb,eAAAA,EAAW;gBAAEY,WAAWN,kBAAkB;gBAAOQ,UAAU;YAAM;QAC5E,CAAC;QACD,GAAIL,2BAA2B;YAAEM,aAASb,0BAAAA,EAAoBO,yBAAyBC;QAAO,CAAC;QAC/F,GAAIH,oBAAoB;YAAES,aAAa;YAAML,cAAUV,kBAAAA,EAAYO,WAAWD;QAAkB,CAAC;IACnG;AACF"}
@@ -2,5 +2,3 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
6
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * Physical placement of a positioned element relative to its target, as computed by Floating UI.\n * This is a Fluent-owned equivalent of Floating UI's `Placement` type, avoiding a transitive\n * dependency on `@floating-ui/dom` in the public API surface.\n */\nexport type PositioningPlacement =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end';\n\n/**\n * Detail payload of the positioning end event, providing the final computed placement\n * after all middleware (flip, shift, etc.) have run.\n */\nexport type OnPositioningEndEventDetail = {\n /**\n * The computed placement of the positioned element. May differ from the requested\n * placement if flip or other middleware adjusted it.\n */\n placement: PositioningPlacement;\n};\n\n/**\n * Custom DOM event dispatched on the positioned container element when a\n * positioning update completes. Carries placement information in `event.detail`.\n */\nexport type OnPositioningEndEvent = CustomEvent<OnPositioningEndEventDetail>;\n\nexport type PositioningRect = {\n width: number;\n height: number;\n x: number;\n y: number;\n};\n\nexport type OffsetFunctionParam = {\n positionedRect: PositioningRect;\n targetRect: PositioningRect;\n position: Position;\n alignment?: Alignment;\n};\n\nexport type TargetElement = HTMLElement | PositioningVirtualElement;\n\n/**\n * @internal\n */\nexport interface PositionManager {\n updatePosition: () => void;\n dispose: () => void;\n}\n\nexport interface UsePositioningReturn {\n // React refs are supposed to be contravariant\n // (allows a more general type to be passed rather than a more specific one)\n // However, Typescript currently can't infer that fact for refs\n // See https://github.com/microsoft/TypeScript/issues/30748 for more information\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-deprecated\n targetRef: React.MutableRefObject<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-deprecated\n containerRef: React.MutableRefObject<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-deprecated\n arrowRef: React.MutableRefObject<any>;\n}\n\nexport type OffsetObject = { crossAxis?: number; mainAxis: number };\n\nexport type OffsetShorthand = number;\n\nexport type OffsetFunction = (param: OffsetFunctionParam) => OffsetObject | OffsetShorthand;\n\nexport type Offset = OffsetFunction | OffsetObject | OffsetShorthand;\n\nexport type Position = 'above' | 'below' | 'before' | 'after';\nexport type Alignment = 'top' | 'bottom' | 'start' | 'end' | 'center';\n\nexport type AutoSize = 'height' | 'height-always' | 'width' | 'width-always' | 'always' | boolean;\nexport type NormalizedAutoSize = { applyMaxWidth: boolean; applyMaxHeight: boolean };\n\nexport type PositioningBoundary =\n | PositioningRect\n | HTMLElement\n | Array<HTMLElement>\n | 'clippingParents'\n | 'scrollParent'\n | 'window';\n/**\n * @deprecated use PositioningBoundary instead\n */\nexport type Boundary = PositioningBoundary;\n\nexport type PositioningImperativeRef = {\n /**\n * Updates the position imperatively.\n * Useful when the position of the target changes from other factors than scrolling of window resize.\n */\n updatePosition: () => void;\n\n /**\n * Sets the target and updates positioning imperatively.\n * Useful for avoiding double renders with the target option.\n */\n setTarget: (target: TargetElement | null) => void;\n};\n\nexport type PositioningVirtualElement = {\n getBoundingClientRect: () => {\n x: number;\n y: number;\n top: number;\n left: number;\n bottom: number;\n right: number;\n width: number;\n height: number;\n };\n contextElement?: Element;\n};\n\nexport type SetVirtualMouseTarget = (event: React.MouseEvent | MouseEvent | undefined | null) => void;\n\n/**\n * Internal options for positioning\n */\nexport interface PositioningOptions {\n /** Alignment for the component. Only has an effect if used with the @see position option */\n align?: Alignment;\n\n /** The element which will define the boundaries of the positioned element for the flip behavior. */\n flipBoundary?: PositioningBoundary | null;\n\n /** The element which will define the boundaries of the positioned element for the overflow behavior. */\n overflowBoundary?: PositioningBoundary | null;\n\n /**\n * Applies a padding to the overflow bounadry, so that overflow is detected earlier before the\n * positioned surface hits the overflow boundary.\n */\n overflowBoundaryPadding?: number | Partial<{ top: number; end: number; bottom: number; start: number }>;\n\n /**\n * Position for the component. Position has higher priority than align. If position is vertical ('above' | 'below')\n * and align is also vertical ('top' | 'bottom') or if both position and align are horizontal ('before' | 'after'\n * and 'start' | 'end' respectively),\n * then provided value for 'align' will be ignored and 'center' will be used instead.\n */\n position?: Position;\n\n /**\n * Enables the position element to be positioned with 'fixed' (default value is position: 'absolute')\n * @default false\n * @deprecated use `strategy` instead\n */\n positionFixed?: boolean;\n\n /**\n * Specifies the type of CSS position property to use.\n * @default absolute\n */\n strategy?: 'absolute' | 'fixed';\n\n /**\n * Lets you displace a positioned element from its reference element.\n * This can be useful if you need to apply some margin between them or if you need to fine tune the\n * position according to some custom logic.\n */\n offset?: Offset;\n\n /**\n * Defines padding between the corner of the popup element and the arrow.\n * Use to prevent the arrow from overlapping a rounded corner, for example.\n */\n arrowPadding?: number;\n\n /**\n * Applies styles on the positioned element to fit it within the available space in viewport.\n * - true: set styles for max height/width.\n * - 'height': set styles for max height.\n * - 'width'': set styles for max width.\n * Note that options 'always'/'height-always'/'width-always' are now obsolete, and equivalent to true/'height'/'width'.\n */\n autoSize?: AutoSize;\n\n /**\n * Modifies position and alignment to cover the target\n */\n coverTarget?: boolean;\n\n /**\n * Disables automatic repositioning of the component; it will always be placed according to the values of `align` and\n * `position` props, regardless of the size of the component, the reference element or the viewport.\n */\n pinned?: boolean;\n\n /**\n * When the reference element or the viewport is outside viewport allows a positioned element to be fully in viewport.\n * \"all\" enables this behavior for all axis.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether?: boolean | 'all';\n\n /**\n * If flip fails to stop the positioned element from overflowing\n * its boundaries, use a specified fallback positions.\n */\n fallbackPositions?: PositioningShorthandValue[];\n\n /**\n * Modifies whether popover is positioned using transform.\n * @default true\n */\n useTransform?: boolean;\n\n /**\n * If false, does not position anything\n */\n enabled?: boolean;\n\n /**\n * When set, the positioned element matches the chosen dimension(s) of the target element\n */\n matchTargetSize?: 'width';\n\n /**\n * Called when a position update has finished. Multiple position updates can happen in a single render,\n * since positioning happens outside of the React lifecycle.\n * The event's `detail.placement` indicates the final computed placement after middleware adjustments.\n *\n * It's also possible to listen to the custom DOM event `fui-positioningend`\n */\n onPositioningEnd?: (e: OnPositioningEndEvent) => void;\n\n /**\n * Disables the resize observer that updates position on target or dimension change\n */\n disableUpdateOnResize?: boolean;\n\n /**\n * When true, the positioned element will shift to cover the target element when there's not enough space.\n * @default false\n */\n shiftToCoverTarget?: boolean;\n}\n\n/**\n * Public api that allows components using react-positioning to specify positioning options\n */\nexport interface PositioningProps\n extends Pick<\n PositioningOptions,\n | 'align'\n | 'arrowPadding'\n | 'autoSize'\n | 'coverTarget'\n | 'fallbackPositions'\n | 'flipBoundary'\n | 'offset'\n | 'overflowBoundary'\n | 'overflowBoundaryPadding'\n | 'pinned'\n | 'position'\n | 'strategy'\n | 'useTransform'\n | 'matchTargetSize'\n | 'onPositioningEnd'\n | 'disableUpdateOnResize'\n | 'shiftToCoverTarget'\n > {\n /** An imperative handle to Popper methods. */\n positioningRef?: React.Ref<PositioningImperativeRef>;\n\n /**\n * Manual override for the target element. Useful for scenarios where a component accepts user prop to override target\n */\n target?: TargetElement | null;\n}\n\nexport type PositioningShorthandValue =\n | 'above'\n | 'above-start'\n | 'above-end'\n | 'below'\n | 'below-start'\n | 'below-end'\n | 'before'\n | 'before-top'\n | 'before-bottom'\n | 'after'\n | 'after-top'\n | 'after-bottom';\n\nexport type PositioningShorthand = PositioningProps | PositioningShorthandValue;\n\n// ---\n\nexport type PositioningConfigurationFnOptions = Omit<\n PositioningOptions,\n // Excluded as the function will never be called if disabled\n | 'enabled'\n // Callback is not subscribed from options\n | 'onPositioningEnd'\n // Is deprecated, no need to bloat the interface\n | 'positionFixed'\n>;\nexport type PositioningConfigurationFn = (params: {\n container: HTMLElement;\n arrow: HTMLElement | null;\n options: PositioningConfigurationFnOptions;\n}) => PositioningConfigurationFnOptions;\n"],"names":["React"],"mappings":";;;;;iEAAuB,QAAQ"}
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type * as React from 'react';\n\n/**\n * Physical placement of a positioned element relative to its target, as computed by Floating UI.\n * This is a Fluent-owned equivalent of Floating UI's `Placement` type, avoiding a transitive\n * dependency on `@floating-ui/dom` in the public API surface.\n */\nexport type PositioningPlacement =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end';\n\n/**\n * Detail payload of the positioning end event, providing the final computed placement\n * after all middleware (flip, shift, etc.) have run.\n */\nexport type OnPositioningEndEventDetail = {\n /**\n * The computed placement of the positioned element. May differ from the requested\n * placement if flip or other middleware adjusted it.\n */\n placement: PositioningPlacement;\n};\n\n/**\n * Custom DOM event dispatched on the positioned container element when a\n * positioning update completes. Carries placement information in `event.detail`.\n */\nexport type OnPositioningEndEvent = CustomEvent<OnPositioningEndEventDetail>;\n\nexport type PositioningRect = {\n width: number;\n height: number;\n x: number;\n y: number;\n};\n\nexport type OffsetFunctionParam = {\n positionedRect: PositioningRect;\n targetRect: PositioningRect;\n position: Position;\n alignment?: Alignment;\n};\n\nexport type TargetElement = HTMLElement | PositioningVirtualElement;\n\n/**\n * @internal\n */\nexport interface PositionManager {\n updatePosition: () => void;\n dispose: () => void;\n}\n\nexport interface UsePositioningReturn {\n // React refs are supposed to be contravariant\n // (allows a more general type to be passed rather than a more specific one)\n // However, Typescript currently can't infer that fact for refs\n // See https://github.com/microsoft/TypeScript/issues/30748 for more information\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-deprecated\n targetRef: React.MutableRefObject<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-deprecated\n containerRef: React.MutableRefObject<any>;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-deprecated\n arrowRef: React.MutableRefObject<any>;\n}\n\nexport type OffsetObject = { crossAxis?: number; mainAxis: number };\n\nexport type OffsetShorthand = number;\n\nexport type OffsetFunction = (param: OffsetFunctionParam) => OffsetObject | OffsetShorthand;\n\nexport type Offset = OffsetFunction | OffsetObject | OffsetShorthand;\n\nexport type Position = 'above' | 'below' | 'before' | 'after';\nexport type Alignment = 'top' | 'bottom' | 'start' | 'end' | 'center';\n\nexport type AutoSize = 'height' | 'height-always' | 'width' | 'width-always' | 'always' | boolean;\nexport type NormalizedAutoSize = { applyMaxWidth: boolean; applyMaxHeight: boolean };\n\nexport type PositioningBoundary =\n | PositioningRect\n | HTMLElement\n | Array<HTMLElement>\n | 'clippingParents'\n | 'scrollParent'\n | 'window';\n/**\n * @deprecated use PositioningBoundary instead\n */\nexport type Boundary = PositioningBoundary;\n\nexport type PositioningImperativeRef = {\n /**\n * Updates the position imperatively.\n * Useful when the position of the target changes from other factors than scrolling of window resize.\n */\n updatePosition: () => void;\n\n /**\n * Sets the target and updates positioning imperatively.\n * Useful for avoiding double renders with the target option.\n */\n setTarget: (target: TargetElement | null) => void;\n};\n\nexport type PositioningVirtualElement = {\n getBoundingClientRect: () => {\n x: number;\n y: number;\n top: number;\n left: number;\n bottom: number;\n right: number;\n width: number;\n height: number;\n };\n contextElement?: Element;\n};\n\nexport type SetVirtualMouseTarget = (event: React.MouseEvent | MouseEvent | undefined | null) => void;\n\n/**\n * Internal options for positioning\n */\nexport interface PositioningOptions {\n /** Alignment for the component. Only has an effect if used with the @see position option */\n align?: Alignment;\n\n /** The element which will define the boundaries of the positioned element for the flip behavior. */\n flipBoundary?: PositioningBoundary | null;\n\n /** The element which will define the boundaries of the positioned element for the overflow behavior. */\n overflowBoundary?: PositioningBoundary | null;\n\n /**\n * Applies a padding to the overflow bounadry, so that overflow is detected earlier before the\n * positioned surface hits the overflow boundary.\n */\n overflowBoundaryPadding?: number | Partial<{ top: number; end: number; bottom: number; start: number }>;\n\n /**\n * Position for the component. Position has higher priority than align. If position is vertical ('above' | 'below')\n * and align is also vertical ('top' | 'bottom') or if both position and align are horizontal ('before' | 'after'\n * and 'start' | 'end' respectively),\n * then provided value for 'align' will be ignored and 'center' will be used instead.\n */\n position?: Position;\n\n /**\n * Enables the position element to be positioned with 'fixed' (default value is position: 'absolute')\n * @default false\n * @deprecated use `strategy` instead\n */\n positionFixed?: boolean;\n\n /**\n * Specifies the type of CSS position property to use.\n * @default absolute\n */\n strategy?: 'absolute' | 'fixed';\n\n /**\n * Lets you displace a positioned element from its reference element.\n * This can be useful if you need to apply some margin between them or if you need to fine tune the\n * position according to some custom logic.\n */\n offset?: Offset;\n\n /**\n * Defines padding between the corner of the popup element and the arrow.\n * Use to prevent the arrow from overlapping a rounded corner, for example.\n */\n arrowPadding?: number;\n\n /**\n * Applies styles on the positioned element to fit it within the available space in viewport.\n * - true: set styles for max height/width.\n * - 'height': set styles for max height.\n * - 'width'': set styles for max width.\n * Note that options 'always'/'height-always'/'width-always' are now obsolete, and equivalent to true/'height'/'width'.\n */\n autoSize?: AutoSize;\n\n /**\n * Modifies position and alignment to cover the target\n */\n coverTarget?: boolean;\n\n /**\n * Disables automatic repositioning of the component; it will always be placed according to the values of `align` and\n * `position` props, regardless of the size of the component, the reference element or the viewport.\n */\n pinned?: boolean;\n\n /**\n * When the reference element or the viewport is outside viewport allows a positioned element to be fully in viewport.\n * \"all\" enables this behavior for all axis.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether?: boolean | 'all';\n\n /**\n * If flip fails to stop the positioned element from overflowing\n * its boundaries, use a specified fallback positions.\n */\n fallbackPositions?: PositioningShorthandValue[];\n\n /**\n * Modifies whether popover is positioned using transform.\n * @default true\n */\n useTransform?: boolean;\n\n /**\n * If false, does not position anything\n */\n enabled?: boolean;\n\n /**\n * When set, the positioned element matches the chosen dimension(s) of the target element\n */\n matchTargetSize?: 'width';\n\n /**\n * Called when a position update has finished. Multiple position updates can happen in a single render,\n * since positioning happens outside of the React lifecycle.\n * The event's `detail.placement` indicates the final computed placement after middleware adjustments.\n *\n * It's also possible to listen to the custom DOM event `fui-positioningend`\n */\n onPositioningEnd?: (e: OnPositioningEndEvent) => void;\n\n /**\n * Disables the resize observer that updates position on target or dimension change\n */\n disableUpdateOnResize?: boolean;\n\n /**\n * When true, the positioned element will shift to cover the target element when there's not enough space.\n * @default false\n */\n shiftToCoverTarget?: boolean;\n}\n\n/**\n * Public api that allows components using react-positioning to specify positioning options\n */\nexport interface PositioningProps\n extends Pick<\n PositioningOptions,\n | 'align'\n | 'arrowPadding'\n | 'autoSize'\n | 'coverTarget'\n | 'fallbackPositions'\n | 'flipBoundary'\n | 'offset'\n | 'overflowBoundary'\n | 'overflowBoundaryPadding'\n | 'pinned'\n | 'position'\n | 'strategy'\n | 'useTransform'\n | 'matchTargetSize'\n | 'onPositioningEnd'\n | 'disableUpdateOnResize'\n | 'shiftToCoverTarget'\n > {\n /** An imperative handle to Popper methods. */\n positioningRef?: React.Ref<PositioningImperativeRef>;\n\n /**\n * Manual override for the target element. Useful for scenarios where a component accepts user prop to override target\n */\n target?: TargetElement | null;\n}\n\nexport type PositioningShorthandValue =\n | 'above'\n | 'above-start'\n | 'above-end'\n | 'below'\n | 'below-start'\n | 'below-end'\n | 'before'\n | 'before-top'\n | 'before-bottom'\n | 'after'\n | 'after-top'\n | 'after-bottom';\n\nexport type PositioningShorthand = PositioningProps | PositioningShorthandValue;\n\n// ---\n\nexport type PositioningConfigurationFnOptions = Omit<\n PositioningOptions,\n // Excluded as the function will never be called if disabled\n | 'enabled'\n // Callback is not subscribed from options\n | 'onPositioningEnd'\n // Is deprecated, no need to bloat the interface\n | 'positionFixed'\n>;\nexport type PositioningConfigurationFn = (params: {\n container: HTMLElement;\n arrow: HTMLElement | null;\n options: PositioningConfigurationFnOptions;\n}) => PositioningConfigurationFnOptions;\n"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/usePositioningMouseTarget.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createVirtualElementFromClick } from './createVirtualElementFromClick';\nimport { PositioningVirtualElement, SetVirtualMouseTarget } from './types';\n\n/**\n * @internal\n * A state hook that manages a popper virtual element from mouseevents.\n * Useful for scenarios where a component needs to be positioned by mouse click (e.g. contextmenu)\n * React synthetic events are not persisted by this hook\n *\n * @param initialState - initializes a user provided state similare to useState\n * @returns state and dispatcher for a Popper virtual element that uses native/synthetic mouse events\n */\nexport const usePositioningMouseTarget = (\n initialState?: PositioningVirtualElement | (() => PositioningVirtualElement),\n): readonly [PositioningVirtualElement | undefined, SetVirtualMouseTarget] => {\n const [virtualElement, setVirtualElement] = React.useState<PositioningVirtualElement | undefined>(initialState);\n\n const setVirtualMouseTarget: SetVirtualMouseTarget = event => {\n if (event === undefined || event === null) {\n setVirtualElement(undefined);\n return;\n }\n\n let mouseevent: MouseEvent;\n if (!(event instanceof MouseEvent)) {\n mouseevent = event.nativeEvent;\n } else {\n mouseevent = event;\n }\n\n if (!(mouseevent instanceof MouseEvent) && process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error('usePositioningMouseTarget should only be used with MouseEvent');\n }\n\n const contextTarget = createVirtualElementFromClick(mouseevent);\n setVirtualElement(contextTarget);\n };\n\n return [virtualElement, setVirtualMouseTarget] as const;\n};\n"],"names":["React","createVirtualElementFromClick","usePositioningMouseTarget","initialState","virtualElement","setVirtualElement","useState","setVirtualMouseTarget","event","undefined","mouseevent","MouseEvent","nativeEvent","process","env","NODE_ENV","console","error","contextTarget"],"mappings":"AAAA;;;;;+BAeaE;;;;;;;iEAbU,QAAQ;+CACe,kCAAkC;AAYzE,kCAAkC,CACvCC;IAEA,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGL,OAAMM,QAAQ,CAAwCH;IAElG,MAAMI,wBAA+CC,CAAAA;QACnD,IAAIA,UAAUC,aAAaD,UAAU,MAAM;YACzCH,kBAAkBI;YAClB;QACF;QAEA,IAAIC;QACJ,IAAI,CAAEF,CAAAA,iBAAiBG,UAAAA,CAAS,EAAI;YAClCD,aAAaF,MAAMI,WAAW;QAChC,OAAO;YACLF,aAAaF;QACf;QAEA,IAAI,CAAEE,CAAAA,sBAAsBC,UAAAA,CAAS,IAAME,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YAChF,sCAAsC;YACtCC,QAAQC,KAAK,CAAC;QAChB;QAEA,MAAMC,oBAAgBjB,4DAAAA,EAA8BS;QACpDL,kBAAkBa;IACpB;IAEA,OAAO;QAACd;QAAgBG;KAAsB;AAChD,EAAE"}
1
+ {"version":3,"sources":["../src/usePositioningMouseTarget.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { createVirtualElementFromClick } from './createVirtualElementFromClick';\nimport type { PositioningVirtualElement, SetVirtualMouseTarget } from './types';\n\n/**\n * A state hook that manages a popper virtual element from mouseevents.\n * Useful for scenarios where a component needs to be positioned by mouse click (e.g. contextmenu)\n * React synthetic events are not persisted by this hook\n *\n * @internal\n * @param initialState - initializes a user provided state similare to useState\n * @returns state and dispatcher for a Popper virtual element that uses native/synthetic mouse events\n */\nexport const usePositioningMouseTarget = (\n initialState?: PositioningVirtualElement | (() => PositioningVirtualElement),\n): readonly [PositioningVirtualElement | undefined, SetVirtualMouseTarget] => {\n const [virtualElement, setVirtualElement] = React.useState<PositioningVirtualElement | undefined>(initialState);\n\n const setVirtualMouseTarget: SetVirtualMouseTarget = event => {\n if (event === undefined || event === null) {\n setVirtualElement(undefined);\n return;\n }\n\n let mouseevent: MouseEvent;\n if (!(event instanceof MouseEvent)) {\n mouseevent = event.nativeEvent;\n } else {\n mouseevent = event;\n }\n\n if (!(mouseevent instanceof MouseEvent) && process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error('usePositioningMouseTarget should only be used with MouseEvent');\n }\n\n const contextTarget = createVirtualElementFromClick(mouseevent);\n setVirtualElement(contextTarget);\n };\n\n return [virtualElement, setVirtualMouseTarget] as const;\n};\n"],"names":["React","createVirtualElementFromClick","usePositioningMouseTarget","initialState","virtualElement","setVirtualElement","useState","setVirtualMouseTarget","event","undefined","mouseevent","MouseEvent","nativeEvent","process","env","NODE_ENV","console","error","contextTarget"],"mappings":"AAAA;;;;;+BAeaE;;;;;;;iEAbU,QAAQ;+CACe,kCAAkC;AAYzE,kCAAkC,CACvCC;IAEA,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGL,OAAMM,QAAQ,CAAwCH;IAElG,MAAMI,wBAA+CC,CAAAA;QACnD,IAAIA,UAAUC,aAAaD,UAAU,MAAM;YACzCH,kBAAkBI;YAClB;QACF;QAEA,IAAIC;QACJ,IAAI,CAAEF,CAAAA,iBAAiBG,UAAAA,CAAS,EAAI;YAClCD,aAAaF,MAAMI,WAAW;QAChC,OAAO;YACLF,aAAaF;QACf;QAEA,IAAI,CAAEE,CAAAA,sBAAsBC,UAAAA,CAAS,IAAME,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YAChF,sCAAsC;YACtCC,QAAQC,KAAK,CAAC;QAChB;QAEA,MAAMC,oBAAgBjB,4DAAAA,EAA8BS;QACpDL,kBAAkBa;IACpB;IAEA,OAAO;QAACd;QAAgBG;KAAsB;AAChD,EAAE"}
@@ -19,10 +19,10 @@ const _utils = require("./utils");
19
19
  const _devtools1 = require("./utils/devtools");
20
20
  const _PositioningConfigurationContext = require("./PositioningConfigurationContext");
21
21
  /**
22
- * @internal
23
- *
24
22
  * This is redundant and exists only to manage React dependencies properly & avoid leaking individual options to the
25
23
  * scope of `usePositioningOptions`.
24
+ *
25
+ * @internal
26
26
  */ function usePositioningConfigFn(configFn, options) {
27
27
  const { align, arrowPadding, autoSize, coverTarget, disableUpdateOnResize, flipBoundary, offset, overflowBoundary, pinned, position, unstable_disableTether, strategy, overflowBoundaryPadding, fallbackPositions, useTransform, matchTargetSize, shiftToCoverTarget } = options;
28
28
  return _react.useCallback((container, arrow)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/usePositioningOptions.ts"],"sourcesContent":["'use client';\n\nimport { devtools } from '@floating-ui/devtools';\nimport { hide as hideMiddleware, arrow as arrowMiddleware } from '@floating-ui/dom';\nimport type { Middleware, Placement, Strategy } from '@floating-ui/dom';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport * as React from 'react';\n\nimport {\n shift as shiftMiddleware,\n flip as flipMiddleware,\n coverTarget as coverTargetMiddleware,\n maxSize as maxSizeMiddleware,\n resetMaxSize as resetMaxSizeMiddleware,\n offset as offsetMiddleware,\n intersecting as intersectingMiddleware,\n matchTargetSize as matchTargetSizeMiddleware,\n} from './middleware';\nimport type { PositioningConfigurationFn, PositioningConfigurationFnOptions, PositioningOptions } from './types';\nimport { toFloatingUIPlacement, hasScrollParent, normalizeAutoSize } from './utils';\nimport { devtoolsCallback } from './utils/devtools';\nimport { usePositioningConfiguration } from './PositioningConfigurationContext';\n\n/**\n * @internal\n *\n * This is redundant and exists only to manage React dependencies properly & avoid leaking individual options to the\n * scope of `usePositioningOptions`.\n */\nfunction usePositioningConfigFn(\n configFn: PositioningConfigurationFn,\n options: PositioningOptions,\n): (container: HTMLElement, arrow: HTMLElement | null) => PositioningConfigurationFnOptions {\n const {\n align,\n arrowPadding,\n autoSize,\n coverTarget,\n disableUpdateOnResize,\n flipBoundary,\n offset,\n overflowBoundary,\n pinned,\n position,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether,\n strategy,\n overflowBoundaryPadding,\n fallbackPositions,\n useTransform,\n matchTargetSize,\n shiftToCoverTarget,\n } = options;\n\n return React.useCallback(\n (container: HTMLElement, arrow: HTMLElement | null) => {\n return configFn({\n container,\n arrow,\n options: {\n autoSize,\n disableUpdateOnResize,\n matchTargetSize,\n offset,\n strategy,\n coverTarget,\n flipBoundary,\n overflowBoundary,\n useTransform,\n overflowBoundaryPadding,\n pinned,\n arrowPadding,\n align,\n fallbackPositions,\n shiftToCoverTarget,\n position,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether,\n },\n });\n },\n [\n autoSize,\n disableUpdateOnResize,\n matchTargetSize,\n offset,\n strategy,\n coverTarget,\n flipBoundary,\n overflowBoundary,\n useTransform,\n overflowBoundaryPadding,\n pinned,\n arrowPadding,\n align,\n fallbackPositions,\n shiftToCoverTarget,\n position,\n unstable_disableTether,\n configFn,\n ],\n );\n}\n\n/**\n * @internal\n */\nexport function usePositioningOptions(options: PositioningOptions): (\n container: HTMLElement,\n arrow: HTMLElement | null,\n) => {\n placement: Placement | undefined;\n middleware: Middleware[];\n strategy: Strategy;\n disableUpdateOnResize?: boolean;\n useTransform?: boolean;\n} {\n const { dir, targetDocument } = useFluent();\n const isRtl = dir === 'rtl';\n\n const configFn = usePositioningConfigFn(usePositioningConfiguration(), options);\n const {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n positionFixed,\n } = options;\n\n return React.useCallback(\n (container: HTMLElement, arrow: HTMLElement | null) => {\n const hasScrollableElement = hasScrollParent(container);\n\n const optionsAfterEnhancement = configFn(container, arrow);\n const {\n autoSize,\n disableUpdateOnResize,\n matchTargetSize,\n offset,\n coverTarget,\n flipBoundary,\n overflowBoundary,\n useTransform,\n overflowBoundaryPadding,\n pinned,\n position,\n arrowPadding,\n strategy,\n align,\n fallbackPositions,\n shiftToCoverTarget,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether,\n } = optionsAfterEnhancement;\n const normalizedAutoSize = normalizeAutoSize(autoSize);\n\n const middleware = [\n normalizedAutoSize && resetMaxSizeMiddleware(normalizedAutoSize),\n matchTargetSize && matchTargetSizeMiddleware(),\n offset && offsetMiddleware(offset),\n coverTarget && coverTargetMiddleware(),\n !pinned && flipMiddleware({ container, flipBoundary, hasScrollableElement, isRtl, fallbackPositions }),\n shiftMiddleware({\n container,\n hasScrollableElement,\n overflowBoundary,\n disableTether: unstable_disableTether,\n overflowBoundaryPadding,\n isRtl,\n shiftToCoverTarget,\n }),\n normalizedAutoSize &&\n maxSizeMiddleware(normalizedAutoSize, { container, overflowBoundary, overflowBoundaryPadding, isRtl }),\n intersectingMiddleware(),\n arrow && arrowMiddleware({ element: arrow, padding: arrowPadding }),\n hideMiddleware({ strategy: 'referenceHidden' }),\n hideMiddleware({ strategy: 'escaped' }),\n process.env.NODE_ENV !== 'production' &&\n targetDocument &&\n devtools(targetDocument, devtoolsCallback(optionsAfterEnhancement)),\n ].filter(Boolean) as Middleware[];\n\n const placement = toFloatingUIPlacement(align, position, isRtl);\n\n return {\n placement,\n middleware,\n strategy: strategy ?? positionFixed ? ('fixed' as const) : ('absolute' as const),\n\n disableUpdateOnResize,\n useTransform,\n };\n },\n [configFn, isRtl, targetDocument, positionFixed],\n );\n}\n"],"names":["devtools","hide","hideMiddleware","arrow","arrowMiddleware","useFluent_unstable","useFluent","React","shift","shiftMiddleware","flip","flipMiddleware","coverTarget","coverTargetMiddleware","maxSize","maxSizeMiddleware","resetMaxSize","resetMaxSizeMiddleware","offset","offsetMiddleware","intersecting","intersectingMiddleware","matchTargetSize","matchTargetSizeMiddleware","toFloatingUIPlacement","hasScrollParent","normalizeAutoSize","devtoolsCallback","usePositioningConfiguration","usePositioningConfigFn","configFn","options","align","arrowPadding","autoSize","disableUpdateOnResize","flipBoundary","overflowBoundary","pinned","position","unstable_disableTether","strategy","overflowBoundaryPadding","fallbackPositions","useTransform","shiftToCoverTarget","useCallback","container","usePositioningOptions","dir","targetDocument","isRtl","positionFixed","hasScrollableElement","optionsAfterEnhancement","normalizedAutoSize","middleware","disableTether","element","padding","process","env","NODE_ENV","filter","Boolean","placement"],"mappings":"AAAA;;;;;+BA2GgBgD;;;;;;;0BAzGS,wBAAwB;qBACgB,mBAAmB;qCAEpC,kCAAkC;iEAC3D,QAAQ;4BAWxB,eAAe;uBAEoD,UAAU;2BACnD,mBAAmB;iDACR,oCAAoC;AAEhF;;;;;CAKC,GACD,SAASnB,uBACPC,QAAoC,EACpCC,OAA2B;IAE3B,MAAM,EACJC,KAAK,EACLC,YAAY,EACZC,QAAQ,EACRtB,WAAW,EACXuB,qBAAqB,EACrBC,YAAY,EACZlB,MAAM,EACNmB,gBAAgB,EAChBC,MAAM,EACNC,QAAQ,EACR,AACAC,sBAAsB,EACtBC,QAAQ,EACRC,uBAAuB,EACvBC,KAJgE,YAI/C,EACjBC,YAAY,EACZtB,eAAe,EACfuB,kBAAkB,EACnB,GAAGd;IAEJ,OAAOxB,OAAMuC,WAAW,CACtB,CAACC,WAAwB5C;QACvB,OAAO2B,SAAS;YACdiB;YACA5C;YACA4B,SAAS;gBACPG;gBACAC;gBACAb;gBACAJ;gBACAuB;gBACA7B;gBACAwB;gBACAC;gBACAO;gBACAF;gBACAJ;gBACAL;gBACAD;gBACAW;gBACAE;gBACAN;gBACA,gEAAgE;gBAChEC;YACF;QACF;IACF,GACA;QACEN;QACAC;QACAb;QACAJ;QACAuB;QACA7B;QACAwB;QACAC;QACAO;QACAF;QACAJ;QACAL;QACAD;QACAW;QACAE;QACAN;QACAC;QACAV;KACD;AAEL;AAKO,+BAA+BC,OAA2B;IAU/D,MAAM,EAAEkB,GAAG,EAAEC,cAAc,EAAE,OAAG5C,uCAAAA;IAChC,MAAM6C,QAAQF,QAAQ;IAEtB,MAAMnB,WAAWD,2BAAuBD,4DAAAA,KAA+BG;IACvE,MAAM,EACJ,AACAqB,aAAa,EACd,GAAGrB,0CAF0D;IAI9D,OAAOxB,OAAMuC,WAAW,CACtB,CAACC,WAAwB5C;QACvB,MAAMkD,uBAAuB5B,0BAAAA,EAAgBsB;QAE7C,MAAMO,0BAA0BxB,SAASiB,WAAW5C;QACpD,MAAM,EACJ+B,QAAQ,EACRC,qBAAqB,EACrBb,eAAe,EACfJ,MAAM,EACNN,WAAW,EACXwB,YAAY,EACZC,gBAAgB,EAChBO,YAAY,EACZF,uBAAuB,EACvBJ,MAAM,EACNC,QAAQ,EACRN,YAAY,EACZQ,QAAQ,EACRT,KAAK,EACLW,iBAAiB,EACjBE,kBAAkB,EAClB,AACAL,sBAAsB,EACvB,GAAGc,qCAF8D;QAGlE,MAAMC,yBAAqB7B,wBAAAA,EAAkBQ;QAE7C,MAAMsB,aAAa;YACjBD,0BAAsBtC,wBAAAA,EAAuBsC;YAC7CjC,uBAAmBC,2BAAAA;YACnBL,cAAUC,kBAAAA,EAAiBD;YAC3BN,mBAAeC,uBAAAA;YACf,CAACyB,cAAU3B,gBAAAA,EAAe;gBAAEoC;gBAAWX;gBAAciB;gBAAsBF;gBAAOR;YAAkB;YACpGlC,qBAAAA,EAAgB;gBACdsC;gBACAM;gBACAhB;gBACAoB,eAAejB;gBACfE;gBACAS;gBACAN;YACF;YACAU,0BACExC,mBAAAA,EAAkBwC,oBAAoB;gBAAER;gBAAWV;gBAAkBK;gBAAyBS;YAAM;gBACtG9B,wBAAAA;YACAlB,aAASC,UAAAA,EAAgB;gBAAEsD,SAASvD;gBAAOwD,SAAS1B;YAAa;gBACjE/B,SAAAA,EAAe;gBAAEuC,UAAU;YAAkB;gBAC7CvC,SAAAA,EAAe;gBAAEuC,UAAU;YAAU;YACrCmB,QAAQC,GAAG,CAACC,QAAQ,KAAK,gBACvBZ,sBACAlD,kBAAAA,EAASkD,oBAAgBvB,2BAAAA,EAAiB2B;SAC7C,CAACS,MAAM,CAACC;QAET,MAAMC,gBAAYzC,4BAAAA,EAAsBQ,OAAOO,UAAUY;QAEzD,OAAO;YACLc;YACAT;YACAf,UAAUA,CAAAA,aAAAA,QAAAA,aAAAA,KAAAA,IAAAA,WAAYW,aAAAA,CAAY,GAAK,UAAqB;YAE5DjB;YACAS;QACF;IACF,GACA;QAACd;QAAUqB;QAAOD;QAAgBE;KAAc;AAEpD"}
1
+ {"version":3,"sources":["../src/usePositioningOptions.ts"],"sourcesContent":["'use client';\n\nimport { devtools } from '@floating-ui/devtools';\nimport { hide as hideMiddleware, arrow as arrowMiddleware } from '@floating-ui/dom';\nimport type { Middleware, Placement, Strategy } from '@floating-ui/dom';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport * as React from 'react';\n\nimport {\n shift as shiftMiddleware,\n flip as flipMiddleware,\n coverTarget as coverTargetMiddleware,\n maxSize as maxSizeMiddleware,\n resetMaxSize as resetMaxSizeMiddleware,\n offset as offsetMiddleware,\n intersecting as intersectingMiddleware,\n matchTargetSize as matchTargetSizeMiddleware,\n} from './middleware';\nimport type { PositioningConfigurationFn, PositioningConfigurationFnOptions, PositioningOptions } from './types';\nimport { toFloatingUIPlacement, hasScrollParent, normalizeAutoSize } from './utils';\nimport { devtoolsCallback } from './utils/devtools';\nimport { usePositioningConfiguration } from './PositioningConfigurationContext';\n\n/**\n * This is redundant and exists only to manage React dependencies properly & avoid leaking individual options to the\n * scope of `usePositioningOptions`.\n *\n * @internal\n */\nfunction usePositioningConfigFn(\n configFn: PositioningConfigurationFn,\n options: PositioningOptions,\n): (container: HTMLElement, arrow: HTMLElement | null) => PositioningConfigurationFnOptions {\n const {\n align,\n arrowPadding,\n autoSize,\n coverTarget,\n disableUpdateOnResize,\n flipBoundary,\n offset,\n overflowBoundary,\n pinned,\n position,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether,\n strategy,\n overflowBoundaryPadding,\n fallbackPositions,\n useTransform,\n matchTargetSize,\n shiftToCoverTarget,\n } = options;\n\n return React.useCallback(\n (container: HTMLElement, arrow: HTMLElement | null) => {\n return configFn({\n container,\n arrow,\n options: {\n autoSize,\n disableUpdateOnResize,\n matchTargetSize,\n offset,\n strategy,\n coverTarget,\n flipBoundary,\n overflowBoundary,\n useTransform,\n overflowBoundaryPadding,\n pinned,\n arrowPadding,\n align,\n fallbackPositions,\n shiftToCoverTarget,\n position,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether,\n },\n });\n },\n [\n autoSize,\n disableUpdateOnResize,\n matchTargetSize,\n offset,\n strategy,\n coverTarget,\n flipBoundary,\n overflowBoundary,\n useTransform,\n overflowBoundaryPadding,\n pinned,\n arrowPadding,\n align,\n fallbackPositions,\n shiftToCoverTarget,\n position,\n unstable_disableTether,\n configFn,\n ],\n );\n}\n\n/**\n * @internal\n */\nexport function usePositioningOptions(options: PositioningOptions): (\n container: HTMLElement,\n arrow: HTMLElement | null,\n) => {\n placement: Placement | undefined;\n middleware: Middleware[];\n strategy: Strategy;\n disableUpdateOnResize?: boolean;\n useTransform?: boolean;\n} {\n const { dir, targetDocument } = useFluent();\n const isRtl = dir === 'rtl';\n\n const configFn = usePositioningConfigFn(usePositioningConfiguration(), options);\n const {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n positionFixed,\n } = options;\n\n return React.useCallback(\n (container: HTMLElement, arrow: HTMLElement | null) => {\n const hasScrollableElement = hasScrollParent(container);\n\n const optionsAfterEnhancement = configFn(container, arrow);\n const {\n autoSize,\n disableUpdateOnResize,\n matchTargetSize,\n offset,\n coverTarget,\n flipBoundary,\n overflowBoundary,\n useTransform,\n overflowBoundaryPadding,\n pinned,\n position,\n arrowPadding,\n strategy,\n align,\n fallbackPositions,\n shiftToCoverTarget,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether,\n } = optionsAfterEnhancement;\n const normalizedAutoSize = normalizeAutoSize(autoSize);\n\n const middleware = [\n normalizedAutoSize && resetMaxSizeMiddleware(normalizedAutoSize),\n matchTargetSize && matchTargetSizeMiddleware(),\n offset && offsetMiddleware(offset),\n coverTarget && coverTargetMiddleware(),\n !pinned && flipMiddleware({ container, flipBoundary, hasScrollableElement, isRtl, fallbackPositions }),\n shiftMiddleware({\n container,\n hasScrollableElement,\n overflowBoundary,\n disableTether: unstable_disableTether,\n overflowBoundaryPadding,\n isRtl,\n shiftToCoverTarget,\n }),\n normalizedAutoSize &&\n maxSizeMiddleware(normalizedAutoSize, { container, overflowBoundary, overflowBoundaryPadding, isRtl }),\n intersectingMiddleware(),\n arrow && arrowMiddleware({ element: arrow, padding: arrowPadding }),\n hideMiddleware({ strategy: 'referenceHidden' }),\n hideMiddleware({ strategy: 'escaped' }),\n process.env.NODE_ENV !== 'production' &&\n targetDocument &&\n devtools(targetDocument, devtoolsCallback(optionsAfterEnhancement)),\n ].filter(Boolean) as Middleware[];\n\n const placement = toFloatingUIPlacement(align, position, isRtl);\n\n return {\n placement,\n middleware,\n strategy: strategy ?? positionFixed ? ('fixed' as const) : ('absolute' as const),\n\n disableUpdateOnResize,\n useTransform,\n };\n },\n [configFn, isRtl, targetDocument, positionFixed],\n );\n}\n"],"names":["devtools","hide","hideMiddleware","arrow","arrowMiddleware","useFluent_unstable","useFluent","React","shift","shiftMiddleware","flip","flipMiddleware","coverTarget","coverTargetMiddleware","maxSize","maxSizeMiddleware","resetMaxSize","resetMaxSizeMiddleware","offset","offsetMiddleware","intersecting","intersectingMiddleware","matchTargetSize","matchTargetSizeMiddleware","toFloatingUIPlacement","hasScrollParent","normalizeAutoSize","devtoolsCallback","usePositioningConfiguration","usePositioningConfigFn","configFn","options","align","arrowPadding","autoSize","disableUpdateOnResize","flipBoundary","overflowBoundary","pinned","position","unstable_disableTether","strategy","overflowBoundaryPadding","fallbackPositions","useTransform","shiftToCoverTarget","useCallback","container","usePositioningOptions","dir","targetDocument","isRtl","positionFixed","hasScrollableElement","optionsAfterEnhancement","normalizedAutoSize","middleware","disableTether","element","padding","process","env","NODE_ENV","filter","Boolean","placement"],"mappings":"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"}
@@ -8,8 +8,6 @@ Object.defineProperty(exports, "getReactFiberFromNode", {
8
8
  return getReactFiberFromNode;
9
9
  }
10
10
  });
11
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
11
  var WorkTag = /*#__PURE__*/ function(WorkTag) {
14
12
  WorkTag[WorkTag["FunctionComponent"] = 0] = "FunctionComponent";
15
13
  WorkTag[WorkTag["ClassComponent"] = 1] = "ClassComponent";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/getReactFiberFromNode.ts"],"sourcesContent":["import * as React from 'react';\n\n// ========================================================\n// react/packages/shared/ReactTypes.js\n// ========================================================\n\ntype ReactEventResponder<E, C> = {\n $$typeof: Symbol | number;\n displayName: string;\n targetEventTypes: null | string[];\n rootEventTypes: null | string[];\n getInitialState: null | ((props: Object) => Object);\n onEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onRootEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onMount: null | ((context: C, props: Object, state: Object) => void);\n onUnmount: null | ((context: C, props: Object, state: Object) => void);\n};\n\ntype ReactEventResponderInstance<E, C> = {\n fiber: Object;\n props: Object;\n responder: ReactEventResponder<E, C>;\n rootEventTypes: null | Set<string>;\n state: Object;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiberHooks.js\n// ========================================================\n\nexport type HookType =\n | 'useState'\n | 'useReducer'\n | 'useContext'\n | 'useRef'\n | 'useEffect'\n | 'useLayoutEffect'\n | 'useCallback'\n | 'useMemo'\n | 'useImperativeHandle'\n | 'useDebugValue'\n | 'useResponder';\n\ntype ReactProviderType<T> = {\n $$typeof: Symbol | number;\n _context: ReactContext<T>;\n};\n\ntype ReactContext<T> = {\n $$typeof: Symbol | number;\n Consumer: ReactContext<T>;\n Provider: ReactProviderType<T>;\n\n _calculateChangedBits: ((a: T, b: T) => number) | null;\n\n _currentValue: T;\n _currentValue2: T;\n _threadCount: number;\n\n // DEV only\n _currentRenderer?: Object | null;\n _currentRenderer2?: Object | null;\n};\n\ntype ContextDependency<T> = {\n context: ReactContext<T>;\n observedBits: number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n next: ContextDependency<any> | null;\n};\n\nenum WorkTag {\n FunctionComponent = 0,\n ClassComponent = 1,\n IndeterminateComponent = 2, // Before we know whether it is function or class\n HostRoot = 3, // Root of a host tree. Could be nested inside another node.\n HostPortal = 4, // A subtree. Could be an entry point to a different renderer.\n HostComponent = 5,\n HostText = 6,\n Fragment = 7,\n Mode = 8,\n ContextConsumer = 9,\n ContextProvider = 10,\n ForwardRef = 11,\n Profiler = 12,\n SuspenseComponent = 13,\n MemoComponent = 14,\n SimpleMemoComponent = 15,\n LazyComponent = 16,\n IncompleteClassComponent = 17,\n DehydratedFragment = 18,\n SuspenseListComponent = 19,\n FundamentalComponent = 20,\n ScopeComponent = 21,\n}\n\ntype Source = {\n fileName: string;\n lineNumber: number;\n};\n\ntype ExpirationTime = number;\n\ntype Dependencies = {\n expirationTime: ExpirationTime;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n firstContext: ContextDependency<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n responders: Map<ReactEventResponder<any, any>, ReactEventResponderInstance<any, any>> | null;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiber.js\n// ========================================================\n\n// A Fiber is work on a Component that needs to be done or was done. There can\n// be more than one per component.\n\nexport type Fiber = {\n // These first fields are conceptually members of an Instance. This used to\n // be split into a separate type and intersected with the other Fiber fields,\n // but until Flow fixes its intersection bugs, we've merged them into a\n // single type.\n\n // An Instance is shared between all versions of a component. We can easily\n // break this out into a separate object to avoid copying so much to the\n // alternate versions of the tree. We put this on a single object for now to\n // minimize the number of objects created during the initial render.\n\n // Tag identifying the type of fiber.\n tag: WorkTag;\n\n // Unique identifier of this child.\n key: null | string;\n\n // The value of element.type which is used to preserve the identity during\n // reconciliation of this child.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n elementType: any;\n\n // The resolved function/class/ associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n\n // The local state associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stateNode: any;\n\n // Conceptual aliases\n // parent : Instance -> return The parent happens to be the same as the\n // return fiber since we've merged the fiber and instance.\n\n // Remaining fields belong to Fiber\n\n // The Fiber to return to after finishing processing this one.\n // This is effectively the parent, but there can be multiple parents (two)\n // so this is only the parent of the thing we're currently processing.\n // It is conceptually the same as the return address of a stack frame.\n return: Fiber | null;\n\n // Singly Linked List Tree Structure.\n child: Fiber | null;\n sibling: Fiber | null;\n index: number;\n\n // The ref last used to attach this node.\n // I'll avoid adding an owner field for prod and model that as functions.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: React.Ref<any>;\n\n // Input is the data coming into process this fiber. Arguments. Props.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n pendingProps: any; // This type will be more specific once we overload the tag.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedProps: any; // The props used to create the output.\n\n // A queue of state updates and callbacks.\n // updateQueue: UpdateQueue<any> | null,\n\n // The state used to create the output\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedState: any;\n\n // Dependencies (contexts, events) for this fiber, if it has any\n dependencies: Dependencies | null;\n\n // // Bitfield that describes properties about the fiber and its subtree. E.g.\n // // the ConcurrentMode flag indicates whether the subtree should be async-by-\n // // default. When a fiber is created, it inherits the mode of its\n // // parent. Additional flags can be set at creation time, but after that the\n // // value should remain unchanged throughout the fiber's lifetime, particularly\n // // before its child fibers are created.\n // mode: TypeOfMode\n //\n // // Effect\n // effectTag: SideEffectTag\n\n // Singly linked list fast path to the next fiber with side-effects.\n nextEffect: Fiber | null;\n\n // The first and last fiber with side-effect within this subtree. This allows\n // us to reuse a slice of the linked list when we reuse the work done within\n // this fiber.\n firstEffect: Fiber | null;\n lastEffect: Fiber | null;\n\n // Represents a time in the future by which this work should be completed.\n // Does not include work found in its subtree.\n expirationTime: ExpirationTime;\n\n // This is used to quickly determine if a subtree has no pending changes.\n childExpirationTime: ExpirationTime;\n\n // This is a pooled version of a Fiber. Every fiber that gets updated will\n // eventually have a pair. There are cases when we can clean up pairs to save\n // memory if we need to.\n alternate: Fiber | null;\n\n // Time spent rendering this Fiber and its descendants for the current update.\n // This tells us how well the tree makes use of sCU for memoization.\n // It is reset to 0 each time we render and only updated when we don't bailout.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualDuration?: number;\n\n // If the Fiber is currently active in the \"render\" phase,\n // This marks the time at which the work began.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualStartTime?: number;\n\n // Duration of the most recent render time for this Fiber.\n // This value is not updated when we bailout for memoization purposes.\n // This field is only set when the enableProfilerTimer flag is enabled.\n selfBaseDuration?: number;\n\n // Sum of base times for all descendants of this Fiber.\n // This value bubbles up during the \"complete\" phase.\n // This field is only set when the enableProfilerTimer flag is enabled.\n treeBaseDuration?: number;\n\n // Conceptual aliases\n // workInProgress : Fiber -> alternate The alternate used for reuse happens\n // to be the same as work in progress.\n // __DEV__ only\n _debugID?: number;\n _debugSource?: Source | null;\n _debugOwner?: Fiber | null;\n _debugIsCurrentlyTiming?: boolean;\n _debugNeedsRemount?: boolean;\n\n // Used to verify that the order of hooks does not change between renders.\n _debugHookTypes?: HookType[] | null;\n};\n\nexport function getReactFiberFromNode(elm: Node | undefined): Fiber | null {\n if (!elm) {\n return null;\n }\n\n for (const k in elm) {\n // React 16 uses \"__reactInternalInstance$\" prefix\n // React 17 uses \"__reactFiber$\" prefix\n // https://github.com/facebook/react/pull/18377\n if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return elm[k];\n }\n }\n\n throw new Error('getReactFiber(): Failed to find a React Fiber on a node');\n}\n"],"names":["React","WorkTag","getReactFiberFromNode","elm","k","indexOf","Error"],"mappings":";;;;+BA6PgBE;;;;;;;iEA7PO,QAAQ;AAuE/B,IAAKD,UAAAA,WAAAA,GAAAA,SAAAA,OAAAA;;;;;;;;;;;;;;;;;;;;;;;WAAAA;EAAAA,WAAAA,CAAAA;AAsLE,+BAA+BE,GAAqB;IACzD,IAAI,CAACA,KAAK;QACR,OAAO;IACT;IAEA,IAAK,MAAMC,KAAKD,IAAK;QACnB,kDAAkD;QAClD,uCAAuC;QACvC,+CAA+C;QAC/C,IAAIC,EAAEC,OAAO,CAAC,gCAAgC,KAAKD,EAAEC,OAAO,CAAC,qBAAqB,GAAG;YACnF,6DAA6D;YAC7D,aAAa;YACb,OAAOF,GAAG,CAACC,EAAE;QACf;IACF;IAEA,MAAM,IAAIE,MAAM;AAClB"}
1
+ {"version":3,"sources":["../src/utils/getReactFiberFromNode.ts"],"sourcesContent":["import type * as React from 'react';\n\n// ========================================================\n// react/packages/shared/ReactTypes.js\n// ========================================================\n\ntype ReactEventResponder<E, C> = {\n $$typeof: Symbol | number;\n displayName: string;\n targetEventTypes: null | string[];\n rootEventTypes: null | string[];\n getInitialState: null | ((props: Object) => Object);\n onEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onRootEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onMount: null | ((context: C, props: Object, state: Object) => void);\n onUnmount: null | ((context: C, props: Object, state: Object) => void);\n};\n\ntype ReactEventResponderInstance<E, C> = {\n fiber: Object;\n props: Object;\n responder: ReactEventResponder<E, C>;\n rootEventTypes: null | Set<string>;\n state: Object;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiberHooks.js\n// ========================================================\n\nexport type HookType =\n | 'useState'\n | 'useReducer'\n | 'useContext'\n | 'useRef'\n | 'useEffect'\n | 'useLayoutEffect'\n | 'useCallback'\n | 'useMemo'\n | 'useImperativeHandle'\n | 'useDebugValue'\n | 'useResponder';\n\ntype ReactProviderType<T> = {\n $$typeof: Symbol | number;\n _context: ReactContext<T>;\n};\n\ntype ReactContext<T> = {\n $$typeof: Symbol | number;\n Consumer: ReactContext<T>;\n Provider: ReactProviderType<T>;\n\n _calculateChangedBits: ((a: T, b: T) => number) | null;\n\n _currentValue: T;\n _currentValue2: T;\n _threadCount: number;\n\n // DEV only\n _currentRenderer?: Object | null;\n _currentRenderer2?: Object | null;\n};\n\ntype ContextDependency<T> = {\n context: ReactContext<T>;\n observedBits: number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n next: ContextDependency<any> | null;\n};\n\nenum WorkTag {\n FunctionComponent = 0,\n ClassComponent = 1,\n IndeterminateComponent = 2, // Before we know whether it is function or class\n HostRoot = 3, // Root of a host tree. Could be nested inside another node.\n HostPortal = 4, // A subtree. Could be an entry point to a different renderer.\n HostComponent = 5,\n HostText = 6,\n Fragment = 7,\n Mode = 8,\n ContextConsumer = 9,\n ContextProvider = 10,\n ForwardRef = 11,\n Profiler = 12,\n SuspenseComponent = 13,\n MemoComponent = 14,\n SimpleMemoComponent = 15,\n LazyComponent = 16,\n IncompleteClassComponent = 17,\n DehydratedFragment = 18,\n SuspenseListComponent = 19,\n FundamentalComponent = 20,\n ScopeComponent = 21,\n}\n\ntype Source = {\n fileName: string;\n lineNumber: number;\n};\n\ntype ExpirationTime = number;\n\ntype Dependencies = {\n expirationTime: ExpirationTime;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n firstContext: ContextDependency<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n responders: Map<ReactEventResponder<any, any>, ReactEventResponderInstance<any, any>> | null;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiber.js\n// ========================================================\n\n// A Fiber is work on a Component that needs to be done or was done. There can\n// be more than one per component.\n\nexport type Fiber = {\n // These first fields are conceptually members of an Instance. This used to\n // be split into a separate type and intersected with the other Fiber fields,\n // but until Flow fixes its intersection bugs, we've merged them into a\n // single type.\n\n // An Instance is shared between all versions of a component. We can easily\n // break this out into a separate object to avoid copying so much to the\n // alternate versions of the tree. We put this on a single object for now to\n // minimize the number of objects created during the initial render.\n\n // Tag identifying the type of fiber.\n tag: WorkTag;\n\n // Unique identifier of this child.\n key: null | string;\n\n // The value of element.type which is used to preserve the identity during\n // reconciliation of this child.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n elementType: any;\n\n // The resolved function/class/ associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n\n // The local state associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stateNode: any;\n\n // Conceptual aliases\n // parent : Instance -> return The parent happens to be the same as the\n // return fiber since we've merged the fiber and instance.\n\n // Remaining fields belong to Fiber\n\n // The Fiber to return to after finishing processing this one.\n // This is effectively the parent, but there can be multiple parents (two)\n // so this is only the parent of the thing we're currently processing.\n // It is conceptually the same as the return address of a stack frame.\n return: Fiber | null;\n\n // Singly Linked List Tree Structure.\n child: Fiber | null;\n sibling: Fiber | null;\n index: number;\n\n // The ref last used to attach this node.\n // I'll avoid adding an owner field for prod and model that as functions.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: React.Ref<any>;\n\n // Input is the data coming into process this fiber. Arguments. Props.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n pendingProps: any; // This type will be more specific once we overload the tag.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedProps: any; // The props used to create the output.\n\n // A queue of state updates and callbacks.\n // updateQueue: UpdateQueue<any> | null,\n\n // The state used to create the output\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedState: any;\n\n // Dependencies (contexts, events) for this fiber, if it has any\n dependencies: Dependencies | null;\n\n // // Bitfield that describes properties about the fiber and its subtree. E.g.\n // // the ConcurrentMode flag indicates whether the subtree should be async-by-\n // // default. When a fiber is created, it inherits the mode of its\n // // parent. Additional flags can be set at creation time, but after that the\n // // value should remain unchanged throughout the fiber's lifetime, particularly\n // // before its child fibers are created.\n // mode: TypeOfMode\n //\n // // Effect\n // effectTag: SideEffectTag\n\n // Singly linked list fast path to the next fiber with side-effects.\n nextEffect: Fiber | null;\n\n // The first and last fiber with side-effect within this subtree. This allows\n // us to reuse a slice of the linked list when we reuse the work done within\n // this fiber.\n firstEffect: Fiber | null;\n lastEffect: Fiber | null;\n\n // Represents a time in the future by which this work should be completed.\n // Does not include work found in its subtree.\n expirationTime: ExpirationTime;\n\n // This is used to quickly determine if a subtree has no pending changes.\n childExpirationTime: ExpirationTime;\n\n // This is a pooled version of a Fiber. Every fiber that gets updated will\n // eventually have a pair. There are cases when we can clean up pairs to save\n // memory if we need to.\n alternate: Fiber | null;\n\n // Time spent rendering this Fiber and its descendants for the current update.\n // This tells us how well the tree makes use of sCU for memoization.\n // It is reset to 0 each time we render and only updated when we don't bailout.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualDuration?: number;\n\n // If the Fiber is currently active in the \"render\" phase,\n // This marks the time at which the work began.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualStartTime?: number;\n\n // Duration of the most recent render time for this Fiber.\n // This value is not updated when we bailout for memoization purposes.\n // This field is only set when the enableProfilerTimer flag is enabled.\n selfBaseDuration?: number;\n\n // Sum of base times for all descendants of this Fiber.\n // This value bubbles up during the \"complete\" phase.\n // This field is only set when the enableProfilerTimer flag is enabled.\n treeBaseDuration?: number;\n\n // Conceptual aliases\n // workInProgress : Fiber -> alternate The alternate used for reuse happens\n // to be the same as work in progress.\n // __DEV__ only\n _debugID?: number;\n _debugSource?: Source | null;\n _debugOwner?: Fiber | null;\n _debugIsCurrentlyTiming?: boolean;\n _debugNeedsRemount?: boolean;\n\n // Used to verify that the order of hooks does not change between renders.\n _debugHookTypes?: HookType[] | null;\n};\n\nexport function getReactFiberFromNode(elm: Node | undefined): Fiber | null {\n if (!elm) {\n return null;\n }\n\n for (const k in elm) {\n // React 16 uses \"__reactInternalInstance$\" prefix\n // React 17 uses \"__reactFiber$\" prefix\n // https://github.com/facebook/react/pull/18377\n if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return elm[k];\n }\n }\n\n throw new Error('getReactFiber(): Failed to find a React Fiber on a node');\n}\n"],"names":["WorkTag","getReactFiberFromNode","elm","k","indexOf","Error"],"mappings":";;;;+BA6PgBC;;;;;;AAtLhB,IAAKD,UAAAA,WAAAA,GAAAA,SAAAA,OAAAA;;;;;;;;;;;;;;;;;;;;;;;WAAAA;EAAAA,WAAAA,CAAAA;AAsLE,+BAA+BE,GAAqB;IACzD,IAAI,CAACA,KAAK;QACR,OAAO;IACT;IAEA,IAAK,MAAMC,KAAKD,IAAK;QACnB,kDAAkD;QAClD,uCAAuC;QACvC,+CAA+C;QAC/C,IAAIC,EAAEC,OAAO,CAAC,gCAAgC,KAAKD,EAAEC,OAAO,CAAC,qBAAqB,GAAG;YACnF,6DAA6D;YAC7D,aAAa;YACb,OAAOF,GAAG,CAACC,EAAE;QACf;IACF;IAEA,MAAM,IAAIE,MAAM;AAClB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/toFloatingUIPadding.ts"],"sourcesContent":["import type { SideObject } from '@floating-ui/dom';\nimport { PositioningOptions } from '../types';\n\nexport function toFloatingUIPadding(\n padding: NonNullable<PositioningOptions['overflowBoundaryPadding']>,\n isRtl: boolean,\n): number | Partial<SideObject> {\n if (typeof padding === 'number') {\n return padding;\n }\n\n const { start, end, ...verticalPadding } = padding;\n\n const paddingObject: Partial<SideObject> = verticalPadding;\n\n const left = isRtl ? 'end' : 'start';\n const right = isRtl ? 'start' : 'end';\n\n // assign properties explicitly since undefined values are actually handled by floating UI\n // TODO create floating UI issue\n if (padding[left]) {\n paddingObject.left = padding[left];\n }\n\n if (padding[right]) {\n paddingObject.right = padding[right];\n }\n\n return paddingObject;\n}\n"],"names":["toFloatingUIPadding","padding","isRtl","start","end","verticalPadding","paddingObject","left","right"],"mappings":";;;;+BAGgBA;;;;;;AAAT,6BACLC,OAAmE,EACnEC,KAAc;IAEd,IAAI,OAAOD,YAAY,UAAU;QAC/B,OAAOA;IACT;IAEA,MAAM,EAAEE,KAAK,EAAEC,GAAG,EAAE,GAAGC,iBAAiB,GAAGJ;IAE3C,MAAMK,gBAAqCD;IAE3C,MAAME,OAAOL,QAAQ,QAAQ;IAC7B,MAAMM,QAAQN,QAAQ,UAAU;IAEhC,0FAA0F;IAC1F,gCAAgC;IAChC,IAAID,OAAO,CAACM,KAAK,EAAE;QACjBD,cAAcC,IAAI,GAAGN,OAAO,CAACM,KAAK;IACpC;IAEA,IAAIN,OAAO,CAACO,MAAM,EAAE;QAClBF,cAAcE,KAAK,GAAGP,OAAO,CAACO,MAAM;IACtC;IAEA,OAAOF;AACT"}
1
+ {"version":3,"sources":["../src/utils/toFloatingUIPadding.ts"],"sourcesContent":["import type { SideObject } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\n\nexport function toFloatingUIPadding(\n padding: NonNullable<PositioningOptions['overflowBoundaryPadding']>,\n isRtl: boolean,\n): number | Partial<SideObject> {\n if (typeof padding === 'number') {\n return padding;\n }\n\n const { start, end, ...verticalPadding } = padding;\n\n const paddingObject: Partial<SideObject> = verticalPadding;\n\n const left = isRtl ? 'end' : 'start';\n const right = isRtl ? 'start' : 'end';\n\n // assign properties explicitly since undefined values are actually handled by floating UI\n // TODO create floating UI issue\n if (padding[left]) {\n paddingObject.left = padding[left];\n }\n\n if (padding[right]) {\n paddingObject.right = padding[right];\n }\n\n return paddingObject;\n}\n"],"names":["toFloatingUIPadding","padding","isRtl","start","end","verticalPadding","paddingObject","left","right"],"mappings":";;;;+BAGgBA;;;;;;AAAT,6BACLC,OAAmE,EACnEC,KAAc;IAEd,IAAI,OAAOD,YAAY,UAAU;QAC/B,OAAOA;IACT;IAEA,MAAM,EAAEE,KAAK,EAAEC,GAAG,EAAE,GAAGC,iBAAiB,GAAGJ;IAE3C,MAAMK,gBAAqCD;IAE3C,MAAME,OAAOL,QAAQ,QAAQ;IAC7B,MAAMM,QAAQN,QAAQ,UAAU;IAEhC,0FAA0F;IAC1F,gCAAgC;IAChC,IAAID,OAAO,CAACM,KAAK,EAAE;QACjBD,cAAcC,IAAI,GAAGN,OAAO,CAACM,KAAK;IACpC;IAEA,IAAIN,OAAO,CAACO,MAAM,EAAE;QAClBF,cAAcE,KAAK,GAAGP,OAAO,CAACO,MAAM;IACtC;IAEA,OAAOF;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/writeArrowUpdates.ts"],"sourcesContent":["import { MiddlewareData } from '@floating-ui/dom';\n\n/**\n * Writes all DOM element updates after position is computed\n */\nexport function writeArrowUpdates(options: { arrow: HTMLElement | null; middlewareData: MiddlewareData }): void {\n const { arrow, middlewareData } = options;\n if (!middlewareData.arrow || !arrow) {\n return;\n }\n\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n Object.assign(arrow.style, {\n left: arrowX !== null && arrowX !== undefined ? `${arrowX}px` : '',\n top: arrowY !== null && arrowY !== undefined ? `${arrowY}px` : '',\n });\n}\n"],"names":["writeArrowUpdates","options","arrow","middlewareData","x","arrowX","y","arrowY","Object","assign","style","left","undefined","top"],"mappings":"AAEA;;CAEC,GACD;;;;;;;;;;AAAO,SAASA,kBAAkBC,OAAsE;IACtG,MAAM,EAAEC,KAAK,EAAEC,cAAc,EAAE,GAAGF;IAClC,IAAI,CAACE,eAAeD,KAAK,IAAI,CAACA,OAAO;QACnC;IACF;IAEA,MAAM,EAAEE,GAAGC,MAAM,EAAEC,GAAGC,MAAM,EAAE,GAAGJ,eAAeD,KAAK;IAErDM,OAAOC,MAAM,CAACP,MAAMQ,KAAK,EAAE;QACzBC,MAAMN,WAAW,QAAQA,WAAWO,YAAY,GAAGP,OAAO,EAAE,CAAC,GAAG;QAChEQ,KAAKN,WAAW,QAAQA,WAAWK,YAAY,GAAGL,OAAO,EAAE,CAAC,GAAG;IACjE;AACF"}
1
+ {"version":3,"sources":["../src/utils/writeArrowUpdates.ts"],"sourcesContent":["import type { MiddlewareData } from '@floating-ui/dom';\n\n/**\n * Writes all DOM element updates after position is computed\n */\nexport function writeArrowUpdates(options: { arrow: HTMLElement | null; middlewareData: MiddlewareData }): void {\n const { arrow, middlewareData } = options;\n if (!middlewareData.arrow || !arrow) {\n return;\n }\n\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n Object.assign(arrow.style, {\n left: arrowX !== null && arrowX !== undefined ? `${arrowX}px` : '',\n top: arrowY !== null && arrowY !== undefined ? `${arrowY}px` : '',\n });\n}\n"],"names":["writeArrowUpdates","options","arrow","middlewareData","x","arrowX","y","arrowY","Object","assign","style","left","undefined","top"],"mappings":"AAEA;;CAEC,GACD;;;;;;;;;;AAAO,SAASA,kBAAkBC,OAAsE;IACtG,MAAM,EAAEC,KAAK,EAAEC,cAAc,EAAE,GAAGF;IAClC,IAAI,CAACE,eAAeD,KAAK,IAAI,CAACA,OAAO;QACnC;IACF;IAEA,MAAM,EAAEE,GAAGC,MAAM,EAAEC,GAAGC,MAAM,EAAE,GAAGJ,eAAeD,KAAK;IAErDM,OAAOC,MAAM,CAACP,MAAMQ,KAAK,EAAE;QACzBC,MAAMN,WAAW,QAAQA,WAAWO,YAAY,GAAGP,OAAO,EAAE,CAAC,GAAG;QAChEQ,KAAKN,WAAW,QAAQA,WAAWK,YAAY,GAAGL,OAAO,EAAE,CAAC,GAAG;IACjE;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-positioning",
3
- "version": "9.22.0",
3
+ "version": "9.22.1",
4
4
  "description": "A react wrapper around Popper.js for Fluent UI",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -16,7 +16,7 @@
16
16
  "@floating-ui/devtools": "^0.2.3",
17
17
  "@fluentui/react-shared-contexts": "^9.26.2",
18
18
  "@fluentui/react-theme": "^9.2.1",
19
- "@fluentui/react-utilities": "^9.26.2",
19
+ "@fluentui/react-utilities": "^9.26.3",
20
20
  "@griffel/react": "^1.5.32",
21
21
  "@swc/helpers": "^0.5.1",
22
22
  "use-sync-external-store": "^1.2.0"