@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,44 @@
|
|
|
1
|
+
// What a pasted block must be to go into the page (pure): the rules checkBlocks (blocks.mjs, the
|
|
2
|
+
// clipboard's own data, which is not trusted) and import/to-blocks.mjs (another program's content,
|
|
3
|
+
// made into blocks that pass) both go by, so that one rule is one function.
|
|
4
|
+
|
|
5
|
+
import { BLOCK_TYPES, clipboardOf } from "../../../components/registry.mjs";
|
|
6
|
+
|
|
7
|
+
/** The kind of unit a described block becomes (for accepts()); undefined for a type the page has none of. */
|
|
8
|
+
export const kindOfBlock = (block) => (block.type === "copy" ? block.kind : BLOCK_TYPES[block.type]?.kind);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Described blocks with each run of list items copied on their own (an item carrying its list's
|
|
12
|
+
* kind, `list`: notion-lite's item is a block of its type) made a list of that kind, the items no
|
|
13
|
+
* longer carrying it, and each run of a flowchart's nodes copied on their own a flowchart: where a
|
|
14
|
+
* box takes no items or nodes (asLists), and for other programs (export.mjs).
|
|
15
|
+
*/
|
|
16
|
+
export function groupItems(blocks) {
|
|
17
|
+
const out = [];
|
|
18
|
+
const runs = new Set();
|
|
19
|
+
for (const block of blocks) {
|
|
20
|
+
const { run } = clipboardOf(block.type);
|
|
21
|
+
if (!run) {
|
|
22
|
+
out.push(block);
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
const { list: kind = run, ...item } = block;
|
|
26
|
+
const last = out.at(-1);
|
|
27
|
+
if (runs.has(last) && last.type === kind) last.blocks.push(item);
|
|
28
|
+
else {
|
|
29
|
+
const run = { type: kind, blocks: [item] };
|
|
30
|
+
runs.add(run);
|
|
31
|
+
out.push(run);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const IMAGE_SOURCE = /^(https?:\/\/[^\s"<>]+|data:image\/(png|jpe?g|gif|webp|svg\+xml);base64,[a-z0-9+/=]+)$/i;
|
|
38
|
+
const WEB_PAGE = /^https?:\/\/[^\s"<>]+$/i;
|
|
39
|
+
|
|
40
|
+
/** Whether `src` is an address a pasted image may have: a web address, or a data: picture. */
|
|
41
|
+
export const imageSource = (src) => typeof src === "string" && src.length <= 15e6 && IMAGE_SOURCE.test(src);
|
|
42
|
+
|
|
43
|
+
/** Whether `src` is an address a pasted embed may have: a web page's. */
|
|
44
|
+
export const webPage = (src) => typeof src === "string" && src.length <= 2000 && WEB_PAGE.test(src);
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { escapeText } from "../../../../shared/escape.mjs";
|
|
2
|
+
import { UNIT, serializeInner, textEnd } from "../../core.mjs";
|
|
3
|
+
import { askClipboard, clipboardOf, sizeValue } from "../../../components/registry.mjs";
|
|
4
|
+
import { isMark } from "../../marks.mjs";
|
|
5
|
+
import { colorOf, copiedType, describe } from "./describe.mjs";
|
|
6
|
+
import { groupItems } from "./rules.mjs";
|
|
7
|
+
|
|
8
|
+
// Selected text as the clipboard's own description (docs/editor.md, "Copying text"), after
|
|
9
|
+
// notion-lite (editor/input/clipboard/index.js: a selection in one text area, and segmentSpecs for one
|
|
10
|
+
// across blocks):
|
|
11
|
+
// in one text block its inline HTML (selectedHtml: the format bar's marks, a chip as its source),
|
|
12
|
+
// and no block: neither a list's marker nor a heading's size goes with it;
|
|
13
|
+
// across blocks blocks, each of its type (describeAcross): the first from where the selection
|
|
14
|
+
// starts, those between whole, the last up to where it ends; a list's items each an
|
|
15
|
+
// item of its kind (`list`, as an item selected on its own) with its checked state
|
|
16
|
+
// and what of the blocks it holds the selection reaches, a quote's paragraphs in a
|
|
17
|
+
// quote, and a highlight block, a callout, a disclosure or a section the selection ends in
|
|
18
|
+
// with what of it comes before the end (its icon, its title), a tabs area with the
|
|
19
|
+
// tab shown and what of its panel comes before the end; a flowchart's nodes a
|
|
20
|
+
// flowchart with its direction (never loose paragraphs: its steps are no items),
|
|
21
|
+
// the node it ends in a node with what of it comes before the end. Around where it
|
|
22
|
+
// starts, a highlight block, a callout, a disclosure, a section, a flowchart's node, an item
|
|
23
|
+
// whose own text comes before it, a row of columns, a column or a tabs area are not
|
|
24
|
+
// copied, only what of them it holds (notion-lite copies no block its start is in:
|
|
25
|
+
// a callout, a toggle, a list item's parent; a row of columns it flattens wherever).
|
|
26
|
+
// What of a block this takes is the unit's to say (`clipboard.piece`, `across`, `endsIn`).
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* `range` (a selection in `host`) kept to the block's own text (a list item's ends before the blocks
|
|
30
|
+
* it holds) and widened over a chip (a formula, a link shown with its icon) an end stands inside;
|
|
31
|
+
* an end at a chip's very start (where Chrome's triple click stops) or a start at its very end
|
|
32
|
+
* leaves it out, as the selection drawn does.
|
|
33
|
+
*/
|
|
34
|
+
export function ownRange(host, range) {
|
|
35
|
+
const part = range.cloneRange();
|
|
36
|
+
const own = host.ownerDocument.createRange();
|
|
37
|
+
own.setStart(host, 0);
|
|
38
|
+
own.setEnd(host, textEnd(host));
|
|
39
|
+
if (part.compareBoundaryPoints(part.START_TO_START, own) < 0) part.setStart(host, 0);
|
|
40
|
+
if (part.compareBoundaryPoints(part.END_TO_END, own) > 0) part.setEnd(host, textEnd(host));
|
|
41
|
+
const chipOf = (node) => {
|
|
42
|
+
const chip = (node?.nodeType === 1 ? node : node?.parentElement)?.closest("[data-ge-atom]");
|
|
43
|
+
return chip && chip !== host && host.contains(chip) ? chip : null;
|
|
44
|
+
};
|
|
45
|
+
// Whether nothing of `chip` stands between its start (or its end) and the point.
|
|
46
|
+
const atEdge = (chip, node, offset, end) => {
|
|
47
|
+
const between = host.ownerDocument.createRange();
|
|
48
|
+
between.selectNodeContents(chip);
|
|
49
|
+
if (end) between.setStart(node, offset);
|
|
50
|
+
else between.setEnd(node, offset);
|
|
51
|
+
return between.toString() === "";
|
|
52
|
+
};
|
|
53
|
+
const first = chipOf(part.startContainer);
|
|
54
|
+
if (first && atEdge(first, part.startContainer, part.startOffset, true)) part.setStartAfter(first);
|
|
55
|
+
else if (first) part.setStartBefore(first);
|
|
56
|
+
const last = chipOf(part.endContainer);
|
|
57
|
+
if (last && atEdge(last, part.endContainer, part.endOffset, false)) part.setEndBefore(last);
|
|
58
|
+
else if (last) part.setEndAfter(last);
|
|
59
|
+
return part;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The inline HTML of `range` in `host` (ownRange), as serializeInner writes a block's: the format
|
|
64
|
+
* bar's marks (those around it too, as a word selected in bold), a chip as its source, a table
|
|
65
|
+
* cell's lists; code as its text, a line break between its lines.
|
|
66
|
+
*/
|
|
67
|
+
export function selectedHtml(host, range) {
|
|
68
|
+
const doc = host.ownerDocument;
|
|
69
|
+
const holder = doc.createElement("div");
|
|
70
|
+
const kind = host.getAttribute("data-ge-kind");
|
|
71
|
+
if (kind) holder.setAttribute("data-ge-kind", kind); // a cell's lists are its text, code is text alone
|
|
72
|
+
const part = ownRange(host, range);
|
|
73
|
+
let content = part.cloneContents();
|
|
74
|
+
for (let node = part.commonAncestorContainer; node && node !== host && host.contains(node); node = node.parentNode) {
|
|
75
|
+
if (!isMark(node)) continue; // a word selected in bold is bold (notion-lite's slice of the text keeps its marks)
|
|
76
|
+
const mark = node.cloneNode(false);
|
|
77
|
+
mark.append(content);
|
|
78
|
+
content = mark;
|
|
79
|
+
}
|
|
80
|
+
holder.append(content);
|
|
81
|
+
const html = serializeInner(holder);
|
|
82
|
+
return kind === "code" ? html.replace(/\n/g, "<br>") : html;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// A block's words, what the page shows of it (what it draws for readers' sake and the editor's left out).
|
|
86
|
+
function wordsOf(unit) {
|
|
87
|
+
const copy = unit.cloneNode(true);
|
|
88
|
+
copy.querySelectorAll('[aria-hidden="true"], [data-doc-dev], .ge-code-gutter').forEach((node) => node.remove());
|
|
89
|
+
return copy.textContent.replace(/\s+/g, " ").trim();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* A selection across blocks described (notion-lite segmentSpecs): `range` the selection, `texts` its
|
|
94
|
+
* text by text block ([{ host, range }]: body text, headings, list items),
|
|
95
|
+
* `wholes` the blocks it takes whole (text-select/ piecesOf). The list's items at the top carry their
|
|
96
|
+
* list's kind; inside a block, runs of them are lists (groupItems). Were none of it found among the
|
|
97
|
+
* page's blocks, its texts are paragraphs: a copy of a selection is never empty.
|
|
98
|
+
*/
|
|
99
|
+
export function describeAcross(range, { texts, wholes }) {
|
|
100
|
+
const pieces = new Map(texts.map((piece) => [piece.host, piece.range]));
|
|
101
|
+
const taken = new Set(wholes);
|
|
102
|
+
const holdsAny = (unit) => texts.some(({ host }) => unit.contains(host)) || wholes.some((node) => unit.contains(node));
|
|
103
|
+
const holdsAll = (unit) => {
|
|
104
|
+
const own = unit.ownerDocument.createRange();
|
|
105
|
+
own.selectNode(unit);
|
|
106
|
+
return range.compareBoundaryPoints(range.START_TO_START, own) <= 0 && range.compareBoundaryPoints(range.END_TO_END, own) >= 0;
|
|
107
|
+
};
|
|
108
|
+
// The blocks of a box it holds some of, in a group of blocks too (a tab not shown holds none), and
|
|
109
|
+
// through what stands in a box but is neither block nor box (a detail card, its panel).
|
|
110
|
+
const walk = (box) => [...box.children].flatMap((child) => (child.hidden ? []
|
|
111
|
+
: child.matches(UNIT) || pieces.has(child) || taken.has(child) ? blocksOf(child) : walk(child)));
|
|
112
|
+
// A block taken whole as a copy of blocks describes it; one the page cannot make (a report's own
|
|
113
|
+
// widget, a card not saved yet) as its words.
|
|
114
|
+
const whole = (unit) => {
|
|
115
|
+
const block = describe(unit);
|
|
116
|
+
if (block) return [block];
|
|
117
|
+
const words = wordsOf(unit);
|
|
118
|
+
return words ? [{ type: "paragraph", html: escapeText(words) }] : [];
|
|
119
|
+
};
|
|
120
|
+
// A text block's part, of its type as a copy of the block describes it (a quote's paragraph a
|
|
121
|
+
// paragraph, the quote around it); a title, no block of its own, a paragraph (notion-lite's page
|
|
122
|
+
// title and captions: a text block each).
|
|
123
|
+
const piece = (host) => {
|
|
124
|
+
const html = selectedHtml(host, pieces.get(host));
|
|
125
|
+
const part = askClipboard("piece", host, html, what);
|
|
126
|
+
if (part) return part;
|
|
127
|
+
const type = host.parentElement?.hasAttribute("data-ge-box") ? copiedType(host) : null;
|
|
128
|
+
const color = colorOf(host);
|
|
129
|
+
return { type: type ?? "paragraph", html, ...(color ? { color } : {}) };
|
|
130
|
+
};
|
|
131
|
+
// The boxes of a block it holds some of (a row's columns are blocks, its tabs area's panels boxes).
|
|
132
|
+
const boxesOf = (unit) => (unit.hasAttribute("data-ge-box") ? [unit]
|
|
133
|
+
: [...unit.querySelectorAll("[data-ge-box]")].filter((box) => !box.hidden && box.parentElement?.closest(UNIT) === unit));
|
|
134
|
+
// What a block's hooks are told.
|
|
135
|
+
const what = {
|
|
136
|
+
walk, holdsAll, holdsAny, boxesOf, groupItems, colorOf, sizeValue, serializeInner, describe,
|
|
137
|
+
startsIn: (unit) => unit.contains(range.startContainer), // the selection starts in it
|
|
138
|
+
blocksIn: (boxes) => groupItems(boxes.flatMap(walk)),
|
|
139
|
+
};
|
|
140
|
+
const container = (unit) => {
|
|
141
|
+
const through = askClipboard("across", unit, what);
|
|
142
|
+
if (through) return through;
|
|
143
|
+
if (holdsAll(unit)) {
|
|
144
|
+
const block = describe(unit);
|
|
145
|
+
if (block) return [block];
|
|
146
|
+
}
|
|
147
|
+
// Where it ends: the block with what of it comes before the end.
|
|
148
|
+
const ending = what.startsIn(unit) ? undefined : askClipboard("endsIn", unit, what);
|
|
149
|
+
return ending ?? walk(unit).filter((block) => !clipboardOf(block.type).lead);
|
|
150
|
+
};
|
|
151
|
+
function blocksOf(unit) {
|
|
152
|
+
if (taken.has(unit)) return whole(unit);
|
|
153
|
+
if (pieces.has(unit)) return [piece(unit)];
|
|
154
|
+
return holdsAny(unit) ? container(unit) : [];
|
|
155
|
+
}
|
|
156
|
+
const main = range.startContainer.ownerDocument.querySelector("main");
|
|
157
|
+
const blocks = main ? walk(main) : [];
|
|
158
|
+
return blocks.length > 0 ? blocks : texts.map(({ host, range: part }) => ({ type: "paragraph", html: selectedHtml(host, part) }));
|
|
159
|
+
}
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { escapeMarkup, escapeText } from "../../../../shared/escape.mjs";
|
|
2
|
+
import { iconMarkup } from "../../../../shared/emoji/icon-value.mjs";
|
|
3
|
+
import { BLOCK_LEVEL } from "../../../../shared/html-tree.mjs";
|
|
4
|
+
import { TEXT_TYPES, clipboardOf, unitClipboard } from "../../../components/registry.mjs";
|
|
5
|
+
|
|
6
|
+
// The writers by `clipboard.kind` (notion-lite's serialize.js, src/blocks/README.md): how each kind of
|
|
7
|
+
// block is written out, one table for the two that write. A block that says no kind is a paragraph.
|
|
8
|
+
//
|
|
9
|
+
// copied(block, how, clip) Markdown of a block described for the clipboard (export.mjs), as lines
|
|
10
|
+
// exported(unit, how, clip) Markdown of an element of a report, for a page export and 复制页面内容
|
|
11
|
+
// (src/transfer/markdown.mjs), as lines
|
|
12
|
+
// html(block, how, clip) the clipboard's text/html of a described block; `clip.html`, where it
|
|
13
|
+
// says one, names the writer of this instead of its kind
|
|
14
|
+
// list its blocks stand one line apart beside another list
|
|
15
|
+
// opens an element of it is an aside's first line
|
|
16
|
+
// silent(block) a described block of it says nothing, and takes no empty line
|
|
17
|
+
//
|
|
18
|
+
// The two Markdowns are not one: a description has its text as the clipboard keeps it, an element
|
|
19
|
+
// holds pictures, files of the report's folder and charts, and each has its own ways (a page export
|
|
20
|
+
// starts a list from its number and leaves empty paragraphs out, as Notion's export; the clipboard
|
|
21
|
+
// follows Notion's copy). What they share is a helper here; where the bytes differ a kind has its
|
|
22
|
+
// two sides. `clip` is what the block's definition says: a writer reads no element's markup, and what
|
|
23
|
+
// it needs of one it asks of `clip.read`; its kinds are this table's own words, notion-lite's where it
|
|
24
|
+
// has the same.
|
|
25
|
+
//
|
|
26
|
+
// `how` is what each caller gives its writers: { inline(html), block(block), lines(blocks),
|
|
27
|
+
// portable(html), html(block) } in export.mjs, and { inline(html), own(host), lines(units),
|
|
28
|
+
// held(units), heldIn(box), plain(node), words(node), media(src, kind, name), opening(units, title),
|
|
29
|
+
// packageOf(id), … } in src/transfer/markdown.mjs. No module here wants a document as it loads: a worker imports this
|
|
30
|
+
// before it has one.
|
|
31
|
+
|
|
32
|
+
const INDENT = " ";
|
|
33
|
+
const indented = (lines) => lines.map((line) => (line ? `${INDENT}${line}` : line));
|
|
34
|
+
|
|
35
|
+
// What in a whole block sets its words apart (wordsIn): a block, always; and what lays out a word or
|
|
36
|
+
// two, wherever nothing stands straight in the element around it. Next to words of that element's own
|
|
37
|
+
// it is one of them: a unit, a number in a color. What shows none of its text is left out.
|
|
38
|
+
const BLOCKS = [...BLOCK_LEVEL].join(", ");
|
|
39
|
+
const PIECES = "button, label, span";
|
|
40
|
+
const SHOWS_NONE = "script, style, template, noscript, svg, title, desc, canvas, select, textarea, object";
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The words of `block` (a whole block, a card's drawing), all that it shows, as runs that BLOCKS and
|
|
44
|
+
* PIECES end, in the file's order; `more` other elements of text (an SVG's text), but `without`.
|
|
45
|
+
*/
|
|
46
|
+
export function wordsIn(block, more = "", without = null) {
|
|
47
|
+
const blocks = [BLOCKS, more].filter(Boolean).join(", ");
|
|
48
|
+
const said = [];
|
|
49
|
+
const read = (node) => {
|
|
50
|
+
const ownWords = [...node.childNodes].some((child) => child.nodeType === 3 && child.data.trim());
|
|
51
|
+
const breaks = ownWords ? blocks : `${blocks}, ${PIECES}`;
|
|
52
|
+
let run = "";
|
|
53
|
+
const end = () => {
|
|
54
|
+
const words = run.replace(/\s+/g, " ").trim();
|
|
55
|
+
if (words) said.push(words);
|
|
56
|
+
run = "";
|
|
57
|
+
};
|
|
58
|
+
for (const child of node.childNodes) {
|
|
59
|
+
if (child.nodeType === 3) run += child.data;
|
|
60
|
+
else if (child.nodeType !== 1 || child === without) continue;
|
|
61
|
+
else if (child.matches(breaks) || child.querySelector(breaks)) {
|
|
62
|
+
end();
|
|
63
|
+
read(child);
|
|
64
|
+
} else if (!child.matches(SHOWS_NONE)) run += child.textContent;
|
|
65
|
+
}
|
|
66
|
+
end();
|
|
67
|
+
};
|
|
68
|
+
read(block);
|
|
69
|
+
return said;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Text as Markdown with a line that starts as a tag of HTML or a code fence held to being words, its
|
|
74
|
+
* first character escaped, which every reader takes for that character: read as it stands such a
|
|
75
|
+
* line opens a block that takes in what follows. Other words are left as they are, as in notion-lite.
|
|
76
|
+
*/
|
|
77
|
+
export const heldToWords = (text) => text.replace(/^([ \t]*)(<(?=[!/a-z])|(?=```))/gim, "$1\\$2");
|
|
78
|
+
|
|
79
|
+
// Blocks of lines, an empty line between them.
|
|
80
|
+
function apart(parts) {
|
|
81
|
+
const out = [];
|
|
82
|
+
for (const part of parts) out.push(...(out.length ? [""] : []), ...part);
|
|
83
|
+
return out;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// What opens with its block and is no block of its text: a described one's, an element's.
|
|
87
|
+
const leads = (block) => clipboardOf(block.type).lead;
|
|
88
|
+
const unitLeads = (unit) => unitClipboard(unit).lead;
|
|
89
|
+
// A described highlight block's or `headed` entry's first line and the blocks under it: its emoji (an
|
|
90
|
+
// icon of a set or a picture none) and its first text block's words, then the rest of its blocks.
|
|
91
|
+
function opening(blocks, how) {
|
|
92
|
+
const icon = blocks.find(leads)?.icon;
|
|
93
|
+
const [first, ...rest] = blocks.filter((block) => !leads(block));
|
|
94
|
+
const title = first && TEXT_TYPES.has(first.type);
|
|
95
|
+
const head = [/^\p{Extended_Pictographic}/u.test(icon ?? "") ? icon : "", title ? how.inline(first.html) : ""].filter(Boolean).join(" ");
|
|
96
|
+
return { head, after: title ? rest : [first, ...rest].filter(Boolean) };
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// The emoji an icon element shows.
|
|
100
|
+
const emojiOf = (icon, how) => (icon && /\p{Extended_Pictographic}/u.test(how.plain(icon)) ? how.plain(icon) : "");
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* An element's first line and the units under it: the emoji that leads `units` and the words of
|
|
104
|
+
* `title(first)`, the element it says of the first after the icon (null: no words), then the rest.
|
|
105
|
+
*/
|
|
106
|
+
export function unitOpening(units, title, how) {
|
|
107
|
+
const icon = units.find(unitLeads);
|
|
108
|
+
const rest = units.filter((child) => child !== icon);
|
|
109
|
+
const words = title(rest[0]);
|
|
110
|
+
return { head: [emojiOf(icon, how), words ? how.own(words) : ""].filter(Boolean).join(" "), rest: rest.filter((child) => child !== words) };
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// A described list's entry: an item, what it holds 4 spaces in; a `headed` one, its emoji and title
|
|
114
|
+
// on the item's line, the rest of its blocks under it.
|
|
115
|
+
function entry(item, marker, how) {
|
|
116
|
+
if (clipboardOf(item.type).headed) {
|
|
117
|
+
const { head, after } = opening(item.blocks, how);
|
|
118
|
+
return [...`${marker}${head}`.split("\n"), ...indented(how.lines(after))];
|
|
119
|
+
}
|
|
120
|
+
return [...`${marker}${how.inline(item.html)}`.split("\n"), ...(item.lists ?? []).flatMap((each) => how.block(each)).map((line) => `${INDENT}${line}`)];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// The words on the line of an entry (a list item, a disclosure) over the lines it holds (`held`): its
|
|
124
|
+
// own, or, where it has none over them, a non-breaking space, so that a viewer gives it a line of its
|
|
125
|
+
// own above them, its marker on it, as the page shows it (with nothing there a list item's first block
|
|
126
|
+
// would stand on its line, and after an empty line it would be none of the item's). The import reads
|
|
127
|
+
// that space as no words (import/markdown.mjs).
|
|
128
|
+
const lineOf = (words, held) => words || (held.length > 0 ? " " : "");
|
|
129
|
+
|
|
130
|
+
// A list by its tag and the marker of an entry (`number` its number, `gap` what follows a to-do's box).
|
|
131
|
+
const list = (tag, marker) => ({
|
|
132
|
+
list: true,
|
|
133
|
+
copied: (block, how) => block.blocks.flatMap((item, index) => entry(item, marker(index + 1, item.checked, " "), how)),
|
|
134
|
+
exported(unit, how, clip) {
|
|
135
|
+
const { start, items } = clip.read(unit, how);
|
|
136
|
+
return items.flatMap(({ checked, written }, index) => {
|
|
137
|
+
const { text, held } = written();
|
|
138
|
+
const [first, ...rest] = text.split("\n");
|
|
139
|
+
const under = how.held(held);
|
|
140
|
+
return [`${marker(start + index, checked, " ")}${text ? first : lineOf(text, under)}`, ...rest.map((line) => `${INDENT}${line}`), ...under];
|
|
141
|
+
});
|
|
142
|
+
},
|
|
143
|
+
html: (block, how) => `<${tag}>${block.blocks.map(how.html).join("")}</${tag}>`,
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
// Code fenced: its title in bold where it has one (a file's name: Notion's code has none). The fence is
|
|
147
|
+
// longer than any at the start of one of its lines, which would close it.
|
|
148
|
+
function fence({ title, language, lines }) {
|
|
149
|
+
const mark = "`".repeat(Math.max(2, ...lines.map((line) => /^\s*(`*)/.exec(line)[1].length)) + 1);
|
|
150
|
+
return [...(title ? [`**${title}**`, ""] : []), `${mark}${language}`, ...lines, mark];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const math = (tex) => ["$$", ...tex.split("\n"), "$$"];
|
|
154
|
+
|
|
155
|
+
// A table's grid (`clip.grid`) as a Markdown table, its cells on one line; `cell`, a cell's Markdown.
|
|
156
|
+
const piped = (data, columns, cell, clip) => clip.grid(data, columns, (html) => cell(html).trim().replace(/\s*\n\s*/g, " ").replace(/\|/g, "\\|")).flatMap((row, index) => {
|
|
157
|
+
const line = `| ${row.join(" | ")} |`;
|
|
158
|
+
return index === 0 ? [line, `| ${row.map(() => "---").join(" | ")} |`] : [line];
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
// A line and the caption (`node`, an element) below it as a paragraph (Notion's).
|
|
162
|
+
function captioned(line, node, how) {
|
|
163
|
+
const said = node ? how.inline(how.serializeInner(node)) : "";
|
|
164
|
+
return said ? [line, "", said] : [line];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// A card that is a link: its label and address, a file of the report's folder through `how.media`.
|
|
168
|
+
function linked(unit, how, clip) {
|
|
169
|
+
const link = clip.read(unit, how);
|
|
170
|
+
return link ? captioned(`[${link.label}](${link.file ? how.media(link.src, "file", link.name) : link.src})`, link.caption, how) : [];
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const paragraph = {
|
|
174
|
+
opens: true,
|
|
175
|
+
copied: (block, how) => how.inline(block.html ?? "").split("\n"),
|
|
176
|
+
exported(unit, how) {
|
|
177
|
+
const said = how.own(unit);
|
|
178
|
+
return said ? said.split("\n") : [];
|
|
179
|
+
},
|
|
180
|
+
html: (block, how) => `<p>${how.portable(block.html ?? "")}</p>`,
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const todo = list("ul", (_, checked, gap) => `- [${checked ? "x" : " "}]${gap}`);
|
|
184
|
+
|
|
185
|
+
export const WRITERS = {
|
|
186
|
+
paragraph,
|
|
187
|
+
heading: {
|
|
188
|
+
opens: true,
|
|
189
|
+
copied: (block, how, { level }) => `${"#".repeat(level)} ${how.inline(block.html ?? "")}`.split("\n"),
|
|
190
|
+
exported(unit, how, { level }) {
|
|
191
|
+
const said = how.own(unit);
|
|
192
|
+
return said ? `${"#".repeat(level)} ${said}`.split("\n") : [];
|
|
193
|
+
},
|
|
194
|
+
html: (block, how, { level }) => `<h${level}>${how.portable(block.html ?? "")}</h${level}>`,
|
|
195
|
+
},
|
|
196
|
+
bullet: list("ul", () => "- "),
|
|
197
|
+
number: list("ol", (at) => `${at}. `),
|
|
198
|
+
todo: { ...todo, html: (block, how) => `<ul>${block.blocks.map((item) => how.html({ ...item, html: `${item.checked ? "[x]" : "[ ]"} ${item.html}` })).join("")}</ul>` },
|
|
199
|
+
quote: {
|
|
200
|
+
copied: (block, how) => block.blocks.flatMap((inner, index) => [...(index > 0 ? [""] : []), ...how.inline(inner.html).split("\n")]).map((line) => `> ${line}`),
|
|
201
|
+
exported(unit, how) {
|
|
202
|
+
const parts = how.unitsOf(unit).map((child) => (how.isHost(child) ? how.own(child) : how.lines([child]).join("\n"))).filter(Boolean);
|
|
203
|
+
return parts.flatMap((part, index) => [...(index > 0 ? [""] : []), ...part.split("\n")]).map((line) => (line ? `> ${line}` : ">"));
|
|
204
|
+
},
|
|
205
|
+
html: (block, how) => `<blockquote>${block.blocks.map(how.html).join("")}</blockquote>`,
|
|
206
|
+
},
|
|
207
|
+
aside: {
|
|
208
|
+
copied(block, how) {
|
|
209
|
+
const { head, after } = opening(block.blocks, how);
|
|
210
|
+
return ["<aside>", ...head.split("\n"), "", ...(after.length ? [...how.lines(after), ""] : []), "</aside>"];
|
|
211
|
+
},
|
|
212
|
+
exported(unit, how) {
|
|
213
|
+
const { head, rest } = unitOpening(how.unitsOf(unit), (first) => (first && WRITERS[unitClipboard(first).kind].opens ? first : null), how);
|
|
214
|
+
const after = how.lines(rest);
|
|
215
|
+
return ["<aside>", ...(head ? head.split("\n") : []), "", ...(after.length ? [...after, ""] : []), "</aside>"];
|
|
216
|
+
},
|
|
217
|
+
html: (block, how) => `<div>${block.blocks.map(how.html).join("")}</div>`,
|
|
218
|
+
},
|
|
219
|
+
// A disclosure: "- " and its title, its blocks 4 spaces in (Notion writes a toggle as an item), but
|
|
220
|
+
// no list: an empty line stands between it and a list beside it.
|
|
221
|
+
toggle: {
|
|
222
|
+
copied: (block, how) => [`- ${how.inline(block.html)}`, ...indented(how.lines(block.blocks))],
|
|
223
|
+
exported(unit, how, clip) {
|
|
224
|
+
const { title, content, without } = clip.read(unit);
|
|
225
|
+
const words = title ? how.inline(how.serializeInner(title)) : "";
|
|
226
|
+
const under = content ? how.heldIn(content, without) : [];
|
|
227
|
+
return [`- ${lineOf(words, under)}`, ...under];
|
|
228
|
+
},
|
|
229
|
+
html: (block, how) => `<details open><summary>${how.portable(block.html)}</summary>${block.blocks.map(how.html).join("")}</details>`,
|
|
230
|
+
},
|
|
231
|
+
code: {
|
|
232
|
+
copied: (block) => fence({ language: block.language ?? "", lines: block.text.split("\n") }),
|
|
233
|
+
exported: (unit, how, clip) => fence(clip.read(unit, how)),
|
|
234
|
+
html: (block) => `<pre><code${block.language ? ` class="language-${escapeMarkup(block.language)}"` : ""}>${escapeText(block.text)}</code></pre>`,
|
|
235
|
+
},
|
|
236
|
+
// An empty one says nothing: no $$ $$ to read back as nothing.
|
|
237
|
+
equation: {
|
|
238
|
+
silent: (block) => !block.tex.trim(),
|
|
239
|
+
copied: (block) => math(block.tex),
|
|
240
|
+
exported(unit, how, clip) {
|
|
241
|
+
const { tex } = clip.read(unit, how);
|
|
242
|
+
return tex ? math(tex) : [];
|
|
243
|
+
},
|
|
244
|
+
html: (block) => (block.tex.trim() ? `<p>$$${escapeText(block.tex)}$$</p>` : ""),
|
|
245
|
+
},
|
|
246
|
+
hr: {
|
|
247
|
+
copied: () => ["---"],
|
|
248
|
+
exported: () => ["---"],
|
|
249
|
+
html: () => "<hr>",
|
|
250
|
+
},
|
|
251
|
+
table: {
|
|
252
|
+
copied: (block, how, clip) => piped(block, block.rows[0].length, how.inline, clip),
|
|
253
|
+
exported(unit, how, clip) {
|
|
254
|
+
const data = clip.read(unit, how);
|
|
255
|
+
return data.rows.length === 0 ? [] : piped(data, Math.max(...data.rows.map((row) => row.length)), how.inline, clip);
|
|
256
|
+
},
|
|
257
|
+
// A merged cell keeps its spans (colspan, rowspan): its row has fewer cells.
|
|
258
|
+
html(block, how) {
|
|
259
|
+
const spans = (r, i) => {
|
|
260
|
+
const [down, across] = block.spans?.[r]?.[i] ?? [1, 1];
|
|
261
|
+
return `${across > 1 ? ` colspan="${across}"` : ""}${down > 1 ? ` rowspan="${down}"` : ""}`;
|
|
262
|
+
};
|
|
263
|
+
const row = (cells, tag, r) => `<tr>${cells.map((cell, i) => `<${tag}${spans(r, i)}>${how.portable(cell)}</${tag}>`).join("")}</tr>`;
|
|
264
|
+
const [first, ...rest] = block.rows;
|
|
265
|
+
return `<table>${block.header ? `<thead>${row(first, "th", 0)}</thead>` : ""}<tbody>${(block.header ? rest : block.rows).map((cells, index) => row(cells, "td", index + (block.header ? 1 : 0))).join("")}</tbody></table>`;
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
// Only the blocks it holds.
|
|
269
|
+
flatten: {
|
|
270
|
+
copied: (block, how) => how.lines(block.blocks),
|
|
271
|
+
exported: (unit, how, clip) => how.lines(clip.blocks?.(unit, how) ?? how.unitsOf(unit)),
|
|
272
|
+
},
|
|
273
|
+
// Each tab's name, a line before its panel's blocks.
|
|
274
|
+
tabs: {
|
|
275
|
+
copied: (block, how) => block.tabs.flatMap((tab, index) => [...(index > 0 ? [""] : []), tab.title, ...(tab.blocks.length ? ["", ...how.lines(tab.blocks)] : [])]),
|
|
276
|
+
exported(unit, how, clip) {
|
|
277
|
+
return clip.read(unit, how).flatMap(({ name, units }, index) => {
|
|
278
|
+
const inner = how.lines(units);
|
|
279
|
+
return [...(index > 0 ? [""] : []), ...(name ? [name] : []), ...(inner.length ? [...(name ? [""] : []), ...inner] : [])];
|
|
280
|
+
});
|
|
281
|
+
},
|
|
282
|
+
html: (block, how) => block.tabs.map((tab) => `<h3>${escapeText(tab.title)}</h3>${tab.blocks.map(how.html).join("")}`).join(""),
|
|
283
|
+
},
|
|
284
|
+
// Cards are copied as themselves (a copy has its own Markdown and HTML), so these write a page export alone.
|
|
285
|
+
image: {
|
|
286
|
+
exported(unit, how, clip) {
|
|
287
|
+
const image = clip.read(unit, how);
|
|
288
|
+
return image ? captioned(`})`, image.caption, how) : [];
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
media: { exported: linked },
|
|
292
|
+
bookmark: { exported: linked },
|
|
293
|
+
// The parts `clip.read` gives of an element, an empty line between them; a description's blocks in turn.
|
|
294
|
+
// An instance of a package, by its parts: in its HTML a part of words is of the type it says it is
|
|
295
|
+
// written as there (`as`: its heading), in Markdown a paragraph.
|
|
296
|
+
parts: {
|
|
297
|
+
copied: (block, how) => how.lines(block.blocks),
|
|
298
|
+
exported: (unit, how, clip) => apart(clip.read(unit, how)),
|
|
299
|
+
html: (block, how) => block.blocks.map((inner) => how.html(typeof inner.as === "string" && TEXT_TYPES.has(inner.as) ? { ...inner, type: inner.as } : inner)).join(""),
|
|
300
|
+
},
|
|
301
|
+
// A report's own widget, and a part of a block a file left standing alone: its blocks of text on
|
|
302
|
+
// one line, then its pictures.
|
|
303
|
+
words: {
|
|
304
|
+
exported(unit, how, clip) {
|
|
305
|
+
const said = how.wordsIn(unit, "", clip?.without);
|
|
306
|
+
return apart([...(said.length ? [said.join(" · ")] : []), ...how.picturesIn(unit)].map((line) => [line]));
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
// What leads a block is written with that block's first line, or not at all.
|
|
310
|
+
icon: { ...paragraph, opens: false, silent: () => true, exported: () => [], html: (block) => iconMarkup(block.icon) },
|
|
311
|
+
// The text/html of blocks that are written in a list's run.
|
|
312
|
+
item: { html: (block, how) => `<li>${how.portable(block.html)}${(block.lists ?? []).map(how.html).join("")}</li>` },
|
|
313
|
+
node: { html: (block, how) => `<li>${block.blocks.filter((each) => !leads(each)).map(how.html).join("")}</li>` }, // a 流程图's node, its blocks in an ordered list's item
|
|
314
|
+
section: { html: (block, how) => `<section>${block.blocks.map(how.html).join("")}</section>` },
|
|
315
|
+
};
|