@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,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "gallery-soft",
|
|
3
|
+
"name": { "zh": "柔光风格", "en": "Soft style" },
|
|
4
|
+
"description": { "zh": "柔和的配色、圆润的卡片:首页卡片的另一种样子。", "en": "Soft colors and rounded cards: another look for the home page's cards." },
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"author": "Gallery",
|
|
7
|
+
"icon": "🌷"
|
|
8
|
+
}
|
package/release.json
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heycys/gallery",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"built": "2026-11-
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"built": "2026-11-09T12:40:13.596Z",
|
|
5
5
|
"stamps": {
|
|
6
|
-
"editor": "
|
|
6
|
+
"editor": "3e8a535e1b3305fd",
|
|
7
7
|
"kit": {
|
|
8
|
-
"styles": "
|
|
8
|
+
"styles": "b4df48c5b58e5996",
|
|
9
9
|
"katex-styles": "81d0a0b4dcb41846",
|
|
10
|
-
"runtime": "
|
|
11
|
-
"code": "
|
|
12
|
-
"state": "
|
|
10
|
+
"runtime": "2e70af13bb7f6272",
|
|
11
|
+
"code": "ac7030c365b49692",
|
|
12
|
+
"state": "d4a528bd33704119",
|
|
13
13
|
"sheets": "fda7b7b754e01019",
|
|
14
14
|
"tokens": "a218d5d5f9008530",
|
|
15
|
-
"ui": "
|
|
15
|
+
"ui": "9d426d38850cc54f",
|
|
16
16
|
"dialogs": "42866e832540bf9f",
|
|
17
17
|
"katex": "1b0a973a02ab84f0",
|
|
18
18
|
"katex-auto-render": "63e7162ddec186d6",
|
|
19
|
-
"math": "
|
|
19
|
+
"math": "af1582414dca108c",
|
|
20
20
|
"d3": "9f5a21b6070f8353",
|
|
21
|
-
"charts": "
|
|
22
|
-
"tables": "
|
|
21
|
+
"charts": "22bde4e5900579fe",
|
|
22
|
+
"tables": "7ab99911557a2efe",
|
|
23
|
+
"board-styles": "021119be212eaf56",
|
|
24
|
+
"board": "15007a0cd8566621"
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
}
|
package/sdk/doc-kit.d.ts
CHANGED
|
@@ -3,15 +3,22 @@ import type { DocState } from "./doc-state.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* What an instance can hear (`on`). `editable`: `context.canEdit()` has just become true, for one mounted before the page came to edit.
|
|
5
5
|
* `content`: a change inside the instance, heard only with `owns: false`, as what a component owns the
|
|
6
|
-
* kit does not watch; a change of what the file says of it is `source`, whatever it owns
|
|
6
|
+
* kit does not watch; a change of what the file says of it is `source`, whatever it owns: of a part edited
|
|
7
|
+
* as text or data, or of the blocks a slot holds (a part edited as flow), typed, moved in or out, undone,
|
|
8
|
+
* an attribute that says something of the file among them (a to-do item checked, a cell's spans, a look
|
|
9
|
+
* class), none an instance among those blocks draws; told in the next frame, a frame's changes in one.
|
|
10
|
+
* `clock`: each whole minute of the reader's clock, its detail "minute", or "day" for the first of a day.
|
|
11
|
+
* `data`: what the workspace holds changed, its detail the kind (`"todos"`, `"recent"`, `"stats"`, `"activity"`):
|
|
12
|
+
* heard for the kinds this instance read with `context.workspace.query`; read it again then. For a view of a
|
|
13
|
+
* table (the manifest's needs hold `"tables"`) the detail is `"table"`: the rows of the table it reads changed.
|
|
7
14
|
*/
|
|
8
|
-
export type DocComponentSignal = "source" | "resize" | "theme" | "layout" | "viewport" | "fonts" | "content" | "reveal" | "editable";
|
|
15
|
+
export type DocComponentSignal = "source" | "resize" | "theme" | "layout" | "viewport" | "fonts" | "content" | "reveal" | "editable" | "clock" | "data";
|
|
9
16
|
|
|
10
17
|
/** What a component's `mount` returns, all of it optional. */
|
|
11
18
|
export interface DocComponentHandle {
|
|
12
19
|
/**
|
|
13
20
|
* A signal it asked for (`on`). `detail`: the mutation records of `source` and `content`; the faces of a
|
|
14
|
-
* later `fonts
|
|
21
|
+
* later `fonts`; of `data`, the kind that changed ("table": the rows of the table a view reads). `options.quiet`: on `content`, a change that leaves the page looking as it was.
|
|
15
22
|
*/
|
|
16
23
|
update?(reason: DocComponentSignal, detail?: unknown, options?: { quiet?: boolean }): void;
|
|
17
24
|
/** The host left the page. What listens on `context.signal` goes by itself. */
|
|
@@ -27,6 +34,257 @@ export interface DocComponentStateOptions<T extends Record<string, unknown>> {
|
|
|
27
34
|
transientKeys?: Array<keyof T & string>;
|
|
28
35
|
}
|
|
29
36
|
|
|
37
|
+
/** A link a row's cells hold to a document of the workspace, or to a block of one. */
|
|
38
|
+
export interface DocRowLink {
|
|
39
|
+
/** The document's folder name: of this document for a link within it. */
|
|
40
|
+
slug: string;
|
|
41
|
+
/** The link's words. */
|
|
42
|
+
title: string;
|
|
43
|
+
/** The block's id, or null for the document. */
|
|
44
|
+
block: string | null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** A row of a table a part holds (`context.rows`), or of the table a view reads (`context.table()`), as it reads it when it is asked. */
|
|
48
|
+
export interface DocRow {
|
|
49
|
+
/** The row on the page: read it, never write it (a write is `add`, `move`, `remove`, and a view's `set`). */
|
|
50
|
+
readonly el: HTMLTableRowElement;
|
|
51
|
+
/** Its values by the header's words: a number where a cell writes one, its words, or null for none (as a chart drawn from a table reads them). */
|
|
52
|
+
readonly values: Readonly<Record<string, string | number | null>>;
|
|
53
|
+
/** The links its cells hold to documents. */
|
|
54
|
+
readonly links: readonly DocRowLink[];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The rows of the table a part is or holds, read when `context.rows` is called: its header's words and
|
|
59
|
+
* the rows of its body. Each write is one `context.edit` of the part, one undo step, false where it
|
|
60
|
+
* was not taken, as `edit`'s; a row added, moved or removed takes the blank before it along, so a table
|
|
61
|
+
* written a row a line stays so. Read the rows again after a write: on `source`.
|
|
62
|
+
*/
|
|
63
|
+
export interface DocRowSet {
|
|
64
|
+
/** The header's words, in order. */
|
|
65
|
+
readonly columns: readonly string[];
|
|
66
|
+
readonly rows: readonly DocRow[];
|
|
67
|
+
/** A row of these values (by the header's words; a name the header does not have throws), after `at.after`, or last. */
|
|
68
|
+
add(values: Record<string, string>, at?: { after?: DocRow }): boolean;
|
|
69
|
+
/** `row` put before `to.before`, or after `to.after`, its cells of `to.values` set in the same write (a card dropped in another column: its status and its place); neither leaves it where it is. */
|
|
70
|
+
move(row: DocRow, to: { before?: DocRow; after?: DocRow; values?: Record<string, string> }): boolean;
|
|
71
|
+
/** `row` taken out. */
|
|
72
|
+
remove(row: DocRow): boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The table of the document a view reads (`context.table()`, for a block whose manifest's needs hold
|
|
77
|
+
* "tables", bound to the table by the key on its instance, data-doc-from, which the table's frame carries
|
|
78
|
+
* as data-doc-chart-source), read when it is called, in the file's order (a reader's sort of the table
|
|
79
|
+
* leaves it): its header's words and its rows of data, as a chart drawn from the table reads them. A row
|
|
80
|
+
* is the same object until it, or the header, changes, so that a view keeps what it drew of a row while
|
|
81
|
+
* that row is the same. No write is a write of the view's: `set`, `add`, `move` and `remove` each ask
|
|
82
|
+
* the page editor, which changes the table as its own tools do (one undo step; a cell's words merged word
|
|
83
|
+
* by word with someone else's, a row moved, put in or taken out held back as a conflict where the table
|
|
84
|
+
* changed meanwhile), and answer whether it did: false in an export, in 演示视图, before the page edits,
|
|
85
|
+
* for a table the editor's tools do not manage (one with merged cells, or not written as the kit writes
|
|
86
|
+
* one), and for a row no longer in the table; a name the header does not have throws. Its own sort and
|
|
87
|
+
* filter a view keeps in `context.state`, never in the table.
|
|
88
|
+
*/
|
|
89
|
+
export interface DocTableView extends DocRowSet {
|
|
90
|
+
/** Whether the page editor would take a change of this table now, asked with no change: false where every change answers false whatever it is (an export, 演示视图, before the page edits, a table the editor's tools do not manage: a `<tfoot>`, rows of other lengths), so that a view shows it read-only. */
|
|
91
|
+
canEdit(): boolean;
|
|
92
|
+
/** One cell's words: the cell of `column` (a name of the header) in `row`. */
|
|
93
|
+
set(row: DocRow, column: string, text: string): boolean;
|
|
94
|
+
/** `listener` called once a change of the page leaves the table's rows other than they were (a cell typed in, a row added, moved or taken out, the table or the view's key changed); the function returned takes it off, as the instance's end does. A view that hears `data` (detail "table") needs none. */
|
|
95
|
+
subscribe(listener: () => void): () => void;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** A card's size on a custom page: in the grid's cells as the board draws it (1 to 12 wide, no more than the board's columns, 4 on a narrow window; 1 to 24 high), and in pixels, what the card holds inside its padding. */
|
|
99
|
+
export interface DocComponentSize {
|
|
100
|
+
w: number;
|
|
101
|
+
h: number;
|
|
102
|
+
width: number;
|
|
103
|
+
height: number;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Where a to-do stands, what names it to its document whether or not its item has a block id. */
|
|
107
|
+
export interface DocTodoRef {
|
|
108
|
+
/** Its document's folder name. */
|
|
109
|
+
slug: string;
|
|
110
|
+
/** Its item's block id (data-block-id), or null for one written with none yet. */
|
|
111
|
+
block: string | null;
|
|
112
|
+
/** Its words. */
|
|
113
|
+
text: string;
|
|
114
|
+
/** The headings it stands under, the outermost first. */
|
|
115
|
+
path: string[];
|
|
116
|
+
/** Which of the to-dos of the same words under the same path it is, 0 the first. */
|
|
117
|
+
nth: number;
|
|
118
|
+
/** The version of its document's file it was read from (a hash), by which a check finds it by its place while the file is still that one; null where none is known. */
|
|
119
|
+
version?: string | null;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** A to-do of a document of the workspace (`workspace.query("todos")`): an item of a to-do list. */
|
|
123
|
+
export interface DocTodo {
|
|
124
|
+
ref: DocTodoRef;
|
|
125
|
+
/** Its words. */
|
|
126
|
+
text: string;
|
|
127
|
+
/** Checked. */
|
|
128
|
+
done: boolean;
|
|
129
|
+
/** Its document's folder name and title. */
|
|
130
|
+
slug: string;
|
|
131
|
+
title: string;
|
|
132
|
+
/** The headings it stands under, the outermost first. */
|
|
133
|
+
path: string[];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** A document of the workspace as `workspace.query("recent")` lists it, the one edited last first. */
|
|
137
|
+
export interface DocRecentDocument {
|
|
138
|
+
slug: string;
|
|
139
|
+
title: string;
|
|
140
|
+
/** Its page icon as its doc.json writes it (an emoji, or an icon's or a picture's value), or null. */
|
|
141
|
+
icon: string | null;
|
|
142
|
+
/** When its file was last written, an ISO time. */
|
|
143
|
+
edited: string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** The workspace's counts (`workspace.query("stats")`). */
|
|
147
|
+
export interface DocWorkspaceStats {
|
|
148
|
+
/** Its documents (not the 写作偏好 page, nor a custom page). */
|
|
149
|
+
documents: number;
|
|
150
|
+
/** Its to-dos, checked and all. */
|
|
151
|
+
todos: { done: number; total: number };
|
|
152
|
+
/** The words of all its documents. */
|
|
153
|
+
words: number;
|
|
154
|
+
/** How many documents were written since this week's Monday, 0:00. */
|
|
155
|
+
editedThisWeek: number;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** A day of the workspace's record of edits (`workspace.query("activity")`), of every document. */
|
|
159
|
+
export interface DocActivityDay {
|
|
160
|
+
/** YYYY-MM-DD, the server's local day. */
|
|
161
|
+
date: string;
|
|
162
|
+
/** The writes that changed a document that day. */
|
|
163
|
+
edits: number;
|
|
164
|
+
/** The net change of words that day (below 0 where more went than came). */
|
|
165
|
+
words: number;
|
|
166
|
+
/** Of those, the reader's own (their commits on the page) and the Agent's (any other write). */
|
|
167
|
+
reader: { edits: number; words: number };
|
|
168
|
+
agent: { edits: number; words: number };
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/** A row of a table of a document as `workspace.query("table")` gives it: its values by the header's words, the links its cells hold to documents. */
|
|
172
|
+
export interface DocWorkspaceRow {
|
|
173
|
+
values: Record<string, string | number | null>;
|
|
174
|
+
links: { slug: string; title: string; block: string | null }[];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** What `workspace.query("table")` gives: the header's words, the rows asked for (the first `limit`), and how many rows matched in all. */
|
|
178
|
+
export interface DocWorkspaceTable {
|
|
179
|
+
columns: string[];
|
|
180
|
+
rows: DocWorkspaceRow[];
|
|
181
|
+
total: number;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** What `workspace.query` resolves to: its data, and when it was read (an ISO time; in an exported file, when the export was made). */
|
|
185
|
+
export interface DocWorkspaceAnswer<T> {
|
|
186
|
+
data: T;
|
|
187
|
+
at: string;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* What a block reads of the workspace, where its manifest's `needs` hold `"workspace"` (no consent asked:
|
|
192
|
+
* it is the user's own). A query that cannot be answered rejects with an Error whose `code` says why, one
|
|
193
|
+
* of these and never another: "offline" (an exported file whose export kept none of it, or a server that does
|
|
194
|
+
* not answer: show that the data is Gallery's), "failed" (the server answered and could not read it: show
|
|
195
|
+
* that it could not be read), "missing" (`table`: no such document, no table of that key in it, or one with
|
|
196
|
+
* merged cells), "kind", "options", "unsupported" (which no server of this version says). In an exported
|
|
197
|
+
* file each kind is answered from what the export embedded (to-dos 200 at most, documents 50, the tables
|
|
198
|
+
* the document's blocks asked for), `at` the export's time: say "截至 …" with it.
|
|
199
|
+
*/
|
|
200
|
+
export interface DocWorkspace {
|
|
201
|
+
/** The to-dos of the documents, of those edited last first, each in its document's order (`limit` default 200, at most 1000). */
|
|
202
|
+
query(kind: "todos", options?: { done?: boolean; slugs?: string[]; limit?: number }): Promise<DocWorkspaceAnswer<DocTodo[]>>;
|
|
203
|
+
/** The documents edited last (`limit` default 10, at most 50). */
|
|
204
|
+
query(kind: "recent", options?: { limit?: number }): Promise<DocWorkspaceAnswer<DocRecentDocument[]>>;
|
|
205
|
+
query(kind: "stats", options?: Record<string, never>): Promise<DocWorkspaceAnswer<DocWorkspaceStats>>;
|
|
206
|
+
/** The last `days` days to today (default 365, at most 371: 53 weeks, as long as the record is kept), a day of none 0, from the day the record started at the earliest. */
|
|
207
|
+
query(kind: "activity", options?: { days?: number }): Promise<DocWorkspaceAnswer<DocActivityDay[]>>;
|
|
208
|
+
/** A keyed table of a document (its frame's data-doc-chart-source), read-only: its rows whose cells hold the words `where` names (`limit` default 200, at most 1000). A column the table does not have rejects with "options". */
|
|
209
|
+
query(kind: "table", options: { slug: string; key: string; where?: Record<string, string>; limit?: number }): Promise<DocWorkspaceAnswer<DocWorkspaceTable>>;
|
|
210
|
+
/** Open a document (at a block of it) or a custom page where the page is shown: the workbench, else the page itself goes there; nothing in an exported file. */
|
|
211
|
+
open(target: { slug: string; block?: string | null } | { page: string }): void;
|
|
212
|
+
/**
|
|
213
|
+
* Check (`done` true) or clear a to-do of a document, by the ref `query("todos")` gave: the server writes that
|
|
214
|
+
* document as the reader's edit (an open page of it merges it; on a custom page, its undo checks it back).
|
|
215
|
+
* Resolves to whether it changed the document (false: it said so already). Rejects with `code`: "changed"
|
|
216
|
+
* (the item is not as read: its words changed, or it is gone; read again), "ambiguous" (several items alike
|
|
217
|
+
* and the file changed since), "locked" (the item is there, where the document's own page cannot check it: in a table cell, in a block of the document's own), "missing", "busy", "offline" (nothing on the page writes the workspace),
|
|
218
|
+
* "ref", "failed". Not there in an exported file: test `if (workspace.setTodo)` and draw the boxes read-only.
|
|
219
|
+
*/
|
|
220
|
+
setTodo?(ref: DocTodoRef, done: boolean): Promise<boolean>;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/** Where a drag would drop: the element the marker goes in, and the child of it the marker goes before (null: its end). */
|
|
224
|
+
export interface DocDropSpot {
|
|
225
|
+
into: Element;
|
|
226
|
+
before: Node | null;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/** What `DocKit.input` takes. */
|
|
230
|
+
export interface DocInputOptions {
|
|
231
|
+
/** Hears each value the reader is done with, once: Enter, the field left, a select changed; never while an input method composes. */
|
|
232
|
+
commit(value: string): void;
|
|
233
|
+
/** Ends what it listens to (`context.signal`). */
|
|
234
|
+
signal?: AbortSignal;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/** What `DocKit.input` returns. */
|
|
238
|
+
export interface DocInputHandle {
|
|
239
|
+
/** The value the file holds now, drawn from a part: shown unless the reader is typing another there. */
|
|
240
|
+
set(value: string): void;
|
|
241
|
+
/** The value committed last, or set. */
|
|
242
|
+
readonly value: string;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** What `DocKit.drag` takes. */
|
|
246
|
+
export interface DocDragOptions<S extends DocDropSpot> {
|
|
247
|
+
/** What a press starts a drag on, a selector inside the area. */
|
|
248
|
+
items: string;
|
|
249
|
+
/** Where in an item a press starts one, a selector (default: anywhere in it). */
|
|
250
|
+
handle?: string;
|
|
251
|
+
/** How far, in pixels, a press moves before it is a drag (default 4). */
|
|
252
|
+
threshold?: number;
|
|
253
|
+
/** Whether a drag may start now (default: always): `() => context.canEdit()`. */
|
|
254
|
+
enabled?: () => boolean;
|
|
255
|
+
/** An element of the component's that stands where a drop would go, while one would. */
|
|
256
|
+
marker?: Element | null;
|
|
257
|
+
/** Where a drop at (x, y), the pointer's place in the window, goes, or null for nowhere. */
|
|
258
|
+
over(x: number, y: number, item: HTMLElement): S | null;
|
|
259
|
+
/** The item released over a spot: the write, one `context.edit`. */
|
|
260
|
+
drop(item: HTMLElement, spot: S): void;
|
|
261
|
+
/** Ends what it listens to (`context.signal`). */
|
|
262
|
+
signal?: AbortSignal;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/** What `DocKit.drag` returns. */
|
|
266
|
+
export interface DocDragHandle {
|
|
267
|
+
/** Give up a drag going on, as Escape does: nothing dropped. */
|
|
268
|
+
cancel(): void;
|
|
269
|
+
/** Whether an item is being dragged. */
|
|
270
|
+
readonly dragging: boolean;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/** A row of `DocKit.choose`'s menu: `[value, words]`, `{ value, label?, disabled? }`, a bare string (its own value and words), or `{ group }`, a heading that is no row. */
|
|
274
|
+
export type DocChoice = [value: string, label: string] | { value: string; label?: string; disabled?: boolean } | { group: string } | string;
|
|
275
|
+
|
|
276
|
+
/** What `DocKit.choose` takes. */
|
|
277
|
+
export interface DocChooseOptions {
|
|
278
|
+
/** The rows of the menu, in order. */
|
|
279
|
+
options: DocChoice[];
|
|
280
|
+
/** The value checked (and lit first), if any. */
|
|
281
|
+
value?: string | null;
|
|
282
|
+
/** The menu's name for a screen reader. */
|
|
283
|
+
label?: string;
|
|
284
|
+
/** Closes the menu without a choice when it aborts (`context.signal`). */
|
|
285
|
+
signal?: AbortSignal;
|
|
286
|
+
}
|
|
287
|
+
|
|
30
288
|
/** What `mount` is given for a package's instance. */
|
|
31
289
|
export interface DocComponentContext {
|
|
32
290
|
/** The instance's element. */
|
|
@@ -41,7 +299,12 @@ export interface DocComponentContext {
|
|
|
41
299
|
frame(draw: () => void): void;
|
|
42
300
|
/** Say this instance failed: it ends there, even as `mount` runs, and shows what it holds, read-only. */
|
|
43
301
|
fail(error: unknown): void;
|
|
44
|
-
/**
|
|
302
|
+
/**
|
|
303
|
+
* The first element of a part of the manifest in this instance's own markup, or null. A part edited as
|
|
304
|
+
* flow gives its slot (data-doc-slot), whose blocks are the document's, the reader's: read it (its
|
|
305
|
+
* height, its words, its headings), and never write in it, move it or take it off. A name the manifest
|
|
306
|
+
* does not have throws.
|
|
307
|
+
*/
|
|
45
308
|
part(name: string): HTMLElement | null;
|
|
46
309
|
/** This instance's reading state, of no other instance of the package: the same object at every mount. */
|
|
47
310
|
state<T extends Record<string, unknown>>(options: DocComponentStateOptions<T>): DocState<T>;
|
|
@@ -59,11 +322,97 @@ export interface DocComponentContext {
|
|
|
59
322
|
* draft, or leaves what a file cannot hold (a script, a handler, an element that does not read back as
|
|
60
323
|
* itself, its own tag changed): nothing has happened then, and the console says why. Undo puts the
|
|
61
324
|
* part back and `source` tells you, like any change of it. A name the manifest does not have, or a
|
|
62
|
-
* part not edited as data, throws. A list of names changes those parts in one write, one undo step (a
|
|
325
|
+
* part not edited as data (a text part, a slot), throws. A list of names changes those parts in one write, one undo step (a
|
|
63
326
|
* gesture that moves a card and counts the move): `change` is handed a draft of each, by its name, and
|
|
64
327
|
* two that are one element, or one in the other, throw.
|
|
65
328
|
*/
|
|
66
329
|
edit<P extends string | string[]>(part: P, change: (draft: P extends string[] ? Record<string, HTMLElement> : HTMLElement) => void): boolean;
|
|
330
|
+
/**
|
|
331
|
+
* What a part holds, parsed as JSON (a script of data's), JSON's null too; undefined where there is
|
|
332
|
+
* nothing to read: an optional part the instance does not hold, and one that holds no JSON, which
|
|
333
|
+
* fails the instance, as `fail` does.
|
|
334
|
+
*/
|
|
335
|
+
readJSON(part: string): any;
|
|
336
|
+
/**
|
|
337
|
+
* `edit` of a part of JSON: `change` is handed what it holds, parsed, and changes it, or returns what is
|
|
338
|
+
* to stand there instead. Written back as it was laid out (on one line where it was on one, else a line
|
|
339
|
+
* an entry, but for an object or a list of values alone), so that a change of one value changes its
|
|
340
|
+
* line; a change that leaves the value as it was writes nothing. Returns what `edit` returns.
|
|
341
|
+
*/
|
|
342
|
+
editJSON(part: string, change: (draft: any) => any): boolean;
|
|
343
|
+
/** The rows of the table a part is or holds, or null for none, or one with a cell spanning others. */
|
|
344
|
+
rows(part: string): DocRowSet | null;
|
|
345
|
+
/**
|
|
346
|
+
* The table of the document this instance is a view of (its data-doc-from), for a block whose
|
|
347
|
+
* manifest's needs hold "tables": null with none (no key, no table carries it, a cell spanning others),
|
|
348
|
+
* on a custom page, and for a block whose needs do not hold "tables" (the console says so once).
|
|
349
|
+
*/
|
|
350
|
+
table(): DocTableView | null;
|
|
351
|
+
/** `setInterval`, cleared as the instance ends; what it runs is the instance's (its failure the instance's). */
|
|
352
|
+
interval(run: () => void, ms: number): number;
|
|
353
|
+
/** `setTimeout`, cleared as the instance ends; what it runs is the instance's. */
|
|
354
|
+
timeout(run: () => void, ms: number): number;
|
|
355
|
+
/** `addEventListener`, removed as the instance ends (or as `options.signal` aborts). */
|
|
356
|
+
listen<K extends keyof WindowEventMap>(target: Window, type: K, listener: (event: WindowEventMap[K]) => void, options?: AddEventListenerOptions | boolean): void;
|
|
357
|
+
listen<K extends keyof DocumentEventMap>(target: Document, type: K, listener: (event: DocumentEventMap[K]) => void, options?: AddEventListenerOptions | boolean): void;
|
|
358
|
+
listen<K extends keyof HTMLElementEventMap>(target: HTMLElement, type: K, listener: (event: HTMLElementEventMap[K]) => void, options?: AddEventListenerOptions | boolean): void;
|
|
359
|
+
listen(target: EventTarget, type: string, listener: (event: Event) => void, options?: AddEventListenerOptions | boolean): void;
|
|
360
|
+
/** Where the instance is: a document as Gallery shows it, a custom page, or an exported file (where nothing writes). */
|
|
361
|
+
readonly place: "document" | "page" | "export";
|
|
362
|
+
/** Its card's size on a custom page, read when asked (`layout` says it changed); null anywhere else. */
|
|
363
|
+
readonly size: DocComponentSize | null;
|
|
364
|
+
/** What it reads of the workspace: there where its manifest's `needs` hold `"workspace"`, else undefined. `data` says what it read changed. */
|
|
365
|
+
readonly workspace?: DocWorkspace;
|
|
366
|
+
/**
|
|
367
|
+
* The web, for a block whose manifest's needs name the host ("net:<host>", "net:*.<host>" for the names
|
|
368
|
+
* under it): an absolute http or https address on it, asked of Gallery's server, which fetches it (a GET,
|
|
369
|
+
* no cookie, the answer JSON or text, 512 KB at most), keeps it a minute and keeps what it got for when
|
|
370
|
+
* the network is not there. `as`: "json" (the default: `data` is its JSON) or "text". `{key}` in the
|
|
371
|
+
* address is where the server writes the workspace's key for that host (gallery block key), which no
|
|
372
|
+
* page ever holds. Resolves with the answer and when it was fetched (`cached`: given from what was kept,
|
|
373
|
+
* which may be old where the network is not there). Rejects with a DocFetchError: "consent" until the
|
|
374
|
+
* reader allows it, on the card the kit then shows 允许访问 <host> on (draw your own state too, and the
|
|
375
|
+
* instance starts again once the reader says yes or takes it back). In an exported file nothing is
|
|
376
|
+
* fetched: what the export embedded of the address, or "offline", for the block to show a placeholder.
|
|
377
|
+
* Not there for a block whose needs name no host of the net (declared here as always there, so that a
|
|
378
|
+
* block that names one need not ask).
|
|
379
|
+
*/
|
|
380
|
+
fetch(url: string, options?: { as?: "json" | "text" }): Promise<DocFetchAnswer>;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/** What `context.fetch` resolves with. */
|
|
384
|
+
export interface DocFetchAnswer {
|
|
385
|
+
/** The answer's JSON (as "json") or its text (as "text"). */
|
|
386
|
+
data: any;
|
|
387
|
+
/** When it was fetched, an ISO time. */
|
|
388
|
+
at: string;
|
|
389
|
+
/** Whether it was given from what was kept, not fetched now. */
|
|
390
|
+
cached: boolean;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/** Why `context.fetch` was refused: its `code`. */
|
|
394
|
+
export type DocFetchCode = "consent" | "host" | "url" | "private" | "key" | "rate" | "status" | "type" | "too-large" | "offline" | "missing";
|
|
395
|
+
|
|
396
|
+
/** What `context.fetch` rejects with. */
|
|
397
|
+
export interface DocFetchError extends Error {
|
|
398
|
+
/**
|
|
399
|
+
* consent: the reader has not allowed it yet; host: its needs do not name the address's host (or a
|
|
400
|
+
* redirect's); url: no address it may ask for (not http(s), another port, a user in it), its own or a
|
|
401
|
+
* redirect's (or a redirect to an address that does not parse); private: the host is this computer or
|
|
402
|
+
* a private network as this computer's resolver answered it, with no proxy of this computer to take
|
|
403
|
+
* its name (usually the reader's network setup, not the block: the message names the address); key:
|
|
404
|
+
* the address names `{key}` and the workspace has none for that host; rate: too many fetches a
|
|
405
|
+
* minute; status: the site answered an error (`status`);
|
|
406
|
+
* type: no JSON or text (or no JSON asked as JSON); too-large: more than 512 KB; offline: the network
|
|
407
|
+
* or the site not reached, and nothing kept (in an exported file: nothing embedded); missing: the block does not load.
|
|
408
|
+
*/
|
|
409
|
+
code: DocFetchCode;
|
|
410
|
+
/** The hosts of its needs the reader has not allowed yet (consent). */
|
|
411
|
+
hosts?: string[];
|
|
412
|
+
/** The host refused (host, private, key). */
|
|
413
|
+
host?: string;
|
|
414
|
+
/** The site's status (status). */
|
|
415
|
+
status?: number;
|
|
67
416
|
}
|
|
68
417
|
|
|
69
418
|
/** What a package's kit.js registers. */
|
|
@@ -86,7 +435,7 @@ export interface DocComponent {
|
|
|
86
435
|
*/
|
|
87
436
|
dehydrate?(host: HTMLElement): void;
|
|
88
437
|
/**
|
|
89
|
-
* A small edit, as a reader's gesture would make it, by `context.edit`: what `gallery
|
|
438
|
+
* A small edit, as a reader's gesture would make it, by `context.edit`: what `gallery block check`
|
|
90
439
|
* calls to try the way back to the file. Nothing else calls it.
|
|
91
440
|
*/
|
|
92
441
|
example?(host: HTMLElement, context: DocComponentContext): void;
|
|
@@ -101,6 +450,30 @@ declare global {
|
|
|
101
450
|
type DocComponentSignal = import("./doc-kit.js").DocComponentSignal;
|
|
102
451
|
/** What kit.js registers. */
|
|
103
452
|
type DocComponent = import("./doc-kit.js").DocComponent;
|
|
453
|
+
/** A row of a table a part holds (`context.rows`). */
|
|
454
|
+
type DocRow = import("./doc-kit.js").DocRow;
|
|
455
|
+
/** The rows of a table a part holds (`context.rows`). */
|
|
456
|
+
type DocRowSet = import("./doc-kit.js").DocRowSet;
|
|
457
|
+
/** The table of the document a view reads (`context.table()`). */
|
|
458
|
+
type DocTableView = import("./doc-kit.js").DocTableView;
|
|
459
|
+
/** A card's size on a custom page (`context.size`). */
|
|
460
|
+
type DocComponentSize = import("./doc-kit.js").DocComponentSize;
|
|
461
|
+
/** Where a drag would drop (`DocKit.drag`'s `over`). */
|
|
462
|
+
type DocDropSpot = import("./doc-kit.js").DocDropSpot;
|
|
463
|
+
/** What `context.fetch` resolves with. */
|
|
464
|
+
type DocFetchAnswer = import("./doc-kit.js").DocFetchAnswer;
|
|
465
|
+
/** What `context.fetch` rejects with: its `code` says why. */
|
|
466
|
+
type DocFetchError = import("./doc-kit.js").DocFetchError;
|
|
467
|
+
/** What a block reads of the workspace (`context.workspace`), and what it gives. */
|
|
468
|
+
type DocWorkspace = import("./doc-kit.js").DocWorkspace;
|
|
469
|
+
type DocTodo = import("./doc-kit.js").DocTodo;
|
|
470
|
+
type DocTodoRef = import("./doc-kit.js").DocTodoRef;
|
|
471
|
+
type DocWorkspaceRow = import("./doc-kit.js").DocWorkspaceRow;
|
|
472
|
+
type DocWorkspaceTable = import("./doc-kit.js").DocWorkspaceTable;
|
|
473
|
+
type DocRecentDocument = import("./doc-kit.js").DocRecentDocument;
|
|
474
|
+
type DocWorkspaceStats = import("./doc-kit.js").DocWorkspaceStats;
|
|
475
|
+
type DocActivityDay = import("./doc-kit.js").DocActivityDay;
|
|
476
|
+
type DocWorkspaceAnswer<T> = import("./doc-kit.js").DocWorkspaceAnswer<T>;
|
|
104
477
|
}
|
|
105
478
|
|
|
106
479
|
/** How much the kit runs now. */
|
|
@@ -129,13 +502,37 @@ export interface DocKitApi {
|
|
|
129
502
|
quietly<T>(change: () => T): T;
|
|
130
503
|
/** Take what the kit and its components left off `root`, a copy of the page. */
|
|
131
504
|
dehydrate<T extends Element>(root: T): T;
|
|
132
|
-
/** The component on `host` makes its `example` of an edit, as `gallery
|
|
505
|
+
/** The component on `host` makes its `example` of an edit, as `gallery block check` asks it. Whether it has one. */
|
|
133
506
|
example(host: Element): boolean;
|
|
134
507
|
/** Open what hides an element, and bring it into view. */
|
|
135
508
|
reveal(element: Element): void;
|
|
509
|
+
/**
|
|
510
|
+
* A field whose value goes to the file when the reader is done with it: `commit` hears it on Enter (in
|
|
511
|
+
* a textarea Ctrl+Enter), as the field is left or a select changes, never while an input method
|
|
512
|
+
* composes and never twice; Escape puts back the value committed last.
|
|
513
|
+
*/
|
|
514
|
+
input(field: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement, options: DocInputOptions): DocInputHandle;
|
|
515
|
+
/**
|
|
516
|
+
* A drag of what `items` finds in `area`, by pointer events: past a threshold, a `marker` where a drop
|
|
517
|
+
* would go (`over`), `drop` on a release over a spot, nothing on Escape or a release elsewhere; the
|
|
518
|
+
* item carries the class `doc-dragging` while it moves.
|
|
519
|
+
*/
|
|
520
|
+
drag<S extends DocDropSpot>(area: HTMLElement, options: DocDragOptions<S>): DocDragHandle;
|
|
521
|
+
/**
|
|
522
|
+
* The kit's menu of choices under `anchor`, a button of the block's own: the card every `<select>` of the
|
|
523
|
+
* page opens (flat, rounded, the chosen row checked, light and dark as the page is; ↑ ↓ Enter, a letter, Esc).
|
|
524
|
+
* Resolves with the value chosen, or null when it is dismissed (Esc, a press outside, `signal`, the anchor
|
|
525
|
+
* leaving the page); called again on the anchor of a menu that is open, it closes it. Never the browser's
|
|
526
|
+
* popup: a `<select>` needs no call (the kit opens this menu for it), and a menu a block draws itself is not
|
|
527
|
+
* to look like the browser's.
|
|
528
|
+
*/
|
|
529
|
+
choose(anchor: Element, options: DocChooseOptions): Promise<string | null>;
|
|
530
|
+
|
|
136
531
|
stats(): DocKitStats;
|
|
137
532
|
/** The keys of the page's bound controls. */
|
|
138
533
|
readonly bindings: unknown;
|
|
139
534
|
/** The selectors of the elements blocks stand in. */
|
|
140
535
|
readonly flows: readonly string[];
|
|
536
|
+
/** The tables of the page a key names, as the kit's charts drawn from a table and the views of one read them: the kit's own (a view reads its table by `context.table()`). */
|
|
537
|
+
readonly tables: unknown;
|
|
141
538
|
}
|
package/sdk/doc-state.d.ts
CHANGED
|
@@ -27,6 +27,8 @@ export interface DocStateOptions<T extends Record<string, unknown>> {
|
|
|
27
27
|
defaults: T;
|
|
28
28
|
/** Overrides the browser storage key; normally left out. */
|
|
29
29
|
storageKey?: string;
|
|
30
|
+
/** A name the state was kept under before (a component's instance before it had a block id): read when nothing is kept under `id`, and carried to it. */
|
|
31
|
+
formerId?: string;
|
|
30
32
|
/** Default: []; excluded from browser restoration and exported snapshots. */
|
|
31
33
|
transientKeys?: Array<keyof T & string>;
|
|
32
34
|
}
|