Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
a5ff175913 | |||
f84e7c48ae | |||
185d9ff957 | |||
6145bd66dc | |||
d58272a604 | |||
68ca1e8906 | |||
7023888f38 | |||
1356666700 | |||
b436fe77b0 | |||
3de788bb75 | |||
d50e320f17 | |||
a7532c8816 | |||
2d5944cdd7 | |||
5a8527068a |
1
license
1
license
@ -1,4 +1,5 @@
|
||||
Copyright (c) 2020 Lossless GmbH (hello@lossless.com)
|
||||
Copyright (c) 2017 Nathan Friend (ts-keycode-enum)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
162
package-lock.json
generated
162
package-lock.json
generated
@ -1,16 +1,16 @@
|
||||
{
|
||||
"name": "@designestate/dees-domtools",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.11",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@designestate/dees-domtools",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.11",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest": "^2.0.0",
|
||||
"@designestate/dees-comms": "^1.0.16",
|
||||
"@apiglobal/typedrequest": "^2.0.3",
|
||||
"@designestate/dees-comms": "^1.0.22",
|
||||
"@pushrocks/lik": "^5.0.4",
|
||||
"@pushrocks/smartdelay": "^2.0.13",
|
||||
"@pushrocks/smartpromise": "^3.1.7",
|
||||
@ -20,12 +20,12 @@
|
||||
"@pushrocks/webrequest": "^3.0.3",
|
||||
"@pushrocks/websetup": "^3.0.16",
|
||||
"@pushrocks/webstore": "^1.0.18",
|
||||
"lit": "^2.2.1",
|
||||
"lit": "^2.2.2",
|
||||
"sweet-scroll": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.61",
|
||||
"@gitzone/tsbundle": "^1.0.101",
|
||||
"@gitzone/tsbundle": "^1.0.102",
|
||||
"@gitzone/tstest": "^1.0.70",
|
||||
"@pushrocks/tapbundle": "^5.0.3",
|
||||
"@types/node": "^17.0.23",
|
||||
@ -47,9 +47,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@apiglobal/typedrequest": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/@apiglobal%2ftypedrequest/-/typedrequest-2.0.0.tgz",
|
||||
"integrity": "sha512-dpgBO9kVC+n8sTBuUfmlc30k2exvZwYR8t40Svk3/rKtp6oxVFUXVNtdP+eoHb2ODihafmz3UV0fr4Tkpwh1kA==",
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://verdaccio.lossless.one/@apiglobal%2ftypedrequest/-/typedrequest-2.0.3.tgz",
|
||||
"integrity": "sha512-bRXiv3OwPh4uA4ete9maHXyF3CMNz8rc81r41DBeYzscaadKlQSK0ewOBLQjjZ2MBWDAGR0NbGBEaJJrXqYS0w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest-interfaces": "^1.0.15",
|
||||
@ -1816,42 +1816,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@designestate/dees-comms": {
|
||||
"version": "1.0.16",
|
||||
"resolved": "https://verdaccio.lossless.one/@designestate%2fdees-comms/-/dees-comms-1.0.16.tgz",
|
||||
"integrity": "sha512-Y38dn+rXRo6PwgBuqMzbUKj8p5nFu58aFrnQQV+HxcXq4TC2xtGuNBR3RDXeYfVOhaiTuQaKYYi8f9X1/2rUJQ==",
|
||||
"version": "1.0.22",
|
||||
"resolved": "https://verdaccio.lossless.one/@designestate%2fdees-comms/-/dees-comms-1.0.22.tgz",
|
||||
"integrity": "sha512-zZ2AwCy49sj1fNyeSMtAxcN4qAGiP5+OjJCtY88YjrNbvD83v4GZpjci0nFUPuvOkCoeo18Uw8xgZSDy8lc59Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest": "^1.0.65",
|
||||
"@apiglobal/typedrequest": "^2.0.3",
|
||||
"@apiglobal/typedrequest-interfaces": "^1.0.15",
|
||||
"@pushrocks/smartdelay": "^2.0.13",
|
||||
"broadcast-channel": "^3.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@designestate/dees-comms/node_modules/@apiglobal/typedrequest": {
|
||||
"version": "1.0.67",
|
||||
"resolved": "https://verdaccio.lossless.one/@apiglobal%2ftypedrequest/-/typedrequest-1.0.67.tgz",
|
||||
"integrity": "sha512-f8DiYAv9ci7jgs39Q3kb64aII3TtWL+vYSYB+38wtvldXW3YY+Ub/wdur0/15yt/0EYzx9JLqLfylyDHZ7zyMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest-interfaces": "^1.0.15",
|
||||
"@pushrocks/isounique": "^1.0.4",
|
||||
"@pushrocks/lik": "^5.0.0",
|
||||
"@pushrocks/smartdelay": "^2.0.13",
|
||||
"@pushrocks/smartpromise": "^3.1.6",
|
||||
"@pushrocks/webrequest": "^2.0.13"
|
||||
}
|
||||
},
|
||||
"node_modules/@designestate/dees-comms/node_modules/@pushrocks/webrequest": {
|
||||
"version": "2.0.15",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fwebrequest/-/webrequest-2.0.15.tgz",
|
||||
"integrity": "sha512-75aaLAMmyBlHvoEABANJUxcjoVLv4TEH3B9TLMi7jdx8UePFfZmbtymKfkpHO0gu3Q60dqRJowp/DWVl0sR/gg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pushrocks/smartdelay": "^2.0.13",
|
||||
"@pushrocks/smartenv": "^4.0.16",
|
||||
"@pushrocks/smartjson": "^4.0.6",
|
||||
"node-fetch": "^2.6.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@gitzone/tsbuild": {
|
||||
"version": "2.1.61",
|
||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbuild/-/tsbuild-2.1.61.tgz",
|
||||
@ -1880,9 +1855,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@gitzone/tsbundle": {
|
||||
"version": "1.0.101",
|
||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbundle/-/tsbundle-1.0.101.tgz",
|
||||
"integrity": "sha512-OJlcZZofnSQX3ZnWv7UH51dyyyYN/n36zEzvEHszIcpb22cKHEqI9tQqqsTXo6bxJeA8lOmkJzu7wsVAwP9i1Q==",
|
||||
"version": "1.0.102",
|
||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbundle/-/tsbundle-1.0.102.tgz",
|
||||
"integrity": "sha512-3DyYTEM/dXG43LqerBsvF/oNHSvsH117qAvLpKNMP71SSLmpqqSxYdXU3HTQGjOW9S6ejkTeuJE9HkzOix+6nQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@ -3585,22 +3560,6 @@
|
||||
"@pushrocks/smartpromise": "^3.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/@pushrocks/smartenv": {
|
||||
"version": "4.0.16",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartenv/-/smartenv-4.0.16.tgz",
|
||||
"integrity": "sha512-NwYMONDc/NjY6BGvzZzLMteF83kPQTF9BCGfqWbktUUruEtdqL+nGw6ecoLFi2b5u7XPb8jK1TKIcSvpNJ7SyA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"@types/node": "^14.11.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@pushrocks/smartenv/node_modules/@types/node": {
|
||||
"version": "14.17.15",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.17.15.tgz",
|
||||
"integrity": "sha512-D1sdW0EcSCmNdLKBGMYb38YsHUS6JcM7yQ6sLQ9KuZ35ck7LYCKE7kYFHOO59ayFOY3zobWVZxf4KXhYHcHYFA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@pushrocks/smarterror": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarterror/-/smarterror-2.0.1.tgz",
|
||||
@ -8021,9 +7980,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lit": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://verdaccio.lossless.one/lit/-/lit-2.2.1.tgz",
|
||||
"integrity": "sha512-dSe++R50JqrvNGXmI9OE13de1z5U/Y3J2dTm/9GC86vedI8ILoR8ZGnxfThFpvQ9m0lR0qRnIR4IiKj/jDCfYw==",
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://verdaccio.lossless.one/lit/-/lit-2.2.2.tgz",
|
||||
"integrity": "sha512-eN3+2QRHn/erxYB88AXiiRgQA6RltE9MhzySCwX+ACOxA/MLWN3VdXvcbZD9PN09zmUwlgzDvW3T84YWj2Sa0A==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"@lit/reactive-element": "^1.3.0",
|
||||
@ -8532,6 +8491,7 @@
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://verdaccio.lossless.one/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
@ -8552,18 +8512,21 @@
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://verdaccio.lossless.one/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/node-fetch/node_modules/webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://verdaccio.lossless.one/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause"
|
||||
},
|
||||
"node_modules/node-fetch/node_modules/whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"tr46": "~0.0.3",
|
||||
@ -11550,9 +11513,9 @@
|
||||
}
|
||||
},
|
||||
"@apiglobal/typedrequest": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/@apiglobal%2ftypedrequest/-/typedrequest-2.0.0.tgz",
|
||||
"integrity": "sha512-dpgBO9kVC+n8sTBuUfmlc30k2exvZwYR8t40Svk3/rKtp6oxVFUXVNtdP+eoHb2ODihafmz3UV0fr4Tkpwh1kA==",
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://verdaccio.lossless.one/@apiglobal%2ftypedrequest/-/typedrequest-2.0.3.tgz",
|
||||
"integrity": "sha512-bRXiv3OwPh4uA4ete9maHXyF3CMNz8rc81r41DBeYzscaadKlQSK0ewOBLQjjZ2MBWDAGR0NbGBEaJJrXqYS0w==",
|
||||
"requires": {
|
||||
"@apiglobal/typedrequest-interfaces": "^1.0.15",
|
||||
"@pushrocks/isounique": "^1.0.5",
|
||||
@ -12712,39 +12675,14 @@
|
||||
}
|
||||
},
|
||||
"@designestate/dees-comms": {
|
||||
"version": "1.0.16",
|
||||
"resolved": "https://verdaccio.lossless.one/@designestate%2fdees-comms/-/dees-comms-1.0.16.tgz",
|
||||
"integrity": "sha512-Y38dn+rXRo6PwgBuqMzbUKj8p5nFu58aFrnQQV+HxcXq4TC2xtGuNBR3RDXeYfVOhaiTuQaKYYi8f9X1/2rUJQ==",
|
||||
"version": "1.0.22",
|
||||
"resolved": "https://verdaccio.lossless.one/@designestate%2fdees-comms/-/dees-comms-1.0.22.tgz",
|
||||
"integrity": "sha512-zZ2AwCy49sj1fNyeSMtAxcN4qAGiP5+OjJCtY88YjrNbvD83v4GZpjci0nFUPuvOkCoeo18Uw8xgZSDy8lc59Q==",
|
||||
"requires": {
|
||||
"@apiglobal/typedrequest": "^1.0.65",
|
||||
"@apiglobal/typedrequest": "^2.0.3",
|
||||
"@apiglobal/typedrequest-interfaces": "^1.0.15",
|
||||
"@pushrocks/smartdelay": "^2.0.13",
|
||||
"broadcast-channel": "^3.7.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest": {
|
||||
"version": "1.0.67",
|
||||
"resolved": "https://verdaccio.lossless.one/@apiglobal%2ftypedrequest/-/typedrequest-1.0.67.tgz",
|
||||
"integrity": "sha512-f8DiYAv9ci7jgs39Q3kb64aII3TtWL+vYSYB+38wtvldXW3YY+Ub/wdur0/15yt/0EYzx9JLqLfylyDHZ7zyMQ==",
|
||||
"requires": {
|
||||
"@apiglobal/typedrequest-interfaces": "^1.0.15",
|
||||
"@pushrocks/isounique": "^1.0.4",
|
||||
"@pushrocks/lik": "^5.0.0",
|
||||
"@pushrocks/smartdelay": "^2.0.13",
|
||||
"@pushrocks/smartpromise": "^3.1.6",
|
||||
"@pushrocks/webrequest": "^2.0.13"
|
||||
}
|
||||
},
|
||||
"@pushrocks/webrequest": {
|
||||
"version": "2.0.15",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fwebrequest/-/webrequest-2.0.15.tgz",
|
||||
"integrity": "sha512-75aaLAMmyBlHvoEABANJUxcjoVLv4TEH3B9TLMi7jdx8UePFfZmbtymKfkpHO0gu3Q60dqRJowp/DWVl0sR/gg==",
|
||||
"requires": {
|
||||
"@pushrocks/smartdelay": "^2.0.13",
|
||||
"@pushrocks/smartenv": "^4.0.16",
|
||||
"@pushrocks/smartjson": "^4.0.6",
|
||||
"node-fetch": "^2.6.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@gitzone/tsbuild": {
|
||||
@ -12772,9 +12710,9 @@
|
||||
}
|
||||
},
|
||||
"@gitzone/tsbundle": {
|
||||
"version": "1.0.101",
|
||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbundle/-/tsbundle-1.0.101.tgz",
|
||||
"integrity": "sha512-OJlcZZofnSQX3ZnWv7UH51dyyyYN/n36zEzvEHszIcpb22cKHEqI9tQqqsTXo6bxJeA8lOmkJzu7wsVAwP9i1Q==",
|
||||
"version": "1.0.102",
|
||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbundle/-/tsbundle-1.0.102.tgz",
|
||||
"integrity": "sha512-3DyYTEM/dXG43LqerBsvF/oNHSvsH117qAvLpKNMP71SSLmpqqSxYdXU3HTQGjOW9S6ejkTeuJE9HkzOix+6nQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/core": "^7.17.7",
|
||||
@ -13915,22 +13853,6 @@
|
||||
"@pushrocks/smartpromise": "^3.0.6"
|
||||
}
|
||||
},
|
||||
"@pushrocks/smartenv": {
|
||||
"version": "4.0.16",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartenv/-/smartenv-4.0.16.tgz",
|
||||
"integrity": "sha512-NwYMONDc/NjY6BGvzZzLMteF83kPQTF9BCGfqWbktUUruEtdqL+nGw6ecoLFi2b5u7XPb8jK1TKIcSvpNJ7SyA==",
|
||||
"requires": {
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"@types/node": "^14.11.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": {
|
||||
"version": "14.17.15",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.17.15.tgz",
|
||||
"integrity": "sha512-D1sdW0EcSCmNdLKBGMYb38YsHUS6JcM7yQ6sLQ9KuZ35ck7LYCKE7kYFHOO59ayFOY3zobWVZxf4KXhYHcHYFA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@pushrocks/smarterror": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarterror/-/smarterror-2.0.1.tgz",
|
||||
@ -17113,9 +17035,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"lit": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://verdaccio.lossless.one/lit/-/lit-2.2.1.tgz",
|
||||
"integrity": "sha512-dSe++R50JqrvNGXmI9OE13de1z5U/Y3J2dTm/9GC86vedI8ILoR8ZGnxfThFpvQ9m0lR0qRnIR4IiKj/jDCfYw==",
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://verdaccio.lossless.one/lit/-/lit-2.2.2.tgz",
|
||||
"integrity": "sha512-eN3+2QRHn/erxYB88AXiiRgQA6RltE9MhzySCwX+ACOxA/MLWN3VdXvcbZD9PN09zmUwlgzDvW3T84YWj2Sa0A==",
|
||||
"requires": {
|
||||
"@lit/reactive-element": "^1.3.0",
|
||||
"lit-element": "^3.2.0",
|
||||
@ -17509,6 +17431,7 @@
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://verdaccio.lossless.one/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
@ -17516,17 +17439,20 @@
|
||||
"tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://verdaccio.lossless.one/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
|
||||
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=",
|
||||
"dev": true
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://verdaccio.lossless.one/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
|
||||
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=",
|
||||
"dev": true
|
||||
},
|
||||
"whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://verdaccio.lossless.one/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
|
10
package.json
10
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@designestate/dees-domtools",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.11",
|
||||
"private": false,
|
||||
"description": "tools to simplify complex css structures",
|
||||
"main": "dist_ts/index.js",
|
||||
@ -15,7 +15,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.61",
|
||||
"@gitzone/tsbundle": "^1.0.101",
|
||||
"@gitzone/tsbundle": "^1.0.102",
|
||||
"@gitzone/tstest": "^1.0.70",
|
||||
"@pushrocks/tapbundle": "^5.0.3",
|
||||
"@types/node": "^17.0.23",
|
||||
@ -23,8 +23,8 @@
|
||||
"tslint-config-prettier": "^1.15.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@apiglobal/typedrequest": "^2.0.0",
|
||||
"@designestate/dees-comms": "^1.0.16",
|
||||
"@apiglobal/typedrequest": "^2.0.3",
|
||||
"@designestate/dees-comms": "^1.0.22",
|
||||
"@pushrocks/lik": "^5.0.4",
|
||||
"@pushrocks/smartdelay": "^2.0.13",
|
||||
"@pushrocks/smartpromise": "^3.1.7",
|
||||
@ -34,7 +34,7 @@
|
||||
"@pushrocks/webrequest": "^3.0.3",
|
||||
"@pushrocks/websetup": "^3.0.16",
|
||||
"@pushrocks/webstore": "^1.0.18",
|
||||
"lit": "^2.2.1",
|
||||
"lit": "^2.2.2",
|
||||
"sweet-scroll": "^4.0.0"
|
||||
},
|
||||
"files": [
|
||||
|
@ -6,6 +6,7 @@ import { TViewport } from './domtools.css.breakpoints.js';
|
||||
import { Scroller } from './domtools.classes.scroller.js';
|
||||
import { WebSetup } from '@pushrocks/websetup';
|
||||
import { ThemeManager } from './domtools.classes.thememanager.js';
|
||||
import { Keyboard, Key } from './domtools.classes.keyboard.js';
|
||||
|
||||
export interface IDomToolsState {
|
||||
virtualViewport: TViewport;
|
||||
@ -91,18 +92,8 @@ export class DomTools {
|
||||
/* some options */
|
||||
}); // TODO: switch to scroller class
|
||||
public themeManager = new ThemeManager(this);
|
||||
|
||||
/* private actionSetVirtualViewport = this.domToolsStatePart.createAction<TViewport>(
|
||||
async (statePart, payload) => {
|
||||
const currentState = statePart.getState();
|
||||
currentState.virtualViewport = payload;
|
||||
return currentState;
|
||||
}
|
||||
);
|
||||
|
||||
public setVirtualViewport(environmentArg: TViewport) {
|
||||
this.domToolsStatePart.dispatchAction(this.actionSetVirtualViewport, environmentArg);
|
||||
} */
|
||||
public keyboard = new Keyboard(document.body);
|
||||
|
||||
|
||||
public domToolsReady = plugins.smartpromise.defer();
|
||||
public domReady = plugins.smartpromise.defer();
|
||||
|
221
ts/domtools.classes.keyboard.ts
Normal file
221
ts/domtools.classes.keyboard.ts
Normal file
@ -0,0 +1,221 @@
|
||||
import * as plugins from './domtools.plugins.js';
|
||||
|
||||
export enum Key {
|
||||
Backspace = 8,
|
||||
Tab = 9,
|
||||
Enter = 13,
|
||||
Shift = 16,
|
||||
Ctrl = 17,
|
||||
Alt = 18,
|
||||
PauseBreak = 19,
|
||||
CapsLock = 20,
|
||||
Escape = 27,
|
||||
Space = 32,
|
||||
PageUp = 33,
|
||||
PageDown = 34,
|
||||
End = 35,
|
||||
Home = 36,
|
||||
|
||||
LeftArrow = 37,
|
||||
UpArrow = 38,
|
||||
RightArrow = 39,
|
||||
DownArrow = 40,
|
||||
|
||||
Insert = 45,
|
||||
Delete = 46,
|
||||
|
||||
Zero = 48,
|
||||
ClosedParen = Zero,
|
||||
One = 49,
|
||||
ExclamationMark = One,
|
||||
Two = 50,
|
||||
AtSign = Two,
|
||||
Three = 51,
|
||||
PoundSign = Three,
|
||||
Hash = PoundSign,
|
||||
Four = 52,
|
||||
DollarSign = Four,
|
||||
Five = 53,
|
||||
PercentSign = Five,
|
||||
Six = 54,
|
||||
Caret = Six,
|
||||
Hat = Caret,
|
||||
Seven = 55,
|
||||
Ampersand = Seven,
|
||||
Eight = 56,
|
||||
Star = Eight,
|
||||
Asterik = Star,
|
||||
Nine = 57,
|
||||
OpenParen = Nine,
|
||||
|
||||
A = 65,
|
||||
B = 66,
|
||||
C = 67,
|
||||
D = 68,
|
||||
E = 69,
|
||||
F = 70,
|
||||
G = 71,
|
||||
H = 72,
|
||||
I = 73,
|
||||
J = 74,
|
||||
K = 75,
|
||||
L = 76,
|
||||
M = 77,
|
||||
N = 78,
|
||||
O = 79,
|
||||
P = 80,
|
||||
Q = 81,
|
||||
R = 82,
|
||||
S = 83,
|
||||
T = 84,
|
||||
U = 85,
|
||||
V = 86,
|
||||
W = 87,
|
||||
X = 88,
|
||||
Y = 89,
|
||||
Z = 90,
|
||||
|
||||
LeftWindowKey = 91,
|
||||
RightWindowKey = 92,
|
||||
SelectKey = 93,
|
||||
|
||||
Numpad0 = 96,
|
||||
Numpad1 = 97,
|
||||
Numpad2 = 98,
|
||||
Numpad3 = 99,
|
||||
Numpad4 = 100,
|
||||
Numpad5 = 101,
|
||||
Numpad6 = 102,
|
||||
Numpad7 = 103,
|
||||
Numpad8 = 104,
|
||||
Numpad9 = 105,
|
||||
|
||||
Multiply = 106,
|
||||
Add = 107,
|
||||
Subtract = 109,
|
||||
DecimalPoint = 110,
|
||||
Divide = 111,
|
||||
|
||||
F1 = 112,
|
||||
F2 = 113,
|
||||
F3 = 114,
|
||||
F4 = 115,
|
||||
F5 = 116,
|
||||
F6 = 117,
|
||||
F7 = 118,
|
||||
F8 = 119,
|
||||
F9 = 120,
|
||||
F10 = 121,
|
||||
F11 = 122,
|
||||
F12 = 123,
|
||||
|
||||
NumLock = 144,
|
||||
ScrollLock = 145,
|
||||
|
||||
SemiColon = 186,
|
||||
Equals = 187,
|
||||
Comma = 188,
|
||||
Dash = 189,
|
||||
Period = 190,
|
||||
UnderScore = Dash,
|
||||
PlusSign = Equals,
|
||||
ForwardSlash = 191,
|
||||
Tilde = 192,
|
||||
GraveAccent = Tilde,
|
||||
|
||||
OpenBracket = 219,
|
||||
ClosedBracket = 221,
|
||||
Quote = 222,
|
||||
}
|
||||
|
||||
type KeyCombo = Array<Key>;
|
||||
|
||||
export class Keyboard {
|
||||
private mapCombosToHandlers = new Map<number[], plugins.smartrx.rxjs.Subject<KeyboardEvent>>();
|
||||
private pressedKeys = new Set<Key>();
|
||||
|
||||
constructor(private domNode: Element | Document) {
|
||||
this.startListening();
|
||||
}
|
||||
|
||||
public on(keys: Key[] | KeyCombo[]) {
|
||||
const combos = this.toCombos(keys);
|
||||
const subject = new plugins.smartrx.rxjs.Subject<KeyboardEvent>();
|
||||
combos.forEach((combo) => {
|
||||
this.registerComboCallback(combo, subject);
|
||||
});
|
||||
return subject;
|
||||
}
|
||||
|
||||
public startListening() {
|
||||
this.domNode.addEventListener('keydown', this.handleKeyDown);
|
||||
this.domNode.addEventListener('keyup', this.handleKeyUp);
|
||||
}
|
||||
|
||||
public stopListening() {
|
||||
this.domNode.removeEventListener('keydown', this.handleKeyDown);
|
||||
this.domNode.removeEventListener('keyup', this.handleKeyUp);
|
||||
}
|
||||
|
||||
public clear() {
|
||||
this.stopListening();
|
||||
this.mapCombosToHandlers.clear();
|
||||
this.pressedKeys.clear();
|
||||
}
|
||||
|
||||
private handleKeyDown = (event: KeyboardEvent) => {
|
||||
this.pressedKeys.add(event.keyCode);
|
||||
|
||||
this.mapCombosToHandlers.forEach((subjectArg, comboArg) => {
|
||||
if (this.isComboPressed(comboArg)) {
|
||||
subjectArg.next(event);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
private handleKeyUp = (event: KeyboardEvent) => {
|
||||
this.pressedKeys.delete(event.keyCode);
|
||||
};
|
||||
|
||||
private isComboPressed(combo: number[]) {
|
||||
let result = true;
|
||||
|
||||
combo.forEach((key) => {
|
||||
if (!this.pressedKeys.has(key)) {
|
||||
result = false;
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private registerComboCallback(
|
||||
comboArg: Array<Key>,
|
||||
subjectArg: plugins.smartrx.rxjs.Subject<KeyboardEvent>
|
||||
) {
|
||||
if (!this.mapCombosToHandlers.has(comboArg)) {
|
||||
this.mapCombosToHandlers.set(comboArg, subjectArg);
|
||||
} else {
|
||||
const subject = this.mapCombosToHandlers.get(comboArg);
|
||||
return subject;
|
||||
}
|
||||
}
|
||||
|
||||
private toCombos(keys: KeyCombo[] | Key[]) {
|
||||
if (keys.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const isKeys = !Array.isArray(keys[0]);
|
||||
let combos: KeyCombo[] = [];
|
||||
|
||||
if (isKeys) {
|
||||
combos = (keys as Key[]).map((key) => [key]);
|
||||
} else {
|
||||
combos = keys as KeyCombo[];
|
||||
combos = combos.filter((combo) => combo.length > 0);
|
||||
}
|
||||
|
||||
return combos;
|
||||
}
|
||||
}
|
@ -2,16 +2,39 @@ import { DomTools } from './domtools.classes.domtools.js';
|
||||
|
||||
import { CSSResult, unsafeCSS } from 'lit';
|
||||
|
||||
export const desktop = 1240;
|
||||
export const desktop = 1600;
|
||||
export const notebook = 1240;
|
||||
export const tablet = 1024;
|
||||
export const phablet = 600;
|
||||
export const phone = 400;
|
||||
|
||||
export type TViewport = 'native' | 'desktop' | 'tablet' | 'phablet' | 'phone';
|
||||
|
||||
export const cssForDesktop = (cssArg: CSSResult) => {
|
||||
return unsafeCSS(`
|
||||
@container wccToolsViewport (min-width: ${desktop}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
@media (min-width: ${desktop}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
`);
|
||||
};
|
||||
|
||||
export const cssForNotebook = (cssArg: CSSResult) => {
|
||||
return unsafeCSS(`
|
||||
@container wccToolsViewport (max-width: ${notebook}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
@media (max-width: ${notebook}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
`);
|
||||
};
|
||||
|
||||
export const cssForTablet = (cssArg: CSSResult) => {
|
||||
return unsafeCSS(`
|
||||
@container wccToolsViewport size(max-width: ${tablet}px) {
|
||||
@container wccToolsViewport (max-width: ${tablet}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
@media (max-width: ${tablet}px) {
|
||||
@ -22,7 +45,7 @@ export const cssForTablet = (cssArg: CSSResult) => {
|
||||
|
||||
export const cssForPhablet = (cssArg: CSSResult) => {
|
||||
return unsafeCSS(`
|
||||
@container wccToolsViewport size(max-width: ${phablet}px) {
|
||||
@container wccToolsViewport (max-width: ${phablet}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
@media (max-width: ${phablet}px) {
|
||||
@ -33,7 +56,7 @@ export const cssForPhablet = (cssArg: CSSResult) => {
|
||||
|
||||
export const cssForPhone = (cssArg: CSSResult) => {
|
||||
return unsafeCSS(`
|
||||
@container wccToolsViewport size(max-width: ${phone}px) {
|
||||
@container wccToolsViewport (max-width: ${phone}px) {
|
||||
${cssArg.cssText}
|
||||
}
|
||||
@media (max-width: ${phone}px) {
|
||||
|
Reference in New Issue
Block a user