@heycys/gallery 0.1.0 → 0.1.2

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 (465) hide show
  1. package/THIRD-PARTY-NOTICES.md +51 -1
  2. package/browser/editor/components/callout/index.mjs +40 -15
  3. package/browser/editor/components/columns/page.mjs +45 -32
  4. package/browser/editor/components/details/index.mjs +2 -1
  5. package/browser/editor/components/dialog/index.mjs +2 -1
  6. package/browser/editor/components/dialog/page.mjs +0 -18
  7. package/browser/editor/components/divider/index.mjs +1 -1
  8. package/browser/editor/components/embed/index.mjs +2 -2
  9. package/browser/editor/components/figure/page.mjs +10 -1
  10. package/browser/editor/components/file/page.mjs +2 -2
  11. package/browser/editor/components/flowchart/add.mjs +7 -6
  12. package/browser/editor/components/flowchart/page.mjs +1 -1
  13. package/browser/editor/components/heading/index.mjs +2 -0
  14. package/browser/editor/components/heading/page.mjs +6 -0
  15. package/browser/editor/components/highlight/index.mjs +4 -20
  16. package/browser/editor/components/icons.mjs +13 -2
  17. package/browser/editor/components/image/crop.mjs +6 -9
  18. package/browser/editor/components/image/page.mjs +2 -2
  19. package/browser/editor/components/installed/index.mjs +82 -29
  20. package/browser/editor/components/installed/page.mjs +146 -34
  21. package/browser/editor/components/installed/served.mjs +6 -5
  22. package/browser/editor/components/instances.mjs +18 -0
  23. package/browser/editor/components/kit.mjs +3 -0
  24. package/browser/editor/components/list/page.mjs +3 -6
  25. package/browser/editor/components/media/page.mjs +44 -14
  26. package/browser/editor/components/pages.mjs +2 -2
  27. package/browser/editor/components/registry.mjs +68 -33
  28. package/browser/editor/components/section/index.mjs +2 -1
  29. package/browser/editor/components/set-apart.mjs +24 -0
  30. package/browser/editor/components/table/index.mjs +64 -5
  31. package/browser/editor/components/table/page.mjs +30 -19
  32. package/browser/editor/page/annotate/anchors.mjs +4 -3
  33. package/browser/editor/page/annotate/card.mjs +3 -6
  34. package/browser/editor/page/annotate/index.mjs +61 -34
  35. package/browser/editor/page/autosave.mjs +357 -38
  36. package/browser/editor/page/beside.mjs +5 -5
  37. package/browser/editor/page/block-menu/colors.mjs +3 -1
  38. package/browser/editor/page/block-menu/index.mjs +8 -6
  39. package/browser/editor/page/blocks.mjs +16 -7
  40. package/browser/editor/page/board/client.mjs +57 -0
  41. package/browser/editor/page/board/hint.mjs +145 -0
  42. package/browser/editor/page/board/history.mjs +119 -0
  43. package/browser/editor/page/board/index.mjs +970 -0
  44. package/browser/editor/page/board/settings.mjs +209 -0
  45. package/browser/editor/page/caret.mjs +5 -2
  46. package/browser/editor/page/changes/bar.mjs +94 -0
  47. package/browser/editor/page/changes/ghost.mjs +206 -0
  48. package/browser/editor/page/changes/gone-words.mjs +94 -0
  49. package/browser/editor/page/changes/index.mjs +447 -0
  50. package/browser/editor/page/changes/words.mjs +27 -0
  51. package/browser/editor/page/clipboard/import/colors.mjs +3 -3
  52. package/browser/editor/page/clipboard/import/html.mjs +29 -6
  53. package/browser/editor/page/clipboard/import/inline.mjs +32 -0
  54. package/browser/editor/page/clipboard/import/markdown.mjs +58 -13
  55. package/browser/editor/page/clipboard/import/read.mjs +6 -1
  56. package/browser/editor/page/clipboard/import/to-blocks.mjs +44 -12
  57. package/browser/editor/page/clipboard/import/yuque.mjs +622 -0
  58. package/browser/editor/page/clipboard/index.mjs +156 -26
  59. package/browser/editor/page/clipboard/own/blocks.mjs +25 -16
  60. package/browser/editor/page/clipboard/own/chart-keys.mjs +41 -28
  61. package/browser/editor/page/clipboard/own/describe.mjs +16 -7
  62. package/browser/editor/page/clipboard/own/export.mjs +6 -6
  63. package/browser/editor/page/clipboard/own/selection.mjs +3 -3
  64. package/browser/editor/page/clipboard/own/writers.mjs +0 -11
  65. package/browser/editor/page/columns/index.mjs +48 -46
  66. package/browser/editor/page/commit.mjs +98 -25
  67. package/browser/editor/page/conflicts.mjs +13 -33
  68. package/browser/editor/page/convert.mjs +8 -7
  69. package/browser/editor/page/core.mjs +81 -27
  70. package/browser/editor/page/custom-page.mjs +106 -0
  71. package/browser/editor/page/drag/index.mjs +40 -24
  72. package/browser/editor/page/drag/preview.mjs +9 -4
  73. package/browser/editor/page/editor.mjs +120 -28
  74. package/browser/editor/page/emoji-picker/emoji-tab.mjs +22 -13
  75. package/browser/editor/page/emoji-picker/grid.mjs +7 -5
  76. package/browser/editor/page/emoji-picker/icon-tab.mjs +4 -4
  77. package/browser/editor/page/emoji-picker/icons.mjs +0 -1
  78. package/browser/editor/page/emoji-picker/index.mjs +11 -9
  79. package/browser/editor/page/emoji-picker/styles.mjs +156 -2
  80. package/browser/editor/page/emoji-picker/support.mjs +6 -4
  81. package/browser/editor/page/emoji-picker/upload.mjs +14 -13
  82. package/browser/editor/page/fills.mjs +5 -3
  83. package/browser/editor/page/fold/index.mjs +348 -0
  84. package/browser/editor/page/fold/rule.mjs +125 -0
  85. package/browser/editor/page/folded.mjs +23 -0
  86. package/browser/editor/page/format-bar/bar.mjs +2 -1
  87. package/browser/editor/page/format-bar/index.mjs +1 -1
  88. package/browser/editor/page/geometry.mjs +8 -6
  89. package/browser/editor/page/handle/index.mjs +22 -14
  90. package/browser/editor/page/hints/index.mjs +1 -1
  91. package/browser/editor/page/history.mjs +24 -4
  92. package/browser/editor/page/insert/index.mjs +30 -17
  93. package/browser/editor/page/links/index.mjs +5 -3
  94. package/browser/editor/page/links/pages.mjs +27 -9
  95. package/browser/editor/page/long-runs.mjs +75 -0
  96. package/browser/editor/page/look.mjs +69 -6
  97. package/browser/editor/page/margin.mjs +63 -27
  98. package/browser/editor/page/media-menu/index.mjs +6 -7
  99. package/browser/editor/page/menu.mjs +86 -31
  100. package/browser/editor/page/merge.mjs +24 -0
  101. package/browser/editor/page/notices.mjs +3 -3
  102. package/browser/editor/page/offered.mjs +1 -1
  103. package/browser/editor/page/outline/folds.mjs +11 -10
  104. package/browser/editor/page/outline/index.mjs +131 -45
  105. package/browser/editor/page/outline/list.mjs +23 -11
  106. package/browser/editor/page/outline/read.mjs +1 -1
  107. package/browser/editor/page/outline/strip.mjs +7 -1
  108. package/browser/editor/page/page-objects.mjs +13 -2
  109. package/browser/editor/page/panel.mjs +9 -13
  110. package/browser/editor/page/present-links.mjs +11 -2
  111. package/browser/editor/page/resize/index.mjs +42 -29
  112. package/browser/editor/page/selection/delete.mjs +8 -6
  113. package/browser/editor/page/selection/index.mjs +10 -3
  114. package/browser/editor/page/served.mjs +14 -0
  115. package/browser/editor/page/session.mjs +101 -6
  116. package/browser/editor/page/slash-menu/index.mjs +3 -3
  117. package/browser/editor/page/table/cell-bar.mjs +4 -1
  118. package/browser/editor/page/table/cells.mjs +103 -47
  119. package/browser/editor/page/table/icons.mjs +3 -1
  120. package/browser/editor/page/table/index.mjs +40 -16
  121. package/browser/editor/page/table/pictures.mjs +299 -0
  122. package/browser/editor/page/table/views.mjs +150 -0
  123. package/browser/editor/page/table/widths.mjs +9 -4
  124. package/browser/editor/page/text-select/index.mjs +43 -14
  125. package/browser/editor/page/todo-writes.mjs +75 -0
  126. package/browser/editor/page/tooltip.mjs +1 -1
  127. package/browser/editor/page/type-grid.mjs +4 -3
  128. package/browser/editor/page/typing/code-edges.mjs +63 -17
  129. package/browser/editor/page/typing/index.mjs +65 -9
  130. package/browser/editor/page/typing/leave.mjs +1 -1
  131. package/browser/editor/page/ui.mjs +13 -0
  132. package/browser/shared/annotations.mjs +8 -10
  133. package/browser/shared/block-packs.mjs +404 -0
  134. package/browser/shared/board-places.mjs +224 -0
  135. package/browser/shared/card-size.mjs +59 -0
  136. package/browser/shared/code-folds.mjs +5 -1
  137. package/browser/shared/colors.mjs +17 -14
  138. package/browser/shared/component-catalog.mjs +345 -54
  139. package/browser/shared/component-source.mjs +37 -0
  140. package/browser/shared/components/callout.mjs +4 -2
  141. package/browser/shared/components/index.mjs +72 -9
  142. package/browser/shared/components/installed.mjs +110 -8
  143. package/browser/shared/components/page.mjs +22 -3
  144. package/browser/shared/components/state.mjs +5 -1
  145. package/browser/shared/components/table.mjs +1 -1
  146. package/browser/shared/components/text.mjs +2 -2
  147. package/browser/shared/document-look.mjs +183 -0
  148. package/browser/shared/drafts.mjs +432 -0
  149. package/browser/shared/emoji/data/LICENSE-lucide.txt +43 -0
  150. package/browser/shared/emoji/data/README.md +4 -2
  151. package/browser/shared/emoji/data/categories.json +1 -1
  152. package/browser/shared/emoji/data/keywords-en.json +1 -1
  153. package/browser/shared/emoji/data/keywords-zh.json +1 -1
  154. package/browser/shared/emoji/data/names.json +1 -1
  155. package/browser/shared/emoji/data/positions.json +1 -1
  156. package/browser/shared/emoji/data/twemoji-index.json +1 -1
  157. package/browser/shared/emoji/data/twemoji-svg.bin +0 -0
  158. package/browser/shared/emoji/data.mjs +10 -12
  159. package/browser/shared/emoji/emoji.mjs +8 -7
  160. package/browser/shared/emoji/icon-value.mjs +4 -3
  161. package/browser/shared/extension-sidebar.mjs +126 -0
  162. package/browser/shared/extensions.mjs +79 -0
  163. package/browser/shared/file-table.mjs +101 -0
  164. package/browser/shared/html-tree.mjs +11 -5
  165. package/browser/shared/i18n/en.mjs +374 -35
  166. package/browser/shared/json-layout.mjs +47 -0
  167. package/browser/shared/long-runs.mjs +39 -0
  168. package/browser/shared/net-cache.mjs +133 -0
  169. package/browser/shared/net-keys.mjs +32 -0
  170. package/browser/shared/net-policy.mjs +177 -0
  171. package/browser/shared/new-names.mjs +5 -2
  172. package/browser/shared/outline-shape.mjs +128 -0
  173. package/browser/shared/outline.mjs +458 -0
  174. package/browser/shared/pack-manifest.mjs +77 -0
  175. package/browser/shared/page-address.mjs +6 -3
  176. package/browser/shared/page-cards.mjs +308 -0
  177. package/browser/shared/page-links.mjs +69 -6
  178. package/browser/shared/pages.mjs +388 -0
  179. package/browser/shared/paths.mjs +6 -0
  180. package/browser/shared/preferences.mjs +10 -4
  181. package/browser/shared/preview-server.mjs +3 -7
  182. package/browser/shared/session.mjs +13 -5
  183. package/browser/shared/shipped-blocks.mjs +299 -0
  184. package/browser/shared/table-chart.mjs +33 -1
  185. package/browser/shared/todos.mjs +83 -0
  186. package/browser/shared/user-directory.mjs +24 -0
  187. package/browser/shared/versions.mjs +14 -0
  188. package/browser/shared/web-links.mjs +134 -0
  189. package/browser/shared/workspace-columns.mjs +120 -0
  190. package/browser/shared/workspace-look.mjs +91 -0
  191. package/browser/shared/workspace-name.mjs +154 -0
  192. package/browser/shared/workspace-query.mjs +125 -0
  193. package/browser/shared/workspace-registry.mjs +272 -0
  194. package/browser/shared/workspace.mjs +171 -20
  195. package/browser/shared/zoom.mjs +5 -5
  196. package/dist/chunk-2NRBY6AJ.mjs +2 -0
  197. package/dist/chunk-32ZUEFZ7.mjs +2 -0
  198. package/dist/chunk-35NQ4PLQ.mjs +2 -0
  199. package/dist/chunk-3KJHLHUO.mjs +2 -0
  200. package/dist/chunk-3NJACR4W.mjs +2 -0
  201. package/dist/chunk-4AV456RQ.mjs +2 -0
  202. package/dist/chunk-4OZWXZE5.mjs +5 -0
  203. package/dist/chunk-5XYHDBJ5.mjs +2 -0
  204. package/dist/chunk-5ZJA7CXT.mjs +2 -0
  205. package/dist/chunk-6A53MZYZ.mjs +2 -0
  206. package/dist/chunk-6EXH3ORZ.mjs +166 -0
  207. package/dist/chunk-6EZ7FNIK.mjs +3 -0
  208. package/dist/{chunk-UXUK4PMC.mjs → chunk-6QBHU4DF.mjs} +1 -1
  209. package/dist/{chunk-6U2SLSDN.mjs → chunk-6VTU6KEO.mjs} +1 -1
  210. package/dist/chunk-B4P2CM2J.mjs +3 -0
  211. package/dist/chunk-BPL64HGA.mjs +4 -0
  212. package/dist/chunk-BVEFGE4B.mjs +2 -0
  213. package/dist/chunk-BZ5RAF7L.mjs +2 -0
  214. package/dist/chunk-CRJEG7MT.mjs +2 -0
  215. package/dist/{chunk-B3VTYBYR.mjs → chunk-D4CKRD3V.mjs} +91 -91
  216. package/dist/chunk-D4EURAX4.mjs +4 -0
  217. package/dist/chunk-DQCE7TJY.mjs +5 -0
  218. package/dist/chunk-DR73Y2UJ.mjs +3 -0
  219. package/dist/{chunk-TMYZB6AV.mjs → chunk-EKNHM3P4.mjs} +1 -1
  220. package/dist/{chunk-DB4WKGYF.mjs → chunk-ERLAIBOA.mjs} +2 -2
  221. package/dist/chunk-EURLTOTZ.mjs +4 -0
  222. package/dist/chunk-FJYN7RTH.mjs +4 -0
  223. package/dist/chunk-FWNRPMCJ.mjs +12 -0
  224. package/dist/chunk-FWW4CSAZ.mjs +2 -0
  225. package/dist/{chunk-2B5E4CDJ.mjs → chunk-GPIWQ4X4.mjs} +1 -1
  226. package/dist/chunk-GY3FAUVM.mjs +2 -0
  227. package/dist/chunk-HLYV7RIH.mjs +2 -0
  228. package/dist/chunk-HMYTM3GT.mjs +15 -0
  229. package/dist/chunk-IA4PSIMD.mjs +2 -0
  230. package/dist/chunk-JEUK3ZO7.mjs +2 -0
  231. package/dist/chunk-JVHHHGEA.mjs +3 -0
  232. package/dist/chunk-KTKHRC6H.mjs +2 -0
  233. package/dist/chunk-L7UP52JO.mjs +2 -0
  234. package/dist/chunk-MHW7ZKOU.mjs +2 -0
  235. package/dist/chunk-N76HWBA3.mjs +10 -0
  236. package/dist/chunk-N7AZZLGT.mjs +548 -0
  237. package/dist/chunk-NAMN3RAF.mjs +2 -0
  238. package/dist/{chunk-YXAUQPVK.mjs → chunk-NFMCP2HI.mjs} +3 -3
  239. package/dist/chunk-NG375ILQ.mjs +2 -0
  240. package/dist/chunk-NVRNLK25.mjs +6 -0
  241. package/dist/chunk-NWFBE2YA.mjs +2 -0
  242. package/dist/chunk-NWR2LT5B.mjs +2 -0
  243. package/dist/chunk-OJKMINIU.mjs +20 -0
  244. package/dist/chunk-OUUP3WKT.mjs +2 -0
  245. package/dist/chunk-OW5NWPOJ.mjs +10 -0
  246. package/dist/chunk-PAREWQGB.mjs +4 -0
  247. package/dist/chunk-POQSE4C2.mjs +2 -0
  248. package/dist/chunk-PUOQ65NC.mjs +2 -0
  249. package/dist/{chunk-Z52HTUW7.mjs → chunk-PVER7LSC.mjs} +2 -2
  250. package/dist/chunk-PZDLJJTJ.mjs +3 -0
  251. package/dist/chunk-Q47PLKIJ.mjs +15 -0
  252. package/dist/chunk-Q4UEPUWF.mjs +2 -0
  253. package/dist/chunk-QKXMPUXC.mjs +2 -0
  254. package/dist/chunk-QOUEFUCH.mjs +16 -0
  255. package/dist/chunk-RFDZXFJF.mjs +13 -0
  256. package/dist/chunk-RKPWLGZ3.mjs +4 -0
  257. package/dist/chunk-RMECZA2K.mjs +2 -0
  258. package/dist/{chunk-EUX7IC5J.mjs → chunk-SQ6Y2ZMA.mjs} +2 -2
  259. package/dist/chunk-SX4LJYT6.mjs +8 -0
  260. package/dist/chunk-SXHBYZST.mjs +16 -0
  261. package/dist/chunk-TANZRINB.mjs +2 -0
  262. package/dist/chunk-TEZAWDSQ.mjs +2 -0
  263. package/dist/chunk-UBBRTJ2R.mjs +24 -0
  264. package/dist/chunk-UFNYFFKO.mjs +20 -0
  265. package/dist/chunk-UGWYKHBL.mjs +170 -0
  266. package/dist/chunk-UKSHDZZ6.mjs +2 -0
  267. package/dist/chunk-UMHUSOPJ.mjs +2 -0
  268. package/dist/chunk-UNOYVIYR.mjs +2 -0
  269. package/dist/chunk-V6RIYQZZ.mjs +4 -0
  270. package/dist/chunk-VJPFVNNW.mjs +15 -0
  271. package/dist/chunk-VS3ZMVGX.mjs +5 -0
  272. package/dist/chunk-VTKNEYT3.mjs +6 -0
  273. package/dist/chunk-VXACTLO3.mjs +3 -0
  274. package/dist/chunk-W3BGBJQW.mjs +2 -0
  275. package/dist/chunk-YI43RG4P.mjs +2 -0
  276. package/dist/chunk-YQGT4AB2.mjs +6 -0
  277. package/dist/chunk-ZB4H7ZN4.mjs +2 -0
  278. package/dist/{chunk-ACOPDCNB.mjs → chunk-ZHEHPMBK.mjs} +1 -1
  279. package/dist/chunk-ZTHICSSF.mjs +2 -0
  280. package/dist/chunk-ZUNVAXLH.mjs +2 -0
  281. package/dist/chunk-ZWPMCK7P.mjs +2 -0
  282. package/dist/cli.mjs +1 -1
  283. package/dist/server.mjs +1 -1
  284. package/dist/{chunk-EVJ3BX3M.mjs → update-fetch.mjs} +1 -1
  285. package/dist/worker.mjs +1 -1
  286. package/kit/board.css +95 -0
  287. package/kit/board.js +250 -0
  288. package/kit/charts.js +5 -71
  289. package/kit/code.js +14 -14
  290. package/kit/math.js +18 -2
  291. package/kit/report.css +500 -151
  292. package/kit/runtime.js +1720 -170
  293. package/kit/state.js +10 -1
  294. package/kit/tables.js +172 -37
  295. package/kit/ui.js +166 -27
  296. package/package.json +2 -1
  297. package/packs/gallery/card/component.json +14 -0
  298. package/packs/gallery/card/example.html +10 -0
  299. package/packs/gallery/card/preview.svg +1 -0
  300. package/packs/gallery/card/style.css +6 -0
  301. package/packs/gallery/card/template.html +6 -0
  302. package/packs/gallery/card/writing.md +14 -0
  303. package/packs/gallery/chart-card/component.json +15 -0
  304. package/packs/gallery/chart-card/example.html +14 -0
  305. package/packs/gallery/chart-card/kit.js +130 -0
  306. package/packs/gallery/chart-card/preview.svg +1 -0
  307. package/packs/gallery/chart-card/style.css +42 -0
  308. package/packs/gallery/chart-card/template.html +13 -0
  309. package/packs/gallery/chart-card/writing.md +20 -0
  310. package/packs/gallery/chart-view/component.json +20 -0
  311. package/packs/gallery/chart-view/example.html +13 -0
  312. package/packs/gallery/chart-view/kit.js +355 -0
  313. package/packs/gallery/chart-view/preview.svg +1 -0
  314. package/packs/gallery/chart-view/style.css +94 -0
  315. package/packs/gallery/chart-view/template.html +3 -0
  316. package/packs/gallery/chart-view/writing.md +22 -0
  317. package/packs/gallery/countdown/component.json +18 -0
  318. package/packs/gallery/countdown/example.html +3 -0
  319. package/packs/gallery/countdown/kit.js +156 -0
  320. package/packs/gallery/countdown/preview.svg +1 -0
  321. package/packs/gallery/countdown/style.css +130 -0
  322. package/packs/gallery/countdown/template.html +3 -0
  323. package/packs/gallery/countdown/writing.md +22 -0
  324. package/packs/gallery/habit/component.json +14 -0
  325. package/packs/gallery/habit/example.html +3 -0
  326. package/packs/gallery/habit/kit.js +295 -0
  327. package/packs/gallery/habit/preview.svg +1 -0
  328. package/packs/gallery/habit/style.css +246 -0
  329. package/packs/gallery/habit/template.html +3 -0
  330. package/packs/gallery/habit/writing.md +21 -0
  331. package/packs/gallery/heatmap/component.json +18 -0
  332. package/packs/gallery/heatmap/example.html +3 -0
  333. package/packs/gallery/heatmap/kit.js +351 -0
  334. package/packs/gallery/heatmap/preview.svg +1 -0
  335. package/packs/gallery/heatmap/style.css +201 -0
  336. package/packs/gallery/heatmap/template.html +3 -0
  337. package/packs/gallery/heatmap/writing.md +21 -0
  338. package/packs/gallery/kanban/component.json +18 -0
  339. package/packs/gallery/kanban/example.html +12 -0
  340. package/packs/gallery/kanban/kit.js +540 -0
  341. package/packs/gallery/kanban/preview.svg +1 -0
  342. package/packs/gallery/kanban/style.css +212 -0
  343. package/packs/gallery/kanban/template.html +3 -0
  344. package/packs/gallery/kanban/writing.md +20 -0
  345. package/packs/gallery/metric/component.json +22 -0
  346. package/packs/gallery/metric/example.html +15 -0
  347. package/packs/gallery/metric/kit.js +248 -0
  348. package/packs/gallery/metric/preview.svg +1 -0
  349. package/packs/gallery/metric/style.css +92 -0
  350. package/packs/gallery/metric/template.html +3 -0
  351. package/packs/gallery/metric/writing.md +23 -0
  352. package/packs/gallery/note/component.json +14 -0
  353. package/packs/gallery/note/example.html +3 -0
  354. package/packs/gallery/note/kit.js +102 -0
  355. package/packs/gallery/note/preview.svg +1 -0
  356. package/packs/gallery/note/style.css +76 -0
  357. package/packs/gallery/note/template.html +3 -0
  358. package/packs/gallery/note/writing.md +18 -0
  359. package/packs/gallery/pack.json +8 -0
  360. package/packs/gallery/recent/component.json +13 -0
  361. package/packs/gallery/recent/example.html +1 -0
  362. package/packs/gallery/recent/kit.js +238 -0
  363. package/packs/gallery/recent/preview.svg +1 -0
  364. package/packs/gallery/recent/style.css +158 -0
  365. package/packs/gallery/recent/template.html +1 -0
  366. package/packs/gallery/recent/writing.md +15 -0
  367. package/packs/gallery/static/component.json +13 -0
  368. package/packs/gallery/static/example.html +11 -0
  369. package/packs/gallery/static/preview.svg +1 -0
  370. package/packs/gallery/static/style.css +138 -0
  371. package/packs/gallery/static/template.html +1 -0
  372. package/packs/gallery/static/writing.md +18 -0
  373. package/packs/gallery/stats/component.json +13 -0
  374. package/packs/gallery/stats/example.html +1 -0
  375. package/packs/gallery/stats/kit.js +166 -0
  376. package/packs/gallery/stats/preview.svg +1 -0
  377. package/packs/gallery/stats/style.css +151 -0
  378. package/packs/gallery/stats/template.html +1 -0
  379. package/packs/gallery/stats/writing.md +11 -0
  380. package/packs/gallery/today/component.json +12 -0
  381. package/packs/gallery/today/example.html +1 -0
  382. package/packs/gallery/today/kit.js +185 -0
  383. package/packs/gallery/today/preview.svg +1 -0
  384. package/packs/gallery/today/style.css +120 -0
  385. package/packs/gallery/today/template.html +1 -0
  386. package/packs/gallery/today/writing.md +14 -0
  387. package/packs/gallery/todos/component.json +19 -0
  388. package/packs/gallery/todos/example.html +3 -0
  389. package/packs/gallery/todos/kit.js +342 -0
  390. package/packs/gallery/todos/preview.svg +1 -0
  391. package/packs/gallery/todos/style.css +267 -0
  392. package/packs/gallery/todos/template.html +3 -0
  393. package/packs/gallery/todos/writing.md +30 -0
  394. package/packs/gallery/weather/component.json +19 -0
  395. package/packs/gallery/weather/example.html +3 -0
  396. package/packs/gallery/weather/kit.js +312 -0
  397. package/packs/gallery/weather/preview.svg +1 -0
  398. package/packs/gallery/weather/style.css +258 -0
  399. package/packs/gallery/weather/template.html +3 -0
  400. package/packs/gallery/weather/writing.md +26 -0
  401. package/packs/gallery-soft/pack.json +8 -0
  402. package/release.json +13 -11
  403. package/sdk/doc-kit.d.ts +404 -7
  404. package/sdk/doc-state.d.ts +2 -0
  405. package/skill/SKILL.md +71 -26
  406. package/skill/references/block-script.md +140 -0
  407. package/skill/references/building-blocks.md +257 -0
  408. package/skill/references/example-report.html +1 -1
  409. package/skill/references/extensions.md +59 -0
  410. package/skill/references/pages-and-data.md +221 -0
  411. package/skill/references/writing-html.md +9 -7
  412. package/skill/sdk/doc-kit.d.ts +404 -7
  413. package/skill/sdk/doc-state.d.ts +2 -0
  414. package/web/assets/index-BK2e_07w.js +13 -0
  415. package/web/assets/index-CWFI83mF.css +1 -0
  416. package/web/index.html +2 -2
  417. package/browser/editor/components/callout/page.mjs +0 -13
  418. package/dist/chunk-2PBALTR3.mjs +0 -57
  419. package/dist/chunk-3LA3EMDE.mjs +0 -15
  420. package/dist/chunk-5FRMCDPY.mjs +0 -16
  421. package/dist/chunk-5LEK2CBS.mjs +0 -2
  422. package/dist/chunk-5OFN5AHC.mjs +0 -2
  423. package/dist/chunk-5SIYS5HN.mjs +0 -2
  424. package/dist/chunk-5TEK3RAD.mjs +0 -2
  425. package/dist/chunk-6CYG3Z4V.mjs +0 -2
  426. package/dist/chunk-7GHT2UCA.mjs +0 -15
  427. package/dist/chunk-7QQBR7PB.mjs +0 -2
  428. package/dist/chunk-ATCJYAR4.mjs +0 -2
  429. package/dist/chunk-C7HWOBIF.mjs +0 -2
  430. package/dist/chunk-E7VYDG2X.mjs +0 -2
  431. package/dist/chunk-EZY3WC6Z.mjs +0 -15
  432. package/dist/chunk-FQGQH4KM.mjs +0 -2
  433. package/dist/chunk-G7TOXONE.mjs +0 -6
  434. package/dist/chunk-GPF4YWWB.mjs +0 -9
  435. package/dist/chunk-GYQV7Y4J.mjs +0 -120
  436. package/dist/chunk-HMHK3EQ6.mjs +0 -2
  437. package/dist/chunk-HQQMJCQJ.mjs +0 -10
  438. package/dist/chunk-IERUOGC3.mjs +0 -6
  439. package/dist/chunk-ITNLYXXV.mjs +0 -3
  440. package/dist/chunk-L4DVONOG.mjs +0 -2
  441. package/dist/chunk-LAE5NQ4B.mjs +0 -2
  442. package/dist/chunk-LC7YNQFG.mjs +0 -2
  443. package/dist/chunk-LHTFLRB6.mjs +0 -4
  444. package/dist/chunk-NFIBI4IP.mjs +0 -26
  445. package/dist/chunk-NSKUTQ5J.mjs +0 -5
  446. package/dist/chunk-O52JMOCZ.mjs +0 -2
  447. package/dist/chunk-P2CAZPDP.mjs +0 -3
  448. package/dist/chunk-QMQUXTU4.mjs +0 -12
  449. package/dist/chunk-QVWVFC5K.mjs +0 -6
  450. package/dist/chunk-QYKCJ7FG.mjs +0 -8
  451. package/dist/chunk-QZY6Q64C.mjs +0 -2
  452. package/dist/chunk-TDQP3DKQ.mjs +0 -10
  453. package/dist/chunk-TX6JH7TR.mjs +0 -2
  454. package/dist/chunk-UNUEWH4S.mjs +0 -2
  455. package/dist/chunk-V4CPWKMZ.mjs +0 -2
  456. package/dist/chunk-VACRB2NE.mjs +0 -3
  457. package/dist/chunk-W63L7367.mjs +0 -7
  458. package/dist/chunk-W7CXPCRV.mjs +0 -6
  459. package/dist/chunk-XINNG4F2.mjs +0 -4
  460. package/dist/chunk-YL2DPWVS.mjs +0 -4
  461. package/dist/chunk-YZ5Z6H4W.mjs +0 -4
  462. package/dist/chunk-ZBIM6ARY.mjs +0 -216
  463. package/skill/references/building-components.md +0 -327
  464. package/web/assets/index-B6Ai3wsa.js +0 -13
  465. package/web/assets/index-SYPC3EZy.css +0 -1
