start converting styleguide-app to elm 0.19

This commit is contained in:
Brooke Angel 2018-12-04 14:36:15 -08:00 committed by Gavin Panella
parent b9d554f189
commit 7bbd4c1739
14 changed files with 548 additions and 301 deletions

View File

@ -12,24 +12,24 @@ checks:
.PHONY: diff
diff: node_modules elm-stuff
if (elm-package diff | tee /dev/stderr | grep -q MAJOR); then echo "MAJOR changes are not allowed!"; exit 1; fi
if (elm diff | tee /dev/stderr | grep -q MAJOR); then echo "MAJOR changes are not allowed!"; exit 1; fi
.PHONY: format
format: node_modules
elm-format --validate src && elm-format --validate --elm-version=0.18 tests styleguide-app
elm-format --validate src && elm-format --validate --elm-version=0.19 tests styleguide-app
.PHONY: clean
clean:
rm -rf node_modules styleguide-app/elm.js styleguide-app/javascript.js $(shell find . -type d -name 'elm-stuff')
documentation.json: node_modules
elm-make --docs $@
elm make --docs $@
styleguide-app/javascript.js: lib/index.js
npx browserify --entry lib/index.js --outfile styleguide-app/javascript.js
styleguide-app/elm.js: styleguide-app/javascript.js styleguide-app/elm-stuff $(shell find src-0.18 styleguide-app -type f -name '*.elm')
cd styleguide-app; elm-make Main.elm --output=$(@F)
styleguide-app/elm.js: styleguide-app/javascript.js $(shell find src styleguide-app -type f -name '*.elm')
cd styleguide-app; elm make Main.elm --output=$(@F)
# plumbing
@ -37,20 +37,10 @@ node_modules: package.json
npm install
touch -m $@
.NOTPARALLEL: elm-stuff
elm-stuff: elm-package.json node_modules
elm-package install --yes
touch -m $@
.NOTPARALLEL: %/elm-stuff
%/elm-stuff: %/elm-package.json node_modules
cd $(@D); elm-package install --yes
touch -m $@
# special targets for travis, but anyone can use them, really.
.PHONY: setup
setup: node_modules elm-stuff tests/elm-stuff styleguide-app/elm-stuff
setup: node_modules
.PHONY: ci
ci: checks test format documentation.json diff styleguide-app/elm.js

View File

@ -58,4 +58,4 @@
"wernerdegroot/listzipper": "3.1.1 <= v < 4.0.0"
},
"test-dependencies": {}
}
}

558
package-lock.json generated
View File

