@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
package/kit/board.js
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
(() => {
|
|
3
|
+
// src/shared/card-size.mjs
|
|
4
|
+
var MOST = Object.freeze({ w: 12, h: 24 });
|
|
5
|
+
var DEFAULT = Object.freeze({ x: 0, y: 0, w: 4, h: 2 });
|
|
6
|
+
var whole = (value, fallback) => {
|
|
7
|
+
const number = Number.parseInt(value ?? "", 10);
|
|
8
|
+
return Number.isFinite(number) ? number : fallback;
|
|
9
|
+
};
|
|
10
|
+
function cellsOf(card) {
|
|
11
|
+
const w = Math.min(MOST.w, Math.max(1, whole(card.dataset.w, DEFAULT.w)));
|
|
12
|
+
const h = Math.min(MOST.h, Math.max(1, whole(card.dataset.h, DEFAULT.h)));
|
|
13
|
+
const x = Math.min(MOST.w - w, Math.max(0, whole(card.dataset.x, DEFAULT.x)));
|
|
14
|
+
const y = Math.max(0, whole(card.dataset.y, DEFAULT.y));
|
|
15
|
+
return { x, y, w, h };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// src/shared/board-places.mjs
|
|
19
|
+
var GRID = Object.freeze({ columns: 12, rows: 24 });
|
|
20
|
+
var GAP = 16;
|
|
21
|
+
var CELL = 64;
|
|
22
|
+
var LEAST = 4;
|
|
23
|
+
var spanOf = (n, cell, gap = GAP) => n * cell + Math.max(0, n - 1) * gap;
|
|
24
|
+
function gridFor(room) {
|
|
25
|
+
const fit = Math.floor((Math.max(0, room) + GAP) / (CELL + GAP));
|
|
26
|
+
const columns = Math.max(LEAST, Math.min(GRID.columns, fit));
|
|
27
|
+
const cell = fit >= LEAST ? CELL : Math.max(0, (room - (LEAST - 1) * GAP) / LEAST);
|
|
28
|
+
return { columns, cell, width: spanOf(columns, cell) };
|
|
29
|
+
}
|
|
30
|
+
var 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;
|
|
31
|
+
function settle(cards, fixed = []) {
|
|
32
|
+
const kept = new Set(fixed);
|
|
33
|
+
const placed = cards.filter((card) => kept.has(card.id)).map((card) => ({ ...card }));
|
|
34
|
+
const rest = cards.map((card, index) => ({ card, index })).filter(({ card }) => !kept.has(card.id)).sort((a, b) => a.card.y - b.card.y || a.card.x - b.card.x || a.index - b.index);
|
|
35
|
+
for (const { card } of rest) {
|
|
36
|
+
const going = { ...card };
|
|
37
|
+
for (let met = placed.filter((other) => overlaps(going, other)); met.length > 0; met = placed.filter((other) => overlaps(going, other))) {
|
|
38
|
+
going.y = Math.max(...met.map((other) => other.y + other.h));
|
|
39
|
+
}
|
|
40
|
+
placed.push(going);
|
|
41
|
+
}
|
|
42
|
+
const at = new Map(placed.map((card) => [card.id, card]));
|
|
43
|
+
return cards.map((card) => at.get(card.id));
|
|
44
|
+
}
|
|
45
|
+
function fitHeight(height, cell, gap = GAP) {
|
|
46
|
+
if (!(cell > 0)) return 1;
|
|
47
|
+
return Math.min(GRID.rows, Math.max(1, Math.ceil((height + gap) / (cell + gap) - 1e-6)));
|
|
48
|
+
}
|
|
49
|
+
function flow(cards, columns) {
|
|
50
|
+
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);
|
|
51
|
+
const placed = [];
|
|
52
|
+
const at = /* @__PURE__ */ new Map();
|
|
53
|
+
let row = 0;
|
|
54
|
+
let column = 0;
|
|
55
|
+
for (const { card, index } of order) {
|
|
56
|
+
const w = Math.max(1, Math.min(card.w, columns));
|
|
57
|
+
let x = column;
|
|
58
|
+
let y = row;
|
|
59
|
+
for (; ; ) {
|
|
60
|
+
if (x + w > columns) {
|
|
61
|
+
x = 0;
|
|
62
|
+
y += 1;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
const spot = { x, y, w, h: card.h };
|
|
66
|
+
if (!placed.some((other) => overlaps(spot, other))) break;
|
|
67
|
+
x += 1;
|
|
68
|
+
}
|
|
69
|
+
const going = { ...card, x, y, w };
|
|
70
|
+
placed.push(going);
|
|
71
|
+
at.set(index, going);
|
|
72
|
+
row = y;
|
|
73
|
+
column = x + w;
|
|
74
|
+
}
|
|
75
|
+
return cards.map((_, index) => at.get(index));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// src/render/kit/board/index.js
|
|
79
|
+
var gridOf = gridFor;
|
|
80
|
+
if (typeof document !== "undefined" && !globalThis.DocBoard) {
|
|
81
|
+
let told = false;
|
|
82
|
+
const tell = () => {
|
|
83
|
+
if (told) return;
|
|
84
|
+
told = true;
|
|
85
|
+
requestAnimationFrame(() => {
|
|
86
|
+
told = false;
|
|
87
|
+
dispatchEvent(new Event("doc-layout-change"));
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
const said = /* @__PURE__ */ new WeakMap();
|
|
91
|
+
const drafts = /* @__PURE__ */ new WeakMap();
|
|
92
|
+
const skips = /* @__PURE__ */ new WeakMap();
|
|
93
|
+
const kept = /* @__PURE__ */ new WeakMap();
|
|
94
|
+
const drawnOf = /* @__PURE__ */ new WeakMap();
|
|
95
|
+
const fits = (card) => card.dataset.geFit === "content";
|
|
96
|
+
const instanceOf = (card) => [...card.children].find((child) => child.matches("[data-doc-component]")) ?? null;
|
|
97
|
+
const needed = (card) => {
|
|
98
|
+
const inner = instanceOf(card);
|
|
99
|
+
if (!inner) return 0;
|
|
100
|
+
const style = getComputedStyle(card);
|
|
101
|
+
const sides = ["paddingTop", "paddingBottom", "borderTopWidth", "borderBottomWidth"].reduce((sum, side) => sum + (parseFloat(style[side]) || 0), 0);
|
|
102
|
+
return inner.getBoundingClientRect().height + sides;
|
|
103
|
+
};
|
|
104
|
+
const cardsIn = (board) => [...board.querySelectorAll(":scope > .gallery-card")];
|
|
105
|
+
const setCells = (card, cells, skip = 0) => {
|
|
106
|
+
drawnOf.set(card, cells);
|
|
107
|
+
for (const name of ["x", "y", "w", "h"]) {
|
|
108
|
+
const property = `--gallery-${name}`;
|
|
109
|
+
const value = String(name === "y" ? cells.y - skip : cells[name]);
|
|
110
|
+
if (card.style.getPropertyValue(property) !== value) card.style.setProperty(property, value);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const measureCard = (card, columns) => {
|
|
114
|
+
const { w, h } = drawnOf.get(card) ?? cellsOf(card);
|
|
115
|
+
const size = `${Math.min(w, columns)} ${h} ${card.clientWidth} ${card.clientHeight}`;
|
|
116
|
+
if (said.get(card) === size) return;
|
|
117
|
+
const first = !said.has(card);
|
|
118
|
+
said.set(card, size);
|
|
119
|
+
if (!first) tell();
|
|
120
|
+
};
|
|
121
|
+
const setColumns = (board, columns) => {
|
|
122
|
+
if (board.dataset.columns !== String(columns)) board.dataset.columns = String(columns);
|
|
123
|
+
if (board.style.getPropertyValue("--gallery-columns") !== String(columns)) board.style.setProperty("--gallery-columns", String(columns));
|
|
124
|
+
};
|
|
125
|
+
const layBoard = (board) => {
|
|
126
|
+
const { columns, cell } = gridOf(board.clientWidth);
|
|
127
|
+
setColumns(board, columns);
|
|
128
|
+
const side = `${Math.round(cell * 100) / 100}px`;
|
|
129
|
+
if (board.style.getPropertyValue("--gallery-cell") !== side) board.style.setProperty("--gallery-cell", side);
|
|
130
|
+
const draft = drafts.get(board);
|
|
131
|
+
const cards = cardsIn(board);
|
|
132
|
+
let placed = cards.map((card, index) => ({ id: String(index), ...cellsOf(card) }));
|
|
133
|
+
if (draft) {
|
|
134
|
+
const held = [];
|
|
135
|
+
placed = placed.map((cells2, index) => {
|
|
136
|
+
const own = draft.get(cards[index]);
|
|
137
|
+
if (!own) return cells2;
|
|
138
|
+
held.push(cells2.id);
|
|
139
|
+
return { id: cells2.id, x: own.x, y: own.y, w: own.w, h: own.h };
|
|
140
|
+
});
|
|
141
|
+
placed = settle(placed, held);
|
|
142
|
+
}
|
|
143
|
+
const cells = placed.map((one, index) => fits(cards[index]) && !draft?.get(cards[index])?.fixed ? { ...one, h: fitHeight(needed(cards[index]), cell) } : one);
|
|
144
|
+
const laid = columns === GRID.columns ? settle(cells) : flow(cells, columns);
|
|
145
|
+
if (columns < GRID.columns && laid.length) setColumns(board, Math.max(...laid.map(({ x, w }) => x + w)));
|
|
146
|
+
const least = laid.length ? Math.min(...laid.map(({ y }) => y)) : 0;
|
|
147
|
+
const skip = draft && kept.has(board) ? Math.min(kept.get(board), least) : least;
|
|
148
|
+
skips.set(board, skip);
|
|
149
|
+
cards.forEach((card, index) => setCells(card, laid[index], skip));
|
|
150
|
+
};
|
|
151
|
+
const boards = /* @__PURE__ */ new Set();
|
|
152
|
+
const resized = new ResizeObserver((entries) => {
|
|
153
|
+
const again = /* @__PURE__ */ new Set();
|
|
154
|
+
for (const { target } of entries) {
|
|
155
|
+
if (target.matches(".gallery-board")) again.add(target);
|
|
156
|
+
else if (!target.matches(".gallery-card")) {
|
|
157
|
+
const card = target.parentElement;
|
|
158
|
+
if (card && fits(card) && boards.has(card.parentElement)) again.add(card.parentElement);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
for (const board of again) layBoard(board);
|
|
162
|
+
for (const board of boards) {
|
|
163
|
+
const columns = Number(board.dataset.columns) || 12;
|
|
164
|
+
for (const card of cardsIn(board)) measureCard(card, columns);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
const watchCard = (card) => {
|
|
168
|
+
resized.observe(card);
|
|
169
|
+
const inner = instanceOf(card);
|
|
170
|
+
if (inner && fits(card)) resized.observe(inner);
|
|
171
|
+
};
|
|
172
|
+
const watchBoard = (board) => {
|
|
173
|
+
if (boards.has(board)) return;
|
|
174
|
+
boards.add(board);
|
|
175
|
+
layBoard(board);
|
|
176
|
+
resized.observe(board);
|
|
177
|
+
for (const card of cardsIn(board)) watchCard(card);
|
|
178
|
+
};
|
|
179
|
+
const look = (root = document) => {
|
|
180
|
+
for (const board of root.querySelectorAll?.(".gallery-board") ?? []) watchBoard(board);
|
|
181
|
+
};
|
|
182
|
+
new MutationObserver((records) => {
|
|
183
|
+
const again = /* @__PURE__ */ new Set();
|
|
184
|
+
for (const record of records) {
|
|
185
|
+
if (record.type === "attributes") {
|
|
186
|
+
const card = record.target;
|
|
187
|
+
if (card.matches?.(".gallery-card") && boards.has(card.parentElement)) again.add(card.parentElement);
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
for (const node of record.addedNodes) {
|
|
191
|
+
if (node.nodeType !== 1) continue;
|
|
192
|
+
if (node.matches(".gallery-board")) watchBoard(node);
|
|
193
|
+
else if (node.matches(".gallery-card") && boards.has(node.parentElement)) {
|
|
194
|
+
watchCard(node);
|
|
195
|
+
again.add(node.parentElement);
|
|
196
|
+
} else if (node.matches("[data-doc-component]") && node.parentElement?.matches(".gallery-card") && boards.has(node.parentElement.parentElement)) {
|
|
197
|
+
watchCard(node.parentElement);
|
|
198
|
+
again.add(node.parentElement.parentElement);
|
|
199
|
+
} else look(node);
|
|
200
|
+
}
|
|
201
|
+
for (const node of record.removedNodes) {
|
|
202
|
+
if (node.nodeType !== 1) continue;
|
|
203
|
+
if (boards.has(node)) {
|
|
204
|
+
boards.delete(node);
|
|
205
|
+
resized.unobserve(node);
|
|
206
|
+
} else if (node.matches(".gallery-card") && boards.has(record.target)) again.add(record.target);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
for (const board of again) {
|
|
210
|
+
layBoard(board);
|
|
211
|
+
const columns = Number(board.dataset.columns) || 12;
|
|
212
|
+
for (const card of cardsIn(board)) measureCard(card, columns);
|
|
213
|
+
}
|
|
214
|
+
}).observe(document.documentElement, { subtree: true, childList: true, attributes: true, attributeFilter: ["data-x", "data-y", "data-w", "data-h", "data-ge-fit"] });
|
|
215
|
+
look();
|
|
216
|
+
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", () => look(), { once: true });
|
|
217
|
+
globalThis.DocBoard = Object.freeze({
|
|
218
|
+
cellsOf,
|
|
219
|
+
gridOf,
|
|
220
|
+
/** The cells card `card` is drawn at now ({ x, y, w, h }: its file's, or lower, or as high as its content), its row as the file counts them (skipped: how many it is drawn up). */
|
|
221
|
+
drawn: (card) => ({ ...drawnOf.get(card) ?? cellsOf(card) }),
|
|
222
|
+
/** How many rows above its first card board `board` does not draw now: its drawn row r is the file's row r + skipped. */
|
|
223
|
+
skipped: (board) => skips.get(board) ?? 0,
|
|
224
|
+
/**
|
|
225
|
+
* Board `board` drawn as it would be with some of its cards at cells of the editing's (`cells`:
|
|
226
|
+
* Map(card -> { x, y, w, h, fixed? }), `fixed` a height kept for a card of fit content): the cards
|
|
227
|
+
* they meet pushed down under them (the page service's pushDown), then all drawn as the file would
|
|
228
|
+
* draw them (fit content as high as it is, what is under it lower: a draft's card too); null draws it
|
|
229
|
+
* as the file says again. Laid out at once.
|
|
230
|
+
*/
|
|
231
|
+
draft(board, cells) {
|
|
232
|
+
if (cells && cells.size) {
|
|
233
|
+
if (!drafts.has(board)) kept.set(board, skips.get(board) ?? 0);
|
|
234
|
+
drafts.set(board, cells);
|
|
235
|
+
} else {
|
|
236
|
+
drafts.delete(board);
|
|
237
|
+
kept.delete(board);
|
|
238
|
+
}
|
|
239
|
+
layBoard(board);
|
|
240
|
+
const columns = Number(board.dataset.columns) || 12;
|
|
241
|
+
for (const card of cardsIn(board)) measureCard(card, columns);
|
|
242
|
+
},
|
|
243
|
+
/** Board `board` laid out again now (a card put in or taken out by the editing). */
|
|
244
|
+
layout(board) {
|
|
245
|
+
if (!boards.has(board)) return watchBoard(board);
|
|
246
|
+
layBoard(board);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
})();
|
package/kit/charts.js
CHANGED
|
@@ -51,8 +51,6 @@
|
|
|
51
51
|
// src/shared/table-chart.mjs
|
|
52
52
|
var CHART_DATA = "data-doc-chart-data";
|
|
53
53
|
var CHART_SOURCE = "data-doc-chart-source";
|
|
54
|
-
var FORMULA = /\\\(([\s\S]*?)\\\)|\\\[([\s\S]*?)\\\]|\$\$([\s\S]*?)\$\$/g;
|
|
55
|
-
var cellWords = (text) => text.replace(FORMULA, (_, inline, display, dollars) => inline ?? display ?? dollars).replaceAll(ZWSP, "").replace(/\s+/g, " ").trim();
|
|
56
54
|
var WORD_TYPES = /* @__PURE__ */ new Set(["text", "date"]);
|
|
57
55
|
function cellValue(cell, type = null) {
|
|
58
56
|
if (!cell) return null;
|
|
@@ -101,73 +99,11 @@
|
|
|
101
99
|
|
|
102
100
|
// src/render/kit/charts/from-table.js
|
|
103
101
|
var SETTLE = 800;
|
|
104
|
-
var checks = /* @__PURE__ */ new Set();
|
|
105
|
-
var observer = null;
|
|
106
|
-
var SOURCES = `.doc-table-wrap[${CHART_SOURCE}]`;
|
|
107
|
-
var sourceOf = (key) => [...document.querySelectorAll(SOURCES)].find((wrap) => wrap.getAttribute(CHART_SOURCE) === key && !wrap.closest("[data-doc-dev]")) ?? null;
|
|
108
|
-
function touchesSource(record) {
|
|
109
|
-
if (record.type === "attributes" && (record.attributeName === CHART_SOURCE || record.attributeName === CHART_DATA)) return true;
|
|
110
|
-
const target = record.target.nodeType === 1 ? record.target : record.target.parentElement;
|
|
111
|
-
if (target?.closest(SOURCES)) return true;
|
|
112
|
-
return [...record.addedNodes, ...record.removedNodes].some((node) => node.nodeType === 1 && (node.matches(SOURCES) || node.querySelector(SOURCES)));
|
|
113
|
-
}
|
|
114
|
-
function watch() {
|
|
115
|
-
if (observer) return;
|
|
116
|
-
observer = new MutationObserver((records) => {
|
|
117
|
-
if (!globalThis.document?.defaultView) return;
|
|
118
|
-
if (records.some(touchesSource)) for (const check of checks) check();
|
|
119
|
-
});
|
|
120
|
-
observer.observe(document.documentElement, {
|
|
121
|
-
childList: true,
|
|
122
|
-
subtree: true,
|
|
123
|
-
characterData: true,
|
|
124
|
-
attributes: true,
|
|
125
|
-
attributeFilter: [CHART_SOURCE, CHART_DATA, "data-sort-value", "data-sort-type", "rowspan", "colspan", "aria-sort"]
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
function unwatch() {
|
|
129
|
-
if (checks.size > 0 || !observer) return;
|
|
130
|
-
observer.disconnect();
|
|
131
|
-
observer = null;
|
|
132
|
-
}
|
|
133
|
-
var fileOrder = /* @__PURE__ */ new WeakMap();
|
|
134
|
-
function inFileOrder(table, rows) {
|
|
135
|
-
const sorted = [...table.tHead?.rows[0]?.cells ?? []].some((cell) => /^(?:ascending|descending)$/.test(cell.getAttribute("aria-sort") ?? ""));
|
|
136
|
-
if (!sorted) {
|
|
137
|
-
rows.forEach((row, index) => fileOrder.set(row, index));
|
|
138
|
-
return rows;
|
|
139
|
-
}
|
|
140
|
-
const place = (row) => fileOrder.get(row) ?? rows.length + rows.indexOf(row);
|
|
141
|
-
return [...rows].sort((a, b) => place(a) - place(b));
|
|
142
|
-
}
|
|
143
|
-
var TEX = 'annotation[encoding="application/x-tex"]';
|
|
144
|
-
function sourceText(node) {
|
|
145
|
-
if (node.nodeType === 3) return node.data;
|
|
146
|
-
if (node.nodeType !== 1 || node.hasAttribute("data-ge-empty")) return "";
|
|
147
|
-
const tex = node.classList.contains("katex") ? node.querySelector(TEX) : null;
|
|
148
|
-
if (tex) return tex.textContent;
|
|
149
|
-
let text = "";
|
|
150
|
-
for (const child of node.childNodes) text += sourceText(child);
|
|
151
|
-
return text;
|
|
152
|
-
}
|
|
153
|
-
var wordsOf = (cell) => cellWords(sourceText(cell));
|
|
154
|
-
function tableCells(table) {
|
|
155
|
-
let header = table.tHead?.rows[0] ?? null;
|
|
156
|
-
let rows = [...table.tBodies].flatMap((body) => [...body.rows]);
|
|
157
|
-
if (!header && rows.length > 0 && rows[0].cells.length > 0 && [...rows[0].cells].every((cell) => cell.localName === "th")) [header, ...rows] = rows;
|
|
158
|
-
const merged = [header, ...rows].some((row) => row && [...row.cells].some((cell) => cell.rowSpan !== 1 || cell.colSpan !== 1));
|
|
159
|
-
return {
|
|
160
|
-
names: header ? [...header.cells].map(wordsOf) : null,
|
|
161
|
-
types: header ? [...header.cells].map((cell) => cell.getAttribute("data-sort-type")) : null,
|
|
162
|
-
rows: inFileOrder(table, rows).map((row) => [...row.cells].map((cell) => ({ words: wordsOf(cell), sort: cell.getAttribute("data-sort-value")?.trim() ?? null }))),
|
|
163
|
-
merged
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
102
|
function readSource(host) {
|
|
167
103
|
const key = host.getAttribute(CHART_DATA);
|
|
168
|
-
const
|
|
169
|
-
if (!
|
|
170
|
-
const found = tableRows(
|
|
104
|
+
const read = globalThis.DocKit.tables.reading(key);
|
|
105
|
+
if (!read) return { error: `no table carries ${CHART_SOURCE}="${key}": put the table back, or delete the card`, message: ["table-gone"] };
|
|
106
|
+
const found = tableRows({ names: read.names, types: read.header ? read.types : null, rows: read.cells, merged: read.merged });
|
|
171
107
|
return found.error ? { error: `its table ${found.error}`, message: found.message } : found;
|
|
172
108
|
}
|
|
173
109
|
function createBound(host, make, context) {
|
|
@@ -220,8 +156,7 @@
|
|
|
220
156
|
destroy: () => globalThis.DocKit.destroy(host)
|
|
221
157
|
};
|
|
222
158
|
mounts.set(host, api);
|
|
223
|
-
|
|
224
|
-
watch();
|
|
159
|
+
const unfollow = globalThis.DocKit.tables.follow(() => host.getAttribute(CHART_DATA), check);
|
|
225
160
|
check();
|
|
226
161
|
return {
|
|
227
162
|
api,
|
|
@@ -229,8 +164,7 @@
|
|
|
229
164
|
destroy() {
|
|
230
165
|
destroyed = true;
|
|
231
166
|
clearTimeout(waiting);
|
|
232
|
-
|
|
233
|
-
unwatch();
|
|
167
|
+
unfollow();
|
|
234
168
|
inner?.destroy();
|
|
235
169
|
inner = null;
|
|
236
170
|
if (mounts.get(host) === api) mounts.delete(host);
|