@fluentui/react-utilities 0.0.0-nightly-20230830-0414.1 → 0.0.0-nightly-20230831-0414.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/CHANGELOG.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui/react-utilities",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 30 Aug 2023 04:20:48 GMT",
6
- "tag": "@fluentui/react-utilities_v0.0.0-nightly-20230830-0414.1",
7
- "version": "0.0.0-nightly-20230830-0414.1",
5
+ "date": "Thu, 31 Aug 2023 04:21:25 GMT",
6
+ "tag": "@fluentui/react-utilities_v0.0.0-nightly-20230831-0414.1",
7
+ "version": "0.0.0-nightly-20230831-0414.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -16,8 +16,8 @@
16
16
  {
17
17
  "author": "beachball",
18
18
  "package": "@fluentui/react-utilities",
19
- "comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230830-0414.1",
20
- "commit": "5740348369864468ba08f65fbf73080aba7007dc"
19
+ "comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230831-0414.1",
20
+ "commit": "c99f5b3f1071bdf98228512e5ad9514a1185d62f"
21
21
  }
22
22
  ]
23
23
  }
package/CHANGELOG.md CHANGED
@@ -1,18 +1,18 @@
1
1
  # Change Log - @fluentui/react-utilities
2
2
 
3
- This log was last generated on Wed, 30 Aug 2023 04:20:48 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 31 Aug 2023 04:21:25 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20230830-0414.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v0.0.0-nightly-20230830-0414.1)
7
+ ## [0.0.0-nightly-20230831-0414.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v0.0.0-nightly-20230831-0414.1)
8
8
 
9
- Wed, 30 Aug 2023 04:20:48 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.13.0..@fluentui/react-utilities_v0.0.0-nightly-20230830-0414.1)
9
+ Thu, 31 Aug 2023 04:21:25 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.13.0..@fluentui/react-utilities_v0.0.0-nightly-20230831-0414.1)
11
11
 
12
12
  ### Changes
13
13
 
14
14
  - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230830-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/5740348369864468ba08f65fbf73080aba7007dc) by beachball)