@ -119,12 +119,6 @@
"integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=",
"dev": true
},
"asap": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
"integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=",
"dev": true
},
"asn1": {
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
@ -183,15 +177,6 @@
"integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=",
"dev": true
},
"async": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz",
"integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==",
"dev": true,
"requires": {
"lodash": "^4.17.10"
}
},
"async-each": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz",
@ -328,7 +313,7 @@
},
"binstall": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/binstall/-/binstall-1.2.0.tgz",
"resolved": "http://registry.npmjs.org/binstall/-/binstall-1.2.0.tgz",
"integrity": "sha1-aywPWAuePGB/UO96IqVM6f3I2TM=",
"dev": true,
"requires": {
@ -355,7 +340,7 @@
},
"request": {
"version": "2.79.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz",
"resolved": "http://registry.npmjs.org/request/-/request-2.79.0.tgz",
"integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=",
"dev": true,
"requires": {
@ -433,7 +418,7 @@
"dependencies": {
"combined-stream": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz",
"resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz",
"integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=",
"dev": true,
"requires": {
@ -524,43 +509,6 @@
}
}
},
"bl": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz",
"integrity": "sha1-/cqHGplxOqANGeO7ukHER4emU5g=",
"dev": true,
"requires": {
"readable-stream": "~2.0.5"
},
"dependencies": {
"process-nextick-args": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=",
"dev": true
},
"readable-stream": {
"version": "2.0.6",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz",
"integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=",
"dev": true,
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"isarray": "~1.0.0",
"process-nextick-args": "~1.0.6",
"string_decoder": "~0.10.x",
"util-deprecate": "~1.0.1"
}
},
"string_decoder": {
"version": "0.10.31",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
"dev": true
}
}
},
"block-stream": {
"version": "0.0.9",
"resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz",
@ -707,7 +655,7 @@
},
"browserify-aes": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
"resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
"integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
"dev": true,
"requires": {
@ -744,7 +692,7 @@
},
"browserify-rsa": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz",
"resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz",
"integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=",
"dev": true,
"requires": {
@ -858,7 +806,7 @@
},
"chalk": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": {
@ -1024,7 +972,7 @@
},
"convert-source-map": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz",
"resolved": "http://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz",
"integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=",
"dev": true
},
@ -1052,7 +1000,7 @@
},
"create-hash": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
"resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
"integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==",
"dev": true,
"requires": {
@ -1065,7 +1013,7 @@
},
"create-hmac": {
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
"resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
"integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==",
"dev": true,
"requires": {
@ -1253,7 +1201,7 @@
},
"diffie-hellman": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
"resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
"integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==",
"dev": true,
"requires": {
@ -1303,15 +1251,26 @@
}
},
"elm": {
"version": "0.18.0",
"resolved": "https://registry.npmjs.org/elm/-/elm-0.18.0.tgz",
"integrity": "sha1-kZuDCc2Tnf4v+dJS2WG2yJUJuXA=",
"version": "0.19.0",
"resolved": "https://registry.npmjs.org/elm/-/elm-0.19.0.tgz",
"integrity": "sha512-CYgewByRByMOilPk5/yrW1mtflaS/vp+026gwb0EEX6aqUl+TGYoTSTW+uf44XB/FOKgUauV3TDH3Bl0IHZ8Ag==",
"dev": true,
"requires": {
"mkdirp": "0.5.1",
"promise": "7.1.1",
"request": "2.74.0",
"tar": "2.2.1"
"binwrap": "0.1.4"
},
"dependencies": {
"binwrap": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/binwrap/-/binwrap-0.1.4.tgz",
"integrity": "sha1-yh94cDAiElGPoksHcm+cUKFcdVk=",
"dev": true,
"requires": {
"request": "^2.81.0",
"request-promise": "^4.2.0",
"tar": "^2.2.1",
"unzip": "^0.1.11"
}
}
}
},
"elm-format": {
@ -1369,7 +1328,7 @@
},
"lodash": {
"version": "4.13.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz",
"resolved": "http://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz",
"integrity": "sha1-g+SxCRP0hJbU0W/sSlYK8u50S2g=",
"dev": true
},
@ -1515,7 +1474,7 @@
},
"lodash": {
"version": "4.14.2",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.14.2.tgz",
"resolved": "http://registry.npmjs.org/lodash/-/lodash-4.14.2.tgz",
"integrity": "sha1-u8zOY3OkAPv9CoxnykL20e9BZDI=",
"dev": true
}
@ -1555,14 +1514,14 @@
"dev": true
},
"form-data": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.1.tgz",
"integrity": "sha1-rjFduaSQf6BlUCMEpm13M0de43w=",
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
"integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
"dev": true,
"requires": {
"async": "^2.0.1",
"combined-stream": "^1.0.5",
"mime-types": "^2.1.11"
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
}
},
"fragment-cache": {
@ -1623,8 +1582,7 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"aproba": {
"version": "1.1.1",
@ -1686,7 +1644,6 @@
"version": "0.0.9",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"inherits": "~2.0.0"
}
@ -1695,7 +1652,6 @@
"version": "2.10.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"hoek": "2.x.x"
}
@ -1712,8 +1668,7 @@
"buffer-shims": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"caseless": {
"version": "0.12.0",
@ -1730,14 +1685,12 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"combined-stream": {
"version": "1.0.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"delayed-stream": "~1.0.0"
}
@ -1750,14 +1703,12 @@
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"core-util-is": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"cryptiles": {
"version": "2.0.5",
@ -1777,8 +1728,7 @@
"dependencies": {
"assert-plus": {
"version": "1.0.0",
"bundled": true,
"optional": true
"bundled": true
}
}
},
@ -1791,8 +1741,7 @@
"delayed-stream": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"delegates": {
"version": "1.0.0",
@ -1816,8 +1765,7 @@
"extsprintf": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"forever-agent": {
"version": "0.6.1",
@ -1845,7 +1793,6 @@
"version": "1.0.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"graceful-fs": "^4.1.2",
"inherits": "~2.0.0",
@ -1889,8 +1836,7 @@
"dependencies": {
"assert-plus": {
"version": "1.0.0",
"bundled": true,
"optional": true
"bundled": true
}
}
},
@ -1910,8 +1856,7 @@
"graceful-fs": {
"version": "4.1.11",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"har-schema": {
"version": "1.0.5",
@ -1950,8 +1895,7 @@
"hoek": {
"version": "2.16.3",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"http-signature": {
"version": "1.1.1",
@ -1988,7 +1932,6 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -2002,8 +1945,7 @@
"isarray": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"isstream": {
"version": "0.1.2",
@ -2020,8 +1962,7 @@
},
"jsbn": {
"version": "0.1.1",
"bundled": true,
"optional": true
"bundled": true
},
"json-schema": {
"version": "0.2.3",
@ -2073,14 +2014,12 @@
"mime-db": {
"version": "1.27.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"mime-types": {
"version": "2.1.15",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"mime-db": "~1.27.0"
}
@ -2096,14 +2035,12 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -2154,8 +2091,7 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"oauth-sign": {
"version": "0.8.2",
@ -2213,8 +2149,7 @@
"process-nextick-args": {
"version": "1.0.7",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"punycode": {
"version": "1.4.1",
@ -2250,7 +2185,6 @@
"version": "2.2.9",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"buffer-shims": "~1.0.0",
"core-util-is": "~1.0.0",
@ -2302,8 +2236,7 @@
"safe-buffer": {
"version": "5.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"semver": {
"version": "5.3.0",
@ -2336,7 +2269,6 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -2347,7 +2279,6 @@
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.0.1"
}
@ -2356,7 +2287,6 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@ -2371,7 +2301,6 @@
"version": "2.2.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"block-stream": "*",
"fstream": "^1.0.2",
@ -2405,8 +2334,7 @@
},
"tweetnacl": {
"version": "0.14.5",
"bundled": true,
"optional": true
"bundled": true
},
"uid-number": {
"version": "0.0.6",
@ -2417,8 +2345,7 @@
"util-deprecate": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"uuid": {
"version": "3.0.1",
@ -3003,7 +2930,7 @@
},
"jsonfile": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
"resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
"integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=",
"dev": true,
"requires": {
@ -3122,6 +3049,42 @@
"object-visit": "^1.0.0"
}
},
"match-stream": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/match-stream/-/match-stream-0.0.2.tgz",
"integrity": "sha1-mesFAJOzTf+t5CG5rAtBCpz6F88=",
"dev": true,
"requires": {
"buffers": "~0.1.1",
"readable-stream": "~1.0.0"
},
"dependencies": {
"isarray": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
"dev": true
},
"readable-stream": {
"version": "1.0.34",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
"integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=",
"dev": true,
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"isarray": "0.0.1",
"string_decoder": "~0.10.x"
}
},
"string_decoder": {
"version": "0.10.31",
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
"dev": true
}
}
},
"math-random": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz",
@ -3234,7 +3197,7 @@
},
"mkdirp": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true,
"requires": {
@ -3336,6 +3299,12 @@
}
}
},
"natives": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/natives/-/natives-1.1.6.tgz",
"integrity": "sha512-6+TDFewD4yxY14ptjKaS63GVdtKiES1pTPyxn9Jb0rBqPMZ7VcCiooEhPNsr+mqHtMGxa/5c/HhcC4uPEUw/nA==",
"dev": true
},
"node-elm-compiler": {
"version": "4.3.3",
"resolved": "https://registry.npmjs.org/node-elm-compiler/-/node-elm-compiler-4.3.3.tgz",
@ -3350,18 +3319,12 @@
"dependencies": {
"lodash": {
"version": "4.14.2",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.14.2.tgz",
"resolved": "http://registry.npmjs.org/lodash/-/lodash-4.14.2.tgz",
"integrity": "sha1-u8zOY3OkAPv9CoxnykL20e9BZDI=",
"dev": true
}
}
},
"node-uuid": {
"version": "1.4.8",
"resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz",
"integrity": "sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=",
"dev": true
},
"normalize-path": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
@ -3464,6 +3427,12 @@
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true
},
"over": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/over/-/over-0.0.5.tgz",
"integrity": "sha1-8phS5w/X4l82DgE6jsRMgq7bVwg=",
"dev": true
},
"pako": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz",
@ -3481,7 +3450,7 @@
},
"parse-asn1": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz",
"resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz",
"integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==",
"dev": true,
"requires": {
@ -3592,15 +3561,6 @@
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
"dev": true
},
"promise": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/promise/-/promise-7.1.1.tgz",
"integrity": "sha1-SJZUxpJha4qlWwck+oCbt9tJxb8=",
"dev": true,
"requires": {
"asap": "~2.0.3"
}
},
"pseudomap": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
@ -3615,7 +3575,7 @@
},
"public-encrypt": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.2.tgz",
"resolved": "http://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.2.tgz",
"integrity": "sha512-4kJ5Esocg8X3h8YgJsKAuoesBgB7mqH3eowiDzMUPKiRDDE7E/BqqZD1hnTByIaAFiwAw246YEltSq7tdrOH0Q==",
"dev": true,
"requires": {
@ -3626,6 +3586,44 @@
"randombytes": "^2.0.1"
}
},
"pullstream": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/pullstream/-/pullstream-0.4.1.tgz",
"integrity": "sha1-1vs79a7Wl+gxFQ6xACwlo/iuExQ=",
"dev": true,
"requires": {
"over": ">= 0.0.5 < 1",
"readable-stream": "~1.0.31",
"setimmediate": ">= 1.0.2 < 2",
"slice-stream": ">= 1.0.0 < 2"
},
"dependencies": {
"isarray": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
"dev": true
},
"readable-stream": {
"version": "1.0.34",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
"integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=",
"dev": true,
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"isarray": "0.0.1",
"string_decoder": "~0.10.x"
}
},
"string_decoder": {
"version": "0.10.31",
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
"dev": true
}
}
},
"punycode": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
@ -3633,9 +3631,9 @@
"dev": true
},
"qs": {
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.2.3.tgz",
"integrity": "sha1-HPyyXBCpsrSDBT/zn138kjOQjP4=",
"version": "6.5.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
"dev": true
},
"querystring": {
@ -4043,32 +4041,121 @@
"dev": true
},
"request": {
"version": "2.74.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.74.0.tgz",
"integrity": "sha1-dpPKdou7DqXIzgjAhKRe+gW4kqs=",
"version": "2.88.0",
"resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz",
"integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
"dev": true,
"requires": {
"aws-sign2": "~0.6.0",
"aws4": "^1.2.1",
"bl": "~1.1.2",
"caseless": "~0.11.0",
"combined-stream": "~1.0.5",
"extend": "~3.0.0",
"aws-sign2": "~0.7.0",
"aws4": "^1.8.0",
"caseless": "~0.12.0",
"combined-stream": "~1.0.6",
"extend": "~3.0.2",
"forever-agent": "~0.6.1",
"form-data": "~1.0.0-rc4",
"har-validator": "~2.0.6",
"hawk": "~3.1.3",
"http-signature": "~1.1.0",
"form-data": "~2.3.2",
"har-validator": "~5.1.0",
"http-signature": "~1.2.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.7",
"node-uuid": "~1.4.7",
"oauth-sign": "~0.8.1",
"qs": "~6.2.0",
"stringstream": "~0.0.4",
"tough-cookie": "~2.3.0",
"tunnel-agent": "~0.4.1"
"mime-types": "~2.1.19",
"oauth-sign": "~0.9.0",
"performance-now": "^2.1.0",
"qs": "~6.5.2",
"safe-buffer": "^5.1.2",
"tough-cookie": "~2.4.3",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
},
"dependencies": {
"ajv": {
"version": "6.6.1",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.6.1.tgz",
"integrity": "sha512-ZoJjft5B+EJBjUyu9C9Hc0OZyPZSSlOF+plzouTrg6UlA8f+e/n8NIgBFG/9tppJtpPWfthHakK7juJdNDODww==",
"dev": true,
"requires": {
"fast-deep-equal": "^2.0.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
"dev": true
},
"aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
"integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=",
"dev": true
},
"caseless": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
"dev": true
},
"fast-deep-equal": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
"dev": true
},
"har-validator": {
"version": "5.1.3",
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz",
"integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==",
"dev": true,
"requires": {
"ajv": "^6.5.5",
"har-schema": "^2.0.0"
}
},
"http-signature": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
"dev": true,
"requires": {
"assert-plus": "^1.0.0",
"jsprim": "^1.2.2",
"sshpk": "^1.7.0"
}
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==",
"dev": true
},
"tough-cookie": {
"version": "2.4.3",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",
"integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
"dev": true,
"requires": {
"psl": "^1.1.24",
"punycode": "^1.4.1"
}
},
"tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"dev": true,
"requires": {
"safe-buffer": "^5.0.1"
}
}
}
},
"request-promise": {
@ -4176,9 +4263,15 @@
}
}
},
"setimmediate": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=",
"dev": true
},
"sha.js": {
"version": "2.4.11",
"resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
"resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
"integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
"dev": true,
"requires": {
@ -4188,7 +4281,7 @@
},
"shasum": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz",
"resolved": "http://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz",
"integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=",
"dev": true,
"requires": {
@ -4214,6 +4307,41 @@
"integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=",
"dev": true
},
"slice-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/slice-stream/-/slice-stream-1.0.0.tgz",
"integrity": "sha1-WzO9ZvATsaf4ZGCwPUY97DmtPqA=",
"dev": true,
"requires": {
"readable-stream": "~1.0.31"
},
"dependencies": {
"isarray": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
"dev": true
},
"readable-stream": {
"version": "1.0.34",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
"integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=",
"dev": true,
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"isarray": "0.0.1",
"string_decoder": "~0.10.x"
}
},
"string_decoder": {
"version": "0.10.31",
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
"dev": true
}
}
},
"snapdragon": {
"version": "0.8.2",
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
@ -4540,7 +4668,7 @@
"dependencies": {
"rimraf": {
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz",
"resolved": "http://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz",
"integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=",
"dev": true
}
@ -4548,7 +4676,7 @@
},
"through": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
"resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz",
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
"dev": true
},
@ -4757,6 +4885,67 @@
}
}
},
"unzip": {
"version": "0.1.11",
"resolved": "https://registry.npmjs.org/unzip/-/unzip-0.1.11.tgz",
"integrity": "sha1-iXScY7BY19kNYZ+GuYqhU107l/A=",
"dev": true,
"requires": {
"binary": ">= 0.3.0 < 1",
"fstream": ">= 0.1.30 < 1",
"match-stream": ">= 0.0.2 < 1",
"pullstream": ">= 0.4.1 < 1",
"readable-stream": "~1.0.31",
"setimmediate": ">= 1.0.1 < 2"
},
"dependencies": {
"fstream": {
"version": "0.1.31",
"resolved": "https://registry.npmjs.org/fstream/-/fstream-0.1.31.tgz",
"integrity": "sha1-czfwWPu7vvqMn1YaKMqwhJICyYg=",
"dev": true,
"requires": {
"graceful-fs": "~3.0.2",
"inherits": "~2.0.0",
"mkdirp": "0.5",
"rimraf": "2"
}
},
"graceful-fs": {
"version": "3.0.11",
"resolved": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz",
"integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=",
"dev": true,
"requires": {
"natives": "^1.1.0"
}
},
"isarray": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
"dev": true
},
"readable-stream": {
"version": "1.0.34",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
"integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=",
"dev": true,
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.1",
"isarray": "0.0.1",
"string_decoder": "~0.10.x"
}
},
"string_decoder": {
"version": "0.10.31",
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
"dev": true
}
}
},
"unzip-stream": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/unzip-stream/-/unzip-stream-0.3.0.tgz",
@ -4767,6 +4956,23 @@
"mkdirp": "^0.5.1"
}
},
"uri-js": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
"integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
"dev": true,
"requires": {
"punycode": "^2.1.0"
},
"dependencies": {
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
"dev": true
}
}
},
"urix": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",

