@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,335 @@
|
|
|
1
|
+
// gallery-soft/recent (最近编辑, 柔光风格): Gallery 风格's gallery/recent in the soft look, the same logic. The
|
|
2
|
+
// workspace's documents edited last, the last first, read through context.workspace.query("recent") (its
|
|
3
|
+
// manifest's needs hold "workspace"): each its page icon, its title and when it was edited, said as a person
|
|
4
|
+
// says it (刚刚, 5 分钟前, 昨天, 11月2日), which moves on by itself (the kit's clock, each minute). A click opens
|
|
5
|
+
// the document (context.workspace.open: the workbench goes there). It reads again whenever the workspace
|
|
6
|
+
// says the list changed (the `data` signal, "recent": a document written, renamed, given another icon, made
|
|
7
|
+
// or gone). It holds no part and writes nothing: all it shows is drawn (the manifest's `runtime`). Where the
|
|
8
|
+
// workspace cannot be read (an exported file, where it has no server; a server that does not answer) it
|
|
9
|
+
// says so on the cards' empty face. The words are the page's language (the UI's where Gallery says it, else
|
|
10
|
+
// the page's lang).
|
|
11
|
+
//
|
|
12
|
+
// Its face, laid out by its card's size (`context.size`, read again on `layout`; data-w, data-h, data-pad): a
|
|
13
|
+
// head of a clock's chip and 最近编辑, how many of those listed were edited today at its end (今天 3 篇); the
|
|
14
|
+
// documents as rows like the sidebar's, the latest's time in the accent; a card 6 cells high and more says
|
|
15
|
+
// over them which of today, yesterday, this week and earlier each is in (`sectionOf`). The list shows whole
|
|
16
|
+
// rows only: as many as fit what the card has under its head (`fit`, its height the bottom of the last row
|
|
17
|
+
// none is cut at), a muted line under them saying how many more are below (还有 3 篇), counted again as the
|
|
18
|
+
// list scrolls or the card changes size (its own ResizeObserver on the face) and gone at its end; a card 2
|
|
19
|
+
// cells high shows its rows at the bottom, no such line.
|
|
20
|
+
//
|
|
21
|
+
// A document's icon is drawn as Gallery's sidebar draws it, from the server that shows the page (its icon
|
|
22
|
+
// route, /__gallery/edit/icon, one picture of any icon's value): an emoji as it is, a picture of its folder
|
|
23
|
+
// as a picture, one of Gallery's glyphs as a mask in the muted color, which follows the theme; a document
|
|
24
|
+
// with none a page drawn on a soft gray square.
|
|
25
|
+
|
|
26
|
+
const WORDS = {
|
|
27
|
+
zh: {
|
|
28
|
+
title: "最近编辑",
|
|
29
|
+
empty: "还没有文档",
|
|
30
|
+
emptyHow: "新建一篇,或者让 Agent 写一篇",
|
|
31
|
+
offline: "在 Gallery 里打开时显示",
|
|
32
|
+
failed: "读不到工作区的文档",
|
|
33
|
+
more: (/** @type {number} */ count) => `还有 ${count} 篇`,
|
|
34
|
+
today: (/** @type {number} */ count) => `今天 ${count} 篇`,
|
|
35
|
+
open: (/** @type {string} */ title) => `打开「${title}」`,
|
|
36
|
+
now: "刚刚",
|
|
37
|
+
minutes: (/** @type {number} */ count) => `${count} 分钟前`,
|
|
38
|
+
hours: (/** @type {number} */ count) => `${count} 小时前`,
|
|
39
|
+
yesterday: "昨天",
|
|
40
|
+
days: (/** @type {number} */ count) => `${count} 天前`,
|
|
41
|
+
date: (/** @type {Date} */ date, /** @type {boolean} */ thisYear) => (thisYear ? `${date.getMonth() + 1}月${date.getDate()}日` : `${date.getFullYear()}年${date.getMonth() + 1}月${date.getDate()}日`),
|
|
42
|
+
sections: { today: "今天", yesterday: "昨天", week: "本周", earlier: "更早" },
|
|
43
|
+
},
|
|
44
|
+
en: {
|
|
45
|
+
title: "Recently edited",
|
|
46
|
+
empty: "No documents yet",
|
|
47
|
+
emptyHow: "Make one, or ask your Agent to write one",
|
|
48
|
+
offline: "Shown when opened in Gallery",
|
|
49
|
+
failed: "The workspace's documents could not be read",
|
|
50
|
+
more: (/** @type {number} */ count) => `${count} more`,
|
|
51
|
+
today: (/** @type {number} */ count) => `${count} today`,
|
|
52
|
+
open: (/** @type {string} */ title) => `Open “${title}”`,
|
|
53
|
+
now: "just now",
|
|
54
|
+
minutes: (/** @type {number} */ count) => `${count} min ago`,
|
|
55
|
+
hours: (/** @type {number} */ count) => `${count} h ago`,
|
|
56
|
+
yesterday: "yesterday",
|
|
57
|
+
days: (/** @type {number} */ count) => `${count} days ago`,
|
|
58
|
+
date: (/** @type {Date} */ date, /** @type {boolean} */ thisYear) => `${["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"][date.getMonth()]} ${date.getDate()}${thisYear ? "" : `, ${date.getFullYear()}`}`,
|
|
59
|
+
sections: { today: "Today", yesterday: "Yesterday", week: "This week", earlier: "Earlier" },
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/** The language the page speaks: the UI's where Gallery says it (data-ge-language), else its lang's. */
|
|
64
|
+
function languageOf(/** @type {HTMLElement} */ root) {
|
|
65
|
+
const ui = root.getAttribute("data-ge-language");
|
|
66
|
+
return (ui !== null ? ui === "en" : /^en(?:-|$)/i.test(root.lang)) ? "en" : "zh";
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* When `edited` (an ISO time) was, from `now` (the reader's clock), as a person says it: within a minute
|
|
71
|
+
* 刚刚, then minutes, then hours (the same day, or within 6 hours of it), 昨天 for the day before, days
|
|
72
|
+
* within the week, else the date (the year said when it is another).
|
|
73
|
+
* @param {string} edited
|
|
74
|
+
* @param {Date} now
|
|
75
|
+
* @param {"zh" | "en"} language
|
|
76
|
+
*/
|
|
77
|
+
function whenOf(edited, now, language) {
|
|
78
|
+
const words = WORDS[language];
|
|
79
|
+
const then = new Date(edited);
|
|
80
|
+
const minutes = Math.floor((now.getTime() - then.getTime()) / 60_000);
|
|
81
|
+
if (!Number.isFinite(minutes)) return "";
|
|
82
|
+
if (minutes < 1) return words.now;
|
|
83
|
+
if (minutes < 60) return words.minutes(minutes);
|
|
84
|
+
const day = (/** @type {Date} */ date) => Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) / 86_400_000;
|
|
85
|
+
const days = day(now) - day(then);
|
|
86
|
+
if (days === 0 || minutes < 360) return words.hours(Math.floor(minutes / 60));
|
|
87
|
+
if (days === 1) return words.yesterday;
|
|
88
|
+
if (days < 7) return words.days(days);
|
|
89
|
+
return words.date(then, then.getFullYear() === now.getFullYear());
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Which part of the time `edited` (an ISO time) falls in from `now`, as a tall card's labels say it: today,
|
|
94
|
+
* yesterday, this week (since Monday), or earlier.
|
|
95
|
+
* @param {string} edited
|
|
96
|
+
* @param {Date} now
|
|
97
|
+
* @returns {"today" | "yesterday" | "week" | "earlier"}
|
|
98
|
+
*/
|
|
99
|
+
function sectionOf(edited, now) {
|
|
100
|
+
const then = new Date(edited);
|
|
101
|
+
const day = (/** @type {Date} */ date) => Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) / 86_400_000;
|
|
102
|
+
const days = day(now) - day(then);
|
|
103
|
+
if (!(days >= 0) || days === 0) return "today";
|
|
104
|
+
if (days === 1) return "yesterday";
|
|
105
|
+
return days <= (now.getDay() + 6) % 7 ? "week" : "earlier";
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** What a document's icon is, as Gallery writes its value: a glyph (/icons/…), a picture of its folder (assets/…), an emoji, or none. @param {string | null} value */
|
|
109
|
+
function iconKindOf(value) {
|
|
110
|
+
if (typeof value !== "string" || !value) return null;
|
|
111
|
+
if (value.startsWith("/icons/")) return "glyph";
|
|
112
|
+
if (value.startsWith("assets/")) return "image";
|
|
113
|
+
return "emoji";
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The size the face is laid out by: its card's cells (`context.size`), or `fallback` (the manifest's first
|
|
118
|
+
* size) where no card is; and the frame's padding for it, as the soft cards pad theirs: "xs" on a card one
|
|
119
|
+
* cell high, "s" on a small one (2 × 2 and less), "l" on one 3 cells high or more, else "m".
|
|
120
|
+
* @param {DocComponentSize | null | undefined} size
|
|
121
|
+
* @param {[number, number]} fallback
|
|
122
|
+
*/
|
|
123
|
+
function sizeOf(size, fallback) {
|
|
124
|
+
const w = size?.w ?? fallback[0];
|
|
125
|
+
const h = size?.h ?? fallback[1];
|
|
126
|
+
return { w, h, pad: h === 1 ? "xs" : w <= 2 && h <= 2 ? "s" : h >= 3 ? "l" : "m" };
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* An element of the face, of `kind` (its class).
|
|
131
|
+
* @template {keyof HTMLElementTagNameMap} K
|
|
132
|
+
* @param {K} tag
|
|
133
|
+
* @param {string} kind
|
|
134
|
+
* @param {string} [text]
|
|
135
|
+
*/
|
|
136
|
+
function made(tag, kind, text) {
|
|
137
|
+
const node = document.createElement(tag);
|
|
138
|
+
node.className = `gallery-soft-recent-${kind}`;
|
|
139
|
+
if (text !== undefined) node.textContent = text;
|
|
140
|
+
return node;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const line = (/** @type {string} */ paths) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">${paths}</svg>`;
|
|
144
|
+
const PAGE = '<path d="M7 3.5h10a1.5 1.5 0 0 1 1.5 1.5v14a1.5 1.5 0 0 1-1.5 1.5H7A1.5 1.5 0 0 1 5.5 19V5A1.5 1.5 0 0 1 7 3.5z"/><path d="M9 8.5h6M9 12h6M9 15.5h3.5"/>';
|
|
145
|
+
|
|
146
|
+
// A document's icon: its emoji, its picture from the server's icon route, a glyph masked, or a page on a gray square.
|
|
147
|
+
function iconFor(/** @type {string} */ slug, /** @type {string | null} */ value) {
|
|
148
|
+
const kind = iconKindOf(value);
|
|
149
|
+
const icon = made("span", "icon");
|
|
150
|
+
if (!kind || value === null) {
|
|
151
|
+
icon.classList.add("gallery-soft-recent-plain");
|
|
152
|
+
icon.innerHTML = line(PAGE);
|
|
153
|
+
return icon;
|
|
154
|
+
}
|
|
155
|
+
if (kind === "emoji") {
|
|
156
|
+
icon.classList.add("gallery-soft-recent-emoji");
|
|
157
|
+
icon.textContent = value;
|
|
158
|
+
return icon;
|
|
159
|
+
}
|
|
160
|
+
const address = `/__gallery/edit/icon?value=${encodeURIComponent(value)}&slug=${encodeURIComponent(slug)}`;
|
|
161
|
+
if (kind === "glyph") {
|
|
162
|
+
icon.classList.add("gallery-soft-recent-glyph");
|
|
163
|
+
icon.style.setProperty("--gallery-soft-recent-icon", `url("${address}")`);
|
|
164
|
+
return icon;
|
|
165
|
+
}
|
|
166
|
+
const picture = document.createElement("img");
|
|
167
|
+
picture.alt = "";
|
|
168
|
+
picture.src = address;
|
|
169
|
+
picture.decoding = "async";
|
|
170
|
+
icon.classList.add("gallery-soft-recent-picture");
|
|
171
|
+
icon.append(picture);
|
|
172
|
+
return icon;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
DocKit.component({
|
|
176
|
+
id: "gallery-soft/recent",
|
|
177
|
+
on: ["data", "clock", "layout"],
|
|
178
|
+
mount(host, context) {
|
|
179
|
+
const language = languageOf(document.documentElement);
|
|
180
|
+
const words = WORDS[language];
|
|
181
|
+
const face = made("div", "face");
|
|
182
|
+
const list = made("ul", "list");
|
|
183
|
+
const head = made("div", "head");
|
|
184
|
+
const chip = made("span", "chip");
|
|
185
|
+
chip.setAttribute("aria-hidden", "true");
|
|
186
|
+
chip.innerHTML = line('<circle cx="12" cy="12" r="8.6"/><path d="M12 7.6V12l2.9 1.9"/>');
|
|
187
|
+
// Its quiet meta at the head's end: how many of the documents listed were edited today.
|
|
188
|
+
const meta = made("span", "meta");
|
|
189
|
+
head.append(chip, made("span", "title", words.title), meta);
|
|
190
|
+
const more = made("p", "more");
|
|
191
|
+
const arrow = made("span", "arrow");
|
|
192
|
+
arrow.innerHTML = line('<path d="M12 5v14M6.5 13.5L12 19l5.5-5.5"/>');
|
|
193
|
+
const moreWords = made("span", "more-words");
|
|
194
|
+
more.append(arrow, moreWords);
|
|
195
|
+
more.hidden = true;
|
|
196
|
+
const empty = made("div", "empty");
|
|
197
|
+
face.append(head, list, more, empty);
|
|
198
|
+
host.append(face);
|
|
199
|
+
let high = 4; // the card's cells high, as last laid out
|
|
200
|
+
// How many rows are below what the list shows (one cut off counted), said under it, or nothing.
|
|
201
|
+
const recount = () => {
|
|
202
|
+
const bottom = list.scrollTop + list.clientHeight;
|
|
203
|
+
let below = 0;
|
|
204
|
+
for (const row of /** @type {NodeListOf<HTMLElement>} */ (list.querySelectorAll(".gallery-soft-recent-item"))) if (row.offsetTop + row.offsetHeight > bottom + 1) below++;
|
|
205
|
+
const said = below > 0 && high > 2 ? words.more(below) : "";
|
|
206
|
+
if (moreWords.textContent !== said) moreWords.textContent = said;
|
|
207
|
+
more.hidden = said === "";
|
|
208
|
+
};
|
|
209
|
+
// The list as high as the whole rows that fit the room under the head (with the line of more under it
|
|
210
|
+
// where they are not all shown, but on a card 2 cells high), so that no row is cut at the card's bottom.
|
|
211
|
+
const fit = () => {
|
|
212
|
+
list.style.maxHeight = "";
|
|
213
|
+
more.hidden = true;
|
|
214
|
+
if (list.clientHeight === 0 || list.scrollHeight <= list.clientHeight + 1) return void recount();
|
|
215
|
+
if (high > 2) {
|
|
216
|
+
moreWords.textContent = words.more(0);
|
|
217
|
+
more.hidden = false;
|
|
218
|
+
}
|
|
219
|
+
const room = list.clientHeight;
|
|
220
|
+
const rows = /** @type {HTMLElement[]} */ ([...list.children]);
|
|
221
|
+
const bottoms = rows.filter((row) => row.classList.contains("gallery-soft-recent-item")).map((row) => row.offsetTop + row.offsetHeight).filter((bottom) => bottom <= room + 0.5).sort((a, b) => b - a);
|
|
222
|
+
const whole = bottoms.find((bottom) => rows.every((row) => !(row.offsetTop < bottom - 0.5 && row.offsetTop + row.offsetHeight > bottom + 0.5)));
|
|
223
|
+
if (whole !== undefined) list.style.maxHeight = `${whole}px`;
|
|
224
|
+
recount();
|
|
225
|
+
};
|
|
226
|
+
list.addEventListener("scroll", recount, { passive: true });
|
|
227
|
+
const watch = typeof ResizeObserver === "function" ? new ResizeObserver(() => fit()) : null;
|
|
228
|
+
watch?.observe(face);
|
|
229
|
+
context.signal?.addEventListener("abort", () => {
|
|
230
|
+
list.removeEventListener("scroll", recount);
|
|
231
|
+
watch?.disconnect();
|
|
232
|
+
}, { once: true });
|
|
233
|
+
const workspace = context.workspace;
|
|
234
|
+
if (!workspace) return void context.fail(new Error("its manifest's needs hold \"workspace\": context.workspace is not there"));
|
|
235
|
+
/** @type {Array<{ node: HTMLElement, edited: string }>} */
|
|
236
|
+
let times = [];
|
|
237
|
+
/** @type {Array<{ slug: string, title: string, icon: string | null, edited: string }> | null} */
|
|
238
|
+
let documents = null;
|
|
239
|
+
let failure = "";
|
|
240
|
+
const lay = () => {
|
|
241
|
+
const { w, h, pad } = sizeOf(context.size, [4, 4]);
|
|
242
|
+
high = h;
|
|
243
|
+
Object.assign(face.dataset, { w: String(w), h: String(h), pad });
|
|
244
|
+
};
|
|
245
|
+
// The cards' empty face: a soft disc, a line, what to do.
|
|
246
|
+
const say = (/** @type {string | null} */ said, /** @type {string} */ how = "", /** @type {string} */ picture = PAGE) => {
|
|
247
|
+
face.toggleAttribute("data-empty", said !== null);
|
|
248
|
+
if (said === null) return void empty.replaceChildren();
|
|
249
|
+
const disc = made("span", "disc");
|
|
250
|
+
disc.innerHTML = line(picture);
|
|
251
|
+
empty.replaceChildren(disc, made("p", "line", said), ...(how ? [made("p", "how", how)] : []));
|
|
252
|
+
};
|
|
253
|
+
// Each time said again, only where its words are others; the head's count of today's too.
|
|
254
|
+
const retime = () => {
|
|
255
|
+
const now = new Date();
|
|
256
|
+
let today = 0;
|
|
257
|
+
for (const { node, edited } of times) {
|
|
258
|
+
const said = whenOf(edited, now, language);
|
|
259
|
+
if (node.textContent !== said) node.textContent = said;
|
|
260
|
+
node.classList.toggle("gallery-soft-recent-now", said === words.now);
|
|
261
|
+
const then = new Date(edited);
|
|
262
|
+
if (then.getFullYear() === now.getFullYear() && then.getMonth() === now.getMonth() && then.getDate() === now.getDate()) today++;
|
|
263
|
+
}
|
|
264
|
+
const counted = today > 0 ? words.today(today) : "";
|
|
265
|
+
if (meta.textContent !== counted) meta.textContent = counted;
|
|
266
|
+
};
|
|
267
|
+
const draw = () => {
|
|
268
|
+
lay();
|
|
269
|
+
times = [];
|
|
270
|
+
if (documents === null) {
|
|
271
|
+
meta.textContent = "";
|
|
272
|
+
list.replaceChildren();
|
|
273
|
+
if (failure === "offline") say(words.offline, "", '<circle cx="12" cy="12" r="8.6"/><path d="M12 7.6V12l2.9 1.9"/>');
|
|
274
|
+
else if (failure) say(words.failed);
|
|
275
|
+
else say(null);
|
|
276
|
+
return fit();
|
|
277
|
+
}
|
|
278
|
+
const now = new Date();
|
|
279
|
+
/** @type {string} */
|
|
280
|
+
let section = "";
|
|
281
|
+
/** @type {HTMLElement[]} */
|
|
282
|
+
const rows = [];
|
|
283
|
+
for (const entry of documents) {
|
|
284
|
+
if (high >= 6) {
|
|
285
|
+
const part = sectionOf(entry.edited, now);
|
|
286
|
+
if (part !== section) {
|
|
287
|
+
section = part;
|
|
288
|
+
const label = made("li", "section", words.sections[part]);
|
|
289
|
+
label.setAttribute("aria-hidden", "true");
|
|
290
|
+
rows.push(label);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
const item = made("li", "item");
|
|
294
|
+
const button = made("button", "document");
|
|
295
|
+
button.type = "button";
|
|
296
|
+
button.title = words.open(entry.title);
|
|
297
|
+
const when = made("time", "when");
|
|
298
|
+
when.dateTime = entry.edited;
|
|
299
|
+
times.push({ node: when, edited: entry.edited });
|
|
300
|
+
button.append(iconFor(entry.slug, entry.icon), made("span", "name", entry.title), when);
|
|
301
|
+
button.addEventListener("click", () => workspace.open({ slug: entry.slug }));
|
|
302
|
+
item.append(button);
|
|
303
|
+
rows.push(item);
|
|
304
|
+
}
|
|
305
|
+
list.replaceChildren(...rows);
|
|
306
|
+
retime();
|
|
307
|
+
say(documents.length === 0 ? words.empty : null, words.emptyHow);
|
|
308
|
+
fit();
|
|
309
|
+
};
|
|
310
|
+
let asking = 0; // the last read asked: an older answer that comes after it is dropped
|
|
311
|
+
const read = () => {
|
|
312
|
+
const ticket = ++asking;
|
|
313
|
+
workspace.query("recent", { limit: 20 }).then(({ data }) => {
|
|
314
|
+
if (ticket !== asking || context.signal.aborted) return;
|
|
315
|
+
documents = data;
|
|
316
|
+
failure = "";
|
|
317
|
+
draw();
|
|
318
|
+
}, (/** @type {any} */ error) => {
|
|
319
|
+
if (ticket !== asking || context.signal.aborted) return;
|
|
320
|
+
documents = null;
|
|
321
|
+
failure = error?.code === "offline" ? "offline" : "failed";
|
|
322
|
+
draw();
|
|
323
|
+
});
|
|
324
|
+
};
|
|
325
|
+
lay();
|
|
326
|
+
read();
|
|
327
|
+
return {
|
|
328
|
+
update(reason, detail) {
|
|
329
|
+
if (reason === "data" && detail === "recent") read();
|
|
330
|
+
else if (reason === "clock") retime();
|
|
331
|
+
else if (reason === "layout") draw();
|
|
332
|
+
},
|
|
333
|
+
};
|
|
334
|
+
},
|
|
335
|
+
});
|
|
@@ -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="40" height="6" rx="3" fill="#37352f"/><rect x="178" y="28" width="26" height="6" rx="3" fill="#c4c2bd"/><rect x="30" y="44" width="11" height="11" rx="3.5" fill="#f4e1c4"/><rect x="48" y="47" width="56" height="6" rx="3" fill="#4a4843"/><rect x="180" y="48" width="24" height="5" rx="2.5" fill="#3e7ac6"/><rect x="30" y="59" width="11" height="11" rx="3.5" fill="#f3d0d4"/><rect x="48" y="62" width="74" height="6" rx="3" fill="#4a4843"/><rect x="180" y="63" width="24" height="5" rx="2.5" fill="#c4c2bd"/><rect x="30" y="74" width="11" height="11" rx="3.5" fill="#efeff0"/><rect x="48" y="77" width="50" height="6" rx="3" fill="#4a4843"/><rect x="180" y="78" width="24" height="5" rx="2.5" fill="#c4c2bd"/><rect x="30" y="89" width="11" height="11" rx="3.5" fill="#d6e6c8"/><rect x="48" y="92" width="88" height="6" rx="3" fill="#4a4843"/><rect x="180" y="93" width="24" height="5" rx="2.5" fill="#c4c2bd"/></svg>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/* 柔光风格's recently edited. Every selector starts at the instance and goes down from it, so that nothing
|
|
2
|
+
here reaches the rest of the page. The soft look's tokens first, light and dark (light-dark(): the page's
|
|
3
|
+
color scheme, which follows its theme), then the face: a faint wash of the accent from the card's top over
|
|
4
|
+
the soft card's fill; a head of a clock's chip and 最近编辑, today's count at its end (fading while the grip
|
|
5
|
+
shows); the documents as rows like the sidebar's (a page icon on a soft gray square, an emoji on none, the
|
|
6
|
+
title, when at the end, the latest's 刚刚 in the accent), a row under the pointer a soft gray; on a tall card
|
|
7
|
+
faint labels of today, yesterday, this week and earlier between them; a muted line of how many more under
|
|
8
|
+
them at the card's bottom; on a card 2 cells high its rows at the bottom. Nothing to list: the cards' empty
|
|
9
|
+
face. On a custom page the face is the card's whole room, taken out over the card's padding and given the
|
|
10
|
+
soft frame's (data-pad), the board's line around it; where no card is (a document, as gallery block check
|
|
11
|
+
shows it) the face frames itself at a 4 × 4 card's size. */
|
|
12
|
+
[data-doc-component="gallery-soft/recent"] {
|
|
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-faint: light-dark(#ababb0, #66666c);
|
|
23
|
+
--soft-accent: light-dark(#3e7ac6, #7eade2);
|
|
24
|
+
--soft-accent-ink: light-dark(#356cb3, #98bee9);
|
|
25
|
+
--soft-accent-soft: light-dark(#ecf3fb, rgb(126 173 226 / 14%));
|
|
26
|
+
--soft-track: light-dark(rgb(28 28 32 / 7%), rgb(255 255 255 / 8%));
|
|
27
|
+
--soft-hover: light-dark(rgb(55 53 47 / 6%), rgb(255 255 255 / 6%));
|
|
28
|
+
--soft-grip-room: 0px;
|
|
29
|
+
> .gallery-soft-recent-face {
|
|
30
|
+
--soft-pad: 24px;
|
|
31
|
+
position: relative;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
min-width: 0;
|
|
36
|
+
width: 304px;
|
|
37
|
+
max-width: 100%;
|
|
38
|
+
height: 304px;
|
|
39
|
+
padding: calc(var(--soft-pad) - var(--soft-edge, 0px));
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
border-radius: 16px;
|
|
42
|
+
box-shadow: var(--soft-card-shadow);
|
|
43
|
+
background: var(--soft-wash), var(--soft-card);
|
|
44
|
+
color: var(--soft-text);
|
|
45
|
+
font: 13px/1.5 var(--soft-font);
|
|
46
|
+
-webkit-font-smoothing: antialiased;
|
|
47
|
+
}
|
|
48
|
+
> .gallery-soft-recent-face[data-pad="m"] { --soft-pad: 20px; }
|
|
49
|
+
> .gallery-soft-recent-face[data-pad="s"] { --soft-pad: 18px; }
|
|
50
|
+
/* The head: the clock's chip, 最近编辑, today's count at its end. */
|
|
51
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-head { display: flex; align-items: center; gap: 10px; flex: none; height: 28px; min-width: 0; padding-inline-end: var(--soft-grip-room); }
|
|
52
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-head > .gallery-soft-recent-chip { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--soft-accent-soft); color: var(--soft-accent); }
|
|
53
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-head > .gallery-soft-recent-chip > svg { display: block; width: 16px; height: 16px; }
|
|
54
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-head > .gallery-soft-recent-title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; font-weight: 600; color: var(--soft-strong); }
|
|
55
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-head > .gallery-soft-recent-meta {
|
|
56
|
+
flex: none;
|
|
57
|
+
margin-left: auto;
|
|
58
|
+
margin-inline-end: calc(-1 * var(--soft-grip-room));
|
|
59
|
+
font-size: 12px;
|
|
60
|
+
color: var(--soft-muted);
|
|
61
|
+
white-space: nowrap;
|
|
62
|
+
opacity: calc(1 - var(--gallery-grip-shown, 0));
|
|
63
|
+
transition: opacity .12s ease-out;
|
|
64
|
+
}
|
|
65
|
+
/* The rows. */
|
|
66
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-list {
|
|
67
|
+
position: relative;
|
|
68
|
+
flex: 0 1 auto;
|
|
69
|
+
min-height: 0;
|
|
70
|
+
margin: 12px 0 0;
|
|
71
|
+
padding: 0;
|
|
72
|
+
list-style: none;
|
|
73
|
+
overflow-x: hidden;
|
|
74
|
+
overflow-y: auto;
|
|
75
|
+
scrollbar-width: none;
|
|
76
|
+
}
|
|
77
|
+
> .gallery-soft-recent-face[data-h="1"] > .gallery-soft-recent-list,
|
|
78
|
+
> .gallery-soft-recent-face[data-h="2"] > .gallery-soft-recent-list { margin-top: auto; }
|
|
79
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-list > .gallery-soft-recent-section { display: flex; align-items: flex-end; height: 22px; padding-bottom: 3px; box-sizing: border-box; font-size: 11.5px; color: var(--soft-faint); }
|
|
80
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-list > .gallery-soft-recent-section:first-child { height: 16px; }
|
|
81
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-list > .gallery-soft-recent-item { display: block; }
|
|
82
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-list > .gallery-soft-recent-item > .gallery-soft-recent-document {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
gap: 10px;
|
|
86
|
+
box-sizing: border-box;
|
|
87
|
+
width: calc(100% + 12px);
|
|
88
|
+
height: 31px;
|
|
89
|
+
margin: 0 -6px;
|
|
90
|
+
padding: 0 6px;
|
|
91
|
+
border: 0;
|
|
92
|
+
border-radius: 6px;
|
|
93
|
+
background: none;
|
|
94
|
+
font: inherit;
|
|
95
|
+
color: inherit;
|
|
96
|
+
text-align: left;
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
}
|
|
99
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-list > .gallery-soft-recent-item > .gallery-soft-recent-document:is(:hover, :focus-visible) { outline: none; background: var(--soft-hover); }
|
|
100
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-list > .gallery-soft-recent-item > .gallery-soft-recent-document > .gallery-soft-recent-icon {
|
|
101
|
+
display: grid;
|
|
102
|
+
place-items: center;
|
|
103
|
+
flex: none;
|
|
104
|
+
width: 26px;
|
|
105
|
+
height: 26px;
|
|
106
|
+
border-radius: 7px;
|
|
107
|
+
background: var(--soft-track);
|
|
108
|
+
color: var(--soft-muted);
|
|
109
|
+
font-size: 15px;
|
|
110
|
+
line-height: 1;
|
|
111
|
+
}
|
|
112
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-list > .gallery-soft-recent-item > .gallery-soft-recent-document > .gallery-soft-recent-emoji { background: transparent; font-size: 17px; }
|
|
113
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-list > .gallery-soft-recent-item > .gallery-soft-recent-document > .gallery-soft-recent-icon > svg { display: block; width: 15px; height: 15px; }
|
|
114
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-list > .gallery-soft-recent-item > .gallery-soft-recent-document > .gallery-soft-recent-picture { background: transparent; }
|
|
115
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-list > .gallery-soft-recent-item > .gallery-soft-recent-document > .gallery-soft-recent-picture > img { display: block; width: 20px; height: 20px; border-radius: 4px; object-fit: cover; }
|
|
116
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-list > .gallery-soft-recent-item > .gallery-soft-recent-document > .gallery-soft-recent-glyph::before { content: ""; width: 15px; height: 15px; background: var(--soft-muted); -webkit-mask: var(--gallery-soft-recent-icon) center / contain no-repeat; mask: var(--gallery-soft-recent-icon) center / contain no-repeat; }
|
|
117
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-list > .gallery-soft-recent-item > .gallery-soft-recent-document > .gallery-soft-recent-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13.5px; color: var(--soft-text); }
|
|
118
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-list > .gallery-soft-recent-item > .gallery-soft-recent-document > .gallery-soft-recent-when { flex: none; margin-left: auto; padding-left: 10px; font: 12px var(--soft-num); color: var(--soft-muted); white-space: nowrap; }
|
|
119
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-list > .gallery-soft-recent-item > .gallery-soft-recent-document > .gallery-soft-recent-now { color: var(--soft-accent-ink); font-weight: 500; }
|
|
120
|
+
/* How many more are below. */
|
|
121
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-more { display: flex; align-items: center; gap: 4px; flex: none; margin: auto 0 0; padding-top: 8px; font-size: 12px; color: var(--soft-muted); }
|
|
122
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-more[hidden] { display: none; }
|
|
123
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-more > .gallery-soft-recent-arrow { display: block; width: 13px; height: 13px; }
|
|
124
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-more > .gallery-soft-recent-arrow > svg { display: block; width: 100%; height: 100%; }
|
|
125
|
+
/* Nothing to list: the cards' empty face. */
|
|
126
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-empty { display: none; }
|
|
127
|
+
> .gallery-soft-recent-face[data-empty] > .gallery-soft-recent-list { display: none; }
|
|
128
|
+
> .gallery-soft-recent-face[data-empty] > .gallery-soft-recent-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex: 1; min-height: 0; text-align: center; }
|
|
129
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-empty > .gallery-soft-recent-disc { display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin-bottom: 8px; border-radius: 50%; background: var(--soft-track); color: var(--soft-muted); }
|
|
130
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-empty > .gallery-soft-recent-disc > svg { display: block; width: 20px; height: 20px; }
|
|
131
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-empty > .gallery-soft-recent-line { margin: 0; font-size: 13px; color: var(--soft-text); }
|
|
132
|
+
> .gallery-soft-recent-face > .gallery-soft-recent-empty > .gallery-soft-recent-how { margin: 0; font-size: 12px; color: var(--soft-muted); }
|
|
133
|
+
/* A 2 × 2 card: a smaller disc, a line each, so that the three stand clear of the head. */
|
|
134
|
+
> .gallery-soft-recent-face[data-pad="s"] > .gallery-soft-recent-empty { gap: 0; }
|
|
135
|
+
> .gallery-soft-recent-face[data-pad="s"] > .gallery-soft-recent-empty > .gallery-soft-recent-disc { width: 30px; height: 30px; margin-bottom: 4px; }
|
|
136
|
+
> .gallery-soft-recent-face[data-pad="s"] > .gallery-soft-recent-empty > .gallery-soft-recent-disc > svg { width: 15px; height: 15px; }
|
|
137
|
+
> .gallery-soft-recent-face[data-pad="s"] > .gallery-soft-recent-empty > :is(.gallery-soft-recent-line, .gallery-soft-recent-how) { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
138
|
+
> .gallery-soft-recent-face[data-pad="s"] > .gallery-soft-recent-empty > .gallery-soft-recent-line { font-size: 12.5px; line-height: 18px; }
|
|
139
|
+
> .gallery-soft-recent-face[data-pad="s"] > .gallery-soft-recent-empty > .gallery-soft-recent-how { line-height: 16px; }
|
|
140
|
+
/* 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. */
|
|
141
|
+
> .gallery-soft-recent-face[data-pad="m"][data-empty] > .gallery-soft-recent-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; }
|
|
142
|
+
> .gallery-soft-recent-face[data-pad="m"] > .gallery-soft-recent-empty > .gallery-soft-recent-disc { grid-row: 1 / span 2; width: 36px; height: 36px; margin: 0; }
|
|
143
|
+
> .gallery-soft-recent-face[data-pad="m"] > .gallery-soft-recent-empty > .gallery-soft-recent-disc > svg { width: 17px; height: 17px; }
|
|
144
|
+
> .gallery-soft-recent-face[data-pad="m"] > .gallery-soft-recent-empty > :is(.gallery-soft-recent-line, .gallery-soft-recent-how) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
145
|
+
> .gallery-soft-recent-face[data-pad="m"] > .gallery-soft-recent-empty > .gallery-soft-recent-line { align-self: end; }
|
|
146
|
+
> .gallery-soft-recent-face[data-pad="m"] > .gallery-soft-recent-empty > .gallery-soft-recent-how { align-self: start; }
|
|
147
|
+
> .gallery-soft-recent-face[data-pad="m"] > .gallery-soft-recent-empty > .gallery-soft-recent-line:last-child { grid-row: 1 / span 2; align-self: center; }
|
|
148
|
+
}
|
|
149
|
+
/* 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. */
|
|
150
|
+
.gallery-card > [data-doc-component="gallery-soft/recent"] { height: 100%; }
|
|
151
|
+
.gallery-card > [data-doc-component="gallery-soft/recent"] > .gallery-soft-recent-face {
|
|
152
|
+
--soft-edge: 1px;
|
|
153
|
+
--soft-grip-room: max(0px, calc(40px - var(--soft-pad)));
|
|
154
|
+
width: auto;
|
|
155
|
+
max-width: none;
|
|
156
|
+
height: calc(100% + 2 * var(--gallery-card-pad));
|
|
157
|
+
margin: calc(-1 * var(--gallery-card-pad));
|
|
158
|
+
border-radius: calc(var(--gallery-card-radius) - 1px);
|
|
159
|
+
box-shadow: none;
|
|
160
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<div data-doc-component="gallery-soft/recent"></div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# 最近编辑 (gallery-soft/recent)
|
|
2
|
+
|
|
3
|
+
A card for a custom page (its places are `page`, its needs `workspace`): the documents of the workspace edited last, the last first, each with its page icon, its title and when it was edited (刚刚, 5 分钟前, 昨天, 11月2日). Use it on the home page, for the user to go back to what they were working on.
|
|
4
|
+
|
|
5
|
+
It is 柔光风格's (the pack `gallery-soft`, off until the user turns it on in 设置 › 组件列表): the same card as Gallery 风格's `gallery/recent`, its settings, its data and what the user does on it the same, in the soft look of design A (a faint wash of blue from the card's top, rounded chips, big numbers). Write it only where the user asked for 柔光风格 or the page already holds its cards.
|
|
6
|
+
|
|
7
|
+
## How to write it
|
|
8
|
+
|
|
9
|
+
Put it on a custom page as a card of its board, `<section class="gallery-card" data-card-id="…" data-x data-y data-w data-h>`, holding one instance, after `gallery block add gallery-soft/recent`: the instance is empty, `<div data-doc-component="gallery-soft/recent"></div>`, everything on it drawn by its script. It has no settings and holds no data: there is nothing to fill in and nothing it writes. Sizes: 4 × 4 (the default), 4 × 2 and 4 × 6 (labels of today, yesterday, this week and earlier between the rows) are the ones its menu lists; it is 4 wide and any height from 2 to 8 cells; the list shows whole rows and scrolls inside the card, a muted line under it saying how many more.
|
|
10
|
+
|
|
11
|
+
## What the user does
|
|
12
|
+
|
|
13
|
+
Clicks a document: it opens. The list follows by itself: a document written, renamed or given another icon, made or taken away shows at once, and the times move on each minute.
|
|
14
|
+
|
|
15
|
+
## How it looks
|
|
16
|
+
|
|
17
|
+
最近编辑 beside a clock's chip on the top line, how many were edited today at its end (今天 4 篇); the documents as rows like the sidebar's, each its icon (an emoji as it is, a page on a soft gray square for one with none), its title and when it was edited at the end (刚刚 in the accent, 12 分钟前, 昨天, 11月2日); on a 4 × 6 card faint labels of 今天, 昨天, 本周 and 更早 between them; on a 4 × 2 card two rows at the bottom; under the list 还有 17 篇 where more are below; 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 times move on by themselves (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,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "gallery-soft/static",
|
|
3
|
+
"apiVersion": 1,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"name": { "zh": "静态卡片", "en": "Static card" },
|
|
6
|
+
"description": { "zh": "放一段任意的 HTML,只展示,不能在页面上改;开头的标题画成卡片的标题行", "en": "Any HTML, shown as it is: nothing on it changes in the page; a heading it starts with drawn as the card's head row" },
|
|
7
|
+
"words": "jingtaikapian jingtai kapian static html card 静态 卡片 展示 内容",
|
|
8
|
+
"parts": {
|
|
9
|
+
"content": { "at": ":scope > div", "edit": "none" }
|
|
10
|
+
},
|
|
11
|
+
"places": ["page"],
|
|
12
|
+
"card": { "sizes": [[4, 2], [2, 2], [4, 4], [8, 2], [2, 1], [4, 1]], "min": { "w": 1, "h": 1 }, "max": { "w": 12, "h": 24 }, "resize": true }
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<div data-doc-component="gallery-soft/static">
|
|
2
|
+
<div>
|
|
3
|
+
<h3>本周重点</h3>
|
|
4
|
+
<p><small>11月10日 — 11月16日</small></p>
|
|
5
|
+
<ul>
|
|
6
|
+
<li>周三前定下发布日期</li>
|
|
7
|
+
<li>和设计一起过一遍首页</li>
|
|
8
|
+
<li>读完《深度工作》第三章</li>
|
|
9
|
+
</ul>
|
|
10
|
+
<p><a href="https://example.com/plan">完整的计划</a></p>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
@@ -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="44" height="6" rx="3" fill="#37352f"/><rect x="30" y="47" width="9" height="9" rx="3" fill="#efeff0"/><rect x="46" y="49" width="62" height="6" rx="3" fill="#4a4843"/><rect x="176" y="50" width="28" height="4" rx="2" fill="#c4c2bd"/><rect x="30" y="62" width="9" height="9" rx="3" fill="#efeff0"/><rect x="46" y="64" width="50" height="6" rx="3" fill="#4a4843"/><rect x="176" y="65" width="28" height="4" rx="2" fill="#c4c2bd"/><rect x="30" y="77" width="9" height="9" rx="3" fill="#efeff0"/><rect x="46" y="79" width="74" height="6" rx="3" fill="#4a4843"/><rect x="176" y="80" width="28" height="4" rx="2" fill="#c4c2bd"/></svg>
|