Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
npm-debug.log
tmp
*~
package-lock.json
8 changes: 4 additions & 4 deletions dist/repl.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/repl.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
},
"dependencies": {
"brace": "^0.9.0",
"jss": "^10.0.0",
"jss-preset-default": "^10.0.0"
"jss": "^10.1.1",
"jss-preset-default": "^10.1.1"
},
"scripts": {
"all": "npm run lint && npm run build",
Expand Down
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ function render() {
const div = document.createElement('div')
div.innerHTML = layout({
classes: sheet.classes,
versions
versions,
})
document.body.appendChild(div)

const inputElem = document.getElementsByClassName(sheet.classes.input)[0]
const input = ace.edit(inputElem)
setupEditor(input, {mode: 'ace/mode/javascript'})


const outputElem = document.getElementsByClassName(sheet.classes.output)[0]
const output = ace.edit(outputElem)
setupEditor(output, {mode: 'ace/mode/css', readonly: true})
Expand All @@ -42,7 +41,7 @@ function setupEditor(editor, options = {}) {
session.setOptions({
tabSize: 2,
useSoftTabs: true,
...options
...options,
})
editor.setTheme('ace/theme/tomorrow')
editor.$blockScrolling = Infinity
Expand All @@ -51,8 +50,9 @@ function setupEditor(editor, options = {}) {
function convert(str) {
/* eslint-disable no-new-func */
try {
const transpiledStr = window.Babel.transform(str, {presets: ['es2015']}).code
return jss.createStyleSheet(evalModule(transpiledStr)).toString()
const transpiledStr = window.Babel.transform(str, {presets: ['es2015']})
.code
return jss.createStyleSheet(evalModule(transpiledStr)).update().toString()
}
catch (err) {
return err.message
Expand Down
175 changes: 101 additions & 74 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@
# yarn lockfile v1


"@babel/runtime@^7.3.1", "@babel/runtime@^7.5.5":
"@babel/runtime@^7.3.1":
version "7.6.0"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.6.0.tgz#4fc1d642a9fd0299754e8b5de62c631cf5568205"
dependencies:
regenerator-runtime "^0.13.2"

"@babel/runtime@^7.8.3":
version "7.9.6"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.9.6.tgz#a9102eb5cadedf3f31d08a9ecf294af7827ea29f"
integrity sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ==
dependencies:
regenerator-runtime "^0.13.4"

abbrev@1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
Expand Down Expand Up @@ -1082,11 +1089,12 @@ crypto-browserify@3.3.0:
ripemd160 "0.2.0"
sha.js "2.2.6"

css-vendor@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/css-vendor/-/css-vendor-2.0.6.tgz#a205f73d7562e8728c86ef6ce5ee7c7e5eefd71b"
css-vendor@^2.0.7:
version "2.0.8"
resolved "https://registry.yarnpkg.com/css-vendor/-/css-vendor-2.0.8.tgz#e47f91d3bd3117d49180a3c935e62e3d9f7f449d"
integrity sha512-x9Aq0XTInxrkuFeHKbYC7zWY8ai7qJ04Kxd9MnvbC1uO5DagxoHQjm4JvG+vCdXOoFtCjbL2XSZfxmoYa9uQVQ==
dependencies:
"@babel/runtime" "^7.5.5"
"@babel/runtime" "^7.8.3"
is-in-browser "^1.0.2"

csstype@^2.6.5:
Expand Down Expand Up @@ -2067,119 +2075,133 @@ jsonpointer@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9"

jss-plugin-camel-case@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/jss-plugin-camel-case/-/jss-plugin-camel-case-10.0.0.tgz#d601bae2e8e2041cc526add289dcd7062db0a248"
jss-plugin-camel-case@10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/jss-plugin-camel-case/-/jss-plugin-camel-case-10.1.1.tgz#8e73ecc4f1d0f8dfe4dd31f6f9f2782588970e78"
integrity sha512-MDIaw8FeD5uFz1seQBKz4pnvDLnj5vIKV5hXSVdMaAVq13xR6SVTVWkIV/keyTs5txxTvzGJ9hXoxgd1WTUlBw==
dependencies:
"@babel/runtime" "^7.3.1"
hyphenate-style-name "^1.0.3"
jss "10.0.0"
jss "10.1.1"

jss-plugin-compose@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/jss-plugin-compose/-/jss-plugin-compose-10.0.0.tgz#6a33566373b9d98b2c086d41b7477d5391b0ec91"
jss-plugin-compose@10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/jss-plugin-compose/-/jss-plugin-compose-10.1.1.tgz#86309068ba33297d5096ffc2482e2d69cd4bb950"
integrity sha512-0fD+YVGk0fVnsLiNf7CG4Lv7lYwmNyeE62Fbccx8k1mMdFoE7he0hpx37tudsfKW2ArCE+hf4fmJDXPW8l6LBw==
dependencies:
"@babel/runtime" "^7.3.1"
jss "10.0.0"
jss "10.1.1"
tiny-warning "^1.0.2"

jss-plugin-default-unit@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/jss-plugin-default-unit/-/jss-plugin-default-unit-10.0.0.tgz#601caf5f576fc0c66986fbe8a9aa37307a3a3ea3"
jss-plugin-default-unit@10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/jss-plugin-default-unit/-/jss-plugin-default-unit-10.1.1.tgz#2df86016dfe73085eead843f5794e3890e9c5c47"
integrity sha512-UkeVCA/b3QEA4k0nIKS4uWXDCNmV73WLHdh2oDGZZc3GsQtlOCuiH3EkB/qI60v2MiCq356/SYWsDXt21yjwdg==
dependencies:
"@babel/runtime" "^7.3.1"
jss "10.0.0"
jss "10.1.1"

jss-plugin-expand@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/jss-plugin-expand/-/jss-plugin-expand-10.0.0.tgz#ab6a3fac5925267c9d25119aa51de7756b4ff8d8"
jss-plugin-expand@10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/jss-plugin-expand/-/jss-plugin-expand-10.1.1.tgz#ed3f28b0bbe8105230d34af720fe645e4f37e5d0"
integrity sha512-ITO3RR4eTB3628B+gx8gLI7TKKE0TsFDBJ7BA648ZhXjHWQ5uxdC1bZld+++xnFL1l4kerj5tuWmZxS64C1Kcg==
dependencies:
"@babel/runtime" "^7.3.1"
jss "10.0.0"
jss "10.1.1"

jss-plugin-extend@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/jss-plugin-extend/-/jss-plugin-extend-10.0.0.tgz#0ce24831b41b622ae3f0f29a519200e864fd303c"
jss-plugin-extend@10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/jss-plugin-extend/-/jss-plugin-extend-10.1.1.tgz#254999b7313055a127a9743480d32fb185de0c24"
integrity sha512-dZl0hNsndP9GJM6yqA7lZmnx6KJHo/13Zeo5B3i2uaDNO9jd5Y3pp1XHURGfbFG3K29XsYBQPTgfBwQ7e7+nyA==
dependencies:
"@babel/runtime" "^7.3.1"
jss "10.0.0"
jss "10.1.1"
tiny-warning "^1.0.2"

jss-plugin-global@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/jss-plugin-global/-/jss-plugin-global-10.0.0.tgz#0fed1b6461e0d57d6e394f877529009bc1cb3cb6"
jss-plugin-global@10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/jss-plugin-global/-/jss-plugin-global-10.1.1.tgz#36b0d6d9facb74dfd99590643708a89260747d14"
integrity sha512-VBG3wRyi3Z8S4kMhm8rZV6caYBegsk+QnQZSVmrWw6GVOT/Z4FA7eyMu5SdkorDlG/HVpHh91oFN56O4R9m2VA==
dependencies:
"@babel/runtime" "^7.3.1"
jss "10.0.0"
jss "10.1.1"

jss-plugin-nested@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/jss-plugin-nested/-/jss-plugin-nested-10.0.0.tgz#d37ecc013c3b0d0e4acc2b48f6b62da6ae53948b"
jss-plugin-nested@10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/jss-plugin-nested/-/jss-plugin-nested-10.1.1.tgz#5c3de2b8bda344de1ebcef3a4fd30870a29a8a8c"
integrity sha512-ozEu7ZBSVrMYxSDplPX3H82XHNQk2DQEJ9TEyo7OVTPJ1hEieqjDFiOQOxXEj9z3PMqkylnUbvWIZRDKCFYw5Q==
dependencies:
"@babel/runtime" "^7.3.1"
jss "10.0.0"
jss "10.1.1"
tiny-warning "^1.0.2"

jss-plugin-props-sort@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/jss-plugin-props-sort/-/jss-plugin-props-sort-10.0.0.tgz#38a13407384c2a4a7c026659488350669b953b18"
jss-plugin-props-sort@10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/jss-plugin-props-sort/-/jss-plugin-props-sort-10.1.1.tgz#34bddcbfaf9430ec8ccdf92729f03bb10caf1785"
integrity sha512-g/joK3eTDZB4pkqpZB38257yD4LXB0X15jxtZAGbUzcKAVUHPl9Jb47Y7lYmiGsShiV4YmQRqG1p2DHMYoK91g==
dependencies:
"@babel/runtime" "^7.3.1"
jss "10.0.0"
jss "10.1.1"

jss-plugin-rule-value-function@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/jss-plugin-rule-value-function/-/jss-plugin-rule-value-function-10.0.0.tgz#3ec1b781b7c86080136dbef6c36e91f20244b72e"
jss-plugin-rule-value-function@10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/jss-plugin-rule-value-function/-/jss-plugin-rule-value-function-10.1.1.tgz#be00dac6fc394aaddbcef5860b9eca6224d96382"
integrity sha512-ClV1lvJ3laU9la1CUzaDugEcwnpjPTuJ0yGy2YtcU+gG/w9HMInD5vEv7xKAz53Bk4WiJm5uLOElSEshHyhKNw==
dependencies:
"@babel/runtime" "^7.3.1"
jss "10.0.0"
jss "10.1.1"

jss-plugin-rule-value-observable@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/jss-plugin-rule-value-observable/-/jss-plugin-rule-value-observable-10.0.0.tgz#1e801cbd35f29d08a6184bb073b2565376319e1e"
jss-plugin-rule-value-observable@10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/jss-plugin-rule-value-observable/-/jss-plugin-rule-value-observable-10.1.1.tgz#c4552167f7b84395fbbe77344f5b6186bdd51235"
integrity sha512-l1zmLfS5Ks6CrthOIVTokHkDoI01ymnwNBlciN+IlaR4UsLEQBBL0+3BfQjOPvIYRAYXxYx3G7ebUHebr8mWyA==
dependencies:
"@babel/runtime" "^7.3.1"
jss "10.0.0"
jss "10.1.1"
symbol-observable "^1.2.0"

jss-plugin-template@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/jss-plugin-template/-/jss-plugin-template-10.0.0.tgz#b656c95ef3994a78e1bcc7f177818b31f8015d34"
jss-plugin-template@10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/jss-plugin-template/-/jss-plugin-template-10.1.1.tgz#1153a58b1ee7de122e3f46223c041b5f808f2924"
integrity sha512-CPhNapLDgj6gIJOi3vj/QPohF/1OHuLQj8ZjBYqrnzCDSfYV5s2Rzp1TicFGxUb07BRLh62ymU+MgH1hbKGSTQ==
dependencies:
"@babel/runtime" "^7.3.1"
jss "10.0.0"
jss "10.1.1"
tiny-warning "^1.0.2"

jss-plugin-vendor-prefixer@10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/jss-plugin-vendor-prefixer/-/jss-plugin-vendor-prefixer-10.0.0.tgz#400280535b0f483a9c78105afe4eee61b70018eb"
jss-plugin-vendor-prefixer@10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/jss-plugin-vendor-prefixer/-/jss-plugin-vendor-prefixer-10.1.1.tgz#8348b20749f790beebab3b6a8f7075b07c2cfcfd"
integrity sha512-09MZpQ6onQrhaVSF6GHC4iYifQ7+4YC/tAP6D4ZWeZotvCMq1mHLqNKRIaqQ2lkgANjlEot2JnVi1ktu4+L4pw==
dependencies:
"@babel/runtime" "^7.3.1"
css-vendor "^2.0.6"
jss "10.0.0"
css-vendor "^2.0.7"
jss "10.1.1"

jss-preset-default@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/jss-preset-default/-/jss-preset-default-10.0.0.tgz#ea6941b453f70f300087889ff5d81d010bfbf7e3"
jss-preset-default@^10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/jss-preset-default/-/jss-preset-default-10.1.1.tgz#71f3108398ed04e2bed598a7b3accb7cb3c9ddcd"
integrity sha512-YwQp/BZ8IiBwxDTQ4uPAjzI2k2njrw6RJegAPvhCB1MTmWN2oR9Dhb5aN3RtepUf/agUkewTMwQqoS6PijgVMg==
dependencies:
"@babel/runtime" "^7.3.1"
jss "10.0.0"
jss-plugin-camel-case "10.0.0"
jss-plugin-compose "10.0.0"
jss-plugin-default-unit "10.0.0"
jss-plugin-expand "10.0.0"
jss-plugin-extend "10.0.0"
jss-plugin-global "10.0.0"
jss-plugin-nested "10.0.0"
jss-plugin-props-sort "10.0.0"
jss-plugin-rule-value-function "10.0.0"
jss-plugin-rule-value-observable "10.0.0"
jss-plugin-template "10.0.0"
jss-plugin-vendor-prefixer "10.0.0"

jss@10.0.0, jss@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/jss/-/jss-10.0.0.tgz#998d5026c02accae15708de83bd6ba57bac977d2"
jss "10.1.1"
jss-plugin-camel-case "10.1.1"
jss-plugin-compose "10.1.1"
jss-plugin-default-unit "10.1.1"
jss-plugin-expand "10.1.1"
jss-plugin-extend "10.1.1"
jss-plugin-global "10.1.1"
jss-plugin-nested "10.1.1"
jss-plugin-props-sort "10.1.1"
jss-plugin-rule-value-function "10.1.1"
jss-plugin-rule-value-observable "10.1.1"
jss-plugin-template "10.1.1"
jss-plugin-vendor-prefixer "10.1.1"

jss@10.1.1, jss@^10.1.1:
version "10.1.1"
resolved "https://registry.yarnpkg.com/jss/-/jss-10.1.1.tgz#450b27d53761af3e500b43130a54cdbe157ea332"
integrity sha512-Xz3qgRUFlxbWk1czCZibUJqhVPObrZHxY3FPsjCXhDld4NOj1BgM14Ir5hVm+Qr6OLqVljjGvoMcCdXNOAbdkQ==
dependencies:
"@babel/runtime" "^7.3.1"
csstype "^2.6.5"
Expand Down Expand Up @@ -2826,6 +2848,11 @@ regenerator-runtime@^0.13.2:
version "0.13.3"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz#7cf6a77d8f5c6f60eb73c5fc1955b2ceb01e6bf5"

regenerator-runtime@^0.13.4:
version "0.13.5"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz#d878a1d094b4306d10b9096484b33ebd55e26697"
integrity sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==

regenerator-transform@^0.10.0:
version "0.10.1"
resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd"
Expand Down