@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,14 +1,18 @@
1
1
  // gallery/countdown (倒计时): the days between today, by the reader's clock, and the date its settings
2
- // name: how many are left before it, 今天 on the day itself, how many have gone since after it. Its two
2
+ // name: how many are left before it, 就是今天 on the day itself, how many have gone since after it. Its two
3
3
  // settings, `title` (the name of the day) and `date` (YYYY-MM-DD), are the card's form (on a custom page
4
- // the grip at the card's top right › 设置…), kept in the data part `settings`, a script of JSON, which the board writes and this block
5
- // only reads: it writes nothing. Drawn from that part on every `source` (the form, an Agent's write, an
6
- // undo) and again as a day begins (the kit's `clock`, "day"), so that the count moves at midnight. A
7
- // date it cannot read, or none, asks for one; the words are the page's language (the UI's where Gallery
8
- // says it, else the page's lang). Its head is the cards' (the kit's card tokens): the chip, an hourglass,
9
- // before the day's name alone (春节, or 倒计时 where it has none), on one line; under it the count's label
10
- // (还有, 已经过去) over the count, large, and its unit, the family's label over a number; its face says by
11
- // `data-kind` which of left, today, since or none it shows.
4
+ // the grip at the card's top right › 设置…), kept in the data part `settings`, a script of JSON, which the
5
+ // board writes and this block only reads: it writes nothing. Drawn from that part on every `source` (the
6
+ // form, an Agent's write, an undo) and again as a day begins (the kit's `clock`, "day"), so that the count
7
+ // moves at midnight. The words are the page's language (the UI's where Gallery says it, else the page's
8
+ // lang). Its face (the pack's design B, in the kit's card tokens): a head of the chip, an hourglass, and
9
+ // the day's name alone (春节, or 倒计时 where it has none), on one line; at the bottom the count's label
10
+ // (还有, 已经过去) over the count, the hero, and its unit, and the date under them, faint (2027年2月6日 周六);
11
+ // on the day, 就是今天 in the accent where the count stands. A card four cells wide (`data-layout` "wide",
12
+ // by context.size, read again on `layout`) sets the month of the date beside it, a small calendar, Monday
13
+ // first, the day itself the one solid square of the accent (`monthOf`). A date it cannot read, or none,
14
+ // is the cards' empty face under the head: 选一个日子, and where to set one. Its face says by `data-kind`
15
+ // which of left, today, since or none it shows.
12
16
 
13
17
  const WORDS = {
14
18
  zh: {
@@ -18,9 +22,11 @@ const WORDS = {
18
22
  days: (/** @type {number} */ count) => `${count}`,
19
23
  unit: () => "天",
20
24
  countdown: "倒计时",
21
- pick: "选一个日期",
22
- where: "右上角手柄 › 设置…",
23
- weekdays: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
25
+ pick: "选一个日子",
26
+ where: "在卡片右上角的 设置… 里填日期",
27
+ whereShort: "在 设置… 里填日期",
28
+ weekdays: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
29
+ initials: ["一", "二", "三", "四", "五", "六", "日"],
24
30
  date: (/** @type {number} */ year, /** @type {number} */ month, /** @type {number} */ day, /** @type {string} */ weekday) => [`${year}年${month}月${day}日`, weekday],
25
31
  },
26
32
  en: {
@@ -30,10 +36,12 @@ const WORDS = {
30
36
  days: (/** @type {number} */ count) => `${count}`,
31
37
  unit: (/** @type {number} */ count) => (count === 1 ? "day" : "days"),
32
38
  countdown: "Countdown",
33
- pick: "Pick a date",
34
- where: "The grip at the top right › Settings…",
35
- weekdays: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
36
- 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}`],
39
+ pick: "Pick a day",
40
+ where: "Set its date in Settings… at the card's top right",
41
+ whereShort: "Set its date in Settings…",
42
+ weekdays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
43
+ initials: ["M", "T", "W", "T", "F", "S", "S"],
44
+ date: (/** @type {number} */ year, /** @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}, ${year}`],
37
45
  },
38
46
  };
39
47
 