15
+ - Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230831-0414.1 ([commit](https://github.com/microsoft/fluentui/commit/c99f5b3f1071bdf98228512e5ad9514a1185d62f) by beachball)
16
16
 
17
17
  ## [9.13.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.13.0)
18
18
 
@@ -1,4 +1,10 @@
1
+ import { canUseDOM } from '../ssr/canUseDOM';
1
2
  import { useBrowserTimer } from './useBrowserTimer';
3
+ const setAnimationFrameNoop = (callback)=>{
4
+ callback(0);
5
+ return 0;
6
+ };
7
+ const cancelAnimationFrameNoop = (handle)=>handle;
2
8
  /**
3
9
  * @internal
4
10
  * Helper to manage a browser requestAnimationFrame.
@@ -7,6 +13,9 @@ import { useBrowserTimer } from './useBrowserTimer';
7
13
  *
8
14
  * @returns A pair of [requestAnimationFrame, cancelAnimationFrame] that are stable between renders.
9
15
  */ export function useAnimationFrame() {
16
+ const isDOM = canUseDOM();
10
17
  // TODO: figure it out a way to not call global.requestAnimationFrame and instead infer window from some context
11
- return useBrowserTimer(requestAnimationFrame, cancelAnimationFrame);
18
+ const setAnimationFrame = isDOM ? requestAnimationFrame : setAnimationFrameNoop;
19
+ const clearAnimationFrame = isDOM ? cancelAnimationFrame : cancelAnimationFrameNoop;
20
+ return useBrowserTimer(setAnimationFrame, clearAnimationFrame);
12
21
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["useAnimationFrame.ts"],"sourcesContent":["import { useBrowserTimer } from './useBrowserTimer';\n\n/**\n * @internal\n * Helper to manage a browser requestAnimationFrame.\n * Ensures that the requestAnimationFrame isn't set multiple times at once and is cleaned up\n * when the component is unloaded.\n *\n * @returns A pair of [requestAnimationFrame, cancelAnimationFrame] that are stable between renders.\n */\nexport function useAnimationFrame() {\n // TODO: figure it out a way to not call global.requestAnimationFrame and instead infer window from some context\n return useBrowserTimer(requestAnimationFrame, cancelAnimationFrame);\n}\n"],"names":["useBrowserTimer","useAnimationFrame","requestAnimationFrame","cancelAnimationFrame"],"mappings":"AAAA,SAASA,eAAe,QAAQ,oBAAoB;AAEpD;;;;;;;CAOC,GACD,OAAO,SAASC,oBAAoB;IAClC,gHAAgH;IAChH,OAAOD,gBAAgBE,uBAAuBC;AAChD,CAAC"}
1
+ {"version":3,"sources":["useAnimationFrame.ts"],"sourcesContent":["import { canUseDOM } from '../ssr/canUseDOM';\nimport { useBrowserTimer } from './useBrowserTimer';\n\nconst setAnimationFrameNoop = (callback: FrameRequestCallback) => {\n callback(0);\n return 0;\n};\nconst cancelAnimationFrameNoop = (handle: number) => handle;\n\n/**\n * @internal\n * Helper to manage a browser requestAnimationFrame.\n * Ensures that the requestAnimationFrame isn't set multiple times at once and is cleaned up\n * when the component is unloaded.\n *\n * @returns A pair of [requestAnimationFrame, cancelAnimationFrame] that are stable between renders.\n */\nexport function useAnimationFrame() {\n const isDOM = canUseDOM();\n\n // TODO: figure it out a way to not call global.requestAnimationFrame and instead infer window from some context\n const setAnimationFrame = isDOM ? requestAnimationFrame : setAnimationFrameNoop;\n const clearAnimationFrame = isDOM ? cancelAnimationFrame : cancelAnimationFrameNoop;\n\n return useBrowserTimer(setAnimationFrame, clearAnimationFrame);\n}\n"],"names":["canUseDOM","useBrowserTimer","setAnimationFrameNoop","callback","cancelAnimationFrameNoop","handle","useAnimationFrame","isDOM","setAnimationFrame","requestAnimationFrame","clearAnimationFrame","cancelAnimationFrame"],"mappings":"AAAA,SAASA,SAAS,QAAQ,mBAAmB;AAC7C,SAASC,eAAe,QAAQ,oBAAoB;AAEpD,MAAMC,wBAAwB,CAACC,WAAmC;IAChEA,SAAS;IACT,OAAO;AACT;AACA,MAAMC,2BAA2B,CAACC,SAAmBA;AAErD;;;;;;;CAOC,GACD,OAAO,SAASC,oBAAoB;IAClC,MAAMC,QAAQP;IAEd,gHAAgH;IAChH,MAAMQ,oBAAoBD,QAAQE,wBAAwBP,qBAAqB;IAC/E,MAAMQ,sBAAsBH,QAAQI,uBAAuBP,wBAAwB;IAEnF,OAAOH,gBAAgBO,mBAAmBE;AAC5C,CAAC"}
@@ -6,8 +6,17 @@ Object.defineProperty(exports, "useAnimationFrame", {
6
6
  enumerable: true,
7
7
  get: ()=>useAnimationFrame
8
8
  });
9
+ const _canUseDOM = require("../ssr/canUseDOM");
9
10
  const _useBrowserTimer = require("./useBrowserTimer");
11
+ const setAnimationFrameNoop = (callback)=>{
12
+ callback(0);
13
+ return 0;
14
+ };
15
+ const cancelAnimationFrameNoop = (handle)=>handle;
10
16
  function useAnimationFrame() {
17
+ const isDOM = (0, _canUseDOM.canUseDOM)();
11
18
  // TODO: figure it out a way to not call global.requestAnimationFrame and instead infer window from some context
12
- return (0, _useBrowserTimer.useBrowserTimer)(requestAnimationFrame, cancelAnimationFrame);
19
+ const setAnimationFrame = isDOM ? requestAnimationFrame : setAnimationFrameNoop;
20
+ const clearAnimationFrame = isDOM ? cancelAnimationFrame : cancelAnimationFrameNoop;
21
+ return (0, _useBrowserTimer.useBrowserTimer)(setAnimationFrame, clearAnimationFrame);
13
22
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["useAnimationFrame.js"],"sourcesContent":["import { useBrowserTimer } from './useBrowserTimer';\n/**\n * @internal\n * Helper to manage a browser requestAnimationFrame.\n * Ensures that the requestAnimationFrame isn't set multiple times at once and is cleaned up\n * when the component is unloaded.\n *\n * @returns A pair of [requestAnimationFrame, cancelAnimationFrame] that are stable between renders.\n */ export function useAnimationFrame() {\n // TODO: figure it out a way to not call global.requestAnimationFrame and instead infer window from some context\n return useBrowserTimer(requestAnimationFrame, cancelAnimationFrame);\n}\n"],"names":["useAnimationFrame","useBrowserTimer","requestAnimationFrame","cancelAnimationFrame"],"mappings":";;;;+BAQoBA;;aAAAA;;iCARY;AAQrB,SAASA,oBAAoB;IACpC,gHAAgH;IAChH,OAAOC,IAAAA,gCAAe,EAACC,uBAAuBC;AAClD"}
1
+ {"version":3,"sources":["useAnimationFrame.js"],"sourcesContent":["import { canUseDOM } from '../ssr/canUseDOM';\nimport { useBrowserTimer } from './useBrowserTimer';\nconst setAnimationFrameNoop = (callback)=>{\n callback(0);\n return 0;\n};\nconst cancelAnimationFrameNoop = (handle)=>handle;\n/**\n * @internal\n * Helper to manage a browser requestAnimationFrame.\n * Ensures that the requestAnimationFrame isn't set multiple times at once and is cleaned up\n * when the component is unloaded.\n *\n * @returns A pair of [requestAnimationFrame, cancelAnimationFrame] that are stable between renders.\n */ export function useAnimationFrame() {\n const isDOM = canUseDOM();\n // TODO: figure it out a way to not call global.requestAnimationFrame and instead infer window from some context\n const setAnimationFrame = isDOM ? requestAnimationFrame : setAnimationFrameNoop;\n const clearAnimationFrame = isDOM ? cancelAnimationFrame : cancelAnimationFrameNoop;\n return useBrowserTimer(setAnimationFrame, clearAnimationFrame);\n}\n"],"names":["useAnimationFrame","setAnimationFrameNoop","callback","cancelAnimationFrameNoop","handle","isDOM","canUseDOM","setAnimationFrame","requestAnimationFrame","clearAnimationFrame","cancelAnimationFrame","useBrowserTimer"],"mappings":";;;;+BAcoBA;;aAAAA;;2BAdM;iCACM;AAChC,MAAMC,wBAAwB,CAACC,WAAW;IACtCA,SAAS;IACT,OAAO;AACX;AACA,MAAMC,2BAA2B,CAACC,SAASA;AAQhC,SAASJ,oBAAoB;IACpC,MAAMK,QAAQC,IAAAA,oBAAS;IACvB,gHAAgH;IAChH,MAAMC,oBAAoBF,QAAQG,wBAAwBP,qBAAqB;IAC/E,MAAMQ,sBAAsBJ,QAAQK,uBAAuBP,wBAAwB;IACnF,OAAOQ,IAAAA,gCAAe,EAACJ,mBAAmBE;AAC9C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-utilities",
3
- "version": "0.0.0-nightly-20230830-0414.1",
3
+ "version": "0.0.0-nightly-20230831-0414.1",
4
4
  "description": "A set of general React-specific utilities.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -31,7 +31,7 @@
31
31
  "@fluentui/scripts-tasks": "*"
32
32
  },
33
33
  "dependencies": {
34
- "@fluentui/keyboard-keys": "0.0.0-nightly-20230830-0414.1",
34
+ "@fluentui/keyboard-keys": "0.0.0-nightly-20230831-0414.1",
35
35
  "@swc/helpers": "^0.4.14"
36
36
  },
37
37
  "peerDependencies": {