@@ -0,0 +1,158 @@
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 (the chip and 最近编辑, how many were edited today its quiet meta at the
4
+ end, clear of the card's grip), then the
5
+ documents, as many whole rows as fit (the script sets the list's height; they scroll inside it), a row each as the sidebar draws one (its icon, its title, and
6
+ when it was edited at its end, muted), a hover fill a press away from opening it; where more are below
7
+ what it shows, a muted line under the list says how many (the script's); none, the cards' empty face (a
8
+ page in a soft disc over a muted line). Light and dark. */
9
+ [data-doc-component="gallery/recent"] {
10
+ height: 16em;
11
+ > .gallery-recent-face {
12
+ display: flex;
13
+ flex-direction: column;
14
+ gap: var(--gallery-face-gap);
15
+ box-sizing: border-box;
16
+ height: 100%;
17
+ min-height: 0;
18
+ color: var(--gallery-text);
19
+ font-size: 14px;
20
+ line-height: 1.45;
21
+ }
22
+ > .gallery-recent-face > .gallery-recent-head {
23
+ display: flex;
24
+ align-items: center;
25
+ gap: 8px;
26
+ flex: none;
27
+ min-width: 0;
28
+ padding-inline-end: var(--gallery-grip-room, 0px);
29
+ }
30
+ > .gallery-recent-face > .gallery-recent-head > .gallery-recent-chip {
31
+ flex: none;
32
+ display: inline-flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ width: var(--gallery-chip-size);
36
+ height: var(--gallery-chip-size);
37
+ border-radius: var(--gallery-chip-radius);
38
+ background: var(--gallery-accent-soft);
39
+ color: var(--gallery-accent);
40
+ }
41
+ > .gallery-recent-face > .gallery-recent-head > .gallery-recent-chip > svg { width: var(--gallery-chip-icon); height: var(--gallery-chip-icon); }
42
+ > .gallery-recent-face > .gallery-recent-head > .gallery-recent-title {
43
+ flex: 1 1 auto;
44
+ min-width: 0;
45
+ overflow: hidden;
46
+ white-space: nowrap;
47
+ text-overflow: ellipsis;
48
+ font-size: var(--gallery-title-size);
49
+ line-height: var(--gallery-title-line);
50
+ font-weight: 600;
51
+ color: var(--gallery-text-strong);
52
+ }
53
+ > .gallery-recent-face > .gallery-recent-head > .gallery-recent-meta { flex: none; font-size: var(--gallery-meta-size); color: var(--doc-muted); white-space: nowrap; font-variant-numeric: tabular-nums; margin-inline-end: calc(-1 * var(--gallery-grip-room, 0px)); opacity: calc(1 - var(--gallery-grip-shown, 0)); transition: opacity .12s ease-out; }
54
+ > .gallery-recent-face > .gallery-recent-list {
55
+ flex: 1 1 auto;
56
+ min-height: 0;
57
+ margin: -2px -6px 0;
58
+ padding: 0;
59
+ list-style: none;
60
+ position: relative;
61
+ overflow-y: auto;
62
+ overscroll-behavior: contain;
63
+ scrollbar-width: thin;
64
+ }
65
+ > .gallery-recent-face > .gallery-recent-list > .gallery-recent-item > .gallery-recent-document {
66
+ display: flex;
67
+ align-items: center;
68
+ gap: 10px;
69
+ box-sizing: border-box;
70
+ width: 100%;
71
+ margin: 0;
72
+ padding: 6px;
73
+ border: 0;
74
+ border-radius: 6px;
75
+ background: transparent;
76
+ font: inherit;
77
+ color: inherit;
78
+ text-align: start;
79
+ cursor: pointer;
80
+ }
81
+ > .gallery-recent-face > .gallery-recent-list > .gallery-recent-item > .gallery-recent-document:hover { background: var(--doc-hover); }
82
+ > .gallery-recent-face > .gallery-recent-list > .gallery-recent-item > .gallery-recent-document > .gallery-recent-icon {
83
+ flex: none;
84
+ display: inline-flex;
85
+ align-items: center;
86
+ justify-content: center;
87
+ width: 18px;
88
+ height: 18px;
89
+ color: var(--doc-muted);
90
+ }
91
+ /* A document with no icon: a page, drawn as the sidebar's (a folded corner), in the muted color. */
92
+ > .gallery-recent-face > .gallery-recent-list > .gallery-recent-item > .gallery-recent-document > .gallery-recent-icon:empty:not(.gallery-recent-glyph)::before {
93
+ content: "";
94
+ display: block;
95
+ width: 13px;
96
+ height: 16px;
97
+ background: currentColor;
98
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 16'%3E%3Cpath d='M2 .75h6.2l4.05 4.05V14A1.25 1.25 0 0 1 11 15.25H2A1.25 1.25 0 0 1 .75 14V2A1.25 1.25 0 0 1 2 .75z M8 1v3.5a.75.75 0 0 0 .75.75H12' fill='none' stroke='black' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
99
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 16'%3E%3Cpath d='M2 .75h6.2l4.05 4.05V14A1.25 1.25 0 0 1 11 15.25H2A1.25 1.25 0 0 1 .75 14V2A1.25 1.25 0 0 1 2 .75z M8 1v3.5a.75.75 0 0 0 .75.75H12' fill='none' stroke='black' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
100
+ }
101
+ > .gallery-recent-face > .gallery-recent-list > .gallery-recent-item > .gallery-recent-document > .gallery-recent-glyph {
102
+ background: currentColor;
103
+ -webkit-mask: var(--gallery-recent-icon) center / 16px no-repeat;
104
+ mask: var(--gallery-recent-icon) center / 16px no-repeat;
105
+ }
106
+ > .gallery-recent-face > .gallery-recent-list > .gallery-recent-item > .gallery-recent-document > .gallery-recent-picture > img { display: block; width: 16px; height: 16px; object-fit: contain; border-radius: 3px; }
107
+ > .gallery-recent-face > .gallery-recent-list > .gallery-recent-item > .gallery-recent-document > .gallery-recent-name {
108
+ flex: 1 1 auto;
109
+ min-width: 0;
110
+ overflow: hidden;
111
+ white-space: nowrap;
112
+ text-overflow: ellipsis;
113
+ }
114
+ > .gallery-recent-face > .gallery-recent-list > .gallery-recent-item > .gallery-recent-document > .gallery-recent-when { flex: none; font-size: var(--gallery-meta-size); color: var(--doc-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
115
+ /* What it says where it lists nothing: in the middle of what the card has left, muted, a quiet
116
+ picture of a page over it. */
117
+ > .gallery-recent-face > .gallery-recent-line {
118
+ flex: 1 1 auto;
119
+ display: flex;
120
+ flex-direction: column;
121
+ align-items: center;
122
+ justify-content: center;
123
+ gap: 8px;
124
+ margin: 0;
125
+ padding: 8px 12px;
126
+ font-size: 13px;
127
+ color: var(--doc-muted);
128
+ text-align: center;
129
+ }
130
+ > .gallery-recent-face > .gallery-recent-line::before {
131
+ content: "";
132
+ flex: none;
133
+ width: 44px;
134
+ height: 44px;
135
+ margin-bottom: 2px;
136
+ background: currentColor;
137
+ -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='M14 3v4a1 1 0 0 0 1 1h4'/%3E%3Cpath d='M17 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
138
+ 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='M14 3v4a1 1 0 0 0 1 1h4'/%3E%3Cpath d='M17 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
139
+ }
140
+ > .gallery-recent-face > .gallery-recent-line[hidden] { display: none; }
141
+ /* How many more are below what the list shows. */
142
+ > .gallery-recent-face > .gallery-recent-more {
143
+ flex: none;
144
+ margin: -2px 0 0;
145
+ font-size: var(--gallery-meta-size);
146
+ line-height: 16px;
147
+ color: var(--doc-muted);
148
+ }
149
+ > .gallery-recent-face > .gallery-recent-more[hidden] { display: none; }
150
+ }
151
+ /* On a custom page the face is the card's: as high as what the card holds inside its padding, and a
152
+ container of that height, so that a low card (two rows of cells) says it lists nothing in its words
153
+ alone, the picture over them left out (it would not fit under the head). */
154
+ .gallery-card > [data-doc-component="gallery/recent"] { height: 100%; container-type: size; }
155
+ @container (max-height: 150px) {
156
+ [data-doc-component="gallery/recent"] > .gallery-recent-face > .gallery-recent-line { padding-block: 0; }
157
+ [data-doc-component="gallery/recent"] > .gallery-recent-face > .gallery-recent-line::before { display: none; }
158
+ }
@@ -0,0 +1 @@
1
+ <div data-doc-component="gallery/recent"></div>
@@ -0,0 +1,15 @@
1
+ # 最近编辑 (gallery/recent)
2
+
3
+ A card for a custom page (its places are `page`, its needs `workspace`): the documents of the workspace edited last, the last first, each with its page icon, its title and when it was edited (刚刚, 5 分钟前, 昨天, 11月2日). Use it on the home page, for the user to go back to what they were working on.
4
+
5
+ ## How to write it
6
+
7
+ 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 recent`: the instance is empty, `<div data-doc-component="gallery/recent"></div>`, everything on it drawn by its script. It has no settings and holds no data: there is nothing to fill in and nothing it writes. Sizes: 4 × 5 (the default), 4 × 2, 4 × 4 and 4 × 6; the list scrolls inside the card.
8
+
9
+ ## What the user does
10
+
11
+ Clicks a document: it opens. The list follows by itself: a document written, renamed or given another icon, made or taken away shows at once, and the times move on each minute.
12
+
13
+ ## How it looks
14
+
15
+ 最近编辑 beside a clock's chip on the top line, how many were edited today at its end (今天 3 篇), then a row a document as the sidebar draws one, its time muted at its end, as many whole rows as the card holds, a muted line under them saying how many more are below (还有 3 篇); 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. With no document it says 还没有文档. In an exported file, which has no workspace to read, it says the list shows when the page is opened in Gallery. The script runs with the rights of the page's own scripts, as any block's does.
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "gallery/static",
3
+ "apiVersion": 1,
4
+ "version": "1.2.0",
5
+ "name": { "zh": "静态卡片", "en": "Static card" },
6
+ "description": { "zh": "放一段任意的 HTML,只展示,不能在页面上改", "en": "Any HTML, shown as it is: nothing on it changes in the page" },
7
+ "words": "jingtaikapian jingtai kapian static html card 静态 卡片 展示 内容",
8
+ "parts": {
9
+ "content": { "at": ":scope > div", "edit": "none" }
10
+ },
11
+ "places": ["page"],
12
+ "card": { "sizes": [[4, 2], [2, 1], [2, 2], [4, 1], [4, 3], [4, 4], [6, 2], [6, 4], [8, 4], [12, 2], [12, 4]], "min": { "w": 1, "h": 1 }, "max": { "w": 12, "h": 24 }, "resize": true }
13
+ }
@@ -0,0 +1,11 @@
1
+ <div data-doc-component="gallery/static">
2
+ <div>
3
+ <h3>这周的重点</h3>
4
+ <ul>
5
+ <li>周三前定下发布日期</li>
6
+ <li>和设计一起过一遍首页</li>
7
+ <li>读完《深度工作》第三章</li>
8
+ </ul>
9
+ <p><a href="https://example.com/plan">完整的计划</a> · <small>11 月 7 日更新</small></p>
10
+ </div>
11
+ </div>
@@ -0,0 +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="26" width="72" height="8" rx="4" fill="#3b3a37"/><circle cx="33" cy="52" r="2" fill="#8f8d88"/><rect x="40" y="49.5" width="120" height="6" rx="3" fill="#7b7a76"/><circle cx="33" cy="66" r="2" fill="#8f8d88"/><rect x="40" y="63.5" width="96" height="6" rx="3" fill="#7b7a76"/><circle cx="33" cy="80" r="2" fill="#8f8d88"/><rect x="40" y="77.5" width="136" height="6" rx="3" fill="#7b7a76"/><rect x="30" y="92" width="46" height="5" rx="2.5" fill="#387dc9"/><rect x="82" y="92" width="40" height="5" rx="2.5" fill="#c4c2bd"/></svg>
@@ -0,0 +1,138 @@
1
+ /* The static card has no script: what its content holds, any HTML, is what a reader sees. It gives that
2
+ HTML a plain reading look (headings, paragraphs, lists, links, a table, a picture no wider than the
3
+ card). Each of those rules is written in an @scope of the instance with :where(), so that it weighs
4
+ nothing: the page's own <style> and an inline style always win over it. It sets no color of its own
5
+ but the links' (the kit's link color): its words are the color they stand in, inherited (the page's
6
+ text, which follows the theme, or a color the page gives the card or a wrapper of the content), and
7
+ what is muted (small words, a quote, an empty card's words) or drawn as a line (a table's, a rule's, a
8
+ quote's) is a share of that color (color-mix with currentColor, the shares of the kit's own muted text
9
+ and lines), so that light words on a dark fill a page writes stay light in every heading and line.
10
+ Its first line keeps its end clear of the card's grip, and only its first: a float as wide and as high as
11
+ the grip's corner (--gallery-grip-room, the kit's card tokens) stands at the top right of the instance
12
+ on a card, before its content, so that the words of the first line or two go round it and every line
13
+ after has the card's whole width; its text wraps so that no line is left with a word or a character
14
+ alone (text-wrap: pretty). A heading the content starts with, where more follows it, is drawn as the
15
+ cards' head row (the kit's card tokens): the title's size and weight, a chip before it (the cards' tinted
16
+ square, the accent's, with lines of text in it: the one color it gives besides the links'), the face's gap
17
+ under it; a heading alone (a card that names a group of cards) stays a heading. Every selector stands in
18
+ the instance: nothing here reaches the rest of the page. A card with nothing in its content (a new one,
19
+ from a menu) says so, in the page's language, until an Agent writes it: the cards' empty face, a short
20
+ line over a muted one saying what to do. */
21
+ [data-doc-component="gallery/static"] > div {
22
+ font-size: 14px;
23
+ line-height: 1.6;
24
+ overflow-wrap: break-word;
25
+ text-wrap: pretty;
26
+ }
27
+ /* The grip's corner, on a card: a float the content's first lines go round. */
28
+ .gallery-card > [data-doc-component="gallery/static"]::before {
29
+ content: "";
30
+ float: inline-end;
31
+ width: var(--gallery-grip-room, 0px);
32
+ height: var(--gallery-grip-room, 0px);
33
+ }
34
+ @scope ([data-doc-component="gallery/static"]) {
35
+ :where(h1, h2, h3, h4, h5, h6) {
36
+ margin: 12px 0 6px;
37
+ font-size: 15px;
38
+ line-height: 1.4;
39
+ font-weight: 600;
40
+ }
41
+ :where(h1, h2) { font-size: 18px; }
42
+ :where(h3) { font-size: 16px; }
43
+ :where(p, ul, ol, dl, blockquote, table, figure, pre) { margin: 0 0 8px; }
44
+ :where(ul, ol) { padding-inline-start: 1.5em; }
45
+ :where(li + li) { margin-top: 2px; }
46
+ :where(a) { color: var(--doc-link); text-decoration: none; }
47
+ :where(a:hover) { text-decoration: underline; }
48
+ :where(img, svg, video) { max-width: 100%; }
49
+ :where(img, video) { height: auto; }
50
+ :where(table) { border-collapse: collapse; }
51
+ :where(th, td) { padding: 4px 8px; border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent); text-align: start; vertical-align: top; }
52
+ :where(th) { font-weight: 600; }
53
+ :where(hr) { margin: 12px 0; border: 0; border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent); }
54
+ :where(code) { padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, currentColor 6%, transparent); font-family: var(--doc-mono); font-size: .9em; }
55
+ /* A quote's line is a share of its own muted color: 18% of 65%, about the 12% of the other lines. */
56
+ :where(blockquote) { padding-inline-start: 12px; border-inline-start: 3px solid color-mix(in srgb, currentColor 18%, transparent); color: color-mix(in srgb, currentColor 65%, transparent); }
57
+ :where(small) { color: color-mix(in srgb, currentColor 65%, transparent); }
58
+ :scope > div > :where(:first-child) { margin-top: 0; }
59
+ :scope > div > :where(:last-child) { margin-bottom: 0; }
60
+ /* The heading it starts with, where more follows: the cards' head row, a chip before it. */
61
+ :scope > div > :where(h1, h2, h3, h4, h5, h6):where(:first-child:not(:last-child)) {
62
+ position: relative;
63
+ display: flex;
64
+ align-items: center;
65
+ gap: 8px;
66
+ min-height: var(--gallery-chip-size);
67
+ margin: 0 0 var(--gallery-face-gap);
68
+ font-size: var(--gallery-title-size);
69
+ line-height: var(--gallery-title-line);
70
+ font-weight: 600;
71
+ }
72
+ :scope > div > :where(h1, h2, h3, h4, h5, h6):where(:first-child:not(:last-child))::before {
73
+ content: "";
74
+ flex: none;
75
+ width: var(--gallery-chip-size);
76
+ height: var(--gallery-chip-size);
77
+ border-radius: var(--gallery-chip-radius);
78
+ background: var(--gallery-accent-soft);
79
+ }
80
+ :scope > div > :where(h1, h2, h3, h4, h5, h6):where(:first-child:not(:last-child))::after {
81
+ content: "";
82
+ position: absolute;
83
+ top: 50%;
84
+ left: calc((var(--gallery-chip-size) - var(--gallery-chip-icon)) / 2);
85
+ width: var(--gallery-chip-icon);
86
+ height: var(--gallery-chip-icon);
87
+ margin-top: calc(var(--gallery-chip-icon) / -2);
88
+ background: var(--gallery-accent);
89
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 6.5h15M4.5 12h10M4.5 17.5h12.5'/%3E%3C/svg%3E") center / contain no-repeat;
90
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 6.5h15M4.5 12h10M4.5 17.5h12.5'/%3E%3C/svg%3E") center / contain no-repeat;
91
+ }
92
+ }
93
+ /* Nothing in it: the cards' empty face, in the middle of the card, a share of its color as all else of
94
+ it: a soft disc with sparkles in it (the instance's ::before, one mask, where the grip's float stands on
95
+ a card with content, as nothing runs round it here), then a short line (还没有内容) over what to do, muted
96
+ (the content's ::before and ::after), each line whole. */
97
+ [data-doc-component="gallery/static"]:has(> div:empty) {
98
+ display: flex;
99
+ flex-direction: column;
100
+ align-items: center;
101
+ justify-content: center;
102
+ gap: 10px;
103
+ box-sizing: border-box;
104
+ }
105
+ .gallery-card > [data-doc-component="gallery/static"]:has(> div:empty) { height: 100%; }
106
+ [data-doc-component="gallery/static"] > div:empty {
107
+ display: flex;
108
+ flex-direction: column;
109
+ align-items: center;
110
+ gap: 2px;
111
+ box-sizing: border-box;
112
+ padding: 0 12px;
113
+ font-size: 13px;
114
+ line-height: 1.45;
115
+ text-align: center;
116
+ }
117
+ [data-doc-component="gallery/static"]:has(> div:empty)::before,
118
+ .gallery-card > [data-doc-component="gallery/static"]:has(> div:empty)::before {
119
+ content: "";
120
+ float: none;
121
+ flex: none;
122
+ width: 44px;
123
+ height: 44px;
124
+ background: color-mix(in srgb, currentColor 55%, transparent);
125
+ -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='M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2-2a2 2 0 0 1-2-2a2 2 0 0 1-2 2zm0-12a2 2 0 0 1 2 2a2 2 0 0 1 2-2a2 2 0 0 1-2-2a2 2 0 0 1-2 2zm-7 12a6 6 0 0 1 6-6a6 6 0 0 1-6-6a6 6 0 0 1-6 6a6 6 0 0 1 6 6z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
126
+ 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='M16 18a2 2 0 0 1 2 2a2 2 0 0 1 2-2a2 2 0 0 1-2-2a2 2 0 0 1-2 2zm0-12a2 2 0 0 1 2 2a2 2 0 0 1 2-2a2 2 0 0 1-2-2a2 2 0 0 1-2 2zm-7 12a6 6 0 0 1 6-6a6 6 0 0 1-6-6a6 6 0 0 1-6 6a6 6 0 0 1 6 6z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
127
+ }
128
+ [data-doc-component="gallery/static"] > div:empty::before { content: "还没有内容"; font-size: 14px; }
129
+ [data-doc-component="gallery/static"] > div:empty::after {
130
+ content: "跟 Agent 说要在这里放什么";
131
+ color: color-mix(in srgb, currentColor 65%, transparent);
132
+ }
133
+ :root[data-ge-language="en"] [data-doc-component="gallery/static"] > div:empty::before,
134
+ :root:not([data-ge-language])[lang|="en" i] [data-doc-component="gallery/static"] > div:empty::before { content: "Nothing here yet"; }
135
+ :root[data-ge-language="en"] [data-doc-component="gallery/static"] > div:empty::after,
136
+ :root:not([data-ge-language])[lang|="en" i] [data-doc-component="gallery/static"] > div:empty::after {
137
+ content: "Tell your Agent what this card should show";
138
+ }
@@ -0,0 +1 @@
1
+ <div data-doc-component="gallery/static"><div></div></div>
@@ -0,0 +1,18 @@
1
+ # 静态卡片 (gallery/static)
2
+
3
+ A card that shows any HTML you write, as it is: nothing on it changes in the page, and it has no script. Use it on a custom page for whatever only shows (a heading for a group of cards, links the user opens often, a short list, a picture, a table of a few rows); make a block of your own only where the card needs behavior or data that changes. Its places are `page` alone: a document already has a block for everything that only shows, and you write its HTML as it is there (writing-html.md), so no document's menu offers it.
4
+
5
+ ## How to write it
6
+
7
+ 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 static`, and write the HTML in the instance's one `<div>`, as example.html does:
8
+
9
+ - the content, the `div` right inside the instance (its part `content`, edited as `none`): any HTML, headings, paragraphs, lists, links, a table, a picture. No `<script>`, no form fields, no `on…` attributes: the card only shows.
10
+ - a picture: a file of the page's `assets/` (`pages/<slug>/assets/`), written `assets/<file>` (a name of letters, digits, dots, dashes and underscores, right in that folder), which the server serves at `/pages/<slug>/assets/<file>`: put the file there first (`gallery page check` says a picture whose file is not there), and never `cover.png` alone, which nothing serves. A small SVG or PNG may be a `data:` address in the `<img>` itself.
11
+ - the look: the card gives it a plain one (14px text, headings a little larger, but a heading the content starts with, where more follows it, drawn as the cards' head row: the title's size, a chip of lines before it, so that the card sits among Gallery's own; a heading alone stays a heading, links in the kit's link color, tables with lines between rows, pictures no wider than the card) that weighs nothing, so that a page's own `<style>` or a `style` attribute changes any of it. It sets no color but the links' and that head chip's: its words are the color they stand in, the page's text or the color your page gives the card (`.gallery-card[data-card-id="…"] { background: …; color: … }`) or a wrapper of the content (`style="color: …"`), every heading in it too, and its small words, quotes and lines a share of that color. Write colors of your own for both themes (`:root[data-doc-effective-theme="dark"]` on a custom page), a link's too where its fill is dark.
12
+ - Size: any whole number of cells, 1 to 12 wide and 1 to 24 high, 4 × 2 by default: write `data-w` and `data-h` to fit what you wrote (`gallery page add static --w <w> --h <h>` does too). The user changes it by dragging the card's lower right corner, or from the 大小 menu of the grip at the card's top right, which lists the common sizes. The card does not grow with what it holds: what does not fit scrolls inside it, so give it the height it needs.
13
+
14
+ An empty one (`<div></div>`, what a menu adds) says that it has nothing yet (还没有内容, 跟 Agent 说要在这里放什么), so that the user asks you for it.
15
+
16
+ ## How it looks
17
+
18
+ What you wrote, in the board's card frame on a page. The user changes it only by asking you: to change it, write the HTML in `page.html` again, that card alone, its `data-card-id` and place kept.
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "gallery/stats",
3
+ "apiVersion": 1,
4
+ "version": "1.2.0",
5
+ "name": { "zh": "工作区统计", "en": "Workspace numbers" },
6
+ "description": { "zh": "文档数、待办完成了几项、总字数、本周编辑了几篇", "en": "How many documents, to-dos done, words in all, documents edited this week" },
7
+ "words": "gongzuoqutongji tongji shuzi stats statistics numbers count words 统计 工作区 字数 文档数 待办",
8
+ "parts": {},
9
+ "runtime": { "generated": [":scope > .gallery-stats-face"] },
10
+ "places": ["page"],
11
+ "card": { "sizes": [[4, 2], [8, 2]], "resize": true },
12
+ "needs": ["workspace"]
13
+ }
@@ -0,0 +1 @@
1
+ <div data-doc-component="gallery/stats"></div>
@@ -0,0 +1,166 @@
1
+ // gallery/stats (工作区统计): four numbers of the workspace, read through context.workspace.query("stats")
2
+ // (its manifest's needs hold "workspace"): its documents, its to-dos done of all, the words of all its
3
+ // documents, and the documents edited this week (since Monday, 0:00); a workspace with none of them
4
+ // shows each 0. It reads again whenever the workspace says they changed (the `data` signal, "stats": a
5
+ // document written, a to-do checked, a document made or gone) and as a day begins (the kit's clock: a
6
+ // new week starts on a Monday). It holds no part and writes nothing: all it shows is drawn (the
7
+ // manifest's `runtime`). Where the workspace cannot be read (an exported file, where it has no server; a
8
+ // server that does not answer) each number is a dash and a line says why. The words are the page's
9
+ // language (the UI's where Gallery says it, else the page's lang); a big number of words is said short
10
+ // (12.3万, 123K) as the language does. Its head is the cards' (the kit's card tokens): the chip, bars of a
11
+ // chart, before its title; each label after a small picture of what it counts (style.css, by the cell's
12
+ // `data-stat`); the to-dos done drawn as a bar too under their count, the share of all that is done in
13
+ // the accent on the track.
14
+
15
+ const WORDS = {
16
+ zh: {
17
+ title: "工作区统计",
18
+ documents: "文档",
19
+ todos: "待办完成",
20
+ words: "总字数",
21
+ week: "本周编辑",
22
+ pieces: "篇",
23
+ offline: "在 Gallery 里打开时显示",
24
+ failed: "读不到工作区的统计",
25
+ locale: "zh-CN",
26
+ },
27
+ en: {
28
+ title: "Workspace",
29
+ documents: "Documents",
30
+ todos: "To-dos done",
31
+ words: "Words",
32
+ week: "Edited this week",
33
+ pieces: "",
34
+ offline: "Shown when opened in Gallery",
35
+ failed: "The workspace's numbers could not be read",
36
+ locale: "en",
37
+ },
38
+ };
39
+
40
+ /** The language the page speaks: the UI's where Gallery says it (data-ge-language), else its lang's. */
41
+ function languageOf(/** @type {HTMLElement} */ root) {
42
+ const ui = root.getAttribute("data-ge-language");
43
+ return (ui !== null ? ui === "en" : /^en(?:-|$)/i.test(root.lang)) ? "en" : "zh";
44
+ }
45
+
46
+ /**
47
+ * A count as the card writes it, in `language`: whole and grouped up to 99,999 (12,345), shorter past
48
+ * it (12.3万, 123.5K), as the language writes a big number.
49
+ * @param {number} value
50
+ * @param {"zh" | "en"} language
51
+ */
52
+ function countOf(value, language) {
53
+ const big = Math.abs(value) >= 100_000;
54
+ return new Intl.NumberFormat(WORDS[language].locale, big ? { notation: "compact", maximumFractionDigits: 1 } : { maximumFractionDigits: 0 }).format(value);
55
+ }
56
+
57
+ /**
58
+ * The four cells the card shows of `stats` (workspace.query("stats")'s data), or of none (null: a dash
59
+ * each), in `language`: [{ key, label, value, unit }].
60
+ * @param {{ documents: number, todos: { done: number, total: number }, words: number, editedThisWeek: number } | null} stats
61
+ * @param {"zh" | "en"} language
62
+ */
63
+ function cellsOf(stats, language) {
64
+ const words = WORDS[language];
65
+ const dash = "–";
66
+ return [
67
+ { key: "documents", label: words.documents, value: stats ? countOf(stats.documents, language) : dash, unit: stats ? words.pieces : "" },
68
+ { key: "todos", label: words.todos, value: stats ? `${countOf(stats.todos.done, language)}/${countOf(stats.todos.total, language)}` : dash, unit: "" },
69
+ { key: "words", label: words.words, value: stats ? countOf(stats.words, language) : dash, unit: "" },
70
+ { key: "week", label: words.week, value: stats ? countOf(stats.editedThisWeek, language) : dash, unit: stats ? words.pieces : "" },
71
+ ];
72
+ }
73
+
74
+ /**
75
+ * An element of the face, of `kind` (its class).
76
+ * @template {keyof HTMLElementTagNameMap} K
77
+ * @param {K} tag
78
+ * @param {string} kind
79
+ * @param {string} [text]
80
+ */
81
+ function made(tag, kind, text) {
82
+ const node = document.createElement(tag);
83
+ node.className = `gallery-stats-${kind}`;
84
+ if (text !== undefined) node.textContent = text;
85
+ return node;
86
+ }
87
+
88
+ DocKit.component({
89
+ id: "gallery/stats",
90
+ on: ["data", "clock"],
91
+ mount(host, context) {
92
+ const language = languageOf(document.documentElement);
93
+ const words = WORDS[language];
94
+ const face = made("div", "face");
95
+ const head = made("div", "head");
96
+ const chip = made("span", "chip");
97
+ chip.setAttribute("aria-hidden", "true");
98
+ chip.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M4.5 19.5h15M7.5 15.5v-5M12 15.5V4.5M16.5 15.5V8"/></svg>';
99
+ head.append(chip, made("span", "title", words.title));
100
+ const grid = made("dl", "grid");
101
+ const line = made("p", "line");
102
+ line.hidden = true;
103
+ face.append(head, grid, line);
104
+ host.append(face);
105
+ const workspace = context.workspace;
106
+ if (!workspace) return void context.fail(new Error("its manifest's needs hold \"workspace\": context.workspace is not there"));
107
+ // The cells, each a label over its number, made again only where their words are others.
108
+ const draw = (/** @type {Parameters<typeof cellsOf>[0]} */ stats) => {
109
+ const cells = cellsOf(stats, language);
110
+ if (grid.children.length !== cells.length) {
111
+ grid.replaceChildren(...cells.map(({ key }) => {
112
+ const cell = made("div", "cell");
113
+ cell.dataset.stat = key;
114
+ const value = made("dd", "value");
115
+ value.append(made("span", "number"), made("span", "unit"));
116
+ if (key === "todos") {
117
+ const bar = made("span", "bar");
118
+ bar.setAttribute("aria-hidden", "true");
119
+ bar.append(made("span", "fill"));
120
+ value.append(bar);
121
+ }
122
+ cell.append(made("dt", "label"), value);
123
+ return cell;
124
+ }));
125
+ }
126
+ cells.forEach(({ label, value, unit }, index) => {
127
+ const cell = /** @type {HTMLElement} */ (grid.children[index]);
128
+ const put = (/** @type {string} */ selector, /** @type {string} */ text) => {
129
+ const node = cell.querySelector(selector);
130
+ if (node && node.textContent !== text) node.textContent = text;
131
+ };
132
+ put(".gallery-stats-label", label);
133
+ put(".gallery-stats-number", value);
134
+ put(".gallery-stats-unit", unit);
135
+ });
136
+ // The bar of the to-dos: the share done, none drawn where nothing is known or there is none.
137
+ const bar = /** @type {HTMLElement | null} */ (grid.querySelector(".gallery-stats-bar"));
138
+ if (bar) {
139
+ const share = stats && stats.todos.total > 0 ? stats.todos.done / stats.todos.total : null;
140
+ bar.hidden = share === null;
141
+ bar.style.setProperty("--share", String(share ?? 0));
142
+ }
143
+ };
144
+ let asking = 0; // the last read asked: an older answer that comes after it is dropped
145
+ const read = () => {
146
+ const ticket = ++asking;
147
+ workspace.query("stats").then(({ data }) => {
148
+ if (ticket !== asking || context.signal.aborted) return;
149
+ line.hidden = true;
150
+ draw(data);
151
+ }, (/** @type {any} */ error) => {
152
+ if (ticket !== asking || context.signal.aborted) return;
153
+ draw(null);
154
+ line.hidden = false;
155
+ line.textContent = error?.code === "offline" ? words.offline : words.failed;
156
+ });
157
+ };
158
+ draw(null);
159
+ read();
160
+ return {
161
+ update(reason, detail) {
162
+ if ((reason === "data" && detail === "stats") || (reason === "clock" && detail === "day")) read();
163
+ },
164
+ };
165
+ },
166
+ });
@@ -0,0 +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 19v-6M12 19V5M18 19v-9"/></g><rect x="50" y="28" width="50" height="6" rx="3" fill="#3b3a37"/><rect x="30" y="50" width="18" height="4" rx="2" fill="#c4c2bd"/><text x="29" y="70" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="17" font-weight="600" letter-spacing="-.5" fill="#3b3a37">5</text><rect x="41" y="64" width="7" height="5" rx="2" fill="#c4c2bd"/><rect x="126" y="50" width="26" height="4" rx="2" fill="#c4c2bd"/><text x="125" y="70" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="17" font-weight="600" letter-spacing="-.5" fill="#3b3a37">1/4</text><rect x="126" y="74.5" width="82" height="2.6" rx="1.3" fill="#efeeec"/><rect x="126" y="74.5" width="20" height="2.6" rx="1.3" fill="#2e7cd1"/><rect x="30" y="82" width="22" height="4" rx="2" fill="#c4c2bd"/><text x="29" y="101" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="17" font-weight="600" letter-spacing="-.5" fill="#3b3a37">1,293</text><rect x="126" y="82" width="26" height="4" rx="2" fill="#c4c2bd"/><text x="125" y="101" font-family="Segoe UI, Helvetica, Arial, sans-serif" font-size="17" font-weight="600" letter-spacing="-.5" fill="#3b3a37">2</text><rect x="137" y="95" width="7" height="5" rx="2" fill="#c4c2bd"/></svg>