@heycys/gallery 0.1.2 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/THIRD-PARTY-NOTICES.md +2 -2
  2. package/browser/editor/components/align.mjs +58 -0
  3. package/browser/editor/components/code/index.mjs +1 -1
  4. package/browser/editor/components/embed/page.mjs +1 -1
  5. package/browser/editor/components/file/page.mjs +4 -4
  6. package/browser/editor/components/heading/index.mjs +7 -6
  7. package/browser/editor/components/icon/page.mjs +6 -4
  8. package/browser/editor/components/icons.mjs +5 -2
  9. package/browser/editor/components/image/index.mjs +2 -0
  10. package/browser/editor/components/image/page.mjs +172 -90
  11. package/browser/editor/components/installed/index.mjs +6 -2
  12. package/browser/editor/components/installed/page.mjs +80 -13
  13. package/browser/editor/components/media/icons.mjs +13 -8
  14. package/browser/editor/components/media/page.mjs +5 -3
  15. package/browser/editor/components/media/toolbar.mjs +12 -3
  16. package/browser/editor/components/paragraph/index.mjs +4 -3
  17. package/browser/editor/components/registry.mjs +17 -5
  18. package/browser/editor/components/table/index.mjs +4 -2
  19. package/browser/editor/page/after/index.mjs +288 -0
  20. package/browser/editor/page/align.mjs +91 -0
  21. package/browser/editor/page/beside.mjs +5 -6
  22. package/browser/editor/page/block-menu/index.mjs +6 -3
  23. package/browser/editor/page/blocks.mjs +3 -1
  24. package/browser/editor/page/board/hint.mjs +64 -27
  25. package/browser/editor/page/board/index.mjs +160 -71
  26. package/browser/editor/page/board/motion.mjs +177 -0
  27. package/browser/editor/page/board/settings.mjs +4 -3
  28. package/browser/editor/page/clipboard/import/read.mjs +20 -2
  29. package/browser/editor/page/clipboard/index.mjs +10 -3
  30. package/browser/editor/page/clipboard/own/blocks.mjs +3 -4
  31. package/browser/editor/page/clipboard/own/describe.mjs +6 -2
  32. package/browser/editor/page/commit.mjs +2 -2
  33. package/browser/editor/page/core.mjs +3 -1
  34. package/browser/editor/page/custom-page.mjs +15 -11
  35. package/browser/editor/page/editor.mjs +31 -14
  36. package/browser/editor/page/history.mjs +19 -4
  37. package/browser/editor/page/insert/index.mjs +20 -22
  38. package/browser/editor/page/menu.mjs +15 -7
  39. package/browser/editor/page/page-objects.mjs +3 -7
  40. package/browser/editor/page/present-links.mjs +5 -4
  41. package/browser/editor/page/present-shell.mjs +63 -0
  42. package/browser/editor/page/selection/index.mjs +10 -2
  43. package/browser/editor/page/table/binding.mjs +87 -0
  44. package/browser/editor/page/table/icons.mjs +0 -2
  45. package/browser/editor/page/table/index.mjs +10 -14
  46. package/browser/editor/page/table/views.mjs +5 -52
  47. package/browser/editor/page/table/widths.mjs +82 -10
  48. package/browser/editor/page/typing/index.mjs +44 -12
  49. package/browser/editor/page/typing/leave.mjs +19 -5
  50. package/browser/shared/block-packs.mjs +23 -8
  51. package/browser/shared/component-catalog.mjs +15 -8
  52. package/browser/shared/component-source.mjs +3 -1
  53. package/browser/shared/components/heading.mjs +2 -1
  54. package/browser/shared/components/installed.mjs +1 -1
  55. package/browser/shared/components/page.mjs +2 -0
  56. package/browser/shared/components/paragraph.mjs +8 -1
  57. package/browser/shared/components/table.mjs +1 -0
  58. package/browser/shared/document-copy.mjs +43 -0
  59. package/browser/shared/drafts.mjs +10 -3
  60. package/browser/shared/emoji/icon-value.mjs +2 -2
  61. package/browser/shared/emoji/line-icons.mjs +37 -0
  62. package/browser/shared/extensions.mjs +83 -7
  63. package/browser/shared/http.mjs +9 -0
  64. package/browser/shared/i18n/en.mjs +50 -17
  65. package/browser/shared/outline-shape.mjs +6 -0
  66. package/browser/shared/outline.mjs +165 -12
  67. package/browser/shared/pack-manifest.mjs +12 -1
  68. package/browser/shared/pages.mjs +169 -57
  69. package/browser/shared/pinyin.mjs +92 -0
  70. package/browser/shared/present-step.mjs +17 -0
  71. package/browser/shared/sidebar-head.mjs +70 -0
  72. package/browser/shared/web-links.mjs +5 -0
  73. package/browser/shared/workspace-columns.mjs +11 -7
  74. package/dist/{chunk-N7AZZLGT.mjs → chunk-2GKGEVMR.mjs} +29 -24
  75. package/dist/chunk-2OHANJ6Q.mjs +2 -0
  76. package/dist/{chunk-HYMEEXKN.mjs → chunk-2RKIHJI2.mjs} +1 -1
  77. package/dist/{chunk-742D2WWJ.mjs → chunk-36FIRJIF.mjs} +2 -2
  78. package/dist/{chunk-BPL64HGA.mjs → chunk-3A5I2GJK.mjs} +1 -1
  79. package/dist/{chunk-RFDZXFJF.mjs → chunk-3OFXMN6N.mjs} +1 -1
  80. package/dist/chunk-46ACXOU5.mjs +2 -0
  81. package/dist/{chunk-PUOQ65NC.mjs → chunk-4AMTKWDO.mjs} +1 -1
  82. package/dist/{chunk-VTKNEYT3.mjs → chunk-4DNHHJSL.mjs} +1 -1
  83. package/dist/chunk-5DPABPBI.mjs +2 -0
  84. package/dist/chunk-5IIH335D.mjs +3 -0
  85. package/dist/chunk-5L26JUYA.mjs +2 -0
  86. package/dist/{chunk-3NJACR4W.mjs → chunk-5MEXZ2UF.mjs} +1 -1
  87. package/dist/{chunk-ZHEHPMBK.mjs → chunk-6MPKCH3P.mjs} +1 -1
  88. package/dist/{chunk-C564NU2H.mjs → chunk-74RPP2M2.mjs} +1 -1
  89. package/dist/chunk-7M2BQQGZ.mjs +2 -0
  90. package/dist/{chunk-VXACTLO3.mjs → chunk-7M7UPWU6.mjs} +1 -1
  91. package/dist/{chunk-ZB4H7ZN4.mjs → chunk-7N2LPG33.mjs} +1 -1
  92. package/dist/{chunk-UBBRTJ2R.mjs → chunk-7XDYK3UC.mjs} +1 -1
  93. package/dist/chunk-AEMVZYZQ.mjs +166 -0
  94. package/dist/{chunk-POQSE4C2.mjs → chunk-AFGUR7SY.mjs} +1 -1
  95. package/dist/{chunk-QKXMPUXC.mjs → chunk-AMDGVDNV.mjs} +1 -1
  96. package/dist/{chunk-KTKHRC6H.mjs → chunk-ASAXY2DJ.mjs} +1 -1
  97. package/dist/{chunk-NVRNLK25.mjs → chunk-BYSF5UMM.mjs} +2 -2
  98. package/dist/{chunk-U3SSPL4K.mjs → chunk-CCSGFCLZ.mjs} +1 -1
  99. package/dist/{chunk-NWFBE2YA.mjs → chunk-CG3UHDKH.mjs} +1 -1
  100. package/dist/chunk-CPS4SRPF.mjs +5 -0
  101. package/dist/{chunk-B4P2CM2J.mjs → chunk-CZ5KJSGK.mjs} +1 -1
  102. package/dist/chunk-DAMVDXR3.mjs +2 -0
  103. package/dist/{chunk-NG375ILQ.mjs → chunk-DH6GMDNN.mjs} +1 -1
  104. package/dist/chunk-DHB7UZ7F.mjs +3 -0
  105. package/dist/{chunk-MHW7ZKOU.mjs → chunk-DKR7LFIY.mjs} +1 -1
  106. package/dist/chunk-DLFZJJEE.mjs +2 -0
  107. package/dist/{chunk-6EZ7FNIK.mjs → chunk-F4ZA6JRZ.mjs} +1 -1
  108. package/dist/{chunk-6VTU6KEO.mjs → chunk-FCK6NXON.mjs} +1 -1
  109. package/dist/{chunk-ZWPMCK7P.mjs → chunk-FX42XU6J.mjs} +1 -1
  110. package/dist/chunk-FXQBADMN.mjs +5 -0
  111. package/dist/{chunk-W3BGBJQW.mjs → chunk-G4YP7GVC.mjs} +1 -1
  112. package/dist/{chunk-V6XZ4VIR.mjs → chunk-GWOYMENX.mjs} +1 -1
  113. package/dist/chunk-HATA2W7X.mjs +2 -0
  114. package/dist/{chunk-YI43RG4P.mjs → chunk-HBAUKKQH.mjs} +1 -1
  115. package/dist/{chunk-MAFIGVXY.mjs → chunk-HM4E43VM.mjs} +1 -1
  116. package/dist/{chunk-CRJEG7MT.mjs → chunk-JI6T3A4Y.mjs} +1 -1
  117. package/dist/{chunk-NFMCP2HI.mjs → chunk-JJNRIFND.mjs} +2 -2
  118. package/dist/chunk-JL6R4FG4.mjs +4 -0
  119. package/dist/{chunk-UMHUSOPJ.mjs → chunk-JXLSHVJ2.mjs} +1 -1
  120. package/dist/{chunk-FJYN7RTH.mjs → chunk-KFZBYDIS.mjs} +1 -1
  121. package/dist/{chunk-ZTHICSSF.mjs → chunk-KH24LWAT.mjs} +1 -1
  122. package/dist/{chunk-RKPWLGZ3.mjs → chunk-KUILYI7H.mjs} +1 -1
  123. package/dist/{chunk-RMECZA2K.mjs → chunk-L7W624FD.mjs} +1 -1
  124. package/dist/chunk-LE44MD3O.mjs +4 -0
  125. package/dist/{chunk-4K5KC6V2.mjs → chunk-LV24RY2E.mjs} +1 -1
  126. package/dist/{chunk-43B75J5T.mjs → chunk-MKTX5PGV.mjs} +1 -1
  127. package/dist/{chunk-LKX55H76.mjs → chunk-NAGMRVW4.mjs} +1 -1
  128. package/dist/{chunk-D4CKRD3V.mjs → chunk-NFABH3QW.mjs} +2 -2
  129. package/dist/{chunk-PVER7LSC.mjs → chunk-NIW7F7LU.mjs} +2 -2
  130. package/dist/{chunk-PAREWQGB.mjs → chunk-NWRZXELO.mjs} +1 -1
  131. package/dist/{chunk-OJKMINIU.mjs → chunk-OU3S466R.mjs} +15 -15
  132. package/dist/{chunk-5ZJA7CXT.mjs → chunk-PAFSFVYB.mjs} +1 -1
  133. package/dist/chunk-QCEATQC4.mjs +2 -0
  134. package/dist/{chunk-Y34NR5JL.mjs → chunk-QJ3TFJLQ.mjs} +1 -1
  135. package/dist/{chunk-IA4PSIMD.mjs → chunk-QK3VISCA.mjs} +1 -1
  136. package/dist/{chunk-ZUNVAXLH.mjs → chunk-QXVNUASA.mjs} +1 -1
  137. package/dist/{chunk-GRAXKKG4.mjs → chunk-QZ35UAB4.mjs} +1 -1
  138. package/dist/{chunk-UGWYKHBL.mjs → chunk-S2Y7VI4H.mjs} +2 -2
  139. package/dist/{chunk-OW5NWPOJ.mjs → chunk-SAHS56QM.mjs} +1 -1
  140. package/dist/{chunk-QOUEFUCH.mjs → chunk-SOD23RGL.mjs} +1 -1
  141. package/dist/chunk-TDWJKOLN.mjs +2 -0
  142. package/dist/{chunk-V6RIYQZZ.mjs → chunk-TOE6DPLH.mjs} +1 -1
  143. package/dist/chunk-UGO5N3EI.mjs +15 -0
  144. package/dist/{chunk-Q47PLKIJ.mjs → chunk-UGWMMEJ5.mjs} +1 -1
  145. package/dist/{chunk-NWR2LT5B.mjs → chunk-V5JRSGZF.mjs} +1 -1
  146. package/dist/{chunk-BZ5RAF7L.mjs → chunk-VA3KAQZD.mjs} +1 -1
  147. package/dist/chunk-VG5JEIUQ.mjs +12 -0
  148. package/dist/{chunk-UNOYVIYR.mjs → chunk-VGTMLQWZ.mjs} +1 -1
  149. package/dist/chunk-VKSRM7EY.mjs +22 -0
  150. package/dist/{chunk-YQGT4AB2.mjs → chunk-VNUWREXU.mjs} +1 -1
  151. package/dist/{chunk-AGDILNWB.mjs → chunk-VPVOAJ7X.mjs} +1 -1
  152. package/dist/{chunk-HLYV7RIH.mjs → chunk-WCWYNFDF.mjs} +1 -1
  153. package/dist/chunk-WTEGUPFG.mjs +16 -0
  154. package/dist/{chunk-N76HWBA3.mjs → chunk-XKOHV4H6.mjs} +1 -1
  155. package/dist/{chunk-HMYTM3GT.mjs → chunk-XMKHCUI6.mjs} +1 -1
  156. package/dist/{chunk-OUUP3WKT.mjs → chunk-XQRUG4G3.mjs} +1 -1
  157. package/dist/{chunk-32ZUEFZ7.mjs → chunk-YBB5LWZK.mjs} +1 -1
  158. package/dist/{chunk-SX4LJYT6.mjs → chunk-YFJU3O7G.mjs} +1 -1
  159. package/dist/chunk-YPPJVDQI.mjs +2 -0
  160. package/dist/chunk-ZANMKAWS.mjs +2 -0
  161. package/dist/{chunk-6QBHU4DF.mjs → chunk-ZCP7BTOZ.mjs} +1 -1
  162. package/dist/{chunk-ERLAIBOA.mjs → chunk-ZEY2RLBT.mjs} +2 -2
  163. package/dist/{chunk-SQ6Y2ZMA.mjs → chunk-ZO7SFB2E.mjs} +2 -2
  164. package/dist/cli.mjs +1 -1
  165. package/dist/server.mjs +1 -1
  166. package/dist/worker.mjs +1 -1
  167. package/kit/board.css +5 -5
  168. package/kit/code.js +15 -15
  169. package/kit/math.js +1 -1
  170. package/kit/report.css +123 -44
  171. package/kit/runtime.js +45 -7
  172. package/kit/tables.js +2 -0
  173. package/kit/ui.js +2 -0
  174. package/package.json +1 -1
  175. package/packs/gallery/chart-view/kit.js +3 -3
  176. package/packs/gallery/chart-view/writing.md +1 -1
  177. package/packs/gallery/countdown/component.json +1 -1
  178. package/packs/gallery/countdown/kit.js +89 -29
  179. package/packs/gallery/countdown/preview.svg +1 -1
  180. package/packs/gallery/countdown/style.css +88 -100
  181. package/packs/gallery/countdown/writing.md +2 -2
  182. package/packs/gallery/habit/component.json +3 -3
  183. package/packs/gallery/habit/kit.js +114 -75
  184. package/packs/gallery/habit/preview.svg +1 -1
  185. package/packs/gallery/habit/style.css +133 -205
  186. package/packs/gallery/habit/writing.md +2 -2
  187. package/packs/gallery/heatmap/component.json +2 -2
  188. package/packs/gallery/heatmap/kit.js +335 -173
  189. package/packs/gallery/heatmap/preview.svg +1 -1
  190. package/packs/gallery/heatmap/style.css +158 -170
  191. package/packs/gallery/heatmap/writing.md +2 -2
  192. package/packs/gallery/kanban/kit.js +3 -3
  193. package/packs/gallery/kanban/writing.md +1 -1
  194. package/packs/gallery/metric/kit.js +3 -3
  195. package/packs/gallery/metric/writing.md +1 -1
  196. package/packs/gallery/note/component.json +3 -3
  197. package/packs/gallery/note/kit.js +40 -13
  198. package/packs/gallery/note/preview.svg +1 -1
  199. package/packs/gallery/note/style.css +51 -30
  200. package/packs/gallery/note/writing.md +2 -2
  201. package/packs/gallery/recent/component.json +2 -2
  202. package/packs/gallery/recent/kit.js +141 -86
  203. package/packs/gallery/recent/preview.svg +1 -1
  204. package/packs/gallery/recent/style.css +53 -126
  205. package/packs/gallery/recent/writing.md +2 -2
  206. package/packs/gallery/static/component.json +2 -2
  207. package/packs/gallery/static/preview.svg +1 -1
  208. package/packs/gallery/static/style.css +99 -66
  209. package/packs/gallery/static/writing.md +2 -2
  210. package/packs/gallery/stats/component.json +3 -3
  211. package/packs/gallery/stats/kit.js +253 -72
  212. package/packs/gallery/stats/preview.svg +1 -1
  213. package/packs/gallery/stats/style.css +64 -142
  214. package/packs/gallery/stats/writing.md +2 -2
  215. package/packs/gallery/today/component.json +2 -2
  216. package/packs/gallery/today/kit.js +62 -27
  217. package/packs/gallery/today/preview.svg +1 -1
  218. package/packs/gallery/today/style.css +101 -72
  219. package/packs/gallery/today/writing.md +2 -2
  220. package/packs/gallery/todos/component.json +1 -1
  221. package/packs/gallery/todos/kit.js +218 -71
  222. package/packs/gallery/todos/preview.svg +1 -1
  223. package/packs/gallery/todos/style.css +170 -223
  224. package/packs/gallery/todos/writing.md +1 -1
  225. package/packs/gallery/weather/component.json +2 -2
  226. package/packs/gallery/weather/kit.js +165 -90
  227. package/packs/gallery/weather/preview.svg +1 -1
  228. package/packs/gallery/weather/style.css +100 -218
  229. package/packs/gallery/weather/writing.md +1 -1
  230. package/packs/gallery-soft/countdown/component.json +18 -0
  231. package/packs/gallery-soft/countdown/example.html +3 -0
  232. package/packs/gallery-soft/countdown/kit.js +206 -0
  233. package/packs/gallery-soft/countdown/preview.svg +1 -0
  234. package/packs/gallery-soft/countdown/style.css +211 -0
  235. package/packs/gallery-soft/countdown/template.html +3 -0
  236. package/packs/gallery-soft/countdown/writing.md +24 -0
  237. package/packs/gallery-soft/habit/component.json +14 -0
  238. package/packs/gallery-soft/habit/example.html +3 -0
  239. package/packs/gallery-soft/habit/kit.js +366 -0
  240. package/packs/gallery-soft/habit/preview.svg +1 -0
  241. package/packs/gallery-soft/habit/style.css +251 -0
  242. package/packs/gallery-soft/habit/template.html +3 -0
  243. package/packs/gallery-soft/habit/writing.md +23 -0
  244. package/packs/gallery-soft/heatmap/component.json +18 -0
  245. package/packs/gallery-soft/heatmap/example.html +3 -0
  246. package/packs/gallery-soft/heatmap/kit.js +498 -0
  247. package/packs/gallery-soft/heatmap/preview.svg +1 -0
  248. package/packs/gallery-soft/heatmap/style.css +181 -0
  249. package/packs/gallery-soft/heatmap/template.html +3 -0
  250. package/packs/gallery-soft/heatmap/writing.md +23 -0
  251. package/packs/gallery-soft/note/component.json +14 -0
  252. package/packs/gallery-soft/note/example.html +3 -0
  253. package/packs/gallery-soft/note/kit.js +162 -0
  254. package/packs/gallery-soft/note/preview.svg +1 -0
  255. package/packs/gallery-soft/note/style.css +148 -0
  256. package/packs/gallery-soft/note/template.html +3 -0
  257. package/packs/gallery-soft/note/writing.md +20 -0
  258. package/packs/gallery-soft/recent/component.json +13 -0
  259. package/packs/gallery-soft/recent/example.html +1 -0
  260. package/packs/gallery-soft/recent/kit.js +335 -0
  261. package/packs/gallery-soft/recent/preview.svg +1 -0
  262. package/packs/gallery-soft/recent/style.css +160 -0
  263. package/packs/gallery-soft/recent/template.html +1 -0
  264. package/packs/gallery-soft/recent/writing.md +17 -0
  265. package/packs/gallery-soft/static/component.json +13 -0
  266. package/packs/gallery-soft/static/example.html +12 -0
  267. package/packs/gallery-soft/static/preview.svg +1 -0
  268. package/packs/gallery-soft/static/style.css +186 -0
  269. package/packs/gallery-soft/static/template.html +1 -0
  270. package/packs/gallery-soft/static/writing.md +20 -0
  271. package/packs/gallery-soft/stats/component.json +13 -0
  272. package/packs/gallery-soft/stats/example.html +1 -0
  273. package/packs/gallery-soft/stats/kit.js +341 -0
  274. package/packs/gallery-soft/stats/preview.svg +1 -0
  275. package/packs/gallery-soft/stats/style.css +119 -0
  276. package/packs/gallery-soft/stats/template.html +1 -0
  277. package/packs/gallery-soft/stats/writing.md +13 -0
  278. package/packs/gallery-soft/today/component.json +12 -0
  279. package/packs/gallery-soft/today/example.html +1 -0
  280. package/packs/gallery-soft/today/kit.js +222 -0
  281. package/packs/gallery-soft/today/preview.svg +1 -0
  282. package/packs/gallery-soft/today/style.css +178 -0
  283. package/packs/gallery-soft/today/template.html +1 -0
  284. package/packs/gallery-soft/today/writing.md +16 -0
  285. package/packs/gallery-soft/todos/component.json +19 -0
  286. package/packs/gallery-soft/todos/example.html +3 -0
  287. package/packs/gallery-soft/todos/kit.js +527 -0
  288. package/packs/gallery-soft/todos/preview.svg +1 -0
  289. package/packs/gallery-soft/todos/style.css +212 -0
  290. package/packs/gallery-soft/todos/template.html +3 -0
  291. package/packs/gallery-soft/todos/writing.md +32 -0
  292. package/packs/gallery-soft/weather/component.json +19 -0
  293. package/packs/gallery-soft/weather/example.html +3 -0
  294. package/packs/gallery-soft/weather/kit.js +411 -0
  295. package/packs/gallery-soft/weather/preview.svg +1 -0
  296. package/packs/gallery-soft/weather/style.css +185 -0
  297. package/packs/gallery-soft/weather/template.html +3 -0
  298. package/packs/gallery-soft/weather/writing.md +28 -0
  299. package/release.json +10 -10
  300. package/skill/SKILL.md +15 -14
  301. package/skill/references/building-blocks.md +4 -4
  302. package/skill/references/extensions.md +11 -7
  303. package/skill/references/pages-and-data.md +13 -9
  304. package/skill/references/writing-html.md +2 -0
  305. package/web/assets/index-BHC5ZOMh.js +15 -0
  306. package/web/assets/index-xP0uw3a0.css +1 -0
  307. package/web/index.html +2 -2
  308. package/dist/chunk-2NRBY6AJ.mjs +0 -2
  309. package/dist/chunk-35NQ4PLQ.mjs +0 -2
  310. package/dist/chunk-3KJHLHUO.mjs +0 -2
  311. package/dist/chunk-4AV456RQ.mjs +0 -2
  312. package/dist/chunk-5XYHDBJ5.mjs +0 -2
  313. package/dist/chunk-6A53MZYZ.mjs +0 -2
  314. package/dist/chunk-6EXH3ORZ.mjs +0 -166
  315. package/dist/chunk-BVEFGE4B.mjs +0 -2
  316. package/dist/chunk-D4EURAX4.mjs +0 -4
  317. package/dist/chunk-DQCE7TJY.mjs +0 -5
  318. package/dist/chunk-FWNRPMCJ.mjs +0 -12
  319. package/dist/chunk-FWW4CSAZ.mjs +0 -2
  320. package/dist/chunk-GY3FAUVM.mjs +0 -2
  321. package/dist/chunk-JVHHHGEA.mjs +0 -3
  322. package/dist/chunk-L7UP52JO.mjs +0 -2
  323. package/dist/chunk-NAMN3RAF.mjs +0 -2
  324. package/dist/chunk-PZDLJJTJ.mjs +0 -3
  325. package/dist/chunk-SXHBYZST.mjs +0 -16
  326. package/dist/chunk-TEZAWDSQ.mjs +0 -2
  327. package/dist/chunk-UFNYFFKO.mjs +0 -20
  328. package/dist/chunk-UKSHDZZ6.mjs +0 -2
  329. package/dist/chunk-VJPFVNNW.mjs +0 -15
  330. package/dist/chunk-VS3ZMVGX.mjs +0 -5
  331. package/web/assets/index-BK2e_07w.js +0 -13
  332. package/web/assets/index-CWFI83mF.css +0 -1
  333. /package/dist/{chunk-YEY3RSFQ.mjs → chunk-5MMN3N5J.mjs} +0 -0
  334. /package/dist/{chunk-UH4SIXTR.mjs → chunk-74UW7QSL.mjs} +0 -0
  335. /package/dist/{chunk-W7XHE4CT.mjs → chunk-EKGYYOSP.mjs} +0 -0
  336. /package/dist/{chunk-QAIHRH3I.mjs → chunk-KNZJT4ET.mjs} +0 -0
  337. /package/dist/{chunk-A55HN5OK.mjs → chunk-N3DSBH5S.mjs} +0 -0
  338. /package/dist/{chunk-QR6A54KJ.mjs → chunk-ZW2A6GBW.mjs} +0 -0
