@fluentui/react-positioning 0.0.0-nightly627ad67f1120211109.1 → 0.0.0-nightly99adff5a9a20211125.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. package/CHANGELOG.json +59 -10
  2. package/CHANGELOG.md +19 -7
  3. package/dist/react-positioning.d.ts +28 -0
  4. package/lib/createArrowStyles.d.ts +27 -0
  5. package/lib/createArrowStyles.js +75 -0
  6. package/lib/createArrowStyles.js.map +1 -0
  7. package/lib/createVirtualElementFromClick.js +17 -15
  8. package/lib/createVirtualElementFromClick.js.map +1 -1
  9. package/lib/index.d.ts +2 -1
  10. package/lib/index.js +2 -1
  11. package/lib/index.js.map +1 -1
  12. package/lib/usePopper.js +362 -312
  13. package/lib/usePopper.js.map +1 -1
  14. package/lib/usePopperMouseTarget.js +28 -22
  15. package/lib/usePopperMouseTarget.js.map +1 -1
  16. package/lib/utils/getBasePlacement.js +1 -1
  17. package/lib/utils/getBasePlacement.js.map +1 -1
  18. package/lib/utils/getBoundary.js +15 -10
  19. package/lib/utils/getBoundary.js.map +1 -1
  20. package/lib/utils/getReactFiberFromNode.js +39 -35
  21. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  22. package/lib/utils/getScrollParent.js +46 -32
  23. package/lib/utils/getScrollParent.js.map +1 -1
  24. package/lib/utils/mergeArrowOffset.js +29 -24
  25. package/lib/utils/mergeArrowOffset.js.map +1 -1
  26. package/lib/utils/positioningHelper.d.ts +1 -1
  27. package/lib/utils/positioningHelper.js +38 -30
  28. package/lib/utils/positioningHelper.js.map +1 -1
  29. package/lib/utils/resolvePositioningShorthand.js +57 -19
  30. package/lib/utils/resolvePositioningShorthand.js.map +1 -1
  31. package/lib/utils/useCallbackRef.js +35 -29
  32. package/lib/utils/useCallbackRef.js.map +1 -1
  33. package/lib-commonjs/createArrowStyles.d.ts +27 -0
  34. package/lib-commonjs/createArrowStyles.js +84 -0
  35. package/lib-commonjs/createArrowStyles.js.map +1 -0
  36. package/lib-commonjs/createVirtualElementFromClick.js +23 -16
  37. package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
  38. package/lib-commonjs/index.d.ts +2 -1
  39. package/lib-commonjs/index.js +28 -6
  40. package/lib-commonjs/index.js.map +1 -1
  41. package/lib-commonjs/types.js +4 -1
  42. package/lib-commonjs/types.js.map +1 -1
  43. package/lib-commonjs/usePopper.js +376 -316
  44. package/lib-commonjs/usePopper.js.map +1 -1
  45. package/lib-commonjs/usePopperMouseTarget.js +38 -25
  46. package/lib-commonjs/usePopperMouseTarget.js.map +1 -1
  47. package/lib-commonjs/utils/getBasePlacement.js +7 -2
  48. package/lib-commonjs/utils/getBasePlacement.js.map +1 -1
  49. package/lib-commonjs/utils/getBoundary.js +23 -12
  50. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  51. package/lib-commonjs/utils/getReactFiberFromNode.js +44 -36
  52. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  53. package/lib-commonjs/utils/getScrollParent.js +53 -33
  54. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  55. package/lib-commonjs/utils/index.js +14 -2
  56. package/lib-commonjs/utils/index.js.map +1 -1
  57. package/lib-commonjs/utils/mergeArrowOffset.js +35 -25
  58. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  59. package/lib-commonjs/utils/positioningHelper.d.ts +1 -1
  60. package/lib-commonjs/utils/positioningHelper.js +46 -31
  61. package/lib-commonjs/utils/positioningHelper.js.map +1 -1
  62. package/lib-commonjs/utils/resolvePositioningShorthand.js +65 -22
  63. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  64. package/lib-commonjs/utils/useCallbackRef.js +45 -32
  65. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  66. package/package.json +8 -8
