@heycys/gallery 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +50 -2
- package/THIRD-PARTY-NOTICES.md +3303 -0
- package/assets/writing-preferences.md +107 -0
- package/bin/gallery.mjs +10 -0
- package/browser/editor/components/bookmark/icons.mjs +6 -0
- package/browser/editor/components/bookmark/index.mjs +80 -0
- package/browser/editor/components/bookmark/page.mjs +147 -0
- package/browser/editor/components/builders.mjs +19 -0
- package/browser/editor/components/callout/index.mjs +64 -0
- package/browser/editor/components/code/index.mjs +327 -0
- package/browser/editor/components/code/page.mjs +561 -0
- package/browser/editor/components/colors.mjs +50 -0
- package/browser/editor/components/columns/index.mjs +104 -0
- package/browser/editor/components/columns/page.mjs +310 -0
- package/browser/editor/components/details/index.mjs +73 -0
- package/browser/editor/components/details/page.mjs +86 -0
- package/browser/editor/components/dialog/index.mjs +84 -0
- package/browser/editor/components/dialog/page.mjs +201 -0
- package/browser/editor/components/divider/index.mjs +48 -0
- package/browser/editor/components/embed/icons.mjs +11 -0
- package/browser/editor/components/embed/index.mjs +123 -0
- package/browser/editor/components/embed/page.mjs +309 -0
- package/browser/editor/components/figure/index.mjs +87 -0
- package/browser/editor/components/figure/page.mjs +42 -0
- package/browser/editor/components/file/icons.mjs +14 -0
- package/browser/editor/components/file/index.mjs +77 -0
- package/browser/editor/components/file/page.mjs +114 -0
- package/browser/editor/components/flowchart/add.mjs +123 -0
- package/browser/editor/components/flowchart/index.mjs +246 -0
- package/browser/editor/components/flowchart/page.mjs +453 -0
- package/browser/editor/components/heading/index.mjs +53 -0
- package/browser/editor/components/heading/page.mjs +6 -0
- package/browser/editor/components/highlight/index.mjs +63 -0
- package/browser/editor/components/icon/index.mjs +57 -0
- package/browser/editor/components/icon/page.mjs +286 -0
- package/browser/editor/components/icons.mjs +48 -0
- package/browser/editor/components/image/crop.mjs +189 -0
- package/browser/editor/components/image/index.mjs +104 -0
- package/browser/editor/components/image/page.mjs +385 -0
- package/browser/editor/components/image/viewer.mjs +213 -0
- package/browser/editor/components/installed/index.mjs +179 -0
- package/browser/editor/components/installed/page.mjs +523 -0
- package/browser/editor/components/installed/served.mjs +35 -0
- package/browser/editor/components/kit.mjs +67 -0
- package/browser/editor/components/list/index.mjs +194 -0
- package/browser/editor/components/list/join.mjs +68 -0
- package/browser/editor/components/list/numbers.mjs +107 -0
- package/browser/editor/components/list/page.mjs +632 -0
- package/browser/editor/components/math/index.mjs +88 -0
- package/browser/editor/components/math/page.mjs +236 -0
- package/browser/editor/components/math/tex-logo.mjs +6 -0
- package/browser/editor/components/media/icons.mjs +19 -0
- package/browser/editor/components/media/page.mjs +192 -0
- package/browser/editor/components/media/parts.mjs +60 -0
- package/browser/editor/components/media/size.mjs +20 -0
- package/browser/editor/components/media/toolbar.mjs +37 -0
- package/browser/editor/components/media/write.mjs +7 -0
- package/browser/editor/components/pages.mjs +46 -0
- package/browser/editor/components/paragraph/index.mjs +43 -0
- package/browser/editor/components/paragraph/page.mjs +52 -0
- package/browser/editor/components/placeholder-bar.mjs +17 -0
- package/browser/editor/components/placeholder.mjs +128 -0
- package/browser/editor/components/quote/index.mjs +33 -0
- package/browser/editor/components/registry.mjs +859 -0
- package/browser/editor/components/rows.mjs +16 -0
- package/browser/editor/components/section/index.mjs +42 -0
- package/browser/editor/components/section/page.mjs +141 -0
- package/browser/editor/components/set-apart.mjs +24 -0
- package/browser/editor/components/sheets/index.mjs +137 -0
- package/browser/editor/components/sheets/page.mjs +227 -0
- package/browser/editor/components/sheets/pills.mjs +226 -0
- package/browser/editor/components/table/grid.mjs +73 -0
- package/browser/editor/components/table/index.mjs +308 -0
- package/browser/editor/components/table/page.mjs +683 -0
- package/browser/editor/components/table/slots.mjs +41 -0
- package/browser/editor/components/widget/index.mjs +50 -0
- package/browser/editor/page/annotate/anchors.mjs +230 -0
- package/browser/editor/page/annotate/card.mjs +102 -0
- package/browser/editor/page/annotate/index.mjs +1656 -0
- package/browser/editor/page/at-menu/index.mjs +317 -0
- package/browser/editor/page/autosave.mjs +1023 -0
- package/browser/editor/page/beside.mjs +21 -0
- package/browser/editor/page/block-info.mjs +63 -0
- package/browser/editor/page/block-menu/colors.mjs +84 -0
- package/browser/editor/page/block-menu/index.mjs +217 -0
- package/browser/editor/page/blocks.mjs +255 -0
- package/browser/editor/page/caret.mjs +682 -0
- package/browser/editor/page/changes/bar.mjs +102 -0
- package/browser/editor/page/changes/ghost.mjs +206 -0
- package/browser/editor/page/changes/gone-words.mjs +94 -0
- package/browser/editor/page/changes/index.mjs +447 -0
- package/browser/editor/page/changes/words.mjs +27 -0
- package/browser/editor/page/chip-fills.mjs +126 -0
- package/browser/editor/page/clipboard/import/colors.mjs +192 -0
- package/browser/editor/page/clipboard/import/html.mjs +792 -0
- package/browser/editor/page/clipboard/import/inline.mjs +232 -0
- package/browser/editor/page/clipboard/import/languages.mjs +42 -0
- package/browser/editor/page/clipboard/import/markdown.mjs +760 -0
- package/browser/editor/page/clipboard/import/math.mjs +100 -0
- package/browser/editor/page/clipboard/import/office.mjs +245 -0
- package/browser/editor/page/clipboard/import/read.mjs +120 -0
- package/browser/editor/page/clipboard/import/rich.mjs +29 -0
- package/browser/editor/page/clipboard/import/to-blocks.mjs +290 -0
- package/browser/editor/page/clipboard/index.mjs +816 -0
- package/browser/editor/page/clipboard/own/blocks.mjs +211 -0
- package/browser/editor/page/clipboard/own/chart-keys.mjs +58 -0
- package/browser/editor/page/clipboard/own/describe.mjs +124 -0
- package/browser/editor/page/clipboard/own/export.mjs +167 -0
- package/browser/editor/page/clipboard/own/ids.mjs +39 -0
- package/browser/editor/page/clipboard/own/index.mjs +13 -0
- package/browser/editor/page/clipboard/own/rules.mjs +44 -0
- package/browser/editor/page/clipboard/own/selection.mjs +159 -0
- package/browser/editor/page/clipboard/own/writers.mjs +315 -0
- package/browser/editor/page/columns/index.mjs +360 -0
- package/browser/editor/page/commit.mjs +1813 -0
- package/browser/editor/page/conflicts.mjs +249 -0
- package/browser/editor/page/convert.mjs +831 -0
- package/browser/editor/page/core.mjs +1693 -0
- package/browser/editor/page/drag/drop.mjs +307 -0
- package/browser/editor/page/drag/index.mjs +351 -0
- package/browser/editor/page/drag/preview.mjs +126 -0
- package/browser/editor/page/edge-scroll.mjs +50 -0
- package/browser/editor/page/editor.mjs +1780 -0
- package/browser/editor/page/emoji-picker/emoji-tab.mjs +287 -0
- package/browser/editor/page/emoji-picker/glyph-html.mjs +26 -0
- package/browser/editor/page/emoji-picker/grid.mjs +81 -0
- package/browser/editor/page/emoji-picker/icon-tab.mjs +217 -0
- package/browser/editor/page/emoji-picker/icons.mjs +31 -0
- package/browser/editor/page/emoji-picker/index.mjs +166 -0
- package/browser/editor/page/emoji-picker/styles.mjs +161 -0
- package/browser/editor/page/emoji-picker/support.mjs +204 -0
- package/browser/editor/page/emoji-picker/upload.mjs +236 -0
- package/browser/editor/page/export-report.mjs +23 -0
- package/browser/editor/page/fills.mjs +62 -0
- package/browser/editor/page/find/index.mjs +107 -0
- package/browser/editor/page/flags.mjs +70 -0
- package/browser/editor/page/fold/index.mjs +348 -0
- package/browser/editor/page/fold/rule.mjs +125 -0
- package/browser/editor/page/folded.mjs +23 -0
- package/browser/editor/page/format-bar/bar.mjs +449 -0
- package/browser/editor/page/format-bar/brush.mjs +77 -0
- package/browser/editor/page/format-bar/colors.mjs +46 -0
- package/browser/editor/page/format-bar/index.mjs +404 -0
- package/browser/editor/page/formula/index.mjs +236 -0
- package/browser/editor/page/formula/panel.mjs +336 -0
- package/browser/editor/page/formula/symbols.mjs +156 -0
- package/browser/editor/page/frame.mjs +74 -0
- package/browser/editor/page/frames.mjs +196 -0
- package/browser/editor/page/geometry.mjs +402 -0
- package/browser/editor/page/gesture.mjs +45 -0
- package/browser/editor/page/handle/index.mjs +650 -0
- package/browser/editor/page/handle-sizes.mjs +14 -0
- package/browser/editor/page/hints/index.mjs +84 -0
- package/browser/editor/page/history.mjs +401 -0
- package/browser/editor/page/insert/index.mjs +256 -0
- package/browser/editor/page/kept.mjs +38 -0
- package/browser/editor/page/links/address.mjs +40 -0
- package/browser/editor/page/links/index.mjs +866 -0
- package/browser/editor/page/links/pages.mjs +131 -0
- package/browser/editor/page/links/views.mjs +369 -0
- package/browser/editor/page/long-runs.mjs +75 -0
- package/browser/editor/page/look.mjs +77 -0
- package/browser/editor/page/made.mjs +24 -0
- package/browser/editor/page/margin.mjs +373 -0
- package/browser/editor/page/markdown/index.mjs +88 -0
- package/browser/editor/page/markdown/rules.mjs +33 -0
- package/browser/editor/page/marks.mjs +377 -0
- package/browser/editor/page/media-menu/index.mjs +158 -0
- package/browser/editor/page/menu.mjs +544 -0
- package/browser/editor/page/merge.mjs +124 -0
- package/browser/editor/page/notices.mjs +142 -0
- package/browser/editor/page/offered.mjs +32 -0
- package/browser/editor/page/outline/folds.mjs +53 -0
- package/browser/editor/page/outline/index.mjs +783 -0
- package/browser/editor/page/outline/list.mjs +184 -0
- package/browser/editor/page/outline/read.mjs +201 -0
- package/browser/editor/page/outline/strip.mjs +287 -0
- package/browser/editor/page/outline/tree.mjs +248 -0
- package/browser/editor/page/overlay-layer.mjs +227 -0
- package/browser/editor/page/overlays.mjs +205 -0
- package/browser/editor/page/own.mjs +28 -0
- package/browser/editor/page/pads.mjs +71 -0
- package/browser/editor/page/page-objects.mjs +105 -0
- package/browser/editor/page/panel.mjs +65 -0
- package/browser/editor/page/placement.mjs +58 -0
- package/browser/editor/page/post.mjs +41 -0
- package/browser/editor/page/present-links.mjs +50 -0
- package/browser/editor/page/quiet.mjs +48 -0
- package/browser/editor/page/resize/index.mjs +327 -0
- package/browser/editor/page/select-all/index.mjs +262 -0
- package/browser/editor/page/selection/delete.mjs +61 -0
- package/browser/editor/page/selection/index.mjs +164 -0
- package/browser/editor/page/selection/marquee.mjs +174 -0
- package/browser/editor/page/session.mjs +168 -0
- package/browser/editor/page/slash-menu/index.mjs +291 -0
- package/browser/editor/page/storage.mjs +48 -0
- package/browser/editor/page/sync-state.mjs +267 -0
- package/browser/editor/page/table/aligns.mjs +29 -0
- package/browser/editor/page/table/cell-bar.mjs +141 -0
- package/browser/editor/page/table/cells.mjs +527 -0
- package/browser/editor/page/table/icons.mjs +40 -0
- package/browser/editor/page/table/index.mjs +990 -0
- package/browser/editor/page/table/lists.mjs +187 -0
- package/browser/editor/page/table/widths.mjs +313 -0
- package/browser/editor/page/tex.mjs +32 -0
- package/browser/editor/page/text-select/index.mjs +671 -0
- package/browser/editor/page/tooltip.mjs +98 -0
- package/browser/editor/page/type-grid.mjs +83 -0
- package/browser/editor/page/typing/code-edges.mjs +274 -0
- package/browser/editor/page/typing/index.mjs +282 -0
- package/browser/editor/page/typing/leave.mjs +68 -0
- package/browser/editor/page/ui.mjs +160 -0
- package/browser/shared/annotations.mjs +569 -0
- package/browser/shared/code-folds.mjs +14 -0
- package/browser/shared/code-languages.mjs +70 -0
- package/browser/shared/code-lines.mjs +30 -0
- package/browser/shared/colors.mjs +30 -0
- package/browser/shared/component-catalog.mjs +573 -0
- package/browser/shared/components/bookmark.mjs +26 -0
- package/browser/shared/components/callout.mjs +9 -0
- package/browser/shared/components/chart.mjs +20 -0
- package/browser/shared/components/code.mjs +37 -0
- package/browser/shared/components/columns.mjs +16 -0
- package/browser/shared/components/details.mjs +15 -0
- package/browser/shared/components/dialog.mjs +28 -0
- package/browser/shared/components/diff.mjs +18 -0
- package/browser/shared/components/divider.mjs +6 -0
- package/browser/shared/components/embed.mjs +25 -0
- package/browser/shared/components/figure.mjs +14 -0
- package/browser/shared/components/file.mjs +23 -0
- package/browser/shared/components/heading.mjs +6 -0
- package/browser/shared/components/highlight.mjs +9 -0
- package/browser/shared/components/icon.mjs +18 -0
- package/browser/shared/components/image.mjs +39 -0
- package/browser/shared/components/index.mjs +396 -0
- package/browser/shared/components/installed.mjs +232 -0
- package/browser/shared/components/list.mjs +146 -0
- package/browser/shared/components/math.mjs +49 -0
- package/browser/shared/components/mention.mjs +33 -0
- package/browser/shared/components/page.mjs +46 -0
- package/browser/shared/components/paragraph.mjs +9 -0
- package/browser/shared/components/quote.mjs +6 -0
- package/browser/shared/components/section.mjs +8 -0
- package/browser/shared/components/sheets.mjs +80 -0
- package/browser/shared/components/state.mjs +20 -0
- package/browser/shared/components/table.mjs +49 -0
- package/browser/shared/components/text.mjs +14 -0
- package/browser/shared/components/widget.mjs +10 -0
- package/browser/shared/copy-ids.mjs +72 -0
- package/browser/shared/css-references.mjs +110 -0
- package/browser/shared/document-look.mjs +178 -0
- package/browser/shared/emoji/custom.mjs +91 -0
- package/browser/shared/emoji/data/LICENSE-lucide.txt +43 -0
- package/browser/shared/emoji/data/LICENSE-mingcute.txt +202 -0
- package/browser/shared/emoji/data/LICENSE-tabler.txt +21 -0
- package/browser/shared/emoji/data/README.md +28 -0
- package/browser/shared/emoji/data/categories.json +1 -0
- package/browser/shared/emoji/data/icons.json +1 -0
- package/browser/shared/emoji/data/keywords-en.json +1 -0
- package/browser/shared/emoji/data/keywords-zh.json +1 -0
- package/browser/shared/emoji/data/names.json +1 -0
- package/browser/shared/emoji/data/positions.json +1 -0
- package/browser/shared/emoji/data/twemoji-index.json +1 -0
- package/browser/shared/emoji/data/twemoji-svg.bin +0 -0
- package/browser/shared/emoji/data.mjs +194 -0
- package/browser/shared/emoji/emoji.mjs +38 -0
- package/browser/shared/emoji/glyphs.mjs +134 -0
- package/browser/shared/emoji/icon-value.mjs +91 -0
- package/browser/shared/escape.mjs +20 -0
- package/browser/shared/export-wrap.mjs +89 -0
- package/browser/shared/files.mjs +33 -0
- package/browser/shared/html-tree.mjs +59 -0
- package/browser/shared/http.mjs +22 -0
- package/browser/shared/i18n/en.mjs +1223 -0
- package/browser/shared/i18n/index.mjs +132 -0
- package/browser/shared/ids.mjs +24 -0
- package/browser/shared/import-types.mjs +23 -0
- package/browser/shared/inline-spacing.mjs +97 -0
- package/browser/shared/layers.mjs +42 -0
- package/browser/shared/long-runs.mjs +39 -0
- package/browser/shared/media.mjs +162 -0
- package/browser/shared/new-names.mjs +67 -0
- package/browser/shared/number-reading.mjs +92 -0
- package/browser/shared/old-names.mjs +143 -0
- package/browser/shared/outline.mjs +194 -0
- package/browser/shared/page-address.mjs +140 -0
- package/browser/shared/page-links.mjs +86 -0
- package/browser/shared/paths.mjs +73 -0
- package/browser/shared/preferences.mjs +116 -0
- package/browser/shared/preview-server.mjs +247 -0
- package/browser/shared/qa-levels.mjs +93 -0
- package/browser/shared/reading-place.mjs +91 -0
- package/browser/shared/renamed-storage.mjs +220 -0
- package/browser/shared/reports.mjs +46 -0
- package/browser/shared/search.mjs +85 -0
- package/browser/shared/session.mjs +77 -0
- package/browser/shared/table-chart.mjs +113 -0
- package/browser/shared/table-hides.mjs +120 -0
- package/browser/shared/table-slots.mjs +75 -0
- package/browser/shared/words.mjs +23 -0
- package/browser/shared/workspace-look.mjs +91 -0
- package/browser/shared/workspace.mjs +535 -0
- package/browser/shared/writing-preferences.mjs +68 -0
- package/browser/shared/zoom.mjs +57 -0
- package/dist/chunk-2B5E4CDJ.mjs +2 -0
- package/dist/chunk-342HXE3Q.mjs +2 -0
- package/dist/chunk-3HIRPVLU.mjs +2 -0
- package/dist/chunk-43B75J5T.mjs +2 -0
- package/dist/chunk-4FS7Z7WR.mjs +2 -0
- package/dist/chunk-4K5KC6V2.mjs +2 -0
- package/dist/chunk-5L7RYZCL.mjs +2 -0
- package/dist/chunk-5MHMDLZD.mjs +4 -0
- package/dist/chunk-5ZKJ3H4P.mjs +8 -0
- package/dist/chunk-64K7IPLO.mjs +255 -0
- package/dist/chunk-6QXGZM36.mjs +8 -0
- package/dist/chunk-6RGJOMJP.mjs +16 -0
- package/dist/chunk-742D2WWJ.mjs +19 -0
- package/dist/chunk-7DTINW6U.mjs +48 -0
- package/dist/chunk-A55HN5OK.mjs +2 -0
- package/dist/chunk-AGDILNWB.mjs +2 -0
- package/dist/chunk-AJ73XJF3.mjs +2 -0
- package/dist/chunk-AUZGSZJH.mjs +13 -0
- package/dist/chunk-BFE45AKL.mjs +2 -0
- package/dist/chunk-BGGDRNYQ.mjs +10 -0
- package/dist/chunk-BXO2ZY5P.mjs +2 -0
- package/dist/chunk-C564NU2H.mjs +77 -0
- package/dist/chunk-CEH4MRCC.mjs +2 -0
- package/dist/chunk-CY2FNNAB.mjs +16 -0
- package/dist/chunk-DFUDV4LX.mjs +2 -0
- package/dist/chunk-DKXG4XDG.mjs +2 -0
- package/dist/chunk-E7LWZRXY.mjs +4 -0
- package/dist/chunk-EZQ34M3F.mjs +124 -0
- package/dist/chunk-EZY3WC6Z.mjs +15 -0
- package/dist/chunk-FDLXYYG4.mjs +4 -0
- package/dist/chunk-FUKQNOQS.mjs +9 -0
- package/dist/chunk-GB5SOYQJ.mjs +7 -0
- package/dist/chunk-GRAXKKG4.mjs +2 -0
- package/dist/chunk-HYMEEXKN.mjs +4 -0
- package/dist/chunk-IVDLMMBD.mjs +2 -0
- package/dist/chunk-JPOSLGOC.mjs +6 -0
- package/dist/chunk-JVHHHGEA.mjs +3 -0
- package/dist/chunk-L3QKH4OK.mjs +26 -0
- package/dist/chunk-LAE5NQ4B.mjs +2 -0
- package/dist/chunk-LCTHTZIL.mjs +960 -0
- package/dist/chunk-LEF6DRCK.mjs +59 -0
- package/dist/chunk-LKX55H76.mjs +2 -0
- package/dist/chunk-LS4F7JUM.mjs +2 -0
- package/dist/chunk-MAFIGVXY.mjs +2 -0
- package/dist/chunk-NO5NJCHO.mjs +2 -0
- package/dist/chunk-NQPVAU63.mjs +2 -0
- package/dist/chunk-NSKUTQ5J.mjs +5 -0
- package/dist/chunk-O35FIXRB.mjs +2 -0
- package/dist/chunk-P2CAZPDP.mjs +3 -0
- package/dist/chunk-PL6GHLGD.mjs +15 -0
- package/dist/chunk-QAIHRH3I.mjs +13 -0
- package/dist/chunk-QJIR2BLP.mjs +6 -0
- package/dist/chunk-QR6A54KJ.mjs +3 -0
- package/dist/chunk-QUPLVPB2.mjs +7 -0
- package/dist/chunk-R7BNENLY.mjs +4 -0
- package/dist/chunk-S6O4UHLC.mjs +2 -0
- package/dist/chunk-SGJWQKEI.mjs +2 -0
- package/dist/chunk-SYGN7GLU.mjs +2 -0
- package/dist/chunk-TMYZB6AV.mjs +2 -0
- package/dist/chunk-TX6JH7TR.mjs +2 -0
- package/dist/chunk-TYK6VNAB.mjs +10 -0
- package/dist/chunk-U3SSPL4K.mjs +8 -0
- package/dist/chunk-U6KNPJPR.mjs +2 -0
- package/dist/chunk-UALRNVSE.mjs +4 -0
- package/dist/chunk-UH4SIXTR.mjs +2 -0
- package/dist/chunk-UMHUSOPJ.mjs +2 -0
- package/dist/chunk-V3HXVQEM.mjs +2 -0
- package/dist/chunk-V5JTW2LH.mjs +27 -0
- package/dist/chunk-V5VXUJKG.mjs +2 -0
- package/dist/chunk-V6XZ4VIR.mjs +2 -0
- package/dist/chunk-VBXMADMP.mjs +2 -0
- package/dist/chunk-VNV55RUA.mjs +2 -0
- package/dist/chunk-VPD2PS35.mjs +2 -0
- package/dist/chunk-W3BGBJQW.mjs +2 -0
- package/dist/chunk-W4VKN3GF.mjs +7 -0
- package/dist/chunk-W5BXXPDJ.mjs +3 -0
- package/dist/chunk-W7XHE4CT.mjs +2 -0
- package/dist/chunk-XNROSH2T.mjs +4 -0
- package/dist/chunk-XUNHRCOG.mjs +6 -0
- package/dist/chunk-Y34NR5JL.mjs +2 -0
- package/dist/chunk-Y6RLRPG3.mjs +3 -0
- package/dist/chunk-YEY3RSFQ.mjs +2 -0
- package/dist/cli.mjs +2 -0
- package/dist/server.mjs +2 -0
- package/dist/worker.mjs +5 -0
- package/kit/charts.js +355 -0
- package/kit/code.js +164 -0
- package/kit/dialogs.js +157 -0
- package/kit/math.js +2004 -0
- package/kit/report.css +2932 -0
- package/kit/runtime.js +1782 -0
- package/kit/sheets.js +123 -0
- package/kit/state.js +217 -0
- package/kit/tables.js +1499 -0
- package/kit/tokens.js +29 -0
- package/kit/ui.js +658 -0
- package/package.json +41 -4
- package/release.json +25 -0
- package/sdk/column-widths.d.ts +56 -0
- package/sdk/doc-charts.d.ts +82 -0
- package/sdk/doc-code.d.ts +28 -0
- package/sdk/doc-dialogs.d.ts +4 -0
- package/sdk/doc-kit.d.ts +147 -0
- package/sdk/doc-math.d.ts +3 -0
- package/sdk/doc-sheets.d.ts +15 -0
- package/sdk/doc-state.d.ts +41 -0
- package/sdk/doc-tables.d.ts +24 -0
- package/sdk/doc-tokens.d.ts +22 -0
- package/sdk/index.d.ts +30 -0
- package/skill/SKILL.md +150 -0
- package/skill/agents/openai.yaml +5 -0
- package/skill/references/building-components.md +367 -0
- package/skill/references/example-report.html +356 -0
- package/skill/references/writing-html.md +187 -0
- package/skill/sdk/column-widths.d.ts +56 -0
- package/skill/sdk/doc-charts.d.ts +82 -0
- package/skill/sdk/doc-code.d.ts +28 -0
- package/skill/sdk/doc-dialogs.d.ts +4 -0
- package/skill/sdk/doc-kit.d.ts +147 -0
- package/skill/sdk/doc-math.d.ts +3 -0
- package/skill/sdk/doc-sheets.d.ts +15 -0
- package/skill/sdk/doc-state.d.ts +41 -0
- package/skill/sdk/doc-tables.d.ts +24 -0
- package/skill/sdk/doc-tokens.d.ts +22 -0
- package/skill/sdk/index.d.ts +30 -0
- package/starter/doc.html +21 -0
- package/starter/doc.json +5 -0
- package/vendor/d3.v7.9.0.min.js +2 -0
- package/vendor/katex/auto-render.min.js +1 -0
- package/vendor/katex/contrib/mhchem.min.js +1 -0
- package/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/vendor/katex/katex.min.css +1 -0
- package/vendor/katex/katex.min.js +1 -0
- package/vendor/pdfjs/LICENSE +177 -0
- package/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
- package/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
- package/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
- package/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
- package/vendor/pdfjs/cmaps/LICENSE +36 -0
- package/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
- package/vendor/pdfjs/legacy/build/pdf.min.mjs +27 -0
- package/vendor/pdfjs/legacy/build/pdf.worker.min.mjs +27 -0
- package/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
- package/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/vendor/types/@types/d3/LICENSE +21 -0
- package/vendor/types/@types/d3/index.d.ts +39 -0
- package/vendor/types/@types/d3/package.json +81 -0
- package/vendor/types/@types/d3-array/LICENSE +21 -0
- package/vendor/types/@types/d3-array/index.d.ts +1118 -0
- package/vendor/types/@types/d3-array/package.json +56 -0
- package/vendor/types/@types/d3-axis/LICENSE +21 -0
- package/vendor/types/@types/d3-axis/index.d.ts +293 -0
- package/vendor/types/@types/d3-axis/package.json +47 -0
- package/vendor/types/@types/d3-brush/LICENSE +21 -0
- package/vendor/types/@types/d3-brush/index.d.ts +255 -0
- package/vendor/types/@types/d3-brush/package.json +42 -0
- package/vendor/types/@types/d3-chord/LICENSE +21 -0
- package/vendor/types/@types/d3-chord/index.d.ts +471 -0
- package/vendor/types/@types/d3-chord/package.json +40 -0
- package/vendor/types/@types/d3-color/LICENSE +21 -0
- package/vendor/types/@types/d3-color/index.d.ts +669 -0
- package/vendor/types/@types/d3-color/package.json +55 -0
- package/vendor/types/@types/d3-contour/LICENSE +21 -0
- package/vendor/types/@types/d3-contour/index.d.ts +222 -0
- package/vendor/types/@types/d3-contour/package.json +38 -0
- package/vendor/types/@types/d3-delaunay/LICENSE +21 -0
- package/vendor/types/@types/d3-delaunay/index.d.ts +316 -0
- package/vendor/types/@types/d3-delaunay/package.json +30 -0
- package/vendor/types/@types/d3-dispatch/LICENSE +21 -0
- package/vendor/types/@types/d3-dispatch/index.d.ts +96 -0
- package/vendor/types/@types/d3-dispatch/package.json +51 -0
- package/vendor/types/@types/d3-drag/LICENSE +21 -0
- package/vendor/types/@types/d3-drag/index.d.ts +395 -0
- package/vendor/types/@types/d3-drag/package.json +42 -0
- package/vendor/types/@types/d3-dsv/LICENSE +21 -0
- package/vendor/types/@types/d3-dsv/index.d.ts +482 -0
- package/vendor/types/@types/d3-dsv/package.json +45 -0
- package/vendor/types/@types/d3-ease/LICENSE +21 -0
- package/vendor/types/@types/d3-ease/index.d.ts +316 -0
- package/vendor/types/@types/d3-ease/package.json +40 -0
- package/vendor/types/@types/d3-fetch/LICENSE +21 -0
- package/vendor/types/@types/d3-fetch/index.d.ts +282 -0
- package/vendor/types/@types/d3-fetch/package.json +37 -0
- package/vendor/types/@types/d3-force/LICENSE +21 -0
- package/vendor/types/@types/d3-force/index.d.ts +899 -0
- package/vendor/types/@types/d3-force/package.json +45 -0
- package/vendor/types/@types/d3-format/LICENSE +21 -0
- package/vendor/types/@types/d3-format/index.d.ts +337 -0
- package/vendor/types/@types/d3-format/package.json +45 -0
- package/vendor/types/@types/d3-geo/LICENSE +21 -0
- package/vendor/types/@types/d3-geo/index.d.ts +1371 -0
- package/vendor/types/@types/d3-geo/package.json +48 -0
- package/vendor/types/@types/d3-hierarchy/LICENSE +21 -0
- package/vendor/types/@types/d3-hierarchy/index.d.ts +928 -0
- package/vendor/types/@types/d3-hierarchy/package.json +50 -0
- package/vendor/types/@types/d3-interpolate/LICENSE +21 -0
- package/vendor/types/@types/d3-interpolate/index.d.ts +387 -0
- package/vendor/types/@types/d3-interpolate/package.json +47 -0
- package/vendor/types/@types/d3-path/LICENSE +21 -0
- package/vendor/types/@types/d3-path/index.d.ts +108 -0
- package/vendor/types/@types/d3-path/package.json +41 -0
- package/vendor/types/@types/d3-polygon/LICENSE +21 -0
- package/vendor/types/@types/d3-polygon/index.d.ts +41 -0
- package/vendor/types/@types/d3-polygon/package.json +40 -0
- package/vendor/types/@types/d3-quadtree/LICENSE +21 -0
- package/vendor/types/@types/d3-quadtree/index.d.ts +204 -0
- package/vendor/types/@types/d3-quadtree/package.json +45 -0
- package/vendor/types/@types/d3-random/LICENSE +21 -0
- package/vendor/types/@types/d3-random/index.d.ts +313 -0
- package/vendor/types/@types/d3-random/package.json +41 -0
- package/vendor/types/@types/d3-scale/LICENSE +21 -0
- package/vendor/types/@types/d3-scale/index.d.ts +2669 -0
- package/vendor/types/@types/d3-scale/package.json +53 -0
- package/vendor/types/@types/d3-scale-chromatic/LICENSE +21 -0
- package/vendor/types/@types/d3-scale-chromatic/index.d.ts +520 -0
- package/vendor/types/@types/d3-scale-chromatic/package.json +46 -0
- package/vendor/types/@types/d3-selection/LICENSE +21 -0
- package/vendor/types/@types/d3-selection/index.d.ts +1210 -0
- package/vendor/types/@types/d3-selection/package.json +56 -0
- package/vendor/types/@types/d3-shape/LICENSE +21 -0
- package/vendor/types/@types/d3-shape/index.d.ts +2792 -0
- package/vendor/types/@types/d3-shape/package.json +53 -0
- package/vendor/types/@types/d3-time/LICENSE +21 -0
- package/vendor/types/@types/d3-time/index.d.ts +697 -0
- package/vendor/types/@types/d3-time/package.json +46 -0
- package/vendor/types/@types/d3-time-format/LICENSE +21 -0
- package/vendor/types/@types/d3-time-format/index.d.ts +202 -0
- package/vendor/types/@types/d3-time-format/package.json +40 -0
- package/vendor/types/@types/d3-timer/LICENSE +21 -0
- package/vendor/types/@types/d3-timer/index.d.ts +68 -0
- package/vendor/types/@types/d3-timer/package.json +45 -0
- package/vendor/types/@types/d3-transition/LICENSE +21 -0
- package/vendor/types/@types/d3-transition/index.d.ts +664 -0
- package/vendor/types/@types/d3-transition/package.json +47 -0
- package/vendor/types/@types/d3-zoom/LICENSE +21 -0
- package/vendor/types/@types/d3-zoom/index.d.ts +611 -0
- package/vendor/types/@types/d3-zoom/package.json +48 -0
- package/vendor/types/@types/geojson/LICENSE +21 -0
- package/vendor/types/@types/geojson/index.d.ts +202 -0
- package/vendor/types/@types/geojson/package.json +46 -0
- package/vendor/typescript/LICENSE.txt +55 -0
- package/vendor/typescript/lib.decorators.d.ts +384 -0
- package/vendor/typescript/lib.decorators.legacy.d.ts +22 -0
- package/vendor/typescript/lib.dom.d.ts +39429 -0
- package/vendor/typescript/lib.dom.iterable.d.ts +571 -0
- package/vendor/typescript/lib.es2015.collection.d.ts +147 -0
- package/vendor/typescript/lib.es2015.core.d.ts +597 -0
- package/vendor/typescript/lib.es2015.d.ts +28 -0
- package/vendor/typescript/lib.es2015.generator.d.ts +77 -0
- package/vendor/typescript/lib.es2015.iterable.d.ts +605 -0
- package/vendor/typescript/lib.es2015.promise.d.ts +81 -0
- package/vendor/typescript/lib.es2015.proxy.d.ts +128 -0
- package/vendor/typescript/lib.es2015.reflect.d.ts +144 -0
- package/vendor/typescript/lib.es2015.symbol.d.ts +46 -0
- package/vendor/typescript/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/vendor/typescript/lib.es2016.array.include.d.ts +116 -0
- package/vendor/typescript/lib.es2016.d.ts +21 -0
- package/vendor/typescript/lib.es2016.intl.d.ts +31 -0
- package/vendor/typescript/lib.es2017.arraybuffer.d.ts +21 -0
- package/vendor/typescript/lib.es2017.d.ts +26 -0
- package/vendor/typescript/lib.es2017.date.d.ts +31 -0
- package/vendor/typescript/lib.es2017.intl.d.ts +44 -0
- package/vendor/typescript/lib.es2017.object.d.ts +49 -0
- package/vendor/typescript/lib.es2017.sharedmemory.d.ts +135 -0
- package/vendor/typescript/lib.es2017.string.d.ts +45 -0
- package/vendor/typescript/lib.es2017.typedarrays.d.ts +53 -0
- package/vendor/typescript/lib.es2018.asyncgenerator.d.ts +77 -0
- package/vendor/typescript/lib.es2018.asynciterable.d.ts +53 -0
- package/vendor/typescript/lib.es2018.d.ts +24 -0
- package/vendor/typescript/lib.es2018.intl.d.ts +83 -0
- package/vendor/typescript/lib.es2018.promise.d.ts +30 -0
- package/vendor/typescript/lib.es2018.regexp.d.ts +37 -0
- package/vendor/typescript/lib.es2019.array.d.ts +79 -0
- package/vendor/typescript/lib.es2019.d.ts +24 -0
- package/vendor/typescript/lib.es2019.intl.d.ts +23 -0
- package/vendor/typescript/lib.es2019.object.d.ts +33 -0
- package/vendor/typescript/lib.es2019.string.d.ts +37 -0
- package/vendor/typescript/lib.es2019.symbol.d.ts +24 -0
- package/vendor/typescript/lib.es2020.bigint.d.ts +765 -0
- package/vendor/typescript/lib.es2020.d.ts +27 -0
- package/vendor/typescript/lib.es2020.date.d.ts +42 -0
- package/vendor/typescript/lib.es2020.intl.d.ts +474 -0
- package/vendor/typescript/lib.es2020.number.d.ts +28 -0
- package/vendor/typescript/lib.es2020.promise.d.ts +47 -0
- package/vendor/typescript/lib.es2020.sharedmemory.d.ts +99 -0
- package/vendor/typescript/lib.es2020.string.d.ts +44 -0
- package/vendor/typescript/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/vendor/typescript/lib.es2021.d.ts +23 -0
- package/vendor/typescript/lib.es2021.intl.d.ts +166 -0
- package/vendor/typescript/lib.es2021.promise.d.ts +48 -0
- package/vendor/typescript/lib.es2021.string.d.ts +33 -0
- package/vendor/typescript/lib.es2021.weakref.d.ts +78 -0
- package/vendor/typescript/lib.es2022.array.d.ts +121 -0
- package/vendor/typescript/lib.es2022.d.ts +25 -0
- package/vendor/typescript/lib.es2022.error.d.ts +75 -0
- package/vendor/typescript/lib.es2022.intl.d.ts +145 -0
- package/vendor/typescript/lib.es2022.object.d.ts +26 -0
- package/vendor/typescript/lib.es2022.regexp.d.ts +39 -0
- package/vendor/typescript/lib.es2022.string.d.ts +25 -0
- package/vendor/typescript/lib.es5.d.ts +4601 -0
- package/vendor/typescript/package.json +4 -0
- package/vendor/typescript/typescript.js +446 -0
- package/web/assets/index-Bh74DfsV.css +1 -0
- package/web/assets/index-UW0RyFFt.js +13 -0
- package/web/index.html +14 -0
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
import { UNIT, dropIfEmpty, holderItem, isEmpty, isHost, keepLine, nestedBlocks, nestedLists, newContainer, newHost, newTail, ownHTML, parentItem, placeBefore } from "../../page/core.mjs";
|
|
2
|
+
import { caretAt, select } from "../../page/caret.mjs";
|
|
3
|
+
import { markerAt } from "../../page/geometry.mjs";
|
|
4
|
+
import { rangeAt, rangeOffsets } from "../../page/marks.mjs";
|
|
5
|
+
import { begin, done, made } from "../../page/made.mjs";
|
|
6
|
+
import { createMenu } from "../../page/menu.mjs";
|
|
7
|
+
import { keptByComponent } from "../../page/page-objects.mjs";
|
|
8
|
+
import { hideTooltip, tooltipAt } from "../../page/tooltip.mjs";
|
|
9
|
+
import { addStyle, element } from "../../page/ui.mjs";
|
|
10
|
+
import { CHECKED, CONTINUE, FLOW, START, TODO, heldListType, holdsSays, listType, mergeSays } from "./index.mjs";
|
|
11
|
+
import { BLOCK_TYPES, accepts } from "../registry.mjs";
|
|
12
|
+
import { FLOW_KEY, isFlowLabel } from "../../../shared/components/list.mjs";
|
|
13
|
+
import { tidyLists } from "./join.mjs";
|
|
14
|
+
import { continuation, formatNumber, formatOf, keepContinuing, numberOf, parseNumber } from "./numbers.mjs";
|
|
15
|
+
import { t } from "../../../shared/i18n/index.mjs";
|
|
16
|
+
|
|
17
|
+
// Lists on the page (Feishu's and Notion's ways, docs/editor.md "Lists"). An item indents under the
|
|
18
|
+
// item before it (Tab): it goes to the end of that item's last list (a new list of its own kind when
|
|
19
|
+
// it has none), its own lists coming along. Back out (Shift+Tab, Backspace at the start of a nested
|
|
20
|
+
// item, Enter on it empty), it goes right after the item it hung from, and the items after it in its
|
|
21
|
+
// list become its own (at the end of its last list). Several selected items indent and outdent
|
|
22
|
+
// together. Backspace at the start of an item of a list in a flow turns it into body text where it
|
|
23
|
+
// stands (the list split there, the items after it numbered from 1 again), its own lists following it;
|
|
24
|
+
// Enter at its start puts an empty item above it; Enter on it empty turns it into body text. A
|
|
25
|
+
// whole list turns into the other kind of list (retagList, the block menu). A flowchart (流程图) is
|
|
26
|
+
// components/flowchart/'s: its steps are nodes, never items, so nothing here reaches them (an item of a
|
|
27
|
+
// list a node holds is the outermost of its list: core.mjs parentItem stops at the node); its 方向,
|
|
28
|
+
// the flowchart's and a node's, is that component's too (components/flowchart/page.mjs menuItems).
|
|
29
|
+
//
|
|
30
|
+
// Numbers as notion-lite counts them (view/frame/children.js): consecutive items are one list from 1;
|
|
31
|
+
// a block between two lists starts the second at 1 again, and lists a change sets side by side
|
|
32
|
+
// become one (join.mjs). A number is the reader's to set too: a click on it opens 开始新列表 (from 1
|
|
33
|
+
// again) and 修改编号值 (a number of its own, typed as its depth writes numbers: 3, c, iii). On an
|
|
34
|
+
// item in the middle of a list, a new list starts there (the list split). A list right after
|
|
35
|
+
// another with a number of its own says so (its start written, 1 too), so it is not joined to it.
|
|
36
|
+
// "3. " typed at a block's start begins a list at 3. A list a file writes counting on from the one
|
|
37
|
+
// before it (data-continue) keeps its start in step as the lists before it change (keepContinuing).
|
|
38
|
+
|
|
39
|
+
const isItem = (node) => node?.localName === "li";
|
|
40
|
+
const itemsOf = (list) => [...list.children].filter(isItem);
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Turn a list into another kind of list (`type`: bullets, numbers, todo): a new element of its tag
|
|
44
|
+
* with the same attributes (a numbered one's own only on an ol, the to-do class only on a to-do
|
|
45
|
+
* list) and items. What the kit set on a flowchart (the key of its layout, the name it gave it) is
|
|
46
|
+
* the kit's, never carried. A list and a flowchart are made of each other node by item
|
|
47
|
+
* (components/flowchart/page.mjs), not retagged.
|
|
48
|
+
*/
|
|
49
|
+
export function retagList(list, type) {
|
|
50
|
+
const { tag, className } = BLOCK_TYPES[type];
|
|
51
|
+
const next = list.ownerDocument.createElement(tag);
|
|
52
|
+
const kits = (name, value) => name === FLOW_KEY || (name === "aria-label" && isFlowLabel(value) && list.classList.contains(FLOW));
|
|
53
|
+
for (const { name, value } of list.attributes) if ((tag === "ol" || (name !== START && name !== CONTINUE)) && !kits(name, value)) next.setAttribute(name, value);
|
|
54
|
+
for (const name of [TODO, FLOW]) next.classList.toggle(name, name === className);
|
|
55
|
+
if (next.getAttribute("class") === "") next.removeAttribute("class");
|
|
56
|
+
next.setAttribute("data-ge-type", type);
|
|
57
|
+
if (list.hasAttribute("data-ge-unit")) next.setAttribute("data-ge-convert", list.getAttribute("data-ge-unit"));
|
|
58
|
+
list.replaceWith(next);
|
|
59
|
+
placeBefore(next, [...list.childNodes], null);
|
|
60
|
+
return next;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// ---------- nested list items ----------
|
|
64
|
+
|
|
65
|
+
// An item that may hold lists: in the file (its list-holding box) or made on the page.
|
|
66
|
+
const nestable = (item) => item?.tagName === "LI" && (item.getAttribute("data-ge-box-kind") === "nest" || (item.hasAttribute("data-ge-new") && !item.hasAttribute("data-ge-unit")));
|
|
67
|
+
const inBox = (item) => Boolean(item?.parentElement?.hasAttribute("data-ge-box"));
|
|
68
|
+
|
|
69
|
+
// The last list of an item that takes items, when it is the last block the item holds, or a new one of
|
|
70
|
+
// this type (bullets, numbers, todo: heldListType) put at its end.
|
|
71
|
+
function listIn(item, type) {
|
|
72
|
+
const last = nestedBlocks(item).at(-1);
|
|
73
|
+
if (last?.matches("ul, ol") && last.hasAttribute("data-ge-box")) return last;
|
|
74
|
+
const list = made(newContainer(item.ownerDocument, heldListType(type)));
|
|
75
|
+
item.append(list);
|
|
76
|
+
return list;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Whether a list item can indent (Tab) or outdent (Shift+Tab). */
|
|
80
|
+
export function canNest(item, delta) {
|
|
81
|
+
if (item?.tagName !== "LI" || !inBox(item)) return false;
|
|
82
|
+
if (delta > 0) return nestable(item.previousElementSibling) && item.previousElementSibling.tagName === "LI";
|
|
83
|
+
const parent = parentItem(item);
|
|
84
|
+
return Boolean(parent) && inBox(parent) && (item.nextElementSibling === null || nestable(item));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** The containers whose child lists indenting or outdenting an item may change. */
|
|
88
|
+
export function nestParents(item) {
|
|
89
|
+
const list = item.parentElement;
|
|
90
|
+
const parent = parentItem(item);
|
|
91
|
+
const previous = item.previousElementSibling;
|
|
92
|
+
return [...new Set([list, parent, parent?.parentElement, previous, nestedLists(previous).at(-1), item, nestedLists(item).at(-1)].filter((node) => node?.nodeType === 1))];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Tab: the item goes under the one before it.
|
|
96
|
+
function indentOne(item) {
|
|
97
|
+
if (!canNest(item, 1)) return false;
|
|
98
|
+
placeBefore(listIn(item.previousElementSibling, listType(item.parentElement)), [item], null);
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Shift+Tab: the item goes out of its list, right after the item it hung from; the items after it
|
|
103
|
+
// in its list become its own.
|
|
104
|
+
function outdentOne(item) {
|
|
105
|
+
if (!canNest(item, -1)) return false;
|
|
106
|
+
const list = item.parentElement;
|
|
107
|
+
const parent = parentItem(item);
|
|
108
|
+
const rest = [...list.children].slice([...list.children].indexOf(item) + 1);
|
|
109
|
+
if (rest.length > 0) placeBefore(listIn(item, listType(list)), rest, null);
|
|
110
|
+
placeBefore(parent.parentElement, [item], parent.nextSibling);
|
|
111
|
+
dropIfEmpty(list);
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Tab: the item goes under the one before it. Returns { focus, created }. */
|
|
116
|
+
export function indentItem(item) {
|
|
117
|
+
begin();
|
|
118
|
+
return done(indentOne(item) ? item : null);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Shift+Tab: the item goes out of its list, right after the item it hung from. Returns { focus, created }. */
|
|
122
|
+
export function outdentItem(item) {
|
|
123
|
+
begin();
|
|
124
|
+
return done(outdentOne(item) ? item : null);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// ---------- other blocks under an item ----------
|
|
128
|
+
// A block of another kind (a paragraph, a heading, an image…) goes under a list item as notion-lite's
|
|
129
|
+
// child of an item does (editor/commands/indent.js): Tab right after a list puts it under that list's
|
|
130
|
+
// last item, at the end of what the item holds; Shift+Tab (or Backspace at its start) on the last
|
|
131
|
+
// block an item holds takes it out, right after the item: the item's list split there, the items
|
|
132
|
+
// after it a list of their own after the block (numbered from 1 again, as a block between lists
|
|
133
|
+
// makes them).
|
|
134
|
+
|
|
135
|
+
// The item right before a block: the last item of the list right before it.
|
|
136
|
+
const itemBefore = (block) => (block?.previousElementSibling?.matches("ul, ol") ? itemsOf(block.previousElementSibling).at(-1) ?? null : null);
|
|
137
|
+
|
|
138
|
+
/** Whether a block that is no list item can go under the item before it (`delta` 1) or out of the item holding it (-1). */
|
|
139
|
+
export function canHold(block, delta) {
|
|
140
|
+
if (!block || isItem(block) || !inBox(block) || !accepts("nest", block.getAttribute("data-ge-unit-kind"))) return false;
|
|
141
|
+
if (delta > 0) {
|
|
142
|
+
const item = itemBefore(block);
|
|
143
|
+
return nestable(item) && inBox(item);
|
|
144
|
+
}
|
|
145
|
+
const item = holderItem(block);
|
|
146
|
+
return Boolean(item) && nestedBlocks(item).at(-1) === block && inBox(item) && inBox(item.parentElement);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** The containers whose child lists `hold` changes for a block. */
|
|
150
|
+
export function holdParents(block, delta) {
|
|
151
|
+
const item = delta > 0 ? itemBefore(block) : holderItem(block);
|
|
152
|
+
return [...new Set([block.parentElement, item, item?.parentElement, item?.parentElement?.parentElement].filter(Boolean))];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function holdOne(block, delta) {
|
|
156
|
+
if (!canHold(block, delta)) return false;
|
|
157
|
+
if (delta > 0) {
|
|
158
|
+
placeBefore(itemBefore(block), [block], null);
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
const item = holderItem(block);
|
|
162
|
+
const list = item.parentElement;
|
|
163
|
+
const rest = itemsOf(list).slice(itemsOf(list).indexOf(item) + 1);
|
|
164
|
+
placeBefore(list.parentElement, [block], list.nextSibling);
|
|
165
|
+
if (rest.length > 0) {
|
|
166
|
+
const tail = made(newTail(list, listType(list)));
|
|
167
|
+
block.after(tail);
|
|
168
|
+
placeBefore(tail, rest, null);
|
|
169
|
+
}
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** Tab (1) or Shift+Tab (-1) on a block that is no item: under the item before it, or out of the one holding it. Returns { focus, created }. */
|
|
174
|
+
export function holdBlock(block, delta) {
|
|
175
|
+
begin();
|
|
176
|
+
return done(holdOne(block, delta) ? block : null);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// ---------- the numbers' look while the page is edited ----------
|
|
180
|
+
|
|
181
|
+
const STYLE = `
|
|
182
|
+
[data-ge-editing] main ol > li[data-ge-number]::before { background: var(--ge-hover); cursor: pointer; }
|
|
183
|
+
[data-ge-editing] main ol > li[data-ge-number="pressed"]::before { background: var(--ge-press); }
|
|
184
|
+
[data-ge-editing] main ul.doc-todo > li::before { cursor: pointer; }
|
|
185
|
+
.ge-list-value { display: flex; align-items: center; gap: 8px; padding: 10px 12px 12px; }
|
|
186
|
+
.ge-list-value-title { padding: 10px 12px 0; color: var(--ge-tx2); font-size: 12px; font-weight: 500; line-height: 14px; }
|
|
187
|
+
.ge-list-value input { box-sizing: border-box; flex: 1; min-width: 0; height: 28px; margin: 0; padding: 0 8px; border: 0; border-radius: 6px; outline: none; background: var(--ge-hover); color: var(--ge-tx); font: inherit; box-shadow: inset 0 0 0 1px var(--ge-line); }
|
|
188
|
+
.ge-list-value input:focus { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ge-tx3) 60%, transparent); }
|
|
189
|
+
.ge-list-value button { flex: none; height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: var(--ge-accent); color: #fff; font: inherit; cursor: pointer; }
|
|
190
|
+
.ge-list-value button:hover { background: var(--ge-accent-hover); }
|
|
191
|
+
`;
|
|
192
|
+
|
|
193
|
+
// ---------- keys, numbers ----------
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Lists' keys and numbers, with what the editor gives it: struct (a structural undo step), say,
|
|
197
|
+
* convertHost (a text block turned into a type), targetsOf (convert.mjs), look (an
|
|
198
|
+
* undoable change of a block's attributes, history.mjs: look(element, change, select), `select`
|
|
199
|
+
* selected again on undo), isEditing and blocks() (the block tools, whose selection a click on a box follows).
|
|
200
|
+
*/
|
|
201
|
+
export function create({ struct, say, convertHost, targetsOf, look, isEditing, blocks }) {
|
|
202
|
+
addStyle(STYLE);
|
|
203
|
+
|
|
204
|
+
// ---------- a to-do's box ----------
|
|
205
|
+
// A click on a to-do item's box (the kit's, drawn before it: todo.css) checks it or takes the
|
|
206
|
+
// check away; the selected to-do items with it when it is one of them (Notion's: all to the same
|
|
207
|
+
// state), one undo step. Ctrl+Enter in an item does it for that item. The box is the item's
|
|
208
|
+
// ::before: a press on it, on its item's first line, is on it (geometry.mjs markerAt).
|
|
209
|
+
const isTodo = (item) => isItem(item) && item.parentElement?.classList.contains(TODO);
|
|
210
|
+
const onBox = (item, x, y) => markerAt(item, x, y) !== null;
|
|
211
|
+
function check(items) {
|
|
212
|
+
const todo = items.filter(isTodo);
|
|
213
|
+
if (todo.length === 0) return false;
|
|
214
|
+
const checked = !todo[0].hasAttribute(CHECKED);
|
|
215
|
+
look(todo, { attributes: { [CHECKED]: checked ? "" : null } });
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
document.addEventListener("mousedown", (event) => {
|
|
219
|
+
if (!isEditing() || event.button !== 0 || keptByComponent(event.target)) return;
|
|
220
|
+
const item = [...document.elementsFromPoint(event.clientX, event.clientY)].map((node) => node.closest?.("main li")).find((node) => node && isTodo(node) && onBox(node, event.clientX, event.clientY))
|
|
221
|
+
?? [...document.querySelectorAll("main ul.doc-todo > li")].find((node) => onBox(node, event.clientX, event.clientY));
|
|
222
|
+
if (!item) return;
|
|
223
|
+
event.preventDefault();
|
|
224
|
+
event.stopPropagation();
|
|
225
|
+
const chosen = blocks()?.picked ?? [];
|
|
226
|
+
check(chosen.includes(item) ? chosen : [item]);
|
|
227
|
+
}, true);
|
|
228
|
+
// Tab and Shift+Tab in a list item: it goes under the item before it, or back out a level; the
|
|
229
|
+
// caret stays where it was.
|
|
230
|
+
function nest(host, delta) {
|
|
231
|
+
if (!canNest(host, delta)) {
|
|
232
|
+
say(delta > 0 ? t("这一项上面没有同级的项,不能再缩进。") : t("这一项已经在最外层。"));
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const selection = getSelection();
|
|
236
|
+
const offsets = selection.rangeCount && host.contains(selection.anchorNode) ? rangeOffsets(host, selection.getRangeAt(0)) : null;
|
|
237
|
+
const result = struct(nestParents(host), [host], () => {
|
|
238
|
+
const { focus, created } = delta > 0 ? indentItem(host) : outdentItem(host);
|
|
239
|
+
return focus ? { touched: [focus], focus, created } : null;
|
|
240
|
+
});
|
|
241
|
+
if (!result) return;
|
|
242
|
+
host.focus({ preventScroll: true });
|
|
243
|
+
if (offsets) select(rangeAt(host, offsets));
|
|
244
|
+
else caretAt(host, "start");
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Tab or Shift+Tab with blocks selected: the selected items (not those inside another selected
|
|
249
|
+
* one) indent or outdent together, as one undo step (outdenting from the last, so each keeps its
|
|
250
|
+
* place). True when every selected block is an item and one moved.
|
|
251
|
+
*/
|
|
252
|
+
function nestBlocks(units, delta) {
|
|
253
|
+
if (units.length > 0 && units.every((unit) => !isItem(unit))) return holdBlocks(units, delta);
|
|
254
|
+
if (units.length === 0 || !units.every(isItem)) return false;
|
|
255
|
+
const items = units.filter((item) => !units.some((other) => other !== item && other.contains(item)));
|
|
256
|
+
const order = delta > 0 ? items : [...items].reverse();
|
|
257
|
+
if (!order.some((item) => canNest(item, delta))) {
|
|
258
|
+
say(delta > 0 ? t("选中的项上面没有同级的项,不能再缩进。") : t("选中的项已经在最外层。"));
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
const parents = [...new Set(items.flatMap((item) => [...nestParents(item), ...nestParents(item).flatMap((node) => isItem(node) ? nestParents(node) : [])]))];
|
|
262
|
+
struct(parents, items, () => {
|
|
263
|
+
begin();
|
|
264
|
+
const moved = order.filter((item) => (delta > 0 ? indentOne(item) : outdentOne(item)));
|
|
265
|
+
const { created } = done(null);
|
|
266
|
+
return moved.length > 0 ? { touched: items, focus: null, created, select: items, reselect: true } : null;
|
|
267
|
+
});
|
|
268
|
+
say(t("{0} {1} 项 · Ctrl+Z 撤销", delta > 0 ? t("已缩进") : t("已取消缩进"), items.length));
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Selected blocks that are no items (a paragraph, an image…): under the item before the first, in
|
|
273
|
+
// their order, or out of the item holding them, the last first (each the last it holds by then);
|
|
274
|
+
// one undo step. True when they were the list's to move (a list right before them, or an item
|
|
275
|
+
// holding them).
|
|
276
|
+
function holdBlocks(units, delta) {
|
|
277
|
+
const order = delta > 0 ? units : [...units].reverse();
|
|
278
|
+
if (!canHold(order[0], delta)) return false;
|
|
279
|
+
const parents = [...new Set(order.flatMap((unit) => holdParents(unit, delta)))];
|
|
280
|
+
struct(parents, [], () => {
|
|
281
|
+
begin();
|
|
282
|
+
const moved = order.filter((unit) => holdOne(unit, delta));
|
|
283
|
+
const { created } = done(null);
|
|
284
|
+
return moved.length > 0 ? { touched: [], focus: null, created, select: units, reselect: true } : null;
|
|
285
|
+
});
|
|
286
|
+
say(t("{0} · Ctrl+Z 撤销", delta > 0 ? t("已放到上一项下面") : t("已移出这一项")));
|
|
287
|
+
return true;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// Tab or Shift+Tab in a block that is no item (a paragraph under an item, or right after a list):
|
|
291
|
+
// under the item before it, or out of the item holding it; the caret stays where it was.
|
|
292
|
+
function hold(host, delta) {
|
|
293
|
+
const selection = getSelection();
|
|
294
|
+
const offsets = selection.rangeCount && host.contains(selection.anchorNode) ? rangeOffsets(host, selection.getRangeAt(0)) : null;
|
|
295
|
+
const result = struct(holdParents(host, delta), [host], () => {
|
|
296
|
+
const { focus, created } = holdBlock(host, delta);
|
|
297
|
+
return focus ? { touched: [focus], focus, created } : null;
|
|
298
|
+
});
|
|
299
|
+
if (!result) return false;
|
|
300
|
+
host.focus({ preventScroll: true });
|
|
301
|
+
if (offsets) select(rangeAt(host, offsets));
|
|
302
|
+
else caretAt(host, "start");
|
|
303
|
+
say(t("{0} · Ctrl+Z 撤销", delta > 0 ? t("已放到上一项下面") : t("已移出这一项")));
|
|
304
|
+
return true;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// Enter on an empty nested item: it moves out a level (typing/leave.mjs, which turns an empty
|
|
308
|
+
// item of a list in a flow into body text, Feishu's and Notion's). True when it did. Enter at the
|
|
309
|
+
// start of an item with text puts an empty item above it (the editor's split does).
|
|
310
|
+
function outdentEmpty(host) {
|
|
311
|
+
if (!isEmpty(host) || !parentItem(host) || !canNest(host, -1)) return false;
|
|
312
|
+
nest(host, -1);
|
|
313
|
+
return true;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// Enter on an empty item: a nested one moves out a level, and one of a list in a flow holding blocks
|
|
317
|
+
// turns into body text where it stands, what it holds after it, as Backspace turns it (notion-lite's
|
|
318
|
+
// Enter on an empty block of a type that resets: text, its children kept); one holding none is
|
|
319
|
+
// typing/leave.mjs's. True when it was the list's to handle.
|
|
320
|
+
function enterEmpty(host) {
|
|
321
|
+
if (outdentEmpty(host)) return true;
|
|
322
|
+
return isEmpty(host) && nestedBlocks(host).length > 0 && backspace(host);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// Backspace at the start of a list item; true when it was the list's to handle. A nested item
|
|
326
|
+
// moves out a level. An item of a list in a flow turns into body text where it stands (Feishu's and
|
|
327
|
+
// Notion's: first into text, and only then does Backspace join it to the line above); an item
|
|
328
|
+
// holding lists takes them along after it. The items after it are a list of their own, from 1.
|
|
329
|
+
function backspace(host) {
|
|
330
|
+
if (parentItem(host) && canNest(host, -1)) {
|
|
331
|
+
nest(host, -1);
|
|
332
|
+
return true;
|
|
333
|
+
}
|
|
334
|
+
if (host.tagName !== "LI" || parentItem(host) || !inBox(host)) return false;
|
|
335
|
+
if (nestedBlocks(host).length > 0) return toBodyText(host);
|
|
336
|
+
if (targetsOf(host).includes("paragraph")) {
|
|
337
|
+
convertHost(host, "paragraph");
|
|
338
|
+
return true;
|
|
339
|
+
}
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// An item holding lists turned into body text: a paragraph where it stood (its list split there,
|
|
344
|
+
// the items after it from 1 again), its lists right after the paragraph.
|
|
345
|
+
function toBodyText(host) {
|
|
346
|
+
const list = host.parentElement;
|
|
347
|
+
const flow = list.parentElement;
|
|
348
|
+
if (!flow?.hasAttribute("data-ge-box") || !nestedBlocks(host).every((inner) => inner.matches(UNIT))) return false;
|
|
349
|
+
let paragraph = null;
|
|
350
|
+
const result = struct([list, flow, host], [host], () => {
|
|
351
|
+
begin();
|
|
352
|
+
const items = itemsOf(list);
|
|
353
|
+
const index = items.indexOf(host);
|
|
354
|
+
const rest = items.slice(index + 1);
|
|
355
|
+
paragraph = newHost(host.ownerDocument, "paragraph");
|
|
356
|
+
paragraph.innerHTML = ownHTML(host);
|
|
357
|
+
const lists = nestedBlocks(host);
|
|
358
|
+
if (index === 0) list.before(paragraph, ...lists);
|
|
359
|
+
else {
|
|
360
|
+
if (rest.length > 0) {
|
|
361
|
+
const tail = made(newTail(list, listType(list)));
|
|
362
|
+
placeBefore(tail, rest, null);
|
|
363
|
+
list.after(tail);
|
|
364
|
+
}
|
|
365
|
+
list.after(paragraph, ...lists);
|
|
366
|
+
}
|
|
367
|
+
host.remove();
|
|
368
|
+
dropIfEmpty(list);
|
|
369
|
+
const { created } = done(paragraph);
|
|
370
|
+
return { touched: [paragraph], focus: paragraph, created };
|
|
371
|
+
});
|
|
372
|
+
if (!result) return false;
|
|
373
|
+
caretAt(paragraph, "start");
|
|
374
|
+
say(t("已转换为文本 · Ctrl+Z 撤销"));
|
|
375
|
+
return true;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// "3. " typed at a block's start, which a conversion made a numbered item of (markdown/): the item
|
|
379
|
+
// shows that number. First in its list, the list starts there (the items after it counting on);
|
|
380
|
+
// further down, it begins a list of its own at the number, the items after it in it. Runs inside
|
|
381
|
+
// the conversion's undo step; returns the lists it made.
|
|
382
|
+
function numberTyped(item, number) {
|
|
383
|
+
const list = item?.parentElement;
|
|
384
|
+
if (list?.localName !== "ol" || !Number.isInteger(number) || number < 1 || numberOf(item) === number) return [];
|
|
385
|
+
const items = itemsOf(list);
|
|
386
|
+
const index = items.indexOf(item);
|
|
387
|
+
if (index === 0) {
|
|
388
|
+
const start = ownStart(list, number);
|
|
389
|
+
if (start === null) list.removeAttribute(START);
|
|
390
|
+
else list.setAttribute(START, start);
|
|
391
|
+
list.removeAttribute(CONTINUE);
|
|
392
|
+
return [];
|
|
393
|
+
}
|
|
394
|
+
const own = newContainer(item.ownerDocument, "numbers");
|
|
395
|
+
own.setAttribute(START, String(number)); // right after the list it leaves: a start of its own, 1 too
|
|
396
|
+
list.after(own);
|
|
397
|
+
placeBefore(own, items.slice(index), null);
|
|
398
|
+
return [own];
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// What a Markdown shortcut set on the item it made (`props` of a type's `markdown`): the number it
|
|
402
|
+
// shows, or checked. Runs inside the conversion's undo step; returns the lists it made.
|
|
403
|
+
function setProps(item, { number, checked }) {
|
|
404
|
+
if (checked) item.setAttribute(CHECKED, "");
|
|
405
|
+
return number ? numberTyped(item, number) : [];
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// The start a list writes for its first number: none for 1, unless it stands right after another
|
|
409
|
+
// numbered list, which it would otherwise join (join.mjs).
|
|
410
|
+
const ownStart = (list, number) => (number === 1 && !(list.previousElementSibling?.localName === "ol" && listType(list.previousElementSibling) === "numbers") ? null : String(number));
|
|
411
|
+
|
|
412
|
+
// ---------- a number clicked ----------
|
|
413
|
+
|
|
414
|
+
const menu = createMenu();
|
|
415
|
+
let hovered = null;
|
|
416
|
+
|
|
417
|
+
// The number of an item of a numbered list the editor may change, under a point: { item, rect }.
|
|
418
|
+
function numberAt(target, x, y) {
|
|
419
|
+
const item = target?.closest?.("main li");
|
|
420
|
+
const list = item?.parentElement;
|
|
421
|
+
if (!isEditing() || list?.localName !== "ol" || listType(list) !== "numbers" || !list.hasAttribute("data-ge-box") || list.hasAttribute("data-ge-keep")) return null;
|
|
422
|
+
const rect = markerAt(item, x, y);
|
|
423
|
+
return rect ? { item, rect } : null;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
function hover(found) {
|
|
427
|
+
const item = found?.item ?? null;
|
|
428
|
+
if (item === hovered) return;
|
|
429
|
+
if (hovered && hovered.getAttribute("data-ge-number") !== "open") hovered.removeAttribute("data-ge-number");
|
|
430
|
+
hideTooltip();
|
|
431
|
+
hovered = item;
|
|
432
|
+
if (!item) return;
|
|
433
|
+
if (!item.hasAttribute("data-ge-number")) item.setAttribute("data-ge-number", "");
|
|
434
|
+
if (!menu.isOpen) tooltipAt(found.rect, t("设置编号")); // after a moment, as every tooltip
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
document.addEventListener("mousemove", (event) => hover(numberAt(event.target, event.clientX, event.clientY)), { passive: true, capture: true });
|
|
438
|
+
// A press on a number moves no caret and selects nothing; its click opens the menu.
|
|
439
|
+
document.addEventListener("pointerdown", (event) => {
|
|
440
|
+
if (menu.isOpen && !menu.contains(event.target)) menu.close();
|
|
441
|
+
const found = event.button === 0 ? numberAt(event.target, event.clientX, event.clientY) : null;
|
|
442
|
+
if (!found) return;
|
|
443
|
+
event.preventDefault();
|
|
444
|
+
event.stopImmediatePropagation();
|
|
445
|
+
found.item.setAttribute("data-ge-number", "pressed");
|
|
446
|
+
}, true);
|
|
447
|
+
document.addEventListener("click", (event) => {
|
|
448
|
+
const found = numberAt(event.target, event.clientX, event.clientY);
|
|
449
|
+
if (!found) return;
|
|
450
|
+
event.preventDefault();
|
|
451
|
+
event.stopImmediatePropagation();
|
|
452
|
+
openNumbers(found.item, found.rect);
|
|
453
|
+
}, true);
|
|
454
|
+
addEventListener("scroll", (event) => { if (menu.isOpen && !menu.contains(event.target)) menu.close(); }, { passive: true, capture: true });
|
|
455
|
+
addEventListener("resize", () => menu.close());
|
|
456
|
+
|
|
457
|
+
// The menu of a number (in Notion's card): what is not possible greyed. Consecutive items count on
|
|
458
|
+
// by themselves, so there is no 继续之前的编号 (notion-lite has none).
|
|
459
|
+
function openNumbers(item, rect) {
|
|
460
|
+
hideTooltip();
|
|
461
|
+
const list = item.parentElement;
|
|
462
|
+
const first = itemsOf(list)[0] === item;
|
|
463
|
+
const number = numberOf(item);
|
|
464
|
+
item.setAttribute("data-ge-number", "open");
|
|
465
|
+
menu.open([
|
|
466
|
+
{ label: t("开始新列表"), disabled: number === 1, run: () => (first ? setFirst(list, 1) : splitAt(item, 1)) },
|
|
467
|
+
{ label: t("修改编号值"), run: () => openValue(item, rect) },
|
|
468
|
+
], rect, { label: t("设置编号"), icons: false, width: 136, highlight: false, onClose: () => item.removeAttribute("data-ge-number") });
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// 修改编号值: the number typed as its depth writes numbers (3, c, iii), ↑/↓ a step, Enter or 确定 sets it.
|
|
472
|
+
function openValue(item, rect) {
|
|
473
|
+
const list = item.parentElement;
|
|
474
|
+
const format = formatOf(list);
|
|
475
|
+
const field = element("input", { type: "text", value: formatNumber(numberOf(item), format), spellcheck: "false", autocomplete: "off", "aria-label": t("新编号") });
|
|
476
|
+
const apply = () => {
|
|
477
|
+
const value = parseNumber(field.value, format);
|
|
478
|
+
if (!Number.isInteger(value) || value < 1 || value > 999999999) {
|
|
479
|
+
say(format === "decimal" ? t("编号是从 1 开始的整数。") : format === "lower-alpha" ? t("这一层的编号是字母(a、b、c…)或数字。") : t("这一层的编号是罗马数字(i、ii、iii…)或数字。"));
|
|
480
|
+
field.focus();
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
menu.close();
|
|
484
|
+
setNumber(item, value);
|
|
485
|
+
};
|
|
486
|
+
field.addEventListener("keydown", (event) => {
|
|
487
|
+
if (event.isComposing || event.keyCode === 229) return;
|
|
488
|
+
if (event.key === "Enter") apply();
|
|
489
|
+
else if (event.key === "Escape") menu.close();
|
|
490
|
+
else if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
|
491
|
+
const value = parseNumber(field.value, format);
|
|
492
|
+
const next = Math.min(999999999, Math.max(1, (Number.isInteger(value) ? value : 1) + (event.key === "ArrowUp" ? 1 : -1)));
|
|
493
|
+
field.value = formatNumber(next, format);
|
|
494
|
+
} else return;
|
|
495
|
+
event.preventDefault();
|
|
496
|
+
});
|
|
497
|
+
const confirm = element("button", { type: "button", text: t("确定") });
|
|
498
|
+
confirm.addEventListener("mousedown", (event) => event.preventDefault());
|
|
499
|
+
confirm.addEventListener("click", apply);
|
|
500
|
+
const view = element("div", {}, element("div", { class: "ge-list-value-title", text: t("新编号为") }), element("div", { class: "ge-list-value" }, field, confirm));
|
|
501
|
+
item.setAttribute("data-ge-number", "open");
|
|
502
|
+
menu.open([{ node: view, cells: [] }], rect, { label: t("修改编号值"), icons: false, width: 148, highlight: false, onClose: () => item.removeAttribute("data-ge-number") });
|
|
503
|
+
field.focus({ preventScroll: true });
|
|
504
|
+
field.select();
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// The first item's number: the list's start (its own, from the list before it too).
|
|
508
|
+
function setFirst(list, number) {
|
|
509
|
+
if (look(list, { attributes: { [CONTINUE]: null, [START]: ownStart(list, number) } })) {
|
|
510
|
+
say(t("{0} · Ctrl+Z 撤销", number === 1 ? t("已开始新列表") : t("编号已改为 {0}", formatNumber(number, formatOf(list)))));
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
// A list right after a numbered list given the number that list counts on to: one list, its items
|
|
515
|
+
// joining that one (selected and moved as one list then), one undo step.
|
|
516
|
+
function joinPrevious(list) {
|
|
517
|
+
const previous = list.previousElementSibling;
|
|
518
|
+
const result = struct([previous, list, list.parentElement], [], () => {
|
|
519
|
+
placeBefore(previous, itemsOf(list), null);
|
|
520
|
+
list.remove();
|
|
521
|
+
return { touched: [], focus: null };
|
|
522
|
+
});
|
|
523
|
+
if (result) say(t("已接上前面的编号 · Ctrl+Z 撤销"));
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
// An item's number set: on the first, the list's start (or the list before it taken on, when it
|
|
527
|
+
// is the number that list counts on to); in the middle, a new list from the item at that number
|
|
528
|
+
// (none when it already shows it, as it counts on).
|
|
529
|
+
function setNumber(item, number) {
|
|
530
|
+
const list = item.parentElement;
|
|
531
|
+
if (itemsOf(list)[0] === item) {
|
|
532
|
+
const previous = list.previousElementSibling;
|
|
533
|
+
if (previous?.localName === "ol" && listType(previous) === "numbers" && continuation(list) === number) return joinPrevious(list); // counting on right after it: one list
|
|
534
|
+
return setFirst(list, number);
|
|
535
|
+
}
|
|
536
|
+
if (numberOf(item) === number) return;
|
|
537
|
+
splitAt(item, number);
|
|
538
|
+
caretAt(item, "end");
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
// A new numbered list from an item on, at a number (the items after it count on from it). It
|
|
542
|
+
// stands right after the list it leaves, so its start is written, 1 too: it is a list of its own.
|
|
543
|
+
function splitAt(item, number) {
|
|
544
|
+
const list = item.parentElement;
|
|
545
|
+
const result = struct([list, list.parentElement], [], () => {
|
|
546
|
+
begin();
|
|
547
|
+
const tail = made(newContainer(item.ownerDocument, "numbers"));
|
|
548
|
+
tail.setAttribute(START, String(number));
|
|
549
|
+
placeBefore(tail, itemsOf(list).slice(itemsOf(list).indexOf(item)), null);
|
|
550
|
+
list.after(tail);
|
|
551
|
+
const { created } = done(item);
|
|
552
|
+
return { touched: [], focus: item, created };
|
|
553
|
+
});
|
|
554
|
+
if (result) say(t("{0} · Ctrl+Z 撤销", number === 1 ? t("已开始新列表") : t("编号已改为 {0}", formatNumber(number, formatOf(list)))));
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// A list a file writes counting on from the one before it (data-continue) keeps its start in step
|
|
558
|
+
// as the lists before it change (items made, removed or moved, a start set): written as the page changes, never a step of
|
|
559
|
+
// its own, so undo puts it back with what it follows. A list whose start changed is drawn again:
|
|
560
|
+
// Chrome does not recount the kit's numbers (counter(list-item) in ::before) for a start set later.
|
|
561
|
+
new MutationObserver((records) => {
|
|
562
|
+
if (!isEditing()) return;
|
|
563
|
+
for (const list of new Set(records.filter((record) => record.type === "attributes" && record.target.localName === "ol").map((record) => record.target))) recount(list);
|
|
564
|
+
const lists = (nodes) => [...nodes].some((node) => node.localName === "ol" || node.localName === "ul" || isItem(node));
|
|
565
|
+
if (!records.some((record) => record.type === "attributes" || record.target.localName === "ol" || lists(record.addedNodes) || lists(record.removedNodes))) return;
|
|
566
|
+
keepContinuing(document.querySelector("main") ?? document.body);
|
|
567
|
+
}).observe(document.body, { subtree: true, childList: true, attributes: true, attributeFilter: [START, CONTINUE, "value"] });
|
|
568
|
+
|
|
569
|
+
// Its numbers drawn again: taken out of the layout and back in one go (nothing shows in between),
|
|
570
|
+
// its style attribute as it was.
|
|
571
|
+
function recount(list) {
|
|
572
|
+
if (!list.isConnected) return;
|
|
573
|
+
const style = list.getAttribute("style");
|
|
574
|
+
list.style.display = "none";
|
|
575
|
+
void list.offsetHeight;
|
|
576
|
+
if (style === null) list.removeAttribute("style");
|
|
577
|
+
else list.setAttribute("style", style);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// What a structural step may leave untidy around lists (history.mjs): the lists it set side by side
|
|
581
|
+
// (join.mjs), and an item of the containers it changes that holds blocks with no text of its own and
|
|
582
|
+
// has no line (keepLine), as the page opened on it gives it one: an item the file writes empty that
|
|
583
|
+
// Tab gave the next item, items pasted or dropped with no text over what they hold.
|
|
584
|
+
function tidy(parents) {
|
|
585
|
+
const lists = tidyLists(parents);
|
|
586
|
+
return {
|
|
587
|
+
parents: lists.parents,
|
|
588
|
+
settle(result) {
|
|
589
|
+
for (const parent of parents.filter((node) => node.isConnected)) {
|
|
590
|
+
for (const item of [parent, ...parent.querySelectorAll("li")]) if (item.localName === "li" && isHost(item)) keepLine(item);
|
|
591
|
+
}
|
|
592
|
+
return lists.settle(result);
|
|
593
|
+
},
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
return {
|
|
598
|
+
nestBlocks, setProps,
|
|
599
|
+
tidy,
|
|
600
|
+
/** What was typed or deleted in an item: one left with no text over the blocks it holds keeps its line. */
|
|
601
|
+
typed: keepLine,
|
|
602
|
+
mergeRefused: (host) => mergeSays(nestedBlocks(host)),
|
|
603
|
+
keys: {
|
|
604
|
+
// Tab and Shift+Tab in an item nest it.
|
|
605
|
+
tab({ host }, back) {
|
|
606
|
+
nest(host, back ? -1 : 1);
|
|
607
|
+
return true;
|
|
608
|
+
},
|
|
609
|
+
commandEnter: ({ host }) => check([host]), // checks a to-do (Notion's)
|
|
610
|
+
enter: ({ host }) => enterEmpty(host),
|
|
611
|
+
backspace: ({ host }) => backspace(host),
|
|
612
|
+
// Delete in an empty item holding blocks: it does not go by itself.
|
|
613
|
+
delete({ host }) {
|
|
614
|
+
if (!isEmpty(host) || nestedBlocks(host).length === 0) return false;
|
|
615
|
+
say(holdsSays(nestedBlocks(host)));
|
|
616
|
+
return true;
|
|
617
|
+
},
|
|
618
|
+
// A block of another component right after a list goes under its last item, and the last block
|
|
619
|
+
// an item holds out of it (notion-lite's indentSelf and unindentSelf, a list's alone here: no
|
|
620
|
+
// other block holds blocks that way). Tab and Shift+Tab, and Backspace at its start (notion-lite's).
|
|
621
|
+
around: {
|
|
622
|
+
tab({ host }, back) {
|
|
623
|
+
const delta = back ? -1 : 1;
|
|
624
|
+
return canHold(host, delta) && hold(host, delta);
|
|
625
|
+
},
|
|
626
|
+
backspace: ({ host }) => canHold(host, -1) && hold(host, -1),
|
|
627
|
+
},
|
|
628
|
+
},
|
|
629
|
+
/** The nodes to keep in the top layer when a modal dialog opens. */
|
|
630
|
+
get nodes() { return menu.nodes; },
|
|
631
|
+
};
|
|
632
|
+
}
|