@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,224 @@
|
|
|
1
|
+
// Where the cards of a custom page's board go (notes/plans/custom-blocks-spec-2026-11-07.md §6, §8;
|
|
2
|
+
// docs/render.md "A custom page"): the one set of rules every side places a card by, so that what the
|
|
3
|
+
// page shows while a card is dragged, what the page service writes and what gallery page add writes
|
|
4
|
+
// are the same. The page service (src/editor/page-service.mjs) and gallery page add place and push
|
|
5
|
+
// cards in the file by them; the kit's board script (src/render/kit/board/) draws a board by them,
|
|
6
|
+
// cards of `fit: "content"` as high as what they hold, those under them pushed down; the page's board
|
|
7
|
+
// editing (src/editor/page/board/) shows a drag's spot and the cards it pushes by them before it asks
|
|
8
|
+
// the service. Pure: no DOM, no Node.
|
|
9
|
+
//
|
|
10
|
+
// A card is { id, x, y, w, h } in whole cells of a board 12 columns wide, at most 24 cells high: what the
|
|
11
|
+
// file says, wherever it is drawn. A cell's side is fixed (CELL), as a document's reading width is, so a
|
|
12
|
+
// board is as wide whatever the window (the workbench's sidebar open or folded); where the room holds
|
|
13
|
+
// fewer than twelve of them the board is drawn in as many as it holds (gridFor), 4 at the least, its
|
|
14
|
+
// cards one after another in their order (flow), as wide as they are, which nothing writes: nothing is
|
|
15
|
+
// placed there. Nothing here ever moves a card up: a card pushed down stays where it was pushed, the room
|
|
16
|
+
// it left a room on the board, as on a board things are pinned to.
|
|
17
|
+
|
|
18
|
+
/** The cells of a board's row, and the most a card is high (the manifest's own range, spec §1). */
|
|
19
|
+
export const GRID = Object.freeze({ columns: 12, rows: 24 });
|
|
20
|
+
|
|
21
|
+
/** The pixels between two cells. */
|
|
22
|
+
export const GAP = 16;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A cell's side in pixels, the same however wide the window (the user's word of 2026-11-09: the cards no
|
|
26
|
+
* larger with the sidebar folded, only further in): twelve of them and their gaps are 944px, which the
|
|
27
|
+
* workbench's content holds on a 1280px laptop with the sidebar open at its default width.
|
|
28
|
+
*/
|
|
29
|
+
export const CELL = 64;
|
|
30
|
+
|
|
31
|
+
/** The fewest columns a board is drawn in: where not even these fit their cells are drawn smaller (a phone). */
|
|
32
|
+
export const LEAST = 4;
|
|
33
|
+
|
|
34
|
+
/** The pixels `n` cells take on a board whose cell is `cell` pixels (n cells and the n - 1 gaps between them). */
|
|
35
|
+
export const spanOf = (n, cell, gap = GAP) => n * cell + Math.max(0, n - 1) * gap;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A board drawn in `room` pixels: { columns, cell, width }, as many whole cells of CELL, GAP apart, as
|
|
39
|
+
* the room holds, from LEAST to 12; where not even LEAST fit, LEAST cells as large as the room lets
|
|
40
|
+
* them be. `width` is what its columns take (the board stands them in its middle).
|
|
41
|
+
*/
|
|
42
|
+
export function gridFor(room) {
|
|
43
|
+
const fit = Math.floor((Math.max(0, room) + GAP) / (CELL + GAP));
|
|
44
|
+
const columns = Math.max(LEAST, Math.min(GRID.columns, fit));
|
|
45
|
+
const cell = fit >= LEAST ? CELL : Math.max(0, (room - (LEAST - 1) * GAP) / LEAST);
|
|
46
|
+
return { columns, cell, width: spanOf(columns, cell) };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const whole = (value, fallback) => (Number.isInteger(value) ? value : fallback);
|
|
50
|
+
|
|
51
|
+
/** Whether cards `a` and `b` share a cell. */
|
|
52
|
+
export const overlaps = (a, b) => a.x < b.x + b.w && b.x < a.x + a.w && a.y < b.y + b.h && b.y < a.y + a.h;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Cells `{ x, y, w, h }` held to a board of `columns`: 1 <= w <= columns, 1 <= h <= 24, 0 <= x <=
|
|
56
|
+
* columns - w, 0 <= y; what is no whole number the default, a 4 x 2 card at 0, 0.
|
|
57
|
+
*/
|
|
58
|
+
export function onBoard({ x, y, w, h }, columns = GRID.columns) {
|
|
59
|
+
const width = Math.min(columns, Math.max(1, whole(w, 4)));
|
|
60
|
+
const height = Math.min(GRID.rows, Math.max(1, whole(h, 2)));
|
|
61
|
+
return { x: Math.min(columns - width, Math.max(0, whole(x, 0))), y: Math.max(0, whole(y, 0)), w: width, h: height };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The cards of a board with none sharing a cell, none moved up: `fixed` (ids) stay where they are,
|
|
66
|
+
* and every other card, in the order of its place (top to bottom, left to right, then as given), goes
|
|
67
|
+
* down until it shares no cell with one placed before it, right under the one it met. What the file
|
|
68
|
+
* says of a board that shares no cell is what this gives back. Returns new cards, in the order given.
|
|
69
|
+
* @template {{ id: string, x: number, y: number, w: number, h: number }} Card
|
|
70
|
+
* @param {Card[]} cards
|
|
71
|
+
* @param {Iterable<string>} fixed
|
|
72
|
+
* @returns {Card[]}
|
|
73
|
+
*/
|
|
74
|
+
export function settle(cards, fixed = []) {
|
|
75
|
+
const kept = new Set(fixed);
|
|
76
|
+
const placed = cards.filter((card) => kept.has(card.id)).map((card) => ({ ...card }));
|
|
77
|
+
const rest = cards.map((card, index) => ({ card, index })).filter(({ card }) => !kept.has(card.id))
|
|
78
|
+
.sort((a, b) => a.card.y - b.card.y || a.card.x - b.card.x || a.index - b.index);
|
|
79
|
+
for (const { card } of rest) {
|
|
80
|
+
const going = { ...card };
|
|
81
|
+
for (let met = placed.filter((other) => overlaps(going, other)); met.length > 0; met = placed.filter((other) => overlaps(going, other))) {
|
|
82
|
+
going.y = Math.max(...met.map((other) => other.y + other.h));
|
|
83
|
+
}
|
|
84
|
+
placed.push(going);
|
|
85
|
+
}
|
|
86
|
+
const at = new Map(placed.map((card) => [card.id, card]));
|
|
87
|
+
return cards.map((card) => at.get(card.id));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The cards with card `moved.id` at `moved`'s cells (held to the board), and those it now shares a cell
|
|
92
|
+
* with pushed down under it, and so on (settle): what a drop, a resize and a card put on a board at a
|
|
93
|
+
* place of its own do. A card of no id there joins them (a card added).
|
|
94
|
+
*/
|
|
95
|
+
export function pushDown(cards, moved, columns = GRID.columns) {
|
|
96
|
+
const cells = onBoard(moved, columns);
|
|
97
|
+
const next = cards.some((card) => card.id === moved.id)
|
|
98
|
+
? cards.map((card) => (card.id === moved.id ? { ...card, ...cells } : card))
|
|
99
|
+
: [...cards, { ...moved, ...cells }];
|
|
100
|
+
return settle(next, [moved.id]);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The first place a card of `w` x `h` cells takes on a board holding `cards`, reading the board as a
|
|
105
|
+
* page is read: the topmost row it fits in, and there the leftmost column, sharing a cell with none.
|
|
106
|
+
* @returns {{ x: number, y: number }}
|
|
107
|
+
*/
|
|
108
|
+
export function freeSpot(cards, { w, h }, columns = GRID.columns) {
|
|
109
|
+
const { w: width, h: height } = onBoard({ x: 0, y: 0, w, h }, columns);
|
|
110
|
+
const bottom = cards.reduce((most, card) => Math.max(most, card.y + card.h), 0);
|
|
111
|
+
for (let y = 0; y <= bottom; y++) {
|
|
112
|
+
for (let x = 0; x + width <= columns; x++) {
|
|
113
|
+
if (!cards.some((card) => overlaps({ x, y, w: width, h: height }, card))) return { x, y };
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return { x: 0, y: bottom };
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The size a card of a block takes when it is put on a board (the manifest's `card`, as the catalog
|
|
121
|
+
* reads it: component-catalog.mjs cardOf): the first of its `sizes`, else its `w` and `h`; `h` null
|
|
122
|
+
* where the manifest says none, the fewest whole cells its content takes, which only the page measures
|
|
123
|
+
* (`measured`: 2 until then).
|
|
124
|
+
* @param {{ sizes?: number[][] | null, w?: number, h?: number | null } | null | undefined} card
|
|
125
|
+
* @returns {{ w: number, h: number, measured: boolean }}
|
|
126
|
+
*/
|
|
127
|
+
export function defaultSize(card) {
|
|
128
|
+
if (card?.sizes?.length) return { w: card.sizes[0][0], h: card.sizes[0][1], measured: false };
|
|
129
|
+
return { w: card?.w ?? 4, h: card?.h ?? 2, measured: card?.h === null || card?.h === undefined };
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** Of `sizes` ([w, h] each), the nearest to `w` x `h` (by the distance of their corners; the first of two as near). */
|
|
133
|
+
export function nearestSize(sizes, { w, h }) {
|
|
134
|
+
let best = sizes[0];
|
|
135
|
+
let far = Infinity;
|
|
136
|
+
for (const size of sizes) {
|
|
137
|
+
const distance = (size[0] - w) ** 2 + (size[1] - h) ** 2;
|
|
138
|
+
if (distance < far) {
|
|
139
|
+
far = distance;
|
|
140
|
+
best = size;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return { w: best[0], h: best[1] };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* What a card of a block may be resized to, for `w` x `h` asked: the nearest of the manifest's `sizes`
|
|
148
|
+
* where it lists them (unless `any`: a manifest that wrote a min or a max beside them frees the card,
|
|
149
|
+
* its sizes only the common ones its menu lists), else whole cells between its `min` and `max`
|
|
150
|
+
* (1 x 1 and 12 x 24 where it says none), never past the board.
|
|
151
|
+
*/
|
|
152
|
+
export function sizeFor(card, { w, h }, columns = GRID.columns) {
|
|
153
|
+
if (card?.sizes?.length && !card.any) {
|
|
154
|
+
const near = nearestSize(card.sizes, { w, h });
|
|
155
|
+
return { w: Math.min(columns, near.w), h: near.h };
|
|
156
|
+
}
|
|
157
|
+
const min = { w: card?.min?.w ?? 1, h: card?.min?.h ?? 1 };
|
|
158
|
+
const max = { w: Math.min(columns, card?.max?.w ?? GRID.columns), h: Math.min(GRID.rows, card?.max?.h ?? GRID.rows) };
|
|
159
|
+
return { w: Math.min(max.w, Math.max(min.w, Math.round(w))), h: Math.min(max.h, Math.max(min.h, Math.round(h))) };
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The cells high a card of `fit: "content"` is drawn, for its content `height` in pixels (what it
|
|
164
|
+
* needs, its frame and padding with it) on a board whose cell is `cell` pixels: the spec's
|
|
165
|
+
* ceil((height + 16) / (cell + 16)), 1 at least and 24 at most.
|
|
166
|
+
*/
|
|
167
|
+
export function fitHeight(height, cell, gap = GAP) {
|
|
168
|
+
if (!(cell > 0)) return 1;
|
|
169
|
+
return Math.min(GRID.rows, Math.max(1, Math.ceil((height + gap) / (cell + gap) - 1e-6)));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* The cards of a board drawn in `columns` fewer than twelve (a narrow room: gridFor): one after another
|
|
174
|
+
* in the order of their places (top to bottom, left to right, then as given), each as wide as it is but
|
|
175
|
+
* never wider than the row (`w` held to `columns`) and as high, each at the first spot at or after where
|
|
176
|
+
* the one before it ends, row by row, that shares no cell with those before it (as a grid flows its items
|
|
177
|
+
* with no place of their own: no card goes before one it came after, so a room may be left beside a tall
|
|
178
|
+
* one). What is drawn only, never written: the file's twelve-column places stay as they are, and the
|
|
179
|
+
* board is drawn by them again once the room holds twelve. Returns new cards, in the order given.
|
|
180
|
+
* @template {{ id: string, x: number, y: number, w: number, h: number }} Card
|
|
181
|
+
* @param {Card[]} cards
|
|
182
|
+
* @param {number} columns
|
|
183
|
+
* @returns {Card[]}
|
|
184
|
+
*/
|
|
185
|
+
export function flow(cards, columns) {
|
|
186
|
+
const order = cards.map((card, index) => ({ card, index })).sort((a, b) => a.card.y - b.card.y || a.card.x - b.card.x || a.index - b.index);
|
|
187
|
+
const placed = [];
|
|
188
|
+
const at = new Map();
|
|
189
|
+
let row = 0;
|
|
190
|
+
let column = 0;
|
|
191
|
+
for (const { card, index } of order) {
|
|
192
|
+
const w = Math.max(1, Math.min(card.w, columns));
|
|
193
|
+
let x = column;
|
|
194
|
+
let y = row;
|
|
195
|
+
for (;;) {
|
|
196
|
+
if (x + w > columns) {
|
|
197
|
+
x = 0;
|
|
198
|
+
y += 1;
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
const spot = { x, y, w, h: card.h };
|
|
202
|
+
if (!placed.some((other) => overlaps(spot, other))) break;
|
|
203
|
+
x += 1;
|
|
204
|
+
}
|
|
205
|
+
const going = { ...card, x, y, w };
|
|
206
|
+
placed.push(going);
|
|
207
|
+
at.set(index, going);
|
|
208
|
+
row = y;
|
|
209
|
+
column = x + w;
|
|
210
|
+
}
|
|
211
|
+
return cards.map((_, index) => at.get(index));
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/** The whole cells `pixels` are nearest to, from a board's edge: what a drag snaps to. */
|
|
215
|
+
export const cellAt = (pixels, cell, gap = GAP) => (cell > 0 ? Math.round(pixels / (cell + gap)) : 0);
|
|
216
|
+
|
|
217
|
+
/** The cards whose cells changed from `before` to `after` (lists of cards), by id: [{ id, x, y, w, h }] as `after` has them. */
|
|
218
|
+
export function moved(before, after) {
|
|
219
|
+
const was = new Map(before.map((card) => [card.id, card]));
|
|
220
|
+
return after.filter((card) => {
|
|
221
|
+
const old = was.get(card.id);
|
|
222
|
+
return !old || old.x !== card.x || old.y !== card.y || old.w !== card.w || old.h !== card.h;
|
|
223
|
+
});
|
|
224
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// What a block's script is told of the custom page it stands on (notes/plans/custom-blocks-spec-2026-11-07.md,
|
|
2
|
+
// sections 3, 5 and 6), as the kit's runtime reads it (runtime/kernel.js: context.place, context.size,
|
|
3
|
+
// context.state): the page's markup, a card's id and the cells the board draws it at. The page's host
|
|
4
|
+
// writes that markup and its board script lays the cards out by the rule below (the kit's board/
|
|
5
|
+
// imports cellsOf from here, as DocBoard.cellsOf): one rule, so that a block lays out for the card as
|
|
6
|
+
// drawn, never for the raw attributes. Pure, for the page.
|
|
7
|
+
|
|
8
|
+
/** A custom page's root, around every card (page.html's main). */
|
|
9
|
+
export const PAGE = "main.gallery-page";
|
|
10
|
+
|
|
11
|
+
/** A board of a custom page, its cards its children; it says how many columns it has now (data-columns: 12, fewer where it is narrower). */
|
|
12
|
+
export const BOARD = ".gallery-board";
|
|
13
|
+
|
|
14
|
+
/** A card of a board, around one instance: the closest one to an instance, whatever its tag. */
|
|
15
|
+
export const CARD = ".gallery-card";
|
|
16
|
+
|
|
17
|
+
/** A card's id, unique in its page: what an instance's reading state goes by there. */
|
|
18
|
+
export const CARD_ID = "data-card-id";
|
|
19
|
+
|
|
20
|
+
/** The most cells a card is wide and high (the manifest's own range for a card, spec section 1). */
|
|
21
|
+
export const MOST = Object.freeze({ w: 12, h: 24 });
|
|
22
|
+
|
|
23
|
+
/** What a card whose cells are no number is drawn at. */
|
|
24
|
+
const DEFAULT = Object.freeze({ x: 0, y: 0, w: 4, h: 2 });
|
|
25
|
+
|
|
26
|
+
const whole = (value, fallback) => {
|
|
27
|
+
const number = Number.parseInt(value ?? "", 10);
|
|
28
|
+
return Number.isFinite(number) ? number : fallback;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* A card's cells as the board draws them: its data-x, data-y, data-w and data-h, each a whole number
|
|
33
|
+
* (parsed as an integer: "8.5" is 8), held to 1 <= w <= 12, 0 <= x <= 12 - w, 0 <= y and
|
|
34
|
+
* 1 <= h <= 24, one that is no number the default (a 4 x 2 card at 0, 0).
|
|
35
|
+
* @param {{ dataset: Record<string, string | undefined> }} card
|
|
36
|
+
*/
|
|
37
|
+
export function cellsOf(card) {
|
|
38
|
+
const w = Math.min(MOST.w, Math.max(1, whole(card.dataset.w, DEFAULT.w)));
|
|
39
|
+
const h = Math.min(MOST.h, Math.max(1, whole(card.dataset.h, DEFAULT.h)));
|
|
40
|
+
const x = Math.min(MOST.w - w, Math.max(0, whole(card.dataset.x, DEFAULT.x)));
|
|
41
|
+
const y = Math.max(0, whole(card.dataset.y, DEFAULT.y));
|
|
42
|
+
return { x, y, w, h };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The cells a card is drawn at now, what context.size says: its cells (cellsOf), its width no more than
|
|
47
|
+
* the columns its board has now (data-columns, the board script's: 12, or fewer on a board narrower than
|
|
48
|
+
* twelve of its fixed cells, 4 at the least; 12 where it says none), its height the one the board
|
|
49
|
+
* script drew it at (--gallery-h: a card whose block lays out by its content is as high as that,
|
|
50
|
+
* whatever data-h says), else its own.
|
|
51
|
+
* @param {Element & { dataset: Record<string, string | undefined>, style?: CSSStyleDeclaration }} card
|
|
52
|
+
* @returns {{ w: number, h: number }}
|
|
53
|
+
*/
|
|
54
|
+
export function drawnCells(card) {
|
|
55
|
+
const { w, h } = cellsOf(card);
|
|
56
|
+
const columns = Number(/** @type {HTMLElement | null} */ (card.closest(BOARD))?.dataset.columns) || MOST.w;
|
|
57
|
+
const drawn = Number.parseInt(card.style?.getPropertyValue?.("--gallery-h") ?? "", 10);
|
|
58
|
+
return { w: Math.min(w, columns), h: Number.isFinite(drawn) ? Math.min(MOST.h, Math.max(1, drawn)) : h };
|
|
59
|
+
}
|
|
@@ -26,5 +26,6 @@ export const COLORS = [
|
|
|
26
26
|
|
|
27
27
|
export const COLOR_NAMES = COLORS.map(({ name }) => name);
|
|
28
28
|
|
|
29
|
-
/** The page's own text color and background (tokens.css --doc-text, --doc-surface) as [light, dark]: what no color is.
|
|
30
|
-
|
|
29
|
+
/** The page's own text color and background (tokens.css --doc-text, --doc-surface) as [light, dark]: what no color is. The text's light is
|
|
30
|
+
* the kit's default; on an Apple platform it is #262626 (tokens.css, data-doc-platform), a shade a pasted color never needs to tell apart. */
|
|
31
|
+
export const BODY = { text: ["#2d2d2d", "#f3f3f3"], background: ["#ffffff", "#202020"] };
|