@@ -1 +1 @@
1
- {"version":3,"file":"usePopper.js","sourceRoot":"","sources":["../src/usePopper.ts"],"names":[],"mappings":";;;AAAA,+DAAkH;AAClH,2EAA4D;AAC5D,yCAQuB;AACvB,2CAA2C;AAC3C,+BAA+B;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AAA,GAAG,WAAW,CAAC,aAAf,MAA4B,IAA5B,IAA4B,EAAA,KAAA,KAAA,CAA5B,GAA4B,KAAA,CAA5B,GAA4B,EAAA,CAAE,gBAAF,CAAmB,WAAnB,EAAgC,UAAU,CAAC,YAA3C,EAAyD;AACnG,UAAA,UAAU,EAAE;AADuF,SAAzD,CAA5C;;AAIA,eAAO,UAAU,KAAA,IAAV,IAAA,UAAU,KAAA,KAAA,CAAV,GAAU,KAAA,CAAV,GAAA,UAAU,CAAE,QAAZ,EAAP,EAA+B;AAC7B,gBAAM,IAAI,GAAG,UAAU,CAAC,WAAxB,CAD6B,CAE7B;;AACA,UAAA,OAAO,CAAC,IAAR,CAAa,WAAb,EAA0B,IAA1B,EAH6B,CAI7B;;AACA,UAAA,OAAO,CAAC,IAAR,CACE,CACE,gGADF,EAEE,qGAFF,EAGE,2EAHF,EAIE,uEAJF,EAKE,IALF,EAME,yFANF,EAOE,oGAPF,EAQE,kGARF,EASE,WATF,EAUE,4FAVF,EAWE,6FAXF,EAYE,IAZF,EAaE,2FAbF,EAcE,2CAdF,EAeE,8EAfF,EAgBE,IAhBF,CAgBO,GAhBP,CADF;AAmBD;AACF,OAhCkB,CAiCnB;AACA;AACA;;AACD,KApCD,EAoCG,EApCH;AAqCD;;AAED,SAAO;AAAE,IAAA,SAAF;AAAa,IAAA,YAAb;AAA2B,IAAA;AAA3B,GAAP;AACD;;AAlKD,OAAA,CAAA,SAAA,GAAA,SAAA","sourceRoot":""}
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  exports.usePopperMouseTarget = void 0;
4
- const React = require("react");
5
- const createVirtualElementFromClick_1 = require("./createVirtualElementFromClick");
7
+
8
+ const React = /*#__PURE__*/require("react");
9
+
10
+ const createVirtualElementFromClick_1 = /*#__PURE__*/require("./createVirtualElementFromClick");
6
11
  /**
7
12
  * A state hook that manages a popper virtual element from mouseevents.
8
13
  * Useful for scenarios where a component needs to be positioned by mouse click (e.g. contextmenu)
@@ -11,28 +16,36 @@ const createVirtualElementFromClick_1 = require("./createVirtualElementFromClick
11
16
  * @param initialState - initializes a user provided state similare to useState
12
17
  * @returns state and dispatcher for a Popper virtual element that uses native/synthetic mouse events
13
18
  */