@@ -76,8 +84,10 @@ function countdownOf(written, now) {
76
84
  /**
77
85
  * What the card says, in `language`, of its `settings` (context.readJSON's, {} where none is set yet)
78
86
  * at `now`: its head (the day's name, or 倒计时), the count's label (还有, 已经过去; "" with no count), its
79
- * count (null on the day and with no date; `big`, the words standing there instead), the count's unit, and
80
- * its foot, a list of words a line breaks between and never inside (the date, its weekday).
87
+ * count (null on the day and with no date; `big`, the words standing there instead: 就是今天), the count's
88
+ * unit, its foot, a list of words a line breaks between and never inside (the date, its weekday), and,
89
+ * with no date it can read, `empty`: what the empty face says (选一个日子, where to set one on a wide card
90
+ * and on a narrow one).
81
91
  * @param {any} settings
82
92
  * @param {Date} now
83
93
  * @param {"zh" | "en"} language
@@ -88,11 +98,24 @@ function faceOf(settings, now, language) {
88
98
  const named = typeof settings?.title === "string" ? settings.title.trim() : "";
89
99
  const count = countdownOf(settings?.date, now);
90
100
  const head = named || words.countdown;
91
- if (!date || count.kind === "none") return { head, label: "", count: null, unit: "", big: words.pick, foot: [words.where] };
101
+ if (!date || count.kind === "none") return { head, label: "", count: null, unit: "", big: "", foot: [], empty: { title: words.pick, where: words.where, whereShort: words.whereShort } };
92
102
  const weekday = words.weekdays[new Date(Date.UTC(date.year, date.month - 1, date.day)).getUTCDay()];
93
103
  const foot = words.date(date.year, date.month, date.day, weekday);
94
- if (count.kind === "today") return { head, label: "", count: null, unit: "", big: words.today, foot };
95
- return { head, label: count.kind === "left" ? words.left : words.since, count: words.days(count.days), unit: words.unit(count.days), big: "", foot };
104
+ if (count.kind === "today") return { head, label: "", count: null, unit: "", big: words.today, foot, empty: null };
105
+ return { head, label: count.kind === "left" ? words.left : words.since, count: words.days(count.days), unit: words.unit(count.days), big: "", foot, empty: null };
106
+ }
107
+
108
+ /**
109
+ * The month of `date` ({ year, month, day }) as the small calendar draws it, Monday first: its weeks, each
110
+ * seven days of the month (a number) or none before its first and after its last (null).
111
+ * @param {{ year: number, month: number }} date
112
+ */
113
+ function monthOf(date) {
114
+ const first = (new Date(Date.UTC(date.year, date.month - 1, 1)).getUTCDay() + 6) % 7;
115
+ const length = new Date(Date.UTC(date.year, date.month, 0)).getUTCDate();
116
+ const cells = [...Array(first).fill(null), ...Array.from({ length }, (_, index) => index + 1)];
117
+ while (cells.length % 7) cells.push(null);
118
+ return Array.from({ length: cells.length / 7 }, (_, week) => cells.slice(week * 7, week * 7 + 7));
96
119
  }
97
120
 
98
121
  /**
@@ -109,20 +132,33 @@ function made(tag, kind) {
109
132
 
110
133
  DocKit.component({
111
134
  id: "gallery/countdown",
112
- on: ["source", "clock"],
135
+ on: ["source", "clock", "layout"],
113
136
  mount(host, context) {
114
137
  const language = languageOf(document.documentElement);
138
+ const words = WORDS[language];
115
139
  const face = made("div", "face");
140
+ const main = made("div", "main");
116
141
  const head = made("p", "head");
117
142
  const chip = made("span", "chip");
118
143
  chip.setAttribute("aria-hidden", "true");
119
- chip.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M6.5 7h11M6.5 17h11M6 20v-2a6 6 0 1 1 12 0v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zM6 4v2a6 6 0 1 0 12 0V4a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z"/></svg>';
144
+ chip.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M6.5 3.5h11M6.5 20.5h11M7.5 3.5v2.2c0 2 1.3 3.6 3.2 4.4l1.3.6 1.3-.6c1.9-.8 3.2-2.4 3.2-4.4V3.5M7.5 20.5v-2.2c0-2 1.3-3.6 3.2-4.4l1.3-.6 1.3.6c1.9.8 3.2 2.4 3.2 4.4v2.2"/></svg>';
120
145
  const named = made("span", "name");
121
146
  head.append(chip, named);
147
+ const core = made("div", "core");
122
148
  const label = made("p", "label");
123
149
  const middle = made("p", "count");
124
150
  const foot = made("p", "foot");
125
- face.append(head, label, middle, foot);
151
+ core.append(label, middle, foot);
152
+ // No date: the cards' empty face, what to do and where.
153
+ const empty = made("div", "empty");
154
+ const emptyTitle = made("p", "empty-title");
155
+ const emptyWhere = made("p", "empty-where");
156
+ empty.append(emptyTitle, emptyWhere);
157
+ main.append(head, core, empty);
158
+ // A wide card's month, beside the count: the calendar of the date, the day itself marked.
159
+ const month = made("div", "month");
160
+ month.setAttribute("aria-hidden", "true");
161
+ face.append(main, month);
126
162
  host.append(face);
127
163
  const draw = (/** @type {string} */ reason = "", /** @type {unknown} */ detail = null) => {
128
164
  if (reason === "clock" && detail !== "day") return; // a minute moves no count
@@ -131,6 +167,8 @@ DocKit.component({
131
167
  if (settings === null || typeof settings !== "object" || Array.isArray(settings)) return context.fail(new Error("its settings are no object: { \"title\": \"…\", \"date\": \"YYYY-MM-DD\" }"));
132
168
  const at = new Date();
133
169
  const now = faceOf(settings, at, language);
170
+ const layout = context.size && context.size.w >= 4 ? "wide" : "narrow";
171
+ face.dataset.layout = layout;
134
172
  face.dataset.kind = countdownOf(settings.date, at).kind;
135
173
  named.textContent = now.head;
136
174
  named.title = now.head;
@@ -140,15 +178,37 @@ DocKit.component({
140
178
  middle.textContent = now.big;
141
179
  } else {
142
180
  middle.classList.remove("gallery-countdown-words");
181
+ const number = made("span", "number");
182
+ number.textContent = now.count;
143
183
  const unit = made("span", "unit");
144
184
  unit.textContent = now.unit;
145
- middle.replaceChildren(now.count, unit);
185
+ middle.replaceChildren(number, unit);
146
186
  }
147
- foot.replaceChildren(...now.foot.flatMap((words, index) => {
148
- const piece = made("span", "piece");
149
- piece.textContent = words;
150
- return index === 0 ? [piece] : [" ", piece];
187
+ foot.replaceChildren(...now.foot.flatMap((piece, index) => {
188
+ const node = made("span", "piece");
189
+ node.textContent = piece;
190
+ return index === 0 ? [node] : [" ", node];
151
191
  }));
192
+ emptyTitle.textContent = now.empty?.title ?? "";
193
+ emptyWhere.textContent = now.empty ? (layout === "wide" ? now.empty.where : now.empty.whereShort) : "";
194
+ const date = dateOf(settings.date);
195
+ if (!date) return void month.replaceChildren();
196
+ const head = words.initials.map((initial, index) => {
197
+ const cell = made("span", "initial");
198
+ cell.classList.toggle("gallery-countdown-weekend", index >= 5);
199
+ cell.textContent = initial;
200
+ return cell;
201
+ });
202
+ const weeks = monthOf(date);
203
+ month.dataset.weeks = String(weeks.length);
204
+ month.replaceChildren(...head, ...weeks.flatMap((week) => week.map((day, index) => {
205
+ const cell = made("span", "day");
206
+ if (day === null) return cell;
207
+ cell.textContent = String(day);
208
+ cell.classList.toggle("gallery-countdown-weekend", index >= 5);
209
+ cell.classList.toggle("gallery-countdown-on", day === date.day);
210
+ return cell;
211
+ })));
152
212
  };
153
213
  draw();
154
214
  return { update: draw };
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 120"><rect width="240" height="120" rx="8" fill="#f3f3f1"/><rect x="16.5" y="12.5" width="207" height="95" rx="12" fill="#ffffff" stroke="#e7e6e3"/><rect x="30" y="24" width="14" height="14" rx="4.5" fill="#ebf2fa"/><g transform="translate(32 26) scale(.4167)" fill="none" stroke="#2e7cd1" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M6.5 7h11M6.5 17h11M6 20v-2a6 6 0 1 1 12 0v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zM6 4v2a6 6 0 1 0 12 0V4a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z"/></g><rect x="50" y="28" width="24" height="6" rx="3" fill="#3b3a37"/><rect x="30" y="49" width="16" height="5" rx="2.5" fill="#c4c2bd"/><text x="28" y="84" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="34" font-weight="600" letter-spacing="-.5" fill="#3b3a37">89</text><rect x="72" y="74" width="11" height="9" rx="2.5" fill="#c4c2bd"/><rect x="30" y="93" width="82" height="5" rx="2.5" fill="#c4c2bd"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 120"><rect width="240" height="120" rx="8" fill="#f3f3f1"/><rect x="72.5" y="12.5" width="95" height="95" rx="8" fill="#ffffff" stroke="#e6e6e3"/><rect x="82" y="22" width="10" height="10" rx="3" fill="#efefed"/><rect x="96" y="24.5" width="22" height="5" rx="2.5" fill="#37352f"/><rect x="82" y="44" width="14" height="4" rx="2" fill="#a6a5a1"/><rect x="82" y="54" width="30" height="24" rx="3" fill="#1d1d1b"/><rect x="115" y="72" width="7" height="6" rx="3" fill="#a6a5a1"/><rect x="82" y="88" width="52" height="4" rx="2" fill="#d4d3cf"/></svg>
@@ -1,130 +1,118 @@
1
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 face fills its card on a custom page (the board draws the frame), in
3
- the kit's card tokens: its head at the top (the chip, then the day's name on one line, cut with an
4
- ellipsis, its end clear of the card's grip), the count's label small and muted over the count, large
5
- (the cards' hero size), its unit small and muted after it, the two in the middle of the room between the
6
- head and the date, which is muted at the bottom. On the day itself the words stand in the accent. With
7
- no date yet, the cards' empty face: a quiet picture (a calendar) in a soft disc over a muted line, where
8
- to set one under it, in the middle of the room under the head. Light and dark. */
2
+ reaches the rest of the page. The pack's design B, in the kit's card tokens: the head (the chip, an
3
+ hourglass, and the day's name, one line cut with an ellipsis, its end clear of the card's grip); at the
4
+ bottom the count's label (还有, 已经过去) over the count, the card's hero (44px, 48px on a wide card) and
5
+ its unit, and the date under them, faint; on the day, 就是今天 in the accent's ink where the count stands.
6
+ A wide card (data-layout "wide", four cells) sets the month of the date at its right, 126px, seven
7
+ columns Monday first, the weekend fainter, the day itself the one solid square of the accent (a month of
8
+ six weeks a little closer, so that it fits the card). No date: the cards' empty face under the head.
9
+ Light and dark. */
9
10
  [data-doc-component="gallery/countdown"] {
10
- container-type: inline-size;
11
- > .gallery-countdown-face {
12
- display: flex;
13
- flex-direction: column;
14
- justify-content: flex-start;
15
- gap: 6px;
16
- box-sizing: border-box;
17
- height: 100%;
18
- min-height: 0;
19
- color: var(--gallery-text);
20
- }
21
- > .gallery-countdown-face > p { margin: 0; }
22
- > .gallery-countdown-face > .gallery-countdown-head {
11
+ font-family: var(--gallery-font);
12
+ font-size: 13px;
13
+ line-height: 1.5;
14
+ color: var(--gallery-text);
15
+ > .gallery-countdown-face { display: flex; gap: 16px; box-sizing: border-box; min-height: 0; }
16
+ > .gallery-countdown-face > .gallery-countdown-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
17
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-head {
23
18
  display: flex;
24
19
  align-items: center;
25
20
  gap: 8px;
21
+ height: 20px;
26
22
  min-width: 0;
23
+ margin: 0;
27
24
  padding-inline-end: var(--gallery-grip-room, 0px);
28
- font-size: var(--gallery-title-size);
29
- line-height: var(--gallery-title-line);
30
- font-weight: 600;
31
- color: var(--gallery-text-strong);
32
25
  }
33
- > .gallery-countdown-face > .gallery-countdown-head > .gallery-countdown-chip {
26
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-head > .gallery-countdown-chip {
34
27
  flex: none;
35
- display: inline-flex;
36
- align-items: center;
37
- justify-content: center;
28
+ display: grid;
29
+ place-items: center;
38
30
  width: var(--gallery-chip-size);
39
31
  height: var(--gallery-chip-size);
40
32
  border-radius: var(--gallery-chip-radius);
41
- background: var(--gallery-accent-soft);
42
- color: var(--gallery-accent);
33
+ background: var(--gallery-fill);
34
+ color: var(--gallery-muted);
43
35
  }
44
- > .gallery-countdown-face > .gallery-countdown-head > .gallery-countdown-chip > svg { width: var(--gallery-chip-icon); height: var(--gallery-chip-icon); }
45
- > .gallery-countdown-face > .gallery-countdown-head > .gallery-countdown-name {
36
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-head > .gallery-countdown-chip > svg { display: block; width: var(--gallery-chip-icon); height: var(--gallery-chip-icon); }
37
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-head > .gallery-countdown-name {
46
38
  min-width: 0;
47
39
  overflow: hidden;
48
40
  white-space: nowrap;
49
41
  text-overflow: ellipsis;
42
+ font-size: var(--gallery-title-size);
43
+ line-height: var(--gallery-title-line);
44
+ font-weight: 600;
45
+ color: var(--gallery-text);
50
46
  }
51
- /* The count's label over it, the two in the middle of the room between the head and the date. */
52
- > .gallery-countdown-face > .gallery-countdown-label {
53
- margin-top: auto;
54
- font-size: var(--gallery-meta-size);
55
- line-height: 16px;
56
- color: var(--doc-muted);
57
- }
58
- > .gallery-countdown-face > .gallery-countdown-label:empty { display: none; }
59
- > .gallery-countdown-face > .gallery-countdown-label:empty + .gallery-countdown-count { margin-top: auto; }
60
- > .gallery-countdown-face > .gallery-countdown-count {
61
- margin-top: -4px;
62
- font-size: var(--gallery-hero-size);
63
- line-height: 1.1;
47
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-core { margin-top: auto; }
48
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-core > p { margin: 0; }
49
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-core > .gallery-countdown-label { font-size: 12px; line-height: 16px; color: var(--gallery-muted); }
50
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-core > .gallery-countdown-label:empty { display: none; }
51
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-core > .gallery-countdown-count { display: flex; align-items: baseline; margin: 3px 0 7px; }
52
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-core > .gallery-countdown-count > .gallery-countdown-number {
53
+ font-size: 44px;
54
+ line-height: 1;
64
55
  font-weight: var(--gallery-numeral-weight);
65
56
  letter-spacing: var(--gallery-numeral-tracking);
57
+ font-variant-numeric: lining-nums;
66
58
  color: var(--gallery-text-strong);
67
- font-variant-numeric: tabular-nums;
68
- white-space: nowrap;
69
59
  }
70
- > .gallery-countdown-face > .gallery-countdown-count > .gallery-countdown-unit {
71
- margin-inline-start: var(--gallery-unit-gap);
72
- font-size: max(12px, var(--gallery-unit-size));
73
- font-weight: 500;
74
- letter-spacing: 0;
75
- color: var(--doc-muted);
76
- }
77
- /* Today, or no date yet: words where the count stands, smaller; the day itself in the accent. */
78
- > .gallery-countdown-face > .gallery-countdown-count.gallery-countdown-words {
79
- font-size: min(var(--gallery-figure-size), 13cqi);
80
- line-height: 1.2;
81
- letter-spacing: -.01em;
82
- white-space: normal;
60
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-core > .gallery-countdown-count > .gallery-countdown-unit { margin-left: 3px; font-size: var(--gallery-unit); font-weight: 500; color: var(--gallery-muted); }
61
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-core > .gallery-countdown-words {
62
+ display: block;
63
+ margin: 2px 0 6px;
64
+ font-size: 24px;
65
+ line-height: 30px;
66
+ font-weight: 600;
67
+ letter-spacing: .02em;
68
+ color: var(--gallery-accent-ink);
83
69
  }
84
- > .gallery-countdown-face[data-kind="today"] > .gallery-countdown-count { color: var(--gallery-accent); }
85
- /* No date yet: the cards' empty face (as todos' and recent's), the line and where to set it in the middle. */
86
- > .gallery-countdown-face[data-kind="none"] { justify-content: flex-start; }
87
- > .gallery-countdown-face[data-kind="none"] > .gallery-countdown-count {
70
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-core > .gallery-countdown-foot { font-size: 11.5px; line-height: 16px; color: var(--gallery-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
71
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-empty { display: none; }
72
+ > .gallery-countdown-face[data-layout="wide"] > .gallery-countdown-main > .gallery-countdown-core > .gallery-countdown-count > .gallery-countdown-number { font-size: 48px; }
73
+
74
+ /* No date: the cards' empty face, under the head. */
75
+ > .gallery-countdown-face[data-kind="none"] > .gallery-countdown-main > .gallery-countdown-core,
76
+ > .gallery-countdown-face[data-kind="none"] > .gallery-countdown-month,
77
+ > .gallery-countdown-face[data-layout="wide"][data-kind="none"] > .gallery-countdown-month { display: none; }
78
+ > .gallery-countdown-face[data-kind="none"] > .gallery-countdown-main > .gallery-countdown-empty {
79
+ flex: 1;
88
80
  display: flex;
89
81
  flex-direction: column;
90
- align-items: center;
91
- gap: 8px;
92
- margin-top: auto;
93
- font-size: 13px;
94
- line-height: 1.45;
95
- font-weight: 400;
96
- letter-spacing: 0;
97
- color: var(--doc-muted);
98
- text-align: center;
82
+ justify-content: center;
83
+ gap: 4px;
84
+ min-height: 0;
99
85
  }
100
- > .gallery-countdown-face[data-kind="none"] > .gallery-countdown-count::before {
101
- content: "";
86
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-empty > p { margin: 0; }
87
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-empty > .gallery-countdown-empty-title { font-size: 13.5px; line-height: 20px; font-weight: 600; color: var(--gallery-text); }
88
+ > .gallery-countdown-face > .gallery-countdown-main > .gallery-countdown-empty > .gallery-countdown-empty-where { font-size: 12px; line-height: 18px; color: var(--gallery-faint); }
89
+
90
+ /* The month, at a wide card's right. */
91
+ > .gallery-countdown-face > .gallery-countdown-month { display: none; }
92
+ > .gallery-countdown-face[data-layout="wide"] > .gallery-countdown-month {
93
+ display: grid;
102
94
  flex: none;
103
- width: 44px;
104
- height: 44px;
105
- margin-bottom: 2px;
106
- background: currentColor;
107
- -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='M4 7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7z'/%3E%3Cpath d='M16 3v4M8 3v4M4 11h16'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
108
- 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='M4 7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7z'/%3E%3Cpath d='M16 3v4M8 3v4M4 11h16'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
95
+ align-self: flex-end;
96
+ grid-template-columns: repeat(7, 18px);
97
+ row-gap: 2px;
98
+ width: 126px;
99
+ font-variant-numeric: tabular-nums;
109
100
  }
110
- > .gallery-countdown-face[data-kind="none"] > .gallery-countdown-foot { margin-top: 0; margin-bottom: auto; text-align: center; opacity: .8; }
111
- > .gallery-countdown-face > .gallery-countdown-foot {
112
- margin-top: auto;
113
- font-size: var(--gallery-meta-size);
114
- line-height: 1.45;
115
- color: var(--doc-muted);
101
+ > .gallery-countdown-face > .gallery-countdown-month > span {
102
+ display: grid;
103
+ place-items: center;
104
+ height: 16px;
105
+ border-radius: 5px;
106
+ font-size: 10.5px;
107
+ line-height: 1;
108
+ color: var(--gallery-muted);
116
109
  }
117
- /* The date and its weekday break between them, never inside either. */
118
- > .gallery-countdown-face > .gallery-countdown-foot > .gallery-countdown-piece { display: inline-block; }
119
- }
120
- /* On a custom page the face is the card's: as high as what the card holds inside its padding, and a
121
- container of that height too. A narrow card (two cells wide) shows the date alone, its weekday left
122
- out, which would take a second line its two rows of cells have no room for; a low card's empty face
123
- says where to set a date in its words alone, the picture over them left out. */
124
- .gallery-card > [data-doc-component="gallery/countdown"] { height: 100%; container-type: size; }
125
- @container (max-width: 180px) {
126
- [data-doc-component="gallery/countdown"] > .gallery-countdown-face:not([data-kind="none"]) > .gallery-countdown-foot > .gallery-countdown-piece ~ .gallery-countdown-piece { display: none; }
127
- }
128
- @container (max-height: 150px) {
129
- [data-doc-component="gallery/countdown"] > .gallery-countdown-face[data-kind="none"] > .gallery-countdown-count::before { display: none; }
110
+ > .gallery-countdown-face > .gallery-countdown-month > .gallery-countdown-initial { font-size: 10px; color: var(--gallery-faint); }
111
+ > .gallery-countdown-face > .gallery-countdown-month > .gallery-countdown-weekend { color: var(--gallery-faint); }
112
+ > .gallery-countdown-face > .gallery-countdown-month > .gallery-countdown-on { background: var(--gallery-accent); color: #fff; font-weight: 600; }
113
+ > .gallery-countdown-face > .gallery-countdown-month[data-weeks="6"] { row-gap: 1px; }
114
+ > .gallery-countdown-face > .gallery-countdown-month[data-weeks="6"] > span { height: 14px; }
130
115
  }
116
+ /* On a custom page the face fills the card the board frames. */
117
+ .gallery-card > [data-doc-component="gallery/countdown"] { height: 100%; }
118
+ .gallery-card > [data-doc-component="gallery/countdown"] > .gallery-countdown-face { height: 100%; }
@@ -15,8 +15,8 @@ They are kept in its data part `settings`, a `<script type="application/json">`,
15
15
 
16
16
  ## How to write it
17
17
 
18
- Put it on a custom page as a card of its board, `<section class="gallery-card" data-card-id="…" data-x data-y data-w data-h>`, holding one instance, after `gallery block add countdown`, the instance as template.html has it, then its settings as above. Sizes: 2 × 2 (the default) and 4 × 2.
18
+ Put it on a custom page as a card of its board, `<section class="gallery-card" data-card-id="…" data-x data-y data-w data-h>`, holding one instance, after `gallery block add countdown`, the instance as template.html has it, then its settings as above. Sizes: 2 × 2 (the default) and 4 × 2 (the month of the date beside the count, the day marked).
19
19
 
20
20
  ## How it looks
21
21
 
22
- The day's name at the top beside an hourglass's chip, on one line (春节; 倒计时 where it has none), under it 还有 (or 已经过去) over the count of days, large, and the date with its weekday at the bottom, muted; on the day itself 就是今天 in the accent; 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 count moves by itself at midnight (it hears the kit's clock). The script runs with the rights of the page's own scripts, as any block's does.
22
+ 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 an hourglass's chip and the day's name; at the bottom 还有 (or 已经过去) over the count of days, 44px, and the date faint under them (2027年2月6日 周六). On the day itself 就是今天 in the accent stands where the count was. A 4 × 2 card sets the month of the date at its right, Monday first, the day the one solid square of the accent. With no date it says 选一个日子 and where to set one.
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "id": "gallery/habit",
3
3
  "apiVersion": 1,
4
- "version": "1.2.0",
4
+ "version": "2.0.0",
5
5
  "name": { "zh": "习惯打卡", "en": "Habit tracker" },
6
- "description": { "zh": "每天打一次卡,显示连续了几天和最近一周,名字在卡片上直接改", "en": "A check-in a day, the streak and the last seven days; the habit's name is edited on the card" },
6
+ "description": { "zh": "每天打一次卡,显示连续了几天和这一周,名字在卡片上直接改", "en": "A check-in a day, the streak and this week; the habit's name is edited on the card" },
7
7
  "words": "xiguandaka xiguan daka habit streak checkin tracker 习惯 打卡 连续 坚持",
8
8
  "parts": {
9
9
  "habit": { "at": ":scope > script", "edit": "data" }
10
10
  },
11
11
  "runtime": { "generated": [":scope > .gallery-habit-face"] },
12
12
  "places": ["page"],
13
- "card": { "sizes": [[4, 2], [2, 2]], "resize": true }
13
+ "card": { "sizes": [[4, 2], [2, 2], [4, 4]], "resize": true }
14
14
  }