-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from BlizzBolts/dev
Releasing v0.8.3
- Loading branch information
Showing
11 changed files
with
42 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
|
||
import styled from 'styled-components' | ||
import styled from "styled-components"; | ||
|
||
export const StyledSandBox = styled.div` | ||
:hover .bottom-tools { | ||
:hover .iframe-tools { | ||
visibility: visible; | ||
} | ||
` | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,6 @@ | ||
import { visit } from 'unist-util-visit'; | ||
import { Plugin } from 'unified'; | ||
import { Link, Text } from 'mdast'; | ||
import { ResolvedUserConfig, ResolvedComponentProps } from '../../types.js'; | ||
import { tableMaker, parseApi, logger } from '../../utils/index.js'; | ||
import { select } from 'unist-util-select'; | ||
import path from 'path'; | ||
import { isEmpty } from 'lodash-es'; | ||
|
||
const { t, r, c } = tableMaker; | ||
import { Plugin } from "unified"; | ||
import { ResolvedUserConfig } from "../../types.js"; | ||
|
||
export const debug = (config: ResolvedUserConfig): Plugin => { | ||
return (ast) => { | ||
const heading = r([ | ||
c('属性'), | ||
c('类型'), | ||
c('默认值'), | ||
c('必填'), | ||
c('描述'), | ||
]); | ||
visit(ast, 'link', (link: Link, index, parent) => { | ||
const text = select('text', link) as Text; | ||
|
||
if (!link || !text) { | ||
return; | ||
} | ||
|
||
if (text.value.toLowerCase() === 'props' && link.url) { | ||
const componentPath = path.resolve(config.docs, link.url); | ||
const start = performance.now(); | ||
const parsedProps: ResolvedComponentProps[] = parseApi( | ||
componentPath | ||
).filter((o) => !isEmpty(o.props)); | ||
const tables = parsedProps.map((o) => { | ||
return t([ | ||
heading, | ||
...o.props?.map((p) => { | ||
return r([ | ||
c(p.name || '-'), | ||
c(p.type || '-'), | ||
c(p.defaultValue || '-'), | ||
c(p.isRequired ? '是' : '否'), | ||
c(p.description || '-'), | ||
]); | ||
}), | ||
]); | ||
}); | ||
const end = performance.now(); | ||
|
||
logger.info(`Parsing ${link.url} used ${end - start}ms`); | ||
parent.children = tables; | ||
} | ||
}); | ||
}; | ||
return (ast) => {}; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.