mirror of
https://github.com/zoriya/v10.git
synced 2026-08-09 23:58:06 +00:00
fix(site): review cleanup for API reference pages (#685)
- Remove unused BasicUsage demos for time-slider and volume-slider - Strip leading `--` from CSS var names in CSSVarRow ids - Fix dead anchor links in MDX styling sections - Add comments on usesDataAttrs heuristic and type stripping Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
8ab596ea30
commit
286243746e
@@ -309,6 +309,7 @@ function instantiatesCore(filePath: string): boolean {
|
||||
}
|
||||
}
|
||||
|
||||
/** String search heuristic — a comment containing `stateAttrMap` would also match. */
|
||||
function usesDataAttrs(filePath: string): boolean {
|
||||
try {
|
||||
return fs.readFileSync(filePath, 'utf-8').includes('stateAttrMap');
|
||||
|
||||
@@ -94,6 +94,7 @@ export function extractSubPartProps(filePath: string, program: ts.Program, local
|
||||
if (name === 'children' || !member.type) continue;
|
||||
|
||||
let typeStr = checker.typeToString(checker.getTypeFromTypeNode(member.type));
|
||||
// Only strips trailing ` | undefined`; other orderings (e.g., `undefined | string`) pass through.
|
||||
if (member.questionToken) typeStr = typeStr.replace(/ \| undefined$/, '');
|
||||
|
||||
const propDef: PropDef = { type: typeStr };
|
||||
|
||||
Reference in New Issue
Block a user