@fluentui/react-positioning 0.0.0-nightlyc9ccb6f37d20211122.1 → 0.0.0-nightlyca6ef2bc8e20220105.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.
Files changed (62) hide show
  1. package/CHANGELOG.json +75 -10
  2. package/CHANGELOG.md +24 -8
  3. package/dist/react-positioning.d.ts +3 -3
  4. package/lib/createArrowStyles.d.ts +3 -3
  5. package/lib/createArrowStyles.js +48 -50
  6. package/lib/createArrowStyles.js.map +1 -1
  7. package/lib/createVirtualElementFromClick.js +17 -15
  8. package/lib/createVirtualElementFromClick.js.map +1 -1
  9. package/lib/usePopper.js +362 -312
  10. package/lib/usePopper.js.map +1 -1
  11. package/lib/usePopperMouseTarget.js +28 -22
  12. package/lib/usePopperMouseTarget.js.map +1 -1
  13. package/lib/utils/getBasePlacement.js +1 -1
  14. package/lib/utils/getBasePlacement.js.map +1 -1
  15. package/lib/utils/getBoundary.js +15 -10
  16. package/lib/utils/getBoundary.js.map +1 -1
  17. package/lib/utils/getReactFiberFromNode.js +39 -35
  18. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  19. package/lib/utils/getScrollParent.js +46 -32
  20. package/lib/utils/getScrollParent.js.map +1 -1
  21. package/lib/utils/mergeArrowOffset.js +29 -24
  22. package/lib/utils/mergeArrowOffset.js.map +1 -1
  23. package/lib/utils/positioningHelper.d.ts +2 -2
  24. package/lib/utils/positioningHelper.js +38 -30
  25. package/lib/utils/positioningHelper.js.map +1 -1
  26. package/lib/utils/resolvePositioningShorthand.js +57 -19
  27. package/lib/utils/resolvePositioningShorthand.js.map +1 -1
  28. package/lib/utils/useCallbackRef.js +35 -29
  29. package/lib/utils/useCallbackRef.js.map +1 -1
  30. package/lib-commonjs/createArrowStyles.d.ts +3 -3
  31. package/lib-commonjs/createArrowStyles.js +55 -51
  32. package/lib-commonjs/createArrowStyles.js.map +1 -1
  33. package/lib-commonjs/createVirtualElementFromClick.js +23 -16
  34. package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
  35. package/lib-commonjs/index.js +26 -5
  36. package/lib-commonjs/index.js.map +1 -1
  37. package/lib-commonjs/types.js +4 -1
  38. package/lib-commonjs/types.js.map +1 -1
  39. package/lib-commonjs/usePopper.js +376 -316
  40. package/lib-commonjs/usePopper.js.map +1 -1
  41. package/lib-commonjs/usePopperMouseTarget.js +38 -25
  42. package/lib-commonjs/usePopperMouseTarget.js.map +1 -1
  43. package/lib-commonjs/utils/getBasePlacement.js +7 -2
  44. package/lib-commonjs/utils/getBasePlacement.js.map +1 -1
  45. package/lib-commonjs/utils/getBoundary.js +23 -12
  46. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  47. package/lib-commonjs/utils/getReactFiberFromNode.js +44 -36
  48. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  49. package/lib-commonjs/utils/getScrollParent.js +53 -33
  50. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  51. package/lib-commonjs/utils/index.js +14 -2
  52. package/lib-commonjs/utils/index.js.map +1 -1
  53. package/lib-commonjs/utils/mergeArrowOffset.js +35 -25
  54. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  55. package/lib-commonjs/utils/positioningHelper.d.ts +2 -2
  56. package/lib-commonjs/utils/positioningHelper.js +46 -31
  57. package/lib-commonjs/utils/positioningHelper.js.map +1 -1
  58. package/lib-commonjs/utils/resolvePositioningShorthand.js +65 -22
  59. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  60. package/lib-commonjs/utils/useCallbackRef.js +45 -32
  61. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  62. package/package.json +8 -8
