@fluentui/react-positioning 9.15.10 → 9.15.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. package/CHANGELOG.md +23 -2
  2. package/lib/constants.js.map +1 -1
  3. package/lib/createArrowStyles.js.map +1 -1
  4. package/lib/createPositionManager.js.map +1 -1
  5. package/lib/createSlideStyles.js.map +1 -1
  6. package/lib/createVirtualElementFromClick.js.map +1 -1
  7. package/lib/index.js.map +1 -1
  8. package/lib/middleware/coverTarget.js.map +1 -1
  9. package/lib/middleware/flip.js.map +1 -1
  10. package/lib/middleware/index.js.map +1 -1
  11. package/lib/middleware/intersecting.js.map +1 -1
  12. package/lib/middleware/matchTargetSize.js.map +1 -1
  13. package/lib/middleware/maxSize.js.map +1 -1
  14. package/lib/middleware/offset.js.map +1 -1
  15. package/lib/middleware/shift.js.map +1 -1
  16. package/lib/types.js.map +1 -1
  17. package/lib/usePositioning.js.map +1 -1
  18. package/lib/usePositioningMouseTarget.js.map +1 -1
  19. package/lib/utils/createResizeObserver.js.map +1 -1
  20. package/lib/utils/debounce.js.map +1 -1
  21. package/lib/utils/devtools.js.map +1 -1
  22. package/lib/utils/fromFloatingUIPlacement.js.map +1 -1
  23. package/lib/utils/getBoundary.js.map +1 -1
  24. package/lib/utils/getFloatingUIOffset.js.map +1 -1
  25. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  26. package/lib/utils/getScrollParent.js.map +1 -1
  27. package/lib/utils/hasAutoFocusFilter.js.map +1 -1
  28. package/lib/utils/index.js.map +1 -1
  29. package/lib/utils/listScrollParents.js.map +1 -1
  30. package/lib/utils/mergeArrowOffset.js.map +1 -1
  31. package/lib/utils/normalizeAutoSize.js.map +1 -1
  32. package/lib/utils/parseFloatingUIPlacement.js.map +1 -1
  33. package/lib/utils/resolvePositioningShorthand.js.map +1 -1
  34. package/lib/utils/toFloatingUIPadding.js.map +1 -1
  35. package/lib/utils/toFloatingUIPlacement.js.map +1 -1
  36. package/lib/utils/toggleScrollListener.js.map +1 -1
  37. package/lib/utils/useCallbackRef.js.map +1 -1
  38. package/lib/utils/writeArrowUpdates.js +2 -2
  39. package/lib/utils/writeArrowUpdates.js.map +1 -1
  40. package/lib/utils/writeContainerupdates.js.map +1 -1
  41. package/lib-commonjs/constants.js.map +1 -1
  42. package/lib-commonjs/createArrowStyles.js.map +1 -1
  43. package/lib-commonjs/createPositionManager.js.map +1 -1
  44. package/lib-commonjs/createSlideStyles.js.map +1 -1
  45. package/lib-commonjs/createVirtualElementFromClick.js +1 -4
  46. package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
  47. package/lib-commonjs/index.js.map +1 -1
  48. package/lib-commonjs/middleware/coverTarget.js.map +1 -1
  49. package/lib-commonjs/middleware/flip.js.map +1 -1
  50. package/lib-commonjs/middleware/index.js.map +1 -1
  51. package/lib-commonjs/middleware/intersecting.js.map +1 -1
  52. package/lib-commonjs/middleware/matchTargetSize.js.map +1 -1
  53. package/lib-commonjs/middleware/maxSize.js.map +1 -1
  54. package/lib-commonjs/middleware/offset.js.map +1 -1
  55. package/lib-commonjs/middleware/shift.js.map +1 -1
  56. package/lib-commonjs/types.js.map +1 -1
  57. package/lib-commonjs/usePositioning.js +4 -2
  58. package/lib-commonjs/usePositioning.js.map +1 -1
  59. package/lib-commonjs/usePositioningMouseTarget.js.map +1 -1
  60. package/lib-commonjs/utils/createResizeObserver.js.map +1 -1
  61. package/lib-commonjs/utils/debounce.js.map +1 -1
  62. package/lib-commonjs/utils/devtools.js.map +1 -1
  63. package/lib-commonjs/utils/fromFloatingUIPlacement.js.map +1 -1
  64. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  65. package/lib-commonjs/utils/getFloatingUIOffset.js.map +1 -1
  66. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  67. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  68. package/lib-commonjs/utils/hasAutoFocusFilter.js.map +1 -1
  69. package/lib-commonjs/utils/index.js.map +1 -1
  70. package/lib-commonjs/utils/listScrollParents.js.map +1 -1
  71. package/lib-commonjs/utils/mergeArrowOffset.js +1 -9
  72. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  73. package/lib-commonjs/utils/normalizeAutoSize.js +1 -5
  74. package/lib-commonjs/utils/normalizeAutoSize.js.map +1 -1
  75. package/lib-commonjs/utils/parseFloatingUIPlacement.js +1 -6
  76. package/lib-commonjs/utils/parseFloatingUIPlacement.js.map +1 -1
  77. package/lib-commonjs/utils/resolvePositioningShorthand.js +1 -1
  78. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  79. package/lib-commonjs/utils/toFloatingUIPadding.js.map +1 -1
  80. package/lib-commonjs/utils/toFloatingUIPlacement.js.map +1 -1
  81. package/lib-commonjs/utils/toggleScrollListener.js.map +1 -1
  82. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  83. package/lib-commonjs/utils/writeArrowUpdates.js +3 -5
  84. package/lib-commonjs/utils/writeArrowUpdates.js.map +1 -1
  85. package/lib-commonjs/utils/writeContainerupdates.js.map +1 -1
  86. package/package.json +5 -18