View File

@ -26,7 +26,7 @@
"homepage": "https://github.com/NoRedInk/NoRedInk-ui#readme",
"devDependencies": {
"browserify": "16.2.3",
"elm": "0.18.0",
"elm": "0.19.0",
"elm-format": "0.8.1",
"elm-test": "0.18.12"
}

View File

@ -19,11 +19,11 @@ prefixes =
{-| Same as Css.property but vendor prefixed.
-}
property : String -> String -> Css.Style
property prop value =
property prop value_ =
prefixes
|> List.map
(\prefix ->
Css.property (prefix ++ prop) value
Css.property (prefix ++ prop) value_
)
|> Css.batch
@ -31,11 +31,11 @@ property prop value =
{-| Same as Css.property but vendor prefixed.
-}
value : String -> String -> Css.Style
value prop value =
value prop value_ =
prefixes
|> List.map
(\prefix ->
Css.property prop (prefix ++ value)
Css.property prop (prefix ++ value_)
)
|> Css.batch

View File

@ -54,7 +54,6 @@ type alias Assets =
, icons_searchGray_svg : Asset
, icons_selfReviewWhite_svg : Asset
, icons_xBlue_svg : Asset
, icons_xBlue_svg : Asset
, key : String
, leaderboard : String
, leftArrowBlue_png : Asset

