@fluentui/react-positioning 9.5.4 → 9.5.6
Sign up to get free protection for your applications and to get access to all the features.
- package/.swcrc +30 -0
- package/CHANGELOG.json +55 -1
- package/CHANGELOG.md +24 -2
- package/lib/constants.js.map +1 -1
- package/lib/createArrowStyles.js.map +1 -1
- package/lib/createPositionManager.js.map +1 -1
- package/lib/createVirtualElementFromClick.js +1 -2
- package/lib/createVirtualElementFromClick.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/middleware/coverTarget.js.map +1 -1
- package/lib/middleware/flip.js.map +1 -1
- package/lib/middleware/index.js.map +1 -1
- package/lib/middleware/intersecting.js.map +1 -1
- package/lib/middleware/maxSize.js.map +1 -1
- package/lib/middleware/offset.js.map +1 -1
- package/lib/middleware/shift.js.map +1 -1
- package/lib/types.js +1 -1
- package/lib/types.js.map +1 -1
- package/lib/usePositioning.js +23 -21
- package/lib/usePositioning.js.map +1 -1
- package/lib/usePositioningMouseTarget.js.map +1 -1
- package/lib/utils/debounce.js +1 -2
- package/lib/utils/debounce.js.map +1 -1
- package/lib/utils/fromFloatingUIPlacement.js.map +1 -1
- package/lib/utils/getBoundary.js.map +1 -1
- package/lib/utils/getFloatingUIOffset.js.map +1 -1
- package/lib/utils/getReactFiberFromNode.js +1 -0
- package/lib/utils/getReactFiberFromNode.js.map +1 -1
- package/lib/utils/getScrollParent.js +5 -6
- package/lib/utils/getScrollParent.js.map +1 -1
- package/lib/utils/hasAutoFocusFilter.js +2 -2
- package/lib/utils/hasAutoFocusFilter.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/mergeArrowOffset.js +3 -4
- package/lib/utils/mergeArrowOffset.js.map +1 -1
- package/lib/utils/parseFloatingUIPlacement.js +1 -2
- package/lib/utils/parseFloatingUIPlacement.js.map +1 -1
- package/lib/utils/resolvePositioningShorthand.js.map +1 -1
- package/lib/utils/toFloatingUIPadding.js.map +1 -1
- package/lib/utils/toFloatingUIPlacement.js.map +1 -1
- package/lib/utils/toggleScrollListener.js.map +1 -1
- package/lib/utils/useCallbackRef.js.map +1 -1
- package/lib/utils/writeArrowUpdates.js +1 -2
- package/lib/utils/writeArrowUpdates.js.map +1 -1
- package/lib/utils/writeContainerupdates.js +4 -4
- package/lib/utils/writeContainerupdates.js.map +1 -1
- package/lib-commonjs/constants.js +18 -7
- package/lib-commonjs/constants.js.map +1 -1
- package/lib-commonjs/createArrowStyles.js +60 -88
- package/lib-commonjs/createArrowStyles.js.map +1 -1
- package/lib-commonjs/createPositionManager.js +103 -117
- package/lib-commonjs/createPositionManager.js.map +1 -1
- package/lib-commonjs/createVirtualElementFromClick.js +27 -26
- package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
- package/lib-commonjs/index.js +24 -51
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/middleware/coverTarget.js +34 -37
- package/lib-commonjs/middleware/coverTarget.js.map +1 -1
- package/lib-commonjs/middleware/flip.js +31 -38
- package/lib-commonjs/middleware/flip.js.map +1 -1
- package/lib-commonjs/middleware/index.js +10 -9
- package/lib-commonjs/middleware/index.js.map +1 -1
- package/lib-commonjs/middleware/intersecting.js +24 -22
- package/lib-commonjs/middleware/intersecting.js.map +1 -1
- package/lib-commonjs/middleware/maxSize.js +34 -40
- package/lib-commonjs/middleware/maxSize.js.map +1 -1
- package/lib-commonjs/middleware/offset.js +11 -12
- package/lib-commonjs/middleware/offset.js.map +1 -1
- package/lib-commonjs/middleware/shift.js +29 -37
- package/lib-commonjs/middleware/shift.js.map +1 -1
- package/lib-commonjs/types.js +5 -2
- package/lib-commonjs/types.js.map +1 -1
- package/lib-commonjs/usePositioning.js +200 -164
- package/lib-commonjs/usePositioning.js.map +1 -1
- package/lib-commonjs/usePositioningMouseTarget.js +34 -37
- package/lib-commonjs/usePositioningMouseTarget.js.map +1 -1
- package/lib-commonjs/utils/debounce.js +22 -21
- package/lib-commonjs/utils/debounce.js.map +1 -1
- package/lib-commonjs/utils/fromFloatingUIPlacement.js +30 -35
- package/lib-commonjs/utils/fromFloatingUIPlacement.js.map +1 -1
- package/lib-commonjs/utils/getBoundary.js +21 -22
- package/lib-commonjs/utils/getBoundary.js.map +1 -1
- package/lib-commonjs/utils/getFloatingUIOffset.js +23 -35
- package/lib-commonjs/utils/getFloatingUIOffset.js.map +1 -1
- package/lib-commonjs/utils/getReactFiberFromNode.js +45 -41
- package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
- package/lib-commonjs/utils/getScrollParent.js +52 -56
- package/lib-commonjs/utils/getScrollParent.js.map +1 -1
- package/lib-commonjs/utils/hasAutoFocusFilter.js +18 -17
- package/lib-commonjs/utils/hasAutoFocusFilter.js.map +1 -1
- package/lib-commonjs/utils/index.js +19 -18
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/mergeArrowOffset.js +33 -32
- package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
- package/lib-commonjs/utils/parseFloatingUIPlacement.js +15 -14
- package/lib-commonjs/utils/parseFloatingUIPlacement.js.map +1 -1
- package/lib-commonjs/utils/resolvePositioningShorthand.js +63 -61
- package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
- package/lib-commonjs/utils/toFloatingUIPadding.js +23 -25
- package/lib-commonjs/utils/toFloatingUIPadding.js.map +1 -1
- package/lib-commonjs/utils/toFloatingUIPlacement.js +31 -33
- package/lib-commonjs/utils/toFloatingUIPlacement.js.map +1 -1
- package/lib-commonjs/utils/toggleScrollListener.js +20 -24
- package/lib-commonjs/utils/toggleScrollListener.js.map +1 -1
- package/lib-commonjs/utils/useCallbackRef.js +39 -53
- package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
- package/lib-commonjs/utils/writeArrowUpdates.js +19 -24
- package/lib-commonjs/utils/writeArrowUpdates.js.map +1 -1
- package/lib-commonjs/utils/writeContainerupdates.js +37 -45
- package/lib-commonjs/utils/writeContainerupdates.js.map +1 -1
- package/package.json +7 -6
- package/lib-amd/constants.js +0 -10
- package/lib-amd/constants.js.map +0 -1
- package/lib-amd/createArrowStyles.js +0 -62
- package/lib-amd/createArrowStyles.js.map +0 -1
- package/lib-amd/createPositionManager.js +0 -97
- package/lib-amd/createPositionManager.js.map +0 -1
- package/lib-amd/createVirtualElementFromClick.js +0 -32
- package/lib-amd/createVirtualElementFromClick.js.map +0 -1
- package/lib-amd/index.js +0 -13
- package/lib-amd/index.js.map +0 -1
- package/lib-amd/middleware/coverTarget.js +0 -32
- package/lib-amd/middleware/coverTarget.js.map +0 -1
- package/lib-amd/middleware/flip.js +0 -19
- package/lib-amd/middleware/flip.js.map +0 -1
- package/lib-amd/middleware/index.js +0 -11
- package/lib-amd/middleware/index.js.map +0 -1
- package/lib-amd/middleware/intersecting.js +0 -33
- package/lib-amd/middleware/intersecting.js.map +0 -1
- package/lib-amd/middleware/maxSize.js +0 -33
- package/lib-amd/middleware/maxSize.js.map +0 -1
- package/lib-amd/middleware/offset.js +0 -14
- package/lib-amd/middleware/offset.js.map +0 -1
- package/lib-amd/middleware/shift.js +0 -17
- package/lib-amd/middleware/shift.js.map +0 -1
- package/lib-amd/types.js +0 -5
- package/lib-amd/types.js.map +0 -1
- package/lib-amd/usePositioning.js +0 -161
- package/lib-amd/usePositioning.js.map +0 -1
- package/lib-amd/usePositioningMouseTarget.js +0 -39
- package/lib-amd/usePositioningMouseTarget.js.map +0 -1
- package/lib-amd/utils/debounce.js +0 -27
- package/lib-amd/utils/debounce.js.map +0 -1
- package/lib-amd/utils/fromFloatingUIPlacement.js +0 -37
- package/lib-amd/utils/fromFloatingUIPlacement.js.map +0 -1
- package/lib-amd/utils/getBoundary.js +0 -26
- package/lib-amd/utils/getBoundary.js.map +0 -1
- package/lib-amd/utils/getFloatingUIOffset.js +0 -25
- package/lib-amd/utils/getFloatingUIOffset.js.map +0 -1
- package/lib-amd/utils/getReactFiberFromNode.js +0 -48
- package/lib-amd/utils/getReactFiberFromNode.js.map +0 -1
- package/lib-amd/utils/getScrollParent.js +0 -64
- package/lib-amd/utils/getScrollParent.js.map +0 -1
- package/lib-amd/utils/hasAutoFocusFilter.js +0 -31
- package/lib-amd/utils/hasAutoFocusFilter.js.map +0 -1
- package/lib-amd/utils/index.js +0 -20
- package/lib-amd/utils/index.js.map +0 -1
- package/lib-amd/utils/mergeArrowOffset.js +0 -38
- package/lib-amd/utils/mergeArrowOffset.js.map +0 -1
- package/lib-amd/utils/parseFloatingUIPlacement.js +0 -20
- package/lib-amd/utils/parseFloatingUIPlacement.js.map +0 -1
- package/lib-amd/utils/resolvePositioningShorthand.js +0 -31
- package/lib-amd/utils/resolvePositioningShorthand.js.map +0 -1
- package/lib-amd/utils/toFloatingUIPadding.js +0 -25
- package/lib-amd/utils/toFloatingUIPadding.js.map +0 -1
- package/lib-amd/utils/toFloatingUIPlacement.js +0 -40
- package/lib-amd/utils/toFloatingUIPlacement.js.map +0 -1
- package/lib-amd/utils/toggleScrollListener.js +0 -26
- package/lib-amd/utils/toggleScrollListener.js.map +0 -1
- package/lib-amd/utils/useCallbackRef.js +0 -55
- package/lib-amd/utils/useCallbackRef.js.map +0 -1
- package/lib-amd/utils/writeArrowUpdates.js +0 -21
- package/lib-amd/utils/writeArrowUpdates.js.map +0 -1
- package/lib-amd/utils/writeContainerupdates.js +0 -41
- package/lib-amd/utils/writeContainerupdates.js.map +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"writeContainerupdates.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-positioning/src/utils/writeContainerupdates.ts"],"names":[],"mappings":";;;;IAQA;;OAEG;IACH,SAAgB,qBAAqB,CAAC,OAYrC;;QACS,IAAA,SAAS,GAA+D,OAAO,UAAtE,EAAE,SAAS,GAAoD,OAAO,UAA3D,EAAE,cAAc,GAAoC,OAAO,eAA3C,EAAE,QAAQ,GAA0B,OAAO,SAAjC,EAAE,MAAM,GAAkB,OAAO,OAAzB,EAAE,WAAW,GAAK,OAAO,YAAZ,CAAa;QACxF,IAAI,CAAC,SAAS,EAAE;YACd,OAAO;SACR;QACD,SAAS,CAA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floating-ui/dom';\nimport {\n DATA_POSITIONING_ESCAPED,\n DATA_POSITIONING_HIDDEN,\n DATA_POSITIONING_INTERSECTING,\n DATA_POSITIONING_PLACEMENT,\n} from '../constants';\n\n/**\n * Writes all container element position updates after the position is computed\n */\nexport function writeContainerUpdates(options: {\n container: HTMLElement | null;\n placement: Placement;\n middlewareData: MiddlewareData;\n /**\n * Layer acceleration can disable subpixel rendering which causes slightly\n * blurry text on low PPI displays, so we want to use 2D transforms\n * instead\n */\n lowPPI: boolean;\n strategy: Strategy;\n coordinates: Coords;\n}) {\n const { container, placement, middlewareData, strategy, lowPPI, coordinates } = options;\n if (!container) {\n return;\n }\n container.setAttribute(DATA_POSITIONING_PLACEMENT, placement);\n container.removeAttribute(DATA_POSITIONING_INTERSECTING);\n if (middlewareData.intersectionObserver.intersecting) {\n container.setAttribute(DATA_POSITIONING_INTERSECTING, '');\n }\n\n container.removeAttribute(DATA_POSITIONING_ESCAPED);\n if (middlewareData.hide?.escaped) {\n container.setAttribute(DATA_POSITIONING_ESCAPED, '');\n }\n\n container.removeAttribute(DATA_POSITIONING_HIDDEN);\n if (middlewareData.hide?.referenceHidden) {\n container.setAttribute(DATA_POSITIONING_HIDDEN, '');\n }\n\n // Round so that the coordinates land on device pixels.\n // This prevents blurriness in cases where the browser doesn't apply pixel snapping, such as when other effects like\n // `backdrop-filter: blur()` are applied to the container, and the browser is zoomed in.\n // See https://github.com/microsoft/fluentui/issues/26764 for more info.\n const devicePixelRatio = container.ownerDocument.defaultView?.devicePixelRatio || 1;\n const x = Math.round(coordinates.x * devicePixelRatio) / devicePixelRatio;\n const y = Math.round(coordinates.y * devicePixelRatio) / devicePixelRatio;\n\n Object.assign(container.style, {\n transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,\n position: strategy,\n });\n}\n"]}
|