Skip to content

Commit 8e5649d

Browse files
authored
Merge branch '2.0' into update-reference-regex-for-2.0
2 parents 3c703db + ff8d650 commit 8e5649d

File tree

306 files changed

+1734
-1038
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+1734
-1038
lines changed

public/reference/data.json

Lines changed: 764 additions & 462 deletions
Large diffs are not rendered by default.

public/search-indices/en.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

public/search-indices/es.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

public/search-indices/hi.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

public/search-indices/ko.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

public/search-indices/zh-Hans.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/components/CodeEmbed/frame.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export const CodeFrame = (props: CodeFrameProps) => {
146146
return;
147147
}
148148
})();
149-
}, [props.jsCode, mounted]);
149+
}, [props.jsCode, mounted,p5ScriptTag]);
150150

151151
return (
152152
<div

src/components/MethodSignature/index.astro

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ import { CopyCodeButton } from "../CopyCodeButton";
1414
1515
const { params, name, overloads } = Astro.props;
1616
17-
const formatParam = (param: ReferenceParam) =>
18-
param.optional ? `[${param.name}]` : `${param.name}`;
17+
const formatParam = (param: ReferenceParam) => {
18+
let formatted = param.optional ? `[${param.name}]` : `${param.name}`;
19+
if (param.rest) {
20+
formatted = `${param.name}1, ${param.name}2, ..., ${param.name}n`;
21+
}
22+
return formatted;
23+
};
1924
2025
const signatures = params
2126
? [`${name}(${params.map(formatParam).join(", ")})`]

src/components/SearchProvider/index.tsx

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,7 @@ const SearchProvider = ({
3030
const [results, setResults] = useState<SearchResult[]>([]);
3131

3232
// Flattens the search index data
33-
const flattenData = (data: FuseResult<SearchResult>) => {
34-
const flatData: SearchResult[] = [];
35-
let flatId = 0;
36-
Object.entries(data).forEach(([category, entries]) => {
37-
Object.entries(entries).forEach(([title, docDetails]) => {
38-
// Since we are generating these links with Javascript and the
39-
// middleware doesn't prefix the locale automatically, we need to
40-
// do it manually here.
41-
const relativeUrl =
42-
currentLocale === defaultLocale
43-
? docDetails.relativeUrl
44-
: `/${currentLocale}${docDetails.relativeUrl}`;
45-
docDetails.relativeUrl = relativeUrl;
46-
flatData.push({
47-
id: flatId++,
48-
category: category.replace("-fallback", ""),
49-
title,
50-
...docDetails,
51-
});
52-
});
53-
});
54-
55-
return flatData;
56-
};
33+
5734

5835
// Read the search term from query params on first load
5936
useEffect(() => {
@@ -80,6 +57,30 @@ const SearchProvider = ({
8057
}
8158

8259
if (!searchTerm) return;
60+
const flattenData = (data: FuseResult<SearchResult>) => {
61+
const flatData: SearchResult[] = [];
62+
let flatId = 0;
63+
Object.entries(data).forEach(([category, entries]) => {
64+
Object.entries(entries).forEach(([title, docDetails]) => {
65+
// Since we are generating these links with Javascript and the
66+
// middleware doesn't prefix the locale automatically, we need to
67+
// do it manually here.
68+
const relativeUrl =
69+
currentLocale === defaultLocale
70+
? docDetails.relativeUrl
71+
: `/${currentLocale}${docDetails.relativeUrl}`;
72+
docDetails.relativeUrl = relativeUrl;
73+
flatData.push({
74+
id: flatId++,
75+
category: category.replace("-fallback", ""),
76+
title,
77+
...docDetails,
78+
});
79+
});
80+
});
81+
82+
return flatData;
83+
};
8384

8485
let flatData;
8586

src/content/contributor-docs/en/creating_libraries.mdx

Lines changed: 137 additions & 118 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)