@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,205 @@
|
|
|
1
|
+
// What the editor draws over the page (docs/editor.md, "Overlays"): a selected block's fill, the
|
|
2
|
+
// handle and a section's bar, the dashed frame of the text being edited, a drag's line, tint and
|
|
3
|
+
// the blocks' faded copy, a box selection, a resize's lines. Each such node is registered with what it stands for
|
|
4
|
+
// (own: a block, or the gesture it belongs to) and a test of whether it still does (alive). The
|
|
5
|
+
// editor's frames audit them against that: one standing for nothing (a block no longer selected or
|
|
6
|
+
// on the page, a gesture over) is a bug, said once with what led to it, and the node goes, so no
|
|
7
|
+
// overlay is ever left behind on the screen. window.__galleryOverlays() describes them all, with
|
|
8
|
+
// their owners, where each is against where it should be, the frames and the recent events: what
|
|
9
|
+
// to look at (and copy) when something drawn looks wrong.
|
|
10
|
+
|
|
11
|
+
// own() marks each overlay node with this attribute: the audit and the snapshot go through the marked
|
|
12
|
+
// nodes on the page, so whatever is registered is audited, whoever draws it. The audit keeps the
|
|
13
|
+
// marked nodes it found (and those marked since) and goes through them: looking them up in the whole
|
|
14
|
+
// page after every frame took 0.2ms a frame on a long report. It looks through the page again
|
|
15
|
+
// whenever a node it does not hold may have come onto it (put in by anyone: a copy of an overlay, one
|
|
16
|
+
// taken off and put back), which an observer of what is added says (`arrivals`).
|
|
17
|
+
const MARK = "data-ge-overlay";
|
|
18
|
+
|
|
19
|
+
const owners = new WeakMap(); // node -> { kind, owner, alive, expected }
|
|
20
|
+
const owned = new Set(); // the marked nodes the audit goes through
|
|
21
|
+
let unknown = true; // a node `owned` does not hold may be on the page: the next audit looks through it
|
|
22
|
+
|
|
23
|
+
// Watched from an audit to the first node added that `owned` does not hold (or that holds a marked
|
|
24
|
+
// node), then not until the next audit: nothing to pay for while the page is built or typed in. Made
|
|
25
|
+
// at the first audit (this module is read without a page too: the unit tests).
|
|
26
|
+
let arrivals = null;
|
|
27
|
+
function arrived(records) {
|
|
28
|
+
for (const record of records) {
|
|
29
|
+
for (const node of record.addedNodes) {
|
|
30
|
+
if (node.nodeType === 1 && (!owned.has(node) || node.querySelector(`[${MARK}]`))) return true;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
function stopWatching() {
|
|
36
|
+
unknown = true;
|
|
37
|
+
arrivals?.disconnect();
|
|
38
|
+
}
|
|
39
|
+
const settlers = new Set(); // what each part drops at once after a structural change
|
|
40
|
+
const providers = new Map(); // name -> () => state, for the snapshot
|
|
41
|
+
const events = []; // the last things that changed what is drawn: { t, type, detail }
|
|
42
|
+
const said = new Map(); // scope -> { message, time }: errors said, not said again within 5s
|
|
43
|
+
const errors = []; // the last errors said: { t, scope, message }
|
|
44
|
+
let lastStray = "";
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Register `node` as an overlay of `kind` standing for `owner` (a block, or null for a gesture);
|
|
48
|
+
* alive(): whether it still stands for something (the block selected and on the page, the gesture
|
|
49
|
+
* under way); expected(): where it should be now (client coordinates), when that can be told.
|
|
50
|
+
*/
|
|
51
|
+
export function own(node, kind, { owner = null, alive = () => true, expected = null } = {}) {
|
|
52
|
+
owners.set(node, { kind, owner, alive, expected });
|
|
53
|
+
if (node.getAttribute(MARK) !== kind) node.setAttribute(MARK, kind); // the block tools own theirs again on every frame they draw
|
|
54
|
+
owned.add(node);
|
|
55
|
+
return node;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* settle(): after a structural change (history.mjs: a change, undo, redo), at once, not on a later
|
|
60
|
+
* frame, each part drops what stands for something no longer on the page (the selection its gone
|
|
61
|
+
* blocks, the handle the block it stood beside, the frame the text it framed). onSettle(fn): a part's.
|
|
62
|
+
*/
|
|
63
|
+
export function onSettle(fn) {
|
|
64
|
+
settlers.add(fn);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function settle() {
|
|
68
|
+
for (const fn of settlers) {
|
|
69
|
+
try {
|
|
70
|
+
fn();
|
|
71
|
+
} catch (error) {
|
|
72
|
+
report("settling after a change", error);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Something that changes what is drawn happened (selection, history, a gesture). */
|
|
78
|
+
export function note(type, detail = "") {
|
|
79
|
+
events.push({ t: Math.round(performance.now()), type, detail: String(detail).slice(0, 160) });
|
|
80
|
+
if (events.length > 30) events.shift();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** A part of the editor's state for the snapshot (the frames, the block tools). */
|
|
84
|
+
export function provide(name, state) {
|
|
85
|
+
providers.set(name, state);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* An error in drawing or in a gesture: said on the console (the same one at most every 5 seconds
|
|
90
|
+
* per scope, never on every frame) and kept for the snapshot.
|
|
91
|
+
*/
|
|
92
|
+
export function report(scope, error) {
|
|
93
|
+
const message = error?.message ?? String(error);
|
|
94
|
+
const now = performance.now();
|
|
95
|
+
const last = said.get(scope);
|
|
96
|
+
if (last && last.message === message && now - last.time < 5000) return;
|
|
97
|
+
said.set(scope, { message, time: now });
|
|
98
|
+
errors.push({ t: Math.round(now), scope, message });
|
|
99
|
+
if (errors.length > 10) errors.shift();
|
|
100
|
+
note("error", `${scope}: ${message}`);
|
|
101
|
+
console.error(`[gallery] ${scope} failed:`, error);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// A short description of a block or node: tag, id, the start of its text.
|
|
105
|
+
export function describe(node) {
|
|
106
|
+
if (!node) return null;
|
|
107
|
+
if (!node.localName) return String(node);
|
|
108
|
+
const id = node.getAttribute?.("data-block-id");
|
|
109
|
+
const text = (node.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, 24);
|
|
110
|
+
return `${node.localName}${id ? `#${id}` : ""}${text ? ` "${text}"` : ""}`;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const rounded = (rect) => rect && { left: Math.round(rect.left), top: Math.round(rect.top), right: Math.round(rect.right), bottom: Math.round(rect.bottom) };
|
|
114
|
+
|
|
115
|
+
// How far a node's rectangle is from where it should be (the largest difference of an edge), or null.
|
|
116
|
+
function offBy(rect, expected) {
|
|
117
|
+
if (!rect || !expected) return null;
|
|
118
|
+
return Math.max(...["left", "top", "right", "bottom"].map((side) => Math.abs(rect[side] - expected[side])));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Everything drawn and what it stands for, the frames and the recent events (plain data). */
|
|
122
|
+
export function snapshot() {
|
|
123
|
+
const overlays = [];
|
|
124
|
+
for (const node of document.querySelectorAll(`[${MARK}]`)) {
|
|
125
|
+
const entry = owners.get(node);
|
|
126
|
+
const rect = node.getBoundingClientRect();
|
|
127
|
+
const shown = !node.hidden && rect.width > 0 && rect.height > 0;
|
|
128
|
+
let expected = null;
|
|
129
|
+
try {
|
|
130
|
+
expected = entry?.expected?.() ?? null;
|
|
131
|
+
} catch {}
|
|
132
|
+
let alive = null;
|
|
133
|
+
try {
|
|
134
|
+
alive = entry ? Boolean(entry.alive()) : null;
|
|
135
|
+
} catch {}
|
|
136
|
+
overlays.push({
|
|
137
|
+
class: node.className,
|
|
138
|
+
kind: entry?.kind ?? null,
|
|
139
|
+
shown,
|
|
140
|
+
rect: rounded(rect),
|
|
141
|
+
owner: describe(entry?.owner),
|
|
142
|
+
ownerOnPage: entry?.owner ? Boolean(entry.owner.isConnected) : null,
|
|
143
|
+
alive,
|
|
144
|
+
expected: rounded(expected),
|
|
145
|
+
offBy: shown ? offBy(rect, expected) : null,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
const state = {};
|
|
149
|
+
for (const [name, provider] of providers) {
|
|
150
|
+
try {
|
|
151
|
+
state[name] = provider();
|
|
152
|
+
} catch (error) {
|
|
153
|
+
state[name] = `unavailable: ${error.message}`;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return { time: Math.round(performance.now()), scroll: { x: Math.round(scrollX), y: Math.round(scrollY) }, overlays, ...state, errors: [...errors], events: [...events] };
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The overlays standing for nothing, removed (a bug: said once, with the snapshot). Returns how
|
|
161
|
+
* many there were.
|
|
162
|
+
*/
|
|
163
|
+
export function audit() {
|
|
164
|
+
if (!unknown && arrived(arrivals.takeRecords())) stopWatching();
|
|
165
|
+
if (unknown) {
|
|
166
|
+
owned.clear();
|
|
167
|
+
for (const node of document.querySelectorAll(`[${MARK}]`)) owned.add(node);
|
|
168
|
+
unknown = false;
|
|
169
|
+
arrivals ??= new MutationObserver((records) => {
|
|
170
|
+
if (arrived(records)) stopWatching();
|
|
171
|
+
});
|
|
172
|
+
arrivals.observe(document.documentElement, { childList: true, subtree: true });
|
|
173
|
+
}
|
|
174
|
+
const strays = [...owned].filter((node) => {
|
|
175
|
+
// Off the page (what puts it back is an arrival), or no longer marked (annotate/ unmarks its
|
|
176
|
+
// markers as they fade out, standing for nothing): not the audit's.
|
|
177
|
+
if (!node.isConnected || !node.hasAttribute(MARK)) {
|
|
178
|
+
owned.delete(node);
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
const entry = owners.get(node);
|
|
182
|
+
try {
|
|
183
|
+
return !entry || !entry.alive();
|
|
184
|
+
} catch {
|
|
185
|
+
return true;
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
if (strays.length === 0) {
|
|
189
|
+
lastStray = "";
|
|
190
|
+
return 0;
|
|
191
|
+
}
|
|
192
|
+
const key = strays.map((node) => `${node.className}:${describe(owners.get(node)?.owner)}`).join(" | ");
|
|
193
|
+
if (key !== lastStray) {
|
|
194
|
+
lastStray = key;
|
|
195
|
+
note("stray", key);
|
|
196
|
+
console.error("[gallery] overlay standing for nothing (removed):", key, snapshot());
|
|
197
|
+
}
|
|
198
|
+
strays.forEach((node) => {
|
|
199
|
+
node.remove();
|
|
200
|
+
owned.delete(node);
|
|
201
|
+
});
|
|
202
|
+
return strays.length;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
globalThis.__galleryOverlays = snapshot;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isInkClass } from "./marks.mjs";
|
|
2
|
+
import { TAB } from "../components/paragraph/index.mjs";
|
|
3
|
+
|
|
4
|
+
// Inline elements of the report's own (docs/editor.md, "In-place text editing"): a phrasing element
|
|
5
|
+
// the editor has no format for (a span with a class, style or attribute of the report's own: a
|
|
6
|
+
// number badge in a heading, a citation in a cell; a cite, a small, an abbr…), and a format bar's tag
|
|
7
|
+
// that carries attributes of its own and holds no words (a drawn arrow, <i class="arr-r"></i>). In a
|
|
8
|
+
// text block it is an atom, as an inline formula is: shown and written back as the file has it, its
|
|
9
|
+
// words not edited, the words around it editable. Judged from an element's tag, its attributes as the
|
|
10
|
+
// file writes them and whether it holds words, so that the scanner's parse5 nodes (source/blocks.mjs)
|
|
11
|
+
// and the page's elements (core.mjs) are judged alike. Not the editor's own: a text color or
|
|
12
|
+
// highlight (the kit's classes alone), small text's end part, a formula, a link.
|
|
13
|
+
|
|
14
|
+
const PHRASING = new Set([
|
|
15
|
+
"span", "abbr", "cite", "dfn", "small", "mark", "q", "time", "data", "bdi", "bdo", "kbd", "samp", "var",
|
|
16
|
+
"ins", "del", "strike", "font", "big", "tt", "nobr", "acronym",
|
|
17
|
+
]);
|
|
18
|
+
const FORMATS = new Set(["strong", "em", "b", "i", "u", "s", "code", "sup", "sub"]);
|
|
19
|
+
|
|
20
|
+
/** `attributes`: [{ name, value }] as the file writes them; `words`: whether it holds any. */
|
|
21
|
+
export function ownInline(tag, attributes, words) {
|
|
22
|
+
if (FORMATS.has(tag)) return attributes.length > 0 && !words;
|
|
23
|
+
if (!PHRASING.has(tag)) return false;
|
|
24
|
+
if (tag !== "span") return true;
|
|
25
|
+
const classes = attributes.length === 1 && attributes[0].name === "class" ? attributes[0].value.trim().split(/\s+/).filter(Boolean) : null;
|
|
26
|
+
if (classes?.length > 0 && (classes.every(isInkClass) || classes.join(" ") === TAB)) return false;
|
|
27
|
+
return !attributes.some(({ name, value }) => name === "class" && value.split(/\s+/).includes("doc-math-inline"));
|
|
28
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { select } from "./caret.mjs";
|
|
2
|
+
import { holdsNothing } from "./marks.mjs";
|
|
3
|
+
import { ZWSP } from "../../shared/inline-spacing.mjs";
|
|
4
|
+
|
|
5
|
+
// Zero-width pads: a text node holding nothing but a zero-width space where the browser would not
|
|
6
|
+
// keep the caret, so that what is typed there lands on the side the reader chose: after a mark a
|
|
7
|
+
// Markdown shortcut made (typed text would go into it, markdown/), outside after inline code or
|
|
8
|
+
// inside at its start (typing/code-edges.mjs). Text typed into a pad stays there and the space
|
|
9
|
+
// goes (settlePads); a pad the caret left empty goes. A text node holding nothing but the space is
|
|
10
|
+
// never saved (core.mjs serializeNode).
|
|
11
|
+
|
|
12
|
+
const pads = new Set();
|
|
13
|
+
|
|
14
|
+
/** Whether `node` is a text node holding nothing but the zero-width space. */
|
|
15
|
+
export const isPad = (node) => node?.nodeType === 3 && node.data === ZWSP;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The caret in a pad `where` `node` is ("after" or "before" it, or "start": inside it, first),
|
|
19
|
+
* after its space; one already there is used again.
|
|
20
|
+
*/
|
|
21
|
+
export function padCaret(node, where) {
|
|
22
|
+
let pad = where === "start" ? node.firstChild : where === "after" ? node.nextSibling : node.previousSibling;
|
|
23
|
+
if (!isPad(pad)) {
|
|
24
|
+
pad = node.ownerDocument.createTextNode(ZWSP);
|
|
25
|
+
if (where === "start") node.prepend(pad);
|
|
26
|
+
else if (where === "after") node.after(pad);
|
|
27
|
+
else node.before(pad);
|
|
28
|
+
}
|
|
29
|
+
pads.add(pad);
|
|
30
|
+
const caret = node.ownerDocument.createRange();
|
|
31
|
+
caret.setStart(pad, 1);
|
|
32
|
+
caret.collapse(true);
|
|
33
|
+
select(caret);
|
|
34
|
+
return pad;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Text arrived in a pad: the space goes, the caret staying after the text. `left` (the selection
|
|
39
|
+
* moved): a pad still empty goes unless the caret is in it.
|
|
40
|
+
*/
|
|
41
|
+
export function settlePads(left = false) {
|
|
42
|
+
const selection = getSelection();
|
|
43
|
+
for (const pad of [...pads]) {
|
|
44
|
+
if (!pad.isConnected) {
|
|
45
|
+
pads.delete(pad);
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const inside = selection.rangeCount > 0 && selection.anchorNode === pad;
|
|
49
|
+
if (pad.data === ZWSP) {
|
|
50
|
+
if (left && !inside) {
|
|
51
|
+
pads.delete(pad);
|
|
52
|
+
const parent = pad.parentElement;
|
|
53
|
+
pad.remove();
|
|
54
|
+
// Inline code that held nothing but the pad (its text deleted, the caret gone) goes too: it
|
|
55
|
+
// would stay drawn as an empty box.
|
|
56
|
+
if (parent?.tagName === "CODE" && holdsNothing(parent)) parent.remove();
|
|
57
|
+
}
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
pads.delete(pad);
|
|
61
|
+
const at = pad.data.indexOf(ZWSP);
|
|
62
|
+
if (at < 0) continue;
|
|
63
|
+
const offset = inside ? selection.anchorOffset : null;
|
|
64
|
+
pad.deleteData(at, 1);
|
|
65
|
+
if (offset !== null) {
|
|
66
|
+
const caret = pad.ownerDocument.createRange();
|
|
67
|
+
caret.setStart(pad, Math.max(0, offset - (offset > at ? 1 : 0)));
|
|
68
|
+
select(caret);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { HOST_COMPONENT, TYPE_COMPONENT, TYPE_INFO, UNIT_COMPONENT, canHaveChildren, ownerOf, textFilters } from "../components/registry.mjs";
|
|
2
|
+
|
|
3
|
+
// The components' page objects (components/pages.mjs) for the engines that are handed no `ctx` of
|
|
4
|
+
// their own: the editor gives them here once it has made them, and what a type needs of the page is
|
|
5
|
+
// asked of its component.
|
|
6
|
+
let pages = {};
|
|
7
|
+
|
|
8
|
+
/** Hand the engines the page objects. */
|
|
9
|
+
export function connectPages(given) {
|
|
10
|
+
pages = given;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Whether what happens on `node` is a component's own, the editor letting go of it (`keepsKeys`: its keys, the clipboard, a press that would draw a selection). `event`: the key, where one is asked about. */
|
|
14
|
+
export const keptByComponent = (node, event = null) => pageObjects().some((page) => page.keepsKeys?.(node, event));
|
|
15
|
+
|
|
16
|
+
/** The page object of the component a block type is of, if it has one. */
|
|
17
|
+
export const pageOfType = (type) => pages[TYPE_COMPONENT[type]];
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A key of a menu of blocks (notion-lite's menuEntry): a type, or "type:variant", another entry of the
|
|
21
|
+
* type a page object says (`menuVariants`: { label, icon, words, preview?, sample?, create(what) },
|
|
22
|
+
* `sample` where the words a new one holds are there to be typed over): { type, variant (null when it
|
|
23
|
+
* names none, or none there is), named }.
|
|
24
|
+
*/
|
|
25
|
+
export function menuEntry(key) {
|
|
26
|
+
const [type, ...rest] = String(key).split(":");
|
|
27
|
+
const name = rest.join(":");
|
|
28
|
+
return { type, variant: name ? pageOfType(type)?.menuVariants?.()[name] ?? null : null, named: Boolean(name) };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** The row of a key of a menu of blocks: its type's, or its variant's; null for neither. */
|
|
32
|
+
export const menuRow = (key) => TYPE_INFO[key] ?? menuEntry(key).variant;
|
|
33
|
+
|
|
34
|
+
/** The keys of every variant there is now. */
|
|
35
|
+
export const variantKeys = () => Object.keys(TYPE_COMPONENT).flatMap((type) => Object.keys(pageOfType(type)?.menuVariants?.() ?? {}).map((name) => `${type}:${name}`));
|
|
36
|
+
|
|
37
|
+
/** The page objects, in the order they are made. */
|
|
38
|
+
export const pageObjects = () => Object.values(pages);
|
|
39
|
+
|
|
40
|
+
/** The page object with an editor open over the page (`panel`), if any. */
|
|
41
|
+
export const panelOpen = () => pageObjects().find((page) => page.panel) ?? null;
|
|
42
|
+
|
|
43
|
+
/** The text field outside the page's text blocks being edited (`field`: a tab's name), or null. */
|
|
44
|
+
export const fieldOpen = () => pageObjects().map((page) => page.field).find(Boolean) ?? null;
|
|
45
|
+
|
|
46
|
+
/** What the block tools do with rows of columns (`columnOps`, notion-lite's), of whichever page object says, or null. */
|
|
47
|
+
export const columnOps = () => pageObjects().find((page) => page.columnOps)?.columnOps ?? null;
|
|
48
|
+
|
|
49
|
+
/** What the block tools do with sections (`sectionOps`), of whichever page object says, or null. */
|
|
50
|
+
export const sectionOps = () => pageObjects().find((page) => page.sectionOps)?.sectionOps ?? null;
|
|
51
|
+
|
|
52
|
+
/** What the gaps between blocks in a row resize (`rowOps`), of whichever page object says, or null. */
|
|
53
|
+
export const rowOps = () => pageObjects().find((page) => page.rowOps)?.rowOps ?? null;
|
|
54
|
+
|
|
55
|
+
// With no component that says `modalOps`, nothing stands over the page.
|
|
56
|
+
const NO_MODALS = { open: () => [], listen() {}, closeTop: () => false, show: () => null, kept: () => [], reopen() {} };
|
|
57
|
+
|
|
58
|
+
/** What stands open over the page as a modal (`modalOps`), of whichever page object says. */
|
|
59
|
+
export const modalOps = () => pageObjects().find((page) => page.modalOps)?.modalOps ?? NO_MODALS;
|
|
60
|
+
|
|
61
|
+
/** The page's own icon, as the page shows it (`pageIcon`), or null. */
|
|
62
|
+
export const pageIcon = () => pageObjects().map((page) => page.pageIcon?.()).find(Boolean) ?? null;
|
|
63
|
+
|
|
64
|
+
/** The page object of the component that defines a kind of text block. */
|
|
65
|
+
export const pageOfHost = (kind) => pages[HOST_COMPONENT[kind]];
|
|
66
|
+
|
|
67
|
+
/** The page object of the component a kind of unit is of, if it has one. */
|
|
68
|
+
export const pageOfKind = (kind) => pages[UNIT_COMPONENT[kind]];
|
|
69
|
+
|
|
70
|
+
/** The page object of the component a block is of, by the kind of unit it is (`menuItems`, `menu`), if it has one. */
|
|
71
|
+
export const pageOfUnit = (unit) => pageOfKind(unit.getAttribute("data-ge-unit-kind"));
|
|
72
|
+
|
|
73
|
+
/** The row of the block menu a page object has for a block of another component (`rowBeside`), the first that has one, or null. */
|
|
74
|
+
export const rowBeside = (target) => pageObjects().map((page) => page.rowBeside?.(target)).find(Boolean) ?? null;
|
|
75
|
+
|
|
76
|
+
/** The page object of the component a text block is of, or none (`keys`). */
|
|
77
|
+
export const pageOf = (host) => pages[ownerOf(host)];
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* What stands around a text block, nearest first, each once and its own component none of them: the
|
|
81
|
+
* block before it where that says `canHaveChildren`, then what it stands in, from where it stands out.
|
|
82
|
+
*/
|
|
83
|
+
export function pagesAround(host) {
|
|
84
|
+
const before = host.previousElementSibling;
|
|
85
|
+
const around = before && canHaveChildren(before) ? [before] : [];
|
|
86
|
+
for (let node = host.parentElement; node; node = node.parentElement) around.push(node);
|
|
87
|
+
const own = pageOf(host);
|
|
88
|
+
return [...new Set(around.map(pageOf))].filter((page) => page && page !== own);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** The page object of what a press or a click came down on: of the component of the nearest element around it that is of one. */
|
|
92
|
+
export function pageAt(target) {
|
|
93
|
+
for (let node = target; node?.nodeType === 1; node = node.parentElement) {
|
|
94
|
+
const owner = ownerOf(node);
|
|
95
|
+
if (owner) return pages[owner];
|
|
96
|
+
}
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Text put in a text block that takes it as it is (`textFilters`), by its component's `type`. Whether it took it. */
|
|
101
|
+
export function typedAsIs(host, text) {
|
|
102
|
+
const page = textFilters(host) ? null : pageOf(host);
|
|
103
|
+
page?.type?.(host, text);
|
|
104
|
+
return Boolean(page?.type);
|
|
105
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Z } from "../../shared/layers.mjs";
|
|
2
|
+
|
|
3
|
+
// The editor's one bottom panel: the conflicts' (conflicts.mjs, left) and the lost texts' (notices.mjs,
|
|
4
|
+
// right) are the same card: a small muted head with a red dot, items under it, the reader's words as
|
|
5
|
+
// a quote, one filled primary button, the rest outlined or, looking only, quiet text. No notice covers
|
|
6
|
+
// one: while one stands, the toast stands above it (notices.mjs, and the workbench's, told the room).
|
|
7
|
+
|
|
8
|
+
const PANELS = ".ge-conflicts:not([hidden]), .ge-panel";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* How far from the window's bottom the highest bottom panel shown reaches, 0 with none shown: what a
|
|
12
|
+
* notice stands above.
|
|
13
|
+
*/
|
|
14
|
+
export function panelRoom() {
|
|
15
|
+
let room = 0;
|
|
16
|
+
for (const panel of document.querySelectorAll(PANELS)) {
|
|
17
|
+
const { top, height } = panel.getBoundingClientRect();
|
|
18
|
+
if (height > 0) room = Math.max(room, Math.round(innerHeight - top));
|
|
19
|
+
}
|
|
20
|
+
return room;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Who hears that the room the panels take may have changed: as a panel comes, changes size (cards
|
|
24
|
+
// added or answered), is hidden (收起) and goes.
|
|
25
|
+
const hearing = new Set();
|
|
26
|
+
const told = () => hearing.forEach((listener) => listener());
|
|
27
|
+
const sizes = typeof ResizeObserver === "function" ? new ResizeObserver(told) : null;
|
|
28
|
+
|
|
29
|
+
/** `listener` told whenever the room the bottom panels take may have changed. */
|
|
30
|
+
export const onPanels = (listener) => hearing.add(listener);
|
|
31
|
+
|
|
32
|
+
/** A bottom panel put on the page. */
|
|
33
|
+
export function panelShown(panel) {
|
|
34
|
+
sizes?.observe(panel);
|
|
35
|
+
told();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** A bottom panel taken off the page. */
|
|
39
|
+
export function panelGone(panel) {
|
|
40
|
+
sizes?.unobserve(panel);
|
|
41
|
+
told();
|
|
42
|
+
}
|
|
43
|
+
export const PANEL_STYLE = `
|
|
44
|
+
:is(.ge-conflicts, .ge-panel) { position: fixed; bottom: 16px; z-index: ${Z.panel}; box-sizing: border-box; width: min(400px, calc(100vw - 32px)); max-height: min(70vh, 600px); overflow: auto; border-radius: 10px; background: var(--ge-bg); color: var(--ge-tx); box-shadow: var(--ge-shadow); font: 13px/1.55 var(--doc-font, system-ui, sans-serif); }
|
|
45
|
+
.ge-conflicts { left: 16px; }
|
|
46
|
+
.ge-panel { right: 16px; }
|
|
47
|
+
.ge-conflicts[hidden] { display: none; }
|
|
48
|
+
:is(.ge-conflicts-head, .ge-panel-head) { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 10px 10px 4px 14px; background: var(--ge-bg); color: var(--ge-tx2); font-size: 12px; font-weight: 500; }
|
|
49
|
+
:is(.ge-conflicts-head, .ge-panel-head)::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ge-red); }
|
|
50
|
+
:is(.ge-conflicts-head, .ge-panel-head) span { flex: 1; }
|
|
51
|
+
:is(.ge-conflict, .ge-panel-item) { padding: 10px 14px 12px; }
|
|
52
|
+
:is(.ge-conflict, .ge-panel-item) + :is(.ge-conflict, .ge-panel-item) { border-top: 1px solid var(--ge-edge); }
|
|
53
|
+
:is(.ge-conflict, .ge-panel-item) p { margin: 0; font-weight: 500; }
|
|
54
|
+
:is(.ge-conflict, .ge-panel-item) p + .ge-version { margin-top: 6px; }
|
|
55
|
+
:is(.ge-conflicts, .ge-panel) .ge-version { margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--ge-quote); overflow-wrap: anywhere; }
|
|
56
|
+
:is(.ge-conflicts, .ge-panel) .ge-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
|
|
57
|
+
:is(.ge-conflicts, .ge-panel) button { height: 28px; padding: 0 10px; border: 1px solid var(--ge-edge); border-radius: 6px; background: transparent; color: inherit; font: inherit; font-weight: 500; white-space: nowrap; cursor: pointer; }
|
|
58
|
+
:is(.ge-conflicts, .ge-panel) button:hover:not(:disabled) { background: var(--ge-hover); }
|
|
59
|
+
:is(.ge-conflicts, .ge-panel) button[data-primary] { border-color: transparent; background: var(--ge-accent); color: #fff; }
|
|
60
|
+
:is(.ge-conflicts, .ge-panel) button[data-primary]:hover:not(:disabled) { background: var(--ge-accent-hover); }
|
|
61
|
+
:is(.ge-conflicts, .ge-panel) button[data-quiet] { height: 24px; padding: 0 6px; border-color: transparent; color: var(--ge-tx2); font-weight: 400; }
|
|
62
|
+
:is(.ge-conflicts, .ge-panel) button[data-quiet]:hover:not(:disabled) { color: var(--ge-tx); background: transparent; }
|
|
63
|
+
:is(.ge-conflicts, .ge-panel) button:disabled { opacity: .45; cursor: default; }
|
|
64
|
+
`;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Where a card or panel that stands by something stands: notion-lite's ui/popup.js rule (an origin, a
|
|
2
|
+
// side, an alignment and a gap; put on the other side where it does not fit; kept inside the window),
|
|
3
|
+
// the one placement every such card here takes: the link card, the formula editor, the cell bar, the
|
|
4
|
+
// format bar, the tooltips and the icon picker's popups (emoji-picker/support.mjs). The block menu
|
|
5
|
+
// (menu.mjs place) and what follows the pointer (hints, the size label of resize/) have rules of
|
|
6
|
+
// their own. What stands for text (the format bar, a pasted address's 选择视图) stands by its last
|
|
7
|
+
// character: textAnchor, besideText.
|
|
8
|
+
|
|
9
|
+
const TEXT_GAP_X = 4; // its corner this far right of the text's last character
|
|
10
|
+
const TEXT_GAP_Y = 8; // and this far below its line (or above the text)
|
|
11
|
+
const TEXT_MARGIN = 12; // this far inside the window at the most
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The left and top (window px, not rounded) of a box of `size` ({ width, height }) by `origin` (a
|
|
15
|
+
* rect), `margin` px inside the window at the most. placement: "bottom" or "top" (below or above
|
|
16
|
+
* the origin), "right" or "left" (beside it); a box that does not fit on the side asked for goes to
|
|
17
|
+
* the opposite one if it fits there (if it fits on neither, it stays on the one asked for), inside the
|
|
18
|
+
* window less its scrollbars. align:
|
|
19
|
+
* along that side, the box's "start", "center" or "end" with the origin's. gap: px between them. x:
|
|
20
|
+
* for "bottom" and "top", where the box's left edge is wanted in place of the alignment's (the format
|
|
21
|
+
* bar stands at the selection's last character).
|
|
22
|
+
*/
|
|
23
|
+
export function placeBox(origin, { width, height }, { placement = "bottom", align = "start", gap = 0, margin = 8, x } = {}) {
|
|
24
|
+
// The window less its scrollbars (a box kept inside innerWidth would run under the page's scrollbar).
|
|
25
|
+
const root = globalThis.document?.documentElement;
|
|
26
|
+
const innerWidth = root?.clientWidth || globalThis.innerWidth;
|
|
27
|
+
const innerHeight = root?.clientHeight || globalThis.innerHeight;
|
|
28
|
+
const clamp = (value, space) => Math.max(margin, Math.min(value, space - margin));
|
|
29
|
+
const alignX = () => x ?? (align === "center" ? origin.left + origin.width / 2 - width / 2 : align === "end" ? origin.right - width : origin.left);
|
|
30
|
+
const alignY = () => (align === "center" ? origin.top + origin.height / 2 - height / 2 : align === "end" ? origin.bottom - height : origin.top);
|
|
31
|
+
if (placement === "bottom" || placement === "top") {
|
|
32
|
+
const below = origin.bottom + gap;
|
|
33
|
+
const above = origin.top - gap - height;
|
|
34
|
+
const fitsBelow = below + height <= innerHeight - margin;
|
|
35
|
+
const fitsAbove = above >= margin;
|
|
36
|
+
const top = placement === "bottom" ? (fitsBelow || !fitsAbove ? below : above) : (fitsAbove || !fitsBelow ? above : below);
|
|
37
|
+
return { left: clamp(alignX(), innerWidth - width), top: clamp(top, innerHeight - height) };
|
|
38
|
+
}
|
|
39
|
+
const right = origin.right + gap;
|
|
40
|
+
const beyond = origin.left - gap - width;
|
|
41
|
+
const fitsRight = right + width <= innerWidth - margin;
|
|
42
|
+
const fitsLeft = beyond >= margin;
|
|
43
|
+
const left = placement === "right" ? (fitsRight || !fitsLeft ? right : beyond) : (fitsLeft || !fitsRight ? beyond : right);
|
|
44
|
+
return { left: clamp(left, innerWidth - width), top: clamp(alignY(), innerHeight - height) };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Where text (a range) is to what stands for it: its last character (its last piece of a line), not
|
|
49
|
+
* the right edge of its widest line, and the top of its first line, for when there is no room below.
|
|
50
|
+
*/
|
|
51
|
+
export function textAnchor(range) {
|
|
52
|
+
const box = range.getBoundingClientRect();
|
|
53
|
+
const end = [...range.getClientRects()].filter((rect) => rect.width > 0 && rect.height > 0).at(-1) ?? box;
|
|
54
|
+
return { right: end.right, bottom: end.bottom, top: box.top };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** The left and top of a box of `size` standing for text (`anchor`: textAnchor): below and right of its last character, above its first line when it does not fit below. */
|
|
58
|
+
export const besideText = (anchor, size) => placeBox(anchor, size, { x: anchor.right + TEXT_GAP_X, gap: TEXT_GAP_Y, margin: TEXT_MARGIN });
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { t, told } from "../../shared/i18n/index.mjs";
|
|
2
|
+
// The page's one way to talk to the preview server: a POST of JSON with the report's token
|
|
3
|
+
// (postJson: the request, a network error rejecting as fetch does; postAnswer: its answer read, a
|
|
4
|
+
// failure an answer too, what the editor's requests use), and what goes over it: what a refusal
|
|
5
|
+
// says (failure) and how an upload carries a file (blobBase64).
|
|
6
|
+
|
|
7
|
+
/** POST `body` as JSON to `route` with `token` (the map's); resolves with the Response. */
|
|
8
|
+
export const postJson = (route, token, body, { keepalive = false } = {}) => fetch(route, {
|
|
9
|
+
method: "POST",
|
|
10
|
+
headers: { "Content-Type": "application/json", "X-Gallery-Token": token },
|
|
11
|
+
body: JSON.stringify(body),
|
|
12
|
+
keepalive,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* POST `body` as JSON to `route` and read the answer, never throwing: a server that cannot be
|
|
17
|
+
* reached answers `{ ok: false, reason: "offline" }`, one that answers with no JSON `{ ok: false }`.
|
|
18
|
+
*/
|
|
19
|
+
export async function postAnswer(route, token, body) {
|
|
20
|
+
let response;
|
|
21
|
+
try {
|
|
22
|
+
response = await postJson(route, token, body);
|
|
23
|
+
} catch {
|
|
24
|
+
return { ok: false, reason: "offline" };
|
|
25
|
+
}
|
|
26
|
+
return response.json().catch(() => ({ ok: false }));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* What a refused request says: the server's own words in the UI's language (told: its template with its
|
|
31
|
+
* values, or its whole message), else that it could not be reached, else `fallback`.
|
|
32
|
+
*/
|
|
33
|
+
export const failure = (answer, fallback) => told(answer) ?? (answer.reason === "offline" ? t("连不上本地服务") : fallback);
|
|
34
|
+
|
|
35
|
+
/** A blob's bytes as base64, how an upload carries them. */
|
|
36
|
+
export const blobBase64 = (blob) => new Promise((resolve, reject) => {
|
|
37
|
+
const reader = new FileReader();
|
|
38
|
+
reader.onload = () => resolve(String(reader.result).split(",")[1]);
|
|
39
|
+
reader.onerror = () => reject(reader.error);
|
|
40
|
+
reader.readAsDataURL(blob);
|
|
41
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { t } from "../../shared/i18n/index.mjs";
|
|
2
|
+
import { addressOn, elsewhere, fromFile, isPageAddress, mayBePage, pageAddress, workbenchHash } from "../../shared/page-address.mjs";
|
|
3
|
+
import { inTrash, linkedPages, pageLinks } from "../../shared/page-links.mjs";
|
|
4
|
+
import { PROTOCOL, VERSION } from "../../shared/session.mjs";
|
|
5
|
+
|
|
6
|
+
// The links of a page shown in 演示视图 (?present: src/server/routes.mjs), which has no editor and whose
|
|
7
|
+
// frame the presentation holds (src/workbench/app/features/present/). A link to a document or a block
|
|
8
|
+
// of one goes there in the frame and stays a reader's: its page with ?present, the block found by the
|
|
9
|
+
// kit (kit/runtime/reveal.js); followed as it stands it would come to the document's page with the
|
|
10
|
+
// editor on it, and a web address would take the frame away from the presentation, so that goes to
|
|
11
|
+
// a new tab. An address of this computer is asked of the list as the click is taken, for only the
|
|
12
|
+
// list knows the titles and what is gone: a document that is not there leaves the presentation where
|
|
13
|
+
// it is, with a word through it (the workbench's notice), and on another port what the list does not
|
|
14
|
+
// hold (addressOn) is another program's, a web address like any. What the kit or the browser does with
|
|
15
|
+
// a click stays theirs: an anchor, a link to save, a link of a target of its own, any click with a key
|
|
16
|
+
// held.
|
|
17
|
+
|
|
18
|
+
const own = pageAddress(location.href)?.slug ?? null;
|
|
19
|
+
const openTab = (address) => window.open(address, "_blank", "noopener");
|
|
20
|
+
const read = (route) => fetch(`/__gallery/workspace/${route}`).then((answer) => answer.json()).catch(() => null);
|
|
21
|
+
|
|
22
|
+
function go({ slug, block }) {
|
|
23
|
+
const fragment = block ? `#${encodeURIComponent(block)}` : "";
|
|
24
|
+
if (slug !== own) location.assign(`/generated/${slug}.html?present${fragment}`);
|
|
25
|
+
else if (block) dispatchEvent(new CustomEvent("doc-jump-request", { detail: { hash: fragment } })); // the kit's jump, a step of the history as a link #<block id> is
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function sayGone(name, { trash = [] } = {}) {
|
|
29
|
+
const text = inTrash(trash, name) ? t("这个页面已删除。") : t("没有找到这个页面。");
|
|
30
|
+
window.parent.postMessage({ protocol: PROTOCOL, v: VERSION, type: "notice", slug: own, text }, location.origin);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async function follow(address) {
|
|
34
|
+
if (!mayBePage(address)) return void openTab(address);
|
|
35
|
+
const listed = await read("outline");
|
|
36
|
+
const place = addressOn(address, listed?.reports ? pageLinks(linkedPages(listed.reports)) : null, location.origin);
|
|
37
|
+
if (place) go(place);
|
|
38
|
+
else if (isPageAddress(address) && !elsewhere(address, location.origin)) sayGone(pageAddress(address)?.slug ?? workbenchHash(address), listed ?? undefined);
|
|
39
|
+
else openTab(address);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
document.addEventListener("click", (event) => {
|
|
43
|
+
if (event.defaultPrevented || event.button !== 0 || event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) return;
|
|
44
|
+
const link = event.target.closest?.("a[*|href]");
|
|
45
|
+
if (!link || link.matches("[download], [target], [*|href^='#']")) return;
|
|
46
|
+
const address = fromFile(link.href.baseVal ?? link.getAttribute("href"), own, location.origin);
|
|
47
|
+
if (!address || !/^https?:/.test(address)) return;
|
|
48
|
+
event.preventDefault();
|
|
49
|
+
follow(address);
|
|
50
|
+
});
|