-
Notifications
You must be signed in to change notification settings - Fork 45
feat: new JSV design #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Parent:
feat: v4 stable release
Merged
feat: new JSV design #103
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4ebc0f9
feat: new design
6c7902e
feat: move to mosaic
1efbe1c
fix: simplify vlidations and address review
8faa3b7
fix: scrolling and divider
bccb846
fix: dark mode
0a1f443
fix: tests
912bab8
fix: icon typing
ca06c5d
fix: linting
c77f451
test: update
9feccb7
chore: cleanup
716278a
feat: use interactive mode
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,18 +1,19 @@ | ||
| import { MarkdownViewer } from '@stoplight/markdown-viewer'; | ||
| import { Popover } from '@stoplight/ui-kit'; | ||
| import { Box } from '@stoplight/mosaic'; | ||
| import * as React from 'react'; | ||
|
|
||
| export const Description: React.FunctionComponent<{ value: string }> = ({ value }) => ( | ||
| <Popover | ||
| boundary="window" | ||
| interactionKind="hover" | ||
| className="ml-2 flex-1 truncate flex items-baseline" | ||
| target={<div className="text-darken-7 dark:text-lighten-7 w-full truncate">{value}</div>} | ||
| className="flex-1 truncate flex items-baseline" | ||
marcelltoth marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| target={<Box className="text-darken-7 dark:text-lighten-7 w-full truncate">{value}</Box>} | ||
marcelltoth marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| targetClassName="text-darken-7 dark:text-lighten-6 w-full truncate" | ||
| content={ | ||
| <div className="p-5" style={{ maxHeight: 500, maxWidth: 400 }}> | ||
| <Box p={5} style={{ maxHeight: 500, maxWidth: 400 }}> | ||
| <MarkdownViewer markdown={value} /> | ||
| </div> | ||
| </Box> | ||
| } | ||
| /> | ||
| ); | ||
This file contains hidden or 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,11 +1,12 @@ | ||
| import { SchemaCombinerName } from '@stoplight/json-schema-tree'; | ||
| import { Box, Flex } from '@stoplight/mosaic'; | ||
| import * as React from 'react'; | ||
|
|
||
| import { COMBINER_PRETTY_NAMES } from '../../consts'; | ||
|
|
||
| export const Divider: React.FunctionComponent<{ kind: SchemaCombinerName }> = ({ kind }) => ( | ||
| <div className="flex items-center w-full absolute" style={{ top: -9, height: 1 }}> | ||
| <div className="text-darken-7 dark:text-lighten-8 uppercase text-xs pr-2 -ml-4">{COMBINER_PRETTY_NAMES[kind]}</div> | ||
| <div className="flex-1 bg-darken-5 dark:bg-lighten-5" style={{ height: 1 }} /> | ||
marcelltoth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </div> | ||
| export const Divider: React.FunctionComponent<{ kind?: SchemaCombinerName, style?: React.CSSProperties }> = ({ kind, style }) => ( | ||
| <Flex align="center" className="w-full absolute" style={{ ...style, ...(kind && { top: -9 }), height: 1 }}> | ||
marcelltoth marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| {kind && <Box pr={2} ml={-4} className="text-darken-7 dark:text-lighten-8 uppercase text-xs">{COMBINER_PRETTY_NAMES[kind]}</Box>} | ||
| {!kind && <Box flex={1} className="bg-darken-5 dark:bg-lighten-5" style={{ height: 1 }} />} | ||
| </Flex> | ||
| ); | ||
This file contains hidden or 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,22 +1,14 @@ | ||
| import { isRegularNode, RegularNode } from '@stoplight/json-schema-tree'; | ||
| import { isRegularNode } from '@stoplight/json-schema-tree'; | ||
| import cn from 'classnames'; | ||
| import * as React from 'react'; | ||
|
|
||
| import { PROPERTY_TYPE_COLORS } from '../../consts'; | ||
| import { useSchemaNode } from '../../hooks/useSchemaNode'; | ||
|
|
||
| function matchPropertyColor(node: RegularNode): string | null { | ||
| if (node.types === null || node.types.length !== 1) return null; | ||
|
|
||
| return PROPERTY_TYPE_COLORS[node.types[0]]; | ||
| } | ||
|
|
||
| export const Format: React.FunctionComponent = () => { | ||
| const schemaNode = useSchemaNode(); | ||
|
|
||
| if (!isRegularNode(schemaNode) || schemaNode.format === null) { | ||
| return null; | ||
| } | ||
|
|
||
| return <span className={cn('ml-2', matchPropertyColor(schemaNode))}>{`<${schemaNode.format}>`}</span>; | ||
| return <span className={cn('ml-2', 'text-gray-5 dark:text-gray-3')}>{`<${schemaNode.format}>`}</span>; | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.