@heycys/gallery 0.1.1 → 0.2.0
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/columns/page.mjs +4 -4
- package/browser/editor/components/embed/index.mjs +2 -2
- package/browser/editor/components/embed/page.mjs +1 -1
- package/browser/editor/components/file/page.mjs +4 -4
- package/browser/editor/components/flowchart/add.mjs +7 -6
- package/browser/editor/components/flowchart/page.mjs +1 -1
- package/browser/editor/components/heading/index.mjs +7 -6
- package/browser/editor/components/icons.mjs +11 -0
- package/browser/editor/components/image/crop.mjs +6 -9
- 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 +15 -4
- package/browser/editor/components/installed/page.mjs +103 -25
- package/browser/editor/components/installed/served.mjs +6 -5
- package/browser/editor/components/instances.mjs +18 -0
- package/browser/editor/components/list/page.mjs +3 -6
- 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 +30 -9
- package/browser/editor/components/table/index.mjs +61 -2
- package/browser/editor/components/table/page.mjs +1 -1
- package/browser/editor/page/after/index.mjs +288 -0
- package/browser/editor/page/align.mjs +91 -0
- package/browser/editor/page/annotate/card.mjs +3 -6
- package/browser/editor/page/autosave.mjs +310 -37
- 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/client.mjs +57 -0
- package/browser/editor/page/board/hint.mjs +182 -0
- package/browser/editor/page/board/history.mjs +119 -0
- package/browser/editor/page/board/index.mjs +1059 -0
- package/browser/editor/page/board/motion.mjs +177 -0
- package/browser/editor/page/board/settings.mjs +210 -0
- package/browser/editor/page/caret.mjs +1 -1
- package/browser/editor/page/changes/bar.mjs +6 -14
- package/browser/editor/page/changes/index.mjs +2 -2
- package/browser/editor/page/clipboard/import/html.mjs +29 -6
- package/browser/editor/page/clipboard/import/inline.mjs +32 -0
- package/browser/editor/page/clipboard/import/markdown.mjs +58 -13
- package/browser/editor/page/clipboard/import/read.mjs +6 -1
- package/browser/editor/page/clipboard/import/to-blocks.mjs +44 -12
- package/browser/editor/page/clipboard/import/yuque.mjs +622 -0
- package/browser/editor/page/clipboard/index.mjs +133 -15
- package/browser/editor/page/clipboard/own/blocks.mjs +13 -14
- package/browser/editor/page/clipboard/own/chart-keys.mjs +41 -28
- package/browser/editor/page/clipboard/own/describe.mjs +6 -2
- package/browser/editor/page/clipboard/own/selection.mjs +1 -1
- package/browser/editor/page/columns/index.mjs +48 -46
- package/browser/editor/page/commit.mjs +80 -22
- package/browser/editor/page/conflicts.mjs +7 -7
- package/browser/editor/page/core.mjs +34 -16
- package/browser/editor/page/custom-page.mjs +110 -0
- package/browser/editor/page/editor.mjs +71 -17
- package/browser/editor/page/emoji-picker/styles.mjs +7 -12
- package/browser/editor/page/emoji-picker/upload.mjs +2 -2
- package/browser/editor/page/handle/index.mjs +5 -8
- package/browser/editor/page/history.mjs +41 -6
- package/browser/editor/page/insert/index.mjs +20 -22
- package/browser/editor/page/links/index.mjs +5 -3
- package/browser/editor/page/links/pages.mjs +27 -9
- package/browser/editor/page/look.mjs +54 -3
- package/browser/editor/page/margin.mjs +18 -3
- package/browser/editor/page/media-menu/index.mjs +6 -7
- package/browser/editor/page/menu.mjs +33 -14
- package/browser/editor/page/notices.mjs +2 -2
- package/browser/editor/page/page-objects.mjs +9 -2
- package/browser/editor/page/panel.mjs +4 -9
- package/browser/editor/page/present-links.mjs +15 -5
- package/browser/editor/page/present-shell.mjs +63 -0
- package/browser/editor/page/resize/index.mjs +42 -29
- package/browser/editor/page/selection/index.mjs +10 -2
- package/browser/editor/page/served.mjs +14 -0
- package/browser/editor/page/session.mjs +48 -4
- package/browser/editor/page/slash-menu/index.mjs +3 -3
- package/browser/editor/page/table/binding.mjs +87 -0
- package/browser/editor/page/table/cells.mjs +102 -46
- package/browser/editor/page/table/index.mjs +24 -9
- package/browser/editor/page/table/pictures.mjs +299 -0
- package/browser/editor/page/table/views.mjs +103 -0
- package/browser/editor/page/table/widths.mjs +82 -10
- package/browser/editor/page/text-select/index.mjs +26 -12
- package/browser/editor/page/todo-writes.mjs +75 -0
- package/browser/editor/page/typing/index.mjs +97 -15
- package/browser/editor/page/typing/leave.mjs +19 -5
- package/browser/editor/page/ui.mjs +13 -0
- package/browser/shared/block-packs.mjs +419 -0
- package/browser/shared/board-places.mjs +224 -0
- package/browser/shared/card-size.mjs +59 -0
- package/browser/shared/colors.mjs +3 -2
- package/browser/shared/component-catalog.mjs +330 -46
- package/browser/shared/component-source.mjs +39 -0
- package/browser/shared/components/heading.mjs +2 -1
- package/browser/shared/components/index.mjs +12 -3
- package/browser/shared/components/installed.mjs +35 -3
- package/browser/shared/components/page.mjs +20 -8
- package/browser/shared/components/paragraph.mjs +8 -1
- package/browser/shared/components/state.mjs +5 -1
- package/browser/shared/components/table.mjs +1 -0
- package/browser/shared/document-look.mjs +10 -5
- package/browser/shared/drafts.mjs +432 -0
- package/browser/shared/emoji/line-icons.mjs +37 -0
- package/browser/shared/extension-sidebar.mjs +126 -0
- package/browser/shared/extensions.mjs +79 -0
- package/browser/shared/file-table.mjs +101 -0
- package/browser/shared/http.mjs +9 -0
- package/browser/shared/i18n/en.mjs +330 -27
- package/browser/shared/json-layout.mjs +47 -0
- package/browser/shared/net-cache.mjs +133 -0
- package/browser/shared/net-keys.mjs +32 -0
- package/browser/shared/net-policy.mjs +177 -0
- package/browser/shared/outline-shape.mjs +128 -0
- package/browser/shared/outline.mjs +359 -67
- package/browser/shared/pack-manifest.mjs +88 -0
- package/browser/shared/page-address.mjs +6 -3
- package/browser/shared/page-cards.mjs +308 -0
- package/browser/shared/page-links.mjs +69 -6
- package/browser/shared/pages.mjs +500 -0
- package/browser/shared/paths.mjs +6 -0
- package/browser/shared/pinyin.mjs +92 -0
- package/browser/shared/present-step.mjs +17 -0
- package/browser/shared/preview-server.mjs +3 -7
- package/browser/shared/session.mjs +8 -1
- package/browser/shared/shipped-blocks.mjs +299 -0
- package/browser/shared/sidebar-head.mjs +70 -0
- package/browser/shared/table-chart.mjs +33 -1
- package/browser/shared/todos.mjs +83 -0
- package/browser/shared/user-directory.mjs +24 -0
- package/browser/shared/versions.mjs +14 -0
- package/browser/shared/web-links.mjs +139 -0
- package/browser/shared/workspace-columns.mjs +120 -0
- package/browser/shared/workspace-name.mjs +154 -0
- package/browser/shared/workspace-query.mjs +125 -0
- package/browser/shared/workspace-registry.mjs +272 -0
- package/browser/shared/workspace.mjs +171 -20
- package/dist/chunk-2OHANJ6Q.mjs +2 -0
- package/dist/chunk-3MBRL2PM.mjs +16 -0
- package/dist/chunk-4OKWZY5E.mjs +2 -0
- package/dist/chunk-4OZWXZE5.mjs +5 -0
- package/dist/chunk-5K44HLTZ.mjs +2 -0
- package/dist/{chunk-5ZKJ3H4P.mjs → chunk-5XA2ZBAE.mjs} +3 -3
- package/dist/{chunk-4FS7Z7WR.mjs → chunk-67N2QJYT.mjs} +1 -1
- package/dist/chunk-6KBYRA2C.mjs +2 -0
- package/dist/chunk-6N3PX4XX.mjs +8 -0
- package/dist/{chunk-V5JTW2LH.mjs → chunk-6QBHU4DF.mjs} +1 -1
- package/dist/chunk-7JDX4E65.mjs +13 -0
- package/dist/chunk-7M2BQQGZ.mjs +2 -0
- package/dist/chunk-7OG26PGF.mjs +2 -0
- package/dist/chunk-AHN3NFKJ.mjs +3 -0
- package/dist/chunk-ALZ6ZENZ.mjs +3 -0
- package/dist/chunk-AR5D57ZD.mjs +170 -0
- package/dist/{chunk-W3BGBJQW.mjs → chunk-BFJGHSQN.mjs} +1 -1
- package/dist/{chunk-LS4F7JUM.mjs → chunk-BZ5RAF7L.mjs} +1 -1
- package/dist/chunk-CMA72MAG.mjs +2 -0
- package/dist/{chunk-LCTHTZIL.mjs → chunk-DAZL73VK.mjs} +91 -91
- package/dist/{chunk-Y6RLRPG3.mjs → chunk-DJISHPUL.mjs} +1 -1
- package/dist/chunk-DR73Y2UJ.mjs +3 -0
- package/dist/{chunk-FDLXYYG4.mjs → chunk-EAIFITAV.mjs} +1 -1
- package/dist/{chunk-TMYZB6AV.mjs → chunk-EKNHM3P4.mjs} +1 -1
- package/dist/chunk-EP25HDAJ.mjs +2 -0
- package/dist/{chunk-GB5SOYQJ.mjs → chunk-ERLAIBOA.mjs} +2 -2
- package/dist/chunk-EURLTOTZ.mjs +4 -0
- package/dist/chunk-F4ZA6JRZ.mjs +3 -0
- package/dist/chunk-F6HVDZR4.mjs +2 -0
- package/dist/chunk-FDMAXMQA.mjs +2 -0
- package/dist/chunk-FETSREUN.mjs +5 -0
- package/dist/chunk-GHOYKMQ3.mjs +4 -0
- package/dist/{chunk-2B5E4CDJ.mjs → chunk-GPIWQ4X4.mjs} +1 -1
- package/dist/chunk-HDWTZ763.mjs +12 -0
- package/dist/chunk-HPOI4ZX7.mjs +6 -0
- package/dist/{chunk-BGGDRNYQ.mjs → chunk-HXG7EOPJ.mjs} +1 -1
- package/dist/chunk-IA4PSIMD.mjs +2 -0
- package/dist/{chunk-E7LWZRXY.mjs → chunk-ITOH5EGO.mjs} +1 -1
- package/dist/chunk-IV64FFI4.mjs +2 -0
- package/dist/chunk-J43Z6LSS.mjs +2 -0
- package/dist/chunk-J5PUIV3Y.mjs +4 -0
- package/dist/chunk-JA7G53PC.mjs +2 -0
- package/dist/chunk-JEUK3ZO7.mjs +2 -0
- package/dist/chunk-JLTZF4LA.mjs +2 -0
- package/dist/chunk-JZT7I2OJ.mjs +2 -0
- package/dist/chunk-K5XATEOO.mjs +2 -0
- package/dist/chunk-L2SUIS5S.mjs +2 -0
- package/dist/chunk-L7UP52JO.mjs +2 -0
- package/dist/chunk-LM4XFQHZ.mjs +2 -0
- package/dist/chunk-MN7BZL4R.mjs +2 -0
- package/dist/chunk-MTYYHM2G.mjs +15 -0
- package/dist/chunk-MXUBKDRO.mjs +15 -0
- package/dist/chunk-NAMN3RAF.mjs +2 -0
- package/dist/{chunk-SYGN7GLU.mjs → chunk-OEXWRJME.mjs} +1 -1
- package/dist/chunk-OFHXGWOX.mjs +2 -0
- package/dist/chunk-ORID3AE7.mjs +166 -0
- package/dist/chunk-PAREWQGB.mjs +4 -0
- package/dist/chunk-PGDE24N5.mjs +2 -0
- package/dist/chunk-POTA2FV4.mjs +2 -0
- package/dist/chunk-PUOQ65NC.mjs +2 -0
- package/dist/chunk-Q4UEPUWF.mjs +2 -0
- package/dist/chunk-QE5RG76S.mjs +549 -0
- package/dist/chunk-R2ZDLJYT.mjs +10 -0
- package/dist/{chunk-7DTINW6U.mjs → chunk-SQ6Y2ZMA.mjs} +2 -2
- package/dist/chunk-SWUTTZCN.mjs +2 -0
- package/dist/chunk-TANZRINB.mjs +2 -0
- package/dist/chunk-TR7TWGHB.mjs +2 -0
- package/dist/chunk-U5XL7D6A.mjs +3 -0
- package/dist/{chunk-XNROSH2T.mjs → chunk-U7NZI6N4.mjs} +2 -2
- package/dist/chunk-UGWMMEJ5.mjs +15 -0
- package/dist/chunk-UJQJKNGK.mjs +2 -0
- package/dist/chunk-UYVCQK3H.mjs +22 -0
- package/dist/chunk-VFX2KNHP.mjs +4 -0
- package/dist/chunk-VS7JIGJW.mjs +24 -0
- package/dist/chunk-W7665ZEC.mjs +6 -0
- package/dist/chunk-WQDQWCX5.mjs +2 -0
- package/dist/chunk-YI43RG4P.mjs +2 -0
- package/dist/chunk-YLPSMDIS.mjs +5 -0
- package/dist/chunk-YNAWBAYN.mjs +3 -0
- package/dist/chunk-YROX2O22.mjs +2 -0
- package/dist/chunk-ZDLPUOAG.mjs +6 -0
- package/dist/{chunk-IVDLMMBD.mjs → chunk-ZHEHPMBK.mjs} +1 -1
- package/dist/chunk-ZQS6H473.mjs +16 -0
- package/dist/chunk-ZTHICSSF.mjs +2 -0
- package/dist/chunk-ZWWC4KLF.mjs +20 -0
- package/dist/cli.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/{chunk-U6KNPJPR.mjs → update-fetch.mjs} +1 -1
- package/dist/worker.mjs +1 -1
- package/kit/board.css +95 -0
- package/kit/board.js +250 -0
- package/kit/charts.js +5 -71
- package/kit/code.js +17 -17
- package/kit/report.css +335 -18
- package/kit/runtime.js +1638 -125
- package/kit/state.js +10 -1
- package/kit/tables.js +130 -43
- package/kit/ui.js +79 -35
- package/package.json +2 -1
- package/packs/gallery/card/component.json +14 -0
- package/packs/gallery/card/example.html +10 -0
- package/packs/gallery/card/preview.svg +1 -0
- package/packs/gallery/card/style.css +6 -0
- package/packs/gallery/card/template.html +6 -0
- package/packs/gallery/card/writing.md +14 -0
- package/packs/gallery/chart-card/component.json +15 -0
- package/packs/gallery/chart-card/example.html +14 -0
- package/packs/gallery/chart-card/kit.js +130 -0
- package/packs/gallery/chart-card/preview.svg +1 -0
- package/packs/gallery/chart-card/style.css +42 -0
- package/packs/gallery/chart-card/template.html +13 -0
- package/packs/gallery/chart-card/writing.md +20 -0
- package/packs/gallery/chart-view/component.json +20 -0
- package/packs/gallery/chart-view/example.html +13 -0
- package/packs/gallery/chart-view/kit.js +355 -0
- package/packs/gallery/chart-view/preview.svg +1 -0
- package/packs/gallery/chart-view/style.css +94 -0
- package/packs/gallery/chart-view/template.html +3 -0
- package/packs/gallery/chart-view/writing.md +22 -0
- package/packs/gallery/countdown/component.json +18 -0
- package/packs/gallery/countdown/example.html +3 -0
- package/packs/gallery/countdown/kit.js +216 -0
- package/packs/gallery/countdown/preview.svg +1 -0
- package/packs/gallery/countdown/style.css +118 -0
- package/packs/gallery/countdown/template.html +3 -0
- package/packs/gallery/countdown/writing.md +22 -0
- package/packs/gallery/habit/component.json +14 -0
- package/packs/gallery/habit/example.html +3 -0
- package/packs/gallery/habit/kit.js +334 -0
- package/packs/gallery/habit/preview.svg +1 -0
- package/packs/gallery/habit/style.css +174 -0
- package/packs/gallery/habit/template.html +3 -0
- package/packs/gallery/habit/writing.md +21 -0
- package/packs/gallery/heatmap/component.json +18 -0
- package/packs/gallery/heatmap/example.html +3 -0
- package/packs/gallery/heatmap/kit.js +513 -0
- package/packs/gallery/heatmap/preview.svg +1 -0
- package/packs/gallery/heatmap/style.css +189 -0
- package/packs/gallery/heatmap/template.html +3 -0
- package/packs/gallery/heatmap/writing.md +21 -0
- package/packs/gallery/kanban/component.json +18 -0
- package/packs/gallery/kanban/example.html +12 -0
- package/packs/gallery/kanban/kit.js +540 -0
- package/packs/gallery/kanban/preview.svg +1 -0
- package/packs/gallery/kanban/style.css +212 -0
- package/packs/gallery/kanban/template.html +3 -0
- package/packs/gallery/kanban/writing.md +20 -0
- package/packs/gallery/metric/component.json +22 -0
- package/packs/gallery/metric/example.html +15 -0
- package/packs/gallery/metric/kit.js +248 -0
- package/packs/gallery/metric/preview.svg +1 -0
- package/packs/gallery/metric/style.css +92 -0
- package/packs/gallery/metric/template.html +3 -0
- package/packs/gallery/metric/writing.md +23 -0
- package/packs/gallery/note/component.json +14 -0
- package/packs/gallery/note/example.html +3 -0
- package/packs/gallery/note/kit.js +129 -0
- package/packs/gallery/note/preview.svg +1 -0
- package/packs/gallery/note/style.css +97 -0
- package/packs/gallery/note/template.html +3 -0
- package/packs/gallery/note/writing.md +18 -0
- package/packs/gallery/pack.json +8 -0
- package/packs/gallery/recent/component.json +13 -0
- package/packs/gallery/recent/example.html +1 -0
- package/packs/gallery/recent/kit.js +293 -0
- package/packs/gallery/recent/preview.svg +1 -0
- package/packs/gallery/recent/style.css +85 -0
- package/packs/gallery/recent/template.html +1 -0
- package/packs/gallery/recent/writing.md +15 -0
- package/packs/gallery/static/component.json +13 -0
- package/packs/gallery/static/example.html +11 -0
- package/packs/gallery/static/preview.svg +1 -0
- package/packs/gallery/static/style.css +171 -0
- package/packs/gallery/static/template.html +1 -0
- package/packs/gallery/static/writing.md +18 -0
- package/packs/gallery/stats/component.json +13 -0
- package/packs/gallery/stats/example.html +1 -0
- package/packs/gallery/stats/kit.js +347 -0
- package/packs/gallery/stats/preview.svg +1 -0
- package/packs/gallery/stats/style.css +73 -0
- package/packs/gallery/stats/template.html +1 -0
- package/packs/gallery/stats/writing.md +11 -0
- package/packs/gallery/today/component.json +12 -0
- package/packs/gallery/today/example.html +1 -0
- package/packs/gallery/today/kit.js +220 -0
- package/packs/gallery/today/preview.svg +1 -0
- package/packs/gallery/today/style.css +149 -0
- package/packs/gallery/today/template.html +1 -0
- package/packs/gallery/today/writing.md +14 -0
- package/packs/gallery/todos/component.json +19 -0
- package/packs/gallery/todos/example.html +3 -0
- package/packs/gallery/todos/kit.js +489 -0
- package/packs/gallery/todos/preview.svg +1 -0
- package/packs/gallery/todos/style.css +214 -0
- package/packs/gallery/todos/template.html +3 -0
- package/packs/gallery/todos/writing.md +30 -0
- package/packs/gallery/weather/component.json +19 -0
- package/packs/gallery/weather/example.html +3 -0
- package/packs/gallery/weather/kit.js +387 -0
- package/packs/gallery/weather/preview.svg +1 -0
- package/packs/gallery/weather/style.css +140 -0
- package/packs/gallery/weather/template.html +3 -0
- package/packs/gallery/weather/writing.md +26 -0
- 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/pack.json +8 -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 +12 -10
- package/sdk/doc-kit.d.ts +396 -5
- package/sdk/doc-state.d.ts +2 -0
- package/skill/SKILL.md +56 -23
- package/skill/references/block-script.md +140 -0
- package/skill/references/building-blocks.md +257 -0
- package/skill/references/extensions.md +59 -0
- package/skill/references/pages-and-data.md +225 -0
- package/skill/references/writing-html.md +8 -4
- package/skill/sdk/doc-kit.d.ts +396 -5
- package/skill/sdk/doc-state.d.ts +2 -0
- package/web/assets/index-BM_K-Auu.css +1 -0
- package/web/assets/index-DRslOBiv.js +15 -0
- package/web/index.html +2 -2
- package/dist/chunk-3HIRPVLU.mjs +0 -2
- package/dist/chunk-5MHMDLZD.mjs +0 -4
- package/dist/chunk-64K7IPLO.mjs +0 -255
- package/dist/chunk-6QXGZM36.mjs +0 -8
- package/dist/chunk-6RGJOMJP.mjs +0 -16
- package/dist/chunk-AJ73XJF3.mjs +0 -2
- package/dist/chunk-AUZGSZJH.mjs +0 -13
- package/dist/chunk-BFE45AKL.mjs +0 -2
- package/dist/chunk-BXO2ZY5P.mjs +0 -2
- package/dist/chunk-CEH4MRCC.mjs +0 -2
- package/dist/chunk-CY2FNNAB.mjs +0 -16
- package/dist/chunk-DFUDV4LX.mjs +0 -2
- package/dist/chunk-DKXG4XDG.mjs +0 -2
- package/dist/chunk-EZQ34M3F.mjs +0 -124
- package/dist/chunk-EZY3WC6Z.mjs +0 -15
- package/dist/chunk-FUKQNOQS.mjs +0 -9
- package/dist/chunk-JPOSLGOC.mjs +0 -6
- package/dist/chunk-JVHHHGEA.mjs +0 -3
- package/dist/chunk-L3QKH4OK.mjs +0 -26
- package/dist/chunk-LAE5NQ4B.mjs +0 -2
- package/dist/chunk-LEF6DRCK.mjs +0 -59
- package/dist/chunk-NO5NJCHO.mjs +0 -2
- package/dist/chunk-NQPVAU63.mjs +0 -2
- package/dist/chunk-NSKUTQ5J.mjs +0 -5
- package/dist/chunk-O35FIXRB.mjs +0 -2
- package/dist/chunk-P2CAZPDP.mjs +0 -3
- package/dist/chunk-PL6GHLGD.mjs +0 -15
- package/dist/chunk-QJIR2BLP.mjs +0 -6
- package/dist/chunk-QUPLVPB2.mjs +0 -7
- package/dist/chunk-R7BNENLY.mjs +0 -4
- package/dist/chunk-S6O4UHLC.mjs +0 -2
- package/dist/chunk-SGJWQKEI.mjs +0 -2
- package/dist/chunk-TX6JH7TR.mjs +0 -2
- package/dist/chunk-TYK6VNAB.mjs +0 -10
- package/dist/chunk-UALRNVSE.mjs +0 -4
- package/dist/chunk-V3HXVQEM.mjs +0 -2
- package/dist/chunk-V5VXUJKG.mjs +0 -2
- package/dist/chunk-VBXMADMP.mjs +0 -2
- package/dist/chunk-VNV55RUA.mjs +0 -2
- package/dist/chunk-VPD2PS35.mjs +0 -2
- package/dist/chunk-W4VKN3GF.mjs +0 -7
- package/dist/chunk-W5BXXPDJ.mjs +0 -3
- package/dist/chunk-XUNHRCOG.mjs +0 -6
- package/skill/references/building-components.md +0 -367
- package/web/assets/index-Bh74DfsV.css +0 -1
- package/web/assets/index-UW0RyFFt.js +0 -13
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// gallery/today (问候与日期): a greeting by the hour of the reader's clock (早上好 from 5 to 11, 下午好
|
|
2
|
+
// from 12 to 17, 晚上好 from 18 to 4), today's date and its weekday, in the page's language and in the
|
|
3
|
+
// order it writes them (11月7日 星期六, Saturday, November 7: as the countdown's foot writes a date): the
|
|
4
|
+
// UI's where Gallery says it (data-ge-language on the root), else English for a page whose lang is en,
|
|
5
|
+
// else Chinese, the kit's own rule. Drawn again by the kit's clock (`clock`): at each whole minute, which
|
|
6
|
+
// moves the greeting on as the hour turns, and as a day begins, which moves the date; one timer for
|
|
7
|
+
// every block on the page, none of its own. It holds no part and writes nothing: all it shows is drawn
|
|
8
|
+
// (the manifest's `runtime`), and a file holds the bare instance.
|
|
9
|
+
//
|
|
10
|
+
// Its face (the pack's design B, notes/plans/block-packs-plan-2026-11-09.md) is laid out by its card's
|
|
11
|
+
// cells (`context.size`, read again on `layout`: the face's `data-layout`, style.css): a card 3 or more
|
|
12
|
+
// wide and 2 or more high ("full", the 4 × 2 default) has a head of the chip (the sun from 5 to 17 in its
|
|
13
|
+
// warm color, the moon after it in the accent's), the date and the number of the week (ISO 8601's,
|
|
14
|
+
// `weekNumberOf`: 第 46 周) as its quiet meta, the greeting large under it, and the week it is in at the
|
|
15
|
+
// bottom, Monday to Sunday, each day's initial over its date, the days gone fainter, today's 今 (Today)
|
|
16
|
+
// over its date on the accent (`weekOf`, for the eye alone: the date says it); a narrow card ("narrow",
|
|
17
|
+
// 2 wide) is a page of a desk calendar, the greeting in its head, today's day of the month large at the
|
|
18
|
+
// bottom and its weekday and month under it; a card one cell high ("line", 4 × 1) a line, the chip, the
|
|
19
|
+
// greeting and the date. A soft glow from the card's top left, the sun's warm color by day, the accent's
|
|
20
|
+
// in the evening (the face's `data-sky`), the one mood of a home page. The date line's weekday is
|
|
21
|
+
// marked (gallery-today-weekday), a piece a line breaks before and never inside.
|
|
22
|
+
|
|
23
|
+
const WORDS = {
|
|
24
|
+
zh: {
|
|
25
|
+
morning: "早上好",
|
|
26
|
+
afternoon: "下午好",
|
|
27
|
+
evening: "晚上好",
|
|
28
|
+
weekdays: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
|
|
29
|
+
initials: ["日", "一", "二", "三", "四", "五", "六"],
|
|
30
|
+
today: "今",
|
|
31
|
+
week: (/** @type {number} */ number) => `第 ${number} 周`,
|
|
32
|
+
/** The date and its weekday as the language writes them, pieces a line breaks between. @param {number} month @param {number} day @param {string} weekday */
|
|
33
|
+
line: (month, day, weekday) => [`${month}月${day}日`, weekday],
|
|
34
|
+
/** Which of the line's pieces is the weekday. */
|
|
35
|
+
weekdayAt: 1,
|
|
36
|
+
/** A desk calendar's foot: the weekday, then the month. @param {number} month @param {string} weekday */
|
|
37
|
+
foot: (month, weekday) => [weekday, `${month}月`],
|
|
38
|
+
},
|
|
39
|
+
en: {
|
|
40
|
+
morning: "Good morning",
|
|
41
|
+
afternoon: "Good afternoon",
|
|
42
|
+
evening: "Good evening",
|
|
43
|
+
weekdays: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
44
|
+
initials: ["S", "M", "T", "W", "T", "F", "S"],
|
|
45
|
+
today: "Today",
|
|
46
|
+
week: (/** @type {number} */ number) => `Week ${number}`,
|
|
47
|
+
/** The weekday first: Saturday, November 7. @param {number} month @param {number} day @param {string} weekday */
|
|
48
|
+
line: (month, day, weekday) => [`${weekday},`, `${MONTHS[month - 1]} ${day}`],
|
|
49
|
+
weekdayAt: 0,
|
|
50
|
+
/** @param {number} month @param {string} weekday */
|
|
51
|
+
foot: (month, weekday) => [weekday, MONTHS[month - 1].slice(0, 3)],
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
const MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
55
|
+
|
|
56
|
+
/** The language the page speaks: the UI's where Gallery says it (data-ge-language), else its lang's. */
|
|
57
|
+
function languageOf(/** @type {HTMLElement} */ root) {
|
|
58
|
+
const ui = root.getAttribute("data-ge-language");
|
|
59
|
+
return (ui !== null ? ui === "en" : /^en(?:-|$)/i.test(root.lang)) ? "en" : "zh";
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The part of the day an hour (0 to 23) is in, as the greeting says it: morning from 5 to 11,
|
|
64
|
+
* afternoon from 12 to 17, evening from 18 to 4.
|
|
65
|
+
* @param {number} hour
|
|
66
|
+
* @returns {"morning" | "afternoon" | "evening"}
|
|
67
|
+
*/
|
|
68
|
+
function partOfDay(hour) {
|
|
69
|
+
if (hour >= 5 && hour < 12) return "morning";
|
|
70
|
+
if (hour >= 12 && hour < 18) return "afternoon";
|
|
71
|
+
return "evening";
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* What the card says at `now` (the reader's clock) in `language`: the greeting, the date line (its
|
|
76
|
+
* month and day and the weekday, in the language's order, a list of words a line breaks between and
|
|
77
|
+
* never inside), and the date as a <time> names it (YYYY-MM-DD).
|
|
78
|
+
* @param {Date} now
|
|
79
|
+
* @param {"zh" | "en"} language
|
|
80
|
+
*/
|
|
81
|
+
function faceOf(now, language) {
|
|
82
|
+
const words = WORDS[language];
|
|
83
|
+
const two = (/** @type {number} */ value) => String(value).padStart(2, "0");
|
|
84
|
+
return {
|
|
85
|
+
greeting: words[partOfDay(now.getHours())],
|
|
86
|
+
line: words.line(now.getMonth() + 1, now.getDate(), words.weekdays[now.getDay()]),
|
|
87
|
+
datetime: `${now.getFullYear()}-${two(now.getMonth() + 1)}-${two(now.getDate())}`,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* How a card of `size` (context.size: its cells, or null where no card holds it, a document) lays its face
|
|
93
|
+
* out: "line" one cell high, "narrow" two wide or less, else "full".
|
|
94
|
+
* @param {{ w: number, h: number } | null | undefined} size
|
|
95
|
+
* @returns {"full" | "narrow" | "line"}
|
|
96
|
+
*/
|
|
97
|
+
function layoutOf(size) {
|
|
98
|
+
if (!size) return "full";
|
|
99
|
+
if (size.h <= 1) return "line";
|
|
100
|
+
return size.w <= 2 ? "narrow" : "full";
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// The chip's two pictures, 24 x 24 lines in the chip's ink: the sun by day, the moon in the evening.
|
|
104
|
+
const PICTURES = {
|
|
105
|
+
sun: '<circle cx="12" cy="12" r="4"/><path d="M12 2.8v1.9M12 19.3v1.9M2.8 12h1.9M19.3 12h1.9M5.5 5.5l1.3 1.3M17.2 17.2l1.3 1.3M5.5 18.5l1.3-1.3M17.2 6.8l1.3-1.3"/>',
|
|
106
|
+
moon: '<path d="M19.5 14.3A7.8 7.8 0 0 1 9.7 4.5a7.8 7.8 0 1 0 9.8 9.8z"/>',
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The week `now` is in, Monday first, as the card's strip draws it in `language`: seven of { initial (the
|
|
111
|
+
* weekday's, today's 今 or Today), date (the day of the month), today, past (a day before today) }.
|
|
112
|
+
* @param {Date} now
|
|
113
|
+
* @param {"zh" | "en"} language
|
|
114
|
+
*/
|
|
115
|
+
function weekOf(now, language) {
|
|
116
|
+
const monday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - ((now.getDay() + 6) % 7), 12);
|
|
117
|
+
return Array.from({ length: 7 }, (_, index) => {
|
|
118
|
+
const day = new Date(monday.getFullYear(), monday.getMonth(), monday.getDate() + index, 12);
|
|
119
|
+
const today = index === (now.getDay() + 6) % 7;
|
|
120
|
+
return { initial: today ? WORDS[language].today : WORDS[language].initials[day.getDay()], date: day.getDate(), today, past: index < (now.getDay() + 6) % 7 };
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* The number of the week `now` is in, as ISO 8601 counts them (the week a year's first Thursday is in its
|
|
126
|
+
* first, Monday its first day), 1 to 53.
|
|
127
|
+
* @param {Date} now
|
|
128
|
+
*/
|
|
129
|
+
function weekNumberOf(now) {
|
|
130
|
+
const thursday = new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate()));
|
|
131
|
+
thursday.setUTCDate(thursday.getUTCDate() + 3 - ((thursday.getUTCDay() + 6) % 7)); // the Thursday of its week, which says the year
|
|
132
|
+
const first = Date.UTC(thursday.getUTCFullYear(), 0, 1);
|
|
133
|
+
return Math.ceil(((thursday.getTime() - first) / 86_400_000 + 1) / 7);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* An element of the face, of `kind` (its class).
|
|
138
|
+
* @template {keyof HTMLElementTagNameMap} K
|
|
139
|
+
* @param {K} tag
|
|
140
|
+
* @param {string} kind
|
|
141
|
+
*/
|
|
142
|
+
function made(tag, kind) {
|
|
143
|
+
const node = document.createElement(tag);
|
|
144
|
+
node.className = `gallery-today-${kind}`;
|
|
145
|
+
return node;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
DocKit.component({
|
|
149
|
+
id: "gallery/today",
|
|
150
|
+
on: ["clock", "layout"],
|
|
151
|
+
mount(host, context) {
|
|
152
|
+
const face = made("div", "face");
|
|
153
|
+
const chip = made("span", "chip");
|
|
154
|
+
chip.setAttribute("aria-hidden", "true");
|
|
155
|
+
const greeting = made("p", "greeting");
|
|
156
|
+
const date = made("time", "date");
|
|
157
|
+
// The head's quiet meta, after the date: the number of the week.
|
|
158
|
+
const number = made("span", "meta");
|
|
159
|
+
number.setAttribute("aria-hidden", "true");
|
|
160
|
+
const week = made("ol", "week");
|
|
161
|
+
week.setAttribute("aria-hidden", "true");
|
|
162
|
+
// A narrow card's desk calendar: the day of the month, large, and its weekday and month under it.
|
|
163
|
+
const big = made("span", "big");
|
|
164
|
+
big.setAttribute("aria-hidden", "true");
|
|
165
|
+
const foot = made("span", "foot");
|
|
166
|
+
foot.setAttribute("aria-hidden", "true");
|
|
167
|
+
face.append(chip, greeting, date, number, week, big, foot);
|
|
168
|
+
host.append(face);
|
|
169
|
+
// Each word set only when it is another, so that a minute that changes nothing writes nothing.
|
|
170
|
+
const put = (/** @type {HTMLElement} */ node, /** @type {string} */ words) => {
|
|
171
|
+
if (node.textContent !== words) node.textContent = words;
|
|
172
|
+
};
|
|
173
|
+
const draw = () => {
|
|
174
|
+
const at = new Date();
|
|
175
|
+
const language = languageOf(document.documentElement);
|
|
176
|
+
const words = WORDS[language];
|
|
177
|
+
const now = faceOf(at, language);
|
|
178
|
+
const layout = layoutOf(context?.size);
|
|
179
|
+
if (face.dataset.layout !== layout) face.dataset.layout = layout;
|
|
180
|
+
const sky = partOfDay(at.getHours()) === "evening" ? "moon" : "sun";
|
|
181
|
+
if (chip.dataset.sky !== sky) {
|
|
182
|
+
chip.dataset.sky = sky;
|
|
183
|
+
face.dataset.sky = sky;
|
|
184
|
+
chip.innerHTML = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round">${PICTURES[sky]}</svg>`;
|
|
185
|
+
}
|
|
186
|
+
put(greeting, now.greeting);
|
|
187
|
+
// The date line's pieces, a space between them, made again only when its words are others.
|
|
188
|
+
if (date.textContent !== now.line.join(" ")) {
|
|
189
|
+
date.replaceChildren(...now.line.flatMap((piece, index) => {
|
|
190
|
+
const node = made("span", "piece");
|
|
191
|
+
node.classList.toggle("gallery-today-weekday", index === words.weekdayAt);
|
|
192
|
+
node.textContent = piece;
|
|
193
|
+
return index === 0 ? [node] : [" ", node];
|
|
194
|
+
}));
|
|
195
|
+
}
|
|
196
|
+
if (date.dateTime !== now.datetime) {
|
|
197
|
+
date.dateTime = now.datetime;
|
|
198
|
+
number.textContent = words.week(weekNumberOf(at));
|
|
199
|
+
big.textContent = String(at.getDate());
|
|
200
|
+
const [weekday, month] = words.foot(at.getMonth() + 1, words.weekdays[at.getDay()]);
|
|
201
|
+
const dot = made("span", "dot");
|
|
202
|
+
dot.textContent = "·";
|
|
203
|
+
foot.replaceChildren(weekday, dot, month);
|
|
204
|
+
week.replaceChildren(...weekOf(at, language).map((day) => {
|
|
205
|
+
const item = made("li", "day");
|
|
206
|
+
item.classList.toggle("gallery-today-now", day.today);
|
|
207
|
+
item.classList.toggle("gallery-today-past", day.past);
|
|
208
|
+
const initial = made("span", "initial");
|
|
209
|
+
initial.textContent = day.initial;
|
|
210
|
+
const value = made("span", "number");
|
|
211
|
+
value.textContent = String(day.date);
|
|
212
|
+
item.append(initial, value);
|
|
213
|
+
return item;
|
|
214
|
+
}));
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
draw();
|
|
218
|
+
return { update: draw };
|
|
219
|
+
},
|
|
220
|
+
});
|
|
@@ -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"/><defs><radialGradient id="g" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(16 12) scale(140 96)"><stop offset="0" stop-color="#ffb74d" stop-opacity=".22"/><stop offset=".62" stop-color="#ffb74d" stop-opacity="0"/></radialGradient></defs><rect x="16.5" y="12.5" width="207" height="95" rx="8" fill="#ffffff" stroke="#e6e6e3"/><rect x="17" y="13" width="206" height="94" rx="7.5" fill="url(#g)"/><rect x="28" y="22" width="10" height="10" rx="3" fill="#fdf1dd"/><rect x="42" y="24.5" width="46" height="5" rx="2.5" fill="#37352f"/><rect x="92" y="24.5" width="20" height="5" rx="2.5" fill="#d4d3cf"/><rect x="28" y="42" width="60" height="15" rx="3" fill="#1d1d1b"/><rect x="35" y="76" width="6" height="3" rx="1.5" fill="#d4d3cf"/><rect x="33" y="84" width="10" height="6" rx="3" fill="#a6a5a1"/><rect x="62" y="76" width="6" height="3" rx="1.5" fill="#d4d3cf"/><rect x="60" y="84" width="10" height="6" rx="3" fill="#a6a5a1"/><rect x="89" y="76" width="6" height="3" rx="1.5" fill="#d4d3cf"/><rect x="87" y="84" width="10" height="6" rx="3" fill="#a6a5a1"/><rect x="108" y="71" width="22" height="26" rx="6" fill="#4084cf"/><rect x="116" y="76" width="6" height="3" rx="1.5" fill="#ffffff"/><rect x="114" y="84" width="10" height="6" rx="3" fill="#ffffff"/><rect x="143" y="76" width="6" height="3" rx="1.5" fill="#d4d3cf"/><rect x="141" y="84" width="10" height="6" rx="3" fill="#37352f"/><rect x="170" y="76" width="6" height="3" rx="1.5" fill="#d4d3cf"/><rect x="168" y="84" width="10" height="6" rx="3" fill="#37352f"/><rect x="197" y="76" width="6" height="3" rx="1.5" fill="#d4d3cf"/><rect x="195" y="84" width="10" height="6" rx="3" fill="#37352f"/></svg>
|
|
@@ -0,0 +1,149 @@
|
|
|
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 (the pack's design B) in the kit's card tokens, a grid laid out by
|
|
3
|
+
the card's cells (the face's data-layout, which the script sets from context.size): "full" (4 × 2, the
|
|
4
|
+
default) a head of the chip, the date (600) and the number of the week after it (the head's quiet meta),
|
|
5
|
+
the greeting large under it and the week at the bottom, seven days of 38px, the days gone fainter,
|
|
6
|
+
today the one solid square of the accent; "narrow" (2 wide) a page of a desk calendar, the greeting
|
|
7
|
+
the head's title, today's day of the month large at the bottom, its weekday and month under it;
|
|
8
|
+
"line" (one cell high) the chip, the greeting and the date on one line. The chip is the sun's warm
|
|
9
|
+
color by day and the accent's pale blue in the evening, and so is the soft glow at the card's top left
|
|
10
|
+
(the face's data-sky), drawn from the card's edges: the face taken out over the card's padding and
|
|
11
|
+
given it back. Its head keeps clear of the card's grip. Light and dark. */
|
|
12
|
+
[data-doc-component="gallery/today"] {
|
|
13
|
+
--gallery-today-glow: light-dark(rgb(255 183 77 / 20%), rgb(255 170 60 / 8.5%));
|
|
14
|
+
--gallery-today-glow-evening: light-dark(rgb(64 132 207 / 13%), rgb(80 143 214 / 15%));
|
|
15
|
+
font-family: var(--gallery-font);
|
|
16
|
+
font-size: 13px;
|
|
17
|
+
line-height: 1.5;
|
|
18
|
+
color: var(--gallery-text);
|
|
19
|
+
> .gallery-today-face {
|
|
20
|
+
display: grid;
|
|
21
|
+
grid-template-columns: auto minmax(0, max-content) auto minmax(var(--gallery-grip-room, 0px), 1fr);
|
|
22
|
+
grid-template-rows: 20px auto 1fr;
|
|
23
|
+
grid-template-areas: "chip date meta ." "greeting greeting greeting greeting" "week week week week";
|
|
24
|
+
column-gap: 8px;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
min-height: 0;
|
|
27
|
+
}
|
|
28
|
+
> .gallery-today-face > .gallery-today-chip {
|
|
29
|
+
grid-area: chip;
|
|
30
|
+
align-self: center;
|
|
31
|
+
display: grid;
|
|
32
|
+
place-items: center;
|
|
33
|
+
width: var(--gallery-chip-size);
|
|
34
|
+
height: var(--gallery-chip-size);
|
|
35
|
+
border-radius: var(--gallery-chip-radius);
|
|
36
|
+
background: var(--gallery-warm-soft);
|
|
37
|
+
color: var(--gallery-warm);
|
|
38
|
+
}
|
|
39
|
+
> .gallery-today-face > .gallery-today-chip[data-sky="moon"] { background: var(--gallery-accent-soft); color: var(--gallery-accent-ink); }
|
|
40
|
+
> .gallery-today-face > .gallery-today-chip > svg { display: block; width: var(--gallery-chip-icon); height: var(--gallery-chip-icon); }
|
|
41
|
+
> .gallery-today-face > .gallery-today-date {
|
|
42
|
+
grid-area: date;
|
|
43
|
+
align-self: center;
|
|
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);
|
|
52
|
+
}
|
|
53
|
+
> .gallery-today-face > .gallery-today-meta {
|
|
54
|
+
grid-area: meta;
|
|
55
|
+
align-self: center;
|
|
56
|
+
font-size: var(--gallery-meta-size);
|
|
57
|
+
line-height: var(--gallery-title-line);
|
|
58
|
+
color: var(--gallery-faint);
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
}
|
|
61
|
+
> .gallery-today-face > .gallery-today-greeting {
|
|
62
|
+
grid-area: greeting;
|
|
63
|
+
margin: 8px 0 0;
|
|
64
|
+
font-size: 28px;
|
|
65
|
+
line-height: 34px;
|
|
66
|
+
font-weight: 600;
|
|
67
|
+
letter-spacing: .02em;
|
|
68
|
+
color: var(--gallery-text-strong);
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
text-overflow: ellipsis;
|
|
72
|
+
}
|
|
73
|
+
> .gallery-today-face > .gallery-today-week {
|
|
74
|
+
grid-area: week;
|
|
75
|
+
align-self: end;
|
|
76
|
+
display: grid;
|
|
77
|
+
grid-template-columns: repeat(7, minmax(0, 1fr));
|
|
78
|
+
gap: 4px;
|
|
79
|
+
margin: 0;
|
|
80
|
+
padding: 0;
|
|
81
|
+
list-style: none;
|
|
82
|
+
}
|
|
83
|
+
> .gallery-today-face > .gallery-today-week > .gallery-today-day {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
height: 38px;
|
|
89
|
+
border-radius: 9px;
|
|
90
|
+
}
|
|
91
|
+
> .gallery-today-face > .gallery-today-week > .gallery-today-day > .gallery-today-initial { font-size: 10.5px; line-height: 14px; color: var(--gallery-faint); }
|
|
92
|
+
> .gallery-today-face > .gallery-today-week > .gallery-today-day > .gallery-today-number { font-size: 13px; line-height: 17px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--gallery-text); }
|
|
93
|
+
> .gallery-today-face > .gallery-today-week > .gallery-today-past > .gallery-today-number { font-weight: 500; color: var(--gallery-faint); }
|
|
94
|
+
> .gallery-today-face > .gallery-today-week > .gallery-today-now { background: var(--gallery-accent); }
|
|
95
|
+
> .gallery-today-face > .gallery-today-week > .gallery-today-now > .gallery-today-initial { color: rgb(255 255 255 / 82%); }
|
|
96
|
+
> .gallery-today-face > .gallery-today-week > .gallery-today-now > .gallery-today-number { color: #fff; }
|
|
97
|
+
> .gallery-today-face > :is(.gallery-today-big, .gallery-today-foot) { display: none; }
|
|
98
|
+
> .gallery-today-face > .gallery-today-big {
|
|
99
|
+
grid-area: big;
|
|
100
|
+
align-self: end;
|
|
101
|
+
font-size: 56px;
|
|
102
|
+
line-height: 1;
|
|
103
|
+
font-weight: var(--gallery-numeral-weight);
|
|
104
|
+
letter-spacing: -.04em;
|
|
105
|
+
font-variant-numeric: lining-nums;
|
|
106
|
+
color: var(--gallery-text-strong);
|
|
107
|
+
}
|
|
108
|
+
> .gallery-today-face > .gallery-today-foot { grid-area: foot; margin-top: 8px; font-size: 12.5px; line-height: 16px; color: var(--gallery-muted); white-space: nowrap; }
|
|
109
|
+
> .gallery-today-face > .gallery-today-foot > .gallery-today-dot { margin: 0 5px; color: var(--gallery-faintest); }
|
|
110
|
+
|
|
111
|
+
/* A narrow card: a page of a desk calendar. */
|
|
112
|
+
> .gallery-today-face[data-layout="narrow"] {
|
|
113
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
114
|
+
grid-template-rows: 20px 1fr auto;
|
|
115
|
+
grid-template-areas: "chip greeting" "big big" "foot foot";
|
|
116
|
+
}
|
|
117
|
+
> .gallery-today-face[data-layout="narrow"] > :is(.gallery-today-date, .gallery-today-meta, .gallery-today-week) { display: none; }
|
|
118
|
+
> .gallery-today-face[data-layout="narrow"] > :is(.gallery-today-big, .gallery-today-foot) { display: block; }
|
|
119
|
+
> .gallery-today-face[data-layout="narrow"] > .gallery-today-greeting {
|
|
120
|
+
align-self: center;
|
|
121
|
+
margin: 0;
|
|
122
|
+
padding-inline-end: var(--gallery-grip-room, 0px);
|
|
123
|
+
font-size: var(--gallery-title-size);
|
|
124
|
+
line-height: var(--gallery-title-line);
|
|
125
|
+
letter-spacing: 0;
|
|
126
|
+
color: var(--gallery-text);
|
|
127
|
+
}
|
|
128
|
+
/* A card one cell high: a line. */
|
|
129
|
+
> .gallery-today-face[data-layout="line"] {
|
|
130
|
+
grid-template-columns: auto auto minmax(0, 1fr);
|
|
131
|
+
grid-template-rows: 1fr;
|
|
132
|
+
grid-template-areas: "chip greeting date";
|
|
133
|
+
align-items: center;
|
|
134
|
+
}
|
|
135
|
+
> .gallery-today-face[data-layout="line"] > :is(.gallery-today-meta, .gallery-today-week) { display: none; }
|
|
136
|
+
> .gallery-today-face[data-layout="line"] > .gallery-today-greeting { margin: 0; font-size: 15px; line-height: 20px; letter-spacing: 0; }
|
|
137
|
+
> .gallery-today-face[data-layout="line"] > .gallery-today-date { margin-inline-start: 4px; padding-inline-end: var(--gallery-grip-room, 0px); font-weight: 400; color: var(--gallery-muted); }
|
|
138
|
+
}
|
|
139
|
+
/* On a custom page the face is the card's: as high as what the card holds inside its padding, and its glow
|
|
140
|
+
the whole card's, from its edges (the face taken out over the card's padding and given it back). */
|
|
141
|
+
.gallery-card > [data-doc-component="gallery/today"] { height: 100%; }
|
|
142
|
+
.gallery-card > [data-doc-component="gallery/today"] > .gallery-today-face {
|
|
143
|
+
height: calc(100% + 2 * var(--gallery-card-pad));
|
|
144
|
+
margin: calc(-1 * var(--gallery-card-pad));
|
|
145
|
+
padding: var(--gallery-card-pad);
|
|
146
|
+
border-radius: var(--gallery-card-radius);
|
|
147
|
+
background: radial-gradient(110% 100% at 0% 0%, var(--gallery-today-glow), transparent 62%);
|
|
148
|
+
}
|
|
149
|
+
.gallery-card > [data-doc-component="gallery/today"] > .gallery-today-face[data-sky="moon"] { background: radial-gradient(110% 100% at 0% 0%, var(--gallery-today-glow-evening), transparent 62%); }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<div data-doc-component="gallery/today"></div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# 问候与日期 (gallery/today)
|
|
2
|
+
|
|
3
|
+
A card for a custom page (its places are `page`): a greeting by the time of day (早上好, 下午好, 晚上好), today's date and its weekday, in the language Gallery's UI speaks. Use it at the top of a home page or of any page the user opens every day.
|
|
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 today`: the instance is empty, `<div data-doc-component="gallery/today"></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.
|
|
8
|
+
|
|
9
|
+
- Sizes: 4 × 2 (the default: the date and the week's number at the top, the greeting large, this week at the bottom), 2 × 2 (a page of a desk calendar: the greeting, today's day of the month large, its weekday and month) and 4 × 1 (one line: the greeting and the date). The user may switch between them.
|
|
10
|
+
- Its places hold no document: no document's menu offers it. In a document it would show the same words, framed by nothing.
|
|
11
|
+
|
|
12
|
+
## How it looks
|
|
13
|
+
|
|
14
|
+
In Gallery 风格's look (the kit's card tokens, light and dark): a head of a small gray chip and a title, its end clear of the card's grip; one hero; the rest small and gray; the accent on the data and on today alone. The chip is the sun in its warm color by day and the moon in the accent's in the evening, and so is a soft glow at the card's top left, the one mood of a home page. On a 4 × 2 card the greeting is 28px and this week sits at the bottom, seven days, the days gone fainter, today the one solid square of the accent; a 2 × 2 card is a page of a desk calendar, today's day of the month 56px; a 4 × 1 card one line. It changes by itself: the greeting as the hour turns (it hears the kit's clock each minute), the date at midnight. The script runs with the rights of the page's own scripts, as any block's does.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "gallery/todos",
|
|
3
|
+
"apiVersion": 1,
|
|
4
|
+
"version": "2.0.0",
|
|
5
|
+
"name": { "zh": "我的待办", "en": "My to-dos" },
|
|
6
|
+
"description": { "zh": "所有文档里没完成的待办:勾选就写回那篇文档,点文字打开它", "en": "The to-dos of every document not done yet: check one in its document, or click it to open it there" },
|
|
7
|
+
"words": "wodedaiban daiban renwu todo todos tasks checklist 待办 任务 清单 我的待办 没完成",
|
|
8
|
+
"parts": {
|
|
9
|
+
"settings": { "at": ":scope > script", "edit": "data" }
|
|
10
|
+
},
|
|
11
|
+
"runtime": { "generated": [":scope > .gallery-todos-face"] },
|
|
12
|
+
"places": ["page"],
|
|
13
|
+
"card": { "sizes": [[4, 4], [4, 6], [8, 4]], "resize": true },
|
|
14
|
+
"settings": [
|
|
15
|
+
{ "key": "document", "label": { "zh": "只看这篇文档", "en": "Only this document" }, "type": "document" },
|
|
16
|
+
{ "key": "done", "label": { "zh": "也显示已完成的", "en": "Show done ones too" }, "type": "switch", "default": false }
|
|
17
|
+
],
|
|
18
|
+
"needs": ["workspace"]
|
|
19
|
+
}
|