@fluentui/react-positioning 0.0.0-nightlya372ad979820211103.1 → 0.0.0-nightlya54302c0b220211124.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. package/CHANGELOG.json +45 -10
  2. package/CHANGELOG.md +18 -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 +9 -9
  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 +64 -71
  13. package/lib/usePopper.js.map +1 -1
  14. package/lib/usePopperMouseTarget.js +5 -5
  15. package/lib/usePopperMouseTarget.js.map +1 -1
  16. package/lib/utils/getBoundary.js +1 -1
  17. package/lib/utils/getReactFiberFromNode.d.ts +0 -1
  18. package/lib/utils/getReactFiberFromNode.js +1 -1
  19. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  20. package/lib/utils/getScrollParent.js +6 -6
  21. package/lib/utils/getScrollParent.js.map +1 -1
  22. package/lib/utils/mergeArrowOffset.js +5 -5
  23. package/lib/utils/mergeArrowOffset.js.map +1 -1
  24. package/lib/utils/positioningHelper.d.ts +1 -1
  25. package/lib/utils/positioningHelper.js +14 -14
  26. package/lib/utils/positioningHelper.js.map +1 -1
  27. package/lib/utils/resolvePositioningShorthand.js +1 -1
  28. package/lib/utils/resolvePositioningShorthand.js.map +1 -1
  29. package/lib/utils/useCallbackRef.js +6 -6
  30. package/lib/utils/useCallbackRef.js.map +1 -1
  31. package/lib-commonjs/createArrowStyles.d.ts +27 -0
  32. package/lib-commonjs/createArrowStyles.js +79 -0
  33. package/lib-commonjs/createArrowStyles.js.map +1 -0
  34. package/lib-commonjs/createVirtualElementFromClick.js +9 -9
  35. package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
  36. package/lib-commonjs/index.d.ts +2 -1
  37. package/lib-commonjs/index.js +3 -2
  38. package/lib-commonjs/index.js.map +1 -1
  39. package/lib-commonjs/usePopper.js +69 -76
  40. package/lib-commonjs/usePopper.js.map +1 -1
  41. package/lib-commonjs/usePopperMouseTarget.js +7 -7
  42. package/lib-commonjs/usePopperMouseTarget.js.map +1 -1
  43. package/lib-commonjs/utils/getBoundary.js +2 -2
  44. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  45. package/lib-commonjs/utils/getReactFiberFromNode.d.ts +0 -1
  46. package/lib-commonjs/utils/getReactFiberFromNode.js +1 -1
  47. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  48. package/lib-commonjs/utils/getScrollParent.js +6 -6
  49. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  50. package/lib-commonjs/utils/index.js +1 -1
  51. package/lib-commonjs/utils/mergeArrowOffset.js +5 -5
  52. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  53. package/lib-commonjs/utils/positioningHelper.d.ts +1 -1
  54. package/lib-commonjs/utils/positioningHelper.js +14 -14
  55. package/lib-commonjs/utils/positioningHelper.js.map +1 -1
  56. package/lib-commonjs/utils/resolvePositioningShorthand.js +1 -1
  57. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  58. package/lib-commonjs/utils/useCallbackRef.js +8 -8
  59. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  60. package/package.json +4 -4
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolvePositioningShorthand = void 0;
4
4
  // Look up table for shorthand to avoid parsing strings
