@heycys/gallery 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-NOTICES.md +2 -2
- package/browser/editor/components/align.mjs +58 -0
- package/browser/editor/components/code/index.mjs +1 -1
- package/browser/editor/components/columns/page.mjs +4 -4
- package/browser/editor/components/embed/index.mjs +2 -2
- package/browser/editor/components/embed/page.mjs +1 -1
- package/browser/editor/components/file/page.mjs +4 -4
- package/browser/editor/components/flowchart/add.mjs +7 -6
- package/browser/editor/components/flowchart/page.mjs +1 -1
- package/browser/editor/components/heading/index.mjs +7 -6
- package/browser/editor/components/icons.mjs +11 -0
- package/browser/editor/components/image/crop.mjs +6 -9
- package/browser/editor/components/image/index.mjs +2 -0
- package/browser/editor/components/image/page.mjs +172 -90
- package/browser/editor/components/installed/index.mjs +15 -4
- package/browser/editor/components/installed/page.mjs +103 -25
- package/browser/editor/components/installed/served.mjs +6 -5
- package/browser/editor/components/instances.mjs +18 -0
- package/browser/editor/components/list/page.mjs +3 -6
- package/browser/editor/components/media/icons.mjs +13 -8
- package/browser/editor/components/media/page.mjs +5 -3
- package/browser/editor/components/media/toolbar.mjs +12 -3
- package/browser/editor/components/paragraph/index.mjs +4 -3
- package/browser/editor/components/registry.mjs +30 -9
- package/browser/editor/components/table/index.mjs +61 -2
- package/browser/editor/components/table/page.mjs +1 -1
- package/browser/editor/page/after/index.mjs +288 -0
- package/browser/editor/page/align.mjs +91 -0
- package/browser/editor/page/annotate/card.mjs +3 -6
- package/browser/editor/page/autosave.mjs +310 -37
- package/browser/editor/page/beside.mjs +5 -6
- package/browser/editor/page/block-menu/index.mjs +6 -3
- package/browser/editor/page/blocks.mjs +3 -1
- package/browser/editor/page/board/client.mjs +57 -0
- package/browser/editor/page/board/hint.mjs +182 -0
- package/browser/editor/page/board/history.mjs +119 -0
- package/browser/editor/page/board/index.mjs +1059 -0
- package/browser/editor/page/board/motion.mjs +177 -0
- package/browser/editor/page/board/settings.mjs +210 -0
- package/browser/editor/page/caret.mjs +1 -1
- package/browser/editor/page/changes/bar.mjs +6 -14
- package/browser/editor/page/changes/index.mjs +2 -2
- package/browser/editor/page/clipboard/import/html.mjs +29 -6
- package/browser/editor/page/clipboard/import/inline.mjs +32 -0
- package/browser/editor/page/clipboard/import/markdown.mjs +58 -13
- package/browser/editor/page/clipboard/import/read.mjs +6 -1
- package/browser/editor/page/clipboard/import/to-blocks.mjs +44 -12
- package/browser/editor/page/clipboard/import/yuque.mjs +622 -0
- package/browser/editor/page/clipboard/index.mjs +133 -15
- package/browser/editor/page/clipboard/own/blocks.mjs +13 -14
- package/browser/editor/page/clipboard/own/chart-keys.mjs +41 -28
- package/browser/editor/page/clipboard/own/describe.mjs +6 -2
- package/browser/editor/page/clipboard/own/selection.mjs +1 -1
- package/browser/editor/page/columns/index.mjs +48 -46
- package/browser/editor/page/commit.mjs +80 -22
- package/browser/editor/page/conflicts.mjs +7 -7
- package/browser/editor/page/core.mjs +34 -16
- package/browser/editor/page/custom-page.mjs +110 -0
- package/browser/editor/page/editor.mjs +71 -17
- package/browser/editor/page/emoji-picker/styles.mjs +7 -12
- package/browser/editor/page/emoji-picker/upload.mjs +2 -2
- package/browser/editor/page/handle/index.mjs +5 -8
- package/browser/editor/page/history.mjs +41 -6
- package/browser/editor/page/insert/index.mjs +20 -22
- package/browser/editor/page/links/index.mjs +5 -3
- package/browser/editor/page/links/pages.mjs +27 -9
- package/browser/editor/page/look.mjs +54 -3
- package/browser/editor/page/margin.mjs +18 -3
- package/browser/editor/page/media-menu/index.mjs +6 -7
- package/browser/editor/page/menu.mjs +33 -14
- package/browser/editor/page/notices.mjs +2 -2
- package/browser/editor/page/page-objects.mjs +9 -2
- package/browser/editor/page/panel.mjs +4 -9
- package/browser/editor/page/present-links.mjs +15 -5
- package/browser/editor/page/present-shell.mjs +63 -0
- package/browser/editor/page/resize/index.mjs +42 -29
- package/browser/editor/page/selection/index.mjs +10 -2
- package/browser/editor/page/served.mjs +14 -0
- package/browser/editor/page/session.mjs +48 -4
- package/browser/editor/page/slash-menu/index.mjs +3 -3
- package/browser/editor/page/table/binding.mjs +87 -0
- package/browser/editor/page/table/cells.mjs +102 -46
- package/browser/editor/page/table/index.mjs +24 -9
- package/browser/editor/page/table/pictures.mjs +299 -0
- package/browser/editor/page/table/views.mjs +103 -0
- package/browser/editor/page/table/widths.mjs +82 -10
- package/browser/editor/page/text-select/index.mjs +26 -12
- package/browser/editor/page/todo-writes.mjs +75 -0
- package/browser/editor/page/typing/index.mjs +97 -15
- package/browser/editor/page/typing/leave.mjs +19 -5
- package/browser/editor/page/ui.mjs +13 -0
- package/browser/shared/block-packs.mjs +419 -0
- package/browser/shared/board-places.mjs +224 -0
- package/browser/shared/card-size.mjs +59 -0
- package/browser/shared/colors.mjs +3 -2
- package/browser/shared/component-catalog.mjs +330 -46
- package/browser/shared/component-source.mjs +39 -0
- package/browser/shared/components/heading.mjs +2 -1
- package/browser/shared/components/index.mjs +12 -3
- package/browser/shared/components/installed.mjs +35 -3
- package/browser/shared/components/page.mjs +20 -8
- package/browser/shared/components/paragraph.mjs +8 -1
- package/browser/shared/components/state.mjs +5 -1
- package/browser/shared/components/table.mjs +1 -0
- package/browser/shared/document-look.mjs +10 -5
- package/browser/shared/drafts.mjs +432 -0
- package/browser/shared/emoji/line-icons.mjs +37 -0
- package/browser/shared/extension-sidebar.mjs +126 -0
- package/browser/shared/extensions.mjs +79 -0
- package/browser/shared/file-table.mjs +101 -0
- package/browser/shared/http.mjs +9 -0
- package/browser/shared/i18n/en.mjs +330 -27
- package/browser/shared/json-layout.mjs +47 -0
- package/browser/shared/net-cache.mjs +133 -0
- package/browser/shared/net-keys.mjs +32 -0
- package/browser/shared/net-policy.mjs +177 -0
- package/browser/shared/outline-shape.mjs +128 -0
- package/browser/shared/outline.mjs +359 -67
- package/browser/shared/pack-manifest.mjs +88 -0
- package/browser/shared/page-address.mjs +6 -3
- package/browser/shared/page-cards.mjs +308 -0
- package/browser/shared/page-links.mjs +69 -6
- package/browser/shared/pages.mjs +500 -0
- package/browser/shared/paths.mjs +6 -0
- package/browser/shared/pinyin.mjs +92 -0
- package/browser/shared/present-step.mjs +17 -0
- package/browser/shared/preview-server.mjs +3 -7
- package/browser/shared/session.mjs +8 -1
- package/browser/shared/shipped-blocks.mjs +299 -0
- package/browser/shared/sidebar-head.mjs +70 -0
- package/browser/shared/table-chart.mjs +33 -1
- package/browser/shared/todos.mjs +83 -0
- package/browser/shared/user-directory.mjs +24 -0
- package/browser/shared/versions.mjs +14 -0
- package/browser/shared/web-links.mjs +139 -0
- package/browser/shared/workspace-columns.mjs +120 -0
- package/browser/shared/workspace-name.mjs +154 -0
- package/browser/shared/workspace-query.mjs +125 -0
- package/browser/shared/workspace-registry.mjs +272 -0
- package/browser/shared/workspace.mjs +171 -20
- package/dist/chunk-2OHANJ6Q.mjs +2 -0
- package/dist/chunk-3MBRL2PM.mjs +16 -0
- package/dist/chunk-4OKWZY5E.mjs +2 -0
- package/dist/chunk-4OZWXZE5.mjs +5 -0
- package/dist/chunk-5K44HLTZ.mjs +2 -0
- package/dist/{chunk-5ZKJ3H4P.mjs → chunk-5XA2ZBAE.mjs} +3 -3
- package/dist/{chunk-4FS7Z7WR.mjs → chunk-67N2QJYT.mjs} +1 -1
- package/dist/chunk-6KBYRA2C.mjs +2 -0
- package/dist/chunk-6N3PX4XX.mjs +8 -0
- package/dist/{chunk-V5JTW2LH.mjs → chunk-6QBHU4DF.mjs} +1 -1
- package/dist/chunk-7JDX4E65.mjs +13 -0
- package/dist/chunk-7M2BQQGZ.mjs +2 -0
- package/dist/chunk-7OG26PGF.mjs +2 -0
- package/dist/chunk-AHN3NFKJ.mjs +3 -0
- package/dist/chunk-ALZ6ZENZ.mjs +3 -0
- package/dist/chunk-AR5D57ZD.mjs +170 -0
- package/dist/{chunk-W3BGBJQW.mjs → chunk-BFJGHSQN.mjs} +1 -1
- package/dist/{chunk-LS4F7JUM.mjs → chunk-BZ5RAF7L.mjs} +1 -1
- package/dist/chunk-CMA72MAG.mjs +2 -0
- package/dist/{chunk-LCTHTZIL.mjs → chunk-DAZL73VK.mjs} +91 -91
- package/dist/{chunk-Y6RLRPG3.mjs → chunk-DJISHPUL.mjs} +1 -1
- package/dist/chunk-DR73Y2UJ.mjs +3 -0
- package/dist/{chunk-FDLXYYG4.mjs → chunk-EAIFITAV.mjs} +1 -1
- package/dist/{chunk-TMYZB6AV.mjs → chunk-EKNHM3P4.mjs} +1 -1
- package/dist/chunk-EP25HDAJ.mjs +2 -0
- package/dist/{chunk-GB5SOYQJ.mjs → chunk-ERLAIBOA.mjs} +2 -2
- package/dist/chunk-EURLTOTZ.mjs +4 -0
- package/dist/chunk-F4ZA6JRZ.mjs +3 -0
- package/dist/chunk-F6HVDZR4.mjs +2 -0
- package/dist/chunk-FDMAXMQA.mjs +2 -0
- package/dist/chunk-FETSREUN.mjs +5 -0
- package/dist/chunk-GHOYKMQ3.mjs +4 -0
- package/dist/{chunk-2B5E4CDJ.mjs → chunk-GPIWQ4X4.mjs} +1 -1
- package/dist/chunk-HDWTZ763.mjs +12 -0
- package/dist/chunk-HPOI4ZX7.mjs +6 -0
- package/dist/{chunk-BGGDRNYQ.mjs → chunk-HXG7EOPJ.mjs} +1 -1
- package/dist/chunk-IA4PSIMD.mjs +2 -0
- package/dist/{chunk-E7LWZRXY.mjs → chunk-ITOH5EGO.mjs} +1 -1
- package/dist/chunk-IV64FFI4.mjs +2 -0
- package/dist/chunk-J43Z6LSS.mjs +2 -0
- package/dist/chunk-J5PUIV3Y.mjs +4 -0
- package/dist/chunk-JA7G53PC.mjs +2 -0
- package/dist/chunk-JEUK3ZO7.mjs +2 -0
- package/dist/chunk-JLTZF4LA.mjs +2 -0
- package/dist/chunk-JZT7I2OJ.mjs +2 -0
- package/dist/chunk-K5XATEOO.mjs +2 -0
- package/dist/chunk-L2SUIS5S.mjs +2 -0
- package/dist/chunk-L7UP52JO.mjs +2 -0
- package/dist/chunk-LM4XFQHZ.mjs +2 -0
- package/dist/chunk-MN7BZL4R.mjs +2 -0
- package/dist/chunk-MTYYHM2G.mjs +15 -0
- package/dist/chunk-MXUBKDRO.mjs +15 -0
- package/dist/chunk-NAMN3RAF.mjs +2 -0
- package/dist/{chunk-SYGN7GLU.mjs → chunk-OEXWRJME.mjs} +1 -1
- package/dist/chunk-OFHXGWOX.mjs +2 -0
- package/dist/chunk-ORID3AE7.mjs +166 -0
- package/dist/chunk-PAREWQGB.mjs +4 -0
- package/dist/chunk-PGDE24N5.mjs +2 -0
- package/dist/chunk-POTA2FV4.mjs +2 -0
- package/dist/chunk-PUOQ65NC.mjs +2 -0
- package/dist/chunk-Q4UEPUWF.mjs +2 -0
- package/dist/chunk-QE5RG76S.mjs +549 -0
- package/dist/chunk-R2ZDLJYT.mjs +10 -0
- package/dist/{chunk-7DTINW6U.mjs → chunk-SQ6Y2ZMA.mjs} +2 -2
- package/dist/chunk-SWUTTZCN.mjs +2 -0
- package/dist/chunk-TANZRINB.mjs +2 -0
- package/dist/chunk-TR7TWGHB.mjs +2 -0
- package/dist/chunk-U5XL7D6A.mjs +3 -0
- package/dist/{chunk-XNROSH2T.mjs → chunk-U7NZI6N4.mjs} +2 -2
- package/dist/chunk-UGWMMEJ5.mjs +15 -0
- package/dist/chunk-UJQJKNGK.mjs +2 -0
- package/dist/chunk-UYVCQK3H.mjs +22 -0
- package/dist/chunk-VFX2KNHP.mjs +4 -0
- package/dist/chunk-VS7JIGJW.mjs +24 -0
- package/dist/chunk-W7665ZEC.mjs +6 -0
- package/dist/chunk-WQDQWCX5.mjs +2 -0
- package/dist/chunk-YI43RG4P.mjs +2 -0
- package/dist/chunk-YLPSMDIS.mjs +5 -0
- package/dist/chunk-YNAWBAYN.mjs +3 -0
- package/dist/chunk-YROX2O22.mjs +2 -0
- package/dist/chunk-ZDLPUOAG.mjs +6 -0
- package/dist/{chunk-IVDLMMBD.mjs → chunk-ZHEHPMBK.mjs} +1 -1
- package/dist/chunk-ZQS6H473.mjs +16 -0
- package/dist/chunk-ZTHICSSF.mjs +2 -0
- package/dist/chunk-ZWWC4KLF.mjs +20 -0
- package/dist/cli.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/{chunk-U6KNPJPR.mjs → update-fetch.mjs} +1 -1
- package/dist/worker.mjs +1 -1
- package/kit/board.css +95 -0
- package/kit/board.js +250 -0
- package/kit/charts.js +5 -71
- package/kit/code.js +17 -17
- package/kit/report.css +335 -18
- package/kit/runtime.js +1638 -125
- package/kit/state.js +10 -1
- package/kit/tables.js +130 -43
- package/kit/ui.js +79 -35
- package/package.json +2 -1
- package/packs/gallery/card/component.json +14 -0
- package/packs/gallery/card/example.html +10 -0
- package/packs/gallery/card/preview.svg +1 -0
- package/packs/gallery/card/style.css +6 -0
- package/packs/gallery/card/template.html +6 -0
- package/packs/gallery/card/writing.md +14 -0
- package/packs/gallery/chart-card/component.json +15 -0
- package/packs/gallery/chart-card/example.html +14 -0
- package/packs/gallery/chart-card/kit.js +130 -0
- package/packs/gallery/chart-card/preview.svg +1 -0
- package/packs/gallery/chart-card/style.css +42 -0
- package/packs/gallery/chart-card/template.html +13 -0
- package/packs/gallery/chart-card/writing.md +20 -0
- package/packs/gallery/chart-view/component.json +20 -0
- package/packs/gallery/chart-view/example.html +13 -0
- package/packs/gallery/chart-view/kit.js +355 -0
- package/packs/gallery/chart-view/preview.svg +1 -0
- package/packs/gallery/chart-view/style.css +94 -0
- package/packs/gallery/chart-view/template.html +3 -0
- package/packs/gallery/chart-view/writing.md +22 -0
- package/packs/gallery/countdown/component.json +18 -0
- package/packs/gallery/countdown/example.html +3 -0
- package/packs/gallery/countdown/kit.js +216 -0
- package/packs/gallery/countdown/preview.svg +1 -0
- package/packs/gallery/countdown/style.css +118 -0
- package/packs/gallery/countdown/template.html +3 -0
- package/packs/gallery/countdown/writing.md +22 -0
- package/packs/gallery/habit/component.json +14 -0
- package/packs/gallery/habit/example.html +3 -0
- package/packs/gallery/habit/kit.js +334 -0
- package/packs/gallery/habit/preview.svg +1 -0
- package/packs/gallery/habit/style.css +174 -0
- package/packs/gallery/habit/template.html +3 -0
- package/packs/gallery/habit/writing.md +21 -0
- package/packs/gallery/heatmap/component.json +18 -0
- package/packs/gallery/heatmap/example.html +3 -0
- package/packs/gallery/heatmap/kit.js +513 -0
- package/packs/gallery/heatmap/preview.svg +1 -0
- package/packs/gallery/heatmap/style.css +189 -0
- package/packs/gallery/heatmap/template.html +3 -0
- package/packs/gallery/heatmap/writing.md +21 -0
- package/packs/gallery/kanban/component.json +18 -0
- package/packs/gallery/kanban/example.html +12 -0
- package/packs/gallery/kanban/kit.js +540 -0
- package/packs/gallery/kanban/preview.svg +1 -0
- package/packs/gallery/kanban/style.css +212 -0
- package/packs/gallery/kanban/template.html +3 -0
- package/packs/gallery/kanban/writing.md +20 -0
- package/packs/gallery/metric/component.json +22 -0
- package/packs/gallery/metric/example.html +15 -0
- package/packs/gallery/metric/kit.js +248 -0
- package/packs/gallery/metric/preview.svg +1 -0
- package/packs/gallery/metric/style.css +92 -0
- package/packs/gallery/metric/template.html +3 -0
- package/packs/gallery/metric/writing.md +23 -0
- package/packs/gallery/note/component.json +14 -0
- package/packs/gallery/note/example.html +3 -0
- package/packs/gallery/note/kit.js +129 -0
- package/packs/gallery/note/preview.svg +1 -0
- package/packs/gallery/note/style.css +97 -0
- package/packs/gallery/note/template.html +3 -0
- package/packs/gallery/note/writing.md +18 -0
- package/packs/gallery/pack.json +8 -0
- package/packs/gallery/recent/component.json +13 -0
- package/packs/gallery/recent/example.html +1 -0
- package/packs/gallery/recent/kit.js +293 -0
- package/packs/gallery/recent/preview.svg +1 -0
- package/packs/gallery/recent/style.css +85 -0
- package/packs/gallery/recent/template.html +1 -0
- package/packs/gallery/recent/writing.md +15 -0
- package/packs/gallery/static/component.json +13 -0
- package/packs/gallery/static/example.html +11 -0
- package/packs/gallery/static/preview.svg +1 -0
- package/packs/gallery/static/style.css +171 -0
- package/packs/gallery/static/template.html +1 -0
- package/packs/gallery/static/writing.md +18 -0
- package/packs/gallery/stats/component.json +13 -0
- package/packs/gallery/stats/example.html +1 -0
- package/packs/gallery/stats/kit.js +347 -0
- package/packs/gallery/stats/preview.svg +1 -0
- package/packs/gallery/stats/style.css +73 -0
- package/packs/gallery/stats/template.html +1 -0
- package/packs/gallery/stats/writing.md +11 -0
- package/packs/gallery/today/component.json +12 -0
- package/packs/gallery/today/example.html +1 -0
- package/packs/gallery/today/kit.js +220 -0
- package/packs/gallery/today/preview.svg +1 -0
- package/packs/gallery/today/style.css +149 -0
- package/packs/gallery/today/template.html +1 -0
- package/packs/gallery/today/writing.md +14 -0
- package/packs/gallery/todos/component.json +19 -0
- package/packs/gallery/todos/example.html +3 -0
- package/packs/gallery/todos/kit.js +489 -0
- package/packs/gallery/todos/preview.svg +1 -0
- package/packs/gallery/todos/style.css +214 -0
- package/packs/gallery/todos/template.html +3 -0
- package/packs/gallery/todos/writing.md +30 -0
- package/packs/gallery/weather/component.json +19 -0
- package/packs/gallery/weather/example.html +3 -0
- package/packs/gallery/weather/kit.js +387 -0
- package/packs/gallery/weather/preview.svg +1 -0
- package/packs/gallery/weather/style.css +140 -0
- package/packs/gallery/weather/template.html +3 -0
- package/packs/gallery/weather/writing.md +26 -0
- package/packs/gallery-soft/countdown/component.json +18 -0
- package/packs/gallery-soft/countdown/example.html +3 -0
- package/packs/gallery-soft/countdown/kit.js +206 -0
- package/packs/gallery-soft/countdown/preview.svg +1 -0
- package/packs/gallery-soft/countdown/style.css +211 -0
- package/packs/gallery-soft/countdown/template.html +3 -0
- package/packs/gallery-soft/countdown/writing.md +24 -0
- package/packs/gallery-soft/habit/component.json +14 -0
- package/packs/gallery-soft/habit/example.html +3 -0
- package/packs/gallery-soft/habit/kit.js +366 -0
- package/packs/gallery-soft/habit/preview.svg +1 -0
- package/packs/gallery-soft/habit/style.css +251 -0
- package/packs/gallery-soft/habit/template.html +3 -0
- package/packs/gallery-soft/habit/writing.md +23 -0
- package/packs/gallery-soft/heatmap/component.json +18 -0
- package/packs/gallery-soft/heatmap/example.html +3 -0
- package/packs/gallery-soft/heatmap/kit.js +498 -0
- package/packs/gallery-soft/heatmap/preview.svg +1 -0
- package/packs/gallery-soft/heatmap/style.css +181 -0
- package/packs/gallery-soft/heatmap/template.html +3 -0
- package/packs/gallery-soft/heatmap/writing.md +23 -0
- package/packs/gallery-soft/note/component.json +14 -0
- package/packs/gallery-soft/note/example.html +3 -0
- package/packs/gallery-soft/note/kit.js +162 -0
- package/packs/gallery-soft/note/preview.svg +1 -0
- package/packs/gallery-soft/note/style.css +148 -0
- package/packs/gallery-soft/note/template.html +3 -0
- package/packs/gallery-soft/note/writing.md +20 -0
- package/packs/gallery-soft/pack.json +8 -0
- package/packs/gallery-soft/recent/component.json +13 -0
- package/packs/gallery-soft/recent/example.html +1 -0
- package/packs/gallery-soft/recent/kit.js +335 -0
- package/packs/gallery-soft/recent/preview.svg +1 -0
- package/packs/gallery-soft/recent/style.css +160 -0
- package/packs/gallery-soft/recent/template.html +1 -0
- package/packs/gallery-soft/recent/writing.md +17 -0
- package/packs/gallery-soft/static/component.json +13 -0
- package/packs/gallery-soft/static/example.html +12 -0
- package/packs/gallery-soft/static/preview.svg +1 -0
- package/packs/gallery-soft/static/style.css +186 -0
- package/packs/gallery-soft/static/template.html +1 -0
- package/packs/gallery-soft/static/writing.md +20 -0
- package/packs/gallery-soft/stats/component.json +13 -0
- package/packs/gallery-soft/stats/example.html +1 -0
- package/packs/gallery-soft/stats/kit.js +341 -0
- package/packs/gallery-soft/stats/preview.svg +1 -0
- package/packs/gallery-soft/stats/style.css +119 -0
- package/packs/gallery-soft/stats/template.html +1 -0
- package/packs/gallery-soft/stats/writing.md +13 -0
- package/packs/gallery-soft/today/component.json +12 -0
- package/packs/gallery-soft/today/example.html +1 -0
- package/packs/gallery-soft/today/kit.js +222 -0
- package/packs/gallery-soft/today/preview.svg +1 -0
- package/packs/gallery-soft/today/style.css +178 -0
- package/packs/gallery-soft/today/template.html +1 -0
- package/packs/gallery-soft/today/writing.md +16 -0
- package/packs/gallery-soft/todos/component.json +19 -0
- package/packs/gallery-soft/todos/example.html +3 -0
- package/packs/gallery-soft/todos/kit.js +527 -0
- package/packs/gallery-soft/todos/preview.svg +1 -0
- package/packs/gallery-soft/todos/style.css +212 -0
- package/packs/gallery-soft/todos/template.html +3 -0
- package/packs/gallery-soft/todos/writing.md +32 -0
- package/packs/gallery-soft/weather/component.json +19 -0
- package/packs/gallery-soft/weather/example.html +3 -0
- package/packs/gallery-soft/weather/kit.js +411 -0
- package/packs/gallery-soft/weather/preview.svg +1 -0
- package/packs/gallery-soft/weather/style.css +185 -0
- package/packs/gallery-soft/weather/template.html +3 -0
- package/packs/gallery-soft/weather/writing.md +28 -0
- package/release.json +12 -10
- package/sdk/doc-kit.d.ts +396 -5
- package/sdk/doc-state.d.ts +2 -0
- package/skill/SKILL.md +56 -23
- package/skill/references/block-script.md +140 -0
- package/skill/references/building-blocks.md +257 -0
- package/skill/references/extensions.md +59 -0
- package/skill/references/pages-and-data.md +225 -0
- package/skill/references/writing-html.md +8 -4
- package/skill/sdk/doc-kit.d.ts +396 -5
- package/skill/sdk/doc-state.d.ts +2 -0
- package/web/assets/index-BM_K-Auu.css +1 -0
- package/web/assets/index-DRslOBiv.js +15 -0
- package/web/index.html +2 -2
- package/dist/chunk-3HIRPVLU.mjs +0 -2
- package/dist/chunk-5MHMDLZD.mjs +0 -4
- package/dist/chunk-64K7IPLO.mjs +0 -255
- package/dist/chunk-6QXGZM36.mjs +0 -8
- package/dist/chunk-6RGJOMJP.mjs +0 -16
- package/dist/chunk-AJ73XJF3.mjs +0 -2
- package/dist/chunk-AUZGSZJH.mjs +0 -13
- package/dist/chunk-BFE45AKL.mjs +0 -2
- package/dist/chunk-BXO2ZY5P.mjs +0 -2
- package/dist/chunk-CEH4MRCC.mjs +0 -2
- package/dist/chunk-CY2FNNAB.mjs +0 -16
- package/dist/chunk-DFUDV4LX.mjs +0 -2
- package/dist/chunk-DKXG4XDG.mjs +0 -2
- package/dist/chunk-EZQ34M3F.mjs +0 -124
- package/dist/chunk-EZY3WC6Z.mjs +0 -15
- package/dist/chunk-FUKQNOQS.mjs +0 -9
- package/dist/chunk-JPOSLGOC.mjs +0 -6
- package/dist/chunk-JVHHHGEA.mjs +0 -3
- package/dist/chunk-L3QKH4OK.mjs +0 -26
- package/dist/chunk-LAE5NQ4B.mjs +0 -2
- package/dist/chunk-LEF6DRCK.mjs +0 -59
- package/dist/chunk-NO5NJCHO.mjs +0 -2
- package/dist/chunk-NQPVAU63.mjs +0 -2
- package/dist/chunk-NSKUTQ5J.mjs +0 -5
- package/dist/chunk-O35FIXRB.mjs +0 -2
- package/dist/chunk-P2CAZPDP.mjs +0 -3
- package/dist/chunk-PL6GHLGD.mjs +0 -15
- package/dist/chunk-QJIR2BLP.mjs +0 -6
- package/dist/chunk-QUPLVPB2.mjs +0 -7
- package/dist/chunk-R7BNENLY.mjs +0 -4
- package/dist/chunk-S6O4UHLC.mjs +0 -2
- package/dist/chunk-SGJWQKEI.mjs +0 -2
- package/dist/chunk-TX6JH7TR.mjs +0 -2
- package/dist/chunk-TYK6VNAB.mjs +0 -10
- package/dist/chunk-UALRNVSE.mjs +0 -4
- package/dist/chunk-V3HXVQEM.mjs +0 -2
- package/dist/chunk-V5VXUJKG.mjs +0 -2
- package/dist/chunk-VBXMADMP.mjs +0 -2
- package/dist/chunk-VNV55RUA.mjs +0 -2
- package/dist/chunk-VPD2PS35.mjs +0 -2
- package/dist/chunk-W4VKN3GF.mjs +0 -7
- package/dist/chunk-W5BXXPDJ.mjs +0 -3
- package/dist/chunk-XUNHRCOG.mjs +0 -6
- package/skill/references/building-components.md +0 -367
- package/web/assets/index-Bh74DfsV.css +0 -1
- package/web/assets/index-UW0RyFFt.js +0 -13
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// What a component that hears `source` hears of attributes (src/render/kit/runtime/kernel.js;
|
|
2
|
+
// docs/render.md "A custom block on a page"): a change of an attribute in a part or a slot that says
|
|
3
|
+
// something of the file, and of a class only where a look class changes, so that what the kit and the
|
|
4
|
+
// editor toggle as they lay the page out is no change of the file's.
|
|
5
|
+
|
|
6
|
+
import { COLOR_NAMES } from "./colors.mjs";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The attributes that say something of the file in a part or a slot, which a component hearing
|
|
10
|
+
* `source` hears change (runtime/kernel.js): a to-do item checked, a cell's spans, what a table's
|
|
11
|
+
* header and cells say of its sort (the table description's data-sort-*, listed one by one, as an
|
|
12
|
+
* observer takes them). A class is one only where a look class changes (lookChanged); `hidden` and
|
|
13
|
+
* `open` are the reader's, which `reveal` tells.
|
|
14
|
+
*/
|
|
15
|
+
export const SOURCE_ATTRIBUTES = ["data-checked", "rowspan", "colspan", "data-sort-status", "data-sort-type", "data-sort-key", "data-sort-default", "data-sort-ignore", "data-sort-value", "data-sort-rank"];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The classes that are a block's or a cell's look, which a reader sets and the file keeps: a text color
|
|
19
|
+
* or a fill (doc-text-<color>, doc-highlight-<color>), a text block's alignment and indent (a table's frame's alignment is the same two classes), a cell's alignments and its bold (table.mjs's
|
|
20
|
+
* CELL_ALIGN_CLASSES, CELL_VALIGN_CLASSES, CELL_BOLD_CLASS, the editor's CELL_LOOKS). What the kit and
|
|
21
|
+
* the editor toggle as they lay a page out (a table's number and doc-table--auto, a code block's
|
|
22
|
+
* folds) is none, so that no component hears its own layout as a change of the file, and draws again
|
|
23
|
+
* for ever.
|
|
24
|
+
*/
|
|
25
|
+
export const LOOK_CLASSES = new Set([
|
|
26
|
+
...COLOR_NAMES.flatMap((name) => [`doc-text-${name}`, `doc-highlight-${name}`]),
|
|
27
|
+
// table.mjs's CELL_ALIGN_CLASSES, CELL_VALIGN_CLASSES and CELL_BOLD_CLASS, written out: an import of that
|
|
28
|
+
// file would bring its description, prose and all, into the kit's runtime (tests/unit/installed.mjs
|
|
29
|
+
// holds the two lists together).
|
|
30
|
+
"doc-align-left", "doc-align-center", "doc-align-right", "doc-valign-top", "doc-valign-middle", "doc-valign-bottom", "doc-bold",
|
|
31
|
+
// A paragraph's or a heading's indent (the editor's components/align.mjs INDENTS; its alignment is a cell's classes above).
|
|
32
|
+
...Array.from({ length: 8 }, (_, index) => `doc-indent-${index + 1}`),
|
|
33
|
+
]);
|
|
34
|
+
|
|
35
|
+
/** Whether a class attribute's look classes (LOOK_CLASSES) differ from `before` to `after`, either null for none. */
|
|
36
|
+
export function lookChanged(before, after) {
|
|
37
|
+
const looks = (value) => [...new Set(String(value ?? "").split(/\s+/).filter((name) => LOOK_CLASSES.has(name)))].sort().join(" ");
|
|
38
|
+
return looks(before) !== looks(after);
|
|
39
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
// A heading, levels 1 to 4 (the fourth body-sized): a basic block.
|
|
1
|
+
// A heading, levels 1 to 4 (the fourth body-sized): a basic block. Aligned and indented as a paragraph
|
|
2
|
+
// is (paragraph.mjs TEXT_ALIGN_CLASSES, described there and by the table).
|
|
2
3
|
export default {
|
|
3
4
|
id: "heading",
|
|
4
5
|
category: "block",
|
|
@@ -137,9 +137,16 @@ export const EVENTS = {
|
|
|
137
137
|
"doc-theme-request": "a workbench asks for a theme (ui.js listens)",
|
|
138
138
|
"doc-look-request": "the document's look is asked of the page (字体与布局: the page's session for the workbench, the preview's live reload for doc.json written again; ui.js puts it on <html>, src/shared/document-look.mjs)",
|
|
139
139
|
"doc-look-change": "the look the page shows changed (ui.js): the page editor's session tells the workbench",
|
|
140
|
-
"doc-layout-change": "a card's size changed where widths do not tell (the editor), or the document's look changed (ui.js)",
|
|
140
|
+
"doc-layout-change": "a card's size changed where widths do not tell (the editor, a custom page's canvas), or the document's look changed (ui.js)",
|
|
141
|
+
"doc-workspace-change": "what the workspace holds changed, the kind its detail (the page's live script, as the server's \"data <kind>\" says it): the kit tells the instances that hear data and read that kind",
|
|
142
|
+
"doc-todo-set": "a block's context.workspace.setTodo asks whoever shows the page to check a to-do of a document (cancelable: a custom page's board or a document's editor cancels it and answers from the workspace's service)",
|
|
143
|
+
"doc-open-request": "a block's context.workspace.open asks to open a document or a custom page (cancelable: the page's session for the workbench answers it, else the kit goes there)",
|
|
141
144
|
"doc-editable": "the page takes what a component writes from now on (the editor)",
|
|
142
145
|
"doc-component-edit": "a component's context.edit asks to write a part: the editor cancels it to say it took the edit, the kit writing no file (on the instance)",
|
|
146
|
+
"doc-table-intent": "a view's context.table() asks to change the table it reads (set a cell, move, add or take out a row), or whether it would take such a change now (canEdit, op check): the editor cancels it to say it made the change (or would), one undo step, the kit writing nothing (on the instance)",
|
|
147
|
+
"doc-settings-changed": "what gallery.json says of the components changed (the page's event stream, its settings line: hidden, disabled, shown, the consents to the net, unlisted and the packs off): the editor's menus follow it, and the kit starts again an instance whose block's consent changed (runtime/net.js)",
|
|
148
|
+
"doc-net-fetch": "a block's context.fetch asks whoever serves the page to fetch for it (runtime/net.js sends it; the server's live script cancels it and answers from its net route)",
|
|
149
|
+
"doc-net-consent": "a block's 允许访问 asks the reader to let it online (runtime/net.js sends it; the page's session cancels it and the workbench opens its consent dialog)",
|
|
143
150
|
"doc-export-copy-done": "导出当前视图副本 finished (ui.js)",
|
|
144
151
|
"doc-table-sort": "a table's sort changed (tables/, on the table)",
|
|
145
152
|
"doc-jump-request": "演示视图 asks the kit to go to a block of its own page, a step of the history (runtime/reveal.js listens, editor/page/present-links.mjs sends)",
|
|
@@ -171,9 +178,11 @@ export const FLOW_BLOCKS = `${FLOWS.join(", ")}, :is(${GROUPING_FLOWS.join(", ")
|
|
|
171
178
|
* What the kit's runtime reads of the descriptions (runtime/kernel.js): where each component's
|
|
172
179
|
* instances are (`match`) and what it leaves on the page (`runtime`), of the components that say
|
|
173
180
|
* either. /kit/runtime.js carries these alone (assets.mjs, `define`), so an export holds no prose.
|
|
174
|
-
* A field the kernel starts reading is added to RUNTIME_FIELDS (tests/unit/runtime.mjs checks it)
|
|
181
|
+
* A field the kernel starts reading is added to RUNTIME_FIELDS (tests/unit/runtime.mjs checks it):
|
|
182
|
+
* `needs`, what a custom block uses (its context.workspace), which only a package describes (no
|
|
183
|
+
* component of the kit has it, so the runtime carries none).
|
|
175
184
|
*/
|
|
176
|
-
export const RUNTIME_FIELDS = ["match", "runtime", "schema"];
|
|
185
|
+
export const RUNTIME_FIELDS = ["match", "runtime", "schema", "needs"];
|
|
177
186
|
export const runtimeDescriptions = (components = COMPONENTS) => components
|
|
178
187
|
.filter((component) => RUNTIME_FIELDS.some((field) => component[field] !== undefined))
|
|
179
188
|
.map((component) => Object.fromEntries([["id", component.id], ...RUNTIME_FIELDS.filter((field) => component[field] !== undefined).map((field) => [field, component[field]])]));
|
|
@@ -50,6 +50,19 @@ export function heldBy(node) {
|
|
|
50
50
|
return owner !== null && edgeAround(edge) === owner ? null : owner;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* The region what an element holds stands in (its children, its words): the instance itself for an
|
|
55
|
+
* instance, the document's (null) inside a slot that opens it again, and otherwise the region the
|
|
56
|
+
* element stands in, as heldBy says it. heldBy for a child the element does not have yet, or has lost:
|
|
57
|
+
* where a change of what it holds happened.
|
|
58
|
+
*/
|
|
59
|
+
export function heldWithin(element) {
|
|
60
|
+
if (!element.matches(REGION)) return heldBy(element);
|
|
61
|
+
const owner = heldBy(element);
|
|
62
|
+
if (element.matches(INSTANCE)) return owner ?? element;
|
|
63
|
+
return owner !== null && edgeAround(element) === owner ? null : owner;
|
|
64
|
+
}
|
|
65
|
+
|
|
53
66
|
/** Whether an element is a slot that opens the document's region again: one of an instance that stands in the document's. */
|
|
54
67
|
const opensDocument = (node) => node.matches(SLOT_PART) && heldBy(node) !== null && edgeAround(node) === heldBy(node);
|
|
55
68
|
|
|
@@ -110,8 +123,24 @@ export const PACKAGE_MARK = "data-doc-package";
|
|
|
110
123
|
*/
|
|
111
124
|
export const ARRIVING = "data-ge-arriving";
|
|
112
125
|
|
|
113
|
-
/**
|
|
114
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Whether the document's insert entries ("/", 在下方新建, the handle's grid) offer the
|
|
128
|
+
* block `id` whose manifest's `places` are those (left out: ["document"]), by gallery.json's lists
|
|
129
|
+
* (`settings`: hidden, shown, disabled, unlisted, packsOff, each left out for none): one that says it stands in a
|
|
130
|
+
* document is offered unless hidden; one that does not, only where shown; one disabled never, as it does
|
|
131
|
+
* not load, nor one unlisted (设置 › 组件列表's master switch off: no menu and no library offers it, what
|
|
132
|
+
* is written of it shows as ever), nor one of a pack switched off (packsOff, the ids of the packs off: the
|
|
133
|
+
* scope of its id; the same as unlisted, for a whole pack). The one rule, which the server and the page
|
|
134
|
+
* both run (notes/plans/custom-blocks-spec-2026-11-07.md section 2, block-packs-plan-2026-11-09.md §1).
|
|
135
|
+
*/
|
|
136
|
+
export function inDocumentMenus(places, settings, id) {
|
|
137
|
+
const { hidden = [], shown = [], disabled = [], unlisted = [], packsOff = [] } = settings ?? {};
|
|
138
|
+
if (disabled.includes(id) || unlisted.includes(id) || packsOff.includes(String(id).split("/")[0])) return false;
|
|
139
|
+
return (places ?? ["document"]).includes("document") ? !hidden.includes(id) : shown.includes(id);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** What gallery.json's lists make of a package that loads, its manifest's `places` with them: "disabled", "hidden" (no document's menu offers it: inDocumentMenus, which a block unlisted is too) or "normal". */
|
|
143
|
+
export const settingState = (id, settings, places) => (settings.disabled.includes(id) ? "disabled" : inDocumentMenus(places, settings, id) ? "normal" : "hidden");
|
|
115
144
|
|
|
116
145
|
/** The class of the kit's note in such an instance, in a preview alone. */
|
|
117
146
|
export const NOTE = "doc-component-note";
|
|
@@ -223,10 +252,13 @@ export default {
|
|
|
223
252
|
"data-doc-component": "the package an instance is of: <scope>/<name>, on a block-level div or section",
|
|
224
253
|
"data-doc-schema": "the shape an instance holds its content in: a whole number its component chooses, read-only past its manifest's schema",
|
|
225
254
|
"data-doc-slot": "a slot of an instance: the part of its manifest edited as flow, by name, on a block-level div or section in the instance's own region; what it holds is the document's blocks",
|
|
255
|
+
"data-doc-from": "on an instance of a custom block whose needs hold tables: the key of the table it is a view of, which the table's frame carries as data-doc-chart-source",
|
|
226
256
|
},
|
|
227
257
|
runtime: {
|
|
228
258
|
generated: [".doc-component-note", ".doc-component-data"],
|
|
229
259
|
attrs: { "[data-doc-fallback]": ["data-doc-fallback"], "[data-doc-fallback-control]": ["data-doc-fallback-control", "inert"] },
|
|
230
|
-
|
|
260
|
+
// Of what the kit drew of a script of data: a line saying what it left out, and its marks; and the mark
|
|
261
|
+
// DocKit.drag (runtime/gestures.js) puts on what a component draws while it is dragged, a class.
|
|
262
|
+
internal: [PACKAGE_MARK, "doc-component-more", DATA_ONE, DATA_LINE, DATA_SHORT, "doc-dragging"],
|
|
231
263
|
},
|
|
232
264
|
};
|
|
@@ -15,10 +15,12 @@ export function pageLanguage(html) {
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* A document's look on its <html> (字体与布局: its doc.json's look, which the render puts on and the kit's
|
|
18
|
-
* tokens read; src/shared/document-look.mjs), the attribute of each choice. The
|
|
19
|
-
* data-doc-measure (a column's measure, its line length)
|
|
18
|
+
* tokens read; src/shared/document-look.mjs), the attribute of each choice. The 正文宽度's is
|
|
19
|
+
* data-doc-measure (a column's measure, its line length); 全宽 (the top bar's 更多, under 目录) is
|
|
20
|
+
* data-doc-width="full", the one attribute the kit's page, the editor's room and the display menu's
|
|
21
|
+
* 全宽显示 (the reader's own switch in an export) all read: one way to be wide, not two.
|
|
20
22
|
*/
|
|
21
|
-
export const LOOK_ATTRIBUTES = Object.freeze({ font: "data-doc-font", size: "data-doc-size", spacing: "data-doc-spacing", width: "data-doc-measure" });
|
|
23
|
+
export const LOOK_ATTRIBUTES = Object.freeze({ font: "data-doc-font", size: "data-doc-size", spacing: "data-doc-spacing", width: "data-doc-measure", full: "data-doc-width" });
|
|
22
24
|
|
|
23
25
|
export default {
|
|
24
26
|
id: "page",
|
|
@@ -37,10 +39,20 @@ export default {
|
|
|
37
39
|
classes: ["doc-page", "doc-header", "doc-kicker", "doc-title", "doc-button"],
|
|
38
40
|
runtime: {
|
|
39
41
|
generated: [".doc-display", "script[data-doc-state]"],
|
|
40
|
-
|
|
41
|
-
//
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
// data-doc-effective-theme: the theme the page shows now (ui.js), "light" or "dark", which a custom page's own colors go by.
|
|
43
|
+
// data-doc-platform: "mac" on an Apple platform (runtime/index.js sets it as the page opens), the text's color and smoothing go by it; a copy of the view lets it go, its reader's machine judges anew.
|
|
44
|
+
root: { attrs: ["data-doc-ready", "data-doc-drawn", "data-doc-controls", "data-doc-effective-theme", "data-doc-platform"] },
|
|
45
|
+
// The reader's theme (ui.js) and the document's look (字体与布局 and 全宽: its doc.json's, put on by
|
|
46
|
+
// the render, src/shared/document-look.mjs; the reader's own 全宽显示 is the same data-doc-width), which
|
|
47
|
+
// a copy of the view keeps; never written in doc.html.
|
|
48
|
+
state: { html: ["data-doc-theme", ...Object.values(LOOK_ATTRIBUTES)] },
|
|
49
|
+
internal: ["doc-display*", "data-doc-export-copy", "data-theme", "doc-export-id", "doc-reveal", "doc-kit-error", "doc-net-consent*", "data-doc-snapshot",
|
|
50
|
+
// A consent bar on a card under 240px of content (runtime/net.js), its line over its button.
|
|
51
|
+
"data-doc-net-narrow",
|
|
52
|
+
// The time an export's snapshot was made (its data-doc-snapshot tag's: render/net-snapshot.mjs), which context.workspace.query answers as `at`.
|
|
53
|
+
"data-at",
|
|
54
|
+
// A custom page's (no document's: src/render/page-html.mjs, the kit's board/): its cards' cells, the Agent's
|
|
55
|
+
// (data-x, data-y, data-w, data-h), and its boards' columns now (data-columns, board.js's).
|
|
56
|
+
"data-x", "data-y", "data-w", "data-h", "data-columns"],
|
|
45
57
|
},
|
|
46
58
|
};
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
// A paragraph (文本), or small text (小字, p.doc-note): a basic block. Small text may end in a part at
|
|
2
2
|
// the line's right end (span.doc-tab: the page editor's Tab).
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A paragraph's or a heading's alignment and indent (the page editor's 对齐与缩进): centred or at the
|
|
6
|
+
* right (left is neither), moved in by levels of two body characters (styles/flow.css).
|
|
7
|
+
*/
|
|
8
|
+
export const TEXT_ALIGN_CLASSES = ["doc-align-center", "doc-align-right", ...Array.from({ length: 8 }, (_, index) => `doc-indent-${index + 1}`)];
|
|
9
|
+
|
|
3
10
|
export default {
|
|
4
11
|
id: "paragraph",
|
|
5
12
|
category: "block",
|
|
6
13
|
match: "p",
|
|
7
14
|
tail: ".doc-tab", // small text's end part, a span at the line's right end
|
|
8
|
-
classes: ["doc-note", "doc-tab"],
|
|
15
|
+
classes: ["doc-note", "doc-tab", ...TEXT_ALIGN_CLASSES.filter((name) => name.startsWith("doc-indent-"))], // the alignments are the table's (a cell's), the same classes
|
|
9
16
|
};
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
// a key (data-doc-bind), elements shown for a key's value (data-doc-show),
|
|
3
3
|
// keys forgotten when the page is left (data-doc-transient); and the kit's styles of such
|
|
4
4
|
// controls (styles/state.css). A filter (.doc-filter) is one block: its row of buttons and what
|
|
5
|
-
// they filter below it (a list, say), together.
|
|
5
|
+
// they filter below it (a list, say), together. A <select> of any control or block, bound or not, opens
|
|
6
|
+
// the kit's menu of choices (runtime/choice.js, styles/choice.css), never the browser's popup: a card at
|
|
7
|
+
// the end of <body> while it is open, nothing an author writes, which an export of the view leaves out.
|
|
6
8
|
export default {
|
|
7
9
|
id: "state",
|
|
8
10
|
match: "[data-doc-bind], [data-doc-show]",
|
|
@@ -14,7 +16,9 @@ export default {
|
|
|
14
16
|
classes: ["doc-state-fields", "doc-state-field", "doc-state-actions", "doc-filter", "doc-filter-row", "doc-filter-button", "doc-state-list"],
|
|
15
17
|
wholes: ["doc-filter", "doc-filter-row", "doc-state-fields", "doc-state-list"], // the classes above that are a whole block of their own (the others are parts inside one)
|
|
16
18
|
runtime: {
|
|
19
|
+
generated: [".doc-choice"],
|
|
17
20
|
attrs: { "[data-doc-show]": ["hidden"] },
|
|
18
21
|
state: { "button[data-doc-bind]": ["aria-pressed"] },
|
|
22
|
+
internal: ["doc-choice-*"], // the menu's rows, their words, the check and the group headings
|
|
19
23
|
},
|
|
20
24
|
};
|
|
@@ -30,6 +30,7 @@ export default {
|
|
|
30
30
|
"data-number-columns": "off: no column read as numbers (none centered, none sortable by number), on the table or its frame",
|
|
31
31
|
"data-doc-chart-source": "on its frame: the key a chart drawn from it reads it by (data-doc-chart-data on the chart's host)",
|
|
32
32
|
},
|
|
33
|
+
// The frame may be placed centred or at the right (doc-align-center, doc-align-right, a text block's: the page editor's 对齐 ›).
|
|
33
34
|
// A cell may also be given a text color or a fill (doc-text-*, doc-highlight-*: text.mjs), an alignment, a vertical one and bold
|
|
34
35
|
// (doc-bold); a header row's cell's look is doc-bold doc-highlight-gray, as the page editor gives it (a header column's th scope="row" none).
|
|
35
36
|
classes: ["doc-table", "doc-table-wrap", "doc-table-meta", "doc-table--sticky-first", ...CELL_ALIGN_CLASSES, ...CELL_VALIGN_CLASSES, CELL_BOLD_CLASS],
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
// A document's look (
|
|
2
|
-
// view/frame/page-format.js
|
|
3
|
-
// the
|
|
1
|
+
// A document's look (字体与布局 and 全宽, under the workbench's 更多: Notion's page format, notion-lite's
|
|
2
|
+
// view/frame/page-format.js, whose page_full_width is a field of the page as ours is of the document):
|
|
3
|
+
// its font, the size of its text, the spacing of its lines and blocks, the width of its reading column
|
|
4
|
+
// and whether it is shown at the full width of the page whatever that is (全宽). The document's own, as
|
|
5
|
+
// Notion keeps it on the page: `look` in its
|
|
4
6
|
// doc.json (report.json in a document made before Gallery 0.1), over the workspace's default look,
|
|
5
7
|
// `look` in its gallery.json (which the card's 应用到全部文档 writes, every document's own taken away:
|
|
6
8
|
// ./workspace-look.mjs), choice by choice (effectiveLook). The workspace's keeps each choice that is
|
|
7
9
|
// not the default, the field gone when none is; a doc.json each choice that is not the workspace's,
|
|
8
10
|
// the field gone when none is:
|
|
9
11
|
//
|
|
10
|
-
// "look": { "font": "serif" | "mixed", "size": "small" | "large", "spacing": "compact" | "loose", "width": "narrow" | "wide" }
|
|
12
|
+
// "look": { "font": "serif" | "mixed", "size": "small" | "large", "spacing": "compact" | "loose", "width": "narrow" | "wide", "full": "full" }
|
|
11
13
|
//
|
|
12
14
|
// A doc.json may say a default too ("font": "sans", "size": "default"…): 默认 chosen on a page while
|
|
13
15
|
// the workspace's default says otherwise. The look a document shows is never written in doc.html: the
|
|
@@ -26,6 +28,9 @@ export const LOOK = Object.freeze({
|
|
|
26
28
|
size: Object.freeze(["default", "small", "large"]), // 字体大小: 小号, 默认, 大号
|
|
27
29
|
spacing: Object.freeze(["default", "compact", "loose"]), // 正文间距: 紧凑, 默认, 宽松
|
|
28
30
|
width: Object.freeze(["default", "narrow", "wide"]), // 正文宽度: 偏窄, 默认, 偏宽
|
|
31
|
+
// 全宽 (the 更多 menu's switch under 目录): the page at the full width of its area, whatever its 正文宽度 is; its attribute is
|
|
32
|
+
// the kit's own data-doc-width="full", the reader's display menu's 全宽显示 too (components/page.mjs LOOK_ATTRIBUTES)
|
|
33
|
+
full: Object.freeze(["default", "full"]),
|
|
29
34
|
});
|
|
30
35
|
|
|
31
36
|
/** The attribute each choice is on <html> by: the page's description says them (components/page.mjs). */
|
|
@@ -80,7 +85,7 @@ export function lookOf(value) {
|
|
|
80
85
|
return look;
|
|
81
86
|
}
|
|
82
87
|
|
|
83
|
-
/** Each choice of a look, the default where it makes none: { font, size, spacing, width }. */
|
|
88
|
+
/** Each choice of a look, the default where it makes none: { font, size, spacing, width, full }. */
|
|
84
89
|
export const fullLook = (value) => ({ ...Object.fromEntries(Object.entries(LOOK).map(([key, [first]]) => [key, first])), ...lookOf(value) });
|
|
85
90
|
|
|
86
91
|
/** Whether two looks are the same. */
|