@@ -1 +1 @@
1
- {"version":3,"sources":["writeContainerupdates.ts"],"sourcesContent":["import type { Placement, MiddlewareData, Strategy, Coords } from '@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 useTransform?: boolean;\n}) {\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\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 position: strategy,\n });\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\n Object.assign(container.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n}\n"],"names":["writeContainerUpdates","options","middlewareData","container","placement","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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWgBA;;;eAAAA;;;2BALT;AAKA,SAASA,sBAAsBC,OAarC;QAYKC,sBAKAA,uBAQqBC;IAxBzB,MAAM,EAAEA,SAAS,EAAEC,SAAS,EAAEF,cAAc,EAA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B,SAAS,CAAC,UAAU,EAAEiB,EAAE,IAAI,EAAEG,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,EAAEH,EAAE,IAAI,EAAEG,EAAE,MAAM,CAAC;QACpF;QACA;IACF;IAEAC,OAAOC,MAAM,CAACzB,UAAU0B,KAAK,EAAE;QAC7BG,MAAM,CAAC,EAAET,EAAE,EAAE,CAAC;QACdU,KAAK,CAAC,EAAEP,EAAE,EAAE,CAAC;IACf;AACF"}
1
+ {"version":3,"sources":["../src/utils/writeContainerupdates.ts"],"sourcesContent":["import type { Placement, MiddlewareData, Strategy, Coords } from '@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 useTransform?: boolean;\n}) {\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\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 position: strategy,\n });\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\n Object.assign(container.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n}\n"],"names":["writeContainerUpdates","options","middlewareData","container","placement","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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWgBA;;;eAAAA;;;2BALT;AAKA,SAASA,sBAAsBC,OAarC;QAYKC,sBAKAA,uBAQqBC;IAxBzB,MAAM,EAAEA,SAAS,EAAEC,SAAS,EAAEF,cAAc,EAAEG,QAAQ,EAAEC,MAAM,EAAEC,WAAW,EAAEC,eAAe,IAAI,EAAE,GAAGP;IACrG,IAAI,CAACE,WAAW;QACd;IACF;IACAA,UAAUM,YAAY,CAACC,qCAA0B,EAAEN;IACnDD,UAAUQ,eAAe,CAACC,wCAA6B;IACvD,IAAIV,eAAeW,oBAAoB,CAACC,YAAY,EAAE;QACpDX,UAAUM,YAAY,CAACG,wCAA6B,EAAE;IACxD;IAEAT,UAAUQ,eAAe,CAACI,mCAAwB;IAClD,KAAIb,uBAAAA,eAAec,IAAI,cAAnBd,2CAAAA,qBAAqBe,OAAO,EAAE;QAChCd,UAAUM,YAAY,CAACM,mCAAwB,EAAE;IACnD;IAEAZ,UAAUQ,eAAe,CAACO,kCAAuB;IACjD,KAAIhB,wBAAAA,eAAec,IAAI,cAAnBd,4CAAAA,sBAAqBiB,eAAe,EAAE;QACxChB,UAAUM,YAAY,CAACS,kCAAuB,EAAE;IAClD;IAEA,uDAAuD;IACvD,oHAAoH;IACpH,wFAAwF;IACxF,wEAAwE;IACxE,MAAME,mBAAmBjB,EAAAA,uCAAAA,UAAUkB,aAAa,CAACC,WAAW,cAAnCnB,2DAAAA,qCAAqCiB,gBAAgB,KAAI;IAClF,MAAMG,IAAIC,KAAKC,KAAK,CAAClB,YAAYgB,CAAC,GAAGH,oBAAoBA;IACzD,MAAMM,IAAIF,KAAKC,KAAK,CAAClB,YAAYmB,CAAC,GAAGN,oBAAoBA;IAEzDO,OAAOC,MAAM,CAACzB,UAAU0B,KAAK,EAAE;QAC7BC,UAAUzB;IACZ;IAEA,IAAIG,cAAc;QAChBmB,OAAOC,MAAM,CAACzB,UAAU0B,KAAK,EAAE;YAC7BE,WAAWzB,SAAS,CAAC,UAAU,EAAEiB,EAAE,IAAI,EAAEG,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,EAAEH,EAAE,IAAI,EAAEG,EAAE,MAAM,CAAC;QACpF;QACA;IACF;IAEAC,OAAOC,MAAM,CAACzB,UAAU0B,KAAK,EAAE;QAC7BG,MAAM,CAAC,EAAET,EAAE,EAAE,CAAC;QACdU,KAAK,CAAC,EAAEP,EAAE,EAAE,CAAC;IACf;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-positioning",
3
- "version": "9.15.10",
3
+ "version": "9.15.12",
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",
@@ -11,29 +11,16 @@
11
11
  "url": "https://github.com/microsoft/fluentui"
12
12
  },
13
13
  "license": "MIT",
14
- "scripts": {
15
- "build": "just-scripts build",
16
- "bundle-size": "monosize measure",
17
- "clean": "just-scripts clean",
18
- "code-style": "just-scripts code-style",
19
- "just": "just-scripts",
20
- "lint": "just-scripts lint",
21
- "test": "jest --passWithNoTests",
22
- "type-check": "just-scripts type-check",
23
- "generate-api": "just-scripts generate-api",
24
- "test-ssr": "test-ssr \"./stories/**/*.stories.tsx\""
25
- },
26
14
  "devDependencies": {
27
15
  "@fluentui/eslint-plugin": "*",
28
- "@fluentui/scripts-api-extractor": "*",
29
- "@fluentui/scripts-tasks": "*"
16
+ "@fluentui/scripts-api-extractor": "*"
30
17
  },
31
18
  "dependencies": {
32
19
  "@floating-ui/dom": "^1.2.0",
33
20
  "@floating-ui/devtools": "0.2.1",
34
- "@fluentui/react-shared-contexts": "^9.20.2",
35
- "@fluentui/react-theme": "^9.1.21",
36
- "@fluentui/react-utilities": "^9.18.16",
21
+ "@fluentui/react-shared-contexts": "^9.21.0",
22
+ "@fluentui/react-theme": "^9.1.22",
23
+ "@fluentui/react-utilities": "^9.18.17",
37
24
  "@griffel/react": "^1.5.22",
38
25
  "@swc/helpers": "^0.5.1"
39
26
  },