@mui/internal-docs-infra 0.2.0 → 0.2.1-canary.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.
|
@@ -6,6 +6,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
6
6
|
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
7
7
|
import _regenerator from "@babel/runtime/helpers/esm/regenerator";
|
|
8
8
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
9
|
+
var _window$requestIdleCa, _window$cancelIdleCal;
|
|
9
10
|
import * as React from 'react';
|
|
10
11
|
import { useCodeContext } from "../CodeProvider/CodeContext.js";
|
|
11
12
|
import { CodeHighlighterContext } from "./CodeHighlighterContext.js";
|
|
@@ -19,6 +20,8 @@ import * as Errors from "./errors.js";
|
|
|
19
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
21
|
var DEBUG = false; // Set to true for debugging purposes
|
|
21
22
|
|
|
23
|
+
var requestIdleCallback = (_window$requestIdleCa = window.requestIdleCallback) != null ? _window$requestIdleCa : setTimeout;
|
|
24
|
+
var cancelIdleCallback = (_window$cancelIdleCal = window.cancelIdleCallback) != null ? _window$cancelIdleCal : clearTimeout;
|
|
22
25
|
function useInitialData(_ref) {
|
|
23
26
|
var variants = _ref.variants,
|
|
24
27
|
variantName = _ref.variantName,
|
|
@@ -329,11 +332,11 @@ function useCodeParsing(_ref6) {
|
|
|
329
332
|
setIsHighlightAllowed = _React$useState2[1];
|
|
330
333
|
React.useEffect(function () {
|
|
331
334
|
if (highlightAfter === 'idle') {
|
|
332
|
-
var idleRequest =
|
|
335
|
+
var idleRequest = requestIdleCallback(function () {
|
|
333
336
|
setIsHighlightAllowed(true);
|
|
334
337
|
});
|
|
335
338
|
return function () {
|
|
336
|
-
return
|
|
339
|
+
return cancelIdleCallback(idleRequest);
|
|
337
340
|
};
|
|
338
341
|
}
|
|
339
342
|
return undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-docs-infra",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1-canary.1",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "MUI Infra - internal documentation creation tools.",
|
|
6
6
|
"keywords": [
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=22.12.0"
|
|
55
55
|
},
|
|
56
|
+
"gitSha": "5677cff17af7f0bc1a46e014cb6784a7232d43ef",
|
|
56
57
|
"type": "commonjs",
|
|
57
58
|
"exports": {
|
|
58
59
|
"./package.json": "./package.json",
|