14
- const usePopperMouseTarget = (initialState) => {
15
- const [virtualElement, setVirtualElement] = React.useState(initialState);
16
- const setVirtualMouseTarget = (event) => {
17
- if (event === undefined || event === null) {
18
- setVirtualElement(undefined);
19
- return;
20
- }
21
- let mouseevent;
22
- if (!(event instanceof MouseEvent)) {
23
- mouseevent = event.nativeEvent;
24
- }
25
- else {
26
- mouseevent = event;
27
- }
28
- if (!(mouseevent instanceof MouseEvent) && process.env.NODE_ENV !== 'production') {
29
- // eslint-disable-next-line no-console
30
- console.error('usePopperMouseTarget should only be used with MouseEvent');
31
- }
32
- const contextTarget = createVirtualElementFromClick_1.createVirtualElementFromClick(mouseevent);
33
- setVirtualElement(contextTarget);
34
- };
35
- return [virtualElement, setVirtualMouseTarget];
19
+
20
+
21
+ const usePopperMouseTarget = initialState => {
22
+ const [virtualElement, setVirtualElement] = React.useState(initialState);
23
+
24
+ const setVirtualMouseTarget = event => {
25
+ if (event === undefined || event === null) {
26
+ setVirtualElement(undefined);
27
+ return;
28
+ }
29
+
30
+ let mouseevent;
31
+
32
+ if (!(event instanceof MouseEvent)) {
33
+ mouseevent = event.nativeEvent;
34
+ } else {
35
+ mouseevent = event;
36
+ }
37
+
38
+ if (!(mouseevent instanceof MouseEvent) && process.env.NODE_ENV !== 'production') {
39
+ // eslint-disable-next-line no-console
40
+ console.error('usePopperMouseTarget should only be used with MouseEvent');
41
+ }
42
+
43
+ const contextTarget = createVirtualElementFromClick_1.createVirtualElementFromClick(mouseevent);
44
+ setVirtualElement(contextTarget);
45
+ };
46
+
47
+ return [virtualElement, setVirtualMouseTarget];
36
48
  };
49
+
37
50
  exports.usePopperMouseTarget = usePopperMouseTarget;
38
51
  //# sourceMappingURL=usePopperMouseTarget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePopperMouseTarget.js","sourceRoot":"","sources":["../src/usePopperMouseTarget.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,mFAAgF;AAGhF;;;;;;;GAOG;AACI,MAAM,oBAAoB,GAAG,CAAC,YAAwE,EAAE,EAAE;IAC/G,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAsC,YAAY,CAAC,CAAC;IAE9G,MAAM,qBAAqB,GAAG,CAAC,KAAuD,EAAE,EAAE;QACxF,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE;YACzC,iBAAiB,CAAC,SAAS,CAAC,CAAC;YAC7B,OAAO;SACR;QAED,IAAI,UAAsB,CAAC;QAC3B,IAAI,CAAC,CAAC,KAAK,YAAY,UAAU,CAAC,EAAE;YAClC,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC;SAChC;aAAM;YACL,UAAU,GAAG,KAAK,CAAC;SACpB;QAED,IAAI,CAAC,CAAC,UAAU,YAAY,UAAU,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;YAChF,sCAAsC;YACtC,OAAO,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;SAC3E;QAED,MAAM,aAAa,GAAG,6DAA6B,CAAC,UAAU,CAAC,CAAC;QAChE,iBAAiB,CAAC,aAAa,CAAC,CAAC;IACnC,CAAC,CAAC;IAEF,OAAO,CAAC,cAAc,EAAE,qBAAqB,CAAU,CAAC;AAC1D,CAAC,CAAC;AA1BW,QAAA,oBAAoB,wBA0B/B"}
1
+ {"version":3,"sources":["../src/usePopperMouseTarget.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,+BAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;AAGA;;;;;;;AAOG;;;AACI,MAAM,oBAAoB,GAAI,YAAD,IAA6E;AAC/G,QAAM,CAAC,cAAD,EAAiB,iBAAjB,IAAsC,KAAK,CAAC,QAAN,CAAoD,YAApD,CAA5C;;AAEA,QAAM,qBAAqB,GAAI,KAAD,IAA4D;AACxF,QAAI,KAAK,KAAK,SAAV,IAAuB,KAAK,KAAK,IAArC,EAA2C;AACzC,MAAA,iBAAiB,CAAC,SAAD,CAAjB;AACA;AACD;;AAED,QAAI,UAAJ;;AACA,QAAI,EAAE,KAAK,YAAY,UAAnB,CAAJ,EAAoC;AAClC,MAAA,UAAU,GAAG,KAAK,CAAC,WAAnB;AACD,KAFD,MAEO;AACL,MAAA,UAAU,GAAG,KAAb;AACD;;AAED,QAAI,EAAE,UAAU,YAAY,UAAxB,KAAuC,OAAO,CAAC,GAAR,CAAY,QAAZ,KAAyB,YAApE,EAAkF;AAChF;AACA,MAAA,OAAO,CAAC,KAAR,CAAc,0DAAd;AACD;;AAED,UAAM,aAAa,GAAG,+BAAA,CAAA,6BAAA,CAA8B,UAA9B,CAAtB;AACA,IAAA,iBAAiB,CAAC,aAAD,CAAjB;AACD,GApBD;;AAsBA,SAAO,CAAC,cAAD,EAAiB,qBAAjB,CAAP;AACD,CA1BM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourceRoot":""}
@@ -1,5 +1,8 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  exports.getBasePlacement = void 0;
4
7
  /**
5
8
  * Returns the base placement value
@@ -7,8 +10,10 @@ exports.getBasePlacement = void 0;
7
10
  *
8
11
  * @returns bottom-start -> bottom
9
12
  */
13
+
10
14
  function getBasePlacement(placement) {
11
- return placement.split('-')[0];
15
+ return placement.split('-')[0];
12
16
  }
17
+
13
18
  exports.getBasePlacement = getBasePlacement;
14
19
  //# sourceMappingURL=getBasePlacement.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getBasePlacement.js","sourceRoot":"","sources":["../../src/utils/getBasePlacement.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,SAA6B;IAC5D,OAAO,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAA2B,CAAC;AAC3D,CAAC;AAFD,4CAEC"}
1
+ {"version":3,"sources":["../../src/utils/getBasePlacement.ts"],"names":[],"mappings":";;;;;;AAEA;;;;;AAKG;;AACH,SAAgB,gBAAhB,CAAiC,SAAjC,EAA8D;AAC5D,SAAO,SAAS,CAAC,KAAV,CAAgB,GAAhB,EAAqB,CAArB,CAAP;AACD;;AAFD,OAAA,CAAA,gBAAA,GAAA,gBAAA","sourceRoot":""}
@@ -1,22 +1,33 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  exports.getBoundary = void 0;
4
- const getScrollParent_1 = require("./getScrollParent");
7
+
8
+ const getScrollParent_1 = /*#__PURE__*/require("./getScrollParent");
5
9
  /**
6
10
  * Allows to mimic a behavior from V1 of Popper and accept `window` and `scrollParent` as strings.
7
11
  */
12
+
13
+
8
14
  function getBoundary(element, boundary) {
9
- if (boundary === 'window') {
10
- return element === null || element === void 0 ? void 0 : element.ownerDocument.documentElement;
15
+ if (boundary === 'window') {
16
+ return element === null || element === void 0 ? void 0 : element.ownerDocument.documentElement;
17
+ }
18
+
19
+ if (boundary === 'scrollParent') {
20
+ let boundariesNode = getScrollParent_1.getScrollParent(element);
21
+
22
+ if (boundariesNode.nodeName === 'BODY') {
23
+ boundariesNode = element === null || element === void 0 ? void 0 : element.ownerDocument.documentElement;
11
24
  }
12
- if (boundary === 'scrollParent') {
13
- let boundariesNode = getScrollParent_1.getScrollParent(element);
14
- if (boundariesNode.nodeName === 'BODY') {
15
- boundariesNode = element === null || element === void 0 ? void 0 : element.ownerDocument.documentElement;
16
- }
17
- return boundariesNode;
18
- }
19
- return boundary;
25
+
26
+ return boundariesNode;
27
+ }
28
+
29
+ return boundary;
20
30
  }
31
+
21
32
  exports.getBoundary = getBoundary;
22
33
  //# sourceMappingURL=getBoundary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getBoundary.js","sourceRoot":"","sources":["../../src/utils/getBoundary.ts"],"names":[],"mappings":";;;AAEA,uDAAoD;AAGpD;;GAEG;AACH,SAAgB,WAAW,CAAC,OAA2B,EAAE,QAAmB;IAC1E,IAAI,QAAQ,KAAK,QAAQ,EAAE;QACzB,OAAO,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,CAAE,eAAe,CAAC;KAChD;IAED,IAAI,QAAQ,KAAK,cAAc,EAAE;QAC/B,IAAI,cAAc,GAA4B,iCAAe,CAAC,OAAO,CAAC,CAAC;QAEvE,IAAI,cAAc,CAAC,QAAQ,KAAK,MAAM,EAAE;YACtC,cAAc,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,CAAE,eAAe,CAAC;SAC1D;QAED,OAAO,cAAc,CAAC;KACvB;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAhBD,kCAgBC"}
1
+ {"version":3,"sources":["../../src/utils/getBoundary.ts"],"names":[],"mappings":";;;;;;;AAEA,MAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;AAGA;;AAEG;;;AACH,SAAgB,WAAhB,CAA4B,OAA5B,EAAyD,QAAzD,EAA4E;AAC1E,MAAI,QAAQ,KAAK,QAAjB,EAA2B;AACzB,WAAO,OAAO,KAAA,IAAP,IAAA,OAAO,KAAA,KAAA,CAAP,GAAO,KAAA,CAAP,GAAA,OAAO,CAAE,aAAT,CAAwB,eAA/B;AACD;;AAED,MAAI,QAAQ,KAAK,cAAjB,EAAiC;AAC/B,QAAI,cAAc,GAA4B,iBAAA,CAAA,eAAA,CAAgB,OAAhB,CAA9C;;AAEA,QAAI,cAAc,CAAC,QAAf,KAA4B,MAAhC,EAAwC;AACtC,MAAA,cAAc,GAAG,OAAO,KAAA,IAAP,IAAA,OAAO,KAAA,KAAA,CAAP,GAAO,KAAA,CAAP,GAAA,OAAO,CAAE,aAAT,CAAwB,eAAzC;AACD;;AAED,WAAO,cAAP;AACD;;AAED,SAAO,QAAP;AACD;;AAhBD,OAAA,CAAA,WAAA,GAAA,WAAA","sourceRoot":""}
@@ -1,46 +1,54 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  exports.getReactFiberFromNode = void 0;
4
7
  var WorkTag;
8
+
5
9
  (function (WorkTag) {
6
- WorkTag[WorkTag["FunctionComponent"] = 0] = "FunctionComponent";
7
- WorkTag[WorkTag["ClassComponent"] = 1] = "ClassComponent";
8
- WorkTag[WorkTag["IndeterminateComponent"] = 2] = "IndeterminateComponent";
9
- WorkTag[WorkTag["HostRoot"] = 3] = "HostRoot";
10
- WorkTag[WorkTag["HostPortal"] = 4] = "HostPortal";
11
- WorkTag[WorkTag["HostComponent"] = 5] = "HostComponent";
12
- WorkTag[WorkTag["HostText"] = 6] = "HostText";
13
- WorkTag[WorkTag["Fragment"] = 7] = "Fragment";
14
- WorkTag[WorkTag["Mode"] = 8] = "Mode";
15
- WorkTag[WorkTag["ContextConsumer"] = 9] = "ContextConsumer";
16
- WorkTag[WorkTag["ContextProvider"] = 10] = "ContextProvider";
17
- WorkTag[WorkTag["ForwardRef"] = 11] = "ForwardRef";
18
- WorkTag[WorkTag["Profiler"] = 12] = "Profiler";
19
- WorkTag[WorkTag["SuspenseComponent"] = 13] = "SuspenseComponent";
20
- WorkTag[WorkTag["MemoComponent"] = 14] = "MemoComponent";
21
- WorkTag[WorkTag["SimpleMemoComponent"] = 15] = "SimpleMemoComponent";
22
- WorkTag[WorkTag["LazyComponent"] = 16] = "LazyComponent";
23
- WorkTag[WorkTag["IncompleteClassComponent"] = 17] = "IncompleteClassComponent";
24
- WorkTag[WorkTag["DehydratedFragment"] = 18] = "DehydratedFragment";
25
- WorkTag[WorkTag["SuspenseListComponent"] = 19] = "SuspenseListComponent";
26
- WorkTag[WorkTag["FundamentalComponent"] = 20] = "FundamentalComponent";
27
- WorkTag[WorkTag["ScopeComponent"] = 21] = "ScopeComponent";
10
+ WorkTag[WorkTag["FunctionComponent"] = 0] = "FunctionComponent";
11
+ WorkTag[WorkTag["ClassComponent"] = 1] = "ClassComponent";
12
+ WorkTag[WorkTag["IndeterminateComponent"] = 2] = "IndeterminateComponent";
13
+ WorkTag[WorkTag["HostRoot"] = 3] = "HostRoot";
14
+ WorkTag[WorkTag["HostPortal"] = 4] = "HostPortal";
15
+ WorkTag[WorkTag["HostComponent"] = 5] = "HostComponent";
16
+ WorkTag[WorkTag["HostText"] = 6] = "HostText";
17
+ WorkTag[WorkTag["Fragment"] = 7] = "Fragment";
18
+ WorkTag[WorkTag["Mode"] = 8] = "Mode";
19
+ WorkTag[WorkTag["ContextConsumer"] = 9] = "ContextConsumer";
20
+ WorkTag[WorkTag["ContextProvider"] = 10] = "ContextProvider";
21
+ WorkTag[WorkTag["ForwardRef"] = 11] = "ForwardRef";
22
+ WorkTag[WorkTag["Profiler"] = 12] = "Profiler";
23
+ WorkTag[WorkTag["SuspenseComponent"] = 13] = "SuspenseComponent";
24
+ WorkTag[WorkTag["MemoComponent"] = 14] = "MemoComponent";
25
+ WorkTag[WorkTag["SimpleMemoComponent"] = 15] = "SimpleMemoComponent";
26
+ WorkTag[WorkTag["LazyComponent"] = 16] = "LazyComponent";
27
+ WorkTag[WorkTag["IncompleteClassComponent"] = 17] = "IncompleteClassComponent";
28
+ WorkTag[WorkTag["DehydratedFragment"] = 18] = "DehydratedFragment";
29
+ WorkTag[WorkTag["SuspenseListComponent"] = 19] = "SuspenseListComponent";
30
+ WorkTag[WorkTag["FundamentalComponent"] = 20] = "FundamentalComponent";
31
+ WorkTag[WorkTag["ScopeComponent"] = 21] = "ScopeComponent";
28
32
  })(WorkTag || (WorkTag = {}));
33
+
29
34
  function getReactFiberFromNode(elm) {
30
- if (!elm) {
31
- return null;
35
+ if (!elm) {
36
+ return null;
37
+ }
38
+
39
+ for (const k in elm) {
40
+ // React 16 uses "__reactInternalInstance$" prefix
41
+ // React 17 uses "__reactFiber$" prefix
42
+ // https://github.com/facebook/react/pull/18377
43
+ if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {
44
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
45
+ // @ts-ignore
46
+ return elm[k];
32
47
  }
33
- for (const k in elm) {
34
- // React 16 uses "__reactInternalInstance$" prefix
35
- // React 17 uses "__reactFiber$" prefix
36
- // https://github.com/facebook/react/pull/18377
37
- if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {
38
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
39
- // @ts-ignore
40
- return elm[k];
41
- }
42
- }
43
- throw new Error('getReactFiber(): Failed to find a React Fiber on a node');
48
+ }
49
+
50
+ throw new Error('getReactFiber(): Failed to find a React Fiber on a node');
44
51
  }
52
+
45
53
  exports.getReactFiberFromNode = getReactFiberFromNode;
46
54
  //# sourceMappingURL=getReactFiberFromNode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getReactFiberFromNode.js","sourceRoot":"","sources":["../../src/utils/getReactFiberFromNode.ts"],"names":[],"mappings":";;;AAuEA,IAAK,OAuBJ;AAvBD,WAAK,OAAO;IACV,+DAAqB,CAAA;IACrB,yDAAkB,CAAA;IAClB,yEAA0B,CAAA;IAC1B,6CAAY,CAAA;IACZ,iDAAc,CAAA;IACd,uDAAiB,CAAA;IACjB,6CAAY,CAAA;IACZ,6CAAY,CAAA;IACZ,qCAAQ,CAAA;IACR,2DAAmB,CAAA;IACnB,4DAAoB,CAAA;IACpB,kDAAe,CAAA;IACf,8CAAa,CAAA;IACb,gEAAsB,CAAA;IACtB,wDAA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A,GAAA,EAAA,CAAA,GAAA,gBAAA;AACD,CAvBD,EAAK,OAAO,KAAP,OAAO,GAAA,EAAA,CAAZ;;AAsLA,SAAgB,qBAAhB,CAAsC,GAAtC,EAA2D;AACzD,MAAI,CAAC,GAAL,EAAU;AACR,WAAO,IAAP;AACD;;AAED,OAAK,MAAM,CAAX,IAAgB,GAAhB,EAAqB;AACnB;AACA;AACA;AACA,QAAI,CAAC,CAAC,OAAF,CAAU,0BAAV,MAA0C,CAA1C,IAA+C,CAAC,CAAC,OAAF,CAAU,eAAV,MAA+B,CAAlF,EAAqF;AACnF;AACA;AACA,aAAO,GAAG,CAAC,CAAD,CAAV;AACD;AACF;;AAED,QAAM,IAAI,KAAJ,CAAU,yDAAV,CAAN;AACD;;AAjBD,OAAA,CAAA,qBAAA,GAAA,qBAAA","sourceRoot":""}
@@ -1,56 +1,76 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  exports.getScrollParent = exports.getParentNode = void 0;
4
7
  /**
5
8
  * Returns the parent node or the host of the node argument.
6
9
  * @param node - DOM node.
7
10
  * @returns - parent DOM node.
8
11
  */
9
- const getParentNode = (node) => {
10
- if (node.nodeName === 'HTML') {
11
- return node;
12
- }
13
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
- return node.parentNode || node.host;
12
+
13
+ const getParentNode = node => {
14
+ if (node.nodeName === 'HTML') {
15
+ return node;
16
+ } // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
+
18
+
19
+ return node.parentNode || node.host;
15
20
  };
21
+
16
22
  exports.getParentNode = getParentNode;
17
23
  /**
18
24
  * Returns CSS styles of the given node.
19
25
  * @param node - DOM node.
20
26
  * @returns - CSS styles.
21
27
  */
22
- const getStyleComputedProperty = (node) => {
23
- var _a;
24
- if (node.nodeType !== 1) {
25
- return {};
26
- }
27
- const window = (_a = node.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;
28
- return window.getComputedStyle(node, null);
28
+
29
+ const getStyleComputedProperty = node => {
30
+ var _a;
31
+
32
+ if (node.nodeType !== 1) {
33
+ return {};
34
+ }
35
+
36
+ const window = (_a = node.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;
37
+ return window.getComputedStyle(node, null);
29
38
  };
30
39
  /**
31
40
  * Returns the first scrollable parent of the given element.
32
41
  * @param node - DOM node.
33
42
  * @returns - the first scrollable parent.
34
43
  */
35
- const getScrollParent = (node) => {
36
- // Return body, `getScroll` will take care to get the correct `scrollTop` from it
37
- const parentNode = node && exports.getParentNode(node);
38
- // eslint-disable-next-line
39
- if (!parentNode)
40
- return document.body;
41
- switch (parentNode.nodeName) {
42
- case 'HTML':
43
- case 'BODY':
44
- return parentNode.ownerDocument.body;
45
- case '#document':
46
- return parentNode.body;
47
- }
48
- // If any of the overflow props is defined for the node then we return it as the parent
49
- const { overflow, overflowX, overflowY } = getStyleComputedProperty(parentNode);
50
- if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
51
- return parentNode;
52
- }
53
- return exports.getScrollParent(parentNode);
44
+
45
+
46
+ const getScrollParent = node => {
47
+ // Return body, `getScroll` will take care to get the correct `scrollTop` from it
48
+ const parentNode = node && exports.getParentNode(node); // eslint-disable-next-line
49
+
50
+ if (!parentNode) return document.body;
51
+
52
+ switch (parentNode.nodeName) {
53
+ case 'HTML':
54
+ case 'BODY':
55
+ return parentNode.ownerDocument.body;
56
+
57
+ case '#document':
58
+ return parentNode.body;
59
+ } // If any of the overflow props is defined for the node then we return it as the parent
60
+
61
+
62
+ const {
63
+ overflow,
64
+ overflowX,
65
+ overflowY
66
+ } = getStyleComputedProperty(parentNode);
67
+
68
+ if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
69
+ return parentNode;
70
+ }
71
+
72
+ return exports.getScrollParent(parentNode);
54
73
  };
74
+
55
75
  exports.getScrollParent = getScrollParent;
56
76
  //# sourceMappingURL=getScr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F;AAAY,IAAA,SAAZ;AAAuB,IAAA;AAAvB,MAAqC,wBAAwB,CAAC,UAAD,CAAnE;;AACA,MAAI,wBAAwB,IAAxB,CAA6B,QAAS,GAAG,SAAZ,GAAyB,SAAtD,CAAJ,EAAsE;AACpE,WAAO,UAAP;AACD;;AAED,SAAO,OAAA,CAAA,eAAA,CAAgB,UAAhB,CAAP;AACD,CArBM;;AAAM,OAAA,CAAA,eAAA,GAAe,eAAf","sourceRoot":""}
@@ -1,12 +1,24 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
+
4
9
  tslib_1.__exportStar(require("./getBasePlacement"), exports);
10
+
5
11
  tslib_1.__exportStar(require("./getBoundary"), exports);
12
+
6
13
  tslib_1.__exportStar(require("./getReactFiberFromNode"), exports);
14
+
7
15
  tslib_1.__exportStar(require("./getScrollParent"), exports);
16
+
8
17
  tslib_1.__exportStar(require("./mergeArrowOffset"), exports);
18
+
9
19
  tslib_1.__exportStar(require("./positioningHelper"), exports);
20
+
10
21
  tslib_1.__exportStar(require("./resolvePositioningShorthand"), exports);
22
+
11
23
  tslib_1.__exportStar(require("./useCallbackRef"), exports);
12
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,wDAA8B;AAC9B,kEAAwC;AACxC,4DAAkC;AAClC,6DAAmC;AACnC,8DAAoC;AACpC,wEAA8C;AAC9C,2DAAiC"}
1
+ {"version":3,"sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,yBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,oBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,+BAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA","sourceRoot":""}
@@ -1,5 +1,8 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  exports.mergeArrowOffset = void 0;
4
7
  /**
5
8
  * Generally when adding an arrow to popper, it's necessary to offset the position of the popper by the
@@ -9,33 +12,40 @@ exports.mergeArrowOffset = void 0;
9
12
  * @param arrowHeight - The height of the arrow in px
10
13
  * @returns User offset augmented with arrow height
11
14
  */
15
+
12
16
  function mergeArrowOffset(userOffset, arrowHeight) {
13
- let offsetWithArrow = userOffset;
14
- if (!userOffset) {
15
- return [0, arrowHeight];
16
- }
17
- if (Array.isArray(offsetWithArrow)) {
18
- setArrowOffset(offsetWithArrow, arrowHeight);
19
- return offsetWithArrow;
20
- }
21
- if (typeof offsetWithArrow === 'function') {
22
- const userOffsetFn = offsetWithArrow;
23
- offsetWithArrow = offsetParams => {
24
- const offset = userOffsetFn(offsetParams);
25
- setArrowOffset(offset, arrowHeight);
26
- return offset;
27
- };
28
- }
29
- // This should never happen
30
- return [0, 0];
17
+ let offsetWithArrow = userOffset;
18
+
19
+ if (!userOffset) {
20
+ return [0, arrowHeight];
21
+ }
22
+
23
+ if (Array.isArray(offsetWithArrow)) {
24
+ setArrowOffset(offsetWithArrow, arrowHeight);
25
+ return offsetWithArrow;
26
+ }
27
+
28
+ if (typeof offsetWithArrow === 'function') {
29
+ const userOffsetFn = offsetWithArrow;
30
+
31
+ offsetWithArrow = offsetParams => {
32
+ const offset = userOffsetFn(offsetParams);
33
+ setArrowOffset(offset, arrowHeight);
34
+ return offset;
35
+ };
36
+ } // This should never happen
37
+
38
+
39
+ return [0, 0];
31
40
  }
41
+
32
42
  exports.mergeArrowOffset = mergeArrowOffset;
43
+
33
44
  const setArrowOffset = (offset, arrowHeight) => {
34
- if (offset[1] !== null && offset[1] !== undefined) {
35
- offset[1] += arrowHeight;
36
- }
37
- else {
38
- offset[1] = arrowHeight;
39
- }
45
+ if (offset[1] !== null && offset[1] !== undefined) {
46
+ offset[1] += arrowHeight;
47
+ } else {
48
+ offset[1] = arrowHeight;
49
+ }
40
50
  };
41
51
  //# sourceMappingURL=mergeArrowOffset.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mergeArrowOffset.js","sourceRoot":"","sources":["../../src/utils/mergeArrowOffset.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACH,SAAgB,gBAAgB,CAAC,UAAqC,EAAE,WAAmB;IACzF,IAAI,eAAe,GAAG,UAAU,CAAC;IACjC,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;KACzB;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QAClC,cAAc,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;QAC7C,OAAO,eAAe,CAAC;KACxB;IAED,IAAI,OAAO,eAAe,KAAK,UAAU,EAAE;QACzC,MAAM,YAAY,GAAG,eAAe,CAAC;QACrC,eAAe,GAAG,YAAY,CAAC,EAAE;YAC/B,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;YAC1C,cAAc,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;YACpC,OAAO,MAAM,CAAC;QAChB,CAAC,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