Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial commit of gui * initial commit of gui * it renders * pass recipe name * add params * add params * use state for gatsby link * clean up errors * remove recipe test data * refactor gui and remove unused reference * remove welcome message * remove welcome message * clean up imports * use optional chaining * move diff components out * restructure components still in progress * restructure components still in progress * refactor theme ui styling * break out more components * resource message refactor * use optional chaining instead * remove currently unused input stuff * remove currently unused input stuff * work around typeerror * refactor main component and removed unused input stuff * align on gatsby interface version * repin version * needs to be this version of interface * recipes doesn't need interface anymore * clean up theme ui merges * use a fragment * remove fragment * see if removing use of header in recipes page fixes build error * prevent verdaccio from failing * Move the transform code out of the client * transform each step * remove transform from mdx component and not renderer * rendering JS instead of MDX * Move MDX transform to parser and resolve component clashes * remove testing comment * yarn lock * refactor name and run babel shortcode transform always * try and fix linter * fix linting * Revert "fix linting" This reverts commit b90e8d5. * revert commits so we can change on master * comment out test we're not using * Add back validate steps but only check for introduction steps * fix in progress, validate steps is throwing intro error always * add error case back again * use metadata * Grab project root from service lock * Use sitePath instead * remnove comments * don't hardcode API endpoint port * Update packages/gatsby-recipes/src/components/step-renderer.js Co-authored-by: Brent Jackson <jxnblk@gmail.com> * move normalize.css to provider component * Expose StepRenderer as top level component for admin * fixing CLI * Remove li.p component that was causing the bug. We don't need it anyway. Co-authored-by: Laurie Barth <laurie@LauriesrkLaptop.fios-router.home> Co-authored-by: Brent Jackson <jxnblk@gmail.com>
- Loading branch information
1 parent
04c75bb
commit 703678e
Showing
24 changed files
with
882 additions
and
1,184 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
exports.onCreateWebpackConfig = ({ actions }) => { | ||
actions.setWebpackConfig({ | ||
node: { | ||
fs: 'empty' | ||
} | ||
}) | ||
} |
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
77 changes: 77 additions & 0 deletions
77
packages/gatsby-admin/src/components/recipes-gui/code-diff.js
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/** @jsx jsx */ | ||
import ansi2HTML from "ansi-html" | ||
import { getTheme, Heading } from "gatsby-interface" | ||
import { jsx, Styled } from "theme-ui" | ||
|
||
const theme = getTheme() | ||
|
||
ansi2HTML.setColors({ | ||
red: theme.tones.DANGER.medium.slice(1), | ||
green: theme.tones.SUCCESS.medium.slice(1), | ||
yellow: theme.tones.WARNING.medium.slice(1), | ||
}) | ||
|
||
const escapeTags = str => str.replace(/</g, `<`) | ||
|
||
const DiffPre = ({ resourcePlan, ...props }) => ( | ||
<Styled.pre | ||
{...props} | ||
sx={{ | ||
background: theme => theme.tones.BRAND.superLight, | ||
borderRadius: 2, | ||
padding: 4, | ||
}} | ||
dangerouslySetInnerHTML={{ | ||
__html: ansi2HTML(escapeTags(resourcePlan.diff)), | ||
}} | ||
/> | ||
) | ||
|
||
const CodeDiff = ({ resourcePlan, ...props }) => { | ||
if (!resourcePlan.diff) { | ||
return null | ||
} | ||
|
||
if (resourcePlan.resourceName === `File`) { | ||
return ( | ||
<div | ||
sx={{ | ||
background: theme => theme.tones.BRAND.superLight, | ||
border: theme => `1px solid ${theme.tones.BRAND.lighter}`, | ||
borderRadius: 2, | ||
}} | ||
> | ||
<Heading | ||
as="h6" | ||
sx={{ | ||
px: 4, | ||
py: 3, | ||
fontWeight: `normal`, | ||
borderBottom: theme => `1px solid ${theme.tones.BRAND.lighter}`, | ||
}} | ||
> | ||
{resourcePlan.resourceDefinitions.path} | ||
</Heading> | ||
<DiffPre | ||
resourcePlan={resourcePlan} | ||
sx={{ | ||
borderTopLeftRadius: 0, | ||
borderTopRightRadius: 0, | ||
}} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
return ( | ||
<DiffPre | ||
{...props} | ||
resourcePlan={resourcePlan} | ||
sx={{ | ||
border: theme => `1px solid ${theme.tones.BRAND.lighter}`, | ||
}} | ||
/> | ||
) | ||
} | ||
|
||
export default CodeDiff |
Oops, something went wrong.