@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.
- package/THIRD-PARTY-NOTICES.md +2 -2
- package/browser/editor/components/align.mjs +58 -0
- package/browser/editor/components/code/index.mjs +1 -1
- package/browser/editor/components/embed/page.mjs +1 -1
- package/browser/editor/components/file/page.mjs +4 -4
- package/browser/editor/components/heading/index.mjs +7 -6
- package/browser/editor/components/icon/page.mjs +6 -4
- package/browser/editor/components/icons.mjs +5 -2
- package/browser/editor/components/image/index.mjs +2 -0
- package/browser/editor/components/image/page.mjs +172 -90
- package/browser/editor/components/installed/index.mjs +6 -2
- package/browser/editor/components/installed/page.mjs +80 -13
- package/browser/editor/components/media/icons.mjs +13 -8
- package/browser/editor/components/media/page.mjs +5 -3
- package/browser/editor/components/media/toolbar.mjs +12 -3
- package/browser/editor/components/paragraph/index.mjs +4 -3
- package/browser/editor/components/registry.mjs +17 -5
- package/browser/editor/components/table/index.mjs +4 -2
- package/browser/editor/page/after/index.mjs +288 -0
- package/browser/editor/page/align.mjs +91 -0
- package/browser/editor/page/beside.mjs +5 -6
- package/browser/editor/page/block-menu/index.mjs +6 -3
- package/browser/editor/page/blocks.mjs +3 -1
- package/browser/editor/page/board/hint.mjs +64 -27
- package/browser/editor/page/board/index.mjs +160 -71
- package/browser/editor/page/board/motion.mjs +177 -0
- package/browser/editor/page/board/settings.mjs +4 -3
- package/browser/editor/page/clipboard/import/read.mjs +20 -2
- package/browser/editor/page/clipboard/index.mjs +10 -3
- package/browser/editor/page/clipboard/own/blocks.mjs +3 -4
- package/browser/editor/page/clipboard/own/describe.mjs +6 -2
- package/browser/editor/page/commit.mjs +2 -2
- package/browser/editor/page/core.mjs +3 -1
- package/browser/editor/page/custom-page.mjs +15 -11
- package/browser/editor/page/editor.mjs +31 -14
- package/browser/editor/page/history.mjs +19 -4
- package/browser/editor/page/insert/index.mjs +20 -22
- package/browser/editor/page/menu.mjs +15 -7
- package/browser/editor/page/page-objects.mjs +3 -7
- package/browser/editor/page/present-links.mjs +5 -4
- package/browser/editor/page/present-shell.mjs +63 -0
- package/browser/editor/page/selection/index.mjs +10 -2
- package/browser/editor/page/table/binding.mjs +87 -0
- package/browser/editor/page/table/icons.mjs +0 -2
- package/browser/editor/page/table/index.mjs +10 -14
- package/browser/editor/page/table/views.mjs +5 -52
- package/browser/editor/page/table/widths.mjs +82 -10
- package/browser/editor/page/typing/index.mjs +44 -12
- package/browser/editor/page/typing/leave.mjs +19 -5
- package/browser/shared/block-packs.mjs +23 -8
- package/browser/shared/component-catalog.mjs +15 -8
- package/browser/shared/component-source.mjs +3 -1
- package/browser/shared/components/heading.mjs +2 -1
- package/browser/shared/components/installed.mjs +1 -1
- package/browser/shared/components/page.mjs +2 -0
- package/browser/shared/components/paragraph.mjs +8 -1
- package/browser/shared/components/table.mjs +1 -0
- package/browser/shared/document-copy.mjs +43 -0
- package/browser/shared/drafts.mjs +10 -3
- package/browser/shared/emoji/icon-value.mjs +2 -2
- package/browser/shared/emoji/line-icons.mjs +37 -0
- package/browser/shared/extensions.mjs +83 -7
- package/browser/shared/http.mjs +9 -0
- package/browser/shared/i18n/en.mjs +50 -17
- package/browser/shared/outline-shape.mjs +6 -0
- package/browser/shared/outline.mjs +165 -12
- package/browser/shared/pack-manifest.mjs +12 -1
- package/browser/shared/pages.mjs +169 -57
- package/browser/shared/pinyin.mjs +92 -0
- package/browser/shared/present-step.mjs +17 -0
- package/browser/shared/sidebar-head.mjs +70 -0
- package/browser/shared/web-links.mjs +5 -0
- package/browser/shared/workspace-columns.mjs +11 -7
- package/dist/{chunk-N7AZZLGT.mjs → chunk-2GKGEVMR.mjs} +29 -24
- package/dist/chunk-2OHANJ6Q.mjs +2 -0
- package/dist/{chunk-HYMEEXKN.mjs → chunk-2RKIHJI2.mjs} +1 -1
- package/dist/{chunk-742D2WWJ.mjs → chunk-36FIRJIF.mjs} +2 -2
- package/dist/{chunk-BPL64HGA.mjs → chunk-3A5I2GJK.mjs} +1 -1
- package/dist/{chunk-RFDZXFJF.mjs → chunk-3OFXMN6N.mjs} +1 -1
- package/dist/chunk-46ACXOU5.mjs +2 -0
- package/dist/{chunk-PUOQ65NC.mjs → chunk-4AMTKWDO.mjs} +1 -1
- package/dist/{chunk-VTKNEYT3.mjs → chunk-4DNHHJSL.mjs} +1 -1
- package/dist/chunk-5DPABPBI.mjs +2 -0
- package/dist/chunk-5IIH335D.mjs +3 -0
- package/dist/chunk-5L26JUYA.mjs +2 -0
- package/dist/{chunk-3NJACR4W.mjs → chunk-5MEXZ2UF.mjs} +1 -1
- package/dist/{chunk-ZHEHPMBK.mjs → chunk-6MPKCH3P.mjs} +1 -1
- package/dist/{chunk-C564NU2H.mjs → chunk-74RPP2M2.mjs} +1 -1
- package/dist/chunk-7M2BQQGZ.mjs +2 -0
- package/dist/{chunk-VXACTLO3.mjs → chunk-7M7UPWU6.mjs} +1 -1
- package/dist/{chunk-ZB4H7ZN4.mjs → chunk-7N2LPG33.mjs} +1 -1
- package/dist/{chunk-UBBRTJ2R.mjs → chunk-7XDYK3UC.mjs} +1 -1
- package/dist/chunk-AEMVZYZQ.mjs +166 -0
- package/dist/{chunk-POQSE4C2.mjs → chunk-AFGUR7SY.mjs} +1 -1
- package/dist/{chunk-QKXMPUXC.mjs → chunk-AMDGVDNV.mjs} +1 -1
- package/dist/{chunk-KTKHRC6H.mjs → chunk-ASAXY2DJ.mjs} +1 -1
- package/dist/{chunk-NVRNLK25.mjs → chunk-BYSF5UMM.mjs} +2 -2
- package/dist/{chunk-U3SSPL4K.mjs → chunk-CCSGFCLZ.mjs} +1 -1
- package/dist/{chunk-NWFBE2YA.mjs → chunk-CG3UHDKH.mjs} +1 -1
- package/dist/chunk-CPS4SRPF.mjs +5 -0
- package/dist/{chunk-B4P2CM2J.mjs → chunk-CZ5KJSGK.mjs} +1 -1
- package/dist/chunk-DAMVDXR3.mjs +2 -0
- package/dist/{chunk-NG375ILQ.mjs → chunk-DH6GMDNN.mjs} +1 -1
- package/dist/chunk-DHB7UZ7F.mjs +3 -0
- package/dist/{chunk-MHW7ZKOU.mjs → chunk-DKR7LFIY.mjs} +1 -1
- package/dist/chunk-DLFZJJEE.mjs +2 -0
- package/dist/{chunk-6EZ7FNIK.mjs → chunk-F4ZA6JRZ.mjs} +1 -1
- package/dist/{chunk-6VTU6KEO.mjs → chunk-FCK6NXON.mjs} +1 -1
- package/dist/{chunk-ZWPMCK7P.mjs → chunk-FX42XU6J.mjs} +1 -1
- package/dist/chunk-FXQBADMN.mjs +5 -0
- package/dist/{chunk-W3BGBJQW.mjs → chunk-G4YP7GVC.mjs} +1 -1
- package/dist/{chunk-V6XZ4VIR.mjs → chunk-GWOYMENX.mjs} +1 -1
- package/dist/chunk-HATA2W7X.mjs +2 -0
- package/dist/{chunk-YI43RG4P.mjs → chunk-HBAUKKQH.mjs} +1 -1
- package/dist/{chunk-MAFIGVXY.mjs → chunk-HM4E43VM.mjs} +1 -1
- package/dist/{chunk-CRJEG7MT.mjs → chunk-JI6T3A4Y.mjs} +1 -1
- package/dist/{chunk-NFMCP2HI.mjs → chunk-JJNRIFND.mjs} +2 -2
- package/dist/chunk-JL6R4FG4.mjs +4 -0
- package/dist/{chunk-UMHUSOPJ.mjs → chunk-JXLSHVJ2.mjs} +1 -1
- package/dist/{chunk-FJYN7RTH.mjs → chunk-KFZBYDIS.mjs} +1 -1
- package/dist/{chunk-ZTHICSSF.mjs → chunk-KH24LWAT.mjs} +1 -1
- package/dist/{chunk-RKPWLGZ3.mjs → chunk-KUILYI7H.mjs} +1 -1
- package/dist/{chunk-RMECZA2K.mjs → chunk-L7W624FD.mjs} +1 -1
- package/dist/chunk-LE44MD3O.mjs +4 -0
- package/dist/{chunk-4K5KC6V2.mjs → chunk-LV24RY2E.mjs} +1 -1
- package/dist/{chunk-43B75J5T.mjs → chunk-MKTX5PGV.mjs} +1 -1
- package/dist/{chunk-LKX55H76.mjs → chunk-NAGMRVW4.mjs} +1 -1
- package/dist/{chunk-D4CKRD3V.mjs → chunk-NFABH3QW.mjs} +2 -2
- package/dist/{chunk-PVER7LSC.mjs → chunk-NIW7F7LU.mjs} +2 -2
- package/dist/{chunk-PAREWQGB.mjs → chunk-NWRZXELO.mjs} +1 -1
- package/dist/{chunk-OJKMINIU.mjs → chunk-OU3S466R.mjs} +15 -15
- package/dist/{chunk-5ZJA7CXT.mjs → chunk-PAFSFVYB.mjs} +1 -1
- package/dist/chunk-QCEATQC4.mjs +2 -0
- package/dist/{chunk-Y34NR5JL.mjs → chunk-QJ3TFJLQ.mjs} +1 -1
- package/dist/{chunk-IA4PSIMD.mjs → chunk-QK3VISCA.mjs} +1 -1
- package/dist/{chunk-ZUNVAXLH.mjs → chunk-QXVNUASA.mjs} +1 -1
- package/dist/{chunk-GRAXKKG4.mjs → chunk-QZ35UAB4.mjs} +1 -1
- package/dist/{chunk-UGWYKHBL.mjs → chunk-S2Y7VI4H.mjs} +2 -2
- package/dist/{chunk-OW5NWPOJ.mjs → chunk-SAHS56QM.mjs} +1 -1
- package/dist/{chunk-QOUEFUCH.mjs → chunk-SOD23RGL.mjs} +1 -1
- package/dist/chunk-TDWJKOLN.mjs +2 -0
- package/dist/{chunk-V6RIYQZZ.mjs → chunk-TOE6DPLH.mjs} +1 -1
- package/dist/chunk-UGO5N3EI.mjs +15 -0
- package/dist/{chunk-Q47PLKIJ.mjs → chunk-UGWMMEJ5.mjs} +1 -1
- package/dist/{chunk-NWR2LT5B.mjs → chunk-V5JRSGZF.mjs} +1 -1
- package/dist/{chunk-BZ5RAF7L.mjs → chunk-VA3KAQZD.mjs} +1 -1
- package/dist/chunk-VG5JEIUQ.mjs +12 -0
- package/dist/{chunk-UNOYVIYR.mjs → chunk-VGTMLQWZ.mjs} +1 -1
- package/dist/chunk-VKSRM7EY.mjs +22 -0
- package/dist/{chunk-YQGT4AB2.mjs → chunk-VNUWREXU.mjs} +1 -1
- package/dist/{chunk-AGDILNWB.mjs → chunk-VPVOAJ7X.mjs} +1 -1
- package/dist/{chunk-HLYV7RIH.mjs → chunk-WCWYNFDF.mjs} +1 -1
- package/dist/chunk-WTEGUPFG.mjs +16 -0
- package/dist/{chunk-N76HWBA3.mjs → chunk-XKOHV4H6.mjs} +1 -1
- package/dist/{chunk-HMYTM3GT.mjs → chunk-XMKHCUI6.mjs} +1 -1
- package/dist/{chunk-OUUP3WKT.mjs → chunk-XQRUG4G3.mjs} +1 -1
- package/dist/{chunk-32ZUEFZ7.mjs → chunk-YBB5LWZK.mjs} +1 -1
- package/dist/{chunk-SX4LJYT6.mjs → chunk-YFJU3O7G.mjs} +1 -1
- package/dist/chunk-YPPJVDQI.mjs +2 -0
- package/dist/chunk-ZANMKAWS.mjs +2 -0
- package/dist/{chunk-6QBHU4DF.mjs → chunk-ZCP7BTOZ.mjs} +1 -1
- package/dist/{chunk-ERLAIBOA.mjs → chunk-ZEY2RLBT.mjs} +2 -2
- package/dist/{chunk-SQ6Y2ZMA.mjs → chunk-ZO7SFB2E.mjs} +2 -2
- package/dist/cli.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/worker.mjs +1 -1
- package/kit/board.css +5 -5
- package/kit/code.js +15 -15
- package/kit/math.js +1 -1
- package/kit/report.css +123 -44
- package/kit/runtime.js +45 -7
- package/kit/tables.js +2 -0
- package/kit/ui.js +2 -0
- package/package.json +1 -1
- package/packs/gallery/chart-view/kit.js +3 -3
- package/packs/gallery/chart-view/writing.md +1 -1
- package/packs/gallery/countdown/component.json +1 -1
- package/packs/gallery/countdown/kit.js +89 -29
- package/packs/gallery/countdown/preview.svg +1 -1
- package/packs/gallery/countdown/style.css +88 -100
- package/packs/gallery/countdown/writing.md +2 -2
- package/packs/gallery/habit/component.json +3 -3
- package/packs/gallery/habit/kit.js +114 -75
- package/packs/gallery/habit/preview.svg +1 -1
- package/packs/gallery/habit/style.css +133 -205
- package/packs/gallery/habit/writing.md +2 -2
- package/packs/gallery/heatmap/component.json +2 -2
- package/packs/gallery/heatmap/kit.js +335 -173
- package/packs/gallery/heatmap/preview.svg +1 -1
- package/packs/gallery/heatmap/style.css +158 -170
- package/packs/gallery/heatmap/writing.md +2 -2
- package/packs/gallery/kanban/kit.js +3 -3
- package/packs/gallery/kanban/writing.md +1 -1
- package/packs/gallery/metric/kit.js +3 -3
- package/packs/gallery/metric/writing.md +1 -1
- package/packs/gallery/note/component.json +3 -3
- package/packs/gallery/note/kit.js +40 -13
- package/packs/gallery/note/preview.svg +1 -1
- package/packs/gallery/note/style.css +51 -30
- package/packs/gallery/note/writing.md +2 -2
- package/packs/gallery/recent/component.json +2 -2
- package/packs/gallery/recent/kit.js +141 -86
- package/packs/gallery/recent/preview.svg +1 -1
- package/packs/gallery/recent/style.css +53 -126
- package/packs/gallery/recent/writing.md +2 -2
- package/packs/gallery/static/component.json +2 -2
- package/packs/gallery/static/preview.svg +1 -1
- package/packs/gallery/static/style.css +99 -66
- package/packs/gallery/static/writing.md +2 -2
- package/packs/gallery/stats/component.json +3 -3
- package/packs/gallery/stats/kit.js +253 -72
- package/packs/gallery/stats/preview.svg +1 -1
- package/packs/gallery/stats/style.css +64 -142
- package/packs/gallery/stats/writing.md +2 -2
- package/packs/gallery/today/component.json +2 -2
- package/packs/gallery/today/kit.js +62 -27
- package/packs/gallery/today/preview.svg +1 -1
- package/packs/gallery/today/style.css +101 -72
- package/packs/gallery/today/writing.md +2 -2
- package/packs/gallery/todos/component.json +1 -1
- package/packs/gallery/todos/kit.js +218 -71
- package/packs/gallery/todos/preview.svg +1 -1
- package/packs/gallery/todos/style.css +170 -223
- package/packs/gallery/todos/writing.md +1 -1
- package/packs/gallery/weather/component.json +2 -2
- package/packs/gallery/weather/kit.js +165 -90
- package/packs/gallery/weather/preview.svg +1 -1
- package/packs/gallery/weather/style.css +100 -218
- package/packs/gallery/weather/writing.md +1 -1
- package/packs/gallery-soft/countdown/component.json +18 -0
- package/packs/gallery-soft/countdown/example.html +3 -0
- package/packs/gallery-soft/countdown/kit.js +206 -0
- package/packs/gallery-soft/countdown/preview.svg +1 -0
- package/packs/gallery-soft/countdown/style.css +211 -0
- package/packs/gallery-soft/countdown/template.html +3 -0
- package/packs/gallery-soft/countdown/writing.md +24 -0
- package/packs/gallery-soft/habit/component.json +14 -0
- package/packs/gallery-soft/habit/example.html +3 -0
- package/packs/gallery-soft/habit/kit.js +366 -0
- package/packs/gallery-soft/habit/preview.svg +1 -0
- package/packs/gallery-soft/habit/style.css +251 -0
- package/packs/gallery-soft/habit/template.html +3 -0
- package/packs/gallery-soft/habit/writing.md +23 -0
- package/packs/gallery-soft/heatmap/component.json +18 -0
- package/packs/gallery-soft/heatmap/example.html +3 -0
- package/packs/gallery-soft/heatmap/kit.js +498 -0
- package/packs/gallery-soft/heatmap/preview.svg +1 -0
- package/packs/gallery-soft/heatmap/style.css +181 -0
- package/packs/gallery-soft/heatmap/template.html +3 -0
- package/packs/gallery-soft/heatmap/writing.md +23 -0
- package/packs/gallery-soft/note/component.json +14 -0
- package/packs/gallery-soft/note/example.html +3 -0
- package/packs/gallery-soft/note/kit.js +162 -0
- package/packs/gallery-soft/note/preview.svg +1 -0
- package/packs/gallery-soft/note/style.css +148 -0
- package/packs/gallery-soft/note/template.html +3 -0
- package/packs/gallery-soft/note/writing.md +20 -0
- package/packs/gallery-soft/recent/component.json +13 -0
- package/packs/gallery-soft/recent/example.html +1 -0
- package/packs/gallery-soft/recent/kit.js +335 -0
- package/packs/gallery-soft/recent/preview.svg +1 -0
- package/packs/gallery-soft/recent/style.css +160 -0
- package/packs/gallery-soft/recent/template.html +1 -0
- package/packs/gallery-soft/recent/writing.md +17 -0
- package/packs/gallery-soft/static/component.json +13 -0
- package/packs/gallery-soft/static/example.html +12 -0
- package/packs/gallery-soft/static/preview.svg +1 -0
- package/packs/gallery-soft/static/style.css +186 -0
- package/packs/gallery-soft/static/template.html +1 -0
- package/packs/gallery-soft/static/writing.md +20 -0
- package/packs/gallery-soft/stats/component.json +13 -0
- package/packs/gallery-soft/stats/example.html +1 -0
- package/packs/gallery-soft/stats/kit.js +341 -0
- package/packs/gallery-soft/stats/preview.svg +1 -0
- package/packs/gallery-soft/stats/style.css +119 -0
- package/packs/gallery-soft/stats/template.html +1 -0
- package/packs/gallery-soft/stats/writing.md +13 -0
- package/packs/gallery-soft/today/component.json +12 -0
- package/packs/gallery-soft/today/example.html +1 -0
- package/packs/gallery-soft/today/kit.js +222 -0
- package/packs/gallery-soft/today/preview.svg +1 -0
- package/packs/gallery-soft/today/style.css +178 -0
- package/packs/gallery-soft/today/template.html +1 -0
- package/packs/gallery-soft/today/writing.md +16 -0
- package/packs/gallery-soft/todos/component.json +19 -0
- package/packs/gallery-soft/todos/example.html +3 -0
- package/packs/gallery-soft/todos/kit.js +527 -0
- package/packs/gallery-soft/todos/preview.svg +1 -0
- package/packs/gallery-soft/todos/style.css +212 -0
- package/packs/gallery-soft/todos/template.html +3 -0
- package/packs/gallery-soft/todos/writing.md +32 -0
- package/packs/gallery-soft/weather/component.json +19 -0
- package/packs/gallery-soft/weather/example.html +3 -0
- package/packs/gallery-soft/weather/kit.js +411 -0
- package/packs/gallery-soft/weather/preview.svg +1 -0
- package/packs/gallery-soft/weather/style.css +185 -0
- package/packs/gallery-soft/weather/template.html +3 -0
- package/packs/gallery-soft/weather/writing.md +28 -0
- package/release.json +10 -10
- package/skill/SKILL.md +15 -14
- package/skill/references/building-blocks.md +4 -4
- package/skill/references/extensions.md +11 -7
- package/skill/references/pages-and-data.md +13 -9
- package/skill/references/writing-html.md +2 -0
- package/web/assets/index-BHC5ZOMh.js +15 -0
- package/web/assets/index-xP0uw3a0.css +1 -0
- package/web/index.html +2 -2
- package/dist/chunk-2NRBY6AJ.mjs +0 -2
- package/dist/chunk-35NQ4PLQ.mjs +0 -2
- package/dist/chunk-3KJHLHUO.mjs +0 -2
- package/dist/chunk-4AV456RQ.mjs +0 -2
- package/dist/chunk-5XYHDBJ5.mjs +0 -2
- package/dist/chunk-6A53MZYZ.mjs +0 -2
- package/dist/chunk-6EXH3ORZ.mjs +0 -166
- package/dist/chunk-BVEFGE4B.mjs +0 -2
- package/dist/chunk-D4EURAX4.mjs +0 -4
- package/dist/chunk-DQCE7TJY.mjs +0 -5
- package/dist/chunk-FWNRPMCJ.mjs +0 -12
- package/dist/chunk-FWW4CSAZ.mjs +0 -2
- package/dist/chunk-GY3FAUVM.mjs +0 -2
- package/dist/chunk-JVHHHGEA.mjs +0 -3
- package/dist/chunk-L7UP52JO.mjs +0 -2
- package/dist/chunk-NAMN3RAF.mjs +0 -2
- package/dist/chunk-PZDLJJTJ.mjs +0 -3
- package/dist/chunk-SXHBYZST.mjs +0 -16
- package/dist/chunk-TEZAWDSQ.mjs +0 -2
- package/dist/chunk-UFNYFFKO.mjs +0 -20
- package/dist/chunk-UKSHDZZ6.mjs +0 -2
- package/dist/chunk-VJPFVNNW.mjs +0 -15
- package/dist/chunk-VS3ZMVGX.mjs +0 -5
- package/web/assets/index-BK2e_07w.js +0 -13
- package/web/assets/index-CWFI83mF.css +0 -1
- /package/dist/{chunk-YEY3RSFQ.mjs → chunk-5MMN3N5J.mjs} +0 -0
- /package/dist/{chunk-UH4SIXTR.mjs → chunk-74UW7QSL.mjs} +0 -0
- /package/dist/{chunk-W7XHE4CT.mjs → chunk-EKGYYOSP.mjs} +0 -0
- /package/dist/{chunk-QAIHRH3I.mjs → chunk-KNZJT4ET.mjs} +0 -0
- /package/dist/{chunk-A55HN5OK.mjs → chunk-N3DSBH5S.mjs} +0 -0
- /package/dist/{chunk-QR6A54KJ.mjs → chunk-ZW2A6GBW.mjs} +0 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/* 柔光风格's editing heatmap. Every selector starts at the instance and goes down from it, so that nothing
|
|
2
|
+
here reaches the rest of the page. The soft look's tokens first, light and dark (light-dark(): the page's
|
|
3
|
+
color scheme, which follows its theme), the squares' five shades of the accent among them, then the face:
|
|
4
|
+
a faint wash of the accent from the card's top over the soft card's fill; a head of a calendar's chip and
|
|
5
|
+
编辑热力图, its quiet meta at the end (less to more, or the count and the weeks; fading while the grip
|
|
6
|
+
shows); the squares the hero, rounded, placed by the script (left, top and size), the months' names over
|
|
7
|
+
them and the weekdays' initials beside them muted; a day before the record began a faint dot, today ringed
|
|
8
|
+
in the accent, the square under the pointer ringed in the text's color with a dark tip over it saying its
|
|
9
|
+
day. On a card wider than 6 cells a column of figures beside the squares: what they count, its total large,
|
|
10
|
+
four small figures under it, and the reader's and the Agent's shares as a bar of two at its bottom (three
|
|
11
|
+
cells high, 8 × 3: the total and the first two figures alone); on a
|
|
12
|
+
narrower one less to more under the squares at their right. Nothing read: the cards' empty face. On a custom
|
|
13
|
+
page the face is the card's whole room, taken out over the card's padding and given the soft frame's (24px),
|
|
14
|
+
the board's line around it; where no card is (a document, as gallery block check shows it) the face frames
|
|
15
|
+
itself at an 8 × 4 card's size. */
|
|
16
|
+
[data-doc-component="gallery-soft/heatmap"] {
|
|
17
|
+
--soft-font: "PingFang SC", "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
|
|
18
|
+
--soft-num: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
19
|
+
--soft-card: light-dark(#ffffff, #1f1f20);
|
|
20
|
+
--soft-card-line: light-dark(rgb(28 28 32 / 6.5%), rgb(255 255 255 / 7.5%));
|
|
21
|
+
--soft-card-shadow: 0 0 0 1px var(--soft-card-line), 0 1px 2px light-dark(rgb(28 28 32 / 3.5%), rgb(0 0 0 / 0%)), 0 8px 24px -14px light-dark(rgb(28 28 32 / 12%), rgb(0 0 0 / 60%));
|
|
22
|
+
--soft-wash: linear-gradient(180deg, light-dark(rgb(62 122 198 / 6%), rgb(126 173 226 / 7%)) 0%, transparent 52%);
|
|
23
|
+
--soft-text: light-dark(#37352f, #d9d9dc);
|
|
24
|
+
--soft-strong: light-dark(#1f1f1f, #f1f1f2);
|
|
25
|
+
--soft-muted: light-dark(#7a7a7f, #9d9da3);
|
|
26
|
+
--soft-accent: light-dark(#3e7ac6, #7eade2);
|
|
27
|
+
--soft-accent-soft: light-dark(#ecf3fb, rgb(126 173 226 / 14%));
|
|
28
|
+
--soft-track: light-dark(rgb(28 28 32 / 7%), rgb(255 255 255 / 8%));
|
|
29
|
+
--soft-slot: light-dark(rgb(28 28 32 / 8.5%), rgb(255 255 255 / 9%));
|
|
30
|
+
--soft-h0: light-dark(rgb(28 28 32 / 6%), rgb(255 255 255 / 7%));
|
|
31
|
+
--soft-h1: light-dark(#d6e4f4, #253a55);
|
|
32
|
+
--soft-h2: light-dark(#a6c4e8, #3a5d88);
|
|
33
|
+
--soft-h3: light-dark(#6b9bd4, #5a8bc7);
|
|
34
|
+
--soft-h4: light-dark(#3e7ac6, #96bfea);
|
|
35
|
+
--soft-agent: light-dark(#a3c2e6, #4a6f9b);
|
|
36
|
+
--soft-grip-room: 0px;
|
|
37
|
+
> .gallery-soft-heatmap-face {
|
|
38
|
+
--soft-pad: 24px;
|
|
39
|
+
position: relative;
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
min-width: 0;
|
|
44
|
+
width: 624px;
|
|
45
|
+
max-width: 100%;
|
|
46
|
+
height: 304px;
|
|
47
|
+
padding: calc(var(--soft-pad) - var(--soft-edge, 0px));
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
border-radius: 16px;
|
|
50
|
+
box-shadow: var(--soft-card-shadow);
|
|
51
|
+
background: var(--soft-wash), var(--soft-card);
|
|
52
|
+
color: var(--soft-text);
|
|
53
|
+
font: 13px/1.5 var(--soft-font);
|
|
54
|
+
-webkit-font-smoothing: antialiased;
|
|
55
|
+
}
|
|
56
|
+
> .gallery-soft-heatmap-face[data-pad="m"] { --soft-pad: 20px; }
|
|
57
|
+
> .gallery-soft-heatmap-face[data-pad="s"] { --soft-pad: 18px; }
|
|
58
|
+
/* The head: the calendar's chip, 编辑热力图, its meta at the end. */
|
|
59
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-head { display: flex; align-items: center; gap: 10px; flex: none; height: 28px; min-width: 0; padding-inline-end: var(--soft-grip-room); }
|
|
60
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-head > .gallery-soft-heatmap-chip { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--soft-accent-soft); color: var(--soft-accent); }
|
|
61
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-head > .gallery-soft-heatmap-chip > svg { display: block; width: 16px; height: 16px; }
|
|
62
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-head > .gallery-soft-heatmap-title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; font-weight: 600; color: var(--soft-strong); }
|
|
63
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-head > .gallery-soft-heatmap-meta {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: 6px;
|
|
67
|
+
flex: none;
|
|
68
|
+
margin-left: auto;
|
|
69
|
+
margin-inline-end: calc(-1 * var(--soft-grip-room));
|
|
70
|
+
font-size: 12px;
|
|
71
|
+
color: var(--soft-muted);
|
|
72
|
+
white-space: nowrap;
|
|
73
|
+
opacity: calc(1 - var(--gallery-grip-shown, 0));
|
|
74
|
+
transition: opacity .12s ease-out;
|
|
75
|
+
}
|
|
76
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-head > .gallery-soft-heatmap-meta > .gallery-soft-heatmap-count { font: 600 12px var(--soft-num); color: var(--soft-text); }
|
|
77
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-head > .gallery-soft-heatmap-meta > .gallery-soft-heatmap-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7; }
|
|
78
|
+
/* Less to more: five squares between its words. */
|
|
79
|
+
.gallery-soft-heatmap-legend { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--soft-muted); }
|
|
80
|
+
.gallery-soft-heatmap-legend > .gallery-soft-heatmap-key { width: 11px; height: 11px; border-radius: 3px; background: var(--soft-h0); }
|
|
81
|
+
/* The figures beside the squares and the squares' room. */
|
|
82
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body { display: flex; gap: 28px; flex: 1; min-height: 0; margin-top: 16px; }
|
|
83
|
+
> .gallery-soft-heatmap-face[data-narrow] > .gallery-soft-heatmap-body { margin-top: 14px; }
|
|
84
|
+
> .gallery-soft-heatmap-face[data-unread] > .gallery-soft-heatmap-body { display: none; }
|
|
85
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside { display: flex; flex-direction: column; flex: none; width: 150px; min-width: 0; }
|
|
86
|
+
> .gallery-soft-heatmap-face[data-w="12"] > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside { width: 176px; }
|
|
87
|
+
> .gallery-soft-heatmap-face[data-narrow] > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside { display: none; }
|
|
88
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside .gallery-soft-heatmap-label { font-size: 12px; color: var(--soft-muted); white-space: nowrap; }
|
|
89
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-note { margin: 10px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--soft-text); }
|
|
90
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-total {
|
|
91
|
+
margin: 6px 0 0;
|
|
92
|
+
white-space: nowrap;
|
|
93
|
+
font: 700 36px/1 var(--soft-num);
|
|
94
|
+
letter-spacing: -.025em;
|
|
95
|
+
font-variant-numeric: tabular-nums;
|
|
96
|
+
color: var(--soft-strong);
|
|
97
|
+
}
|
|
98
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-total > .gallery-soft-heatmap-unit { margin-left: 4px; font: 500 13px var(--soft-font); letter-spacing: 0; color: var(--soft-muted); }
|
|
99
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-figures { display: grid; grid-template-columns: auto auto; column-gap: 22px; row-gap: 3px; margin-top: 18px; }
|
|
100
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-figures > .gallery-soft-heatmap-label { font-size: 11.5px; }
|
|
101
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-figures > .gallery-soft-heatmap-label:nth-child(n + 5):nth-child(-n + 6) { margin-top: 10px; }
|
|
102
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-figures > .gallery-soft-heatmap-value { font: 600 17px/1.2 var(--soft-num); letter-spacing: -.01em; color: var(--soft-strong); white-space: nowrap; }
|
|
103
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-figures > .gallery-soft-heatmap-value > .gallery-soft-heatmap-small { margin-left: 2px; font: 500 11.5px var(--soft-font); letter-spacing: 0; color: var(--soft-muted); }
|
|
104
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-split { margin-top: auto; }
|
|
105
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-split > .gallery-soft-heatmap-bar { display: flex; gap: 2px; height: 6px; }
|
|
106
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-split > .gallery-soft-heatmap-bar > i { border-radius: 3px; }
|
|
107
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-split > .gallery-soft-heatmap-bar > .gallery-soft-heatmap-you { background: var(--soft-accent); }
|
|
108
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-split > .gallery-soft-heatmap-bar > .gallery-soft-heatmap-agent { flex: 1; background: var(--soft-agent); }
|
|
109
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-split > .gallery-soft-heatmap-key-line { display: flex; justify-content: space-between; margin-top: 7px; font-size: 11.5px; color: var(--soft-muted); white-space: nowrap; }
|
|
110
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-split > .gallery-soft-heatmap-key-line > span { display: inline-flex; align-items: center; gap: 5px; }
|
|
111
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-split > .gallery-soft-heatmap-key-line > span > .gallery-soft-heatmap-swatch { width: 7px; height: 7px; border-radius: 2px; background: var(--soft-accent); }
|
|
112
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-split > .gallery-soft-heatmap-key-line > .gallery-soft-heatmap-agent-key > .gallery-soft-heatmap-swatch { background: var(--soft-agent); }
|
|
113
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-split > .gallery-soft-heatmap-key-line > span > .gallery-soft-heatmap-share { font: 600 11.5px var(--soft-num); color: var(--soft-text); }
|
|
114
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-room { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
|
|
115
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-room > .gallery-soft-heatmap-legend { align-self: flex-end; margin-top: auto; }
|
|
116
|
+
/* Three cells high (8 × 3, the user's word of 2026-11-09): the figures beside the squares the total and the
|
|
117
|
+
first two under it (the days with any, today's), no average, most or shares' bar, which the height has no room for. */
|
|
118
|
+
> .gallery-soft-heatmap-face[data-h="3"] > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-figures > :nth-child(n + 5) { display: none; }
|
|
119
|
+
> .gallery-soft-heatmap-face[data-h="3"] > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside > .gallery-soft-heatmap-split { display: none; }
|
|
120
|
+
/* Two cells high (8 × 2): the squares alone, no head, figures or legend; the months' row the first, kept out of
|
|
121
|
+
the grip's corner by the script (the probe: as wide as that corner). */
|
|
122
|
+
> .gallery-soft-heatmap-face[data-alone] > .gallery-soft-heatmap-head { display: none; }
|
|
123
|
+
> .gallery-soft-heatmap-face[data-alone] > .gallery-soft-heatmap-body { margin-top: 0; }
|
|
124
|
+
> .gallery-soft-heatmap-face[data-alone] > .gallery-soft-heatmap-body > .gallery-soft-heatmap-aside { display: none; }
|
|
125
|
+
> .gallery-soft-heatmap-face[data-alone] > .gallery-soft-heatmap-body > .gallery-soft-heatmap-room > .gallery-soft-heatmap-legend { display: none; }
|
|
126
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-grip-room { position: absolute; width: var(--soft-grip-room, 0px); height: 0; visibility: hidden; pointer-events: none; }
|
|
127
|
+
/* The squares, the months and the weekdays, placed by the script. */
|
|
128
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-body > .gallery-soft-heatmap-room > .gallery-soft-heatmap-grid { position: relative; flex: 1; min-height: 0; }
|
|
129
|
+
.gallery-soft-heatmap-day { position: absolute; border-radius: 5px; background: var(--soft-h0); }
|
|
130
|
+
:is(.gallery-soft-heatmap-day, .gallery-soft-heatmap-key)[data-level="1"] { background: var(--soft-h1); }
|
|
131
|
+
:is(.gallery-soft-heatmap-day, .gallery-soft-heatmap-key)[data-level="2"] { background: var(--soft-h2); }
|
|
132
|
+
:is(.gallery-soft-heatmap-day, .gallery-soft-heatmap-key)[data-level="3"] { background: var(--soft-h3); }
|
|
133
|
+
:is(.gallery-soft-heatmap-day, .gallery-soft-heatmap-key)[data-level="4"] { background: var(--soft-h4); }
|
|
134
|
+
.gallery-soft-heatmap-day.gallery-soft-heatmap-before { background: radial-gradient(circle, var(--soft-slot) 0 2px, transparent 2.5px); }
|
|
135
|
+
.gallery-soft-heatmap-day.gallery-soft-heatmap-today { box-shadow: 0 0 0 2px var(--soft-card), 0 0 0 3.5px var(--soft-accent); }
|
|
136
|
+
.gallery-soft-heatmap-day.gallery-soft-heatmap-pointed { box-shadow: 0 0 0 2px var(--soft-card), 0 0 0 3.5px var(--soft-strong); }
|
|
137
|
+
:is(.gallery-soft-heatmap-month, .gallery-soft-heatmap-row) { position: absolute; font-size: 11px; line-height: 14px; color: var(--soft-muted); white-space: nowrap; }
|
|
138
|
+
.gallery-soft-heatmap-month { top: 0; }
|
|
139
|
+
.gallery-soft-heatmap-row { left: 0; }
|
|
140
|
+
/* The tip: over the card in the top layer (a popover, else fixed), placed in the window by the script. */
|
|
141
|
+
.gallery-soft-heatmap-tip {
|
|
142
|
+
position: fixed;
|
|
143
|
+
inset: auto;
|
|
144
|
+
z-index: 10; /* the top layer needs none: this is where no popover is */
|
|
145
|
+
box-sizing: border-box;
|
|
146
|
+
margin: 0;
|
|
147
|
+
border: 0;
|
|
148
|
+
overflow: visible;
|
|
149
|
+
padding: 7px 10px;
|
|
150
|
+
border-radius: 8px;
|
|
151
|
+
background: var(--soft-strong);
|
|
152
|
+
color: var(--soft-card);
|
|
153
|
+
font-size: 11.5px;
|
|
154
|
+
line-height: 1.45;
|
|
155
|
+
white-space: nowrap;
|
|
156
|
+
box-shadow: 0 6px 18px -6px rgb(0 0 0 / 35%);
|
|
157
|
+
pointer-events: none;
|
|
158
|
+
}
|
|
159
|
+
.gallery-soft-heatmap-tip[hidden] { display: none; }
|
|
160
|
+
.gallery-soft-heatmap-tip > .gallery-soft-heatmap-tip-count { font-family: var(--soft-num); font-weight: 600; }
|
|
161
|
+
.gallery-soft-heatmap-tip > :is(.gallery-soft-heatmap-tip-day, .gallery-soft-heatmap-tip-who) { opacity: .7; }
|
|
162
|
+
/* Nothing read: the cards' empty face. */
|
|
163
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-empty { display: none; }
|
|
164
|
+
> .gallery-soft-heatmap-face[data-unread] > .gallery-soft-heatmap-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: 1; min-height: 0; text-align: center; }
|
|
165
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-empty > .gallery-soft-heatmap-disc { display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin-bottom: 8px; border-radius: 50%; background: var(--soft-track); color: var(--soft-muted); }
|
|
166
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-empty > .gallery-soft-heatmap-disc > svg { display: block; width: 20px; height: 20px; }
|
|
167
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-empty > .gallery-soft-heatmap-line { margin: 0; font-size: 13px; color: var(--soft-text); }
|
|
168
|
+
> .gallery-soft-heatmap-face > .gallery-soft-heatmap-empty > .gallery-soft-heatmap-how { margin: 0; font-size: 12px; color: var(--soft-muted); }
|
|
169
|
+
}
|
|
170
|
+
/* On a custom page: the face over the card's whole room, its padding the soft frame's, the board's line around it; the head's end kept clear of the grip's corner. */
|
|
171
|
+
.gallery-card > [data-doc-component="gallery-soft/heatmap"] { height: 100%; }
|
|
172
|
+
.gallery-card > [data-doc-component="gallery-soft/heatmap"] > .gallery-soft-heatmap-face {
|
|
173
|
+
--soft-edge: 1px;
|
|
174
|
+
--soft-grip-room: max(0px, calc(40px - var(--soft-pad)));
|
|
175
|
+
width: auto;
|
|
176
|
+
max-width: none;
|
|
177
|
+
height: calc(100% + 2 * var(--gallery-card-pad));
|
|
178
|
+
margin: calc(-1 * var(--gallery-card-pad));
|
|
179
|
+
border-radius: calc(var(--gallery-card-radius) - 1px);
|
|
180
|
+
box-shadow: none;
|
|
181
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# 编辑热力图 (gallery-soft/heatmap)
|
|
2
|
+
|
|
3
|
+
A card for a custom page (its places are `page`, its needs `workspace`): how much the workspace was edited each day of the past year, as GitHub draws a year of contributions, a column a week, a square a day, darker for a day of more. What it counts is Gallery's own record of edits (the reader's saves and the Agent's writes, by day, since the workspace's first start of a Gallery that keeps it): the edits of a day, or with its setting the words it added. Use it on the home page.
|
|
4
|
+
|
|
5
|
+
It is 柔光风格's (the pack `gallery-soft`, off until the user turns it on in 设置 › 组件列表): the same card as Gallery 风格's `gallery/heatmap`, its settings, its data and what the user does on it the same, in the soft look of design A (a faint wash of blue from the card's top, rounded chips, big numbers). Write it only where the user asked for 柔光风格 or the page already holds its cards.
|
|
6
|
+
|
|
7
|
+
## Settings
|
|
8
|
+
|
|
9
|
+
Its one setting is the card's form, which the user opens from the grip at the card's top right › 设置…:
|
|
10
|
+
|
|
11
|
+
| Key | Label | Type | What it is |
|
|
12
|
+
| --- | --- | --- | --- |
|
|
13
|
+
| `words` | 按字数显示 | switch | each day by the words it added, not by how many edits it had |
|
|
14
|
+
|
|
15
|
+
It is kept in its data part `settings`, a `<script type="application/json">`: `{}` (template.html, what a menu adds) counts edits. Write `{"words":true}` when the user asks for the words written. The block reads it and writes nothing.
|
|
16
|
+
|
|
17
|
+
## How to write it
|
|
18
|
+
|
|
19
|
+
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 gallery-soft/heatmap`, the instance as template.html has it. Sizes: 8 × 4 (the default: the squares and the figures beside them), 6 × 4 (the squares alone, less to more under them), 12 × 4 (more weeks), 8 × 3 (the squares and the total beside them, with the days that had edits and today's) and 8 × 2 (the squares alone, smaller, about 43 weeks: no head, figures or legend): as many weeks as the card holds are drawn, the last ending today.
|
|
20
|
+
|
|
21
|
+
## How it looks
|
|
22
|
+
|
|
23
|
+
编辑热力图 beside a calendar's chip on the top line, less to more at its end (on a 6 × 4 card the count and the weeks instead); the squares large (22px, 20px on a 6 × 4 card), a column a week, Monday at the top, a month's name over the week it begins in, today ringed in the accent, a day before the record began a faint dot, the shade of each by where its day stands among the days of any edit; the pointer on a square says its day, its count and how much of it was the user's and how much the Agent's. Beside the squares on an 8 × 4 or 12 × 4 card: what they count (近 14 周编辑), its total large, the days with edits of the days recorded and today's, the average a day and the day of the most, and a bar of two shares, 你 and Agent; while nothing is counted yet, since when it records and what it will show; in 柔光风格's soft look (as every card of it: a faint wash of blue from the card's top, a head of a rounded tinted chip and a title, its end clear of the card's grip), light and dark. The script runs with the rights of the page's own scripts, as any block's does.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "gallery-soft/note",
|
|
3
|
+
"apiVersion": 1,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"name": { "zh": "便签", "en": "Note" },
|
|
6
|
+
"description": { "zh": "几行随手记,写在一张纸上,在卡片上直接写,存在页面里", "en": "A few lines jotted on a sheet of paper, typed on the card and kept in the page" },
|
|
7
|
+
"words": "bianqian note memo sticky 便签 笔记 随手记 记事",
|
|
8
|
+
"parts": {
|
|
9
|
+
"note": { "at": ":scope > script", "edit": "data" }
|
|
10
|
+
},
|
|
11
|
+
"runtime": { "generated": [":scope > .gallery-soft-note-face"] },
|
|
12
|
+
"places": ["page"],
|
|
13
|
+
"card": { "sizes": [[4, 2], [2, 2], [4, 4]], "min": { "w": 2, "h": 2 }, "max": { "w": 4, "h": 8 }, "resize": true }
|
|
14
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// gallery-soft/note (便签, 柔光风格): Gallery 风格's gallery/note in the soft look, the same logic. A few lines
|
|
2
|
+
// of free text, kept in the instance's data part, a script of JSON, { "text": "…" }, and typed on the card
|
|
3
|
+
// itself, in a <textarea> the block draws. The field is the kit's (DocKit.input): what the reader typed goes
|
|
4
|
+
// to the file once they are done with it, as they leave the field or press Ctrl+Enter (⌘Enter on a Mac;
|
|
5
|
+
// Enter alone is a new line), never while an input method composes, and never a value it holds already; Esc
|
|
6
|
+
// puts back what the file holds. Each of those is one context.editJSON, one undo step, the JSON written
|
|
7
|
+
// back on one line as it was. It draws from the part on every `source` (an Agent's write, an undo), the
|
|
8
|
+
// words the reader is typing kept where they are. Where nothing takes its writes (an export, a page that
|
|
9
|
+
// has not come to edit yet: context.canEdit() false) the field is read-only, and shows the same words.
|
|
10
|
+
//
|
|
11
|
+
// Its face is a sheet of paper (the paper's warm fill, faint ruled lines the words sit on): a head (the
|
|
12
|
+
// chip, a note's picture in the warm color, 便签, and how many characters it holds, its blanks not
|
|
13
|
+
// counted, said again as the reader types), the field under it, and while the reader types in it a line
|
|
14
|
+
// at the bottom saying how to keep and how to drop what they typed (Ctrl+Enter 保存, Esc 放弃). An empty
|
|
15
|
+
// note says 写点什么, on a wide card with an example of what (比如今天要记住的事). Laid out by its card's size
|
|
16
|
+
// (`context.size`, read again on `layout`; the face's data-w, data-h and data-pad, style.css).
|
|
17
|
+
|
|
18
|
+
const WORDS = {
|
|
19
|
+
zh: {
|
|
20
|
+
empty: "写点什么",
|
|
21
|
+
emptyWide: "写点什么,比如今天要记住的事",
|
|
22
|
+
label: "便签",
|
|
23
|
+
count: (/** @type {number} */ count) => `${count} 字`,
|
|
24
|
+
keep: (/** @type {boolean} */ mac) => `${mac ? "⌘" : "Ctrl+"}Enter 保存`,
|
|
25
|
+
drop: "Esc 放弃",
|
|
26
|
+
},
|
|
27
|
+
en: {
|
|
28
|
+
empty: "Write something",
|
|
29
|
+
emptyWide: "Write something to remember today",
|
|
30
|
+
label: "Note",
|
|
31
|
+
count: (/** @type {number} */ count) => `${count} ${count === 1 ? "character" : "characters"}`,
|
|
32
|
+
keep: (/** @type {boolean} */ mac) => `${mac ? "⌘" : "Ctrl+"}Enter to keep`,
|
|
33
|
+
drop: "Esc to drop",
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** The language the page speaks: the UI's where Gallery says it (data-ge-language), else its lang's. */
|
|
38
|
+
function languageOf(/** @type {HTMLElement} */ root) {
|
|
39
|
+
const ui = root.getAttribute("data-ge-language");
|
|
40
|
+
return (ui !== null ? ui === "en" : /^en(?:-|$)/i.test(root.lang)) ? "en" : "zh";
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The words a note's data holds (context.readJSON's): its `text`, "" where it has none yet; throws
|
|
45
|
+
* saying why for data that is no note, which the block does not draw over.
|
|
46
|
+
* @param {any} data
|
|
47
|
+
* @returns {string}
|
|
48
|
+
*/
|
|
49
|
+
function textOf(data) {
|
|
50
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) throw new Error("its data is no object: a note holds { \"text\": \"…\" }");
|
|
51
|
+
if (data.text === undefined) return "";
|
|
52
|
+
if (typeof data.text !== "string") throw new Error("its text is no string");
|
|
53
|
+
return data.text;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The note made to hold `text`, one write (context.editJSON): what a reader's words, once they are done
|
|
58
|
+
* with the field, call, and the example too. Whether it was taken.
|
|
59
|
+
* @param {DocComponentContext} context
|
|
60
|
+
* @param {string} text
|
|
61
|
+
*/
|
|
62
|
+
function writeNote(context, text) {
|
|
63
|
+
return context.editJSON("note", (data) => {
|
|
64
|
+
textOf(data);
|
|
65
|
+
data.text = text;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** How many characters `text` holds, its blanks not counted (the head's count). @param {string} text */
|
|
70
|
+
const countOf = (text) => [...text.replace(/\s+/g, "")].length;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The size the face is laid out by: its card's cells (`context.size`), or `fallback` (the manifest's first
|
|
74
|
+
* size) where no card is; and the frame's padding for it, as the soft cards pad theirs: "xs" on a card one
|
|
75
|
+
* cell high, "s" on a small one (2 × 2 and less), "l" on one 3 cells high or more, else "m".
|
|
76
|
+
* @param {DocComponentSize | null | undefined} size
|
|
77
|
+
* @param {[number, number]} fallback
|
|
78
|
+
*/
|
|
79
|
+
function sizeOf(size, fallback) {
|
|
80
|
+
const w = size?.w ?? fallback[0];
|
|
81
|
+
const h = size?.h ?? fallback[1];
|
|
82
|
+
return { w, h, pad: h === 1 ? "xs" : w <= 2 && h <= 2 ? "s" : h >= 3 ? "l" : "m" };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
DocKit.component({
|
|
86
|
+
id: "gallery-soft/note",
|
|
87
|
+
on: ["source", "editable", "layout"],
|
|
88
|
+
mount(host, context) {
|
|
89
|
+
const words = WORDS[languageOf(document.documentElement)];
|
|
90
|
+
const mac = /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);
|
|
91
|
+
const face = document.createElement("div");
|
|
92
|
+
face.className = "gallery-soft-note-face";
|
|
93
|
+
const head = document.createElement("div");
|
|
94
|
+
head.className = "gallery-soft-note-head";
|
|
95
|
+
head.setAttribute("aria-hidden", "true");
|
|
96
|
+
const chip = document.createElement("span");
|
|
97
|
+
chip.className = "gallery-soft-note-chip";
|
|
98
|
+
chip.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M5 4.5h14v9.2L13.7 19H5z"/><path d="M13.5 19v-5.5H19"/><path d="M8.5 8.5h7M8.5 11.5h4"/></svg>';
|
|
99
|
+
const title = document.createElement("span");
|
|
100
|
+
title.className = "gallery-soft-note-title";
|
|
101
|
+
title.textContent = words.label;
|
|
102
|
+
// Its quiet meta at the head's end: how many characters the field holds (its blanks not counted), as the reader types too.
|
|
103
|
+
const meta = document.createElement("span");
|
|
104
|
+
meta.className = "gallery-soft-note-meta";
|
|
105
|
+
head.append(chip, title, meta);
|
|
106
|
+
const field = document.createElement("textarea");
|
|
107
|
+
field.className = "gallery-soft-note-field";
|
|
108
|
+
field.spellcheck = false;
|
|
109
|
+
field.setAttribute("aria-label", words.label);
|
|
110
|
+
// While the reader types: how to keep and how to drop it.
|
|
111
|
+
const hint = document.createElement("div");
|
|
112
|
+
hint.className = "gallery-soft-note-hint";
|
|
113
|
+
hint.setAttribute("aria-hidden", "true");
|
|
114
|
+
const keep = document.createElement("span");
|
|
115
|
+
keep.textContent = words.keep(mac);
|
|
116
|
+
const drop = document.createElement("span");
|
|
117
|
+
drop.textContent = words.drop;
|
|
118
|
+
hint.append(keep, drop);
|
|
119
|
+
face.append(head, field, hint);
|
|
120
|
+
host.append(face);
|
|
121
|
+
const typed = DocKit.input(field, { signal: context.signal, commit: (value) => writeNote(context, value) });
|
|
122
|
+
const recount = () => {
|
|
123
|
+
const count = countOf(field.value);
|
|
124
|
+
const said = count > 0 ? words.count(count) : "";
|
|
125
|
+
if (meta.textContent !== said) meta.textContent = said;
|
|
126
|
+
};
|
|
127
|
+
field.addEventListener("input", recount);
|
|
128
|
+
context.signal?.addEventListener("abort", () => field.removeEventListener("input", recount), { once: true });
|
|
129
|
+
const lay = () => {
|
|
130
|
+
const { w, h, pad } = sizeOf(context.size, [4, 2]);
|
|
131
|
+
face.dataset.w = String(w);
|
|
132
|
+
face.dataset.h = String(h);
|
|
133
|
+
face.dataset.pad = pad;
|
|
134
|
+
const placeholder = w <= 2 ? words.empty : words.emptyWide;
|
|
135
|
+
if (field.placeholder !== placeholder) field.placeholder = placeholder;
|
|
136
|
+
};
|
|
137
|
+
const draw = () => {
|
|
138
|
+
const data = context.readJSON("note");
|
|
139
|
+
if (data === undefined) return; // no JSON: the instance has failed, and Gallery shows what it holds
|
|
140
|
+
let text;
|
|
141
|
+
try {
|
|
142
|
+
text = textOf(data);
|
|
143
|
+
} catch (error) {
|
|
144
|
+
return context.fail(error);
|
|
145
|
+
}
|
|
146
|
+
field.readOnly = !context.canEdit();
|
|
147
|
+
typed.set(text);
|
|
148
|
+
recount();
|
|
149
|
+
};
|
|
150
|
+
lay();
|
|
151
|
+
draw();
|
|
152
|
+
return {
|
|
153
|
+
update(reason) {
|
|
154
|
+
if (reason === "layout") lay();
|
|
155
|
+
else draw();
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
},
|
|
159
|
+
example(host, context) {
|
|
160
|
+
writeNote(context, `${textOf(context.readJSON("note"))}\n再加一行`);
|
|
161
|
+
},
|
|
162
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 120"><defs><linearGradient id="w" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#3e7ac6" stop-opacity=".07"/><stop offset=".52" stop-color="#3e7ac6" stop-opacity="0"/></linearGradient></defs><rect width="240" height="120" rx="8" fill="#f3f3f1"/><rect x="16.5" y="12.5" width="207" height="95" rx="14" fill="#fffcf3" stroke="#e8e7e4"/><rect x="30" y="24" width="14" height="14" rx="4.5" fill="#fdf1df"/><rect x="34" y="30" width="6" height="2" rx="1" fill="#e59a2c"/><rect x="50" y="28" width="26" height="6" rx="3" fill="#37352f"/><rect x="186" y="28" width="18" height="6" rx="3" fill="#c4c2bd"/><rect x="30" y="48" width="150" height="6" rx="3" fill="#4a4843"/><rect x="30" y="58" width="180" height="1" fill="#eadfca"/><rect x="30" y="63" width="120" height="6" rx="3" fill="#4a4843"/><rect x="30" y="73" width="180" height="1" fill="#eadfca"/><rect x="30" y="78" width="92" height="6" rx="3" fill="#4a4843"/><rect x="30" y="88" width="180" height="1" fill="#eadfca"/></svg>
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/* 柔光风格's note. Every selector starts at the instance and goes down a step at a time (>), so that
|
|
2
|
+
nothing here reaches the rest of the page. The soft look's tokens first, light and dark (light-dark():
|
|
3
|
+
the page's color scheme, which follows its theme), then the face: a sheet of paper, its warm fill and
|
|
4
|
+
faint ruled lines the words sit on, one every line of the field's (the lines scroll with its words), a
|
|
5
|
+
head of a warm chip, 便签 and the count at its end, the field under it with no border, fill or ring of its
|
|
6
|
+
own, its placeholder faint (muted while the reader types), the caret the accent; while the field has the
|
|
7
|
+
focus and takes edits, a line at the bottom saying how to keep and drop what was typed. On a custom page
|
|
8
|
+
the face is the card's whole room, taken out over the card's padding and given the soft frame's (20px,
|
|
9
|
+
18px on a 2 × 2 card, 24px on a tall one: the face's data-pad), the board's line around it; where no card
|
|
10
|
+
is (a document, as gallery block check shows it) the face frames itself at the size of a 4 × 2 card. */
|
|
11
|
+
[data-doc-component="gallery-soft/note"] {
|
|
12
|
+
--soft-font: "PingFang SC", "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
|
|
13
|
+
--soft-num: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
14
|
+
--soft-card-line: light-dark(rgb(28 28 32 / 6.5%), rgb(255 255 255 / 7.5%));
|
|
15
|
+
--soft-card-shadow: 0 0 0 1px var(--soft-card-line), 0 1px 2px light-dark(rgb(28 28 32 / 3.5%), rgb(0 0 0 / 0%)), 0 8px 24px -14px light-dark(rgb(28 28 32 / 12%), rgb(0 0 0 / 60%));
|
|
16
|
+
--soft-text: light-dark(#37352f, #d9d9dc);
|
|
17
|
+
--soft-strong: light-dark(#1f1f1f, #f1f1f2);
|
|
18
|
+
--soft-muted: light-dark(#7a7a7f, #9d9da3);
|
|
19
|
+
--soft-faint: light-dark(#ababb0, #66666c);
|
|
20
|
+
--soft-accent: light-dark(#3e7ac6, #7eade2);
|
|
21
|
+
--soft-warm: light-dark(#e59a2c, #f0b257);
|
|
22
|
+
--soft-warm-soft: light-dark(#fdf1df, rgb(240 178 87 / 14%));
|
|
23
|
+
--soft-paper: light-dark(#fffcf3, #232220);
|
|
24
|
+
--soft-paper-line: light-dark(rgb(160 120 40 / 10%), rgb(255 220 150 / 6%));
|
|
25
|
+
--soft-grip-room: 0px;
|
|
26
|
+
> .gallery-soft-note-face {
|
|
27
|
+
--soft-pad: 20px;
|
|
28
|
+
--soft-line: 22px;
|
|
29
|
+
--soft-head: 28px;
|
|
30
|
+
--soft-gap: 10px;
|
|
31
|
+
position: relative;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
width: 304px;
|
|
36
|
+
max-width: 100%;
|
|
37
|
+
height: 144px;
|
|
38
|
+
padding: calc(var(--soft-pad) - var(--soft-edge, 0px));
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
border-radius: 16px;
|
|
41
|
+
box-shadow: var(--soft-card-shadow);
|
|
42
|
+
background: var(--soft-paper);
|
|
43
|
+
color: var(--soft-text);
|
|
44
|
+
font: 13px/1.5 var(--soft-font);
|
|
45
|
+
-webkit-font-smoothing: antialiased;
|
|
46
|
+
}
|
|
47
|
+
> .gallery-soft-note-face[data-pad="s"] { --soft-pad: 18px; --soft-line: 21px; --soft-head: 24px; --soft-gap: 8px; }
|
|
48
|
+
> .gallery-soft-note-face[data-pad="l"] { --soft-pad: 24px; }
|
|
49
|
+
> .gallery-soft-note-face[data-pad="xs"] { padding: 0 calc(16px - var(--soft-edge, 0px)); justify-content: center; }
|
|
50
|
+
> .gallery-soft-note-face > .gallery-soft-note-head {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: 10px;
|
|
54
|
+
flex: none;
|
|
55
|
+
height: 28px;
|
|
56
|
+
min-width: 0;
|
|
57
|
+
padding-inline-end: var(--soft-grip-room);
|
|
58
|
+
}
|
|
59
|
+
> .gallery-soft-note-face > .gallery-soft-note-head > .gallery-soft-note-chip {
|
|
60
|
+
display: grid;
|
|
61
|
+
place-items: center;
|
|
62
|
+
flex: none;
|
|
63
|
+
width: 28px;
|
|
64
|
+
height: 28px;
|
|
65
|
+
border-radius: 8px;
|
|
66
|
+
background: var(--soft-warm-soft);
|
|
67
|
+
color: var(--soft-warm);
|
|
68
|
+
}
|
|
69
|
+
> .gallery-soft-note-face > .gallery-soft-note-head > .gallery-soft-note-chip > svg { display: block; width: 16px; height: 16px; }
|
|
70
|
+
> .gallery-soft-note-face > .gallery-soft-note-head > .gallery-soft-note-title {
|
|
71
|
+
min-width: 0;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
white-space: nowrap;
|
|
74
|
+
text-overflow: ellipsis;
|
|
75
|
+
font-size: 14px;
|
|
76
|
+
font-weight: 600;
|
|
77
|
+
color: var(--soft-strong);
|
|
78
|
+
}
|
|
79
|
+
> .gallery-soft-note-face > .gallery-soft-note-head > .gallery-soft-note-meta:empty { display: none; }
|
|
80
|
+
> .gallery-soft-note-face > .gallery-soft-note-head > .gallery-soft-note-meta {
|
|
81
|
+
flex: none;
|
|
82
|
+
margin-left: auto;
|
|
83
|
+
margin-inline-end: calc(-1 * var(--soft-grip-room));
|
|
84
|
+
font-size: 12px;
|
|
85
|
+
color: var(--soft-muted);
|
|
86
|
+
white-space: nowrap;
|
|
87
|
+
opacity: calc(1 - var(--gallery-grip-shown, 0));
|
|
88
|
+
transition: opacity .12s ease-out;
|
|
89
|
+
}
|
|
90
|
+
> .gallery-soft-note-face[data-pad="s"] > .gallery-soft-note-head { gap: 8px; height: 24px; }
|
|
91
|
+
> .gallery-soft-note-face[data-pad="s"] > .gallery-soft-note-head > .gallery-soft-note-chip { width: 24px; height: 24px; border-radius: 7px; }
|
|
92
|
+
> .gallery-soft-note-face[data-pad="s"] > .gallery-soft-note-head > .gallery-soft-note-chip > svg { width: 14px; height: 14px; }
|
|
93
|
+
> .gallery-soft-note-face[data-pad="s"] > .gallery-soft-note-head > .gallery-soft-note-title { font-size: 13px; }
|
|
94
|
+
/* The field: the paper's ruled lines, one a line of its words, as high as whole lines fit. */
|
|
95
|
+
> .gallery-soft-note-face > .gallery-soft-note-field {
|
|
96
|
+
display: block;
|
|
97
|
+
flex: none;
|
|
98
|
+
box-sizing: border-box;
|
|
99
|
+
width: 100%;
|
|
100
|
+
min-height: 0;
|
|
101
|
+
height: round(down, calc(100% - var(--soft-head) - var(--soft-gap) - var(--soft-hint, 0px)), var(--soft-line));
|
|
102
|
+
margin: var(--soft-gap) 0 0;
|
|
103
|
+
padding: 0;
|
|
104
|
+
border: 0;
|
|
105
|
+
outline: 0;
|
|
106
|
+
resize: none;
|
|
107
|
+
background-color: transparent;
|
|
108
|
+
background-image: linear-gradient(transparent calc(var(--soft-line) - 1px), var(--soft-paper-line) calc(var(--soft-line) - 1px), var(--soft-paper-line) var(--soft-line));
|
|
109
|
+
background-size: 100% var(--soft-line);
|
|
110
|
+
background-attachment: local;
|
|
111
|
+
font: inherit;
|
|
112
|
+
font-size: 13.5px;
|
|
113
|
+
line-height: var(--soft-line);
|
|
114
|
+
color: var(--soft-text);
|
|
115
|
+
caret-color: var(--soft-accent);
|
|
116
|
+
overflow-wrap: break-word;
|
|
117
|
+
scrollbar-width: none;
|
|
118
|
+
}
|
|
119
|
+
> .gallery-soft-note-face[data-pad="s"] > .gallery-soft-note-field { font-size: 13px; }
|
|
120
|
+
> .gallery-soft-note-face > .gallery-soft-note-field::placeholder { color: var(--soft-faint); opacity: 1; }
|
|
121
|
+
> .gallery-soft-note-face > .gallery-soft-note-field:focus::placeholder { color: var(--soft-muted); }
|
|
122
|
+
> .gallery-soft-note-face > .gallery-soft-note-field:read-only { cursor: default; }
|
|
123
|
+
> .gallery-soft-note-face > .gallery-soft-note-hint {
|
|
124
|
+
display: none;
|
|
125
|
+
justify-content: space-between;
|
|
126
|
+
gap: 8px;
|
|
127
|
+
flex: none;
|
|
128
|
+
margin-top: 6px;
|
|
129
|
+
font-size: 11.5px;
|
|
130
|
+
line-height: 18px;
|
|
131
|
+
color: var(--soft-muted);
|
|
132
|
+
white-space: nowrap;
|
|
133
|
+
}
|
|
134
|
+
> .gallery-soft-note-face:has(> .gallery-soft-note-field:focus:not(:read-only)) { --soft-hint: 24px; }
|
|
135
|
+
> .gallery-soft-note-face:has(> .gallery-soft-note-field:focus:not(:read-only)) > .gallery-soft-note-hint { display: flex; margin-top: auto; }
|
|
136
|
+
}
|
|
137
|
+
/* On a custom page: the face over the card's whole room, its padding the soft frame's, the board's line around it; the head's end kept clear of the grip's corner. */
|
|
138
|
+
.gallery-card > [data-doc-component="gallery-soft/note"] { height: 100%; }
|
|
139
|
+
.gallery-card > [data-doc-component="gallery-soft/note"] > .gallery-soft-note-face {
|
|
140
|
+
--soft-edge: 1px;
|
|
141
|
+
--soft-grip-room: max(0px, calc(40px - var(--soft-pad)));
|
|
142
|
+
width: auto;
|
|
143
|
+
max-width: none;
|
|
144
|
+
height: calc(100% + 2 * var(--gallery-card-pad));
|
|
145
|
+
margin: calc(-1 * var(--gallery-card-pad));
|
|
146
|
+
border-radius: calc(var(--gallery-card-radius) - 1px);
|
|
147
|
+
box-shadow: none;
|
|
148
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# 便签 (gallery-soft/note)
|
|
2
|
+
|
|
3
|
+
A card for a custom page (its places are `page`): a few lines the user types on the card itself, kept in the page. Use it where the user wants to jot something down beside the rest of a page (a reminder, a list for today).
|
|
4
|
+
|
|
5
|
+
It is 柔光风格's (the pack `gallery-soft`, off until the user turns it on in 设置 › 组件列表): the same card as Gallery 风格's `gallery/note`, its settings, its data and what the user does on it the same, in the soft look of design A (a faint wash of blue from the card's top, rounded chips, big numbers). Write it only where the user asked for 柔光风格 or the page already holds its cards.
|
|
6
|
+
|
|
7
|
+
## How to write it
|
|
8
|
+
|
|
9
|
+
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 gallery-soft/note`, the instance as template.html has it: its data part, a `<script type="application/json">` holding `{"text":"…"}` (on one line and compact, as the block writes it back), the note's words, lines apart with `\n`; `{"text":""}` for an empty one, which shows 写点什么.
|
|
10
|
+
|
|
11
|
+
- Leave the words of a note that is there alone: they are the user's. To start one with words of yours (a list the user asked for), write them in `text`, as example.html does.
|
|
12
|
+
- Sizes: 4 × 2 (the default), 2 × 2 and 4 × 4 are the ones its menu lists; any height from 2 to 8 cells, 2 to 4 wide, is one too (the card's corner reaches each). Words that do not fit scroll inside the card.
|
|
13
|
+
|
|
14
|
+
## What the user does
|
|
15
|
+
|
|
16
|
+
They click the card and type. What they typed is written to the page once they leave the card, or press Ctrl+Enter (⌘Enter on a Mac); Enter alone starts a new line, and Esc puts back what was there. Each write is one step of the page's undo. Nothing is written while a Chinese input method is composing.
|
|
17
|
+
|
|
18
|
+
## How it looks
|
|
19
|
+
|
|
20
|
+
A sheet of paper: the paper's warm fill and faint ruled lines the words sit on, a head of a warm chip, 便签 and how many characters it holds (65 字) at its end, the words under it in the page's font, as many lines as the card holds whole; an empty one says 写点什么 (on a wide card 写点什么,比如今天要记住的事), faint; while the user types, a line at the bottom says how to keep and how to drop it (Ctrl+Enter 保存, Esc 放弃); in 柔光风格's soft look (as every card of it: a faint wash of blue from the card's top, a head of a rounded tinted chip and a title, its end clear of the card's grip), light and dark. Where nothing can be written (an export) the words show read-only. 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-soft/recent",
|
|
3
|
+
"apiVersion": 1,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"name": { "zh": "最近编辑", "en": "Recently edited" },
|
|
6
|
+
"description": { "zh": "最近改过的文档,像侧栏一样一行一篇,点一篇就打开它", "en": "The documents edited last, a row each as in the sidebar: click one to open it" },
|
|
7
|
+
"words": "zuijinbianji zuijin bianji recent recently edited documents 最近 最近编辑 文档 改过",
|
|
8
|
+
"parts": {},
|
|
9
|
+
"runtime": { "generated": [":scope > .gallery-soft-recent-face"] },
|
|
10
|
+
"places": ["page"],
|
|
11
|
+
"card": { "sizes": [[4, 4], [4, 2], [4, 6]], "min": { "w": 4, "h": 2 }, "max": { "w": 4, "h": 8 }, "resize": true },
|
|
12
|
+
"needs": ["workspace"]
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<div data-doc-component="gallery-soft/recent"></div>
|