5
- var shorthandLookup = {
5
+ const shorthandLookup = {
6
6
  above: { position: 'above', align: 'center' },
7
7
  'above-start': { position: 'above', align: 'start' },
8
8
  'above-end': { position: 'above', align: 'end' },
@@ -1 +1 @@
1
- {"version":3,"file":"resolvePositioningShorthand.js","sourceRoot":"","sources":["../../src/utils/resolvePositioningShorthand.ts"],"names":[],"mappings":";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;KACnC;IAED,OAAO,SAAuC,CAAC;AACjD,CAAC;AAZD,kEAYC"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCallbackRef = void 0;
4
- var React = require("react");
5
- var react_utilities_1 = require("@fluentui/react-utilities");
4
+ const React = require("react");
5
+ const react_utilities_1 = require("@fluentui/react-utilities");
6
6
  /**
7
7
  * Creates a MutableRef with ref change callback. Is useful as React.useRef() doesn't notify you when its content
8
8
  * changes and mutating the .current property doesn't cause a re-render. An opt-out will be use a callback ref via
@@ -21,19 +21,19 @@ var react_utilities_1 = require("@fluentui/react-utilities");
21
21
  * // prints 0 -> 1
22
22
  */
23
23
  function useCallbackRef(initialValue, callback, skipInitialResolve) {
24
- var isFirst = React.useRef(true);
25
- var ref = React.useState(function () { return ({
24
+ const isFirst = React.useRef(true);
25
+ const [ref] = React.useState(() => ({
26
26
  // value
27
27
  value: initialValue,
28
28
  // last callback
29
- callback: callback,
29
+ callback,
30
30
  // "memoized" public interface
31
31
  facade: {
32
32
  get current() {
33
33
  return ref.value;
34
34
  },
35
35
  set current(value) {
36
- var last = ref.value;
36
+ const last = ref.value;
37
37
  if (last !== value) {
38
38
  ref.value = value;
39
39
  if (skipInitialResolve && isFirst.current) {
@@ -43,8 +43,8 @@ function useCallbackRef(initialValue, callback, skipInitialResolve) {
43
43
  }
44
44
  },
45
45
  },
46
- }); })[0];
47
- react_utilities_1.useIsomorphicLayoutEffect(function () {
46
+ }));
47
+ react_utilities_1.useIsomorphicLayoutEffect(() => {
48
48
  isFirst.current = false;
49
49
  }, []);
50
50
  // update callback
@@ -1 +1 @@
1
- {"version":3,"file":"useCallbackRef.js","sourceRoot":"","sources":["../../src/utils/useCallbackRef.ts"],"names":[],"mappings":";;;AAAA,6BAA+B;AAC/B,6DAAsE;AAEtE;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,cAAc,CAC5B,YAAsB,EACtB,QAA2D,EAC3D,kBAA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GAAG,EAAE,CAAC,CAAC;QAClC,QAAQ;QACR,KAAK,EAAE,YAAY;QACnB,gBAAgB;QAChB,QAAQ;QACR,8BAA8B;QAC9B,MAAM,EAAE;YACN,IAAI,OAAO;gBACT,OAAO,GAAG,CAAC,KAAK,CAAC;YACnB,CAAC;YACD,IAAI,OAAO,CAAC,KAAK;gBACf,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC;gBAEvB,IAAI,IAAI,KAAK,KAAK,EAAE;oBAClB,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;oBAElB,IAAI,kBAAkB,IAAI,OAAO,CAAC,OAAO,EAAE;wBACzC,OAAO;qBACR;oBAED,GAAG,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;iBAC3B;YACH,CAAC;SACF;KACF,CAAC,CAAC,CAAC;IAEJ,2CAAyB,CAAC,GAAG,EAAE;QAC7B,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;IAC1B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,kBAAkB;IAClB,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAExB,OAAO,GAAG,CAAC,MAAM,CAAC;AACpB,CAAC;AAxCD,wCAwCC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-positioning",
3
- "version": "0.0.0-nightlya372ad979820211103.1",
3
+ "version": "0.0.0-nightlya54302c0b220211124.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",
@@ -33,8 +33,9 @@
33
33
  "react-dom": "16.8.6"
34
34
  },
35
35
  "dependencies": {
36
- "@fluentui/react-shared-contexts": "0.0.0-nightlya372ad979820211103.1",
37
- "@fluentui/react-utilities": "0.0.0-nightlya372ad979820211103.1",
36
+ "@fluentui/react-make-styles": "0.0.0-nightlya54302c0b220211124.1",
37
+ "@fluentui/react-shared-contexts": "0.0.0-nightlya54302c0b220211124.1",
38
+ "@fluentui/react-utilities": "0.0.0-nightlya54302c0b220211124.0",
38
39
  "@popperjs/core": "~2.4.3",
39
40
  "tslib": "^2.1.0"
40
41
  },
@@ -45,7 +46,6 @@
45
46
  "react-dom": ">=16.8.0 <18.0.0"
46
47
  },
47
48
  "beachball": {
48
- "tag": "beta",
49
49
  "disallowedChangeTypes": [
50
50
  "major",
51
51
  "minor",