Skip to content

Commit

Permalink
fix theme injection
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed May 31, 2018
1 parent 7cd1432 commit 25e8486
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/graphql-playground-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"graphql-config-extension-graphcool": "1.0.8",
"graphql-config-extension-prisma": "^0.0.12",
"graphql-playground-html": "^1.5.6",
"graphql-playground-react": "1.7.0-beta.1",
"graphql-playground-react": "1.7.0-beta.2",
"immutable": "4.0.0-rc.9",
"js-yaml": "^3.11.0",
"lodash.merge": "^4.6.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/graphql-playground-electron/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3778,9 +3778,9 @@ graphql-playground-html@^1.5.6:
dependencies:
graphql-config "2.0.0"

[email protected].1:
version "1.7.0-beta.1"
resolved "https://registry.yarnpkg.com/graphql-playground-react/-/graphql-playground-react-1.7.0-beta.1.tgz#992260c6f957989bc99fc43b2ebcc43800ec323d"
[email protected].2:
version "1.7.0-beta.2"
resolved "https://registry.yarnpkg.com/graphql-playground-react/-/graphql-playground-react-1.7.0-beta.2.tgz#158399b7075ed8d7c801e085527c31845dc396ee"
dependencies:
apollo-link "^1.0.7"
apollo-link-http "^1.3.2"
Expand Down
25 changes: 25 additions & 0 deletions packages/graphql-playground-html/src/render-playground-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface MiddlewareOptions {
settings?: ISettings
schema?: IntrospectionResult
tabs?: Tab[]
codeTheme?: EditorColours
}

export type Theme = 'dark' | 'light'
Expand All @@ -23,6 +24,30 @@ export interface ISettings {
'request.credentials': string
}

export interface EditorColours {
property: string
comment: string
punctuation: string
keyword: string
def: string
qualifier: string
attribute: string
number: string
string: string
builtin: string
string2: string
variable: string
meta: string
atom: string
ws: string
selection: string
cursorColor: string
editorBackground: string
resultBackground: string
leftDrawerBackground: string
rightDrawerBackground: string
}

export interface IntrospectionResult {
__schema: any
}
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-playground-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graphql-playground-react",
"version": "1.7.0-beta.2",
"version": "1.7.0",
"main": "./lib/lib.js",
"typings": "./lib/lib.d.ts",
"description": "GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-playground-react/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

npm publish
#npm publish

curl -X POST \
http://purge.jsdelivr.net/ \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,10 @@ class PlaygroundWrapper extends React.Component<
...styledTheme,
mode: theme,
colours: theme === 'dark' ? darkColours : lightColours,
editorColours:
this.props.codeTheme ||
(theme === 'dark' ? darkEditorColours : lightEditorColours),
editorColours: {
...(theme === 'dark' ? darkEditorColours : lightEditorColours),
...this.props.codeTheme,
},
settings: this.props.settings,
}}
>
Expand Down

0 comments on commit 25e8486

Please sign in to comment.