mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-13 03:09:26 +00:00
Compare commits
761 Commits
20240402.1
...
boolean_se
Author | SHA1 | Date | |
---|---|---|---|
![]() |
932120869b | ||
![]() |
061521a979 | ||
![]() |
d3f73baa36 | ||
![]() |
3037bf494c | ||
![]() |
b4dd953128 | ||
![]() |
430a28f350 | ||
![]() |
0eacf3fdac | ||
![]() |
7f9bf69a08 | ||
![]() |
32cca9e30c | ||
![]() |
d7d62307b8 | ||
![]() |
12bfa5dab2 | ||
![]() |
c0a728bc66 | ||
![]() |
19e8667349 | ||
![]() |
f3688b95d4 | ||
![]() |
01f692f05c | ||
![]() |
d652f6382d | ||
![]() |
c0f96d9473 | ||
![]() |
f1a2af24b3 | ||
![]() |
8501098bd1 | ||
![]() |
a235f76985 | ||
![]() |
968c0de141 | ||
![]() |
77d8aff1f4 | ||
![]() |
5e486d9cf0 | ||
![]() |
f730761b3f | ||
![]() |
46fc9c1a33 | ||
![]() |
8ed68bf295 | ||
![]() |
5622180d42 | ||
![]() |
ef1f9b371d | ||
![]() |
0b79684cf1 | ||
![]() |
bc68d8df11 | ||
![]() |
ebbade2fb7 | ||
![]() |
2b5f778f2e | ||
![]() |
91fc2383cb | ||
![]() |
1080a8c961 | ||
![]() |
6144049f8c | ||
![]() |
4ad3ad6e93 | ||
![]() |
16e84296da | ||
![]() |
3e1ea8d236 | ||
![]() |
8c9996fc81 | ||
![]() |
336b5fb547 | ||
![]() |
3f0f3affb6 | ||
![]() |
6754b8893b | ||
![]() |
6ec4323c76 | ||
![]() |
20408392d2 | ||
![]() |
b030a5d1f0 | ||
![]() |
e26e6d7c2d | ||
![]() |
e0c98e4524 | ||
![]() |
2832f501d1 | ||
![]() |
d2f2d682a9 | ||
![]() |
54b2121273 | ||
![]() |
c5ca731e05 | ||
![]() |
fd9c6c5449 | ||
![]() |
39f4355c1a | ||
![]() |
35fed0b0e2 | ||
![]() |
f0f0aefca1 | ||
![]() |
b60864086f | ||
![]() |
6629f372fc | ||
![]() |
ec9a95dde0 | ||
![]() |
3cd0c49c78 | ||
![]() |
e1ae95dd9f | ||
![]() |
9c6aef033d | ||
![]() |
b23aacef84 | ||
![]() |
7d218c89ae | ||
![]() |
ffa96d789f | ||
![]() |
5eae163796 | ||
![]() |
9e7f01a009 | ||
![]() |
eeffa3561c | ||
![]() |
f096eb2031 | ||
![]() |
3aad7431da | ||
![]() |
a4f167559c | ||
![]() |
44a0582e83 | ||
![]() |
94c28ea534 | ||
![]() |
5b7c20af33 | ||
![]() |
4719775926 | ||
![]() |
5c30c1647c | ||
![]() |
3ba572ee37 | ||
![]() |
0adee7d189 | ||
![]() |
51b6d7758d | ||
![]() |
0f21dfadf1 | ||
![]() |
54e8a34f21 | ||
![]() |
dfbf4abd5d | ||
![]() |
62d8434596 | ||
![]() |
d6df228e17 | ||
![]() |
00faa16349 | ||
![]() |
3c92fe4170 | ||
![]() |
02a9d67c7d | ||
![]() |
88718bca23 | ||
![]() |
33931b29a1 | ||
![]() |
a9310fdde0 | ||
![]() |
d634317438 | ||
![]() |
a41978f647 | ||
![]() |
7e799bf639 | ||
![]() |
73617711ff | ||
![]() |
edbfc22bf8 | ||
![]() |
5e75f6a6c2 | ||
![]() |
6dc80306e8 | ||
![]() |
acd1b04b0a | ||
![]() |
7e9d09e11c | ||
![]() |
038f7ec000 | ||
![]() |
08959cbabf | ||
![]() |
b611674ebd | ||
![]() |
2f696bd511 | ||
![]() |
9e3284a7db | ||
![]() |
0c3471e0b7 | ||
![]() |
1ca0b58aca | ||
![]() |
adceed689b | ||
![]() |
574fc99889 | ||
![]() |
3a83cb36a1 | ||
![]() |
a458ccf995 | ||
![]() |
560e2c9438 | ||
![]() |
78becb5440 | ||
![]() |
da2e530601 | ||
![]() |
a88a7c5236 | ||
![]() |
0a095c6f21 | ||
![]() |
e8dd835eeb | ||
![]() |
e05c66444a | ||
![]() |
d0e61ca31a | ||
![]() |
1f90a0c2e5 | ||
![]() |
dbd84901f8 | ||
![]() |
0aa25dbed9 | ||
![]() |
dd74a35d3f | ||
![]() |
b1d8ec0fe4 | ||
![]() |
cd4af674a3 | ||
![]() |
7a6491a901 | ||
![]() |
8d20303d54 | ||
![]() |
a5786b4761 | ||
![]() |
4ade39543d | ||
![]() |
a85dda3365 | ||
![]() |
e578904ff7 | ||
![]() |
09f0da1ead | ||
![]() |
2faa8fec17 | ||
![]() |
945c4a66b1 | ||
![]() |
5d794e7e88 | ||
![]() |
88a33bee14 | ||
![]() |
35ec9af23f | ||
![]() |
dd331173ad | ||
![]() |
885ccb84cb | ||
![]() |
0358fe5614 | ||
![]() |
89d842c2a8 | ||
![]() |
8911b55316 | ||
![]() |
6791e85625 | ||
![]() |
79618ce114 | ||
![]() |
87ba0e73dd | ||
![]() |
567a2ea019 | ||
![]() |
811c34b489 | ||
![]() |
dd22ae446a | ||
![]() |
d96ddf968c | ||
![]() |
bbb64870a1 | ||
![]() |
f05ddd3fcd | ||
![]() |
0612e25d9f | ||
![]() |
559ecf3eae | ||
![]() |
ddb31a8342 | ||
![]() |
1c978b7cce | ||
![]() |
9d9624c960 | ||
![]() |
179245e1aa | ||
![]() |
345000a0e9 | ||
![]() |
d94d5f96c3 | ||
![]() |
0fa3538db5 | ||
![]() |
1749725229 | ||
![]() |
83e94d32e3 | ||
![]() |
7fed4e6b37 | ||
![]() |
677cffd650 | ||
![]() |
1faa1480e4 | ||
![]() |
8cb63ac36d | ||
![]() |
6e29b77e94 | ||
![]() |
38e7b8c467 | ||
![]() |
d078807255 | ||
![]() |
82d84de426 | ||
![]() |
729a12af0c | ||
![]() |
ce43774b5f | ||
![]() |
e63d82d291 | ||
![]() |
d997cfcef0 | ||
![]() |
219f548261 | ||
![]() |
ee2b10912c | ||
![]() |
e3b0630797 | ||
![]() |
30d0293a4b | ||
![]() |
7468ab985a | ||
![]() |
ef3758da55 | ||
![]() |
2a970b8416 | ||
![]() |
f70126eb62 | ||
![]() |
f87296d978 | ||
![]() |
2890d5c8cf | ||
![]() |
15a7ace278 | ||
![]() |
71a2c40dd7 | ||
![]() |
a08bbcd1b4 | ||
![]() |
5ec257fa18 | ||
![]() |
9b01c0b2f0 | ||
![]() |
7dd860c539 | ||
![]() |
dbc2db2591 | ||
![]() |
29aa57229c | ||
![]() |
8d74174be1 | ||
![]() |
a60242f042 | ||
![]() |
db314522d7 | ||
![]() |
7b66ee06eb | ||
![]() |
3f34dacec9 | ||
![]() |
277650e1c1 | ||
![]() |
e59c04c685 | ||
![]() |
d9583582e6 | ||
![]() |
5ead5ed058 | ||
![]() |
f2993602f9 | ||
![]() |
11b490d145 | ||
![]() |
cd4937b539 | ||
![]() |
daa36788e0 | ||
![]() |
7edc4efc95 | ||
![]() |
144d278e4a | ||
![]() |
541453c245 | ||
![]() |
ca53af5c41 | ||
![]() |
bd54eb40a7 | ||
![]() |
8ff2396a53 | ||
![]() |
c85e29f2bb | ||
![]() |
e7a749ef7d | ||
![]() |
bef53aef57 | ||
![]() |
877d0db1bb | ||
![]() |
aa49d6ef6b | ||
![]() |
d646ce4995 | ||
![]() |
d6e6844f23 | ||
![]() |
66e26e1a27 | ||
![]() |
b7473b58fb | ||
![]() |
42b5fbec9b | ||
![]() |
f7072c247e | ||
![]() |
f995f19f06 | ||
![]() |
7f50504908 | ||
![]() |
dc93a0ce54 | ||
![]() |
3e4d06fca3 | ||
![]() |
050bef0564 | ||
![]() |
1abebdae21 | ||
![]() |
b411ae0286 | ||
![]() |
202bd148ef | ||
![]() |
15589927c8 | ||
![]() |
df7b5b08cf | ||
![]() |
8b9fa9bc39 | ||
![]() |
c07e1122e1 | ||
![]() |
1ceef7c3d3 | ||
![]() |
e332364ec0 | ||
![]() |
97c4cf9391 | ||
![]() |
522f66423b | ||
![]() |
57e48e2561 | ||
![]() |
37af77dabe | ||
![]() |
2b5fba4a30 | ||
![]() |
d833910796 | ||
![]() |
81c796beb4 | ||
![]() |
19ee150395 | ||
![]() |
82329833f5 | ||
![]() |
ab3b8593f4 | ||
![]() |
094203f0b4 | ||
![]() |
9a2051a679 | ||
![]() |
09accb3071 | ||
![]() |
7d432cd11a | ||
![]() |
7258e31348 | ||
![]() |
5707ca0016 | ||
![]() |
76abfea6ed | ||
![]() |
d01377da3c | ||
![]() |
e97be57e3b | ||
![]() |
c71a051b6d | ||
![]() |
f41fab6968 | ||
![]() |
bda61da666 | ||
![]() |
93445ced74 | ||
![]() |
b81314fc1f | ||
![]() |
9beb4c39ff | ||
![]() |
18a6f8d64d | ||
![]() |
beec720b9b | ||
![]() |
85865af0c3 | ||
![]() |
d33cf4f199 | ||
![]() |
4a1087c969 | ||
![]() |
cbc95a5e2d | ||
![]() |
dcd4c39978 | ||
![]() |
11d832c2ea | ||
![]() |
3b15d26500 | ||
![]() |
df65038341 | ||
![]() |
da2865d8bf | ||
![]() |
fd64d17d88 | ||
![]() |
5273293cd6 | ||
![]() |
49c42fc757 | ||
![]() |
7603fa3aa8 | ||
![]() |
7aa005e0ce | ||
![]() |
b2a55dd737 | ||
![]() |
ccad1afcf0 | ||
![]() |
231c923776 | ||
![]() |
b08b67179e | ||
![]() |
d9f1b06199 | ||
![]() |
4b7526c8a3 | ||
![]() |
6267ab5ed3 | ||
![]() |
ae94231800 | ||
![]() |
7d28f3f585 | ||
![]() |
adea384f40 | ||
![]() |
55b66250f4 | ||
![]() |
182111912c | ||
![]() |
8a0924bf1f | ||
![]() |
94dc9308ea | ||
![]() |
f42a9ac070 | ||
![]() |
1acada625f | ||
![]() |
128dbbcfef | ||
![]() |
57d8544dbf | ||
![]() |
76daa2bb7f | ||
![]() |
9cbb51549b | ||
![]() |
bd1ede4145 | ||
![]() |
321a085c0e | ||
![]() |
6a3041988a | ||
![]() |
23fcdf876c | ||
![]() |
00f325e961 | ||
![]() |
d00b3cfc61 | ||
![]() |
4cc9e74ea8 | ||
![]() |
a56b9a96ce | ||
![]() |
d4b5f4bc14 | ||
![]() |
cf1523ee73 | ||
![]() |
f5d571ca84 | ||
![]() |
362e92f313 | ||
![]() |
5ddf72b973 | ||
![]() |
6e78c28f51 | ||
![]() |
772f0bb669 | ||
![]() |
846c2a848f | ||
![]() |
8495757005 | ||
![]() |
9960d38b91 | ||
![]() |
d3222f8bb0 | ||
![]() |
2e5cce5409 | ||
![]() |
f78946447f | ||
![]() |
eb0579ddc5 | ||
![]() |
686424fc70 | ||
![]() |
039e9b40bd | ||
![]() |
8272bef890 | ||
![]() |
62528b2413 | ||
![]() |
fa24f529e0 | ||
![]() |
43a54f6cda | ||
![]() |
9c153bbd58 | ||
![]() |
27afe9ecb7 | ||
![]() |
72f989e2bd | ||
![]() |
a6ef46565f | ||
![]() |
a35ac09688 | ||
![]() |
27024135ea | ||
![]() |
8759ed740a | ||
![]() |
bb3e8ae33d | ||
![]() |
b5b60c9bf0 | ||
![]() |
3b6a2cf7d8 | ||
![]() |
7e10e14102 | ||
![]() |
a580abab4a | ||
![]() |
11523c08c4 | ||
![]() |
7a8988528b | ||
![]() |
2a6380f083 | ||
![]() |
f43319a3ae | ||
![]() |
e8eefaf1d3 | ||
![]() |
06d82a4925 | ||
![]() |
4991d52fcc | ||
![]() |
0b391eafcf | ||
![]() |
0bb34830f8 | ||
![]() |
29881c8bb4 | ||
![]() |
56254ddf03 | ||
![]() |
007ba70641 | ||
![]() |
3e1227b064 | ||
![]() |
067e179f26 | ||
![]() |
9a3f7df25e | ||
![]() |
c7b4e8f37c | ||
![]() |
bfa8b886ab | ||
![]() |
433c00b73a | ||
![]() |
a497f42f73 | ||
![]() |
165723cb5b | ||
![]() |
42b5fa696a | ||
![]() |
59062d96a8 | ||
![]() |
d36bbfe07d | ||
![]() |
4a8bb5034d | ||
![]() |
0d489213a4 | ||
![]() |
c54acc9369 | ||
![]() |
562bc084f0 | ||
![]() |
6fce2f35a5 | ||
![]() |
f4e24bed2e | ||
![]() |
09969c0e2d | ||
![]() |
4b0181774b | ||
![]() |
272db5e9e8 | ||
![]() |
9ae3a824d9 | ||
![]() |
9db55c9391 | ||
![]() |
59697127c0 | ||
![]() |
565600e945 | ||
![]() |
721eebf367 | ||
![]() |
f5ae842167 | ||
![]() |
3575734ed0 | ||
![]() |
4e8de1f64d | ||
![]() |
a8366c6416 | ||
![]() |
cd73b8ac29 | ||
![]() |
74eca6b1f5 | ||
![]() |
9ef0bd6e46 | ||
![]() |
53eb7f771f | ||
![]() |
8ff8c01bba | ||
![]() |
cd62f064cb | ||
![]() |
db82b856e0 | ||
![]() |
ab340e13e9 | ||
![]() |
22c54b3fea | ||
![]() |
2dd7e598d5 | ||
![]() |
d1ce06e368 | ||
![]() |
52f3ff3306 | ||
![]() |
9717304b68 | ||
![]() |
c646f3c39a | ||
![]() |
0297ec5a7b | ||
![]() |
e48286c2a0 | ||
![]() |
f2b2da9877 | ||
![]() |
250f87cfd8 | ||
![]() |
9f6afb162a | ||
![]() |
0add65feff | ||
![]() |
c08d9a9166 | ||
![]() |
d9a9038cec | ||
![]() |
6bee3ef45c | ||
![]() |
3a855f95ad | ||
![]() |
e7f3393ec6 | ||
![]() |
d7cb4cb537 | ||
![]() |
c55720c933 | ||
![]() |
f78e757485 | ||
![]() |
fa03c58a93 | ||
![]() |
49f1ad633f | ||
![]() |
d449e10120 | ||
![]() |
474c8c243e | ||
![]() |
e9e53e9451 | ||
![]() |
cfa84f30be | ||
![]() |
7416ae7dfd | ||
![]() |
10a5c4dfb4 | ||
![]() |
6f1fa139e7 | ||
![]() |
b38a348957 | ||
![]() |
f97971faf6 | ||
![]() |
c5ae9e8497 | ||
![]() |
c00287c401 | ||
![]() |
1a2daf8a7a | ||
![]() |
c0e048023d | ||
![]() |
431f4937c1 | ||
![]() |
0a55220837 | ||
![]() |
13f01492b4 | ||
![]() |
ce5bcf61f9 | ||
![]() |
d31a777135 | ||
![]() |
5cc08cfe0b | ||
![]() |
3eea7dc6cd | ||
![]() |
a629f01300 | ||
![]() |
f1345af526 | ||
![]() |
064c51f487 | ||
![]() |
d88670034a | ||
![]() |
5fab1969a8 | ||
![]() |
b3e14d449e | ||
![]() |
97206ee8fe | ||
![]() |
7748315fc3 | ||
![]() |
e059ca146b | ||
![]() |
56cabeb497 | ||
![]() |
7a7bd87f50 | ||
![]() |
ff9c794659 | ||
![]() |
2921161336 | ||
![]() |
91e5fcacd5 | ||
![]() |
febbf34de6 | ||
![]() |
5a2977f4d4 | ||
![]() |
7a7a355765 | ||
![]() |
ccebae84a7 | ||
![]() |
f96f38ee82 | ||
![]() |
d4056e6a32 | ||
![]() |
389a7a6ed9 | ||
![]() |
05aecaaaf1 | ||
![]() |
085131d546 | ||
![]() |
c2737d5cec | ||
![]() |
29ae46d775 | ||
![]() |
dfee3ba089 | ||
![]() |
1dbb70b964 | ||
![]() |
1eecc5c0e2 | ||
![]() |
81c0bcff0b | ||
![]() |
6ccbeb8a75 | ||
![]() |
f59ed0a72b | ||
![]() |
a9f00ded0f | ||
![]() |
74730ba201 | ||
![]() |
95b2f7d821 | ||
![]() |
661b14da54 | ||
![]() |
41e34c0d61 | ||
![]() |
5d044a06eb | ||
![]() |
f617426808 | ||
![]() |
3c3d54243c | ||
![]() |
afc624bf4b | ||
![]() |
0991628843 | ||
![]() |
34b9c7b9d1 | ||
![]() |
d52641b495 | ||
![]() |
80c7fd2bf2 | ||
![]() |
e0062cf190 | ||
![]() |
7d2cee650d | ||
![]() |
66560b1f1c | ||
![]() |
a500b582e3 | ||
![]() |
19f94ff8cc | ||
![]() |
0b6994d402 | ||
![]() |
9fe8f507ec | ||
![]() |
2113cf5280 | ||
![]() |
ae9e1b724f | ||
![]() |
9b28c7cf69 | ||
![]() |
d9bac06806 | ||
![]() |
b1e37cb1e1 | ||
![]() |
a2a89502d8 | ||
![]() |
4cc5d2d04b | ||
![]() |
79abcca3b3 | ||
![]() |
043f383a35 | ||
![]() |
d4dd767941 | ||
![]() |
174f1991b1 | ||
![]() |
e15495a626 | ||
![]() |
a8a9a797cb | ||
![]() |
914dbc1e28 | ||
![]() |
111816f08a | ||
![]() |
1b4534890c | ||
![]() |
ed6542469d | ||
![]() |
3774a3d6ba | ||
![]() |
bfa293ae3a | ||
![]() |
9264adb799 | ||
![]() |
829ea4a9e4 | ||
![]() |
be26f8bc24 | ||
![]() |
c864b34a9a | ||
![]() |
099ea61a94 | ||
![]() |
3ebe6027be | ||
![]() |
f5f2a5ad5b | ||
![]() |
d046700d06 | ||
![]() |
2ad84b2832 | ||
![]() |
f9ccb9fc72 | ||
![]() |
6d3940db1e | ||
![]() |
20d174431d | ||
![]() |
1900710e06 | ||
![]() |
ed86a48e1c | ||
![]() |
d2bdb52926 | ||
![]() |
9c57c9f151 | ||
![]() |
9e9cb15a42 | ||
![]() |
6421a9443d | ||
![]() |
f2b43ddad8 | ||
![]() |
e55b59d9b7 | ||
![]() |
4a77359a06 | ||
![]() |
505d7b6ddb | ||
![]() |
79cdc43699 | ||
![]() |
8ff9823cd7 | ||
![]() |
3488c60818 | ||
![]() |
b2af21ba5c | ||
![]() |
12a61a0021 | ||
![]() |
649917cdde | ||
![]() |
3ed27ee853 | ||
![]() |
c1d3a76917 | ||
![]() |
571ed6b9e9 | ||
![]() |
a347315fa7 | ||
![]() |
57d1405115 | ||
![]() |
e5ff6bd2f5 | ||
![]() |
43a422cdca | ||
![]() |
11f2bef05c | ||
![]() |
ff9f331287 | ||
![]() |
cdf64ccdaa | ||
![]() |
8b220acca2 | ||
![]() |
8fdb7fa1d5 | ||
![]() |
008c842431 | ||
![]() |
bc41de0d9c | ||
![]() |
7310c9cf6d | ||
![]() |
84b436c08e | ||
![]() |
1925a47bdc | ||
![]() |
438a426458 | ||
![]() |
f923deb71d | ||
![]() |
e79bc71ab7 | ||
![]() |
11b0990d2b | ||
![]() |
870cb0c65f | ||
![]() |
deda2009f8 | ||
![]() |
b2797ab8da | ||
![]() |
644dcb0381 | ||
![]() |
c65f4f7a6e | ||
![]() |
e2266aa671 | ||
![]() |
68a79490dc | ||
![]() |
6febe8552e | ||
![]() |
f611f23f6f | ||
![]() |
ef4f11fdf8 | ||
![]() |
627e06663b | ||
![]() |
ab01633069 | ||
![]() |
17dcc90638 | ||
![]() |
d0df029ff1 | ||
![]() |
86a7e69812 | ||
![]() |
af9417f2a6 | ||
![]() |
7120ad99b9 | ||
![]() |
334c245b65 | ||
![]() |
bcb72d83b8 | ||
![]() |
c99e0e846b | ||
![]() |
ec3f63e8a3 | ||
![]() |
1bc33a30ec | ||
![]() |
8cca233b7c | ||
![]() |
a78608bfb4 | ||
![]() |
e7c1ac94af | ||
![]() |
1a797b3415 | ||
![]() |
2b27a4da2b | ||
![]() |
1df92fa863 | ||
![]() |
cdde85315a | ||
![]() |
dc67f9faf4 | ||
![]() |
3ad1be50a2 | ||
![]() |
8aadfe7d28 | ||
![]() |
cff54b73a4 | ||
![]() |
b54cfeb0c0 | ||
![]() |
cefe612b11 | ||
![]() |
4bc874b497 | ||
![]() |
f3abaa8e02 | ||
![]() |
21a563fe98 | ||
![]() |
1acbcccd62 | ||
![]() |
35d6c638ab | ||
![]() |
68f8239708 | ||
![]() |
0db64cca0b | ||
![]() |
accfda5f4b | ||
![]() |
c97c20f57d | ||
![]() |
2725d0191d | ||
![]() |
852cc62398 | ||
![]() |
654e3ce437 | ||
![]() |
20a3a00aec | ||
![]() |
22b927d666 | ||
![]() |
709d6be2e3 | ||
![]() |
64f54d9aaa | ||
![]() |
fbda9ca418 | ||
![]() |
4e97e3763e | ||
![]() |
4c9c52d27d | ||
![]() |
87bcd3e471 | ||
![]() |
7e9b01b56d | ||
![]() |
713763fc21 | ||
![]() |
5b7ab1bfcb | ||
![]() |
8712adbf8d | ||
![]() |
4b0d19b615 | ||
![]() |
90e5d259af | ||
![]() |
af3a331f57 | ||
![]() |
67c60a4aa8 | ||
![]() |
62de16bb8e | ||
![]() |
d9b71e754d | ||
![]() |
5fc950f09f | ||
![]() |
0725c7b160 | ||
![]() |
469dbbcccc | ||
![]() |
ffdd661b1f | ||
![]() |
81922f5a3e | ||
![]() |
7e25366897 | ||
![]() |
8ab61b5468 | ||
![]() |
8239f6dd60 | ||
![]() |
45dce18e4d | ||
![]() |
a428ad0655 | ||
![]() |
1b54d51e4a | ||
![]() |
eb1354d229 | ||
![]() |
4d21f9e80c | ||
![]() |
62f46baacf | ||
![]() |
a3090796d2 | ||
![]() |
c34c5d64f9 | ||
![]() |
66228f5858 | ||
![]() |
ac378cfe6d | ||
![]() |
7ecf8b755e | ||
![]() |
141107f1f3 | ||
![]() |
b5277dee53 | ||
![]() |
4b593c1c96 | ||
![]() |
50ce1b94c8 | ||
![]() |
8bf27a83ec | ||
![]() |
389f0d3d23 | ||
![]() |
b966601e6a | ||
![]() |
f2a0881821 | ||
![]() |
50a49eae43 | ||
![]() |
1c04561004 | ||
![]() |
b80d94d260 | ||
![]() |
87012e23e7 | ||
![]() |
f39758b103 | ||
![]() |
697bbf428e | ||
![]() |
c7444a2605 | ||
![]() |
3a5f4d33d2 | ||
![]() |
c3dc62523b | ||
![]() |
424622061a | ||
![]() |
a3b021b11d | ||
![]() |
b60ad8b143 | ||
![]() |
e376efc579 | ||
![]() |
382035a1d4 | ||
![]() |
542e22fe0e | ||
![]() |
af37d57779 | ||
![]() |
fbef0b0186 | ||
![]() |
9e67d6add8 | ||
![]() |
25c702ad2b | ||
![]() |
6516597c93 | ||
![]() |
1df9c38a8c | ||
![]() |
bd7217145a | ||
![]() |
569fef38a4 | ||
![]() |
f21c89cf1a | ||
![]() |
02cc418969 | ||
![]() |
4faba159c0 | ||
![]() |
29816e6c5e | ||
![]() |
5317a11c39 | ||
![]() |
27c53b3241 | ||
![]() |
919befa961 | ||
![]() |
f9c02ed099 | ||
![]() |
b35c325f43 | ||
![]() |
b82f1128fe | ||
![]() |
178feb7330 | ||
![]() |
0118a5bf4c | ||
![]() |
e0087bd142 | ||
![]() |
c2d3e7900e | ||
![]() |
fb8312110b | ||
![]() |
16de57342e | ||
![]() |
ad6e041c04 | ||
![]() |
e22e3e88a0 | ||
![]() |
dc8a50965c | ||
![]() |
1914de7ddf | ||
![]() |
2e505cfb1f | ||
![]() |
ab49aca815 | ||
![]() |
c96968e476 | ||
![]() |
8f050516ec | ||
![]() |
27d2b244a4 | ||
![]() |
be2f2c6271 | ||
![]() |
8dc2797b16 | ||
![]() |
7ca8dabc44 | ||
![]() |
baeb55e217 | ||
![]() |
a8502fcc11 | ||
![]() |
9f5bc5b196 | ||
![]() |
7556ab9506 | ||
![]() |
bf176ac314 | ||
![]() |
9903e22eaa | ||
![]() |
1e0f7d9629 | ||
![]() |
e8a140af44 | ||
![]() |
b091d4f298 | ||
![]() |
35cf3063cb | ||
![]() |
7141ef17be | ||
![]() |
be2c68c0bb | ||
![]() |
7c944d3767 | ||
![]() |
1d4f02df2e | ||
![]() |
2007a74a20 | ||
![]() |
8c0839ad57 | ||
![]() |
516b9a54c4 | ||
![]() |
0d3e730c9c | ||
![]() |
c7a87d02b2 | ||
![]() |
dd082c204b | ||
![]() |
c4af3d1579 | ||
![]() |
10eadbcbbb | ||
![]() |
17141824f7 | ||
![]() |
4cfd6c010f | ||
![]() |
daa9024bff | ||
![]() |
e96aca90fe | ||
![]() |
0580a31961 | ||
![]() |
5c42c5130c | ||
![]() |
72d1e37a23 | ||
![]() |
61c9072a08 | ||
![]() |
08b25f9c2a | ||
![]() |
1a03b49700 | ||
![]() |
2d4a8e2e45 | ||
![]() |
8486377604 | ||
![]() |
3a4e9b6856 | ||
![]() |
5f5ac5419b | ||
![]() |
92b7a3b477 | ||
![]() |
4326519a3f | ||
![]() |
00837acdfc | ||
![]() |
7704be12b1 | ||
![]() |
712ddb531b | ||
![]() |
d52afc3f71 | ||
![]() |
92f6083e0b | ||
![]() |
5751fdbe56 | ||
![]() |
962b30adb9 | ||
![]() |
3b5b3f3bb6 | ||
![]() |
1a6d96cf3a | ||
![]() |
034fd9b4df | ||
![]() |
eb79a1e7d7 | ||
![]() |
e25d4f17aa | ||
![]() |
ccde9cceee | ||
![]() |
578d3c4260 | ||
![]() |
bfdc9a3d86 | ||
![]() |
5315545a4d | ||
![]() |
82a3b9d80f | ||
![]() |
3de985a3b8 | ||
![]() |
567ee8000d | ||
![]() |
03939001b2 | ||
![]() |
30d18050d1 | ||
![]() |
95caf8c7df | ||
![]() |
6c1f328d71 | ||
![]() |
bb20ab8c2c | ||
![]() |
29eb73176a | ||
![]() |
17ad3a87f3 | ||
![]() |
ed7c9c33b9 | ||
![]() |
59b66219cb | ||
![]() |
1e2c1d1464 | ||
![]() |
5b86b1277f | ||
![]() |
41fdf31e34 | ||
![]() |
9bef5c2af9 | ||
![]() |
ed1a69071b | ||
![]() |
56d328b4db | ||
![]() |
33c7e0fa2d |
@@ -1,28 +1,25 @@
|
||||
[modern]
|
||||
# Support for dynamic import is the main litmus test for serving modern builds.
|
||||
# Although officially a ES2020 feature, browsers implemented it early, so this
|
||||
# enables all of ES2017 and some features in ES2018.
|
||||
supports es6-module-dynamic-import
|
||||
|
||||
# Exclude Safari 11-12 because of a bug in tagged template literals
|
||||
# https://bugs.webkit.org/show_bug.cgi?id=190756
|
||||
# Note: Dropping version 11 also enables several more ES2018 features
|
||||
not Safari < 13
|
||||
not iOS < 13
|
||||
|
||||
# Exclude KaiOS, QQ, and UC browsers due to lack of sufficient feature support data
|
||||
# Babel ignores these automatically, but we need here for Webpack to output ESM with dynamic imports
|
||||
# Modern builds target recent browsers supporting the latest features to minimize transpilation, polyfills, etc.
|
||||
# It is served to browsers meeting the following requirements:
|
||||
# - released in the last year + current alpha/beta versions
|
||||
# - Firefox extended support release (ESR)
|
||||
# - with global utilization at or above 0.5%
|
||||
# - must support dynamic import of ES modules
|
||||
# - exclude browsers no longer being maintained
|
||||
# - exclude KaiOS, QQ, and UC browsers due to lack of sufficient feature support data
|
||||
unreleased versions
|
||||
last 1 year
|
||||
Firefox ESR
|
||||
>= 0.5% and supports es6-module-dynamic-import
|
||||
not dead
|
||||
not KaiOS > 0
|
||||
not QQAndroid > 0
|
||||
not UCAndroid > 0
|
||||
|
||||
# Exclude unsupported browsers
|
||||
not dead
|
||||
|
||||
[legacy]
|
||||
# Legacy builds are served when modern requirements are not met and support browsers:
|
||||
# - released in the last 7 years + current alpha/beta versionss
|
||||
# - with global utilization above 0.05%
|
||||
# - with global utilization at or above 0.05%
|
||||
# The lattermost query ensures that support for popular old browsers is not dropped too early
|
||||
# (e.g. IE 11, Android 4.4, or Samsung 4).
|
||||
#
|
||||
@@ -36,4 +33,10 @@ not dead
|
||||
# As of May 2023, only web sockets must be added to the query.
|
||||
unreleased versions
|
||||
last 7 years
|
||||
> 0.05% and supports websockets
|
||||
>= 0.05% and supports websockets
|
||||
|
||||
[legacy-sw]
|
||||
# Same as legacy plus supports service workers
|
||||
unreleased versions
|
||||
last 7 years
|
||||
>= 0.05% and supports websockets and supports serviceworkers
|
||||
|
@@ -8,6 +8,7 @@
|
||||
"postCreateCommand": "sudo apt update && sudo apt upgrade -y && sudo apt install -y libpcap-dev",
|
||||
"postStartCommand": "script/bootstrap",
|
||||
"containerEnv": {
|
||||
"DEV_CONTAINER": "1",
|
||||
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}"
|
||||
},
|
||||
"customizations": {
|
||||
|
@@ -115,6 +115,7 @@
|
||||
}
|
||||
],
|
||||
"unused-imports/no-unused-imports": "error",
|
||||
"lit/attribute-names": "warn",
|
||||
"lit/attribute-value-entities": "off",
|
||||
"lit/no-template-map": "off",
|
||||
"lit/no-native-attributes": "warn",
|
||||
@@ -125,6 +126,5 @@
|
||||
"lit-a11y/anchor-is-valid": "warn",
|
||||
"lit-a11y/role-has-required-aria-attrs": "warn"
|
||||
},
|
||||
"plugins": ["disable", "unused-imports"],
|
||||
"processor": "disable/disable"
|
||||
"plugins": ["unused-imports"]
|
||||
}
|
||||
|
8
.github/workflows/cast_deployment.yaml
vendored
8
.github/workflows/cast_deployment.yaml
vendored
@@ -21,12 +21,12 @@ jobs:
|
||||
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
|
||||
steps:
|
||||
- name: Check out files from GitHub
|
||||
uses: actions/checkout@v4.1.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
ref: dev
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4.0.2
|
||||
uses: actions/setup-node@v4.0.3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: yarn
|
||||
@@ -57,12 +57,12 @@ jobs:
|
||||
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
|
||||
steps:
|
||||
- name: Check out files from GitHub
|
||||
uses: actions/checkout@v4.1.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
ref: master
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4.0.2
|
||||
uses: actions/setup-node@v4.0.3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: yarn
|
||||
|
20
.github/workflows/ci.yaml
vendored
20
.github/workflows/ci.yaml
vendored
@@ -24,9 +24,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out files from GitHub
|
||||
uses: actions/checkout@v4.1.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4.0.2
|
||||
uses: actions/setup-node@v4.0.3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: yarn
|
||||
@@ -58,9 +58,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out files from GitHub
|
||||
uses: actions/checkout@v4.1.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4.0.2
|
||||
uses: actions/setup-node@v4.0.3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: yarn
|
||||
@@ -76,9 +76,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out files from GitHub
|
||||
uses: actions/checkout@v4.1.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4.0.2
|
||||
uses: actions/setup-node@v4.0.3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: yarn
|
||||
@@ -89,7 +89,7 @@ jobs:
|
||||
env:
|
||||
IS_TEST: "true"
|
||||
- name: Upload bundle stats
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
uses: actions/upload-artifact@v4.3.6
|
||||
with:
|
||||
name: frontend-bundle-stats
|
||||
path: build/stats/*.json
|
||||
@@ -100,9 +100,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out files from GitHub
|
||||
uses: actions/checkout@v4.1.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4.0.2
|
||||
uses: actions/setup-node@v4.0.3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: yarn
|
||||
@@ -113,7 +113,7 @@ jobs:
|
||||
env:
|
||||
IS_TEST: "true"
|
||||
- name: Upload bundle stats
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
uses: actions/upload-artifact@v4.3.6
|
||||
with:
|
||||
name: supervisor-bundle-stats
|
||||
path: build/stats/*.json
|
||||
|
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4.1.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
|
8
.github/workflows/demo_deployment.yaml
vendored
8
.github/workflows/demo_deployment.yaml
vendored
@@ -22,12 +22,12 @@ jobs:
|
||||
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
|
||||
steps:
|
||||
- name: Check out files from GitHub
|
||||
uses: actions/checkout@v4.1.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
ref: dev
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4.0.2
|
||||
uses: actions/setup-node@v4.0.3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: yarn
|
||||
@@ -58,12 +58,12 @@ jobs:
|
||||
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
|
||||
steps:
|
||||
- name: Check out files from GitHub
|
||||
uses: actions/checkout@v4.1.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
with:
|
||||
ref: master
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4.0.2
|
||||
uses: actions/setup-node@v4.0.3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: yarn
|
||||
|
4
.github/workflows/design_deployment.yaml
vendored
4
.github/workflows/design_deployment.yaml
vendored
@@ -16,10 +16,10 @@ jobs:
|
||||
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
|
||||
steps:
|
||||
- name: Check out files from GitHub
|
||||
uses: actions/checkout@v4.1.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4.0.2
|
||||
uses: actions/setup-node@v4.0.3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: yarn
|
||||
|
4
.github/workflows/design_preview.yaml
vendored
4
.github/workflows/design_preview.yaml
vendored
@@ -21,10 +21,10 @@ jobs:
|
||||
if: github.repository == 'home-assistant/frontend' && contains(github.event.pull_request.labels.*.name, 'needs design preview')
|
||||
steps:
|
||||
- name: Check out files from GitHub
|
||||
uses: actions/checkout@v4.1.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4.0.2
|
||||
uses: actions/setup-node@v4.0.3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: yarn
|
||||
|
8
.github/workflows/nightly.yaml
vendored
8
.github/workflows/nightly.yaml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@v4.1.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Set up Python ${{ env.PYTHON_VERSION }}
|
||||
uses: actions/setup-python@v5
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4.0.2
|
||||
uses: actions/setup-node@v4.0.3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: yarn
|
||||
@@ -57,14 +57,14 @@ jobs:
|
||||
run: tar -czvf translations.tar.gz translations
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
uses: actions/upload-artifact@v4.3.6
|
||||
with:
|
||||
name: wheels
|
||||
path: dist/home_assistant_frontend*.whl
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Upload translations
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
uses: actions/upload-artifact@v4.3.6
|
||||
with:
|
||||
name: translations
|
||||
path: translations.tar.gz
|
||||
|
2
.github/workflows/relative-ci.yaml
vendored
2
.github/workflows/relative-ci.yaml
vendored
@@ -17,7 +17,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Send bundle stats and build information to RelativeCI
|
||||
uses: relative-ci/agent-action@v2.1.10
|
||||
uses: relative-ci/agent-action@v2.1.12
|
||||
with:
|
||||
key: ${{ secrets[format('RELATIVE_CI_KEY_{0}_{1}', matrix.bundle, matrix.build)] }}
|
||||
token: ${{ github.token }}
|
||||
|
10
.github/workflows/release.yaml
vendored
10
.github/workflows/release.yaml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
contents: write # Required to upload release assets
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@v4.1.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Verify version
|
||||
uses: home-assistant/actions/helpers/verify-version@master
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4.0.2
|
||||
uses: actions/setup-node@v4.0.3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: yarn
|
||||
@@ -55,7 +55,7 @@ jobs:
|
||||
script/release
|
||||
|
||||
- name: Upload release assets
|
||||
uses: softprops/action-gh-release@v2.0.4
|
||||
uses: softprops/action-gh-release@v2.0.8
|
||||
with:
|
||||
files: |
|
||||
dist/*.whl
|
||||
@@ -74,9 +74,9 @@ jobs:
|
||||
echo "home-assistant-frontend==$version" > ./requirements.txt
|
||||
|
||||
- name: Build wheels
|
||||
uses: home-assistant/wheels@2024.01.0
|
||||
uses: home-assistant/wheels@2024.07.1
|
||||
with:
|
||||
abi: cp311
|
||||
abi: cp312
|
||||
tag: musllinux_1_2
|
||||
arch: amd64
|
||||
wheels-key: ${{ secrets.WHEELS_KEY }}
|
||||
|
2
.github/workflows/translations.yaml
vendored
2
.github/workflows/translations.yaml
vendored
@@ -13,7 +13,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@v4.1.2
|
||||
uses: actions/checkout@v4.1.7
|
||||
|
||||
- name: Upload Translations
|
||||
run: |
|
||||
|
@@ -1,4 +1 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
yarn run lint-staged --relative --shell "/bin/bash"
|
||||
|
55
.yarn/patches/workbox-build-npm-7.1.1-a854f3faae.patch
Normal file
55
.yarn/patches/workbox-build-npm-7.1.1-a854f3faae.patch
Normal file
@@ -0,0 +1,55 @@
|
||||
diff --git a/build/inject-manifest.js b/build/inject-manifest.js
|
||||
index 60e3d2bb51c11a19fbbedbad65e101082ec41c36..fed6026630f43f86e25446383982cf6fb694313b 100644
|
||||
--- a/build/inject-manifest.js
|
||||
+++ b/build/inject-manifest.js
|
||||
@@ -104,7 +104,7 @@ async function injectManifest(config) {
|
||||
replaceString: manifestString,
|
||||
searchString: options.injectionPoint,
|
||||
});
|
||||
- filesToWrite[options.swDest] = source;
|
||||
+ filesToWrite[options.swDest] = source.replace(url, encodeURI(upath_1.default.basename(destPath)));
|
||||
filesToWrite[destPath] = map;
|
||||
}
|
||||
else {
|
||||
diff --git a/build/lib/translate-url-to-sourcemap-paths.js b/build/lib/translate-url-to-sourcemap-paths.js
|
||||
index 3220c5474eeac6e8a56ca9b2ac2bd9be48529e43..5f003879a904d4840529a42dd056d288fd213771 100644
|
||||
--- a/build/lib/translate-url-to-sourcemap-paths.js
|
||||
+++ b/build/lib/translate-url-to-sourcemap-paths.js
|
||||
@@ -22,7 +22,7 @@ function translateURLToSourcemapPaths(url, swSrc, swDest) {
|
||||
const possibleSrcPath = upath_1.default.resolve(upath_1.default.dirname(swSrc), url);
|
||||
if (fs_extra_1.default.existsSync(possibleSrcPath)) {
|
||||
srcPath = possibleSrcPath;
|
||||
- destPath = upath_1.default.resolve(upath_1.default.dirname(swDest), url);
|
||||
+ destPath = `${swDest}.map`;
|
||||
}
|
||||
else {
|
||||
warning = `${errors_1.errors['cant-find-sourcemap']} ${possibleSrcPath}`;
|
||||
diff --git a/src/inject-manifest.ts b/src/inject-manifest.ts
|
||||
index 8795ddcaa77aea7b0356417e4bc4b19e2b3f860c..fcdc68342d9ac53936c9ed40a9ccfc2f5070cad3 100644
|
||||
--- a/src/inject-manifest.ts
|
||||
+++ b/src/inject-manifest.ts
|
||||
@@ -129,7 +129,10 @@ export async function injectManifest(
|
||||
searchString: options.injectionPoint!,
|
||||
});
|
||||
|
||||
- filesToWrite[options.swDest] = source;
|
||||
+ filesToWrite[options.swDest] = source.replace(
|
||||
+ url!,
|
||||
+ encodeURI(upath.basename(destPath)),
|
||||
+ );
|
||||
filesToWrite[destPath] = map;
|
||||
} else {
|
||||
// If there's no sourcemap associated with swSrc, a simple string
|
||||
diff --git a/src/lib/translate-url-to-sourcemap-paths.ts b/src/lib/translate-url-to-sourcemap-paths.ts
|
||||
index 072eac40d4ef5d095a01cb7f7e392a9e034853bd..f0bbe69e88ef3a415de18a7e9cb264daea273d71 100644
|
||||
--- a/src/lib/translate-url-to-sourcemap-paths.ts
|
||||
+++ b/src/lib/translate-url-to-sourcemap-paths.ts
|
||||
@@ -28,7 +28,7 @@ export function translateURLToSourcemapPaths(
|
||||
const possibleSrcPath = upath.resolve(upath.dirname(swSrc), url);
|
||||
if (fse.existsSync(possibleSrcPath)) {
|
||||
srcPath = possibleSrcPath;
|
||||
- destPath = upath.resolve(upath.dirname(swDest), url);
|
||||
+ destPath = `${swDest}.map`;
|
||||
} else {
|
||||
warning = `${errors['cant-find-sourcemap']} ${possibleSrcPath}`;
|
||||
}
|
893
.yarn/releases/yarn-4.1.1.cjs
vendored
893
.yarn/releases/yarn-4.1.1.cjs
vendored
File diff suppressed because one or more lines are too long
925
.yarn/releases/yarn-4.4.0.cjs
vendored
Executable file
925
.yarn/releases/yarn-4.4.0.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
@@ -6,4 +6,4 @@ enableGlobalCache: false
|
||||
|
||||
nodeLinker: node-modules
|
||||
|
||||
yarnPath: .yarn/releases/yarn-4.1.1.cjs
|
||||
yarnPath: .yarn/releases/yarn-4.4.0.cjs
|
||||
|
@@ -1,7 +1,56 @@
|
||||
import defineProvider from "@babel/helper-define-polyfill-provider";
|
||||
import { join } from "node:path";
|
||||
import paths from "../paths.cjs";
|
||||
|
||||
const POLYFILL_DIR = join(paths.polymer_dir, "src/resources/polyfills");
|
||||
|
||||
// List of polyfill keys with supported browser targets for the functionality
|
||||
const PolyfillSupport = {
|
||||
// Note states and shadowRoot properties should be supported.
|
||||
"element-internals": {
|
||||
android: 90,
|
||||
chrome: 90,
|
||||
edge: 90,
|
||||
firefox: 126,
|
||||
ios: 17.4,
|
||||
opera: 76,
|
||||
opera_mobile: 64,
|
||||
safari: 17.4,
|
||||
samsung: 15.0,
|
||||
},
|
||||
"element-append": {
|
||||
android: 54,
|
||||
chrome: 54,
|
||||
edge: 17,
|
||||
firefox: 49,
|
||||
ios: 10.0,
|
||||
opera: 41,
|
||||
opera_mobile: 41,
|
||||
safari: 10.0,
|
||||
samsung: 6.0,
|
||||
},
|
||||
"element-getattributenames": {
|
||||
android: 61,
|
||||
chrome: 61,
|
||||
edge: 18,
|
||||
firefox: 45,
|
||||
ios: 10.3,
|
||||
opera: 48,
|
||||
opera_mobile: 45,
|
||||
safari: 10.1,
|
||||
samsung: 8.0,
|
||||
},
|
||||
"element-toggleattribute": {
|
||||
android: 69,
|
||||
chrome: 69,
|
||||
edge: 18,
|
||||
firefox: 63,
|
||||
ios: 12.0,
|
||||
opera: 56,
|
||||
opera_mobile: 48,
|
||||
safari: 12.0,
|
||||
samsung: 10.0,
|
||||
},
|
||||
fetch: {
|
||||
android: 42,
|
||||
chrome: 42,
|
||||
@@ -13,6 +62,31 @@ const PolyfillSupport = {
|
||||
safari: 10.1,
|
||||
samsung: 4.0,
|
||||
},
|
||||
"intl-getcanonicallocales": {
|
||||
android: 54,
|
||||
chrome: 54,
|
||||
edge: 16,
|
||||
firefox: 48,
|
||||
ios: 10.3,
|
||||
opera: 41,
|
||||
opera_mobile: 41,
|
||||
safari: 10.1,
|
||||
samsung: 6.0,
|
||||
},
|
||||
"intl-locale": {
|
||||
android: 74,
|
||||
chrome: 74,
|
||||
edge: 79,
|
||||
firefox: 75,
|
||||
ios: 14.0,
|
||||
opera: 62,
|
||||
opera_mobile: 53,
|
||||
safari: 14.0,
|
||||
samsung: 11.0,
|
||||
},
|
||||
"intl-other": {
|
||||
// Not specified (i.e. always try polyfill) since compatibility depends on supported locales
|
||||
},
|
||||
proxy: {
|
||||
android: 49,
|
||||
chrome: 49,
|
||||
@@ -24,17 +98,67 @@ const PolyfillSupport = {
|
||||
safari: 10.0,
|
||||
samsung: 5.0,
|
||||
},
|
||||
"resize-observer": {
|
||||
android: 64,
|
||||
chrome: 64,
|
||||
edge: 79,
|
||||
firefox: 69,
|
||||
ios: 13.4,
|
||||
opera: 51,
|
||||
opera_mobile: 47,
|
||||
safari: 13.1,
|
||||
samsung: 9.0,
|
||||
},
|
||||
};
|
||||
|
||||
// Map of global variables and/or instance and static properties to the
|
||||
// corresponding polyfill key and actual module to import
|
||||
const polyfillMap = {
|
||||
global: {
|
||||
Proxy: { key: "proxy", module: "proxy-polyfill" },
|
||||
fetch: { key: "fetch", module: "unfetch/polyfill" },
|
||||
Proxy: { key: "proxy", module: "proxy-polyfill" },
|
||||
ResizeObserver: {
|
||||
key: "resize-observer",
|
||||
module: join(POLYFILL_DIR, "resize-observer.ts"),
|
||||
},
|
||||
},
|
||||
instance: {
|
||||
attachInternals: {
|
||||
key: "element-internals",
|
||||
module: "element-internals-polyfill",
|
||||
},
|
||||
...Object.fromEntries(
|
||||
["append", "getAttributeNames", "toggleAttribute"].map((prop) => {
|
||||
const key = `element-${prop.toLowerCase()}`;
|
||||
return [prop, { key, module: join(POLYFILL_DIR, `${key}.ts`) }];
|
||||
})
|
||||
),
|
||||
},
|
||||
static: {
|
||||
Intl: {
|
||||
getCanonicalLocales: {
|
||||
key: "intl-getcanonicallocales",
|
||||
module: join(POLYFILL_DIR, "intl-polyfill.ts"),
|
||||
},
|
||||
Locale: {
|
||||
key: "intl-locale",
|
||||
module: join(POLYFILL_DIR, "intl-polyfill.ts"),
|
||||
},
|
||||
...Object.fromEntries(
|
||||
[
|
||||
"DateTimeFormat",
|
||||
"DisplayNames",
|
||||
"ListFormat",
|
||||
"NumberFormat",
|
||||
"PluralRules",
|
||||
"RelativeTimeFormat",
|
||||
].map((obj) => [
|
||||
obj,
|
||||
{ key: "intl-other", module: join(POLYFILL_DIR, "intl-polyfill.ts") },
|
||||
])
|
||||
),
|
||||
},
|
||||
},
|
||||
instance: {},
|
||||
static: {},
|
||||
};
|
||||
|
||||
// Create plugin using the same factory as for CoreJS
|
||||
@@ -42,14 +166,16 @@ export default defineProvider(
|
||||
({ createMetaResolver, debug, shouldInjectPolyfill }) => {
|
||||
const resolvePolyfill = createMetaResolver(polyfillMap);
|
||||
return {
|
||||
name: "HA Custom",
|
||||
name: "custom-polyfill",
|
||||
polyfills: PolyfillSupport,
|
||||
usageGlobal(meta, utils) {
|
||||
const polyfill = resolvePolyfill(meta);
|
||||
if (polyfill && shouldInjectPolyfill(polyfill.desc.key)) {
|
||||
debug(polyfill.desc.key);
|
||||
utils.injectGlobalImport(polyfill.desc.module);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@@ -3,6 +3,8 @@ const env = require("./env.cjs");
|
||||
const paths = require("./paths.cjs");
|
||||
const { dependencies } = require("../package.json");
|
||||
|
||||
const BABEL_PLUGINS = path.join(__dirname, "babel-plugins");
|
||||
|
||||
// GitHub base URL to use for production source maps
|
||||
// Nightly builds use the commit SHA, otherwise assumes there is a tag that matches the version
|
||||
module.exports.sourceMapURL = () => {
|
||||
@@ -45,7 +47,7 @@ module.exports.emptyPackages = ({ latestBuild, isHassioBuild }) =>
|
||||
|
||||
module.exports.definedVars = ({ isProdBuild, latestBuild, defineOverlay }) => ({
|
||||
__DEV__: !isProdBuild,
|
||||
__BUILD__: JSON.stringify(latestBuild ? "latest" : "es5"),
|
||||
__BUILD__: JSON.stringify(latestBuild ? "modern" : "legacy"),
|
||||
__VERSION__: JSON.stringify(env.version()),
|
||||
__DEMO__: false,
|
||||
__SUPERVISOR__: false,
|
||||
@@ -77,7 +79,12 @@ module.exports.terserOptions = ({ latestBuild, isTestBuild }) => ({
|
||||
sourceMap: !isTestBuild,
|
||||
});
|
||||
|
||||
module.exports.babelOptions = ({ latestBuild, isProdBuild, isTestBuild }) => ({
|
||||
module.exports.babelOptions = ({
|
||||
latestBuild,
|
||||
isProdBuild,
|
||||
isTestBuild,
|
||||
sw,
|
||||
}) => ({
|
||||
babelrc: false,
|
||||
compact: false,
|
||||
assumptions: {
|
||||
@@ -85,13 +92,13 @@ module.exports.babelOptions = ({ latestBuild, isProdBuild, isTestBuild }) => ({
|
||||
setPublicClassFields: true,
|
||||
setSpreadProperties: true,
|
||||
},
|
||||
browserslistEnv: latestBuild ? "modern" : "legacy",
|
||||
browserslistEnv: latestBuild ? "modern" : `legacy${sw ? "-sw" : ""}`,
|
||||
presets: [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
useBuiltIns: latestBuild ? false : "usage",
|
||||
corejs: latestBuild ? false : dependencies["core-js"],
|
||||
useBuiltIns: "usage",
|
||||
corejs: dependencies["core-js"],
|
||||
bugfixes: true,
|
||||
shippedProposals: true,
|
||||
},
|
||||
@@ -100,22 +107,12 @@ module.exports.babelOptions = ({ latestBuild, isProdBuild, isTestBuild }) => ({
|
||||
],
|
||||
plugins: [
|
||||
[
|
||||
path.resolve(
|
||||
paths.polymer_dir,
|
||||
"build-scripts/babel-plugins/inline-constants-plugin.cjs"
|
||||
),
|
||||
path.join(BABEL_PLUGINS, "inline-constants-plugin.cjs"),
|
||||
{
|
||||
modules: ["@mdi/js"],
|
||||
ignoreModuleNotFound: true,
|
||||
},
|
||||
],
|
||||
[
|
||||
path.resolve(
|
||||
paths.polymer_dir,
|
||||
"build-scripts/babel-plugins/custom-polyfill-plugin.js"
|
||||
),
|
||||
{ method: "usage-global" },
|
||||
],
|
||||
// Minify template literals for production
|
||||
isProdBuild && [
|
||||
"template-html-minifier",
|
||||
@@ -143,8 +140,14 @@ module.exports.babelOptions = ({ latestBuild, isProdBuild, isTestBuild }) => ({
|
||||
"@babel/plugin-transform-runtime",
|
||||
{ version: dependencies["@babel/runtime"] },
|
||||
],
|
||||
// Support some proposals still in TC39 process
|
||||
["@babel/plugin-proposal-decorators", { decoratorsBeforeExport: true }],
|
||||
// Transpile decorators (still in TC39 process)
|
||||
// Modern browsers support class fields and private methods, but transform is required with the older decorator version dictated by Lit
|
||||
[
|
||||
"@babel/plugin-proposal-decorators",
|
||||
{ version: "2018-09", decoratorsBeforeExport: true },
|
||||
],
|
||||
"@babel/plugin-transform-class-properties",
|
||||
"@babel/plugin-transform-private-methods",
|
||||
].filter(Boolean),
|
||||
exclude: [
|
||||
// \\ for Windows, / for Mac OS and Linux
|
||||
@@ -153,6 +156,27 @@ module.exports.babelOptions = ({ latestBuild, isProdBuild, isTestBuild }) => ({
|
||||
],
|
||||
sourceMaps: !isTestBuild,
|
||||
overrides: [
|
||||
{
|
||||
// Add plugin to inject various polyfills, excluding the polyfills
|
||||
// themselves to prevent self-injection.
|
||||
plugins: [
|
||||
[
|
||||
path.join(BABEL_PLUGINS, "custom-polyfill-plugin.js"),
|
||||
{ method: "usage-global" },
|
||||
],
|
||||
],
|
||||
exclude: [
|
||||
path.join(paths.polymer_dir, "src/resources/polyfills"),
|
||||
...[
|
||||
"@formatjs/(?:ecma402-abstract|intl-\\w+)",
|
||||
"@lit-labs/virtualizer/polyfills",
|
||||
"@webcomponents/scoped-custom-element-registry",
|
||||
"element-internals-polyfill",
|
||||
"proxy-polyfill",
|
||||
"unfetch",
|
||||
].map((p) => new RegExp(`/node_modules/${p}/`)),
|
||||
],
|
||||
},
|
||||
{
|
||||
// Use unambiguous for dependencies so that require() is correctly injected into CommonJS files
|
||||
// Exclusions are needed in some cases where ES modules have no static imports or exports, such as polyfills
|
||||
@@ -202,7 +226,13 @@ module.exports.config = {
|
||||
return {
|
||||
name: "frontend" + nameSuffix(latestBuild),
|
||||
entry: {
|
||||
service_worker: "./src/entrypoints/service_worker.ts",
|
||||
"service-worker":
|
||||
!env.useRollup() && !latestBuild
|
||||
? {
|
||||
import: "./src/entrypoints/service-worker.ts",
|
||||
layer: "sw",
|
||||
}
|
||||
: "./src/entrypoints/service-worker.ts",
|
||||
app: "./src/entrypoints/app.ts",
|
||||
authorize: "./src/entrypoints/authorize.ts",
|
||||
onboarding: "./src/entrypoints/onboarding.ts",
|
||||
|
@@ -32,4 +32,7 @@ module.exports = {
|
||||
}
|
||||
return version[1];
|
||||
},
|
||||
isDevContainer() {
|
||||
return process.env.DEV_CONTAINER === "1";
|
||||
},
|
||||
};
|
||||
|
@@ -1,19 +1,54 @@
|
||||
// Tasks to compress
|
||||
|
||||
import { constants } from "node:zlib";
|
||||
import gulp from "gulp";
|
||||
import brotli from "gulp-brotli";
|
||||
import zopfli from "gulp-zopfli-green";
|
||||
import paths from "../paths.cjs";
|
||||
|
||||
const filesGlob = "*.{js,json,css,svg,xml}";
|
||||
const brotliOptions = {
|
||||
skipLarger: true,
|
||||
params: {
|
||||
[constants.BROTLI_PARAM_QUALITY]: constants.BROTLI_MAX_QUALITY,
|
||||
},
|
||||
};
|
||||
const zopfliOptions = { threshold: 150 };
|
||||
|
||||
const compressDist = (rootDir) =>
|
||||
const compressDistBrotli = (rootDir, modernDir) =>
|
||||
gulp
|
||||
.src([
|
||||
`${rootDir}/**/*.{js,json,css,svg,xml}`,
|
||||
`${rootDir}/{authorize,onboarding}.html`,
|
||||
])
|
||||
.src([`${modernDir}/**/${filesGlob}`, `${rootDir}/sw-modern.js`], {
|
||||
base: rootDir,
|
||||
})
|
||||
.pipe(brotli(brotliOptions))
|
||||
.pipe(gulp.dest(rootDir));
|
||||
|
||||
const compressDistZopfli = (rootDir, modernDir) =>
|
||||
gulp
|
||||
.src(
|
||||
[
|
||||
`${rootDir}/**/${filesGlob}`,
|
||||
`!${modernDir}/**/${filesGlob}`,
|
||||
`!${rootDir}/{sw-modern,service_worker}.js`,
|
||||
`${rootDir}/{authorize,onboarding}.html`,
|
||||
],
|
||||
{ base: rootDir }
|
||||
)
|
||||
.pipe(zopfli(zopfliOptions))
|
||||
.pipe(gulp.dest(rootDir));
|
||||
|
||||
gulp.task("compress-app", () => compressDist(paths.app_output_root));
|
||||
gulp.task("compress-hassio", () => compressDist(paths.hassio_output_root));
|
||||
const compressAppBrotli = () =>
|
||||
compressDistBrotli(paths.app_output_root, paths.app_output_latest);
|
||||
const compressHassioBrotli = () =>
|
||||
compressDistBrotli(paths.hassio_output_root, paths.hassio_output_latest);
|
||||
|
||||
const compressAppZopfli = () =>
|
||||
compressDistZopfli(paths.app_output_root, paths.app_output_latest);
|
||||
const compressHassioZopfli = () =>
|
||||
compressDistZopfli(paths.hassio_output_root, paths.hassio_output_latest);
|
||||
|
||||
gulp.task("compress-app", gulp.parallel(compressAppBrotli, compressAppZopfli));
|
||||
gulp.task(
|
||||
"compress-hassio",
|
||||
gulp.parallel(compressHassioBrotli, compressHassioZopfli)
|
||||
);
|
||||
|
@@ -1,28 +1,76 @@
|
||||
// Tasks to generate entry HTML
|
||||
|
||||
import {
|
||||
applyVersionsToRegexes,
|
||||
compileRegex,
|
||||
getPreUserAgentRegexes,
|
||||
} from "browserslist-useragent-regexp";
|
||||
import fs from "fs-extra";
|
||||
import gulp from "gulp";
|
||||
import { minify } from "html-minifier-terser";
|
||||
import template from "lodash.template";
|
||||
import path from "path";
|
||||
import { dirname, extname, resolve } from "node:path";
|
||||
import { htmlMinifierOptions, terserOptions } from "../bundle.cjs";
|
||||
import env from "../env.cjs";
|
||||
import paths from "../paths.cjs";
|
||||
|
||||
// macOS companion app has no way to obtain the Safari version used by WKWebView,
|
||||
// and it is not in the default user agent string. So we add an additional regex
|
||||
// to serve modern based on a minimum macOS version. We take the minimum Safari
|
||||
// major version from browserslist and manually map that to a supported macOS
|
||||
// version. Note this assumes the user has kept Safari updated.
|
||||
const HA_MACOS_REGEX =
|
||||
/Home Assistant\/[\d.]+ \(.+; macOS (\d+)\.(\d+)(?:\.(\d+))?\)/;
|
||||
const SAFARI_TO_MACOS = {
|
||||
15: [10, 15, 0],
|
||||
16: [11, 0, 0],
|
||||
17: [12, 0, 0],
|
||||
18: [13, 0, 0],
|
||||
};
|
||||
|
||||
const getCommonTemplateVars = () => {
|
||||
const browserRegexes = getPreUserAgentRegexes({
|
||||
env: "modern",
|
||||
allowHigherVersions: true,
|
||||
mobileToDesktop: true,
|
||||
throwOnMissing: true,
|
||||
});
|
||||
const minSafariVersion = browserRegexes.find(
|
||||
(regex) => regex.family === "safari"
|
||||
)?.matchedVersions[0][0];
|
||||
const minMacOSVersion = SAFARI_TO_MACOS[minSafariVersion];
|
||||
if (!minMacOSVersion) {
|
||||
throw Error(
|
||||
`Could not find minimum MacOS version for Safari ${minSafariVersion}.`
|
||||
);
|
||||
}
|
||||
const haMacOSRegex = applyVersionsToRegexes(
|
||||
[
|
||||
{
|
||||
family: "ha_macos",
|
||||
regex: HA_MACOS_REGEX,
|
||||
matchedVersions: [minMacOSVersion],
|
||||
requestVersions: [minMacOSVersion],
|
||||
},
|
||||
],
|
||||
{ ignorePatch: true, allowHigherVersions: true }
|
||||
);
|
||||
return {
|
||||
useRollup: env.useRollup(),
|
||||
useWDS: env.useWDS(),
|
||||
modernRegex: compileRegex(browserRegexes.concat(haMacOSRegex)).toString(),
|
||||
};
|
||||
};
|
||||
|
||||
const renderTemplate = (templateFile, data = {}) => {
|
||||
const compiled = template(
|
||||
fs.readFileSync(templateFile, { encoding: "utf-8" })
|
||||
);
|
||||
return compiled({
|
||||
...data,
|
||||
useRollup: env.useRollup(),
|
||||
useWDS: env.useWDS(),
|
||||
// Resolve any child/nested templates relative to the parent and pass the same data
|
||||
renderTemplate: (childTemplate) =>
|
||||
renderTemplate(
|
||||
path.resolve(path.dirname(templateFile), childTemplate),
|
||||
data
|
||||
),
|
||||
renderTemplate(resolve(dirname(templateFile), childTemplate), data),
|
||||
});
|
||||
};
|
||||
|
||||
@@ -56,10 +104,12 @@ const genPagesDevTask =
|
||||
publicRoot = ""
|
||||
) =>
|
||||
async () => {
|
||||
const commonVars = getCommonTemplateVars();
|
||||
for (const [page, entries] of Object.entries(pageEntries)) {
|
||||
const content = renderTemplate(
|
||||
path.resolve(inputRoot, inputSub, `${page}.template`),
|
||||
resolve(inputRoot, inputSub, `${page}.template`),
|
||||
{
|
||||
...commonVars,
|
||||
latestEntryJS: entries.map((entry) =>
|
||||
useWDS
|
||||
? `http://localhost:8000/src/entrypoints/${entry}.ts`
|
||||
@@ -74,7 +124,7 @@ const genPagesDevTask =
|
||||
es5CustomPanelJS: `${publicRoot}/frontend_es5/custom-panel.js`,
|
||||
}
|
||||
);
|
||||
fs.outputFileSync(path.resolve(outputRoot, page), content);
|
||||
fs.outputFileSync(resolve(outputRoot, page), content);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -91,16 +141,18 @@ const genPagesProdTask =
|
||||
) =>
|
||||
async () => {
|
||||
const latestManifest = fs.readJsonSync(
|
||||
path.resolve(outputLatest, "manifest.json")
|
||||
resolve(outputLatest, "manifest.json")
|
||||
);
|
||||
const es5Manifest = outputES5
|
||||
? fs.readJsonSync(path.resolve(outputES5, "manifest.json"))
|
||||
? fs.readJsonSync(resolve(outputES5, "manifest.json"))
|
||||
: {};
|
||||
const commonVars = getCommonTemplateVars();
|
||||
const minifiedHTML = [];
|
||||
for (const [page, entries] of Object.entries(pageEntries)) {
|
||||
const content = renderTemplate(
|
||||
path.resolve(inputRoot, inputSub, `${page}.template`),
|
||||
resolve(inputRoot, inputSub, `${page}.template`),
|
||||
{
|
||||
...commonVars,
|
||||
latestEntryJS: entries.map((entry) => latestManifest[`${entry}.js`]),
|
||||
es5EntryJS: entries.map((entry) => es5Manifest[`${entry}.js`]),
|
||||
latestCustomPanelJS: latestManifest["custom-panel.js"],
|
||||
@@ -108,8 +160,8 @@ const genPagesProdTask =
|
||||
}
|
||||
);
|
||||
minifiedHTML.push(
|
||||
minifyHtml(content, path.extname(page)).then((minified) =>
|
||||
fs.outputFileSync(path.resolve(outputRoot, page), minified)
|
||||
minifyHtml(content, extname(page)).then((minified) =>
|
||||
fs.outputFileSync(resolve(outputRoot, page), minified)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ import gulp from "gulp";
|
||||
import jszip from "jszip";
|
||||
import path from "path";
|
||||
import process from "process";
|
||||
import tar from "tar";
|
||||
import { extract } from "tar";
|
||||
|
||||
const MAX_AGE = 24; // hours
|
||||
const OWNER = "home-assistant";
|
||||
@@ -156,7 +156,7 @@ gulp.task("fetch-nightly-translations", async function () {
|
||||
console.log("Unpacking downloaded translations...");
|
||||
const zip = await jszip.loadAsync(downloadResponse.data);
|
||||
await deleteCurrent;
|
||||
const extractStream = zip.file(/.*/)[0].nodeStream().pipe(tar.extract());
|
||||
const extractStream = zip.file(/.*/)[0].nodeStream().pipe(extract());
|
||||
await new Promise((resolve, reject) => {
|
||||
extractStream.on("close", resolve).on("error", reject);
|
||||
});
|
||||
|
@@ -1,20 +1,19 @@
|
||||
// Generate service worker.
|
||||
// Based on manifest, create a file with the content as service_worker.js
|
||||
// Generate service workers
|
||||
|
||||
import fs from "fs-extra";
|
||||
import { deleteAsync } from "del";
|
||||
import gulp from "gulp";
|
||||
import path from "path";
|
||||
import sourceMapUrl from "source-map-url";
|
||||
import workboxBuild from "workbox-build";
|
||||
import { mkdir, readFile, symlink, writeFile } from "node:fs/promises";
|
||||
import { basename, join, relative } from "node:path";
|
||||
import { injectManifest } from "workbox-build";
|
||||
import paths from "../paths.cjs";
|
||||
|
||||
const swDest = path.resolve(paths.app_output_root, "service_worker.js");
|
||||
const SW_MAP = {
|
||||
[paths.app_output_latest]: "modern",
|
||||
[paths.app_output_es5]: "legacy",
|
||||
};
|
||||
|
||||
const writeSW = (content) => fs.outputFileSync(swDest, content.trim() + "\n");
|
||||
|
||||
gulp.task("gen-service-worker-app-dev", (done) => {
|
||||
writeSW(
|
||||
`
|
||||
const SW_DEV =
|
||||
`
|
||||
console.debug('Service worker disabled in development');
|
||||
|
||||
self.addEventListener('install', (event) => {
|
||||
@@ -22,72 +21,67 @@ self.addEventListener('install', (event) => {
|
||||
// removing any prod service worker the dev might have running
|
||||
self.skipWaiting();
|
||||
});
|
||||
`
|
||||
`.trim() + "\n";
|
||||
|
||||
gulp.task("gen-service-worker-app-dev", async () => {
|
||||
await mkdir(paths.app_output_root, { recursive: true });
|
||||
await Promise.all(
|
||||
Object.values(SW_MAP).map((build) =>
|
||||
writeFile(join(paths.app_output_root, `sw-${build}.js`), SW_DEV, {
|
||||
encoding: "utf-8",
|
||||
})
|
||||
)
|
||||
);
|
||||
done();
|
||||
});
|
||||
|
||||
gulp.task("gen-service-worker-app-prod", async () => {
|
||||
// Read bundled source file
|
||||
const bundleManifestLatest = fs.readJsonSync(
|
||||
path.resolve(paths.app_output_latest, "manifest.json")
|
||||
);
|
||||
let serviceWorkerContent = fs.readFileSync(
|
||||
paths.app_output_root + bundleManifestLatest["service_worker.js"],
|
||||
"utf-8"
|
||||
);
|
||||
|
||||
// Delete old file from frontend_latest so manifest won't pick it up
|
||||
fs.removeSync(
|
||||
paths.app_output_root + bundleManifestLatest["service_worker.js"]
|
||||
);
|
||||
fs.removeSync(
|
||||
paths.app_output_root + bundleManifestLatest["service_worker.js.map"]
|
||||
);
|
||||
|
||||
// Remove ES5
|
||||
const bundleManifestES5 = fs.readJsonSync(
|
||||
path.resolve(paths.app_output_es5, "manifest.json")
|
||||
);
|
||||
fs.removeSync(paths.app_output_root + bundleManifestES5["service_worker.js"]);
|
||||
fs.removeSync(
|
||||
paths.app_output_root + bundleManifestES5["service_worker.js.map"]
|
||||
);
|
||||
|
||||
const workboxManifest = await workboxBuild.getManifest({
|
||||
// Files that mach this pattern will be considered unique and skip revision check
|
||||
// ignore JS files + translation files
|
||||
dontCacheBustURLsMatching: /(frontend_latest\/.+|static\/translations\/.+)/,
|
||||
|
||||
globDirectory: paths.app_output_root,
|
||||
globPatterns: [
|
||||
"frontend_latest/*.js",
|
||||
// Cache all English translations because we catch them as fallback
|
||||
// Using pattern to match hash instead of * to avoid caching en-GB
|
||||
// 'v' added as valid hash letter because in dev we hash with 'dev'
|
||||
"static/translations/**/en-+([a-fv0-9]).json",
|
||||
// Icon shown on splash screen
|
||||
"static/icons/favicon-192x192.png",
|
||||
"static/icons/favicon.ico",
|
||||
// Common fonts
|
||||
"static/fonts/roboto/Roboto-Light.woff2",
|
||||
"static/fonts/roboto/Roboto-Medium.woff2",
|
||||
"static/fonts/roboto/Roboto-Regular.woff2",
|
||||
"static/fonts/roboto/Roboto-Bold.woff2",
|
||||
],
|
||||
});
|
||||
|
||||
for (const warning of workboxManifest.warnings) {
|
||||
console.warn(warning);
|
||||
}
|
||||
|
||||
// remove source map and add WB manifest
|
||||
serviceWorkerContent = sourceMapUrl.removeFrom(serviceWorkerContent);
|
||||
serviceWorkerContent = serviceWorkerContent.replace(
|
||||
"WB_MANIFEST",
|
||||
JSON.stringify(workboxManifest.manifestEntries)
|
||||
);
|
||||
|
||||
// Write new file to root
|
||||
fs.writeFileSync(swDest, serviceWorkerContent);
|
||||
});
|
||||
gulp.task("gen-service-worker-app-prod", () =>
|
||||
Promise.all(
|
||||
Object.entries(SW_MAP).map(async ([outPath, build]) => {
|
||||
const manifest = JSON.parse(
|
||||
await readFile(join(outPath, "manifest.json"), "utf-8")
|
||||
);
|
||||
const swSrc = join(paths.app_output_root, manifest["service-worker.js"]);
|
||||
const swDest = join(paths.app_output_root, `sw-${build}.js`);
|
||||
const buildDir = relative(paths.app_output_root, outPath);
|
||||
const { warnings } = await injectManifest({
|
||||
swSrc,
|
||||
swDest,
|
||||
injectionPoint: "__WB_MANIFEST__",
|
||||
// Files that mach this pattern will be considered unique and skip revision check
|
||||
// ignore JS files + translation files
|
||||
dontCacheBustURLsMatching: new RegExp(
|
||||
`(?:${buildDir}/.+|static/translations/.+)`
|
||||
),
|
||||
globDirectory: paths.app_output_root,
|
||||
globPatterns: [
|
||||
`${buildDir}/*.js`,
|
||||
// Cache all English translations because we catch them as fallback
|
||||
// Using pattern to match hash instead of * to avoid caching en-GB
|
||||
// 'v' added as valid hash letter because in dev we hash with 'dev'
|
||||
"static/translations/**/en-+([a-fv0-9]).json",
|
||||
// Icon shown on splash screen
|
||||
"static/icons/favicon-192x192.png",
|
||||
"static/icons/favicon.ico",
|
||||
// Common fonts
|
||||
"static/fonts/roboto/Roboto-Light.woff2",
|
||||
"static/fonts/roboto/Roboto-Medium.woff2",
|
||||
"static/fonts/roboto/Roboto-Regular.woff2",
|
||||
"static/fonts/roboto/Roboto-Bold.woff2",
|
||||
],
|
||||
globIgnores: [`${buildDir}/service-worker*`],
|
||||
});
|
||||
if (warnings.length > 0) {
|
||||
console.warn(
|
||||
`Problems while injecting ${build} service worker:\n`,
|
||||
warnings.join("\n")
|
||||
);
|
||||
}
|
||||
await deleteAsync(`${swSrc}?(.map)`);
|
||||
// Needed to install new SW from a cached HTML
|
||||
if (build === "modern") {
|
||||
const swOld = join(paths.app_output_root, "service_worker.js");
|
||||
await symlink(basename(swDest), swOld);
|
||||
}
|
||||
})
|
||||
)
|
||||
);
|
||||
|
@@ -1,92 +1,112 @@
|
||||
import { createHash } from "crypto";
|
||||
import { deleteSync } from "del";
|
||||
import { mkdirSync, readdirSync, readFileSync, renameSync } from "fs";
|
||||
import { writeFile } from "node:fs/promises";
|
||||
/* eslint-disable max-classes-per-file */
|
||||
|
||||
import { deleteAsync } from "del";
|
||||
import { glob } from "glob";
|
||||
import gulp from "gulp";
|
||||
import flatmap from "gulp-flatmap";
|
||||
import transform from "gulp-json-transform";
|
||||
import merge from "gulp-merge-json";
|
||||
import rename from "gulp-rename";
|
||||
import path from "path";
|
||||
import vinylBuffer from "vinyl-buffer";
|
||||
import source from "vinyl-source-stream";
|
||||
import merge from "lodash.merge";
|
||||
import { createHash } from "node:crypto";
|
||||
import { mkdir, readFile } from "node:fs/promises";
|
||||
import { basename, join } from "node:path";
|
||||
import { PassThrough, Transform } from "node:stream";
|
||||
import { finished } from "node:stream/promises";
|
||||
import env from "../env.cjs";
|
||||
import paths from "../paths.cjs";
|
||||
import { mapFiles } from "../util.cjs";
|
||||
import "./fetch-nightly-translations.js";
|
||||
|
||||
const inFrontendDir = "translations/frontend";
|
||||
const inBackendDir = "translations/backend";
|
||||
const workDir = "build/translations";
|
||||
const fullDir = workDir + "/full";
|
||||
const coreDir = workDir + "/core";
|
||||
const outDir = workDir + "/output";
|
||||
const outDir = join(workDir, "output");
|
||||
const EN_SRC = join(paths.translations_src, "en.json");
|
||||
const TEST_LOCALE = "en-x-test";
|
||||
|
||||
let mergeBackend = false;
|
||||
|
||||
gulp.task(
|
||||
"translations-enable-merge-backend",
|
||||
gulp.parallel((done) => {
|
||||
gulp.parallel(async () => {
|
||||
mergeBackend = true;
|
||||
done();
|
||||
}, "allow-setup-fetch-nightly-translations")
|
||||
);
|
||||
|
||||
// Panel translations which should be split from the core translations.
|
||||
const TRANSLATION_FRAGMENTS = Object.keys(
|
||||
JSON.parse(
|
||||
readFileSync(
|
||||
path.resolve(paths.polymer_dir, "src/translations/en.json"),
|
||||
"utf-8"
|
||||
)
|
||||
).ui.panel
|
||||
);
|
||||
// Transform stream to apply a function on Vinyl JSON files (buffer mode only).
|
||||
// The provided function can either return a new object, or an array of
|
||||
// [object, subdirectory] pairs for fragmentizing the JSON.
|
||||
class CustomJSON extends Transform {
|
||||
constructor(func, reviver = null) {
|
||||
super({ objectMode: true });
|
||||
this._func = func;
|
||||
this._reviver = reviver;
|
||||
}
|
||||
|
||||
function recursiveFlatten(prefix, data) {
|
||||
let output = {};
|
||||
Object.keys(data).forEach((key) => {
|
||||
if (typeof data[key] === "object") {
|
||||
output = {
|
||||
...output,
|
||||
...recursiveFlatten(prefix + key + ".", data[key]),
|
||||
};
|
||||
async _transform(file, _, callback) {
|
||||
try {
|
||||
let obj = JSON.parse(file.contents.toString(), this._reviver);
|
||||
if (this._func) obj = this._func(obj, file.path);
|
||||
for (const [outObj, dir] of Array.isArray(obj) ? obj : [[obj, ""]]) {
|
||||
const outFile = file.clone({ contents: false });
|
||||
outFile.contents = Buffer.from(JSON.stringify(outObj));
|
||||
outFile.dirname += `/${dir}`;
|
||||
this.push(outFile);
|
||||
}
|
||||
callback(null);
|
||||
} catch (err) {
|
||||
callback(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Transform stream to merge Vinyl JSON files (buffer mode only).
|
||||
class MergeJSON extends Transform {
|
||||
_objects = [];
|
||||
|
||||
constructor(stem, startObj = {}, reviver = null) {
|
||||
super({ objectMode: true, allowHalfOpen: false });
|
||||
this._stem = stem;
|
||||
this._startObj = structuredClone(startObj);
|
||||
this._reviver = reviver;
|
||||
}
|
||||
|
||||
async _transform(file, _, callback) {
|
||||
try {
|
||||
this._objects.push(JSON.parse(file.contents.toString(), this._reviver));
|
||||
if (!this._outFile) this._outFile = file.clone({ contents: false });
|
||||
callback(null);
|
||||
} catch (err) {
|
||||
callback(err);
|
||||
}
|
||||
}
|
||||
|
||||
async _flush(callback) {
|
||||
try {
|
||||
const mergedObj = merge(this._startObj, ...this._objects);
|
||||
this._outFile.contents = Buffer.from(JSON.stringify(mergedObj));
|
||||
this._outFile.stem = this._stem;
|
||||
callback(null, this._outFile);
|
||||
} catch (err) {
|
||||
callback(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Utility to flatten object keys to single level using separator
|
||||
const flatten = (data, prefix = "", sep = ".") => {
|
||||
const output = {};
|
||||
for (const [key, value] of Object.entries(data)) {
|
||||
if (typeof value === "object") {
|
||||
Object.assign(output, flatten(value, prefix + key + sep, sep));
|
||||
} else {
|
||||
output[prefix + key] = data[key];
|
||||
output[prefix + key] = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
return output;
|
||||
}
|
||||
};
|
||||
|
||||
function flatten(data) {
|
||||
return recursiveFlatten("", data);
|
||||
}
|
||||
|
||||
function emptyFilter(data) {
|
||||
const newData = {};
|
||||
Object.keys(data).forEach((key) => {
|
||||
if (data[key]) {
|
||||
if (typeof data[key] === "object") {
|
||||
newData[key] = emptyFilter(data[key]);
|
||||
} else {
|
||||
newData[key] = data[key];
|
||||
}
|
||||
}
|
||||
});
|
||||
return newData;
|
||||
}
|
||||
|
||||
function recursiveEmpty(data) {
|
||||
const newData = {};
|
||||
Object.keys(data).forEach((key) => {
|
||||
if (data[key]) {
|
||||
if (typeof data[key] === "object") {
|
||||
newData[key] = recursiveEmpty(data[key]);
|
||||
} else {
|
||||
newData[key] = "TRANSLATED";
|
||||
}
|
||||
}
|
||||
});
|
||||
return newData;
|
||||
}
|
||||
// Filter functions that can be passed directly to JSON.parse()
|
||||
const emptyReviver = (_key, value) => value || undefined;
|
||||
const testReviver = (_key, value) =>
|
||||
value && typeof value === "string" ? "TRANSLATED" : value;
|
||||
|
||||
/**
|
||||
* Replace Lokalise key placeholders with their actual values.
|
||||
@@ -95,60 +115,44 @@ function recursiveEmpty(data) {
|
||||
* be included in src/translations/en.json, but still be usable while
|
||||
* developing locally.
|
||||
*
|
||||
* @link https://docs.lokalise.co/article/KO5SZWLLsy-key-referencing
|
||||
* @link https://docs.lokalise.com/en/articles/1400528-key-referencing
|
||||
*/
|
||||
const re_key_reference = /\[%key:([^%]+)%\]/;
|
||||
function lokaliseTransform(data, original, file) {
|
||||
const KEY_REFERENCE = /\[%key:([^%]+)%\]/;
|
||||
const lokaliseTransform = (data, path, original = data) => {
|
||||
const output = {};
|
||||
Object.entries(data).forEach(([key, value]) => {
|
||||
if (value instanceof Object) {
|
||||
output[key] = lokaliseTransform(value, original, file);
|
||||
for (const [key, value] of Object.entries(data)) {
|
||||
if (typeof value === "object") {
|
||||
output[key] = lokaliseTransform(value, path, original);
|
||||
} else {
|
||||
output[key] = value.replace(re_key_reference, (_match, lokalise_key) => {
|
||||
output[key] = value.replace(KEY_REFERENCE, (_match, lokalise_key) => {
|
||||
const replace = lokalise_key.split("::").reduce((tr, k) => {
|
||||
if (!tr) {
|
||||
throw Error(
|
||||
`Invalid key placeholder ${lokalise_key} in ${file.path}`
|
||||
);
|
||||
throw Error(`Invalid key placeholder ${lokalise_key} in ${path}`);
|
||||
}
|
||||
return tr[k];
|
||||
}, original);
|
||||
if (typeof replace !== "string") {
|
||||
throw Error(
|
||||
`Invalid key placeholder ${lokalise_key} in ${file.path}`
|
||||
);
|
||||
throw Error(`Invalid key placeholder ${lokalise_key} in ${path}`);
|
||||
}
|
||||
return replace;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
return output;
|
||||
}
|
||||
};
|
||||
|
||||
gulp.task("clean-translations", async () => deleteSync([workDir]));
|
||||
gulp.task("clean-translations", () => deleteAsync([workDir]));
|
||||
|
||||
gulp.task("ensure-translations-build-dir", async () => {
|
||||
mkdirSync(workDir, { recursive: true });
|
||||
});
|
||||
const makeWorkDir = () => mkdir(workDir, { recursive: true });
|
||||
|
||||
gulp.task("create-test-metadata", () =>
|
||||
env.isProdBuild()
|
||||
? Promise.resolve()
|
||||
: writeFile(
|
||||
workDir + "/testMetadata.json",
|
||||
JSON.stringify({ test: { nativeName: "Test" } })
|
||||
)
|
||||
);
|
||||
|
||||
gulp.task("create-test-translation", () =>
|
||||
const createTestTranslation = () =>
|
||||
env.isProdBuild()
|
||||
? Promise.resolve()
|
||||
: gulp
|
||||
.src(path.join(paths.translations_src, "en.json"))
|
||||
.pipe(transform((data, _file) => recursiveEmpty(data)))
|
||||
.pipe(rename("test.json"))
|
||||
.pipe(gulp.dest(workDir))
|
||||
);
|
||||
.src(EN_SRC)
|
||||
.pipe(new CustomJSON(null, testReviver))
|
||||
.pipe(rename(`${TEST_LOCALE}.json`))
|
||||
.pipe(gulp.dest(workDir));
|
||||
|
||||
/**
|
||||
* This task will build a master translation file, to be used as the base for
|
||||
@@ -159,279 +163,164 @@ gulp.task("create-test-translation", () =>
|
||||
* project is buildable immediately after merging new translation keys, since
|
||||
* the Lokalise update to translations/en.json will not happen immediately.
|
||||
*/
|
||||
gulp.task("build-master-translation", () => {
|
||||
const src = [path.join(paths.translations_src, "en.json")];
|
||||
const createMasterTranslation = () =>
|
||||
gulp
|
||||
.src([EN_SRC, ...(mergeBackend ? [`${inBackendDir}/en.json`] : [])])
|
||||
.pipe(new CustomJSON(lokaliseTransform))
|
||||
.pipe(new MergeJSON("en"))
|
||||
.pipe(gulp.dest(workDir));
|
||||
|
||||
if (mergeBackend) {
|
||||
src.push(path.join(inBackendDir, "en.json"));
|
||||
const FRAGMENTS = ["base"];
|
||||
|
||||
const toggleSupervisorFragment = async () => {
|
||||
FRAGMENTS[0] = "supervisor";
|
||||
};
|
||||
|
||||
const panelFragment = (fragment) =>
|
||||
fragment !== "base" && fragment !== "supervisor";
|
||||
|
||||
const HASHES = new Map();
|
||||
|
||||
const createTranslations = async () => {
|
||||
// Parse and store the master to avoid repeating this for each locale, then
|
||||
// add the panel fragments when processing the app.
|
||||
const enMaster = JSON.parse(await readFile(`${workDir}/en.json`, "utf-8"));
|
||||
if (FRAGMENTS[0] === "base") {
|
||||
FRAGMENTS.push(...Object.keys(enMaster.ui.panel));
|
||||
}
|
||||
|
||||
return gulp
|
||||
.src(src)
|
||||
.pipe(transform((data, file) => lokaliseTransform(data, data, file)))
|
||||
// The downstream pipeline is setup first. It hashes the merged data for
|
||||
// each locale, then fragmentizes and flattens the data for final output.
|
||||
const translationFiles = await glob([
|
||||
`${inFrontendDir}/!(en).json`,
|
||||
...(env.isProdBuild() ? [] : [`${workDir}/${TEST_LOCALE}.json`]),
|
||||
]);
|
||||
const hashStream = new Transform({
|
||||
objectMode: true,
|
||||
transform: async (file, _, callback) => {
|
||||
const hash = env.isProdBuild()
|
||||
? createHash("md5").update(file.contents).digest("hex")
|
||||
: "dev";
|
||||
HASHES.set(file.stem, hash);
|
||||
file.stem += `-${hash}`;
|
||||
callback(null, file);
|
||||
},
|
||||
}).setMaxListeners(translationFiles.length + 1);
|
||||
const fragmentsStream = hashStream
|
||||
.pipe(
|
||||
merge({
|
||||
fileName: "en.json",
|
||||
})
|
||||
)
|
||||
.pipe(gulp.dest(fullDir));
|
||||
});
|
||||
|
||||
gulp.task("build-merged-translations", () =>
|
||||
gulp
|
||||
.src([
|
||||
inFrontendDir + "/*.json",
|
||||
"!" + inFrontendDir + "/en.json",
|
||||
...(env.isProdBuild() ? [] : [workDir + "/test.json"]),
|
||||
])
|
||||
.pipe(transform((data, file) => lokaliseTransform(data, data, file)))
|
||||
.pipe(
|
||||
flatmap((stream, file) => {
|
||||
// For each language generate a merged json file. It begins with the master
|
||||
// translation as a failsafe for untranslated strings, and merges all parent
|
||||
// tags into one file for each specific subtag
|
||||
//
|
||||
// TODO: This is a naive interpretation of BCP47 that should be improved.
|
||||
// Will be OK for now as long as we don't have anything more complicated
|
||||
// than a base translation + region.
|
||||
const tr = path.basename(file.history[0], ".json");
|
||||
const subtags = tr.split("-");
|
||||
const src = [fullDir + "/en.json"];
|
||||
for (let i = 1; i <= subtags.length; i++) {
|
||||
const lang = subtags.slice(0, i).join("-");
|
||||
if (lang === "test") {
|
||||
src.push(workDir + "/test.json");
|
||||
} else if (lang !== "en") {
|
||||
src.push(inFrontendDir + "/" + lang + ".json");
|
||||
if (mergeBackend) {
|
||||
src.push(inBackendDir + "/" + lang + ".json");
|
||||
}
|
||||
new CustomJSON((data) =>
|
||||
FRAGMENTS.map((fragment) => {
|
||||
switch (fragment) {
|
||||
case "base":
|
||||
// Remove the panels and supervisor to create the base translations
|
||||
return [
|
||||
flatten({
|
||||
...data,
|
||||
ui: { ...data.ui, panel: undefined },
|
||||
supervisor: undefined,
|
||||
}),
|
||||
"",
|
||||
];
|
||||
case "supervisor":
|
||||
// Supervisor key is at the top level
|
||||
return [flatten(data.supervisor), ""];
|
||||
default:
|
||||
// Create a fragment with only the given panel
|
||||
return [
|
||||
flatten(data.ui.panel[fragment], `ui.panel.${fragment}.`),
|
||||
fragment,
|
||||
];
|
||||
}
|
||||
}
|
||||
return gulp
|
||||
.src(src, { allowEmpty: true })
|
||||
.pipe(transform((data) => emptyFilter(data)))
|
||||
.pipe(
|
||||
merge({
|
||||
fileName: tr + ".json",
|
||||
})
|
||||
)
|
||||
.pipe(gulp.dest(fullDir));
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
let taskName;
|
||||
|
||||
const splitTasks = [];
|
||||
TRANSLATION_FRAGMENTS.forEach((fragment) => {
|
||||
taskName = "build-translation-fragment-" + fragment;
|
||||
gulp.task(taskName, () =>
|
||||
// Return only the translations for this fragment.
|
||||
gulp
|
||||
.src(fullDir + "/*.json")
|
||||
.pipe(
|
||||
transform((data) => ({
|
||||
ui: {
|
||||
panel: {
|
||||
[fragment]: data.ui.panel[fragment],
|
||||
},
|
||||
},
|
||||
}))
|
||||
)
|
||||
.pipe(gulp.dest(workDir + "/" + fragment))
|
||||
);
|
||||
splitTasks.push(taskName);
|
||||
});
|
||||
|
||||
taskName = "build-translation-core";
|
||||
gulp.task(taskName, () =>
|
||||
// Remove the fragment translations from the core translation.
|
||||
gulp
|
||||
.src(fullDir + "/*.json")
|
||||
.pipe(
|
||||
transform((data, _file) => {
|
||||
TRANSLATION_FRAGMENTS.forEach((fragment) => {
|
||||
delete data.ui.panel[fragment];
|
||||
});
|
||||
delete data.supervisor;
|
||||
return data;
|
||||
})
|
||||
)
|
||||
.pipe(gulp.dest(coreDir))
|
||||
);
|
||||
|
||||
splitTasks.push(taskName);
|
||||
|
||||
gulp.task("build-flattened-translations", () =>
|
||||
// Flatten the split versions of our translations, and move them into outDir
|
||||
gulp
|
||||
.src(
|
||||
TRANSLATION_FRAGMENTS.map(
|
||||
(fragment) => workDir + "/" + fragment + "/*.json"
|
||||
).concat(coreDir + "/*.json"),
|
||||
{ base: workDir }
|
||||
)
|
||||
.pipe(
|
||||
transform((data) =>
|
||||
// Polymer.AppLocalizeBehavior requires flattened json
|
||||
flatten(data)
|
||||
})
|
||||
)
|
||||
)
|
||||
.pipe(
|
||||
rename((filePath) => {
|
||||
if (filePath.dirname === "core") {
|
||||
filePath.dirname = "";
|
||||
.pipe(gulp.dest(outDir));
|
||||
|
||||
// Send the English master downstream first, then for each other locale
|
||||
// generate merged JSON data to continue piping. It begins with the master
|
||||
// translation as a failsafe for untranslated strings, and merges all parent
|
||||
// tags into one file for each specific subtag
|
||||
//
|
||||
// TODO: This is a naive interpretation of BCP47 that should be improved.
|
||||
// Will be OK for now as long as we don't have anything more complicated
|
||||
// than a base translation + region.
|
||||
const masterStream = gulp
|
||||
.src(`${workDir}/en.json`)
|
||||
.pipe(new PassThrough({ objectMode: true }));
|
||||
masterStream.pipe(hashStream, { end: false });
|
||||
const mergesFinished = [finished(masterStream)];
|
||||
for (const translationFile of translationFiles) {
|
||||
const locale = basename(translationFile, ".json");
|
||||
const subtags = locale.split("-");
|
||||
const mergeFiles = [];
|
||||
for (let i = 1; i <= subtags.length; i++) {
|
||||
const lang = subtags.slice(0, i).join("-");
|
||||
if (lang === TEST_LOCALE) {
|
||||
mergeFiles.push(`${workDir}/${TEST_LOCALE}.json`);
|
||||
} else if (lang !== "en") {
|
||||
mergeFiles.push(`${inFrontendDir}/${lang}.json`);
|
||||
if (mergeBackend) {
|
||||
mergeFiles.push(`${inBackendDir}/${lang}.json`);
|
||||
}
|
||||
// In dev we create the file with the fake hash in the filename
|
||||
if (!env.isProdBuild()) {
|
||||
filePath.basename += "-dev";
|
||||
}
|
||||
})
|
||||
)
|
||||
.pipe(gulp.dest(outDir))
|
||||
);
|
||||
|
||||
const fingerprints = {};
|
||||
|
||||
gulp.task("build-translation-fingerprints", () => {
|
||||
// Fingerprint full file of each language
|
||||
const files = readdirSync(fullDir);
|
||||
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
fingerprints[files[i].split(".")[0]] = {
|
||||
// In dev we create fake hashes
|
||||
hash: env.isProdBuild()
|
||||
? createHash("md5")
|
||||
.update(readFileSync(path.join(fullDir, files[i]), "utf-8"))
|
||||
.digest("hex")
|
||||
: "dev",
|
||||
};
|
||||
}
|
||||
|
||||
// In dev we create the file with the fake hash in the filename
|
||||
if (env.isProdBuild()) {
|
||||
mapFiles(outDir, ".json", (filename) => {
|
||||
const parsed = path.parse(filename);
|
||||
|
||||
// nl.json -> nl-<hash>.json
|
||||
if (!(parsed.name in fingerprints)) {
|
||||
throw new Error(`Unable to find hash for ${filename}`);
|
||||
}
|
||||
|
||||
renameSync(
|
||||
filename,
|
||||
`${parsed.dir}/${parsed.name}-${fingerprints[parsed.name].hash}${
|
||||
parsed.ext
|
||||
}`
|
||||
);
|
||||
});
|
||||
}
|
||||
const mergeStream = gulp
|
||||
.src(mergeFiles, { allowEmpty: true })
|
||||
.pipe(new MergeJSON(locale, enMaster, emptyReviver));
|
||||
mergesFinished.push(finished(mergeStream));
|
||||
mergeStream.pipe(hashStream, { end: false });
|
||||
}
|
||||
|
||||
const stream = source("translationFingerprints.json");
|
||||
stream.write(JSON.stringify(fingerprints));
|
||||
process.nextTick(() => stream.end());
|
||||
return stream.pipe(vinylBuffer()).pipe(gulp.dest(workDir));
|
||||
});
|
||||
// Wait for all merges to finish, then it's safe to end writing to the
|
||||
// downstream pipeline and wait for all fragments to finish writing.
|
||||
await Promise.all(mergesFinished);
|
||||
hashStream.end();
|
||||
await finished(fragmentsStream);
|
||||
};
|
||||
|
||||
gulp.task("build-translation-fragment-supervisor", () =>
|
||||
const writeTranslationMetaData = () =>
|
||||
gulp
|
||||
.src(fullDir + "/*.json")
|
||||
.pipe(transform((data) => data.supervisor))
|
||||
.src([`${paths.translations_src}/translationMetadata.json`])
|
||||
.pipe(
|
||||
rename((filePath) => {
|
||||
// In dev we create the file with the fake hash in the filename
|
||||
new CustomJSON((meta) => {
|
||||
// Add the test translation in development.
|
||||
if (!env.isProdBuild()) {
|
||||
filePath.basename += "-dev";
|
||||
meta[TEST_LOCALE] = { nativeName: "Translation Test" };
|
||||
}
|
||||
})
|
||||
)
|
||||
.pipe(gulp.dest(workDir + "/supervisor"))
|
||||
);
|
||||
|
||||
gulp.task("build-translation-flatten-supervisor", () =>
|
||||
gulp
|
||||
.src(workDir + "/supervisor/*.json")
|
||||
.pipe(
|
||||
transform((data) =>
|
||||
// Polymer.AppLocalizeBehavior requires flattened json
|
||||
flatten(data)
|
||||
)
|
||||
)
|
||||
.pipe(gulp.dest(outDir))
|
||||
);
|
||||
|
||||
gulp.task("build-translation-write-metadata", () =>
|
||||
gulp
|
||||
.src([
|
||||
path.join(paths.translations_src, "translationMetadata.json"),
|
||||
...(env.isProdBuild() ? [] : [workDir + "/testMetadata.json"]),
|
||||
workDir + "/translationFingerprints.json",
|
||||
])
|
||||
.pipe(merge({}))
|
||||
.pipe(
|
||||
transform((data) => {
|
||||
const newData = {};
|
||||
Object.entries(data).forEach(([key, value]) => {
|
||||
// Filter out translations without native name.
|
||||
if (value.nativeName) {
|
||||
newData[key] = value;
|
||||
} else {
|
||||
// Filter out locales without a native name, and add the hashes.
|
||||
for (const locale of Object.keys(meta)) {
|
||||
if (!meta[locale].nativeName) {
|
||||
meta[locale] = undefined;
|
||||
console.warn(
|
||||
`Skipping language ${key}. Native name was not translated.`
|
||||
`Skipping locale ${locale} because native name is not translated.`
|
||||
);
|
||||
} else {
|
||||
meta[locale].hash = HASHES.get(locale);
|
||||
}
|
||||
});
|
||||
return newData;
|
||||
}
|
||||
return {
|
||||
fragments: FRAGMENTS.filter(panelFragment),
|
||||
translations: meta,
|
||||
};
|
||||
})
|
||||
)
|
||||
.pipe(
|
||||
transform((data) => ({
|
||||
fragments: TRANSLATION_FRAGMENTS,
|
||||
translations: data,
|
||||
}))
|
||||
)
|
||||
.pipe(rename("translationMetadata.json"))
|
||||
.pipe(gulp.dest(workDir))
|
||||
);
|
||||
|
||||
gulp.task(
|
||||
"create-translations",
|
||||
gulp.series(
|
||||
gulp.parallel("create-test-metadata", "create-test-translation"),
|
||||
"build-master-translation",
|
||||
"build-merged-translations",
|
||||
gulp.parallel(...splitTasks),
|
||||
"build-flattened-translations"
|
||||
)
|
||||
);
|
||||
.pipe(gulp.dest(workDir));
|
||||
|
||||
gulp.task(
|
||||
"build-translations",
|
||||
gulp.series(
|
||||
gulp.parallel(
|
||||
"fetch-nightly-translations",
|
||||
gulp.series("clean-translations", "ensure-translations-build-dir")
|
||||
gulp.series("clean-translations", makeWorkDir)
|
||||
),
|
||||
"create-translations",
|
||||
"build-translation-fingerprints",
|
||||
"build-translation-write-metadata"
|
||||
createTestTranslation,
|
||||
createMasterTranslation,
|
||||
createTranslations,
|
||||
writeTranslationMetaData
|
||||
)
|
||||
);
|
||||
|
||||
gulp.task(
|
||||
"build-supervisor-translations",
|
||||
gulp.series(
|
||||
gulp.parallel(
|
||||
"fetch-nightly-translations",
|
||||
gulp.series("clean-translations", "ensure-translations-build-dir")
|
||||
),
|
||||
gulp.parallel("create-test-metadata", "create-test-translation"),
|
||||
"build-master-translation",
|
||||
"build-merged-translations",
|
||||
"build-translation-fragment-supervisor",
|
||||
"build-translation-flatten-supervisor",
|
||||
"build-translation-fingerprints",
|
||||
"build-translation-write-metadata"
|
||||
)
|
||||
gulp.series(toggleSupervisorFragment, "build-translations")
|
||||
);
|
||||
|
@@ -40,8 +40,12 @@ const runDevServer = async ({
|
||||
compiler,
|
||||
contentBase,
|
||||
port,
|
||||
listenHost = "localhost",
|
||||
listenHost = undefined,
|
||||
}) => {
|
||||
if (listenHost === undefined) {
|
||||
// For dev container, we need to listen on all hosts
|
||||
listenHost = env.isDevContainer() ? "0.0.0.0" : "localhost";
|
||||
}
|
||||
const server = new WebpackDevServer(
|
||||
{
|
||||
hot: false,
|
||||
@@ -99,7 +103,7 @@ gulp.task("webpack-watch-app", () => {
|
||||
).watch({ poll: isWsl }, doneHandler());
|
||||
gulp.watch(
|
||||
path.join(paths.translations_src, "en.json"),
|
||||
gulp.series("create-translations", "copy-translations-app")
|
||||
gulp.series("build-translations", "copy-translations-app")
|
||||
);
|
||||
});
|
||||
|
||||
|
@@ -1,16 +0,0 @@
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
|
||||
// Helper function to map recursively over files in a folder and it's subfolders
|
||||
module.exports.mapFiles = function mapFiles(startPath, filter, mapFunc) {
|
||||
const files = fs.readdirSync(startPath);
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const filename = path.join(startPath, files[i]);
|
||||
const stat = fs.lstatSync(filename);
|
||||
if (stat.isDirectory()) {
|
||||
mapFiles(filename, filter, mapFunc);
|
||||
} else if (filename.indexOf(filter) >= 0) {
|
||||
mapFunc(filename);
|
||||
}
|
||||
}
|
||||
};
|
@@ -10,6 +10,7 @@ const WebpackBar = require("webpackbar");
|
||||
const {
|
||||
TransformAsyncModulesPlugin,
|
||||
} = require("transform-async-modules-webpack-plugin");
|
||||
const { dependencies } = require("../package.json");
|
||||
const paths = require("./paths.cjs");
|
||||
const bundle = require("./bundle.cjs");
|
||||
|
||||
@@ -62,17 +63,25 @@ const createWebpackConfig = ({
|
||||
rules: [
|
||||
{
|
||||
test: /\.m?js$|\.ts$/,
|
||||
use: {
|
||||
use: (info) => ({
|
||||
loader: "babel-loader",
|
||||
options: {
|
||||
...bundle.babelOptions({ latestBuild, isProdBuild, isTestBuild }),
|
||||
...bundle.babelOptions({
|
||||
latestBuild,
|
||||
isProdBuild,
|
||||
isTestBuild,
|
||||
sw: info.issuerLayer === "sw",
|
||||
}),
|
||||
cacheDirectory: !isProdBuild,
|
||||
cacheCompression: false,
|
||||
},
|
||||
},
|
||||
}),
|
||||
resolve: {
|
||||
fullySpecified: false,
|
||||
},
|
||||
parser: {
|
||||
worker: ["*context.audioWorklet.addModule()", "..."],
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
@@ -91,11 +100,15 @@ const createWebpackConfig = ({
|
||||
moduleIds: isProdBuild && !isStatsBuild ? "deterministic" : "named",
|
||||
chunkIds: isProdBuild && !isStatsBuild ? "deterministic" : "named",
|
||||
splitChunks: {
|
||||
// Disable splitting for web workers with ESM output
|
||||
// Imports of external chunks are broken
|
||||
chunks: latestBuild
|
||||
? (chunk) => !chunk.canBeInitial() && !/^.+-worker$/.test(chunk.name)
|
||||
: undefined,
|
||||
// Disable splitting for web workers and worklets because imports of
|
||||
// external chunks are broken for:
|
||||
// - ESM output: https://github.com/webpack/webpack/issues/17014
|
||||
// - Worklets use `importScripts`: https://github.com/webpack/webpack/issues/11543
|
||||
chunks: (chunk) =>
|
||||
!chunk.canBeInitial() &&
|
||||
!new RegExp(`^.+-work${latestBuild ? "(?:let|er)" : "let"}$`).test(
|
||||
chunk.name
|
||||
),
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
@@ -156,11 +169,15 @@ const createWebpackConfig = ({
|
||||
transform: (stats) => JSON.stringify(filterStats(stats)),
|
||||
}),
|
||||
!latestBuild &&
|
||||
new TransformAsyncModulesPlugin({ browserslistEnv: "legacy" }),
|
||||
new TransformAsyncModulesPlugin({
|
||||
browserslistEnv: "legacy",
|
||||
runtime: { version: dependencies["@babel/runtime"] },
|
||||
}),
|
||||
].filter(Boolean),
|
||||
resolve: {
|
||||
extensions: [".ts", ".js", ".json"],
|
||||
alias: {
|
||||
"lit/static-html$": "lit/static-html.js",
|
||||
"lit/decorators$": "lit/decorators.js",
|
||||
"lit/directive$": "lit/directive.js",
|
||||
"lit/directives/until$": "lit/directives/until.js",
|
||||
@@ -223,6 +240,7 @@ const createWebpackConfig = ({
|
||||
),
|
||||
},
|
||||
experiments: {
|
||||
layers: true,
|
||||
outputModule: true,
|
||||
},
|
||||
};
|
||||
|
5
cast/public/sw-legacy.js
Normal file
5
cast/public/sw-legacy.js
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
self.addEventListener("fetch", (event) => {
|
||||
event.respondWith(fetch(event.request));
|
||||
});
|
@@ -36,13 +36,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<%= renderTemplate("../../../src/html/_js_base.html.template") %>
|
||||
<script>
|
||||
<% for (const entry of latestEntryJS) { %>
|
||||
import("<%= entry %>");
|
||||
<% } %>
|
||||
window.latestJS = true;
|
||||
</script>
|
||||
<%= renderTemplate("../../../src/html/_script_load_es5.html.template") %>
|
||||
<%= renderTemplate("../../../src/html/_script_loader.html.template") %>
|
||||
<hc-layout subtitle="FAQ">
|
||||
<style>
|
||||
a {
|
||||
@@ -232,17 +226,5 @@ http:
|
||||
</p>
|
||||
</div>
|
||||
</hc-layout>
|
||||
|
||||
<script>
|
||||
var _gaq = [["_setAccount", "UA-57927901-9"], ["_trackPageview"]];
|
||||
(function (d, t) {
|
||||
var g = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
g.src =
|
||||
("https:" == location.protocol ? "//ssl" : "//www") +
|
||||
".google-analytics.com/ga.js";
|
||||
s.parentNode.insertBefore(g, s);
|
||||
})(document, "script");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -13,15 +13,9 @@
|
||||
<%= renderTemplate("_social_meta.html.template") %>
|
||||
</head>
|
||||
<body>
|
||||
<%= renderTemplate("../../../src/html/_js_base.html.template") %>
|
||||
<hc-connect></hc-connect>
|
||||
<script>
|
||||
<% for (const entry of latestEntryJS) { %>
|
||||
import("<%= entry %>");
|
||||
<% } %>
|
||||
window.latestJS = true;
|
||||
</script>
|
||||
<%= renderTemplate("../../../src/html/_script_load_es5.html.template") %>
|
||||
<%= renderTemplate("../../../src/html/_js_base.html.template") %>
|
||||
<%= renderTemplate("../../../src/html/_script_loader.html.template") %>
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
|
@@ -14,22 +14,10 @@
|
||||
--background-color: #41bdf5;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
var _gaq=[['_setAccount','UA-57927901-10'],['_trackPageview']];
|
||||
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
|
||||
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
|
||||
s.parentNode.insertBefore(g,s)}(document,'script'));
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<%= renderTemplate("../../../src/html/_js_base.html.template") %>
|
||||
<cast-media-player></cast-media-player>
|
||||
<script>
|
||||
<% for (const entry of latestEntryJS) { %>
|
||||
import("<%= entry %>");
|
||||
<% } %>
|
||||
window.latestJS = true;
|
||||
</script>
|
||||
<%= renderTemplate("../../../src/html/_script_load_es5.html.template") %>
|
||||
<%= renderTemplate("../../../src/html/_js_base.html.template") %>
|
||||
<%= renderTemplate("../../../src/html/_script_loader.html.template") %>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -11,10 +11,4 @@
|
||||
font-size: initial;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
var _gaq=[['_setAccount','UA-57927901-10'],['_trackPageview']];
|
||||
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
|
||||
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
|
||||
s.parentNode.insertBefore(g,s)}(document,'script'));
|
||||
</script>
|
||||
</html>
|
||||
|
@@ -1,4 +1,3 @@
|
||||
import "../../../src/resources/safari-14-attachshadow-patch";
|
||||
import "./layout/hc-connect";
|
||||
|
||||
import("../../../src/resources/ha-style");
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import "@material/mwc-button/mwc-button";
|
||||
import { mdiCast, mdiCastConnected } from "@mdi/js";
|
||||
import "@polymer/paper-item/paper-icon-item";
|
||||
import "@polymer/paper-listbox/paper-listbox";
|
||||
import { ActionDetail } from "@material/mwc-list/mwc-list";
|
||||
import { mdiCast, mdiCastConnected, mdiViewDashboard } from "@mdi/js";
|
||||
import { Auth, Connection } from "home-assistant-js-websocket";
|
||||
import { CSSResultGroup, LitElement, TemplateResult, css, html } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
@@ -28,6 +27,7 @@ import { LovelaceViewConfig } from "../../../../src/data/lovelace/config/view";
|
||||
import "../../../../src/layouts/hass-loading-screen";
|
||||
import { generateDefaultViewConfig } from "../../../../src/panels/lovelace/common/generate-lovelace-config";
|
||||
import "./hc-layout";
|
||||
import "../../../../src/components/ha-list-item";
|
||||
|
||||
@customElement("hc-cast")
|
||||
class HcCast extends LitElement {
|
||||
@@ -83,34 +83,37 @@ class HcCast extends LitElement {
|
||||
`
|
||||
: html`
|
||||
<div class="section-header">PICK A VIEW</div>
|
||||
<paper-listbox
|
||||
attr-for-selected="data-path"
|
||||
.selected=${this.castManager.status.lovelacePath || ""}
|
||||
>
|
||||
<mwc-list @action=${this._handlePickView} activatable>
|
||||
${(
|
||||
this.lovelaceViews ?? [
|
||||
generateDefaultViewConfig({}, {}, {}, {}, () => ""),
|
||||
]
|
||||
).map(
|
||||
(view, idx) => html`
|
||||
<paper-icon-item
|
||||
@click=${this._handlePickView}
|
||||
data-path=${view.path || idx}
|
||||
(view, idx) =>
|
||||
html`<ha-list-item
|
||||
graphic="avatar"
|
||||
.activated=${this.castManager.status?.lovelacePath ===
|
||||
(view.path ?? idx)}
|
||||
.selected=${this.castManager.status?.lovelacePath ===
|
||||
(view.path ?? idx)}
|
||||
>
|
||||
${view.title || view.path || "Unnamed view"}
|
||||
${view.icon
|
||||
? html`
|
||||
<ha-icon
|
||||
.icon=${view.icon}
|
||||
slot="item-icon"
|
||||
slot="graphic"
|
||||
></ha-icon>
|
||||
`
|
||||
: ""}
|
||||
${view.title || view.path}
|
||||
</paper-icon-item>
|
||||
`
|
||||
)}
|
||||
</paper-listbox>
|
||||
: html`<ha-svg-icon
|
||||
slot="item-icon"
|
||||
.path=${mdiViewDashboard}
|
||||
></ha-svg-icon>`}</ha-list-item
|
||||
> `
|
||||
)}</mwc-list
|
||||
>
|
||||
`}
|
||||
|
||||
<div class="card-actions">
|
||||
${this.castManager.status
|
||||
? html`
|
||||
@@ -182,8 +185,8 @@ class HcCast extends LitElement {
|
||||
this.castManager.requestSession();
|
||||
}
|
||||
|
||||
private async _handlePickView(ev: Event) {
|
||||
const path = (ev.currentTarget as any).getAttribute("data-path");
|
||||
private async _handlePickView(ev: CustomEvent<ActionDetail>) {
|
||||
const path = this.lovelaceViews![ev.detail.index].path ?? ev.detail.index;
|
||||
await ensureConnectedCastSession(this.castManager!, this.auth!);
|
||||
castSendShowLovelaceView(this.castManager, this.auth.data.hassUrl, path);
|
||||
}
|
||||
@@ -246,25 +249,14 @@ class HcCast extends LitElement {
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
paper-listbox {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
paper-listbox ha-icon {
|
||||
ha-list-item ha-icon,
|
||||
ha-list-item ha-svg-icon {
|
||||
padding: 12px;
|
||||
color: var(--secondary-text-color);
|
||||
}
|
||||
|
||||
paper-icon-item {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
paper-icon-item[disabled] {
|
||||
cursor: initial;
|
||||
}
|
||||
|
||||
:host([hide-icons]) paper-icon-item {
|
||||
--paper-item-icon-width: 0px;
|
||||
:host([hide-icons]) ha-icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.spacer {
|
||||
|
@@ -2,6 +2,7 @@ import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
||||
import { customElement, property, query } from "lit/decorators";
|
||||
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
||||
import { LovelaceConfig } from "../../../../src/data/lovelace/config/types";
|
||||
import { getPanelTitleFromUrlPath } from "../../../../src/data/panel";
|
||||
import { Lovelace } from "../../../../src/panels/lovelace/types";
|
||||
import "../../../../src/panels/lovelace/views/hui-view";
|
||||
import { HomeAssistant } from "../../../../src/types";
|
||||
@@ -61,7 +62,12 @@ class HcLovelace extends LitElement {
|
||||
const index = this._viewIndex;
|
||||
|
||||
if (index !== undefined) {
|
||||
const dashboardTitle = this.lovelaceConfig.title || this.urlPath;
|
||||
const title = getPanelTitleFromUrlPath(
|
||||
this.hass,
|
||||
this.urlPath || "lovelace"
|
||||
);
|
||||
|
||||
const dashboardTitle = title || this.urlPath;
|
||||
|
||||
const viewTitle =
|
||||
this.lovelaceConfig.views[index].title ||
|
||||
@@ -80,10 +86,17 @@ class HcLovelace extends LitElement {
|
||||
this.lovelaceConfig.views[index].background ||
|
||||
this.lovelaceConfig.background;
|
||||
|
||||
if (configBackground) {
|
||||
const backgroundStyle =
|
||||
typeof configBackground === "string"
|
||||
? configBackground
|
||||
: configBackground?.image
|
||||
? `center / cover no-repeat url('${configBackground.image}')`
|
||||
: undefined;
|
||||
|
||||
if (backgroundStyle) {
|
||||
this._huiView!.style.setProperty(
|
||||
"--lovelace-background",
|
||||
configBackground
|
||||
backgroundStyle
|
||||
);
|
||||
} else {
|
||||
this._huiView!.style.removeProperty("--lovelace-background");
|
||||
|
@@ -35,6 +35,7 @@ import { loadLovelaceResources } from "../../../../src/panels/lovelace/common/lo
|
||||
import { HassElement } from "../../../../src/state/hass-element";
|
||||
import { castContext } from "../cast_context";
|
||||
import "./hc-launch-screen";
|
||||
import { getPanelTitleFromUrlPath } from "../../../../src/data/panel";
|
||||
|
||||
const DEFAULT_CONFIG: LovelaceDashboardStrategyConfig = {
|
||||
strategy: {
|
||||
@@ -359,7 +360,11 @@ export class HcMain extends HassElement {
|
||||
}
|
||||
|
||||
private _handleNewLovelaceConfig(lovelaceConfig: LovelaceConfig) {
|
||||
castContext.setApplicationState(lovelaceConfig.title || "");
|
||||
const title = getPanelTitleFromUrlPath(
|
||||
this.hass!,
|
||||
this._urlPath || "lovelace"
|
||||
);
|
||||
castContext.setApplicationState(title || "");
|
||||
this._lovelaceConfig = lovelaceConfig;
|
||||
}
|
||||
|
||||
|
BIN
demo/public/assets/sections/images/media_player_family_room.jpg
Normal file
BIN
demo/public/assets/sections/images/media_player_family_room.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
5
demo/public/sw-legacy.js
Normal file
5
demo/public/sw-legacy.js
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
self.addEventListener("fetch", (event) => {
|
||||
event.respondWith(fetch(event.request));
|
||||
});
|
@@ -1,7 +1,7 @@
|
||||
import { convertEntities } from "../../../../src/fake_data/entity";
|
||||
import { DemoConfig } from "../types";
|
||||
|
||||
export const demoEntitiesSections: DemoConfig["entities"] = () =>
|
||||
export const demoEntitiesSections: DemoConfig["entities"] = (localize) =>
|
||||
convertEntities({
|
||||
"cover.living_room_garden_shutter": {
|
||||
entity_id: "cover.living_room_garden_shutter",
|
||||
@@ -113,11 +113,30 @@ export const demoEntitiesSections: DemoConfig["entities"] = () =>
|
||||
},
|
||||
"media_player.living_room_nest_mini": {
|
||||
entity_id: "media_player.living_room_nest_mini",
|
||||
state: "off",
|
||||
state: "on",
|
||||
attributes: {
|
||||
device_class: "speaker",
|
||||
friendly_name: "Living room Nest Mini",
|
||||
supported_features: 152461,
|
||||
volume_level: 0.18,
|
||||
is_volume_muted: false,
|
||||
media_content_type: "music",
|
||||
media_duration: 300,
|
||||
media_position: 0,
|
||||
media_position_updated_at: new Date(
|
||||
// 23 seconds in
|
||||
new Date().getTime() - 23000
|
||||
).toISOString(),
|
||||
media_title: "I Wasn't Born To Follow",
|
||||
media_artist: "The Byrds",
|
||||
media_album_name: "The Notorious Byrd Brothers",
|
||||
source_list: ["It's A Party", "Radio HSL", "Retro 70s and 80s"],
|
||||
shuffle: false,
|
||||
night_sound: false,
|
||||
speech_enhance: false,
|
||||
friendly_name: localize(
|
||||
"ui.panel.page-demo.config.sections.entities.media_player.living_room_nest_mini"
|
||||
),
|
||||
entity_picture: "/assets/sections/images/media_player_family_room.jpg",
|
||||
supported_features: 64063,
|
||||
},
|
||||
},
|
||||
"cover.kitchen_shutter": {
|
||||
@@ -168,8 +187,27 @@ export const demoEntitiesSections: DemoConfig["entities"] = () =>
|
||||
state: "on",
|
||||
attributes: {
|
||||
device_class: "speaker",
|
||||
friendly_name: "Kitchen Nest Audio",
|
||||
supported_features: 152461,
|
||||
volume_level: 0.18,
|
||||
is_volume_muted: false,
|
||||
media_content_type: "music",
|
||||
media_duration: 300,
|
||||
media_position: 0,
|
||||
media_position_updated_at: new Date(
|
||||
// 23 seconds in
|
||||
new Date().getTime() - 23000
|
||||
).toISOString(),
|
||||
media_title: "I Wasn't Born To Follow",
|
||||
media_artist: "The Byrds",
|
||||
media_album_name: "The Notorious Byrd Brothers",
|
||||
source_list: ["It's A Party", "Radio HSL", "Retro 70s and 80s"],
|
||||
shuffle: false,
|
||||
night_sound: false,
|
||||
speech_enhance: false,
|
||||
friendly_name: localize(
|
||||
"ui.panel.page-demo.config.sections.entities.media_player.kitchen_nest_audio"
|
||||
),
|
||||
entity_picture: "/assets/sections/images/media_player_family_room.jpg",
|
||||
supported_features: 64063,
|
||||
},
|
||||
},
|
||||
"binary_sensor.tesla_wall_connector_vehicle_connected": {
|
||||
@@ -333,8 +371,28 @@ export const demoEntitiesSections: DemoConfig["entities"] = () =>
|
||||
entity_id: "media_player.study_nest_hub",
|
||||
state: "off",
|
||||
attributes: {
|
||||
friendly_name: "Study Nest Hub",
|
||||
supported_features: 152461,
|
||||
device_class: "speaker",
|
||||
volume_level: 0.18,
|
||||
is_volume_muted: false,
|
||||
media_content_type: "music",
|
||||
media_duration: 300,
|
||||
media_position: 0,
|
||||
media_position_updated_at: new Date(
|
||||
// 23 seconds in
|
||||
new Date().getTime() - 23000
|
||||
).toISOString(),
|
||||
media_title: "I Wasn't Born To Follow",
|
||||
media_artist: "The Byrds",
|
||||
media_album_name: "The Notorious Byrd Brothers",
|
||||
source_list: ["It's A Party", "Radio HSL", "Retro 70s and 80s"],
|
||||
shuffle: false,
|
||||
night_sound: false,
|
||||
speech_enhance: false,
|
||||
friendly_name: localize(
|
||||
"ui.panel.page-demo.config.sections.entities.media_player.study_nest_hub"
|
||||
),
|
||||
entity_picture: "/assets/sections/images/media_player_family_room.jpg",
|
||||
supported_features: 64063,
|
||||
},
|
||||
},
|
||||
"sensor.standing_desk_height": {
|
||||
|
@@ -1,40 +1,25 @@
|
||||
import { isFrontpageEmbed } from "../../util/is_frontpage";
|
||||
import { DemoConfig } from "../types";
|
||||
|
||||
export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
||||
export const demoLovelaceSections: DemoConfig["lovelace"] = (localize) => ({
|
||||
title: "Home Assistant Demo",
|
||||
views: [
|
||||
{
|
||||
type: "sections",
|
||||
title: "Demo",
|
||||
title: isFrontpageEmbed ? "Home Assistant" : "Demo",
|
||||
path: "home",
|
||||
icon: "mdi:home-assistant",
|
||||
sections: [
|
||||
{
|
||||
title: "Welcome 👋",
|
||||
cards: [{ type: "custom:ha-demo-card" }],
|
||||
},
|
||||
...(isFrontpageEmbed
|
||||
? []
|
||||
: [
|
||||
{
|
||||
title: `${localize("ui.panel.page-demo.config.sections.titles.welcome")} 👋`,
|
||||
cards: [{ type: "custom:ha-demo-card" }],
|
||||
},
|
||||
]),
|
||||
{
|
||||
cards: [
|
||||
{
|
||||
type: "tile",
|
||||
entity: "cover.living_room_garden_shutter",
|
||||
name: "Garden",
|
||||
},
|
||||
{
|
||||
type: "tile",
|
||||
entity: "cover.living_room_graveyard_shutter",
|
||||
name: "Rear",
|
||||
},
|
||||
{
|
||||
type: "tile",
|
||||
entity: "cover.living_room_left_shutter",
|
||||
name: "Left",
|
||||
},
|
||||
{
|
||||
type: "tile",
|
||||
entity: "cover.living_room_right_shutter",
|
||||
name: "Right",
|
||||
},
|
||||
{
|
||||
type: "tile",
|
||||
entity: "light.floor_lamp",
|
||||
@@ -60,13 +45,17 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
||||
detail: 1,
|
||||
name: "Temperature",
|
||||
},
|
||||
{
|
||||
type: "tile",
|
||||
entity: "cover.living_room_garden_shutter",
|
||||
name: "Blinds",
|
||||
},
|
||||
{
|
||||
type: "tile",
|
||||
entity: "media_player.living_room_nest_mini",
|
||||
name: "Nest Mini",
|
||||
},
|
||||
],
|
||||
title: "🛋️ Living room ",
|
||||
title: `🛋️ ${localize("ui.panel.page-demo.config.sections.titles.living_room")} `,
|
||||
},
|
||||
{
|
||||
type: "grid",
|
||||
@@ -99,10 +88,9 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
||||
{
|
||||
type: "tile",
|
||||
entity: "media_player.kitchen_nest_audio",
|
||||
name: "Nest Audio",
|
||||
},
|
||||
],
|
||||
title: "👩🍳 Kitchen",
|
||||
title: `👩🍳 ${localize("ui.panel.page-demo.config.sections.titles.kitchen")}`,
|
||||
},
|
||||
{
|
||||
type: "grid",
|
||||
@@ -144,7 +132,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
||||
color: "dark-grey",
|
||||
},
|
||||
],
|
||||
title: "⚡️ Energy",
|
||||
title: `⚡️ ${localize("ui.panel.page-demo.config.sections.titles.energy")}`,
|
||||
},
|
||||
{
|
||||
type: "grid",
|
||||
@@ -181,7 +169,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
||||
state_content: ["preset_mode", "current_temperature"],
|
||||
},
|
||||
],
|
||||
title: "🌤️ Climate",
|
||||
title: `🌤️ ${localize("ui.panel.page-demo.config.sections.titles.climate")}`,
|
||||
},
|
||||
{
|
||||
type: "grid",
|
||||
@@ -199,7 +187,6 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
||||
{
|
||||
type: "tile",
|
||||
entity: "media_player.study_nest_hub",
|
||||
name: "Nest Hub",
|
||||
},
|
||||
{
|
||||
type: "tile",
|
||||
@@ -209,7 +196,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
||||
icon: "mdi:desk",
|
||||
},
|
||||
],
|
||||
title: "🧑💻 Study",
|
||||
title: `🧑💻 ${localize("ui.panel.page-demo.config.sections.titles.study")}`,
|
||||
},
|
||||
{
|
||||
type: "grid",
|
||||
@@ -243,7 +230,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
||||
name: "Illuminance",
|
||||
},
|
||||
],
|
||||
title: "🌳 Outdoor",
|
||||
title: `🌳 ${localize("ui.panel.page-demo.config.sections.titles.outdoor")}`,
|
||||
},
|
||||
{
|
||||
type: "grid",
|
||||
@@ -273,7 +260,7 @@ export const demoLovelaceSections: DemoConfig["lovelace"] = () => ({
|
||||
icon: "mdi:home-assistant",
|
||||
},
|
||||
],
|
||||
title: "🎉 Updates",
|
||||
title: `🎉 ${localize("ui.panel.page-demo.config.sections.titles.updates")}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@@ -1,8 +1,9 @@
|
||||
import "@material/mwc-button";
|
||||
import { css, CSSResultGroup, html, LitElement, nothing } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import { until } from "lit/directives/until";
|
||||
import { fireEvent } from "../../../src/common/dom/fire_event";
|
||||
import "../../../src/components/ha-card";
|
||||
import "../../../src/components/ha-button";
|
||||
import "../../../src/components/ha-circular-progress";
|
||||
import { LovelaceCardConfig } from "../../../src/data/lovelace/config/card";
|
||||
import { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
||||
@@ -11,7 +12,6 @@ import {
|
||||
demoConfigs,
|
||||
selectedDemoConfig,
|
||||
selectedDemoConfigIndex,
|
||||
setDemoConfig,
|
||||
} from "../configs/demo-configs";
|
||||
|
||||
@customElement("ha-demo-card")
|
||||
@@ -64,9 +64,9 @@ export class HADemoCard extends LitElement implements LovelaceCard {
|
||||
)}
|
||||
</div>
|
||||
|
||||
<mwc-button @click=${this._nextConfig} .disabled=${this._switching}>
|
||||
<ha-button @click=${this._nextConfig} .disabled=${this._switching}>
|
||||
${this.hass.localize("ui.panel.page-demo.cards.demo.next_demo")}
|
||||
</mwc-button>
|
||||
</ha-button>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p class="small-hidden">
|
||||
@@ -87,9 +87,9 @@ export class HADemoCard extends LitElement implements LovelaceCard {
|
||||
</div>
|
||||
<div class="actions small-hidden">
|
||||
<a href="https://www.home-assistant.io" target="_blank">
|
||||
<mwc-button>
|
||||
<ha-button>
|
||||
${this.hass.localize("ui.panel.page-demo.cards.demo.learn_more")}
|
||||
</mwc-button>
|
||||
</ha-button>
|
||||
</a>
|
||||
</div>
|
||||
</ha-card>
|
||||
@@ -113,13 +113,7 @@ export class HADemoCard extends LitElement implements LovelaceCard {
|
||||
|
||||
private async _updateConfig(index: number) {
|
||||
this._switching = true;
|
||||
try {
|
||||
await setDemoConfig(this.hass, this.lovelace!, index);
|
||||
} catch (err: any) {
|
||||
alert("Failed to switch config :-(");
|
||||
} finally {
|
||||
this._switching = false;
|
||||
}
|
||||
fireEvent(this, "set-demo-config" as any, { index });
|
||||
}
|
||||
|
||||
static get styles(): CSSResultGroup {
|
||||
@@ -149,7 +143,7 @@ export class HADemoCard extends LitElement implements LovelaceCard {
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
.picker mwc-button {
|
||||
.picker ha-button {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import "../../src/resources/safari-14-attachshadow-patch";
|
||||
import "./util/is_frontpage";
|
||||
import "./ha-demo";
|
||||
|
||||
import("../../src/resources/ha-style");
|
||||
|
@@ -10,6 +10,7 @@ import {
|
||||
import { HomeAssistantAppEl } from "../../src/layouts/home-assistant";
|
||||
import { HomeAssistant } from "../../src/types";
|
||||
import { selectedDemoConfig } from "./configs/demo-configs";
|
||||
import { mockAreaRegistry } from "./stubs/area_registry";
|
||||
import { mockAuth } from "./stubs/auth";
|
||||
import { mockConfigEntries } from "./stubs/config_entries";
|
||||
import { mockEnergy } from "./stubs/energy";
|
||||
@@ -23,10 +24,10 @@ import { mockLovelace } from "./stubs/lovelace";
|
||||
import { mockMediaPlayer } from "./stubs/media_player";
|
||||
import { mockPersistentNotification } from "./stubs/persistent_notification";
|
||||
import { mockRecorder } from "./stubs/recorder";
|
||||
import { mockTodo } from "./stubs/todo";
|
||||
import { mockSensor } from "./stubs/sensor";
|
||||
import { mockSystemLog } from "./stubs/system_log";
|
||||
import { mockTemplate } from "./stubs/template";
|
||||
import { mockTodo } from "./stubs/todo";
|
||||
import { mockTranslations } from "./stubs/translations";
|
||||
|
||||
@customElement("ha-demo")
|
||||
@@ -62,6 +63,7 @@ export class HaDemo extends HomeAssistantAppEl {
|
||||
mockEnergy(hass);
|
||||
mockPersistentNotification(hass);
|
||||
mockConfigEntries(hass);
|
||||
mockAreaRegistry(hass);
|
||||
mockEntityRegistry(hass, [
|
||||
{
|
||||
config_entry_id: "co2signal",
|
||||
@@ -80,6 +82,8 @@ export class HaDemo extends HomeAssistantAppEl {
|
||||
has_entity_name: false,
|
||||
unique_id: "co2_intensity",
|
||||
options: null,
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
{
|
||||
config_entry_id: "co2signal",
|
||||
@@ -98,6 +102,8 @@ export class HaDemo extends HomeAssistantAppEl {
|
||||
has_entity_name: false,
|
||||
unique_id: "grid_fossil_fuel_percentage",
|
||||
options: null,
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
]);
|
||||
|
||||
|
@@ -63,46 +63,47 @@
|
||||
align-items: center;
|
||||
}
|
||||
#ha-launch-screen svg {
|
||||
width: 170px;
|
||||
width: 112px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
#ha-launch-screen .ha-launch-screen-spacer {
|
||||
#ha-launch-screen .ha-launch-screen-spacer-top {
|
||||
flex: 1;
|
||||
margin-top: calc( 2 * max(env(safe-area-inset-bottom), 48px) + 46px );
|
||||
padding-top: 48px;
|
||||
}
|
||||
#ha-launch-screen .ha-launch-screen-spacer-bottom {
|
||||
flex: 1;
|
||||
padding-top: 48px;
|
||||
}
|
||||
.ohf-logo {
|
||||
margin: max(env(safe-area-inset-bottom), 48px) 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
opacity: .66;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.ohf-logo {
|
||||
filter: invert(1);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="ha-launch-screen">
|
||||
<div class="ha-launch-screen-spacer"></div>
|
||||
<div class="ha-launch-screen-spacer-top"></div>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240">
|
||||
<path fill="#18BCF2" d="M240 224.762a15 15 0 0 1-15 15H15a15 15 0 0 1-15-15v-90c0-8.25 4.77-19.769 10.61-25.609l98.78-98.7805c5.83-5.83 15.38-5.83 21.21 0l98.79 98.7895c5.83 5.83 10.61 17.36 10.61 25.61v90-.01Z"/>
|
||||
<path fill="#F2F4F9" d="m107.27 239.762-40.63-40.63c-2.09.72-4.32 1.13-6.64 1.13-11.3 0-20.5-9.2-20.5-20.5s9.2-20.5 20.5-20.5 20.5 9.2 20.5 20.5c0 2.33-.41 4.56-1.13 6.65l31.63 31.63v-115.88c-6.8-3.3395-11.5-10.3195-11.5-18.3895 0-11.3 9.2-20.5 20.5-20.5s20.5 9.2 20.5 20.5c0 8.07-4.7 15.05-11.5 18.3895v81.27l31.46-31.46c-.62-1.96-.96-4.04-.96-6.2 0-11.3 9.2-20.5 20.5-20.5s20.5 9.2 20.5 20.5-9.2 20.5-20.5 20.5c-2.5 0-4.88-.47-7.09-1.29L129 208.892v30.88z"/>
|
||||
</svg>
|
||||
<div id="ha-launch-screen-info-box" class="ha-launch-screen-spacer"></div>
|
||||
<div id="ha-launch-screen-info-box" class="ha-launch-screen-spacer-bottom"></div>
|
||||
<div class="ohf-logo">
|
||||
<img src="/static/images/ohf-badge.svg" alt="Home Assistant is a project by the Open Home Foundation" height="46">
|
||||
</div>
|
||||
</div>
|
||||
<ha-demo></ha-demo>
|
||||
<%= renderTemplate("../../../src/html/_js_base.html.template") %>
|
||||
<%= renderTemplate("../../../src/html/_preload_roboto.html.template") %>
|
||||
<script>
|
||||
// Safari 12 and below does not have a compliant ES2015 implementation of template literals, so we ship ES5
|
||||
if (!isS11_12) {
|
||||
<% for (const entry of latestEntryJS) { %>
|
||||
import("<%= entry %>");
|
||||
<% } %>
|
||||
window.latestJS = true;
|
||||
}
|
||||
</script>
|
||||
<%= renderTemplate("../../../src/html/_script_load_es5.html.template") %>
|
||||
<script>
|
||||
var _gaq = [["_setAccount", "UA-57927901-5"], ["_trackPageview"]];
|
||||
(function (d, t) {
|
||||
var g = d.createElement(t),
|
||||
s = d.getElementsByTagName(t)[0];
|
||||
g.src =
|
||||
("https:" == location.protocol ? "//ssl" : "//www") +
|
||||
".google-analytics.com/ga.js";
|
||||
s.parentNode.insertBefore(g, s);
|
||||
})(document, "script");
|
||||
</script>
|
||||
<%= renderTemplate("../../../src/html/_script_loader.html.template") %>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { format, startOfToday, startOfTomorrow } from "date-fns/esm";
|
||||
import { format, startOfToday, startOfTomorrow } from "date-fns";
|
||||
import {
|
||||
EnergyInfo,
|
||||
EnergyPreferences,
|
||||
|
@@ -1,5 +1,55 @@
|
||||
import { convertEntities } from "../../../src/fake_data/entity";
|
||||
|
||||
export const mapEntities = () =>
|
||||
convertEntities({
|
||||
"zone.home": {
|
||||
entity_id: "zone.home",
|
||||
state: "zoning",
|
||||
attributes: {
|
||||
hidden: true,
|
||||
latitude: 52.3631339,
|
||||
longitude: 4.8903147,
|
||||
radius: 200,
|
||||
friendly_name: "Home",
|
||||
icon: "hademo:home",
|
||||
},
|
||||
},
|
||||
"zone.uva": {
|
||||
entity_id: "zone.buckhead",
|
||||
state: "zoning",
|
||||
attributes: {
|
||||
hidden: true,
|
||||
radius: 400,
|
||||
friendly_name: "UvA",
|
||||
icon: "hademo:school",
|
||||
latitude: 52.3558182,
|
||||
longitude: 4.9535376,
|
||||
},
|
||||
},
|
||||
"person.arsaboo": {
|
||||
entity_id: "person.arsaboo",
|
||||
state: "not_home",
|
||||
attributes: {
|
||||
radius: 50,
|
||||
friendly_name: "Arsaboo",
|
||||
latitude: 52.3579946,
|
||||
longitude: 4.8664597,
|
||||
entity_picture: "/assets/arsaboo/images/arsaboo.jpg",
|
||||
},
|
||||
},
|
||||
"person.melody": {
|
||||
entity_id: "person.melody",
|
||||
state: "not_home",
|
||||
attributes: {
|
||||
radius: 50,
|
||||
friendly_name: "Melody",
|
||||
latitude: 52.3408927,
|
||||
longitude: 4.8711073,
|
||||
entity_picture: "/assets/arsaboo/images/melody.jpg",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const energyEntities = () =>
|
||||
convertEntities({
|
||||
"sensor.grid_fossil_fuel_percentage": {
|
||||
|
@@ -1,35 +1,52 @@
|
||||
import type { LocalizeFunc } from "../../../src/common/translations/localize";
|
||||
import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
||||
import { selectedDemoConfig } from "../configs/demo-configs";
|
||||
import {
|
||||
selectedDemoConfig,
|
||||
selectedDemoConfigIndex,
|
||||
setDemoConfig,
|
||||
} from "../configs/demo-configs";
|
||||
import "../custom-cards/cast-demo-row";
|
||||
import "../custom-cards/ha-demo-card";
|
||||
import type { HADemoCard } from "../custom-cards/ha-demo-card";
|
||||
import { mapEntities } from "./entities";
|
||||
|
||||
export const mockLovelace = (
|
||||
hass: MockHomeAssistant,
|
||||
localizePromise: Promise<LocalizeFunc>
|
||||
) => {
|
||||
hass.mockWS("lovelace/config", () =>
|
||||
Promise.all([selectedDemoConfig, localizePromise]).then(
|
||||
hass.mockWS("lovelace/config", ({ url_path }) => {
|
||||
if (url_path === "map") {
|
||||
hass.addEntities(mapEntities());
|
||||
return {
|
||||
strategy: {
|
||||
type: "map",
|
||||
},
|
||||
};
|
||||
}
|
||||
return Promise.all([selectedDemoConfig, localizePromise]).then(
|
||||
([config, localize]) => config.lovelace(localize)
|
||||
)
|
||||
);
|
||||
);
|
||||
});
|
||||
|
||||
hass.mockWS("lovelace/config/save", () => Promise.resolve());
|
||||
hass.mockWS("lovelace/resources", () => Promise.resolve([]));
|
||||
};
|
||||
|
||||
customElements.whenDefined("hui-view").then(() => {
|
||||
customElements.whenDefined("hui-root").then(() => {
|
||||
// eslint-disable-next-line
|
||||
const HUIView = customElements.get("hui-view");
|
||||
// Patch HUI-VIEW to make the lovelace object available to the demo card
|
||||
const oldCreateCard = HUIView!.prototype.createCardElement;
|
||||
const HUIRoot = customElements.get("hui-root")!;
|
||||
|
||||
HUIView!.prototype.createCardElement = function (config) {
|
||||
const el = oldCreateCard.call(this, config);
|
||||
if (el.tagName === "HA-DEMO-CARD") {
|
||||
(el as HADemoCard).lovelace = this.lovelace;
|
||||
}
|
||||
return el;
|
||||
const oldFirstUpdated = HUIRoot.prototype.firstUpdated;
|
||||
|
||||
HUIRoot.prototype.firstUpdated = function (changedProperties) {
|
||||
oldFirstUpdated.call(this, changedProperties);
|
||||
this.addEventListener("set-demo-config", async (ev) => {
|
||||
const index = (ev as CustomEvent).detail.index;
|
||||
try {
|
||||
await setDemoConfig(this.hass, this.lovelace!, index);
|
||||
} catch (err: any) {
|
||||
setDemoConfig(this.hass, this.lovelace!, selectedDemoConfigIndex);
|
||||
alert("Failed to switch config :-(");
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
|
1
demo/src/util/is_frontpage.ts
Normal file
1
demo/src/util/is_frontpage.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const isFrontpageEmbed = document.location.search === "?frontpage";
|
BIN
gallery/public/images/paulus.jpg
Normal file
BIN
gallery/public/images/paulus.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 110 KiB |
@@ -1,7 +1,9 @@
|
||||
import { load } from "js-yaml";
|
||||
import { html, css, LitElement, PropertyValues } from "lit";
|
||||
import { LitElement, PropertyValueMap, css, html, nothing } from "lit";
|
||||
import { customElement, property, query, state } from "lit/decorators";
|
||||
import { createCardElement } from "../../../src/panels/lovelace/create-element/create-card-element";
|
||||
import memoizeOne from "memoize-one";
|
||||
import "../../../src/panels/lovelace/cards/hui-card";
|
||||
import type { HuiCard } from "../../../src/panels/lovelace/cards/hui-card";
|
||||
import { HomeAssistant } from "../../../src/types";
|
||||
|
||||
export interface DemoCardConfig {
|
||||
@@ -19,7 +21,12 @@ class DemoCard extends LitElement {
|
||||
|
||||
@state() private _size?: number;
|
||||
|
||||
@query("#card") private _card!: HTMLElement;
|
||||
@query("hui-card", false) private _card?: HuiCard;
|
||||
|
||||
private _config = memoizeOne((config: string) => {
|
||||
const c = (load(config) as any)[0];
|
||||
return c;
|
||||
});
|
||||
|
||||
render() {
|
||||
return html`
|
||||
@@ -30,63 +37,32 @@ class DemoCard extends LitElement {
|
||||
: ""}
|
||||
</h2>
|
||||
<div class="root">
|
||||
<div id="card"></div>
|
||||
${this.showConfig ? html`<pre>${this.config.config.trim()}</pre>` : ""}
|
||||
<hui-card
|
||||
.config=${this._config(this.config.config)}
|
||||
.hass=${this.hass}
|
||||
@card-updated=${this._cardUpdated}
|
||||
></hui-card>
|
||||
${this.showConfig
|
||||
? html`<pre>${this.config.config.trim()}</pre>`
|
||||
: nothing}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
updated(changedProps: PropertyValues) {
|
||||
super.updated(changedProps);
|
||||
|
||||
if (changedProps.has("config")) {
|
||||
const card = this._card;
|
||||
while (card.lastChild) {
|
||||
card.removeChild(card.lastChild);
|
||||
}
|
||||
|
||||
const el = this._createCardElement((load(this.config.config) as any)[0]);
|
||||
card.appendChild(el);
|
||||
this._getSize(el);
|
||||
}
|
||||
|
||||
if (changedProps.has("hass")) {
|
||||
const card = this._card.lastChild;
|
||||
if (card) {
|
||||
(card as any).hass = this.hass;
|
||||
}
|
||||
}
|
||||
private async _cardUpdated(ev) {
|
||||
ev.stopPropagation();
|
||||
this._updateSize();
|
||||
}
|
||||
|
||||
async _getSize(el) {
|
||||
await customElements.whenDefined(el.localName);
|
||||
|
||||
if (!("getCardSize" in el)) {
|
||||
this._size = undefined;
|
||||
return;
|
||||
}
|
||||
this._size = await el.getCardSize();
|
||||
private async _updateSize() {
|
||||
this._size = await this._card?.getCardSize();
|
||||
}
|
||||
|
||||
_createCardElement(cardConfig) {
|
||||
const element = createCardElement(cardConfig);
|
||||
if (this.hass) {
|
||||
element.hass = this.hass;
|
||||
}
|
||||
element.addEventListener(
|
||||
"ll-rebuild",
|
||||
(ev) => {
|
||||
ev.stopPropagation();
|
||||
this._rebuildCard(element, cardConfig);
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
return element;
|
||||
}
|
||||
|
||||
_rebuildCard(cardElToReplace, config) {
|
||||
const newCardEl = this._createCardElement(config);
|
||||
cardElToReplace.parentElement.replaceChild(newCardEl, cardElToReplace);
|
||||
protected update(
|
||||
_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>
|
||||
): void {
|
||||
super.update(_changedProperties);
|
||||
this._updateSize();
|
||||
}
|
||||
|
||||
static styles = css`
|
||||
@@ -101,7 +77,7 @@ class DemoCard extends LitElement {
|
||||
font-size: 0.5em;
|
||||
color: var(--primary-text-color);
|
||||
}
|
||||
#card {
|
||||
hui-card {
|
||||
max-width: 400px;
|
||||
width: 100vw;
|
||||
}
|
||||
|
@@ -532,15 +532,6 @@ export default {
|
||||
last_changed: "2018-07-19T10:44:46.200946+00:00",
|
||||
last_updated: "2018-07-19T10:44:46.200946+00:00",
|
||||
},
|
||||
"mailbox.demomailbox": {
|
||||
entity_id: "mailbox.demomailbox",
|
||||
state: "10",
|
||||
attributes: {
|
||||
friendly_name: "DemoMailbox",
|
||||
},
|
||||
last_changed: "2018-07-19T10:45:16.555210+00:00",
|
||||
last_updated: "2018-07-19T10:45:16.555210+00:00",
|
||||
},
|
||||
"input_select.living_room_preset": {
|
||||
entity_id: "input_select.living_room_preset",
|
||||
state: "Visitors",
|
||||
|
@@ -3,13 +3,16 @@ title: When to use remove, delete, add and create
|
||||
subtitle: The difference between remove/delete and add/create.
|
||||
---
|
||||
|
||||
# Remove vs Delete
|
||||
# Removing or deleting content
|
||||
|
||||
Remove and Delete are quite similar, but can be frustrating if used inconsistently.
|
||||
_Remove_ and _Delete_ are quite similar, but can be frustrating if used inconsistently.
|
||||
|
||||
- Remove refers to an action that can be restored or reapplied.
|
||||
- Delete refers to a permanent, non-recoverable action.
|
||||
|
||||
## Remove
|
||||
|
||||
Take away and set aside, but kept in existence.
|
||||
The term _Remove_ should always be used when an item/setting or content is to be removed or disassociated, but the action can be reversed or reapplied.
|
||||
|
||||
For example:
|
||||
|
||||
@@ -22,7 +25,7 @@ For example:
|
||||
|
||||
## Delete
|
||||
|
||||
Erase, rendered nonexistent or nonrecoverable.
|
||||
The term _Delete_ should always be used to refer to any action that will cause the permanent deletion of an item/setting or content.
|
||||
|
||||
For example:
|
||||
|
||||
|
@@ -64,6 +64,12 @@ const ACTIONS = [
|
||||
entity_id: "input_boolean.toggle_4",
|
||||
},
|
||||
},
|
||||
{
|
||||
sequence: [
|
||||
{ scene: "scene.kitchen_morning" },
|
||||
{ service: "light.turn_off", target: { entity_id: "light.kitchen" } },
|
||||
],
|
||||
},
|
||||
{
|
||||
parallel: [
|
||||
{ scene: "scene.kitchen_morning" },
|
||||
@@ -136,7 +142,7 @@ export class DemoAutomationDescribeAction extends LitElement {
|
||||
<div class="action">
|
||||
<span>
|
||||
${this._action
|
||||
? describeAction(this.hass, [], this._action)
|
||||
? describeAction(this.hass, [], [], [], this._action)
|
||||
: "<invalid YAML>"}
|
||||
</span>
|
||||
<ha-yaml-editor
|
||||
@@ -149,7 +155,7 @@ export class DemoAutomationDescribeAction extends LitElement {
|
||||
${ACTIONS.map(
|
||||
(conf) => html`
|
||||
<div class="action">
|
||||
<span>${describeAction(this.hass, [], conf as any)}</span>
|
||||
<span>${describeAction(this.hass, [], [], [], conf as any)}</span>
|
||||
<pre>${dump(conf)}</pre>
|
||||
</div>
|
||||
`
|
||||
|
@@ -20,6 +20,7 @@ import { HaWaitForTriggerAction } from "../../../../src/panels/config/automation
|
||||
import { HaWaitAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-wait_template";
|
||||
import { Action } from "../../../../src/data/script";
|
||||
import { HaConditionAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-condition";
|
||||
import { HaSequenceAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-sequence";
|
||||
import { HaParallelAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-parallel";
|
||||
import { HaIfAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-if";
|
||||
import { HaStopAction } from "../../../../src/panels/config/automation/action/types/ha-automation-action-stop";
|
||||
@@ -39,6 +40,7 @@ const SCHEMAS: { name: string; actions: Action[] }[] = [
|
||||
{ name: "If-Then", actions: [HaIfAction.defaultConfig] },
|
||||
{ name: "Choose", actions: [HaChooseAction.defaultConfig] },
|
||||
{ name: "Variables", actions: [{ variables: { hello: "1" } }] },
|
||||
{ name: "Sequence", actions: [HaSequenceAction.defaultConfig] },
|
||||
{ name: "Parallel", actions: [HaParallelAction.defaultConfig] },
|
||||
{ name: "Stop", actions: [HaStopAction.defaultConfig] },
|
||||
];
|
||||
|
@@ -15,6 +15,7 @@ import { getEntity } from "../../../../src/fake_data/entity";
|
||||
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
||||
import { HomeAssistant } from "../../../../src/types";
|
||||
import "../../components/demo-black-white-row";
|
||||
import { DeviceRegistryEntry } from "../../../../src/data/device_registry";
|
||||
|
||||
const ENTITIES = [
|
||||
getEntity("alarm_control_panel", "alarm", "disarmed", {
|
||||
@@ -41,7 +42,7 @@ const ENTITIES = [
|
||||
}),
|
||||
];
|
||||
|
||||
const DEVICES = [
|
||||
const DEVICES: DeviceRegistryEntry[] = [
|
||||
{
|
||||
area_id: "bedroom",
|
||||
configuration_url: null,
|
||||
@@ -53,6 +54,7 @@ const DEVICES = [
|
||||
identifiers: [["demo", "volume1"] as [string, string]],
|
||||
manufacturer: null,
|
||||
model: null,
|
||||
model_id: null,
|
||||
name_by_user: null,
|
||||
name: "Dishwasher",
|
||||
sw_version: null,
|
||||
@@ -60,6 +62,8 @@ const DEVICES = [
|
||||
via_device_id: null,
|
||||
serial_number: null,
|
||||
labels: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
{
|
||||
area_id: "backyard",
|
||||
@@ -72,6 +76,7 @@ const DEVICES = [
|
||||
identifiers: [["demo", "pwm1"] as [string, string]],
|
||||
manufacturer: null,
|
||||
model: null,
|
||||
model_id: null,
|
||||
name_by_user: null,
|
||||
name: "Lamp",
|
||||
sw_version: null,
|
||||
@@ -79,6 +84,8 @@ const DEVICES = [
|
||||
via_device_id: null,
|
||||
serial_number: null,
|
||||
labels: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
{
|
||||
area_id: null,
|
||||
@@ -91,6 +98,7 @@ const DEVICES = [
|
||||
identifiers: [["demo", "pwm1"] as [string, string]],
|
||||
manufacturer: null,
|
||||
model: null,
|
||||
model_id: null,
|
||||
name_by_user: "User name",
|
||||
name: "Technical name",
|
||||
sw_version: null,
|
||||
@@ -98,6 +106,8 @@ const DEVICES = [
|
||||
via_device_id: null,
|
||||
serial_number: null,
|
||||
labels: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -110,6 +120,8 @@ const AREAS: AreaRegistryEntry[] = [
|
||||
picture: null,
|
||||
aliases: [],
|
||||
labels: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
{
|
||||
area_id: "bedroom",
|
||||
@@ -119,6 +131,8 @@ const AREAS: AreaRegistryEntry[] = [
|
||||
picture: null,
|
||||
aliases: [],
|
||||
labels: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
{
|
||||
area_id: "livingroom",
|
||||
@@ -128,6 +142,8 @@ const AREAS: AreaRegistryEntry[] = [
|
||||
picture: null,
|
||||
aliases: [],
|
||||
labels: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
];
|
||||
|
||||
|
@@ -21,6 +21,7 @@ import { FloorRegistryEntry } from "../../../../src/data/floor_registry";
|
||||
import { LabelRegistryEntry } from "../../../../src/data/label_registry";
|
||||
import { mockFloorRegistry } from "../../../../demo/src/stubs/floor_registry";
|
||||
import { mockLabelRegistry } from "../../../../demo/src/stubs/label_registry";
|
||||
import { DeviceRegistryEntry } from "../../../../src/data/device_registry";
|
||||
|
||||
const ENTITIES = [
|
||||
getEntity("alarm_control_panel", "alarm", "disarmed", {
|
||||
@@ -41,7 +42,7 @@ const ENTITIES = [
|
||||
}),
|
||||
];
|
||||
|
||||
const DEVICES = [
|
||||
const DEVICES: DeviceRegistryEntry[] = [
|
||||
{
|
||||
area_id: "bedroom",
|
||||
configuration_url: null,
|
||||
@@ -53,6 +54,7 @@ const DEVICES = [
|
||||
identifiers: [["demo", "volume1"] as [string, string]],
|
||||
manufacturer: null,
|
||||
model: null,
|
||||
model_id: null,
|
||||
name_by_user: null,
|
||||
name: "Dishwasher",
|
||||
sw_version: null,
|
||||
@@ -60,6 +62,8 @@ const DEVICES = [
|
||||
via_device_id: null,
|
||||
serial_number: null,
|
||||
labels: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
{
|
||||
area_id: "backyard",
|
||||
@@ -72,6 +76,7 @@ const DEVICES = [
|
||||
identifiers: [["demo", "pwm1"] as [string, string]],
|
||||
manufacturer: null,
|
||||
model: null,
|
||||
model_id: null,
|
||||
name_by_user: null,
|
||||
name: "Lamp",
|
||||
sw_version: null,
|
||||
@@ -79,6 +84,8 @@ const DEVICES = [
|
||||
via_device_id: null,
|
||||
serial_number: null,
|
||||
labels: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
{
|
||||
area_id: null,
|
||||
@@ -91,6 +98,7 @@ const DEVICES = [
|
||||
identifiers: [["demo", "pwm1"] as [string, string]],
|
||||
manufacturer: null,
|
||||
model: null,
|
||||
model_id: null,
|
||||
name_by_user: "User name",
|
||||
name: "Technical name",
|
||||
sw_version: null,
|
||||
@@ -98,6 +106,8 @@ const DEVICES = [
|
||||
via_device_id: null,
|
||||
serial_number: null,
|
||||
labels: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -110,6 +120,8 @@ const AREAS: AreaRegistryEntry[] = [
|
||||
picture: null,
|
||||
aliases: [],
|
||||
labels: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
{
|
||||
area_id: "bedroom",
|
||||
@@ -119,6 +131,8 @@ const AREAS: AreaRegistryEntry[] = [
|
||||
picture: null,
|
||||
aliases: [],
|
||||
labels: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
{
|
||||
area_id: "livingroom",
|
||||
@@ -128,6 +142,8 @@ const AREAS: AreaRegistryEntry[] = [
|
||||
picture: null,
|
||||
aliases: [],
|
||||
labels: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -138,6 +154,8 @@ const FLOORS: FloorRegistryEntry[] = [
|
||||
level: 0,
|
||||
icon: null,
|
||||
aliases: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
{
|
||||
floor_id: "first",
|
||||
@@ -145,6 +163,8 @@ const FLOORS: FloorRegistryEntry[] = [
|
||||
level: 1,
|
||||
icon: "mdi:numeric-1",
|
||||
aliases: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
{
|
||||
floor_id: "second",
|
||||
@@ -152,6 +172,8 @@ const FLOORS: FloorRegistryEntry[] = [
|
||||
level: 2,
|
||||
icon: "mdi:numeric-2",
|
||||
aliases: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -161,12 +183,18 @@ const LABELS: LabelRegistryEntry[] = [
|
||||
name: "Energy",
|
||||
icon: null,
|
||||
color: "yellow",
|
||||
description: null,
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
{
|
||||
label_id: "entertainment",
|
||||
name: "Entertainment",
|
||||
icon: "mdi:popcorn",
|
||||
color: "blue",
|
||||
description: null,
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
];
|
||||
|
||||
|
@@ -56,48 +56,46 @@ export class DemoDateTimeDateTimeNumeric extends LitElement {
|
||||
<div class="center">12 Hours</div>
|
||||
<div class="center">24 Hours</div>
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations)
|
||||
.filter(([key, _]) => key !== "test")
|
||||
.map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatDateTimeNumeric(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatDateTimeNumeric(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatDateTimeNumeric(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations).map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatDateTimeNumeric(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
<div class="center">
|
||||
${formatDateTimeNumeric(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatDateTimeNumeric(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
</mwc-list>
|
||||
`;
|
||||
}
|
||||
|
@@ -56,48 +56,46 @@ export class DemoDateTimeDateTimeSeconds extends LitElement {
|
||||
<div class="center">12 Hours</div>
|
||||
<div class="center">24 Hours</div>
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations)
|
||||
.filter(([key, _]) => key !== "test")
|
||||
.map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatDateTimeWithSeconds(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatDateTimeWithSeconds(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatDateTimeWithSeconds(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations).map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatDateTimeWithSeconds(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
<div class="center">
|
||||
${formatDateTimeWithSeconds(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatDateTimeWithSeconds(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
</mwc-list>
|
||||
`;
|
||||
}
|
||||
|
@@ -56,48 +56,46 @@ export class DemoDateTimeDateTimeShortYear extends LitElement {
|
||||
<div class="center">12 Hours</div>
|
||||
<div class="center">24 Hours</div>
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations)
|
||||
.filter(([key, _]) => key !== "test")
|
||||
.map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatShortDateTimeWithYear(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatShortDateTimeWithYear(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatShortDateTimeWithYear(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations).map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatShortDateTimeWithYear(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
<div class="center">
|
||||
${formatShortDateTimeWithYear(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatShortDateTimeWithYear(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
</mwc-list>
|
||||
`;
|
||||
}
|
||||
|
@@ -56,48 +56,46 @@ export class DemoDateTimeDateTimeShort extends LitElement {
|
||||
<div class="center">12 Hours</div>
|
||||
<div class="center">24 Hours</div>
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations)
|
||||
.filter(([key, _]) => key !== "test")
|
||||
.map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatShortDateTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatShortDateTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatShortDateTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations).map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatShortDateTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
<div class="center">
|
||||
${formatShortDateTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatShortDateTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
</mwc-list>
|
||||
`;
|
||||
}
|
||||
|
@@ -56,48 +56,46 @@ export class DemoDateTimeDateTime extends LitElement {
|
||||
<div class="center">12 Hours</div>
|
||||
<div class="center">24 Hours</div>
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations)
|
||||
.filter(([key, _]) => key !== "test")
|
||||
.map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatDateTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatDateTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatDateTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations).map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatDateTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
<div class="center">
|
||||
${formatDateTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatDateTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
</mwc-list>
|
||||
`;
|
||||
}
|
||||
|
@@ -35,59 +35,57 @@ export class DemoDateTimeDate extends LitElement {
|
||||
<div class="center">Month-Day-Year</div>
|
||||
<div class="center">Year-Month-Day</div>
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations)
|
||||
.filter(([key, _]) => key !== "test")
|
||||
.map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatDateNumeric(
|
||||
date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
date_format: DateFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatDateNumeric(
|
||||
date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
date_format: DateFormat.DMY,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatDateNumeric(
|
||||
date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
date_format: DateFormat.MDY,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatDateNumeric(
|
||||
date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
date_format: DateFormat.YMD,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations).map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatDateNumeric(
|
||||
date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
date_format: DateFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
<div class="center">
|
||||
${formatDateNumeric(
|
||||
date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
date_format: DateFormat.DMY,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatDateNumeric(
|
||||
date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
date_format: DateFormat.MDY,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatDateNumeric(
|
||||
date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
date_format: DateFormat.YMD,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
</mwc-list>
|
||||
`;
|
||||
}
|
||||
|
@@ -56,48 +56,46 @@ export class DemoDateTimeTimeSeconds extends LitElement {
|
||||
<div class="center">12 Hours</div>
|
||||
<div class="center">24 Hours</div>
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations)
|
||||
.filter(([key, _]) => key !== "test")
|
||||
.map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatTimeWithSeconds(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatTimeWithSeconds(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatTimeWithSeconds(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations).map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatTimeWithSeconds(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
<div class="center">
|
||||
${formatTimeWithSeconds(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatTimeWithSeconds(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
</mwc-list>
|
||||
`;
|
||||
}
|
||||
|
@@ -56,48 +56,46 @@ export class DemoDateTimeTimeWeekday extends LitElement {
|
||||
<div class="center">12 Hours</div>
|
||||
<div class="center">24 Hours</div>
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations)
|
||||
.filter(([key, _]) => key !== "test")
|
||||
.map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatTimeWeekday(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatTimeWeekday(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatTimeWeekday(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations).map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatTimeWeekday(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
<div class="center">
|
||||
${formatTimeWeekday(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatTimeWeekday(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
</mwc-list>
|
||||
`;
|
||||
}
|
||||
|
@@ -56,48 +56,46 @@ export class DemoDateTimeTime extends LitElement {
|
||||
<div class="center">12 Hours</div>
|
||||
<div class="center">24 Hours</div>
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations)
|
||||
.filter(([key, _]) => key !== "test")
|
||||
.map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
${Object.entries(translationMetadata.translations).map(
|
||||
([key, value]) => html`
|
||||
<div class="container">
|
||||
<div>${value.nativeName}</div>
|
||||
<div class="center">
|
||||
${formatTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.language,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
<div class="center">
|
||||
${formatTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.am_pm,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
<div class="center">
|
||||
${formatTime(
|
||||
this.date,
|
||||
{
|
||||
...defaultLocale,
|
||||
language: key,
|
||||
time_format: TimeFormat.twenty_four,
|
||||
},
|
||||
demoConfig
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
</mwc-list>
|
||||
`;
|
||||
}
|
||||
|
@@ -287,11 +287,11 @@ const CONFIGS = [
|
||||
config: `
|
||||
- type: entities
|
||||
entities:
|
||||
- type: call-service
|
||||
- type: perform-action
|
||||
icon: mdi:power
|
||||
name: Bed light
|
||||
action_name: Toggle light
|
||||
service: light.toggle
|
||||
action: light.toggle
|
||||
data:
|
||||
entity_id: light.bed_light
|
||||
- type: section
|
||||
|
3
gallery/src/pages/lovelace/picture-card.markdown
Normal file
3
gallery/src/pages/lovelace/picture-card.markdown
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
title: Picture Card
|
||||
---
|
61
gallery/src/pages/lovelace/picture-card.ts
Normal file
61
gallery/src/pages/lovelace/picture-card.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import { html, LitElement, PropertyValues, TemplateResult } from "lit";
|
||||
import { customElement, query } from "lit/decorators";
|
||||
import { getEntity } from "../../../../src/fake_data/entity";
|
||||
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
||||
import "../../components/demo-cards";
|
||||
import { mockIcons } from "../../../../demo/src/stubs/icons";
|
||||
|
||||
const ENTITIES = [
|
||||
getEntity("person", "paulus", "home", {
|
||||
friendly_name: "Paulus",
|
||||
entity_picture: "/images/paulus.jpg",
|
||||
}),
|
||||
];
|
||||
|
||||
const CONFIGS = [
|
||||
{
|
||||
heading: "Image URL",
|
||||
config: `
|
||||
- type: picture
|
||||
image: /images/living_room.png
|
||||
`,
|
||||
},
|
||||
{
|
||||
heading: "Person entity",
|
||||
config: `
|
||||
- type: picture
|
||||
image_entity: person.paulus
|
||||
`,
|
||||
},
|
||||
{
|
||||
heading: "Error: Image required",
|
||||
config: `
|
||||
- type: picture
|
||||
entity: person.paulus
|
||||
`,
|
||||
},
|
||||
];
|
||||
|
||||
@customElement("demo-lovelace-picture-card")
|
||||
class DemoPicture extends LitElement {
|
||||
@query("#demos") private _demoRoot!: HTMLElement;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
return html`<demo-cards id="demos" .configs=${CONFIGS}></demo-cards>`;
|
||||
}
|
||||
|
||||
protected firstUpdated(changedProperties: PropertyValues) {
|
||||
super.firstUpdated(changedProperties);
|
||||
const hass = provideHass(this._demoRoot);
|
||||
hass.updateTranslations(null, "en");
|
||||
hass.updateTranslations("lovelace", "en");
|
||||
hass.addEntities(ENTITIES);
|
||||
mockIcons(hass);
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"demo-lovelace-picture-card": DemoPicture;
|
||||
}
|
||||
}
|
@@ -25,6 +25,15 @@ const ENTITIES = [
|
||||
friendly_name: "Movement Backyard",
|
||||
device_class: "motion",
|
||||
}),
|
||||
getEntity("person", "paulus", "home", {
|
||||
friendly_name: "Paulus",
|
||||
entity_picture: "/images/paulus.jpg",
|
||||
}),
|
||||
getEntity("sensor", "battery", 35, {
|
||||
device_class: "battery",
|
||||
friendly_name: "Battery",
|
||||
unit_of_measurement: "%",
|
||||
}),
|
||||
];
|
||||
|
||||
const CONFIGS = [
|
||||
@@ -123,6 +132,19 @@ const CONFIGS = [
|
||||
left: 35%
|
||||
`,
|
||||
},
|
||||
{
|
||||
heading: "Person entity",
|
||||
config: `
|
||||
- type: picture-elements
|
||||
image_entity: person.paulus
|
||||
elements:
|
||||
- type: state-icon
|
||||
entity: sensor.battery
|
||||
style:
|
||||
top: 8%
|
||||
left: 8%
|
||||
`,
|
||||
},
|
||||
];
|
||||
|
||||
@customElement("demo-lovelace-picture-elements-card")
|
||||
|
@@ -12,6 +12,10 @@ const ENTITIES = [
|
||||
getEntity("light", "bed_light", "off", {
|
||||
friendly_name: "Bed Light",
|
||||
}),
|
||||
getEntity("person", "paulus", "home", {
|
||||
friendly_name: "Paulus",
|
||||
entity_picture: "/images/paulus.jpg",
|
||||
}),
|
||||
];
|
||||
|
||||
const CONFIGS = [
|
||||
@@ -50,6 +54,13 @@ const CONFIGS = [
|
||||
entity: camera.demo_camera
|
||||
`,
|
||||
},
|
||||
{
|
||||
heading: "Person entity",
|
||||
config: `
|
||||
- type: picture-entity
|
||||
entity: person.paulus
|
||||
`,
|
||||
},
|
||||
{
|
||||
heading: "Hidden name",
|
||||
config: `
|
||||
|
@@ -20,6 +20,15 @@ const ENTITIES = [
|
||||
friendly_name: "Basement Floor Wet",
|
||||
device_class: "moisture",
|
||||
}),
|
||||
getEntity("person", "paulus", "home", {
|
||||
friendly_name: "Paulus",
|
||||
entity_picture: "/images/paulus.jpg",
|
||||
}),
|
||||
getEntity("sensor", "battery", 35, {
|
||||
device_class: "battery",
|
||||
friendly_name: "Battery",
|
||||
unit_of_measurement: "%",
|
||||
}),
|
||||
];
|
||||
|
||||
const CONFIGS = [
|
||||
@@ -90,6 +99,15 @@ const CONFIGS = [
|
||||
- light.ceiling_lights
|
||||
`,
|
||||
},
|
||||
{
|
||||
heading: "Person entity",
|
||||
config: `
|
||||
- type: picture-glance
|
||||
image_entity: person.paulus
|
||||
entities:
|
||||
- sensor.battery
|
||||
`,
|
||||
},
|
||||
{
|
||||
heading: "Custom icon",
|
||||
config: `
|
||||
|
@@ -2,11 +2,13 @@ import { html, LitElement, PropertyValues, TemplateResult } from "lit";
|
||||
import { customElement, query } from "lit/decorators";
|
||||
import { CoverEntityFeature } from "../../../../src/data/cover";
|
||||
import { LightColorMode } from "../../../../src/data/light";
|
||||
import { LockEntityFeature } from "../../../../src/data/lock";
|
||||
import { VacuumEntityFeature } from "../../../../src/data/vacuum";
|
||||
import { getEntity } from "../../../../src/fake_data/entity";
|
||||
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
||||
import "../../components/demo-cards";
|
||||
import { mockIcons } from "../../../../demo/src/stubs/icons";
|
||||
import { ClimateEntityFeature } from "../../../../src/data/climate";
|
||||
|
||||
const ENTITIES = [
|
||||
getEntity("switch", "tv_outlet", "on", {
|
||||
@@ -20,6 +22,11 @@ const ENTITIES = [
|
||||
getEntity("light", "unavailable", "unavailable", {
|
||||
friendly_name: "Unavailable entity",
|
||||
}),
|
||||
getEntity("lock", "front_door", "locked", {
|
||||
friendly_name: "Front Door Lock",
|
||||
device_class: "lock",
|
||||
supported_features: LockEntityFeature.OPEN,
|
||||
}),
|
||||
getEntity("climate", "thermostat", "heat", {
|
||||
current_temperature: 73,
|
||||
min_temp: 45,
|
||||
@@ -54,6 +61,36 @@ const ENTITIES = [
|
||||
CoverEntityFeature.OPEN_TILT +
|
||||
CoverEntityFeature.STOP_TILT,
|
||||
}),
|
||||
getEntity("input_number", "counter", "1.0", {
|
||||
friendly_name: "Counter",
|
||||
initial: 0,
|
||||
min: 0,
|
||||
max: 100,
|
||||
step: 1,
|
||||
mode: "slider",
|
||||
}),
|
||||
getEntity("climate", "dual_thermostat", "heat/cool", {
|
||||
friendly_name: "Dual thermostat",
|
||||
hvac_modes: ["off", "cool", "heat_cool", "auto", "dry", "fan_only"],
|
||||
min_temp: 7,
|
||||
max_temp: 35,
|
||||
fan_modes: ["on_low", "on_high", "auto_low", "auto_high", "off"],
|
||||
preset_modes: ["home", "eco", "away"],
|
||||
swing_modes: ["auto", "1", "2", "3", "off"],
|
||||
current_temperature: 23,
|
||||
target_temp_high: 24,
|
||||
target_temp_low: 21,
|
||||
fan_mode: "auto_low",
|
||||
preset_mode: "home",
|
||||
swing_mode: "auto",
|
||||
supported_features:
|
||||
ClimateEntityFeature.TURN_ON +
|
||||
ClimateEntityFeature.TURN_OFF +
|
||||
ClimateEntityFeature.SWING_MODE +
|
||||
ClimateEntityFeature.PRESET_MODE +
|
||||
ClimateEntityFeature.FAN_MODE +
|
||||
ClimateEntityFeature.TARGET_TEMPERATURE_RANGE,
|
||||
}),
|
||||
];
|
||||
|
||||
const CONFIGS = [
|
||||
@@ -138,6 +175,24 @@ const CONFIGS = [
|
||||
- type: "color-temp"
|
||||
`,
|
||||
},
|
||||
{
|
||||
heading: "Lock commands feature",
|
||||
config: `
|
||||
- type: tile
|
||||
entity: lock.front_door
|
||||
features:
|
||||
- type: "lock-commands"
|
||||
`,
|
||||
},
|
||||
{
|
||||
heading: "Lock open door feature",
|
||||
config: `
|
||||
- type: tile
|
||||
entity: lock.front_door
|
||||
features:
|
||||
- type: "lock-open-door"
|
||||
`,
|
||||
},
|
||||
{
|
||||
heading: "Vacuum commands feature",
|
||||
config: `
|
||||
@@ -169,6 +224,25 @@ const CONFIGS = [
|
||||
- type: "cover-tilt"
|
||||
`,
|
||||
},
|
||||
{
|
||||
heading: "Number buttons feature",
|
||||
config: `
|
||||
- type: tile
|
||||
entity: input_number.counter
|
||||
features:
|
||||
- type: numeric-input
|
||||
style: buttons
|
||||
`,
|
||||
},
|
||||
{
|
||||
heading: "Dual thermostat feature",
|
||||
config: `
|
||||
- type: tile
|
||||
entity: climate.dual_thermostat
|
||||
features:
|
||||
- type: target-temperature
|
||||
`,
|
||||
},
|
||||
];
|
||||
|
||||
@customElement("demo-lovelace-tile-card")
|
||||
|
@@ -140,6 +140,9 @@ const ENTITIES: HassEntity[] = [
|
||||
createEntity("climate.auto_preheating", "auto", undefined, {
|
||||
hvac_action: "preheating",
|
||||
}),
|
||||
createEntity("climate.auto_defrosting", "auto", undefined, {
|
||||
hvac_action: "defrosting",
|
||||
}),
|
||||
createEntity("climate.auto_heating", "auto", undefined, {
|
||||
hvac_action: "heating",
|
||||
}),
|
||||
@@ -355,19 +358,18 @@ export class DemoEntityState extends LitElement {
|
||||
},
|
||||
entity_id: {
|
||||
title: "Entity ID",
|
||||
width: "30%",
|
||||
filterable: true,
|
||||
sortable: true,
|
||||
},
|
||||
state: {
|
||||
title: "State",
|
||||
width: "20%",
|
||||
sortable: true,
|
||||
template: (entry) =>
|
||||
html`${computeStateDisplay(
|
||||
hass.localize,
|
||||
entry.stateObj,
|
||||
hass.locale,
|
||||
[], // numericDeviceClasses
|
||||
hass.config,
|
||||
hass.entities
|
||||
)}`,
|
||||
@@ -375,14 +377,12 @@ export class DemoEntityState extends LitElement {
|
||||
device_class: {
|
||||
title: "Device class",
|
||||
template: (entry) => html`${entry.device_class ?? "-"}`,
|
||||
width: "20%",
|
||||
filterable: true,
|
||||
sortable: true,
|
||||
},
|
||||
domain: {
|
||||
title: "Domain",
|
||||
template: (entry) => html`${computeDomain(entry.entity_id)}`,
|
||||
width: "20%",
|
||||
filterable: true,
|
||||
sortable: true,
|
||||
},
|
||||
|
@@ -36,6 +36,8 @@ const createConfigEntry = (
|
||||
pref_disable_new_entities: false,
|
||||
pref_disable_polling: false,
|
||||
reason: null,
|
||||
error_reason_translation_key: null,
|
||||
error_reason_translation_placeholders: null,
|
||||
...override,
|
||||
});
|
||||
|
||||
@@ -201,6 +203,8 @@ const createEntityRegistryEntries = (
|
||||
options: null,
|
||||
labels: [],
|
||||
categories: {},
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -213,6 +217,7 @@ const createDeviceRegistryEntries = (
|
||||
connections: [],
|
||||
manufacturer: "ESPHome",
|
||||
model: "Mock Device",
|
||||
model_id: "ABC-001",
|
||||
name: "Tag Reader",
|
||||
sw_version: null,
|
||||
hw_version: "1.0.0",
|
||||
@@ -225,6 +230,8 @@ const createDeviceRegistryEntries = (
|
||||
disabled_by: null,
|
||||
configuration_url: null,
|
||||
labels: [],
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
},
|
||||
];
|
||||
|
||||
|
@@ -1,4 +1,7 @@
|
||||
import { globIterate } from "glob";
|
||||
import { availableParallelism } from "node:os";
|
||||
|
||||
process.env.UV_THREADPOOL_SIZE = availableParallelism();
|
||||
|
||||
const gulpImports = [];
|
||||
|
||||
|
@@ -127,14 +127,13 @@ export class HassioBackups extends LitElement {
|
||||
main: true,
|
||||
sortable: true,
|
||||
filterable: true,
|
||||
grows: true,
|
||||
flex: 2,
|
||||
template: (backup) =>
|
||||
html`${backup.name || backup.slug}
|
||||
<div class="secondary">${backup.secondary}</div>`,
|
||||
},
|
||||
size: {
|
||||
title: this.supervisor.localize("backup.size"),
|
||||
width: "15%",
|
||||
hidden: narrow,
|
||||
filterable: true,
|
||||
sortable: true,
|
||||
@@ -142,7 +141,6 @@ export class HassioBackups extends LitElement {
|
||||
},
|
||||
location: {
|
||||
title: this.supervisor.localize("backup.location"),
|
||||
width: "15%",
|
||||
hidden: narrow,
|
||||
filterable: true,
|
||||
sortable: true,
|
||||
@@ -151,7 +149,6 @@ export class HassioBackups extends LitElement {
|
||||
},
|
||||
date: {
|
||||
title: this.supervisor.localize("backup.created"),
|
||||
width: "15%",
|
||||
direction: "desc",
|
||||
hidden: narrow,
|
||||
filterable: true,
|
||||
|
@@ -1,6 +1,8 @@
|
||||
import Fuse from "fuse.js";
|
||||
import type { IFuseOptions } from "fuse.js";
|
||||
import Fuse from "fuse.js";
|
||||
import { stripDiacritics } from "../../../src/common/string/strip-diacritics";
|
||||
import { StoreAddon } from "../../../src/data/supervisor/store";
|
||||
import { getStripDiacriticsFn } from "../../../src/util/fuse";
|
||||
|
||||
export function filterAndSort(addons: StoreAddon[], filter: string) {
|
||||
const options: IFuseOptions<StoreAddon> = {
|
||||
@@ -8,7 +10,8 @@ export function filterAndSort(addons: StoreAddon[], filter: string) {
|
||||
isCaseSensitive: false,
|
||||
minMatchCharLength: Math.min(filter.length, 2),
|
||||
threshold: 0.2,
|
||||
getFn: getStripDiacriticsFn,
|
||||
};
|
||||
const fuse = new Fuse(addons, options);
|
||||
return fuse.search(filter).map((result) => result.item);
|
||||
return fuse.search(stripDiacritics(filter)).map((result) => result.item);
|
||||
}
|
||||
|
@@ -1,19 +1,19 @@
|
||||
import { mdiStorePlus, mdiUpdate } from "@mdi/js";
|
||||
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
||||
import { mdiRefresh, mdiStorePlus } from "@mdi/js";
|
||||
import { CSSResultGroup, LitElement, TemplateResult, css, html } from "lit";
|
||||
import { customElement, property } from "lit/decorators";
|
||||
import { atLeastVersion } from "../../../src/common/config/version";
|
||||
import { fireEvent } from "../../../src/common/dom/fire_event";
|
||||
import "../../../src/components/ha-fab";
|
||||
import { reloadHassioAddons } from "../../../src/data/hassio/addon";
|
||||
import { extractApiErrorMessage } from "../../../src/data/hassio/common";
|
||||
import { Supervisor } from "../../../src/data/supervisor/supervisor";
|
||||
import { showAlertDialog } from "../../../src/dialogs/generic/show-dialog-box";
|
||||
import "../../../src/layouts/hass-subpage";
|
||||
import "../../../src/layouts/hass-tabs-subpage";
|
||||
import { haStyle } from "../../../src/resources/styles";
|
||||
import { HomeAssistant, Route } from "../../../src/types";
|
||||
import { supervisorTabs } from "../hassio-tabs";
|
||||
import "./hassio-addons";
|
||||
import "../../../src/layouts/hass-subpage";
|
||||
import { reloadHassioAddons } from "../../../src/data/hassio/addon";
|
||||
import { extractApiErrorMessage } from "../../../src/data/hassio/common";
|
||||
import { showAlertDialog } from "../../../src/dialogs/generic/show-dialog-box";
|
||||
import { fireEvent } from "../../../src/common/dom/fire_event";
|
||||
|
||||
@customElement("hassio-dashboard")
|
||||
class HassioDashboard extends LitElement {
|
||||
@@ -43,7 +43,7 @@ class HassioDashboard extends LitElement {
|
||||
<ha-icon-button
|
||||
slot="toolbar-icon"
|
||||
@click=${this._handleCheckUpdates}
|
||||
.path=${mdiUpdate}
|
||||
.path=${mdiRefresh}
|
||||
.label=${this.supervisor.localize("store.check_updates")}
|
||||
></ha-icon-button>
|
||||
<hassio-addons
|
||||
|
@@ -66,7 +66,8 @@ class HassioRepositoriesDialog extends LitElement {
|
||||
repo.slug !== "core" && // The core add-ons repository
|
||||
repo.slug !== "local" && // Locally managed add-ons
|
||||
repo.slug !== "a0d7b954" && // Home Assistant Community Add-ons
|
||||
repo.slug !== "5c53de3b" // The ESPHome repository
|
||||
repo.slug !== "5c53de3b" && // The ESPHome repository
|
||||
repo.slug !== "d5369777" // Music Assistant repository
|
||||
)
|
||||
.sort((a, b) =>
|
||||
caseInsensitiveStringCompare(a.name, b.name, this.hass.locale.language)
|
||||
|
@@ -4,11 +4,7 @@
|
||||
el.src = src;
|
||||
document.body.appendChild(el);
|
||||
}
|
||||
if (/.*Version\/(?:11|12)(?:\.\d+)*.*Safari\//.test(navigator.userAgent)) {
|
||||
<% for (const entry of es5EntryJS) { %>
|
||||
loadES5("<%= entry %>");
|
||||
<% } %>
|
||||
} else {
|
||||
if (<%= modernRegex %>.test(navigator.userAgent)) {
|
||||
try {
|
||||
<% for (const entry of latestEntryJS) { %>
|
||||
new Function("import('<%= entry %>')")();
|
||||
@@ -17,6 +13,10 @@
|
||||
<% for (const entry of es5EntryJS) { %>
|
||||
loadES5("<%= entry %>");
|
||||
<% } %>
|
||||
} else {
|
||||
<% for (const entry of es5EntryJS) { %>
|
||||
loadES5("<%= entry %>");
|
||||
<% } %>
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
@@ -1,6 +1,5 @@
|
||||
// Compat needs to be first import
|
||||
import "../../src/resources/compatibility";
|
||||
import "../../src/resources/safari-14-attachshadow-patch";
|
||||
import "./hassio-main";
|
||||
|
||||
import("../../src/resources/ha-style");
|
||||
|
188
package.json
188
package.json
@@ -16,7 +16,7 @@
|
||||
"lint:lit": "lit-analyzer \"{.,*}/src/**/*.ts\"",
|
||||
"lint": "yarn run lint:eslint && yarn run lint:prettier && yarn run lint:types && yarn run lint:lit",
|
||||
"format": "yarn run format:eslint && yarn run format:prettier",
|
||||
"postinstall": "husky install",
|
||||
"postinstall": "husky",
|
||||
"prepack": "pinst --disable",
|
||||
"postpack": "pinst --enable",
|
||||
"test": "instant-mocha --webpack-config ./test/webpack.config.js --require ./test/setup.cjs \"test/**/*.ts\""
|
||||
@@ -25,35 +25,35 @@
|
||||
"license": "Apache-2.0",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.24.1",
|
||||
"@braintree/sanitize-url": "7.0.1",
|
||||
"@codemirror/autocomplete": "6.15.0",
|
||||
"@codemirror/commands": "6.3.3",
|
||||
"@codemirror/language": "6.10.1",
|
||||
"@codemirror/legacy-modes": "6.3.3",
|
||||
"@babel/runtime": "7.25.4",
|
||||
"@braintree/sanitize-url": "7.1.0",
|
||||
"@codemirror/autocomplete": "6.18.0",
|
||||
"@codemirror/commands": "6.6.0",
|
||||
"@codemirror/language": "6.10.2",
|
||||
"@codemirror/legacy-modes": "6.4.1",
|
||||
"@codemirror/search": "6.5.6",
|
||||
"@codemirror/state": "6.4.1",
|
||||
"@codemirror/view": "6.26.1",
|
||||
"@codemirror/view": "6.32.0",
|
||||
"@egjs/hammerjs": "2.0.17",
|
||||
"@formatjs/intl-datetimeformat": "6.12.3",
|
||||
"@formatjs/intl-displaynames": "6.6.6",
|
||||
"@formatjs/intl-datetimeformat": "6.12.5",
|
||||
"@formatjs/intl-displaynames": "6.6.8",
|
||||
"@formatjs/intl-getcanonicallocales": "2.3.0",
|
||||
"@formatjs/intl-listformat": "7.5.5",
|
||||
"@formatjs/intl-locale": "3.4.5",
|
||||
"@formatjs/intl-numberformat": "8.10.1",
|
||||
"@formatjs/intl-pluralrules": "5.2.12",
|
||||
"@formatjs/intl-relativetimeformat": "11.2.12",
|
||||
"@fullcalendar/core": "6.1.11",
|
||||
"@fullcalendar/daygrid": "6.1.11",
|
||||
"@fullcalendar/interaction": "6.1.11",
|
||||
"@fullcalendar/list": "6.1.11",
|
||||
"@fullcalendar/luxon3": "6.1.11",
|
||||
"@fullcalendar/timegrid": "6.1.11",
|
||||
"@lezer/highlight": "1.2.0",
|
||||
"@formatjs/intl-listformat": "7.5.7",
|
||||
"@formatjs/intl-locale": "4.0.0",
|
||||
"@formatjs/intl-numberformat": "8.10.3",
|
||||
"@formatjs/intl-pluralrules": "5.2.14",
|
||||
"@formatjs/intl-relativetimeformat": "11.2.14",
|
||||
"@fullcalendar/core": "6.1.15",
|
||||
"@fullcalendar/daygrid": "6.1.15",
|
||||
"@fullcalendar/interaction": "6.1.15",
|
||||
"@fullcalendar/list": "6.1.15",
|
||||
"@fullcalendar/luxon3": "6.1.15",
|
||||
"@fullcalendar/timegrid": "6.1.15",
|
||||
"@lezer/highlight": "1.2.1",
|
||||
"@lit-labs/context": "0.4.1",
|
||||
"@lit-labs/motion": "1.0.7",
|
||||
"@lit-labs/observers": "2.0.2",
|
||||
"@lit-labs/virtualizer": "2.0.12",
|
||||
"@lit-labs/virtualizer": "2.0.14",
|
||||
"@lrnwebcomponents/simple-tooltip": "8.0.2",
|
||||
"@material/chips": "=14.0.0-canary.53b3cad2f.0",
|
||||
"@material/data-table": "=14.0.0-canary.53b3cad2f.0",
|
||||
@@ -70,7 +70,6 @@
|
||||
"@material/mwc-list": "0.27.0",
|
||||
"@material/mwc-menu": "0.27.0",
|
||||
"@material/mwc-radio": "0.27.0",
|
||||
"@material/mwc-ripple": "0.27.0",
|
||||
"@material/mwc-select": "0.27.0",
|
||||
"@material/mwc-snackbar": "0.27.0",
|
||||
"@material/mwc-switch": "0.27.0",
|
||||
@@ -81,7 +80,7 @@
|
||||
"@material/mwc-top-app-bar": "0.27.0",
|
||||
"@material/mwc-top-app-bar-fixed": "0.27.0",
|
||||
"@material/top-app-bar": "=14.0.0-canary.53b3cad2f.0",
|
||||
"@material/web": "=1.3.0",
|
||||
"@material/web": "2.1.0",
|
||||
"@mdi/js": "7.4.47",
|
||||
"@mdi/svg": "7.4.47",
|
||||
"@polymer/paper-item": "3.0.1",
|
||||
@@ -89,8 +88,8 @@
|
||||
"@polymer/paper-tabs": "3.1.0",
|
||||
"@polymer/polymer": "3.5.1",
|
||||
"@thomasloven/round-slider": "0.6.0",
|
||||
"@vaadin/combo-box": "24.3.10",
|
||||
"@vaadin/vaadin-themable-mixin": "24.3.10",
|
||||
"@vaadin/combo-box": "24.4.6",
|
||||
"@vaadin/vaadin-themable-mixin": "24.4.6",
|
||||
"@vibrant/color": "3.2.1-alpha.1",
|
||||
"@vibrant/core": "3.2.1-alpha.1",
|
||||
"@vibrant/quantizer-mmcq": "3.2.1-alpha.1",
|
||||
@@ -98,157 +97,155 @@
|
||||
"@webcomponents/scoped-custom-element-registry": "0.0.9",
|
||||
"@webcomponents/webcomponentsjs": "2.8.0",
|
||||
"app-datepicker": "5.1.1",
|
||||
"chart.js": "4.4.2",
|
||||
"chart.js": "4.4.4",
|
||||
"color-name": "2.0.0",
|
||||
"comlink": "4.4.1",
|
||||
"core-js": "3.36.1",
|
||||
"cropperjs": "1.6.1",
|
||||
"date-fns": "2.30.0",
|
||||
"date-fns-tz": "2.0.1",
|
||||
"core-js": "3.38.1",
|
||||
"cropperjs": "1.6.2",
|
||||
"date-fns": "3.6.0",
|
||||
"date-fns-tz": "3.1.3",
|
||||
"deep-clone-simple": "1.1.1",
|
||||
"deep-freeze": "0.0.1",
|
||||
"element-internals-polyfill": "1.3.10",
|
||||
"element-internals-polyfill": "1.3.11",
|
||||
"fuse.js": "7.0.0",
|
||||
"google-timezones-json": "1.2.0",
|
||||
"hls.js": "patch:hls.js@npm%3A1.5.7#~/.yarn/patches/hls.js-npm-1.5.7-f5bbd3d060.patch",
|
||||
"home-assistant-js-websocket": "9.2.1",
|
||||
"home-assistant-js-websocket": "9.4.0",
|
||||
"idb-keyval": "6.2.1",
|
||||
"intl-messageformat": "10.5.11",
|
||||
"intl-messageformat": "10.5.14",
|
||||
"js-yaml": "4.1.0",
|
||||
"leaflet": "1.9.4",
|
||||
"leaflet-draw": "1.0.4",
|
||||
"lit": "2.8.0",
|
||||
"luxon": "3.4.4",
|
||||
"marked": "12.0.1",
|
||||
"luxon": "3.5.0",
|
||||
"marked": "14.0.0",
|
||||
"memoize-one": "6.0.0",
|
||||
"node-vibrant": "3.2.1-alpha.1",
|
||||
"proxy-polyfill": "0.3.2",
|
||||
"punycode": "2.3.1",
|
||||
"qr-scanner": "1.4.2",
|
||||
"qrcode": "1.5.3",
|
||||
"qrcode": "1.5.4",
|
||||
"roboto-fontface": "0.10.0",
|
||||
"rrule": "2.8.1",
|
||||
"sortablejs": "1.15.2",
|
||||
"stacktrace-js": "2.0.2",
|
||||
"superstruct": "1.0.4",
|
||||
"tinykeys": "2.1.0",
|
||||
"superstruct": "2.0.2",
|
||||
"tinykeys": "3.0.0",
|
||||
"tsparticles-engine": "2.12.0",
|
||||
"tsparticles-preset-links": "2.12.0",
|
||||
"ua-parser-js": "1.0.37",
|
||||
"ua-parser-js": "1.0.38",
|
||||
"unfetch": "5.0.0",
|
||||
"vis-data": "7.1.9",
|
||||
"vis-network": "9.1.9",
|
||||
"vue": "2.7.16",
|
||||
"vue2-daterange-picker": "0.6.8",
|
||||
"weekstart": "2.0.0",
|
||||
"workbox-cacheable-response": "7.0.0",
|
||||
"workbox-core": "7.0.0",
|
||||
"workbox-expiration": "7.0.0",
|
||||
"workbox-precaching": "7.0.0",
|
||||
"workbox-routing": "7.0.0",
|
||||
"workbox-strategies": "7.0.0",
|
||||
"workbox-cacheable-response": "7.1.0",
|
||||
"workbox-core": "7.1.0",
|
||||
"workbox-expiration": "7.1.0",
|
||||
"workbox-precaching": "7.1.0",
|
||||
"workbox-routing": "7.1.0",
|
||||
"workbox-strategies": "7.1.0",
|
||||
"xss": "1.0.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.24.3",
|
||||
"@babel/helper-define-polyfill-provider": "0.6.1",
|
||||
"@babel/plugin-proposal-decorators": "7.24.1",
|
||||
"@babel/plugin-transform-runtime": "7.24.3",
|
||||
"@babel/preset-env": "7.24.3",
|
||||
"@babel/preset-typescript": "7.24.1",
|
||||
"@bundle-stats/plugin-webpack-filter": "4.12.2",
|
||||
"@babel/core": "7.25.2",
|
||||
"@babel/helper-define-polyfill-provider": "0.6.2",
|
||||
"@babel/plugin-proposal-decorators": "7.24.7",
|
||||
"@babel/plugin-transform-runtime": "7.25.4",
|
||||
"@babel/preset-env": "7.25.4",
|
||||
"@babel/preset-typescript": "7.24.7",
|
||||
"@bundle-stats/plugin-webpack-filter": "4.14.2",
|
||||
"@koa/cors": "5.0.0",
|
||||
"@lokalise/node-api": "12.3.0",
|
||||
"@octokit/auth-oauth-device": "7.0.1",
|
||||
"@octokit/plugin-retry": "7.0.3",
|
||||
"@octokit/rest": "20.0.2",
|
||||
"@lokalise/node-api": "12.7.0",
|
||||
"@octokit/auth-oauth-device": "7.1.1",
|
||||
"@octokit/plugin-retry": "7.1.1",
|
||||
"@octokit/rest": "21.0.2",
|
||||
"@open-wc/dev-server-hmr": "0.1.4",
|
||||
"@rollup/plugin-babel": "6.0.4",
|
||||
"@rollup/plugin-commonjs": "25.0.7",
|
||||
"@rollup/plugin-commonjs": "26.0.1",
|
||||
"@rollup/plugin-json": "6.1.0",
|
||||
"@rollup/plugin-node-resolve": "15.2.3",
|
||||
"@rollup/plugin-replace": "5.0.5",
|
||||
"@rollup/plugin-replace": "5.0.7",
|
||||
"@types/babel__plugin-transform-runtime": "7.9.5",
|
||||
"@types/chromecast-caf-receiver": "6.0.13",
|
||||
"@types/chromecast-caf-sender": "1.0.9",
|
||||
"@types/color-name": "1.1.3",
|
||||
"@types/chromecast-caf-receiver": "6.0.17",
|
||||
"@types/chromecast-caf-sender": "1.0.10",
|
||||
"@types/color-name": "1.1.4",
|
||||
"@types/glob": "8.1.0",
|
||||
"@types/html-minifier-terser": "7.0.2",
|
||||
"@types/js-yaml": "4.0.9",
|
||||
"@types/leaflet": "1.9.8",
|
||||
"@types/leaflet": "1.9.12",
|
||||
"@types/leaflet-draw": "1.0.11",
|
||||
"@types/lodash.merge": "4.6.9",
|
||||
"@types/luxon": "3.4.2",
|
||||
"@types/mocha": "10.0.6",
|
||||
"@types/mocha": "10.0.7",
|
||||
"@types/qrcode": "1.5.5",
|
||||
"@types/serve-handler": "6.1.4",
|
||||
"@types/sortablejs": "1.15.8",
|
||||
"@types/tar": "6.1.11",
|
||||
"@types/tar": "6.1.13",
|
||||
"@types/ua-parser-js": "0.7.39",
|
||||
"@types/webspeechapi": "0.0.29",
|
||||
"@typescript-eslint/eslint-plugin": "7.4.0",
|
||||
"@typescript-eslint/parser": "7.4.0",
|
||||
"@typescript-eslint/eslint-plugin": "7.18.0",
|
||||
"@typescript-eslint/parser": "7.18.0",
|
||||
"@web/dev-server": "0.1.38",
|
||||
"@web/dev-server-rollup": "0.4.1",
|
||||
"babel-loader": "9.1.3",
|
||||
"babel-plugin-template-html-minifier": "4.1.0",
|
||||
"chai": "5.1.0",
|
||||
"browserslist-useragent-regexp": "4.1.3",
|
||||
"chai": "5.1.1",
|
||||
"del": "7.1.0",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-config-airbnb-base": "15.0.0",
|
||||
"eslint-config-airbnb-typescript": "18.0.0",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-import-resolver-webpack": "0.13.8",
|
||||
"eslint-plugin-disable": "2.0.3",
|
||||
"eslint-plugin-import": "2.29.1",
|
||||
"eslint-plugin-lit": "1.11.0",
|
||||
"eslint-plugin-lit-a11y": "4.1.2",
|
||||
"eslint-plugin-unused-imports": "3.1.0",
|
||||
"eslint-plugin-wc": "2.0.4",
|
||||
"eslint-plugin-lit": "1.14.0",
|
||||
"eslint-plugin-lit-a11y": "4.1.4",
|
||||
"eslint-plugin-unused-imports": "4.1.3",
|
||||
"eslint-plugin-wc": "2.1.1",
|
||||
"fancy-log": "2.0.0",
|
||||
"fs-extra": "11.2.0",
|
||||
"glob": "10.3.10",
|
||||
"gulp": "4.0.2",
|
||||
"gulp-flatmap": "1.0.2",
|
||||
"glob": "11.0.0",
|
||||
"gulp": "5.0.0",
|
||||
"gulp-brotli": "3.0.0",
|
||||
"gulp-json-transform": "0.5.0",
|
||||
"gulp-merge-json": "2.2.1",
|
||||
"gulp-rename": "2.0.0",
|
||||
"gulp-zopfli-green": "6.0.1",
|
||||
"gulp-zopfli-green": "6.0.2",
|
||||
"html-minifier-terser": "7.2.0",
|
||||
"husky": "9.0.11",
|
||||
"husky": "9.1.5",
|
||||
"instant-mocha": "1.5.2",
|
||||
"jszip": "3.10.1",
|
||||
"lint-staged": "15.2.2",
|
||||
"lint-staged": "15.2.9",
|
||||
"lit-analyzer": "2.0.3",
|
||||
"lodash.merge": "4.6.2",
|
||||
"lodash.template": "4.5.0",
|
||||
"magic-string": "0.30.8",
|
||||
"magic-string": "0.30.11",
|
||||
"map-stream": "0.0.7",
|
||||
"mocha": "10.3.0",
|
||||
"mocha": "10.5.0",
|
||||
"object-hash": "3.0.0",
|
||||
"open": "10.1.0",
|
||||
"pinst": "3.0.0",
|
||||
"prettier": "3.2.5",
|
||||
"prettier": "3.3.3",
|
||||
"rollup": "2.79.1",
|
||||
"rollup-plugin-string": "3.0.0",
|
||||
"rollup-plugin-terser": "7.0.2",
|
||||
"rollup-plugin-visualizer": "5.12.0",
|
||||
"serve-handler": "6.1.5",
|
||||
"sinon": "17.0.1",
|
||||
"source-map-url": "0.4.1",
|
||||
"systemjs": "6.14.3",
|
||||
"tar": "6.2.1",
|
||||
"sinon": "18.0.0",
|
||||
"systemjs": "6.15.1",
|
||||
"tar": "7.4.3",
|
||||
"terser-webpack-plugin": "5.3.10",
|
||||
"transform-async-modules-webpack-plugin": "1.0.4",
|
||||
"transform-async-modules-webpack-plugin": "1.1.1",
|
||||
"ts-lit-plugin": "2.0.2",
|
||||
"typescript": "5.4.3",
|
||||
"vinyl-buffer": "1.0.1",
|
||||
"vinyl-source-stream": "2.0.0",
|
||||
"webpack": "5.91.0",
|
||||
"typescript": "5.5.4",
|
||||
"webpack": "5.94.0",
|
||||
"webpack-cli": "5.1.4",
|
||||
"webpack-dev-server": "5.0.4",
|
||||
"webpack-manifest-plugin": "5.0.0",
|
||||
"webpack-stats-plugin": "1.1.3",
|
||||
"webpackbar": "6.0.1",
|
||||
"workbox-build": "7.0.0"
|
||||
"workbox-build": "patch:workbox-build@npm%3A7.1.1#~/.yarn/patches/workbox-build-npm-7.1.1-a854f3faae.patch"
|
||||
},
|
||||
"_comment": "Polymer 3.2 contained a bug, fixed in https://github.com/Polymer/polymer/pull/5569, add as patch",
|
||||
"resolutions": {
|
||||
@@ -257,8 +254,9 @@
|
||||
"lit": "2.8.0",
|
||||
"clean-css": "5.3.3",
|
||||
"@lit/reactive-element": "1.6.3",
|
||||
"@fullcalendar/daygrid": "6.1.15",
|
||||
"sortablejs@1.15.2": "patch:sortablejs@npm%3A1.15.2#~/.yarn/patches/sortablejs-npm-1.15.2-73347ae85a.patch",
|
||||
"leaflet-draw@1.0.4": "patch:leaflet-draw@npm%3A1.0.4#./.yarn/patches/leaflet-draw-npm-1.0.4-0ca0ebcf65.patch"
|
||||
},
|
||||
"packageManager": "yarn@4.1.1"
|
||||
"packageManager": "yarn@4.4.0"
|
||||
}
|
||||
|
1
public/static/icons/ohf.svg
Normal file
1
public/static/icons/ohf.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB |
3
public/static/images/logo_x.svg
Normal file
3
public/static/images/logo_x.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg width="1200" height="1227" viewBox="0 0 1200 1227" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 430 B |
66
public/static/images/ohf-badge.svg
Normal file
66
public/static/images/ohf-badge.svg
Normal file
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg id="b" data-name="Layer_2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760.69 138.69">
|
||||
<g id="c" data-name="Layer_1">
|
||||
<g>
|
||||
<g>
|
||||
<path d="M136.22,68.35c3.31-.05,6.29.72,8.92,2.31s4.67,3.77,6.11,6.55,2.14,5.89,2.11,9.33c.03,3.44-.68,6.55-2.12,9.34s-3.49,4.98-6.13,6.56-5.62,2.36-8.93,2.31c-3.33,0-6.29-.78-8.88-2.33s-4.6-3.71-6.02-6.48-2.13-5.9-2.13-9.4c-.03-2.56.38-4.98,1.22-7.24s2.01-4.21,3.5-5.82,3.31-2.88,5.45-3.8,4.45-1.36,6.91-1.32ZM136.27,98.35c3.09,0,5.56-1.07,7.41-3.2s2.77-5,2.77-8.61-.91-6.52-2.73-8.65-4.3-3.19-7.44-3.19-5.63,1.06-7.46,3.19-2.75,5.01-2.75,8.65.91,6.52,2.74,8.64,4.32,3.18,7.48,3.18Z"/>
|
||||
<path d="M184.16,80.53c0,3.47-1.06,6.27-3.18,8.41s-4.98,3.21-8.59,3.21h-7.45v12h-6.56v-35.18h14.06c3.64,0,6.5,1.04,8.59,3.11s3.13,4.89,3.13,8.45ZM177.25,80.39c0-1.64-.52-2.98-1.56-4.03s-2.52-1.57-4.44-1.57h-6.3v11.65h6.26c1.95,0,3.45-.55,4.49-1.65s1.56-2.57,1.56-4.39Z"/>
|
||||
<path d="M210.82,98.02v6.14h-22.03v-35.18h21.98v6.19h-15.42v8.3h13.78v5.81h-13.78v8.74h15.47Z"/>
|
||||
<path d="M246.95,68.98v35.18h-6.49l-16.08-24.77v24.77h-6.52v-35.18h6.52l16.08,24.77v-24.77h6.49Z"/>
|
||||
<path d="M266.45,68.98h6.56v14.44l14.7.05v-14.48h6.63v35.18h-6.63v-14.84l-14.7-.09v14.93h-6.56v-35.18Z"/>
|
||||
<path d="M316.41,68.35c3.31-.05,6.29.72,8.92,2.31s4.67,3.77,6.11,6.55,2.14,5.89,2.11,9.33c.03,3.44-.68,6.55-2.12,9.34s-3.49,4.98-6.13,6.56-5.62,2.36-8.93,2.31c-3.33,0-6.29-.78-8.88-2.33s-4.6-3.71-6.02-6.48-2.13-5.9-2.13-9.4c-.03-2.56.38-4.98,1.22-7.24s2.01-4.21,3.5-5.82,3.31-2.88,5.45-3.8,4.45-1.36,6.91-1.32ZM316.46,98.35c3.09,0,5.56-1.07,7.41-3.2s2.77-5,2.77-8.61-.91-6.52-2.73-8.65-4.3-3.19-7.44-3.19-5.63,1.06-7.46,3.19-2.75,5.01-2.75,8.65.91,6.52,2.74,8.64,4.32,3.18,7.48,3.18Z"/>
|
||||
<path d="M373.66,68.98v35.18h-6.45v-20.55l-8.11,20.55h-6.23l-8.02-20.39v20.39h-6.28v-35.18h6.28l11.13,27.54,11.23-27.54h6.45Z"/>
|
||||
<path d="M402.87,98.02v6.14h-22.03v-35.18h21.98v6.19h-15.42v8.3h13.78v5.81h-13.78v8.74h15.47Z"/>
|
||||
<path d="M427.83,75.12v8.93h13.01l-.05,5.91h-12.96v14.2h-6.52v-35.18h21.98l-.05,6.14h-15.42Z"/>
|
||||
<path d="M463.16,68.35c3.31-.05,6.29.72,8.92,2.31s4.67,3.77,6.11,6.55,2.14,5.89,2.11,9.33c.03,3.44-.68,6.55-2.12,9.34s-3.49,4.98-6.13,6.56-5.62,2.36-8.93,2.31c-3.33,0-6.29-.78-8.88-2.33s-4.6-3.71-6.02-6.48-2.13-5.9-2.13-9.4c-.03-2.56.38-4.98,1.22-7.24s2.01-4.21,3.5-5.82,3.31-2.88,5.45-3.8,4.45-1.36,6.91-1.32ZM463.21,98.35c3.09,0,5.56-1.07,7.41-3.2s2.77-5,2.77-8.61-.91-6.52-2.73-8.65-4.3-3.19-7.44-3.19-5.63,1.06-7.46,3.19-2.75,5.01-2.75,8.65.91,6.52,2.74,8.64,4.32,3.18,7.48,3.18Z"/>
|
||||
<path d="M485,68.98h6.56v22.12c0,2.31.72,4.12,2.16,5.43s3.3,1.96,5.58,1.96,4.08-.67,5.58-2.02,2.25-3.13,2.25-5.37v-22.12h6.52v22.31c0,2.08-.38,3.98-1.14,5.7s-1.79,3.14-3.09,4.25-2.82,1.98-4.56,2.59-3.59.91-5.55.91c-2.59,0-4.96-.52-7.1-1.55s-3.88-2.58-5.2-4.65-1.99-4.49-1.99-7.25v-22.31Z"/>
|
||||
<path d="M549.63,68.98v35.18h-6.49l-16.08-24.77v24.77h-6.52v-35.18h6.52l16.08,24.77v-24.77h6.49Z"/>
|
||||
<path d="M586.9,86.58c.05,3.34-.71,6.37-2.27,9.08s-3.7,4.82-6.42,6.32-5.73,2.23-9.02,2.18h-12.42v-35.18h12.42c2.45-.03,4.78.39,6.98,1.28s4.1,2.1,5.68,3.66,2.84,3.43,3.75,5.64,1.35,4.55,1.3,7.03ZM579.99,86.58c0-3.39-1-6.16-3.01-8.3s-4.62-3.21-7.84-3.21h-5.81v23.04h5.81c3.27,0,5.89-1.06,7.88-3.19s2.98-4.91,2.98-8.34Z"/>
|
||||
<path d="M609.16,96.19h-12.73l-2.79,7.97h-6.82l12.68-35.18h6.63l12.66,35.18h-6.96l-2.67-7.97ZM607.24,90.73l-4.43-12.87-4.45,12.87h8.88Z"/>
|
||||
<path d="M642.87,75.17h-9.89v28.99h-6.56v-28.99h-9.94v-6.19h26.39v6.19Z"/>
|
||||
<path d="M647.06,104.16v-35.18h6.56v35.18h-6.56Z"/>
|
||||
<path d="M675.71,68.35c3.31-.05,6.29.72,8.92,2.31s4.67,3.77,6.11,6.55,2.14,5.89,2.11,9.33c.03,3.44-.68,6.55-2.12,9.34s-3.49,4.98-6.13,6.56-5.62,2.36-8.93,2.31c-3.33,0-6.29-.78-8.88-2.33s-4.6-3.71-6.02-6.48-2.13-5.9-2.13-9.4c-.03-2.56.38-4.98,1.22-7.24s2.01-4.21,3.5-5.82,3.31-2.88,5.45-3.8,4.45-1.36,6.91-1.32ZM675.76,98.35c3.09,0,5.56-1.07,7.41-3.2s2.77-5,2.77-8.61-.91-6.52-2.73-8.65-4.3-3.19-7.44-3.19-5.63,1.06-7.46,3.19-2.75,5.01-2.75,8.65.91,6.52,2.74,8.64,4.32,3.18,7.48,3.18Z"/>
|
||||
<path d="M726.96,68.98v35.18h-6.49l-16.08-24.77v24.77h-6.52v-35.18h6.52l16.08,24.77v-24.77h6.49Z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path d="M94.34,79.34c0,2.75-2.25,5-5,5h-50c-2.75,0-5-2.25-5-5v-20c0-2.75,1.59-6.59,3.54-8.54l22.93-22.93c1.94-1.94,5.13-1.94,7.07,0l22.93,22.93c1.94,1.94,3.54,5.79,3.54,8.54v20Z"/>
|
||||
<g>
|
||||
<rect x="34.34" y="94.34" width="60" height="10" rx="2.5" ry="2.5"/>
|
||||
<rect x="34.34" y="94.34" width="10" height="20" rx="1.56" ry="1.56"/>
|
||||
<rect x="84.34" y="94.34" width="10" height="20" rx="1.56" ry="1.56"/>
|
||||
</g>
|
||||
</g>
|
||||
<path d="M735.34,3c12.32,0,22.34,10.02,22.34,22.34v88c0,12.32-10.02,22.34-22.34,22.34H25.34c-12.32,0-22.34-10.02-22.34-22.34V25.34C3,13.02,13.02,3,25.34,3h710M735.34,0H25.34C11.37,0,0,11.37,0,25.34v88c0,13.98,11.37,25.34,25.34,25.34h710c13.97,0,25.34-11.37,25.34-25.34V25.34c0-13.98-11.37-25.34-25.34-25.34h0Z"/>
|
||||
<g>
|
||||
<path d="M120.98,36.79h2.95v7.26l7.66.02v-7.29h2.97v17.37h-2.97v-7.47l-7.66-.02v7.49h-2.95v-17.37Z"/>
|
||||
<path d="M146.97,36.47c1.63,0,3.09.39,4.37,1.16s2.28,1.84,2.99,3.2,1.06,2.9,1.06,4.61c.02,1.7-.32,3.24-1.04,4.62s-1.72,2.47-3.02,3.25-2.75,1.16-4.36,1.14c-1.62.02-3.08-.36-4.37-1.14s-2.29-1.86-3-3.24-1.05-2.91-1.03-4.61c0-1.27.2-2.47.61-3.58s.99-2.08,1.72-2.88,1.63-1.42,2.68-1.88,2.18-.67,3.39-.66ZM146.99,51.57c1.6,0,2.89-.56,3.85-1.67s1.45-2.6,1.45-4.45-.48-3.32-1.45-4.43-2.25-1.66-3.85-1.66-2.89.55-3.86,1.66-1.45,2.58-1.45,4.43.48,3.34,1.44,4.46,2.25,1.67,3.88,1.67Z"/>
|
||||
<path d="M176.51,36.79v17.37h-2.89v-10.78l-4.29,10.78h-2.81l-4.25-10.71v10.71h-2.84v-17.37h2.84l5.66,13.92,5.69-13.92h2.89Z"/>
|
||||
<path d="M192.41,51.37v2.79h-10.78v-17.37h10.78v2.81h-7.83v4.5h7v2.61h-7v4.66h7.83Z"/>
|
||||
<path d="M213.93,50.11h-6.61l-1.43,4.04h-3.04l6.27-17.37h3.04l6.29,17.37h-3.11l-1.41-4.04ZM213.07,47.62l-2.43-6.95-2.45,6.95h4.88Z"/>
|
||||
<path d="M226.96,36.47c1.59,0,2.91.39,3.96,1.16s1.7,1.81,1.94,3.1l-2.78.76c-.16-.74-.52-1.32-1.09-1.72s-1.27-.6-2.11-.6c-.9,0-1.61.21-2.14.64s-.79,1-.79,1.71c0,1.12.7,1.85,2.09,2.18l2.84.71c1.46.38,2.56.98,3.29,1.81s1.09,1.84,1.09,3.05c0,1.55-.56,2.8-1.68,3.76s-2.63,1.44-4.51,1.44c-1.7,0-3.13-.4-4.3-1.2-1.15-.83-1.84-1.92-2.05-3.28l2.78-.72c.1.77.48,1.37,1.14,1.8s1.5.65,2.53.65,1.76-.21,2.32-.62.84-.98.84-1.69c0-1.12-.7-1.85-2.09-2.21l-2.84-.69c-1.46-.33-2.55-.92-3.28-1.77s-1.1-1.88-1.1-3.11c0-1.53.54-2.78,1.63-3.74s2.52-1.44,4.29-1.44Z"/>
|
||||
<path d="M242.38,36.47c1.59,0,2.91.39,3.96,1.16s1.7,1.81,1.94,3.1l-2.78.76c-.16-.74-.52-1.32-1.09-1.72s-1.27-.6-2.11-.6c-.9,0-1.61.21-2.14.64s-.79,1-.79,1.71c0,1.12.7,1.85,2.09,2.18l2.84.71c1.46.38,2.56.98,3.29,1.81s1.09,1.84,1.09,3.05c0,1.55-.56,2.8-1.68,3.76s-2.63,1.44-4.51,1.44c-1.7,0-3.13-.4-4.3-1.2-1.15-.83-1.84-1.92-2.05-3.28l2.78-.72c.1.77.48,1.37,1.14,1.8s1.5.65,2.53.65,1.76-.21,2.32-.62.84-.98.84-1.69c0-1.12-.7-1.85-2.09-2.21l-2.84-.69c-1.46-.33-2.55-.92-3.28-1.77s-1.1-1.88-1.1-3.11c0-1.53.54-2.78,1.63-3.74s2.52-1.44,4.29-1.44Z"/>
|
||||
<path d="M252.68,54.16v-17.37h2.95v17.37h-2.95Z"/>
|
||||
<path d="M265.82,36.47c1.59,0,2.91.39,3.96,1.16s1.7,1.81,1.94,3.1l-2.78.76c-.16-.74-.52-1.32-1.09-1.72s-1.27-.6-2.11-.6c-.9,0-1.61.21-2.14.64s-.79,1-.79,1.71c0,1.12.7,1.85,2.09,2.18l2.84.71c1.46.38,2.56.98,3.29,1.81s1.09,1.84,1.09,3.05c0,1.55-.56,2.8-1.68,3.76s-2.63,1.44-4.51,1.44c-1.7,0-3.13-.4-4.3-1.2-1.15-.83-1.84-1.92-2.05-3.28l2.78-.72c.1.77.48,1.37,1.14,1.8s1.5.65,2.53.65,1.76-.21,2.32-.62.84-.98.84-1.69c0-1.12-.7-1.85-2.09-2.21l-2.84-.69c-1.46-.33-2.55-.92-3.28-1.77s-1.1-1.88-1.1-3.11c0-1.53.54-2.78,1.63-3.74s2.52-1.44,4.29-1.44Z"/>
|
||||
<path d="M287.47,39.57h-4.97v14.58h-2.95v-14.58h-4.97v-2.79h12.9v2.79Z"/>
|
||||
<path d="M298.87,50.11h-6.61l-1.43,4.04h-3.04l6.27-17.37h3.04l6.29,17.37h-3.11l-1.41-4.04ZM298.01,47.62l-2.43-6.95-2.45,6.95h4.88Z"/>
|
||||
<path d="M320.89,36.79v17.37h-2.93l-8.25-12.67v12.67h-2.93v-17.37h2.93l8.25,12.65v-12.65h2.93Z"/>
|
||||
<path d="M337.31,39.57h-4.97v14.58h-2.95v-14.58h-4.97v-2.79h12.9v2.79Z"/>
|
||||
<path d="M348.75,54.16v-17.14h2.05v17.14h-2.05Z"/>
|
||||
<path d="M360.95,36.72c1.55,0,2.82.38,3.81,1.14,1,.74,1.61,1.72,1.82,2.95l-1.95.52c-.16-.87-.56-1.54-1.23-2.02s-1.5-.71-2.5-.71c-1.08,0-1.95.27-2.6.8s-.97,1.24-.97,2.13c0,1.36.84,2.26,2.52,2.71l2.9.73c1.37.34,2.41.9,3.11,1.68s1.05,1.74,1.05,2.9c0,1.46-.53,2.64-1.6,3.54s-2.49,1.36-4.28,1.36c-1.61,0-2.95-.37-4.03-1.12s-1.72-1.76-1.95-3.06l1.98-.55c.13.88.55,1.56,1.25,2.06s1.63.75,2.77.75,2.12-.26,2.79-.77,1.02-1.22,1.02-2.14c0-1.44-.84-2.36-2.52-2.77l-2.88-.71c-1.38-.34-2.42-.9-3.12-1.69s-1.05-1.75-1.05-2.9c0-1.44.52-2.61,1.56-3.51s2.4-1.35,4.09-1.35Z"/>
|
||||
<path d="M388.35,49.75h-7.54l-1.59,4.4h-2.07l6.25-17.14h2.36l6.31,17.14h-2.15l-1.57-4.4ZM387.73,48.05l-3.09-8.71-3.2,8.71h6.29Z"/>
|
||||
<path d="M415.46,42.47c0,1.6-.5,2.91-1.5,3.95s-2.32,1.56-3.97,1.56h-4.53v6.18h-2.05v-17.14h6.6c1.67,0,3,.49,3.98,1.47s1.47,2.31,1.47,3.98ZM413.31,42.42c0-1.07-.32-1.92-.95-2.56s-1.51-.96-2.64-.96h-4.26v7.24h4.17c1.15,0,2.06-.34,2.71-1.02s.98-1.58.98-2.7Z"/>
|
||||
<path d="M428.37,46.9l3.43,7.26h-2.31l-3.18-6.95h-4.76v6.95h-2.05v-17.14h6.54c1.81,0,3.22.45,4.24,1.35s1.53,2.14,1.53,3.72c0,1.22-.3,2.26-.9,3.1s-1.44,1.41-2.53,1.7ZM429.64,42.12c0-1.01-.32-1.81-.95-2.38s-1.52-.86-2.66-.86h-4.5v6.47h4.53c1.15,0,2.03-.28,2.64-.85s.92-1.36.92-2.38Z"/>
|
||||
<path d="M443.34,36.74c1.18-.02,2.28.2,3.31.65s1.9,1.07,2.62,1.85,1.28,1.73,1.69,2.83.6,2.27.59,3.52c.02,1.67-.33,3.19-1.03,4.54s-1.68,2.42-2.95,3.19-2.68,1.14-4.25,1.12c-1.59,0-3-.38-4.25-1.13s-2.21-1.81-2.89-3.15-1.03-2.87-1.03-4.57c-.02-1.67.32-3.18,1.02-4.53s1.67-2.42,2.93-3.2,2.68-1.15,4.24-1.13ZM443.34,52.45c1.8,0,3.26-.64,4.38-1.91s1.68-2.92,1.68-4.95-.56-3.71-1.68-4.98-2.58-1.9-4.38-1.9-3.28.63-4.4,1.9-1.68,2.93-1.68,4.98.56,3.69,1.68,4.96,2.59,1.9,4.39,1.9Z"/>
|
||||
<path d="M464.3,37.02v12.42c0,1.49-.47,2.71-1.41,3.64s-2.17,1.39-3.71,1.39c-1.56,0-2.76-.46-3.61-1.37s-1.27-2.13-1.27-3.69v-.55h1.98v.55c0,1.18.29,1.99.86,2.45.59.45,1.26.67,2.02.67.93,0,1.68-.26,2.24-.78.57-.52.85-1.32.85-2.39v-12.35h2.05Z"/>
|
||||
<path d="M479.86,52.23v1.93h-10.35v-17.14h10.33v1.95h-8.31v5.67h7.53v1.8h-7.53v5.79h8.33Z"/>
|
||||
<path d="M496.97,42.42c-.36-1.15-1.01-2.06-1.93-2.71s-2.02-.98-3.3-.98c-1.79,0-3.24.63-4.35,1.89s-1.66,2.92-1.66,4.96.55,3.72,1.66,4.96,2.55,1.86,4.33,1.86c1.27,0,2.39-.31,3.35-.94.95-.63,1.61-1.44,1.98-2.45l1.93.83c-.55,1.41-1.48,2.53-2.78,3.36-1.31.81-2.81,1.22-4.51,1.22-2.4,0-4.35-.81-5.84-2.43s-2.24-3.75-2.24-6.4c0-1.74.34-3.28,1.02-4.62s1.64-2.39,2.88-3.13,2.65-1.11,4.25-1.11c1.8,0,3.33.46,4.59,1.38,1.26.91,2.12,2.1,2.57,3.59l-1.93.71Z"/>
|
||||
<path d="M512.92,38.95h-5.12v15.21h-2.05v-15.21h-5.16v-1.93h12.33v1.93Z"/>
|
||||
<path d="M536.4,49.66c0,1.39-.49,2.48-1.46,3.29s-2.27,1.21-3.9,1.21h-6.72v-17.12h6.58c1.65,0,2.95.41,3.89,1.24s1.41,1.93,1.41,3.32c0,.92-.21,1.72-.64,2.4s-1.02,1.2-1.79,1.57c.81.37,1.45.91,1.92,1.62s.7,1.53.7,2.47ZM526.3,38.81v5.97h4.54c1.03,0,1.85-.27,2.46-.81s.92-1.24.92-2.09c0-.91-.31-1.65-.93-2.22s-1.45-.85-2.5-.85h-4.5ZM534.45,49.39c0-.91-.32-1.64-.95-2.17s-1.44-.8-2.46-.8h-4.74v5.95h4.74c1.04,0,1.86-.27,2.48-.81s.92-1.26.92-2.16Z"/>
|
||||
<path d="M541.07,37.02l4.54,8.1,4.54-8.1h2.24l-5.76,10.05v7.09h-2.05v-7.09l-5.83-10.05h2.31Z"/>
|
||||
<path d="M574.27,38.95h-5.12v15.21h-2.05v-15.21h-5.16v-1.93h12.33v1.93Z"/>
|
||||
<path d="M577.95,37.02h2.05v7.55l8.74.02v-7.58h2.05v17.14h-2.05v-7.76l-8.74-.02v7.79h-2.05v-17.14Z"/>
|
||||
<path d="M606.55,52.23v1.93h-10.35v-17.14h10.33v1.95h-8.31v5.67h7.53v1.8h-7.53v5.79h8.33Z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 12 KiB |
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "home-assistant-frontend"
|
||||
version = "20240402.1"
|
||||
version = "20240809.0"
|
||||
license = {text = "Apache-2.0"}
|
||||
description = "The Home Assistant frontend"
|
||||
readme = "README.md"
|
||||
|
@@ -37,14 +37,18 @@
|
||||
{
|
||||
"description": "Group tsparticles engine and presets",
|
||||
"groupName": "tsparticles",
|
||||
"matchPackageNames": ["tsparticles-engine"],
|
||||
"matchPackagePrefixes": ["tsparticles-preset-"]
|
||||
"matchPackageNames": ["tsparticles-engine", "tsparticles-preset-{/,}**"]
|
||||
},
|
||||
{
|
||||
"description": "Group date-fns with dependent timezone package",
|
||||
"groupName": "date-fns",
|
||||
"matchPackageNames": ["date-fns", "date-fns-tz"]
|
||||
},
|
||||
{
|
||||
"description": "Group and temporarily disable WDS packages",
|
||||
"groupName": "Web Dev Server",
|
||||
"matchPackagePrefixes": ["@web/dev-server"],
|
||||
"enabled": false
|
||||
"enabled": false,
|
||||
"matchPackageNames": ["@web/dev-server{/,}**"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -31,6 +31,7 @@ import {
|
||||
mdiFormatListBulleted,
|
||||
mdiFormatListCheckbox,
|
||||
mdiFormTextbox,
|
||||
mdiForumOutline,
|
||||
mdiGauge,
|
||||
mdiGoogleAssistant,
|
||||
mdiGoogleCirclesCommunities,
|
||||
@@ -39,7 +40,6 @@ import {
|
||||
mdiImageFilterFrames,
|
||||
mdiLightbulb,
|
||||
mdiLightningBolt,
|
||||
mdiMailbox,
|
||||
mdiMapMarkerRadius,
|
||||
mdiMeterGas,
|
||||
mdiMicrophoneMessage,
|
||||
@@ -98,7 +98,7 @@ export const FIXED_DOMAIN_ICONS = {
|
||||
calendar: mdiCalendar,
|
||||
climate: mdiThermostat,
|
||||
configurator: mdiCog,
|
||||
conversation: mdiMicrophoneMessage,
|
||||
conversation: mdiForumOutline,
|
||||
counter: mdiCounter,
|
||||
date: mdiCalendar,
|
||||
datetime: mdiCalendarClock,
|
||||
@@ -118,7 +118,6 @@ export const FIXED_DOMAIN_ICONS = {
|
||||
input_text: mdiFormTextbox,
|
||||
lawn_mower: mdiRobotMower,
|
||||
light: mdiLightbulb,
|
||||
mailbox: mdiMailbox,
|
||||
notify: mdiCommentAlert,
|
||||
number: mdiRayVertex,
|
||||
persistent_notification: mdiBell,
|
||||
@@ -235,6 +234,8 @@ export const SENSOR_ENTITIES = [
|
||||
"weather",
|
||||
];
|
||||
|
||||
export const ASSIST_ENTITIES = ["conversation", "stt", "tts"];
|
||||
|
||||
/** Domains that render an input element instead of a text value when displayed in a row.
|
||||
* Those rows should then not show a cursor pointer when hovered (which would normally
|
||||
* be the default) unless the element itself enforces it (e.g. a button). Also those elements
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { utcToZonedTime, zonedTimeToUtc } from "date-fns-tz";
|
||||
import { toZonedTime, fromZonedTime } from "date-fns-tz";
|
||||
import { HassConfig } from "home-assistant-js-websocket";
|
||||
import { FrontendLocaleData, TimeZone } from "../../data/translation";
|
||||
|
||||
@@ -8,10 +8,10 @@ const calcZonedDate = (
|
||||
fn: (date: Date, options?: any) => Date | number | boolean,
|
||||
options?
|
||||
) => {
|
||||
const inputZoned = utcToZonedTime(date, tz);
|
||||
const inputZoned = toZonedTime(date, tz);
|
||||
const fnZoned = fn(inputZoned, options);
|
||||
if (fnZoned instanceof Date) {
|
||||
return zonedTimeToUtc(fnZoned, tz) as Date;
|
||||
return fromZonedTime(fnZoned, tz) as Date;
|
||||
}
|
||||
return fnZoned;
|
||||
};
|
||||
@@ -51,6 +51,6 @@ export const calcDateDifferenceProperty = (
|
||||
locale,
|
||||
config,
|
||||
locale.time_zone === TimeZone.server
|
||||
? utcToZonedTime(startDate, config.time_zone)
|
||||
? toZonedTime(startDate, config.time_zone)
|
||||
: startDate
|
||||
);
|
||||
|
@@ -1,8 +1,6 @@
|
||||
import { getWeekStartByLocale } from "weekstart";
|
||||
import { FrontendLocaleData, FirstWeekday } from "../../data/translation";
|
||||
|
||||
import "../../resources/intl-polyfill";
|
||||
|
||||
export const weekdays = [
|
||||
"sunday",
|
||||
"monday",
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import { HassConfig } from "home-assistant-js-websocket";
|
||||
import memoizeOne from "memoize-one";
|
||||
import { DateFormat, FrontendLocaleData } from "../../data/translation";
|
||||
import "../../resources/intl-polyfill";
|
||||
import { resolveTimeZone } from "./resolve-time-zone";
|
||||
|
||||
// Tuesday, August 10
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import { HassConfig } from "home-assistant-js-websocket";
|
||||
import memoizeOne from "memoize-one";
|
||||
import { FrontendLocaleData } from "../../data/translation";
|
||||
import "../../resources/intl-polyfill";
|
||||
import { formatDateNumeric } from "./format_date";
|
||||
import { formatTime } from "./format_time";
|
||||
import { resolveTimeZone } from "./resolve-time-zone";
|
||||
|
@@ -1,6 +1,5 @@
|
||||
import { HaDurationData } from "../../components/ha-duration-input";
|
||||
import { FrontendLocaleData } from "../../data/translation";
|
||||
import "../../resources/intl-polyfill";
|
||||
|
||||
const leftPad = (num: number) => (num < 10 ? `0${num}` : num);
|
||||
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import { HassConfig } from "home-assistant-js-websocket";
|
||||
import memoizeOne from "memoize-one";
|
||||
import { FrontendLocaleData } from "../../data/translation";
|
||||
import "../../resources/intl-polyfill";
|
||||
import { resolveTimeZone } from "./resolve-time-zone";
|
||||
import { useAmPm } from "./use_am_pm";
|
||||
|
||||
|
@@ -1,5 +1,4 @@
|
||||
import memoizeOne from "memoize-one";
|
||||
import "../../resources/intl-polyfill";
|
||||
|
||||
export const localizeWeekdays = memoizeOne(
|
||||
(language: string, short: boolean): string[] => {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user