@fluentui/priority-overflow 0.0.0-nightly-20231207-0407.1 → 0.0.0-nightly-20231208-0405.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Change Log - @fluentui/priority-overflow
2
2
 
3
- This log was last generated on Thu, 07 Dec 2023 04:22:19 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 08 Dec 2023 04:20:27 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20231207-0407.1](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v0.0.0-nightly-20231207-0407.1)
7
+ ## [0.0.0-nightly-20231208-0405.1](https://github.com/microsoft/fluentui/tree/@fluentui/priority-overflow_v0.0.0-nightly-20231208-0405.1)
8
8
 
9
- Thu, 07 Dec 2023 04:22:19 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.10..@fluentui/priority-overflow_v0.0.0-nightly-20231207-0407.1)
9
+ Fri, 08 Dec 2023 04:20:27 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/priority-overflow_v9.1.10..@fluentui/priority-overflow_v0.0.0-nightly-20231208-0405.1)
11
11
 
12
12
  ### Changes
13
13
 
package/lib/debounce.js CHANGED
@@ -5,6 +5,11 @@
5
5
  * @returns debounced function
6
6
  */ export function debounce(fn) {
7
7
  let pending;
8
+ // React testing platforms will often output errors when state updates happen outside `act`
9
+ // Since there is nothing obvious to wait for we just avoid debouncing in unit test environments
10
+ if (process.env.NODE_ENV === 'test') {
11
+ return fn;
12
+ }
8
13
  return ()=>{
9
14
  if (!pending) {
10
15
  pending = true;
@@ -1 +1 @@
1
- {"version":3,"sources":["debounce.ts"],"sourcesContent":["/**\n * Microtask debouncer\n * https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide\n * @param fn - Function to debounce\n * @returns debounced function\n */\nexport function debounce(fn: Function) {\n let pending: boolean;\n return () => {\n if (!pending) {\n pending = true;\n queueMicrotask(() => {\n // Need to set pending to `false` before the debounced function is run.\n // React can actually interrupt the function while it's running!\n pending = false;\n fn();\n });\n }\n };\n}\n"],"names":["debounce","fn","pending","queueMicrotask"],"mappings":"AAAA;;;;;CAKC,GACD,OAAO,SAASA,SAASC,EAAY;IACnC,IAAIC;IACJ,OAAO;QACL,IAAI,CAACA,SAAS;YACZA,UAAU;YACVC,eAAe;gBACb,uEAAuE;gBACvE,gEAAgE;gBAChED,UAAU;gBACVD;YACF;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["debounce.ts"],"sourcesContent":["/**\n * Microtask debouncer\n * https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide\n * @param fn - Function to debounce\n * @returns debounced function\n */\nexport function debounce(fn: Function) {\n let pending: boolean;\n\n // React testing platforms will often output errors when state updates happen outside `act`\n // Since there is nothing obvious to wait for we just avoid debouncing in unit test environments\n if (process.env.NODE_ENV === 'test') {\n return fn as () => void;\n }\n\n return () => {\n if (!pending) {\n pending = true;\n queueMicrotask(() => {\n // Need to set pending to `false` before the debounced function is run.\n // React can actually interrupt the function while it's running!\n pending = false;\n fn();\n });\n }\n };\n}\n"],"names":["debounce","fn","pending","process","env","NODE_ENV","queueMicrotask"],"mappings":"AAAA;;;;;CAKC,GACD,OAAO,SAASA,SAASC,EAAY;IACnC,IAAIC;IAEJ,2FAA2F;IAC3F,gGAAgG;IAChG,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,QAAQ;QACnC,OAAOJ;IACT;IAEA,OAAO;QACL,IAAI,CAACC,SAAS;YACZA,UAAU;YACVI,eAAe;gBACb,uEAAuE;gBACvE,gEAAgE;gBAChEJ,UAAU;gBACVD;YACF;QACF;IACF;AACF"}
@@ -15,6 +15,11 @@ Object.defineProperty(exports, "debounce", {
15
15
  });
16
16
  function debounce(fn) {
17
17
  let pending;
18
+ // React testing platforms will often output errors when state updates happen outside `act`
19
+ // Since there is nothing obvious to wait for we just avoid debouncing in unit test environments
20
+ if (process.env.NODE_ENV === 'test') {
21
+ return fn;
22
+ }
18
23
  return ()=>{
19
24
  if (!pending) {
20
25
  pending = true;
@@ -1 +1 @@
1
- {"version":3,"sources":["debounce.js"],"sourcesContent":["/**\n * Microtask debouncer\n * https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide\n * @param fn - Function to debounce\n * @returns debounced function\n */ export function debounce(fn) {\n let pending;\n return ()=>{\n if (!pending) {\n pending = true;\n queueMicrotask(()=>{\n // Need to set pending to `false` before the debounced function is run.\n // React can actually interrupt the function while it's running!\n pending = false;\n fn();\n });\n }\n };\n}\n"],"names":["debounce","fn","pending","queueMicrotask"],"mappings":"AAAA;;;;;CAKC;;;;+BAAmBA;;;eAAAA;;;AAAT,SAASA,SAASC,EAAE;IAC3B,IAAIC;IACJ,OAAO;QACH,IAAI,CAACA,SAAS;YACVA,UAAU;YACVC,eAAe;gBACX,uEAAuE;gBACvE,gEAAgE;gBAChED,UAAU;gBACVD;YACJ;QACJ;IACJ;AACJ"}
1
+ {"version":3,"sources":["debounce.js"],"sourcesContent":["/**\n * Microtask debouncer\n * https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide\n * @param fn - Function to debounce\n * @returns debounced function\n */ export function debounce(fn) {\n let pending;\n // React testing platforms will often output errors when state updates happen outside `act`\n // Since there is nothing obvious to wait for we just avoid debouncing in unit test environments\n if (process.env.NODE_ENV === 'test') {\n return fn;\n }\n return ()=>{\n if (!pending) {\n pending = true;\n queueMicrotask(()=>{\n // Need to set pending to `false` before the debounced function is run.\n // React can actually interrupt the function while it's running!\n pending = false;\n fn();\n });\n }\n };\n}\n"],"names":["debounce","fn","pending","process","env","NODE_ENV","queueMicrotask"],"mappings":"AAAA;;;;;CAKC;;;;+BAAmBA;;;eAAAA;;;AAAT,SAASA,SAASC,EAAE;IAC3B,IAAIC;IACJ,2FAA2F;IAC3F,gGAAgG;IAChG,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,QAAQ;QACjC,OAAOJ;IACX;IACA,OAAO;QACH,IAAI,CAACC,SAAS;YACVA,UAAU;YACVI,eAAe;gBACX,uEAAuE;gBACvE,gEAAgE;gBAChEJ,UAAU;gBACVD;YACJ;QACJ;IACJ;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/priority-overflow",
3
- "version": "0.0.0-nightly-20231207-0407.1",
3
+ "version": "0.0.0-nightly-20231208-0405.1",
4
4
  "description": "Vanilla JS utilities to implement overflow menus",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",