@heycys/gallery 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/THIRD-PARTY-NOTICES.md +3303 -0
- package/assets/writing-preferences.md +107 -0
- package/bin/gallery.mjs +10 -0
- package/browser/editor/components/bookmark/icons.mjs +6 -0
- package/browser/editor/components/bookmark/index.mjs +80 -0
- package/browser/editor/components/bookmark/page.mjs +147 -0
- package/browser/editor/components/builders.mjs +19 -0
- package/browser/editor/components/callout/index.mjs +64 -0
- package/browser/editor/components/code/index.mjs +327 -0
- package/browser/editor/components/code/page.mjs +561 -0
- package/browser/editor/components/colors.mjs +50 -0
- package/browser/editor/components/columns/index.mjs +104 -0
- package/browser/editor/components/columns/page.mjs +310 -0
- package/browser/editor/components/details/index.mjs +73 -0
- package/browser/editor/components/details/page.mjs +86 -0
- package/browser/editor/components/dialog/index.mjs +84 -0
- package/browser/editor/components/dialog/page.mjs +201 -0
- package/browser/editor/components/divider/index.mjs +48 -0
- package/browser/editor/components/embed/icons.mjs +11 -0
- package/browser/editor/components/embed/index.mjs +123 -0
- package/browser/editor/components/embed/page.mjs +309 -0
- package/browser/editor/components/figure/index.mjs +87 -0
- package/browser/editor/components/figure/page.mjs +42 -0
- package/browser/editor/components/file/icons.mjs +14 -0
- package/browser/editor/components/file/index.mjs +77 -0
- package/browser/editor/components/file/page.mjs +114 -0
- package/browser/editor/components/flowchart/add.mjs +123 -0
- package/browser/editor/components/flowchart/index.mjs +246 -0
- package/browser/editor/components/flowchart/page.mjs +453 -0
- package/browser/editor/components/heading/index.mjs +53 -0
- package/browser/editor/components/heading/page.mjs +6 -0
- package/browser/editor/components/highlight/index.mjs +63 -0
- package/browser/editor/components/icon/index.mjs +57 -0
- package/browser/editor/components/icon/page.mjs +286 -0
- package/browser/editor/components/icons.mjs +48 -0
- package/browser/editor/components/image/crop.mjs +189 -0
- package/browser/editor/components/image/index.mjs +104 -0
- package/browser/editor/components/image/page.mjs +385 -0
- package/browser/editor/components/image/viewer.mjs +213 -0
- package/browser/editor/components/installed/index.mjs +179 -0
- package/browser/editor/components/installed/page.mjs +523 -0
- package/browser/editor/components/installed/served.mjs +35 -0
- package/browser/editor/components/kit.mjs +67 -0
- package/browser/editor/components/list/index.mjs +194 -0
- package/browser/editor/components/list/join.mjs +68 -0
- package/browser/editor/components/list/numbers.mjs +107 -0
- package/browser/editor/components/list/page.mjs +632 -0
- package/browser/editor/components/math/index.mjs +88 -0
- package/browser/editor/components/math/page.mjs +236 -0
- package/browser/editor/components/math/tex-logo.mjs +6 -0
- package/browser/editor/components/media/icons.mjs +19 -0
- package/browser/editor/components/media/page.mjs +192 -0
- package/browser/editor/components/media/parts.mjs +60 -0
- package/browser/editor/components/media/size.mjs +20 -0
- package/browser/editor/components/media/toolbar.mjs +37 -0
- package/browser/editor/components/media/write.mjs +7 -0
- package/browser/editor/components/pages.mjs +46 -0
- package/browser/editor/components/paragraph/index.mjs +43 -0
- package/browser/editor/components/paragraph/page.mjs +52 -0
- package/browser/editor/components/placeholder-bar.mjs +17 -0
- package/browser/editor/components/placeholder.mjs +128 -0
- package/browser/editor/components/quote/index.mjs +33 -0
- package/browser/editor/components/registry.mjs +859 -0
- package/browser/editor/components/rows.mjs +16 -0
- package/browser/editor/components/section/index.mjs +42 -0
- package/browser/editor/components/section/page.mjs +141 -0
- package/browser/editor/components/set-apart.mjs +24 -0
- package/browser/editor/components/sheets/index.mjs +137 -0
- package/browser/editor/components/sheets/page.mjs +227 -0
- package/browser/editor/components/sheets/pills.mjs +226 -0
- package/browser/editor/components/table/grid.mjs +73 -0
- package/browser/editor/components/table/index.mjs +308 -0
- package/browser/editor/components/table/page.mjs +683 -0
- package/browser/editor/components/table/slots.mjs +41 -0
- package/browser/editor/components/widget/index.mjs +50 -0
- package/browser/editor/page/annotate/anchors.mjs +230 -0
- package/browser/editor/page/annotate/card.mjs +102 -0
- package/browser/editor/page/annotate/index.mjs +1656 -0
- package/browser/editor/page/at-menu/index.mjs +317 -0
- package/browser/editor/page/autosave.mjs +1023 -0
- package/browser/editor/page/beside.mjs +21 -0
- package/browser/editor/page/block-info.mjs +63 -0
- package/browser/editor/page/block-menu/colors.mjs +84 -0
- package/browser/editor/page/block-menu/index.mjs +217 -0
- package/browser/editor/page/blocks.mjs +255 -0
- package/browser/editor/page/caret.mjs +682 -0
- package/browser/editor/page/changes/bar.mjs +102 -0
- package/browser/editor/page/changes/ghost.mjs +206 -0
- package/browser/editor/page/changes/gone-words.mjs +94 -0
- package/browser/editor/page/changes/index.mjs +447 -0
- package/browser/editor/page/changes/words.mjs +27 -0
- package/browser/editor/page/chip-fills.mjs +126 -0
- package/browser/editor/page/clipboard/import/colors.mjs +192 -0
- package/browser/editor/page/clipboard/import/html.mjs +792 -0
- package/browser/editor/page/clipboard/import/inline.mjs +232 -0
- package/browser/editor/page/clipboard/import/languages.mjs +42 -0
- package/browser/editor/page/clipboard/import/markdown.mjs +760 -0
- package/browser/editor/page/clipboard/import/math.mjs +100 -0
- package/browser/editor/page/clipboard/import/office.mjs +245 -0
- package/browser/editor/page/clipboard/import/read.mjs +120 -0
- package/browser/editor/page/clipboard/import/rich.mjs +29 -0
- package/browser/editor/page/clipboard/import/to-blocks.mjs +290 -0
- package/browser/editor/page/clipboard/index.mjs +816 -0
- package/browser/editor/page/clipboard/own/blocks.mjs +211 -0
- package/browser/editor/page/clipboard/own/chart-keys.mjs +58 -0
- package/browser/editor/page/clipboard/own/describe.mjs +124 -0
- package/browser/editor/page/clipboard/own/export.mjs +167 -0
- package/browser/editor/page/clipboard/own/ids.mjs +39 -0
- package/browser/editor/page/clipboard/own/index.mjs +13 -0
- package/browser/editor/page/clipboard/own/rules.mjs +44 -0
- package/browser/editor/page/clipboard/own/selection.mjs +159 -0
- package/browser/editor/page/clipboard/own/writers.mjs +315 -0
- package/browser/editor/page/columns/index.mjs +360 -0
- package/browser/editor/page/commit.mjs +1813 -0
- package/browser/editor/page/conflicts.mjs +249 -0
- package/browser/editor/page/convert.mjs +831 -0
- package/browser/editor/page/core.mjs +1693 -0
- package/browser/editor/page/drag/drop.mjs +307 -0
- package/browser/editor/page/drag/index.mjs +351 -0
- package/browser/editor/page/drag/preview.mjs +126 -0
- package/browser/editor/page/edge-scroll.mjs +50 -0
- package/browser/editor/page/editor.mjs +1780 -0
- package/browser/editor/page/emoji-picker/emoji-tab.mjs +287 -0
- package/browser/editor/page/emoji-picker/glyph-html.mjs +26 -0
- package/browser/editor/page/emoji-picker/grid.mjs +81 -0
- package/browser/editor/page/emoji-picker/icon-tab.mjs +217 -0
- package/browser/editor/page/emoji-picker/icons.mjs +31 -0
- package/browser/editor/page/emoji-picker/index.mjs +166 -0
- package/browser/editor/page/emoji-picker/styles.mjs +161 -0
- package/browser/editor/page/emoji-picker/support.mjs +204 -0
- package/browser/editor/page/emoji-picker/upload.mjs +236 -0
- package/browser/editor/page/export-report.mjs +23 -0
- package/browser/editor/page/fills.mjs +62 -0
- package/browser/editor/page/find/index.mjs +107 -0
- package/browser/editor/page/flags.mjs +70 -0
- package/browser/editor/page/fold/index.mjs +348 -0
- package/browser/editor/page/fold/rule.mjs +125 -0
- package/browser/editor/page/folded.mjs +23 -0
- package/browser/editor/page/format-bar/bar.mjs +449 -0
- package/browser/editor/page/format-bar/brush.mjs +77 -0
- package/browser/editor/page/format-bar/colors.mjs +46 -0
- package/browser/editor/page/format-bar/index.mjs +404 -0
- package/browser/editor/page/formula/index.mjs +236 -0
- package/browser/editor/page/formula/panel.mjs +336 -0
- package/browser/editor/page/formula/symbols.mjs +156 -0
- package/browser/editor/page/frame.mjs +74 -0
- package/browser/editor/page/frames.mjs +196 -0
- package/browser/editor/page/geometry.mjs +402 -0
- package/browser/editor/page/gesture.mjs +45 -0
- package/browser/editor/page/handle/index.mjs +650 -0
- package/browser/editor/page/handle-sizes.mjs +14 -0
- package/browser/editor/page/hints/index.mjs +84 -0
- package/browser/editor/page/history.mjs +401 -0
- package/browser/editor/page/insert/index.mjs +256 -0
- package/browser/editor/page/kept.mjs +38 -0
- package/browser/editor/page/links/address.mjs +40 -0
- package/browser/editor/page/links/index.mjs +866 -0
- package/browser/editor/page/links/pages.mjs +131 -0
- package/browser/editor/page/links/views.mjs +369 -0
- package/browser/editor/page/long-runs.mjs +75 -0
- package/browser/editor/page/look.mjs +77 -0
- package/browser/editor/page/made.mjs +24 -0
- package/browser/editor/page/margin.mjs +373 -0
- package/browser/editor/page/markdown/index.mjs +88 -0
- package/browser/editor/page/markdown/rules.mjs +33 -0
- package/browser/editor/page/marks.mjs +377 -0
- package/browser/editor/page/media-menu/index.mjs +158 -0
- package/browser/editor/page/menu.mjs +544 -0
- package/browser/editor/page/merge.mjs +124 -0
- package/browser/editor/page/notices.mjs +142 -0
- package/browser/editor/page/offered.mjs +32 -0
- package/browser/editor/page/outline/folds.mjs +53 -0
- package/browser/editor/page/outline/index.mjs +783 -0
- package/browser/editor/page/outline/list.mjs +184 -0
- package/browser/editor/page/outline/read.mjs +201 -0
- package/browser/editor/page/outline/strip.mjs +287 -0
- package/browser/editor/page/outline/tree.mjs +248 -0
- package/browser/editor/page/overlay-layer.mjs +227 -0
- package/browser/editor/page/overlays.mjs +205 -0
- package/browser/editor/page/own.mjs +28 -0
- package/browser/editor/page/pads.mjs +71 -0
- package/browser/editor/page/page-objects.mjs +105 -0
- package/browser/editor/page/panel.mjs +65 -0
- package/browser/editor/page/placement.mjs +58 -0
- package/browser/editor/page/post.mjs +41 -0
- package/browser/editor/page/present-links.mjs +50 -0
- package/browser/editor/page/quiet.mjs +48 -0
- package/browser/editor/page/resize/index.mjs +327 -0
- package/browser/editor/page/select-all/index.mjs +262 -0
- package/browser/editor/page/selection/delete.mjs +61 -0
- package/browser/editor/page/selection/index.mjs +164 -0
- package/browser/editor/page/selection/marquee.mjs +174 -0
- package/browser/editor/page/session.mjs +168 -0
- package/browser/editor/page/slash-menu/index.mjs +291 -0
- package/browser/editor/page/storage.mjs +48 -0
- package/browser/editor/page/sync-state.mjs +267 -0
- package/browser/editor/page/table/aligns.mjs +29 -0
- package/browser/editor/page/table/cell-bar.mjs +141 -0
- package/browser/editor/page/table/cells.mjs +527 -0
- package/browser/editor/page/table/icons.mjs +40 -0
- package/browser/editor/page/table/index.mjs +990 -0
- package/browser/editor/page/table/lists.mjs +187 -0
- package/browser/editor/page/table/widths.mjs +313 -0
- package/browser/editor/page/tex.mjs +32 -0
- package/browser/editor/page/text-select/index.mjs +671 -0
- package/browser/editor/page/tooltip.mjs +98 -0
- package/browser/editor/page/type-grid.mjs +83 -0
- package/browser/editor/page/typing/code-edges.mjs +274 -0
- package/browser/editor/page/typing/index.mjs +282 -0
- package/browser/editor/page/typing/leave.mjs +68 -0
- package/browser/editor/page/ui.mjs +160 -0
- package/browser/shared/annotations.mjs +569 -0
- package/browser/shared/code-folds.mjs +14 -0
- package/browser/shared/code-languages.mjs +70 -0
- package/browser/shared/code-lines.mjs +30 -0
- package/browser/shared/colors.mjs +30 -0
- package/browser/shared/component-catalog.mjs +573 -0
- package/browser/shared/components/bookmark.mjs +26 -0
- package/browser/shared/components/callout.mjs +9 -0
- package/browser/shared/components/chart.mjs +20 -0
- package/browser/shared/components/code.mjs +37 -0
- package/browser/shared/components/columns.mjs +16 -0
- package/browser/shared/components/details.mjs +15 -0
- package/browser/shared/components/dialog.mjs +28 -0
- package/browser/shared/components/diff.mjs +18 -0
- package/browser/shared/components/divider.mjs +6 -0
- package/browser/shared/components/embed.mjs +25 -0
- package/browser/shared/components/figure.mjs +14 -0
- package/browser/shared/components/file.mjs +23 -0
- package/browser/shared/components/heading.mjs +6 -0
- package/browser/shared/components/highlight.mjs +9 -0
- package/browser/shared/components/icon.mjs +18 -0
- package/browser/shared/components/image.mjs +39 -0
- package/browser/shared/components/index.mjs +396 -0
- package/browser/shared/components/installed.mjs +232 -0
- package/browser/shared/components/list.mjs +146 -0
- package/browser/shared/components/math.mjs +49 -0
- package/browser/shared/components/mention.mjs +33 -0
- package/browser/shared/components/page.mjs +46 -0
- package/browser/shared/components/paragraph.mjs +9 -0
- package/browser/shared/components/quote.mjs +6 -0
- package/browser/shared/components/section.mjs +8 -0
- package/browser/shared/components/sheets.mjs +80 -0
- package/browser/shared/components/state.mjs +20 -0
- package/browser/shared/components/table.mjs +49 -0
- package/browser/shared/components/text.mjs +14 -0
- package/browser/shared/components/widget.mjs +10 -0
- package/browser/shared/copy-ids.mjs +72 -0
- package/browser/shared/css-references.mjs +110 -0
- package/browser/shared/document-look.mjs +178 -0
- package/browser/shared/emoji/custom.mjs +91 -0
- package/browser/shared/emoji/data/LICENSE-lucide.txt +43 -0
- package/browser/shared/emoji/data/LICENSE-mingcute.txt +202 -0
- package/browser/shared/emoji/data/LICENSE-tabler.txt +21 -0
- package/browser/shared/emoji/data/README.md +28 -0
- package/browser/shared/emoji/data/categories.json +1 -0
- package/browser/shared/emoji/data/icons.json +1 -0
- package/browser/shared/emoji/data/keywords-en.json +1 -0
- package/browser/shared/emoji/data/keywords-zh.json +1 -0
- package/browser/shared/emoji/data/names.json +1 -0
- package/browser/shared/emoji/data/positions.json +1 -0
- package/browser/shared/emoji/data/twemoji-index.json +1 -0
- package/browser/shared/emoji/data/twemoji-svg.bin +0 -0
- package/browser/shared/emoji/data.mjs +194 -0
- package/browser/shared/emoji/emoji.mjs +38 -0
- package/browser/shared/emoji/glyphs.mjs +134 -0
- package/browser/shared/emoji/icon-value.mjs +91 -0
- package/browser/shared/escape.mjs +20 -0
- package/browser/shared/export-wrap.mjs +89 -0
- package/browser/shared/files.mjs +33 -0
- package/browser/shared/html-tree.mjs +59 -0
- package/browser/shared/http.mjs +22 -0
- package/browser/shared/i18n/en.mjs +1223 -0
- package/browser/shared/i18n/index.mjs +132 -0
- package/browser/shared/ids.mjs +24 -0
- package/browser/shared/import-types.mjs +23 -0
- package/browser/shared/inline-spacing.mjs +97 -0
- package/browser/shared/layers.mjs +42 -0
- package/browser/shared/long-runs.mjs +39 -0
- package/browser/shared/media.mjs +162 -0
- package/browser/shared/new-names.mjs +67 -0
- package/browser/shared/number-reading.mjs +92 -0
- package/browser/shared/old-names.mjs +143 -0
- package/browser/shared/outline.mjs +194 -0
- package/browser/shared/page-address.mjs +140 -0
- package/browser/shared/page-links.mjs +86 -0
- package/browser/shared/paths.mjs +73 -0
- package/browser/shared/preferences.mjs +116 -0
- package/browser/shared/preview-server.mjs +247 -0
- package/browser/shared/qa-levels.mjs +93 -0
- package/browser/shared/reading-place.mjs +91 -0
- package/browser/shared/renamed-storage.mjs +220 -0
- package/browser/shared/reports.mjs +46 -0
- package/browser/shared/search.mjs +85 -0
- package/browser/shared/session.mjs +77 -0
- package/browser/shared/table-chart.mjs +113 -0
- package/browser/shared/table-hides.mjs +120 -0
- package/browser/shared/table-slots.mjs +75 -0
- package/browser/shared/words.mjs +23 -0
- package/browser/shared/workspace-look.mjs +91 -0
- package/browser/shared/workspace.mjs +535 -0
- package/browser/shared/writing-preferences.mjs +68 -0
- package/browser/shared/zoom.mjs +57 -0
- package/dist/chunk-2B5E4CDJ.mjs +2 -0
- package/dist/chunk-342HXE3Q.mjs +2 -0
- package/dist/chunk-3HIRPVLU.mjs +2 -0
- package/dist/chunk-43B75J5T.mjs +2 -0
- package/dist/chunk-4FS7Z7WR.mjs +2 -0
- package/dist/chunk-4K5KC6V2.mjs +2 -0
- package/dist/chunk-5L7RYZCL.mjs +2 -0
- package/dist/chunk-5MHMDLZD.mjs +4 -0
- package/dist/chunk-5ZKJ3H4P.mjs +8 -0
- package/dist/chunk-64K7IPLO.mjs +255 -0
- package/dist/chunk-6QXGZM36.mjs +8 -0
- package/dist/chunk-6RGJOMJP.mjs +16 -0
- package/dist/chunk-742D2WWJ.mjs +19 -0
- package/dist/chunk-7DTINW6U.mjs +48 -0
- package/dist/chunk-A55HN5OK.mjs +2 -0
- package/dist/chunk-AGDILNWB.mjs +2 -0
- package/dist/chunk-AJ73XJF3.mjs +2 -0
- package/dist/chunk-AUZGSZJH.mjs +13 -0
- package/dist/chunk-BFE45AKL.mjs +2 -0
- package/dist/chunk-BGGDRNYQ.mjs +10 -0
- package/dist/chunk-BXO2ZY5P.mjs +2 -0
- package/dist/chunk-C564NU2H.mjs +77 -0
- package/dist/chunk-CEH4MRCC.mjs +2 -0
- package/dist/chunk-CY2FNNAB.mjs +16 -0
- package/dist/chunk-DFUDV4LX.mjs +2 -0
- package/dist/chunk-DKXG4XDG.mjs +2 -0
- package/dist/chunk-E7LWZRXY.mjs +4 -0
- package/dist/chunk-EZQ34M3F.mjs +124 -0
- package/dist/chunk-EZY3WC6Z.mjs +15 -0
- package/dist/chunk-FDLXYYG4.mjs +4 -0
- package/dist/chunk-FUKQNOQS.mjs +9 -0
- package/dist/chunk-GB5SOYQJ.mjs +7 -0
- package/dist/chunk-GRAXKKG4.mjs +2 -0
- package/dist/chunk-HYMEEXKN.mjs +4 -0
- package/dist/chunk-IVDLMMBD.mjs +2 -0
- package/dist/chunk-JPOSLGOC.mjs +6 -0
- package/dist/chunk-JVHHHGEA.mjs +3 -0
- package/dist/chunk-L3QKH4OK.mjs +26 -0
- package/dist/chunk-LAE5NQ4B.mjs +2 -0
- package/dist/chunk-LCTHTZIL.mjs +960 -0
- package/dist/chunk-LEF6DRCK.mjs +59 -0
- package/dist/chunk-LKX55H76.mjs +2 -0
- package/dist/chunk-LS4F7JUM.mjs +2 -0
- package/dist/chunk-MAFIGVXY.mjs +2 -0
- package/dist/chunk-NO5NJCHO.mjs +2 -0
- package/dist/chunk-NQPVAU63.mjs +2 -0
- package/dist/chunk-NSKUTQ5J.mjs +5 -0
- package/dist/chunk-O35FIXRB.mjs +2 -0
- package/dist/chunk-P2CAZPDP.mjs +3 -0
- package/dist/chunk-PL6GHLGD.mjs +15 -0
- package/dist/chunk-QAIHRH3I.mjs +13 -0
- package/dist/chunk-QJIR2BLP.mjs +6 -0
- package/dist/chunk-QR6A54KJ.mjs +3 -0
- package/dist/chunk-QUPLVPB2.mjs +7 -0
- package/dist/chunk-R7BNENLY.mjs +4 -0
- package/dist/chunk-S6O4UHLC.mjs +2 -0
- package/dist/chunk-SGJWQKEI.mjs +2 -0
- package/dist/chunk-SYGN7GLU.mjs +2 -0
- package/dist/chunk-TMYZB6AV.mjs +2 -0
- package/dist/chunk-TX6JH7TR.mjs +2 -0
- package/dist/chunk-TYK6VNAB.mjs +10 -0
- package/dist/chunk-U3SSPL4K.mjs +8 -0
- package/dist/chunk-U6KNPJPR.mjs +2 -0
- package/dist/chunk-UALRNVSE.mjs +4 -0
- package/dist/chunk-UH4SIXTR.mjs +2 -0
- package/dist/chunk-UMHUSOPJ.mjs +2 -0
- package/dist/chunk-V3HXVQEM.mjs +2 -0
- package/dist/chunk-V5JTW2LH.mjs +27 -0
- package/dist/chunk-V5VXUJKG.mjs +2 -0
- package/dist/chunk-V6XZ4VIR.mjs +2 -0
- package/dist/chunk-VBXMADMP.mjs +2 -0
- package/dist/chunk-VNV55RUA.mjs +2 -0
- package/dist/chunk-VPD2PS35.mjs +2 -0
- package/dist/chunk-W3BGBJQW.mjs +2 -0
- package/dist/chunk-W4VKN3GF.mjs +7 -0
- package/dist/chunk-W5BXXPDJ.mjs +3 -0
- package/dist/chunk-W7XHE4CT.mjs +2 -0
- package/dist/chunk-XNROSH2T.mjs +4 -0
- package/dist/chunk-XUNHRCOG.mjs +6 -0
- package/dist/chunk-Y34NR5JL.mjs +2 -0
- package/dist/chunk-Y6RLRPG3.mjs +3 -0
- package/dist/chunk-YEY3RSFQ.mjs +2 -0
- package/dist/cli.mjs +2 -0
- package/dist/server.mjs +2 -0
- package/dist/worker.mjs +5 -0
- package/kit/charts.js +355 -0
- package/kit/code.js +164 -0
- package/kit/dialogs.js +157 -0
- package/kit/math.js +2004 -0
- package/kit/report.css +2932 -0
- package/kit/runtime.js +1782 -0
- package/kit/sheets.js +123 -0
- package/kit/state.js +217 -0
- package/kit/tables.js +1499 -0
- package/kit/tokens.js +29 -0
- package/kit/ui.js +658 -0
- package/package.json +41 -4
- package/release.json +25 -0
- package/sdk/column-widths.d.ts +56 -0
- package/sdk/doc-charts.d.ts +82 -0
- package/sdk/doc-code.d.ts +28 -0
- package/sdk/doc-dialogs.d.ts +4 -0
- package/sdk/doc-kit.d.ts +147 -0
- package/sdk/doc-math.d.ts +3 -0
- package/sdk/doc-sheets.d.ts +15 -0
- package/sdk/doc-state.d.ts +41 -0
- package/sdk/doc-tables.d.ts +24 -0
- package/sdk/doc-tokens.d.ts +22 -0
- package/sdk/index.d.ts +30 -0
- package/skill/SKILL.md +150 -0
- package/skill/agents/openai.yaml +5 -0
- package/skill/references/building-components.md +367 -0
- package/skill/references/example-report.html +356 -0
- package/skill/references/writing-html.md +187 -0
- package/skill/sdk/column-widths.d.ts +56 -0
- package/skill/sdk/doc-charts.d.ts +82 -0
- package/skill/sdk/doc-code.d.ts +28 -0
- package/skill/sdk/doc-dialogs.d.ts +4 -0
- package/skill/sdk/doc-kit.d.ts +147 -0
- package/skill/sdk/doc-math.d.ts +3 -0
- package/skill/sdk/doc-sheets.d.ts +15 -0
- package/skill/sdk/doc-state.d.ts +41 -0
- package/skill/sdk/doc-tables.d.ts +24 -0
- package/skill/sdk/doc-tokens.d.ts +22 -0
- package/skill/sdk/index.d.ts +30 -0
- package/starter/doc.html +21 -0
- package/starter/doc.json +5 -0
- package/vendor/d3.v7.9.0.min.js +2 -0
- package/vendor/katex/auto-render.min.js +1 -0
- package/vendor/katex/contrib/mhchem.min.js +1 -0
- package/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/vendor/katex/katex.min.css +1 -0
- package/vendor/katex/katex.min.js +1 -0
- package/vendor/pdfjs/LICENSE +177 -0
- package/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
- package/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
- package/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
- package/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
- package/vendor/pdfjs/cmaps/LICENSE +36 -0
- package/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
- package/vendor/pdfjs/legacy/build/pdf.min.mjs +27 -0
- package/vendor/pdfjs/legacy/build/pdf.worker.min.mjs +27 -0
- package/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
- package/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/vendor/types/@types/d3/LICENSE +21 -0
- package/vendor/types/@types/d3/index.d.ts +39 -0
- package/vendor/types/@types/d3/package.json +81 -0
- package/vendor/types/@types/d3-array/LICENSE +21 -0
- package/vendor/types/@types/d3-array/index.d.ts +1118 -0
- package/vendor/types/@types/d3-array/package.json +56 -0
- package/vendor/types/@types/d3-axis/LICENSE +21 -0
- package/vendor/types/@types/d3-axis/index.d.ts +293 -0
- package/vendor/types/@types/d3-axis/package.json +47 -0
- package/vendor/types/@types/d3-brush/LICENSE +21 -0
- package/vendor/types/@types/d3-brush/index.d.ts +255 -0
- package/vendor/types/@types/d3-brush/package.json +42 -0
- package/vendor/types/@types/d3-chord/LICENSE +21 -0
- package/vendor/types/@types/d3-chord/index.d.ts +471 -0
- package/vendor/types/@types/d3-chord/package.json +40 -0
- package/vendor/types/@types/d3-color/LICENSE +21 -0
- package/vendor/types/@types/d3-color/index.d.ts +669 -0
- package/vendor/types/@types/d3-color/package.json +55 -0
- package/vendor/types/@types/d3-contour/LICENSE +21 -0
- package/vendor/types/@types/d3-contour/index.d.ts +222 -0
- package/vendor/types/@types/d3-contour/package.json +38 -0
- package/vendor/types/@types/d3-delaunay/LICENSE +21 -0
- package/vendor/types/@types/d3-delaunay/index.d.ts +316 -0
- package/vendor/types/@types/d3-delaunay/package.json +30 -0
- package/vendor/types/@types/d3-dispatch/LICENSE +21 -0
- package/vendor/types/@types/d3-dispatch/index.d.ts +96 -0
- package/vendor/types/@types/d3-dispatch/package.json +51 -0
- package/vendor/types/@types/d3-drag/LICENSE +21 -0
- package/vendor/types/@types/d3-drag/index.d.ts +395 -0
- package/vendor/types/@types/d3-drag/package.json +42 -0
- package/vendor/types/@types/d3-dsv/LICENSE +21 -0
- package/vendor/types/@types/d3-dsv/index.d.ts +482 -0
- package/vendor/types/@types/d3-dsv/package.json +45 -0
- package/vendor/types/@types/d3-ease/LICENSE +21 -0
- package/vendor/types/@types/d3-ease/index.d.ts +316 -0
- package/vendor/types/@types/d3-ease/package.json +40 -0
- package/vendor/types/@types/d3-fetch/LICENSE +21 -0
- package/vendor/types/@types/d3-fetch/index.d.ts +282 -0
- package/vendor/types/@types/d3-fetch/package.json +37 -0
- package/vendor/types/@types/d3-force/LICENSE +21 -0
- package/vendor/types/@types/d3-force/index.d.ts +899 -0
- package/vendor/types/@types/d3-force/package.json +45 -0
- package/vendor/types/@types/d3-format/LICENSE +21 -0
- package/vendor/types/@types/d3-format/index.d.ts +337 -0
- package/vendor/types/@types/d3-format/package.json +45 -0
- package/vendor/types/@types/d3-geo/LICENSE +21 -0
- package/vendor/types/@types/d3-geo/index.d.ts +1371 -0
- package/vendor/types/@types/d3-geo/package.json +48 -0
- package/vendor/types/@types/d3-hierarchy/LICENSE +21 -0
- package/vendor/types/@types/d3-hierarchy/index.d.ts +928 -0
- package/vendor/types/@types/d3-hierarchy/package.json +50 -0
- package/vendor/types/@types/d3-interpolate/LICENSE +21 -0
- package/vendor/types/@types/d3-interpolate/index.d.ts +387 -0
- package/vendor/types/@types/d3-interpolate/package.json +47 -0
- package/vendor/types/@types/d3-path/LICENSE +21 -0
- package/vendor/types/@types/d3-path/index.d.ts +108 -0
- package/vendor/types/@types/d3-path/package.json +41 -0
- package/vendor/types/@types/d3-polygon/LICENSE +21 -0
- package/vendor/types/@types/d3-polygon/index.d.ts +41 -0
- package/vendor/types/@types/d3-polygon/package.json +40 -0
- package/vendor/types/@types/d3-quadtree/LICENSE +21 -0
- package/vendor/types/@types/d3-quadtree/index.d.ts +204 -0
- package/vendor/types/@types/d3-quadtree/package.json +45 -0
- package/vendor/types/@types/d3-random/LICENSE +21 -0
- package/vendor/types/@types/d3-random/index.d.ts +313 -0
- package/vendor/types/@types/d3-random/package.json +41 -0
- package/vendor/types/@types/d3-scale/LICENSE +21 -0
- package/vendor/types/@types/d3-scale/index.d.ts +2669 -0
- package/vendor/types/@types/d3-scale/package.json +53 -0
- package/vendor/types/@types/d3-scale-chromatic/LICENSE +21 -0
- package/vendor/types/@types/d3-scale-chromatic/index.d.ts +520 -0
- package/vendor/types/@types/d3-scale-chromatic/package.json +46 -0
- package/vendor/types/@types/d3-selection/LICENSE +21 -0
- package/vendor/types/@types/d3-selection/index.d.ts +1210 -0
- package/vendor/types/@types/d3-selection/package.json +56 -0
- package/vendor/types/@types/d3-shape/LICENSE +21 -0
- package/vendor/types/@types/d3-shape/index.d.ts +2792 -0
- package/vendor/types/@types/d3-shape/package.json +53 -0
- package/vendor/types/@types/d3-time/LICENSE +21 -0
- package/vendor/types/@types/d3-time/index.d.ts +697 -0
- package/vendor/types/@types/d3-time/package.json +46 -0
- package/vendor/types/@types/d3-time-format/LICENSE +21 -0
- package/vendor/types/@types/d3-time-format/index.d.ts +202 -0
- package/vendor/types/@types/d3-time-format/package.json +40 -0
- package/vendor/types/@types/d3-timer/LICENSE +21 -0
- package/vendor/types/@types/d3-timer/index.d.ts +68 -0
- package/vendor/types/@types/d3-timer/package.json +45 -0
- package/vendor/types/@types/d3-transition/LICENSE +21 -0
- package/vendor/types/@types/d3-transition/index.d.ts +664 -0
- package/vendor/types/@types/d3-transition/package.json +47 -0
- package/vendor/types/@types/d3-zoom/LICENSE +21 -0
- package/vendor/types/@types/d3-zoom/index.d.ts +611 -0
- package/vendor/types/@types/d3-zoom/package.json +48 -0
- package/vendor/types/@types/geojson/LICENSE +21 -0
- package/vendor/types/@types/geojson/index.d.ts +202 -0
- package/vendor/types/@types/geojson/package.json +46 -0
- package/vendor/typescript/LICENSE.txt +55 -0
- package/vendor/typescript/lib.decorators.d.ts +384 -0
- package/vendor/typescript/lib.decorators.legacy.d.ts +22 -0
- package/vendor/typescript/lib.dom.d.ts +39429 -0
- package/vendor/typescript/lib.dom.iterable.d.ts +571 -0
- package/vendor/typescript/lib.es2015.collection.d.ts +147 -0
- package/vendor/typescript/lib.es2015.core.d.ts +597 -0
- package/vendor/typescript/lib.es2015.d.ts +28 -0
- package/vendor/typescript/lib.es2015.generator.d.ts +77 -0
- package/vendor/typescript/lib.es2015.iterable.d.ts +605 -0
- package/vendor/typescript/lib.es2015.promise.d.ts +81 -0
- package/vendor/typescript/lib.es2015.proxy.d.ts +128 -0
- package/vendor/typescript/lib.es2015.reflect.d.ts +144 -0
- package/vendor/typescript/lib.es2015.symbol.d.ts +46 -0
- package/vendor/typescript/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/vendor/typescript/lib.es2016.array.include.d.ts +116 -0
- package/vendor/typescript/lib.es2016.d.ts +21 -0
- package/vendor/typescript/lib.es2016.intl.d.ts +31 -0
- package/vendor/typescript/lib.es2017.arraybuffer.d.ts +21 -0
- package/vendor/typescript/lib.es2017.d.ts +26 -0
- package/vendor/typescript/lib.es2017.date.d.ts +31 -0
- package/vendor/typescript/lib.es2017.intl.d.ts +44 -0
- package/vendor/typescript/lib.es2017.object.d.ts +49 -0
- package/vendor/typescript/lib.es2017.sharedmemory.d.ts +135 -0
- package/vendor/typescript/lib.es2017.string.d.ts +45 -0
- package/vendor/typescript/lib.es2017.typedarrays.d.ts +53 -0
- package/vendor/typescript/lib.es2018.asyncgenerator.d.ts +77 -0
- package/vendor/typescript/lib.es2018.asynciterable.d.ts +53 -0
- package/vendor/typescript/lib.es2018.d.ts +24 -0
- package/vendor/typescript/lib.es2018.intl.d.ts +83 -0
- package/vendor/typescript/lib.es2018.promise.d.ts +30 -0
- package/vendor/typescript/lib.es2018.regexp.d.ts +37 -0
- package/vendor/typescript/lib.es2019.array.d.ts +79 -0
- package/vendor/typescript/lib.es2019.d.ts +24 -0
- package/vendor/typescript/lib.es2019.intl.d.ts +23 -0
- package/vendor/typescript/lib.es2019.object.d.ts +33 -0
- package/vendor/typescript/lib.es2019.string.d.ts +37 -0
- package/vendor/typescript/lib.es2019.symbol.d.ts +24 -0
- package/vendor/typescript/lib.es2020.bigint.d.ts +765 -0
- package/vendor/typescript/lib.es2020.d.ts +27 -0
- package/vendor/typescript/lib.es2020.date.d.ts +42 -0
- package/vendor/typescript/lib.es2020.intl.d.ts +474 -0
- package/vendor/typescript/lib.es2020.number.d.ts +28 -0
- package/vendor/typescript/lib.es2020.promise.d.ts +47 -0
- package/vendor/typescript/lib.es2020.sharedmemory.d.ts +99 -0
- package/vendor/typescript/lib.es2020.string.d.ts +44 -0
- package/vendor/typescript/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/vendor/typescript/lib.es2021.d.ts +23 -0
- package/vendor/typescript/lib.es2021.intl.d.ts +166 -0
- package/vendor/typescript/lib.es2021.promise.d.ts +48 -0
- package/vendor/typescript/lib.es2021.string.d.ts +33 -0
- package/vendor/typescript/lib.es2021.weakref.d.ts +78 -0
- package/vendor/typescript/lib.es2022.array.d.ts +121 -0
- package/vendor/typescript/lib.es2022.d.ts +25 -0
- package/vendor/typescript/lib.es2022.error.d.ts +75 -0
- package/vendor/typescript/lib.es2022.intl.d.ts +145 -0
- package/vendor/typescript/lib.es2022.object.d.ts +26 -0
- package/vendor/typescript/lib.es2022.regexp.d.ts +39 -0
- package/vendor/typescript/lib.es2022.string.d.ts +25 -0
- package/vendor/typescript/lib.es5.d.ts +4601 -0
- package/vendor/typescript/package.json +4 -0
- package/vendor/typescript/typescript.js +446 -0
- package/web/assets/index-Bh74DfsV.css +1 -0
- package/web/assets/index-UW0RyFFt.js +13 -0
- package/web/index.html +14 -0
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
import { ARRIVING, ATTRIBUTE, DATA_MOST, DATA_SHOWN, FALLBACK, FIELDS, INSTANCE, NO_TEXT, PACKAGE_MARK, SCHEMA, SLOT, SLOT_PART, componentAt, fitsDataScript, heldBy, instanceMatch, isDataScript, noDataPart, refusedInData, schemaAhead, slotsIn } from "../../../shared/components/installed.mjs";
|
|
2
|
+
import { referencedIds } from "../../../shared/copy-ids.mjs";
|
|
3
|
+
import { language, t } from "../../../shared/i18n/index.mjs";
|
|
4
|
+
import { caretAt, editable } from "../../page/caret.mjs";
|
|
5
|
+
import { htmlToBlocks, parseClipboardHTML } from "../../page/clipboard/import/html.mjs";
|
|
6
|
+
import { toBlocks } from "../../page/clipboard/import/to-blocks.mjs";
|
|
7
|
+
import { build as buildBlock } from "../../page/clipboard/own/blocks.mjs";
|
|
8
|
+
import { copyOf } from "../../page/clipboard/own/describe.mjs";
|
|
9
|
+
import { ownIds } from "../../page/clipboard/own/ids.mjs";
|
|
10
|
+
import { firstHost, newHost, unitElement } from "../../page/core.mjs";
|
|
11
|
+
import { addStyle } from "../../page/ui.mjs";
|
|
12
|
+
import { accepts, capsFor } from "../registry.mjs";
|
|
13
|
+
import { ICON } from "./index.mjs";
|
|
14
|
+
import { followCatalog, followSettings, isBehind } from "./served.mjs";
|
|
15
|
+
|
|
16
|
+
// 组件 on the page: events go by region, one rule. What comes down inside an instance and in no text
|
|
17
|
+
// block of it is the component's, and the editor lets go (`keepsKeys`, the same rule as notion-lite's
|
|
18
|
+
// block-keys and clipboard, `e.target.closest('input, textarea')`: a field of a block keeps its keys,
|
|
19
|
+
// here all that stands in an instance, its buttons and what it draws, but undo and redo on what is no
|
|
20
|
+
// field, which has none of its own). Its text parts are the editor's: Enter, Backspace, Ctrl+Z and a
|
|
21
|
+
// selection as in any words. Its outer frame and its handle are Gallery's: moving, copying and deleting
|
|
22
|
+
// it whole, as for any block. What a press does here, the block tools clearing, menus closing and the
|
|
23
|
+
// format bar going, stays: no event is stopped, and a press in a component is only no press the editor
|
|
24
|
+
// answers (`readOnly` in index.mjs says nothing of it, and the format bar comes back over no selection).
|
|
25
|
+
//
|
|
26
|
+
// The page holds the catalog as the server gave it (its map's `components`): a page with no instance
|
|
27
|
+
// of a package that changes is told so and stays as it is, as being shown again would cost its undo
|
|
28
|
+
// steps, so it reads the new list from its own address, which is what a load of the page would have
|
|
29
|
+
// read (`doc-catalog-changed`, src/server/routes.mjs). An instance is made from a template or from
|
|
30
|
+
// what a clipboard carried, here as what the kit would start: its text parts text blocks at once, the
|
|
31
|
+
// caret among them. The first instance of a package on a page served without it, by whatever way it
|
|
32
|
+
// came, brings it: the tags of the map, once, where the server would have put them.
|
|
33
|
+
//
|
|
34
|
+
// A part its manifest edits as data is the component's and nothing of the editor's goes in. What
|
|
35
|
+
// writes it is `context.edit`, which the kit asks of the page (`doc-component-edit`): the page gives the
|
|
36
|
+
// component a draft of each part it names, off the page, and copies of what it made of them go in, one
|
|
37
|
+
// `source` step of undo, or, should it throw, write the part on the page or make what the file could
|
|
38
|
+
// not hold, nothing has happened. The commits find what changed as they find a table's (`dataOf`,
|
|
39
|
+
// core.mjs dataChanges), each part as the kit's dehydrate leaves it, so that what the component leaves
|
|
40
|
+
// on it by its manifest's `runtime` is no change, and they write what differs and nothing else. An
|
|
41
|
+
// instance written whole, made or put back, holds what the file says (`dataIn`), read the same way. What
|
|
42
|
+
// the reader writes over someone else's change of a part (仍然调整) is a step of its own from theirs
|
|
43
|
+
// (`overwrite`), so that one undo gives the file's back.
|
|
44
|
+
// One past its manifest's `schema` is read-only, its words and all.
|
|
45
|
+
//
|
|
46
|
+
// Its slots (data-doc-slot, the parts its manifest edits as flow) are the page's: boxes of kind "slot"
|
|
47
|
+
// (index.mjs), whose blocks are edited, moved and undone as anywhere, a press or a key in one no
|
|
48
|
+
// component's (componentAt), whatever state the instance is in, one of no package too. Enter in a text
|
|
49
|
+
// part goes into the first slot after it, as in a disclosure's title. An empty one says so while the
|
|
50
|
+
// page is edited, and a click on it makes a paragraph (insert/, holdsOne), as a disclosure's content.
|
|
51
|
+
// The component reads a slot (context.part) and hears what changes in it (source), and writes nothing
|
|
52
|
+
// there: a slot it takes off its instance is put back where it stood (`keepSlots`), so that no commit
|
|
53
|
+
// takes the reader's blocks out. An instance made on the page, from "/", a clipboard or 恢复我的, has its
|
|
54
|
+
// slots as boxes made on the page, their blocks made on the page as any (`slotsMade`), which the commit
|
|
55
|
+
// carries apart from its markup (index.mjs `extras`) and the answer names, so that they edit at once; a
|
|
56
|
+
// copy carries them so too, in its document as well (`copiesAsItself`, index.mjs `data`).
|
|
57
|
+
|
|
58
|
+
let held = null; // the map, what makes a block with no editor (the transfer worker) finds none of
|
|
59
|
+
|
|
60
|
+
// A package as the page knows it. One hidden is one like any other but in a menu: its instances run, copy
|
|
61
|
+
// and go by its name. One turned off is none from the moment the page hears, whatever its list still
|
|
62
|
+
// says: what a clipboard brings would load it, and only a list that came would say otherwise.
|
|
63
|
+
const entryOf = (id) => held?.components?.find((entry) => entry.id === id && entry.state !== "disabled") ?? null;
|
|
64
|
+
|
|
65
|
+
// What the page runs of each package, by id: the stamp it came with and that of its manifest.
|
|
66
|
+
const brought = new Map();
|
|
67
|
+
|
|
68
|
+
// On an instance its component wrote: the stamp of the manifest that component ran by, which the write
|
|
69
|
+
// goes by wherever it is sent from, a page taking up what one that is gone left (autosave.mjs recover)
|
|
70
|
+
// running the manifest there is now.
|
|
71
|
+
const WRITTEN_BY = "data-ge-definition";
|
|
72
|
+
|
|
73
|
+
// Whether the page runs an older version of a package than `entry` says, which only a load mends.
|
|
74
|
+
const overtaken = ({ id, stamp }) => brought.has(id) && brought.get(id).stamp !== stamp;
|
|
75
|
+
|
|
76
|
+
// On an instance, the parts of it one edit wrote together, as lists of names (JSON): they go to the file
|
|
77
|
+
// together, or wait together for the reader where someone else changed one of them, as the edit's one
|
|
78
|
+
// undo step takes them together. On the instance, as its stamp is, so that a page taking up what one that
|
|
79
|
+
// is gone left (its body, autosave.mjs recover) sends them so too.
|
|
80
|
+
const WRITTEN_TOGETHER = "data-ge-together";
|
|
81
|
+
const writtenTogether = (instance) => {
|
|
82
|
+
try {
|
|
83
|
+
const groups = JSON.parse(instance.getAttribute(WRITTEN_TOGETHER) ?? "[]");
|
|
84
|
+
return Array.isArray(groups) ? groups.filter(Array.isArray) : [];
|
|
85
|
+
} catch {
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// A tag of a package's as an element that will run: what a template's content holds never does.
|
|
91
|
+
function tagFrom(html) {
|
|
92
|
+
const template = document.createElement("template");
|
|
93
|
+
template.innerHTML = html;
|
|
94
|
+
const written = template.content.firstElementChild;
|
|
95
|
+
const tag = document.createElement(written.localName);
|
|
96
|
+
for (const { name, value } of written.attributes) tag.setAttribute(name, value);
|
|
97
|
+
tag.textContent = written.textContent;
|
|
98
|
+
if (written.localName === "script") tag.async = false; // in the order they are put in
|
|
99
|
+
return tag;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Right after the last of the kit's and the packages' of its kind, as a page is served (render/assets.mjs afterKitTags).
|
|
103
|
+
function put(tag) {
|
|
104
|
+
const kind = tag.localName;
|
|
105
|
+
const last = [...document.querySelectorAll(`${kind}[data-doc-kit], ${kind}[data-doc-vendor], ${kind}[${PACKAGE_MARK}]`)].at(-1);
|
|
106
|
+
if (last) last.after(tag);
|
|
107
|
+
else (kind === "link" ? document.head : document.body).append(tag);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// The kit's file a tag loads is on the page already (by another package, or as the page was served).
|
|
111
|
+
const onPage = (tag) => ["data-doc-kit", "data-doc-vendor"].some((mark) => tag.hasAttribute(mark) && document.querySelector(`[${mark}="${tag.getAttribute(mark)}"]`));
|
|
112
|
+
|
|
113
|
+
// The instances of a package start, or show why they do not, now that its files are in.
|
|
114
|
+
const started = (id) => document.querySelectorAll(instanceMatch(id)).forEach((host) => globalThis.DocKit?.mount(host));
|
|
115
|
+
|
|
116
|
+
// A package on a page served without it: its tags in order, styles then scripts, the kit's files it
|
|
117
|
+
// asks for first. Its description is told at once, its script's own turn comes as it loads.
|
|
118
|
+
function bring({ id, stamp, definition, kit = [], tags }) {
|
|
119
|
+
if (brought.has(id)) return;
|
|
120
|
+
brought.set(id, { stamp, definition });
|
|
121
|
+
const all = [...kit, ...tags.styles, ...tags.scripts].map(tagFrom).filter((tag) => !onPage(tag));
|
|
122
|
+
const script = all.find((tag) => tag.localName === "script" && tag.src && tag.hasAttribute(PACKAGE_MARK));
|
|
123
|
+
const done = () => {
|
|
124
|
+
script?.removeAttribute(ARRIVING);
|
|
125
|
+
started(id);
|
|
126
|
+
};
|
|
127
|
+
script?.setAttribute(ARRIVING, id);
|
|
128
|
+
script?.addEventListener("load", done, { once: true });
|
|
129
|
+
script?.addEventListener("error", done, { once: true });
|
|
130
|
+
all.forEach(put);
|
|
131
|
+
if (!script) done();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// An instance's parts as its manifest says them, as the kit was told. None before its description has come.
|
|
135
|
+
const partsOf = (instance) => Object.entries(globalThis.DocKit?.description(instance.getAttribute(ATTRIBUTE))?.parts ?? {});
|
|
136
|
+
// Whether an instance holds its content in a shape its manifest does not reach, as the kit was told it.
|
|
137
|
+
const ahead = (instance) => schemaAhead(instance.getAttribute(SCHEMA), globalThis.DocKit?.description(instance.getAttribute(ATTRIBUTE))?.schema);
|
|
138
|
+
// The elements of a part an instance holds, of its own region (none of an instance in it, none of what
|
|
139
|
+
// its slots hold, no slot itself) and none of what the kit draws of a script of data there, which is
|
|
140
|
+
// no element of the file's.
|
|
141
|
+
const elementsOf = (instance, at) => [...instance.querySelectorAll(at)].filter((part) => !part.matches(INSTANCE) && !part.matches(SLOT_PART) && part.parentElement.closest(INSTANCE) === instance && heldBy(part) === instance && !part.closest(`.${DATA_SHOWN}`));
|
|
142
|
+
|
|
143
|
+
// The elements of an instance its component writes, [[name, element]], as the server finds them
|
|
144
|
+
// (file.mjs dataParts): of each part edited as data the first it holds, as context.part does. One in
|
|
145
|
+
// another is written with that one, and an element two parts name is the first's.
|
|
146
|
+
function dataParts(instance) {
|
|
147
|
+
const first = partsOf(instance).filter(([, { edit }]) => edit === "data").map(([name, { at }]) => [name, elementsOf(instance, at)[0]]).filter(([, part]) => part);
|
|
148
|
+
return first.filter(([, part], index) => !first.some(([, other], at) => (other !== part && other.contains(part)) || (other === part && at < index)));
|
|
149
|
+
}
|
|
150
|
+
const dataOf = (instance) => Object.fromEntries(dataParts(instance).map(([name, part]) => [name, part.innerHTML]));
|
|
151
|
+
|
|
152
|
+
// The elements of an instance its package edits as text, as the server's scan finds them
|
|
153
|
+
// (file.mjs textParts), in the file's order: what stands in a data part or holds one is the component's,
|
|
154
|
+
// and one past its manifest has none.
|
|
155
|
+
function textParts(instance) {
|
|
156
|
+
if (ahead(instance)) return [];
|
|
157
|
+
const said = partsOf(instance).filter(([, { edit }]) => edit === "text");
|
|
158
|
+
const data = dataParts(instance).map(([, part]) => part);
|
|
159
|
+
const parts = [...new Set(said.flatMap(([, { at }]) => elementsOf(instance, at)))].filter((part) => !NO_TEXT.has(part.localName) && !data.some((other) => other.contains(part) || part.contains(other)));
|
|
160
|
+
return parts.filter((part) => !parts.some((other) => other !== part && other.contains(part))).sort((a, b) => (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// All an element holds, what a <template> keeps apart among it.
|
|
164
|
+
const allIn = (root) => [...root.querySelectorAll("*")].flatMap((node) => (node.localName === "template" ? [node, ...allIn(node.content)] : [node]));
|
|
165
|
+
|
|
166
|
+
// Why what a component made of a draft of `part` cannot go in, as the server would say (file.mjs
|
|
167
|
+
// `rewrite`), for who writes the component, or null.
|
|
168
|
+
function draftProblem(part, draft) {
|
|
169
|
+
if (draft.cloneNode(false).outerHTML !== part.cloneNode(false).outerHTML) return "a part's own tag and attributes are the file's: a change writes what it holds";
|
|
170
|
+
const html = draft.innerHTML;
|
|
171
|
+
if (new TextEncoder().encode(html).length > DATA_MOST) return `it holds more than the ${DATA_MOST} bytes one commit writes`;
|
|
172
|
+
const attributes = [...part.attributes];
|
|
173
|
+
if (part.localName === "script") return isDataScript(part.localName, attributes) && fitsDataScript(html) ? null : "a script of data holds JSON, with nothing in it that ends a script: write < as \\u003c";
|
|
174
|
+
if (noDataPart(part.localName)) return `a <${part.localName}> is no part a component can write`;
|
|
175
|
+
const read = part.cloneNode(false);
|
|
176
|
+
read.innerHTML = html;
|
|
177
|
+
if (read.innerHTML !== html) return "what it holds does not read back as itself (a row with no tbody, a block in a paragraph): a file would hold something else";
|
|
178
|
+
const refused = allIn(draft).find((node) => refusedInData(node.localName, [...node.attributes]));
|
|
179
|
+
return refused ? `a data part holds no <${refused.localName}> of that kind: no script, handler, frame, address of code, data-block-id or data-ge-*` : null;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// What the text blocks of an instance are to contenteditable: an instance the kit shows as it stands,
|
|
183
|
+
// its component failed or its script started nothing, takes no word, as one of no package does.
|
|
184
|
+
const openness = (instance) => (instance.hasAttribute(FALLBACK) ? "false" : "true");
|
|
185
|
+
|
|
186
|
+
// Its text blocks as it stands now, for as long as it stands so: a later mount opens them again.
|
|
187
|
+
function followFallback(instance) {
|
|
188
|
+
const value = openness(instance);
|
|
189
|
+
for (const part of instance.querySelectorAll('[data-ge-kind="installed"]')) {
|
|
190
|
+
if (part.parentElement.closest(INSTANCE) === instance && heldBy(part) === instance && part.getAttribute("contenteditable") !== value) part.setAttribute("contenteditable", value);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Its text parts text blocks now: `data-ge-part`, holding what each said, until the commit that writes
|
|
195
|
+
// the instance names them. What the file then says is what they start from: words typed before that
|
|
196
|
+
// go with the next commit, an untouched one shows the file's, and one the file takes for no text
|
|
197
|
+
// block (more than words in it: `notText`) is read-only from then on.
|
|
198
|
+
function editableParts(instance) {
|
|
199
|
+
const parts = textParts(instance);
|
|
200
|
+
for (const part of parts) for (const [name, value] of [["contenteditable", openness(instance)], ["data-ge-part", part.innerHTML], ["data-ge-kind", "installed"], ["data-ge-caps", capsFor("installed")], ["data-ge-framed", ""]]) part.setAttribute(name, value);
|
|
201
|
+
return parts;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** A new instance from its markup, marked as made on the page, not on it yet. Ids it does not name itself go, as from a copy. */
|
|
205
|
+
function newInstance(doc, html) {
|
|
206
|
+
const template = doc.createElement("template");
|
|
207
|
+
template.innerHTML = html;
|
|
208
|
+
const instance = doc.importNode(template.content.firstElementChild, true);
|
|
209
|
+
const all = [instance, ...instance.querySelectorAll("*")];
|
|
210
|
+
const named = referencedIds(all.flatMap((node) => [...node.attributes]));
|
|
211
|
+
for (const node of all) if (node.id && !named.has(node.id)) node.removeAttribute("id");
|
|
212
|
+
for (const [name, value] of [["data-ge-new", ""], ["data-ge-type", "installed"], ["data-ge-unit-kind", "installed"], ["data-ge-frame", ""], ["contenteditable", "false"]]) instance.setAttribute(name, value);
|
|
213
|
+
return instance;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The slots of a new instance as boxes made on the page, each holding what `fill(slot)` gives (blocks
|
|
218
|
+
* made on the page), or an empty paragraph, where the reader writes: what the commit writes in them
|
|
219
|
+
* goes apart from the instance's markup (index.mjs `extras`), and the page knows each block of it by
|
|
220
|
+
* the commit's answer, as one made in a new column.
|
|
221
|
+
*/
|
|
222
|
+
function slotsMade(doc, instance, fill) {
|
|
223
|
+
for (const slot of slotsIn(instance)) {
|
|
224
|
+
const blocks = fill(slot);
|
|
225
|
+
slot.setAttribute("data-ge-box", "");
|
|
226
|
+
slot.setAttribute("data-ge-box-kind", "slot");
|
|
227
|
+
slot.replaceChildren(...(blocks.length > 0 ? blocks : [newHost(doc, "paragraph")]));
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// What a template's slot holds, as blocks made on the page: read as HTML pasted from elsewhere is
|
|
232
|
+
// (clipboard/import/), each block what a paste makes of it there.
|
|
233
|
+
function blocksOfTemplate(doc, slot) {
|
|
234
|
+
if (!slot.firstElementChild && !slot.textContent.trim()) return [];
|
|
235
|
+
const specs = htmlToBlocks(parseClipboardHTML(slot.innerHTML), {});
|
|
236
|
+
return specs.length > 0 ? toBlocks(specs, "slot").map((block) => buildBlock(doc, block)) : [];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* An instance from what a clipboard carried (`data`): the file is written from that markup, which the
|
|
241
|
+
* commit sends, its slots empty; what they held comes as blocks of their own (`flows`, by name),
|
|
242
|
+
* made again here as any pasted block (`inner`).
|
|
243
|
+
*/
|
|
244
|
+
export function build({ doc, block, inner }) {
|
|
245
|
+
const entry = entryOf(block.package);
|
|
246
|
+
if (entry) bring(entry);
|
|
247
|
+
const instance = newInstance(doc, block.html);
|
|
248
|
+
instance.setAttribute("data-ge-copy", block.html);
|
|
249
|
+
slotsMade(doc, instance, (slot) => inner?.(block.flows?.[slot.getAttribute(SLOT)] ?? []) ?? []);
|
|
250
|
+
editableParts(instance);
|
|
251
|
+
return instance;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
let listed = true; // whether the list says what the server last did: no read of it on its way, none that failed
|
|
255
|
+
let reads = 0; // the reads of the list begun
|
|
256
|
+
|
|
257
|
+
// The list as a load of the page would give it, read from the page's own address: nothing of the page
|
|
258
|
+
// changes. Reads may cross: the last one begun is what the server last did, whichever answers last.
|
|
259
|
+
async function readList() {
|
|
260
|
+
const read = ++reads;
|
|
261
|
+
listed = false;
|
|
262
|
+
const answer = await fetch(location.href, { cache: "no-store" }).catch(() => null);
|
|
263
|
+
const text = answer?.ok ? await answer.text().catch(() => null) : null;
|
|
264
|
+
const map = text && new DOMParser().parseFromString(text, "text/html").getElementById("doc-edit-map");
|
|
265
|
+
if (read !== reads || !map) return;
|
|
266
|
+
held.components = JSON.parse(map.textContent).components ?? [];
|
|
267
|
+
listed = true;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Whether an instance of a package can come onto the page as it is (`entry`, as entryOf finds it): the
|
|
271
|
+
// list says what the package is now, and the page runs that or nothing of it, so that the instance brings it.
|
|
272
|
+
const inStep = (entry) => listed && entry !== null && !overtaken(entry);
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* An instance on the page, a page's new one: of a package the page is behind on that cannot come as it
|
|
276
|
+
* is, what a page holding one when it changed has had; else its package brought, what it holds as text
|
|
277
|
+
* blocks where it came with none.
|
|
278
|
+
*/
|
|
279
|
+
function arrive(instance) {
|
|
280
|
+
if (!instance.isConnected || heldBy(instance)) return;
|
|
281
|
+
const id = instance.getAttribute(ATTRIBUTE);
|
|
282
|
+
const entry = entryOf(id);
|
|
283
|
+
if (isBehind(id) && !inStep(entry)) return void window.dispatchEvent(new CustomEvent("doc-components-changed"));
|
|
284
|
+
if (!entry) return;
|
|
285
|
+
bring(entry);
|
|
286
|
+
started(id);
|
|
287
|
+
if (!instance.querySelector("[data-ge-block], [data-ge-part]")) editableParts(instance);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// A slot of the page's (a box) taken off an instance still on the page, by its component's script
|
|
291
|
+
// (`node`, what was taken off from `from`, before `next`; the instance itself taken off is the editor's
|
|
292
|
+
// doing, and none of this): a slot is the document's, which no component writes, so it goes back where
|
|
293
|
+
// it stood, what it holds with it, and the reader's blocks stay, on the page and in the file. Who
|
|
294
|
+
// wrote the package hears of it.
|
|
295
|
+
function keepSlots(node, from, next) {
|
|
296
|
+
if (node.nodeType !== 1 || node.matches(INSTANCE) || !from.isConnected) return;
|
|
297
|
+
const instance = from.closest(INSTANCE);
|
|
298
|
+
const slots = [node, ...node.querySelectorAll(SLOT_PART)].filter((slot) => slot.matches(`:is(${SLOT_PART})[data-ge-box]`) && !slot.parentElement?.closest(INSTANCE));
|
|
299
|
+
if (!instance || slots.length === 0) return;
|
|
300
|
+
for (const slot of slots) from.insertBefore(slot, next?.parentNode === from ? next : null);
|
|
301
|
+
console.error(`[DocKit] ${instance.getAttribute(ATTRIBUTE)}: a slot left its instance: it is put back, its blocks the document's`);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// A package's picture where a menu shows a mark.
|
|
305
|
+
const pictureOf = ({ preview }) => (preview ? `<img src="${preview}" alt="">` : null);
|
|
306
|
+
|
|
307
|
+
// A slot the file has empty (an Agent's): what a disclosure's content says (details/page.mjs), a click
|
|
308
|
+
// on it making a paragraph there (insert/ clickBlank).
|
|
309
|
+
const SLOT_EMPTY = `
|
|
310
|
+
[data-ge-editing] [data-doc-slot][data-ge-box]:not(:has(> *))::before { content: ${JSON.stringify(t("空白内容区。点击或拖动区块到这里。"))}; display: block; padding: 3px 2px; border-radius: 4px; color: var(--ge-tx3); cursor: pointer; transition: background 20ms ease-in; }
|
|
311
|
+
[data-ge-editing] [data-doc-slot][data-ge-box]:not(:has(> *)):hover::before { background: var(--ge-hover); }
|
|
312
|
+
`;
|
|
313
|
+
|
|
314
|
+
/** An instance on the page: what its events are, what Enter does in its words, and what the menus make of its package. */
|
|
315
|
+
export function create({ map, newParagraph, active, sourceStep, struct }) {
|
|
316
|
+
held = map;
|
|
317
|
+
addStyle(SLOT_EMPTY);
|
|
318
|
+
// Whether a key in an instance, on no field of it, is undo or redo: a button or what a component draws
|
|
319
|
+
// has no undo of its own, and a press on one that wrote leaves the focus there, from where the page's
|
|
320
|
+
// undo goes on through every step, as notion-lite's does from anywhere (onHistoryKey). A field keeps
|
|
321
|
+
// its own.
|
|
322
|
+
const pageUndo = (node, event) => {
|
|
323
|
+
const key = event?.key?.toLowerCase();
|
|
324
|
+
return Boolean(event?.ctrlKey || event?.metaKey) && !event.altKey && (key === "z" || key === "y") && !node.matches(FIELDS);
|
|
325
|
+
};
|
|
326
|
+
// What a component asks to write (`detail` of doc-component-edit, the kit's: the parts it names, and
|
|
327
|
+
// `run`, its change, given a draft of each by name): whether it was taken. What was written goes in as
|
|
328
|
+
// copies, so that a draft the component keeps reaches nothing on the page; a change that wrote the part
|
|
329
|
+
// on the page instead is undone and refused, as its step would undo the change it left out.
|
|
330
|
+
function write({ parts, run }, instance) {
|
|
331
|
+
if (!active()) return false;
|
|
332
|
+
const id = instance.getAttribute(ATTRIBUTE);
|
|
333
|
+
const refuse = (problem) => {
|
|
334
|
+
console.error(`[DocKit] ${id}: context.edit: ${problem}`);
|
|
335
|
+
return false;
|
|
336
|
+
};
|
|
337
|
+
const before = parts.map(({ part }) => part.innerHTML);
|
|
338
|
+
const drafts = parts.map(({ part }) => part.cloneNode(true));
|
|
339
|
+
const ran = run(Object.fromEntries(parts.map(({ name }, index) => [name, drafts[index]])));
|
|
340
|
+
const live = parts.findIndex(({ part }, index) => part.innerHTML !== before[index]);
|
|
341
|
+
if (live >= 0) {
|
|
342
|
+
parts.forEach(({ part }, index) => { if (part.innerHTML !== before[index]) part.innerHTML = before[index]; });
|
|
343
|
+
return refuse(`it wrote the part ${parts[live].name} on the page: a change writes the draft it is handed, which goes onto the page when it returns`);
|
|
344
|
+
}
|
|
345
|
+
if (!ran) return false;
|
|
346
|
+
for (const [index, { name, part }] of parts.entries()) {
|
|
347
|
+
const problem = draftProblem(part, drafts[index]);
|
|
348
|
+
if (problem) return refuse(parts.length > 1 ? `${name}: ${problem}` : problem);
|
|
349
|
+
}
|
|
350
|
+
const changed = parts.map(({ name, part }, index) => [part, before[index], drafts[index], name]).filter(([, was, draft]) => draft.innerHTML !== was);
|
|
351
|
+
if (changed.length === 0) return true;
|
|
352
|
+
for (const [part, , draft] of changed) part.replaceChildren(...draft.cloneNode(true).childNodes);
|
|
353
|
+
instance.setAttribute(WRITTEN_BY, brought.get(id)?.definition ?? "");
|
|
354
|
+
if (changed.length > 1) {
|
|
355
|
+
const names = new Set(changed.map(([, , , name]) => name));
|
|
356
|
+
const groups = writtenTogether(instance);
|
|
357
|
+
const joined = groups.filter((group) => group.some((name) => names.has(name)));
|
|
358
|
+
instance.setAttribute(WRITTEN_TOGETHER, JSON.stringify([...groups.filter((group) => !joined.includes(group)), [...new Set([...names, ...joined.flat()])]]));
|
|
359
|
+
}
|
|
360
|
+
sourceStep(changed.map(([part, was]) => [part, was]));
|
|
361
|
+
return true;
|
|
362
|
+
}
|
|
363
|
+
return {
|
|
364
|
+
keepsKeys: (node, event) => componentAt(node) && !editable(node) && !pageUndo(node, event),
|
|
365
|
+
undoHere: (node) => componentAt(node) && !editable(node),
|
|
366
|
+
keys: {
|
|
367
|
+
// In a text part with a slot after it (in the file's order): the caret goes into the slot, as from
|
|
368
|
+
// a disclosure's title into its content (details/page.mjs), at the start of its first block, or in
|
|
369
|
+
// a paragraph made first in it, one step of undo. Else notion-lite's captionEnter: words of a
|
|
370
|
+
// block that are not the block's own line do not split, Enter there is a text block after the
|
|
371
|
+
// block, the caret in it.
|
|
372
|
+
enter({ host }) {
|
|
373
|
+
const instance = host.parentElement?.closest(INSTANCE);
|
|
374
|
+
const slot = instance && slotsIn(instance).find((each) => each.hasAttribute("data-ge-box") && host.compareDocumentPosition(each) & Node.DOCUMENT_POSITION_FOLLOWING && !host.contains(each));
|
|
375
|
+
if (slot) {
|
|
376
|
+
const first = firstHost(slot);
|
|
377
|
+
if (first) caretAt(first, "start");
|
|
378
|
+
else {
|
|
379
|
+
const paragraph = newHost(document, "paragraph");
|
|
380
|
+
struct([slot], [], () => {
|
|
381
|
+
slot.prepend(paragraph);
|
|
382
|
+
return { touched: [paragraph], focus: paragraph };
|
|
383
|
+
});
|
|
384
|
+
caretAt(paragraph, "start");
|
|
385
|
+
}
|
|
386
|
+
return true;
|
|
387
|
+
}
|
|
388
|
+
const unit = unitElement(host);
|
|
389
|
+
const box = unit?.parentElement;
|
|
390
|
+
if (!box || !accepts(box.getAttribute("data-ge-box-kind") ?? "flow", "paragraph")) return false;
|
|
391
|
+
newParagraph(box, unit);
|
|
392
|
+
return true;
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
// Each package with a template that is offered (its `state`, as `isHidden` of page/offered.mjs goes
|
|
396
|
+
// by block types), by its id, as notion-lite's variants: a row of the menus, found by its name in
|
|
397
|
+
// either language and its words, and what makes one (notion-lite's
|
|
398
|
+
// insertTypedBlock: the caret in its first text part; with none, in an empty paragraph after it, as
|
|
399
|
+
// for a divider). Its slots are boxes made on the page at once, what the template has in each made
|
|
400
|
+
// blocks of the page's (an empty paragraph where it has none), so that the reader writes in one
|
|
401
|
+
// before the instance is saved, and Enter in a text part goes into the slot after it.
|
|
402
|
+
menuVariants: () => Object.fromEntries((map.components ?? []).filter(({ template, state }) => template && state === "normal").map((entry) => [entry.id, {
|
|
403
|
+
label: entry.name[language],
|
|
404
|
+
icon: pictureOf(entry) ?? ICON,
|
|
405
|
+
words: `${entry.name.zh} ${entry.name.en} ${entry.id} ${entry.words}`.toLowerCase(),
|
|
406
|
+
sample: true,
|
|
407
|
+
preview: { src: entry.preview, says: entry.description[language] },
|
|
408
|
+
create({ doc, put: place, paragraph }) {
|
|
409
|
+
bring(entry);
|
|
410
|
+
const instance = newInstance(doc, entry.template);
|
|
411
|
+
slotsMade(doc, instance, (slot) => blocksOfTemplate(doc, slot));
|
|
412
|
+
ownIds(doc, [instance]);
|
|
413
|
+
place(instance);
|
|
414
|
+
return editableParts(instance)[0] ?? firstHost(instance) ?? place(paragraph());
|
|
415
|
+
},
|
|
416
|
+
}])),
|
|
417
|
+
/**
|
|
418
|
+
* Whether a copy of an instance's unit stands for it: not where it has slots, whose blocks that copy
|
|
419
|
+
* would write whole, with no ids the page knows; such an instance is copied by what it carries alone
|
|
420
|
+
* (index.mjs `data`: its slots' blocks apart), in its document too.
|
|
421
|
+
*/
|
|
422
|
+
copiesAsItself: (unit) => slotsIn(unit).length === 0,
|
|
423
|
+
/** What the reader calls a block of it: its package's name, where the page knows its package. */
|
|
424
|
+
nameOf: (unit) => entryOf(unit.getAttribute(ATTRIBUTE))?.name[language] ?? null,
|
|
425
|
+
/**
|
|
426
|
+
* One the file dropped that the page still shows, a reader's to keep: it goes from now on as what a
|
|
427
|
+
* clipboard carried does, its markup as the kit would start it, its slots empty: what they hold is
|
|
428
|
+
* made on the page from now on too (sync-state.mjs asMade), and goes apart (index.mjs `extras`).
|
|
429
|
+
* Its template would not hold what the reader has.
|
|
430
|
+
*/
|
|
431
|
+
renew(instance) {
|
|
432
|
+
if (!instance.hasAttribute("data-ge-copy")) {
|
|
433
|
+
const copy = copyOf(instance, { named: true });
|
|
434
|
+
const boxes = slotsIn(instance).map((slot) => slot.hasAttribute("data-ge-box"));
|
|
435
|
+
slotsIn(copy).forEach((slot, index) => { if (boxes[index]) slot.replaceChildren(); });
|
|
436
|
+
instance.setAttribute("data-ge-copy", copy.outerHTML);
|
|
437
|
+
}
|
|
438
|
+
instance.setAttribute("data-ge-type", "installed");
|
|
439
|
+
return true;
|
|
440
|
+
},
|
|
441
|
+
/** A text part the file takes for no text block: as it stood, read-only, the caret on to the next one that is. */
|
|
442
|
+
notText(part) {
|
|
443
|
+
const selection = getSelection();
|
|
444
|
+
const next = selection.rangeCount > 0 && part.contains(selection.anchorNode) ? textParts(part.parentElement.closest(INSTANCE)).find((other) => other !== part && other.isContentEditable) ?? null : undefined;
|
|
445
|
+
part.innerHTML = part.getAttribute("data-ge-part");
|
|
446
|
+
for (const name of ["contenteditable", "data-ge-part", "data-ge-kind", "data-ge-framed", "data-ge-caps"]) part.removeAttribute(name);
|
|
447
|
+
if (next) caretAt(next, "start");
|
|
448
|
+
else if (next === null) selection.removeAllRanges();
|
|
449
|
+
},
|
|
450
|
+
/** Its package's picture, or the mark of any component. */
|
|
451
|
+
iconOf: (unit) => {
|
|
452
|
+
const entry = entryOf(unit.getAttribute(ATTRIBUTE));
|
|
453
|
+
return (entry && pictureOf(entry)) ?? ICON;
|
|
454
|
+
},
|
|
455
|
+
/**
|
|
456
|
+
* What of an instance its component writes, part by part, as the file is to hold it (null: nothing
|
|
457
|
+
* here does): its parts as the kit's dehydrate leaves them, what it and its component leave on them
|
|
458
|
+
* being no change.
|
|
459
|
+
*/
|
|
460
|
+
dataOf: (instance) => (dataParts(instance).length > 0 ? dataOf(globalThis.DocKit.dehydrate(instance.cloneNode(true))) : null),
|
|
461
|
+
/** What of an instance the file's markup of it (`html`) holds that its component writes, read as dataOf reads one on the page. */
|
|
462
|
+
dataIn(html) {
|
|
463
|
+
const template = document.createElement("template");
|
|
464
|
+
template.innerHTML = html;
|
|
465
|
+
const instance = template.content.firstElementChild;
|
|
466
|
+
return instance?.matches(INSTANCE) && dataParts(instance).length > 0 ? dataOf(globalThis.DocKit.dehydrate(instance)) : null;
|
|
467
|
+
},
|
|
468
|
+
/** The most one commit carries of what components write, in bytes. */
|
|
469
|
+
dataMost: DATA_MOST,
|
|
470
|
+
/** Of the parts of an instance named (`names`), those one edit of this page wrote together, as lists of two or more. */
|
|
471
|
+
together: (instance, names) => writtenTogether(instance).map((group) => names.filter((name) => group.includes(name))).filter((group) => group.length > 1),
|
|
472
|
+
/**
|
|
473
|
+
* The reader writes what an instance holds over what someone else wrote to its parts (`theirs`, by
|
|
474
|
+
* name, as the file held them and the reader was shown them: 仍然调整): one `source` step from theirs to
|
|
475
|
+
* what the page holds, the page as it is, so that one undo gives back what the file held and writes it
|
|
476
|
+
* again. Returns the step, or null where the page holds theirs.
|
|
477
|
+
*/
|
|
478
|
+
overwrite(instance, theirs) {
|
|
479
|
+
const parts = dataParts(instance).filter(([name, part]) => typeof theirs[name] === "string" && part.innerHTML !== theirs[name]);
|
|
480
|
+
return parts.length > 0 ? sourceStep(parts.map(([name, part]) => [part, theirs[name]])) : null;
|
|
481
|
+
},
|
|
482
|
+
/**
|
|
483
|
+
* An instance as it stood with what its component wrote (`parts`, by name, as a commit carried them)
|
|
484
|
+
* in place of what it holds: a copy off the page, a block to copy where the file did not take that
|
|
485
|
+
* write (the list of what a page left, editor.mjs showLost). Null where it holds none of those parts.
|
|
486
|
+
*/
|
|
487
|
+
withData(instance, parts) {
|
|
488
|
+
const copy = instance.cloneNode(true);
|
|
489
|
+
const written = dataParts(copy).filter(([name]) => typeof parts?.[name] === "string");
|
|
490
|
+
for (const [name, part] of written) part.innerHTML = parts[name];
|
|
491
|
+
return written.length > 0 ? copy : null;
|
|
492
|
+
},
|
|
493
|
+
/** The stamp of the manifest an instance's component wrote it by, or the page runs it by. */
|
|
494
|
+
definitionOf: (instance) => (instance.hasAttribute(WRITTEN_BY) ? instance.getAttribute(WRITTEN_BY) || undefined : brought.get(instance.getAttribute(ATTRIBUTE))?.definition),
|
|
495
|
+
/** What a package's manifest says of how its instances are read: `parts` as the kit knows them, `markdown`. */
|
|
496
|
+
packageOf: (id) => ({ markdown: entryOf(id)?.markdown, parts: globalThis.DocKit?.description(id)?.parts }),
|
|
497
|
+
install() {
|
|
498
|
+
for (const tag of document.querySelectorAll(`script[${PACKAGE_MARK}]`)) {
|
|
499
|
+
const id = tag.getAttribute(PACKAGE_MARK);
|
|
500
|
+
brought.set(id, { stamp: entryOf(id)?.stamp ?? null, definition: entryOf(id)?.definition });
|
|
501
|
+
}
|
|
502
|
+
document.addEventListener("doc-component-edit", (event) => { if (write(event.detail, event.target)) event.preventDefault(); });
|
|
503
|
+
new MutationObserver((records) => {
|
|
504
|
+
for (const { type, target, addedNodes, removedNodes, nextSibling } of records) {
|
|
505
|
+
if (type === "attributes") followFallback(target);
|
|
506
|
+
for (const node of addedNodes) {
|
|
507
|
+
if (node.nodeType !== 1 || node.hasAttribute("data-doc-dev")) continue;
|
|
508
|
+
[...(node.matches(INSTANCE) ? [node] : []), ...node.querySelectorAll(INSTANCE)].forEach(arrive);
|
|
509
|
+
}
|
|
510
|
+
for (const node of removedNodes) keepSlots(node, target, nextSibling);
|
|
511
|
+
}
|
|
512
|
+
}).observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: [FALLBACK] });
|
|
513
|
+
window.addEventListener("doc-catalog-changed", readList);
|
|
514
|
+
window.addEventListener("doc-settings-changed", ({ detail }) => followSettings(held.components, detail));
|
|
515
|
+
followCatalog();
|
|
516
|
+
},
|
|
517
|
+
/** The page edits now: what the kit showed as it stands before its text blocks were made is shut, and a component can write. */
|
|
518
|
+
entered() {
|
|
519
|
+
document.querySelectorAll(`[${FALLBACK}]`).forEach(followFallback);
|
|
520
|
+
dispatchEvent(new Event("doc-editable"));
|
|
521
|
+
},
|
|
522
|
+
};
|
|
523
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { settingState } from "../../../shared/components/installed.mjs";
|
|
2
|
+
|
|
3
|
+
// What a page runs of a package is what it was served with. A page holding an instance of one that
|
|
4
|
+
// changes is shown again; one holding none stays, as being shown again would cost its undo steps
|
|
5
|
+
// (src/server/routes.mjs), and is behind on that package from then on, which nothing reads until an
|
|
6
|
+
// instance of it comes onto the page: a menu, an undo, a paste, whatever else puts one there. One the
|
|
7
|
+
// page's new list has, of a package the page runs nothing of or runs as it now is, brings it (./page.mjs
|
|
8
|
+
// `bring`). Any other would run as the page was served, a package off still going, a changed one
|
|
9
|
+
// as it was, against what the file now is, and words typed in it would be refused. So the page keeps
|
|
10
|
+
// which packages it is behind on, and the first such instance to arrive asks for what a page holding
|
|
11
|
+
// one has already had (`doc-components-changed`): shown again once nothing waits.
|
|
12
|
+
|
|
13
|
+
const behind = new Set(); // the ids of the packages that changed since the page was served
|
|
14
|
+
let any = false; // the server could not say which: the page connected a moment after a change
|
|
15
|
+
|
|
16
|
+
/** Whether the package `id` may have changed since the page was served. */
|
|
17
|
+
export const isBehind = (id) => any || behind.has(id);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* `components`, the list a page holds, as the reader's settings now say: the state each package says,
|
|
21
|
+
* which a menu reads, at once and with nothing shown again (`doc-settings-changed`). A package that
|
|
22
|
+
* comes on is in none of that yet: it comes with the list the page reads as the catalog changes, as
|
|
23
|
+
* one added does (`doc-catalog-changed`, ./page.mjs).
|
|
24
|
+
*/
|
|
25
|
+
export function followSettings(components, settings) {
|
|
26
|
+
for (const entry of components) entry.state = settingState(entry.id, settings);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Hears what changed of the catalog while the page held no instance of it. */
|
|
30
|
+
export function followCatalog() {
|
|
31
|
+
window.addEventListener("doc-catalog-changed", ({ detail: { ids } }) => {
|
|
32
|
+
if (ids) ids.forEach((id) => behind.add(id));
|
|
33
|
+
else any = true;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { componentOf, MEDIA_BLOCKS } from "../../shared/components/index.mjs";
|
|
2
|
+
|
|
3
|
+
// The facts of the kit's markup the editor finds blocks by, as the components' descriptions say
|
|
4
|
+
// them (src/shared/components/; docs/internals.md, "Components"), for the page (Element.matches,
|
|
5
|
+
// querySelector) and the server (matchesNode, partOf on parse5's tree) alike: the editor never
|
|
6
|
+
// spells them itself. How the editor treats each component stays in its folder here.
|
|
7
|
+
|
|
8
|
+
const component = (id) => componentOf(id);
|
|
9
|
+
const part = (id, name) => component(id).parts[name].at;
|
|
10
|
+
/** The last compound of a part's chain: what the element itself is (".doc-sheet-tab"). */
|
|
11
|
+
export const stepOf = (at) => at.split(">").at(-1).trim();
|
|
12
|
+
/** The class a compound of one class names (".doc-dialog-content" -> "doc-dialog-content"). */
|
|
13
|
+
export const classOf = (selector) => /^\.([\w-]+)$/.exec(selector)?.[1] ?? null;
|
|
14
|
+
|
|
15
|
+
const pair = component("sheets").pairs[0];
|
|
16
|
+
const rowAt = part("sheets", "row").replace(/^:scope > /, "");
|
|
17
|
+
export const SHEETS = Object.freeze({
|
|
18
|
+
match: component("sheets").match,
|
|
19
|
+
row: part("sheets", "row"), // the tab row, a child of the area
|
|
20
|
+
rowAt, // the tab row wherever it stands, for matches and closest
|
|
21
|
+
tabsOfRow: ":scope > " + stepOf(part("sheets", "tabs")), // the tabs of a tab row (querySelectorAll on it)
|
|
22
|
+
tabIn: rowAt + " " + stepOf(part("sheets", "tabs")), // a tab found from inside it (closest)
|
|
23
|
+
tabs: part("sheets", "tabs"), // its tabs
|
|
24
|
+
panels: part("sheets", "panels"), // the panels, children of the area
|
|
25
|
+
tab: stepOf(part("sheets", "tabs")), // what a tab is
|
|
26
|
+
tabKey: pair.attrA, // a tab's key, its panel's the same
|
|
27
|
+
panelKey: pair.attrB,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const DIALOG = Object.freeze({
|
|
31
|
+
match: component("dialog").match,
|
|
32
|
+
content: part("dialog", "content"),
|
|
33
|
+
heading: component("heading").match, // a block of its content a card may go by
|
|
34
|
+
short: "h2, h3", // the heading a card written the short way may start with, which it takes as an h3
|
|
35
|
+
open: `${component("dialog").match}[open]`, // the card shown now
|
|
36
|
+
openContent: `${component("dialog").match}[open] ${stepOf(part("dialog", "content"))}`, // its content, where it scrolls
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const DETAILS = Object.freeze({
|
|
40
|
+
match: component("details").match,
|
|
41
|
+
label: part("details", "label"),
|
|
42
|
+
content: part("details", "content"),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export const CODE = Object.freeze({
|
|
46
|
+
match: component("code").match,
|
|
47
|
+
title: part("code", "title"),
|
|
48
|
+
pre: part("code", "code"),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
/** A highlight block, the opening summary included: the one place the editor says which elements are one. */
|
|
52
|
+
export const HIGHLIGHT = Object.freeze({ match: component("highlight").match });
|
|
53
|
+
|
|
54
|
+
/** A callout (提示块). */
|
|
55
|
+
export const CALLOUT = Object.freeze({ match: component("callout").match });
|
|
56
|
+
|
|
57
|
+
// A display formula block and an inline one (the math description's two rules).
|
|
58
|
+
const [mathInline, mathBlock] = component("math").match.split(",").map((rule) => rule.trim());
|
|
59
|
+
export const MATH = Object.freeze({ inline: mathInline, block: mathBlock });
|
|
60
|
+
|
|
61
|
+
/** The media blocks (an image, a file, a bookmark, an embed): the figures whose caption is a text block of its own. */
|
|
62
|
+
export const MEDIA = MEDIA_BLOCKS.map((id) => component(id).match).join(", ");
|
|
63
|
+
|
|
64
|
+
export const TABLE = Object.freeze({ frame: component("table").frame, lead: component("table").lead });
|
|
65
|
+
export const SECTION = Object.freeze({ match: component("section").match });
|
|
66
|
+
export const PAGE = Object.freeze({ header: component("page").header, title: component("page").title });
|
|
67
|
+
export const PARAGRAPH = Object.freeze({ tail: component("paragraph").tail });
|