@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,650 @@
|
|
|
1
|
+
import { RAIL } from "../../../shared/annotations.mjs";
|
|
2
|
+
import { IN_LAYER } from "../../../shared/layers.mjs";
|
|
3
|
+
import { NOTE_ADD_ICON } from "../../components/icons.mjs";
|
|
4
|
+
import { SHEETS } from "../../components/kit.mjs";
|
|
5
|
+
import { firstLineActs, handleOf, isLead, standsAsPicture, standsBeside } from "../../components/registry.mjs";
|
|
6
|
+
import { UNIT, isEmpty, isHost, nestedBlocks, unitElement, unitsOf, withLeads } from "../core.mjs";
|
|
7
|
+
import { atHeight, blankTarget, extentOf, hoverAt, measure, measuredNode } from "../geometry.mjs";
|
|
8
|
+
import { ADD, BAR, HANDLE } from "../handle-sizes.mjs";
|
|
9
|
+
import { kept } from "../kept.mjs";
|
|
10
|
+
import { ICONS } from "../menu.mjs";
|
|
11
|
+
import { own } from "../overlays.mjs";
|
|
12
|
+
import { shortcut, tooltip } from "../tooltip.mjs";
|
|
13
|
+
import { drawAt, shapeOf } from "../overlay-layer.mjs";
|
|
14
|
+
import { addStyle, element, swallowNext } from "../ui.mjs";
|
|
15
|
+
import { nodeBefore } from "../../components/flowchart/index.mjs";
|
|
16
|
+
import { t } from "../../../shared/i18n/index.mjs";
|
|
17
|
+
|
|
18
|
+
// A block's handle (docs/editor.md, "Deleting blocks" and "Selecting blocks"). While the pointer
|
|
19
|
+
// is inside a block, or on the empty space beside it (within 150px, geometry.mjs hoverAt), a handle
|
|
20
|
+
// appears left of its first line: Notion's grip (notion-lite's hover menu, editor/interactions/
|
|
21
|
+
// hover-menu.js: 18×24, six dots of its quietest icon gray, 10px left of the block), filled with the
|
|
22
|
+
// hover gray while the pointer is on it. Clicking it (or the right button) selects the block and
|
|
23
|
+
// opens the block menu (block-menu/, where "在下方新建" makes a new block below); pressing it and
|
|
24
|
+
// moving more than a few pixels drags it (drag/). Notion's "+" (beside the grip, always) is not
|
|
25
|
+
// shown (the user's, 2026-10-26): while the grip is filled, a bar of its fill stands just left of
|
|
26
|
+
// it, where Notion's "+" stands (its 24px square, all of it the bar's to reach); the pointer moving
|
|
27
|
+
// on to the bar turns it into a "+" (no fill) and the grip's fill goes, back on the grip the other
|
|
28
|
+
// way round. A click on the "+" makes an empty block below the block at its level (Alt: above, as
|
|
29
|
+
// notion-lite's), the caret in it and the "/" menu open there (`add`: the editor's addNear, which
|
|
30
|
+
// knows what goes beside each block: a flowchart's node gets a node). The pointer right of a block's
|
|
31
|
+
// middle line (notion-lite's right zone, its line at 70%, ours at 50%, with a few pixels' slack so
|
|
32
|
+
// that a pointer resting on it leaves what stands there) finds its 批注 button instead (notion-lite's
|
|
33
|
+
// .cb: 24×24, quiet gray, the same fill under the pointer), where a marker of that block stands
|
|
34
|
+
// (annotate/ markerSpot: the same place to the pixel, right of a section's strip beside the block, the
|
|
35
|
+
// strip pressable on the way to it): neither grip nor bar shows there, and a press annotates the block,
|
|
36
|
+
// or all those selected when it is one of them. A block that cannot take an annotation (one has it
|
|
37
|
+
// already, annotate/ annotated), whose button's place a marker stands on, or that stands beside another
|
|
38
|
+
// (registry.mjs standsBeside) has the handle across its whole width. A section (分区) has no handle at
|
|
39
|
+
// its left (its heading and a divider line at its top are blocks with handles of their own): with the
|
|
40
|
+
// pointer at its right side a light bar spans it, and the bar is its handle. A Sheet area's stands on
|
|
41
|
+
// its tab row, with the pointer there (Notion's tabs block: its tabs are pills with no handles,
|
|
42
|
+
// components/sheets/pills.mjs). Typing, or scrolling by the wheel, hides the handle until the pointer
|
|
43
|
+
// moves (a section's bar stays). A press on a divider line (an <hr>) selects it, as its handle does
|
|
44
|
+
// (lineAt, blocks.mjs). The handle and the bar are drawn in the editor's own layer (overlay-layer.mjs:
|
|
45
|
+
// the one of the block they stand beside), never inside a block, each belonging to the block it stands
|
|
46
|
+
// beside (overlays.mjs). A press ends when the pointer comes up, is cancelled, or the handle loses the
|
|
47
|
+
// pointer capture (then a drag under way is cancelled, never dropped). While the page is edited, its
|
|
48
|
+
// side gutters (the kit's --doc-page-gutter, --doc-wide-gutter) are at least the room the
|
|
49
|
+
// handle takes left of a block, and a little (EDGE): on a narrow window the handle stands in the
|
|
50
|
+
// margin, never over the text, as Feishu's and Notion's do; the section bar has the same room on
|
|
51
|
+
// the right. A wide window, whose column leaves more than that, does not change.
|
|
52
|
+
|
|
53
|
+
const EDGE = ADD.width + HANDLE.width + HANDLE.gap + 12; // the page's gutter while editing: the bar's square, the grip, its gap, and room to breathe (64)
|
|
54
|
+
|
|
55
|
+
const STYLE = `
|
|
56
|
+
.ge-handle { position: absolute; left: 0; top: 0; z-index: ${IN_LAYER.handle}; display: flex; align-items: center; height: ${HANDLE.height}px; touch-action: none; }
|
|
57
|
+
.ge-grip { box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: ${HANDLE.width}px; height: ${HANDLE.height}px; border-radius: 4px; color: var(--ge-ico3); cursor: grab; user-select: none; }
|
|
58
|
+
.ge-handle[data-over="grip"] > .ge-grip { background: var(--ge-hover); }
|
|
59
|
+
.ge-handle-dots { display: block; width: 10px; height: 16px; fill: currentColor; pointer-events: none; }
|
|
60
|
+
/* The bar, and the "+" it turns into: reached only while the grip is filled or the "+" shows; not
|
|
61
|
+
while the grip is pressed, nor while the block menu is open (data-menu: it opens left of the
|
|
62
|
+
grip, over the bar's square). */
|
|
63
|
+
.ge-handle-add { position: absolute; top: 0; right: 100%; display: flex; align-items: center; justify-content: center; width: ${ADD.width}px; height: ${HANDLE.height}px; color: var(--ge-ico3); cursor: pointer; pointer-events: none; }
|
|
64
|
+
.ge-handle[data-over]:not([data-pressed], [data-menu]) > .ge-handle-add { pointer-events: auto; }
|
|
65
|
+
/* The bar: the grip's own fill, three quarters of its height, 4px wide (the user's, 2026-10-26). */
|
|
66
|
+
.ge-handle-add::before { content: ""; position: absolute; top: 3px; bottom: 3px; right: 3px; width: 4px; border-radius: 2px; background: var(--ge-hover); visibility: hidden; }
|
|
67
|
+
.ge-handle[data-over="grip"]:not([data-pressed], [data-menu]) > .ge-handle-add::before { visibility: visible; }
|
|
68
|
+
.ge-handle[data-narrow] > .ge-handle-add::before { right: 1px; width: 3px; } /* in a flowchart's gap (5px beside the grip): clear of the card's border before it */
|
|
69
|
+
/* The editor's 20-unit plus at 20px with 1.32px lines and round ends: Notion's "+" in size (its plusIcon at its icons' 20px, 12.8px across). */
|
|
70
|
+
.ge-handle-add svg { display: block; flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.32; stroke-linecap: round; visibility: hidden; pointer-events: none; }
|
|
71
|
+
/* Where what is left of the grip is cut off (a detail card's edge, past which is the backdrop, where a press closes the card): its square takes half of itself, the 12px there are, and its "+" 16px, 10.5px across, its lines as heavy. */
|
|
72
|
+
.ge-handle[data-tight] > .ge-handle-add { width: ${ADD.width / 2}px; }
|
|
73
|
+
.ge-handle[data-tight] > .ge-handle-add svg { width: 16px; height: 16px; stroke-width: 1.65; }
|
|
74
|
+
.ge-handle[data-over="add"]:not([data-menu]) > .ge-handle-add svg { visibility: visible; }
|
|
75
|
+
/* A node beside the one before it in a flowchart's row: its handle in the gap between them (the
|
|
76
|
+
mock's grip), the arrow under it dimmed (as under the gap's line, columns/). */
|
|
77
|
+
ol.doc-flow > li[data-ge-handle-dim]::after { opacity: .15; }
|
|
78
|
+
/* The 批注 button right of a block. */
|
|
79
|
+
.ge-note-add { position: absolute; left: 0; top: 0; z-index: ${IN_LAYER.button}; box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: ${RAIL.marker}px; height: ${RAIL.marker}px; border-radius: 6px; color: var(--ge-ico3); cursor: pointer; pointer-events: auto; user-select: none; }
|
|
80
|
+
.ge-note-add:hover { background: var(--ge-hover); }
|
|
81
|
+
.ge-note-add svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
|
|
82
|
+
/* A section's handle: a bar along its right side (the strip is wider than the bar it shows). */
|
|
83
|
+
.ge-section-bar { position: absolute; left: 0; top: 0; z-index: ${IN_LAYER.handle}; width: 16px; cursor: pointer; touch-action: none; }
|
|
84
|
+
.ge-section-bar::before { content: ""; position: absolute; top: 0; bottom: 0; left: 6px; width: 4px; border-radius: 2px; background: light-dark(rgb(55 53 47 / 14%), rgb(255 255 255 / 14%)); transition: background .08s ease-in; }
|
|
85
|
+
.ge-section-bar:hover::before { background: light-dark(rgb(55 53 47 / 28%), rgb(255 255 255 / 26%)); }
|
|
86
|
+
.ge-section-bar[data-active]::before { background: color-mix(in srgb, var(--doc-accent, #2678d8) 60%, transparent); }
|
|
87
|
+
/* Room for the handle beside the page's blocks: the page's gutters while editing (resize/ reads --ge-edge-room). */
|
|
88
|
+
:root[data-ge-editing] { --ge-edge-room: ${EDGE}px; --doc-page-gutter: var(--ge-edge-room); --doc-wide-gutter: var(--ge-edge-room); }
|
|
89
|
+
`;
|
|
90
|
+
|
|
91
|
+
// Notion's grip in size (its dragHandle icon at its icons' 20px): 2.5px dots 5px apart across and 6px down (notion-lite's were 5px down, the grip 2px shorter than Notion's: the user, 2026-10-26).
|
|
92
|
+
const DOTS = '<svg class="ge-handle-dots" viewBox="0 0 10 16" aria-hidden="true"><circle cx="2.5" cy="2" r="1.25"/><circle cx="7.5" cy="2" r="1.25"/><circle cx="2.5" cy="8" r="1.25"/><circle cx="7.5" cy="8" r="1.25"/><circle cx="2.5" cy="14" r="1.25"/><circle cx="7.5" cy="14" r="1.25"/></svg>';
|
|
93
|
+
const MIDDLE_SLACK = 3; // what stands by a block's middle line stays until the pointer is this far past it
|
|
94
|
+
|
|
95
|
+
// The first line of a text block left empty, where it shows: an inline one's box (a disclosure's
|
|
96
|
+
// title), a block's first line inside its border and padding.
|
|
97
|
+
function emptyLine(host) {
|
|
98
|
+
const style = getComputedStyle(host);
|
|
99
|
+
const box = host.getClientRects()[0];
|
|
100
|
+
if (style.display.startsWith("inline")) return box;
|
|
101
|
+
const top = box.top + (parseFloat(style.borderTopWidth) || 0) + (parseFloat(style.paddingTop) || 0);
|
|
102
|
+
return { top, bottom: top + (parseFloat(style.lineHeight) || (parseFloat(style.fontSize) || 16) * 1.5) };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* info: block-info.mjs. active(): whether block tools may show. selection: selection/index.mjs.
|
|
107
|
+
* drag: drag/index.mjs. menu: the menu card (menu.mjs createMenu). openMenu(target, rect, side):
|
|
108
|
+
* the block menu (block-menu/). drawing(): a box selection is being drawn
|
|
109
|
+
* (selection/marquee.mjs). schedule(): the block tools' next frame (blocks.mjs). keeps(node): another
|
|
110
|
+
* tool's node over a block (a table's grips and the strips on its lines), where the pointer keeps the
|
|
111
|
+
* handle as it is, as those tools keep themselves. add(target, where): the "+" clicked, an empty
|
|
112
|
+
* block "below" the block (or "above" it: Alt) with the "/" menu open in it. notes: 批注 on blocks,
|
|
113
|
+
* notes.can(units) whether they can take one, notes.at(unit) where the button beside the block stands
|
|
114
|
+
* (window coordinates, null where it has none), notes.write(units) the annotation begun. aside(node):
|
|
115
|
+
* a node over a block the 批注 button steps aside for while the pointer is on it (a heading's fold
|
|
116
|
+
* triangle, fold/, which may stand where the button would).
|
|
117
|
+
*/
|
|
118
|
+
export function createHandle({ info, active, selection, drag, menu, openMenu, drawing, schedule, keeps = () => false, aside = () => false, add = () => {}, notes = { can: () => false, at: () => null, write: () => {} } }) {
|
|
119
|
+
addStyle(STYLE);
|
|
120
|
+
const { kindOf, boxKindOf } = info;
|
|
121
|
+
const grip = element("div", { class: "ge-grip", role: "button", "aria-label": t("打开块菜单") });
|
|
122
|
+
grip.insertAdjacentHTML("beforeend", DOTS);
|
|
123
|
+
tooltip(grip, t("拖动以移动"), t("点击打开菜单"));
|
|
124
|
+
const plus = element("div", { class: "ge-handle-add", role: "button", "aria-label": t("点击在下方添加块") });
|
|
125
|
+
plus.insertAdjacentHTML("beforeend", ICONS.plus);
|
|
126
|
+
tooltip(plus, t("点击在下方添加块"), t("{0}+点击在上方添加", shortcut("alt")));
|
|
127
|
+
const handle = element("div", { class: "ge-handle" }, plus, grip);
|
|
128
|
+
const note = element("div", { class: "ge-note-add", role: "button", "aria-label": t("批注"), html: NOTE_ADD_ICON });
|
|
129
|
+
tooltip(note, t("批注"));
|
|
130
|
+
const bar = element("div", { class: "ge-section-bar", "aria-label": t("分区菜单") });
|
|
131
|
+
tooltip(bar, t("点击打开分区菜单"), t("拖动移动分区")); // as the grip beside it
|
|
132
|
+
let hovered = null; // the block under the pointer, or beside it
|
|
133
|
+
let beside = null; // the pointer is on empty space: { x, y }, for the next frame to find the block beside it
|
|
134
|
+
let barOver = null; // the section whose right side the pointer is at
|
|
135
|
+
let barShown = null; // the section the bar stands beside
|
|
136
|
+
let shown = null; // the block the handle stands beside
|
|
137
|
+
let noted = null; // the block the 批注 button stands beside
|
|
138
|
+
let pointer = null; // { x, y, target }: where the pointer last moved over the page, and what it was on
|
|
139
|
+
let typing = false; // the handle hides while the reader types, until the pointer moves
|
|
140
|
+
let still = null; // the page scrolled with the pointer here: the handle hides until it moves away
|
|
141
|
+
let press = null; // the handle is pressed: { target, x, y }
|
|
142
|
+
let line = { node: null, width: -1, offset: 0 }; // where the handle sits on the block's first line
|
|
143
|
+
let dimmed = null; // the node whose arrow the handle stands over (nodeBefore), dimmed
|
|
144
|
+
|
|
145
|
+
const box = extentOf; // where a block shows: a list item with its marker
|
|
146
|
+
// Where a kind's handle stands is its description's (`handle`): a section's is its bar, at its right; a
|
|
147
|
+
// Sheet area, a row of columns, a column and the page's icon have none the pointer finds at them
|
|
148
|
+
// (their blocks have theirs: a Sheet area's is found on its tab row).
|
|
149
|
+
const barred = (target) => handleOf(kindOf(target)) === "bar";
|
|
150
|
+
const none = (kind) => ["bar", "none"].includes(handleOf(kind));
|
|
151
|
+
// A Sheet tab stands for its area: the area's handle, on the tab row.
|
|
152
|
+
const areaOf = (unit) => unit && handleOf(kindOf(unit)) === "outer" ? unitElement(unit.parentElement) : unit;
|
|
153
|
+
|
|
154
|
+
// ---------- where it stands ----------
|
|
155
|
+
|
|
156
|
+
// The middle of the block's first line of visible text, relative to its top (cached per width).
|
|
157
|
+
function lineOffset(target, rect) {
|
|
158
|
+
const width = Math.round(rect.right - rect.left);
|
|
159
|
+
if (line.node === target && line.width === width) return line.offset;
|
|
160
|
+
let offset = Math.min(rect.bottom - rect.top, HANDLE.height) / 2;
|
|
161
|
+
const skip = '[aria-hidden="true"], .katex-mathml, svg, [hidden], [data-doc-dev]';
|
|
162
|
+
for (const part of withLeads(target)) {
|
|
163
|
+
// A table: its first row's first line, written or not (its first words may be rows below).
|
|
164
|
+
const cell = part.matches(".doc-table-wrap") ? part.querySelector("tr > :is(td, th)") : null;
|
|
165
|
+
if (cell) {
|
|
166
|
+
const style = getComputedStyle(cell);
|
|
167
|
+
offset = cell.getBoundingClientRect().top - rect.top + (parseFloat(style.paddingTop) || 0) + (parseFloat(style.lineHeight) || 20) / 2;
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
// The first line is the first words, the first picture standing as a block (an image's picture comes before its caption's words)
|
|
171
|
+
// or the first text block left empty that shows (a disclosure's title not written yet: its title row, as Notion's handle
|
|
172
|
+
// by an empty toggle), of the block's own content: its lead (a highlight block's icon, a picture too) is not.
|
|
173
|
+
const leadKind = boxKindOf(target);
|
|
174
|
+
const ownContent = (node) => { const unit = unitElement(node.nodeType === 3 ? node.parentElement : node); return unit === target || !unit || !isLead(leadKind, kindOf(unit)); };
|
|
175
|
+
const blank = (node) => isHost(node) && isEmpty(node) && node.getClientRects().length > 0;
|
|
176
|
+
// An item of no text over the blocks it holds: its own line, ahead of them (keepLine), where its
|
|
177
|
+
// marker is, never the first line of what it holds.
|
|
178
|
+
if (blank(part) && nestedBlocks(part).length > 0) {
|
|
179
|
+
const own = emptyLine(part);
|
|
180
|
+
offset = (own.top + own.bottom) / 2 - rect.top;
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
const seen = (node) => (node.nodeType === 3
|
|
184
|
+
? Boolean(node.data.trim()) && !node.parentElement?.closest(skip) && ownContent(node)
|
|
185
|
+
: (standsAsPicture(node) || blank(node)) && !node.closest(skip) && ownContent(node));
|
|
186
|
+
const walker = document.createTreeWalker(part, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT, { acceptNode: (node) => (seen(node) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP) });
|
|
187
|
+
const text = walker.nextNode();
|
|
188
|
+
if (!text) continue;
|
|
189
|
+
if (text.nodeType === 1 && !blank(text)) break; // a picture: the handle stands at the block's top
|
|
190
|
+
const range = document.createRange();
|
|
191
|
+
range.selectNodeContents(text);
|
|
192
|
+
const first = text.nodeType === 1 ? emptyLine(text) : [...range.getClientRects()].find((r) => r.height > 0);
|
|
193
|
+
if (first) offset = (first.top + first.bottom) / 2 - rect.top;
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
line = { node: target, width, offset };
|
|
197
|
+
return offset;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// The bar along the right side of the section the pointer is at, or of the one dragged.
|
|
201
|
+
function placeBar() {
|
|
202
|
+
const picked = selection.picked;
|
|
203
|
+
const candidates = [drag.target, barOver].filter((node) => node && barred(node));
|
|
204
|
+
const target = candidates[0] ?? null;
|
|
205
|
+
const shape = target && shapeOf(target);
|
|
206
|
+
barShown = shape ? target : null;
|
|
207
|
+
if (!shape) return void bar.remove();
|
|
208
|
+
own(bar, "section bar", { owner: target, alive: () => barShown === target && target.isConnected });
|
|
209
|
+
const { rect } = shape;
|
|
210
|
+
drawAt(bar, shape.layer, rect.right + BAR.gap, rect.top);
|
|
211
|
+
bar.style.height = `${Math.max(24, Math.round(rect.bottom - rect.top))}px`;
|
|
212
|
+
bar.toggleAttribute("data-active", picked.includes(target));
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// The handle beside the block dragged, else the block under the pointer or beside it: it follows
|
|
216
|
+
// the pointer only, as Notion's and Feishu's do (a selected block has its fill, not a handle that
|
|
217
|
+
// stays); none while typing, while a box selection is drawn or while a gap is dragged (between two
|
|
218
|
+
// columns or two nodes of a flowchart's row: columns/).
|
|
219
|
+
function placeHandle() {
|
|
220
|
+
const gesture = drawing() || typing || document.documentElement.hasAttribute("data-ge-gap-drag");
|
|
221
|
+
const candidate = drag.target ?? (gesture ? null : hovered);
|
|
222
|
+
const target = candidate && !barred(candidate) && handleOf(kindOf(candidate)) !== "outer" ? candidate : null; // a tab dragged by itself has none
|
|
223
|
+
const shape = target && shapeOf(target);
|
|
224
|
+
// While dragging by it, the handle holds the pointer capture: it stays in the page even when the
|
|
225
|
+
// dragged block is out of sight (another Sheet shown), or the drop would never come; it is
|
|
226
|
+
// not moved to another layer meanwhile either (that would let the capture go).
|
|
227
|
+
if (drag.active && press && (!shape || (handle.parentNode && handle.parentNode !== shape.layer))) return;
|
|
228
|
+
// Right of the block's middle line its 批注 button stands for the handle (none while a menu is open
|
|
229
|
+
// or blocks are dragged).
|
|
230
|
+
const spot = shape && !drag.target ? noteSpot(target) : null;
|
|
231
|
+
placeNote(spot && !menu?.isOpen ? target : null, shape, spot);
|
|
232
|
+
const gripped = shape && !spot ? target : null;
|
|
233
|
+
if (gripped !== shown) reach(null); // another block's handle: no fill, no bar until the pointer is on it
|
|
234
|
+
shown = gripped;
|
|
235
|
+
// A node beside the one before it in a flowchart's row: the 28px gap between them is all the room
|
|
236
|
+
// there is (left of the node the grip would cover that node's corner and the arrow), so the grip
|
|
237
|
+
// stands in the middle of it, the arrow under it dimmed while it shows (the mock's grip); its bar
|
|
238
|
+
// and "+" stand over the corner of the node before.
|
|
239
|
+
const before = shown ? nodeBefore(target) : null;
|
|
240
|
+
if (dimmed !== before) {
|
|
241
|
+
dimmed?.removeAttribute("data-ge-handle-dim");
|
|
242
|
+
dimmed = before;
|
|
243
|
+
dimmed?.setAttribute("data-ge-handle-dim", "");
|
|
244
|
+
}
|
|
245
|
+
if (shown) {
|
|
246
|
+
own(handle, "handle", { owner: target, alive: () => shown === target && target.isConnected });
|
|
247
|
+
const { rect, origin } = shape;
|
|
248
|
+
const client = { left: rect.left + origin.left, top: rect.top + origin.top, right: rect.right + origin.left, bottom: rect.bottom + origin.top };
|
|
249
|
+
const top = rect.top + lineOffset(target, client) - HANDLE.height / 2;
|
|
250
|
+
const gap = before ? (before.getBoundingClientRect().right - origin.left + rect.left) / 2 : null; // the gap's middle, in the layer
|
|
251
|
+
const left = gap !== null ? gap - HANDLE.width / 2 : Math.max(ADD.edge + ADD.width - origin.left, rect.left - HANDLE.gap - HANDLE.width); // the bar's square in from the window's edge
|
|
252
|
+
handle.toggleAttribute("data-narrow", gap !== null);
|
|
253
|
+
handle.toggleAttribute("data-tight", Boolean(shape.clip) && left - ADD.width < shape.clip.left);
|
|
254
|
+
handle.toggleAttribute("data-menu", Boolean(menu?.isOpen));
|
|
255
|
+
drawAt(handle, shape.layer, left, top);
|
|
256
|
+
} else {
|
|
257
|
+
reach(null);
|
|
258
|
+
handle.remove();
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// What a press on the 批注 button beside `target` annotates: all the blocks selected when it is one of
|
|
263
|
+
// them, else it alone.
|
|
264
|
+
const notedBlocks = (target) => (selection.holderOf(target) ? selection.picked : [target]);
|
|
265
|
+
|
|
266
|
+
// The blocks the pointer is at as the reader sees them: a container whose first line acts for it
|
|
267
|
+
// (`firstLineActs`) and the block on that line.
|
|
268
|
+
function pointedAt(target) {
|
|
269
|
+
const kind = boxKindOf(target);
|
|
270
|
+
const first = firstLineActs(kind) ? unitsOf(target).find((child) => !isLead(kind, kindOf(child))) : null;
|
|
271
|
+
return first ? [target, first] : [target];
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// Where the 批注 button beside `target` stands (annotate/ markerSpot), with the pointer right of the
|
|
275
|
+
// block's middle line, or null where it has none: a block that takes an annotation, as do those
|
|
276
|
+
// selected with it, standing beside nothing, nor in anything that does, with its place free.
|
|
277
|
+
function noteSpot(target) {
|
|
278
|
+
const rect = pointer && !aside(pointer.target) && box(target);
|
|
279
|
+
if (!rect || pointer.x <= (rect.left + rect.right) / 2 + (noted === target ? -MIDDLE_SLACK : MIDDLE_SLACK)) return null;
|
|
280
|
+
if (!pointedAt(target).every((unit) => notes.can([unit])) || !notes.can(notedBlocks(target))) return null;
|
|
281
|
+
for (let unit = target; unit; unit = unitElement(unit.parentElement)) if (standsBeside(kindOf(unit), unit)) return null;
|
|
282
|
+
return notes.at(target);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// The 批注 button beside `target` (shown by its `shape`) at `spot`, or none.
|
|
286
|
+
function placeNote(target, shape, spot) {
|
|
287
|
+
noted = target;
|
|
288
|
+
if (!target) return void note.remove();
|
|
289
|
+
own(note, "note button", { owner: target, alive: () => noted === target && target.isConnected });
|
|
290
|
+
drawAt(note, shape.layer, spot.left - shape.origin.left, spot.top - shape.origin.top);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Where on the handle the pointer is: "grip" (filled, the bar beside it), "add" (the bar a "+"), or
|
|
294
|
+
// null. The bar is reached only from the grip (it takes the pointer only while the grip is filled
|
|
295
|
+
// or the "+" shows), so a pointer coming from the left finds the block's text, not a "+".
|
|
296
|
+
function reach(where) {
|
|
297
|
+
if (where) handle.setAttribute("data-over", where);
|
|
298
|
+
else handle.removeAttribute("data-over");
|
|
299
|
+
}
|
|
300
|
+
grip.addEventListener("pointerenter", () => reach("grip"));
|
|
301
|
+
grip.addEventListener("pointerleave", (event) => reach(plus.contains(event.relatedTarget) ? "add" : null));
|
|
302
|
+
plus.addEventListener("pointerenter", () => { if (handle.hasAttribute("data-over")) reach("add"); });
|
|
303
|
+
plus.addEventListener("pointerleave", (event) => reach(grip.contains(event.relatedTarget) ? "grip" : null));
|
|
304
|
+
// A click on the "+": the block below (Alt: above), the "/" menu open in it; the handle steps
|
|
305
|
+
// aside until the pointer moves (notion-lite's resetHover). No caret moves and no box selection
|
|
306
|
+
// starts on the press (blocks.mjs passes presses on the handle by).
|
|
307
|
+
plus.addEventListener("pointerdown", (event) => event.preventDefault());
|
|
308
|
+
plus.addEventListener("click", (event) => {
|
|
309
|
+
const target = shown;
|
|
310
|
+
if (!target || drag.active || !handle.hasAttribute("data-over")) return;
|
|
311
|
+
menu?.close();
|
|
312
|
+
reach(null);
|
|
313
|
+
hovered = null;
|
|
314
|
+
beside = null;
|
|
315
|
+
schedule();
|
|
316
|
+
swallowNext(event); // the handle has stepped aside: on the page under it the second press would take the caret out of the new block and close its menu
|
|
317
|
+
add(target, event.altKey ? "above" : "below");
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
// A click on the 批注 button: the block annotated, or those selected with it, the button stepping
|
|
321
|
+
// aside as the handle does after a click on the "+". No caret moves, no box selection starts and the
|
|
322
|
+
// blocks selected stay so on the press, until the card has taken them.
|
|
323
|
+
note.addEventListener("pointerdown", (event) => event.preventDefault());
|
|
324
|
+
note.addEventListener("click", (event) => {
|
|
325
|
+
const target = noted;
|
|
326
|
+
if (!target) return;
|
|
327
|
+
hovered = null;
|
|
328
|
+
beside = null;
|
|
329
|
+
schedule();
|
|
330
|
+
swallowNext(event);
|
|
331
|
+
notes.write(notedBlocks(target));
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
// The arrow the handle stood over shows again.
|
|
335
|
+
function undim() {
|
|
336
|
+
dimmed?.removeAttribute("data-ge-handle-dim");
|
|
337
|
+
dimmed = null;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// ---------- which block the pointer is at ----------
|
|
341
|
+
|
|
342
|
+
const inside = (rect, x, y, margin = 0) => rect && x >= rect.left - margin && x <= rect.right + margin && y >= rect.top - margin && y <= rect.bottom + margin;
|
|
343
|
+
|
|
344
|
+
// The section whose right side the pointer is at: from its right edge out past its bar, along
|
|
345
|
+
// its height (the innermost, when a Sheet area holds sections). The sections are kept between
|
|
346
|
+
// moves (kept.mjs), not looked up in the whole page on each.
|
|
347
|
+
const sections = kept(() => [...document.querySelectorAll(`main section:is(${UNIT})`)]);
|
|
348
|
+
function barAt(x, y) {
|
|
349
|
+
let found = null;
|
|
350
|
+
for (const section of sections()) {
|
|
351
|
+
if (!barred(section) || section.closest("[data-ge-dragging]")) continue;
|
|
352
|
+
const rect = box(section);
|
|
353
|
+
if (rect && y >= rect.top && y <= rect.bottom && x >= rect.right - 2 && x <= rect.right + BAR.reach) found = section;
|
|
354
|
+
}
|
|
355
|
+
return found;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function blockAt(target, x, y) {
|
|
359
|
+
if (!target?.closest || !target.closest("main")) return null;
|
|
360
|
+
// What a preview says on the page is none of it, but for a note right in a block: its top line.
|
|
361
|
+
const said = target.closest("[data-doc-dev]");
|
|
362
|
+
if (said && !said.parentElement.matches(UNIT)) return null;
|
|
363
|
+
let unit = unitElement(target);
|
|
364
|
+
// Between the blocks of a container (their margins) the nearest block wins over the
|
|
365
|
+
// container; in a Sheet's tab row, the nearest tab.
|
|
366
|
+
const container = target.closest("[data-ge-box]");
|
|
367
|
+
if (container === target && container.getAttribute("data-ge-box-kind") !== "nest") {
|
|
368
|
+
const children = [...container.children].map((child) => unitElement(child)).filter((child) => child && child.parentElement === container);
|
|
369
|
+
const row = container.matches(SHEETS.rowAt);
|
|
370
|
+
const distance = (child) => {
|
|
371
|
+
const rect = box(child);
|
|
372
|
+
return rect ? Math.max(rect.left - x, x - rect.right, 0) + (row ? 0 : Math.max(rect.top - y, y - rect.bottom, 0)) : Infinity;
|
|
373
|
+
};
|
|
374
|
+
const near = children.map((child) => [child, distance(child)]).sort((a, b) => a[1] - b[1])[0];
|
|
375
|
+
if (near && (row || near[1] <= 10)) unit = near[0];
|
|
376
|
+
}
|
|
377
|
+
unit = atPointer(unit, x, y);
|
|
378
|
+
// On a tab row, the Sheet area's handle; elsewhere in the area (its frame, a panel's empty
|
|
379
|
+
// space) none. A section's handle is its bar. A row of columns and its columns have none (as
|
|
380
|
+
// Feishu's): the blocks in them do, and empty space in a column finds them. The page's icon has
|
|
381
|
+
// its own controls.
|
|
382
|
+
if (unit && handleOf(kindOf(unit)) === "outer") return areaOf(unit);
|
|
383
|
+
if (unit && none(kindOf(unit))) return null;
|
|
384
|
+
return unit?.closest("main") ? unit : null;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// The divider line (an <hr>) a press is on, anywhere on its band (extentOf); null elsewhere, and
|
|
388
|
+
// never over text being edited or the report's controls.
|
|
389
|
+
function lineAt(target, x, y) {
|
|
390
|
+
if (!target?.closest?.("main") || target.closest('[data-doc-dev], [contenteditable="true"], a, button, input, select, textarea, summary')) return null;
|
|
391
|
+
for (const rule of document.querySelectorAll(`main hr:is(${UNIT})`)) {
|
|
392
|
+
if (inside(box(rule), x, y)) return rule;
|
|
393
|
+
}
|
|
394
|
+
return null;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// The block beside empty space at the pointer (geometry.mjs hoverAt): only what reaches its
|
|
398
|
+
// height is measured. Sections, Sheet areas and rows of columns have no handle there; their blocks do.
|
|
399
|
+
const skip = (node) => none(node.kind);
|
|
400
|
+
function besideAt(x, y) {
|
|
401
|
+
const main = document.querySelector("main");
|
|
402
|
+
if (!main) return null;
|
|
403
|
+
const top = y + scrollY;
|
|
404
|
+
return atPointer(hoverAt(measure(main, { top, bottom: top }), x + scrollX, top, { skip }), x, y);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// Of a block holding blocks (a list item and its lists, a quote, a disclosure), the one at the
|
|
408
|
+
// pointer's height (geometry.mjs atHeight): the handle follows the pointer's height, as Notion's
|
|
409
|
+
// and Feishu's, never the outer block's first line while the pointer is by an inner one, or in
|
|
410
|
+
// the gap beside one.
|
|
411
|
+
function atPointer(unit, x, y) {
|
|
412
|
+
if (!unit || !unit.querySelector(UNIT)) return firstOfPanel(unit);
|
|
413
|
+
const root = unit.parentElement?.closest("[data-ge-box]") ?? document.querySelector("main"); // measured from the box it stands in
|
|
414
|
+
if (!root) return unit;
|
|
415
|
+
const top = y + scrollY;
|
|
416
|
+
const node = measuredNode(measure(root, { top: top - 80, bottom: top + 80 }), unit);
|
|
417
|
+
return firstOfPanel(node ? atHeight(node, x + scrollX, top, { skip }).el : unit);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// The first block of a container whose first line acts for it (its description's `firstLineActs`: a
|
|
421
|
+
// highlight block's, after its icon, Notion's callout disableFirstItemHoverMenu; a callout's; a quote's) shows no
|
|
422
|
+
// handle of its own: the container's stands on its line (a disclosure's is its title row).
|
|
423
|
+
function firstOfPanel(el) {
|
|
424
|
+
const panel = el?.parentElement;
|
|
425
|
+
const kind = panel && boxKindOf(panel);
|
|
426
|
+
if (!firstLineActs(kind)) return el;
|
|
427
|
+
const first = unitsOf(panel).find((child) => !isLead(kind, kindOf(child)));
|
|
428
|
+
return first === el ? panel : el;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// The strip between the handle and the block's left edge keeps the handle of that block, at the
|
|
432
|
+
// heights where it is that block's (not by a block it holds).
|
|
433
|
+
function inGutter(target, x, y) {
|
|
434
|
+
const rect = box(target);
|
|
435
|
+
const before = rect ? nodeBefore(target) : null; // a node beside another: the gap between them alone, not that node
|
|
436
|
+
const from = before ? before.getBoundingClientRect().right : rect?.left - HANDLE.gap - HANDLE.width - 6;
|
|
437
|
+
return Boolean(rect) && y >= rect.top && y <= rect.bottom && x >= from && x <= rect.left + 2
|
|
438
|
+
&& atPointer(target, rect.left + 2, y) === target;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// The way from a block to its 批注 button keeps the block, at the heights where it is that block's:
|
|
442
|
+
// so the button stands still for a pointer going to it, past what the block holds or the hover's reach.
|
|
443
|
+
function onWay(target, x, y) {
|
|
444
|
+
if (noted !== target) return false;
|
|
445
|
+
const rect = box(target);
|
|
446
|
+
return Boolean(rect) && y >= rect.top && y <= rect.bottom && x >= rect.right - 2 && x <= note.getBoundingClientRect().right
|
|
447
|
+
&& atPointer(target, rect.right - 2, y) === target;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
function onMove(event) {
|
|
451
|
+
const { clientX: x, clientY: y, target } = event;
|
|
452
|
+
// The move the browser makes up when the page stops scrolling under a still pointer is none.
|
|
453
|
+
if (still && x === still.x && y === still.y) return;
|
|
454
|
+
still = null;
|
|
455
|
+
if (!active() || event.buttons) return;
|
|
456
|
+
typing = false;
|
|
457
|
+
pointer = { x, y, target };
|
|
458
|
+
// The pointer on the way to a 批注's marker or button finds a section's strip, which stands left of
|
|
459
|
+
// them. A card at a section's edge is the card's.
|
|
460
|
+
if (!bar.contains(target)) barOver = target?.closest?.(".ge-note-card") ? null : barAt(x, y);
|
|
461
|
+
if (!handle.contains(target) && !note.contains(target) && !menu?.contains(target) && !bar.contains(target) && !keeps(target) && !(hovered && (inGutter(hovered, x, y) || onWay(hovered, x, y)))) {
|
|
462
|
+
const block = blockAt(target, x, y);
|
|
463
|
+
// On empty space, the block beside it: found on the next frame, not on every move; the handle
|
|
464
|
+
// stays where it is until then, so crossing the gap between two blocks never makes it blink.
|
|
465
|
+
beside = !block && blankTarget(target) ? { x, y } : null;
|
|
466
|
+
if (!beside) hovered = block;
|
|
467
|
+
}
|
|
468
|
+
schedule();
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// ---------- pressing it ----------
|
|
472
|
+
|
|
473
|
+
// Pressing the handle: a click selects the block and opens its menu; moving more than a few
|
|
474
|
+
// pixels drags it.
|
|
475
|
+
const openAtHandle = (target) => {
|
|
476
|
+
const rect = handle.getBoundingClientRect(); // the menu leaves the handle in sight
|
|
477
|
+
openMenu(target, { left: rect.left, right: rect.right, top: rect.top, bottom: rect.bottom });
|
|
478
|
+
handle.toggleAttribute("data-menu", Boolean(menu?.isOpen)); // no bar beside the grip meanwhile
|
|
479
|
+
};
|
|
480
|
+
// A section's menu stands right of its bar, where it was pressed.
|
|
481
|
+
const openAtBar = (target, y) => {
|
|
482
|
+
const rect = bar.getBoundingClientRect();
|
|
483
|
+
openMenu(target, { left: rect.left, right: rect.right, top: y - 12, bottom: y + 12 }, "right");
|
|
484
|
+
};
|
|
485
|
+
// A block's handle and a section's bar: a click selects the block and opens its menu, a press
|
|
486
|
+
// moved more than a few pixels drags it.
|
|
487
|
+
const pressable = (control, current, open) => {
|
|
488
|
+
control.addEventListener("pointerdown", (event) => {
|
|
489
|
+
event.preventDefault(); // no caret, no text selection
|
|
490
|
+
if (event.button !== 0 || !current()) return;
|
|
491
|
+
press = { target: current(), x: event.clientX, y: event.clientY };
|
|
492
|
+
control.setPointerCapture?.(event.pointerId);
|
|
493
|
+
});
|
|
494
|
+
// A press drags once: a drag it started and that was cancelled (Esc, the focus lost) does not
|
|
495
|
+
// start again as the pointer goes on moving, and letting go then does nothing.
|
|
496
|
+
control.addEventListener("pointermove", (event) => {
|
|
497
|
+
if (!press) return;
|
|
498
|
+
if (press.dragged) {
|
|
499
|
+
if (drag.active) drag.move(event.clientX, event.clientY);
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
if (Math.hypot(event.clientX - press.x, event.clientY - press.y) <= 4) return;
|
|
503
|
+
if (drag.start(press.target, event.clientX, event.clientY)) press.dragged = true;
|
|
504
|
+
else press = null;
|
|
505
|
+
});
|
|
506
|
+
control.addEventListener("pointerup", (event) => {
|
|
507
|
+
const pressed = press;
|
|
508
|
+
press = null;
|
|
509
|
+
const target = pressed && !pressed.dragged ? pressed.target : null;
|
|
510
|
+
if (drag.active) drag.end(true);
|
|
511
|
+
else if (target) {
|
|
512
|
+
// A block among several selected (or one inside one of them: an item of a selected list)
|
|
513
|
+
// keeps them selected: its menu is theirs (notion-lite's handle of a selected block).
|
|
514
|
+
const holder = selection.holderOf(target);
|
|
515
|
+
const reopen = menu.isOpen && (holder !== null || selection.picked[0] === target);
|
|
516
|
+
if (holder) menu.close();
|
|
517
|
+
else selection.select(target);
|
|
518
|
+
if (!reopen) open(holder ?? target, event.clientY); // a second click closes the menu again
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
control.addEventListener("pointercancel", () => {
|
|
522
|
+
press = null;
|
|
523
|
+
if (drag.active) drag.end(false);
|
|
524
|
+
});
|
|
525
|
+
// After pointerup the capture goes too (the drag has ended then); lost any other way, the press
|
|
526
|
+
// is over: a drag under way is cancelled.
|
|
527
|
+
control.addEventListener("lostpointercapture", () => {
|
|
528
|
+
press = null;
|
|
529
|
+
if (drag.active) drag.end(false);
|
|
530
|
+
});
|
|
531
|
+
control.addEventListener("contextmenu", (event) => {
|
|
532
|
+
event.preventDefault();
|
|
533
|
+
const target = current();
|
|
534
|
+
if (!target) return;
|
|
535
|
+
const holder = selection.holderOf(target);
|
|
536
|
+
if (!holder) selection.select(target, { quiet: true });
|
|
537
|
+
open(holder ?? target, event.clientY);
|
|
538
|
+
});
|
|
539
|
+
};
|
|
540
|
+
pressable(grip, () => shown, openAtHandle);
|
|
541
|
+
// While the grip is pressed (a click, a drag) the bar stays away; the grip keeps its fill.
|
|
542
|
+
grip.addEventListener("pointerdown", (event) => { if (event.button === 0) handle.setAttribute("data-pressed", ""); });
|
|
543
|
+
for (const type of ["pointerup", "pointercancel", "lostpointercapture"]) grip.addEventListener(type, () => handle.removeAttribute("data-pressed"));
|
|
544
|
+
pressable(bar, () => barShown, openAtBar);
|
|
545
|
+
document.addEventListener("mousemove", onMove, { passive: true, capture: true });
|
|
546
|
+
// Over a frame (an embed's) the moves are its own document's: reaching it is the page's last one.
|
|
547
|
+
document.addEventListener("mouseover", (event) => { if (event.target?.localName === "iframe") onMove(event); }, { passive: true, capture: true });
|
|
548
|
+
// Scrolling the page by the wheel (or a touchpad) hides the handle, as Notion's and Feishu's,
|
|
549
|
+
// until the pointer moves; not while it is pressed or dragged. Scrolling the page does itself (the
|
|
550
|
+
// caret kept in sight, a block brought into view) leaves it: that scroll's event may come after the
|
|
551
|
+
// pointer has moved on to a block, and would hide the handle it just found. The keys hide it anyway
|
|
552
|
+
// (typing). A section's bar stays.
|
|
553
|
+
addEventListener("wheel", (event) => {
|
|
554
|
+
if (press || drag.active || !hovered || scrollsInside(event)) return;
|
|
555
|
+
still = { x: event.clientX, y: event.clientY };
|
|
556
|
+
hovered = null;
|
|
557
|
+
beside = null;
|
|
558
|
+
schedule();
|
|
559
|
+
}, { passive: true, capture: true });
|
|
560
|
+
// A wheel over a box of the page that scrolls its way (a table's frame) scrolls that box, not the
|
|
561
|
+
// page: the handle stays (it blinked as the pointer moved on while a table scrolled).
|
|
562
|
+
function scrollsInside(event) {
|
|
563
|
+
const down = Math.abs(event.deltaY) >= Math.abs(event.deltaX);
|
|
564
|
+
for (let node = event.target instanceof Element ? event.target : null; node && node.localName !== "main" && node !== document.body; node = node.parentElement) {
|
|
565
|
+
const style = getComputedStyle(node);
|
|
566
|
+
const scrolls = (overflow, size, client) => (overflow === "auto" || overflow === "scroll") && size > client + 1;
|
|
567
|
+
if (down ? scrolls(style.overflowY, node.scrollHeight, node.clientHeight) : scrolls(style.overflowX, node.scrollWidth, node.clientWidth)) return true;
|
|
568
|
+
}
|
|
569
|
+
return false;
|
|
570
|
+
}
|
|
571
|
+
document.documentElement.addEventListener("mouseleave", () => {
|
|
572
|
+
hovered = null;
|
|
573
|
+
barOver = null;
|
|
574
|
+
schedule();
|
|
575
|
+
});
|
|
576
|
+
|
|
577
|
+
return {
|
|
578
|
+
/** A frame: the block beside empty space found, one taken off the page forgotten. */
|
|
579
|
+
track() {
|
|
580
|
+
if (beside) {
|
|
581
|
+
hovered = areaOf(besideAt(beside.x, beside.y));
|
|
582
|
+
beside = null;
|
|
583
|
+
}
|
|
584
|
+
if (hovered && !hovered.isConnected) hovered = null;
|
|
585
|
+
},
|
|
586
|
+
/** A frame: the bar and the handle where their blocks are now. */
|
|
587
|
+
place() {
|
|
588
|
+
placeBar();
|
|
589
|
+
placeHandle();
|
|
590
|
+
},
|
|
591
|
+
/**
|
|
592
|
+
* The block the pointer is at as the reader sees it, for what shows beside it but the handle (a
|
|
593
|
+
* heading's fold triangle, fold/): none while dragging, typing, drawing a box or dragging a gap;
|
|
594
|
+
* of a container whose first line acts for it (a highlight block), that first block.
|
|
595
|
+
*/
|
|
596
|
+
get pointed() {
|
|
597
|
+
if (drag.active || drawing() || typing || document.documentElement.hasAttribute("data-ge-gap-drag") || !hovered?.isConnected) return null;
|
|
598
|
+
return pointedAt(hovered).at(-1);
|
|
599
|
+
},
|
|
600
|
+
/** The handle, the 批注 button or the bar shows (the frames go on). */
|
|
601
|
+
get showing() { return Boolean(shown || noted || barShown); },
|
|
602
|
+
/** Whether a node is part of the handle, the 批注 button or the bar. */
|
|
603
|
+
holds: (node) => handle.contains(node) || note.contains(node) || bar.contains(node),
|
|
604
|
+
lineAt,
|
|
605
|
+
/** The pointer is on this block (a divider line pressed). */
|
|
606
|
+
hover(target) {
|
|
607
|
+
hovered = target;
|
|
608
|
+
},
|
|
609
|
+
/** Blocks taken off the page: the handle or the bar beside one goes at once (not while dragging). */
|
|
610
|
+
settle() {
|
|
611
|
+
if (hovered && !hovered.isConnected) hovered = null;
|
|
612
|
+
if (barOver && !barOver.isConnected) barOver = null;
|
|
613
|
+
if (shown && !shown.isConnected && !drag.active) {
|
|
614
|
+
shown = null;
|
|
615
|
+
reach(null);
|
|
616
|
+
handle.remove();
|
|
617
|
+
}
|
|
618
|
+
if (!handle.isConnected || !dimmed?.isConnected) undim();
|
|
619
|
+
if (noted && !noted.isConnected) placeNote(null);
|
|
620
|
+
if (barShown && !barShown.isConnected) {
|
|
621
|
+
barShown = null;
|
|
622
|
+
bar.remove();
|
|
623
|
+
}
|
|
624
|
+
},
|
|
625
|
+
/** The block the handle stood beside went (deleted). */
|
|
626
|
+
forget() {
|
|
627
|
+
hovered = null;
|
|
628
|
+
barOver = null;
|
|
629
|
+
},
|
|
630
|
+
/** The reader is typing: the handle steps aside until the pointer moves. */
|
|
631
|
+
typing() {
|
|
632
|
+
typing = true;
|
|
633
|
+
},
|
|
634
|
+
/** The editing stops. */
|
|
635
|
+
hide() {
|
|
636
|
+
press = null;
|
|
637
|
+
hovered = null;
|
|
638
|
+
beside = null;
|
|
639
|
+
barOver = null;
|
|
640
|
+
shown = null;
|
|
641
|
+
barShown = null;
|
|
642
|
+
reach(null);
|
|
643
|
+
handle.removeAttribute("data-pressed");
|
|
644
|
+
handle.remove();
|
|
645
|
+
placeNote(null);
|
|
646
|
+
bar.remove();
|
|
647
|
+
undim();
|
|
648
|
+
},
|
|
649
|
+
};
|
|
650
|
+
}
|