@docusaurus/theme-common 3.3.2 → 3.5.0
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/contexts/announcementBar.d.ts +0 -1
- package/lib/contexts/announcementBar.d.ts.map +1 -1
- package/lib/contexts/announcementBar.js +4 -4
- package/lib/contexts/announcementBar.js.map +1 -1
- package/lib/index.d.ts +5 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +18 -6
- package/lib/index.js.map +1 -1
- package/lib/internal.d.ts +2 -9
- package/lib/internal.d.ts.map +1 -1
- package/lib/internal.js +2 -9
- package/lib/internal.js.map +1 -1
- package/lib/translations/blogTranslations.d.ts +19 -0
- package/lib/translations/blogTranslations.d.ts.map +1 -0
- package/lib/translations/blogTranslations.js +48 -0
- package/lib/translations/blogTranslations.js.map +1 -0
- package/lib/{utils/unlistedUtils.d.ts → translations/contentVisibilityTranslations.d.ts} +3 -2
- package/lib/translations/contentVisibilityTranslations.d.ts.map +1 -0
- package/lib/translations/contentVisibilityTranslations.js +39 -0
- package/lib/translations/contentVisibilityTranslations.js.map +1 -0
- package/lib/utils/ThemeClassNames.d.ts +3 -0
- package/lib/utils/ThemeClassNames.d.ts.map +1 -1
- package/lib/utils/ThemeClassNames.js +3 -0
- package/lib/utils/ThemeClassNames.js.map +1 -1
- package/lib/utils/errorBoundaryUtils.d.ts +0 -1
- package/lib/utils/errorBoundaryUtils.d.ts.map +1 -1
- package/lib/utils/jsUtils.d.ts +1 -0
- package/lib/utils/jsUtils.d.ts.map +1 -1
- package/lib/utils/jsUtils.js +14 -0
- package/lib/utils/jsUtils.js.map +1 -1
- package/lib/utils/searchUtils.d.ts +0 -13
- package/lib/utils/searchUtils.d.ts.map +1 -1
- package/lib/utils/searchUtils.js +0 -39
- package/lib/utils/searchUtils.js.map +1 -1
- package/lib/utils/storageUtils.d.ts +3 -4
- package/lib/utils/storageUtils.d.ts.map +1 -1
- package/lib/utils/storageUtils.js +7 -3
- package/lib/utils/storageUtils.js.map +1 -1
- package/lib/utils/tabsUtils.d.ts +2 -2
- package/lib/utils/tabsUtils.d.ts.map +1 -1
- package/lib/utils/useThemeConfig.d.ts +5 -0
- package/lib/utils/useThemeConfig.d.ts.map +1 -1
- package/lib/utils/useThemeConfig.js.map +1 -1
- package/package.json +9 -11
- package/src/contexts/announcementBar.tsx +4 -6
- package/src/index.ts +27 -16
- package/src/internal.ts +8 -36
- package/src/translations/blogTranslations.tsx +79 -0
- package/src/{utils/unlistedUtils.tsx → translations/contentVisibilityTranslations.tsx} +25 -2
- package/src/types.d.ts +0 -3
- package/src/utils/ThemeClassNames.ts +3 -0
- package/src/utils/jsUtils.ts +18 -0
- package/src/utils/searchUtils.ts +0 -58
- package/src/utils/storageUtils.ts +8 -4
- package/src/utils/useThemeConfig.ts +6 -0
- package/lib/contexts/blogPost.d.ts +0 -33
- package/lib/contexts/blogPost.d.ts.map +0 -1
- package/lib/contexts/blogPost.js +0 -46
- package/lib/contexts/blogPost.js.map +0 -1
- package/lib/contexts/doc.d.ts +0 -30
- package/lib/contexts/doc.d.ts.map +0 -1
- package/lib/contexts/doc.js +0 -48
- package/lib/contexts/doc.js.map +0 -1
- package/lib/contexts/docSidebarItemsExpandedState.d.ts +0 -31
- package/lib/contexts/docSidebarItemsExpandedState.d.ts.map +0 -1
- package/lib/contexts/docSidebarItemsExpandedState.js +0 -28
- package/lib/contexts/docSidebarItemsExpandedState.js.map +0 -1
- package/lib/contexts/docsPreferredVersion.d.ts +0 -30
- package/lib/contexts/docsPreferredVersion.d.ts.map +0 -1
- package/lib/contexts/docsPreferredVersion.js +0 -130
- package/lib/contexts/docsPreferredVersion.js.map +0 -1
- package/lib/contexts/docsSidebar.d.ts +0 -26
- package/lib/contexts/docsSidebar.d.ts.map +0 -1
- package/lib/contexts/docsSidebar.js +0 -30
- package/lib/contexts/docsSidebar.js.map +0 -1
- package/lib/contexts/docsVersion.d.ts +0 -20
- package/lib/contexts/docsVersion.d.ts.map +0 -1
- package/lib/contexts/docsVersion.js +0 -26
- package/lib/contexts/docsVersion.js.map +0 -1
- package/lib/utils/blogUtils.d.ts +0 -13
- package/lib/utils/blogUtils.d.ts.map +0 -1
- package/lib/utils/blogUtils.js +0 -24
- package/lib/utils/blogUtils.js.map +0 -1
- package/lib/utils/docsUtils.d.ts +0 -109
- package/lib/utils/docsUtils.d.ts.map +0 -1
- package/lib/utils/docsUtils.js +0 -276
- package/lib/utils/docsUtils.js.map +0 -1
- package/lib/utils/structuredDataUtils.d.ts +0 -12
- package/lib/utils/structuredDataUtils.d.ts.map +0 -1
- package/lib/utils/structuredDataUtils.js +0 -123
- package/lib/utils/structuredDataUtils.js.map +0 -1
- package/lib/utils/unlistedUtils.d.ts.map +0 -1
- package/lib/utils/unlistedUtils.js +0 -26
- package/lib/utils/unlistedUtils.js.map +0 -1
- package/src/contexts/blogPost.tsx +0 -80
- package/src/contexts/doc.tsx +0 -71
- package/src/contexts/docSidebarItemsExpandedState.tsx +0 -55
- package/src/contexts/docsPreferredVersion.tsx +0 -251
- package/src/contexts/docsSidebar.tsx +0 -50
- package/src/contexts/docsVersion.tsx +0 -36
- package/src/utils/blogUtils.ts +0 -32
- package/src/utils/docsUtils.tsx +0 -418
- package/src/utils/structuredDataUtils.ts +0 -177
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageUtils.d.ts","sourceRoot":"","sources":["../../src/utils/storageUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"storageUtils.d.ts","sourceRoot":"","sources":["../../src/utils/storageUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAElD,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAwFhE,MAAM,MAAM,WAAW,GAAG;IACxB,GAAG,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACzB,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;CACjE,CAAC;AAyBF;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAC,WAAW,CAAC,EAAE,WAAW,CAAA;CAAC,GACpC,WAAW,CA8Db;AAED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,GAAG,IAAI,EAClB,OAAO,CAAC,EAAE;IAAC,WAAW,CAAC,EAAE,WAAW,CAAA;CAAC,GACpC,CAAC,MAAM,GAAG,IAAI,EAAE,WAAW,CAAC,CAiC9B;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,WAAW,GAAE,WAAgC,GAC5C,MAAM,EAAE,CAcV"}
|
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { useCallback, useRef, useSyncExternalStore } from 'react';
|
|
8
|
-
|
|
9
|
-
const DefaultStorageType =
|
|
8
|
+
import SiteStorage from '@generated/site-storage';
|
|
9
|
+
const DefaultStorageType = SiteStorage.type;
|
|
10
|
+
function applyNamespace(storageKey) {
|
|
11
|
+
return `${storageKey}${SiteStorage.namespace}`;
|
|
12
|
+
}
|
|
10
13
|
// window.addEventListener('storage') only works for different windows...
|
|
11
14
|
// so for current window we have to dispatch the event manually
|
|
12
15
|
// Now we can listen for both cross-window / current-window storage changes!
|
|
@@ -88,7 +91,8 @@ Please only call storage APIs in effects and event handlers.`);
|
|
|
88
91
|
* security) or operations might fail individually. Please assume that using
|
|
89
92
|
* this API can be a no-op. See also https://github.com/facebook/docusaurus/issues/6036
|
|
90
93
|
*/
|
|
91
|
-
export function createStorageSlot(
|
|
94
|
+
export function createStorageSlot(keyInput, options) {
|
|
95
|
+
const key = applyNamespace(keyInput);
|
|
92
96
|
if (typeof window === 'undefined') {
|
|
93
97
|
return createServerStorageSlot(key);
|
|
94
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageUtils.js","sourceRoot":"","sources":["../../src/utils/storageUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,WAAW,EAAE,MAAM,EAAE,oBAAoB,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"storageUtils.js","sourceRoot":"","sources":["../../src/utils/storageUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,WAAW,EAAE,MAAM,EAAE,oBAAoB,EAAC,MAAM,OAAO,CAAC;AAChE,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAIlD,MAAM,kBAAkB,GAAgB,WAAW,CAAC,IAAI,CAAC;AAEzD,SAAS,cAAc,CAAC,UAAkB;IACxC,OAAO,GAAG,UAAU,GAAG,WAAW,CAAC,SAAS,EAAE,CAAC;AACjD,CAAC;AAED,yEAAyE;AACzE,+DAA+D;AAC/D,4EAA4E;AAC5E,iDAAiD;AACjD,2GAA2G;AAC3G,SAAS,mBAAmB,CAAC,EAC3B,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,OAAO,GAMR;IACC,8EAA8E;IAC9E,yEAAyE;IACzE,4EAA4E;IAC5E,yDAAyD;IACzD,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO;IACT,CAAC;IACD,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IACnD,KAAK,CAAC,gBAAgB,CACpB,SAAS,EACT,KAAK,EACL,KAAK,EACL,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,MAAM,CAAC,QAAQ,CAAC,IAAI,EACpB,OAAO,CACR,CAAC;IACF,MAAM,CAAC,aAAa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I,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC,EACD,CAAC,WAAW,CAAC,CACd,CAAC;IAEF,MAAM,YAAY,GAAG,oBAAoB,CACvC,MAAM,EACN,GAAG,EAAE;QACH,mDAAmD;QACnD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC;IAC3B,CAAC,EACD,GAAG,EAAE,CAAC,IAAI,CACX,CAAC;IAEF,OAAO,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;AACrC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,cAA2B,kBAAkB;IAE7C,MAAM,cAAc,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;IACtD,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,MAAM,GAAG,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAClC,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACjB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/lib/utils/tabsUtils.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import { type ReactNode, type ReactElement } from 'react';
|
|
8
8
|
/**
|
|
9
9
|
* TabValue is the "config" of a given Tab
|
|
10
10
|
* Provided through <Tabs> "values" prop or through the children <TabItem> props
|
|
@@ -39,7 +39,7 @@ export interface TabItemProps {
|
|
|
39
39
|
[key: string]: unknown;
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
export declare function sanitizeTabsChildren(children: TabsProps['children']):
|
|
42
|
+
export declare function sanitizeTabsChildren(children: TabsProps['children']): ReactElement<TabItemProps>[];
|
|
43
43
|
export declare function useTabs(props: TabsProps): {
|
|
44
44
|
selectedValue: string;
|
|
45
45
|
selectValue: (value: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabsUtils.d.ts","sourceRoot":"","sources":["../../src/utils/tabsUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,
|
|
1
|
+
{"version":3,"file":"tabsUtils.d.ts","sourceRoot":"","sources":["../../src/utils/tabsUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAc,EAKZ,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AAMf;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAC,CAAC;IAC/C,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,KAAK,OAAO,GAAG,YAAY,CAAC,YAAY,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,SAAS,CAAC;AAErE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,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I,EAAE;QACJ,OAAO,EAAE;YACP,WAAW,EAAE,OAAO,CAAC;SACtB,CAAC;KACH,CAAC;IAOF,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,eAAe,CAAC;IAC3B,eAAe,CAAC,EAAE,qBAAqB,CAAC;IACxC,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC,EAAE,CAAC;IACpC,eAAe,EAAE,eAAe,CAAC;CAClC,CAAC;AAGF,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC;AAEvD;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAE5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemeConfig.js","sourceRoot":"","sources":["../../src/utils/useThemeConfig.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"useThemeConfig.js","sourceRoot":"","sources":["../../src/utils/useThemeConfig.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AAgIpE;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,oBAAoB,EAAE,CAAC,UAAU,CAAC,WAA0B,CAAC;AACtE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-common",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "Common code for Docusaurus themes.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -30,13 +30,10 @@
|
|
|
30
30
|
},
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@docusaurus/mdx-loader": "3.
|
|
34
|
-
"@docusaurus/module-type-aliases": "3.
|
|
35
|
-
"@docusaurus/
|
|
36
|
-
"@docusaurus/
|
|
37
|
-
"@docusaurus/plugin-content-pages": "3.3.2",
|
|
38
|
-
"@docusaurus/utils": "3.3.2",
|
|
39
|
-
"@docusaurus/utils-common": "3.3.2",
|
|
33
|
+
"@docusaurus/mdx-loader": "3.5.0",
|
|
34
|
+
"@docusaurus/module-type-aliases": "3.5.0",
|
|
35
|
+
"@docusaurus/utils": "3.5.0",
|
|
36
|
+
"@docusaurus/utils-common": "3.5.0",
|
|
40
37
|
"@types/history": "^4.7.11",
|
|
41
38
|
"@types/react": "*",
|
|
42
39
|
"@types/react-router-config": "*",
|
|
@@ -47,18 +44,19 @@
|
|
|
47
44
|
"utility-types": "^3.10.0"
|
|
48
45
|
},
|
|
49
46
|
"devDependencies": {
|
|
50
|
-
"@docusaurus/core": "3.
|
|
51
|
-
"@docusaurus/types": "3.
|
|
47
|
+
"@docusaurus/core": "3.5.0",
|
|
48
|
+
"@docusaurus/types": "3.5.0",
|
|
52
49
|
"fs-extra": "^11.1.1",
|
|
53
50
|
"lodash": "^4.17.21",
|
|
54
51
|
"schema-dts": "^1.1.2"
|
|
55
52
|
},
|
|
56
53
|
"peerDependencies": {
|
|
54
|
+
"@docusaurus/plugin-content-docs": "*",
|
|
57
55
|
"react": "^18.0.0",
|
|
58
56
|
"react-dom": "^18.0.0"
|
|
59
57
|
},
|
|
60
58
|
"engines": {
|
|
61
59
|
"node": ">=18.0"
|
|
62
60
|
},
|
|
63
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "cb5829f3c34b26d798b869e38ee25073488140bd"
|
|
64
62
|
}
|
|
@@ -18,14 +18,12 @@ import {createStorageSlot} from '../utils/storageUtils';
|
|
|
18
18
|
import {ReactContextError} from '../utils/reactUtils';
|
|
19
19
|
import {useThemeConfig} from '../utils/useThemeConfig';
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const AnnouncementBarIdStorageKey = 'docusaurus.announcement.id';
|
|
24
|
-
|
|
21
|
+
// Keep these keys in sync with the inlined script
|
|
22
|
+
// See packages/docusaurus-theme-classic/src/inlineScripts.ts
|
|
25
23
|
const AnnouncementBarDismissStorage = createStorageSlot(
|
|
26
|
-
|
|
24
|
+
'docusaurus.announcement.dismiss',
|
|
27
25
|
);
|
|
28
|
-
const IdStorage = createStorageSlot(
|
|
26
|
+
const IdStorage = createStorageSlot('docusaurus.announcement.id');
|
|
29
27
|
|
|
30
28
|
const isDismissedInStorage = () =>
|
|
31
29
|
AnnouncementBarDismissStorage.get() === 'true';
|
package/src/index.ts
CHANGED
|
@@ -5,6 +5,29 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
// TODO Docusaurus v4: remove these workarounds as a breaking change
|
|
9
|
+
// and remove docs plugin peerDeps in theme-common/package.json
|
|
10
|
+
// This is public API surface that we need to keep for v3
|
|
11
|
+
// See https://github.com/facebook/docusaurus/pull/10316
|
|
12
|
+
export function useCurrentSidebarCategory(...args: unknown[]): unknown {
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
14
|
+
return require('@docusaurus/plugin-content-docs/client').useCurrentSidebarCategory(
|
|
15
|
+
...args,
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
export function filterDocCardListItems(...args: unknown[]): unknown {
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
20
|
+
return require('@docusaurus/plugin-content-docs/client').filterDocCardListItems(
|
|
21
|
+
...args,
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export function useDocsPreferredVersion(...args: unknown[]): unknown {
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
26
|
+
return require('@docusaurus/plugin-content-docs/client').useDocsPreferredVersion(
|
|
27
|
+
...args,
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
8
31
|
/*
|
|
9
32
|
* APIs to document
|
|
10
33
|
*/
|
|
@@ -32,18 +55,6 @@ export {
|
|
|
32
55
|
listStorageKeys,
|
|
33
56
|
} from './utils/storageUtils';
|
|
34
57
|
|
|
35
|
-
export {useContextualSearchFilters} from './utils/searchUtils';
|
|
36
|
-
|
|
37
|
-
export {
|
|
38
|
-
useCurrentSidebarCategory,
|
|
39
|
-
filterDocCardListItems,
|
|
40
|
-
} from './utils/docsUtils';
|
|
41
|
-
|
|
42
|
-
export {
|
|
43
|
-
useBlogListPageStructuredData,
|
|
44
|
-
useBlogPostStructuredData,
|
|
45
|
-
} from './utils/structuredDataUtils';
|
|
46
|
-
|
|
47
58
|
export {usePluralForm} from './utils/usePluralForm';
|
|
48
59
|
|
|
49
60
|
export {useCollapsible, Collapsible} from './components/Collapsible';
|
|
@@ -90,12 +101,10 @@ export {isMultiColumnFooterLinks} from './utils/footerUtils';
|
|
|
90
101
|
|
|
91
102
|
export {isRegexpStringMatch} from './utils/regexpUtils';
|
|
92
103
|
|
|
93
|
-
export {duplicates, uniq} from './utils/jsUtils';
|
|
104
|
+
export {duplicates, uniq, groupBy} from './utils/jsUtils';
|
|
94
105
|
|
|
95
106
|
export {usePrismTheme} from './hooks/usePrismTheme';
|
|
96
107
|
|
|
97
|
-
export {useDocsPreferredVersion} from './contexts/docsPreferredVersion';
|
|
98
|
-
|
|
99
108
|
export {processAdmonitionProps} from './utils/admonitionUtils';
|
|
100
109
|
|
|
101
110
|
export {
|
|
@@ -114,7 +123,9 @@ export {
|
|
|
114
123
|
UnlistedBannerTitle,
|
|
115
124
|
UnlistedBannerMessage,
|
|
116
125
|
UnlistedMetadata,
|
|
117
|
-
|
|
126
|
+
DraftBannerTitle,
|
|
127
|
+
DraftBannerMessage,
|
|
128
|
+
} from './translations/contentVisibilityTranslations';
|
|
118
129
|
|
|
119
130
|
export {
|
|
120
131
|
ErrorBoundaryTryAgainButton,
|
package/src/internal.ts
CHANGED
|
@@ -18,25 +18,6 @@
|
|
|
18
18
|
// eslint-disable-next-line no-restricted-syntax
|
|
19
19
|
export * from './index';
|
|
20
20
|
|
|
21
|
-
export {
|
|
22
|
-
DocSidebarItemsExpandedStateProvider,
|
|
23
|
-
useDocSidebarItemsExpandedState,
|
|
24
|
-
} from './contexts/docSidebarItemsExpandedState';
|
|
25
|
-
export {DocsVersionProvider, useDocsVersion} from './contexts/docsVersion';
|
|
26
|
-
export {DocsSidebarProvider, useDocsSidebar} from './contexts/docsSidebar';
|
|
27
|
-
|
|
28
|
-
export {DocProvider, useDoc, type DocContextValue} from './contexts/doc';
|
|
29
|
-
export {
|
|
30
|
-
BlogPostProvider,
|
|
31
|
-
useBlogPost,
|
|
32
|
-
type BlogPostContextValue,
|
|
33
|
-
} from './contexts/blogPost';
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
useDocsPreferredVersionByPluginId,
|
|
37
|
-
DocsPreferredVersionContextProvider,
|
|
38
|
-
} from './contexts/docsPreferredVersion';
|
|
39
|
-
|
|
40
21
|
export {
|
|
41
22
|
AnnouncementBarProvider,
|
|
42
23
|
useAnnouncementBar,
|
|
@@ -59,22 +40,7 @@ export {
|
|
|
59
40
|
containsLineNumbers,
|
|
60
41
|
} from './utils/codeBlockUtils';
|
|
61
42
|
|
|
62
|
-
export {
|
|
63
|
-
|
|
64
|
-
export {
|
|
65
|
-
isDocsPluginEnabled,
|
|
66
|
-
useDocById,
|
|
67
|
-
findSidebarCategory,
|
|
68
|
-
findFirstSidebarItemLink,
|
|
69
|
-
isActiveSidebarItem,
|
|
70
|
-
isVisibleSidebarItem,
|
|
71
|
-
useVisibleSidebarItems,
|
|
72
|
-
useSidebarBreadcrumbs,
|
|
73
|
-
useDocsVersionCandidates,
|
|
74
|
-
useLayoutDoc,
|
|
75
|
-
useLayoutDocsSidebar,
|
|
76
|
-
useDocRootMetadata,
|
|
77
|
-
} from './utils/docsUtils';
|
|
43
|
+
export {DEFAULT_SEARCH_TAG} from './utils/searchUtils';
|
|
78
44
|
|
|
79
45
|
export {useTitleFormatter} from './utils/generalUtils';
|
|
80
46
|
|
|
@@ -113,7 +79,6 @@ export {
|
|
|
113
79
|
type TOCHighlightConfig,
|
|
114
80
|
} from './hooks/useTOCHighlight';
|
|
115
81
|
|
|
116
|
-
export {useVisibleBlogSidebarItems} from './utils/blogUtils';
|
|
117
82
|
export {useDateTimeFormat} from './utils/IntlUtils';
|
|
118
83
|
|
|
119
84
|
export {useHideableNavbar} from './hooks/useHideableNavbar';
|
|
@@ -125,3 +90,10 @@ export {useLockBodyScroll} from './hooks/useLockBodyScroll';
|
|
|
125
90
|
export {useCodeWordWrap} from './hooks/useCodeWordWrap';
|
|
126
91
|
export {getPrismCssVariables} from './utils/codeBlockUtils';
|
|
127
92
|
export {useBackToTopButton} from './hooks/useBackToTopButton';
|
|
93
|
+
|
|
94
|
+
export {
|
|
95
|
+
useBlogTagsPostsPageTitle,
|
|
96
|
+
useBlogAuthorPageTitle,
|
|
97
|
+
translateBlogAuthorsListPageTitle,
|
|
98
|
+
BlogAuthorsListViewAllLabel,
|
|
99
|
+
} from './translations/blogTranslations';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React, {type ReactNode} from 'react';
|
|
9
|
+
import Translate, {translate} from '@docusaurus/Translate';
|
|
10
|
+
import {usePluralForm} from '../utils/usePluralForm';
|
|
11
|
+
|
|
12
|
+
// Only used locally
|
|
13
|
+
function useBlogPostsPlural(): (count: number) => string {
|
|
14
|
+
const {selectMessage} = usePluralForm();
|
|
15
|
+
return (count: number) =>
|
|
16
|
+
selectMessage(
|
|
17
|
+
count,
|
|
18
|
+
translate(
|
|
19
|
+
{
|
|
20
|
+
id: 'theme.blog.post.plurals',
|
|
21
|
+
description:
|
|
22
|
+
'Pluralized label for "{count} posts". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',
|
|
23
|
+
message: 'One post|{count} posts',
|
|
24
|
+
},
|
|
25
|
+
{count},
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function useBlogTagsPostsPageTitle(tag: {
|
|
31
|
+
label: string;
|
|
32
|
+
count: number;
|
|
33
|
+
}): string {
|
|
34
|
+
const blogPostsPlural = useBlogPostsPlural();
|
|
35
|
+
return translate(
|
|
36
|
+
{
|
|
37
|
+
id: 'theme.blog.tagTitle',
|
|
38
|
+
description: 'The title of the page for a blog tag',
|
|
39
|
+
message: '{nPosts} tagged with "{tagName}"',
|
|
40
|
+
},
|
|
41
|
+
{nPosts: blogPostsPlural(tag.count), tagName: tag.label},
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function useBlogAuthorPageTitle(author: {
|
|
46
|
+
key: string;
|
|
47
|
+
name?: string;
|
|
48
|
+
count: number;
|
|
49
|
+
}): string {
|
|
50
|
+
const blogPostsPlural = useBlogPostsPlural();
|
|
51
|
+
return translate(
|
|
52
|
+
{
|
|
53
|
+
id: 'theme.blog.author.pageTitle',
|
|
54
|
+
description: 'The title of the page for a blog author',
|
|
55
|
+
message: '{authorName} - {nPosts}',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
nPosts: blogPostsPlural(author.count),
|
|
59
|
+
authorName: author.name || author.key,
|
|
60
|
+
},
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const translateBlogAuthorsListPageTitle = (): string =>
|
|
65
|
+
translate({
|
|
66
|
+
id: 'theme.blog.authorsList.pageTitle',
|
|
67
|
+
message: 'Authors',
|
|
68
|
+
description: 'The title of the authors page',
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export function BlogAuthorsListViewAllLabel(): ReactNode {
|
|
72
|
+
return (
|
|
73
|
+
<Translate
|
|
74
|
+
id="theme.blog.authorsList.viewAll"
|
|
75
|
+
description="The label of the link targeting the blog authors page">
|
|
76
|
+
View All Authors
|
|
77
|
+
</Translate>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -12,7 +12,7 @@ import Head from '@docusaurus/Head';
|
|
|
12
12
|
export function UnlistedBannerTitle(): JSX.Element {
|
|
13
13
|
return (
|
|
14
14
|
<Translate
|
|
15
|
-
id="theme.
|
|
15
|
+
id="theme.contentVisibility.unlistedBanner.title"
|
|
16
16
|
description="The unlisted content banner title">
|
|
17
17
|
Unlisted page
|
|
18
18
|
</Translate>
|
|
@@ -22,7 +22,7 @@ export function UnlistedBannerTitle(): JSX.Element {
|
|
|
22
22
|
export function UnlistedBannerMessage(): JSX.Element {
|
|
23
23
|
return (
|
|
24
24
|
<Translate
|
|
25
|
-
id="theme.
|
|
25
|
+
id="theme.contentVisibility.unlistedBanner.message"
|
|
26
26
|
description="The unlisted content banner message">
|
|
27
27
|
This page is unlisted. Search engines will not index it, and only users
|
|
28
28
|
having a direct link can access it.
|
|
@@ -30,6 +30,8 @@ export function UnlistedBannerMessage(): JSX.Element {
|
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
// TODO Docusaurus v4 breaking change (since it's v3 public theme-common API :/)
|
|
34
|
+
// Move this to theme/ContentVisibility/Unlisted
|
|
33
35
|
export function UnlistedMetadata(): JSX.Element {
|
|
34
36
|
return (
|
|
35
37
|
<Head>
|
|
@@ -37,3 +39,24 @@ export function UnlistedMetadata(): JSX.Element {
|
|
|
37
39
|
</Head>
|
|
38
40
|
);
|
|
39
41
|
}
|
|
42
|
+
|
|
43
|
+
export function DraftBannerTitle(): JSX.Element {
|
|
44
|
+
return (
|
|
45
|
+
<Translate
|
|
46
|
+
id="theme.contentVisibility.draftBanner.title"
|
|
47
|
+
description="The draft content banner title">
|
|
48
|
+
Draft page
|
|
49
|
+
</Translate>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function DraftBannerMessage(): JSX.Element {
|
|
54
|
+
return (
|
|
55
|
+
<Translate
|
|
56
|
+
id="theme.contentVisibility.draftBanner.message"
|
|
57
|
+
description="The draft content banner message">
|
|
58
|
+
This page is a draft. It will only be visible in dev and be excluded from
|
|
59
|
+
the production build.
|
|
60
|
+
</Translate>
|
|
61
|
+
);
|
|
62
|
+
}
|
package/src/types.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export const ThemeClassNames = {
|
|
|
18
18
|
blogPostPage: 'blog-post-page',
|
|
19
19
|
blogTagsListPage: 'blog-tags-list-page',
|
|
20
20
|
blogTagPostListPage: 'blog-tags-post-list-page',
|
|
21
|
+
blogAuthorsListPage: 'blog-authors-list-page',
|
|
22
|
+
blogAuthorsPostsPage: 'blog-authors-posts-page',
|
|
21
23
|
|
|
22
24
|
docsDocPage: 'docs-doc-page',
|
|
23
25
|
docsTagsListPage: 'docs-tags-list-page',
|
|
@@ -41,6 +43,7 @@ export const ThemeClassNames = {
|
|
|
41
43
|
codeBlock: 'theme-code-block',
|
|
42
44
|
admonition: 'theme-admonition',
|
|
43
45
|
unlistedBanner: 'theme-unlisted-banner',
|
|
46
|
+
draftBanner: 'theme-draft-banner',
|
|
44
47
|
|
|
45
48
|
admonitionType: (type: string) => `theme-admonition-${type}`,
|
|
46
49
|
},
|
package/src/utils/jsUtils.ts
CHANGED
|
@@ -34,3 +34,21 @@ export function uniq<T>(arr: T[]): T[] {
|
|
|
34
34
|
// Note: had problems with [...new Set()]: https://github.com/facebook/docusaurus/issues/4972#issuecomment-863895061
|
|
35
35
|
return Array.from(new Set(arr));
|
|
36
36
|
}
|
|
37
|
+
|
|
38
|
+
// TODO 2025: replace by std Object.groupBy ?
|
|
39
|
+
// This is a local polyfill with exact same TS signature
|
|
40
|
+
// see https://github.com/microsoft/TypeScript/blob/main/src/lib/esnext.object.d.ts
|
|
41
|
+
export function groupBy<K extends PropertyKey, T>(
|
|
42
|
+
items: Iterable<T>,
|
|
43
|
+
keySelector: (item: T, index: number) => K,
|
|
44
|
+
): Partial<Record<K, T[]>> {
|
|
45
|
+
const result: Partial<Record<K, T[]>> = {};
|
|
46
|
+
let index = 0;
|
|
47
|
+
for (const item of items) {
|
|
48
|
+
const key = keySelector(item, index);
|
|
49
|
+
result[key] ??= [];
|
|
50
|
+
result[key]!.push(item);
|
|
51
|
+
index += 1;
|
|
52
|
+
}
|
|
53
|
+
return result;
|
|
54
|
+
}
|
package/src/utils/searchUtils.ts
CHANGED
|
@@ -5,62 +5,4 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
useAllDocsData,
|
|
10
|
-
useActivePluginAndVersion,
|
|
11
|
-
} from '@docusaurus/plugin-content-docs/client';
|
|
12
|
-
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
13
|
-
import {useDocsPreferredVersionByPluginId} from '../contexts/docsPreferredVersion';
|
|
14
|
-
|
|
15
8
|
export const DEFAULT_SEARCH_TAG = 'default';
|
|
16
|
-
|
|
17
|
-
/** The search tag to append as each doc's metadata. */
|
|
18
|
-
export function docVersionSearchTag(
|
|
19
|
-
pluginId: string,
|
|
20
|
-
versionName: string,
|
|
21
|
-
): string {
|
|
22
|
-
return `docs-${pluginId}-${versionName}`;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Gets the relevant context information for contextual search.
|
|
27
|
-
*
|
|
28
|
-
* The value is generic and not coupled to Algolia/DocSearch, since we may want
|
|
29
|
-
* to support multiple search engines, or allowing users to use their own search
|
|
30
|
-
* engine solution.
|
|
31
|
-
*/
|
|
32
|
-
export function useContextualSearchFilters(): {locale: string; tags: string[]} {
|
|
33
|
-
const {i18n} = useDocusaurusContext();
|
|
34
|
-
const allDocsData = useAllDocsData();
|
|
35
|
-
const activePluginAndVersion = useActivePluginAndVersion();
|
|
36
|
-
const docsPreferredVersionByPluginId = useDocsPreferredVersionByPluginId();
|
|
37
|
-
|
|
38
|
-
// This can't use more specialized hooks because we are mapping over all
|
|
39
|
-
// plugin instances.
|
|
40
|
-
function getDocPluginTags(pluginId: string) {
|
|
41
|
-
const activeVersion =
|
|
42
|
-
activePluginAndVersion?.activePlugin.pluginId === pluginId
|
|
43
|
-
? activePluginAndVersion.activeVersion
|
|
44
|
-
: undefined;
|
|
45
|
-
|
|
46
|
-
const preferredVersion = docsPreferredVersionByPluginId[pluginId];
|
|
47
|
-
|
|
48
|
-
const latestVersion = allDocsData[pluginId]!.versions.find(
|
|
49
|
-
(v) => v.isLast,
|
|
50
|
-
)!;
|
|
51
|
-
|
|
52
|
-
const version = activeVersion ?? preferredVersion ?? latestVersion;
|
|
53
|
-
|
|
54
|
-
return docVersionSearchTag(pluginId, version.name);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const tags = [
|
|
58
|
-
DEFAULT_SEARCH_TAG,
|
|
59
|
-
...Object.keys(allDocsData).map(getDocPluginTags),
|
|
60
|
-
];
|
|
61
|
-
|
|
62
|
-
return {
|
|
63
|
-
locale: i18n.currentLocale,
|
|
64
|
-
tags,
|
|
65
|
-
};
|
|
66
|
-
}
|
|
@@ -6,12 +6,15 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import {useCallback, useRef, useSyncExternalStore} from 'react';
|
|
9
|
+
import SiteStorage from '@generated/site-storage';
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
export type StorageType = (typeof SiteStorage)['type'] | 'none';
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
const DefaultStorageType: StorageType = SiteStorage.type;
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
function applyNamespace(storageKey: string): string {
|
|
16
|
+
return `${storageKey}${SiteStorage.namespace}`;
|
|
17
|
+
}
|
|
15
18
|
|
|
16
19
|
// window.addEventListener('storage') only works for different windows...
|
|
17
20
|
// so for current window we have to dispatch the event manually
|
|
@@ -134,9 +137,10 @@ Please only call storage APIs in effects and event handlers.`);
|
|
|
134
137
|
* this API can be a no-op. See also https://github.com/facebook/docusaurus/issues/6036
|
|
135
138
|
*/
|
|
136
139
|
export function createStorageSlot(
|
|
137
|
-
|
|
140
|
+
keyInput: string,
|
|
138
141
|
options?: {persistence?: StorageType},
|
|
139
142
|
): StorageSlot {
|
|
143
|
+
const key = applyNamespace(keyInput);
|
|
140
144
|
if (typeof window === 'undefined') {
|
|
141
145
|
return createServerStorageSlot(key);
|
|
142
146
|
}
|
|
@@ -109,6 +109,12 @@ export type ThemeConfig = {
|
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
+
blog: {
|
|
113
|
+
sidebar: {
|
|
114
|
+
groupByYear: boolean;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
|
|
112
118
|
// TODO we should complete this theme config type over time
|
|
113
119
|
// and share it across all themes
|
|
114
120
|
// and use it in the Joi validation schema?
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
import { type ReactNode } from 'react';
|
|
8
|
-
import type { PropBlogPostContent } from '@docusaurus/plugin-content-blog';
|
|
9
|
-
/**
|
|
10
|
-
* The React context value returned by the `useBlogPost()` hook.
|
|
11
|
-
* It contains useful data related to the currently browsed blog post.
|
|
12
|
-
*/
|
|
13
|
-
export type BlogPostContextValue = Pick<PropBlogPostContent, 'metadata' | 'frontMatter' | 'assets' | 'toc'> & {
|
|
14
|
-
readonly isBlogPostPage: boolean;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* This is a very thin layer around the `content` received from the MDX loader.
|
|
18
|
-
* It provides metadata about the blog post to the children tree.
|
|
19
|
-
*/
|
|
20
|
-
export declare function BlogPostProvider({ children, content, isBlogPostPage, }: {
|
|
21
|
-
children: ReactNode;
|
|
22
|
-
content: PropBlogPostContent;
|
|
23
|
-
isBlogPostPage?: boolean;
|
|
24
|
-
}): JSX.Element;
|
|
25
|
-
/**
|
|
26
|
-
* Returns the data of the currently browsed blog post. Gives access to
|
|
27
|
-
* front matter, metadata, TOC, etc.
|
|
28
|
-
* When swizzling a low-level component (e.g. the "Edit this page" link)
|
|
29
|
-
* and you need some extra metadata, you don't have to drill the props
|
|
30
|
-
* all the way through the component tree: simply use this hook instead.
|
|
31
|
-
*/
|
|
32
|
-
export declare function useBlogPost(): BlogPostContextValue;
|
|
33
|
-
//# sourceMappingURL=blogPost.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"blogPost.d.ts","sourceRoot":"","sources":["../../src/contexts/blogPost.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAc,EAAU,KAAK,SAAS,EAAa,MAAM,OAAO,CAAC;AAGjE,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AAEzE;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,mBAAmB,EACnB,UAAU,GAAG,aAAa,GAAG,QAAQ,GAAG,KAAK,CAC9C,GAAG;IACF,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;CAClC,CAAC;AA4BF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,OAAO,EACP,cAAsB,GACvB,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,GAAG,CAAC,OAAO,CAGd;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,oBAAoB,CAMlD"}
|