@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,206 @@
|
|
|
1
|
+
// gallery-soft/countdown (倒计时, 柔光风格): Gallery 风格's gallery/countdown in the soft look, the same logic.
|
|
2
|
+
// The days between today, by the reader's clock, and the date its settings name: how many are left before
|
|
3
|
+
// it, 就是今天 on the day itself, how many have gone since after it. Its two settings, `title` (the name of the
|
|
4
|
+
// day) and `date` (YYYY-MM-DD), are the card's form (on a custom page the grip at the card's top right ›
|
|
5
|
+
// 设置…), kept in the data part `settings`, a script of JSON, which the board writes and this block only
|
|
6
|
+
// reads: it writes nothing. Drawn from that part on every `source` (the form, an Agent's write, an undo)
|
|
7
|
+
// and again as a day begins (the kit's `clock`, "day"), so that the count moves at midnight. A date it
|
|
8
|
+
// cannot read, or none, shows the cards' empty face, a calendar in a soft disc over 还没有设日期 and where
|
|
9
|
+
// to set one; the words are the page's language (the UI's where Gallery says it, else the page's lang).
|
|
10
|
+
//
|
|
11
|
+
// Its face, laid out by its card's size (`context.size`, read again on `layout`; data-w, data-h, data-pad):
|
|
12
|
+
// a head of an hourglass's chip and the day's name (春节, or 倒计时 where it has none); the count the hero,
|
|
13
|
+
// large, 还有 (or 已过) before it and 天 after it, muted; on the day 就是今天 in the accent; under it the date
|
|
14
|
+
// (2月6日 周六 on a 2 × 2 card, 2027年2月6日 星期六 on a wider one, which sets a small page of a calendar
|
|
15
|
+
// beside the count, the month on a band of the accent over the day). The face says by `data-kind` which of
|
|
16
|
+
// left, today, since or none it shows.
|
|
17
|
+
|
|
18
|
+
const WORDS = {
|
|
19
|
+
zh: {
|
|
20
|
+
left: "还有",
|
|
21
|
+
since: "已过",
|
|
22
|
+
today: "就是今天",
|
|
23
|
+
unit: () => "天",
|
|
24
|
+
countdown: "倒计时",
|
|
25
|
+
pick: "还没有设日期",
|
|
26
|
+
where: "右上角手柄 › 设置…",
|
|
27
|
+
whereShort: "手柄 › 设置…",
|
|
28
|
+
weekdays: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
|
|
29
|
+
short: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
|
|
30
|
+
date: (/** @type {number} */ year, /** @type {number} */ month, /** @type {number} */ day, /** @type {string} */ weekday) => [`${year}年${month}月${day}日`, weekday],
|
|
31
|
+
dateShort: (/** @type {number} */ month, /** @type {number} */ day, /** @type {string} */ weekday) => [`${month}月${day}日`, weekday],
|
|
32
|
+
month: (/** @type {number} */ month) => `${month}月`,
|
|
33
|
+
},
|
|
34
|
+
en: {
|
|
35
|
+
left: "In",
|
|
36
|
+
since: "",
|
|
37
|
+
today: "Today",
|
|
38
|
+
unit: (/** @type {number} */ count, /** @type {boolean} */ since = false) => `${count === 1 ? "day" : "days"}${since ? " ago" : ""}`,
|
|
39
|
+
countdown: "Countdown",
|
|
40
|
+
pick: "No date yet",
|
|
41
|
+
where: "The grip at the top right › Settings…",
|
|
42
|
+
whereShort: "Grip › Settings…",
|
|
43
|
+
weekdays: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
44
|
+
short: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
45
|
+
date: (/** @type {number} */ year, /** @type {number} */ month, /** @type {number} */ day, /** @type {string} */ weekday) => [`${weekday},`, `${["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][month - 1]} ${day}, ${year}`],
|
|
46
|
+
dateShort: (/** @type {number} */ month, /** @type {number} */ day, /** @type {string} */ weekday) => [`${weekday},`, `${["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][month - 1]} ${day}`],
|
|
47
|
+
month: (/** @type {number} */ month) => ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][month - 1],
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** The language the page speaks: the UI's where Gallery says it (data-ge-language), else its lang's. */
|
|
52
|
+
function languageOf(/** @type {HTMLElement} */ root) {
|
|
53
|
+
const ui = root.getAttribute("data-ge-language");
|
|
54
|
+
return (ui !== null ? ui === "en" : /^en(?:-|$)/i.test(root.lang)) ? "en" : "zh";
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* A date written YYYY-MM-DD as { year, month, day }, or null for anything else (no such day too:
|
|
59
|
+
* 2027-02-30).
|
|
60
|
+
* @param {unknown} written
|
|
61
|
+
*/
|
|
62
|
+
function dateOf(written) {
|
|
63
|
+
const found = typeof written === "string" ? /^(\d{4})-(\d{2})-(\d{2})$/.exec(written) : null;
|
|
64
|
+
if (!found) return null;
|
|
65
|
+
const [year, month, day] = found.slice(1).map(Number);
|
|
66
|
+
const date = new Date(Date.UTC(year, month - 1, day));
|
|
67
|
+
return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day ? { year, month, day } : null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Where `now` (the reader's clock) stands to the date `written` (YYYY-MM-DD): { kind: "left", days }
|
|
72
|
+
* before it, { kind: "today", days: 0 } on it, { kind: "since", days } after it, by whole days of the
|
|
73
|
+
* calendar (counted in UTC from each day's date, so that a change of the clocks in between changes
|
|
74
|
+
* nothing); { kind: "none" } for a date it cannot read.
|
|
75
|
+
* @param {unknown} written
|
|
76
|
+
* @param {Date} now
|
|
77
|
+
* @returns {{ kind: "left" | "since" | "today", days: number } | { kind: "none" }}
|
|
78
|
+
*/
|
|
79
|
+
function countdownOf(written, now) {
|
|
80
|
+
const date = dateOf(written);
|
|
81
|
+
if (!date) return { kind: "none" };
|
|
82
|
+
const days = Math.round((Date.UTC(date.year, date.month - 1, date.day) - Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())) / 86_400_000);
|
|
83
|
+
if (days === 0) return { kind: "today", days: 0 };
|
|
84
|
+
return days > 0 ? { kind: "left", days } : { kind: "since", days: -days };
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* What the card says, in `language`, of its `settings` (context.readJSON's, {} where none is set yet)
|
|
89
|
+
* at `now`: its head (the day's name, or 倒计时), the words before the count (还有, 已过) and its unit after it
|
|
90
|
+
* ("" with no count), its count (null on the day and with no date), the words standing there instead
|
|
91
|
+
* (`big`: 就是今天, or with no date 还没有设日期), the date (a list of words a line breaks between and never
|
|
92
|
+
* inside: the date and its weekday) long and short, or with no date where to set one (`where`, `whereShort`),
|
|
93
|
+
* and the calendar's page (its month and day; null with no date).
|
|
94
|
+
* @param {any} settings
|
|
95
|
+
* @param {Date} now
|
|
96
|
+
* @param {"zh" | "en"} language
|
|
97
|
+
*/
|
|
98
|
+
function faceOf(settings, now, language) {
|
|
99
|
+
const words = WORDS[language];
|
|
100
|
+
const date = dateOf(settings?.date);
|
|
101
|
+
const named = typeof settings?.title === "string" ? settings.title.trim() : "";
|
|
102
|
+
const count = countdownOf(settings?.date, now);
|
|
103
|
+
const head = named || words.countdown;
|
|
104
|
+
if (!date || count.kind === "none") return { head, label: "", count: null, unit: "", big: words.pick, foot: [words.where], footShort: [words.whereShort], page: null };
|
|
105
|
+
const weekday = new Date(Date.UTC(date.year, date.month - 1, date.day)).getUTCDay();
|
|
106
|
+
const foot = words.date(date.year, date.month, date.day, words.weekdays[weekday]);
|
|
107
|
+
const footShort = words.dateShort(date.month, date.day, words.short[weekday]);
|
|
108
|
+
const page = { month: words.month(date.month), day: String(date.day) };
|
|
109
|
+
if (count.kind === "today") return { head, label: "", count: null, unit: "", big: words.today, foot, footShort, page };
|
|
110
|
+
return { head, label: count.kind === "left" ? words.left : words.since, count: String(count.days), unit: words.unit(count.days, count.kind === "since"), big: "", foot, footShort, page };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The size the face is laid out by: its card's cells (`context.size`), or `fallback` (the manifest's first
|
|
115
|
+
* size) where no card is; and the frame's padding for it, as the soft cards pad theirs: "xs" on a card one
|
|
116
|
+
* cell high, "s" on a small one (2 × 2 and less), "l" on one 3 cells high or more, else "m".
|
|
117
|
+
* @param {DocComponentSize | null | undefined} size
|
|
118
|
+
* @param {[number, number]} fallback
|
|
119
|
+
*/
|
|
120
|
+
function sizeOf(size, fallback) {
|
|
121
|
+
const w = size?.w ?? fallback[0];
|
|
122
|
+
const h = size?.h ?? fallback[1];
|
|
123
|
+
return { w, h, pad: h === 1 ? "xs" : w <= 2 && h <= 2 ? "s" : h >= 3 ? "l" : "m" };
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* An element of the face, of `kind` (its class).
|
|
128
|
+
* @template {keyof HTMLElementTagNameMap} K
|
|
129
|
+
* @param {K} tag
|
|
130
|
+
* @param {string} kind
|
|
131
|
+
* @param {string} [text]
|
|
132
|
+
*/
|
|
133
|
+
function made(tag, kind, text) {
|
|
134
|
+
const node = document.createElement(tag);
|
|
135
|
+
node.className = `gallery-soft-countdown-${kind}`;
|
|
136
|
+
if (text !== undefined) node.textContent = text;
|
|
137
|
+
return node;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** Words as pieces a line breaks between and never inside. @param {string[]} pieces */
|
|
141
|
+
const piecesOf = (pieces) => pieces.flatMap((words, index) => {
|
|
142
|
+
const piece = made("span", "piece", words);
|
|
143
|
+
return index === 0 ? [piece] : [" ", piece];
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
DocKit.component({
|
|
147
|
+
id: "gallery-soft/countdown",
|
|
148
|
+
on: ["source", "clock", "layout"],
|
|
149
|
+
mount(host, context) {
|
|
150
|
+
const language = languageOf(document.documentElement);
|
|
151
|
+
const face = made("div", "face");
|
|
152
|
+
host.append(face);
|
|
153
|
+
const draw = (/** @type {string} */ reason = "", /** @type {unknown} */ detail = null) => {
|
|
154
|
+
if (reason === "clock" && detail !== "day") return; // a minute moves no count
|
|
155
|
+
const settings = context.readJSON("settings");
|
|
156
|
+
if (settings === undefined) return; // no JSON: the instance has failed, and Gallery shows what it holds
|
|
157
|
+
if (settings === null || typeof settings !== "object" || Array.isArray(settings)) return context.fail(new Error("its settings are no object: { \"title\": \"…\", \"date\": \"YYYY-MM-DD\" }"));
|
|
158
|
+
const { w, h, pad } = sizeOf(context.size, [2, 2]);
|
|
159
|
+
const small = w <= 2;
|
|
160
|
+
const at = new Date();
|
|
161
|
+
const now = faceOf(settings, at, language);
|
|
162
|
+
const kind = countdownOf(settings.date, at).kind;
|
|
163
|
+
Object.assign(face.dataset, { kind, w: String(w), h: String(h), pad });
|
|
164
|
+
const head = made("div", "head");
|
|
165
|
+
const chip = made("span", "chip");
|
|
166
|
+
chip.setAttribute("aria-hidden", "true");
|
|
167
|
+
chip.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M7 3.5h10M7 20.5h10"/><path d="M8 3.5v2.4c0 1.4.7 2.6 1.8 3.4L12 11l2.2-1.7A4.2 4.2 0 0 0 16 5.9V3.5"/><path d="M8 20.5v-2.4c0-1.4.7-2.6 1.8-3.4L12 13l2.2 1.7a4.2 4.2 0 0 1 1.8 3.4v2.4"/></svg>';
|
|
168
|
+
const named = made("span", "name", now.head);
|
|
169
|
+
named.title = now.head;
|
|
170
|
+
head.append(chip, named);
|
|
171
|
+
if (kind === "none") {
|
|
172
|
+
// The cards' empty face: a calendar in a soft disc, what is missing, where to set it.
|
|
173
|
+
const empty = made("div", "empty");
|
|
174
|
+
const disc = made("span", "disc");
|
|
175
|
+
disc.setAttribute("aria-hidden", "true");
|
|
176
|
+
disc.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="5.5" width="16" height="14.5" rx="2.4"/><path d="M8 3.5v4M16 3.5v4M4 10.5h16"/></svg>';
|
|
177
|
+
empty.append(disc, made("p", "line", now.big), made("p", "how", (small ? now.footShort : now.foot).join(" ")));
|
|
178
|
+
face.replaceChildren(head, empty);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
// The count: 还有 before it, 天 after it; on the day, its words.
|
|
182
|
+
const figure = made("p", "count");
|
|
183
|
+
if (now.count === null) {
|
|
184
|
+
figure.classList.add("gallery-soft-countdown-words");
|
|
185
|
+
figure.textContent = now.big;
|
|
186
|
+
} else {
|
|
187
|
+
figure.append(...(now.label ? [made("span", "label", now.label)] : []), made("span", "number", now.count), made("span", "unit", now.unit));
|
|
188
|
+
}
|
|
189
|
+
const date = made("p", "date");
|
|
190
|
+
date.append(...piecesOf(small ? now.footShort : now.foot));
|
|
191
|
+
const body = made("div", "body");
|
|
192
|
+
const grow = made("div", "grow");
|
|
193
|
+
grow.append(figure, date);
|
|
194
|
+
body.append(grow);
|
|
195
|
+
if (!small && now.page) {
|
|
196
|
+
const page = made("div", "page");
|
|
197
|
+
page.setAttribute("aria-hidden", "true");
|
|
198
|
+
page.append(made("span", "month", now.page.month), made("span", "day", now.page.day));
|
|
199
|
+
body.append(page);
|
|
200
|
+
}
|
|
201
|
+
face.replaceChildren(head, body);
|
|
202
|
+
};
|
|
203
|
+
draw();
|
|
204
|
+
return { update: draw };
|
|
205
|
+
},
|
|
206
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 120"><defs><linearGradient id="w" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#3e7ac6" stop-opacity=".07"/><stop offset=".52" stop-color="#3e7ac6" stop-opacity="0"/></linearGradient></defs><rect width="240" height="120" rx="8" fill="#f3f3f1"/><rect x="16.5" y="12.5" width="207" height="95" rx="14" fill="#ffffff" stroke="#e8e7e4"/><rect x="17" y="13" width="206" height="94" rx="13.5" fill="url(#w)"/><rect x="30" y="24" width="14" height="14" rx="4.5" fill="#ecf3fb"/><rect x="34" y="30" width="6" height="2" rx="1" fill="#3e7ac6"/><rect x="50" y="28" width="26" height="6" rx="3" fill="#37352f"/><rect x="30" y="58" width="18" height="7" rx="3.5" fill="#8d8c88"/><rect x="52" y="50" width="44" height="22" rx="11" fill="#1f1f1f"/><rect x="100" y="64" width="10" height="7" rx="3.5" fill="#8d8c88"/><rect x="30" y="82" width="70" height="5" rx="2.5" fill="#c4c2bd"/><rect x="168" y="46" width="38" height="44" rx="8" fill="#fff" stroke="#e6e5e2"/><path d="M168 54a8 8 0 0 1 8-8h22a8 8 0 0 1 8 8v4h-38z" fill="#3e7ac6"/><rect x="178" y="67" width="18" height="14" rx="7" fill="#1f1f1f"/></svg>
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/* 柔光风格's countdown. 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(): the
|
|
3
|
+
page's color scheme, which follows its theme), then the face: a faint wash of the accent from the card's
|
|
4
|
+
top over the soft card's fill; a head of an hourglass's chip and the day's name, one line; the count the
|
|
5
|
+
hero at the bottom, its words before it and its unit after it muted, the date under it; on a card wider
|
|
6
|
+
than two cells a small page of a calendar beside the count (the month on a band of the accent, the day
|
|
7
|
+
large), on the day 就是今天 in the accent; with no date the cards' empty face (a calendar in a soft disc,
|
|
8
|
+
a line, where to set one). On a custom page the face is the card's whole room, taken out over the card's
|
|
9
|
+
padding and given the soft frame's (data-pad: 18px on a 2 × 2 card, 20px on a 4 × 2), the board's line
|
|
10
|
+
around it; where no card is (a document, as gallery block check shows it) the face frames itself at the
|
|
11
|
+
size of a 2 × 2 card. */
|
|
12
|
+
[data-doc-component="gallery-soft/countdown"] {
|
|
13
|
+
--soft-font: "PingFang SC", "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
|
|
14
|
+
--soft-num: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
15
|
+
--soft-card: light-dark(#ffffff, #1f1f20);
|
|
16
|
+
--soft-card-line: light-dark(rgb(28 28 32 / 6.5%), rgb(255 255 255 / 7.5%));
|
|
17
|
+
--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%));
|
|
18
|
+
--soft-wash: linear-gradient(180deg, light-dark(rgb(62 122 198 / 6%), rgb(126 173 226 / 7%)) 0%, transparent 52%);
|
|
19
|
+
--soft-text: light-dark(#37352f, #d9d9dc);
|
|
20
|
+
--soft-strong: light-dark(#1f1f1f, #f1f1f2);
|
|
21
|
+
--soft-muted: light-dark(#7a7a7f, #9d9da3);
|
|
22
|
+
--soft-accent: light-dark(#3e7ac6, #7eade2);
|
|
23
|
+
--soft-accent-ink: light-dark(#356cb3, #98bee9);
|
|
24
|
+
--soft-accent-soft: light-dark(#ecf3fb, rgb(126 173 226 / 14%));
|
|
25
|
+
--soft-on-accent: light-dark(#ffffff, #152436);
|
|
26
|
+
--soft-track: light-dark(rgb(28 28 32 / 7%), rgb(255 255 255 / 8%));
|
|
27
|
+
--soft-grip-room: 0px;
|
|
28
|
+
> .gallery-soft-countdown-face {
|
|
29
|
+
--soft-pad: 18px;
|
|
30
|
+
position: relative;
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
min-width: 0;
|
|
35
|
+
width: 144px;
|
|
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-wash), var(--soft-card);
|
|
43
|
+
color: var(--soft-text);
|
|
44
|
+
font: 13px/1.5 var(--soft-font);
|
|
45
|
+
-webkit-font-smoothing: antialiased;
|
|
46
|
+
}
|
|
47
|
+
> .gallery-soft-countdown-face[data-pad="m"] { --soft-pad: 20px; }
|
|
48
|
+
> .gallery-soft-countdown-face[data-pad="l"] { --soft-pad: 24px; }
|
|
49
|
+
> .gallery-soft-countdown-face[data-pad="xs"] { padding: 0 calc(16px - var(--soft-edge, 0px)); justify-content: center; }
|
|
50
|
+
> .gallery-soft-countdown-face:not([data-w="1"], [data-w="2"]) { width: 304px; }
|
|
51
|
+
/* The head: the hourglass's chip and the day's name. */
|
|
52
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-head {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: 10px;
|
|
56
|
+
flex: none;
|
|
57
|
+
height: 28px;
|
|
58
|
+
min-width: 0;
|
|
59
|
+
padding-inline-end: var(--soft-grip-room);
|
|
60
|
+
}
|
|
61
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-head > .gallery-soft-countdown-chip {
|
|
62
|
+
display: grid;
|
|
63
|
+
place-items: center;
|
|
64
|
+
flex: none;
|
|
65
|
+
width: 28px;
|
|
66
|
+
height: 28px;
|
|
67
|
+
border-radius: 8px;
|
|
68
|
+
background: var(--soft-accent-soft);
|
|
69
|
+
color: var(--soft-accent);
|
|
70
|
+
}
|
|
71
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-head > .gallery-soft-countdown-chip > svg { display: block; width: 16px; height: 16px; }
|
|
72
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-head > .gallery-soft-countdown-name {
|
|
73
|
+
min-width: 0;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
white-space: nowrap;
|
|
76
|
+
text-overflow: ellipsis;
|
|
77
|
+
font-size: 14px;
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
color: var(--soft-strong);
|
|
80
|
+
}
|
|
81
|
+
> .gallery-soft-countdown-face[data-pad="s"] > .gallery-soft-countdown-head { gap: 8px; height: 24px; }
|
|
82
|
+
> .gallery-soft-countdown-face[data-pad="s"] > .gallery-soft-countdown-head > .gallery-soft-countdown-chip { width: 24px; height: 24px; border-radius: 7px; }
|
|
83
|
+
> .gallery-soft-countdown-face[data-pad="s"] > .gallery-soft-countdown-head > .gallery-soft-countdown-chip > svg { width: 14px; height: 14px; }
|
|
84
|
+
> .gallery-soft-countdown-face[data-pad="s"] > .gallery-soft-countdown-head > .gallery-soft-countdown-name { font-size: 13px; }
|
|
85
|
+
/* The count at the bottom, the calendar's page beside it on a wide card. */
|
|
86
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-body {
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: flex-end;
|
|
89
|
+
gap: 16px;
|
|
90
|
+
margin-top: auto;
|
|
91
|
+
min-width: 0;
|
|
92
|
+
}
|
|
93
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-body > .gallery-soft-countdown-grow { flex: 1; min-width: 0; }
|
|
94
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-body > .gallery-soft-countdown-grow > .gallery-soft-countdown-count {
|
|
95
|
+
margin: 0;
|
|
96
|
+
white-space: nowrap;
|
|
97
|
+
font-family: var(--soft-num);
|
|
98
|
+
font-size: 44px;
|
|
99
|
+
font-weight: 700;
|
|
100
|
+
line-height: 1;
|
|
101
|
+
letter-spacing: -.025em;
|
|
102
|
+
font-variant-numeric: tabular-nums;
|
|
103
|
+
color: var(--soft-strong);
|
|
104
|
+
}
|
|
105
|
+
> .gallery-soft-countdown-face[data-pad="s"] > .gallery-soft-countdown-body > .gallery-soft-countdown-grow > .gallery-soft-countdown-count { font-size: 40px; }
|
|
106
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-body > .gallery-soft-countdown-grow > .gallery-soft-countdown-count > :is(.gallery-soft-countdown-label, .gallery-soft-countdown-unit) {
|
|
107
|
+
font-family: var(--soft-font);
|
|
108
|
+
font-size: 13px;
|
|
109
|
+
font-weight: 500;
|
|
110
|
+
letter-spacing: 0;
|
|
111
|
+
color: var(--soft-muted);
|
|
112
|
+
}
|
|
113
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-body > .gallery-soft-countdown-grow > .gallery-soft-countdown-count > .gallery-soft-countdown-label { margin-right: 6px; }
|
|
114
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-body > .gallery-soft-countdown-grow > .gallery-soft-countdown-count > .gallery-soft-countdown-unit { margin-left: 4px; }
|
|
115
|
+
/* On the day: its words in the accent. */
|
|
116
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-body > .gallery-soft-countdown-grow > .gallery-soft-countdown-words {
|
|
117
|
+
font-family: var(--soft-font);
|
|
118
|
+
font-size: 26px;
|
|
119
|
+
line-height: 1.1;
|
|
120
|
+
letter-spacing: .02em;
|
|
121
|
+
color: var(--soft-accent-ink);
|
|
122
|
+
}
|
|
123
|
+
> .gallery-soft-countdown-face[data-pad="s"] > .gallery-soft-countdown-body > .gallery-soft-countdown-grow > .gallery-soft-countdown-words { font-size: 24px; }
|
|
124
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-body > .gallery-soft-countdown-grow > .gallery-soft-countdown-date {
|
|
125
|
+
margin: 8px 0 0;
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
white-space: nowrap;
|
|
128
|
+
text-overflow: ellipsis;
|
|
129
|
+
font-size: 12px;
|
|
130
|
+
color: var(--soft-muted);
|
|
131
|
+
}
|
|
132
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-body > .gallery-soft-countdown-page {
|
|
133
|
+
position: relative;
|
|
134
|
+
display: flex;
|
|
135
|
+
flex-direction: column;
|
|
136
|
+
flex: none;
|
|
137
|
+
width: 62px;
|
|
138
|
+
height: 70px;
|
|
139
|
+
overflow: hidden;
|
|
140
|
+
border-radius: 12px;
|
|
141
|
+
background: var(--soft-card);
|
|
142
|
+
box-shadow: 0 0 0 1px var(--soft-card-line), 0 6px 14px -8px rgb(0 0 0 / 25%);
|
|
143
|
+
}
|
|
144
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-body > .gallery-soft-countdown-page > .gallery-soft-countdown-month {
|
|
145
|
+
height: 22px;
|
|
146
|
+
background: var(--soft-accent);
|
|
147
|
+
color: var(--soft-on-accent);
|
|
148
|
+
font: 600 11.5px/22px var(--soft-font);
|
|
149
|
+
text-align: center;
|
|
150
|
+
}
|
|
151
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-body > .gallery-soft-countdown-page > .gallery-soft-countdown-day {
|
|
152
|
+
display: grid;
|
|
153
|
+
place-items: center;
|
|
154
|
+
flex: 1;
|
|
155
|
+
font: 700 28px/1 var(--soft-num);
|
|
156
|
+
letter-spacing: -.02em;
|
|
157
|
+
color: var(--soft-strong);
|
|
158
|
+
}
|
|
159
|
+
/* No date: the cards' empty face. */
|
|
160
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-empty {
|
|
161
|
+
display: flex;
|
|
162
|
+
flex-direction: column;
|
|
163
|
+
align-items: center;
|
|
164
|
+
justify-content: center;
|
|
165
|
+
gap: 4px;
|
|
166
|
+
flex: 1;
|
|
167
|
+
min-height: 0;
|
|
168
|
+
text-align: center;
|
|
169
|
+
}
|
|
170
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-empty > .gallery-soft-countdown-disc {
|
|
171
|
+
display: grid;
|
|
172
|
+
place-items: center;
|
|
173
|
+
flex: none;
|
|
174
|
+
width: 44px;
|
|
175
|
+
height: 44px;
|
|
176
|
+
margin-bottom: 8px;
|
|
177
|
+
border-radius: 50%;
|
|
178
|
+
background: var(--soft-track);
|
|
179
|
+
color: var(--soft-muted);
|
|
180
|
+
}
|
|
181
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-empty > .gallery-soft-countdown-disc > svg { display: block; width: 20px; height: 20px; }
|
|
182
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-empty > .gallery-soft-countdown-line { margin: 0; font-size: 13px; color: var(--soft-text); }
|
|
183
|
+
> .gallery-soft-countdown-face > .gallery-soft-countdown-empty > .gallery-soft-countdown-how { margin: 0; font-size: 12px; color: var(--soft-muted); }
|
|
184
|
+
/* A 2 × 2 card: a smaller disc, a line each, so that the three stand clear of the head. */
|
|
185
|
+
> .gallery-soft-countdown-face[data-pad="s"] > .gallery-soft-countdown-empty { gap: 0; }
|
|
186
|
+
> .gallery-soft-countdown-face[data-pad="s"] > .gallery-soft-countdown-empty > .gallery-soft-countdown-disc { width: 30px; height: 30px; margin-bottom: 4px; }
|
|
187
|
+
> .gallery-soft-countdown-face[data-pad="s"] > .gallery-soft-countdown-empty > .gallery-soft-countdown-disc > svg { width: 15px; height: 15px; }
|
|
188
|
+
> .gallery-soft-countdown-face[data-pad="s"] > .gallery-soft-countdown-empty > :is(.gallery-soft-countdown-line, .gallery-soft-countdown-how) { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
189
|
+
> .gallery-soft-countdown-face[data-pad="s"] > .gallery-soft-countdown-empty > .gallery-soft-countdown-line { font-size: 12.5px; line-height: 18px; }
|
|
190
|
+
> .gallery-soft-countdown-face[data-pad="s"] > .gallery-soft-countdown-empty > .gallery-soft-countdown-how { line-height: 16px; }
|
|
191
|
+
/* A card 2 cells high and wider: the disc beside its line and what to do, which under the head have no room for a column. */
|
|
192
|
+
> .gallery-soft-countdown-face[data-pad="m"] > .gallery-soft-countdown-empty { display: grid; grid-template-columns: auto minmax(0, max-content); column-gap: 12px; row-gap: 2px; align-content: center; justify-content: center; text-align: left; }
|
|
193
|
+
> .gallery-soft-countdown-face[data-pad="m"] > .gallery-soft-countdown-empty > .gallery-soft-countdown-disc { grid-row: 1 / span 2; width: 36px; height: 36px; margin: 0; }
|
|
194
|
+
> .gallery-soft-countdown-face[data-pad="m"] > .gallery-soft-countdown-empty > .gallery-soft-countdown-disc > svg { width: 17px; height: 17px; }
|
|
195
|
+
> .gallery-soft-countdown-face[data-pad="m"] > .gallery-soft-countdown-empty > :is(.gallery-soft-countdown-line, .gallery-soft-countdown-how) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
196
|
+
> .gallery-soft-countdown-face[data-pad="m"] > .gallery-soft-countdown-empty > .gallery-soft-countdown-line { align-self: end; }
|
|
197
|
+
> .gallery-soft-countdown-face[data-pad="m"] > .gallery-soft-countdown-empty > .gallery-soft-countdown-how { align-self: start; }
|
|
198
|
+
> .gallery-soft-countdown-face[data-pad="m"] > .gallery-soft-countdown-empty > .gallery-soft-countdown-line:last-child { grid-row: 1 / span 2; align-self: center; }
|
|
199
|
+
}
|
|
200
|
+
/* 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. */
|
|
201
|
+
.gallery-card > [data-doc-component="gallery-soft/countdown"] { height: 100%; }
|
|
202
|
+
.gallery-card > [data-doc-component="gallery-soft/countdown"] > .gallery-soft-countdown-face {
|
|
203
|
+
--soft-edge: 1px;
|
|
204
|
+
--soft-grip-room: max(0px, calc(40px - var(--soft-pad)));
|
|
205
|
+
width: auto;
|
|
206
|
+
max-width: none;
|
|
207
|
+
height: calc(100% + 2 * var(--gallery-card-pad));
|
|
208
|
+
margin: calc(-1 * var(--gallery-card-pad));
|
|
209
|
+
border-radius: calc(var(--gallery-card-radius) - 1px);
|
|
210
|
+
box-shadow: none;
|
|
211
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# 倒计时 (gallery-soft/countdown)
|
|
2
|
+
|
|
3
|
+
A card for a custom page (its places are `page`): how many days are left until a date, 就是今天 on the day, and how many days have gone since after it. Use it for a day the user waits for or counts from (a holiday, a deadline, an anniversary).
|
|
4
|
+
|
|
5
|
+
It is 柔光风格's (the pack `gallery-soft`, off until the user turns it on in 设置 › 组件列表): the same card as Gallery 风格's `gallery/countdown`, 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 two settings are 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
|
+
| `title` | 名称 | text | the name of the day, as 春节 or 项目上线; left empty, the card says 还有 / 已经过去 alone |
|
|
14
|
+
| `date` | 日期 | date | the day, `YYYY-MM-DD` |
|
|
15
|
+
|
|
16
|
+
They are kept in its data part `settings`, a `<script type="application/json">`, as example.html does: `{"title":"春节","date":"2027-02-06"}` (on one line and compact, as the card's 设置… writes it back). Write them there when the user tells you the day, or `gallery page add <slug> gallery-soft/countdown --set date=2027-02-06 --set title=春节` with the add; the date is the one setting it cannot show anything without (`required` in its manifest): ask the user for it when they did not say which day. `{}` (template.html, what a menu adds) is a card with no date yet, which asks for one (右上角手柄 › 设置…), and `gallery page check` notes it. The block reads them and writes nothing.
|
|
17
|
+
|
|
18
|
+
## How to write it
|
|
19
|
+
|
|
20
|
+
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/countdown`, the instance as template.html has it, then its settings as above. Sizes: 2 × 2 (the default) and 4 × 2 (a small page of a calendar beside the count).
|
|
21
|
+
|
|
22
|
+
## How it looks
|
|
23
|
+
|
|
24
|
+
The day's name beside an hourglass's chip on the top line (春节; 倒计时 where it has none), the count of days large at the bottom, 还有 (or 已过) before it and 天 after it, muted, the date under it (2月6日 周六; on a 4 × 2 card 2027年2月6日 星期六, and a small page of a calendar at the right, the month on a band of the accent over the day); on the day itself 就是今天 in the accent; with no date a calendar in a soft disc over 还没有设日期 and where to set it (右上角手柄 › 设置…); 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 count moves by itself at midnight (it hears the kit's clock). The script runs with the rights of the page's own scripts, as any block's does.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "gallery-soft/habit",
|
|
3
|
+
"apiVersion": 1,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"name": { "zh": "习惯打卡", "en": "Habit tracker" },
|
|
6
|
+
"description": { "zh": "每天打一次卡,显示连续了几天和最近一周,大卡片还有最近四周;名字在卡片上直接改", "en": "A check-in a day, the streak and the last seven days, the last four weeks on a large card; the habit's name is edited on the card" },
|
|
7
|
+
"words": "xiguandaka xiguan daka habit streak checkin tracker 习惯 打卡 连续 坚持",
|
|
8
|
+
"parts": {
|
|
9
|
+
"habit": { "at": ":scope > script", "edit": "data" }
|
|
10
|
+
},
|
|
11
|
+
"runtime": { "generated": [":scope > .gallery-soft-habit-face"] },
|
|
12
|
+
"places": ["page"],
|
|
13
|
+
"card": { "sizes": [[4, 2], [2, 2], [4, 4]], "resize": true }
|
|
14
|
+
}
|