@@ -1,258 +1,140 @@
1
- /* Every selector starts at the instance and goes down from it (a step at a time, >, but for the
2
- pictures' parts), so that nothing here reaches the rest of the page. The face fills its card on a
3
- custom page (the board draws the frame), in the kit's card tokens: its head (the chip, the city, when it
4
- was fetched, muted, its end clear of the card's grip); the sky's picture, the temperature large, the
5
- sky's words and today's range; how it feels, the humidity and the wind, muted, a dot between them; and
6
- the days ahead, each its lowest and highest at the ends of a bar in the accent drawn against all the
7
- days shown. As much as the card holds: the instance is a container of both its sides (a 2 x 2 card
8
- shows the temperature and, under it, the sky's words and its range on one muted line, a 4 x 2 one its
9
- range and the more line too, a 4 x 4 one the days ahead), the weather now in the middle of the room under
10
- the head, but where the days ahead show: then it stands under the head, the days right after the more
11
- line, their rows taller where the card has the room (to 44px), the room left over at the bottom. The
12
- temperature is the cards' hero size. What it says while there is nothing to show is the cards' empty face: a quiet
13
- picture (a place's pin) in a soft disc over a muted line, where to set the city under it, in the middle. The sun and
14
- the rain have colors of their own, light and dark. */
1
+ /* Every selector starts at the instance and goes down a step at a time (>), so that nothing here
2
+ reaches the rest of the page. The pack's design B, in the kit's card tokens, laid out by the card's cells
3
+ (the face's data-layout): "wide" (4 × 2) the head (the chip, a pin, the city, when, faint), the sky's
4
+ picture (50px) beside the temperature (46px, the hero) and the sky's words over today's lowest and
5
+ highest, and at the bottom how it feels, the humidity and the wind, each after a small picture; "narrow"
6
+ (2 × 2) the picture (40px) and the temperature (40px) at the bottom and one line under them; "tall" (4 ×
7
+ 4) the picture larger (60px) and, at the bottom over a hairline, the next five days, each a row of its
8
+ weekday, its sky (22px), its lowest (faint), a bar of its span on the scale of all of them (the cold
9
+ blue to the warm orange) and its highest (600). The pictures have their own colors (the sun's orange, a
10
+ cloud's gray, the rain's blue), in light and dark. A state with nothing to show is the cards' empty face
11
+ under the head. Light and dark. */
15
12
  [data-doc-component="gallery/weather"] {
16
- container-type: size;
17
- --gallery-weather-sun: light-dark(#e09a2b, #f2b950);
18
- --gallery-weather-rain: light-dark(#3a7bd5, #7aa9ec);
19
- --gallery-weather-cloud: light-dark(#a3abb8, #7c8594);
20
- > .gallery-weather-face {
21
- display: flex;
22
- flex-direction: column;
23
- gap: var(--gallery-face-gap);
24
- box-sizing: border-box;
25
- height: 100%;
26
- min-height: 0;
27
- overflow: hidden;
28
- color: var(--gallery-text);
29
- }
30
- > .gallery-weather-face > p { margin: 0; }
13
+ --gallery-weather-sun: light-dark(#f3a935, #f4b045);
14
+ --gallery-weather-cloud: light-dark(#dde2e9, #68717e);
15
+ --gallery-weather-cloud-2: light-dark(#c4cbd5, #4a515b);
16
+ --gallery-weather-rain: light-dark(#5e90d8, #70a1e2);
17
+ --gallery-weather-cool: light-dark(#88b2e3, #6b9bd7);
18
+ --gallery-weather-hot: light-dark(#f3b45a, #efa94a);
19
+ font-family: var(--gallery-font);
20
+ font-size: 13px;
21
+ line-height: 1.5;
22
+ color: var(--gallery-text);
23
+ > .gallery-weather-face { display: flex; flex-direction: column; box-sizing: border-box; min-height: 0; }
31
24
  > .gallery-weather-face > .gallery-weather-head {
32
25
  display: flex;
33
26
  align-items: center;
34
27
  gap: 8px;
35
28
  flex: none;
29
+ height: 20px;
36
30
  min-width: 0;
31
+ margin: 0;
37
32
  padding-inline-end: var(--gallery-grip-room, 0px);
38
- font-size: var(--gallery-title-size);
39
- line-height: var(--gallery-title-line);
40
33
  }
41
34
  > .gallery-weather-face > .gallery-weather-head > .gallery-weather-chip {
42
35
  flex: none;
43
- display: inline-flex;
44
- align-items: center;
45
- justify-content: center;
36
+ display: grid;
37
+ place-items: center;
46
38
  width: var(--gallery-chip-size);
47
39
  height: var(--gallery-chip-size);
48
40
  border-radius: var(--gallery-chip-radius);
49
- background: var(--gallery-accent-soft);
50
- color: var(--gallery-accent);
41
+ background: var(--gallery-fill);
42
+ color: var(--gallery-muted);
51
43
  }
52
- > .gallery-weather-face > .gallery-weather-head > .gallery-weather-chip > svg { width: var(--gallery-chip-icon); height: var(--gallery-chip-icon); }
44
+ > .gallery-weather-face > .gallery-weather-head > .gallery-weather-chip > svg { display: block; width: var(--gallery-chip-icon); height: var(--gallery-chip-icon); }
53
45
  > .gallery-weather-face > .gallery-weather-head > .gallery-weather-city {
54
- flex: 1 1 auto;
55
46
  min-width: 0;
56
47
  overflow: hidden;
57
48
  white-space: nowrap;
58
49
  text-overflow: ellipsis;
50
+ font-size: var(--gallery-title-size);
51
+ line-height: var(--gallery-title-line);
59
52
  font-weight: 600;
60
- color: var(--gallery-text-strong);
61
- }
62
- > .gallery-weather-face > .gallery-weather-head > .gallery-weather-at {
63
- flex: none;
64
- margin-inline-end: calc(-1 * var(--gallery-grip-room, 0px)); opacity: calc(1 - var(--gallery-grip-shown, 0)); transition: opacity .12s ease-out;
65
- font-size: var(--gallery-meta-size);
66
- color: var(--doc-muted);
67
- white-space: nowrap;
68
- }
69
- > .gallery-weather-face > .gallery-weather-now {
70
- display: flex;
71
- align-items: center;
72
- gap: 12px;
73
- min-width: 0;
74
- margin-top: auto;
75
- }
76
- /* The weather now and its more line, together in the middle of the room under the head. */
77
- > .gallery-weather-face > .gallery-weather-more { margin-bottom: auto; }
78
- > .gallery-weather-face > .gallery-weather-now > .gallery-weather-picture {
79
- flex: none;
80
- width: clamp(40px, 13cqi, 52px);
81
- height: clamp(40px, 13cqi, 52px);
53
+ color: var(--gallery-text);
82
54
  }
55
+ > .gallery-weather-face > .gallery-weather-head > .gallery-weather-at { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: var(--gallery-meta-size); color: var(--gallery-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
56
+ > .gallery-weather-face > .gallery-weather-head > .gallery-weather-at > .gallery-weather-stale { display: inline-flex; color: var(--gallery-warm); }
57
+ > .gallery-weather-face > .gallery-weather-head > .gallery-weather-at > .gallery-weather-stale > svg { width: 12px; height: 12px; stroke-width: 2; }
58
+ > .gallery-weather-face > .gallery-weather-now { display: flex; align-items: center; gap: 10px; flex: none; margin-top: 10px; }
59
+ > .gallery-weather-face > .gallery-weather-now > .gallery-weather-picture { flex: none; width: 50px; height: 50px; overflow: visible; }
83
60
  > .gallery-weather-face > .gallery-weather-now > .gallery-weather-temperature {
84
- flex: none;
85
- font-size: var(--gallery-hero-size);
61
+ font-size: 46px;
86
62
  line-height: 1;
87
- font-weight: var(--gallery-numeral-weight);
88
- letter-spacing: var(--gallery-numeral-tracking);
63
+ font-weight: 500;
64
+ letter-spacing: -.04em;
65
+ font-variant-numeric: lining-nums;
89
66
  color: var(--gallery-text-strong);
90
- font-variant-numeric: tabular-nums;
91
67
  }
92
- > .gallery-weather-face > .gallery-weather-now > .gallery-weather-words {
68
+ > .gallery-weather-face > .gallery-weather-now > .gallery-weather-words { display: flex; flex-direction: column; gap: 2px; margin-left: 6px; min-width: 0; }
69
+ > .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > .gallery-weather-sky { font-size: 14px; line-height: 18px; font-weight: 600; color: var(--gallery-text); white-space: nowrap; }
70
+ > .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > .gallery-weather-range { font-size: 12.5px; line-height: 16px; color: var(--gallery-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
71
+ > .gallery-weather-face > .gallery-weather-line { display: none; }
72
+ > .gallery-weather-face > .gallery-weather-more { display: flex; gap: 14px; flex: none; margin: auto 0 0; font-size: 12px; line-height: 16px; color: var(--gallery-muted); white-space: nowrap; overflow: hidden; }
73
+ > .gallery-weather-face > .gallery-weather-more > .gallery-weather-piece { display: inline-flex; align-items: center; gap: 4px; }
74
+ > .gallery-weather-face > .gallery-weather-more > .gallery-weather-piece > svg { flex: none; width: 13px; height: 13px; color: var(--gallery-faint); }
75
+ > .gallery-weather-face > .gallery-weather-days { display: none; }
76
+ /* The pictures' own colors. */
77
+ > .gallery-weather-face svg .gallery-weather-sun { fill: var(--gallery-weather-sun); stroke: var(--gallery-weather-sun); }
78
+ > .gallery-weather-face svg .gallery-weather-sun > circle { stroke: none; }
79
+ > .gallery-weather-face svg .gallery-weather-moon { fill: var(--gallery-weather-sun); }
80
+ > .gallery-weather-face svg .gallery-weather-cloud { fill: var(--gallery-weather-cloud); }
81
+ > .gallery-weather-face svg .gallery-weather-cloud-2 { fill: var(--gallery-weather-cloud-2); }
82
+ > .gallery-weather-face svg :is(.gallery-weather-rain, .gallery-weather-mist) { stroke: var(--gallery-weather-rain); }
83
+ > .gallery-weather-face svg .gallery-weather-mist { stroke: var(--gallery-weather-cloud-2); }
84
+ > .gallery-weather-face svg .gallery-weather-snow { fill: var(--gallery-weather-cool); }
85
+ > .gallery-weather-face svg .gallery-weather-bolt { fill: var(--gallery-weather-sun); }
86
+
87
+ /* A narrow card: the picture and the temperature at the bottom, one line under them. */
88
+ /* Its head the city alone, but for the sign of an answer kept from before the network went (its time in its title), so that yesterday's weather never reads as now's. */
89
+ > .gallery-weather-face[data-layout="narrow"] > .gallery-weather-head > .gallery-weather-at:not(:has(> .gallery-weather-stale)) { display: none; }
90
+ > .gallery-weather-face[data-layout="narrow"] > .gallery-weather-head > .gallery-weather-at > .gallery-weather-when { display: none; }
91
+ > .gallery-weather-face[data-layout="narrow"] > .gallery-weather-now { margin-top: auto; gap: 4px; }
92
+ > .gallery-weather-face[data-layout="narrow"] > .gallery-weather-now > .gallery-weather-picture { width: 40px; height: 40px; }
93
+ > .gallery-weather-face[data-layout="narrow"] > .gallery-weather-now > .gallery-weather-temperature { font-size: 40px; }
94
+ > .gallery-weather-face[data-layout="narrow"] > .gallery-weather-now > .gallery-weather-words,
95
+ > .gallery-weather-face[data-layout="narrow"] > .gallery-weather-more { display: none; }
96
+ > .gallery-weather-face[data-layout="narrow"] > .gallery-weather-line { display: block; margin: 6px 0 0; font-size: 12.5px; line-height: 16px; color: var(--gallery-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
97
+ > .gallery-weather-face[data-layout="narrow"] > .gallery-weather-line > b { font-weight: 600; color: var(--gallery-text); }
98
+ > .gallery-weather-face[data-layout="narrow"] > .gallery-weather-line > .gallery-weather-dot { margin: 0 5px; color: var(--gallery-faintest); }
99
+ /* A tall card: the five days ahead at the bottom. */
100
+ > .gallery-weather-face[data-layout="tall"] > .gallery-weather-now { margin-top: 14px; }
101
+ > .gallery-weather-face[data-layout="tall"] > .gallery-weather-now > .gallery-weather-picture { width: 60px; height: 60px; }
102
+ > .gallery-weather-face[data-layout="tall"] > .gallery-weather-more { margin-top: 12px; }
103
+ > .gallery-weather-face[data-layout="tall"] > .gallery-weather-days {
93
104
  display: flex;
94
105
  flex-direction: column;
95
- gap: 2px;
96
- min-width: 0;
97
- font-size: 14px;
98
- line-height: 1.35;
99
- }
100
- > .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > * {
101
- overflow: hidden;
102
- white-space: nowrap;
103
- text-overflow: ellipsis;
104
- }
105
- > .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > .gallery-weather-sky { font-weight: 500; }
106
- > .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > .gallery-weather-range {
107
- font-size: 13px;
108
- color: var(--doc-muted);
109
- font-variant-numeric: tabular-nums;
110
- }
111
- /* How it feels, the humidity, the wind: muted, a dot between them, a piece never broken. */
112
- > .gallery-weather-face > .gallery-weather-more {
113
- display: flex;
114
- flex-wrap: wrap;
115
- align-items: center;
116
- gap: 2px 0;
117
- font-size: var(--gallery-meta-size);
118
- line-height: 1.5;
119
- color: var(--doc-muted);
120
- font-variant-numeric: tabular-nums;
121
- }
122
- > .gallery-weather-face > .gallery-weather-more > .gallery-weather-piece { white-space: nowrap; }
123
- > .gallery-weather-face > .gallery-weather-more > .gallery-weather-piece + .gallery-weather-piece::before {
124
- content: "";
125
- display: inline-block;
126
- width: 3px;
127
- height: 3px;
128
- margin: 0 8px;
129
- border-radius: 50%;
130
- background: currentColor;
131
- opacity: .6;
132
- vertical-align: middle;
133
- }
134
- > .gallery-weather-face > .gallery-weather-days {
135
- display: none;
136
- margin: 0;
137
- padding: 8px 0 0;
106
+ margin: auto 0 0;
107
+ padding: 6px 0 0;
108
+ border-top: 1px solid var(--gallery-hair);
138
109
  list-style: none;
139
- border-top: 1px solid var(--doc-grid);
140
110
  }
141
111
  > .gallery-weather-face > .gallery-weather-days > .gallery-weather-day {
142
112
  display: grid;
143
- grid-template-columns: minmax(2.6em, 1fr) 22px minmax(0, 3fr);
144
- align-items: center;
145
- gap: 10px;
146
- padding: 3px 0;
147
- font-size: 13px;
148
- line-height: 1.4;
149
- }
150
- > .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-picture { width: 20px; height: 20px; }
151
- > .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-day-range {
152
- display: grid;
153
- grid-template-columns: 2.6em minmax(0, 1fr) 2.6em;
113
+ grid-template-columns: 34px 24px 30px 1fr 30px;
154
114
  align-items: center;
155
- gap: 8px;
115
+ gap: 6px;
116
+ height: 26px;
117
+ font-size: 12.5px;
156
118
  font-variant-numeric: tabular-nums;
157
119
  }
158
- > .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-day-range > .gallery-weather-low { color: var(--doc-muted); text-align: end; }
159
- > .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-day-range > .gallery-weather-bar {
160
- position: relative;
161
- height: 4px;
162
- border-radius: 2px;
163
- background: var(--gallery-track);
164
- }
165
- > .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-day-range > .gallery-weather-bar > .gallery-weather-fill {
120
+ > .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-weekday { color: var(--gallery-text); }
121
+ > .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-picture { width: 22px; height: 22px; overflow: visible; }
122
+ > .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-low { color: var(--gallery-faint); text-align: right; }
123
+ > .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-high { color: var(--gallery-text); font-weight: 600; }
124
+ > .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-bar { position: relative; height: 5px; border-radius: 3px; background: var(--gallery-fill); }
125
+ > .gallery-weather-face > .gallery-weather-days > .gallery-weather-day > .gallery-weather-bar > .gallery-weather-fill {
166
126
  position: absolute;
167
127
  top: 0;
168
128
  bottom: 0;
169
- left: calc(var(--from, 0) * 100%);
170
- right: calc((1 - var(--to, 1)) * 100%);
171
- min-width: 4px;
172
- border-radius: 2px;
173
- background: var(--gallery-accent);
174
- }
175
- /* What it says while there is nothing to show: the cards' empty face (as todos' and recent's), a quiet
176
- picture over a muted line, where to set the city under it, the two in the middle. */
177
- > .gallery-weather-face > .gallery-weather-note {
178
- display: flex;
179
- flex-direction: column;
180
- align-items: center;
181
- gap: 8px;
182
- margin-top: auto;
183
- padding: 0 8px;
184
- font-size: 13px;
185
- line-height: 1.45;
186
- color: var(--doc-muted);
187
- text-align: center;
188
- }
189
- > .gallery-weather-face > .gallery-weather-note::before {
190
- content: "";
191
- flex: none;
192
- width: 44px;
193
- height: 44px;
194
- margin-bottom: 2px;
195
- background: currentColor;
196
- -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Ccircle cx='22' cy='22' r='22' fill-opacity='.14'/%3E%3Cg transform='translate(11 11) scale(.9167)' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11a3 3 0 1 0 6 0 3 3 0 0 0-6 0'/%3E%3Cpath d='M17.66 16.66 13.41 20.9a2 2 0 0 1-2.83 0l-4.24-4.24a8 8 0 1 1 11.32 0z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
197
- mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Ccircle cx='22' cy='22' r='22' fill-opacity='.14'/%3E%3Cg transform='translate(11 11) scale(.9167)' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11a3 3 0 1 0 6 0 3 3 0 0 0-6 0'/%3E%3Cpath d='M17.66 16.66 13.41 20.9a2 2 0 0 1-2.83 0l-4.24-4.24a8 8 0 1 1 11.32 0z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
198
- }
199
- > .gallery-weather-face > .gallery-weather-note:last-child { margin-bottom: auto; }
200
- > .gallery-weather-face > .gallery-weather-hint {
201
- margin: -4px 0 auto;
202
- font-size: var(--gallery-meta-size);
203
- color: var(--doc-muted);
204
- text-align: center;
205
- opacity: .8;
206
- }
207
- .gallery-weather-picture { fill: var(--gallery-weather-cloud); }
208
- .gallery-weather-picture .gallery-weather-sun { fill: var(--gallery-weather-sun); stroke: var(--gallery-weather-sun); }
209
- .gallery-weather-picture g.gallery-weather-sun { fill: none; }
210
- .gallery-weather-picture .gallery-weather-moon { fill: var(--gallery-weather-sun); }
211
- .gallery-weather-picture .gallery-weather-rain,
212
- .gallery-weather-picture .gallery-weather-cloud-line { stroke: var(--gallery-weather-rain); }
213
- .gallery-weather-picture .gallery-weather-cloud-line { stroke: var(--gallery-weather-cloud); }
214
- .gallery-weather-picture .gallery-weather-snow { fill: var(--gallery-weather-rain); }
215
- .gallery-weather-picture .gallery-weather-bolt { fill: var(--gallery-weather-sun); }
216
- }
217
- /* A narrow card (2 wide): the picture at the left of the temperature and, under the temperature (from its
218
- left, not the picture's), the sky's words and the range on one muted line, a dot between; no more line;
219
- narrower still, no range. */
220
- @container (max-width: 260px) {
221
- [data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-more { display: none; }
222
- [data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now {
223
- display: grid;
224
- grid-template-columns: auto minmax(0, 1fr);
225
- grid-template-areas: "picture temperature" "picture words";
226
- align-items: center;
227
- gap: 2px 10px;
228
- margin-bottom: auto;
229
- }
230
- [data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now > .gallery-weather-picture { grid-area: picture; }
231
- [data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now > .gallery-weather-temperature { grid-area: temperature; }
232
- [data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now > .gallery-weather-words { grid-area: words; flex-direction: row; gap: 0; font-size: 13px; color: var(--doc-muted); }
233
- [data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > .gallery-weather-sky { font-weight: 400; }
234
- [data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > .gallery-weather-range::before { content: "·"; margin: 0 5px; }
235
- [data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-head > .gallery-weather-at { display: none; }
236
- }
237
- @container (max-width: 200px) {
238
- [data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now > .gallery-weather-words > .gallery-weather-range { display: none; }
239
- }
240
- /* A low card: no more line. */
241
- @container (max-height: 104px) {
242
- [data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-more { display: none; }
243
- [data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now { margin-bottom: auto; }
244
- }
245
- /* A tall card (4 high, or 2 high on a wide window but for its last row's room): the weather now under the
246
- head, the days ahead right after its more line, their rows sharing the room left (each 44px at the most),
247
- what is still left at the bottom. */
248
- @container (min-height: 240px) {
249
- [data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-now { margin-top: 4px; }
250
- [data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-more { margin-bottom: 0; }
251
- [data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-days { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin-top: 4px; }
252
- [data-doc-component="gallery/weather"] > .gallery-weather-face > .gallery-weather-days > .gallery-weather-day { flex: 1 1 0; max-height: 44px; min-height: 0; }
129
+ border-radius: 3px;
130
+ background-image: linear-gradient(90deg, var(--gallery-weather-cool), var(--gallery-weather-hot));
131
+ }
132
+ /* Nothing to show yet: the cards' empty face under the head. */
133
+ > .gallery-weather-face > .gallery-weather-empty { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 0; }
134
+ > .gallery-weather-face > .gallery-weather-empty > p { margin: 0; }
135
+ > .gallery-weather-face > .gallery-weather-empty > .gallery-weather-note { font-size: 13.5px; line-height: 20px; font-weight: 600; color: var(--gallery-text); }
136
+ > .gallery-weather-face > .gallery-weather-empty > .gallery-weather-hint { font-size: 12px; line-height: 18px; color: var(--gallery-faint); }
253
137
  }
254
- /* On a custom page the face is the card's: as high as what the card holds inside its padding. Where no card
255
- is around it (a document, as gallery block check shows it) it is as high as a 4 x 2 card's face, for the
256
- instance is a container of its height too and would otherwise have none. */
257
- [data-doc-component="gallery/weather"] { height: 11em; }
138
+ /* On a custom page the face fills the card the board frames. */
258
139
  .gallery-card > [data-doc-component="gallery/weather"] { height: 100%; }
140
+ .gallery-card > [data-doc-component="gallery/weather"] > .gallery-weather-face { height: 100%; }
@@ -23,4 +23,4 @@ Put it on a custom page as a card of its board, `<section class="gallery-card" d
23
23
 
24
24
  ## How it looks
25
25
 
26
- The city beside a pin's chip and when the weather was fetched (更新于 14:05) at the top, the sky's picture, the temperature large and the sky's words beside it (on a 2 × 2 card under it, with the range, muted), how it feels, the humidity and the wind in a muted line, and on a 4 × 4 card the days ahead right under them, each with its picture and its lowest and highest at the ends of a bar drawn against the whole week; in the kit's card tokens (as every Gallery card: a head of a tinted chip and a title, its end clear of the card's grip), light and dark, the sun and the rain in colors of their own. It is fetched again when its settings change and every 30 minutes. While there is nothing to show it says why where the weather stands: 写上一个城市 (no city), 找不到「…」 (a name Open-Meteo does not know), 允许联网之后显示天气 (waiting for the user's consent, the kit's button over it), 现在连不上网,取不到天气 (no network, and nothing fetched before; Gallery gives the last answer it kept when there is one, its time at the top), 网络设置把天气服务指向了本地地址,取不到天气 (this computer's network setup gives Open-Meteo's names an address of this computer or of a private network, and no proxy of this computer takes them by name: Gallery refuses such an address). The script runs with the rights of the page's own scripts, as any block's does.
26
+ In Gallery 风格's look (the kit's card tokens, light and dark): a head of a small gray chip and a title, its end clear of the card's grip; one hero; the rest small and gray; the accent on the data and on today alone. Its head is a pin's chip, the city and when it was fetched (更新于 09:05; with no network, an answer kept from before says when, after a sign). The sky's picture, in its own colors (the sun's orange, a cloud's gray, the rain's blue), stands beside the temperature, the hero, and the sky's words over today's lowest and highest; at the bottom how it feels, the humidity and the wind, each after a small picture. A 2 × 2 card keeps the picture, the temperature and one line; a 4 × 4 card adds the next five days at the bottom, each its weekday, its sky, its lowest and highest at either end of a bar on the scale of all of them, cold blue to warm orange. Until the reader allows it online, or with no city, a city it cannot find or no network, the card says so under its head, and what to do faint under that.
@@ -0,0 +1,18 @@
1
+ {
2
+ "id": "gallery-soft/countdown",
3
+ "apiVersion": 1,
4
+ "version": "1.0.0",
5
+ "name": { "zh": "倒计时", "en": "Countdown" },
6
+ "description": { "zh": "离某一天还有几天,宽卡片旁边放一页小日历;到了那天说就是今天,过了说已过几天", "en": "How many days until a date, a page of a calendar beside it on a wide card: today on the day, and the days since after it" },
7
+ "words": "daojishi daoshu countdown days until 倒计时 倒数日 纪念日 日子",
8
+ "parts": {
9
+ "settings": { "at": ":scope > script", "edit": "data" }
10
+ },
11
+ "runtime": { "generated": [":scope > .gallery-soft-countdown-face"] },
12
+ "places": ["page"],
13
+ "card": { "sizes": [[2, 2], [4, 2]], "resize": true },
14
+ "settings": [
15
+ { "key": "title", "label": { "zh": "名称", "en": "Name" }, "type": "text", "default": "" },
16
+ { "key": "date", "label": { "zh": "日期", "en": "Date" }, "type": "date", "required": true }
17
+ ]
18
+ }
@@ -0,0 +1,3 @@
1
+ <div data-doc-component="gallery-soft/countdown">
2
+ <script type="application/json">{"title":"春节","date":"2027-02-06"}</script>
3
+ </div>
@@ -0,0 +1,206 @@
1
+ // gallery-soft/countdown (倒计时, 柔光风格): Gallery 风格's gallery/countdown in the soft look, the same logic.
2
+ // The days between today, by the reader's clock, and the date its settings name: how many are left before
3
+ // it, 就是今天 on the day itself, how many have gone since after it. Its two settings, `title` (the name of the
4
+ // day) and `date` (YYYY-MM-DD), are the card's form (on a custom page the grip at the card's top right ›
5
+ // 设置…), kept in the data part `settings`, a script of JSON, which the board writes and this block only
6
+ // reads: it writes nothing. Drawn from that part on every `source` (the form, an Agent's write, an undo)
7
+ // and again as a day begins (the kit's `clock`, "day"), so that the count moves at midnight. A date it
8
+ // cannot read, or none, shows the cards' empty face, a calendar in a soft disc over 还没有设日期 and where
9
+ // to set one; the words are the page's language (the UI's where Gallery says it, else the page's lang).
10
+ //
11
+ // Its face, laid out by its card's size (`context.size`, read again on `layout`; data-w, data-h, data-pad):
12
+ // a head of an hourglass's chip and the day's name (春节, or 倒计时 where it has none); the count the hero,
13
+ // large, 还有 (or 已过) before it and 天 after it, muted; on the day 就是今天 in the accent; under it the date
14
+ // (2月6日 周六 on a 2 × 2 card, 2027年2月6日 星期六 on a wider one, which sets a small page of a calendar
15
+ // beside the count, the month on a band of the accent over the day). The face says by `data-kind` which of
16
+ // left, today, since or none it shows.
17
+
18
+ const WORDS = {
19
+ zh: {
20
+ left: "还有",
21
+ since: "已过",
22
+ today: "就是今天",
23
+ unit: () => "天",
24
+ countdown: "倒计时",
25
+ pick: "还没有设日期",
26
+ where: "右上角手柄 › 设置…",
27
+ whereShort: "手柄 › 设置…",
28
+ weekdays: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
29
+ short: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
30
+ date: (/** @type {number} */ year, /** @type {number} */ month, /** @type {number} */ day, /** @type {string} */ weekday) => [`${year}年${month}月${day}日`, weekday],
31
+ dateShort: (/** @type {number} */ month, /** @type {number} */ day, /** @type {string} */ weekday) => [`${month}月${day}日`, weekday],
32
+ month: (/** @type {number} */ month) => `${month}月`,
33
+ },
34
+ en: {
35
+ left: "In",
36
+ since: "",
37
+ today: "Today",
38
+ unit: (/** @type {number} */ count, /** @type {boolean} */ since = false) => `${count === 1 ? "day" : "days"}${since ? " ago" : ""}`,
39
+ countdown: "Countdown",
40
+ pick: "No date yet",
41
+ where: "The grip at the top right › Settings…",
42
+ whereShort: "Grip › Settings…",
43
+ weekdays: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
44
+ short: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
45
+ date: (/** @type {number} */ year, /** @type {number} */ month, /** @type {number} */ day, /** @type {string} */ weekday) => [`${weekday},`, `${["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][month - 1]} ${day}, ${year}`],
46
+ dateShort: (/** @type {number} */ month, /** @type {number} */ day, /** @type {string} */ weekday) => [`${weekday},`, `${["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][month - 1]} ${day}`],
47
+ month: (/** @type {number} */ month) => ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][month - 1],
48
+ },
49
+ };
50
+
51
+ /** The language the page speaks: the UI's where Gallery says it (data-ge-language), else its lang's. */
52
+ function languageOf(/** @type {HTMLElement} */ root) {
53
+ const ui = root.getAttribute("data-ge-language");
54
+ return (ui !== null ? ui === "en" : /^en(?:-|$)/i.test(root.lang)) ? "en" : "zh";
55
+ }
56
+
57
+ /**
58
+ * A date written YYYY-MM-DD as { year, month, day }, or null for anything else (no such day too:
59
+ * 2027-02-30).
60
+ * @param {unknown} written
61
+ */
62
+ function dateOf(written) {
63
+ const found = typeof written === "string" ? /^(\d{4})-(\d{2})-(\d{2})$/.exec(written) : null;
64
+ if (!found) return null;
65
+ const [year, month, day] = found.slice(1).map(Number);
66
+ const date = new Date(Date.UTC(year, month - 1, day));
67
+ return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day ? { year, month, day } : null;
68
+ }
69
+
70
+ /**
71
+ * Where `now` (the reader's clock) stands to the date `written` (YYYY-MM-DD): { kind: "left", days }
72
+ * before it, { kind: "today", days: 0 } on it, { kind: "since", days } after it, by whole days of the
73
+ * calendar (counted in UTC from each day's date, so that a change of the clocks in between changes
74
+ * nothing); { kind: "none" } for a date it cannot read.
75
+ * @param {unknown} written
76
+ * @param {Date} now
77
+ * @returns {{ kind: "left" | "since" | "today", days: number } | { kind: "none" }}
78
+ */
79
+ function countdownOf(written, now) {
80
+ const date = dateOf(written);
81
+ if (!date) return { kind: "none" };
82
+ const days = Math.round((Date.UTC(date.year, date.month - 1, date.day) - Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())) / 86_400_000);
83
+ if (days === 0) return { kind: "today", days: 0 };
84
+ return days > 0 ? { kind: "left", days } : { kind: "since", days: -days };
85
+ }
86
+
87
+ /**
88
+ * What the card says, in `language`, of its `settings` (context.readJSON's, {} where none is set yet)
89
+ * at `now`: its head (the day's name, or 倒计时), the words before the count (还有, 已过) and its unit after it
90
+ * ("" with no count), its count (null on the day and with no date), the words standing there instead
91
+ * (`big`: 就是今天, or with no date 还没有设日期), the date (a list of words a line breaks between and never
92
+ * inside: the date and its weekday) long and short, or with no date where to set one (`where`, `whereShort`),
93
+ * and the calendar's page (its month and day; null with no date).
94
+ * @param {any} settings
95
+ * @param {Date} now
96
+ * @param {"zh" | "en"} language
97
+ */
98
+ function faceOf(settings, now, language) {
99
+ const words = WORDS[language];
100
+ const date = dateOf(settings?.date);
101
+ const named = typeof settings?.title === "string" ? settings.title.trim() : "";
102
+ const count = countdownOf(settings?.date, now);
103
+ const head = named || words.countdown;
104
+ if (!date || count.kind === "none") return { head, label: "", count: null, unit: "", big: words.pick, foot: [words.where], footShort: [words.whereShort], page: null };
105
+ const weekday = new Date(Date.UTC(date.year, date.month - 1, date.day)).getUTCDay();
106
+ const foot = words.date(date.year, date.month, date.day, words.weekdays[weekday]);
107
+ const footShort = words.dateShort(date.month, date.day, words.short[weekday]);
108
+ const page = { month: words.month(date.month), day: String(date.day) };
109
+ if (count.kind === "today") return { head, label: "", count: null, unit: "", big: words.today, foot, footShort, page };
110
+ return { head, label: count.kind === "left" ? words.left : words.since, count: String(count.days), unit: words.unit(count.days, count.kind === "since"), big: "", foot, footShort, page };
111
+ }
112
+
113
+ /**
114
+ * The size the face is laid out by: its card's cells (`context.size`), or `fallback` (the manifest's first
115
+ * size) where no card is; and the frame's padding for it, as the soft cards pad theirs: "xs" on a card one
116
+ * cell high, "s" on a small one (2 × 2 and less), "l" on one 3 cells high or more, else "m".
117
+ * @param {DocComponentSize | null | undefined} size
118
+ * @param {[number, number]} fallback
119
+ */
120
+ function sizeOf(size, fallback) {
121
+ const w = size?.w ?? fallback[0];
122
+ const h = size?.h ?? fallback[1];
123
+ return { w, h, pad: h === 1 ? "xs" : w <= 2 && h <= 2 ? "s" : h >= 3 ? "l" : "m" };
124
+ }
125
+
126
+ /**
127
+ * An element of the face, of `kind` (its class).
128
+ * @template {keyof HTMLElementTagNameMap} K
129
+ * @param {K} tag
130
+ * @param {string} kind
131
+ * @param {string} [text]
132
+ */
133
+ function made(tag, kind, text) {
134
+ const node = document.createElement(tag);
135
+ node.className = `gallery-soft-countdown-${kind}`;
136
+ if (text !== undefined) node.textContent = text;
137
+ return node;
138
+ }
139
+
140
+ /** Words as pieces a line breaks between and never inside. @param {string[]} pieces */
141
+ const piecesOf = (pieces) => pieces.flatMap((words, index) => {
142
+ const piece = made("span", "piece", words);
143
+ return index === 0 ? [piece] : [" ", piece];
144
+ });
145
+
146
+ DocKit.component({
147
+ id: "gallery-soft/countdown",
148
+ on: ["source", "clock", "layout"],
149
+ mount(host, context) {
150
+ const language = languageOf(document.documentElement);
151
+ const face = made("div", "face");
152
+ host.append(face);
153
+ const draw = (/** @type {string} */ reason = "", /** @type {unknown} */ detail = null) => {
154
+ if (reason === "clock" && detail !== "day") return; // a minute moves no count
155
+ const settings = context.readJSON("settings");
156
+ if (settings === undefined) return; // no JSON: the instance has failed, and Gallery shows what it holds
157
+ if (settings === null || typeof settings !== "object" || Array.isArray(settings)) return context.fail(new Error("its settings are no object: { \"title\": \"…\", \"date\": \"YYYY-MM-DD\" }"));
158
+ const { w, h, pad } = sizeOf(context.size, [2, 2]);
159
+ const small = w <= 2;
160
+ const at = new Date();
161
+ const now = faceOf(settings, at, language);
162
+ const kind = countdownOf(settings.date, at).kind;
163
+ Object.assign(face.dataset, { kind, w: String(w), h: String(h), pad });
164
+ const head = made("div", "head");
165
+ const chip = made("span", "chip");
166
+ chip.setAttribute("aria-hidden", "true");
167
+ chip.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M7 3.5h10M7 20.5h10"/><path d="M8 3.5v2.4c0 1.4.7 2.6 1.8 3.4L12 11l2.2-1.7A4.2 4.2 0 0 0 16 5.9V3.5"/><path d="M8 20.5v-2.4c0-1.4.7-2.6 1.8-3.4L12 13l2.2 1.7a4.2 4.2 0 0 1 1.8 3.4v2.4"/></svg>';
168
+ const named = made("span", "name", now.head);
169
+ named.title = now.head;
170
+ head.append(chip, named);
171
+ if (kind === "none") {
172
+ // The cards' empty face: a calendar in a soft disc, what is missing, where to set it.
173
+ const empty = made("div", "empty");
174
+ const disc = made("span", "disc");
175
+ disc.setAttribute("aria-hidden", "true");
176
+ disc.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="5.5" width="16" height="14.5" rx="2.4"/><path d="M8 3.5v4M16 3.5v4M4 10.5h16"/></svg>';
177
+ empty.append(disc, made("p", "line", now.big), made("p", "how", (small ? now.footShort : now.foot).join(" ")));
178
+ face.replaceChildren(head, empty);
179
+ return;
180
+ }
181
+ // The count: 还有 before it, 天 after it; on the day, its words.
182
+ const figure = made("p", "count");
183
+ if (now.count === null) {
184
+ figure.classList.add("gallery-soft-countdown-words");
185
+ figure.textContent = now.big;
186
+ } else {
187
+ figure.append(...(now.label ? [made("span", "label", now.label)] : []), made("span", "number", now.count), made("span", "unit", now.unit));
188
+ }
189
+ const date = made("p", "date");
190
+ date.append(...piecesOf(small ? now.footShort : now.foot));
191
+ const body = made("div", "body");
192
+ const grow = made("div", "grow");
193
+ grow.append(figure, date);
194
+ body.append(grow);
195
+ if (!small && now.page) {
196
+ const page = made("div", "page");
197
+ page.setAttribute("aria-hidden", "true");
198
+ page.append(made("span", "month", now.page.month), made("span", "day", now.page.day));
199
+ body.append(page);
200
+ }
201
+ face.replaceChildren(head, body);
202
+ };
203
+ draw();
204
+ return { update: draw };
205
+ },
206
+ });
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 120"><defs><linearGradient id="w" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#3e7ac6" stop-opacity=".07"/><stop offset=".52" stop-color="#3e7ac6" stop-opacity="0"/></linearGradient></defs><rect width="240" height="120" rx="8" fill="#f3f3f1"/><rect x="16.5" y="12.5" width="207" height="95" rx="14" fill="#ffffff" stroke="#e8e7e4"/><rect x="17" y="13" width="206" height="94" rx="13.5" fill="url(#w)"/><rect x="30" y="24" width="14" height="14" rx="4.5" fill="#ecf3fb"/><rect x="34" y="30" width="6" height="2" rx="1" fill="#3e7ac6"/><rect x="50" y="28" width="26" height="6" rx="3" fill="#37352f"/><rect x="30" y="58" width="18" height="7" rx="3.5" fill="#8d8c88"/><rect x="52" y="50" width="44" height="22" rx="11" fill="#1f1f1f"/><rect x="100" y="64" width="10" height="7" rx="3.5" fill="#8d8c88"/><rect x="30" y="82" width="70" height="5" rx="2.5" fill="#c4c2bd"/><rect x="168" y="46" width="38" height="44" rx="8" fill="#fff" stroke="#e6e5e2"/><path d="M168 54a8 8 0 0 1 8-8h22a8 8 0 0 1 8 8v4h-38z" fill="#3e7ac6"/><rect x="178" y="67" width="18" height="14" rx="7" fill="#1f1f1f"/></svg>