Skip to content

Commit 0efd1be

Browse files
committedMar 3, 2024··
fix: anchor link for events
1 parent 9fa115d commit 0efd1be

14 files changed

+83
-57
lines changed
 

‎apps/website/src/components/ConstructorNode.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { VscSymbolMethod } from '@react-icons/all-files/vsc/VscSymbolMethod';
22
import { Code2, LinkIcon } from 'lucide-react';
33
import Link from 'next/link';
4+
import { ENV } from '~/util/env';
45
import { ParameterNode } from './ParameterNode';
56
import { SummaryNode } from './SummaryNode';
67

@@ -13,7 +14,10 @@ export async function ConstructorNode({ node, version }: { readonly node: any; r
1314
</h2>
1415

1516
<div className="flex place-content-between place-items-center">
16-
<h3 id="constructor" className="group scroll-mt-8 break-words font-mono font-semibold">
17+
<h3
18+
id="constructor"
19+
className={`${ENV.IS_LOCAL_DEV || ENV.IS_PREVIEW ? 'scroll-mt-16' : 'scroll-mt-8'} group break-words font-mono font-semibold`}
20+
>
1721
{/* constructor({parsedContent.constructor.parametersString}) */}
1822
<Link href="#constructor" className="float-left -ml-6 hidden pb-2 pr-2 group-hover:block">
1923
<LinkIcon aria-hidden size={16} />

‎apps/website/src/components/EnumMemberNode.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { VscSymbolEnumMember } from '@react-icons/all-files/vsc/VscSymbolEnumMem
22
import { Code2, LinkIcon } from 'lucide-react';
33
import Link from 'next/link';
44
import { Fragment } from 'react';
5+
import { ENV } from '~/util/env';
56
import { Badges } from './Badges';
67
import { DeprecatedNode } from './DeprecatedNode';
78
import { ExampleNode } from './ExampleNode';
@@ -34,7 +35,10 @@ export async function EnumMemberNode({
3435
<Fragment key={`${enumMember.displayName}-${idx}`}>
3536
<div className="flex flex-col gap-4">
3637
<div className="flex place-content-between place-items-center">
37-
<h3 id={enumMember.displayName} className="group scroll-mt-8 break-words font-mono font-semibold">
38+
<h3
39+
id={enumMember.displayName}
40+
className={`${ENV.IS_LOCAL_DEV || ENV.IS_PREVIEW ? 'scroll-mt-16' : 'scroll-mt-8'} group break-words font-mono font-semibold`}
41+
>
3842
<Badges node={enumMember} />
3943
<span>
4044
<Link

‎apps/website/src/components/EventNode.tsx

+17-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { VscSymbolEvent } from '@react-icons/all-files/vsc/VscSymbolEvent';
2-
import { ChevronDown, ChevronUp, Code2 } from 'lucide-react';
2+
import { ChevronDown, ChevronUp, Code2, LinkIcon } from 'lucide-react';
3+
import Link from 'next/link';
4+
import { ENV } from '~/util/env';
35
import { Badges } from './Badges';
46
import { DeprecatedNode } from './DeprecatedNode';
57
import { ExampleNode } from './ExampleNode';
@@ -29,17 +31,22 @@ async function EventBodyNode({
2931
<div className="flex place-content-between place-items-center">
3032
<h3
3133
id={event.displayName}
32-
className={`${overload ? 'scroll-mt-16' : 'scroll-mt-8'} break-words font-mono font-semibold`}
34+
className={`${overload ? (ENV.IS_LOCAL_DEV || ENV.IS_PREVIEW ? 'scroll-mt-24' : 'scroll-mt-16') : ENV.IS_LOCAL_DEV || ENV.IS_PREVIEW ? 'scroll-mt-16' : 'scroll-mt-8'} group break-words font-mono font-semibold`}
3335
>
3436
<Badges node={event} /> {event.displayName}
35-
{event.typeParameters?.length ? (
36-
<>
37-
{'<'}
38-
<TypeParameterNode node={event.typeParameters} version={version} />
39-
{'>'}
40-
</>
41-
) : null}
42-
({event.parameters?.length ? <ParameterNode node={event.parameters} version={version} /> : null})
37+
<span>
38+
<Link href={`#${event.displayName}`} className="float-left -ml-6 hidden pb-2 pr-2 group-hover:block">
39+
<LinkIcon aria-hidden size={16} />
40+
</Link>
41+
{event.typeParameters?.length ? (
42+
<>
43+
{'<'}
44+
<TypeParameterNode node={event.typeParameters} version={version} />
45+
{'>'}
46+
</>
47+
) : null}
48+
({event.parameters?.length ? <ParameterNode node={event.parameters} version={version} /> : null})
49+
</span>
4350
</h3>
4451

4552
<a

‎apps/website/src/components/MethodNode.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { VscSymbolMethod } from '@react-icons/all-files/vsc/VscSymbolMethod';
22
import { ChevronDown, ChevronUp, Code2, LinkIcon } from 'lucide-react';
33
import Link from 'next/link';
4+
import { ENV } from '~/util/env';
45
import { Badges } from './Badges';
56
import { DeprecatedNode } from './DeprecatedNode';
67
import { ExampleNode } from './ExampleNode';
@@ -31,7 +32,7 @@ async function MethodBodyNode({
3132
<div className="flex place-content-between place-items-center">
3233
<h3
3334
id={method.displayName}
34-
className={`${overload ? 'scroll-mt-16' : 'scroll-mt-8'} group break-words font-mono font-semibold`}
35+
className={`${overload ? (ENV.IS_LOCAL_DEV || ENV.IS_PREVIEW ? 'scroll-mt-24' : 'scroll-mt-16') : ENV.IS_LOCAL_DEV || ENV.IS_PREVIEW ? 'scroll-mt-16' : 'scroll-mt-8'} group break-words font-mono font-semibold`}
3536
>
3637
<Badges node={method} /> {method.displayName}
3738
<span>

‎apps/website/src/components/PropertyNode.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { VscSymbolProperty } from '@react-icons/all-files/vsc/VscSymbolProperty'
22
import { ChevronDown, ChevronUp, Code2, LinkIcon } from 'lucide-react';
33
import Link from 'next/link';
44
import { Fragment } from 'react';
5+
import { ENV } from '~/util/env';
56
import { Badges } from './Badges';
67
import { DeprecatedNode } from './DeprecatedNode';
78
import { ExcerptNode } from './ExcerptNode';
@@ -39,7 +40,7 @@ export async function PropertyNode({
3940
<div className="flex place-content-between place-items-center">
4041
<h3
4142
id={property.displayName}
42-
className="group flex scroll-mt-8 flex-col gap-2 break-words font-mono font-semibold"
43+
className={`${ENV.IS_LOCAL_DEV || ENV.IS_PREVIEW ? 'scroll-mt-16' : 'scroll-mt-8'} group flex flex-col gap-2 break-words font-mono font-semibold`}
4344
>
4445
<Badges node={property} />
4546
<span>

‎apps/website/src/components/TypeParameterNode.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { LinkIcon } from 'lucide-react';
22
import Link from 'next/link';
33
import { Fragment } from 'react';
4+
import { ENV } from '~/util/env';
45
import { Badges } from './Badges';
56
import { DocNode } from './DocNode';
67
import { ExcerptNode } from './ExcerptNode';
@@ -20,7 +21,10 @@ export async function TypeParameterNode({
2021
return (
2122
<Fragment key={`${typeParameter.name}-${idx}`}>
2223
<div className={description ? '' : 'inline after:content-[",_"] last-of-type:after:content-none'}>
23-
<h3 id={typeParameter.name} className="group inline scroll-mt-8 break-words font-mono font-semibold">
24+
<h3
25+
id={typeParameter.name}
26+
className={`${ENV.IS_LOCAL_DEV || ENV.IS_PREVIEW ? 'scroll-mt-16' : 'scroll-mt-8'} group inline break-words font-mono font-semibold`}
27+
>
2428
{description ? <Badges node={typeParameter} /> : null}
2529
<span>
2630
{description ? (

‎packages/actions/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"meilisearch": "^0.37.0",
4949
"p-limit": "^5.0.0",
5050
"tslib": "^2.6.2",
51-
"undici": "6.6.2"
51+
"undici": "6.7.0"
5252
},
5353
"devDependencies": {
5454
"@types/node": "18.18.8",

‎packages/discord.js/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"fast-deep-equal": "3.1.3",
7777
"lodash.snakecase": "4.1.1",
7878
"tslib": "2.6.2",
79-
"undici": "6.6.2",
79+
"undici": "6.7.0",
8080
"ws": "8.16.0"
8181
},
8282
"devDependencies": {

‎packages/docgen/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"commander": "^12.0.0",
6363
"jsdoc-to-markdown": "^8.0.1",
6464
"tslib": "^2.6.2",
65-
"typedoc": "^0.25.9"
65+
"typedoc": "^0.25.10"
6666
},
6767
"devDependencies": {
6868
"@favware/cliff-jumper": "^3.0.0",

‎packages/proxy/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"@discordjs/rest": "workspace:^",
6868
"@discordjs/util": "workspace:^",
6969
"tslib": "^2.6.2",
70-
"undici": "6.6.2"
70+
"undici": "6.7.0"
7171
},
7272
"devDependencies": {
7373
"@discordjs/api-extractor": "workspace:^",

‎packages/rest/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"discord-api-types": "0.37.61",
9191
"magic-bytes.js": "^1.8.0",
9292
"tslib": "^2.6.2",
93-
"undici": "6.6.2"
93+
"undici": "6.7.0"
9494
},
9595
"devDependencies": {
9696
"@discordjs/api-extractor": "workspace:^",

‎packages/scripts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"@vercel/postgres": "^0.7.2",
6868
"commander": "^12.0.0",
6969
"tslib": "^2.6.2",
70-
"undici": "6.6.2",
70+
"undici": "6.7.0",
7171
"yaml": "2.4.0"
7272
},
7373
"devDependencies": {

‎packages/ws/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"tsup": "^8.0.2",
100100
"turbo": "^1.12.4",
101101
"typescript": "^5.3.3",
102-
"undici": "6.6.2",
102+
"undici": "6.7.0",
103103
"vitest": "^1.3.1",
104104
"zlib-sync": "^0.1.9"
105105
},

‎pnpm-lock.yaml

+40-35
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.