@fluentui/react-utilities 0.0.0-nightly-20230317-0436.1 → 0.0.0-nightly-20230317-1454.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.
- package/.swcrc +39 -0
- package/CHANGELOG.json +5 -5
- package/CHANGELOG.md +5 -5
- package/lib/compose/getSlots.js +6 -7
- package/lib/compose/getSlots.js.map +1 -1
- package/lib/compose/index.js +4 -4
- package/lib/compose/index.js.map +1 -1
- package/lib/compose/isResolvedShorthand.js +2 -2
- package/lib/compose/isResolvedShorthand.js.map +1 -1
- package/lib/compose/resolveShorthand.js +3 -3
- package/lib/compose/resolveShorthand.js.map +1 -1
- package/lib/compose/types.js +1 -1
- package/lib/compose/types.js.map +1 -1
- package/lib/events/index.js +1 -1
- package/lib/events/index.js.map +1 -1
- package/lib/events/mouseTouchHelpers.js +5 -4
- package/lib/events/mouseTouchHelpers.js.map +1 -1
- package/lib/hooks/index.js +12 -12
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useControllableState.js +7 -7
- package/lib/hooks/useControllableState.js.map +1 -1
- package/lib/hooks/useEventCallback.js +3 -3
- package/lib/hooks/useEventCallback.js.map +1 -1
- package/lib/hooks/useFirstMount.js +1 -1
- package/lib/hooks/useFirstMount.js.map +1 -1
- package/lib/hooks/useForceUpdate.js +1 -1
- package/lib/hooks/useForceUpdate.js.map +1 -1
- package/lib/hooks/useId.js +6 -6
- package/lib/hooks/useId.js.map +1 -1
- package/lib/hooks/useIsomorphicLayoutEffect.js +3 -4
- package/lib/hooks/useIsomorphicLayoutEffect.js.map +1 -1
- package/lib/hooks/useMergedRefs.js +2 -2
- package/lib/hooks/useMergedRefs.js.map +1 -1
- package/lib/hooks/useOnClickOutside.js +20 -23
- package/lib/hooks/useOnClickOutside.js.map +1 -1
- package/lib/hooks/useOnScrollOutside.js +7 -7
- package/lib/hooks/useOnScrollOutside.js.map +1 -1
- package/lib/hooks/usePrevious.js +1 -1
- package/lib/hooks/usePrevious.js.map +1 -1
- package/lib/hooks/useScrollbarWidth.js +5 -5
- package/lib/hooks/useScrollbarWidth.js.map +1 -1
- package/lib/hooks/useTimeout.js +1 -1
- package/lib/hooks/useTimeout.js.map +1 -1
- package/lib/index.js +6 -6
- package/lib/index.js.map +1 -1
- package/lib/ssr/SSRContext.js +5 -6
- package/lib/ssr/SSRContext.js.map +1 -1
- package/lib/ssr/canUseDOM.js +2 -3
- package/lib/ssr/canUseDOM.js.map +1 -1
- package/lib/ssr/index.js +2 -2
- package/lib/ssr/index.js.map +1 -1
- package/lib/trigger/applyTriggerPropsToChildren.js +4 -4
- package/lib/trigger/applyTriggerPropsToChildren.js.map +1 -1
- package/lib/trigger/getTriggerChild.js +2 -2
- package/lib/trigger/getTriggerChild.js.map +1 -1
- package/lib/trigger/index.js +4 -4
- package/lib/trigger/index.js.map +1 -1
- package/lib/trigger/isFluentTrigger.js +1 -0
- package/lib/trigger/isFluentTrigger.js.map +1 -1
- package/lib/trigger/types.js +1 -1
- package/lib/trigger/types.js.map +1 -1
- package/lib/utils/clamp.js +1 -2
- package/lib/utils/clamp.js.map +1 -1
- package/lib/utils/getNativeElementProps.js +4 -4
- package/lib/utils/getNativeElementProps.js.map +1 -1
- package/lib/utils/getRTLSafeKey.js +6 -7
- package/lib/utils/getRTLSafeKey.js.map +1 -1
- package/lib/utils/getReactCallbackName.js +3 -2
- package/lib/utils/getReactCallbackName.js.map +1 -1
- package/lib/utils/index.js +8 -8
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/isHTMLElement.js +2 -4
- package/lib/utils/isHTMLElement.js.map +1 -1
- package/lib/utils/isInteractiveHTMLElement.js +5 -5
- package/lib/utils/isInteractiveHTMLElement.js.map +1 -1
- package/lib/utils/mergeCallbacks.js +3 -4
- package/lib/utils/mergeCallbacks.js.map +1 -1
- package/lib/utils/omit.js +1 -2
- package/lib/utils/omit.js.map +1 -1
- package/lib/utils/properties.js +28 -55
- package/lib/utils/properties.js.map +1 -1
- package/lib-commonjs/compose/getSlots.js +47 -55
- package/lib-commonjs/compose/getSlots.js.map +1 -1
- package/lib-commonjs/compose/index.js +8 -7
- package/lib-commonjs/compose/index.js.map +1 -1
- package/lib-commonjs/compose/isResolvedShorthand.js +9 -37
- package/lib-commonjs/compose/isResolvedShorthand.js.map +1 -1
- package/lib-commonjs/compose/resolveShorthand.js +25 -32
- package/lib-commonjs/compose/resolveShorthand.js.map +1 -1
- package/lib-commonjs/compose/types.js +5 -2
- package/lib-commonjs/compose/types.js.map +1 -1
- package/lib-commonjs/events/index.js +5 -4
- package/lib-commonjs/events/index.js.map +1 -1
- package/lib-commonjs/events/mouseTouchHelpers.js +40 -37
- package/lib-commonjs/events/mouseTouchHelpers.js.map +1 -1
- package/lib-commonjs/hooks/index.js +16 -15
- package/lib-commonjs/hooks/index.js.map +1 -1
- package/lib-commonjs/hooks/useControllableState.js +63 -64
- package/lib-commonjs/hooks/useControllableState.js.map +1 -1
- package/lib-commonjs/hooks/useEventCallback.js +25 -31
- package/lib-commonjs/hooks/useEventCallback.js.map +1 -1
- package/lib-commonjs/hooks/useFirstMount.js +15 -23
- package/lib-commonjs/hooks/useFirstMount.js.map +1 -1
- package/lib-commonjs/hooks/useForceUpdate.js +9 -11
- package/lib-commonjs/hooks/useForceUpdate.js.map +1 -1
- package/lib-commonjs/hooks/useId.js +48 -47
- package/lib-commonjs/hooks/useId.js.map +1 -1
- package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js +10 -16
- package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js.map +1 -1
- package/lib-commonjs/hooks/useMergedRefs.js +25 -27
- package/lib-commonjs/hooks/useMergedRefs.js.map +1 -1
- package/lib-commonjs/hooks/useOnClickOutside.js +109 -115
- package/lib-commonjs/hooks/useOnClickOutside.js.map +1 -1
- package/lib-commonjs/hooks/useOnScrollOutside.js +33 -36
- package/lib-commonjs/hooks/useOnScrollOutside.js.map +1 -1
- package/lib-commonjs/hooks/usePrevious.js +17 -15
- package/lib-commonjs/hooks/usePrevious.js.map +1 -1
- package/lib-commonjs/hooks/useScrollbarWidth.js +32 -32
- package/lib-commonjs/hooks/useScrollbarWidth.js.map +1 -1
- package/lib-commonjs/hooks/useTimeout.js +30 -30
- package/lib-commonjs/hooks/useTimeout.js.map +1 -1
- package/lib-commonjs/index.js +52 -214
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/ssr/SSRContext.js +56 -59
- package/lib-commonjs/ssr/SSRContext.js.map +1 -1
- package/lib-commonjs/ssr/canUseDOM.js +12 -12
- package/lib-commonjs/ssr/canUseDOM.js.map +1 -1
- package/lib-commonjs/ssr/index.js +6 -5
- package/lib-commonjs/ssr/index.js.map +1 -1
- package/lib-commonjs/trigger/applyTriggerPropsToChildren.js +29 -31
- package/lib-commonjs/trigger/applyTriggerPropsToChildren.js.map +1 -1
- package/lib-commonjs/trigger/getTriggerChild.js +16 -36
- package/lib-commonjs/trigger/getTriggerChild.js.map +1 -1
- package/lib-commonjs/trigger/index.js +8 -7
- package/lib-commonjs/trigger/index.js.map +1 -1
- package/lib-commonjs/trigger/isFluentTrigger.js +10 -11
- package/lib-commonjs/trigger/isFluentTrigger.js.map +1 -1
- package/lib-commonjs/trigger/types.js +5 -2
- package/lib-commonjs/trigger/types.js.map +1 -1
- package/lib-commonjs/utils/clamp.js +10 -9
- package/lib-commonjs/utils/clamp.js.map +1 -1
- package/lib-commonjs/utils/getNativeElementProps.js +54 -61
- package/lib-commonjs/utils/getNativeElementProps.js.map +1 -1
- package/lib-commonjs/utils/getRTLSafeKey.js +22 -21
- package/lib-commonjs/utils/getRTLSafeKey.js.map +1 -1
- package/lib-commonjs/utils/getReactCallbackName.js +24 -24
- package/lib-commonjs/utils/getReactCallbackName.js.map +1 -1
- package/lib-commonjs/utils/index.js +12 -11
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/isHTMLElement.js +12 -12
- package/lib-commonjs/utils/isHTMLElement.js.map +1 -1
- package/lib-commonjs/utils/isInteractiveHTMLElement.js +20 -24
- package/lib-commonjs/utils/isInteractiveHTMLElement.js.map +1 -1
- package/lib-commonjs/utils/mergeCallbacks.js +14 -13
- package/lib-commonjs/utils/mergeCallbacks.js.map +1 -1
- package/lib-commonjs/utils/omit.js +18 -17
- package/lib-commonjs/utils/omit.js.map +1 -1
- package/lib-commonjs/utils/properties.js +327 -223
- package/lib-commonjs/utils/properties.js.map +1 -1
- package/package.json +4 -4
@@ -1,35 +1,35 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "useTimeout", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>useTimeout
|
5
8
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
/**
|
9
|
-
* @internal
|
10
|
-
* Helper to manage a browser timeout.
|
11
|
-
* Ensures that the timeout isn't set multiple times at once,
|
12
|
-
* and is cleaned up when the component is unloaded.
|
13
|
-
*
|
14
|
-
* @returns A pair of [setTimeout, clearTimeout] that are stable between renders.
|
15
|
-
*/
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
16
11
|
function useTimeout() {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
12
|
+
const [timeout] = _react.useState(()=>({
|
13
|
+
id: undefined,
|
14
|
+
set: (fn, delay)=>{
|
15
|
+
timeout.clear();
|
16
|
+
timeout.id = setTimeout(fn, delay);
|
17
|
+
},
|
18
|
+
clear: ()=>{
|
19
|
+
if (timeout.id !== undefined) {
|
20
|
+
clearTimeout(timeout.id);
|
21
|
+
timeout.id = undefined;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}));
|
25
|
+
// Clean up the timeout when the component is unloaded
|
26
|
+
_react.useEffect(()=>timeout.clear, [
|
27
|
+
timeout
|
28
|
+
]);
|
29
|
+
return [
|
30
|
+
timeout.set,
|
31
|
+
timeout.clear
|
32
|
+
];
|
33
|
+
} //# sourceMappingURL=useTimeout.js.map
|
34
|
+
|
35
35
|
//# sourceMappingURL=useTimeout.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/hooks/useTimeout.js"],"sourcesContent":["import * as React from \"react\";\n/**\n * @internal\n * Helper to manage a browser timeout.\n * Ensures that the timeout isn't set multiple times at once,\n * and is cleaned up when the component is unloaded.\n *\n * @returns A pair of [setTimeout, clearTimeout] that are stable between renders.\n */\nexport function useTimeout() {\n const [timeout] = React.useState(() => ({\n id: undefined,\n set: (fn, delay) => {\n timeout.clear();\n timeout.id = setTimeout(fn, delay);\n },\n clear: () => {\n if (timeout.id !== undefined) {\n clearTimeout(timeout.id);\n timeout.id = undefined;\n }\n }\n }));\n // Clean up the timeout when the component is unloaded\n React.useEffect(() => timeout.clear, [timeout]);\n return [timeout.set, timeout.clear];\n}\n//# sourceMappingURL=useTimeout.js.map"],"names":["useTimeout","timeout","React","useState","id","undefined","set","fn","delay","clear","setTimeout","clearTimeout","useEffect"],"mappings":";;;;+BASgBA;;aAAAA;;;6DATO;AAShB,SAASA,aAAa;IAC3B,MAAM,CAACC,QAAQ,GAAGC,OAAMC,QAAQ,CAAC,IAAO,CAAA;YACtCC,IAAIC;YACJC,KAAK,CAACC,IAAIC,QAAU;gBAClBP,QAAQQ,KAAK;gBACbR,QAAQG,EAAE,GAAGM,WAAWH,IAAIC;YAC9B;YACAC,OAAO,IAAM;gBACX,IAAIR,QAAQG,EAAE,KAAKC,WAAW;oBAC5BM,aAAaV,QAAQG,EAAE;oBACvBH,QAAQG,EAAE,GAAGC;gBACf,CAAC;YACH;QACF,CAAA;IACA,sDAAsD;IACtDH,OAAMU,SAAS,CAAC,IAAMX,QAAQQ,KAAK,EAAE;QAACR;KAAQ;IAC9C,OAAO;QAACA,QAAQK,GAAG;QAAEL,QAAQQ,KAAK;KAAC;AACrC,EACA,sCAAsC"}
|
package/lib-commonjs/index.js
CHANGED
@@ -1,217 +1,55 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
5
|
-
});
|
6
|
-
|
7
|
-
var
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
});
|
57
|
-
Object.defineProperty(exports, "useForceUpdate", {
|
58
|
-
enumerable: true,
|
59
|
-
get: function () {
|
60
|
-
return index_2.useForceUpdate;
|
61
|
-
}
|
62
|
-
});
|
63
|
-
Object.defineProperty(exports, "useId", {
|
64
|
-
enumerable: true,
|
65
|
-
get: function () {
|
66
|
-
return index_2.useId;
|
67
|
-
}
|
68
|
-
});
|
69
|
-
Object.defineProperty(exports, "useIsomorphicLayoutEffect", {
|
70
|
-
enumerable: true,
|
71
|
-
get: function () {
|
72
|
-
return index_2.useIsomorphicLayoutEffect;
|
73
|
-
}
|
74
|
-
});
|
75
|
-
Object.defineProperty(exports, "useMergedRefs", {
|
76
|
-
enumerable: true,
|
77
|
-
get: function () {
|
78
|
-
return index_2.useMergedRefs;
|
79
|
-
}
|
80
|
-
});
|
81
|
-
Object.defineProperty(exports, "useOnClickOutside", {
|
82
|
-
enumerable: true,
|
83
|
-
get: function () {
|
84
|
-
return index_2.useOnClickOutside;
|
85
|
-
}
|
86
|
-
});
|
87
|
-
Object.defineProperty(exports, "useOnScrollOutside", {
|
88
|
-
enumerable: true,
|
89
|
-
get: function () {
|
90
|
-
return index_2.useOnScrollOutside;
|
91
|
-
}
|
92
|
-
});
|
93
|
-
Object.defineProperty(exports, "usePrevious", {
|
94
|
-
enumerable: true,
|
95
|
-
get: function () {
|
96
|
-
return index_2.usePrevious;
|
97
|
-
}
|
98
|
-
});
|
99
|
-
Object.defineProperty(exports, "useScrollbarWidth", {
|
100
|
-
enumerable: true,
|
101
|
-
get: function () {
|
102
|
-
return index_2.useScrollbarWidth;
|
103
|
-
}
|
104
|
-
});
|
105
|
-
Object.defineProperty(exports, "useTimeout", {
|
106
|
-
enumerable: true,
|
107
|
-
get: function () {
|
108
|
-
return index_2.useTimeout;
|
109
|
-
}
|
110
|
-
});
|
111
|
-
var index_3 = /*#__PURE__*/require("./ssr/index");
|
112
|
-
Object.defineProperty(exports, "canUseDOM", {
|
113
|
-
enumerable: true,
|
114
|
-
get: function () {
|
115
|
-
return index_3.canUseDOM;
|
116
|
-
}
|
117
|
-
});
|
118
|
-
Object.defineProperty(exports, "useIsSSR", {
|
119
|
-
enumerable: true,
|
120
|
-
get: function () {
|
121
|
-
return index_3.useIsSSR;
|
122
|
-
}
|
123
|
-
});
|
124
|
-
Object.defineProperty(exports, "SSRProvider", {
|
125
|
-
enumerable: true,
|
126
|
-
get: function () {
|
127
|
-
return index_3.SSRProvider;
|
128
|
-
}
|
129
|
-
});
|
130
|
-
var index_4 = /*#__PURE__*/require("./utils/index");
|
131
|
-
Object.defineProperty(exports, "clamp", {
|
132
|
-
enumerable: true,
|
133
|
-
get: function () {
|
134
|
-
return index_4.clamp;
|
135
|
-
}
|
136
|
-
});
|
137
|
-
Object.defineProperty(exports, "getNativeElementProps", {
|
138
|
-
enumerable: true,
|
139
|
-
get: function () {
|
140
|
-
return index_4.getNativeElementProps;
|
141
|
-
}
|
142
|
-
});
|
143
|
-
Object.defineProperty(exports, "getPartitionedNativeProps", {
|
144
|
-
enumerable: true,
|
145
|
-
get: function () {
|
146
|
-
return index_4.getPartitionedNativeProps;
|
147
|
-
}
|
148
|
-
});
|
149
|
-
Object.defineProperty(exports, "getRTLSafeKey", {
|
150
|
-
enumerable: true,
|
151
|
-
get: function () {
|
152
|
-
return index_4.getRTLSafeKey;
|
153
|
-
}
|
154
|
-
});
|
155
|
-
Object.defineProperty(exports, "mergeCallbacks", {
|
156
|
-
enumerable: true,
|
157
|
-
get: function () {
|
158
|
-
return index_4.mergeCallbacks;
|
159
|
-
}
|
160
|
-
});
|
161
|
-
Object.defineProperty(exports, "isHTMLElement", {
|
162
|
-
enumerable: true,
|
163
|
-
get: function () {
|
164
|
-
return index_4.isHTMLElement;
|
165
|
-
}
|
166
|
-
});
|
167
|
-
Object.defineProperty(exports, "isInteractiveHTMLElement", {
|
168
|
-
enumerable: true,
|
169
|
-
get: function () {
|
170
|
-
return index_4.isInteractiveHTMLElement;
|
171
|
-
}
|
172
|
-
});
|
173
|
-
Object.defineProperty(exports, "omit", {
|
174
|
-
enumerable: true,
|
175
|
-
get: function () {
|
176
|
-
return index_4.omit;
|
177
|
-
}
|
178
|
-
});
|
179
|
-
var index_5 = /*#__PURE__*/require("./trigger/index");
|
180
|
-
Object.defineProperty(exports, "applyTriggerPropsToChildren", {
|
181
|
-
enumerable: true,
|
182
|
-
get: function () {
|
183
|
-
return index_5.applyTriggerPropsToChildren;
|
184
|
-
}
|
185
|
-
});
|
186
|
-
Object.defineProperty(exports, "getTriggerChild", {
|
187
|
-
enumerable: true,
|
188
|
-
get: function () {
|
189
|
-
return index_5.getTriggerChild;
|
190
|
-
}
|
191
|
-
});
|
192
|
-
Object.defineProperty(exports, "isFluentTrigger", {
|
193
|
-
enumerable: true,
|
194
|
-
get: function () {
|
195
|
-
return index_5.isFluentTrigger;
|
196
|
-
}
|
197
|
-
});
|
198
|
-
var index_6 = /*#__PURE__*/require("./events/index");
|
199
|
-
Object.defineProperty(exports, "isTouchEvent", {
|
200
|
-
enumerable: true,
|
201
|
-
get: function () {
|
202
|
-
return index_6.isTouchEvent;
|
203
|
-
}
|
204
|
-
});
|
205
|
-
Object.defineProperty(exports, "isMouseEvent", {
|
206
|
-
enumerable: true,
|
207
|
-
get: function () {
|
208
|
-
return index_6.isMouseEvent;
|
209
|
-
}
|
210
|
-
});
|
211
|
-
Object.defineProperty(exports, "getEventClientCoords", {
|
212
|
-
enumerable: true,
|
213
|
-
get: function () {
|
214
|
-
return index_6.getEventClientCoords;
|
215
|
-
}
|
216
|
-
});
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
function _export(target, all) {
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
7
|
+
enumerable: true,
|
8
|
+
get: all[name]
|
9
|
+
});
|
10
|
+
}
|
11
|
+
_export(exports, {
|
12
|
+
getSlots: ()=>_index.getSlots,
|
13
|
+
resolveShorthand: ()=>_index.resolveShorthand,
|
14
|
+
isResolvedShorthand: ()=>_index.isResolvedShorthand,
|
15
|
+
IdPrefixProvider: ()=>_index1.IdPrefixProvider,
|
16
|
+
resetIdsForTests: ()=>_index1.resetIdsForTests,
|
17
|
+
useControllableState: ()=>_index1.useControllableState,
|
18
|
+
useEventCallback: ()=>_index1.useEventCallback,
|
19
|
+
useFirstMount: ()=>_index1.useFirstMount,
|
20
|
+
useForceUpdate: ()=>_index1.useForceUpdate,
|
21
|
+
useId: ()=>_index1.useId,
|
22
|
+
useIsomorphicLayoutEffect: ()=>_index1.useIsomorphicLayoutEffect,
|
23
|
+
useMergedRefs: ()=>_index1.useMergedRefs,
|
24
|
+
useOnClickOutside: ()=>_index1.useOnClickOutside,
|
25
|
+
useOnScrollOutside: ()=>_index1.useOnScrollOutside,
|
26
|
+
usePrevious: ()=>_index1.usePrevious,
|
27
|
+
useScrollbarWidth: ()=>_index1.useScrollbarWidth,
|
28
|
+
useTimeout: ()=>_index1.useTimeout,
|
29
|
+
canUseDOM: ()=>_index2.canUseDOM,
|
30
|
+
useIsSSR: ()=>_index2.useIsSSR,
|
31
|
+
SSRProvider: ()=>_index2.SSRProvider,
|
32
|
+
clamp: ()=>_index3.clamp,
|
33
|
+
getNativeElementProps: ()=>_index3.getNativeElementProps,
|
34
|
+
getPartitionedNativeProps: ()=>_index3.getPartitionedNativeProps,
|
35
|
+
getRTLSafeKey: ()=>_index3.getRTLSafeKey,
|
36
|
+
mergeCallbacks: ()=>_index3.mergeCallbacks,
|
37
|
+
isHTMLElement: ()=>_index3.isHTMLElement,
|
38
|
+
isInteractiveHTMLElement: ()=>_index3.isInteractiveHTMLElement,
|
39
|
+
omit: ()=>_index3.omit,
|
40
|
+
applyTriggerPropsToChildren: ()=>_index4.applyTriggerPropsToChildren,
|
41
|
+
getTriggerChild: ()=>_index4.getTriggerChild,
|
42
|
+
isFluentTrigger: ()=>_index4.isFluentTrigger,
|
43
|
+
isTouchEvent: ()=>_index5.isTouchEvent,
|
44
|
+
isMouseEvent: ()=>_index5.isMouseEvent,
|
45
|
+
getEventClientCoords: ()=>_index5.getEventClientCoords
|
46
|
+
});
|
47
|
+
const _index = require("./compose/index");
|
48
|
+
const _index1 = require("./hooks/index");
|
49
|
+
const _index2 = require("./ssr/index");
|
50
|
+
const _index3 = require("./utils/index");
|
51
|
+
const _index4 = require("./trigger/index");
|
52
|
+
const _index5 = require("./events/index");
|
53
|
+
//# sourceMappingURL=index.js.map
|
54
|
+
|
217
55
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { getSlots, resolveShorthand, isResolvedShorthand } from \"./compose/index\";\nexport { IdPrefixProvider, resetIdsForTests, useControllableState, useEventCallback, useFirstMount, useForceUpdate, useId, useIsomorphicLayoutEffect, useMergedRefs, useOnClickOutside, useOnScrollOutside, usePrevious, useScrollbarWidth, useTimeout } from \"./hooks/index\";\nexport { canUseDOM, useIsSSR, SSRProvider } from \"./ssr/index\";\nexport { clamp, getNativeElementProps, getPartitionedNativeProps, getRTLSafeKey, mergeCallbacks, isHTMLElement, isInteractiveHTMLElement, omit } from \"./utils/index\";\nexport { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from \"./trigger/index\";\nexport { isTouchEvent, isMouseEvent, getEventClientCoords } from \"./events/index\";\n//# sourceMappingURL=index.js.map"],"names":["getSlots","resolveShorthand","isResolvedShorthand","IdPrefixProvider","resetIdsForTests","useControllableState","useEventCallback","useFirstMount","useForceUpdate","useId","useIsomorphicLayoutEffect","useMergedRefs","useOnClickOutside","useOnScrollOutside","usePrevious","useScrollbarWidth","useTimeout","canUseDOM","useIsSSR","SSRProvider","clamp","getNativeElementProps","getPartitionedNativeProps","getRTLSafeKey","mergeCallbacks","isHTMLElement","isInteractiveHTMLElement","omit","applyTriggerPropsToChildren","getTriggerChild","isFluentTrigger","isTouchEvent","isMouseEvent","getEventClientCoords"],"mappings":";;;;;;;;;;;IAASA,QAAQ,MAARA,eAAQ;IAAEC,gBAAgB,MAAhBA,uBAAgB;IAAEC,mBAAmB,MAAnBA,0BAAmB;IAC/CC,gBAAgB,MAAhBA,wBAAgB;IAAEC,gBAAgB,MAAhBA,wBAAgB;IAAEC,oBAAoB,MAApBA,4BAAoB;IAAEC,gBAAgB,MAAhBA,wBAAgB;IAAEC,aAAa,MAAbA,qBAAa;IAAEC,cAAc,MAAdA,sBAAc;IAAEC,KAAK,MAALA,aAAK;IAAEC,yBAAyB,MAAzBA,iCAAyB;IAAEC,aAAa,MAAbA,qBAAa;IAAEC,iBAAiB,MAAjBA,yBAAiB;IAAEC,kBAAkB,MAAlBA,0BAAkB;IAAEC,WAAW,MAAXA,mBAAW;IAAEC,iBAAiB,MAAjBA,yBAAiB;IAAEC,UAAU,MAAVA,kBAAU;IAC7OC,SAAS,MAATA,iBAAS;IAAEC,QAAQ,MAARA,gBAAQ;IAAEC,WAAW,MAAXA,mBAAW;IAChCC,KAAK,MAALA,aAAK;IAAEC,qBAAqB,MAArBA,6BAAqB;IAAEC,yBAAyB,MAAzBA,iCAAyB;IAAEC,aAAa,MAAbA,qBAAa;IAAEC,cAAc,MAAdA,sBAAc;IAAEC,aAAa,MAAbA,qBAAa;IAAEC,wBAAwB,MAAxBA,gCAAwB;IAAEC,IAAI,MAAJA,YAAI;IACrIC,2BAA2B,MAA3BA,mCAA2B;IAAEC,eAAe,MAAfA,uBAAe;IAAEC,eAAe,MAAfA,uBAAe;IAC7DC,YAAY,MAAZA,oBAAY;IAAEC,YAAY,MAAZA,oBAAY;IAAEC,oBAAoB,MAApBA,4BAAoB;;uBALO;wBAC8L;wBAC7M;wBACqG;wBACxE;wBACb;CACjE,iCAAiC"}
|
@@ -1,69 +1,66 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
function _export(target, all) {
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
7
|
+
enumerable: true,
|
8
|
+
get: all[name]
|
9
|
+
});
|
10
|
+
}
|
11
|
+
_export(exports, {
|
12
|
+
defaultSSRContextValue: ()=>defaultSSRContextValue,
|
13
|
+
SSRContext: ()=>SSRContext,
|
14
|
+
useSSRContext: ()=>useSSRContext,
|
15
|
+
SSRProvider: ()=>SSRProvider,
|
16
|
+
useIsSSR: ()=>useIsSSR
|
5
17
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
const
|
9
|
-
|
10
|
-
|
11
|
-
*
|
12
|
-
* @internal
|
13
|
-
*/
|
14
|
-
exports.defaultSSRContextValue = {
|
15
|
-
current: 0
|
18
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
19
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
20
|
+
const _canUseDOM = require("./canUseDOM");
|
21
|
+
const defaultSSRContextValue = {
|
22
|
+
current: 0
|
16
23
|
};
|
17
|
-
|
18
|
-
/**
|
19
|
-
* @internal
|
20
|
-
*/
|
24
|
+
const SSRContext = /*#__PURE__*/ _react.createContext(undefined);
|
21
25
|
function useSSRContext() {
|
22
|
-
|
23
|
-
return (_a = React.useContext(exports.SSRContext)) !== null && _a !== void 0 ? _a : exports.defaultSSRContextValue;
|
26
|
+
return _react.useContext(SSRContext) ?? defaultSSRContextValue;
|
24
27
|
}
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
const SSRProvider = props => {
|
33
|
-
const [value] = React.useState(() => ({
|
34
|
-
current: 0
|
35
|
-
}));
|
36
|
-
return React.createElement(exports.SSRContext.Provider, {
|
37
|
-
value: value
|
38
|
-
}, props.children);
|
28
|
+
const SSRProvider = (props)=>{
|
29
|
+
const [value] = _react.useState(()=>({
|
30
|
+
current: 0
|
31
|
+
}));
|
32
|
+
return /*#__PURE__*/ _react.createElement(SSRContext.Provider, {
|
33
|
+
value: value
|
34
|
+
}, props.children);
|
39
35
|
};
|
40
|
-
exports.SSRProvider = SSRProvider;
|
41
|
-
/**
|
42
|
-
* Returns whether the component is currently being server side rendered or hydrated on the client. Can be used to delay
|
43
|
-
* browser-specific rendering until after hydration. May cause re-renders on a client when is used within SSRProvider.
|
44
|
-
*/
|
45
36
|
function useIsSSR() {
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
37
|
+
const isInSSRContext = useSSRContext() !== defaultSSRContextValue;
|
38
|
+
const [isSSR, setIsSSR] = _react.useState(isInSSRContext);
|
39
|
+
// If we are rendering in a non-DOM environment, and there's no SSRProvider, provide a warning to hint to the
|
40
|
+
// developer to add one.
|
41
|
+
if (process.env.NODE_ENV !== "production") {
|
42
|
+
if (!isInSSRContext && !(0, _canUseDOM.canUseDOM)()) {
|
43
|
+
// eslint-disable-next-line no-console
|
44
|
+
console.error([
|
45
|
+
"@fluentui/react-components: ",
|
46
|
+
"When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are " + "generated between the client and server.",
|
47
|
+
"\n",
|
48
|
+
"\n",
|
49
|
+
"Check documentation at https://aka.ms/fluentui-ssr"
|
50
|
+
].join(""));
|
51
|
+
}
|
54
52
|
}
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
}
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
exports.useIsSSR = useIsSSR;
|
53
|
+
// If on the client, and the component was initially server rendered, then schedule a layout effect to update the
|
54
|
+
// component after hydration.
|
55
|
+
if ((0, _canUseDOM.canUseDOM)() && isInSSRContext) {
|
56
|
+
// This if statement technically breaks the rules of hooks, but is safe because the condition never changes after
|
57
|
+
// mounting.
|
58
|
+
// eslint-disable-next-line
|
59
|
+
_react.useLayoutEffect(()=>{
|
60
|
+
setIsSSR(false);
|
61
|
+
}, []);
|
62
|
+
}
|
63
|
+
return isSSR;
|
64
|
+
} //# sourceMappingURL=SSRContext.js.map
|
65
|
+
|
69
66
|
//# sourceMappingURL=SSRContext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/ssr/SSRContext.js"],"sourcesContent":["import * as React from \"react\";\nimport { canUseDOM } from \"./canUseDOM\";\n/**\n * Default context value to use in case there is no SSRProvider. This is fine for client-only apps.\n *\n * @internal\n */\nexport const defaultSSRContextValue = {\n current: 0\n};\nexport const SSRContext = /*#__PURE__*/React.createContext(undefined);\n/**\n * @internal\n */\nexport function useSSRContext() {\n return React.useContext(SSRContext) ?? defaultSSRContextValue;\n}\n/**\n * When using SSR with Fluent UI, applications must be wrapped in an SSRProvider. This ensures that auto generated ids\n * are consistent between the client and server.\n *\n * @public\n */\nexport const SSRProvider = props => {\n const [value] = React.useState(() => ({\n current: 0\n }));\n return /*#__PURE__*/React.createElement(SSRContext.Provider, {\n value: value\n }, props.children);\n};\n/**\n * Returns whether the component is currently being server side rendered or hydrated on the client. Can be used to delay\n * browser-specific rendering until after hydration. May cause re-renders on a client when is used within SSRProvider.\n */\nexport function useIsSSR() {\n const isInSSRContext = useSSRContext() !== defaultSSRContextValue;\n const [isSSR, setIsSSR] = React.useState(isInSSRContext);\n // If we are rendering in a non-DOM environment, and there's no SSRProvider, provide a warning to hint to the\n // developer to add one.\n if (process.env.NODE_ENV !== \"production\") {\n if (!isInSSRContext && !canUseDOM()) {\n // eslint-disable-next-line no-console\n console.error([\"@fluentui/react-components: \", \"When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are \" + \"generated between the client and server.\", \"\\n\", \"\\n\", \"Check documentation at https://aka.ms/fluentui-ssr\"].join(\"\"));\n }\n }\n // If on the client, and the component was initially server rendered, then schedule a layout effect to update the\n // component after hydration.\n if (canUseDOM() && isInSSRContext) {\n // This if statement technically breaks the rules of hooks, but is safe because the condition never changes after\n // mounting.\n // eslint-disable-next-line\n React.useLayoutEffect(() => {\n setIsSSR(false);\n }, []);\n }\n return isSSR;\n}\n//# sourceMappingURL=SSRContext.js.map"],"names":["defaultSSRContextValue","SSRContext","useSSRContext","SSRProvider","useIsSSR","current","React","createContext","undefined","useContext","props","value","useState","createElement","Provider","children","isInSSRContext","isSSR","setIsSSR","process","env","NODE_ENV","canUseDOM","console","error","join","useLayoutEffect"],"mappings":";;;;;;;;;;;IAOaA,sBAAsB,MAAtBA;IAGAC,UAAU,MAAVA;IAIGC,aAAa,MAAbA;IASHC,WAAW,MAAXA;IAYGC,QAAQ,MAARA;;;6DAnCO;2BACG;AAMnB,MAAMJ,yBAAyB;IACpCK,SAAS;AACX;AACO,MAAMJ,aAAa,WAAW,GAAEK,OAAMC,aAAa,CAACC;AAIpD,SAASN,gBAAgB;IAC9B,OAAOI,OAAMG,UAAU,CAACR,eAAeD;AACzC;AAOO,MAAMG,cAAcO,CAAAA,QAAS;IAClC,MAAM,CAACC,MAAM,GAAGL,OAAMM,QAAQ,CAAC,IAAO,CAAA;YACpCP,SAAS;QACX,CAAA;IACA,OAAO,WAAW,GAAEC,OAAMO,aAAa,CAACZ,WAAWa,QAAQ,EAAE;QAC3DH,OAAOA;IACT,GAAGD,MAAMK,QAAQ;AACnB;AAKO,SAASX,WAAW;IACzB,MAAMY,iBAAiBd,oBAAoBF;IAC3C,MAAM,CAACiB,OAAOC,SAAS,GAAGZ,OAAMM,QAAQ,CAACI;IACzC,6GAA6G;IAC7G,wBAAwB;IACxB,IAAIG,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAI,CAACL,kBAAkB,CAACM,IAAAA,oBAAS,KAAI;YACnC,sCAAsC;YACtCC,QAAQC,KAAK,CAAC;gBAAC;gBAAgC,4GAA4G;gBAA4C;gBAAM;gBAAM;aAAqD,CAACC,IAAI,CAAC;QAChR,CAAC;IACH,CAAC;IACD,iHAAiH;IACjH,6BAA6B;IAC7B,IAAIH,IAAAA,oBAAS,OAAMN,gBAAgB;QACjC,iHAAiH;QACjH,YAAY;QACZ,2BAA2B;QAC3BV,OAAMoB,eAAe,CAAC,IAAM;YAC1BR,SAAS,KAAK;QAChB,GAAG,EAAE;IACP,CAAC;IACD,OAAOD;AACT,EACA,sCAAsC"}
|
@@ -1,16 +1,16 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.canUseDOM = void 0;
|
7
1
|
/**
|
8
2
|
* Verifies if an application can use DOM.
|
9
|
-
*/
|
3
|
+
*/ "use strict";
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
Object.defineProperty(exports, "canUseDOM", {
|
8
|
+
enumerable: true,
|
9
|
+
get: ()=>canUseDOM
|
10
|
+
});
|
10
11
|
function canUseDOM() {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
exports.canUseDOM = canUseDOM;
|
12
|
+
return typeof window !== "undefined" && !!(window.document && // eslint-disable-next-line deprecation/deprecation
|
13
|
+
window.document.createElement);
|
14
|
+
} //# sourceMappingURL=canUseDOM.js.map
|
15
|
+
|
16
16
|
//# sourceMappingURL=canUseDOM.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/ssr/canUseDOM.js"],"sourcesContent":["/**\n * Verifies if an application can use DOM.\n */export function canUseDOM() {\n return typeof window !== \"undefined\" && !!(window.document &&\n // eslint-disable-next-line deprecation/deprecation\n window.document.createElement);\n}\n//# sourceMappingURL=canUseDOM.js.map"],"names":["canUseDOM","window","document","createElement"],"mappings":"AAAA;;CAEC;;;;+BAAkBA;;aAAAA;;AAAT,SAASA,YAAY;IAC7B,OAAO,OAAOC,WAAW,eAAe,CAAC,CAAEA,CAAAA,OAAOC,QAAQ,IAC1D,mDAAmD;IACnDD,OAAOC,QAAQ,CAACC,aAAa,AAAD;AAC9B,EACA,qCAAqC"}
|
@@ -1,9 +1,10 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
6
|
-
const
|
7
|
-
|
8
|
-
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
6
|
+
_exportStar(require("./canUseDOM"), exports);
|
7
|
+
_exportStar(require("./SSRContext"), exports);
|
8
|
+
//# sourceMappingURL=index.js.map
|
9
|
+
|
9
10
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/ssr/index.js"],"sourcesContent":["export * from \"./canUseDOM\";\nexport * from \"./SSRContext\";\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;CACd,iCAAiC"}
|