View File

@ -58,9 +58,13 @@ value initial =
The first value will be the initial value.
-}
values : List a -> Control a
values choices =
choice (List.map (\x -> ( toString x, value x )) choices)
values : a -> List a -> Control a
values current choices =
let
toControl x =
( Debug.toString x, value x )
in
choice (toControl current) (List.map toControl choices)
{-| A `Control` that wraps another control in a `Maybe`, which a checkbox UI.
@ -70,33 +74,33 @@ and `True` is `Just` with the value of the nested control.
-}
maybe : Bool -> Control a -> Control (Maybe a)
maybe isJust (Control value) =
maybe isJust (Control valu) =
Control
{ currentValue =
if isJust then
Just value.currentValue
Just valu.currentValue
else
Nothing
, allValues =
\() ->
Nothing
:: List.map Just (value.allValues ())
:: List.map Just (valu.allValues ())
, view =
SingleView <|
\() ->
Html.span
[ Html.Attributes.style [ ( "white-space", "nowrap" ) ]
[ Html.Attributes.style "white-space" "nowrap"
]
[ Html.input
[ Html.Attributes.type_ "checkbox"
, Html.Events.onCheck (flip maybe (Control value))
, Html.Events.onCheck (\a -> maybe a (Control valu))
, Html.Attributes.checked isJust
]
[]
, Html.text " "
, if isJust then
view_ (maybe isJust) (Control value)
view_ (maybe isJust) (Control valu)
else
Html.text "Nothing"
@ -107,13 +111,13 @@ maybe isJust (Control value) =
{-| A `Control` that toggles a `Bool` with a checkbox UI.
-}
bool : Bool -> Control Bool
bool value =
bool valu =
Control
{ currentValue = value
{ currentValue = valu
, allValues =
\() ->
[ value
, not value
[ valu
, not valu
]
, view =
SingleView <|
@ -122,11 +126,11 @@ bool value =
[ Html.input
[ Html.Attributes.type_ "checkbox"
, Html.Events.onCheck bool
, Html.Attributes.checked value
, Html.Attributes.checked valu
]
[]
, Html.text " "
, Html.text <| toString value
, Html.text <| Debug.toString valu
]
}
@ -134,12 +138,12 @@ bool value =
{-| A `Control` that allows text input.
-}
string : String -> Control String
string value =
string valu =
Control
{ currentValue = value
{ currentValue = valu
, allValues =
\() ->
[ value
[ valu
, ""
, "short"
, "Longwordyesverylongwithnospacessupercalifragilisticexpialidocious"
@ -149,7 +153,7 @@ string value =
SingleView <|
\() ->
Html.input
[ Html.Attributes.value value
[ Html.Attributes.value valu
, Html.Events.onInput string
]
[]
@ -163,14 +167,9 @@ This will crash if you provide an empty list.
The first entry will be the initial value.
-}
choice : List ( String, Control a ) -> Control a
choice choices =
case choices of
[] ->
Debug.crash "No choices given"
first :: rest ->
choice_ [] first rest
choice : ( String, Control a ) -> List ( String, Control a ) -> Control a
choice =
choice_ []
choice_ :
@ -190,7 +189,7 @@ choice_ left current right =
SingleView <|
\() ->
let
option selected ( label, value ) =
option selected ( label, valu ) =
Html.option
[ Html.Attributes.selected selected ]
[ Html.text label ]
@ -245,6 +244,11 @@ list itemControl =
list_ itemControl 1 0 10
flip : (a -> b -> c) -> b -> a -> c
flip fn param1 param2 =
fn param2 param1
list_ : Control a -> Int -> Int -> Int -> Control (List a)
list_ itemControl current min max =
let
@ -271,7 +275,6 @@ list_ itemControl current min max =
in
Html.map
(String.toInt
>> Result.toMaybe
>> Maybe.withDefault current
>> selectNew
)
@ -280,10 +283,10 @@ list_ itemControl current min max =
[ Html.text ""
, Html.input
[ Html.Attributes.type_ "range"
, Html.Attributes.min <| toString min
, Html.Attributes.max <| toString max
, Html.Attributes.step <| toString 1
, Html.Attributes.attribute "value" <| toString current
, Html.Attributes.min <| Debug.toString min
, Html.Attributes.max <| Debug.toString max
, Html.Attributes.step <| Debug.toString 1
, Html.Attributes.attribute "value" <| Debug.toString current
, Html.Events.on "input" Html.Events.targetValue
]
[]
@ -326,12 +329,12 @@ See [`record`](#record).
-}
field : String -> Control a -> Control (a -> b) -> Control b
field name (Control value) (Control pipeline) =
field name (Control valu) (Control pipeline) =
Control
{ currentValue = pipeline.currentValue value.currentValue
{ currentValue = pipeline.currentValue valu.currentValue
, allValues =
\() ->
value.allValues ()
valu.allValues ()
|> List.concatMap
(\v ->
List.map (\p -> p v)
@ -342,14 +345,14 @@ field name (Control value) (Control pipeline) =
otherFields =
case pipeline.view of
FieldViews fs ->
List.map (Tuple.mapSecond (\x -> \() -> Html.map (field name (Control value)) (x ())))
List.map (Tuple.mapSecond (\x -> \() -> Html.map (field name (Control valu)) (x ())))
fs
_ ->
[]
newView () =
view_ (\v -> field name v (Control pipeline)) (Control value)
view_ (\v -> field name v (Control pipeline)) (Control valu)
in
FieldViews (( name, newView ) :: otherFields)
}
@ -360,8 +363,8 @@ field name (Control value) (Control pipeline) =
map : (a -> b) -> Control a -> Control b
map fn (Control a) =
let
mapTuple ( label, value ) =
( label, map fn value )
mapTuple ( label, valu ) =
( label, map fn valu )
in
Control
{ currentValue = fn a.currentValue
@ -400,13 +403,13 @@ allValues (Control c) =
view : (Control a -> msg) -> Control a -> Html msg
view msg (Control c) =
let
fieldRow ( name, view ) =
fieldRow ( name, column ) =
Html.tr []
[ Html.td
[ Html.Attributes.style [ ( "text-align", "right" ) ] ]
[ Html.Attributes.style "text-align" "right" ]
[ Html.text name ]
, Html.td [] [ Html.text " = " ]
, Html.td [] [ view () ]
, Html.td [] [ column () ]
]
in
Html.div []
@ -417,19 +420,19 @@ view msg (Control c) =
view_ : (Control a -> msg) -> Control a -> Html msg
view_ msg (Control c) =
let
fieldRow ( name, view ) =
fieldRow ( name, column ) =
Html.tr
[ Html.Attributes.style
[ ( "vertical-align", "text-top" ) ]
"vertical-align"
"text-top"
]
[ Html.td [] [ Html.text "," ]
, Html.td
[ Html.Attributes.style
[ ( "text-align", "right" ) ]
[ Html.Attributes.style "text-align" "right"
]
[ Html.text name ]
, Html.td [] [ Html.text " = " ]
, Html.td [] [ view () ]
, Html.td [] [ column () ]
]
in
case c.view of
@ -443,7 +446,8 @@ view_ msg (Control c) =
List.concat
[ [ Html.tr
[ Html.Attributes.style
[ ( "vertical-align", "text-top" ) ]
"vertical-align"
"text-top"
]
[ Html.td [] [ Html.text "{" ] ]
]

View File

@ -11,8 +11,8 @@ import Html.Styled exposing (..)
import Html.Styled.Attributes exposing (css)
import ModuleExample as ModuleExample exposing (Category(..), ModuleExample, ModuleMessages)
import Nri.Ui.AssetPath exposing (Asset)
import Nri.Ui.Button.V5 as Button
import Nri.Ui.Icon.V3 as Icon
import Nri.Ui.Button.V6 as Button
import Nri.Ui.Icon.V4 as Icon
{-| -}
@ -43,7 +43,7 @@ example assets unnamedMessages state =
messages =
unnamedMessages "ButtonExample"
in
{ filename = "Nri.Ui.Button.V5"
{ filename = "Nri.Ui.Button.V7"
, category = Buttons
, content =
[ viewButtonExamples assets messages state ]
@ -58,34 +58,35 @@ init assets =
|> Control.field "icon (copyToClipboard has only one choice)"
(Control.maybe False <|
Control.choice
[ ( "Performance", Control.value (Icon.performance assets) )
, ( "Lock", Control.value (Icon.lock assets) )
( "Performance", Control.value (Icon.performance assets) )
[ ( "Lock", Control.value (Icon.lock assets) )
]
)
|> Control.field "width"
(Control.choice
[ ( "Nri.Ui.Button.V5.WidthExact 120", Control.value <| Button.WidthExact 120 )
, ( "Nri.Ui.Button.V5.WidthExact 70", Control.value <| Button.WidthExact 70 )
, ( "Nri.Ui.Button.V5.WidthUnbounded", Control.value <| Button.WidthUnbounded )
( "Nri.Ui.Button.V7.WidthExact 120", Control.value <| Button.WidthExact 120 )
[ ( "Nri.Ui.Button.V7.WidthExact 70", Control.value <| Button.WidthExact 70 )
, ( "Nri.Ui.Button.V7.WidthUnbounded", Control.value <| Button.WidthUnbounded )
]
)
|> Control.field "button type"
(Control.choice
[ ( "Nri.Ui.Button.V5.button", Control.value Button )
, ( "Nri.Ui.Button.V5.link", Control.value Link )
, ( "Nri.Ui.Button.V5.copyToClipboard", Control.value CopyToClipboard )
( "Nri.Ui.Button.V7.button", Control.value Button )
[ ( "Nri.Ui.Button.V7.link", Control.value Link )
, ( "Nri.Ui.Button.V7.copyToClipboard", Control.value CopyToClipboard )
]
)
|> Control.field "state (button only)"
(Control.choice <|
List.map (\x -> ( toString x, Control.value x ))
[ Button.Enabled
, Button.Disabled
(Control.choice
( Debug.toString Button.Enabled, Control.value Button.Enabled )
(List.map (\x -> ( Debug.toString x, Control.value x ))
[ Button.Disabled
, Button.Error
, Button.Unfulfilled
, Button.Loading
, Button.Success
]
)
)
|> State
@ -123,7 +124,7 @@ viewButtonExamples assets messages (State control) =
in
[ Control.view (State >> SetState >> messages.wrapper) control
|> fromUnstyled
, buttons assets messages sizes model
, buttons assets messages model
, toggleButtons messages
, Button.delete assets
{ label = "Delete Something"
@ -163,10 +164,9 @@ allStyles =
buttons :
{ r | teach_assignments_copyWhite_svg : Asset }
-> ModuleMessages Msg parentMsg
-> List Button.ButtonSize
-> Model
-> Html parentMsg
buttons assets messages sizes model =
buttons assets messages model =
let
exampleRow style =
List.concat
@ -175,7 +175,7 @@ buttons assets messages sizes model =
[ verticalAlign middle
]
]
[ text <| toString style ]
[ text <| Debug.toString style ]
]
, sizes
|> List.map (exampleCell style)
@ -198,7 +198,7 @@ buttons assets messages sizes model =
Button.button
{ size = size
, style = style
, onClick = messages.showItWorked (toString ( style, size ))
, onClick = messages.showItWorked (Debug.toString ( style, size ))
, width = model.width
}
{ label = model.label
@ -222,7 +222,7 @@ buttons assets messages sizes model =
in
List.concat
[ [ sizes
|> List.map (\size -> th [] [ text <| toString size ])
|> List.map (\size -> th [] [ text <| Debug.toString size ])
|> (\cells -> tr [] (th [] [] :: cells))
]
, allStyles

View File

@ -1,28 +1,30 @@
module Main exposing (init, main)
import Html.Styled
import Browser
import Browser.Navigation exposing (Key)
import Model exposing (..)
import Navigation
import NriModules as NriModules
import Routes as Routes exposing (Route(..))
import Update exposing (Msg(..), subscriptions, update)
import Url exposing (Url)
import View exposing (view)
main : Program Never Model Msg
main : Program () Model Msg
main =
Navigation.program
(Routes.fromLocation >> UrlChanged)
Browser.application
{ init = init
, update = update
, subscriptions = subscriptions
, view = view >> Html.Styled.toUnstyled
, view = view
, onUrlRequest = OnUrlRequest
, onUrlChange = OnUrlChange
}
init : Navigation.Location -> ( Model, Cmd Msg )
init location =
( { route = Routes.fromLocation location
init : () -> Url -> Key -> ( Model, Cmd Msg )
init () url _ =
( { route = Routes.fromLocation url
, moduleStates = NriModules.init
}
, Cmd.none

View File

@ -22,8 +22,7 @@ import Examples.TextInput as TextInputExample
import Html exposing (Html, img)
import Html.Attributes exposing (..)
import ModuleExample exposing (Category(..), ModuleExample)
import Navigation
import String.Extra
import Url exposing (Url)
type alias ModuleStates =
@ -74,8 +73,8 @@ type Msg
update : Msg -> ModuleStates -> ( ModuleStates, Cmd Msg )
update msg moduleStates =
case msg of
update outsideMsg moduleStates =
case outsideMsg of
ButtonExampleMsg msg ->
let
( buttonExampleState, cmd ) =
@ -193,7 +192,7 @@ container : Int -> List (Html msg) -> Html msg
container width children =
Html.div
[ Html.Attributes.class "demo-container"
, style [ ( "width", toString width ++ "px" ) ]
, style "width" (Debug.toString width ++ "px")
]
children
@ -229,8 +228,7 @@ exampleMessages exampleMessageWrapper exampleName =
}
route : Navigation.Location -> Maybe String
route : Url -> Maybe String
route location =
location.hash
|> String.dropLeft 1
|> String.Extra.nonEmpty
location.fragment
|> Maybe.map (String.dropLeft 1)

View File

@ -1,8 +1,9 @@
module Routes exposing (Route(..), fromLocation)
import Browser.Navigation as Navigation
import ModuleExample exposing (categoryFromString)
import Navigation
import UrlParser as Url exposing ((</>), custom, s, string, top)
import Url exposing (Url)
import Url.Parser as Url exposing ((</>), custom, s, string, top)
type Route
@ -22,10 +23,10 @@ route =
category : Url.Parser (ModuleExample.Category -> a) a
category =
custom "category" categoryFromString
custom "category" (categoryFromString >> Result.toMaybe)
fromLocation : Navigation.Location -> Route
fromLocation : Url -> Route
fromLocation location =
Url.parseHash route location
Url.parse route location
|> Maybe.withDefault All

View File

@ -1,13 +1,15 @@
module Update exposing (Msg(..), subscriptions, update)
import Browser
import Model exposing (..)
import NriModules as NriModules
import Routes as Routes exposing (Route)
import Url exposing (Url)
type Msg
= UpdateModuleStates NriModules.Msg
| UrlChanged Route
| OnUrlRequest Browser.UrlRequest
| OnUrlChange Url
| NoOp
@ -23,10 +25,13 @@ update action model =
, Cmd.map UpdateModuleStates cmd
)
UrlChanged route ->
( { model | route = route }
, Cmd.none
)
OnUrlRequest request ->
-- TODO
( model, Cmd.none )
OnUrlChange route ->
-- TODO
( model, Cmd.none )
NoOp ->
( model, Cmd.none )

View File

@ -1,5 +1,6 @@
module View exposing (view)
import Browser exposing (Document)
import Css exposing (..)
import Css.Global exposing (Snippet)
import Headings
@ -15,8 +16,13 @@ import Routes as Routes exposing (Route)
import Update exposing (..)
view : Model -> Html Msg
view : Model -> Document Msg
view model =
{ title = "Style Guide", body = [ view_ model |> Html.toUnstyled ] }
view_ : Model -> Html Msg
view_ model =
Html.div []
[ Css.Global.global layoutFixer
, Html.styled Html.div
@ -44,7 +50,7 @@ view model =
[ sectionStyles ]
[]
[ newComponentsLink
, Headings.h2 [ Html.text (toString category) ]
, Headings.h2 [ Html.text (Debug.toString category) ]
, nriThemedModules model.moduleStates
|> List.filter (\doodad -> category == doodad.category)
|> List.map (ModuleExample.view True)
@ -105,7 +111,7 @@ navigation route =
else
color Colors.azure
]
[ Attributes.href <| "#category/" ++ toString category ]
[ Attributes.href <| "#category/" ++ Debug.toString category ]
[ Html.text (categoryForDisplay category) ]
]
in

36
styleguide-app/elm.json Normal file
View File

@ -0,0 +1,36 @@
{
"type": "application",
"source-directories": [
".",
"../src"
],
"elm-version": "0.19.0",
"dependencies": {
"direct": {
"avh4/elm-color": "1.0.0",
"elm/browser": "1.0.1",
"elm/core": "1.0.2",
"elm/html": "1.0.0",
"elm/json": "1.1.2",
"elm/regex": "1.0.0",
"elm/svg": "1.0.1",
"elm/url": "1.0.0",
"elm-community/string-extra": "4.0.0",
"lukewestby/accessible-html-with-css-temp-19": "1.0.0",
"pablohirafuji/elm-markdown": "2.0.5",
"rtfeldman/elm-css": "16.0.0",
"tesk9/accessible-html": "4.0.0",
"wernerdegroot/listzipper": "3.1.1"
},
"indirect": {
"Skinney/murmur3": "2.0.8",
"elm/time": "1.0.0",
"elm/virtual-dom": "1.0.2",
"rtfeldman/elm-hex": "1.0.0"
}
},
"test-dependencies": {
"direct": {},
"indirect": {}
}
}