@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,544 @@
|
|
|
1
|
+
import { Z } from "../../shared/layers.mjs";
|
|
2
|
+
import { addStyle, element, mount } from "./ui.mjs";
|
|
3
|
+
import { hideTooltip, tooltip } from "./tooltip.mjs";
|
|
4
|
+
import { SECTION_ICON, svg } from "../components/icons.mjs";
|
|
5
|
+
import { t } from "../../shared/i18n/index.mjs";
|
|
6
|
+
|
|
7
|
+
// The editor's menu card, used by the "/" menu (slash-menu/: block types, filtered as the reader
|
|
8
|
+
// types) and by the block menu a block's handle opens (block-menu/: a header with the block's type,
|
|
9
|
+
// the types it can be turned into as a grid of icons, then its commands). One row (or cell of a
|
|
10
|
+
// grid) is highlighted: ↑/↓ move it (a line of the grid at a time, ←/→ along it) and Enter runs it,
|
|
11
|
+
// the keys being forwarded by the editor, because the focus stays where it was (in the text, or on
|
|
12
|
+
// the page with a block selected). A press on a row never moves the caret. Colors follow the
|
|
13
|
+
// report's light or dark theme (light-dark()). A row may open a submenu (Notion's 颜色 ›): a second
|
|
14
|
+
// card right of it, opened by resting on the row, a click, Enter or →, and closed by ←, by resting
|
|
15
|
+
// on another row, or with the menu; while it is open from the keys they move in it. A row that both
|
|
16
|
+
// runs and opens a submenu (a split row: a table's 一键优化 ›) is two parts side by side, each with
|
|
17
|
+
// its own grey under the pointer: its words, which a click or Enter runs, and its › at its right,
|
|
18
|
+
// which opens the submenu (resting on it, a click, or →); resting on its words opens nothing.
|
|
19
|
+
//
|
|
20
|
+
// A card is as wide as its rows (Notion's menus: 180px at least), up to FIT.most, past which a row's
|
|
21
|
+
// words are cut by an ellipsis, so a short submenu (一键优化 ›: 自动调整列宽, 识别数字列; 对齐 ›) is no
|
|
22
|
+
// wider than its words; it once took 265px whatever it held. A card whose rows change as it is used
|
|
23
|
+
// keeps the one width its caller gives (`width`: the block menu's grid, the "/" menu, a code block's
|
|
24
|
+
// languages), or SEARCHING when it has a search field and gives none, so it never jumps as rows come
|
|
25
|
+
// and go.
|
|
26
|
+
|
|
27
|
+
const FIT = { least: 180, most: 320 }; // a card with no width given: as wide as its rows, between these
|
|
28
|
+
const SEARCHING = 240; // a card with a search field and no width given: its rows filtered as typed
|
|
29
|
+
|
|
30
|
+
const STYLE = `
|
|
31
|
+
.ge-pop {
|
|
32
|
+
position: fixed; left: 0; top: 0; z-index: ${Z.menu}; width: max-content; min-width: ${FIT.least}px; max-width: min(${FIT.most}px, calc(100vw - 16px)); max-height: calc(100vh - 24px);
|
|
33
|
+
overflow-x: hidden; overflow-y: auto; padding: 4px 0; border-radius: 10px; background: var(--ge-bg); color: var(--ge-tx);
|
|
34
|
+
box-shadow: var(--ge-shadow-pop);
|
|
35
|
+
font: 14px/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
|
|
36
|
+
user-select: none; scrollbar-width: thin; scrollbar-color: var(--ge-line-strong) transparent; animation: ge-pop-in .12s ease-out;
|
|
37
|
+
}
|
|
38
|
+
/* A width given (data-sized: opts.width, placed by place()): that width, whatever the rows hold. */
|
|
39
|
+
.ge-pop[data-sized] { min-width: 0; max-width: calc(100vw - 16px); }
|
|
40
|
+
@keyframes ge-pop-in { from { opacity: 0; transform: scale(.98); } }
|
|
41
|
+
@media (prefers-reduced-motion: reduce) { .ge-pop { animation: none; } }
|
|
42
|
+
.ge-pop-title { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--ge-tx2); font-size: 12px; font-weight: 500; line-height: 14px; }
|
|
43
|
+
.ge-pop-title:has(> .ge-pop-icon) { padding-block: 4px; }
|
|
44
|
+
.ge-pop-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
45
|
+
/* Notion's 4px above the first row (a row right at the top had its corners cut by the card's); a
|
|
46
|
+
title or a search field first keeps its own room. */
|
|
47
|
+
.ge-pop > .ge-pop-title:first-child { padding-top: 6px; }
|
|
48
|
+
.ge-pop:has(> .ge-pop-search:first-child) { padding-top: 0; }
|
|
49
|
+
.ge-pop-row { display: flex; align-items: center; gap: 8px; width: calc(100% - 8px); height: 28px; margin: 0 4px 1px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
|
|
50
|
+
.ge-pop-row[data-active] { background: var(--ge-hover); }
|
|
51
|
+
.ge-pop-row:disabled { cursor: default; }
|
|
52
|
+
.ge-pop-row:disabled:not([data-current]) .ge-pop-label, .ge-pop-row:disabled:not([data-current]) .ge-pop-icon { opacity: .45; }
|
|
53
|
+
.ge-pop-icon { flex: none; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; color: var(--ge-ico); }
|
|
54
|
+
.ge-pop-icon svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
|
|
55
|
+
.ge-pop-icon img { display: block; width: 20px; height: 20px; border-radius: 3px; object-fit: contain; }
|
|
56
|
+
.ge-pop-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
57
|
+
/* A row with a hint (its current choice, its key) reads by its label first: the label keeps its
|
|
58
|
+
words and the hint takes what is left, cut short with an ellipsis where it is too long (an English
|
|
59
|
+
row's current choice once took the whole row, its label drawn 0px wide). */
|
|
60
|
+
.ge-pop-label:has(+ .ge-pop-hint) { flex: 1 0 auto; max-width: 100%; }
|
|
61
|
+
.ge-pop-hint { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ge-tx3); font-size: 12px; white-space: nowrap; }
|
|
62
|
+
/* A row of a page (its title, the page it is under as its hint): a long title is what an ellipsis
|
|
63
|
+
cuts, and the page above keeps its words, up to a part of the row. */
|
|
64
|
+
.ge-pop-row[data-long] .ge-pop-label { flex: 1 1 0; max-width: none; }
|
|
65
|
+
.ge-pop-row[data-long] .ge-pop-hint { flex: none; max-width: 40%; }
|
|
66
|
+
.ge-pop-check, .ge-pop-arrow { flex: none; width: 16px; height: 16px; }
|
|
67
|
+
.ge-pop-arrow { color: var(--ge-tx3); }
|
|
68
|
+
.ge-pop-arrow svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
|
|
69
|
+
.ge-pop-row[aria-expanded="true"] { background: var(--ge-hover); }
|
|
70
|
+
/* A split row (run and submenu both): its words (.ge-pop-main) and its › (.ge-pop-more, 32px wide:
|
|
71
|
+
the › where another submenu row has its own) side by side, 2px apart, each grey on its own: the words
|
|
72
|
+
when the row is highlighted and the pointer is not on the ›, the › under the pointer and while its
|
|
73
|
+
submenu is open. The row itself takes no grey. */
|
|
74
|
+
.ge-pop-row[data-split] { gap: 2px; padding: 0; }
|
|
75
|
+
.ge-pop-row[data-split][data-active], .ge-pop-row[data-split][aria-expanded="true"] { background: transparent; }
|
|
76
|
+
.ge-pop-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; align-self: stretch; padding: 0 8px; border-radius: 6px; }
|
|
77
|
+
.ge-pop-more { flex: none; display: flex; align-items: center; justify-content: center; width: 32px; align-self: stretch; border-radius: 6px; }
|
|
78
|
+
.ge-pop-row[data-split][data-active]:not([data-more]) > .ge-pop-main,
|
|
79
|
+
.ge-pop-row[data-split][data-more] > .ge-pop-more,
|
|
80
|
+
.ge-pop-row[data-split][aria-expanded="true"] > .ge-pop-more { background: var(--ge-hover); }
|
|
81
|
+
.ge-pop-check svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
|
|
82
|
+
.ge-pop-sep { height: 1px; margin: 3px 12px 4px; background: var(--ge-line); }
|
|
83
|
+
/* A note wraps at the card's width and never widens it (no width of its own: contain). */
|
|
84
|
+
.ge-pop-note { contain: inline-size; padding: 0 12px 6px 40px; color: var(--ge-tx3); font-size: 12px; line-height: 1.5; }
|
|
85
|
+
.ge-pop-empty { padding: 8px 12px; color: var(--ge-tx3); }
|
|
86
|
+
/* What a row makes, shown beside it under the pointer (a component package's preview.svg). */
|
|
87
|
+
.ge-pop-preview { display: block; width: 240px; max-height: 180px; border-radius: 4px; object-fit: contain; background: var(--ge-bg); }
|
|
88
|
+
.ge-pop-search { position: sticky; top: 0; z-index: 1; padding: 8px 8px 6px; background: var(--ge-bg); }
|
|
89
|
+
.ge-pop-search input { box-sizing: border-box; width: 100%; 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); }
|
|
90
|
+
.ge-pop-search input:focus { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ge-tx3) 60%, transparent); }
|
|
91
|
+
.ge-pop-search input::placeholder { color: var(--ge-tx3); }
|
|
92
|
+
/* Rows in a card that is there already (inside: a link card's pages): under what stands in it, as wide as it, no card of their own. */
|
|
93
|
+
.ge-pop[data-inside] { position: static; flex: 0 0 100%; width: auto; min-width: 0; max-width: none; padding: 4px 0 0; border-radius: 0; background: none; box-shadow: none; animation: none; }
|
|
94
|
+
.ge-pop[data-inside] .ge-pop-row { width: 100%; margin-inline: 0; }
|
|
95
|
+
`;
|
|
96
|
+
|
|
97
|
+
// A section's lines, of the icons of 在下方新建分区 and 解散分区: the mark beside them says which.
|
|
98
|
+
const SECTION_LINES = '<path d="M3.25 5.25h13.5M3.25 9.75h9"/>';
|
|
99
|
+
|
|
100
|
+
/** Icons of the editor's menus (a block type's own is in its component's description). */
|
|
101
|
+
export const ICONS = {
|
|
102
|
+
plus: svg('<path d="M10 4.25v11.5M4.25 10h11.5"/>'),
|
|
103
|
+
copy: svg('<rect x="7.25" y="7.25" width="9.5" height="9.5" rx="2"/><path d="M12.75 7.25V5.5a2 2 0 0 0-2-2h-5.5a2 2 0 0 0-2 2V11a2 2 0 0 0 2 2h2"/>'),
|
|
104
|
+
trash: svg('<path d="M3.75 5.75h12.5M8 5.75V4.5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1.25M5.25 5.75l.7 9.6a1.5 1.5 0 0 0 1.5 1.4h5.1a1.5 1.5 0 0 0 1.5-1.4l.7-9.6"/>'),
|
|
105
|
+
outer: svg('<rect x="3.25" y="3.25" width="13.5" height="13.5" rx="2.5" stroke-dasharray="2.2 2.2"/><rect x="6.5" y="6.5" width="7" height="7" rx="1.25"/>'),
|
|
106
|
+
section: svg(`${SECTION_LINES}<path d="M14.5 12v5M12 14.5h5"/>`),
|
|
107
|
+
dissolve: svg(`${SECTION_LINES}<path d="m12.75 12.75 3.5 3.5M16.25 12.75l-3.5 3.5"/>`), // section's plus, turned 45°
|
|
108
|
+
group: SECTION_ICON, // blocks gathered into a new section: their lines between brackets (components/icons.mjs)
|
|
109
|
+
center: svg('<rect x="5.25" y="4.25" width="9.5" height="11.5" rx="1.75"/><path d="M2.75 4v12M17.25 4v12"/>'),
|
|
110
|
+
full: svg('<rect x="3.25" y="4.25" width="13.5" height="11.5" rx="1.75"/><path d="m6.5 10h7M6.5 10l1.75-1.75M6.5 10l1.75 1.75M13.5 10l-1.75-1.75M13.5 10l-1.75 1.75"/>'),
|
|
111
|
+
reset: svg('<path d="M4.75 6.75A6 6 0 1 1 4 10.5"/><path d="M4.5 3.5v3.5H8"/>'),
|
|
112
|
+
check: svg('<path d="m3.5 8.5 3 3 6-7"/>', 16),
|
|
113
|
+
frame: svg('<rect x="3.25" y="4.25" width="13.5" height="11.5" rx="3"/><path d="M6.25 7.75h3"/>'),
|
|
114
|
+
rename: svg('<path d="M11.75 4.75l3.5 3.5"/><path d="M13.25 3.25a1.5 1.5 0 0 1 2.12 0l1.38 1.38a1.5 1.5 0 0 1 0 2.12L7.5 16H4v-3.5z"/>'),
|
|
115
|
+
chevron: svg('<path d="m6.5 4 4 4-4 4"/>', 16),
|
|
116
|
+
face: svg('<circle cx="10" cy="10" r="6.75"/><path d="M7.5 11.5a3 3 0 0 0 5 0"/><circle cx="7.9" cy="8.5" r=".9" fill="currentColor" stroke="none"/><circle cx="12.1" cy="8.5" r=".9" fill="currentColor" stroke="none"/>'),
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// A row's picture, as the tooltip shows it.
|
|
120
|
+
const previewOf = ({ src }) => element("img", { class: "ge-pop-preview", src, alt: "" });
|
|
121
|
+
|
|
122
|
+
const opened = new Set(); // the menus open now, whichever part of the page opened them
|
|
123
|
+
|
|
124
|
+
/** Whether a menu is open anywhere on the page (a press outside it closes it). */
|
|
125
|
+
export const menuOpen = () => opened.size > 0;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* items: rows { label, run, icon?, hint?, long?, current?, checked?, disabled?, note?, preview? } (long:
|
|
129
|
+
* a label of any length, a page's title, cut before its hint is; current: the choice
|
|
130
|
+
* made, checked and not to be chosen again; checked: a switch that is on, checked and clicked to turn
|
|
131
|
+
* it off; preview: { src, says }, a picture of what the row makes, where it has one, and a line on it,
|
|
132
|
+
* shown at the row's right while the pointer rests on it, notion-lite's row tooltip) (or { label, icon?, submenu:
|
|
133
|
+
* () => items, width?, search? } opening a submenu, with a search field at its top when `search` is
|
|
134
|
+
* given, as `opts.search` below, and `search.empty` the words shown when nothing is found; a row
|
|
135
|
+
* with both `run` and `submenu` is a split row: its words run, its › opens the submenu), titles
|
|
136
|
+
* { title, icon? }, separators { separator: true } and grids { node, cells, columns } (type-grid.mjs: the
|
|
137
|
+
* node shown as it is, its cells, buttons that act on their own click, highlighted as rows are).
|
|
138
|
+
* opts: { label, empty, highlight, onClose, around, side, width } — width: the card's, in px, whatever
|
|
139
|
+
* its rows hold (the block menu: as wide as its grid of types), where without it the card is as wide
|
|
140
|
+
* as its rows (FIT; SEARCHING with a search field). around: the rect of the block a handle
|
|
141
|
+
* (the anchor) stands for; the menu keeps clear of that block: left of it beside the handle, else
|
|
142
|
+
* below or above it (scrolling inside when only part of it fits), and over it only when the block
|
|
143
|
+
* leaves no room at all. side: "right": beside the anchor, right of it (left of it when there is no
|
|
144
|
+
* room), level with it (a section's bar). Without either the menu stands below the anchor (the
|
|
145
|
+
* caret), or above it when there is no room below; align: "end", its right edge at the anchor's.
|
|
146
|
+
* icons: false, rows of words alone (no column for icons: a code block's languages); height: the
|
|
147
|
+
* card's greatest height, in px (its rows scroll inside it past that). stand(size): where the card
|
|
148
|
+
* stands, its { left, top } for its { width, height }, in place of all of these rules (a pasted
|
|
149
|
+
* address's 选择视图, by the format bar's rule: placement.mjs besideText). inside: an element the rows
|
|
150
|
+
* go in, in place of a card over the page (a link card's pages): they stand where it has them.
|
|
151
|
+
* search: { placeholder, filter(text) }: a field above the rows, which takes the focus (unless
|
|
152
|
+
* `focus` is false: a submenu the pointer opened, whose field the first letter typed goes to,
|
|
153
|
+
* menu.type); what is typed in it gives the rows anew (filter returns the items), its keys moving the
|
|
154
|
+
* highlight (↑/↓), running the row (Enter) and closing the menu (Esc).
|
|
155
|
+
*/
|
|
156
|
+
export function createMenu() {
|
|
157
|
+
addStyle(STYLE);
|
|
158
|
+
let node = null;
|
|
159
|
+
let list = null; // where the rows go: the card, or under its search field
|
|
160
|
+
let rows = [];
|
|
161
|
+
let active = -1;
|
|
162
|
+
let pointed = false; // the highlight is where the pointer is (not where the keys moved it)
|
|
163
|
+
let options = {};
|
|
164
|
+
let anchor = null;
|
|
165
|
+
let sub = null; // the submenu's card (a menu of its own), made when first needed
|
|
166
|
+
let subRow = null; // the row it is open from
|
|
167
|
+
let subKeys = false; // opened from the keys: they move in it
|
|
168
|
+
let subTimer = 0;
|
|
169
|
+
let pointedRow = null;
|
|
170
|
+
let pointedMore = false; // the pointer on a split row's › (not on its words)
|
|
171
|
+
|
|
172
|
+
// The pointer over a row highlights it. In a menu that starts with nothing highlighted (the block
|
|
173
|
+
// menu), leaving the row takes the highlight off again, as :hover would; a row the keys moved to
|
|
174
|
+
// stays, and so does the "/" menu's, the row Enter runs. On a split row, `more`: the pointer is on
|
|
175
|
+
// its › (data-more on the row, which greys the › instead of the words), the part that opens.
|
|
176
|
+
const point = (row, more = false) => {
|
|
177
|
+
highlight(rows.indexOf(row), false);
|
|
178
|
+
pointed = true;
|
|
179
|
+
if (row.split) row.toggleAttribute("data-more", more);
|
|
180
|
+
if (row === pointedRow && more === pointedMore) return;
|
|
181
|
+
pointedRow = row;
|
|
182
|
+
pointedMore = more;
|
|
183
|
+
clearTimeout(subTimer);
|
|
184
|
+
// Notion's: a submenu opens 80ms after the pointer rests on its row (200ms while another is
|
|
185
|
+
// open), and goes 250ms after the pointer rests elsewhere (a split row's words being elsewhere).
|
|
186
|
+
const opens = Boolean(row.submenu) && (!row.split || more);
|
|
187
|
+
if (opens && row !== subRow) subTimer = setTimeout(() => openSub(row), subRow ? 200 : 80);
|
|
188
|
+
else if (!opens && subRow) subTimer = setTimeout(closeSub, 250);
|
|
189
|
+
};
|
|
190
|
+
const leave = (row) => {
|
|
191
|
+
if (pointed && rows[active] === row && options.highlight === false) highlight(-1);
|
|
192
|
+
row.removeAttribute("data-more");
|
|
193
|
+
if (pointedRow !== row) return;
|
|
194
|
+
pointedRow = null;
|
|
195
|
+
pointedMore = false;
|
|
196
|
+
clearTimeout(subTimer); // passing over a row opens nothing
|
|
197
|
+
if (subRow === row && !subKeys) subTimer = setTimeout(closeSub, 250); // unless the pointer goes into it
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
function build(items) {
|
|
201
|
+
rows = [];
|
|
202
|
+
const children = [];
|
|
203
|
+
for (const item of items) {
|
|
204
|
+
if (item.separator) {
|
|
205
|
+
if (children.length > 0 && !children.at(-1).classList.contains("ge-pop-sep")) children.push(element("div", { class: "ge-pop-sep", role: "separator" }));
|
|
206
|
+
} else if (item.title) children.push(element("div", { class: "ge-pop-title" }, ...(item.icon ? [element("span", { class: "ge-pop-icon", html: item.icon })] : []), element("span", { class: "ge-pop-name", text: item.title })));
|
|
207
|
+
else if (item.node) {
|
|
208
|
+
const grid = { start: rows.length, count: item.cells.length, columns: item.columns };
|
|
209
|
+
for (const cell of item.cells) {
|
|
210
|
+
cell.grid = grid;
|
|
211
|
+
cell.addEventListener("pointermove", () => point(cell));
|
|
212
|
+
cell.addEventListener("pointerleave", () => leave(cell));
|
|
213
|
+
rows.push(cell);
|
|
214
|
+
}
|
|
215
|
+
children.push(item.node);
|
|
216
|
+
} else {
|
|
217
|
+
const row = element("button", { type: "button", class: "ge-pop-row", role: "menuitem" });
|
|
218
|
+
// A split row's words go in a part of their own, its › in another (CSS above).
|
|
219
|
+
row.split = Boolean(item.run && item.submenu);
|
|
220
|
+
const words = row.split ? element("span", { class: "ge-pop-main" }) : row;
|
|
221
|
+
if (row.split) row.setAttribute("data-split", "");
|
|
222
|
+
if (item.long) row.setAttribute("data-long", "");
|
|
223
|
+
if (options.icons !== false) words.append(element("span", { class: "ge-pop-icon", html: item.icon ?? "" }));
|
|
224
|
+
words.append(element("span", { class: "ge-pop-label", text: item.label }));
|
|
225
|
+
if (item.hint) words.append(element("span", { class: "ge-pop-hint", text: item.hint }));
|
|
226
|
+
if (row.split) row.append(words, element("span", { class: "ge-pop-more", html: `<span class="ge-pop-arrow">${ICONS.chevron}</span>` }));
|
|
227
|
+
else if (item.submenu) row.append(element("span", { class: "ge-pop-arrow", html: ICONS.chevron }));
|
|
228
|
+
if (item.submenu) {
|
|
229
|
+
row.setAttribute("aria-haspopup", "menu");
|
|
230
|
+
row.submenu = item.submenu;
|
|
231
|
+
row.subWidth = item.width;
|
|
232
|
+
row.subSearch = item.search;
|
|
233
|
+
}
|
|
234
|
+
if (item.current || item.checked) {
|
|
235
|
+
row.append(element("span", { class: "ge-pop-check", html: ICONS.check, "aria-label": item.current ? t("当前") : t("已开启") }));
|
|
236
|
+
row.setAttribute("data-current", "");
|
|
237
|
+
if (item.checked) row.setAttribute("aria-checked", "true");
|
|
238
|
+
}
|
|
239
|
+
row.disabled = Boolean(item.disabled || item.current);
|
|
240
|
+
row.run = item.run;
|
|
241
|
+
row.addEventListener("mousedown", (event) => event.preventDefault());
|
|
242
|
+
const onMore = (event) => row.split && Boolean(event.target.closest?.(".ge-pop-more"));
|
|
243
|
+
row.addEventListener("pointermove", (event) => point(row, onMore(event)));
|
|
244
|
+
row.addEventListener("pointerleave", () => leave(row));
|
|
245
|
+
row.addEventListener("click", (event) => run(row, onMore(event)));
|
|
246
|
+
rows.push(row);
|
|
247
|
+
children.push(row);
|
|
248
|
+
if (item.note) children.push(element("div", { class: "ge-pop-note", text: item.note }));
|
|
249
|
+
if (item.preview) tooltip(row, item.preview.src ? () => previewOf(item.preview) : item.preview.says, item.preview.src ? item.preview.says : null, { placement: "right", align: "start", beside: true });
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
while (children.at(-1)?.classList.contains("ge-pop-sep")) children.pop();
|
|
253
|
+
if (rows.length === 0 && options.empty) children.push(element("div", { class: "ge-pop-empty", text: options.empty }));
|
|
254
|
+
hideTooltip();
|
|
255
|
+
list.replaceChildren(...children);
|
|
256
|
+
active = -1;
|
|
257
|
+
pointed = false;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function highlight(index, scroll = true) {
|
|
261
|
+
rows[active]?.removeAttribute("data-active");
|
|
262
|
+
active = index;
|
|
263
|
+
const row = rows[active];
|
|
264
|
+
if (!row) return;
|
|
265
|
+
row.setAttribute("data-active", "");
|
|
266
|
+
if (scroll) row.scrollIntoView({ block: "nearest" });
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
const clamp = (value, low, high) => Math.max(low, Math.min(high, value));
|
|
270
|
+
|
|
271
|
+
function place() {
|
|
272
|
+
if (options.inside) return;
|
|
273
|
+
const margin = 8;
|
|
274
|
+
const gap = 6;
|
|
275
|
+
node.style.maxHeight = options.height ? `${options.height}px` : "";
|
|
276
|
+
if (options.width) node.style.width = `${options.width}px`;
|
|
277
|
+
const width = node.offsetWidth;
|
|
278
|
+
let height = node.offsetHeight;
|
|
279
|
+
const room = innerHeight - 2 * margin;
|
|
280
|
+
const fit = (space) => {
|
|
281
|
+
if (height > space) {
|
|
282
|
+
node.style.maxHeight = `${Math.floor(space)}px`;
|
|
283
|
+
height = space;
|
|
284
|
+
// A card as wide as its content widens by the scrollbar it now has.
|
|
285
|
+
if (options.width) node.style.width = `${options.width + node.offsetWidth - node.clientWidth}px`;
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
let left;
|
|
289
|
+
let top;
|
|
290
|
+
const block = options.around;
|
|
291
|
+
if (options.stand) {
|
|
292
|
+
fit(room);
|
|
293
|
+
({ left, top } = options.stand({ width, height }));
|
|
294
|
+
} else if (options.side === "right") {
|
|
295
|
+
fit(room);
|
|
296
|
+
const aside = options.gap ?? gap;
|
|
297
|
+
left = anchor.right + aside + width <= innerWidth - margin ? anchor.right + aside : anchor.left - aside - width;
|
|
298
|
+
top = clamp(anchor.top, margin, innerHeight - margin - height);
|
|
299
|
+
} else if (!block) {
|
|
300
|
+
// Below the anchor (the caret), or above it where there is more room; never over it (it once
|
|
301
|
+
// covered the line typed in, at the top of the window): the card scrolls inside when it fits
|
|
302
|
+
// in neither.
|
|
303
|
+
const aside = options.gap ?? gap;
|
|
304
|
+
left = clamp(options.align === "end" ? anchor.right - width : anchor.left, margin, innerWidth - width - margin);
|
|
305
|
+
const below = innerHeight - margin - (anchor.bottom + aside);
|
|
306
|
+
const above = anchor.top - aside - margin;
|
|
307
|
+
if (height <= below || below >= above) {
|
|
308
|
+
fit(Math.max(below, 120));
|
|
309
|
+
top = anchor.bottom + aside;
|
|
310
|
+
} else {
|
|
311
|
+
fit(Math.max(above, 120));
|
|
312
|
+
top = Math.max(margin, anchor.top - aside - height);
|
|
313
|
+
}
|
|
314
|
+
} else {
|
|
315
|
+
const below = innerHeight - margin - (block.bottom + gap);
|
|
316
|
+
const above = block.top - gap - margin;
|
|
317
|
+
const beside = anchor.left - gap - width;
|
|
318
|
+
if (beside >= margin) {
|
|
319
|
+
// Left of the block, centered on its handle.
|
|
320
|
+
fit(room);
|
|
321
|
+
left = beside;
|
|
322
|
+
top = clamp((anchor.top + anchor.bottom) / 2 - height / 2, margin, innerHeight - margin - height);
|
|
323
|
+
} else if (Math.max(below, above) >= Math.min(height, 180)) {
|
|
324
|
+
// Below the block, else above it; in the larger of the two when it fits in neither.
|
|
325
|
+
left = clamp(anchor.left, margin, innerWidth - width - margin);
|
|
326
|
+
const under = height <= below || (height > above && below >= above);
|
|
327
|
+
fit(under ? below : above);
|
|
328
|
+
top = under ? block.bottom + gap : block.top - gap - height;
|
|
329
|
+
} else {
|
|
330
|
+
// The block fills the window: beside the handle, over the block.
|
|
331
|
+
fit(room);
|
|
332
|
+
left = Math.min(anchor.right + gap, innerWidth - width - margin);
|
|
333
|
+
top = clamp((anchor.top + anchor.bottom) / 2 - height / 2, margin, innerHeight - margin - height);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
node.style.left = `${Math.round(Math.max(margin, left))}px`;
|
|
337
|
+
node.style.top = `${Math.round(top)}px`;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// ---------- a row's submenu ----------
|
|
341
|
+
|
|
342
|
+
function openSub(row, keys = false) {
|
|
343
|
+
clearTimeout(subTimer);
|
|
344
|
+
if (!node || !rows.includes(row)) return;
|
|
345
|
+
if (subRow === row && sub?.isOpen) {
|
|
346
|
+
if (keys && !subKeys) {
|
|
347
|
+
subKeys = true;
|
|
348
|
+
sub.move(1);
|
|
349
|
+
}
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
closeSub();
|
|
353
|
+
sub ??= createMenu();
|
|
354
|
+
subRow = row;
|
|
355
|
+
subKeys = keys;
|
|
356
|
+
row.setAttribute("aria-expanded", "true");
|
|
357
|
+
// A choice in it closes both cards, then runs; so does one its search field found.
|
|
358
|
+
const closing = (items) => items.map((item) => (item.run ? { ...item, run: () => { close(); item.run(); } } : item));
|
|
359
|
+
const items = closing(row.submenu());
|
|
360
|
+
const search = row.subSearch && { placeholder: row.subSearch.placeholder, filter: (text) => closing(row.subSearch.filter(text)) };
|
|
361
|
+
sub.open(items, row.getBoundingClientRect(), {
|
|
362
|
+
side: "right", gap: 0, height: Math.round(innerHeight * 0.7), highlight: keys, width: row.subWidth, label: row.textContent, search, empty: row.subSearch?.empty, focus: keys,
|
|
363
|
+
onClose: () => {
|
|
364
|
+
row.removeAttribute("aria-expanded");
|
|
365
|
+
if (subRow === row) {
|
|
366
|
+
subRow = null;
|
|
367
|
+
subKeys = false;
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
});
|
|
371
|
+
for (const card of sub.nodes) card.addEventListener("pointerenter", () => clearTimeout(subTimer));
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function closeSub() {
|
|
375
|
+
clearTimeout(subTimer);
|
|
376
|
+
sub?.close();
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// A row's work: its submenu opened (a split row's only from its ›: `more`), a grid's cell's own
|
|
380
|
+
// click, or the menu closed and its action run (Enter and a click on a split row's words).
|
|
381
|
+
function run(row, more = false) {
|
|
382
|
+
if (!row || row.disabled) return false;
|
|
383
|
+
if (row.submenu && (!row.split || more)) {
|
|
384
|
+
openSub(row, true);
|
|
385
|
+
return true;
|
|
386
|
+
}
|
|
387
|
+
if (row.grid) {
|
|
388
|
+
row.click(); // a grid's cell does its own work (and closes the menu)
|
|
389
|
+
return true;
|
|
390
|
+
}
|
|
391
|
+
const action = row.run;
|
|
392
|
+
close();
|
|
393
|
+
action?.();
|
|
394
|
+
return true;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// The search field: what is typed in it filters the rows (not while an input method composes).
|
|
398
|
+
function searchField(search) {
|
|
399
|
+
const field = element("input", { type: "text", placeholder: search.placeholder ?? t("搜索"), spellcheck: "false", autocomplete: "off", "aria-label": search.placeholder ?? t("搜索") });
|
|
400
|
+
const filter = () => {
|
|
401
|
+
build(search.filter(field.value));
|
|
402
|
+
highlight(rows.findIndex((row) => !row.disabled));
|
|
403
|
+
};
|
|
404
|
+
field.addEventListener("input", (event) => { if (!event.isComposing) filter(); });
|
|
405
|
+
field.addEventListener("compositionend", filter);
|
|
406
|
+
field.addEventListener("keydown", (event) => {
|
|
407
|
+
if (event.isComposing || event.keyCode === 229) return;
|
|
408
|
+
if (!menu.arrow(event)) {
|
|
409
|
+
if (event.key === "Enter") menu.choose();
|
|
410
|
+
else if (event.key === "Escape") close();
|
|
411
|
+
else if (event.key !== "Tab") return;
|
|
412
|
+
}
|
|
413
|
+
event.preventDefault();
|
|
414
|
+
});
|
|
415
|
+
return element("div", { class: "ge-pop-search" }, field);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
function close() {
|
|
419
|
+
if (!node) return;
|
|
420
|
+
opened.delete(menu);
|
|
421
|
+
closeSub();
|
|
422
|
+
hideTooltip();
|
|
423
|
+
pointedRow = null;
|
|
424
|
+
node.remove();
|
|
425
|
+
node = null;
|
|
426
|
+
list = null;
|
|
427
|
+
rows = [];
|
|
428
|
+
active = -1;
|
|
429
|
+
const done = options.onClose;
|
|
430
|
+
options = {};
|
|
431
|
+
done?.();
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
const menu = {
|
|
435
|
+
open(items, rect, opts = {}) {
|
|
436
|
+
close();
|
|
437
|
+
options = opts.search && !opts.width ? { ...opts, width: SEARCHING } : opts;
|
|
438
|
+
anchor = rect;
|
|
439
|
+
opened.add(menu);
|
|
440
|
+
node = element("div", { class: "ge-pop", role: "menu", "aria-label": opts.label ?? t("菜单") });
|
|
441
|
+
if (options.width) node.setAttribute("data-sized", "");
|
|
442
|
+
if (opts.inside) {
|
|
443
|
+
node.setAttribute("data-inside", "");
|
|
444
|
+
opts.inside.append(node);
|
|
445
|
+
} else mount(node);
|
|
446
|
+
list = node;
|
|
447
|
+
if (opts.search) {
|
|
448
|
+
list = element("div");
|
|
449
|
+
node.append(searchField(opts.search), list);
|
|
450
|
+
}
|
|
451
|
+
build(items);
|
|
452
|
+
if (opts.highlight !== false) highlight(rows.findIndex((row) => !row.disabled && !row.passed));
|
|
453
|
+
place();
|
|
454
|
+
if (opts.focus !== false) node.querySelector(".ge-pop-search input")?.focus({ preventScroll: true });
|
|
455
|
+
},
|
|
456
|
+
/** Replace the rows (filtering), keeping the place; `first`: the first row highlighted. */
|
|
457
|
+
update(items, rect = anchor, { first = true } = {}) {
|
|
458
|
+
if (!node) return;
|
|
459
|
+
anchor = rect;
|
|
460
|
+
build(items);
|
|
461
|
+
if (first) highlight(rows.findIndex((row) => !row.disabled && !row.passed));
|
|
462
|
+
place();
|
|
463
|
+
},
|
|
464
|
+
/** Stand again, by `rect` or by what `stand` reads: the page moved under it. */
|
|
465
|
+
follow(rect = anchor) {
|
|
466
|
+
if (!node) return;
|
|
467
|
+
anchor = rect;
|
|
468
|
+
place();
|
|
469
|
+
},
|
|
470
|
+
close,
|
|
471
|
+
/**
|
|
472
|
+
* Move the highlight by one row, skipping disabled rows; in a grid by a line of it, out of it
|
|
473
|
+
* past its first or last line. `along`: ←/→ in a grid (false when no cell is highlighted).
|
|
474
|
+
*/
|
|
475
|
+
move(delta, along = false) {
|
|
476
|
+
if (sub?.isOpen && subKeys) {
|
|
477
|
+
if (along && delta < 0 && !sub.move(delta, true)) {
|
|
478
|
+
closeSub();
|
|
479
|
+
return true;
|
|
480
|
+
}
|
|
481
|
+
return along ? true : sub.move(delta);
|
|
482
|
+
}
|
|
483
|
+
if (along && delta > 0 && rows[active]?.submenu) {
|
|
484
|
+
openSub(rows[active], true);
|
|
485
|
+
return true;
|
|
486
|
+
}
|
|
487
|
+
if (rows.length === 0) return false;
|
|
488
|
+
pointed = false;
|
|
489
|
+
const grid = rows[active]?.grid;
|
|
490
|
+
if (along) {
|
|
491
|
+
if (!grid) return false;
|
|
492
|
+
highlight(grid.start + (active - grid.start + delta + grid.count) % grid.count);
|
|
493
|
+
return true;
|
|
494
|
+
}
|
|
495
|
+
let index = active < 0 && delta < 0 ? rows.length : active; // from nothing, ↑ reaches the last row
|
|
496
|
+
if (grid) {
|
|
497
|
+
const at = active - grid.start;
|
|
498
|
+
const line = Math.floor(at / grid.columns);
|
|
499
|
+
const last = Math.floor((grid.count - 1) / grid.columns);
|
|
500
|
+
const next = delta > 0 && line < last ? Math.min(at + grid.columns, grid.count - 1) : delta < 0 && line > 0 ? at - grid.columns : null;
|
|
501
|
+
if (next !== null) {
|
|
502
|
+
highlight(grid.start + next);
|
|
503
|
+
return true;
|
|
504
|
+
}
|
|
505
|
+
index = delta > 0 ? grid.start + grid.count - 1 : grid.start;
|
|
506
|
+
}
|
|
507
|
+
// Passed over: a disabled row, and a cell that is already the block's (passed: a color's swatch).
|
|
508
|
+
for (let step = 0; step < rows.length; step++) {
|
|
509
|
+
index = (index + delta + rows.length) % rows.length;
|
|
510
|
+
if (!rows[index].disabled && !rows[index].passed) break;
|
|
511
|
+
}
|
|
512
|
+
highlight(index);
|
|
513
|
+
return true;
|
|
514
|
+
},
|
|
515
|
+
/** ↑/↓ as a key event: moves the highlight (`move`); false for any other key (the caller's own keys stay its). */
|
|
516
|
+
arrow(event) {
|
|
517
|
+
if (event.key !== "ArrowDown" && event.key !== "ArrowUp") return false;
|
|
518
|
+
menu.move(event.key === "ArrowDown" ? 1 : -1);
|
|
519
|
+
return true;
|
|
520
|
+
},
|
|
521
|
+
/**
|
|
522
|
+
* A letter typed while a submenu with a search field is open (the pointer opened it, the focus
|
|
523
|
+
* staying where it was): the field takes the focus, and the letter goes into it (the key's own
|
|
524
|
+
* typing, not prevented). Returns whether it went there.
|
|
525
|
+
*/
|
|
526
|
+
type(event) {
|
|
527
|
+
const field = sub?.isOpen ? sub.nodes[0]?.querySelector(".ge-pop-search input") : null;
|
|
528
|
+
if (!field || event.ctrlKey || event.metaKey || event.altKey || (event.key.length !== 1 && event.keyCode !== 229)) return false;
|
|
529
|
+
subKeys = true; // its keys now move in it
|
|
530
|
+
field.focus({ preventScroll: true });
|
|
531
|
+
return true;
|
|
532
|
+
},
|
|
533
|
+
/** Run the highlighted row. Returns whether one ran. */
|
|
534
|
+
choose: () => (sub?.isOpen && subKeys ? sub.choose() : run(rows[active])),
|
|
535
|
+
get isOpen() { return node !== null; },
|
|
536
|
+
get hasChoice() { return sub?.isOpen && subKeys ? sub.hasChoice : Boolean(rows[active] && !rows[active].disabled); },
|
|
537
|
+
/** Whether the highlight is where the pointer is, not where the keys moved it. */
|
|
538
|
+
get pointed() { return pointed; },
|
|
539
|
+
contains: (target) => Boolean(node?.contains(target) || sub?.contains(target)),
|
|
540
|
+
/** The nodes to keep in the top layer when a modal dialog opens. */
|
|
541
|
+
get nodes() { return node ? [node, ...(sub?.nodes ?? [])] : []; },
|
|
542
|
+
};
|
|
543
|
+
return menu;
|
|
544
|
+
}
|