package/CHANGELOG.json CHANGED
@@ -2,17 +2,76 @@
2
2
  "name": "@fluentui/react-positioning",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 22 Nov 2021 04:15:08 GMT",
6
- "tag": "@fluentui/react-positioning_v0.0.0-nightlyc9ccb6f37d20211122.1",
7
- "version": "0.0.0-nightlyc9ccb6f37d20211122.1",
5
+ "date": "Wed, 05 Jan 2022 04:18:36 GMT",
6
+ "tag": "@fluentui/react-positioning_v0.0.0-nightlyca6ef2bc8e20220105.1",
7
+ "version": "0.0.0-nightlyca6ef2bc8e20220105.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
11
11
  "author": "email not defined",
12
12
  "package": "@fluentui/react-positioning",
13
- "commit": "485cdebc9d90401363f72f87d647689444cdaba4",
13
+ "commit": "6b7aa2d681aba265af6ba17a7eff9012a967ddcb",
14
14
  "comment": "Release nightly v9"
15
15
  },
16
+ {
17
+ "author": "olfedias@microsoft.com",
18
+ "package": "@fluentui/react-positioning",
19
+ "commit": "a76afe26daad901ff5458ffdda7e66e600d5bcac",
20
+ "comment": "use new types from makeStyles core"
21
+ },
22
+ {
23
+ "author": "bsunderhus@microsoft.com",
24
+ "package": "@fluentui/react-positioning",
25
+ "commit": "e382ad22539fc97bb283ca4ed856e126c7477e89",
26
+ "comment": "Adds @noflip annotation to data-popper-placement styles"
27
+ },
28
+ {
29
+ "author": "olfedias@microsoft.com",
30
+ "package": "@fluentui/react-positioning",
31
+ "commit": "967d6b74cf0507685a24e0cfaa8c7b9d52a351e1",
32
+ "comment": "update styles to not use CSS shorthands"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-positioning",
37
+ "comment": "Bump @fluentui/react-make-styles to v0.0.0-nightlyca6ef2bc8e20220105.1",
38
+ "commit": "6b7aa2d681aba265af6ba17a7eff9012a967ddcb"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-positioning",
43
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightlyca6ef2bc8e20220105.1",
44
+ "commit": "6b7aa2d681aba265af6ba17a7eff9012a967ddcb"
45
+ },
46
+ {
47
+ "author": "beachball",
48
+ "package": "@fluentui/react-positioning",
49
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightlyca6ef2bc8e20220105.1",
50
+ "commit": "6b7aa2d681aba265af6ba17a7eff9012a967ddcb"
51
+ },
52
+ {
53
+ "author": "beachball",
54
+ "package": "@fluentui/react-positioning",
55
+ "comment": "Bump @fluentui/babel-make-styles to v0.0.0-nightlyca6ef2bc8e20220105.1",
56
+ "commit": "6b7aa2d681aba265af6ba17a7eff9012a967ddcb"
57
+ }
58
+ ]
59
+ }
60
+ },
61
+ {
62
+ "date": "Thu, 25 Nov 2021 08:34:15 GMT",
63
+ "tag": "@fluentui/react-positioning_v9.0.0-beta.4",
64
+ "version": "9.0.0-beta.4",
65
+ "comments": {
66
+ "none": [
67
+ {
68
+ "author": "lingfangao@hotmail.com",
69
+ "package": "@fluentui/react-positioning",
70
+ "commit": "718e63006d8d07d24efab9c32942041963d78dc7",
71
+ "comment": "Migrate package to use solution style ts-configs"
72
+ }
73
+ ],
74
+ "prerelease": [
16
75
  {
17
76
  "author": "lingfangao@hotmail.com",
18
77
  "package": "@fluentui/react-positioning",
@@ -22,20 +81,26 @@
22
81
  {
23
82
  "author": "beachball",
24
83
  "package": "@fluentui/react-positioning",
25
- "comment": "Bump @fluentui/react-make-styles to v0.0.0-nightlyc9ccb6f37d20211122.1",
26
- "commit": "485cdebc9d90401363f72f87d647689444cdaba4"
84
+ "comment": "Bump @fluentui/react-make-styles to v9.0.0-beta.4",
85
+ "commit": "48d236ac53a4950fabc3ddd52f91dac93ca0195b"
86
+ },
87
+ {
88
+ "author": "beachball",
89
+ "package": "@fluentui/react-positioning",
90
+ "comment": "Bump @fluentui/react-shared-contexts to v9.0.0-beta.4",
91
+ "commit": "48d236ac53a4950fabc3ddd52f91dac93ca0195b"
27
92
  },
28
93
  {
29
94
  "author": "beachball",
30
95
  "package": "@fluentui/react-positioning",
31
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightlyc9ccb6f37d20211122.1",
32
- "commit": "485cdebc9d90401363f72f87d647689444cdaba4"
96
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-beta.4",
97
+ "commit": "48d236ac53a4950fabc3ddd52f91dac93ca0195b"
33
98
  },
34
99
  {
35
100
  "author": "beachball",
36
101
  "package": "@fluentui/react-positioning",
37
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightlyc9ccb6f37d20211122.1",
38
- "commit": "485cdebc9d90401363f72f87d647689444cdaba4"
102
+ "comment": "Bump @fluentui/babel-make-styles to v9.0.0-beta.4",
103
+ "commit": "48d236ac53a4950fabc3ddd52f91dac93ca0195b"
39
104
  }
40
105
  ]
41
106
  }
package/CHANGELOG.md CHANGED
@@ -1,21 +1,37 @@
1
1
  # Change Log - @fluentui/react-positioning
2
2
 
3
- This log was last generated on Mon, 22 Nov 2021 04:15:08 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 05 Jan 2022 04:18:36 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightlyc9ccb6f37d20211122.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v0.0.0-nightlyc9ccb6f37d20211122.1)
7
+ ## [0.0.0-nightlyca6ef2bc8e20220105.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v0.0.0-nightlyca6ef2bc8e20220105.1)
8
8
 
9
- Mon, 22 Nov 2021 04:15:08 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-beta.3..@fluentui/react-positioning_v0.0.0-nightlyc9ccb6f37d20211122.1)
9
+ Wed, 05 Jan 2022 04:18:36 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-beta.4..@fluentui/react-positioning_v0.0.0-nightlyca6ef2bc8e20220105.1)
11
+
12
+ ### Changes
13
+
14
+ - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/6b7aa2d681aba265af6ba17a7eff9012a967ddcb) by email not defined)
15
+ - use new types from makeStyles core ([PR #20786](https://github.com/microsoft/fluentui/pull/20786) by olfedias@microsoft.com)
16
+ - Adds @noflip annotation to data-popper-placement styles ([PR #20845](https://github.com/microsoft/fluentui/pull/20845) by bsunderhus@microsoft.com)
17
+ - update styles to not use CSS shorthands ([PR #20842](https://github.com/microsoft/fluentui/pull/20842) by olfedias@microsoft.com)
18
+ - Bump @fluentui/react-make-styles to v0.0.0-nightlyca6ef2bc8e20220105.1 ([commit](https://github.com/microsoft/fluentui/commit/6b7aa2d681aba265af6ba17a7eff9012a967ddcb) by beachball)
19
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightlyca6ef2bc8e20220105.1 ([commit](https://github.com/microsoft/fluentui/commit/6b7aa2d681aba265af6ba17a7eff9012a967ddcb) by beachball)
20
+ - Bump @fluentui/react-utilities to v0.0.0-nightlyca6ef2bc8e20220105.1 ([commit](https://github.com/microsoft/fluentui/commit/6b7aa2d681aba265af6ba17a7eff9012a967ddcb) by beachball)
21
+ - Bump @fluentui/babel-make-styles to v0.0.0-nightlyca6ef2bc8e20220105.1 ([commit](https://github.com/microsoft/fluentui/commit/6b7aa2d681aba265af6ba17a7eff9012a967ddcb) by beachball)
22
+
23
+ ## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.0.0-beta.4)
24
+
25
+ Thu, 25 Nov 2021 08:34:15 GMT
26
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-beta.3..@fluentui/react-positioning_v9.0.0-beta.4)
11
27
 
12
28
  ### Changes
13
29
 
14
- - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/485cdebc9d90401363f72f87d647689444cdaba4) by email not defined)
15
30
  - Add utility function to create styles for an arrow element ([PR #20541](https://github.com/microsoft/fluentui/pull/20541) by lingfangao@hotmail.com)
16
- - Bump @fluentui/react-make-styles to v0.0.0-nightlyc9ccb6f37d20211122.1 ([commit](https://github.com/microsoft/fluentui/commit/485cdebc9d90401363f72f87d647689444cdaba4) by beachball)
17
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightlyc9ccb6f37d20211122.1 ([commit](https://github.com/microsoft/fluentui/commit/485cdebc9d90401363f72f87d647689444cdaba4) by beachball)
18
- - Bump @fluentui/react-utilities to v0.0.0-nightlyc9ccb6f37d20211122.1 ([commit](https://github.com/microsoft/fluentui/commit/485cdebc9d90401363f72f87d647689444cdaba4) by beachball)
31
+ - Bump @fluentui/react-make-styles to v9.0.0-beta.4 ([PR #20762](https://github.com/microsoft/fluentui/pull/20762) by beachball)
32
+ - Bump @fluentui/react-shared-contexts to v9.0.0-beta.4 ([PR #20762](https://github.com/microsoft/fluentui/pull/20762) by beachball)
33
+ - Bump @fluentui/react-utilities to v9.0.0-beta.4 ([PR #20762](https://github.com/microsoft/fluentui/pull/20762) by beachball)
34
+ - Bump @fluentui/babel-make-styles to v9.0.0-beta.4 ([PR #20762](https://github.com/microsoft/fluentui/pull/20762) by beachball)
19
35
 
20
36
  ## [9.0.0-beta.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.0.0-beta.3)
21
37
 
@@ -1,4 +1,4 @@
1
- import type { MakeStylesStyleRule } from '@fluentui/make-styles';
1
+ import type { MakeStylesStyleRule } from '@fluentui/react-make-styles';
2
2
  import * as PopperJs from '@popperjs/core';
3
3
  import * as React_2 from 'react';
4
4
  import type { Theme } from '@fluentui/react-theme';
@@ -23,8 +23,8 @@ export declare type Boundary = PopperJs.Boundary | 'scrollParent' | 'window';
23
23
  * })
24
24
  * ...
25
25
  *
26
- * state.arrowWithSize.clasName = styles.arrowWithSize
27
- * state.arrowWithoutSize.className = mergeClases(
26
+ * state.arrowWithSize.className = styles.arrowWithSize
27
+ * state.arrowWithoutSize.className = mergeClasses(
28
28
  * styles.arrowWithoutSize,
29
29
  * state.smallArrow && styles.smallArrow,
30
30
  * state.mediumArrow && styles.mediumArrow,
@@ -1,4 +1,4 @@
1
- import type { MakeStylesStyleRule } from '@fluentui/make-styles';
1
+ import type { MakeStylesStyleRule } from '@fluentui/react-make-styles';
2
2
  import type { Theme } from '@fluentui/react-theme';
3
3
  /**
4
4
  * Helper that creates a makeStyles rule for an arrow element.
@@ -14,8 +14,8 @@ import type { Theme } from '@fluentui/react-theme';
14
14
  * })
15
15
  * ...
16
16
  *
17
- * state.arrowWithSize.clasName = styles.arrowWithSize
18
- * state.arrowWithoutSize.className = mergeClases(
17
+ * state.arrowWithSize.className = styles.arrowWithSize
18
+ * state.arrowWithoutSize.className = mergeClasses(
19
19
  * styles.arrowWithoutSize,
20
20
  * state.smallArrow && styles.smallArrow,
21
21
  * state.mediumArrow && styles.mediumArrow,
@@ -1,3 +1,4 @@
1
+ import { shorthands } from '@fluentui/react-make-styles';
1
2
  /**
2
3
  * Helper that creates a makeStyles rule for an arrow element.
3
4
  * For runtime arrow size toggling simply create extra classnames to apply to the arrow element
@@ -12,8 +13,8 @@
12
13
  * })
13
14
  * ...
14
15
  *
15
- * state.arrowWithSize.clasName = styles.arrowWithSize
16
- * state.arrowWithoutSize.className = mergeClases(
16
+ * state.arrowWithSize.className = styles.arrowWithSize
17
+ * state.arrowWithoutSize.className = mergeClasses(
17
18
  * styles.arrowWithoutSize,
18
19
  * state.smallArrow && styles.smallArrow,
19
20
  * state.mediumArrow && styles.mediumArrow,
@@ -22,54 +23,51 @@
22
23
  *
23
24
  * @param size - dimensions of the square arrow element in pixels.
24
25
  */
26
+
25
27
  export function createArrowStyles(size) {
26
- return theme => {
27
- const arrowHCBorderStyle = `1px solid transparent`;
28
- const arrowHCBorder = {
29
- borderRight: arrowHCBorderStyle,
30
- borderBottom: arrowHCBorderStyle,
31
- };
32
- return {
33
- position: 'absolute',
34
- background: 'inherit',
35
- visibility: 'hidden',
36
- zIndex: -1,
37
- ...(size && {
38
- aspectRatio: 1,
39
- width: `${size}px`,
40
- }),
41
- ':before': {
42
- content: '""',
43
- borderRadius: '4px',
44
- position: 'absolute',
45
- width: 'inherit',
46
- height: 'inherit',
47
- background: 'inherit',
48
- visibility: 'visible',
49
- borderBottomRightRadius: theme.borderRadiusSmall,
50
- transform: 'rotate(var(--angle)) translate(0, 50%) rotate(45deg)',
51
- },
52
- ':global([data-popper-placement])': {
53
- ':before': arrowHCBorder,
54
- },
55
- // Popper sets data-popper-placement on the root element, which is used to align the arrow
56
- ':global([data-popper-placement^="top"])': {
57
- bottom: 0,
58
- '--angle': '0',
59
- },
60
- ':global([data-popper-placement^="right"])': {
61
- left: 0,
62
- '--angle': '90deg',
63
- },
64
- ':global([data-popper-placement^="bottom"])': {
65
- top: 0,
66
- '--angle': '180deg',
67
- },
68
- ':global([data-popper-placement^="left"])': {
69
- right: 0,
70
- '--angle': '270deg',
71
- },
72
- };
73
- };
28
+ return theme => ({
29
+ position: 'absolute',
30
+ backgroundColor: 'inherit',
31
+ visibility: 'hidden',
32
+ zIndex: -1,
33
+ ...(size && {
34
+ aspectRatio: '1',
35
+ width: `${size}px`
36
+ }),
37
+ ':before': {
38
+ content: '""',
39
+ ...shorthands.borderRadius('4px'),
40
+ position: 'absolute',
41
+ width: 'inherit',
42
+ height: 'inherit',
43
+ backgroundColor: 'inherit',
44
+ visibility: 'visible',
45
+ borderBottomRightRadius: theme.borderRadiusSmall,
46
+ transform: 'rotate(var(--angle)) translate(0, 50%) rotate(45deg)'
47
+ },
48
+ ':global([data-popper-placement])': {
49
+ ':before': { // Special border for High Contrast mode
50
+ ...shorthands.borderRight('1px', 'solid', 'transparent'),
51
+ ...shorthands.borderBottom('1px', 'solid', 'transparent')
52
+ }
53
+ },
54
+ // Popper sets data-popper-placement on the root element, which is used to align the arrow
55
+ ':global([data-popper-placement^="top"])': {
56
+ bottom: 0,
57
+ '--angle': '0'
58
+ },
59
+ ':global([data-popper-placement^="right"])': {
60
+ left: '0 /* @noflip */',
61
+ '--angle': '90deg'
62
+ },
63
+ ':global([data-popper-placement^="bottom"])': {
64
+ top: 0,
65
+ '--angle': '180deg'
66
+ },
67
+ ':global([data-popper-placement^="left"])': {
68
+ right: '0 /* @noflip */',
69
+ '--angle': '270deg'
70
+ }
71
+ });
74
72
  }
75
73
  //# sourceMappingURL=createArrowStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createArrowStyles.js","sourceRoot":"","sources":["../src/createArrowStyles.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAa;IAC7C,OAAO,KAAK,CAAC,EAAE;QACb,MAAM,kBAAkB,GAAG,uBAAuB,CAAC;QACnD,MAAM,aAAa,GAAG;YACpB,WAAW,EAAE,kBAAkB;YAC/B,YAAY,EAAE,kBAAkB;SACjC,CAAC;QAEF,OAAO;YACL,QAAQ,EAAE,UAAU;YACpB,UAAU,EAAE,SAAS;YACrB,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,CAAC,CAAC;YAEV,GAAG,CAAC,IAAI,IAAI;gBACV,WAAW,EAAE,CAAC;gBACd,KAAK,EAAE,GAAG,IAAI,IAAI;aACnB,CAAC;YAEF,SAAS,EAAE;gBACT,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,KAAK;gBACnB,QAAQ,EAAE,UAAU;gBACpB,KAAK,EAAE,SAAS;gBAChB,MAAM,EAAE,SAAS;gBACjB,UAAU,EAAE,SAAS;gBACrB,UAAU,EAAE,SAAS;gBACrB,uBAAuB,EAAE,KAAK,CAAC,iBAAiB;gBAChD,SAAS,EAAE,sDAAsD;aAClE;YAED,kCAAkC,EAAE;gBAClC,SAAS,EAAE,aAAa;aACzB;YAED,0FAA0F;YAC1F,yCAAyC,EAAE;gBACzC,MAAM,EAAE,CAAC;gBACT,SAAS,EAAE,GAAG;aACf;YAED,2CAA2C,EAAE;gBAC3C,IAAI,EAAE,CAAC;gBACP,SAAS,EAAE,OAAO;aACnB;YACD,4CAA4C,EAAE;gBAC5C,GAAG,EAAE,CAAC;gBACN,SAAS,EAAE,QAAQ;aACpB;YACD,0CAA0C,EAAE;gBAC1C,KAAK,EAAE,CAAC;gBACR,SAAS,EAAE,QAAQ;aACpB;SACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"sources":["../src/createArrowStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,QAA2B,6BAA3B;AAIA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;;AACH,OAAM,SAAU,iBAAV,CAA4B,IAA5B,EAAyC;AAC7C,SAAO,KAAK,KAAK;AACf,IAAA,QAAQ,EAAE,UADK;AAEf,IAAA,eAAe,EAAE,SAFF;AAGf,IAAA,UAAU,EAAE,QAHG;AAIf,IAAA,MAAM,EAAE,CAAC,CAJM;AAMf,QAAI,IAAI,IAAI;AACV,MAAA,WAAW,EAAE,GADH;AAEV,MAAA,KAAK,EAAE,GAAG,IAAI;AAFJ,KAAZ,CANe;AAWf,eAAW;AACT,MAAA,OAAO,EAAE,IADA;AAET,SAAG,UAAU,CAAC,YAAX,CAAwB,KAAxB,CAFM;AAGT,MAAA,QAAQ,EAAE,UAHD;AAIT,MAAA,KAAK,EAAE,SAJE;AAKT,MAAA,MAAM,EAAE,SALC;AAMT,MAAA,eAAe,EAAE,SANR;AAOT,MAAA,UAAU,EAAE,SAPH;AAQT,MAAA,uBAAuB,EAAE,KAAK,CAAC,iBARtB;AAST,MAAA,SAAS,EAAE;AATF,KAXI;AAuBf,wCAAoC;AAClC,iBAAW,EACT;AACA,WAAG,UAAU,CAAC,WAAX,CAAuB,KAAvB,EAA8B,OAA9B,EAAuC,aAAvC,CAFM;AAGT,WAAG,UAAU,CAAC,YAAX,CAAwB,KAAxB,EAA+B,OAA/B,EAAwC,aAAxC;AAHM;AADuB,KAvBrB;AA+Bf;AACA,+CAA2C;AACzC,MAAA,MAAM,EAAE,CADiC;AAEzC,iBAAW;AAF8B,KAhC5B;AAqCf,iDAA6C;AAC3C,MAAA,IAAI,EAAE,iBADqC;AAE3C,iBAAW;AAFgC,KArC9B;AAyCf,kDAA8C;AAC5C,MAAA,GAAG,EAAE,CADuC;AAE5C,iBAAW;AAFiC,KAzC/B;AA6Cf,gDAA4C;AAC1C,MAAA,KAAK,EAAE,iBADmC;AAE1C,iBAAW;AAF+B;AA7C7B,GAAL,CAAZ;AAkDD","sourceRoot":""}
@@ -3,22 +3,24 @@
3
3
  * Can be used as a target for popper in scenarios such as context menus
4
4
  */
5
5
  export function createVirtualElementFromClick(nativeEvent) {
6
- const left = nativeEvent.clientX;
7
- const top = nativeEvent.clientY;
8
- const right = left + 1;
9
- const bottom = top + 1;
10
- function getBoundingClientRect() {
11
- return {
12
- left,
13
- top,
14
- right,
15
- bottom,
16
- height: 1,
17
- width: 1,
18
- };
19
- }
6
+ const left = nativeEvent.clientX;
7
+ const top = nativeEvent.clientY;
8
+ const right = left + 1;
9
+ const bottom = top + 1;
10
+
11
+ function getBoundingClientRect() {
20
12
  return {
21
- getBoundingClientRect,
13
+ left,
14
+ top,
15
+ right,
16
+ bottom,
17
+ height: 1,
18
+ width: 1
22
19
  };
20
+ }
21
+
22
+ return {
23
+ getBoundingClientRect
24
+ };
23
25
  }
24
26
  //# sourceMappingURL=createVirtualElementFromClick.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createVirtualElementFromClick.js","sourceRoot":"","sources":["../src/createVirtualElementFromClick.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAAC,WAAuB;IACnE,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC;IACjC,MAAM,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC;IAChC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC;IACvB,MAAM,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC;IAEvB,SAAS,qBAAqB;QAC5B,OAAO;YACL,IAAI;YACJ,GAAG;YACH,KAAK;YACL,MAAM;YAEN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,CAAC;SACT,CAAC;IACJ,CAAC;IAED,OAAO;QACL,qBAAqB;KACtB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"sources":["../src/createVirtualElementFromClick.ts"],"names":[],"mappings":"AAEA;;;AAGG;AACH,OAAM,SAAU,6BAAV,CAAwC,WAAxC,EAA+D;AACnE,QAAM,IAAI,GAAG,WAAW,CAAC,OAAzB;AACA,QAAM,GAAG,GAAG,WAAW,CAAC,OAAxB;AACA,QAAM,KAAK,GAAG,IAAI,GAAG,CAArB;AACA,QAAM,MAAM,GAAG,GAAG,GAAG,CAArB;;AAEA,WAAS,qBAAT,GAA8B;AAC5B,WAAO;AACL,MAAA,IADK;AAEL,MAAA,GAFK;AAGL,MAAA,KAHK;AAIL,MAAA,MAJK;AAML,MAAA,MAAM,EAAE,CANH;AAOL,MAAA,KAAK,EAAE;AAPF,KAAP;AASD;;AAED,SAAO;AACL,IAAA;AADK,GAAP;AAGD","sourceRoot":""}