Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add paramType config to use standard search queries (#161)
Co-authored-by: Michael Taranto <michaeltaranto@users.noreply.github.com>
- Loading branch information
1 parent
80b4583
commit f5ad5ff
Showing
33 changed files
with
427 additions
and
152 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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const withPropTypes = (component) => { | ||
component.propTypes = { | ||
color: PropTypes.oneOf(['red', 'blue']), | ||
children: PropTypes.node, | ||
}; | ||
|
||
return component; | ||
}; | ||
const parent = { | ||
border: '1px solid currentColor', | ||
padding: '10px 10px 10px 15px', | ||
}; | ||
|
||
export const Foo = withPropTypes(({ color = 'black', children }) => ( | ||
<div style={{ color }}> | ||
Foo{children ? <div style={parent}>{children}</div> : null} | ||
</div> | ||
)); | ||
|
||
export const Bar = withPropTypes(({ color = 'black', children }) => ( | ||
<div style={{ color }}> | ||
Bar{children ? <div style={parent}>{children}</div> : null} | ||
</div> | ||
)); |
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,10 @@ | ||
module.exports = { | ||
components: './components', | ||
snippets: './snippets', | ||
themes: './themes', | ||
outputPath: './dist', | ||
openBrowser: false, | ||
paramType: 'search', | ||
port: 9001, | ||
storageKey: 'playroom-example-themed', | ||
}; |
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,3 @@ | ||
{ | ||
"cleanUrls": false | ||
} |
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,22 @@ | ||
export default [ | ||
{ | ||
group: 'Foo', | ||
name: 'Default', | ||
code: '<Foo>Foo</Foo>', | ||
}, | ||
{ | ||
group: 'Foo', | ||
name: 'Red', | ||
code: '<Foo color="red">Red Foo</Foo>', | ||
}, | ||
{ | ||
group: 'Bar', | ||
name: 'Default', | ||
code: '<Bar>Bar</Bar>', | ||
}, | ||
{ | ||
group: 'Bar', | ||
name: 'Blue', | ||
code: '<Bar color="blue">Blue Bar</Bar>', | ||
}, | ||
]; |
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,2 @@ | ||
export const themeOne = { name: 'one' }; | ||
export const themeTwo = { name: 'two' }; |
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,18 +1 @@ | ||
require('./commands'); | ||
const { getFirstFrame } = require('./utils'); | ||
|
||
beforeEach(() => { | ||
cy.visit('http://localhost:9000') | ||
.window() | ||
.then((win) => { | ||
const { storageKey } = win.__playroomConfig__; | ||
indexedDB.deleteDatabase(storageKey); | ||
}) | ||
.reload() | ||
.then(() => | ||
getFirstFrame().then( | ||
($iframe) => | ||
new Cypress.Promise((resolve) => $iframe.on('load', resolve)) | ||
) | ||
); | ||
}); |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.