@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,65 @@
|
|
|
1
|
+
import { Z } from "../../shared/layers.mjs";
|
|
2
|
+
|
|
3
|
+
// The editor's bottom panels: the conflicts' (conflicts.mjs, left) and the lost texts' (notices.mjs,
|
|
4
|
+
// right) are the same card, and the bar of the Agent's changes (changes/bar.mjs, in the middle) is its
|
|
5
|
+
// buttons in a row: a small muted head with a red dot, items under it, the reader's words as
|
|
6
|
+
// a quote, one filled primary button, the rest outlined or, looking only, quiet text. No notice covers
|
|
7
|
+
// one: while one stands, the toast stands above it (notices.mjs, and the workbench's, told the room).
|
|
8
|
+
|
|
9
|
+
const PANELS = ".ge-conflicts:not([hidden]), .ge-panel, .ge-changes:not([hidden])";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* How far from the window's bottom the highest bottom panel shown reaches, 0 with none shown: what a
|
|
13
|
+
* notice stands above.
|
|
14
|
+
*/
|
|
15
|
+
export function panelRoom() {
|
|
16
|
+
let room = 0;
|
|
17
|
+
for (const panel of document.querySelectorAll(PANELS)) {
|
|
18
|
+
const { top, height } = panel.getBoundingClientRect();
|
|
19
|
+
if (height > 0) room = Math.max(room, Math.round(innerHeight - top));
|
|
20
|
+
}
|
|
21
|
+
return room;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Who hears that the room the panels take may have changed: as a panel comes, changes size (cards
|
|
25
|
+
// added or answered), is hidden (收起) and goes.
|
|
26
|
+
const hearing = new Set();
|
|
27
|
+
const told = () => hearing.forEach((listener) => listener());
|
|
28
|
+
const sizes = typeof ResizeObserver === "function" ? new ResizeObserver(told) : null;
|
|
29
|
+
|
|
30
|
+
/** `listener` told whenever the room the bottom panels take may have changed. */
|
|
31
|
+
export const onPanels = (listener) => hearing.add(listener);
|
|
32
|
+
|
|
33
|
+
/** A bottom panel put on the page. */
|
|
34
|
+
export function panelShown(panel) {
|
|
35
|
+
sizes?.observe(panel);
|
|
36
|
+
told();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** A bottom panel taken off the page. */
|
|
40
|
+
export function panelGone(panel) {
|
|
41
|
+
sizes?.unobserve(panel);
|
|
42
|
+
told();
|
|
43
|
+
}
|
|
44
|
+
export const PANEL_STYLE = `
|
|
45
|
+
:is(.ge-conflicts, .ge-panel) { position: fixed; bottom: 16px; z-index: ${Z.panel}; box-sizing: border-box; width: min(400px, calc(100vw - 32px)); max-height: min(70vh, 600px); overflow: auto; border-radius: 10px; background: var(--ge-bg); color: var(--ge-tx); box-shadow: var(--ge-shadow); font: 13px/1.55 var(--doc-sans-font, var(--doc-font, system-ui, sans-serif)); }
|
|
46
|
+
.ge-conflicts { left: 16px; }
|
|
47
|
+
.ge-panel { right: 16px; }
|
|
48
|
+
.ge-conflicts[hidden] { display: none; }
|
|
49
|
+
:is(.ge-conflicts-head, .ge-panel-head) { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 10px 10px 4px 14px; background: var(--ge-bg); color: var(--ge-tx2); font-size: 12px; font-weight: 500; }
|
|
50
|
+
:is(.ge-conflicts-head, .ge-panel-head)::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ge-red); }
|
|
51
|
+
:is(.ge-conflicts-head, .ge-panel-head) span { flex: 1; }
|
|
52
|
+
:is(.ge-conflict, .ge-panel-item) { padding: 10px 14px 12px; }
|
|
53
|
+
:is(.ge-conflict, .ge-panel-item) + :is(.ge-conflict, .ge-panel-item) { border-top: 1px solid var(--ge-edge); }
|
|
54
|
+
:is(.ge-conflict, .ge-panel-item) p { margin: 0; font-weight: 500; }
|
|
55
|
+
:is(.ge-conflict, .ge-panel-item) p + .ge-version { margin-top: 6px; }
|
|
56
|
+
:is(.ge-conflicts, .ge-panel) .ge-version { margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--ge-quote); overflow-wrap: anywhere; }
|
|
57
|
+
:is(.ge-conflicts, .ge-panel) .ge-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
|
|
58
|
+
:is(.ge-conflicts, .ge-panel) button { height: 28px; padding: 0 10px; border: 1px solid var(--ge-edge); border-radius: 6px; background: transparent; color: inherit; font: inherit; font-weight: 500; white-space: nowrap; cursor: pointer; }
|
|
59
|
+
:is(.ge-conflicts, .ge-panel) button:hover:not(:disabled) { background: var(--ge-hover); }
|
|
60
|
+
:is(.ge-conflicts, .ge-panel) button[data-primary] { border-color: transparent; background: var(--ge-accent); color: #fff; }
|
|
61
|
+
:is(.ge-conflicts, .ge-panel) button[data-primary]:hover:not(:disabled) { background: var(--ge-accent-hover); }
|
|
62
|
+
:is(.ge-conflicts, .ge-panel) button[data-quiet] { height: 24px; padding: 0 6px; border-color: transparent; color: var(--ge-tx2); font-weight: 400; }
|
|
63
|
+
:is(.ge-conflicts, .ge-panel) button[data-quiet]:hover:not(:disabled) { color: var(--ge-tx); background: transparent; }
|
|
64
|
+
:is(.ge-conflicts, .ge-panel) button:disabled { opacity: .45; cursor: default; }
|
|
65
|
+
`;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Where a card or panel that stands by something stands: notion-lite's ui/popup.js rule (an origin, a
|
|
2
|
+
// side, an alignment and a gap; put on the other side where it does not fit; kept inside the window),
|
|
3
|
+
// the one placement every such card here takes: the link card, the formula editor, the cell bar, the
|
|
4
|
+
// format bar, the tooltips and the icon picker's popups (emoji-picker/support.mjs). The block menu
|
|
5
|
+
// (menu.mjs place) and what follows the pointer (hints, the size label of resize/) have rules of
|
|
6
|
+
// their own. What stands for text (the format bar, a pasted address's 选择视图) stands by its last
|
|
7
|
+
// character: textAnchor, besideText.
|
|
8
|
+
|
|
9
|
+
const TEXT_GAP_X = 4; // its corner this far right of the text's last character
|
|
10
|
+
const TEXT_GAP_Y = 8; // and this far below its line (or above the text)
|
|
11
|
+
const TEXT_MARGIN = 12; // this far inside the window at the most
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The left and top (window px, not rounded) of a box of `size` ({ width, height }) by `origin` (a
|
|
15
|
+
* rect), `margin` px inside the window at the most. placement: "bottom" or "top" (below or above
|
|
16
|
+
* the origin), "right" or "left" (beside it); a box that does not fit on the side asked for goes to
|
|
17
|
+
* the opposite one if it fits there (if it fits on neither, it stays on the one asked for), inside the
|
|
18
|
+
* window less its scrollbars. align:
|
|
19
|
+
* along that side, the box's "start", "center" or "end" with the origin's. gap: px between them. x:
|
|
20
|
+
* for "bottom" and "top", where the box's left edge is wanted in place of the alignment's (the format
|
|
21
|
+
* bar stands at the selection's last character).
|
|
22
|
+
*/
|
|
23
|
+
export function placeBox(origin, { width, height }, { placement = "bottom", align = "start", gap = 0, margin = 8, x } = {}) {
|
|
24
|
+
// The window less its scrollbars (a box kept inside innerWidth would run under the page's scrollbar).
|
|
25
|
+
const root = globalThis.document?.documentElement;
|
|
26
|
+
const innerWidth = root?.clientWidth || globalThis.innerWidth;
|
|
27
|
+
const innerHeight = root?.clientHeight || globalThis.innerHeight;
|
|
28
|
+
const clamp = (value, space) => Math.max(margin, Math.min(value, space - margin));
|
|
29
|
+
const alignX = () => x ?? (align === "center" ? origin.left + origin.width / 2 - width / 2 : align === "end" ? origin.right - width : origin.left);
|
|
30
|
+
const alignY = () => (align === "center" ? origin.top + origin.height / 2 - height / 2 : align === "end" ? origin.bottom - height : origin.top);
|
|
31
|
+
if (placement === "bottom" || placement === "top") {
|
|
32
|
+
const below = origin.bottom + gap;
|
|
33
|
+
const above = origin.top - gap - height;
|
|
34
|
+
const fitsBelow = below + height <= innerHeight - margin;
|
|
35
|
+
const fitsAbove = above >= margin;
|
|
36
|
+
const top = placement === "bottom" ? (fitsBelow || !fitsAbove ? below : above) : (fitsAbove || !fitsBelow ? above : below);
|
|
37
|
+
return { left: clamp(alignX(), innerWidth - width), top: clamp(top, innerHeight - height) };
|
|
38
|
+
}
|
|
39
|
+
const right = origin.right + gap;
|
|
40
|
+
const beyond = origin.left - gap - width;
|
|
41
|
+
const fitsRight = right + width <= innerWidth - margin;
|
|
42
|
+
const fitsLeft = beyond >= margin;
|
|
43
|
+
const left = placement === "right" ? (fitsRight || !fitsLeft ? right : beyond) : (fitsLeft || !fitsRight ? beyond : right);
|
|
44
|
+
return { left: clamp(left, innerWidth - width), top: clamp(alignY(), innerHeight - height) };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Where text (a range) is to what stands for it: its last character (its last piece of a line), not
|
|
49
|
+
* the right edge of its widest line, and the top of its first line, for when there is no room below.
|
|
50
|
+
*/
|
|
51
|
+
export function textAnchor(range) {
|
|
52
|
+
const box = range.getBoundingClientRect();
|
|
53
|
+
const end = [...range.getClientRects()].filter((rect) => rect.width > 0 && rect.height > 0).at(-1) ?? box;
|
|
54
|
+
return { right: end.right, bottom: end.bottom, top: box.top };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** The left and top of a box of `size` standing for text (`anchor`: textAnchor): below and right of its last character, above its first line when it does not fit below. */
|
|
58
|
+
export const besideText = (anchor, size) => placeBox(anchor, size, { x: anchor.right + TEXT_GAP_X, gap: TEXT_GAP_Y, margin: TEXT_MARGIN });
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { t, told } from "../../shared/i18n/index.mjs";
|
|
2
|
+
// The page's one way to talk to the preview server: a POST of JSON with the report's token
|
|
3
|
+
// (postJson: the request, a network error rejecting as fetch does; postAnswer: its answer read, a
|
|
4
|
+
// failure an answer too, what the editor's requests use), and what goes over it: what a refusal
|
|
5
|
+
// says (failure) and how an upload carries a file (blobBase64).
|
|
6
|
+
|
|
7
|
+
/** POST `body` as JSON to `route` with `token` (the map's); resolves with the Response. */
|
|
8
|
+
export const postJson = (route, token, body, { keepalive = false } = {}) => fetch(route, {
|
|
9
|
+
method: "POST",
|
|
10
|
+
headers: { "Content-Type": "application/json", "X-Gallery-Token": token },
|
|
11
|
+
body: JSON.stringify(body),
|
|
12
|
+
keepalive,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* POST `body` as JSON to `route` and read the answer, never throwing: a server that cannot be
|
|
17
|
+
* reached answers `{ ok: false, reason: "offline" }`, one that answers with no JSON `{ ok: false }`.
|
|
18
|
+
*/
|
|
19
|
+
export async function postAnswer(route, token, body) {
|
|
20
|
+
let response;
|
|
21
|
+
try {
|
|
22
|
+
response = await postJson(route, token, body);
|
|
23
|
+
} catch {
|
|
24
|
+
return { ok: false, reason: "offline" };
|
|
25
|
+
}
|
|
26
|
+
return response.json().catch(() => ({ ok: false }));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* What a refused request says: the server's own words in the UI's language (told: its template with its
|
|
31
|
+
* values, or its whole message), else that it could not be reached, else `fallback`.
|
|
32
|
+
*/
|
|
33
|
+
export const failure = (answer, fallback) => told(answer) ?? (answer.reason === "offline" ? t("连不上本地服务") : fallback);
|
|
34
|
+
|
|
35
|
+
/** A blob's bytes as base64, how an upload carries them. */
|
|
36
|
+
export const blobBase64 = (blob) => new Promise((resolve, reject) => {
|
|
37
|
+
const reader = new FileReader();
|
|
38
|
+
reader.onload = () => resolve(String(reader.result).split(",")[1]);
|
|
39
|
+
reader.onerror = () => reject(reader.error);
|
|
40
|
+
reader.readAsDataURL(blob);
|
|
41
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { t } from "../../shared/i18n/index.mjs";
|
|
2
|
+
import { addressOn, elsewhere, fromFile, isPageAddress, mayBePage, pageAddress, workbenchHash } from "../../shared/page-address.mjs";
|
|
3
|
+
import { inTrash, linkedPages, pageLinks } from "../../shared/page-links.mjs";
|
|
4
|
+
import { PROTOCOL, VERSION } from "../../shared/session.mjs";
|
|
5
|
+
|
|
6
|
+
// The links of a page shown in 演示视图 (?present: src/server/routes.mjs), which has no editor and whose
|
|
7
|
+
// frame the presentation holds (src/workbench/app/features/present/). A link to a document or a block
|
|
8
|
+
// of one goes there in the frame and stays a reader's: its page with ?present, the block found by the
|
|
9
|
+
// kit (kit/runtime/reveal.js); followed as it stands it would come to the document's page with the
|
|
10
|
+
// editor on it, and a web address would take the frame away from the presentation, so that goes to
|
|
11
|
+
// a new tab. An address of this computer is asked of the list as the click is taken, for only the
|
|
12
|
+
// list knows the titles and what is gone: a document that is not there leaves the presentation where
|
|
13
|
+
// it is, with a word through it (the workbench's notice), and on another port what the list does not
|
|
14
|
+
// hold (addressOn) is another program's, a web address like any. What the kit or the browser does with
|
|
15
|
+
// a click stays theirs: an anchor, a link to save, a link of a target of its own, any click with a key
|
|
16
|
+
// held.
|
|
17
|
+
|
|
18
|
+
const own = pageAddress(location.href)?.slug ?? null;
|
|
19
|
+
const openTab = (address) => window.open(address, "_blank", "noopener");
|
|
20
|
+
const read = (route) => fetch(`/__gallery/workspace/${route}`).then((answer) => answer.json()).catch(() => null);
|
|
21
|
+
|
|
22
|
+
function go({ slug, block }) {
|
|
23
|
+
const fragment = block ? `#${encodeURIComponent(block)}` : "";
|
|
24
|
+
if (slug !== own) location.assign(`/generated/${slug}.html?present${fragment}`);
|
|
25
|
+
else if (block) dispatchEvent(new CustomEvent("doc-jump-request", { detail: { hash: fragment } })); // the kit's jump, a step of the history as a link #<block id> is
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function sayGone(name, { trash = [] } = {}) {
|
|
29
|
+
const text = inTrash(trash, name) ? t("这个页面已删除。") : t("没有找到这个页面。");
|
|
30
|
+
window.parent.postMessage({ protocol: PROTOCOL, v: VERSION, type: "notice", slug: own, text }, location.origin);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function follow(address) {
|
|
34
|
+
if (!mayBePage(address)) return void openTab(address);
|
|
35
|
+
const listed = await read("outline");
|
|
36
|
+
const place = addressOn(address, listed?.reports ? pageLinks(linkedPages(listed.reports)) : null, location.origin);
|
|
37
|
+
if (place) go(place);
|
|
38
|
+
else if (isPageAddress(address) && !elsewhere(address, location.origin)) sayGone(pageAddress(address)?.slug ?? workbenchHash(address), listed ?? undefined);
|
|
39
|
+
else openTab(address);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
document.addEventListener("click", (event) => {
|
|
43
|
+
if (event.defaultPrevented || event.button !== 0 || event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) return;
|
|
44
|
+
const link = event.target.closest?.("a[*|href]");
|
|
45
|
+
if (!link || link.matches("[download], [target], [*|href^='#']")) return;
|
|
46
|
+
const address = fromFile(link.href.baseVal ?? link.getAttribute("href"), own, location.origin);
|
|
47
|
+
if (!address || !/^https?:/.test(address)) return;
|
|
48
|
+
event.preventDefault();
|
|
49
|
+
follow(address);
|
|
50
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { t } from "../../shared/i18n/index.mjs";
|
|
2
|
+
|
|
3
|
+
// What 减少通知 leaves out (the workbench's 设置: shared/preferences.mjs quietNotices; notices.mjs
|
|
4
|
+
// say() asks routine() of every notice but an error): the notices of the everyday operations, which
|
|
5
|
+
// users of Notion and Feishu know and notion-lite says nothing of (its snackbar speaks only of a
|
|
6
|
+
// copy to the clipboard, a failure, an upload, an import or an export):
|
|
7
|
+
// - what was just done, which the page shows: moved, deleted, pasted, turned into, inserted,
|
|
8
|
+
// formatted, resized, colored, indented, folded… (every notice that offers Ctrl+Z is one);
|
|
9
|
+
// - how to go on: a selection's keys, a drag's, the format the next letters take;
|
|
10
|
+
// - a copy made with Ctrl+C, a save asked for with Ctrl+S (the page saves by itself), a drag or
|
|
11
|
+
// a resize cancelled or ending where it began, and a key that had nothing to do (Tab on a list's
|
|
12
|
+
// first item, Shift+Tab on its outermost, a block moved past the end of its row).
|
|
13
|
+
// What still shows is what the reader must act on or would not know otherwise: errors, a save that
|
|
14
|
+
// failed or is held, conflicts, text that could not be put back, something refused with the reason
|
|
15
|
+
// ("这里不能粘贴块。"), what an action did that the page does not show (a link copied from a menu, a
|
|
16
|
+
// web page that refused a frame shown as a bookmark, lines pasted into one, a detail card no longer
|
|
17
|
+
// kept, a page whose preview could not be read) and the result of a long one (an export done).
|
|
18
|
+
// Each is matched in the UI's language, its {0}… standing for anything.
|
|
19
|
+
|
|
20
|
+
// Notices that offer Ctrl+Z but say what the page does not show: they still show.
|
|
21
|
+
const TOLD = () => [
|
|
22
|
+
t("入口已移除:页面上没有地方能打开这张详情卡片了 · Ctrl+Z 撤销"),
|
|
23
|
+
`${t("暂不支持获取该网站的预览信息")}{0}`, // links/views.mjs UNREAD: the title or icon of a link left as its address
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
const ROUTINE = () => [
|
|
27
|
+
t("{0} · Ctrl+Z 撤销"), // whatever was just done
|
|
28
|
+
t("已新建分区 · 标题、分割线都可以按需加"),
|
|
29
|
+
t("已复制 {0} · 在要放的块里按 Ctrl+V 粘贴到它后面"), t("已复制 {0} 格"),
|
|
30
|
+
t("已保存。"), t("{0}。", t("标题已更新")),
|
|
31
|
+
t("已取消调整。"), t("已取消移动。"), t("位置没有变化。"),
|
|
32
|
+
t("已选中 {0} 块 · Delete 删除 · 拖动手柄一起移动 · Esc 取消"), t("已选中{0} · Delete 删除{1} · Esc 取消"),
|
|
33
|
+
t("已选中{0} · Delete 删除 · Esc 取消{1}"), t("已选中这一块的文字 · 再按 {0} 选中{1}"), t("已选中这一块的文字"), // Ctrl+A (select-all/)
|
|
34
|
+
t("正在移动{0} · 拖到要放的位置后松开 · 停在选项卡上切换,停在折叠块标题上展开 · Esc 取消"),
|
|
35
|
+
t("接着打的字:{0} · 再按一次取消"), t("接着打的字照旧"),
|
|
36
|
+
t("链接:{0}"), t("链接已移除。"),
|
|
37
|
+
t("这一项上面没有同级的项,不能再缩进。"), t("这一项已经在最外层。"), t("选中的项上面没有同级的项,不能再缩进。"), t("选中的项已经在最外层。"),
|
|
38
|
+
t("{0}已经在{1}。"), t("这里只有{0};可以拖动手柄移到别处。"),
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
const patternOf = (said) => new RegExp(`^${said.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\\\{\d+\\\}/g, "[\\s\\S]*?")}$`);
|
|
42
|
+
let patterns = null;
|
|
43
|
+
|
|
44
|
+
/** Whether `text` (in the UI's language) is a routine notice, one 减少通知 leaves out. */
|
|
45
|
+
export function routine(text) {
|
|
46
|
+
patterns ??= { told: TOLD().map(patternOf), routine: ROUTINE().map(patternOf) };
|
|
47
|
+
return !patterns.told.some((pattern) => pattern.test(text)) && patterns.routine.some((pattern) => pattern.test(text));
|
|
48
|
+
}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { Z } from "../../../shared/layers.mjs";
|
|
2
|
+
import { SPAN } from "../../../shared/media.mjs";
|
|
3
|
+
import { CENTERED } from "../../components/figure/index.mjs";
|
|
4
|
+
import { RESIZABLE, RESIZABLE_AT, SIZES } from "../../components/registry.mjs";
|
|
5
|
+
import { scrollHeight } from "../../components/table/index.mjs";
|
|
6
|
+
import { cancelOnEscape, endsGesture, gestureLock } from "../gesture.mjs";
|
|
7
|
+
import { kept } from "../kept.mjs";
|
|
8
|
+
import { note, own } from "../overlays.mjs";
|
|
9
|
+
import { addStyle, element, mount } from "../ui.mjs";
|
|
10
|
+
import { t } from "../../../shared/i18n/index.mjs";
|
|
11
|
+
|
|
12
|
+
// Resizing chart cards and tables in the preview ("Sizes" in the kit's styles/sizes.css). With the pointer on the
|
|
13
|
+
// right edge of a card or table, or on its bottom edge (a chart's plot height, a table's scroll
|
|
14
|
+
// height), the cursor changes; dragging shows a blue line where the edge goes and the size that
|
|
15
|
+
// makes, and letting go applies it as one undo step (Esc cancels). Widths are shares of the width
|
|
16
|
+
// the block stands in: the reading width, or its column's. A card's width snaps to the middle and
|
|
17
|
+
// to the end; a centered card grows on both sides. A table's
|
|
18
|
+
// width moves its own right end by as much as the pointer moves, also when the table is wider than
|
|
19
|
+
// its frame and scrolls in it; it snaps to the width it stands in, and past it the table is wider than
|
|
20
|
+
// the text and scrolls sideways in its frame, which stays at that width. (The columns of a row
|
|
21
|
+
// are resized by the gaps between them: columns/.)
|
|
22
|
+
// A table of a dozen rows or fewer has no bottom edge to drag. A code block's bottom edge sets the
|
|
23
|
+
// height of its frame: shorter than its code, the code scrolls inside it, and the edge snaps to the
|
|
24
|
+
// height that shows all of it (no height of its own). Letting go where the drag started changes
|
|
25
|
+
// nothing. Anything that ends the press another way (the capture lost, the window losing the
|
|
26
|
+
// focus, the page hidden) cancels it; the lines and the label belong to the drag (overlays.mjs). A
|
|
27
|
+
// code block's bottom edge has no label: the line alone (where it snaps, the status line says after).
|
|
28
|
+
|
|
29
|
+
const STYLE = `
|
|
30
|
+
${gestureLock("data-ge-resize=\"x\"", { cursor: "ew-resize" })}
|
|
31
|
+
${gestureLock("data-ge-resize=\"y\"", { cursor: "ns-resize" })}
|
|
32
|
+
.ge-resize-line { position: fixed; left: 0; top: 0; z-index: ${Z.guide}; border-radius: 2px; background: rgb(151 197 241); pointer-events: none; }
|
|
33
|
+
.ge-resize-label { position: fixed; left: 0; top: 0; z-index: ${Z.label}; padding: 2px 7px; border-radius: 5px; background: var(--doc-accent, #2678d8); color: #fff; font: 12px/18px var(--doc-sans-font, var(--doc-font, system-ui, sans-serif)); white-space: nowrap; pointer-events: none; }
|
|
34
|
+
`;
|
|
35
|
+
const GRAB = { inside: 3, outside: 8 }; // how near an edge the pointer takes it, inside and outside the block (px)
|
|
36
|
+
const SNAP = 14; // px
|
|
37
|
+
const MIN_WIDTH = 160; // px: the least a card's edge is dragged to (a table's is its columns' floors)
|
|
38
|
+
// The sizes (name and range) are each component's description's (registry SIZES): the same ones the
|
|
39
|
+
// server checks a size by.
|
|
40
|
+
const range = (kind, name) => SIZES[kind][name];
|
|
41
|
+
// The size a kind's bottom edge sets (`height` among its sizes), and that size's least: a code block's
|
|
42
|
+
// frame is about a line and a half.
|
|
43
|
+
const heightOf = (kind) => Object.keys(SIZES[kind]).find((name) => SIZES[kind][name].height);
|
|
44
|
+
const heightRange = (kind) => range(kind, heightOf(kind));
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* units: Map(id -> { kind }) from the edit map. active(): whether resizing may start.
|
|
48
|
+
* look(element, { sizes }, select): the editor's undoable change of sizes. say(text): the status line.
|
|
49
|
+
* owns(node): whether a table's right and bottom edges are the table tools' (table/widths.mjs: a
|
|
50
|
+
* click arms one, a drag then is this tool's, `startTable`).
|
|
51
|
+
*/
|
|
52
|
+
export function createResize({ units, active, look, say, owns = () => false }) {
|
|
53
|
+
addStyle(STYLE);
|
|
54
|
+
let hover = null; // { node, axis } under the pointer
|
|
55
|
+
let drag = null;
|
|
56
|
+
|
|
57
|
+
// Blocks made or converted on the page carry their kind (a code block made from a paragraph).
|
|
58
|
+
const kindOf = (node) => node.getAttribute("data-ge-unit-kind") ?? units.get(Number(node.getAttribute("data-ge-unit")))?.kind;
|
|
59
|
+
const codeOf = (node) => node.querySelector(":scope > pre");
|
|
60
|
+
// A card's chart: the svg its host holds, straight in it or beside controls of its own (a part).
|
|
61
|
+
const plot = (node) => node.querySelector(".doc-chart > svg") ?? node.querySelector(".doc-chart svg");
|
|
62
|
+
const sizeOf = (node, name) => node.style.getPropertyValue(name).trim() || null;
|
|
63
|
+
// The page's gutter in full width (--doc-wide-gutter) while editing: the room the handle takes
|
|
64
|
+
// beside the blocks (--ge-edge-room, handle/; the tool works only while editing).
|
|
65
|
+
const gutter = () => parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--ge-edge-room")) || 0;
|
|
66
|
+
const SHORT = 12; // a table with this many rows or fewer shows them all: no height to set
|
|
67
|
+
|
|
68
|
+
// The blocks that may resize (`resizable`) of the open modal dialog if there is one, else of the page: kept
|
|
69
|
+
// between moves (kept.mjs), as looking them up and measuring each on every move cost up to 1.8ms a
|
|
70
|
+
// move on a long report.
|
|
71
|
+
const blocks = kept(() => {
|
|
72
|
+
const scope = document.querySelector("dialog[open]") ?? document.querySelector("main");
|
|
73
|
+
return [...(scope?.querySelectorAll(RESIZABLE_AT) ?? [])];
|
|
74
|
+
});
|
|
75
|
+
// One of them the reader can reach now: visible, of a kind that resizes, not folded or inert.
|
|
76
|
+
const reachable = (node) => RESIZABLE.has(kindOf(node)) && node.getClientRects().length > 0 && !node.closest("[inert]") && !node.matches(".doc-code--folded");
|
|
77
|
+
|
|
78
|
+
// Which edge of which block the pointer is on: the right one of a card or table, or the bottom
|
|
79
|
+
// one of a table, a card with a chart or a code block that is (or may be) shorter than its code.
|
|
80
|
+
// Only a block whose edges the pointer is within the grab of is looked at any further.
|
|
81
|
+
function edgeAt(x, y) {
|
|
82
|
+
for (const node of blocks()) {
|
|
83
|
+
const rect = node.getBoundingClientRect();
|
|
84
|
+
const near = x >= Math.min(rect.left, rect.right - GRAB.inside) && x <= rect.right + GRAB.outside && y >= Math.min(rect.top, rect.bottom - GRAB.inside) && y <= rect.bottom + GRAB.outside;
|
|
85
|
+
if (!near || !reachable(node)) continue;
|
|
86
|
+
const kind = kindOf(node);
|
|
87
|
+
if (kind !== "code" && !(kind === "table" && owns(node)) && y >= rect.top && y <= rect.bottom && x >= rect.right - GRAB.inside && x <= rect.right + GRAB.outside) return { node, axis: "x" };
|
|
88
|
+
if (!(x >= rect.left && x <= rect.right && y >= rect.bottom - GRAB.inside && y <= rect.bottom + GRAB.outside)) continue;
|
|
89
|
+
const code = kind === "code" ? codeOf(node) : null;
|
|
90
|
+
const tall = kind === "table" ? !owns(node) && node.querySelectorAll(":scope > table > tbody > tr").length > SHORT
|
|
91
|
+
: kind === "code" ? Boolean(code) && (code.scrollHeight > heightRange(kind).min * 2 || sizeOf(node, heightOf(kind)) !== null) : plot(node);
|
|
92
|
+
if (tall) return { node, axis: "y" };
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function setHover(next) {
|
|
98
|
+
hover = next;
|
|
99
|
+
const axis = next?.axis ?? null;
|
|
100
|
+
if (document.documentElement.getAttribute("data-ge-resize") === axis) return; // the same on every move along an edge
|
|
101
|
+
if (axis) document.documentElement.setAttribute("data-ge-resize", axis);
|
|
102
|
+
else document.documentElement.removeAttribute("data-ge-resize");
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function contentBox(container) {
|
|
106
|
+
const rect = container.getBoundingClientRect();
|
|
107
|
+
const style = getComputedStyle(container);
|
|
108
|
+
const left = rect.left + parseFloat(style.borderLeftWidth) + parseFloat(style.paddingLeft);
|
|
109
|
+
const right = rect.right - parseFloat(style.borderRightWidth) - parseFloat(style.paddingRight);
|
|
110
|
+
return { left, right, width: right - left };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// ---------- widths ----------
|
|
114
|
+
|
|
115
|
+
// The share of the width it stands in a right edge at x gives; a centered card's is twice its half.
|
|
116
|
+
function shareAt(x) {
|
|
117
|
+
const { rect, box, centered } = drag;
|
|
118
|
+
if (centered) return (2 * (x - (box.left + box.right) / 2)) / box.width;
|
|
119
|
+
return (x - rect.left) / box.width;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// A table's width goes by how far the pointer moved: the table's own right
|
|
123
|
+
// end moves that much, also when the table is wider than its frame and scrolls in it (its end
|
|
124
|
+
// then lies past the frame's edge, or at it when scrolled to the end). It snaps back where it
|
|
125
|
+
// started and to the reading width; past that it is wider than the text, as far as the window goes.
|
|
126
|
+
// A table narrower than the text never scrolls: it goes no narrower than its columns' readable
|
|
127
|
+
// floors (tables.js leaves them on the wrapper).
|
|
128
|
+
function tableWidthAt(x) {
|
|
129
|
+
const { box, table } = drag;
|
|
130
|
+
const far = Math.max(box.right, document.documentElement.clientWidth - gutter());
|
|
131
|
+
const width = (at) => table.width + (at - table.press);
|
|
132
|
+
const narrowest = table.press - (table.width - Math.max(MIN_WIDTH, table.floor));
|
|
133
|
+
let edge = Math.min(Math.max(x, narrowest), far);
|
|
134
|
+
const snaps = [{ x: table.press, label: t("原宽度"), keep: true }, { x: table.press + (box.width - table.width), label: t("铺满正文") }];
|
|
135
|
+
const snap = snaps.find((candidate) => Math.abs(candidate.x - edge) <= SNAP);
|
|
136
|
+
if (snap) edge = snap.x;
|
|
137
|
+
if (snap?.keep) return { edge, label: snap.label, value: drag.before };
|
|
138
|
+
// Rounded up, so the frame is never narrower than where it was let go (at the floors, say).
|
|
139
|
+
const share = Math.ceil(Math.max(range("table", SPAN).min, width(edge) / box.width) * 1000) / 1000;
|
|
140
|
+
const label = snap?.label ?? (share > 1 ? t("超宽表 · 表宽 {0}px,横向滚动", Math.round(width(edge)))
|
|
141
|
+
: edge <= narrowest + 0.5 ? t("最窄 · {0}%", Math.round(share * 100)) : `${Math.round(share * 100)}%`);
|
|
142
|
+
return { edge, label, value: Math.abs(share - 1) < 0.005 ? "1" : String(Math.min(share, range("table", SPAN).max)) };
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Where the edge may go and where it snaps: back where it started (no change), the middle (a
|
|
146
|
+
// card), the end of the line or the reading width.
|
|
147
|
+
function widthAt(x) {
|
|
148
|
+
const { node, kind, rect, box, centered } = drag;
|
|
149
|
+
if (kind === "table") return tableWidthAt(x);
|
|
150
|
+
const center = (box.left + box.right) / 2;
|
|
151
|
+
const far = box.right;
|
|
152
|
+
const near = centered ? center + MIN_WIDTH / 2 : rect.left + MIN_WIDTH;
|
|
153
|
+
const fromStart = Math.abs(rect.left - box.left) < 2;
|
|
154
|
+
const snaps = [{ x: rect.right, label: t("原宽度"), keep: true }];
|
|
155
|
+
const middle = centered ? center + box.width / 4 : box.left + box.width / 2;
|
|
156
|
+
if (kind === "figure" && middle > near) snaps.push({ x: middle, label: centered ? t("半宽 · 居中") : fromStart ? t("半宽") : t("到中线") });
|
|
157
|
+
snaps.push({ x: box.right, label: fromStart || centered ? t("全宽") : t("占满本行") });
|
|
158
|
+
let edge = Math.min(Math.max(x, near), far);
|
|
159
|
+
const snap = snaps.find((candidate) => Math.abs(candidate.x - edge) <= SNAP);
|
|
160
|
+
if (snap) edge = snap.x;
|
|
161
|
+
if (snap?.keep) return { edge, label: snap.label, value: drag.before };
|
|
162
|
+
const share = Math.round(Math.max(range(kind, SPAN).min, shareAt(edge)) * 1000) / 1000;
|
|
163
|
+
const whole = Math.abs(share - 1) < 0.005;
|
|
164
|
+
const label = snap?.label ?? `${Math.round(share * 100)}%${centered ? t(" · 居中") : ""}`;
|
|
165
|
+
// A card at the whole width is the default.
|
|
166
|
+
const value = whole ? (kind === "figure" && !centered ? null : "1") : String(Math.min(share, range(kind, SPAN).max));
|
|
167
|
+
return { edge, label, value };
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// ---------- heights ----------
|
|
171
|
+
|
|
172
|
+
// The plot's height as drawn: at least 280px wide, scaled down in a narrower card, so the
|
|
173
|
+
// height set is the viewBox's, not the one shown.
|
|
174
|
+
const drawnHeight = (svg) => svg.viewBox?.baseVal?.height || svg.getBoundingClientRect().height;
|
|
175
|
+
|
|
176
|
+
// A chart card: the plot's height, never below what the chart needs; back where it started
|
|
177
|
+
// changes nothing. A table: its scroll area,
|
|
178
|
+
// at most all its rows. A code block: its frame (a code card's header aside), at most its whole
|
|
179
|
+
// code, which it snaps to.
|
|
180
|
+
function heightAt(y) {
|
|
181
|
+
const { node, kind, rect, before } = drag;
|
|
182
|
+
if (kind === "code") {
|
|
183
|
+
const code = codeOf(node);
|
|
184
|
+
const header = rect.height - code.getBoundingClientRect().height;
|
|
185
|
+
const whole = rect.height + (code.scrollHeight - code.clientHeight); // all its lines, no scrolling
|
|
186
|
+
const height = Math.min(Math.max(y - rect.top, Math.min(whole, header + heightRange(kind).min)), whole);
|
|
187
|
+
if (before !== null && Math.abs(rect.top + height - rect.bottom) <= SNAP / 2) return { edge: rect.bottom, label: t("原高度"), value: before };
|
|
188
|
+
if (whole - height <= SNAP) return { edge: rect.top + whole, label: t("显示全部代码"), value: null };
|
|
189
|
+
const frame = Math.round(height - header);
|
|
190
|
+
return { edge: rect.top + header + frame, label: t("高 {0}px · 其余滚动查看", frame), value: `${frame}px` };
|
|
191
|
+
}
|
|
192
|
+
if (kind === "figure") {
|
|
193
|
+
const svg = plot(node);
|
|
194
|
+
const drawn = drawnHeight(svg);
|
|
195
|
+
const scale = svg.getBoundingClientRect().height / drawn || 1;
|
|
196
|
+
const floor = 160; // the least a chart is drawn at (a softer floor than the one a size is checked by)
|
|
197
|
+
if (Math.abs(rect.bottom - y) <= SNAP) return { edge: rect.bottom, label: t("原高度"), value: before };
|
|
198
|
+
// Level with a card beside it (in another column of its row): the bottoms meet.
|
|
199
|
+
const beside = drag.beside.find((bottom) => Math.abs(bottom - y) <= SNAP);
|
|
200
|
+
const height = Math.round(Math.min(Math.max(drawn + ((beside ?? y) - rect.bottom) / scale, floor), heightRange(kind).max));
|
|
201
|
+
const edge = rect.bottom + (height - drawn) * scale;
|
|
202
|
+
return { edge, label: beside !== undefined && Math.abs(edge - beside) < 1.5 ? t("与旁边对齐 · 图表高 {0}px", height) : t("图表高 {0}px", height), value: `${height}px` };
|
|
203
|
+
}
|
|
204
|
+
const all = node.scrollHeight + (node.offsetHeight - node.clientHeight);
|
|
205
|
+
let height = Math.min(Math.max(y - rect.top, heightRange(kind).min), all);
|
|
206
|
+
if (Math.abs(rect.top + height - rect.bottom) <= SNAP / 2) return { edge: rect.bottom, label: t("原高度"), value: drag.before };
|
|
207
|
+
if (height >= all - 2) {
|
|
208
|
+
const fits = all <= scrollHeight(node); // the default scroll area shows them all
|
|
209
|
+
return { edge: rect.top + all, label: t("显示全部行"), value: fits ? null : "none" };
|
|
210
|
+
}
|
|
211
|
+
height = Math.round(height);
|
|
212
|
+
return { edge: rect.top + height, label: t("高 {0}px", height), value: `${height}px` };
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// The bottoms of the cards standing beside a card: alone in another column of its row of columns.
|
|
216
|
+
function besideBottoms(node) {
|
|
217
|
+
const column = node.parentElement;
|
|
218
|
+
const row = column?.classList.contains("doc-column") ? column.parentElement : null;
|
|
219
|
+
if (!row?.classList.contains("doc-columns")) return [];
|
|
220
|
+
return [...row.children].filter((other) => other !== column && other.classList.contains("doc-column"))
|
|
221
|
+
.flatMap((other) => [...other.children].filter((card) => card.matches("figure.doc-figure") && card.getClientRects().length > 0))
|
|
222
|
+
.map((card) => card.getBoundingClientRect().bottom);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// ---------- dragging ----------
|
|
226
|
+
|
|
227
|
+
function start(event, { node, axis }) {
|
|
228
|
+
const kind = kindOf(node);
|
|
229
|
+
const name = axis === "x" ? SPAN : heightOf(kind);
|
|
230
|
+
const before = sizeOf(node, name);
|
|
231
|
+
const rect = node.getBoundingClientRect();
|
|
232
|
+
drag = {
|
|
233
|
+
node, axis, kind, name, before, rect,
|
|
234
|
+
box: contentBox(node.parentElement),
|
|
235
|
+
// A card's height snaps level with the cards beside it: the bottoms of those in the other columns of its row.
|
|
236
|
+
beside: axis === "y" && kind === "figure" ? besideBottoms(node) : [],
|
|
237
|
+
centered: axis === "x" && kind === "figure" && node.classList.contains(CENTERED),
|
|
238
|
+
// A table's whole width (past its frame when it scrolls sideways), where the press was, and
|
|
239
|
+
// whether it is scrolled to its end.
|
|
240
|
+
table: axis === "x" && kind === "table" ? {
|
|
241
|
+
width: Math.max(rect.width, node.scrollWidth + (node.offsetWidth - node.clientWidth)),
|
|
242
|
+
floor: Number(node.dataset.docMinWidth) || 0,
|
|
243
|
+
press: event.clientX,
|
|
244
|
+
atEnd: node.scrollLeft + node.clientWidth >= node.scrollWidth - 2,
|
|
245
|
+
} : null,
|
|
246
|
+
label: kind === "code" ? null : element("div", { class: "ge-resize-label" }),
|
|
247
|
+
result: null,
|
|
248
|
+
};
|
|
249
|
+
const session = drag;
|
|
250
|
+
session.lines = (session.centered ? [0, 1] : [0]).map(() => element("div", { class: "ge-resize-line" }));
|
|
251
|
+
for (const part of [session.label, ...session.lines].filter(Boolean)) mount(own(part, "resize", { owner: node, alive: () => drag === session }));
|
|
252
|
+
note("resize", `start ${axis}`);
|
|
253
|
+
document.documentElement.setPointerCapture?.(event.pointerId);
|
|
254
|
+
update(event.clientX, event.clientY);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function update(x, y) {
|
|
258
|
+
const { axis, rect, box, lines, label } = drag;
|
|
259
|
+
drag.result = axis === "x" ? widthAt(x) : heightAt(y);
|
|
260
|
+
const { edge } = drag.result;
|
|
261
|
+
if (axis === "x") {
|
|
262
|
+
const mirror = 2 * ((box.left + box.right) / 2) - edge;
|
|
263
|
+
lines.forEach((line, index) => Object.assign(line.style, {
|
|
264
|
+
width: "2px", height: `${Math.round(rect.height)}px`,
|
|
265
|
+
transform: `translate(${Math.round((index ? mirror : edge) - 1)}px, ${Math.round(rect.top)}px)`,
|
|
266
|
+
}));
|
|
267
|
+
if (label) label.style.transform = `translate(${Math.round(Math.min(edge + 10, innerWidth - label.offsetWidth - 8))}px, ${Math.round(Math.max(8, y - 30))}px)`;
|
|
268
|
+
} else {
|
|
269
|
+
Object.assign(lines[0].style, { width: `${Math.round(rect.width)}px`, height: "2px", transform: `translate(${Math.round(rect.left)}px, ${Math.round(edge - 1)}px)` });
|
|
270
|
+
if (label) label.style.transform = `translate(${Math.round(Math.min(x + 12, innerWidth - label.offsetWidth - 8))}px, ${Math.round(Math.min(edge + 8, innerHeight - 28))}px)`;
|
|
271
|
+
}
|
|
272
|
+
if (label) label.textContent = drag.result.label;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
function finish(commit) {
|
|
276
|
+
if (!drag) return;
|
|
277
|
+
const { node, axis, kind, name, before, lines, label, result, table } = drag;
|
|
278
|
+
note("resize", commit ? "released" : "cancelled");
|
|
279
|
+
drag = null;
|
|
280
|
+
lines.forEach((line) => line.remove());
|
|
281
|
+
label?.remove();
|
|
282
|
+
setHover(null);
|
|
283
|
+
if (commit && result && look(node, { sizes: { [name]: result.value } }, null)) {
|
|
284
|
+
say(t("已调整{0}{1}:{2} · Ctrl+Z 撤销", kind === "figure" ? t("卡片") : kind === "code" ? t("代码块") : t("表格"), axis === "x" ? t("宽度") : t("高度"), result.label));
|
|
285
|
+
// Scrolled to its end, a table stays so: its new end shows at the frame's edge, ready for the
|
|
286
|
+
// next drag (after tables.js has laid it out again, on the next frame).
|
|
287
|
+
if (table?.atEnd) requestAnimationFrame(() => requestAnimationFrame(() => { node.scrollLeft = node.scrollWidth; }));
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// ---------- events ----------
|
|
292
|
+
|
|
293
|
+
document.addEventListener("pointermove", (event) => {
|
|
294
|
+
if (drag) return update(event.clientX, event.clientY);
|
|
295
|
+
const busy = !active() || event.buttons || document.documentElement.hasAttribute("data-ge-drag") || event.target?.closest?.("[data-doc-dev]");
|
|
296
|
+
setHover(busy ? null : edgeAt(event.clientX, event.clientY));
|
|
297
|
+
}, { passive: true, capture: true });
|
|
298
|
+
document.addEventListener("pointerdown", (event) => {
|
|
299
|
+
if (drag || event.button !== 0 || !active() || event.target?.closest?.("[data-doc-dev]")) return;
|
|
300
|
+
const at = edgeAt(event.clientX, event.clientY);
|
|
301
|
+
if (!at) return;
|
|
302
|
+
event.preventDefault(); // no caret, no text selection
|
|
303
|
+
event.stopImmediatePropagation(); // nor the editor's reaction to a press on the page
|
|
304
|
+
start(event, at);
|
|
305
|
+
}, true);
|
|
306
|
+
document.addEventListener("pointerup", () => { if (drag) finish(true); }, true);
|
|
307
|
+
// After pointerup the drag is over already; any other way it ends, it is cancelled (gesture.mjs).
|
|
308
|
+
endsGesture({ active: () => Boolean(drag), cancel: () => finish(false) });
|
|
309
|
+
cancelOnEscape({ active: () => Boolean(drag), cancel: () => { finish(false); say(t("已取消调整。")); } });
|
|
310
|
+
|
|
311
|
+
return {
|
|
312
|
+
/** A table's width ("x", from its right edge) or scroll height ("y", from its bottom edge) dragged, the press `event` on it (the table tools' armed edge). */
|
|
313
|
+
startTable(event, node, axis = "x") {
|
|
314
|
+
if (drag || !active()) return false;
|
|
315
|
+
setHover({ node, axis });
|
|
316
|
+
start(event, { node, axis });
|
|
317
|
+
return true;
|
|
318
|
+
},
|
|
319
|
+
/** Stop any resizing. */
|
|
320
|
+
hide() {
|
|
321
|
+
if (drag) finish(false);
|
|
322
|
+
setHover(null);
|
|
323
|
+
},
|
|
324
|
+
/** The editor's UI nodes to keep in the top layer when a modal dialog opens. */
|
|
325
|
+
get nodes() { return drag ? [...drag.lines, drag.label].filter(Boolean) : []; },
|
|
326
|
+
};
|
|
327
|
+
}
|