@docusaurus/plugin-content-docs 4.0.0-canary-6858 → 4.0.0-canary-6862
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/lib/client/doc.js +1 -1
- package/lib/client/docSidebarItemsExpandedState.js +1 -1
- package/lib/client/docsPreferredVersion.js +1 -1
- package/lib/client/docsSidebar.js +1 -1
- package/lib/client/docsVersion.js +1 -1
- package/package.json +12 -12
- package/src/client/doc.tsx +1 -1
- package/src/client/docSidebarItemsExpandedState.tsx +1 -1
- package/src/client/docsPreferredVersion.tsx +1 -1
- package/src/client/docsSidebar.tsx +1 -1
- package/src/client/docsVersion.tsx +1 -1
package/lib/client/doc.js
CHANGED
|
@@ -29,7 +29,7 @@ function useContextValue(content) {
|
|
|
29
29
|
*/
|
|
30
30
|
export function DocProvider({ children, content, }) {
|
|
31
31
|
const contextValue = useContextValue(content);
|
|
32
|
-
return <Context
|
|
32
|
+
return <Context value={contextValue}>{children}</Context>;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Returns the data of the currently browsed doc. Gives access to the doc's MDX
|
|
@@ -16,7 +16,7 @@ const Context = React.createContext(EmptyContext);
|
|
|
16
16
|
export function DocSidebarItemsExpandedStateProvider({ children, }) {
|
|
17
17
|
const [expandedItem, setExpandedItem] = useState(null);
|
|
18
18
|
const contextValue = useMemo(() => ({ expandedItem, setExpandedItem }), [expandedItem]);
|
|
19
|
-
return <Context
|
|
19
|
+
return <Context value={contextValue}>{children}</Context>;
|
|
20
20
|
}
|
|
21
21
|
export function useDocSidebarItemsExpandedState() {
|
|
22
22
|
const value = useContext(Context);
|
|
@@ -76,7 +76,7 @@ function useContextValue() {
|
|
|
76
76
|
}
|
|
77
77
|
function DocsPreferredVersionContextProviderUnsafe({ children, }) {
|
|
78
78
|
const value = useContextValue();
|
|
79
|
-
return <Context
|
|
79
|
+
return <Context value={value}>{children}</Context>;
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
82
|
* This is a maybe-layer. If the docs plugin is not enabled, this provider is a
|
|
@@ -15,7 +15,7 @@ const Context = React.createContext(EmptyContext);
|
|
|
15
15
|
*/
|
|
16
16
|
export function DocsSidebarProvider({ children, name, items, }) {
|
|
17
17
|
const stableValue = useMemo(() => (name && items ? { name, items } : null), [name, items]);
|
|
18
|
-
return <Context
|
|
18
|
+
return <Context value={stableValue}>{children}</Context>;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Gets the sidebar that's currently displayed, or `null` if there isn't one
|
|
@@ -11,7 +11,7 @@ const Context = React.createContext(null);
|
|
|
11
11
|
* Provide the current version's metadata to your children.
|
|
12
12
|
*/
|
|
13
13
|
export function DocsVersionProvider({ children, version, }) {
|
|
14
|
-
return <Context
|
|
14
|
+
return <Context value={version}>{children}</Context>;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Gets the version metadata of the current doc page.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-docs",
|
|
3
|
-
"version": "4.0.0-canary-
|
|
3
|
+
"version": "4.0.0-canary-6862",
|
|
4
4
|
"description": "Docs plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
},
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@docusaurus/core": "4.0.0-canary-
|
|
39
|
-
"@docusaurus/glob": "4.0.0-canary-
|
|
40
|
-
"@docusaurus/logger": "4.0.0-canary-
|
|
41
|
-
"@docusaurus/mdx-loader": "4.0.0-canary-
|
|
42
|
-
"@docusaurus/module-type-aliases": "4.0.0-canary-
|
|
43
|
-
"@docusaurus/theme-common": "4.0.0-canary-
|
|
44
|
-
"@docusaurus/types": "4.0.0-canary-
|
|
45
|
-
"@docusaurus/utils": "4.0.0-canary-
|
|
46
|
-
"@docusaurus/utils-common": "4.0.0-canary-
|
|
47
|
-
"@docusaurus/utils-validation": "4.0.0-canary-
|
|
38
|
+
"@docusaurus/core": "4.0.0-canary-6862",
|
|
39
|
+
"@docusaurus/glob": "4.0.0-canary-6862",
|
|
40
|
+
"@docusaurus/logger": "4.0.0-canary-6862",
|
|
41
|
+
"@docusaurus/mdx-loader": "4.0.0-canary-6862",
|
|
42
|
+
"@docusaurus/module-type-aliases": "4.0.0-canary-6862",
|
|
43
|
+
"@docusaurus/theme-common": "4.0.0-canary-6862",
|
|
44
|
+
"@docusaurus/types": "4.0.0-canary-6862",
|
|
45
|
+
"@docusaurus/utils": "4.0.0-canary-6862",
|
|
46
|
+
"@docusaurus/utils-common": "4.0.0-canary-6862",
|
|
47
|
+
"@docusaurus/utils-validation": "4.0.0-canary-6862",
|
|
48
48
|
"@types/react-router-config": "^5.0.11",
|
|
49
49
|
"combine-promises": "^1.2.0",
|
|
50
50
|
"fs-extra": "^11.4.0",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"engines": {
|
|
70
70
|
"node": ">=24.21"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "b21cd576b7f75d57b62d6c4441d7c0ac29fe1437"
|
|
73
73
|
}
|
package/src/client/doc.tsx
CHANGED
|
@@ -52,7 +52,7 @@ export function DocProvider({
|
|
|
52
52
|
content: PropDocContent;
|
|
53
53
|
}): ReactNode {
|
|
54
54
|
const contextValue = useContextValue(content);
|
|
55
|
-
return <Context
|
|
55
|
+
return <Context value={contextValue}>{children}</Context>;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/**
|
|
@@ -43,7 +43,7 @@ export function DocSidebarItemsExpandedStateProvider({
|
|
|
43
43
|
[expandedItem],
|
|
44
44
|
);
|
|
45
45
|
|
|
46
|
-
return <Context
|
|
46
|
+
return <Context value={contextValue}>{children}</Context>;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
export function useDocSidebarItemsExpandedState(): ContextValue {
|
|
@@ -162,7 +162,7 @@ function DocsPreferredVersionContextProviderUnsafe({
|
|
|
162
162
|
children: ReactNode;
|
|
163
163
|
}): ReactNode {
|
|
164
164
|
const value = useContextValue();
|
|
165
|
-
return <Context
|
|
165
|
+
return <Context value={value}>{children}</Context>;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
/**
|
|
@@ -35,7 +35,7 @@ export function DocsSidebarProvider({
|
|
|
35
35
|
() => (name && items ? {name, items} : null),
|
|
36
36
|
[name, items],
|
|
37
37
|
);
|
|
38
|
-
return <Context
|
|
38
|
+
return <Context value={stableValue}>{children}</Context>;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -21,7 +21,7 @@ export function DocsVersionProvider({
|
|
|
21
21
|
children: ReactNode;
|
|
22
22
|
version: PropVersionMetadata | null;
|
|
23
23
|
}): ReactNode {
|
|
24
|
-
return <Context
|
|
24
|
+
return <Context value={version}>{children}</Context>;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/**
|