@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,133 @@
|
|
|
1
|
+
import { escapeText } from "../../../shared/escape.mjs";
|
|
2
|
+
import { ATTRIBUTE, FALLBACK, INSTANCE, PACKAGE_ID, instanceMatch, refusedInCopy } from "../../../shared/components/installed.mjs";
|
|
3
|
+
import { wordsIn } from "../../page/clipboard/own/writers.mjs";
|
|
4
|
+
import { svg } from "../icons.mjs";
|
|
5
|
+
import { t } from "../../../shared/i18n/index.mjs";
|
|
6
|
+
|
|
7
|
+
// 组件: the one kind of block every component package is to the engines, the host of a package's
|
|
8
|
+
// instances (src/shared/components/installed.mjs). It uses only what a definition offers any block:
|
|
9
|
+
// the engines know no package and no part of one. An instance is one block, moved, copied and
|
|
10
|
+
// deleted whole, no container, nothing going in or out; its parts edited as text are text blocks of
|
|
11
|
+
// this kind (file.mjs finds them, as its manifest says), and everything else in it is the component's
|
|
12
|
+
// (page.mjs). A press on its outer frame or on the handle is Gallery's, as for any block.
|
|
13
|
+
//
|
|
14
|
+
// Where the engines reach it (src/editor/page/ unless named): ../source/ (the scan stops at one,
|
|
15
|
+
// natural.mjs and old names pass it by: `isInstance`, src/shared/components/), hints/ (`readOnly`), clipboard/own/
|
|
16
|
+
// (`clipboard`, copied as itself), caret.mjs (`sealed`: `editable`, where most of the page's events
|
|
17
|
+
// start from), text-select/, editor.mjs's entries and the tools that go by a kit's class (`keepsKeys`,
|
|
18
|
+
// page.mjs), formula/, the "/" menu, the format bar and clipboard/ (`formula`). The "/" menu and 在下方新建
|
|
19
|
+
// offer each package (`menuVariants`, notion-lite's, on the page object: the catalog reaches the page
|
|
20
|
+
// alone), and a new one is written from its manifest (file.mjs `source`). Its parts edited as data
|
|
21
|
+
// are written as a table's rows are (page/core.mjs dataChanges, on `dataOf` of the page object,
|
|
22
|
+
// source/apply.mjs and file.mjs `rewrite`), an undo step of `source` (page/history.mjs).
|
|
23
|
+
|
|
24
|
+
// An instance as Markdown, the words of the file and none of what a component draws: as its package's
|
|
25
|
+
// manifest says (`markdown`), each part in the file's order with `parts`, a table a table, one edited
|
|
26
|
+
// as text a paragraph and any other its words and pictures, or with `text`, and where no package says,
|
|
27
|
+
// its words as any whole block's.
|
|
28
|
+
function instanceParts(unit, how) {
|
|
29
|
+
const found = how.packageOf(unit.getAttribute(ATTRIBUTE));
|
|
30
|
+
if (found?.markdown !== "parts") return [how.words(unit)];
|
|
31
|
+
return saidParts(unit, found.parts).flatMap(({ part, edit }) => {
|
|
32
|
+
if (part.matches("table")) return [how.writtenAs("table", part)];
|
|
33
|
+
return (edit === "text" ? [how.own(part)] : [how.wordsIn(part).join(" · "), ...how.picturesIn(part)]).map((line) => [line]);
|
|
34
|
+
}).filter(([first, ...more]) => first || more.length > 0);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// The parts of an instance that say something, each once and none inside another, in the file's order.
|
|
38
|
+
function saidParts(unit, parts) {
|
|
39
|
+
const said = Object.values(parts).flatMap(({ at, edit }) => [...unit.querySelectorAll(at)].map((part) => ({ part, edit })))
|
|
40
|
+
.filter(({ part }) => !part.matches(`${INSTANCE}, script, style, template`) && part.parentElement.closest(INSTANCE) === unit);
|
|
41
|
+
const found = [...new Map(said.map((each) => [each.part, each])).values()];
|
|
42
|
+
return found.filter(({ part }) => !found.some((other) => other.part !== part && other.part.contains(part)))
|
|
43
|
+
.sort((a, b) => (a.part.compareDocumentPosition(b.part) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// A copy of an instance as blocks, what other programs and a field of plain text read of it: as its
|
|
47
|
+
// package says, as a page export writes it (instanceParts), but for pictures, which are no words. Its
|
|
48
|
+
// words are paragraphs, as `markdown: "parts"` has them; a text part that is a heading says so for the
|
|
49
|
+
// clipboard's HTML (`as`: the type it is written as there, the parts writer's).
|
|
50
|
+
function copiedParts(copy, found, { serializeInner, clipboardOf, copiedType }) {
|
|
51
|
+
if (found?.markdown !== "parts" || !found.parts) return [{ type: "paragraph", html: escapeText(wordsIn(copy).join(" · ")) }].filter(({ html }) => html);
|
|
52
|
+
return saidParts(copy, found.parts).flatMap(({ part, edit }) => {
|
|
53
|
+
if (part.matches("table")) return [clipboardOf("table").data(part, { serializeInner })].filter(Boolean);
|
|
54
|
+
const html = edit === "text" ? serializeInner(part) : escapeText(wordsIn(part).join(" · "));
|
|
55
|
+
const own = edit === "text" ? copiedType(part) : null;
|
|
56
|
+
return html ? [{ type: "paragraph", html, ...(own && clipboardOf(own)?.kind === "heading" ? { as: own } : {}) }] : [];
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// All an element holds, what a <template> keeps apart among it, itself first.
|
|
61
|
+
const allIn = (root) => [root, ...root.querySelectorAll("*")].flatMap((node) => (node.localName === "template" ? [node, ...[...node.content.children].flatMap(allIn)] : [node]));
|
|
62
|
+
// Whether any of that may not come onto a page by a clipboard.
|
|
63
|
+
const refused = (root) => allIn(root).some((node) => refusedInCopy(node.localName, [...node.attributes]));
|
|
64
|
+
// The one element a copy's markup is, or null. An element's outerHTML reads back as itself, which
|
|
65
|
+
// markup that leans on the parser does not (an end tag left out, a comment left open, an end tag of
|
|
66
|
+
// nothing): what is put right here a file reads otherwise.
|
|
67
|
+
function elementOf(html, doc = globalThis.document) {
|
|
68
|
+
const template = doc.createElement("template");
|
|
69
|
+
template.innerHTML = html;
|
|
70
|
+
const [root, ...more] = template.content.childNodes;
|
|
71
|
+
return template.innerHTML === html && root?.nodeType === 1 && more.length === 0 ? root : null;
|
|
72
|
+
}
|
|
73
|
+
// The most a description carries of one piece of markup (blocks.mjs `string`).
|
|
74
|
+
const CARRIED = 1e6;
|
|
75
|
+
|
|
76
|
+
// A block of four corners and a notch, a piece that fits something else.
|
|
77
|
+
export const ICON = svg('<path d="M4 6.75A1.75 1.75 0 0 1 5.75 5H8a2 2 0 0 1 4 0h2.25A1.75 1.75 0 0 1 16 6.75V9a2 2 0 0 1 0 4v1.25A1.75 1.75 0 0 1 14.25 16H5.75A1.75 1.75 0 0 1 4 14.25z"/>');
|
|
78
|
+
|
|
79
|
+
export default {
|
|
80
|
+
name: "installed",
|
|
81
|
+
// Ahead of every rule of the page's: all that stands in an instance is the component's, its
|
|
82
|
+
// controls too, and one of no package, or whose component failed, says why nothing there answers.
|
|
83
|
+
readOnly: [
|
|
84
|
+
{ rank: 1, at: `[${FALLBACK}] *`, says: t("这个组件没有运行:内容只能看,可以整块移动、复制和删除。") },
|
|
85
|
+
{ rank: 2, at: `[${ATTRIBUTE}] *`, says: null },
|
|
86
|
+
],
|
|
87
|
+
attributes: [ATTRIBUTE],
|
|
88
|
+
sealed: INSTANCE,
|
|
89
|
+
units: {
|
|
90
|
+
installed: {
|
|
91
|
+
name: t("组件@block"),
|
|
92
|
+
icon: ICON,
|
|
93
|
+
match: [{ rank: 0, tag: ["div", "section"], attr: ATTRIBUTE }],
|
|
94
|
+
boxed: true,
|
|
95
|
+
chapter: true,
|
|
96
|
+
copy: "itself",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
hosts: {
|
|
100
|
+
// A part a manifest edits as text: words as in a paragraph, emptied but never split, joined or
|
|
101
|
+
// taken out on its own, as a media block's caption is. No formula: the kit draws none in an
|
|
102
|
+
// instance, so one would read as its TeX from the next load on.
|
|
103
|
+
installed: { name: t("组件里的文字"), caps: () => ["empty", "links"], formula: false, placeholder: t("输入文字…") },
|
|
104
|
+
},
|
|
105
|
+
types: {
|
|
106
|
+
// An instance made on the page, in no menu of types: its package's rows are `menuVariants`, and its
|
|
107
|
+
// markup the file's, written from its manifest, or from what a clipboard carried where a copy has
|
|
108
|
+
// no unit to be made from (`data-ge-copy`).
|
|
109
|
+
installed: {
|
|
110
|
+
tag: "div", kind: "installed", bare: true,
|
|
111
|
+
extras: (element) => ({ package: element.getAttribute(ATTRIBUTE), ...(element.hasAttribute("data-ge-copy") ? { html: element.getAttribute("data-ge-copy") } : {}) }),
|
|
112
|
+
clipboard: {
|
|
113
|
+
kind: "parts", read: instanceParts,
|
|
114
|
+
// What carries it where its unit is not (cut, another document): its markup as the kit would
|
|
115
|
+
// start it, with the ids it names itself, and what it says to whoever reads no blocks. One
|
|
116
|
+
// whose markup no clipboard may bring anywhere (a handler, a script) has none, and stays a
|
|
117
|
+
// copy within its document.
|
|
118
|
+
data(node, { serializeInner, copyOf, clipboardOf, copiedType, page }) {
|
|
119
|
+
const copy = copyOf(node, { named: true });
|
|
120
|
+
const html = copy.outerHTML;
|
|
121
|
+
if (html.length > CARRIED || refused(copy) || !elementOf(html, node.ownerDocument)) return null;
|
|
122
|
+
const id = node.getAttribute(ATTRIBUTE);
|
|
123
|
+
return { type: "installed", package: id, html, blocks: copiedParts(copy, page("installed")?.packageOf(id), { serializeInner, clipboardOf, copiedType }) };
|
|
124
|
+
},
|
|
125
|
+
check(block, { string, valid }) {
|
|
126
|
+
if (!string(block.package, 200) || !PACKAGE_ID.test(block.package) || !string(block.html, CARRIED) || !Array.isArray(block.blocks) || !block.blocks.every((inner) => valid(inner))) return false;
|
|
127
|
+
const root = elementOf(block.html);
|
|
128
|
+
return Boolean(root?.matches(instanceMatch(block.package))) && !refused(root);
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
};
|
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import { ARRIVING, ATTRIBUTE, DATA_MOST, DATA_SHOWN, FALLBACK, FIELDS, INSTANCE, NO_TEXT, PACKAGE_MARK, SCHEMA, fitsDataScript, instanceMatch, isDataScript, noDataPart, refusedInData, schemaAhead } from "../../../shared/components/installed.mjs";
|
|
2
|
+
import { referencedIds } from "../../../shared/copy-ids.mjs";
|
|
3
|
+
import { language } from "../../../shared/i18n/index.mjs";
|
|
4
|
+
import { caretAt, editable } from "../../page/caret.mjs";
|
|
5
|
+
import { copyOf } from "../../page/clipboard/own/describe.mjs";
|
|
6
|
+
import { ownIds } from "../../page/clipboard/own/ids.mjs";
|
|
7
|
+
import { unitElement } from "../../page/core.mjs";
|
|
8
|
+
import { accepts, capsFor } from "../registry.mjs";
|
|
9
|
+
import { ICON } from "./index.mjs";
|
|
10
|
+
import { followCatalog, followSettings, isBehind } from "./served.mjs";
|
|
11
|
+
|
|
12
|
+
// 组件 on the page: events go by region, one rule. What comes down inside an instance and in no text
|
|
13
|
+
// block of it is the component's, and the editor lets go (`keepsKeys`, the same rule as notion-lite's
|
|
14
|
+
// block-keys and clipboard, `e.target.closest('input, textarea')`: a field of a block keeps its keys,
|
|
15
|
+
// here all that stands in an instance, its buttons and what it draws, but undo and redo on what is no
|
|
16
|
+
// field, which has none of its own). Its text parts are the editor's: Enter, Backspace, Ctrl+Z and a
|
|
17
|
+
// selection as in any words. Its outer frame and its handle are Gallery's: moving, copying and deleting
|
|
18
|
+
// it whole, as for any block. What a press does here, the block tools clearing, menus closing and the
|
|
19
|
+
// format bar going, stays: no event is stopped, and a press in a component is only no press the editor
|
|
20
|
+
// answers (`readOnly` in index.mjs says nothing of it, and the format bar comes back over no selection).
|
|
21
|
+
//
|
|
22
|
+
// The page holds the catalog as the server gave it (its map's `components`): a page with no instance
|
|
23
|
+
// of a package that changes is told so and stays as it is, as being shown again would cost its undo
|
|
24
|
+
// steps, so it reads the new list from its own address, which is what a load of the page would have
|
|
25
|
+
// read (`doc-catalog-changed`, src/server/routes.mjs). An instance is made from a template or from
|
|
26
|
+
// what a clipboard carried, here as what the kit would start: its text parts text blocks at once, the
|
|
27
|
+
// caret among them. The first instance of a package on a page served without it, by whatever way it
|
|
28
|
+
// came, brings it: the tags of the map, once, where the server would have put them.
|
|
29
|
+
//
|
|
30
|
+
// A part its manifest edits as data is the component's and nothing of the editor's goes in. What
|
|
31
|
+
// writes it is `context.edit`, which the kit asks of the page (`doc-component-edit`): the page gives the
|
|
32
|
+
// component a draft of each part it names, off the page, and copies of what it made of them go in, one
|
|
33
|
+
// `source` step of undo, or, should it throw, write the part on the page or make what the file could
|
|
34
|
+
// not hold, nothing has happened. The commits find what changed as they find a table's (`dataOf`,
|
|
35
|
+
// core.mjs dataChanges), each part as the kit's dehydrate leaves it, so that what the component leaves
|
|
36
|
+
// on it by its manifest's `runtime` is no change, and they write what differs and nothing else. An
|
|
37
|
+
// instance written whole, made or put back, holds what the file says (`dataIn`), read the same way. What
|
|
38
|
+
// the reader writes over someone else's change of a part (仍然调整) is a step of its own from theirs
|
|
39
|
+
// (`overwrite`), so that one undo gives the file's back.
|
|
40
|
+
// One past its manifest's `schema` is read-only, its words and all.
|
|
41
|
+
|
|
42
|
+
let held = null; // the map, what makes a block with no editor (the transfer worker) finds none of
|
|
43
|
+
|
|
44
|
+
// A package as the page knows it. One hidden is one like any other but in a menu: its instances run, copy
|
|
45
|
+
// and go by its name. One turned off is none from the moment the page hears, whatever its list still
|
|
46
|
+
// says: what a clipboard brings would load it, and only a list that came would say otherwise.
|
|
47
|
+
const entryOf = (id) => held?.components?.find((entry) => entry.id === id && entry.state !== "disabled") ?? null;
|
|
48
|
+
|
|
49
|
+
// What the page runs of each package, by id: the stamp it came with and that of its manifest.
|
|
50
|
+
const brought = new Map();
|
|
51
|
+
|
|
52
|
+
// On an instance its component wrote: the stamp of the manifest that component ran by, which the write
|
|
53
|
+
// goes by wherever it is sent from, a page taking up what one that is gone left (autosave.mjs recover)
|
|
54
|
+
// running the manifest there is now.
|
|
55
|
+
const WRITTEN_BY = "data-ge-definition";
|
|
56
|
+
|
|
57
|
+
// Whether the page runs an older version of a package than `entry` says, which only a load mends.
|
|
58
|
+
const overtaken = ({ id, stamp }) => brought.has(id) && brought.get(id).stamp !== stamp;
|
|
59
|
+
|
|
60
|
+
// On an instance, the parts of it one edit wrote together, as lists of names (JSON): they go to the file
|
|
61
|
+
// together, or wait together for the reader where someone else changed one of them, as the edit's one
|
|
62
|
+
// undo step takes them together. On the instance, as its stamp is, so that a page taking up what one that
|
|
63
|
+
// is gone left (its body, autosave.mjs recover) sends them so too.
|
|
64
|
+
const WRITTEN_TOGETHER = "data-ge-together";
|
|
65
|
+
const writtenTogether = (instance) => {
|
|
66
|
+
try {
|
|
67
|
+
const groups = JSON.parse(instance.getAttribute(WRITTEN_TOGETHER) ?? "[]");
|
|
68
|
+
return Array.isArray(groups) ? groups.filter(Array.isArray) : [];
|
|
69
|
+
} catch {
|
|
70
|
+
return [];
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// A tag of a package's as an element that will run: what a template's content holds never does.
|
|
75
|
+
function tagFrom(html) {
|
|
76
|
+
const template = document.createElement("template");
|
|
77
|
+
template.innerHTML = html;
|
|
78
|
+
const written = template.content.firstElementChild;
|
|
79
|
+
const tag = document.createElement(written.localName);
|
|
80
|
+
for (const { name, value } of written.attributes) tag.setAttribute(name, value);
|
|
81
|
+
tag.textContent = written.textContent;
|
|
82
|
+
if (written.localName === "script") tag.async = false; // in the order they are put in
|
|
83
|
+
return tag;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Right after the last of the kit's and the packages' of its kind, as a page is served (render/assets.mjs afterKitTags).
|
|
87
|
+
function put(tag) {
|
|
88
|
+
const kind = tag.localName;
|
|
89
|
+
const last = [...document.querySelectorAll(`${kind}[data-doc-kit], ${kind}[data-doc-vendor], ${kind}[${PACKAGE_MARK}]`)].at(-1);
|
|
90
|
+
if (last) last.after(tag);
|
|
91
|
+
else (kind === "link" ? document.head : document.body).append(tag);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// The kit's file a tag loads is on the page already (by another package, or as the page was served).
|
|
95
|
+
const onPage = (tag) => ["data-doc-kit", "data-doc-vendor"].some((mark) => tag.hasAttribute(mark) && document.querySelector(`[${mark}="${tag.getAttribute(mark)}"]`));
|
|
96
|
+
|
|
97
|
+
// The instances of a package start, or show why they do not, now that its files are in.
|
|
98
|
+
const started = (id) => document.querySelectorAll(instanceMatch(id)).forEach((host) => globalThis.DocKit?.mount(host));
|
|
99
|
+
|
|
100
|
+
// A package on a page served without it: its tags in order, styles then scripts, the kit's files it
|
|
101
|
+
// asks for first. Its description is told at once, its script's own turn comes as it loads.
|
|
102
|
+
function bring({ id, stamp, definition, kit = [], tags }) {
|
|
103
|
+
if (brought.has(id)) return;
|
|
104
|
+
brought.set(id, { stamp, definition });
|
|
105
|
+
const all = [...kit, ...tags.styles, ...tags.scripts].map(tagFrom).filter((tag) => !onPage(tag));
|
|
106
|
+
const script = all.find((tag) => tag.localName === "script" && tag.src && tag.hasAttribute(PACKAGE_MARK));
|
|
107
|
+
const done = () => {
|
|
108
|
+
script?.removeAttribute(ARRIVING);
|
|
109
|
+
started(id);
|
|
110
|
+
};
|
|
111
|
+
script?.setAttribute(ARRIVING, id);
|
|
112
|
+
script?.addEventListener("load", done, { once: true });
|
|
113
|
+
script?.addEventListener("error", done, { once: true });
|
|
114
|
+
all.forEach(put);
|
|
115
|
+
if (!script) done();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// An instance's parts as its manifest says them, as the kit was told. None before its description has come.
|
|
119
|
+
const partsOf = (instance) => Object.entries(globalThis.DocKit?.description(instance.getAttribute(ATTRIBUTE))?.parts ?? {});
|
|
120
|
+
// Whether an instance holds its content in a shape its manifest does not reach, as the kit was told it.
|
|
121
|
+
const ahead = (instance) => schemaAhead(instance.getAttribute(SCHEMA), globalThis.DocKit?.description(instance.getAttribute(ATTRIBUTE))?.schema);
|
|
122
|
+
// The elements of a part an instance holds, none of an instance in it nor of what the kit draws of a
|
|
123
|
+
// script of data there, which is no element of the file's.
|
|
124
|
+
const elementsOf = (instance, at) => [...instance.querySelectorAll(at)].filter((part) => !part.matches(INSTANCE) && part.parentElement.closest(INSTANCE) === instance && !part.closest(`.${DATA_SHOWN}`));
|
|
125
|
+
|
|
126
|
+
// The elements of an instance its component writes, [[name, element]], as the server finds them
|
|
127
|
+
// (file.mjs dataParts): of each part edited as data the first it holds, as context.part does. One in
|
|
128
|
+
// another is written with that one, and an element two parts name is the first's.
|
|
129
|
+
function dataParts(instance) {
|
|
130
|
+
const first = partsOf(instance).filter(([, { edit }]) => edit === "data").map(([name, { at }]) => [name, elementsOf(instance, at)[0]]).filter(([, part]) => part);
|
|
131
|
+
return first.filter(([, part], index) => !first.some(([, other], at) => (other !== part && other.contains(part)) || (other === part && at < index)));
|
|
132
|
+
}
|
|
133
|
+
const dataOf = (instance) => Object.fromEntries(dataParts(instance).map(([name, part]) => [name, part.innerHTML]));
|
|
134
|
+
|
|
135
|
+
// The elements of an instance its package edits as text, as the server's scan finds them
|
|
136
|
+
// (file.mjs textParts), in the file's order: what stands in a data part or holds one is the component's,
|
|
137
|
+
// and one past its manifest has none.
|
|
138
|
+
function textParts(instance) {
|
|
139
|
+
if (ahead(instance)) return [];
|
|
140
|
+
const said = partsOf(instance).filter(([, { edit }]) => edit === "text");
|
|
141
|
+
const data = dataParts(instance).map(([, part]) => part);
|
|
142
|
+
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)));
|
|
143
|
+
return parts.filter((part) => !parts.some((other) => other !== part && other.contains(part))).sort((a, b) => (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// All an element holds, what a <template> keeps apart among it.
|
|
147
|
+
const allIn = (root) => [...root.querySelectorAll("*")].flatMap((node) => (node.localName === "template" ? [node, ...allIn(node.content)] : [node]));
|
|
148
|
+
|
|
149
|
+
// Why what a component made of a draft of `part` cannot go in, as the server would say (file.mjs
|
|
150
|
+
// `rewrite`), for who writes the component, or null.
|
|
151
|
+
function draftProblem(part, draft) {
|
|
152
|
+
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";
|
|
153
|
+
const html = draft.innerHTML;
|
|
154
|
+
if (new TextEncoder().encode(html).length > DATA_MOST) return `it holds more than the ${DATA_MOST} bytes one commit writes`;
|
|
155
|
+
const attributes = [...part.attributes];
|
|
156
|
+
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";
|
|
157
|
+
if (noDataPart(part.localName)) return `a <${part.localName}> is no part a component can write`;
|
|
158
|
+
const read = part.cloneNode(false);
|
|
159
|
+
read.innerHTML = html;
|
|
160
|
+
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";
|
|
161
|
+
const refused = allIn(draft).find((node) => refusedInData(node.localName, [...node.attributes]));
|
|
162
|
+
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;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// What the text blocks of an instance are to contenteditable: an instance the kit shows as it stands,
|
|
166
|
+
// its component failed or its script started nothing, takes no word, as one of no package does.
|
|
167
|
+
const openness = (instance) => (instance.hasAttribute(FALLBACK) ? "false" : "true");
|
|
168
|
+
|
|
169
|
+
// Its text blocks as it stands now, for as long as it stands so: a later mount opens them again.
|
|
170
|
+
function followFallback(instance) {
|
|
171
|
+
const value = openness(instance);
|
|
172
|
+
for (const part of instance.querySelectorAll('[data-ge-kind="installed"]')) {
|
|
173
|
+
if (part.parentElement.closest(INSTANCE) === instance && part.getAttribute("contenteditable") !== value) part.setAttribute("contenteditable", value);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Its text parts text blocks now: `data-ge-part`, holding what each said, until the commit that writes
|
|
178
|
+
// the instance names them. What the file then says is what they start from: words typed before that
|
|
179
|
+
// go with the next commit, an untouched one shows the file's, and one the file takes for no text
|
|
180
|
+
// block (more than words in it: `notText`) is read-only from then on.
|
|
181
|
+
function editableParts(instance) {
|
|
182
|
+
const parts = textParts(instance);
|
|
183
|
+
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);
|
|
184
|
+
return parts;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** 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. */
|
|
188
|
+
function newInstance(doc, html) {
|
|
189
|
+
const template = doc.createElement("template");
|
|
190
|
+
template.innerHTML = html;
|
|
191
|
+
const instance = doc.importNode(template.content.firstElementChild, true);
|
|
192
|
+
const all = [instance, ...instance.querySelectorAll("*")];
|
|
193
|
+
const named = referencedIds(all.flatMap((node) => [...node.attributes]));
|
|
194
|
+
for (const node of all) if (node.id && !named.has(node.id)) node.removeAttribute("id");
|
|
195
|
+
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);
|
|
196
|
+
return instance;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** An instance from what a clipboard carried (`data`): the file is written from that markup, which the commit sends. */
|
|
200
|
+
export function build({ doc, block }) {
|
|
201
|
+
const entry = entryOf(block.package);
|
|
202
|
+
if (entry) bring(entry);
|
|
203
|
+
const instance = newInstance(doc, block.html);
|
|
204
|
+
instance.setAttribute("data-ge-copy", block.html);
|
|
205
|
+
editableParts(instance);
|
|
206
|
+
return instance;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
let listed = true; // whether the list says what the server last did: no read of it on its way, none that failed
|
|
210
|
+
let reads = 0; // the reads of the list begun
|
|
211
|
+
|
|
212
|
+
// The list as a load of the page would give it, read from the page's own address: nothing of the page
|
|
213
|
+
// changes. Reads may cross: the last one begun is what the server last did, whichever answers last.
|
|
214
|
+
async function readList() {
|
|
215
|
+
const read = ++reads;
|
|
216
|
+
listed = false;
|
|
217
|
+
const answer = await fetch(location.href, { cache: "no-store" }).catch(() => null);
|
|
218
|
+
const text = answer?.ok ? await answer.text().catch(() => null) : null;
|
|
219
|
+
const map = text && new DOMParser().parseFromString(text, "text/html").getElementById("doc-edit-map");
|
|
220
|
+
if (read !== reads || !map) return;
|
|
221
|
+
held.components = JSON.parse(map.textContent).components ?? [];
|
|
222
|
+
listed = true;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Whether an instance of a package can come onto the page as it is (`entry`, as entryOf finds it): the
|
|
226
|
+
// list says what the package is now, and the page runs that or nothing of it, so that the instance brings it.
|
|
227
|
+
const inStep = (entry) => listed && entry !== null && !overtaken(entry);
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* An instance on the page, a page's new one: of a package the page is behind on that cannot come as it
|
|
231
|
+
* is, what a page holding one when it changed has had; else its package brought, what it holds as text
|
|
232
|
+
* blocks where it came with none.
|
|
233
|
+
*/
|
|
234
|
+
function arrive(instance) {
|
|
235
|
+
if (!instance.isConnected || instance.parentElement?.closest(INSTANCE)) return;
|
|
236
|
+
const id = instance.getAttribute(ATTRIBUTE);
|
|
237
|
+
const entry = entryOf(id);
|
|
238
|
+
if (isBehind(id) && !inStep(entry)) return void window.dispatchEvent(new CustomEvent("doc-components-changed"));
|
|
239
|
+
if (!entry) return;
|
|
240
|
+
bring(entry);
|
|
241
|
+
started(id);
|
|
242
|
+
if (!instance.querySelector("[data-ge-block], [data-ge-part]")) editableParts(instance);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// A package's picture where a menu shows a mark.
|
|
246
|
+
const pictureOf = ({ preview }) => (preview ? `<img src="${preview}" alt="">` : null);
|
|
247
|
+
|
|
248
|
+
/** An instance on the page: what its events are, what Enter does in its words, and what the menus make of its package. */
|
|
249
|
+
export function create({ map, newParagraph, active, sourceStep }) {
|
|
250
|
+
held = map;
|
|
251
|
+
// Whether a key in an instance, on no field of it, is undo or redo: a button or what a component draws
|
|
252
|
+
// has no undo of its own, and a press on one that wrote leaves the focus there, from where the page's
|
|
253
|
+
// undo goes on through every step, as notion-lite's does from anywhere (onHistoryKey). A field keeps
|
|
254
|
+
// its own.
|
|
255
|
+
const pageUndo = (node, event) => {
|
|
256
|
+
const key = event?.key?.toLowerCase();
|
|
257
|
+
return Boolean(event?.ctrlKey || event?.metaKey) && !event.altKey && (key === "z" || key === "y") && !node.matches(FIELDS);
|
|
258
|
+
};
|
|
259
|
+
// What a component asks to write (`detail` of doc-component-edit, the kit's: the parts it names, and
|
|
260
|
+
// `run`, its change, given a draft of each by name): whether it was taken. What was written goes in as
|
|
261
|
+
// copies, so that a draft the component keeps reaches nothing on the page; a change that wrote the part
|
|
262
|
+
// on the page instead is undone and refused, as its step would undo the change it left out.
|
|
263
|
+
function write({ parts, run }, instance) {
|
|
264
|
+
if (!active()) return false;
|
|
265
|
+
const id = instance.getAttribute(ATTRIBUTE);
|
|
266
|
+
const refuse = (problem) => {
|
|
267
|
+
console.error(`[DocKit] ${id}: context.edit: ${problem}`);
|
|
268
|
+
return false;
|
|
269
|
+
};
|
|
270
|
+
const before = parts.map(({ part }) => part.innerHTML);
|
|
271
|
+
const drafts = parts.map(({ part }) => part.cloneNode(true));
|
|
272
|
+
const ran = run(Object.fromEntries(parts.map(({ name }, index) => [name, drafts[index]])));
|
|
273
|
+
const live = parts.findIndex(({ part }, index) => part.innerHTML !== before[index]);
|
|
274
|
+
if (live >= 0) {
|
|
275
|
+
parts.forEach(({ part }, index) => { if (part.innerHTML !== before[index]) part.innerHTML = before[index]; });
|
|
276
|
+
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`);
|
|
277
|
+
}
|
|
278
|
+
if (!ran) return false;
|
|
279
|
+
for (const [index, { name, part }] of parts.entries()) {
|
|
280
|
+
const problem = draftProblem(part, drafts[index]);
|
|
281
|
+
if (problem) return refuse(parts.length > 1 ? `${name}: ${problem}` : problem);
|
|
282
|
+
}
|
|
283
|
+
const changed = parts.map(({ name, part }, index) => [part, before[index], drafts[index], name]).filter(([, was, draft]) => draft.innerHTML !== was);
|
|
284
|
+
if (changed.length === 0) return true;
|
|
285
|
+
for (const [part, , draft] of changed) part.replaceChildren(...draft.cloneNode(true).childNodes);
|
|
286
|
+
instance.setAttribute(WRITTEN_BY, brought.get(id)?.definition ?? "");
|
|
287
|
+
if (changed.length > 1) {
|
|
288
|
+
const names = new Set(changed.map(([, , , name]) => name));
|
|
289
|
+
const groups = writtenTogether(instance);
|
|
290
|
+
const joined = groups.filter((group) => group.some((name) => names.has(name)));
|
|
291
|
+
instance.setAttribute(WRITTEN_TOGETHER, JSON.stringify([...groups.filter((group) => !joined.includes(group)), [...new Set([...names, ...joined.flat()])]]));
|
|
292
|
+
}
|
|
293
|
+
sourceStep(changed.map(([part, was]) => [part, was]));
|
|
294
|
+
return true;
|
|
295
|
+
}
|
|
296
|
+
return {
|
|
297
|
+
keepsKeys: (node, event) => node?.nodeType === 1 && Boolean(node.parentElement?.closest(INSTANCE)) && !editable(node) && !pageUndo(node, event),
|
|
298
|
+
undoHere: (node) => Boolean(node.parentElement?.closest(INSTANCE)) && !editable(node),
|
|
299
|
+
keys: {
|
|
300
|
+
// notion-lite's captionEnter: words of a block that are not the block's own line do not split,
|
|
301
|
+
// Enter there is a text block after the block, the caret in it.
|
|
302
|
+
enter({ host }) {
|
|
303
|
+
const unit = unitElement(host);
|
|
304
|
+
const box = unit?.parentElement;
|
|
305
|
+
if (!box || !accepts(box.getAttribute("data-ge-box-kind") ?? "flow", "paragraph")) return false;
|
|
306
|
+
newParagraph(box, unit);
|
|
307
|
+
return true;
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
// Each package with a template that is offered (its `state`, as `isHidden` of page/offered.mjs goes
|
|
311
|
+
// by block types), by its id, as notion-lite's variants: a row of the menus, found by its name in
|
|
312
|
+
// either language and its words, and what makes one (notion-lite's
|
|
313
|
+
// insertTypedBlock: the caret in its first text part; with none, in an empty paragraph after it, as
|
|
314
|
+
// for a divider).
|
|
315
|
+
menuVariants: () => Object.fromEntries((map.components ?? []).filter(({ template, state }) => template && state === "normal").map((entry) => [entry.id, {
|
|
316
|
+
label: entry.name[language],
|
|
317
|
+
icon: pictureOf(entry) ?? ICON,
|
|
318
|
+
words: `${entry.name.zh} ${entry.name.en} ${entry.id} ${entry.words}`.toLowerCase(),
|
|
319
|
+
sample: true,
|
|
320
|
+
preview: { src: entry.preview, says: entry.description[language] },
|
|
321
|
+
create({ doc, put: place, paragraph }) {
|
|
322
|
+
bring(entry);
|
|
323
|
+
const instance = newInstance(doc, entry.template);
|
|
324
|
+
ownIds(doc, [instance]);
|
|
325
|
+
place(instance);
|
|
326
|
+
return editableParts(instance)[0] ?? place(paragraph());
|
|
327
|
+
},
|
|
328
|
+
}])),
|
|
329
|
+
/** What the reader calls a block of it: its package's name, where the page knows its package. */
|
|
330
|
+
nameOf: (unit) => entryOf(unit.getAttribute(ATTRIBUTE))?.name[language] ?? null,
|
|
331
|
+
/**
|
|
332
|
+
* One the file dropped that the page still shows, a reader's to keep: it goes from now on as what a
|
|
333
|
+
* clipboard carried does, its markup as the kit would start it. Its template would not hold what
|
|
334
|
+
* the reader has.
|
|
335
|
+
*/
|
|
336
|
+
renew(instance) {
|
|
337
|
+
if (!instance.hasAttribute("data-ge-copy")) instance.setAttribute("data-ge-copy", copyOf(instance, { named: true }).outerHTML);
|
|
338
|
+
instance.setAttribute("data-ge-type", "installed");
|
|
339
|
+
return true;
|
|
340
|
+
},
|
|
341
|
+
/** A text part the file takes for no text block: as it stood, read-only, the caret on to the next one that is. */
|
|
342
|
+
notText(part) {
|
|
343
|
+
const selection = getSelection();
|
|
344
|
+
const next = selection.rangeCount > 0 && part.contains(selection.anchorNode) ? textParts(part.parentElement.closest(INSTANCE)).find((other) => other !== part && other.isContentEditable) ?? null : undefined;
|
|
345
|
+
part.innerHTML = part.getAttribute("data-ge-part");
|
|
346
|
+
for (const name of ["contenteditable", "data-ge-part", "data-ge-kind", "data-ge-framed", "data-ge-caps"]) part.removeAttribute(name);
|
|
347
|
+
if (next) caretAt(next, "start");
|
|
348
|
+
else if (next === null) selection.removeAllRanges();
|
|
349
|
+
},
|
|
350
|
+
/** Its package's picture, or the mark of any component. */
|
|
351
|
+
iconOf: (unit) => {
|
|
352
|
+
const entry = entryOf(unit.getAttribute(ATTRIBUTE));
|
|
353
|
+
return (entry && pictureOf(entry)) ?? ICON;
|
|
354
|
+
},
|
|
355
|
+
/**
|
|
356
|
+
* What of an instance its component writes, part by part, as the file is to hold it (null: nothing
|
|
357
|
+
* here does): its parts as the kit's dehydrate leaves them, what it and its component leave on them
|
|
358
|
+
* being no change.
|
|
359
|
+
*/
|
|
360
|
+
dataOf: (instance) => (dataParts(instance).length > 0 ? dataOf(globalThis.DocKit.dehydrate(instance.cloneNode(true))) : null),
|
|
361
|
+
/** What of an instance the file's markup of it (`html`) holds that its component writes, read as dataOf reads one on the page. */
|
|
362
|
+
dataIn(html) {
|
|
363
|
+
const template = document.createElement("template");
|
|
364
|
+
template.innerHTML = html;
|
|
365
|
+
const instance = template.content.firstElementChild;
|
|
366
|
+
return instance?.matches(INSTANCE) && dataParts(instance).length > 0 ? dataOf(globalThis.DocKit.dehydrate(instance)) : null;
|
|
367
|
+
},
|
|
368
|
+
/** The most one commit carries of what components write, in bytes. */
|
|
369
|
+
dataMost: DATA_MOST,
|
|
370
|
+
/** Of the parts of an instance named (`names`), those one edit of this page wrote together, as lists of two or more. */
|
|
371
|
+
together: (instance, names) => writtenTogether(instance).map((group) => names.filter((name) => group.includes(name))).filter((group) => group.length > 1),
|
|
372
|
+
/**
|
|
373
|
+
* The reader writes what an instance holds over what someone else wrote to its parts (`theirs`, by
|
|
374
|
+
* name, as the file held them and the reader was shown them: 仍然调整): one `source` step from theirs to
|
|
375
|
+
* what the page holds, the page as it is, so that one undo gives back what the file held and writes it
|
|
376
|
+
* again. Returns the step, or null where the page holds theirs.
|
|
377
|
+
*/
|
|
378
|
+
overwrite(instance, theirs) {
|
|
379
|
+
const parts = dataParts(instance).filter(([name, part]) => typeof theirs[name] === "string" && part.innerHTML !== theirs[name]);
|
|
380
|
+
return parts.length > 0 ? sourceStep(parts.map(([name, part]) => [part, theirs[name]])) : null;
|
|
381
|
+
},
|
|
382
|
+
/**
|
|
383
|
+
* An instance as it stood with what its component wrote (`parts`, by name, as a commit carried them)
|
|
384
|
+
* in place of what it holds: a copy off the page, a block to copy where the file did not take that
|
|
385
|
+
* write (the list of what a page left, editor.mjs showLost). Null where it holds none of those parts.
|
|
386
|
+
*/
|
|
387
|
+
withData(instance, parts) {
|
|
388
|
+
const copy = instance.cloneNode(true);
|
|
389
|
+
const written = dataParts(copy).filter(([name]) => typeof parts?.[name] === "string");
|
|
390
|
+
for (const [name, part] of written) part.innerHTML = parts[name];
|
|
391
|
+
return written.length > 0 ? copy : null;
|
|
392
|
+
},
|
|
393
|
+
/** The stamp of the manifest an instance's component wrote it by, or the page runs it by. */
|
|
394
|
+
definitionOf: (instance) => (instance.hasAttribute(WRITTEN_BY) ? instance.getAttribute(WRITTEN_BY) || undefined : brought.get(instance.getAttribute(ATTRIBUTE))?.definition),
|
|
395
|
+
/** What a package's manifest says of how its instances are read: `parts` as the kit knows them, `markdown`. */
|
|
396
|
+
packageOf: (id) => ({ markdown: entryOf(id)?.markdown, parts: globalThis.DocKit?.description(id)?.parts }),
|
|
397
|
+
install() {
|
|
398
|
+
for (const tag of document.querySelectorAll(`script[${PACKAGE_MARK}]`)) {
|
|
399
|
+
const id = tag.getAttribute(PACKAGE_MARK);
|
|
400
|
+
brought.set(id, { stamp: entryOf(id)?.stamp ?? null, definition: entryOf(id)?.definition });
|
|
401
|
+
}
|
|
402
|
+
document.addEventListener("doc-component-edit", (event) => { if (write(event.detail, event.target)) event.preventDefault(); });
|
|
403
|
+
new MutationObserver((records) => {
|
|
404
|
+
for (const { type, target, addedNodes } of records) {
|
|
405
|
+
if (type === "attributes") followFallback(target);
|
|
406
|
+
for (const node of addedNodes) {
|
|
407
|
+
if (node.nodeType !== 1 || node.hasAttribute("data-doc-dev")) continue;
|
|
408
|
+
[...(node.matches(INSTANCE) ? [node] : []), ...node.querySelectorAll(INSTANCE)].forEach(arrive);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}).observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: [FALLBACK] });
|
|
412
|
+
window.addEventListener("doc-catalog-changed", readList);
|
|
413
|
+
window.addEventListener("doc-settings-changed", ({ detail }) => followSettings(held.components, detail));
|
|
414
|
+
followCatalog();
|
|
415
|
+
},
|
|
416
|
+
/** The page edits now: what the kit showed as it stands before its text blocks were made is shut, and a component can write. */
|
|
417
|
+
entered() {
|
|
418
|
+
document.querySelectorAll(`[${FALLBACK}]`).forEach(followFallback);
|
|
419
|
+
dispatchEvent(new Event("doc-editable"));
|
|
420
|
+
},
|
|
421
|
+
};
|
|
422
|
+
}
|
|
@@ -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
|
+
}
|