@heycys/gallery 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-NOTICES.md +51 -1
- package/browser/editor/components/callout/index.mjs +40 -15
- package/browser/editor/components/columns/page.mjs +45 -32
- package/browser/editor/components/details/index.mjs +2 -1
- package/browser/editor/components/dialog/index.mjs +2 -1
- package/browser/editor/components/dialog/page.mjs +0 -18
- package/browser/editor/components/divider/index.mjs +1 -1
- package/browser/editor/components/embed/index.mjs +2 -2
- package/browser/editor/components/figure/page.mjs +10 -1
- package/browser/editor/components/file/page.mjs +2 -2
- 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 +2 -0
- package/browser/editor/components/heading/page.mjs +6 -0
- package/browser/editor/components/highlight/index.mjs +4 -20
- package/browser/editor/components/icons.mjs +13 -2
- package/browser/editor/components/image/crop.mjs +6 -9
- package/browser/editor/components/image/page.mjs +2 -2
- package/browser/editor/components/installed/index.mjs +82 -29
- package/browser/editor/components/installed/page.mjs +146 -34
- package/browser/editor/components/installed/served.mjs +6 -5
- package/browser/editor/components/instances.mjs +18 -0
- package/browser/editor/components/kit.mjs +3 -0
- package/browser/editor/components/list/page.mjs +3 -6
- package/browser/editor/components/media/page.mjs +44 -14
- package/browser/editor/components/pages.mjs +2 -2
- package/browser/editor/components/registry.mjs +68 -33
- package/browser/editor/components/section/index.mjs +2 -1
- package/browser/editor/components/set-apart.mjs +24 -0
- package/browser/editor/components/table/index.mjs +64 -5
- package/browser/editor/components/table/page.mjs +30 -19
- package/browser/editor/page/annotate/anchors.mjs +4 -3
- package/browser/editor/page/annotate/card.mjs +3 -6
- package/browser/editor/page/annotate/index.mjs +61 -34
- package/browser/editor/page/autosave.mjs +357 -38
- package/browser/editor/page/beside.mjs +5 -5
- package/browser/editor/page/block-menu/colors.mjs +3 -1
- package/browser/editor/page/block-menu/index.mjs +8 -6
- package/browser/editor/page/blocks.mjs +16 -7
- package/browser/editor/page/board/client.mjs +57 -0
- package/browser/editor/page/board/hint.mjs +145 -0
- package/browser/editor/page/board/history.mjs +119 -0
- package/browser/editor/page/board/index.mjs +970 -0
- package/browser/editor/page/board/settings.mjs +209 -0
- package/browser/editor/page/caret.mjs +5 -2
- package/browser/editor/page/changes/bar.mjs +94 -0
- package/browser/editor/page/changes/ghost.mjs +206 -0
- package/browser/editor/page/changes/gone-words.mjs +94 -0
- package/browser/editor/page/changes/index.mjs +447 -0
- package/browser/editor/page/changes/words.mjs +27 -0
- package/browser/editor/page/clipboard/import/colors.mjs +3 -3
- 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 +156 -26
- package/browser/editor/page/clipboard/own/blocks.mjs +25 -16
- package/browser/editor/page/clipboard/own/chart-keys.mjs +41 -28
- package/browser/editor/page/clipboard/own/describe.mjs +16 -7
- package/browser/editor/page/clipboard/own/export.mjs +6 -6
- package/browser/editor/page/clipboard/own/selection.mjs +3 -3
- package/browser/editor/page/clipboard/own/writers.mjs +0 -11
- package/browser/editor/page/columns/index.mjs +48 -46
- package/browser/editor/page/commit.mjs +98 -25
- package/browser/editor/page/conflicts.mjs +13 -33
- package/browser/editor/page/convert.mjs +8 -7
- package/browser/editor/page/core.mjs +81 -27
- package/browser/editor/page/custom-page.mjs +106 -0
- package/browser/editor/page/drag/index.mjs +40 -24
- package/browser/editor/page/drag/preview.mjs +9 -4
- package/browser/editor/page/editor.mjs +120 -28
- package/browser/editor/page/emoji-picker/emoji-tab.mjs +22 -13
- package/browser/editor/page/emoji-picker/grid.mjs +7 -5
- package/browser/editor/page/emoji-picker/icon-tab.mjs +4 -4
- package/browser/editor/page/emoji-picker/icons.mjs +0 -1
- package/browser/editor/page/emoji-picker/index.mjs +11 -9
- package/browser/editor/page/emoji-picker/styles.mjs +156 -2
- package/browser/editor/page/emoji-picker/support.mjs +6 -4
- package/browser/editor/page/emoji-picker/upload.mjs +14 -13
- package/browser/editor/page/fills.mjs +5 -3
- package/browser/editor/page/fold/index.mjs +348 -0
- package/browser/editor/page/fold/rule.mjs +125 -0
- package/browser/editor/page/folded.mjs +23 -0
- package/browser/editor/page/format-bar/bar.mjs +2 -1
- package/browser/editor/page/format-bar/index.mjs +1 -1
- package/browser/editor/page/geometry.mjs +8 -6
- package/browser/editor/page/handle/index.mjs +22 -14
- package/browser/editor/page/hints/index.mjs +1 -1
- package/browser/editor/page/history.mjs +24 -4
- package/browser/editor/page/insert/index.mjs +30 -17
- package/browser/editor/page/links/index.mjs +5 -3
- package/browser/editor/page/links/pages.mjs +27 -9
- package/browser/editor/page/long-runs.mjs +75 -0
- package/browser/editor/page/look.mjs +69 -6
- package/browser/editor/page/margin.mjs +63 -27
- package/browser/editor/page/media-menu/index.mjs +6 -7
- package/browser/editor/page/menu.mjs +86 -31
- package/browser/editor/page/merge.mjs +24 -0
- package/browser/editor/page/notices.mjs +3 -3
- package/browser/editor/page/offered.mjs +1 -1
- package/browser/editor/page/outline/folds.mjs +11 -10
- package/browser/editor/page/outline/index.mjs +131 -45
- package/browser/editor/page/outline/list.mjs +23 -11
- package/browser/editor/page/outline/read.mjs +1 -1
- package/browser/editor/page/outline/strip.mjs +7 -1
- package/browser/editor/page/page-objects.mjs +13 -2
- package/browser/editor/page/panel.mjs +9 -13
- package/browser/editor/page/present-links.mjs +11 -2
- package/browser/editor/page/resize/index.mjs +42 -29
- package/browser/editor/page/selection/delete.mjs +8 -6
- package/browser/editor/page/selection/index.mjs +10 -3
- package/browser/editor/page/served.mjs +14 -0
- package/browser/editor/page/session.mjs +101 -6
- package/browser/editor/page/slash-menu/index.mjs +3 -3
- package/browser/editor/page/table/cell-bar.mjs +4 -1
- package/browser/editor/page/table/cells.mjs +103 -47
- package/browser/editor/page/table/icons.mjs +3 -1
- package/browser/editor/page/table/index.mjs +40 -16
- package/browser/editor/page/table/pictures.mjs +299 -0
- package/browser/editor/page/table/views.mjs +150 -0
- package/browser/editor/page/table/widths.mjs +9 -4
- package/browser/editor/page/text-select/index.mjs +43 -14
- package/browser/editor/page/todo-writes.mjs +75 -0
- package/browser/editor/page/tooltip.mjs +1 -1
- package/browser/editor/page/type-grid.mjs +4 -3
- package/browser/editor/page/typing/code-edges.mjs +63 -17
- package/browser/editor/page/typing/index.mjs +65 -9
- package/browser/editor/page/typing/leave.mjs +1 -1
- package/browser/editor/page/ui.mjs +13 -0
- package/browser/shared/annotations.mjs +8 -10
- package/browser/shared/block-packs.mjs +404 -0
- package/browser/shared/board-places.mjs +224 -0
- package/browser/shared/card-size.mjs +59 -0
- package/browser/shared/code-folds.mjs +5 -1
- package/browser/shared/colors.mjs +17 -14
- package/browser/shared/component-catalog.mjs +345 -54
- package/browser/shared/component-source.mjs +37 -0
- package/browser/shared/components/callout.mjs +4 -2
- package/browser/shared/components/index.mjs +72 -9
- package/browser/shared/components/installed.mjs +110 -8
- package/browser/shared/components/page.mjs +22 -3
- package/browser/shared/components/state.mjs +5 -1
- package/browser/shared/components/table.mjs +1 -1
- package/browser/shared/components/text.mjs +2 -2
- package/browser/shared/document-look.mjs +183 -0
- package/browser/shared/drafts.mjs +432 -0
- package/browser/shared/emoji/data/LICENSE-lucide.txt +43 -0
- package/browser/shared/emoji/data/README.md +4 -2
- package/browser/shared/emoji/data/categories.json +1 -1
- package/browser/shared/emoji/data/keywords-en.json +1 -1
- package/browser/shared/emoji/data/keywords-zh.json +1 -1
- package/browser/shared/emoji/data/names.json +1 -1
- package/browser/shared/emoji/data/positions.json +1 -1
- package/browser/shared/emoji/data/twemoji-index.json +1 -1
- package/browser/shared/emoji/data/twemoji-svg.bin +0 -0
- package/browser/shared/emoji/data.mjs +10 -12
- package/browser/shared/emoji/emoji.mjs +8 -7
- package/browser/shared/emoji/icon-value.mjs +4 -3
- 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/html-tree.mjs +11 -5
- package/browser/shared/i18n/en.mjs +374 -35
- package/browser/shared/json-layout.mjs +47 -0
- package/browser/shared/long-runs.mjs +39 -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/new-names.mjs +5 -2
- package/browser/shared/outline-shape.mjs +128 -0
- package/browser/shared/outline.mjs +458 -0
- package/browser/shared/pack-manifest.mjs +77 -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 +388 -0
- package/browser/shared/paths.mjs +6 -0
- package/browser/shared/preferences.mjs +10 -4
- package/browser/shared/preview-server.mjs +3 -7
- package/browser/shared/session.mjs +13 -5
- package/browser/shared/shipped-blocks.mjs +299 -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 +134 -0
- package/browser/shared/workspace-columns.mjs +120 -0
- package/browser/shared/workspace-look.mjs +91 -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/browser/shared/zoom.mjs +5 -5
- package/dist/chunk-2NRBY6AJ.mjs +2 -0
- package/dist/chunk-32ZUEFZ7.mjs +2 -0
- package/dist/chunk-35NQ4PLQ.mjs +2 -0
- package/dist/chunk-3KJHLHUO.mjs +2 -0
- package/dist/chunk-3NJACR4W.mjs +2 -0
- package/dist/chunk-4AV456RQ.mjs +2 -0
- package/dist/chunk-4OZWXZE5.mjs +5 -0
- package/dist/chunk-5XYHDBJ5.mjs +2 -0
- package/dist/chunk-5ZJA7CXT.mjs +2 -0
- package/dist/chunk-6A53MZYZ.mjs +2 -0
- package/dist/chunk-6EXH3ORZ.mjs +166 -0
- package/dist/chunk-6EZ7FNIK.mjs +3 -0
- package/dist/{chunk-UXUK4PMC.mjs → chunk-6QBHU4DF.mjs} +1 -1
- package/dist/{chunk-6U2SLSDN.mjs → chunk-6VTU6KEO.mjs} +1 -1
- package/dist/chunk-B4P2CM2J.mjs +3 -0
- package/dist/chunk-BPL64HGA.mjs +4 -0
- package/dist/chunk-BVEFGE4B.mjs +2 -0
- package/dist/chunk-BZ5RAF7L.mjs +2 -0
- package/dist/chunk-CRJEG7MT.mjs +2 -0
- package/dist/{chunk-B3VTYBYR.mjs → chunk-D4CKRD3V.mjs} +91 -91
- package/dist/chunk-D4EURAX4.mjs +4 -0
- package/dist/chunk-DQCE7TJY.mjs +5 -0
- package/dist/chunk-DR73Y2UJ.mjs +3 -0
- package/dist/{chunk-TMYZB6AV.mjs → chunk-EKNHM3P4.mjs} +1 -1
- package/dist/{chunk-DB4WKGYF.mjs → chunk-ERLAIBOA.mjs} +2 -2
- package/dist/chunk-EURLTOTZ.mjs +4 -0
- package/dist/chunk-FJYN7RTH.mjs +4 -0
- package/dist/chunk-FWNRPMCJ.mjs +12 -0
- package/dist/chunk-FWW4CSAZ.mjs +2 -0
- package/dist/{chunk-2B5E4CDJ.mjs → chunk-GPIWQ4X4.mjs} +1 -1
- package/dist/chunk-GY3FAUVM.mjs +2 -0
- package/dist/chunk-HLYV7RIH.mjs +2 -0
- package/dist/chunk-HMYTM3GT.mjs +15 -0
- package/dist/chunk-IA4PSIMD.mjs +2 -0
- package/dist/chunk-JEUK3ZO7.mjs +2 -0
- package/dist/chunk-JVHHHGEA.mjs +3 -0
- package/dist/chunk-KTKHRC6H.mjs +2 -0
- package/dist/chunk-L7UP52JO.mjs +2 -0
- package/dist/chunk-MHW7ZKOU.mjs +2 -0
- package/dist/chunk-N76HWBA3.mjs +10 -0
- package/dist/chunk-N7AZZLGT.mjs +548 -0
- package/dist/chunk-NAMN3RAF.mjs +2 -0
- package/dist/{chunk-YXAUQPVK.mjs → chunk-NFMCP2HI.mjs} +3 -3
- package/dist/chunk-NG375ILQ.mjs +2 -0
- package/dist/chunk-NVRNLK25.mjs +6 -0
- package/dist/chunk-NWFBE2YA.mjs +2 -0
- package/dist/chunk-NWR2LT5B.mjs +2 -0
- package/dist/chunk-OJKMINIU.mjs +20 -0
- package/dist/chunk-OUUP3WKT.mjs +2 -0
- package/dist/chunk-OW5NWPOJ.mjs +10 -0
- package/dist/chunk-PAREWQGB.mjs +4 -0
- package/dist/chunk-POQSE4C2.mjs +2 -0
- package/dist/chunk-PUOQ65NC.mjs +2 -0
- package/dist/{chunk-Z52HTUW7.mjs → chunk-PVER7LSC.mjs} +2 -2
- package/dist/chunk-PZDLJJTJ.mjs +3 -0
- package/dist/chunk-Q47PLKIJ.mjs +15 -0
- package/dist/chunk-Q4UEPUWF.mjs +2 -0
- package/dist/chunk-QKXMPUXC.mjs +2 -0
- package/dist/chunk-QOUEFUCH.mjs +16 -0
- package/dist/chunk-RFDZXFJF.mjs +13 -0
- package/dist/chunk-RKPWLGZ3.mjs +4 -0
- package/dist/chunk-RMECZA2K.mjs +2 -0
- package/dist/{chunk-EUX7IC5J.mjs → chunk-SQ6Y2ZMA.mjs} +2 -2
- package/dist/chunk-SX4LJYT6.mjs +8 -0
- package/dist/chunk-SXHBYZST.mjs +16 -0
- package/dist/chunk-TANZRINB.mjs +2 -0
- package/dist/chunk-TEZAWDSQ.mjs +2 -0
- package/dist/chunk-UBBRTJ2R.mjs +24 -0
- package/dist/chunk-UFNYFFKO.mjs +20 -0
- package/dist/chunk-UGWYKHBL.mjs +170 -0
- package/dist/chunk-UKSHDZZ6.mjs +2 -0
- package/dist/chunk-UMHUSOPJ.mjs +2 -0
- package/dist/chunk-UNOYVIYR.mjs +2 -0
- package/dist/chunk-V6RIYQZZ.mjs +4 -0
- package/dist/chunk-VJPFVNNW.mjs +15 -0
- package/dist/chunk-VS3ZMVGX.mjs +5 -0
- package/dist/chunk-VTKNEYT3.mjs +6 -0
- package/dist/chunk-VXACTLO3.mjs +3 -0
- package/dist/chunk-W3BGBJQW.mjs +2 -0
- package/dist/chunk-YI43RG4P.mjs +2 -0
- package/dist/chunk-YQGT4AB2.mjs +6 -0
- package/dist/chunk-ZB4H7ZN4.mjs +2 -0
- package/dist/{chunk-ACOPDCNB.mjs → chunk-ZHEHPMBK.mjs} +1 -1
- package/dist/chunk-ZTHICSSF.mjs +2 -0
- package/dist/chunk-ZUNVAXLH.mjs +2 -0
- package/dist/chunk-ZWPMCK7P.mjs +2 -0
- package/dist/cli.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/{chunk-EVJ3BX3M.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 +14 -14
- package/kit/math.js +18 -2
- package/kit/report.css +500 -151
- package/kit/runtime.js +1720 -170
- package/kit/state.js +10 -1
- package/kit/tables.js +172 -37
- package/kit/ui.js +166 -27
- 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 +156 -0
- package/packs/gallery/countdown/preview.svg +1 -0
- package/packs/gallery/countdown/style.css +130 -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 +295 -0
- package/packs/gallery/habit/preview.svg +1 -0
- package/packs/gallery/habit/style.css +246 -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 +351 -0
- package/packs/gallery/heatmap/preview.svg +1 -0
- package/packs/gallery/heatmap/style.css +201 -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 +102 -0
- package/packs/gallery/note/preview.svg +1 -0
- package/packs/gallery/note/style.css +76 -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 +238 -0
- package/packs/gallery/recent/preview.svg +1 -0
- package/packs/gallery/recent/style.css +158 -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 +138 -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 +166 -0
- package/packs/gallery/stats/preview.svg +1 -0
- package/packs/gallery/stats/style.css +151 -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 +185 -0
- package/packs/gallery/today/preview.svg +1 -0
- package/packs/gallery/today/style.css +120 -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 +342 -0
- package/packs/gallery/todos/preview.svg +1 -0
- package/packs/gallery/todos/style.css +267 -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 +312 -0
- package/packs/gallery/weather/preview.svg +1 -0
- package/packs/gallery/weather/style.css +258 -0
- package/packs/gallery/weather/template.html +3 -0
- package/packs/gallery/weather/writing.md +26 -0
- package/packs/gallery-soft/pack.json +8 -0
- package/release.json +13 -11
- package/sdk/doc-kit.d.ts +404 -7
- package/sdk/doc-state.d.ts +2 -0
- package/skill/SKILL.md +71 -26
- package/skill/references/block-script.md +140 -0
- package/skill/references/building-blocks.md +257 -0
- package/skill/references/example-report.html +1 -1
- package/skill/references/extensions.md +59 -0
- package/skill/references/pages-and-data.md +221 -0
- package/skill/references/writing-html.md +9 -7
- package/skill/sdk/doc-kit.d.ts +404 -7
- package/skill/sdk/doc-state.d.ts +2 -0
- package/web/assets/index-BK2e_07w.js +13 -0
- package/web/assets/index-CWFI83mF.css +1 -0
- package/web/index.html +2 -2
- package/browser/editor/components/callout/page.mjs +0 -13
- package/dist/chunk-2PBALTR3.mjs +0 -57
- package/dist/chunk-3LA3EMDE.mjs +0 -15
- package/dist/chunk-5FRMCDPY.mjs +0 -16
- package/dist/chunk-5LEK2CBS.mjs +0 -2
- package/dist/chunk-5OFN5AHC.mjs +0 -2
- package/dist/chunk-5SIYS5HN.mjs +0 -2
- package/dist/chunk-5TEK3RAD.mjs +0 -2
- package/dist/chunk-6CYG3Z4V.mjs +0 -2
- package/dist/chunk-7GHT2UCA.mjs +0 -15
- package/dist/chunk-7QQBR7PB.mjs +0 -2
- package/dist/chunk-ATCJYAR4.mjs +0 -2
- package/dist/chunk-C7HWOBIF.mjs +0 -2
- package/dist/chunk-E7VYDG2X.mjs +0 -2
- package/dist/chunk-EZY3WC6Z.mjs +0 -15
- package/dist/chunk-FQGQH4KM.mjs +0 -2
- package/dist/chunk-G7TOXONE.mjs +0 -6
- package/dist/chunk-GPF4YWWB.mjs +0 -9
- package/dist/chunk-GYQV7Y4J.mjs +0 -120
- package/dist/chunk-HMHK3EQ6.mjs +0 -2
- package/dist/chunk-HQQMJCQJ.mjs +0 -10
- package/dist/chunk-IERUOGC3.mjs +0 -6
- package/dist/chunk-ITNLYXXV.mjs +0 -3
- package/dist/chunk-L4DVONOG.mjs +0 -2
- package/dist/chunk-LAE5NQ4B.mjs +0 -2
- package/dist/chunk-LC7YNQFG.mjs +0 -2
- package/dist/chunk-LHTFLRB6.mjs +0 -4
- package/dist/chunk-NFIBI4IP.mjs +0 -26
- package/dist/chunk-NSKUTQ5J.mjs +0 -5
- package/dist/chunk-O52JMOCZ.mjs +0 -2
- package/dist/chunk-P2CAZPDP.mjs +0 -3
- package/dist/chunk-QMQUXTU4.mjs +0 -12
- package/dist/chunk-QVWVFC5K.mjs +0 -6
- package/dist/chunk-QYKCJ7FG.mjs +0 -8
- package/dist/chunk-QZY6Q64C.mjs +0 -2
- package/dist/chunk-TDQP3DKQ.mjs +0 -10
- package/dist/chunk-TX6JH7TR.mjs +0 -2
- package/dist/chunk-UNUEWH4S.mjs +0 -2
- package/dist/chunk-V4CPWKMZ.mjs +0 -2
- package/dist/chunk-VACRB2NE.mjs +0 -3
- package/dist/chunk-W63L7367.mjs +0 -7
- package/dist/chunk-W7CXPCRV.mjs +0 -6
- package/dist/chunk-XINNG4F2.mjs +0 -4
- package/dist/chunk-YL2DPWVS.mjs +0 -4
- package/dist/chunk-YZ5Z6H4W.mjs +0 -4
- package/dist/chunk-ZBIM6ARY.mjs +0 -216
- package/skill/references/building-components.md +0 -327
- package/web/assets/index-B6Ai3wsa.js +0 -13
- package/web/assets/index-SYPC3EZy.css +0 -1
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
// gallery/todos (我的待办): the to-dos of the workspace's documents (each item of a to-do list, ul.doc-todo),
|
|
2
|
+
// those not done yet, read through context.workspace.query("todos") (its manifest's needs hold
|
|
3
|
+
// "workspace"), grouped by document, the one edited last first, each group's items in its document's
|
|
4
|
+
// order, each with the headings it stands under. Its box checks the item in its document
|
|
5
|
+
// (context.workspace.setTodo: the server writes that document as the reader's edit, and the home page's
|
|
6
|
+
// undo checks it back), drawn checked at once, put back with a line saying why where the write is refused
|
|
7
|
+
// (the item changed meanwhile, several items alike, one the document's own page cannot check, the document
|
|
8
|
+
// being written, no server); an item checked here stays in the list, struck through, until the page is shown
|
|
9
|
+
// again, so that a slip is undone where it was made, and its group stays where it is (the document the box
|
|
10
|
+
// wrote is the one edited last, which the facts would put first: once a box is checked here the groups keep
|
|
11
|
+
// the order they were drawn in, a document new to the card first). A click on an item's words opens its
|
|
12
|
+
// document there, at the item's block where it has an id, else at the document (context.workspace.open:
|
|
13
|
+
// the workbench goes there); a click on a group's title opens the document. It reads again whenever the workspace says its to-dos changed (the `data` signal, "todos":
|
|
14
|
+
// a to-do added, checked or taken out in any document, a document renamed or gone) and when its settings
|
|
15
|
+
// do (`source`). Its two settings, the card's form (the grip at its top right › 设置…), are kept in its data part `settings`,
|
|
16
|
+
// which the board writes and this block only reads: `document` (a document's slug: its to-dos alone) and
|
|
17
|
+
// `done` (the done ones too, checked and struck through). Where the workspace cannot be read (an exported
|
|
18
|
+
// file, where it has no server; a server that does not answer) it says so in a line; where nothing writes
|
|
19
|
+
// it (an exported file: no setTodo) its boxes are only drawn. The words are the page's language (the UI's
|
|
20
|
+
// where Gallery says it, else the page's lang). Its head is the cards' (the kit's card tokens): the chip,
|
|
21
|
+
// a checked list, before its title, how many to-dos there are its quiet note at the end (共 6 项); under it,
|
|
22
|
+
// where there are any, how many are done of all (of the document asked, or of every one): a ring of the
|
|
23
|
+
// share done, its percent in the middle, and a key of the two counts. An item's headings are said after it
|
|
24
|
+
// but for the document's own title (its first heading, as often), which the group's title above says. The
|
|
25
|
+
// face says by `data-state` what it shows: items, every one done (the ring then its picture in the middle
|
|
26
|
+
// of the room, 待办都完成了 under it, no key) or none.
|
|
27
|
+
|
|
28
|
+
const WORDS = {
|
|
29
|
+
zh: {
|
|
30
|
+
title: "我的待办",
|
|
31
|
+
empty: "所有文档里的待办会出现在这里",
|
|
32
|
+
allDone: "待办都完成了",
|
|
33
|
+
noneIn: "这篇文档里没有待办",
|
|
34
|
+
offline: "在 Gallery 里打开时,这里列出所有文档里的待办",
|
|
35
|
+
failed: "读不到工作区的待办",
|
|
36
|
+
open: (/** @type {string} */ title) => `打开「${title}」`,
|
|
37
|
+
path: (/** @type {string[]} */ path) => path.join(" › "),
|
|
38
|
+
check: "标记为完成",
|
|
39
|
+
uncheck: "标记为未完成",
|
|
40
|
+
done: "已完成",
|
|
41
|
+
left: "未完成",
|
|
42
|
+
share: (/** @type {number} */ done, /** @type {number} */ all) => `${all} 项待办完成了 ${done} 项`,
|
|
43
|
+
all: (/** @type {number} */ count) => `共 ${count} 项`,
|
|
44
|
+
refused: {
|
|
45
|
+
changed: "这一项刚被改过,已重新读取",
|
|
46
|
+
ambiguous: "文档里有几项一样的待办,请在文档里勾选",
|
|
47
|
+
locked: "这一项在文档里是只读的,不能勾选",
|
|
48
|
+
busy: "文档正在被修改,请稍后再勾选",
|
|
49
|
+
offline: "在 Gallery 里打开时才能勾选",
|
|
50
|
+
missing: "找不到这篇文档",
|
|
51
|
+
failed: "没能勾选这一项",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
en: {
|
|
55
|
+
title: "My to-dos",
|
|
56
|
+
empty: "The to-dos of every document will show here",
|
|
57
|
+
allDone: "Every to-do is done",
|
|
58
|
+
noneIn: "This document has no to-dos",
|
|
59
|
+
offline: "Opened in Gallery, this lists the to-dos of every document",
|
|
60
|
+
failed: "The workspace's to-dos could not be read",
|
|
61
|
+
open: (/** @type {string} */ title) => `Open “${title}”`,
|
|
62
|
+
path: (/** @type {string[]} */ path) => path.join(" › "),
|
|
63
|
+
check: "Mark as done",
|
|
64
|
+
uncheck: "Mark as not done",
|
|
65
|
+
done: "Done",
|
|
66
|
+
left: "Open",
|
|
67
|
+
share: (/** @type {number} */ done, /** @type {number} */ all) => `${done} of ${all} to-dos done`,
|
|
68
|
+
all: (/** @type {number} */ count) => `${count} in all`,
|
|
69
|
+
refused: {
|
|
70
|
+
changed: "This to-do just changed: read again",
|
|
71
|
+
ambiguous: "The document has several to-dos alike: check it in the document",
|
|
72
|
+
locked: "This to-do is read-only in its document: it cannot be checked",
|
|
73
|
+
busy: "The document is being written: try again in a moment",
|
|
74
|
+
offline: "Open it in Gallery to check it",
|
|
75
|
+
missing: "The document is not there",
|
|
76
|
+
failed: "The to-do could not be checked",
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** How long a line saying why a check was refused stays, in ms. */
|
|
82
|
+
const SAID_FOR = 4000;
|
|
83
|
+
|
|
84
|
+
/** The language the page speaks: the UI's where Gallery says it (data-ge-language), else its lang's. */
|
|
85
|
+
function languageOf(/** @type {HTMLElement} */ root) {
|
|
86
|
+
const ui = root.getAttribute("data-ge-language");
|
|
87
|
+
return (ui !== null ? ui === "en" : /^en(?:-|$)/i.test(root.lang)) ? "en" : "zh";
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* What the card's settings ask (context.readJSON's, {} where none is set yet): { document, done }, the
|
|
92
|
+
* slug of the one document to read (null: every one) and whether the done ones show too.
|
|
93
|
+
* @param {any} settings
|
|
94
|
+
*/
|
|
95
|
+
function askedOf(settings) {
|
|
96
|
+
const table = settings !== null && typeof settings === "object" && !Array.isArray(settings) ? settings : {};
|
|
97
|
+
return { document: typeof table.document === "string" && table.document ? table.document : null, done: table.done === true };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** @typedef {{ ref: DocTodoRef, text: string, done: boolean, slug: string, title: string, path: string[] }} Todo */
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* An item by its document, its headings and its words: what names it while the card lives, whether it has
|
|
104
|
+
* an id yet or not (its check gives it one).
|
|
105
|
+
* @param {Todo} todo
|
|
106
|
+
*/
|
|
107
|
+
const itemKey = (todo) => JSON.stringify([todo.slug, todo.path, todo.text]);
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The to-dos (workspace.query("todos")'s data) as the card shows them, of `asked`: { groups, open,
|
|
111
|
+
* all }, groups [{ slug, title, items }] in the order the documents come (the one edited last first),
|
|
112
|
+
* items those shown (not done, or all with `asked.done`, and the ones checked on this card: `kept`);
|
|
113
|
+
* `open` how many are not done, `all` how many there are of the document asked or of the workspace.
|
|
114
|
+
* `order` (the slugs as drawn before, or null): the groups keep that order, a document not in it before them.
|
|
115
|
+
* @param {Todo[]} todos
|
|
116
|
+
* @param {{ document: string | null, done: boolean }} asked
|
|
117
|
+
* @param {Set<string>} kept
|
|
118
|
+
* @param {string[] | null} [order]
|
|
119
|
+
*/
|
|
120
|
+
function groupsOf(todos, asked, kept, order = null) {
|
|
121
|
+
const mine = todos.filter((todo) => asked.document === null || todo.slug === asked.document);
|
|
122
|
+
/** @type {Map<string, { slug: string, title: string, items: Todo[] }>} */
|
|
123
|
+
const groups = new Map();
|
|
124
|
+
for (const todo of mine) {
|
|
125
|
+
if (todo.done && !asked.done && !kept.has(itemKey(todo))) continue;
|
|
126
|
+
if (!groups.has(todo.slug)) groups.set(todo.slug, { slug: todo.slug, title: todo.title, items: [] });
|
|
127
|
+
groups.get(todo.slug)?.items.push(todo);
|
|
128
|
+
}
|
|
129
|
+
const placed = [...groups.values()];
|
|
130
|
+
if (order) placed.sort((a, b) => order.indexOf(a.slug) - order.indexOf(b.slug)); // stable: those not in it keep the order they came in
|
|
131
|
+
return { groups: placed, open: mine.filter((todo) => !todo.done).length, all: mine.length };
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The line the card says where it shows no item, or null where it shows some: none in the workspace,
|
|
136
|
+
* none in the one document asked, all done.
|
|
137
|
+
* @param {{ groups: unknown[], all: number }} shown
|
|
138
|
+
* @param {{ document: string | null }} asked
|
|
139
|
+
* @param {"zh" | "en"} language
|
|
140
|
+
*/
|
|
141
|
+
function emptyLine(shown, asked, language) {
|
|
142
|
+
if (shown.groups.length > 0) return null;
|
|
143
|
+
const words = WORDS[language];
|
|
144
|
+
if (shown.all > 0) return words.allDone;
|
|
145
|
+
return asked.document === null ? words.empty : words.noneIn;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* An element of the face, of `kind` (its class).
|
|
150
|
+
* @template {keyof HTMLElementTagNameMap} K
|
|
151
|
+
* @param {K} tag
|
|
152
|
+
* @param {string} kind
|
|
153
|
+
* @param {string} [text]
|
|
154
|
+
*/
|
|
155
|
+
function made(tag, kind, text) {
|
|
156
|
+
const node = document.createElement(tag);
|
|
157
|
+
node.className = `gallery-todos-${kind}`;
|
|
158
|
+
if (text !== undefined) node.textContent = text;
|
|
159
|
+
return node;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
DocKit.component({
|
|
163
|
+
id: "gallery/todos",
|
|
164
|
+
on: ["source", "data"],
|
|
165
|
+
mount(host, context) {
|
|
166
|
+
const language = languageOf(document.documentElement);
|
|
167
|
+
const words = WORDS[language];
|
|
168
|
+
const face = made("div", "face");
|
|
169
|
+
const head = made("div", "head");
|
|
170
|
+
const count = made("span", "count");
|
|
171
|
+
const chip = made("span", "chip");
|
|
172
|
+
chip.setAttribute("aria-hidden", "true");
|
|
173
|
+
chip.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"><path d="M3.5 5.5L5 7l2.5-2.5M3.5 11.5L5 13l2.5-2.5M3.5 17.5L5 19l2.5-2.5M11 6h9M11 12h9M11 18h9"/></svg>';
|
|
174
|
+
head.append(chip, made("span", "title", words.title), count);
|
|
175
|
+
// How many are done of all: a ring of the share done (the good green once all are) and a key of the two counts.
|
|
176
|
+
const summary = made("div", "summary");
|
|
177
|
+
summary.hidden = true;
|
|
178
|
+
summary.setAttribute("role", "img");
|
|
179
|
+
const ring = made("span", "ring");
|
|
180
|
+
ring.innerHTML = '<svg viewBox="0 0 100 100" aria-hidden="true"><circle class="gallery-todos-track" cx="50" cy="50" r="42"/><circle class="gallery-todos-arc" cx="50" cy="50" r="42" pathLength="100" transform="rotate(-90 50 50)"/></svg>';
|
|
181
|
+
const percent = made("span", "percent");
|
|
182
|
+
ring.append(percent);
|
|
183
|
+
const key = made("dl", "key");
|
|
184
|
+
const doneCount = made("dd", "key-count");
|
|
185
|
+
const leftCount = made("dd", "key-count");
|
|
186
|
+
const doneRow = made("div", "key-row");
|
|
187
|
+
doneRow.dataset.kind = "done";
|
|
188
|
+
doneRow.append(made("dt", "key-name", words.done), doneCount);
|
|
189
|
+
const leftRow = made("div", "key-row");
|
|
190
|
+
leftRow.dataset.kind = "left";
|
|
191
|
+
leftRow.append(made("dt", "key-name", words.left), leftCount);
|
|
192
|
+
key.append(doneRow, leftRow);
|
|
193
|
+
summary.append(ring, key);
|
|
194
|
+
const list = made("div", "list");
|
|
195
|
+
const line = made("p", "line");
|
|
196
|
+
const note = made("p", "note");
|
|
197
|
+
note.hidden = true;
|
|
198
|
+
note.setAttribute("role", "status");
|
|
199
|
+
face.append(head, summary, list, line, note);
|
|
200
|
+
host.append(face);
|
|
201
|
+
const workspace = context.workspace;
|
|
202
|
+
if (!workspace) return void context.fail(new Error("its manifest's needs hold \"workspace\": context.workspace is not there"));
|
|
203
|
+
const open = (/** @type {{ slug: string, block?: string | null }} */ target) => workspace.open(target);
|
|
204
|
+
const setTodo = workspace.setTodo;
|
|
205
|
+
const kept = new Set(); // the items checked on this card, shown until the page is shown again
|
|
206
|
+
/** @type {Todo[] | null} */
|
|
207
|
+
let last = null; // what was read last, as drawn (a check drawn into it at once)
|
|
208
|
+
/** @type {{ document: string | null, done: boolean }} */
|
|
209
|
+
let lastAsked = { document: null, done: false };
|
|
210
|
+
/** @type {string[]} */
|
|
211
|
+
let order = []; // the documents of the groups as drawn
|
|
212
|
+
/** @type {string[] | null} */
|
|
213
|
+
let held = null; // that order as it was when the first box was checked here: the groups keep it from then on
|
|
214
|
+
|
|
215
|
+
const say = (/** @type {string | null} */ words) => {
|
|
216
|
+
line.hidden = words === null;
|
|
217
|
+
line.textContent = words ?? "";
|
|
218
|
+
};
|
|
219
|
+
let noteTimer = 0;
|
|
220
|
+
const tell = (/** @type {string} */ words) => {
|
|
221
|
+
note.textContent = words;
|
|
222
|
+
note.hidden = false;
|
|
223
|
+
clearTimeout(noteTimer);
|
|
224
|
+
noteTimer = context.timeout(() => { note.hidden = true; }, SAID_FOR);
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
// An item's box checked or cleared: drawn so at once, then written in its document; a refusal puts it
|
|
228
|
+
// back, says why and reads again.
|
|
229
|
+
const check = (/** @type {Todo} */ todo) => {
|
|
230
|
+
if (!setTodo || !last) return;
|
|
231
|
+
const done = !todo.done;
|
|
232
|
+
const drawn = { ...todo, done };
|
|
233
|
+
kept.add(itemKey(todo));
|
|
234
|
+
held ??= order;
|
|
235
|
+
last = last.map((one) => (one === todo ? drawn : one));
|
|
236
|
+
draw();
|
|
237
|
+
setTodo(todo.ref, done).catch((/** @type {any} */ error) => {
|
|
238
|
+
if (context.signal.aborted) return;
|
|
239
|
+
if (last?.includes(drawn)) {
|
|
240
|
+
last = last.map((one) => (one === drawn ? todo : one));
|
|
241
|
+
draw();
|
|
242
|
+
}
|
|
243
|
+
const refused = /** @type {Record<string, string>} */ (words.refused);
|
|
244
|
+
tell(refused[error?.code] ?? refused.failed);
|
|
245
|
+
read();
|
|
246
|
+
});
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
// The list drawn anew of what was read, scrolled where it was.
|
|
250
|
+
const draw = () => {
|
|
251
|
+
if (!last) return;
|
|
252
|
+
const asked = lastAsked;
|
|
253
|
+
const shown = groupsOf(last, asked, kept, held);
|
|
254
|
+
order = shown.groups.map((group) => group.slug);
|
|
255
|
+
const top = list.scrollTop;
|
|
256
|
+
count.textContent = shown.all > 0 ? words.all(shown.all) : "";
|
|
257
|
+
// The summary of all the to-dos asked (of one document, or of every one), none where there are none.
|
|
258
|
+
const done = shown.all - shown.open;
|
|
259
|
+
summary.hidden = shown.all === 0;
|
|
260
|
+
summary.toggleAttribute("data-all", shown.all > 0 && done === shown.all);
|
|
261
|
+
summary.style.setProperty("--gallery-todos-share", String(shown.all > 0 ? done / shown.all : 0));
|
|
262
|
+
summary.setAttribute("aria-label", words.share(done, shown.all));
|
|
263
|
+
if (shown.all > 0) percent.replaceChildren(String(Math.floor((100 * done) / shown.all)), made("span", "percent-sign", "%"));
|
|
264
|
+
else percent.replaceChildren();
|
|
265
|
+
doneCount.textContent = String(done);
|
|
266
|
+
leftCount.textContent = String(shown.open);
|
|
267
|
+
face.dataset.state = shown.groups.length > 0 ? "items" : shown.all > 0 ? "done" : "none";
|
|
268
|
+
list.replaceChildren(...shown.groups.map((group) => {
|
|
269
|
+
const section = made("section", "group");
|
|
270
|
+
const title = made("button", "doc", group.title);
|
|
271
|
+
title.type = "button";
|
|
272
|
+
title.title = words.open(group.title);
|
|
273
|
+
title.addEventListener("click", () => open({ slug: group.slug }));
|
|
274
|
+
const items = made("ul", "items");
|
|
275
|
+
for (const todo of group.items) {
|
|
276
|
+
const item = made("li", "item");
|
|
277
|
+
const button = made("button", "todo");
|
|
278
|
+
button.type = "button";
|
|
279
|
+
if (todo.done) {
|
|
280
|
+
button.classList.add("gallery-todos-done");
|
|
281
|
+
item.classList.add("gallery-todos-done");
|
|
282
|
+
}
|
|
283
|
+
button.title = words.open(group.title);
|
|
284
|
+
const text = made("span", "text", todo.text);
|
|
285
|
+
if (setTodo) {
|
|
286
|
+
const box = made("button", "check");
|
|
287
|
+
box.type = "button";
|
|
288
|
+
box.setAttribute("role", "checkbox");
|
|
289
|
+
box.setAttribute("aria-checked", String(todo.done));
|
|
290
|
+
box.title = todo.done ? words.uncheck : words.check;
|
|
291
|
+
box.setAttribute("aria-label", `${todo.done ? words.uncheck : words.check}: ${todo.text}`);
|
|
292
|
+
box.append(made("span", "box"));
|
|
293
|
+
box.addEventListener("click", (event) => {
|
|
294
|
+
event.stopPropagation();
|
|
295
|
+
check(todo);
|
|
296
|
+
});
|
|
297
|
+
item.append(box);
|
|
298
|
+
button.append(text);
|
|
299
|
+
} else button.append(made("span", "box"), text);
|
|
300
|
+
// Its headings, but for the document's title the group's title above says (its first heading, as often).
|
|
301
|
+
const path = todo.path[0] === group.title ? todo.path.slice(1) : todo.path;
|
|
302
|
+
if (path.length > 0) button.append(made("span", "path", words.path(path)));
|
|
303
|
+
button.addEventListener("click", () => open({ slug: todo.ref.slug, block: todo.ref.block }));
|
|
304
|
+
item.append(button);
|
|
305
|
+
items.append(item);
|
|
306
|
+
}
|
|
307
|
+
section.append(title, items);
|
|
308
|
+
return section;
|
|
309
|
+
}));
|
|
310
|
+
list.scrollTop = top;
|
|
311
|
+
say(emptyLine(shown, asked, language));
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
let asking = 0; // the last read asked: an older answer that comes after it is dropped
|
|
315
|
+
const read = () => {
|
|
316
|
+
const settings = context.readJSON("settings");
|
|
317
|
+
if (settings === undefined) return; // no JSON: the instance has failed, and Gallery shows what it holds
|
|
318
|
+
const asked = askedOf(settings);
|
|
319
|
+
const ticket = ++asking;
|
|
320
|
+
workspace.query("todos", { limit: 1000, ...(asked.document ? { slugs: [asked.document] } : {}) }).then(({ data }) => {
|
|
321
|
+
if (ticket !== asking || context.signal.aborted) return;
|
|
322
|
+
last = data;
|
|
323
|
+
lastAsked = asked;
|
|
324
|
+
draw();
|
|
325
|
+
}, (/** @type {any} */ error) => {
|
|
326
|
+
if (ticket !== asking || context.signal.aborted) return;
|
|
327
|
+
last = null;
|
|
328
|
+
count.textContent = "";
|
|
329
|
+
summary.hidden = true;
|
|
330
|
+
face.dataset.state = "none";
|
|
331
|
+
list.replaceChildren();
|
|
332
|
+
say(error?.code === "offline" ? words.offline : words.failed);
|
|
333
|
+
});
|
|
334
|
+
};
|
|
335
|
+
read();
|
|
336
|
+
return {
|
|
337
|
+
update(reason, detail) {
|
|
338
|
+
if (reason === "source" || (reason === "data" && detail === "todos")) read();
|
|
339
|
+
},
|
|
340
|
+
};
|
|
341
|
+
},
|
|
342
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 120"><rect width="240" height="120" rx="8" fill="#f3f3f1"/><rect x="16.5" y="12.5" width="207" height="95" rx="12" fill="#ffffff" stroke="#e7e6e3"/><rect x="30" y="24" width="14" height="14" rx="4.5" fill="#ebf2fa"/><g transform="translate(32 26) scale(.4167)" fill="none" stroke="#2e7cd1" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M3.5 5.5L5 7l2.5-2.5M3.5 11.5L5 13l2.5-2.5M3.5 17.5L5 19l2.5-2.5M11 6h9M11 12h9M11 18h9"/></g><rect x="50" y="28" width="40" height="6" rx="3" fill="#3b3a37"/><rect x="186" y="28.5" width="24" height="5" rx="2.5" fill="#c4c2bd"/><circle cx="40" cy="55" r="8.5" fill="none" stroke="#ecebe8" stroke-width="3.2"/><circle cx="40" cy="55" r="8.5" fill="none" stroke="#2e7cd1" stroke-width="3.2" stroke-linecap="round" stroke-dasharray="32.0 53.4" transform="rotate(-90 40 55)"/><circle cx="59" cy="50.5" r="2" fill="#2e7cd1"/><rect x="64" y="48.5" width="20" height="4" rx="2" fill="#c4c2bd"/><rect x="98" y="48.5" width="7" height="4" rx="2" fill="#3b3a37"/><circle cx="59" cy="59.5" r="2" fill="#ecebe8"/><rect x="64" y="57.5" width="20" height="4" rx="2" fill="#c4c2bd"/><rect x="98" y="57.5" width="7" height="4" rx="2" fill="#3b3a37"/><rect x="30" y="70" width="180" height="1" fill="#efeeec"/><rect x="30" y="76" width="10" height="10" rx="3" fill="#2e7cd1"/><path d="M32.12 81.18l1.98 1.98 3.96-4.14" fill="none" stroke="#fff" stroke-width="1.44" stroke-linecap="round" stroke-linejoin="round"/><rect x="47" y="78.5" width="92" height="5" rx="2.5" fill="#c4c2bd"/><rect x="144" y="78.5" width="16" height="5" rx="2.5" fill="#e9e8e5"/><rect x="30.75" y="91.75" width="8.5" height="8.5" rx="2.6" fill="none" stroke="#a9a7a2" stroke-width="1.3"/><rect x="47" y="93.5" width="70" height="5" rx="2.5" fill="#3b3a37"/><rect x="122" y="93.5" width="16" height="5" rx="2.5" fill="#e9e8e5"/></svg>
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/* Every selector starts at the instance and goes down a step at a time (>), so that nothing here
|
|
2
|
+
reaches the rest of the page. The face fills its card on a custom page (the board draws the frame), in
|
|
3
|
+
the kit's card tokens: its head (the chip, the title, how many there are its quiet note at the end,
|
|
4
|
+
clear of the card's grip), the summary of how many are done (where there are any: a ring of the share,
|
|
5
|
+
56px, 88px on a card 280px high and more, as large whatever it shows, its percent in the middle, the
|
|
6
|
+
sign small and muted, a key of the two counts beside it), then the documents' to-dos, which scroll inside the card, each
|
|
7
|
+
document's title small and muted over its items, an item a rounded box (checked, it fills with the
|
|
8
|
+
accent), its words and the headings it stands under, muted. A row a press away from its document (a
|
|
9
|
+
hover fill, as a row of the sidebar has). A wide card (8 cells) sets the documents in two columns.
|
|
10
|
+
Every one done, the summary's ring (no key) is the card's empty face, in the middle of the room under the
|
|
11
|
+
head, the line under it; none at all, the cards' empty face (a picture in a soft disc over a muted line).
|
|
12
|
+
Light and dark. */
|
|
13
|
+
[data-doc-component="gallery/todos"] {
|
|
14
|
+
container-type: size;
|
|
15
|
+
--gallery-todos-ring: 56px;
|
|
16
|
+
--gallery-todos-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.6 7.2l2.2 2.2 4.6-4.8' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
|
17
|
+
> .gallery-todos-face {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: var(--gallery-face-gap);
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
height: 100%;
|
|
23
|
+
min-height: 0;
|
|
24
|
+
color: var(--gallery-text);
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
line-height: 1.45;
|
|
27
|
+
}
|
|
28
|
+
> .gallery-todos-face > .gallery-todos-head {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: 8px;
|
|
32
|
+
flex: none;
|
|
33
|
+
min-width: 0;
|
|
34
|
+
padding-inline-end: var(--gallery-grip-room, 0px);
|
|
35
|
+
}
|
|
36
|
+
> .gallery-todos-face > .gallery-todos-head > .gallery-todos-chip {
|
|
37
|
+
flex: none;
|
|
38
|
+
display: inline-flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
width: var(--gallery-chip-size);
|
|
42
|
+
height: var(--gallery-chip-size);
|
|
43
|
+
border-radius: var(--gallery-chip-radius);
|
|
44
|
+
background: var(--gallery-accent-soft);
|
|
45
|
+
color: var(--gallery-accent);
|
|
46
|
+
}
|
|
47
|
+
> .gallery-todos-face > .gallery-todos-head > .gallery-todos-chip > svg { width: var(--gallery-chip-icon); height: var(--gallery-chip-icon); }
|
|
48
|
+
> .gallery-todos-face > .gallery-todos-head > .gallery-todos-title {
|
|
49
|
+
flex: 1 1 auto;
|
|
50
|
+
min-width: 0;
|
|
51
|
+
color: var(--gallery-text-strong);
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
white-space: nowrap;
|
|
54
|
+
text-overflow: ellipsis;
|
|
55
|
+
font-size: var(--gallery-title-size);
|
|
56
|
+
line-height: var(--gallery-title-line);
|
|
57
|
+
font-weight: 600;
|
|
58
|
+
}
|
|
59
|
+
> .gallery-todos-face > .gallery-todos-head > .gallery-todos-count {
|
|
60
|
+
flex: none;
|
|
61
|
+
margin-inline-end: calc(-1 * var(--gallery-grip-room, 0px)); opacity: calc(1 - var(--gallery-grip-shown, 0)); transition: opacity .12s ease-out;
|
|
62
|
+
font-size: var(--gallery-meta-size);
|
|
63
|
+
color: var(--doc-muted);
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
font-variant-numeric: tabular-nums;
|
|
66
|
+
}
|
|
67
|
+
> .gallery-todos-face > .gallery-todos-head > .gallery-todos-count:empty { display: none; }
|
|
68
|
+
/* How many are done of all, under the head: a ring of the share done in the accent (the good green
|
|
69
|
+
once all are), the share in its middle, and a key of the two counts beside it, each a dot of its
|
|
70
|
+
color, its name muted and its count at the end; a hairline under it where the list follows. */
|
|
71
|
+
> .gallery-todos-face > .gallery-todos-summary {
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
gap: 14px;
|
|
75
|
+
flex: none;
|
|
76
|
+
min-width: 0;
|
|
77
|
+
padding-bottom: 12px;
|
|
78
|
+
border-bottom: 1px solid var(--doc-grid);
|
|
79
|
+
}
|
|
80
|
+
> .gallery-todos-face > .gallery-todos-summary[hidden] { display: none; }
|
|
81
|
+
/* All done: the summary the card's empty face, the ring (as large as ever) in the middle of the room
|
|
82
|
+
under the head, the line (待办都完成了) under it, no key, no picture of its own. */
|
|
83
|
+
> .gallery-todos-face[data-state="done"] > .gallery-todos-summary { flex-direction: column; gap: 10px; margin-top: auto; padding-bottom: 0; border-bottom: 0; }
|
|
84
|
+
> .gallery-todos-face[data-state="done"] > .gallery-todos-summary > .gallery-todos-key { display: none; }
|
|
85
|
+
> .gallery-todos-face[data-state="done"] > .gallery-todos-list { display: none; }
|
|
86
|
+
> .gallery-todos-face[data-state="done"] > .gallery-todos-line { flex: none; margin-bottom: auto; padding-top: 0; }
|
|
87
|
+
> .gallery-todos-face[data-state="done"] > .gallery-todos-line::before { display: none; }
|
|
88
|
+
> .gallery-todos-face > .gallery-todos-summary > .gallery-todos-ring {
|
|
89
|
+
position: relative;
|
|
90
|
+
flex: none;
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
width: var(--gallery-todos-ring);
|
|
95
|
+
height: var(--gallery-todos-ring);
|
|
96
|
+
}
|
|
97
|
+
> .gallery-todos-face > .gallery-todos-summary > .gallery-todos-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
|
|
98
|
+
> .gallery-todos-face > .gallery-todos-summary > .gallery-todos-ring > svg > circle { fill: none; stroke-width: 10; }
|
|
99
|
+
> .gallery-todos-face > .gallery-todos-summary > .gallery-todos-ring > svg > .gallery-todos-track { stroke: var(--gallery-track); }
|
|
100
|
+
> .gallery-todos-face > .gallery-todos-summary > .gallery-todos-ring > svg > .gallery-todos-arc {
|
|
101
|
+
stroke: var(--gallery-accent);
|
|
102
|
+
stroke-linecap: round;
|
|
103
|
+
stroke-dasharray: calc(var(--gallery-todos-share, 0) * 100) 100;
|
|
104
|
+
}
|
|
105
|
+
> .gallery-todos-face > .gallery-todos-summary[data-all] > .gallery-todos-ring > svg > .gallery-todos-arc { stroke: var(--gallery-good); }
|
|
106
|
+
> .gallery-todos-face > .gallery-todos-summary > .gallery-todos-ring > .gallery-todos-percent {
|
|
107
|
+
position: relative;
|
|
108
|
+
font-size: calc(var(--gallery-todos-ring) * .27);
|
|
109
|
+
line-height: 1;
|
|
110
|
+
font-weight: var(--gallery-numeral-weight);
|
|
111
|
+
letter-spacing: var(--gallery-numeral-tracking);
|
|
112
|
+
color: var(--gallery-text-strong);
|
|
113
|
+
font-variant-numeric: tabular-nums;
|
|
114
|
+
}
|
|
115
|
+
/* The percent sign small and muted, as every number's unit. */
|
|
116
|
+
> .gallery-todos-face > .gallery-todos-summary > .gallery-todos-ring > .gallery-todos-percent > .gallery-todos-percent-sign { margin-inline-start: .08em; font-size: .55em; font-weight: 500; letter-spacing: 0; color: var(--doc-muted); }
|
|
117
|
+
> .gallery-todos-face > .gallery-todos-summary > .gallery-todos-key {
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-direction: column;
|
|
120
|
+
gap: 4px;
|
|
121
|
+
flex: 1 1 auto;
|
|
122
|
+
min-width: 0;
|
|
123
|
+
max-width: 160px;
|
|
124
|
+
margin: 0;
|
|
125
|
+
}
|
|
126
|
+
> .gallery-todos-face > .gallery-todos-summary > .gallery-todos-key > .gallery-todos-key-row { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 20px; }
|
|
127
|
+
> .gallery-todos-face > .gallery-todos-summary > .gallery-todos-key > .gallery-todos-key-row::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--gallery-accent); }
|
|
128
|
+
> .gallery-todos-face > .gallery-todos-summary[data-all] > .gallery-todos-key > .gallery-todos-key-row[data-kind="done"]::before { background: var(--gallery-good); }
|
|
129
|
+
> .gallery-todos-face > .gallery-todos-summary > .gallery-todos-key > .gallery-todos-key-row[data-kind="left"]::before { background: var(--gallery-track); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--doc-muted) 35%, transparent); }
|
|
130
|
+
> .gallery-todos-face > .gallery-todos-summary > .gallery-todos-key > .gallery-todos-key-row > .gallery-todos-key-name { flex: 1 1 auto; min-width: 0; color: var(--doc-muted); }
|
|
131
|
+
> .gallery-todos-face > .gallery-todos-summary > .gallery-todos-key > .gallery-todos-key-row > .gallery-todos-key-count { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
|
|
132
|
+
> .gallery-todos-face > .gallery-todos-list {
|
|
133
|
+
flex: 1 1 auto;
|
|
134
|
+
min-height: 0;
|
|
135
|
+
margin: -2px -6px 0;
|
|
136
|
+
overflow-y: auto;
|
|
137
|
+
overscroll-behavior: contain;
|
|
138
|
+
scrollbar-width: thin;
|
|
139
|
+
}
|
|
140
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group + .gallery-todos-group { margin-top: 10px; }
|
|
141
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > button,
|
|
142
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items > .gallery-todos-item > button {
|
|
143
|
+
display: flex;
|
|
144
|
+
box-sizing: border-box;
|
|
145
|
+
width: 100%;
|
|
146
|
+
margin: 0;
|
|
147
|
+
border: 0;
|
|
148
|
+
border-radius: 6px;
|
|
149
|
+
background: transparent;
|
|
150
|
+
font: inherit;
|
|
151
|
+
color: inherit;
|
|
152
|
+
text-align: start;
|
|
153
|
+
cursor: pointer;
|
|
154
|
+
}
|
|
155
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > button:hover,
|
|
156
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items > .gallery-todos-item > button:hover { background: var(--doc-hover); }
|
|
157
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-doc {
|
|
158
|
+
padding: 2px 6px;
|
|
159
|
+
font-size: var(--gallery-meta-size);
|
|
160
|
+
font-weight: 500;
|
|
161
|
+
color: var(--doc-muted);
|
|
162
|
+
overflow: hidden;
|
|
163
|
+
white-space: nowrap;
|
|
164
|
+
text-overflow: ellipsis;
|
|
165
|
+
}
|
|
166
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items { margin: 0; padding: 0; list-style: none; }
|
|
167
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items > .gallery-todos-item > .gallery-todos-todo {
|
|
168
|
+
flex-wrap: wrap;
|
|
169
|
+
align-items: baseline;
|
|
170
|
+
column-gap: 8px;
|
|
171
|
+
padding: 4px 6px 4px 30px;
|
|
172
|
+
position: relative;
|
|
173
|
+
}
|
|
174
|
+
/* The box: a rounded square of the muted color's line, filled with the accent and ticked once done. */
|
|
175
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items > .gallery-todos-item > .gallery-todos-todo > .gallery-todos-box,
|
|
176
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items > .gallery-todos-item > .gallery-todos-check > .gallery-todos-box {
|
|
177
|
+
position: absolute;
|
|
178
|
+
top: calc(4px + .725em - 8px);
|
|
179
|
+
left: 7px;
|
|
180
|
+
box-sizing: border-box;
|
|
181
|
+
width: 16px;
|
|
182
|
+
height: 16px;
|
|
183
|
+
border: 1.5px solid color-mix(in srgb, var(--doc-muted) 70%, transparent);
|
|
184
|
+
border-radius: 5px;
|
|
185
|
+
}
|
|
186
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items > .gallery-todos-item > .gallery-todos-todo > .gallery-todos-text { min-width: 0; overflow-wrap: anywhere; }
|
|
187
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items > .gallery-todos-item > .gallery-todos-todo > .gallery-todos-path {
|
|
188
|
+
min-width: 0;
|
|
189
|
+
font-size: var(--gallery-meta-size);
|
|
190
|
+
color: var(--doc-muted);
|
|
191
|
+
overflow: hidden;
|
|
192
|
+
white-space: nowrap;
|
|
193
|
+
text-overflow: ellipsis;
|
|
194
|
+
}
|
|
195
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items > .gallery-todos-item > .gallery-todos-todo.gallery-todos-done > .gallery-todos-text { color: var(--doc-muted); text-decoration: line-through; }
|
|
196
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items > .gallery-todos-item > .gallery-todos-todo.gallery-todos-done > .gallery-todos-box,
|
|
197
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items > .gallery-todos-item > .gallery-todos-check[aria-checked="true"] > .gallery-todos-box {
|
|
198
|
+
border-color: transparent;
|
|
199
|
+
background: var(--gallery-accent) var(--gallery-todos-tick) center / 12px no-repeat;
|
|
200
|
+
}
|
|
201
|
+
/* The box as a button of its own (where the workspace takes checks: setTodo), over the item's start: a
|
|
202
|
+
press checks it in its document, the words beside it still open the document. */
|
|
203
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items > .gallery-todos-item { position: relative; }
|
|
204
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items > .gallery-todos-item > .gallery-todos-check {
|
|
205
|
+
position: absolute;
|
|
206
|
+
z-index: 1;
|
|
207
|
+
top: 0;
|
|
208
|
+
left: 0;
|
|
209
|
+
width: 30px;
|
|
210
|
+
height: calc(8px + 1.45em);
|
|
211
|
+
padding: 0;
|
|
212
|
+
border-radius: 6px 0 0 6px;
|
|
213
|
+
}
|
|
214
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items > .gallery-todos-item > .gallery-todos-check:hover { background: transparent; }
|
|
215
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items > .gallery-todos-item > .gallery-todos-check:hover > .gallery-todos-box { border-color: var(--doc-muted); }
|
|
216
|
+
> .gallery-todos-face > .gallery-todos-list > .gallery-todos-group > .gallery-todos-items > .gallery-todos-item > .gallery-todos-check[aria-checked="true"]:hover > .gallery-todos-box { border-color: transparent; }
|
|
217
|
+
/* Why a check was refused, for a few seconds, under the list. */
|
|
218
|
+
> .gallery-todos-face > .gallery-todos-note { flex: none; margin: 0; font-size: var(--gallery-meta-size); color: var(--gallery-bad); }
|
|
219
|
+
> .gallery-todos-face > .gallery-todos-note[hidden] { display: none; }
|
|
220
|
+
/* What it says where it lists nothing: in the middle of what the card has left, muted, a quiet
|
|
221
|
+
picture over it in a soft disc (the cards' empty face), a check in the good green's once all are done. */
|
|
222
|
+
> .gallery-todos-face > .gallery-todos-line {
|
|
223
|
+
flex: 1 1 auto;
|
|
224
|
+
display: flex;
|
|
225
|
+
flex-direction: column;
|
|
226
|
+
align-items: center;
|
|
227
|
+
justify-content: center;
|
|
228
|
+
gap: 8px;
|
|
229
|
+
margin: 0;
|
|
230
|
+
padding: 8px 12px;
|
|
231
|
+
font-size: 13px;
|
|
232
|
+
color: var(--doc-muted);
|
|
233
|
+
text-align: center;
|
|
234
|
+
}
|
|
235
|
+
> .gallery-todos-face > .gallery-todos-line::before {
|
|
236
|
+
content: "";
|
|
237
|
+
flex: none;
|
|
238
|
+
width: 44px;
|
|
239
|
+
height: 44px;
|
|
240
|
+
margin-bottom: 2px;
|
|
241
|
+
background: currentColor;
|
|
242
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Ccircle cx='22' cy='22' r='22' fill-opacity='.14'/%3E%3Cg transform='translate(11 11) scale(.9167)' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 5.5L5 7l2.5-2.5M3.5 11.5L5 13l2.5-2.5M3.5 17.5L5 19l2.5-2.5M11 6h9M11 12h9M11 18h9'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
|
|
243
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Ccircle cx='22' cy='22' r='22' fill-opacity='.14'/%3E%3Cg transform='translate(11 11) scale(.9167)' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 5.5L5 7l2.5-2.5M3.5 11.5L5 13l2.5-2.5M3.5 17.5L5 19l2.5-2.5M11 6h9M11 12h9M11 18h9'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
|
|
244
|
+
}
|
|
245
|
+
> .gallery-todos-face[data-state="done"] > .gallery-todos-line::before {
|
|
246
|
+
background: var(--gallery-good);
|
|
247
|
+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Ccircle cx='22' cy='22' r='22' fill-opacity='.14'/%3E%3Cg transform='translate(11 11) scale(.9167)' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4 4L18.5 7.5'/%3E%3C/g%3E%3C/svg%3E");
|
|
248
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Ccircle cx='22' cy='22' r='22' fill-opacity='.14'/%3E%3Cg transform='translate(11 11) scale(.9167)' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4 4L18.5 7.5'/%3E%3C/g%3E%3C/svg%3E");
|
|
249
|
+
}
|
|
250
|
+
> .gallery-todos-face > .gallery-todos-line[hidden] { display: none; }
|
|
251
|
+
}
|
|
252
|
+
/* A tall card (280px high and more: 4 high from a window 1440px wide): the ring larger, the key beside it. */
|
|
253
|
+
@container (min-height: 280px) {
|
|
254
|
+
[data-doc-component="gallery/todos"] > .gallery-todos-face { --gallery-todos-ring: 88px; }
|
|
255
|
+
[data-doc-component="gallery/todos"] > .gallery-todos-face > .gallery-todos-summary { gap: 20px; }
|
|
256
|
+
[data-doc-component="gallery/todos"] > .gallery-todos-face > .gallery-todos-summary > .gallery-todos-key { max-width: 200px; gap: 6px; }
|
|
257
|
+
[data-doc-component="gallery/todos"] > .gallery-todos-face > .gallery-todos-summary > .gallery-todos-key > .gallery-todos-key-row { font-size: 14px; }
|
|
258
|
+
}
|
|
259
|
+
/* A wide card (8 cells): the documents side by side, two to a row, the list still scrolling down. */
|
|
260
|
+
@container (min-width: 560px) {
|
|
261
|
+
[data-doc-component="gallery/todos"] > .gallery-todos-face > .gallery-todos-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 10px 24px; }
|
|
262
|
+
[data-doc-component="gallery/todos"] > .gallery-todos-face > .gallery-todos-list > .gallery-todos-group + .gallery-todos-group { margin-top: 0; }
|
|
263
|
+
}
|
|
264
|
+
/* On a custom page the face is the card's: as high as what the card holds inside its padding. Where no
|
|
265
|
+
card is around it (a document, as gallery block check shows it) it is a few items high. */
|
|
266
|
+
[data-doc-component="gallery/todos"] { height: 16em; }
|
|
267
|
+
.gallery-card > [data-doc-component="gallery/todos"] { height: 100%; }
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 我的待办 (gallery/todos)
|
|
2
|
+
|
|
3
|
+
A card for a custom page (its places are `page`, its needs `workspace`): the to-dos of every document of the workspace that are not done yet, an item of a to-do list each (`<ul class="doc-todo">`), grouped by document, the one edited last first, each with the headings it stands under. Use it on the home page, or on a page about the user's work.
|
|
4
|
+
|
|
5
|
+
## Settings
|
|
6
|
+
|
|
7
|
+
Its two settings are the card's form, which the user opens from the grip at the card's top right › 设置…:
|
|
8
|
+
|
|
9
|
+
| Key | Label | Type | What it is |
|
|
10
|
+
| --- | --- | --- | --- |
|
|
11
|
+
| `document` | 只看这篇文档 | document | a document's slug: its to-dos alone; left out, every document's |
|
|
12
|
+
| `done` | 也显示已完成的 | switch | the done ones too, checked and struck through |
|
|
13
|
+
|
|
14
|
+
They are kept in its data part `settings`, a `<script type="application/json">`: `{}` (template.html, what a menu adds) shows the open to-dos of every document. Write `document` when the user asks for one document's to-dos. The block reads them and writes nothing.
|
|
15
|
+
|
|
16
|
+
## How to write it
|
|
17
|
+
|
|
18
|
+
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 todos`, the instance as template.html has it. Sizes: 4 × 4 (the default), 4 × 6 and 8 × 4; the list scrolls inside the card.
|
|
19
|
+
|
|
20
|
+
## What the user does
|
|
21
|
+
|
|
22
|
+
- clicks an item's box: the item is checked (or cleared) in its document, which Gallery writes as the user's own edit; the home page's undo (Ctrl+Z) checks it back. An item checked on the card stays there, struck through, until the page is shown again. Where the item changed meanwhile (its words), the card says so and reads again;
|
|
23
|
+
- clicks an item's words: its document opens, at the item where it has a block id;
|
|
24
|
+
- clicks a document's title: the document opens.
|
|
25
|
+
|
|
26
|
+
The card follows by itself: a to-do added, checked or taken out in any document shows at once.
|
|
27
|
+
|
|
28
|
+
## How it looks
|
|
29
|
+
|
|
30
|
+
我的待办 beside a checked list's chip on the top line, how many to-dos there are at its end (共 6 项); under it how many are done of all, a ring of the share done (larger on a tall card) and the two counts; then each document's title small and muted over its items, an item a rounded box (filled with the accent once checked), its words and the headings it stands under (but the document's title, which its group's says); on an 8 × 4 card the documents two to a row; in the kit's card tokens (as every Gallery card: a head of a tinted chip and a title, its end clear of the card's grip), light and dark. With every to-do done, the ring stands in the middle (green at 100%) over 待办都完成了; with no to-do it says 所有文档里的待办会出现在这里. In an exported file, which has no workspace to read, it says the list shows when the page is opened in Gallery; its boxes there are drawn and do nothing. The script runs with the rights of the page's own scripts, as any block's does.
|