@heycys/gallery 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/THIRD-PARTY-NOTICES.md +3253 -0
- package/assets/writing-preferences.md +107 -0
- package/bin/gallery.mjs +10 -0
- package/browser/editor/components/bookmark/icons.mjs +6 -0
- package/browser/editor/components/bookmark/index.mjs +80 -0
- package/browser/editor/components/bookmark/page.mjs +147 -0
- package/browser/editor/components/builders.mjs +19 -0
- package/browser/editor/components/callout/index.mjs +39 -0
- package/browser/editor/components/callout/page.mjs +13 -0
- package/browser/editor/components/code/index.mjs +327 -0
- package/browser/editor/components/code/page.mjs +561 -0
- package/browser/editor/components/colors.mjs +50 -0
- package/browser/editor/components/columns/index.mjs +104 -0
- package/browser/editor/components/columns/page.mjs +297 -0
- package/browser/editor/components/details/index.mjs +72 -0
- package/browser/editor/components/details/page.mjs +86 -0
- package/browser/editor/components/dialog/index.mjs +83 -0
- package/browser/editor/components/dialog/page.mjs +219 -0
- package/browser/editor/components/divider/index.mjs +48 -0
- package/browser/editor/components/embed/icons.mjs +11 -0
- package/browser/editor/components/embed/index.mjs +123 -0
- package/browser/editor/components/embed/page.mjs +309 -0
- package/browser/editor/components/figure/index.mjs +87 -0
- package/browser/editor/components/figure/page.mjs +33 -0
- package/browser/editor/components/file/icons.mjs +14 -0
- package/browser/editor/components/file/index.mjs +77 -0
- package/browser/editor/components/file/page.mjs +114 -0
- package/browser/editor/components/flowchart/add.mjs +123 -0
- package/browser/editor/components/flowchart/index.mjs +246 -0
- package/browser/editor/components/flowchart/page.mjs +453 -0
- package/browser/editor/components/heading/index.mjs +51 -0
- package/browser/editor/components/highlight/index.mjs +79 -0
- package/browser/editor/components/icon/index.mjs +57 -0
- package/browser/editor/components/icon/page.mjs +286 -0
- package/browser/editor/components/icons.mjs +45 -0
- package/browser/editor/components/image/crop.mjs +189 -0
- package/browser/editor/components/image/index.mjs +104 -0
- package/browser/editor/components/image/page.mjs +385 -0
- package/browser/editor/components/image/viewer.mjs +213 -0
- package/browser/editor/components/installed/index.mjs +133 -0
- package/browser/editor/components/installed/page.mjs +422 -0
- package/browser/editor/components/installed/served.mjs +35 -0
- package/browser/editor/components/kit.mjs +64 -0
- package/browser/editor/components/list/index.mjs +194 -0
- package/browser/editor/components/list/join.mjs +68 -0
- package/browser/editor/components/list/numbers.mjs +107 -0
- package/browser/editor/components/list/page.mjs +632 -0
- package/browser/editor/components/math/index.mjs +88 -0
- package/browser/editor/components/math/page.mjs +236 -0
- package/browser/editor/components/math/tex-logo.mjs +6 -0
- package/browser/editor/components/media/icons.mjs +19 -0
- package/browser/editor/components/media/page.mjs +162 -0
- package/browser/editor/components/media/parts.mjs +60 -0
- package/browser/editor/components/media/size.mjs +20 -0
- package/browser/editor/components/media/toolbar.mjs +37 -0
- package/browser/editor/components/media/write.mjs +7 -0
- package/browser/editor/components/pages.mjs +46 -0
- package/browser/editor/components/paragraph/index.mjs +43 -0
- package/browser/editor/components/paragraph/page.mjs +52 -0
- package/browser/editor/components/placeholder-bar.mjs +17 -0
- package/browser/editor/components/placeholder.mjs +128 -0
- package/browser/editor/components/quote/index.mjs +33 -0
- package/browser/editor/components/registry.mjs +833 -0
- package/browser/editor/components/rows.mjs +16 -0
- package/browser/editor/components/section/index.mjs +41 -0
- package/browser/editor/components/section/page.mjs +141 -0
- package/browser/editor/components/sheets/index.mjs +137 -0
- package/browser/editor/components/sheets/page.mjs +227 -0
- package/browser/editor/components/sheets/pills.mjs +226 -0
- package/browser/editor/components/table/grid.mjs +73 -0
- package/browser/editor/components/table/index.mjs +306 -0
- package/browser/editor/components/table/page.mjs +672 -0
- package/browser/editor/components/table/slots.mjs +41 -0
- package/browser/editor/components/widget/index.mjs +50 -0
- package/browser/editor/page/annotate/anchors.mjs +229 -0
- package/browser/editor/page/annotate/card.mjs +102 -0
- package/browser/editor/page/annotate/index.mjs +1629 -0
- package/browser/editor/page/at-menu/index.mjs +317 -0
- package/browser/editor/page/autosave.mjs +977 -0
- package/browser/editor/page/beside.mjs +21 -0
- package/browser/editor/page/block-info.mjs +63 -0
- package/browser/editor/page/block-menu/colors.mjs +82 -0
- package/browser/editor/page/block-menu/index.mjs +215 -0
- package/browser/editor/page/blocks.mjs +246 -0
- package/browser/editor/page/caret.mjs +679 -0
- package/browser/editor/page/chip-fills.mjs +126 -0
- package/browser/editor/page/clipboard/import/colors.mjs +192 -0
- package/browser/editor/page/clipboard/import/html.mjs +792 -0
- package/browser/editor/page/clipboard/import/inline.mjs +232 -0
- package/browser/editor/page/clipboard/import/languages.mjs +42 -0
- package/browser/editor/page/clipboard/import/markdown.mjs +760 -0
- package/browser/editor/page/clipboard/import/math.mjs +100 -0
- package/browser/editor/page/clipboard/import/office.mjs +245 -0
- package/browser/editor/page/clipboard/import/read.mjs +120 -0
- package/browser/editor/page/clipboard/import/rich.mjs +29 -0
- package/browser/editor/page/clipboard/import/to-blocks.mjs +290 -0
- package/browser/editor/page/clipboard/index.mjs +797 -0
- package/browser/editor/page/clipboard/own/blocks.mjs +202 -0
- package/browser/editor/page/clipboard/own/chart-keys.mjs +58 -0
- package/browser/editor/page/clipboard/own/describe.mjs +115 -0
- package/browser/editor/page/clipboard/own/export.mjs +167 -0
- package/browser/editor/page/clipboard/own/ids.mjs +39 -0
- package/browser/editor/page/clipboard/own/index.mjs +13 -0
- package/browser/editor/page/clipboard/own/rules.mjs +44 -0
- package/browser/editor/page/clipboard/own/selection.mjs +159 -0
- package/browser/editor/page/clipboard/own/writers.mjs +326 -0
- package/browser/editor/page/columns/index.mjs +360 -0
- package/browser/editor/page/commit.mjs +1798 -0
- package/browser/editor/page/conflicts.mjs +269 -0
- package/browser/editor/page/convert.mjs +830 -0
- package/browser/editor/page/core.mjs +1655 -0
- package/browser/editor/page/drag/drop.mjs +307 -0
- package/browser/editor/page/drag/index.mjs +335 -0
- package/browser/editor/page/drag/preview.mjs +121 -0
- package/browser/editor/page/edge-scroll.mjs +50 -0
- package/browser/editor/page/editor.mjs +1725 -0
- package/browser/editor/page/emoji-picker/emoji-tab.mjs +278 -0
- package/browser/editor/page/emoji-picker/glyph-html.mjs +26 -0
- package/browser/editor/page/emoji-picker/grid.mjs +79 -0
- package/browser/editor/page/emoji-picker/icon-tab.mjs +217 -0
- package/browser/editor/page/emoji-picker/icons.mjs +32 -0
- package/browser/editor/page/emoji-picker/index.mjs +164 -0
- package/browser/editor/page/emoji-picker/styles.mjs +2 -0
- package/browser/editor/page/emoji-picker/support.mjs +202 -0
- package/browser/editor/page/emoji-picker/upload.mjs +235 -0
- package/browser/editor/page/export-report.mjs +23 -0
- package/browser/editor/page/fills.mjs +60 -0
- package/browser/editor/page/find/index.mjs +107 -0
- package/browser/editor/page/flags.mjs +70 -0
- package/browser/editor/page/format-bar/bar.mjs +448 -0
- package/browser/editor/page/format-bar/brush.mjs +77 -0
- package/browser/editor/page/format-bar/colors.mjs +46 -0
- package/browser/editor/page/format-bar/index.mjs +404 -0
- package/browser/editor/page/formula/index.mjs +236 -0
- package/browser/editor/page/formula/panel.mjs +336 -0
- package/browser/editor/page/formula/symbols.mjs +156 -0
- package/browser/editor/page/frame.mjs +74 -0
- package/browser/editor/page/frames.mjs +196 -0
- package/browser/editor/page/geometry.mjs +400 -0
- package/browser/editor/page/gesture.mjs +45 -0
- package/browser/editor/page/handle/index.mjs +639 -0
- package/browser/editor/page/handle-sizes.mjs +14 -0
- package/browser/editor/page/hints/index.mjs +84 -0
- package/browser/editor/page/history.mjs +401 -0
- package/browser/editor/page/insert/index.mjs +243 -0
- package/browser/editor/page/kept.mjs +38 -0
- package/browser/editor/page/links/address.mjs +40 -0
- package/browser/editor/page/links/index.mjs +866 -0
- package/browser/editor/page/links/pages.mjs +131 -0
- package/browser/editor/page/links/views.mjs +369 -0
- package/browser/editor/page/look.mjs +65 -0
- package/browser/editor/page/made.mjs +24 -0
- package/browser/editor/page/margin.mjs +352 -0
- package/browser/editor/page/markdown/index.mjs +88 -0
- package/browser/editor/page/markdown/rules.mjs +33 -0
- package/browser/editor/page/marks.mjs +377 -0
- package/browser/editor/page/media-menu/index.mjs +158 -0
- package/browser/editor/page/menu.mjs +500 -0
- package/browser/editor/page/merge.mjs +100 -0
- package/browser/editor/page/notices.mjs +142 -0
- package/browser/editor/page/offered.mjs +32 -0
- package/browser/editor/page/outline/folds.mjs +52 -0
- package/browser/editor/page/outline/index.mjs +697 -0
- package/browser/editor/page/outline/list.mjs +172 -0
- package/browser/editor/page/outline/read.mjs +201 -0
- package/browser/editor/page/outline/strip.mjs +281 -0
- package/browser/editor/page/outline/tree.mjs +248 -0
- package/browser/editor/page/overlay-layer.mjs +227 -0
- package/browser/editor/page/overlays.mjs +205 -0
- package/browser/editor/page/own.mjs +28 -0
- package/browser/editor/page/pads.mjs +71 -0
- package/browser/editor/page/page-objects.mjs +105 -0
- package/browser/editor/page/panel.mjs +64 -0
- package/browser/editor/page/placement.mjs +58 -0
- package/browser/editor/page/post.mjs +41 -0
- package/browser/editor/page/present-links.mjs +50 -0
- package/browser/editor/page/quiet.mjs +48 -0
- package/browser/editor/page/resize/index.mjs +327 -0
- package/browser/editor/page/select-all/index.mjs +262 -0
- package/browser/editor/page/selection/delete.mjs +59 -0
- package/browser/editor/page/selection/index.mjs +157 -0
- package/browser/editor/page/selection/marquee.mjs +174 -0
- package/browser/editor/page/session.mjs +117 -0
- package/browser/editor/page/slash-menu/index.mjs +291 -0
- package/browser/editor/page/storage.mjs +48 -0
- package/browser/editor/page/sync-state.mjs +267 -0
- package/browser/editor/page/table/aligns.mjs +29 -0
- package/browser/editor/page/table/cell-bar.mjs +138 -0
- package/browser/editor/page/table/cells.mjs +527 -0
- package/browser/editor/page/table/icons.mjs +40 -0
- package/browser/editor/page/table/index.mjs +985 -0
- package/browser/editor/page/table/lists.mjs +187 -0
- package/browser/editor/page/table/widths.mjs +308 -0
- package/browser/editor/page/tex.mjs +32 -0
- package/browser/editor/page/text-select/index.mjs +656 -0
- package/browser/editor/page/tooltip.mjs +98 -0
- package/browser/editor/page/type-grid.mjs +82 -0
- package/browser/editor/page/typing/code-edges.mjs +228 -0
- package/browser/editor/page/typing/index.mjs +276 -0
- package/browser/editor/page/typing/leave.mjs +68 -0
- package/browser/editor/page/ui.mjs +160 -0
- package/browser/shared/annotations.mjs +571 -0
- package/browser/shared/code-folds.mjs +10 -0
- package/browser/shared/code-languages.mjs +70 -0
- package/browser/shared/code-lines.mjs +30 -0
- package/browser/shared/colors.mjs +28 -0
- package/browser/shared/component-catalog.mjs +559 -0
- package/browser/shared/components/bookmark.mjs +26 -0
- package/browser/shared/components/callout.mjs +7 -0
- package/browser/shared/components/chart.mjs +20 -0
- package/browser/shared/components/code.mjs +37 -0
- package/browser/shared/components/columns.mjs +16 -0
- package/browser/shared/components/details.mjs +15 -0
- package/browser/shared/components/dialog.mjs +28 -0
- package/browser/shared/components/diff.mjs +18 -0
- package/browser/shared/components/divider.mjs +6 -0
- package/browser/shared/components/embed.mjs +25 -0
- package/browser/shared/components/figure.mjs +14 -0
- package/browser/shared/components/file.mjs +23 -0
- package/browser/shared/components/heading.mjs +6 -0
- package/browser/shared/components/highlight.mjs +9 -0
- package/browser/shared/components/icon.mjs +18 -0
- package/browser/shared/components/image.mjs +39 -0
- package/browser/shared/components/index.mjs +342 -0
- package/browser/shared/components/installed.mjs +162 -0
- package/browser/shared/components/list.mjs +146 -0
- package/browser/shared/components/math.mjs +49 -0
- package/browser/shared/components/mention.mjs +33 -0
- package/browser/shared/components/page.mjs +37 -0
- package/browser/shared/components/paragraph.mjs +9 -0
- package/browser/shared/components/quote.mjs +6 -0
- package/browser/shared/components/section.mjs +8 -0
- package/browser/shared/components/sheets.mjs +80 -0
- package/browser/shared/components/state.mjs +20 -0
- package/browser/shared/components/table.mjs +49 -0
- package/browser/shared/components/text.mjs +14 -0
- package/browser/shared/components/widget.mjs +10 -0
- package/browser/shared/copy-ids.mjs +72 -0
- package/browser/shared/css-references.mjs +110 -0
- package/browser/shared/emoji/custom.mjs +91 -0
- package/browser/shared/emoji/data/LICENSE-mingcute.txt +202 -0
- package/browser/shared/emoji/data/LICENSE-tabler.txt +21 -0
- package/browser/shared/emoji/data/README.md +26 -0
- package/browser/shared/emoji/data/categories.json +1 -0
- package/browser/shared/emoji/data/icons.json +1 -0
- package/browser/shared/emoji/data/keywords-en.json +1 -0
- package/browser/shared/emoji/data/keywords-zh.json +1 -0
- package/browser/shared/emoji/data/names.json +1 -0
- package/browser/shared/emoji/data/positions.json +1 -0
- package/browser/shared/emoji/data/twemoji-index.json +1 -0
- package/browser/shared/emoji/data/twemoji-svg.bin +0 -0
- package/browser/shared/emoji/data.mjs +196 -0
- package/browser/shared/emoji/emoji.mjs +37 -0
- package/browser/shared/emoji/glyphs.mjs +134 -0
- package/browser/shared/emoji/icon-value.mjs +90 -0
- package/browser/shared/escape.mjs +20 -0
- package/browser/shared/export-wrap.mjs +89 -0
- package/browser/shared/files.mjs +33 -0
- package/browser/shared/html-tree.mjs +53 -0
- package/browser/shared/http.mjs +22 -0
- package/browser/shared/i18n/en.mjs +1164 -0
- package/browser/shared/i18n/index.mjs +132 -0
- package/browser/shared/ids.mjs +24 -0
- package/browser/shared/import-types.mjs +23 -0
- package/browser/shared/inline-spacing.mjs +97 -0
- package/browser/shared/layers.mjs +42 -0
- package/browser/shared/media.mjs +162 -0
- package/browser/shared/new-names.mjs +64 -0
- package/browser/shared/number-reading.mjs +92 -0
- package/browser/shared/old-names.mjs +143 -0
- package/browser/shared/page-address.mjs +140 -0
- package/browser/shared/page-links.mjs +86 -0
- package/browser/shared/paths.mjs +73 -0
- package/browser/shared/preferences.mjs +110 -0
- package/browser/shared/preview-server.mjs +247 -0
- package/browser/shared/qa-levels.mjs +93 -0
- package/browser/shared/reading-place.mjs +91 -0
- package/browser/shared/renamed-storage.mjs +220 -0
- package/browser/shared/reports.mjs +46 -0
- package/browser/shared/search.mjs +85 -0
- package/browser/shared/session.mjs +76 -0
- package/browser/shared/table-chart.mjs +113 -0
- package/browser/shared/table-hides.mjs +120 -0
- package/browser/shared/table-slots.mjs +75 -0
- package/browser/shared/words.mjs +23 -0
- package/browser/shared/workspace.mjs +535 -0
- package/browser/shared/writing-preferences.mjs +68 -0
- package/browser/shared/zoom.mjs +57 -0
- package/dist/chunk-2B5E4CDJ.mjs +2 -0
- package/dist/chunk-2PBALTR3.mjs +57 -0
- package/dist/chunk-342HXE3Q.mjs +2 -0
- package/dist/chunk-3LA3EMDE.mjs +15 -0
- package/dist/chunk-43B75J5T.mjs +2 -0
- package/dist/chunk-4K5KC6V2.mjs +2 -0
- package/dist/chunk-5FRMCDPY.mjs +16 -0
- package/dist/chunk-5L7RYZCL.mjs +2 -0
- package/dist/chunk-5LEK2CBS.mjs +2 -0
- package/dist/chunk-5OFN5AHC.mjs +2 -0
- package/dist/chunk-5SIYS5HN.mjs +2 -0
- package/dist/chunk-5TEK3RAD.mjs +2 -0
- package/dist/chunk-6CYG3Z4V.mjs +2 -0
- package/dist/chunk-6U2SLSDN.mjs +3 -0
- package/dist/chunk-742D2WWJ.mjs +19 -0
- package/dist/chunk-7GHT2UCA.mjs +15 -0
- package/dist/chunk-7QQBR7PB.mjs +2 -0
- package/dist/chunk-A55HN5OK.mjs +2 -0
- package/dist/chunk-ACOPDCNB.mjs +2 -0
- package/dist/chunk-AGDILNWB.mjs +2 -0
- package/dist/chunk-ATCJYAR4.mjs +2 -0
- package/dist/chunk-B3VTYBYR.mjs +960 -0
- package/dist/chunk-C564NU2H.mjs +77 -0
- package/dist/chunk-C7HWOBIF.mjs +2 -0
- package/dist/chunk-DB4WKGYF.mjs +7 -0
- package/dist/chunk-E7VYDG2X.mjs +2 -0
- package/dist/chunk-EUX7IC5J.mjs +48 -0
- package/dist/chunk-EVJ3BX3M.mjs +2 -0
- package/dist/chunk-EZY3WC6Z.mjs +15 -0
- package/dist/chunk-FQGQH4KM.mjs +2 -0
- package/dist/chunk-G7TOXONE.mjs +6 -0
- package/dist/chunk-GPF4YWWB.mjs +9 -0
- package/dist/chunk-GRAXKKG4.mjs +2 -0
- package/dist/chunk-GYQV7Y4J.mjs +120 -0
- package/dist/chunk-HMHK3EQ6.mjs +2 -0
- package/dist/chunk-HQQMJCQJ.mjs +10 -0
- package/dist/chunk-HYMEEXKN.mjs +4 -0
- package/dist/chunk-IERUOGC3.mjs +6 -0
- package/dist/chunk-ITNLYXXV.mjs +3 -0
- package/dist/chunk-L4DVONOG.mjs +2 -0
- package/dist/chunk-LAE5NQ4B.mjs +2 -0
- package/dist/chunk-LC7YNQFG.mjs +2 -0
- package/dist/chunk-LHTFLRB6.mjs +4 -0
- package/dist/chunk-LKX55H76.mjs +2 -0
- package/dist/chunk-MAFIGVXY.mjs +2 -0
- package/dist/chunk-NFIBI4IP.mjs +26 -0
- package/dist/chunk-NSKUTQ5J.mjs +5 -0
- package/dist/chunk-O52JMOCZ.mjs +2 -0
- package/dist/chunk-P2CAZPDP.mjs +3 -0
- package/dist/chunk-QAIHRH3I.mjs +13 -0
- package/dist/chunk-QMQUXTU4.mjs +12 -0
- package/dist/chunk-QR6A54KJ.mjs +3 -0
- package/dist/chunk-QVWVFC5K.mjs +6 -0
- package/dist/chunk-QYKCJ7FG.mjs +8 -0
- package/dist/chunk-QZY6Q64C.mjs +2 -0
- package/dist/chunk-TDQP3DKQ.mjs +10 -0
- package/dist/chunk-TMYZB6AV.mjs +2 -0
- package/dist/chunk-TX6JH7TR.mjs +2 -0
- package/dist/chunk-U3SSPL4K.mjs +8 -0
- package/dist/chunk-UH4SIXTR.mjs +2 -0
- package/dist/chunk-UNUEWH4S.mjs +2 -0
- package/dist/chunk-UXUK4PMC.mjs +27 -0
- package/dist/chunk-V4CPWKMZ.mjs +2 -0
- package/dist/chunk-V6XZ4VIR.mjs +2 -0
- package/dist/chunk-VACRB2NE.mjs +3 -0
- package/dist/chunk-W63L7367.mjs +7 -0
- package/dist/chunk-W7CXPCRV.mjs +6 -0
- package/dist/chunk-W7XHE4CT.mjs +2 -0
- package/dist/chunk-XINNG4F2.mjs +4 -0
- package/dist/chunk-Y34NR5JL.mjs +2 -0
- package/dist/chunk-YEY3RSFQ.mjs +2 -0
- package/dist/chunk-YL2DPWVS.mjs +4 -0
- package/dist/chunk-YXAUQPVK.mjs +8 -0
- package/dist/chunk-YZ5Z6H4W.mjs +4 -0
- package/dist/chunk-Z52HTUW7.mjs +4 -0
- package/dist/chunk-ZBIM6ARY.mjs +216 -0
- package/dist/cli.mjs +2 -0
- package/dist/server.mjs +2 -0
- package/dist/worker.mjs +5 -0
- package/kit/charts.js +355 -0
- package/kit/code.js +164 -0
- package/kit/dialogs.js +157 -0
- package/kit/math.js +1988 -0
- package/kit/report.css +2821 -0
- package/kit/runtime.js +1707 -0
- package/kit/sheets.js +123 -0
- package/kit/state.js +217 -0
- package/kit/tables.js +1449 -0
- package/kit/tokens.js +29 -0
- package/kit/ui.js +561 -0
- package/package.json +41 -4
- package/release.json +25 -0
- package/sdk/column-widths.d.ts +56 -0
- package/sdk/doc-charts.d.ts +82 -0
- package/sdk/doc-code.d.ts +28 -0
- package/sdk/doc-dialogs.d.ts +4 -0
- package/sdk/doc-kit.d.ts +141 -0
- package/sdk/doc-math.d.ts +3 -0
- package/sdk/doc-sheets.d.ts +15 -0
- package/sdk/doc-state.d.ts +41 -0
- package/sdk/doc-tables.d.ts +24 -0
- package/sdk/doc-tokens.d.ts +22 -0
- package/sdk/index.d.ts +30 -0
- package/skill/SKILL.md +138 -0
- package/skill/agents/openai.yaml +5 -0
- package/skill/references/building-components.md +327 -0
- package/skill/references/example-report.html +356 -0
- package/skill/references/writing-html.md +187 -0
- package/skill/sdk/column-widths.d.ts +56 -0
- package/skill/sdk/doc-charts.d.ts +82 -0
- package/skill/sdk/doc-code.d.ts +28 -0
- package/skill/sdk/doc-dialogs.d.ts +4 -0
- package/skill/sdk/doc-kit.d.ts +141 -0
- package/skill/sdk/doc-math.d.ts +3 -0
- package/skill/sdk/doc-sheets.d.ts +15 -0
- package/skill/sdk/doc-state.d.ts +41 -0
- package/skill/sdk/doc-tables.d.ts +24 -0
- package/skill/sdk/doc-tokens.d.ts +22 -0
- package/skill/sdk/index.d.ts +30 -0
- package/starter/doc.html +21 -0
- package/starter/doc.json +5 -0
- package/vendor/d3.v7.9.0.min.js +2 -0
- package/vendor/katex/auto-render.min.js +1 -0
- package/vendor/katex/contrib/mhchem.min.js +1 -0
- package/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/vendor/katex/katex.min.css +1 -0
- package/vendor/katex/katex.min.js +1 -0
- package/vendor/pdfjs/LICENSE +177 -0
- package/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
- package/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
- package/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
- package/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
- package/vendor/pdfjs/cmaps/LICENSE +36 -0
- package/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
- package/vendor/pdfjs/legacy/build/pdf.min.mjs +27 -0
- package/vendor/pdfjs/legacy/build/pdf.worker.min.mjs +27 -0
- package/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
- package/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/vendor/types/@types/d3/LICENSE +21 -0
- package/vendor/types/@types/d3/index.d.ts +39 -0
- package/vendor/types/@types/d3/package.json +81 -0
- package/vendor/types/@types/d3-array/LICENSE +21 -0
- package/vendor/types/@types/d3-array/index.d.ts +1118 -0
- package/vendor/types/@types/d3-array/package.json +56 -0
- package/vendor/types/@types/d3-axis/LICENSE +21 -0
- package/vendor/types/@types/d3-axis/index.d.ts +293 -0
- package/vendor/types/@types/d3-axis/package.json +47 -0
- package/vendor/types/@types/d3-brush/LICENSE +21 -0
- package/vendor/types/@types/d3-brush/index.d.ts +255 -0
- package/vendor/types/@types/d3-brush/package.json +42 -0
- package/vendor/types/@types/d3-chord/LICENSE +21 -0
- package/vendor/types/@types/d3-chord/index.d.ts +471 -0
- package/vendor/types/@types/d3-chord/package.json +40 -0
- package/vendor/types/@types/d3-color/LICENSE +21 -0
- package/vendor/types/@types/d3-color/index.d.ts +669 -0
- package/vendor/types/@types/d3-color/package.json +55 -0
- package/vendor/types/@types/d3-contour/LICENSE +21 -0
- package/vendor/types/@types/d3-contour/index.d.ts +222 -0
- package/vendor/types/@types/d3-contour/package.json +38 -0
- package/vendor/types/@types/d3-delaunay/LICENSE +21 -0
- package/vendor/types/@types/d3-delaunay/index.d.ts +316 -0
- package/vendor/types/@types/d3-delaunay/package.json +30 -0
- package/vendor/types/@types/d3-dispatch/LICENSE +21 -0
- package/vendor/types/@types/d3-dispatch/index.d.ts +96 -0
- package/vendor/types/@types/d3-dispatch/package.json +51 -0
- package/vendor/types/@types/d3-drag/LICENSE +21 -0
- package/vendor/types/@types/d3-drag/index.d.ts +395 -0
- package/vendor/types/@types/d3-drag/package.json +42 -0
- package/vendor/types/@types/d3-dsv/LICENSE +21 -0
- package/vendor/types/@types/d3-dsv/index.d.ts +482 -0
- package/vendor/types/@types/d3-dsv/package.json +45 -0
- package/vendor/types/@types/d3-ease/LICENSE +21 -0
- package/vendor/types/@types/d3-ease/index.d.ts +316 -0
- package/vendor/types/@types/d3-ease/package.json +40 -0
- package/vendor/types/@types/d3-fetch/LICENSE +21 -0
- package/vendor/types/@types/d3-fetch/index.d.ts +282 -0
- package/vendor/types/@types/d3-fetch/package.json +37 -0
- package/vendor/types/@types/d3-force/LICENSE +21 -0
- package/vendor/types/@types/d3-force/index.d.ts +899 -0
- package/vendor/types/@types/d3-force/package.json +45 -0
- package/vendor/types/@types/d3-format/LICENSE +21 -0
- package/vendor/types/@types/d3-format/index.d.ts +337 -0
- package/vendor/types/@types/d3-format/package.json +45 -0
- package/vendor/types/@types/d3-geo/LICENSE +21 -0
- package/vendor/types/@types/d3-geo/index.d.ts +1371 -0
- package/vendor/types/@types/d3-geo/package.json +48 -0
- package/vendor/types/@types/d3-hierarchy/LICENSE +21 -0
- package/vendor/types/@types/d3-hierarchy/index.d.ts +928 -0
- package/vendor/types/@types/d3-hierarchy/package.json +50 -0
- package/vendor/types/@types/d3-interpolate/LICENSE +21 -0
- package/vendor/types/@types/d3-interpolate/index.d.ts +387 -0
- package/vendor/types/@types/d3-interpolate/package.json +47 -0
- package/vendor/types/@types/d3-path/LICENSE +21 -0
- package/vendor/types/@types/d3-path/index.d.ts +108 -0
- package/vendor/types/@types/d3-path/package.json +41 -0
- package/vendor/types/@types/d3-polygon/LICENSE +21 -0
- package/vendor/types/@types/d3-polygon/index.d.ts +41 -0
- package/vendor/types/@types/d3-polygon/package.json +40 -0
- package/vendor/types/@types/d3-quadtree/LICENSE +21 -0
- package/vendor/types/@types/d3-quadtree/index.d.ts +204 -0
- package/vendor/types/@types/d3-quadtree/package.json +45 -0
- package/vendor/types/@types/d3-random/LICENSE +21 -0
- package/vendor/types/@types/d3-random/index.d.ts +313 -0
- package/vendor/types/@types/d3-random/package.json +41 -0
- package/vendor/types/@types/d3-scale/LICENSE +21 -0
- package/vendor/types/@types/d3-scale/index.d.ts +2669 -0
- package/vendor/types/@types/d3-scale/package.json +53 -0
- package/vendor/types/@types/d3-scale-chromatic/LICENSE +21 -0
- package/vendor/types/@types/d3-scale-chromatic/index.d.ts +520 -0
- package/vendor/types/@types/d3-scale-chromatic/package.json +46 -0
- package/vendor/types/@types/d3-selection/LICENSE +21 -0
- package/vendor/types/@types/d3-selection/index.d.ts +1210 -0
- package/vendor/types/@types/d3-selection/package.json +56 -0
- package/vendor/types/@types/d3-shape/LICENSE +21 -0
- package/vendor/types/@types/d3-shape/index.d.ts +2792 -0
- package/vendor/types/@types/d3-shape/package.json +53 -0
- package/vendor/types/@types/d3-time/LICENSE +21 -0
- package/vendor/types/@types/d3-time/index.d.ts +697 -0
- package/vendor/types/@types/d3-time/package.json +46 -0
- package/vendor/types/@types/d3-time-format/LICENSE +21 -0
- package/vendor/types/@types/d3-time-format/index.d.ts +202 -0
- package/vendor/types/@types/d3-time-format/package.json +40 -0
- package/vendor/types/@types/d3-timer/LICENSE +21 -0
- package/vendor/types/@types/d3-timer/index.d.ts +68 -0
- package/vendor/types/@types/d3-timer/package.json +45 -0
- package/vendor/types/@types/d3-transition/LICENSE +21 -0
- package/vendor/types/@types/d3-transition/index.d.ts +664 -0
- package/vendor/types/@types/d3-transition/package.json +47 -0
- package/vendor/types/@types/d3-zoom/LICENSE +21 -0
- package/vendor/types/@types/d3-zoom/index.d.ts +611 -0
- package/vendor/types/@types/d3-zoom/package.json +48 -0
- package/vendor/types/@types/geojson/LICENSE +21 -0
- package/vendor/types/@types/geojson/index.d.ts +202 -0
- package/vendor/types/@types/geojson/package.json +46 -0
- package/vendor/typescript/LICENSE.txt +55 -0
- package/vendor/typescript/lib.decorators.d.ts +384 -0
- package/vendor/typescript/lib.decorators.legacy.d.ts +22 -0
- package/vendor/typescript/lib.dom.d.ts +39429 -0
- package/vendor/typescript/lib.dom.iterable.d.ts +571 -0
- package/vendor/typescript/lib.es2015.collection.d.ts +147 -0
- package/vendor/typescript/lib.es2015.core.d.ts +597 -0
- package/vendor/typescript/lib.es2015.d.ts +28 -0
- package/vendor/typescript/lib.es2015.generator.d.ts +77 -0
- package/vendor/typescript/lib.es2015.iterable.d.ts +605 -0
- package/vendor/typescript/lib.es2015.promise.d.ts +81 -0
- package/vendor/typescript/lib.es2015.proxy.d.ts +128 -0
- package/vendor/typescript/lib.es2015.reflect.d.ts +144 -0
- package/vendor/typescript/lib.es2015.symbol.d.ts +46 -0
- package/vendor/typescript/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/vendor/typescript/lib.es2016.array.include.d.ts +116 -0
- package/vendor/typescript/lib.es2016.d.ts +21 -0
- package/vendor/typescript/lib.es2016.intl.d.ts +31 -0
- package/vendor/typescript/lib.es2017.arraybuffer.d.ts +21 -0
- package/vendor/typescript/lib.es2017.d.ts +26 -0
- package/vendor/typescript/lib.es2017.date.d.ts +31 -0
- package/vendor/typescript/lib.es2017.intl.d.ts +44 -0
- package/vendor/typescript/lib.es2017.object.d.ts +49 -0
- package/vendor/typescript/lib.es2017.sharedmemory.d.ts +135 -0
- package/vendor/typescript/lib.es2017.string.d.ts +45 -0
- package/vendor/typescript/lib.es2017.typedarrays.d.ts +53 -0
- package/vendor/typescript/lib.es2018.asyncgenerator.d.ts +77 -0
- package/vendor/typescript/lib.es2018.asynciterable.d.ts +53 -0
- package/vendor/typescript/lib.es2018.d.ts +24 -0
- package/vendor/typescript/lib.es2018.intl.d.ts +83 -0
- package/vendor/typescript/lib.es2018.promise.d.ts +30 -0
- package/vendor/typescript/lib.es2018.regexp.d.ts +37 -0
- package/vendor/typescript/lib.es2019.array.d.ts +79 -0
- package/vendor/typescript/lib.es2019.d.ts +24 -0
- package/vendor/typescript/lib.es2019.intl.d.ts +23 -0
- package/vendor/typescript/lib.es2019.object.d.ts +33 -0
- package/vendor/typescript/lib.es2019.string.d.ts +37 -0
- package/vendor/typescript/lib.es2019.symbol.d.ts +24 -0
- package/vendor/typescript/lib.es2020.bigint.d.ts +765 -0
- package/vendor/typescript/lib.es2020.d.ts +27 -0
- package/vendor/typescript/lib.es2020.date.d.ts +42 -0
- package/vendor/typescript/lib.es2020.intl.d.ts +474 -0
- package/vendor/typescript/lib.es2020.number.d.ts +28 -0
- package/vendor/typescript/lib.es2020.promise.d.ts +47 -0
- package/vendor/typescript/lib.es2020.sharedmemory.d.ts +99 -0
- package/vendor/typescript/lib.es2020.string.d.ts +44 -0
- package/vendor/typescript/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/vendor/typescript/lib.es2021.d.ts +23 -0
- package/vendor/typescript/lib.es2021.intl.d.ts +166 -0
- package/vendor/typescript/lib.es2021.promise.d.ts +48 -0
- package/vendor/typescript/lib.es2021.string.d.ts +33 -0
- package/vendor/typescript/lib.es2021.weakref.d.ts +78 -0
- package/vendor/typescript/lib.es2022.array.d.ts +121 -0
- package/vendor/typescript/lib.es2022.d.ts +25 -0
- package/vendor/typescript/lib.es2022.error.d.ts +75 -0
- package/vendor/typescript/lib.es2022.intl.d.ts +145 -0
- package/vendor/typescript/lib.es2022.object.d.ts +26 -0
- package/vendor/typescript/lib.es2022.regexp.d.ts +39 -0
- package/vendor/typescript/lib.es2022.string.d.ts +25 -0
- package/vendor/typescript/lib.es5.d.ts +4601 -0
- package/vendor/typescript/package.json +4 -0
- package/vendor/typescript/typescript.js +446 -0
- package/web/assets/index-B6Ai3wsa.js +13 -0
- package/web/assets/index-SYPC3EZy.css +1 -0
- package/web/index.html +14 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { parseInlineMath, unescapeMarkdown } from "./inline.mjs";
|
|
2
|
+
|
|
3
|
+
// Formulas in pasted content, beyond what Notion knows (notion-lite ai-math.js): copied from
|
|
4
|
+
// ChatGPT, Gemini, Claude, DeepSeek, Wikipedia… a formula would be lost or garbled.
|
|
5
|
+
// convertRenderedMath(root) formulas a page drew, as Notion's own formula marks (data-notion-
|
|
6
|
+
// equation / data-notion-inline-equation, which html.mjs reads), before the conversion:
|
|
7
|
+
// KaTeX (.katex-display display, .katex inline): the TeX in annotation[encoding="application/x-tex"];
|
|
8
|
+
// [data-math] (Gemini; display with block / display in its class, or a div);
|
|
9
|
+
// MathJax 2: script[type^="math/tex"] (mode=display: display), the .MathJax* drawn beside it removed;
|
|
10
|
+
// MathML (Wikipedia): its annotation or alttext, {\displaystyle …} taken off; .mwe-math-element
|
|
11
|
+
// (with a fallback picture) replaced whole.
|
|
12
|
+
// mathifySpecs(specs) formulas still in the text of converted blocks (AI pages and their copy
|
|
13
|
+
// buttons give the TeX as text): a text block that is only $$ … $$ / \[ … \] / \\[ … \\] a
|
|
14
|
+
// formula block; $ … $, $$ … $$, \( … \), \\( … \\) in text inline formulas (code and formulas
|
|
15
|
+
// left alone; table cells too).
|
|
16
|
+
|
|
17
|
+
const EQ = "data-notion-equation";
|
|
18
|
+
const INLINE_EQ = "data-notion-inline-equation";
|
|
19
|
+
|
|
20
|
+
function equationElement(doc, tex, display) {
|
|
21
|
+
const element = doc.createElement(display ? "div" : "span");
|
|
22
|
+
element.setAttribute(display ? EQ : INLINE_EQ, tex);
|
|
23
|
+
element.textContent = tex;
|
|
24
|
+
return element;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const stripDisplaystyle = (tex) => tex.replace(/^\{\\displaystyle\s*([\s\S]*)\}$/, "$1").trim();
|
|
28
|
+
|
|
29
|
+
export function convertRenderedMath(root) {
|
|
30
|
+
const doc = root.ownerDocument;
|
|
31
|
+
for (const element of [...root.querySelectorAll(".katex-display, .katex")]) {
|
|
32
|
+
if (!element.isConnected) continue;
|
|
33
|
+
const tex = element.querySelector('annotation[encoding="application/x-tex"]')?.textContent?.trim();
|
|
34
|
+
if (tex) element.replaceWith(equationElement(doc, tex, element.classList.contains("katex-display")));
|
|
35
|
+
}
|
|
36
|
+
for (const element of [...root.querySelectorAll("[data-math]")]) {
|
|
37
|
+
if (!element.isConnected) continue;
|
|
38
|
+
const tex = element.getAttribute("data-math")?.trim();
|
|
39
|
+
if (tex) element.replaceWith(equationElement(doc, tex, /block|display/i.test(element.getAttribute("class") ?? "") || element.tagName === "DIV"));
|
|
40
|
+
}
|
|
41
|
+
for (const script of [...root.querySelectorAll('script[type^="math/tex"]')]) {
|
|
42
|
+
const display = /mode=display/.test(script.getAttribute("type"));
|
|
43
|
+
for (let p = script.previousElementSibling; p && /MathJax/.test(p.getAttribute("class") ?? ""); p = script.previousElementSibling) p.remove();
|
|
44
|
+
const tex = script.textContent.trim();
|
|
45
|
+
if (tex) script.replaceWith(equationElement(doc, tex, display));
|
|
46
|
+
else script.remove();
|
|
47
|
+
}
|
|
48
|
+
for (const math of [...root.querySelectorAll("math")]) {
|
|
49
|
+
if (!math.isConnected) continue;
|
|
50
|
+
const tex = math.querySelector('annotation[encoding="application/x-tex"]')?.textContent?.trim() || math.getAttribute("alttext")?.trim();
|
|
51
|
+
if (!tex) continue;
|
|
52
|
+
(math.closest(".mwe-math-element") ?? math).replaceWith(equationElement(doc, stripDisplaystyle(tex), math.getAttribute("display") === "block"));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Inline formulas in rich text's plain pieces, as formula pieces with the piece's annotations.
|
|
57
|
+
function mathifyTitle(title) {
|
|
58
|
+
if (!Array.isArray(title)) return title;
|
|
59
|
+
const out = [];
|
|
60
|
+
for (const [text, annotations] of title) {
|
|
61
|
+
if (annotations?.some((a) => a[0] === "c" || a[0] === "e") || !/[$\\]/.test(text)) {
|
|
62
|
+
out.push(annotations ? [text, annotations] : [text]);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
for (const [piece, own] of parseInlineMath(text)) {
|
|
66
|
+
const merged = [...(own ?? []), ...(annotations ?? [])];
|
|
67
|
+
out.push(merged.length ? [piece, merged] : [piece]);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return out;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// A whole text that is a display formula: its TeX, else null. [pattern, escaped inside, its end
|
|
74
|
+
// that may not come again inside].
|
|
75
|
+
const DISPLAY = [[/^\\\\\[([\s\S]+)\\\\\]$/, true, "\\\\]"], [/^\\\[([\s\S]+)\\\]$/, false, "\\]"], [/^\$\$([\s\S]+)\$\$$/, false, "$$"]];
|
|
76
|
+
function displayMathOf(title) {
|
|
77
|
+
if (!title?.length || title.some(([, a]) => a?.some((x) => x[0] === "c" || x[0] === "e"))) return null;
|
|
78
|
+
const text = title.map((t) => t[0]).join("").trim();
|
|
79
|
+
for (const [pattern, escaped, close] of DISPLAY) {
|
|
80
|
+
const match = pattern.exec(text);
|
|
81
|
+
if (match && !match[1].includes(close)) return (escaped ? unescapeMarkdown(match[1]) : match[1]).trim();
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function mathifySpecs(specs) {
|
|
87
|
+
return specs.map((s) => {
|
|
88
|
+
if (s.type === "code" || s.type === "equation") return s;
|
|
89
|
+
if (s.type === "text" && !s.children?.length) {
|
|
90
|
+
const tex = displayMathOf(s.title);
|
|
91
|
+
if (tex) return { type: "equation", title: [[tex]], props: {}, children: [] };
|
|
92
|
+
}
|
|
93
|
+
const props = { ...s.props };
|
|
94
|
+
if (props.cells) props.cells = Object.fromEntries(Object.entries(props.cells).map(([key, value]) => [key, mathifyTitle(value)]));
|
|
95
|
+
if (props.caption) props.caption = mathifyTitle(props.caption);
|
|
96
|
+
return { ...s, title: mathifyTitle(s.title), props, children: mathifySpecs(s.children ?? []) };
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export const mathifyRichText = mathifyTitle;
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
// HTML copied from Word, WPS or OneNote, through TinyMCE's Word paste filter first, as Notion does
|
|
2
|
+
// (393771 → 860274 → 980556 tF; TinyMCE's WordFilter, MIT; notion-lite office-filter.js). Notion
|
|
3
|
+
// uses it only when the HTML has Office's namespaces (read.mjs) and looks like Word's (isWordContent:
|
|
4
|
+
// Mso classes, mso- styles, w:WordDocument, OutlineElement…), with its settings: no retained style
|
|
5
|
+
// properties (bold and italic as b / i, nothing else), the default valid elements, fake lists made
|
|
6
|
+
// lists.
|
|
7
|
+
// 1. Patterns out: Apple's line break marks, Google Docs' guid wrapper, comments (conditional
|
|
8
|
+
// ones too), scripts, <?xml>, img / meta / link / style tags, namespaced tags (o:p: the tag
|
|
9
|
+
// alone); <s> → <strike>; → a no-break space; mso-spacerun's spaces halved.
|
|
10
|
+
// 2. Attributes: style — mso-list gives the list level, mso-list:Ignore marks the node and its
|
|
11
|
+
// first child to go, comments go, mso- is dropped, font-weight / font-style not normal wrap
|
|
12
|
+
// it in b / i, no other style stays; class — comments' and revisions' elements go, the rest
|
|
13
|
+
// loses it; del goes; a — comment links go, file:// links keep what follows #, anchors without
|
|
14
|
+
// href, or named other than a contents / note mark, lose the tag.
|
|
15
|
+
// 3. Only the valid elements and attributes stay: strong(b) em(i) u span p(div) ol ul li h1~h6
|
|
16
|
+
// a[href|name] sub sup strike br del table[width] tr td/th[colspan|rowspan|width] thead tfoot
|
|
17
|
+
// tbody; others lose their tag, spans without attributes too, empty ones go.
|
|
18
|
+
// 4. Fake lists: top-level <p> starting with •·§● → ul; with 1. / a. / iv. / 一. … → ol (its
|
|
19
|
+
// start); with an mso-list level → ul; nested by level, their bullet or number taken off.
|
|
20
|
+
// Besides TinyMCE's (feishu-lite's color matching, colors.mjs): with `colors`, a text color and a
|
|
21
|
+
// background in a style stay as data-paste-color / data-paste-background, which html.mjs maps to
|
|
22
|
+
// the page's colors (Feishu keeps Word's colors; Notion drops them).
|
|
23
|
+
|
|
24
|
+
const NBSP = String.fromCharCode(0xa0);
|
|
25
|
+
|
|
26
|
+
/** Whether HTML looks like Word's (Notion's test). */
|
|
27
|
+
export const isWordContent = (html) =>
|
|
28
|
+
/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(html) || /class="OutlineElement/.test(html) || /id="?docs-internal-guid-/.test(html);
|
|
29
|
+
|
|
30
|
+
const VALID = {
|
|
31
|
+
strong: [], em: [], u: [], span: [], p: [], ol: [], ul: [], li: [], h1: [], h2: [], h3: [], h4: [], h5: [], h6: [], a: ["href", "name"],
|
|
32
|
+
sub: [], sup: [], strike: [], br: [], del: [], table: ["width"], tr: [], td: ["colspan", "rowspan", "width"], th: ["colspan", "rowspan", "width"], thead: [], tfoot: [], tbody: [],
|
|
33
|
+
};
|
|
34
|
+
const COLOR_ATTRIBUTES = ["data-paste-color", "data-paste-background"];
|
|
35
|
+
const ALIAS = { b: "strong", i: "em", div: "p" };
|
|
36
|
+
const REMOVE_EMPTY = new Set(["strong", "em", "u", "span", "p", "ol", "ul", "li", "h1", "h2", "h3", "h4", "h5", "h6", "a"]);
|
|
37
|
+
const BULLET = /^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/;
|
|
38
|
+
const NUMBERED = [/^[IVXLMCD]{1,2}\.[ \u00a0]/, /^[ivxlmcd]{1,2}\.[ \u00a0]/, /^[a-z]{1,2}[.)][ \u00a0]/, /^[A-Z]{1,2}[.)][ \u00a0]/, /^[0-9]+\.[ \u00a0]/,
|
|
39
|
+
/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/, /^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/];
|
|
40
|
+
|
|
41
|
+
function regexFilters(html) {
|
|
42
|
+
const rules = [
|
|
43
|
+
/<br class="?Apple-interchange-newline"?>/gi,
|
|
44
|
+
/<b[^>]+id="?docs-internal-[^>]*>/gi,
|
|
45
|
+
/<!--[\s\S]+?-->/gi,
|
|
46
|
+
/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s/>]))[^>]*>/gi,
|
|
47
|
+
[/<(\/?)s>/gi, "<$1strike>"],
|
|
48
|
+
[/ /gi, NBSP],
|
|
49
|
+
[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
|
|
50
|
+
(_, spaces) => (spaces.length > 0 ? spaces.replace(/./, " ").slice(Math.floor(spaces.length / 2)).split("").join(NBSP) : "")],
|
|
51
|
+
];
|
|
52
|
+
for (const rule of rules) html = rule instanceof RegExp ? html.replace(rule, "") : html.replace(rule[0], rule[1]);
|
|
53
|
+
return html;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const parseStyle = (style) => (style ?? "").split(";").map((part) => part.split(":")).filter(([key, value]) => key?.trim() && value !== undefined)
|
|
57
|
+
.map(([key, ...value]) => [key.trim().toLowerCase(), value.join(":").trim()]);
|
|
58
|
+
|
|
59
|
+
const tagOf = (element) => element.tagName.toLowerCase();
|
|
60
|
+
function wrapWith(element, tag) {
|
|
61
|
+
const wrapper = element.ownerDocument.createElement(tag);
|
|
62
|
+
element.parentNode.insertBefore(wrapper, element);
|
|
63
|
+
wrapper.appendChild(element);
|
|
64
|
+
}
|
|
65
|
+
const unwrap = (element) => element.replaceWith(...element.childNodes);
|
|
66
|
+
|
|
67
|
+
/** Word's HTML filtered (TinyMCE's WordFilter as Notion sets it); `colors`: colors kept as data-paste-*. */
|
|
68
|
+
export function filterWordContent(html, { colors = false } = {}) {
|
|
69
|
+
const doc = new globalThis.DOMParser().parseFromString(regexFilters(html), "text/html");
|
|
70
|
+
const root = doc.body;
|
|
71
|
+
const level = new WeakMap();
|
|
72
|
+
const ignore = new WeakSet();
|
|
73
|
+
// 2. Attributes (style, class, del, a).
|
|
74
|
+
for (const element of [...root.querySelectorAll("*")]) {
|
|
75
|
+
if (!element.isConnected) continue;
|
|
76
|
+
const style = element.getAttribute("style");
|
|
77
|
+
if (style !== null) {
|
|
78
|
+
let removed = false;
|
|
79
|
+
let bold = false;
|
|
80
|
+
let italic = false;
|
|
81
|
+
for (const [name, value] of parseStyle(style)) {
|
|
82
|
+
if (name === "mso-list") {
|
|
83
|
+
const match = /\w+ \w+([0-9]+)/i.exec(style);
|
|
84
|
+
if (match) level.set(element, parseInt(match[1], 10));
|
|
85
|
+
if (/Ignore/i.test(value) && element.firstChild) {
|
|
86
|
+
ignore.add(element);
|
|
87
|
+
ignore.add(element.firstChild);
|
|
88
|
+
}
|
|
89
|
+
} else if (name === "font-weight" && value !== "normal") bold = /bold/i.test(value);
|
|
90
|
+
else if (name === "font-style" && value !== "normal") italic = /italic/i.test(value);
|
|
91
|
+
else if (name === "mso-element" && /^(comment|comment-list)$/i.test(value)) {
|
|
92
|
+
removed = true;
|
|
93
|
+
break;
|
|
94
|
+
} else if (colors && name === "color") element.setAttribute("data-paste-color", value);
|
|
95
|
+
else if (colors && (name === "background" || name === "background-color" || name === "mso-highlight")) element.setAttribute("data-paste-background", value);
|
|
96
|
+
if (name.startsWith("mso-comment")) {
|
|
97
|
+
removed = true;
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (removed) {
|
|
102
|
+
element.remove();
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
element.removeAttribute("style");
|
|
106
|
+
if (bold) wrapWith(element, "b");
|
|
107
|
+
if (italic) wrapWith(element, "i");
|
|
108
|
+
if (tagOf(element) === "span" && element.parentNode && !element.attributes.length) {
|
|
109
|
+
unwrap(element);
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const className = element.getAttribute("class");
|
|
114
|
+
if (className !== null) {
|
|
115
|
+
if (/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className)) {
|
|
116
|
+
element.remove();
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
element.removeAttribute("class");
|
|
120
|
+
}
|
|
121
|
+
if (tagOf(element) === "del") {
|
|
122
|
+
element.remove();
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
if (tagOf(element) === "a") {
|
|
126
|
+
let href = element.getAttribute("href");
|
|
127
|
+
const name = element.getAttribute("name");
|
|
128
|
+
if (href && href.includes("#_msocom_")) {
|
|
129
|
+
element.remove();
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (href && href.startsWith("file://")) {
|
|
133
|
+
href = href.split("#")[1];
|
|
134
|
+
if (href) href = `#${href}`;
|
|
135
|
+
}
|
|
136
|
+
if ((!href && !name) || (name && !/^_?(?:toc|edn|ftn)/i.test(name))) {
|
|
137
|
+
unwrap(element);
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
if (href) element.setAttribute("href", href);
|
|
141
|
+
else element.removeAttribute("href");
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// 3. The valid elements: renamed, others unwrapped, other attributes dropped, empty ones gone.
|
|
145
|
+
for (let element of [...root.querySelectorAll("*")].reverse()) {
|
|
146
|
+
if (!element.isConnected) continue;
|
|
147
|
+
let tag = tagOf(element);
|
|
148
|
+
// A div holding blocks (Word's WordSection wrapper of a whole page) goes: TinyMCE's parser takes p in p apart.
|
|
149
|
+
if (tag === "div" && [...element.children].some((child) => /^(P|DIV|H[1-6]|UL|OL|TABLE)$/.test(child.tagName))) {
|
|
150
|
+
unwrap(element);
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
if (ALIAS[tag]) {
|
|
154
|
+
const next = doc.createElement(ALIAS[tag]);
|
|
155
|
+
for (const attribute of element.attributes) next.setAttribute(attribute.name, attribute.value);
|
|
156
|
+
next.append(...element.childNodes);
|
|
157
|
+
if (level.has(element)) level.set(next, level.get(element));
|
|
158
|
+
if (ignore.has(element)) ignore.add(next);
|
|
159
|
+
element.replaceWith(next);
|
|
160
|
+
element = next;
|
|
161
|
+
tag = ALIAS[tag];
|
|
162
|
+
}
|
|
163
|
+
if (!(tag in VALID)) {
|
|
164
|
+
unwrap(element);
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
for (const attribute of [...element.attributes]) {
|
|
168
|
+
const name = attribute.name.toLowerCase();
|
|
169
|
+
if (!VALID[tag].includes(name) && !(colors && COLOR_ATTRIBUTES.includes(name))) element.removeAttribute(attribute.name);
|
|
170
|
+
}
|
|
171
|
+
if (REMOVE_EMPTY.has(tag) && !element.childNodes.length) element.remove();
|
|
172
|
+
}
|
|
173
|
+
// 4. Fake lists made lists.
|
|
174
|
+
let current = null;
|
|
175
|
+
let previous = null;
|
|
176
|
+
let lastLevel = 1;
|
|
177
|
+
const trimStart = (node, pattern) => {
|
|
178
|
+
if (node.nodeType === 3) {
|
|
179
|
+
if (pattern.test(node.data)) {
|
|
180
|
+
node.data = node.data.replace(pattern, "");
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
for (let child = node.firstChild; child; child = child.nextSibling) if (!trimStart(child, pattern)) return false;
|
|
185
|
+
return true;
|
|
186
|
+
};
|
|
187
|
+
const removeIgnored = (node) => {
|
|
188
|
+
if (ignore.has(node)) {
|
|
189
|
+
node.remove();
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
for (const child of [...node.childNodes]) removeIgnored(child);
|
|
193
|
+
};
|
|
194
|
+
const toItem = (p, listTag, start) => {
|
|
195
|
+
const itemLevel = level.get(p) || lastLevel;
|
|
196
|
+
if (itemLevel !== lastLevel) {
|
|
197
|
+
if (itemLevel < lastLevel) {
|
|
198
|
+
if (current) current = current.parentNode?.parentNode ?? null;
|
|
199
|
+
} else {
|
|
200
|
+
previous = current;
|
|
201
|
+
current = null;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const item = doc.createElement("li");
|
|
205
|
+
if (!current || tagOf(current) !== listTag) {
|
|
206
|
+
previous = previous || current;
|
|
207
|
+
current = doc.createElement(listTag);
|
|
208
|
+
if (start > 1) current.setAttribute("start", String(start));
|
|
209
|
+
p.parentNode.insertBefore(current, p);
|
|
210
|
+
}
|
|
211
|
+
item.append(...p.childNodes);
|
|
212
|
+
current.appendChild(item);
|
|
213
|
+
p.remove();
|
|
214
|
+
if (itemLevel > lastLevel && previous?.lastElementChild) previous.lastElementChild.appendChild(current);
|
|
215
|
+
lastLevel = itemLevel;
|
|
216
|
+
level.set(item, itemLevel);
|
|
217
|
+
removeIgnored(item);
|
|
218
|
+
trimStart(item, /^\u00a0+/);
|
|
219
|
+
trimStart(item, /^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/);
|
|
220
|
+
trimStart(item, /^\u00a0+/);
|
|
221
|
+
};
|
|
222
|
+
for (const element of [...root.childNodes]) {
|
|
223
|
+
if (element.nodeType === 1 && tagOf(element) === "p" && element.firstChild) {
|
|
224
|
+
const text = element.textContent ?? "";
|
|
225
|
+
if (BULLET.test(text)) {
|
|
226
|
+
toItem(element, "ul");
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
if (NUMBERED.some((pattern) => pattern.test(text.replace(/^[\u00a0 ]+/, "")))) {
|
|
230
|
+
const match = /([0-9]+)\./.exec(text);
|
|
231
|
+
toItem(element, "ol", match ? parseInt(match[1], 10) : 1);
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
if (level.get(element)) {
|
|
235
|
+
toItem(element, "ul", 1);
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
current = null;
|
|
239
|
+
} else {
|
|
240
|
+
previous = current;
|
|
241
|
+
current = null;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return root.innerHTML;
|
|
245
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { containsRichFormatting, htmlToBlocks, htmlToRichText, parseClipboardHTML } from "./html.mjs";
|
|
2
|
+
import { filterWordContent, isWordContent } from "./office.mjs";
|
|
3
|
+
import { mathifyRichText, mathifySpecs } from "./math.mjs";
|
|
4
|
+
import { fromMarkdown } from "./markdown.mjs";
|
|
5
|
+
import { parseInlineMarkdown } from "./inline.mjs";
|
|
6
|
+
import { vscodeLanguage } from "./languages.mjs";
|
|
7
|
+
import { addressOf } from "../../links/address.mjs";
|
|
8
|
+
|
|
9
|
+
// What a paste from another program is (Notion 860313 clipboardActions' external content, notion-lite
|
|
10
|
+
// editor/input/clipboard/index.js): the clipboard read in Notion's order, as block specs, one rich
|
|
11
|
+
// text to go in at the caret, or plain text.
|
|
12
|
+
// - Text: U+2028 as line breaks (text/uri-list when there is no text). HTML only with "rich
|
|
13
|
+
// formatting" (html.mjs containsRichFormatting; WordPress's always): spans, divs and paragraphs
|
|
14
|
+
// alone paste as their text.
|
|
15
|
+
// - Office's HTML (its namespaces) that looks like Word's goes through the Word filter (office.mjs).
|
|
16
|
+
// - A whole $$ formula $$ → a formula block; several lines from VS Code → code in its language.
|
|
17
|
+
// - HTML: several lines of text, or a table → blocks (html.mjs htmlToBlocks); else one rich text.
|
|
18
|
+
// - No HTML: several lines → Markdown (markdown.mjs); one line → inline Markdown (bold, links,
|
|
19
|
+
// addresses, formulas) when it has any, else plain text. A whole line that is a display formula
|
|
20
|
+
// (\[ … \]) → a formula block.
|
|
21
|
+
// Besides Notion's: formulas AI answers copy (math.mjs, markdown.mjs, inline.mjs) and colors
|
|
22
|
+
// (feishu-lite: html.mjs `colors`; nearest for Word, Google Docs and Notion, whose styles are meant,
|
|
23
|
+
// as Feishu's 129153 · P; else only the page's own).
|
|
24
|
+
|
|
25
|
+
const OFFICE = /schemas-microsoft-com:office|xmlns:m="http:\/\/schemas\.microsoft\.com\/office\/2004\/12\/omml"/;
|
|
26
|
+
const WORDPRESS = /<!-- wp:/;
|
|
27
|
+
// 860313 E: a whole $$ formula $$.
|
|
28
|
+
const EQUATION = /^\s*\$\$[ \t]*\r?\n?([\s\S]+?)\r?\n?[ \t]*\$\$\s*$/;
|
|
29
|
+
const multiline = (text) => text.trimEnd().includes("\n"); // 860313 L
|
|
30
|
+
// Clipboard types of sources whose styles are meant (Feishu 129153 · P).
|
|
31
|
+
const STYLED = ["application/x-vnd.google-docs-document-slice-clip+wrapped", "text/_notion-page-source-production", "text/_notion-text-production", "text/_notion-blocks-v3-production"];
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The clipboard's other programs' content (860313 ef): { text, html (with rich formatting, else ""),
|
|
35
|
+
* fromOffice, isTable (its first element a table, before normalizing), language (VS Code's), colors }.
|
|
36
|
+
*/
|
|
37
|
+
export function externalContent(data, { base } = {}) {
|
|
38
|
+
const text = (data.getData("text/plain") || "").replace(/\u2028/g, "\n").replace(/\r\n?/g, "\n") || data.getData("text/uri-list") || "";
|
|
39
|
+
const original = data.getData("text/html") || "";
|
|
40
|
+
const fromOffice = OFFICE.test(original);
|
|
41
|
+
const types = [...(data.types ?? [])];
|
|
42
|
+
const colors = fromOffice || types.some((type) => STYLED.includes(type)) ? "nearest" : "exact";
|
|
43
|
+
const raw = fromOffice && isWordContent(original) ? filterWordContent(original, { colors: true }) : original;
|
|
44
|
+
let html = "";
|
|
45
|
+
let isTable = false;
|
|
46
|
+
if (raw) {
|
|
47
|
+
const probe = parseClipboardHTML(raw, { base });
|
|
48
|
+
isTable = probe.firstElementChild?.tagName === "TABLE";
|
|
49
|
+
if (containsRichFormatting(probe, { colors }) || (WORDPRESS.test(raw) && WORDPRESS.test(text))) html = raw;
|
|
50
|
+
}
|
|
51
|
+
let mode = null;
|
|
52
|
+
try {
|
|
53
|
+
mode = JSON.parse(data.getData("vscode-editor-data") || "null")?.mode ?? null;
|
|
54
|
+
} catch {
|
|
55
|
+
// not JSON
|
|
56
|
+
}
|
|
57
|
+
return { text, html, fromOffice, isTable, language: mode ? vscodeLanguage(mode) : null, colors };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The href of what is on the clipboard when that is an address alone, else null. The plain text says
|
|
62
|
+
* so (addressOf); HTML beside it, as a web page's link has when it is copied, may hold nothing but a
|
|
63
|
+
* link to that address, or the same words (a code editor's colored text). An address written with
|
|
64
|
+
* www. says no scheme: the link beside it is that same link under either, and gives its own.
|
|
65
|
+
*/
|
|
66
|
+
export function bareAddress(data, options = {}) {
|
|
67
|
+
const plain = data.getData("text/plain");
|
|
68
|
+
const href = addressOf(plain);
|
|
69
|
+
const html = data.getData("text/html");
|
|
70
|
+
if (!href || !html) return href;
|
|
71
|
+
const root = parseClipboardHTML(html, options);
|
|
72
|
+
const [link, ...others] = root.querySelectorAll("a[href]");
|
|
73
|
+
if (others.length > 0 || root.querySelector("img, picture, svg, video, audio, table")) return null;
|
|
74
|
+
const words = (text) => text.replace(/\s+/g, "");
|
|
75
|
+
if (!link) return words(root.textContent) === words(plain) ? href : null;
|
|
76
|
+
if (words(root.textContent) !== words(link.textContent)) return null;
|
|
77
|
+
const unsaid = /^www\./i.test(plain.trim());
|
|
78
|
+
if (!sameAddress(unsaid ? link.href.replace(/^https:/i, "http:") : link.href, href)) return null;
|
|
79
|
+
return unsaid ? link.href : href;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function sameAddress(one, other) {
|
|
83
|
+
try {
|
|
84
|
+
return new URL(one).href === new URL(other).href;
|
|
85
|
+
} catch {
|
|
86
|
+
return one === other;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Another program's content as { kind: "blocks", specs } | { kind: "rich", title } | { kind: "plain",
|
|
92
|
+
* text } (notion-lite readClipboard, after the editor's own formats).
|
|
93
|
+
*/
|
|
94
|
+
export function readExternal(data, options = {}) {
|
|
95
|
+
const external = externalContent(data, options);
|
|
96
|
+
const { text, html } = external;
|
|
97
|
+
const convert = { colors: external.colors };
|
|
98
|
+
const equation = EQUATION.exec(text)?.[1];
|
|
99
|
+
if (equation?.trim()) return { kind: "blocks", specs: [{ type: "equation", title: [[equation]], props: {}, children: [] }] };
|
|
100
|
+
if (multiline(text) && external.language) return { kind: "blocks", specs: [{ type: "code", title: [[text]], props: { language: external.language }, children: [] }] };
|
|
101
|
+
if (html) {
|
|
102
|
+
if (multiline(text) || external.isTable) {
|
|
103
|
+
const specs = mathifySpecs(htmlToBlocks(parseClipboardHTML(html, options), convert));
|
|
104
|
+
if (specs.length) return { kind: "blocks", specs };
|
|
105
|
+
}
|
|
106
|
+
const title = mathifyRichText(htmlToRichText(parseClipboardHTML(html, options), convert));
|
|
107
|
+
return title.length ? { kind: "rich", title } : { kind: "plain", text };
|
|
108
|
+
}
|
|
109
|
+
if (multiline(text)) {
|
|
110
|
+
const specs = fromMarkdown(text);
|
|
111
|
+
if (specs.length) return { kind: "blocks", specs };
|
|
112
|
+
}
|
|
113
|
+
// One line: a whole display formula → a formula block; else inline Markdown (860313 eE → 389867 Z4)
|
|
114
|
+
// when it makes anything, else plain text (an address alone stays text: the page may link it).
|
|
115
|
+
const single = fromMarkdown(text);
|
|
116
|
+
if (single.length === 1 && single[0].type === "equation") return { kind: "blocks", specs: single };
|
|
117
|
+
const title = parseInlineMarkdown(text);
|
|
118
|
+
if (title.some((piece) => piece[1]?.length) && !addressOf(text)) return { kind: "rich", title };
|
|
119
|
+
return { kind: "plain", text };
|
|
120
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// What the import builds (import/): notion-lite's block specs and rich text, so that its conversions
|
|
2
|
+
// port as they are and their results compare with Notion's own (tests/unit/paste.mjs). to-blocks.mjs
|
|
3
|
+
// turns them into the page's blocks.
|
|
4
|
+
//
|
|
5
|
+
// spec { type, title, props, children }: Notion's block types (text, header, sub_header,
|
|
6
|
+
// sub_sub_header, header_4, bulleted_list, numbered_list, to_do, quote, callout, toggle,
|
|
7
|
+
// code, equation, divider, table + table_row, image, embed, file, column_list + column,
|
|
8
|
+
// tab; besides them the kit's flowchart, report_flow + report_step: html.mjs), props as
|
|
9
|
+
// Notion's (checked, language, source, caption, block_color, icon, …)
|
|
10
|
+
// rich text [[text, [[annotation, value?], …]], …] (inline.mjs names the annotations)
|
|
11
|
+
|
|
12
|
+
export const spec = (type, title = [], props = {}, children = []) => ({ type, title, props, children });
|
|
13
|
+
|
|
14
|
+
const annotationKey = (annotations) => JSON.stringify([...annotations].map((a) => JSON.stringify(a)).sort());
|
|
15
|
+
|
|
16
|
+
/** Rich text with neighbouring pieces of the same annotations joined and empty ones dropped. */
|
|
17
|
+
export function normalize(title) {
|
|
18
|
+
const out = [];
|
|
19
|
+
for (const [text, annotations] of title ?? []) {
|
|
20
|
+
if (!text) continue;
|
|
21
|
+
const last = out.at(-1);
|
|
22
|
+
if (last && annotationKey(last[1] ?? []) === annotationKey(annotations ?? [])) last[0] += text;
|
|
23
|
+
else out.push(annotations?.length ? [text, annotations] : [text]);
|
|
24
|
+
}
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** The plain text of rich text (a formula as its TeX). */
|
|
29
|
+
export const plainOf = (title) => (title ?? []).map(([text, annotations]) => annotations?.find((a) => a[0] === "e")?.[1] ?? text).join("");
|