@fluentui/react-positioning 9.9.0 → 9.9.2

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,55 @@
2
2
  "name": "@fluentui/react-positioning",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 27 Jul 2023 10:33:12 GMT",
5
+ "date": "Fri, 04 Aug 2023 08:48:25 GMT",
6
+ "tag": "@fluentui/react-positioning_v9.9.2",
7
+ "version": "9.9.2",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui/react-positioning",
13
+ "comment": "Bump @fluentui/react-shared-contexts to v9.7.1",
14
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-positioning",
19
+ "comment": "Bump @fluentui/react-theme to v9.1.10",
20
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-positioning",
25
+ "comment": "Bump @fluentui/react-utilities to v9.11.0",
26
+ "commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
27
+ }
28
+ ]
29
+ }
30
+ },
31
+ {
32
+ "date": "Tue, 01 Aug 2023 10:17:19 GMT",
33
+ "tag": "@fluentui/react-positioning_v9.9.1",
34
+ "version": "9.9.1",
35
+ "comments": {
36
+ "patch": [
37
+ {
38
+ "author": "yuanboxue@microsoft.com",
39
+ "package": "@fluentui/react-positioning",
40
+ "commit": "412d815f88863bde8bb16abc8fd9c4140a37f1f5",
41
+ "comment": "fix: autoSize causing maximum positioning update"
42
+ },
43
+ {
44
+ "author": "beachball",
45
+ "package": "@fluentui/react-positioning",
46
+ "comment": "Bump @fluentui/react-shared-contexts to v9.7.0",
47
+ "commit": "412d815f88863bde8bb16abc8fd9c4140a37f1f5"
48
+ }
49
+ ]
50
+ }
51
+ },
52
+ {
53
+ "date": "Thu, 27 Jul 2023 10:34:13 GMT",
6
54
  "tag": "@fluentui/react-positioning_v9.9.0",
7
55
  "version": "9.9.0",
8
56
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,33 @@
1
1
  # Change Log - @fluentui/react-positioning
2
2
 
3
- This log was last generated on Thu, 27 Jul 2023 10:33:12 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 04 Aug 2023 08:48:25 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.9.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.9.2)
8
+
9
+ Fri, 04 Aug 2023 08:48:25 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.9.1..@fluentui/react-positioning_v9.9.2)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-shared-contexts to v9.7.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
15
+ - Bump @fluentui/react-theme to v9.1.10 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
16
+ - Bump @fluentui/react-utilities to v9.11.0 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
17
+
18
+ ## [9.9.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.9.1)
19
+
20
+ Tue, 01 Aug 2023 10:17:19 GMT
21
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.9.0..@fluentui/react-positioning_v9.9.1)
22
+
23
+ ### Patches
24
+
25
+ - fix: autoSize causing maximum positioning update ([PR #28689](https://github.com/microsoft/fluentui/pull/28689) by yuanboxue@microsoft.com)
26
+ - Bump @fluentui/react-shared-contexts to v9.7.0 ([PR #28689](https://github.com/microsoft/fluentui/pull/28689) by beachball)
27
+
7
28
  ## [9.9.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.9.0)
8
29
 
9
- Thu, 27 Jul 2023 10:33:12 GMT
30
+ Thu, 27 Jul 2023 10:34:13 GMT
10
31
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.8.0..@fluentui/react-positioning_v9.9.0)
11
32
 
12
33
  ### Minor changes
@@ -4,10 +4,12 @@ import { getBoundary } from '../utils/getBoundary';
4
4
  * floating-ui `size` middleware uses floating element's height/width to calculate available height/width.
5
5
  * This middleware only runs once per lifecycle, resetting styles applied by maxSize from previous lifecycle.
6
6
  * Then floating element's original size is restored and `size` middleware can calculate available height/width correctly.
7
- */ export const resetMaxSize = (autoSize)=>({
7
+ */ export const resetMaxSize = (autoSize)=>{
8
+ return {
8
9
  name: 'resetMaxSize',
9
- fn ({ middlewareData: { maxSizeAlreadyReset } , elements }) {
10
- if (maxSizeAlreadyReset) {
10
+ fn ({ middlewareData , elements }) {
11
+ var _middlewareData_resetMaxSize;
12
+ if ((_middlewareData_resetMaxSize = middlewareData.resetMaxSize) === null || _middlewareData_resetMaxSize === void 0 ? void 0 : _middlewareData_resetMaxSize.maxSizeAlreadyReset) {
11
13
  return {};
12
14
  }
13
15
  const { applyMaxWidth , applyMaxHeight } = autoSize;
@@ -30,7 +32,8 @@ import { getBoundary } from '../utils/getBoundary';
30
32
  }
31
33
  };
32
34
  }
33
- });
35
+ };
36
+ };
34
37
  export function maxSize(autoSize, options) {
35
38
  const { container , overflowBoundary } = options;
36
39
  return size({
@@ -1 +1 @@
1
- {"version":3,"sources":["maxSize.ts"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport type { Middleware } from '@floating-ui/dom';\nimport type { NormalizedAutoSize, PositioningOptions } from '../types';\nimport { getBoundary } from '../utils/getBoundary';\nexport interface MaxSizeMiddlewareOptions extends Pick<PositioningOptions, 'overflowBoundary'> {\n container: HTMLElement | null;\n}\n\n/**\n * floating-ui `size` middleware uses floating element's height/width to calculate available height/width.\n * This middleware only runs once per lifecycle, resetting styles applied by maxSize from previous lifecycle.\n * Then floating element's original size is restored and `size` middleware can calculate available height/width correctly.\n */\nexport const resetMaxSize = (autoSize: NormalizedAutoSize): Middleware => ({\n name: 'resetMaxSize',\n fn({ middlewareData: { maxSizeAlreadyReset }, elements }) {\n if (maxSizeAlreadyReset) {\n return {};\n }\n\n const { applyMaxWidth, applyMaxHeight } = autoSize;\n if (applyMaxWidth) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-width');\n elements.floating.style.removeProperty('width');\n }\n if (applyMaxHeight) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-height');\n elements.floating.style.removeProperty('height');\n }\n\n return {\n data: { maxSizeAlreadyReset: true },\n reset: { rects: true },\n };\n },\n});\n\nexport function maxSize(autoSize: NormalizedAutoSize, options: MaxSizeMiddlewareOptions): Middleware {\n const { container, overflowBoundary } = options;\n return size({\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n apply({ availableHeight, availableWidth, elements, rects }) {\n const applyMaxSizeStyles = (apply: boolean, dimension: 'width' | 'height', availableSize: number) => {\n if (!apply) {\n return;\n }\n\n elements.floating.style.setProperty('box-sizing', 'border-box');\n elements.floating.style.setProperty(`max-${dimension}`, `${availableSize}px`);\n\n if (rects.floating[dimension] > availableSize) {\n elements.floating.style.setProperty(dimension, `${availableSize}px`);\n\n const axis = dimension === 'width' ? 'x' : 'y';\n if (!elements.floating.style.getPropertyValue(`overflow-${axis}`)) {\n elements.floating.style.setProperty(`overflow-${axis}`, 'auto');\n }\n }\n };\n\n const { applyMaxWidth, applyMaxHeight } = autoSize;\n applyMaxSizeStyles(applyMaxWidth, 'width', availableWidth);\n applyMaxSizeStyles(applyMaxHeight, 'height', availableHeight);\n },\n });\n}\n"],"names":["size","getBoundary","resetMaxSize","autoSize","name","fn","middlewareData","maxSizeAlreadyReset","elements","applyMaxWidth","applyMaxHeight","floating","style","removeProperty","data","reset","rects","maxSize","options","container","overflowBoundary","altBoundary","boundary","apply","availableHeight","availableWidth","applyMaxSizeStyles","dimension","availableSize","setProperty","axis","getPropertyValue"],"mappings":"AAAA,SAASA,IAAI,QAAQ,mBAAmB;AAGxC,SAASC,WAAW,QAAQ,uBAAuB;AAKnD;;;;CAIC,GACD,OAAO,MAAMC,eAAe,CAACC,WAA8C,CAAA;QACzEC,MAAM;QACNC,IAAG,EAAEC,gBAAgB,EAAEC,oBAAmB,EAAE,CAAA,EAAEC,SAAQ,EAAE,EAAE;YACxD,IAAID,qBAAqB;gBACvB,OAAO,CAAC;YACV,CAAC;YAED,MAAM,EAAEE,cAAa,EAAEC,eAAc,EAAE,GAAGP;YAC1C,IAAIM,eAAe;gBACjBD,SAASG,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCL,SAASG,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCL,SAASG,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;YACzC,CAAC;YACD,IAAIH,gBAAgB;gBAClBF,SAASG,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCL,SAASG,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCL,SAASG,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;YACzC,CAAC;YAED,OAAO;gBACLC,MAAM;oBAAEP,qBAAqB,IAAI;gBAAC;gBAClCQ,OAAO;oBAAEC,OAAO,IAAI;gBAAC;YACvB;QACF;IACF,CAAA,EAAG;AAEH,OAAO,SAASC,QAAQd,QAA4B,EAAEe,OAAiC,EAAc;IACnG,MAAM,EAAEC,UAAS,EAAEC,iBAAgB,EAAE,GAAGF;IACxC,OAAOlB,KAAK;QACV,GAAIoB,oBAAoB;YAAEC,aAAa,IAAI;YAAEC,UAAUrB,YAAYkB,WAAWC;QAAkB,CAAC;QACjGG,OAAM,EAAEC,gBAAe,EAAEC,eAAc,EAAEjB,SAAQ,EAAEQ,MAAK,EAAE,EAAE;YAC1D,MAAMU,qBAAqB,CAACH,OAAgBI,WAA+BC,gBAA0B;gBACnG,IAAI,CAACL,OAAO;oBACV;gBACF,CAAC;gBAEDf,SAASG,QAAQ,CAACC,KAAK,CAACiB,WAAW,CAAC,cAAc;gBAClDrB,SAASG,QAAQ,CAACC,KAAK,CAACiB,WAAW,CAAC,CAAC,IAAI,EAAEF,UAAU,CAAC,EAAE,CAAC,EAAEC,cAAc,EAAE,CAAC;gBAE5E,IAAIZ,MAAML,QAAQ,CAACgB,UAAU,GAAGC,eAAe;oBAC7CpB,SAASG,QAAQ,CAACC,KAAK,CAACiB,WAAW,CAACF,WAAW,CAAC,EAAEC,cAAc,EAAE,CAAC;oBAEnE,MAAME,OAAOH,cAAc,UAAU,MAAM,GAAG;oBAC9C,IAAI,CAACnB,SAASG,QAAQ,CAACC,KAAK,CAACmB,gBAAgB,CAAC,CAAC,SAAS,EAAED,KAAK,CAAC,GAAG;wBACjEtB,SAASG,QAAQ,CAACC,KAAK,CAACiB,WAAW,CAAC,CAAC,SAAS,EAAEC,KAAK,CAAC,EAAE;oBAC1D,CAAC;gBACH,CAAC;YACH;YAEA,MAAM,EAAErB,cAAa,EAAEC,eAAc,EAAE,GAAGP;YAC1CuB,mBAAmBjB,eAAe,SAASgB;YAC3CC,mBAAmBhB,gBAAgB,UAAUc;QAC/C;IACF;AACF,CAAC"}
1
+ {"version":3,"sources":["maxSize.ts"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport type { Middleware } from '@floating-ui/dom';\nimport type { NormalizedAutoSize, PositioningOptions } from '../types';\nimport { getBoundary } from '../utils/getBoundary';\nexport interface MaxSizeMiddlewareOptions extends Pick<PositioningOptions, 'overflowBoundary'> {\n container: HTMLElement | null;\n}\n\n/**\n * floating-ui `size` middleware uses floating element's height/width to calculate available height/width.\n * This middleware only runs once per lifecycle, resetting styles applied by maxSize from previous lifecycle.\n * Then floating element's original size is restored and `size` middleware can calculate available height/width correctly.\n */\nexport const resetMaxSize = (autoSize: NormalizedAutoSize): Middleware => ({\n name: 'resetMaxSize',\n fn({ middlewareData, elements }) {\n if (middlewareData.resetMaxSize?.maxSizeAlreadyReset) {\n return {};\n }\n\n const { applyMaxWidth, applyMaxHeight } = autoSize;\n if (applyMaxWidth) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-width');\n elements.floating.style.removeProperty('width');\n }\n if (applyMaxHeight) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-height');\n elements.floating.style.removeProperty('height');\n }\n\n return {\n data: { maxSizeAlreadyReset: true },\n reset: { rects: true },\n };\n },\n});\n\nexport function maxSize(autoSize: NormalizedAutoSize, options: MaxSizeMiddlewareOptions): Middleware {\n const { container, overflowBoundary } = options;\n return size({\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n apply({ availableHeight, availableWidth, elements, rects }) {\n const applyMaxSizeStyles = (apply: boolean, dimension: 'width' | 'height', availableSize: number) => {\n if (!apply) {\n return;\n }\n\n elements.floating.style.setProperty('box-sizing', 'border-box');\n elements.floating.style.setProperty(`max-${dimension}`, `${availableSize}px`);\n\n if (rects.floating[dimension] > availableSize) {\n elements.floating.style.setProperty(dimension, `${availableSize}px`);\n\n const axis = dimension === 'width' ? 'x' : 'y';\n if (!elements.floating.style.getPropertyValue(`overflow-${axis}`)) {\n elements.floating.style.setProperty(`overflow-${axis}`, 'auto');\n }\n }\n };\n\n const { applyMaxWidth, applyMaxHeight } = autoSize;\n applyMaxSizeStyles(applyMaxWidth, 'width', availableWidth);\n applyMaxSizeStyles(applyMaxHeight, 'height', availableHeight);\n },\n });\n}\n"],"names":["size","getBoundary","resetMaxSize","autoSize","name","fn","middlewareData","elements","maxSizeAlreadyReset","applyMaxWidth","applyMaxHeight","floating","style","removeProperty","data","reset","rects","maxSize","options","container","overflowBoundary","altBoundary","boundary","apply","availableHeight","availableWidth","applyMaxSizeStyles","dimension","availableSize","setProperty","axis","getPropertyValue"],"mappings":"AAAA,SAASA,IAAI,QAAQ,mBAAmB;AAGxC,SAASC,WAAW,QAAQ,uBAAuB;AAKnD;;;;CAIC,GACD,OAAO,MAAMC,eAAe,CAACC;IAA8C,OAAA;QACzEC,MAAM;QACNC,IAAG,EAAEC,eAAc,EAAEC,SAAQ,EAAE,EAAE;gBAC3BD;YAAJ,IAAIA,CAAAA,+BAAAA,eAAeJ,YAAY,cAA3BI,0CAAAA,KAAAA,IAAAA,6BAA6BE,mBAAmB,EAAE;gBACpD,OAAO,CAAC;YACV,CAAC;YAED,MAAM,EAAEC,cAAa,EAAEC,eAAc,EAAE,GAAGP;YAC1C,IAAIM,eAAe;gBACjBF,SAASI,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCN,SAASI,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCN,SAASI,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;YACzC,CAAC;YACD,IAAIH,gBAAgB;gBAClBH,SAASI,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCN,SAASI,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCN,SAASI,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;YACzC,CAAC;YAED,OAAO;gBACLC,MAAM;oBAAEN,qBAAqB,IAAI;gBAAC;gBAClCO,OAAO;oBAAEC,OAAO,IAAI;gBAAC;YACvB;QACF;IACF;EAAG;AAEH,OAAO,SAASC,QAAQd,QAA4B,EAAEe,OAAiC,EAAc;IACnG,MAAM,EAAEC,UAAS,EAAEC,iBAAgB,EAAE,GAAGF;IACxC,OAAOlB,KAAK;QACV,GAAIoB,oBAAoB;YAAEC,aAAa,IAAI;YAAEC,UAAUrB,YAAYkB,WAAWC;QAAkB,CAAC;QACjGG,OAAM,EAAEC,gBAAe,EAAEC,eAAc,EAAElB,SAAQ,EAAES,MAAK,EAAE,EAAE;YAC1D,MAAMU,qBAAqB,CAACH,OAAgBI,WAA+BC,gBAA0B;gBACnG,IAAI,CAACL,OAAO;oBACV;gBACF,CAAC;gBAEDhB,SAASI,QAAQ,CAACC,KAAK,CAACiB,WAAW,CAAC,cAAc;gBAClDtB,SAASI,QAAQ,CAACC,KAAK,CAACiB,WAAW,CAAC,CAAC,IAAI,EAAEF,UAAU,CAAC,EAAE,CAAC,EAAEC,cAAc,EAAE,CAAC;gBAE5E,IAAIZ,MAAML,QAAQ,CAACgB,UAAU,GAAGC,eAAe;oBAC7CrB,SAASI,QAAQ,CAACC,KAAK,CAACiB,WAAW,CAACF,WAAW,CAAC,EAAEC,cAAc,EAAE,CAAC;oBAEnE,MAAME,OAAOH,cAAc,UAAU,MAAM,GAAG;oBAC9C,IAAI,CAACpB,SAASI,QAAQ,CAACC,KAAK,CAACmB,gBAAgB,CAAC,CAAC,SAAS,EAAED,KAAK,CAAC,GAAG;wBACjEvB,SAASI,QAAQ,CAACC,KAAK,CAACiB,WAAW,CAAC,CAAC,SAAS,EAAEC,KAAK,CAAC,EAAE;oBAC1D,CAAC;gBACH,CAAC;YACH;YAEA,MAAM,EAAErB,cAAa,EAAEC,eAAc,EAAE,GAAGP;YAC1CuB,mBAAmBjB,eAAe,SAASgB;YAC3CC,mBAAmBhB,gBAAgB,UAAUc;QAC/C;IACF;AACF,CAAC"}
@@ -14,10 +14,12 @@ _export(exports, {
14
14
  });
15
15
  const _dom = require("@floating-ui/dom");
16
16
  const _getBoundary = require("../utils/getBoundary");
17
- const resetMaxSize = (autoSize)=>({
17
+ const resetMaxSize = (autoSize)=>{
18
+ return {
18
19
  name: 'resetMaxSize',
19
- fn ({ middlewareData: { maxSizeAlreadyReset } , elements }) {
20
- if (maxSizeAlreadyReset) {
20
+ fn ({ middlewareData , elements }) {
21
+ var _middlewareData_resetMaxSize;
22
+ if ((_middlewareData_resetMaxSize = middlewareData.resetMaxSize) === null || _middlewareData_resetMaxSize === void 0 ? void 0 : _middlewareData_resetMaxSize.maxSizeAlreadyReset) {
21
23
  return {};
22
24
  }
23
25
  const { applyMaxWidth , applyMaxHeight } = autoSize;
@@ -40,7 +42,8 @@ const resetMaxSize = (autoSize)=>({
40
42
  }
41
43
  };
42
44
  }
43
- });
45
+ };
46
+ };
44
47
  function maxSize(autoSize, options) {
45
48
  const { container , overflowBoundary } = options;
46
49
  return (0, _dom.size)({
@@ -1 +1 @@
1
- {"version":3,"sources":["maxSize.js"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport { getBoundary } from '../utils/getBoundary';\n/**\n * floating-ui `size` middleware uses floating element's height/width to calculate available height/width.\n * This middleware only runs once per lifecycle, resetting styles applied by maxSize from previous lifecycle.\n * Then floating element's original size is restored and `size` middleware can calculate available height/width correctly.\n */ export const resetMaxSize = (autoSize)=>({\n name: 'resetMaxSize',\n fn ({ middlewareData: { maxSizeAlreadyReset } , elements }) {\n if (maxSizeAlreadyReset) {\n return {};\n }\n const { applyMaxWidth , applyMaxHeight } = autoSize;\n if (applyMaxWidth) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-width');\n elements.floating.style.removeProperty('width');\n }\n if (applyMaxHeight) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-height');\n elements.floating.style.removeProperty('height');\n }\n return {\n data: {\n maxSizeAlreadyReset: true\n },\n reset: {\n rects: true\n }\n };\n }\n });\nexport function maxSize(autoSize, options) {\n const { container , overflowBoundary } = options;\n return size({\n ...overflowBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, overflowBoundary)\n },\n apply ({ availableHeight , availableWidth , elements , rects }) {\n const applyMaxSizeStyles = (apply, dimension, availableSize)=>{\n if (!apply) {\n return;\n }\n elements.floating.style.setProperty('box-sizing', 'border-box');\n elements.floating.style.setProperty(`max-${dimension}`, `${availableSize}px`);\n if (rects.floating[dimension] > availableSize) {\n elements.floating.style.setProperty(dimension, `${availableSize}px`);\n const axis = dimension === 'width' ? 'x' : 'y';\n if (!elements.floating.style.getPropertyValue(`overflow-${axis}`)) {\n elements.floating.style.setProperty(`overflow-${axis}`, 'auto');\n }\n }\n };\n const { applyMaxWidth , applyMaxHeight } = autoSize;\n applyMaxSizeStyles(applyMaxWidth, 'width', availableWidth);\n applyMaxSizeStyles(applyMaxHeight, 'height', availableHeight);\n }\n });\n}\n"],"names":["resetMaxSize","maxSize","autoSize","name","fn","middlewareData","maxSizeAlreadyReset","elements","applyMaxWidth","applyMaxHeight","floating","style","removeProperty","data","reset","rects","options","container","overflowBoundary","size","altBoundary","boundary","getBoundary","apply","availableHeight","availableWidth","applyMaxSizeStyles","dimension","availableSize","setProperty","axis","getPropertyValue"],"mappings":";;;;;;;;;;;IAMiBA,YAAY,MAAZA;IA2BDC,OAAO,MAAPA;;qBAjCK;6BACO;AAKjB,MAAMD,eAAe,CAACE,WAAY,CAAA;QACrCC,MAAM;QACNC,IAAI,EAAEC,gBAAgB,EAAEC,oBAAmB,EAAG,CAAA,EAAGC,SAAQ,EAAG,EAAE;YAC1D,IAAID,qBAAqB;gBACrB,OAAO,CAAC;YACZ,CAAC;YACD,MAAM,EAAEE,cAAa,EAAGC,eAAc,EAAG,GAAGP;YAC5C,IAAIM,eAAe;gBACfD,SAASG,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCL,SAASG,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCL,SAASG,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;YAC3C,CAAC;YACD,IAAIH,gBAAgB;gBAChBF,SAASG,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCL,SAASG,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCL,SAASG,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;YAC3C,CAAC;YACD,OAAO;gBACHC,MAAM;oBACFP,qBAAqB,IAAI;gBAC7B;gBACAQ,OAAO;oBACHC,OAAO,IAAI;gBACf;YACJ;QACJ;IACJ,CAAA;AACG,SAASd,QAAQC,QAAQ,EAAEc,OAAO,EAAE;IACvC,MAAM,EAAEC,UAAS,EAAGC,iBAAgB,EAAG,GAAGF;IAC1C,OAAOG,IAAAA,SAAI,EAAC;QACR,GAAGD,oBAAoB;YACnBE,aAAa,IAAI;YACjBC,UAAUC,IAAAA,wBAAW,EAACL,WAAWC;QACrC,CAAC;QACDK,OAAO,EAAEC,gBAAe,EAAGC,eAAc,EAAGlB,SAAQ,EAAGQ,MAAK,EAAG,EAAE;YAC7D,MAAMW,qBAAqB,CAACH,OAAOI,WAAWC,gBAAgB;gBAC1D,IAAI,CAACL,OAAO;oBACR;gBACJ,CAAC;gBACDhB,SAASG,QAAQ,CAACC,KAAK,CAACkB,WAAW,CAAC,cAAc;gBAClDtB,SAASG,QAAQ,CAACC,KAAK,CAACkB,WAAW,CAAC,CAAC,IAAI,EAAEF,UAAU,CAAC,EAAE,CAAC,EAAEC,cAAc,EAAE,CAAC;gBAC5E,IAAIb,MAAML,QAAQ,CAACiB,UAAU,GAAGC,eAAe;oBAC3CrB,SAASG,QAAQ,CAACC,KAAK,CAACkB,WAAW,CAACF,WAAW,CAAC,EAAEC,cAAc,EAAE,CAAC;oBACnE,MAAME,OAAOH,cAAc,UAAU,MAAM,GAAG;oBAC9C,IAAI,CAACpB,SAASG,QAAQ,CAACC,KAAK,CAACoB,gBAAgB,CAAC,CAAC,SAAS,EAAED,KAAK,CAAC,GAAG;wBAC/DvB,SAASG,QAAQ,CAACC,KAAK,CAACkB,WAAW,CAAC,CAAC,SAAS,EAAEC,KAAK,CAAC,EAAE;oBAC5D,CAAC;gBACL,CAAC;YACL;YACA,MAAM,EAAEtB,cAAa,EAAGC,eAAc,EAAG,GAAGP;YAC5CwB,mBAAmBlB,eAAe,SAASiB;YAC3CC,mBAAmBjB,gBAAgB,UAAUe;QACjD;IACJ;AACJ"}
1
+ {"version":3,"sources":["maxSize.js"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport { getBoundary } from '../utils/getBoundary';\n/**\n * floating-ui `size` middleware uses floating element's height/width to calculate available height/width.\n * This middleware only runs once per lifecycle, resetting styles applied by maxSize from previous lifecycle.\n * Then floating element's original size is restored and `size` middleware can calculate available height/width correctly.\n */ export const resetMaxSize = (autoSize)=>{\n return {\n name: 'resetMaxSize',\n fn ({ middlewareData , elements }) {\n var _middlewareData_resetMaxSize;\n if ((_middlewareData_resetMaxSize = middlewareData.resetMaxSize) === null || _middlewareData_resetMaxSize === void 0 ? void 0 : _middlewareData_resetMaxSize.maxSizeAlreadyReset) {\n return {};\n }\n const { applyMaxWidth , applyMaxHeight } = autoSize;\n if (applyMaxWidth) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-width');\n elements.floating.style.removeProperty('width');\n }\n if (applyMaxHeight) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-height');\n elements.floating.style.removeProperty('height');\n }\n return {\n data: {\n maxSizeAlreadyReset: true\n },\n reset: {\n rects: true\n }\n };\n }\n };\n};\nexport function maxSize(autoSize, options) {\n const { container , overflowBoundary } = options;\n return size({\n ...overflowBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, overflowBoundary)\n },\n apply ({ availableHeight , availableWidth , elements , rects }) {\n const applyMaxSizeStyles = (apply, dimension, availableSize)=>{\n if (!apply) {\n return;\n }\n elements.floating.style.setProperty('box-sizing', 'border-box');\n elements.floating.style.setProperty(`max-${dimension}`, `${availableSize}px`);\n if (rects.floating[dimension] > availableSize) {\n elements.floating.style.setProperty(dimension, `${availableSize}px`);\n const axis = dimension === 'width' ? 'x' : 'y';\n if (!elements.floating.style.getPropertyValue(`overflow-${axis}`)) {\n elements.floating.style.setProperty(`overflow-${axis}`, 'auto');\n }\n }\n };\n const { applyMaxWidth , applyMaxHeight } = autoSize;\n applyMaxSizeStyles(applyMaxWidth, 'width', availableWidth);\n applyMaxSizeStyles(applyMaxHeight, 'height', availableHeight);\n }\n });\n}\n"],"names":["resetMaxSize","maxSize","autoSize","name","fn","middlewareData","elements","_middlewareData_resetMaxSize","maxSizeAlreadyReset","applyMaxWidth","applyMaxHeight","floating","style","removeProperty","data","reset","rects","options","container","overflowBoundary","size","altBoundary","boundary","getBoundary","apply","availableHeight","availableWidth","applyMaxSizeStyles","dimension","availableSize","setProperty","axis","getPropertyValue"],"mappings":";;;;;;;;;;;IAMiBA,YAAY,MAAZA;IA8BDC,OAAO,MAAPA;;qBApCK;6BACO;AAKjB,MAAMD,eAAe,CAACE,WAAW;IACxC,OAAO;QACHC,MAAM;QACNC,IAAI,EAAEC,eAAc,EAAGC,SAAQ,EAAG,EAAE;YAChC,IAAIC;YACJ,IAAI,AAACA,CAAAA,+BAA+BF,eAAeL,YAAY,AAAD,MAAO,IAAI,IAAIO,iCAAiC,KAAK,IAAI,KAAK,IAAIA,6BAA6BC,mBAAmB,EAAE;gBAC9K,OAAO,CAAC;YACZ,CAAC;YACD,MAAM,EAAEC,cAAa,EAAGC,eAAc,EAAG,GAAGR;YAC5C,IAAIO,eAAe;gBACfH,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCP,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCP,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;YAC3C,CAAC;YACD,IAAIH,gBAAgB;gBAChBJ,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCP,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCP,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;YAC3C,CAAC;YACD,OAAO;gBACHC,MAAM;oBACFN,qBAAqB,IAAI;gBAC7B;gBACAO,OAAO;oBACHC,OAAO,IAAI;gBACf;YACJ;QACJ;IACJ;AACJ;AACO,SAASf,QAAQC,QAAQ,EAAEe,OAAO,EAAE;IACvC,MAAM,EAAEC,UAAS,EAAGC,iBAAgB,EAAG,GAAGF;IAC1C,OAAOG,IAAAA,SAAI,EAAC;QACR,GAAGD,oBAAoB;YACnBE,aAAa,IAAI;YACjBC,UAAUC,IAAAA,wBAAW,EAACL,WAAWC;QACrC,CAAC;QACDK,OAAO,EAAEC,gBAAe,EAAGC,eAAc,EAAGpB,SAAQ,EAAGU,MAAK,EAAG,EAAE;YAC7D,MAAMW,qBAAqB,CAACH,OAAOI,WAAWC,gBAAgB;gBAC1D,IAAI,CAACL,OAAO;oBACR;gBACJ,CAAC;gBACDlB,SAASK,QAAQ,CAACC,KAAK,CAACkB,WAAW,CAAC,cAAc;gBAClDxB,SAASK,QAAQ,CAACC,KAAK,CAACkB,WAAW,CAAC,CAAC,IAAI,EAAEF,UAAU,CAAC,EAAE,CAAC,EAAEC,cAAc,EAAE,CAAC;gBAC5E,IAAIb,MAAML,QAAQ,CAACiB,UAAU,GAAGC,eAAe;oBAC3CvB,SAASK,QAAQ,CAACC,KAAK,CAACkB,WAAW,CAACF,WAAW,CAAC,EAAEC,cAAc,EAAE,CAAC;oBACnE,MAAME,OAAOH,cAAc,UAAU,MAAM,GAAG;oBAC9C,IAAI,CAACtB,SAASK,QAAQ,CAACC,KAAK,CAACoB,gBAAgB,CAAC,CAAC,SAAS,EAAED,KAAK,CAAC,GAAG;wBAC/DzB,SAASK,QAAQ,CAACC,KAAK,CAACkB,WAAW,CAAC,CAAC,SAAS,EAAEC,KAAK,CAAC,EAAE;oBAC5D,CAAC;gBACL,CAAC;YACL;YACA,MAAM,EAAEtB,cAAa,EAAGC,eAAc,EAAG,GAAGR;YAC5CyB,mBAAmBlB,eAAe,SAASiB;YAC3CC,mBAAmBjB,gBAAgB,UAAUe;QACjD;IACJ;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-positioning",
3
- "version": "9.9.0",
3
+ "version": "9.9.2",
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": "^9.6.0",
34
- "@fluentui/react-theme": "^9.1.9",
35
- "@fluentui/react-utilities": "^9.10.1",
33
+ "@fluentui/react-shared-contexts": "^9.7.1",
34
+ "@fluentui/react-theme": "^9.1.10",
35
+ "@fluentui/react-utilities": "^9.11.0",
36
36
  "@griffel/react": "^1.5.7",
37
37
  "@swc/helpers": "^0.4.14"
38
38
  },