@heycys/gallery 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/THIRD-PARTY-NOTICES.md +3253 -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 +39 -0
- package/browser/editor/components/callout/page.mjs +13 -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 +297 -0
- package/browser/editor/components/details/index.mjs +72 -0
- package/browser/editor/components/details/page.mjs +86 -0
- package/browser/editor/components/dialog/index.mjs +83 -0
- package/browser/editor/components/dialog/page.mjs +219 -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 +33 -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 +51 -0
- package/browser/editor/components/highlight/index.mjs +79 -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 +45 -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 +133 -0
- package/browser/editor/components/installed/page.mjs +422 -0
- package/browser/editor/components/installed/served.mjs +35 -0
- package/browser/editor/components/kit.mjs +64 -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 +162 -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 +833 -0
- package/browser/editor/components/rows.mjs +16 -0
- package/browser/editor/components/section/index.mjs +41 -0
- package/browser/editor/components/section/page.mjs +141 -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 +306 -0
- package/browser/editor/components/table/page.mjs +672 -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 +229 -0
- package/browser/editor/page/annotate/card.mjs +102 -0
- package/browser/editor/page/annotate/index.mjs +1629 -0
- package/browser/editor/page/at-menu/index.mjs +317 -0
- package/browser/editor/page/autosave.mjs +977 -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 +82 -0
- package/browser/editor/page/block-menu/index.mjs +215 -0
- package/browser/editor/page/blocks.mjs +246 -0
- package/browser/editor/page/caret.mjs +679 -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 +797 -0
- package/browser/editor/page/clipboard/own/blocks.mjs +202 -0
- package/browser/editor/page/clipboard/own/chart-keys.mjs +58 -0
- package/browser/editor/page/clipboard/own/describe.mjs +115 -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 +326 -0
- package/browser/editor/page/columns/index.mjs +360 -0
- package/browser/editor/page/commit.mjs +1798 -0
- package/browser/editor/page/conflicts.mjs +269 -0
- package/browser/editor/page/convert.mjs +830 -0
- package/browser/editor/page/core.mjs +1655 -0
- package/browser/editor/page/drag/drop.mjs +307 -0
- package/browser/editor/page/drag/index.mjs +335 -0
- package/browser/editor/page/drag/preview.mjs +121 -0
- package/browser/editor/page/edge-scroll.mjs +50 -0
- package/browser/editor/page/editor.mjs +1725 -0
- package/browser/editor/page/emoji-picker/emoji-tab.mjs +278 -0
- package/browser/editor/page/emoji-picker/glyph-html.mjs +26 -0
- package/browser/editor/page/emoji-picker/grid.mjs +79 -0
- package/browser/editor/page/emoji-picker/icon-tab.mjs +217 -0
- package/browser/editor/page/emoji-picker/icons.mjs +32 -0
- package/browser/editor/page/emoji-picker/index.mjs +164 -0
- package/browser/editor/page/emoji-picker/styles.mjs +2 -0
- package/browser/editor/page/emoji-picker/support.mjs +202 -0
- package/browser/editor/page/emoji-picker/upload.mjs +235 -0
- package/browser/editor/page/export-report.mjs +23 -0
- package/browser/editor/page/fills.mjs +60 -0
- package/browser/editor/page/find/index.mjs +107 -0
- package/browser/editor/page/flags.mjs +70 -0
- package/browser/editor/page/format-bar/bar.mjs +448 -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 +400 -0
- package/browser/editor/page/gesture.mjs +45 -0
- package/browser/editor/page/handle/index.mjs +639 -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 +243 -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/look.mjs +65 -0
- package/browser/editor/page/made.mjs +24 -0
- package/browser/editor/page/margin.mjs +352 -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 +500 -0
- package/browser/editor/page/merge.mjs +100 -0
- package/browser/editor/page/notices.mjs +142 -0
- package/browser/editor/page/offered.mjs +32 -0
- package/browser/editor/page/outline/folds.mjs +52 -0
- package/browser/editor/page/outline/index.mjs +697 -0
- package/browser/editor/page/outline/list.mjs +172 -0
- package/browser/editor/page/outline/read.mjs +201 -0
- package/browser/editor/page/outline/strip.mjs +281 -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 +64 -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 +59 -0
- package/browser/editor/page/selection/index.mjs +157 -0
- package/browser/editor/page/selection/marquee.mjs +174 -0
- package/browser/editor/page/session.mjs +117 -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 +138 -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 +985 -0
- package/browser/editor/page/table/lists.mjs +187 -0
- package/browser/editor/page/table/widths.mjs +308 -0
- package/browser/editor/page/tex.mjs +32 -0
- package/browser/editor/page/text-select/index.mjs +656 -0
- package/browser/editor/page/tooltip.mjs +98 -0
- package/browser/editor/page/type-grid.mjs +82 -0
- package/browser/editor/page/typing/code-edges.mjs +228 -0
- package/browser/editor/page/typing/index.mjs +276 -0
- package/browser/editor/page/typing/leave.mjs +68 -0
- package/browser/editor/page/ui.mjs +160 -0
- package/browser/shared/annotations.mjs +571 -0
- package/browser/shared/code-folds.mjs +10 -0
- package/browser/shared/code-languages.mjs +70 -0
- package/browser/shared/code-lines.mjs +30 -0
- package/browser/shared/colors.mjs +28 -0
- package/browser/shared/component-catalog.mjs +559 -0
- package/browser/shared/components/bookmark.mjs +26 -0
- package/browser/shared/components/callout.mjs +7 -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 +342 -0
- package/browser/shared/components/installed.mjs +162 -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 +37 -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/emoji/custom.mjs +91 -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 +26 -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 +196 -0
- package/browser/shared/emoji/emoji.mjs +37 -0
- package/browser/shared/emoji/glyphs.mjs +134 -0
- package/browser/shared/emoji/icon-value.mjs +90 -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 +53 -0
- package/browser/shared/http.mjs +22 -0
- package/browser/shared/i18n/en.mjs +1164 -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/media.mjs +162 -0
- package/browser/shared/new-names.mjs +64 -0
- package/browser/shared/number-reading.mjs +92 -0
- package/browser/shared/old-names.mjs +143 -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 +110 -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 +76 -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.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-2PBALTR3.mjs +57 -0
- package/dist/chunk-342HXE3Q.mjs +2 -0
- package/dist/chunk-3LA3EMDE.mjs +15 -0
- package/dist/chunk-43B75J5T.mjs +2 -0
- package/dist/chunk-4K5KC6V2.mjs +2 -0
- package/dist/chunk-5FRMCDPY.mjs +16 -0
- package/dist/chunk-5L7RYZCL.mjs +2 -0
- package/dist/chunk-5LEK2CBS.mjs +2 -0
- package/dist/chunk-5OFN5AHC.mjs +2 -0
- package/dist/chunk-5SIYS5HN.mjs +2 -0
- package/dist/chunk-5TEK3RAD.mjs +2 -0
- package/dist/chunk-6CYG3Z4V.mjs +2 -0
- package/dist/chunk-6U2SLSDN.mjs +3 -0
- package/dist/chunk-742D2WWJ.mjs +19 -0
- package/dist/chunk-7GHT2UCA.mjs +15 -0
- package/dist/chunk-7QQBR7PB.mjs +2 -0
- package/dist/chunk-A55HN5OK.mjs +2 -0
- package/dist/chunk-ACOPDCNB.mjs +2 -0
- package/dist/chunk-AGDILNWB.mjs +2 -0
- package/dist/chunk-ATCJYAR4.mjs +2 -0
- package/dist/chunk-B3VTYBYR.mjs +960 -0
- package/dist/chunk-C564NU2H.mjs +77 -0
- package/dist/chunk-C7HWOBIF.mjs +2 -0
- package/dist/chunk-DB4WKGYF.mjs +7 -0
- package/dist/chunk-E7VYDG2X.mjs +2 -0
- package/dist/chunk-EUX7IC5J.mjs +48 -0
- package/dist/chunk-EVJ3BX3M.mjs +2 -0
- package/dist/chunk-EZY3WC6Z.mjs +15 -0
- package/dist/chunk-FQGQH4KM.mjs +2 -0
- package/dist/chunk-G7TOXONE.mjs +6 -0
- package/dist/chunk-GPF4YWWB.mjs +9 -0
- package/dist/chunk-GRAXKKG4.mjs +2 -0
- package/dist/chunk-GYQV7Y4J.mjs +120 -0
- package/dist/chunk-HMHK3EQ6.mjs +2 -0
- package/dist/chunk-HQQMJCQJ.mjs +10 -0
- package/dist/chunk-HYMEEXKN.mjs +4 -0
- package/dist/chunk-IERUOGC3.mjs +6 -0
- package/dist/chunk-ITNLYXXV.mjs +3 -0
- package/dist/chunk-L4DVONOG.mjs +2 -0
- package/dist/chunk-LAE5NQ4B.mjs +2 -0
- package/dist/chunk-LC7YNQFG.mjs +2 -0
- package/dist/chunk-LHTFLRB6.mjs +4 -0
- package/dist/chunk-LKX55H76.mjs +2 -0
- package/dist/chunk-MAFIGVXY.mjs +2 -0
- package/dist/chunk-NFIBI4IP.mjs +26 -0
- package/dist/chunk-NSKUTQ5J.mjs +5 -0
- package/dist/chunk-O52JMOCZ.mjs +2 -0
- package/dist/chunk-P2CAZPDP.mjs +3 -0
- package/dist/chunk-QAIHRH3I.mjs +13 -0
- package/dist/chunk-QMQUXTU4.mjs +12 -0
- package/dist/chunk-QR6A54KJ.mjs +3 -0
- package/dist/chunk-QVWVFC5K.mjs +6 -0
- package/dist/chunk-QYKCJ7FG.mjs +8 -0
- package/dist/chunk-QZY6Q64C.mjs +2 -0
- package/dist/chunk-TDQP3DKQ.mjs +10 -0
- package/dist/chunk-TMYZB6AV.mjs +2 -0
- package/dist/chunk-TX6JH7TR.mjs +2 -0
- package/dist/chunk-U3SSPL4K.mjs +8 -0
- package/dist/chunk-UH4SIXTR.mjs +2 -0
- package/dist/chunk-UNUEWH4S.mjs +2 -0
- package/dist/chunk-UXUK4PMC.mjs +27 -0
- package/dist/chunk-V4CPWKMZ.mjs +2 -0
- package/dist/chunk-V6XZ4VIR.mjs +2 -0
- package/dist/chunk-VACRB2NE.mjs +3 -0
- package/dist/chunk-W63L7367.mjs +7 -0
- package/dist/chunk-W7CXPCRV.mjs +6 -0
- package/dist/chunk-W7XHE4CT.mjs +2 -0
- package/dist/chunk-XINNG4F2.mjs +4 -0
- package/dist/chunk-Y34NR5JL.mjs +2 -0
- package/dist/chunk-YEY3RSFQ.mjs +2 -0
- package/dist/chunk-YL2DPWVS.mjs +4 -0
- package/dist/chunk-YXAUQPVK.mjs +8 -0
- package/dist/chunk-YZ5Z6H4W.mjs +4 -0
- package/dist/chunk-Z52HTUW7.mjs +4 -0
- package/dist/chunk-ZBIM6ARY.mjs +216 -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 +1988 -0
- package/kit/report.css +2821 -0
- package/kit/runtime.js +1707 -0
- package/kit/sheets.js +123 -0
- package/kit/state.js +217 -0
- package/kit/tables.js +1449 -0
- package/kit/tokens.js +29 -0
- package/kit/ui.js +561 -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 +141 -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 +138 -0
- package/skill/agents/openai.yaml +5 -0
- package/skill/references/building-components.md +327 -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 +141 -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-B6Ai3wsa.js +13 -0
- package/web/assets/index-SYPC3EZy.css +1 -0
- package/web/index.html +14 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { tooltip } from "../tooltip.mjs";
|
|
2
|
+
import { element } from "../ui.mjs";
|
|
3
|
+
import { t } from "../../../shared/i18n/index.mjs";
|
|
4
|
+
import { keyAction } from "./tree.mjs";
|
|
5
|
+
|
|
6
|
+
// The outline's rows (outline/index.mjs puts them in its dock, or in the strip's card): a tree as
|
|
7
|
+
// aria has it (role tree, a treeitem a row with its level, open or folded, the current one
|
|
8
|
+
// aria-current), one tab stop (the current row, else the first), the keys of tree.mjs keyAction.
|
|
9
|
+
// A row's title, cut short, shows whole in the shared tooltip, at the list's left (over the gutter,
|
|
10
|
+
// not the rows above); a parent's triangle at its title's left, in a column of its own (a leaf keeps
|
|
11
|
+
// the room, so titles of a level line up), folds or unfolds it (a folded one always shows it, an open
|
|
12
|
+
// one while the pointer is over the list or the keyboard is in it: STYLE in index.mjs); a click
|
|
13
|
+
// elsewhere on the row goes to its heading. The strip (strip.mjs) lights a row from outside (hot): the
|
|
14
|
+
// one its line under the pointer stands for, filled as under the pointer, a blue segment on the guide.
|
|
15
|
+
|
|
16
|
+
export const ROW = 28; // a row's height
|
|
17
|
+
const MARK = 16; // the current row's segment on the guide (and the hot row's)
|
|
18
|
+
|
|
19
|
+
// A small solid triangle on the 20-unit grid, pointing right (folded); turned down when open.
|
|
20
|
+
export const TRIANGLE = '<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M8 6.5v7l5-3.5z"/></svg>';
|
|
21
|
+
|
|
22
|
+
const cut = (node) => node.scrollWidth > node.clientWidth + 1;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* jump(node, { keyboard }): a row chosen (a click, or Enter or Space: keyboard); fold(node): its
|
|
26
|
+
* chevron (a click, ← or →); escape(): Esc in the list; page(direction): PageDown (1) or PageUp (-1).
|
|
27
|
+
* Returns { node (the list), render(rows, folded, marked), mark(marked), focus(index), rowAt(index), holds(target) }.
|
|
28
|
+
*/
|
|
29
|
+
export function createList({ jump, fold, escape, page }) {
|
|
30
|
+
const node = element("div", { class: "ge-outline-list", role: "tree", "aria-label": t("目录") });
|
|
31
|
+
const segment = element("span", { class: "ge-outline-mark", "aria-hidden": "true" });
|
|
32
|
+
const hotSegment = element("span", { class: "ge-outline-mark", "data-hot": "", "aria-hidden": "true", hidden: "" });
|
|
33
|
+
const empty = element("div", { class: "ge-outline-empty", text: t("添加标题后,这里会列出它们") });
|
|
34
|
+
let rows = [];
|
|
35
|
+
let folded = new Set();
|
|
36
|
+
let marked = -1;
|
|
37
|
+
let hot = -1;
|
|
38
|
+
let rowNodes = [];
|
|
39
|
+
|
|
40
|
+
function rowFor({ node: item, depth, parent }, index) {
|
|
41
|
+
const label = element("span", { class: "ge-outline-text" });
|
|
42
|
+
const named = item.kind === "tab" ? element("span", { class: "ge-outline-tab", text: item.text }) : label;
|
|
43
|
+
if (item.kind === "tab") label.append(named);
|
|
44
|
+
else label.textContent = item.text;
|
|
45
|
+
const open = !folded.has(item.key);
|
|
46
|
+
const twist = item.children.length
|
|
47
|
+
? element("span", { class: "ge-outline-twist", role: "button", "aria-label": open ? t("折叠") : t("展开"), html: TRIANGLE })
|
|
48
|
+
: element("span", { class: "ge-outline-slot", "aria-hidden": "true" });
|
|
49
|
+
const row = element("div", { class: "ge-outline-row", role: "treeitem", tabindex: "-1", "aria-level": String(depth + 1), "data-index": String(index), "data-kind": item.kind }, twist, label);
|
|
50
|
+
row.style.setProperty("--ge-depth", String(depth));
|
|
51
|
+
if (item.kind === "tab" && item.shown) row.dataset.shown = "";
|
|
52
|
+
// The top level's headings (bold): at the top, or right under a tab (a tab's own top level).
|
|
53
|
+
if (item.kind === "heading" && (parent < 0 || rows[parent]?.node.kind === "tab")) row.dataset.top = "";
|
|
54
|
+
if (item.children.length) row.setAttribute("aria-expanded", String(open));
|
|
55
|
+
tooltip(row, () => (cut(named) ? item.text : null), null, { placement: "left", align: "center", gap: 14 });
|
|
56
|
+
return row;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Draw `rows` (tree.mjs rowsOf) with what is `folded`, row `marked` the current one. */
|
|
60
|
+
function render(next, nextFolded, nextMarked) {
|
|
61
|
+
const focusedKey = node.contains(document.activeElement) ? rows[Number(document.activeElement.dataset?.index)]?.node.key : null;
|
|
62
|
+
rows = next;
|
|
63
|
+
folded = nextFolded;
|
|
64
|
+
rowNodes = rows.map(rowFor);
|
|
65
|
+
node.replaceChildren(...rowNodes, ...(rows.length ? [segment, hotSegment] : [empty]));
|
|
66
|
+
node.toggleAttribute("data-empty", rows.length === 0);
|
|
67
|
+
marked = -2;
|
|
68
|
+
mark(nextMarked);
|
|
69
|
+
const wasHot = hot;
|
|
70
|
+
hot = -2;
|
|
71
|
+
light(wasHot);
|
|
72
|
+
if (focusedKey !== null) {
|
|
73
|
+
const again = rows.findIndex((row) => row.node.key === focusedKey);
|
|
74
|
+
focus(again >= 0 ? again : Math.max(0, Math.min(rows.length - 1, marked)));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** The rows' data, the same rows drawn (the tree read again, its elements new: an undo put them back). */
|
|
79
|
+
function update(next) {
|
|
80
|
+
rows = next;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Row `index` the current one (-1: none). */
|
|
84
|
+
function mark(index) {
|
|
85
|
+
if (index === marked) return;
|
|
86
|
+
marked = index;
|
|
87
|
+
rowNodes.forEach((row, at) => {
|
|
88
|
+
const current = at === index;
|
|
89
|
+
row.toggleAttribute("data-current", current);
|
|
90
|
+
if (current) row.setAttribute("aria-current", "location");
|
|
91
|
+
else row.removeAttribute("aria-current");
|
|
92
|
+
});
|
|
93
|
+
const stop = index >= 0 ? index : 0;
|
|
94
|
+
rowNodes.forEach((row, at) => { row.tabIndex = at === stop ? 0 : -1; });
|
|
95
|
+
place(segment, index);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// A segment on the guide by row `index` (rows stand ROW apart, measured or not: the card closed).
|
|
99
|
+
function place(mark, index) {
|
|
100
|
+
mark.hidden = !rowNodes[index];
|
|
101
|
+
if (!mark.hidden) mark.style.transform = `translateY(${index * ROW + (ROW - MARK) / 2}px)`;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Row `index` lit from outside (the strip's line under the pointer; -1: none). Returns its node. */
|
|
105
|
+
function light(index) {
|
|
106
|
+
if (index === hot) return rowNodes[index] ?? null;
|
|
107
|
+
rowNodes[hot]?.removeAttribute("data-hot");
|
|
108
|
+
hot = rowNodes[index] ? index : -1;
|
|
109
|
+
rowNodes[hot]?.setAttribute("data-hot", "");
|
|
110
|
+
place(hotSegment, hot);
|
|
111
|
+
return rowNodes[hot] ?? null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function focus(index) {
|
|
115
|
+
const row = rowNodes[index];
|
|
116
|
+
if (!row) return;
|
|
117
|
+
rowNodes.forEach((other) => { other.tabIndex = other === row ? 0 : -1; });
|
|
118
|
+
row.focus({ preventScroll: true });
|
|
119
|
+
const box = row.closest(".ge-outline-scroll");
|
|
120
|
+
if (!box) return;
|
|
121
|
+
const top = row.getBoundingClientRect().top - box.getBoundingClientRect().top + box.scrollTop;
|
|
122
|
+
if (top < box.scrollTop) box.scrollTop = top - 4;
|
|
123
|
+
else if (top + ROW > box.scrollTop + box.clientHeight) box.scrollTop = top + ROW - box.clientHeight + 4;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const indexOf = (target) => Number(target?.closest?.(".ge-outline-row")?.dataset.index ?? -1);
|
|
127
|
+
|
|
128
|
+
node.addEventListener("click", (event) => {
|
|
129
|
+
const index = indexOf(event.target);
|
|
130
|
+
if (index < 0 || !rows[index]) return;
|
|
131
|
+
if (event.target.closest(".ge-outline-twist")) fold(rows[index].node);
|
|
132
|
+
else jump(rows[index].node, { keyboard: event.detail === 0 });
|
|
133
|
+
});
|
|
134
|
+
node.addEventListener("keydown", (event) => {
|
|
135
|
+
// Ctrl/⌘+A selects nothing here (the rows are no text; the page's select-all is the text's).
|
|
136
|
+
if ((event.ctrlKey || event.metaKey) && !event.altKey && event.key.toLowerCase() === "a") {
|
|
137
|
+
event.preventDefault();
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if (event.ctrlKey || event.metaKey || event.altKey || event.isComposing) return;
|
|
141
|
+
if (event.key === "Escape") {
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
escape();
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (event.key === "PageUp" || event.key === "PageDown") {
|
|
147
|
+
event.preventDefault();
|
|
148
|
+
page?.(event.key === "PageDown" ? 1 : -1);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const index = indexOf(event.target);
|
|
152
|
+
const action = index >= 0 ? keyAction(rows, index, event.key, folded) : null;
|
|
153
|
+
if (!action) return;
|
|
154
|
+
event.preventDefault();
|
|
155
|
+
if ("focus" in action) focus(action.focus);
|
|
156
|
+
else if (action.fold || action.unfold) fold(action.fold ?? action.unfold);
|
|
157
|
+
else if (action.jump) jump(action.jump, { keyboard: true });
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
return {
|
|
161
|
+
node,
|
|
162
|
+
render,
|
|
163
|
+
update,
|
|
164
|
+
mark,
|
|
165
|
+
light,
|
|
166
|
+
focus,
|
|
167
|
+
get marked() { return marked; },
|
|
168
|
+
get hot() { return hot; },
|
|
169
|
+
rowAt: (index) => rowNodes[index] ?? null,
|
|
170
|
+
holds: (target) => node.contains(target),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { SHEETS } from "../../components/kit.mjs";
|
|
2
|
+
|
|
3
|
+
// What the outline lists, read from the page (outline/tree.mjs's entries): the heading blocks (h1-h4
|
|
4
|
+
// the editor knows as headings, data-ge-unit-kind="heading", in the file or made on the page) in the
|
|
5
|
+
// page's flows: sections, plain boxes, highlight panels, rows of columns, disclosures, tab panels. Not
|
|
6
|
+
// the report's title (the header's: the page's name), a detail card's headings (a dialog, not on the
|
|
7
|
+
// page), a component's own title (a figure's or a chart's, which is no heading block), nor a heading in a
|
|
8
|
+
// table or a list (a flowchart's step). A row of columns, a disclosure and a tab's panel keep their
|
|
9
|
+
// headings to themselves (tree.mjs "scope"); a tabs area lists its tabs in their row's order, the hidden
|
|
10
|
+
// ones too, each with its panel's headings. A heading with no text (just made) has no row yet.
|
|
11
|
+
|
|
12
|
+
export const HEADING = ':is(h1, h2, h3, h4)[data-ge-unit-kind="heading"]';
|
|
13
|
+
const LEFT_OUT = "dialog, figure, table, li, .doc-header, template, [data-doc-dev]";
|
|
14
|
+
const SCOPES = ".doc-columns, details";
|
|
15
|
+
|
|
16
|
+
// ---------- a formula as a row reads it ----------
|
|
17
|
+
|
|
18
|
+
const SYMBOLS = {
|
|
19
|
+
alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", varepsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", vartheta: "ϑ", iota: "ι", kappa: "κ",
|
|
20
|
+
lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", pi: "π", rho: "ρ", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", varphi: "φ", chi: "χ", psi: "ψ", omega: "ω",
|
|
21
|
+
Gamma: "Γ", Delta: "Δ", Theta: "Θ", Lambda: "Λ", Xi: "Ξ", Pi: "Π", Sigma: "Σ", Upsilon: "Υ", Phi: "Φ", Psi: "Ψ", Omega: "Ω",
|
|
22
|
+
times: "×", cdot: "·", div: "÷", pm: "±", mp: "∓", le: "≤", leq: "≤", ge: "≥", geq: "≥", ne: "≠", neq: "≠", approx: "≈", sim: "∼", simeq: "≃",
|
|
23
|
+
equiv: "≡", propto: "∝", infty: "∞", to: "→", rightarrow: "→", leftarrow: "←", Rightarrow: "⇒", Leftarrow: "⇐", leftrightarrow: "↔",
|
|
24
|
+
Leftrightarrow: "⇔", mapsto: "↦", sum: "∑", prod: "∏", int: "∫", oint: "∮", partial: "∂", nabla: "∇", in: "∈", notin: "∉", ni: "∋",
|
|
25
|
+
subset: "⊂", subseteq: "⊆", supset: "⊃", supseteq: "⊇", cup: "∪", cap: "∩", emptyset: "∅", varnothing: "∅", forall: "∀", exists: "∃",
|
|
26
|
+
neg: "¬", land: "∧", wedge: "∧", lor: "∨", vee: "∨", ldots: "…", cdots: "⋯", dots: "…", circ: "∘", degree: "°", prime: "′", angle: "∠",
|
|
27
|
+
perp: "⊥", parallel: "∥", ll: "≪", gg: "≫", langle: "⟨", rangle: "⟩", lvert: "|", rvert: "|", vert: "|", mid: "|", percent: "%",
|
|
28
|
+
};
|
|
29
|
+
const SPACED = new Set(["×", "·", "÷", "±", "∓", "≤", "≥", "≠", "≈", "∼", "≃", "≡", "∝", "→", "←", "⇒", "⇐", "↔", "⇔", "↦", "∈", "∉", "∋", "⊂", "⊆", "⊃", "⊇", "∪", "∩", "∧", "∨", "∘", "≪", "≫", "∥", "⊥"]); // written with a space on each side
|
|
30
|
+
const NAMED = new Set(["log", "ln", "lg", "sin", "cos", "tan", "cot", "sec", "csc", "exp", "lim", "max", "min", "sup", "inf", "det", "arg", "deg", "gcd", "mod", "Pr"]);
|
|
31
|
+
const KEPT = new Set(["text", "textrm", "textbf", "textit", "mathrm", "mathbf", "mathit", "mathsf", "mathtt", "mathcal", "mathbb", "mathfrak", "boldsymbol", "bm", "operatorname", "mbox", "hbox", "overline", "underline", "widehat", "widetilde", "hat", "tilde", "bar", "vec", "dot", "ddot", "displaystyle", "textstyle"]);
|
|
32
|
+
const DROPPED = new Set(["left", "right", "big", "Big", "bigg", "Bigg", "bigl", "bigr", "Bigl", "Bigr", "limits", "nolimits"]);
|
|
33
|
+
const SPACES = { ",": " ", ";": " ", ":": " ", "!": "", " ": " ", quad: " ", qquad: " ", "\\": " " };
|
|
34
|
+
const UP = { 0: "⁰", 1: "¹", 2: "²", 3: "³", 4: "⁴", 5: "⁵", 6: "⁶", 7: "⁷", 8: "⁸", 9: "⁹", "+": "⁺", "-": "⁻", "=": "⁼", "(": "⁽", ")": "⁾", n: "ⁿ", i: "ⁱ", "′": "′" };
|
|
35
|
+
const DOWN = { 0: "₀", 1: "₁", 2: "₂", 3: "₃", 4: "₄", 5: "₅", 6: "₆", 7: "₇", 8: "₈", 9: "₉", "+": "₊", "-": "₋", "=": "₌", "(": "₍", ")": "₎" };
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A formula's TeX as a row reads it (a line of plain text, not drawn): Greek letters and the usual
|
|
39
|
+
* signs as their characters, \frac{a}{b} as a/b, \sqrt{x} as √x, a power or an index of digits raised
|
|
40
|
+
* or lowered (x^2 as x², a_1 as a₁; others written x^n, x_ij as they are), \text{…} and its kind as
|
|
41
|
+
* their words, \left and \right left out, a chemical formula's numbers lowered (\ce{H2O} as H₂O).
|
|
42
|
+
*/
|
|
43
|
+
export function texReading(tex) {
|
|
44
|
+
let at = 0;
|
|
45
|
+
const group = () => { // what a command or a script takes: {…}, a command, or one character
|
|
46
|
+
while (tex[at] === " ") at++;
|
|
47
|
+
if (tex[at] === "{") {
|
|
48
|
+
let depth = 0;
|
|
49
|
+
const from = at;
|
|
50
|
+
for (; at < tex.length; at++) {
|
|
51
|
+
if (tex[at] === "\\") at++;
|
|
52
|
+
else if (tex[at] === "{") depth++;
|
|
53
|
+
else if (tex[at] === "}" && --depth === 0) break;
|
|
54
|
+
}
|
|
55
|
+
at++;
|
|
56
|
+
return texReading(tex.slice(from + 1, at - 1));
|
|
57
|
+
}
|
|
58
|
+
if (tex[at] === "\\") return read(true);
|
|
59
|
+
return tex[at++] ?? "";
|
|
60
|
+
};
|
|
61
|
+
const wrapped = (text) => (text.length > 1 && /[\s+\-−×·/=]/.test(text) ? `(${text})` : text);
|
|
62
|
+
const script = (text, map, mark) => {
|
|
63
|
+
const bare = text.replace(/\s+/g, "");
|
|
64
|
+
if (!bare) return "";
|
|
65
|
+
return [...bare].every((char) => map[char]) ? [...bare].map((char) => map[char]).join("") : `${mark}${wrapped(bare)}`;
|
|
66
|
+
};
|
|
67
|
+
function read(one = false) {
|
|
68
|
+
let out = "";
|
|
69
|
+
while (at < tex.length) {
|
|
70
|
+
const char = tex[at];
|
|
71
|
+
if (char === "\\") {
|
|
72
|
+
at++;
|
|
73
|
+
const name = /[A-Za-z]/.test(tex[at] ?? "") ? tex.slice(at).match(/^[A-Za-z]+/)[0] : tex[at] ?? "";
|
|
74
|
+
at += name.length;
|
|
75
|
+
if (/^[A-Za-z]/.test(name)) while (tex[at] === " ") at++; // the space ending a command's name is no space
|
|
76
|
+
let piece;
|
|
77
|
+
if (name in SPACES) piece = SPACES[name];
|
|
78
|
+
else if (name === "frac" || name === "dfrac" || name === "tfrac") piece = `${wrapped(group())}/${wrapped(group())}`;
|
|
79
|
+
else if (name === "sqrt") {
|
|
80
|
+
if (tex[at] === "[") at = tex.indexOf("]", at) + 1 || tex.length;
|
|
81
|
+
piece = `√${wrapped(group())}`;
|
|
82
|
+
} else if (name === "ce") piece = group().replace(/(?<=[A-Za-z)\]])(\d+)/g, (digits) => script(digits, DOWN, "_"));
|
|
83
|
+
else if (KEPT.has(name)) piece = group();
|
|
84
|
+
else if (DROPPED.has(name)) piece = "";
|
|
85
|
+
else if (SYMBOLS[name]) piece = SPACED.has(SYMBOLS[name]) ? ` ${SYMBOLS[name]} ` : SYMBOLS[name];
|
|
86
|
+
else if (NAMED.has(name)) piece = /[A-Za-z\\]/.test(tex[at] ?? "") ? `${name} ` : name; // sin θ, log₂ n
|
|
87
|
+
else piece = name;
|
|
88
|
+
out += piece;
|
|
89
|
+
} else if (char === "^" || char === "_") {
|
|
90
|
+
at++;
|
|
91
|
+
out += script(group(), char === "^" ? UP : DOWN, char);
|
|
92
|
+
} else if (char === "{") out += group();
|
|
93
|
+
else if (char === "}") at++;
|
|
94
|
+
else if (char === "~") { out += " "; at++; }
|
|
95
|
+
else if (char === "=" || char === "+" || char === "<" || char === ">") { out += ` ${char} `; at++; }
|
|
96
|
+
else { out += char; at++; }
|
|
97
|
+
if (one) break;
|
|
98
|
+
}
|
|
99
|
+
return out;
|
|
100
|
+
}
|
|
101
|
+
return read().replace(/\s+/g, " ").trim();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* A heading's text as its row shows it: spaces as one, an inline formula as it reads (texReading),
|
|
106
|
+
* a link shown with its icon as its title, inline code and marks as their text; what the editor adds
|
|
107
|
+
* (pads, its own nodes) left out.
|
|
108
|
+
*/
|
|
109
|
+
export function headingText(heading) {
|
|
110
|
+
const copy = heading.cloneNode(true);
|
|
111
|
+
for (const math of copy.querySelectorAll(".katex")) {
|
|
112
|
+
const tex = math.querySelector('annotation[encoding="application/x-tex"]')?.textContent;
|
|
113
|
+
math.replaceWith(tex === undefined ? math.textContent : texReading(tex));
|
|
114
|
+
}
|
|
115
|
+
for (const inline of copy.querySelectorAll(".doc-math-inline")) {
|
|
116
|
+
const text = inline.textContent;
|
|
117
|
+
const tex = text.match(/^\s*\\\(([\s\S]*)\\\)\s*$/);
|
|
118
|
+
inline.textContent = tex ? texReading(tex[1]) : text;
|
|
119
|
+
}
|
|
120
|
+
for (const node of copy.querySelectorAll('[data-doc-dev], [aria-hidden="true"], script, style')) node.remove();
|
|
121
|
+
return copy.textContent.replace(/[]/g, "").replace(/\s+/g, " ").trim();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const tabText = (tab) => tab.textContent.replace(/[]/g, "").replace(/\s+/g, " ").trim();
|
|
125
|
+
|
|
126
|
+
/** The entries of `main` (tree.mjs), each heading's and tab's element as its `ref`. */
|
|
127
|
+
export function entriesOf(main) {
|
|
128
|
+
const heads = new Set([...main.querySelectorAll(HEADING)].filter((heading) => !heading.closest(LEFT_OUT)));
|
|
129
|
+
const holding = new Set(); // the boxes on the way to a heading: the only ones walked into
|
|
130
|
+
for (const heading of heads) {
|
|
131
|
+
for (let node = heading.parentElement; node && node !== main && !holding.has(node); node = node.parentElement) holding.add(node);
|
|
132
|
+
}
|
|
133
|
+
const named = new Map(); // a heading with no block id is named by its level and text, the second of a name numbered
|
|
134
|
+
const keyOf = (heading, text) => {
|
|
135
|
+
const id = heading.getAttribute("data-block-id");
|
|
136
|
+
if (id) return `b:${id}`;
|
|
137
|
+
const base = `t:${heading.localName}:${text}`;
|
|
138
|
+
const seen = named.get(base) ?? 0;
|
|
139
|
+
named.set(base, seen + 1);
|
|
140
|
+
return seen ? `${base}#${seen}` : base;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
// A tabs area by its name (data-doc-sheets: what the report calls it, kept as the editor gives it
|
|
144
|
+
// a block id, so a fold of its tab stays), else its block id; a second area of a name numbered.
|
|
145
|
+
const areas = new Map();
|
|
146
|
+
const areaKeyOf = (area) => {
|
|
147
|
+
const base = area.getAttribute("data-doc-sheets") || area.getAttribute("data-block-id") || "tabs";
|
|
148
|
+
const seen = areas.get(base) ?? 0;
|
|
149
|
+
areas.set(base, seen + 1);
|
|
150
|
+
return seen ? `${base}#${seen}` : base;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
function tabsOf(area) {
|
|
154
|
+
const row = area.querySelector(SHEETS.row);
|
|
155
|
+
const areaKey = areaKeyOf(area);
|
|
156
|
+
const panels = [...area.children].filter((child) => child.hasAttribute(SHEETS.panelKey));
|
|
157
|
+
const tabs = row ? [...row.querySelectorAll(SHEETS.tabsOfRow)] : [];
|
|
158
|
+
return {
|
|
159
|
+
kind: "tabs",
|
|
160
|
+
key: `a:${areaKey}`,
|
|
161
|
+
tabs: tabs.map((tab) => {
|
|
162
|
+
const id = tab.getAttribute(SHEETS.tabKey);
|
|
163
|
+
const panel = panels.find((candidate) => candidate.getAttribute(SHEETS.panelKey) === id) ?? null;
|
|
164
|
+
return { key: `tab:${areaKey}:${id}`, text: tabText(tab), shown: Boolean(panel && !panel.hidden), ref: tab, entries: panel && holding.has(panel) ? walk(panel) : [] };
|
|
165
|
+
}),
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function walk(container) {
|
|
170
|
+
const out = [];
|
|
171
|
+
for (const child of container.children) {
|
|
172
|
+
if (heads.has(child)) {
|
|
173
|
+
const text = headingText(child);
|
|
174
|
+
if (text) out.push({ kind: "heading", key: keyOf(child, text), level: Number(child.localName[1]), text, ref: child });
|
|
175
|
+
} else if (!holding.has(child)) continue;
|
|
176
|
+
else if (child.matches(SHEETS.match)) out.push(tabsOf(child));
|
|
177
|
+
else if (child.matches(SCOPES)) out.push({ kind: "scope", entries: walk(child) });
|
|
178
|
+
else out.push(...walk(child));
|
|
179
|
+
}
|
|
180
|
+
return out;
|
|
181
|
+
}
|
|
182
|
+
return walk(main);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const LISTED = `${HEADING}, ${SHEETS.tab}, ${SHEETS.match}`;
|
|
186
|
+
const lists = (node) => node.nodeType === 1 && (node.matches(LISTED) || node.querySelector(LISTED) !== null);
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Whether a change of the page (a MutationObserver's records) may change what the outline lists: an
|
|
190
|
+
* attribute it reads, text in a heading or a tab, a heading, a tab or a tabs area put in or taken out
|
|
191
|
+
* (or a box holding one); not the words typed in other text, nor what holds no heading.
|
|
192
|
+
*/
|
|
193
|
+
export function touchesOutline(records) {
|
|
194
|
+
for (const record of records) {
|
|
195
|
+
if (record.type === "attributes") return true;
|
|
196
|
+
const at = record.target.nodeType === 1 ? record.target : record.target.parentElement;
|
|
197
|
+
if (at?.closest?.(`${HEADING}, ${SHEETS.tab}`)) return true;
|
|
198
|
+
if (record.type === "childList" && [...record.addedNodes, ...record.removedNodes].some(lists)) return true;
|
|
199
|
+
}
|
|
200
|
+
return false;
|
|
201
|
+
}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { element } from "../ui.mjs";
|
|
2
|
+
import { t } from "../../../shared/i18n/index.mjs";
|
|
3
|
+
import { ROW } from "./list.mjs";
|
|
4
|
+
import { ticksOf } from "./tree.mjs";
|
|
5
|
+
|
|
6
|
+
// The outline's narrow form (outline/index.mjs shows it where the page has no room for the list:
|
|
7
|
+
// margin.mjs): a strip at the window's right edge of short lines, a line a row
|
|
8
|
+
// shown (folds kept), as wide as the row is shallow, the current heading's dark; 240px of lines at the
|
|
9
|
+
// most (tree.mjs ticksOf: a long report's deepest levels left out).
|
|
10
|
+
//
|
|
11
|
+
// The pointer reaching it shows the list as a card beside it at once (faded in, sliding a little from
|
|
12
|
+
// the strip), its top level with the strip's, and each line is a target of its own: the one nearest the
|
|
13
|
+
// pointer turns blue and stands out (longer, thicker), and the card lights its row (index.mjs: filled
|
|
14
|
+
// as under the pointer, a blue segment on the guide), kept in view; moving up and down moves both. The
|
|
15
|
+
// pointer over the card's rows lights their lines the same way. A click on a line goes to its heading
|
|
16
|
+
// (`choose`), as a click on a row does; the card stays while the pointer is on the strip or the card,
|
|
17
|
+
// and goes a moment after it leaves both (faded out), or at a press elsewhere.
|
|
18
|
+
//
|
|
19
|
+
// The keyboard: the strip is one button (Enter or Space opens the card with the focus in its list;
|
|
20
|
+
// again, or Esc in the list, closes it with the focus back on the strip; the focus leaving both (Tab)
|
|
21
|
+
// or a heading chosen by a key closes it too). Esc on the strip itself leaves it as Esc in the list
|
|
22
|
+
// does (escape). Folding in the card keeps it open; it follows the page's scroll (its current row)
|
|
23
|
+
// while open, unless the pointer is on it. With no headings the strip shows the outline's icon.
|
|
24
|
+
|
|
25
|
+
// Three lines, the lower two set in: the 目录 icon (the workbench's 更多 row draws the same, icons.ts outline).
|
|
26
|
+
export const OUTLINE_ICON = '<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M3.75 5.25h12.5M7.25 10h9M7.25 14.75h9"/></svg>';
|
|
27
|
+
export const STRIP_TOP = 54; // the lines' top in the window, and their card's
|
|
28
|
+
const ROOM = 16 + 16; // their padding and a margin below them
|
|
29
|
+
const HIDE = 280; // ms the card stays after the pointer left the strip and the card
|
|
30
|
+
const SHOW = { ms: 140, slide: 8 }; // the card coming: a fade, sliding this far from the strip
|
|
31
|
+
const FADE = { top: 24, bottom: 32 }; // the card's faded ends (index.mjs STYLE): a lit row kept clear of them
|
|
32
|
+
|
|
33
|
+
const still = () => globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* list: list.mjs (shown in the card). opened(), closed(): the card opened, closed. escape(): Esc on
|
|
37
|
+
* the strip. choose(row): a line clicked, row its index in the rows drawn.
|
|
38
|
+
*/
|
|
39
|
+
export function createStrip({ list, opened, closed, escape, choose }) {
|
|
40
|
+
const button = element("div", { class: "ge-outline-ticks", role: "button", tabindex: "0", "aria-label": t("目录"), "aria-expanded": "false" });
|
|
41
|
+
const strip = element("div", { class: "ge-outline-strip", "data-doc-dev": "", hidden: "" }, button);
|
|
42
|
+
const scroll = element("div", { class: "ge-outline-scroll" });
|
|
43
|
+
const card = element("nav", { class: "ge-outline-card", "aria-label": t("目录"), "data-doc-dev": "", hidden: "" }, scroll);
|
|
44
|
+
let open = false;
|
|
45
|
+
let keyed = false; // opened by a key (the focus in it), not by the pointer
|
|
46
|
+
let over = false; // the pointer on the strip or the card
|
|
47
|
+
let drawn = "";
|
|
48
|
+
let ticks = []; // the lines drawn: { row, width }
|
|
49
|
+
let lines = []; // and their nodes
|
|
50
|
+
let hot = -1; // the row lit (a line under the pointer, or a row of the card)
|
|
51
|
+
let hideTimer = 0;
|
|
52
|
+
|
|
53
|
+
/** The lines for `rows` (tree.mjs rowsOf), row `marked` the current one. */
|
|
54
|
+
function draw(rows, marked) {
|
|
55
|
+
const height = Math.max(40, innerHeight - STRIP_TOP - ROOM);
|
|
56
|
+
const drawing = ticksOf(rows, height, marked);
|
|
57
|
+
const key = `${height}:${drawing.gap}:${drawing.current}:${drawing.ticks.map((tick) => `${tick.row}.${tick.width}`).join(",")}`;
|
|
58
|
+
if (key === drawn) return;
|
|
59
|
+
drawn = key;
|
|
60
|
+
ticks = drawing.ticks;
|
|
61
|
+
if (!rows.length) {
|
|
62
|
+
lines = [];
|
|
63
|
+
button.style.removeProperty("--ge-tick-gap");
|
|
64
|
+
button.replaceChildren(element("span", { class: "ge-outline-none", html: OUTLINE_ICON }));
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
button.style.setProperty("--ge-tick-gap", `${drawing.gap}px`);
|
|
68
|
+
lines = ticks.map((tick, index) => {
|
|
69
|
+
const line = element("i");
|
|
70
|
+
line.style.setProperty("--ge-tick", `${tick.width}px`);
|
|
71
|
+
if (index === drawing.current) line.dataset.current = "";
|
|
72
|
+
return line;
|
|
73
|
+
});
|
|
74
|
+
button.replaceChildren(...lines);
|
|
75
|
+
paint();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// The line that stands for row `row`: its own, or (left out) the last line before it.
|
|
79
|
+
function lineOf(row) {
|
|
80
|
+
let at = -1;
|
|
81
|
+
if (row >= 0) ticks.forEach((tick, index) => { if (tick.row <= row) at = index; });
|
|
82
|
+
return at;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function paint() {
|
|
86
|
+
const at = lineOf(hot);
|
|
87
|
+
lines.forEach((line, index) => line.toggleAttribute("data-hot", index === at));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// The line nearest the pointer's height (the gaps and the strip's ends belong to the nearest).
|
|
91
|
+
function lineAt(y) {
|
|
92
|
+
let best = -1;
|
|
93
|
+
let distance = Infinity;
|
|
94
|
+
lines.forEach((line, index) => {
|
|
95
|
+
const rect = line.getBoundingClientRect();
|
|
96
|
+
const off = Math.abs(y - (rect.top + rect.bottom) / 2);
|
|
97
|
+
if (off < distance) {
|
|
98
|
+
distance = off;
|
|
99
|
+
best = index;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
return best;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Row `row` lit, its line and its row in the card; `keep`: the card scrolled to show it (the
|
|
106
|
+
// pointer on the strip, not on the card's rows themselves).
|
|
107
|
+
function light(row, { keep = false } = {}) {
|
|
108
|
+
if (row === hot) return;
|
|
109
|
+
hot = row;
|
|
110
|
+
paint();
|
|
111
|
+
const node = list.light(open ? row : -1);
|
|
112
|
+
if (keep && node) inView(node);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// As little scrolled as shows `node` whole, clear of the card's faded ends.
|
|
116
|
+
function inView(node) {
|
|
117
|
+
const top = node.getBoundingClientRect().top - scroll.getBoundingClientRect().top + scroll.scrollTop;
|
|
118
|
+
const view = scroll.clientHeight;
|
|
119
|
+
if (top - FADE.top < scroll.scrollTop) scroll.scrollTop = Math.max(0, top - FADE.top);
|
|
120
|
+
else if (top + ROW + FADE.bottom > scroll.scrollTop + view) scroll.scrollTop = Math.min(scroll.scrollHeight - view, top + ROW + FADE.bottom - view);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function showCard() {
|
|
124
|
+
for (const animation of card.getAnimations?.() ?? []) animation.cancel();
|
|
125
|
+
card.hidden = false;
|
|
126
|
+
if (!still()) card.animate?.([{ opacity: 0, transform: `translateX(${SHOW.slide}px)` }, { opacity: 1, transform: "none" }], { duration: SHOW.ms, easing: "ease-out" });
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function hideCard() {
|
|
130
|
+
if (card.hidden) return;
|
|
131
|
+
const animation = still() ? null : card.animate?.([{ opacity: 1, transform: "none" }, { opacity: 0, transform: `translateX(${SHOW.slide / 2}px)` }], { duration: 100, easing: "ease-in", fill: "forwards" });
|
|
132
|
+
const finish = () => {
|
|
133
|
+
animation?.cancel();
|
|
134
|
+
if (!open) card.hidden = true;
|
|
135
|
+
};
|
|
136
|
+
if (animation) animation.onfinish = finish;
|
|
137
|
+
else finish();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** Open the card; `focus`: by a key, the focus in its list (on its current row). */
|
|
141
|
+
function openCard({ focus = false } = {}) {
|
|
142
|
+
clearTimeout(hideTimer);
|
|
143
|
+
if (open) {
|
|
144
|
+
if (focus) {
|
|
145
|
+
keyed = true;
|
|
146
|
+
list.focus(list.marked >= 0 ? list.marked : 0);
|
|
147
|
+
}
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
open = true;
|
|
151
|
+
keyed = focus;
|
|
152
|
+
button.setAttribute("aria-expanded", "true");
|
|
153
|
+
if (list.node.parentNode !== scroll) scroll.append(list.node);
|
|
154
|
+
showCard();
|
|
155
|
+
// The row lit (else the current one) in the card's middle (as far as the list goes), not at its edge.
|
|
156
|
+
const shown = list.light(hot);
|
|
157
|
+
const row = shown ?? list.rowAt(list.marked);
|
|
158
|
+
if (row) {
|
|
159
|
+
const top = row.getBoundingClientRect().top - scroll.getBoundingClientRect().top + scroll.scrollTop;
|
|
160
|
+
scroll.scrollTop = Math.max(0, Math.min(scroll.scrollHeight - scroll.clientHeight, Math.round(top - (scroll.clientHeight - ROW) / 2)));
|
|
161
|
+
}
|
|
162
|
+
if (focus) list.focus(list.marked >= 0 ? list.marked : 0);
|
|
163
|
+
opened?.();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** Close the card; `focus`: the focus back on the strip (Esc in it). */
|
|
167
|
+
function closeCard({ focus = false } = {}) {
|
|
168
|
+
clearTimeout(hideTimer);
|
|
169
|
+
if (!open) return;
|
|
170
|
+
open = false;
|
|
171
|
+
keyed = false;
|
|
172
|
+
over = button.matches(":hover"); // (the card going from under a still pointer tells no leaving)
|
|
173
|
+
button.setAttribute("aria-expanded", "false");
|
|
174
|
+
list.light(-1);
|
|
175
|
+
hideCard();
|
|
176
|
+
if (focus) button.focus({ preventScroll: true });
|
|
177
|
+
closed?.();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const inside = (node) => Boolean(node && (card.contains(node) || button.contains(node)));
|
|
181
|
+
const focusIn = () => inside(document.hasFocus() ? document.activeElement : null);
|
|
182
|
+
|
|
183
|
+
// The pointer: on the strip, the card at once and the line nearest it lit; leaving both, the card
|
|
184
|
+
// goes a moment later (crossing the gap to the card keeps it), unless the keys opened it and hold
|
|
185
|
+
// the focus in it. A touch has no leaving: its card stays until a press elsewhere.
|
|
186
|
+
function enter() {
|
|
187
|
+
over = true;
|
|
188
|
+
clearTimeout(hideTimer);
|
|
189
|
+
}
|
|
190
|
+
function leave(event) {
|
|
191
|
+
if (event.pointerType === "touch" || inside(event.relatedTarget)) return;
|
|
192
|
+
over = false;
|
|
193
|
+
light(-1);
|
|
194
|
+
clearTimeout(hideTimer);
|
|
195
|
+
hideTimer = setTimeout(() => {
|
|
196
|
+
if (!over && !(keyed && focusIn())) closeCard();
|
|
197
|
+
}, HIDE);
|
|
198
|
+
}
|
|
199
|
+
button.addEventListener("pointerenter", (event) => {
|
|
200
|
+
enter();
|
|
201
|
+
openCard();
|
|
202
|
+
light(ticks[lineAt(event.clientY)]?.row ?? -1, { keep: true });
|
|
203
|
+
});
|
|
204
|
+
button.addEventListener("pointermove", (event) => light(ticks[lineAt(event.clientY)]?.row ?? -1, { keep: true }));
|
|
205
|
+
button.addEventListener("pointerleave", leave);
|
|
206
|
+
card.addEventListener("pointerenter", enter);
|
|
207
|
+
card.addEventListener("pointerleave", leave);
|
|
208
|
+
// A row of the card under the pointer: its line lit on the strip.
|
|
209
|
+
card.addEventListener("pointerover", (event) => {
|
|
210
|
+
const row = event.target?.closest?.(".ge-outline-row");
|
|
211
|
+
light(row ? Number(row.dataset.index) : -1);
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
// A click on the strip goes to the heading of the line nearest it (a key's click is the keys' below).
|
|
215
|
+
button.addEventListener("click", (event) => {
|
|
216
|
+
if (event.detail === 0) return;
|
|
217
|
+
const row = ticks[lineAt(event.clientY)]?.row;
|
|
218
|
+
if (row !== undefined) choose?.(row);
|
|
219
|
+
else openCard();
|
|
220
|
+
});
|
|
221
|
+
button.addEventListener("keydown", (event) => {
|
|
222
|
+
if (event.key === "Escape" && !open && !event.isComposing) {
|
|
223
|
+
event.preventDefault();
|
|
224
|
+
escape?.();
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
228
|
+
event.preventDefault();
|
|
229
|
+
if (open && keyed) closeCard({ focus: true });
|
|
230
|
+
else openCard({ focus: true });
|
|
231
|
+
});
|
|
232
|
+
// A press anywhere but on the strip and its card closes the card.
|
|
233
|
+
document.addEventListener("pointerdown", (event) => {
|
|
234
|
+
if (open && !inside(event.target)) closeCard();
|
|
235
|
+
}, true);
|
|
236
|
+
// So does the focus leaving both (Tab out of it, to the workbench or another window, as the block
|
|
237
|
+
// menu closes), unless the pointer holds it there: looked at once the focus has settled, since rows
|
|
238
|
+
// drawn again (a fold) take the focus with them and give it back.
|
|
239
|
+
const left = () => setTimeout(() => {
|
|
240
|
+
if (open && !over && !focusIn()) closeCard();
|
|
241
|
+
}, 0);
|
|
242
|
+
card.addEventListener("focusout", left);
|
|
243
|
+
button.addEventListener("focusout", left);
|
|
244
|
+
|
|
245
|
+
return {
|
|
246
|
+
strip,
|
|
247
|
+
card,
|
|
248
|
+
scroll,
|
|
249
|
+
draw,
|
|
250
|
+
openCard,
|
|
251
|
+
closeCard,
|
|
252
|
+
get open() { return open; },
|
|
253
|
+
/** Whether the keys opened the card (a heading chosen by a key closes it; by the pointer, it stays while the pointer is on it). */
|
|
254
|
+
get keyed() { return keyed; },
|
|
255
|
+
focusButton: () => button.focus({ preventScroll: true }),
|
|
256
|
+
/** Show the strip (or take it away, its card with it). `fade`: it comes faded in. */
|
|
257
|
+
show(on, { fade = false } = {}) {
|
|
258
|
+
clearTimeout(hideTimer);
|
|
259
|
+
if (!on) {
|
|
260
|
+
if (open) {
|
|
261
|
+
open = false;
|
|
262
|
+
keyed = false;
|
|
263
|
+
button.setAttribute("aria-expanded", "false");
|
|
264
|
+
for (const animation of card.getAnimations?.() ?? []) animation.cancel();
|
|
265
|
+
card.hidden = true;
|
|
266
|
+
}
|
|
267
|
+
over = false;
|
|
268
|
+
hot = -1;
|
|
269
|
+
list.light(-1);
|
|
270
|
+
strip.hidden = true;
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
if (list.node.parentNode !== scroll) scroll.append(list.node);
|
|
274
|
+
drawn = "";
|
|
275
|
+
for (const animation of strip.getAnimations?.() ?? []) animation.cancel();
|
|
276
|
+
strip.hidden = false;
|
|
277
|
+
if (fade && !still()) strip.animate?.([{ opacity: 0 }, { opacity: 1 }], { duration: SHOW.ms, easing: "ease-out" });
|
|
278
|
+
},
|
|
279
|
+
holds: (target) => strip.contains(target) || card.contains(target),
|
|
280
|
+
};
|
|
281
|
+
}
|