@fluentui/react-positioning 0.0.0-nightly-20230526-0415.1 → 0.0.0-nightly-20230530-0415.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.json +9 -9
- package/CHANGELOG.md +7 -7
- package/dist/index.d.ts +6 -1
- package/lib/constants.js +1 -0
- package/lib/constants.js.map +1 -1
- package/lib/createArrowStyles.js +48 -54
- package/lib/createArrowStyles.js.map +1 -1
- package/lib/createPositionManager.js +96 -107
- package/lib/createPositionManager.js.map +1 -1
- package/lib/createVirtualElementFromClick.js +19 -18
- package/lib/createVirtualElementFromClick.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/middleware/coverTarget.js +27 -31
- package/lib/middleware/coverTarget.js.map +1 -1
- package/lib/middleware/flip.js +23 -31
- package/lib/middleware/flip.js.map +1 -1
- package/lib/middleware/index.js +1 -0
- package/lib/middleware/index.js.map +1 -1
- package/lib/middleware/intersecting.js +17 -16
- package/lib/middleware/intersecting.js.map +1 -1
- package/lib/middleware/maxSize.js +26 -33
- package/lib/middleware/maxSize.js.map +1 -1
- package/lib/middleware/offset.js +4 -4
- package/lib/middleware/offset.js.map +1 -1
- package/lib/middleware/shift.js +22 -29
- package/lib/middleware/shift.js.map +1 -1
- package/lib/types.js +1 -0
- package/lib/types.js.map +1 -1
- package/lib/usePositioning.js +189 -153
- package/lib/usePositioning.js.map +1 -1
- package/lib/usePositioningMouseTarget.js +25 -22
- package/lib/usePositioningMouseTarget.js.map +1 -1
- package/lib/utils/debounce.js +14 -13
- package/lib/utils/debounce.js.map +1 -1
- package/lib/utils/fromFloatingUIPlacement.js +24 -27
- package/lib/utils/fromFloatingUIPlacement.js.map +1 -1
- package/lib/utils/getBoundary.js +15 -15
- package/lib/utils/getBoundary.js.map +1 -1
- package/lib/utils/getFloatingUIOffset.js +17 -26
- package/lib/utils/getFloatingUIOffset.js.map +1 -1
- package/lib/utils/getReactFiberFromNode.js +37 -36
- package/lib/utils/getReactFiberFromNode.js.map +1 -1
- package/lib/utils/getScrollParent.js +36 -41
- package/lib/utils/getScrollParent.js.map +1 -1
- package/lib/utils/hasAutoFocusFilter.js +10 -10
- package/lib/utils/hasAutoFocusFilter.js.map +1 -1
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/mergeArrowOffset.js +25 -24
- package/lib/utils/mergeArrowOffset.js.map +1 -1
- package/lib/utils/parseFloatingUIPlacement.js +7 -6
- package/lib/utils/parseFloatingUIPlacement.js.map +1 -1
- package/lib/utils/resolvePositioningShorthand.js +56 -55
- package/lib/utils/resolvePositioningShorthand.js.map +1 -1
- package/lib/utils/toFloatingUIPadding.js +17 -20
- package/lib/utils/toFloatingUIPadding.js.map +1 -1
- package/lib/utils/toFloatingUIPlacement.js +26 -26
- package/lib/utils/toFloatingUIPlacement.js.map +1 -1
- package/lib/utils/toggleScrollListener.js +13 -13
- package/lib/utils/toggleScrollListener.js.map +1 -1
- package/lib/utils/useCallbackRef.js +31 -31
- package/lib/utils/useCallbackRef.js.map +1 -1
- package/lib/utils/writeArrowUpdates.js +11 -16
- package/lib/utils/writeArrowUpdates.js.map +1 -1
- package/lib/utils/writeContainerupdates.js +40 -38
- package/lib/utils/writeContainerupdates.js.map +1 -1
- package/lib-commonjs/constants.js.map +1 -1
- package/lib-commonjs/createArrowStyles.js.map +1 -1
- package/lib-commonjs/createPositionManager.js +3 -2
- package/lib-commonjs/createPositionManager.js.map +1 -1
- package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/middleware/coverTarget.js.map +1 -1
- package/lib-commonjs/middleware/flip.js.map +1 -1
- package/lib-commonjs/middleware/index.js.map +1 -1
- package/lib-commonjs/middleware/intersecting.js.map +1 -1
- package/lib-commonjs/middleware/maxSize.js.map +1 -1
- package/lib-commonjs/middleware/offset.js.map +1 -1
- package/lib-commonjs/middleware/shift.js.map +1 -1
- package/lib-commonjs/types.js.map +1 -1
- package/lib-commonjs/usePositioning.js +5 -3
- package/lib-commonjs/usePositioning.js.map +1 -1
- package/lib-commonjs/usePositioningMouseTarget.js.map +1 -1
- package/lib-commonjs/utils/debounce.js.map +1 -1
- package/lib-commonjs/utils/fromFloatingUIPlacement.js.map +1 -1
- package/lib-commonjs/utils/getBoundary.js.map +1 -1
- package/lib-commonjs/utils/getFloatingUIOffset.js.map +1 -1
- package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
- package/lib-commonjs/utils/getScrollParent.js.map +1 -1
- package/lib-commonjs/utils/hasAutoFocusFilter.js.map +1 -1
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
- package/lib-commonjs/utils/parseFloatingUIPlacement.js.map +1 -1
- package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
- package/lib-commonjs/utils/toFloatingUIPadding.js.map +1 -1
- package/lib-commonjs/utils/toFloatingUIPlacement.js.map +1 -1
- package/lib-commonjs/utils/toggleScrollListener.js.map +1 -1
- package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
- package/lib-commonjs/utils/writeArrowUpdates.js.map +1 -1
- package/lib-commonjs/utils/writeContainerupdates.js +11 -2
- package/lib-commonjs/utils/writeContainerupdates.js.map +1 -1
- package/package.json +4 -4
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "writeContainerUpdates", {
|
|
9
9
|
const _constants = require("../constants");
|
10
10
|
function writeContainerUpdates(options) {
|
11
11
|
var _middlewareData_hide, _middlewareData_hide1, _container_ownerDocument_defaultView;
|
12
|
-
const { container , placement , middlewareData , strategy , lowPPI , coordinates } = options;
|
12
|
+
const { container , placement , middlewareData , strategy , lowPPI , coordinates , useTransform =true } = options;
|
13
13
|
if (!container) {
|
14
14
|
return;
|
15
15
|
}
|
@@ -34,9 +34,18 @@ function writeContainerUpdates(options) {
|
|
34
34
|
const x = Math.round(coordinates.x * devicePixelRatio) / devicePixelRatio;
|
35
35
|
const y = Math.round(coordinates.y * devicePixelRatio) / devicePixelRatio;
|
36
36
|
Object.assign(container.style, {
|
37
|
-
transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`,
|
38
37
|
position: strategy
|
39
38
|
});
|
39
|
+
if (useTransform) {
|
40
|
+
Object.assign(container.style, {
|
41
|
+
transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`
|
42
|
+
});
|
43
|
+
return;
|
44
|
+
}
|
45
|
+
Object.assign(container.style, {
|
46
|
+
left: `${x}px`,
|
47
|
+
top: `${y}px`
|
48
|
+
});
|
40
49
|
} //# sourceMappingURL=writeContainerupdates.js.map
|
41
50
|
|
42
51
|
//# sourceMappingURL=writeContainerupdates.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../lib/utils/writeContainerupdates.js"],"sourcesContent":["import { DATA_POSITIONING_ESCAPED, DATA_POSITIONING_HIDDEN, DATA_POSITIONING_INTERSECTING, DATA_POSITIONING_PLACEMENT } from '../constants';\n/**\n * Writes all container element position updates after the position is computed\n
|
1
|
+
{"version":3,"sources":["../../lib/utils/writeContainerupdates.js"],"sourcesContent":["import { DATA_POSITIONING_ESCAPED, DATA_POSITIONING_HIDDEN, DATA_POSITIONING_INTERSECTING, DATA_POSITIONING_PLACEMENT } from '../constants';\n/**\n * Writes all container element position updates after the position is computed\n */ export function writeContainerUpdates(options) {\n var _middlewareData_hide, _middlewareData_hide1, _container_ownerDocument_defaultView;\n const { container , placement , middlewareData , strategy , lowPPI , coordinates , useTransform =true } = 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 container.removeAttribute(DATA_POSITIONING_ESCAPED);\n if ((_middlewareData_hide = middlewareData.hide) === null || _middlewareData_hide === void 0 ? void 0 : _middlewareData_hide.escaped) {\n container.setAttribute(DATA_POSITIONING_ESCAPED, '');\n }\n container.removeAttribute(DATA_POSITIONING_HIDDEN);\n if ((_middlewareData_hide1 = middlewareData.hide) === null || _middlewareData_hide1 === void 0 ? void 0 : _middlewareData_hide1.referenceHidden) {\n container.setAttribute(DATA_POSITIONING_HIDDEN, '');\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 = container.ownerDocument.defaultView) === null || _container_ownerDocument_defaultView === void 0 ? void 0 : _container_ownerDocument_defaultView.devicePixelRatio) || 1;\n const x = Math.round(coordinates.x * devicePixelRatio) / devicePixelRatio;\n const y = Math.round(coordinates.y * devicePixelRatio) / devicePixelRatio;\n Object.assign(container.style, {\n position: strategy\n });\n if (useTransform) {\n Object.assign(container.style, {\n transform: lowPPI ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`\n });\n return;\n }\n Object.assign(container.style, {\n left: `${x}px`,\n top: `${y}px`\n });\n}\n\n//# sourceMappingURL=writeContainerupdates.js.map"],"names":["writeContainerUpdates","options","_middlewareData_hide","_middlewareData_hide1","_container_ownerDocument_defaultView","container","placement","middlewareData","strategy","lowPPI","coordinates","useTransform","setAttribute","DATA_POSITIONING_PLACEMENT","removeAttribute","DATA_POSITIONING_INTERSECTING","intersectionObserver","intersecting","DATA_POSITIONING_ESCAPED","hide","escaped","DATA_POSITIONING_HIDDEN","referenceHidden","devicePixelRatio","ownerDocument","defaultView","x","Math","round","y","Object","assign","style","position","transform","left","top"],"mappings":";;;;+BAGoBA;;aAAAA;;2BAHyG;AAGlH,SAASA,sBAAsBC,OAAO,EAAE;IAC/C,IAAIC,sBAAsBC,uBAAuBC;IACjD,MA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ACA,IAAIG,cAAc;QACdmB,OAAOC,MAAM,CAAC1B,UAAU2B,KAAK,EAAE;YAC3BE,WAAWzB,SAAS,CAAC,UAAU,EAAEiB,EAAE,IAAI,EAAEG,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,EAAEH,EAAE,IAAI,EAAEG,EAAE,MAAM,CAAC;QACtF;QACA;IACJ,CAAC;IACDC,OAAOC,MAAM,CAAC1B,UAAU2B,KAAK,EAAE;QAC3BG,MAAM,CAAC,EAAET,EAAE,EAAE,CAAC;QACdU,KAAK,CAAC,EAAEP,EAAE,EAAE,CAAC;IACjB;AACJ,EAEA,iDAAiD"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-positioning",
|
3
|
-
"version": "0.0.0-nightly-
|
3
|
+
"version": "0.0.0-nightly-20230530-0415.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",
|
@@ -30,9 +30,9 @@
|
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
32
|
"@floating-ui/dom": "^1.2.0",
|
33
|
-
"@fluentui/react-shared-contexts": "0.0.0-nightly-
|
34
|
-
"@fluentui/react-theme": "0.0.0-nightly-
|
35
|
-
"@fluentui/react-utilities": "0.0.0-nightly-
|
33
|
+
"@fluentui/react-shared-contexts": "0.0.0-nightly-20230530-0415.1",
|
34
|
+
"@fluentui/react-theme": "0.0.0-nightly-20230530-0415.1",
|
35
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20230530-0415.1",
|
36
36
|
"@griffel/react": "^1.5.2",
|
37
37
|
"@swc/helpers": "^0.4.14"
|
38
38
|
},
|