@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.
- package/CHANGELOG.json +45 -10
- package/CHANGELOG.md +18 -7
- package/dist/react-positioning.d.ts +28 -0
- package/lib/createArrowStyles.d.ts +27 -0
- package/lib/createArrowStyles.js +75 -0
- package/lib/createArrowStyles.js.map +1 -0
- package/lib/createVirtualElementFromClick.js +9 -9
- package/lib/createVirtualElementFromClick.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/usePopper.js +64 -71
- package/lib/usePopper.js.map +1 -1
- package/lib/usePopperMouseTarget.js +5 -5
- package/lib/usePopperMouseTarget.js.map +1 -1
- package/lib/utils/getBoundary.js +1 -1
- package/lib/utils/getReactFiberFromNode.d.ts +0 -1
- package/lib/utils/getReactFiberFromNode.js +1 -1
- package/lib/utils/getReactFiberFromNode.js.map +1 -1
- package/lib/utils/getScrollParent.js +6 -6
- package/lib/utils/getScrollParent.js.map +1 -1
- package/lib/utils/mergeArrowOffset.js +5 -5
- package/lib/utils/mergeArrowOffset.js.map +1 -1
- package/lib/utils/positioningHelper.d.ts +1 -1
- package/lib/utils/positioningHelper.js +14 -14
- package/lib/utils/positioningHelper.js.map +1 -1
- package/lib/utils/resolvePositioningShorthand.js +1 -1
- package/lib/utils/resolvePositioningShorthand.js.map +1 -1
- package/lib/utils/useCallbackRef.js +6 -6
- package/lib/utils/useCallbackRef.js.map +1 -1
- package/lib-commonjs/createArrowStyles.d.ts +27 -0
- package/lib-commonjs/createArrowStyles.js +79 -0
- package/lib-commonjs/createArrowStyles.js.map +1 -0
- package/lib-commonjs/createVirtualElementFromClick.js +9 -9
- package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
- package/lib-commonjs/index.d.ts +2 -1
- package/lib-commonjs/index.js +3 -2
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/usePopper.js +69 -76
- package/lib-commonjs/usePopper.js.map +1 -1
- package/lib-commonjs/usePopperMouseTarget.js +7 -7
- package/lib-commonjs/usePopperMouseTarget.js.map +1 -1
- package/lib-commonjs/utils/getBoundary.js +2 -2
- package/lib-commonjs/utils/getBoundary.js.map +1 -1
- package/lib-commonjs/utils/getReactFiberFromNode.d.ts +0 -1
- package/lib-commonjs/utils/getReactFiberFromNode.js +1 -1
- package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
- package/lib-commonjs/utils/getScrollParent.js +6 -6
- package/lib-commonjs/utils/getScrollParent.js.map +1 -1
- package/lib-commonjs/utils/index.js +1 -1
- package/lib-commonjs/utils/mergeArrowOffset.js +5 -5
- package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
- package/lib-commonjs/utils/positioningHelper.d.ts +1 -1
- package/lib-commonjs/utils/positioningHelper.js +14 -14
- package/lib-commonjs/utils/positioningHelper.js.map +1 -1
- package/lib-commonjs/utils/resolvePositioningShorthand.js +1 -1
- package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
- package/lib-commonjs/utils/useCallbackRef.js +8 -8
- package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
- 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
|
-
|
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":";;;AAEA,uDAAuD;AACvD,
|
1
|
+
{"version":3,"file":"resolvePositioningShorthand.js","sourceRoot":"","sources":["../../src/utils/resolvePositioningShorthand.ts"],"names":[],"mappings":";;;AAE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|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.useCallbackRef = void 0;
|
4
|
-
|
5
|
-
|
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
|
-
|
25
|
-
|
24
|
+
const isFirst = React.useRef(true);
|
25
|
+
const [ref] = React.useState(() => ({
|
26
26
|
// value
|
27
27
|
value: initialValue,
|
28
28
|
// last callback
|
29
|
-
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
|
-
|
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
|
-
})
|
47
|
-
react_utilities_1.useIsomorphicLayoutEffect(
|
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
|
1
|
+
{"version":3,"file":"useCallbackRef.js","sourceRoot":"","sources":["../../src/utils/useCallbackRef.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,+DAAsE;AAEtE;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,cAAc,CAC5B,YAAsB,EACtB,QAA2D,EAC3D,kBAA4B;IAE5B,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,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-
|
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-
|
37
|
-
"@fluentui/react-
|
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",
|