@vite-hub/ui 0.1.0 → 0.4.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/README.md +247 -21
- package/dist/attachments-BzTwqRTU.js +90 -0
- package/dist/{avatar-stack-DXmCQhxd.d.ts → avatar-stack-DPRFuezh.d.ts} +1 -1
- package/dist/choices-input-ByXJvDn1.d.ts +94 -0
- package/dist/{code-view-J4OsgEdh.js → code-view-DsU-xzic.js} +20 -4
- package/dist/colors-BghReA9C-CjF9gnmy.js +28 -0
- package/dist/comment-attachments-C4yNbcx5.js +20 -0
- package/dist/comment-composer-fINL5bxo.d.ts +243 -0
- package/dist/comment-composer-jYv2ULNP.js +591 -0
- package/dist/comment-layer-C_sbPIR5.d.ts +176 -0
- package/dist/comment-list-BcSaLngS.d.ts +62 -0
- package/dist/comment-marks.css +234 -0
- package/dist/comment-panel-CfvdRUMX.d.ts +208 -0
- package/dist/comment-person-CLPlW_SS.js +40 -0
- package/dist/comment-pin-DHOdRvUw.d.ts +68 -0
- package/dist/comment-row-Bn3nr8l5.js +39 -0
- package/dist/comment-selection-bar-CyVBNYl9.d.ts +42 -0
- package/dist/comment-thread-DKJjmWN0.d.ts +385 -0
- package/dist/comment-visibility-DsVuVndP.d.ts +40 -0
- package/dist/{comments-C08J3z4e.js → comments-D0d26ghV.js} +210 -59
- package/dist/comments-D8hulVPy.d.ts +198 -0
- package/dist/comments-context-C2lOZyQ5.js +38 -0
- package/dist/config-DgxBW013.d.ts +80 -0
- package/dist/config-Dk67emQt.js +63 -0
- package/dist/copy-button-CRN3kmSD.js +253 -0
- package/dist/draw-DzSmD7uo-Dwz8zoH2.js +72976 -0
- package/dist/editor-C_wt4RRV.js +582 -0
- package/dist/error-diagnostics-SXtnk6bz.js +38 -0
- package/dist/{file-tree-C1pv4_AI.js → file-tree-C4OYgbV-.js} +292 -145
- package/dist/{file-tree-Ctb8hZ_g.d.ts → file-tree-DlT9RGhu.d.ts} +51 -15
- package/dist/format-orwcdZL_.js +39 -0
- package/dist/handlers-DMl-Na3x.js +182 -0
- package/dist/headless.d.ts +5 -176
- package/dist/headless.js +5 -3
- package/dist/icon-swap.css +69 -0
- package/dist/{image-preview-VfknBEFu.js → image-preview-C9tdkmEj.js} +8 -5
- package/dist/{index-DcH0QSI5.d.ts → index-BYRFQfCd.d.ts} +14 -0
- package/dist/{code-view-vDM-hph-.d.ts → index-CNY1uNTh.d.ts} +14 -228
- package/dist/index.d.ts +55 -57
- package/dist/index.js +678 -25
- package/dist/markdown-editor-CMbNZOdN.js +2394 -0
- package/dist/markdown-editor-wQF0yD5o.d.ts +195 -0
- package/dist/markdown-editor.d.ts +108 -0
- package/dist/markdown-editor.js +3 -0
- package/dist/message-scroller-jrYN9dG9.d.ts +175 -0
- package/dist/nuxt-ui-DSQFzq3s.js +38 -0
- package/dist/nuxt.d.ts +84 -2
- package/dist/nuxt.js +243 -35
- package/dist/parts/components/agent-session.d.ts +254 -0
- package/dist/parts/components/agent-session.js +640 -0
- package/dist/{attachment-BBndG9_P.d.ts → parts/components/attachment.d.ts} +14 -15
- package/dist/{attachment-B3dXC7jM.js → parts/components/attachment.js} +6 -4
- package/dist/{avatar-stack.d.ts → parts/components/avatar-stack.d.ts} +1 -1
- package/dist/{avatar-stack-DM6HRnc0.js → parts/components/avatar-stack.js} +2 -5
- package/dist/{bubble-BJH2rfii.d.ts → parts/components/bubble.d.ts} +7 -8
- package/dist/{bubble-BPyFQlW7.js → parts/components/bubble.js} +2 -2
- package/dist/{chat-message-mpDmZbIC.d.ts → parts/components/chat-message.d.ts} +2 -3
- package/dist/{chat-message-BNK9G7xF.js → parts/components/chat-message.js} +4 -4
- package/dist/{chat-session-D6C7VJBR.d.ts → parts/components/chat-session.d.ts} +3 -4
- package/dist/{chat-session-DYEHB1HC.js → parts/components/chat-session.js} +2 -2
- package/dist/{chat-B9HlZWA2.d.ts → parts/components/chat.d.ts} +8 -4
- package/dist/{chat-BoFHlu9V.js → parts/components/chat.js} +42 -9
- package/dist/{highlighted-code-Dzf6o54i.d.ts → parts/components/code-block.d.ts} +15 -23
- package/dist/{code-block-Br-02hn-.js → parts/components/code-block.js} +9 -38
- package/dist/parts/components/code-view.d.ts +270 -0
- package/dist/parts/components/code-view.js +2 -0
- package/dist/parts/components/comment-composer.d.ts +2 -0
- package/dist/parts/components/comment-composer.js +2 -0
- package/dist/parts/components/comment-layer.d.ts +2 -0
- package/dist/parts/components/comment-layer.js +631 -0
- package/dist/parts/components/comment-list.d.ts +2 -0
- package/dist/parts/components/comment-list.js +168 -0
- package/dist/parts/components/comment-panel.d.ts +2 -0
- package/dist/parts/components/comment-panel.js +311 -0
- package/dist/parts/components/comment-pin.d.ts +2 -0
- package/dist/parts/components/comment-pin.js +75 -0
- package/dist/parts/components/comment-selection-bar.d.ts +2 -0
- package/dist/parts/components/comment-selection-bar.js +116 -0
- package/dist/parts/components/comment-thread.d.ts +2 -0
- package/dist/parts/components/comment-thread.js +598 -0
- package/dist/parts/components/comments.d.ts +8 -0
- package/dist/parts/components/comments.js +9 -0
- package/dist/{connection-status-DjGBw6xX.d.ts → parts/components/connection-status.d.ts} +6 -7
- package/dist/{connection-status-CzuWBENf.js → parts/components/connection-status.js} +1 -1
- package/dist/parts/components/copy-button.d.ts +118 -0
- package/dist/parts/components/copy-button.js +2 -0
- package/dist/parts/components/device-frame.d.ts +130 -0
- package/dist/parts/components/device-frame.js +471 -0
- package/dist/parts/components/file-tree.d.ts +2 -0
- package/dist/parts/components/file-tree.js +2 -0
- package/dist/parts/components/filter-search.d.ts +47 -0
- package/dist/parts/components/filter-search.js +58 -0
- package/dist/parts/components/markdown-editor.d.ts +2 -0
- package/dist/parts/components/markdown-editor.js +2 -0
- package/dist/parts/components/markdown-renderer.d.ts +52 -0
- package/dist/parts/components/markdown-renderer.js +23077 -0
- package/dist/{markdown-Dse5ldJe.d.ts → parts/components/markdown.d.ts} +7 -7
- package/dist/parts/components/markdown.js +47 -0
- package/dist/{marker-ea-tvx-J.d.ts → parts/components/marker.d.ts} +6 -7
- package/dist/{marker-Di2ZG_k1.js → parts/components/marker.js} +2 -2
- package/dist/{message-parts-BBFUkluC.d.ts → parts/components/message-parts.d.ts} +2 -3
- package/dist/{message-parts-DQnfioAH.js → parts/components/message-parts.js} +6 -6
- package/dist/{message-CW_paC1k.d.ts → parts/components/message.d.ts} +8 -9
- package/dist/{message-DiyBthIq.js → parts/components/message.js} +2 -2
- package/dist/parts/components/patch-parsers.d.ts +2 -0
- package/dist/parts/components/patch-parsers.js +2 -0
- package/dist/{prompt-input-Cy_Ue6B5.d.ts → parts/components/prompt-input.d.ts} +53 -10
- package/dist/{prompt-input-BbnCb80O.js → parts/components/prompt-input.js} +66 -111
- package/dist/parts/components/relative-time.d.ts +73 -0
- package/dist/parts/components/relative-time.js +2 -0
- package/dist/parts/components/status.d.ts +60 -0
- package/dist/parts/components/status.js +48 -0
- package/dist/{sync-status-refELOZn.d.ts → parts/components/sync-status.d.ts} +5 -6
- package/dist/{sync-status-BpxYdZIJ.js → parts/components/sync-status.js} +1 -1
- package/dist/{tool-list-E7CA52rz.d.ts → parts/components/tool-list.d.ts} +3 -4
- package/dist/{tool-list-BdSr5CT4.js → parts/components/tool-list.js} +7 -38
- package/dist/{trace-run-COeXn46Z.d.ts → parts/components/trace-run.d.ts} +3 -4
- package/dist/{trace-run-BIQ17CED.js → parts/components/trace-run.js} +15 -23
- package/dist/{trace-V7rM3Pyd.d.ts → parts/components/trace.d.ts} +11 -12
- package/dist/{trace-llBCDiSW.js → parts/components/trace.js} +20 -13
- package/dist/parts/composables/attachments.d.ts +32 -0
- package/dist/parts/composables/attachments.js +2 -0
- package/dist/parts/composables/highlighted-code.d.ts +9 -0
- package/dist/{highlighted-code-Ck4zexJX.js → parts/composables/highlighted-code.js} +5 -2
- package/dist/parts/headless/choices-input.d.ts +2 -0
- package/dist/parts/headless/choices-input.js +162 -0
- package/dist/parts/headless/comment-visibility.d.ts +2 -0
- package/dist/parts/headless/comment-visibility.js +128 -0
- package/dist/parts/headless/comments.d.ts +2 -0
- package/dist/parts/headless/comments.js +2 -0
- package/dist/parts/headless/message-scroller.d.ts +2 -0
- package/dist/{message-scroller-CX6NJTdm.js → parts/headless/message-scroller.js} +2 -2
- package/dist/parts/playground/highlight.d.ts +5 -0
- package/dist/parts/playground/highlight.js +23 -0
- package/dist/parts/playground/paths.d.ts +4 -0
- package/dist/parts/playground/paths.js +7 -0
- package/dist/parts/playground/playground-render.d.ts +126 -0
- package/dist/parts/playground/playground-render.js +356 -0
- package/dist/parts/playground/share.d.ts +2 -0
- package/dist/parts/playground/share.js +92 -0
- package/dist/parts/playground/zip.d.ts +6 -0
- package/dist/parts/playground/zip.js +76 -0
- package/dist/parts/workspace/browser-support-notice.d.ts +76 -0
- package/dist/parts/workspace/browser-support-notice.js +105 -0
- package/dist/parts/workspace/codemirror.d.ts +16 -0
- package/dist/parts/workspace/codemirror.js +243 -0
- package/dist/parts/workspace/connect-panel.d.ts +129 -0
- package/dist/parts/workspace/connect-panel.js +285 -0
- package/dist/parts/workspace/connect-store.d.ts +26 -0
- package/dist/parts/workspace/connect-store.js +59 -0
- package/dist/parts/workspace/icons.d.ts +34 -0
- package/dist/parts/workspace/icons.js +46 -0
- package/dist/parts/workspace/playground-container.d.ts +192 -0
- package/dist/parts/workspace/playground-container.js +603 -0
- package/dist/parts/workspace/workspace-boot-status.d.ts +75 -0
- package/dist/parts/workspace/workspace-boot-status.js +207 -0
- package/dist/parts/workspace/workspace-editor.d.ts +43 -0
- package/dist/parts/workspace/workspace-editor.js +54 -0
- package/dist/parts/workspace/workspace-file-tree.d.ts +53 -0
- package/dist/parts/workspace/workspace-file-tree.js +68 -0
- package/dist/parts/workspace/workspace-preview.d.ts +72 -0
- package/dist/parts/workspace/workspace-preview.js +307 -0
- package/dist/parts/workspace/workspace-shell.d.ts +88 -0
- package/dist/parts/workspace/workspace-shell.js +291 -0
- package/dist/parts/workspace/workspace-terminal.d.ts +39 -0
- package/dist/parts/workspace/workspace-terminal.js +130 -0
- package/dist/payload-text-sjkYAwvw.js +32 -0
- package/dist/{pierre-code-view-T7V67hwT.js → pierre-code-view-NE35tkmR.js} +245 -102
- package/dist/{pierre-dark-DDWDl8g6.js → pierre-dark-CzUmjETS.js} +3 -1
- package/dist/{pierre-light-CWhW4NrH.js → pierre-light-Dn6E0sWv.js} +3 -1
- package/dist/playground.d.ts +4 -0
- package/dist/playground.js +4 -0
- package/dist/relative-time-BVmjOsYG.js +309 -0
- package/dist/rolldown-runtime-C9mWXvCC.js +29 -0
- package/dist/runtime/nuxt-plugin.js +23 -4
- package/dist/sankey-CAYwt82B-D4uDQoMR.js +2887 -0
- package/dist/share-DM4eNy4q.d.ts +37 -0
- package/dist/{slot-part-C7Ocxn3b.js → slot-part-Doic71uh.js} +7 -1
- package/dist/styles.css +2609 -620
- package/dist/temml-BilSAAws.js +12362 -0
- package/dist/theme-focus-ring.css +42 -0
- package/dist/theme.css +376 -0
- package/dist/theme.d.ts +355 -0
- package/dist/theme.js +265 -0
- package/dist/{types-CqDwuJAm.d.ts → types-Dj7vp0lZ.d.ts} +1 -1
- package/dist/vue-BDmSCtay.js +30779 -0
- package/dist/vue-DGstVdGn.js +2492 -0
- package/dist/workspace.d.ts +15 -0
- package/dist/workspace.js +12 -0
- package/package.json +135 -149
- package/dist/andromeeda-BASpqCeJ.js +0 -4
- package/dist/attachment.d.ts +0 -2
- package/dist/attachment.js +0 -2
- package/dist/aurora-x-DugsLcii.js +0 -4
- package/dist/avatar-stack.js +0 -2
- package/dist/ayu-dark-BT3qdi3o.js +0 -4
- package/dist/ayu-light-BVZyHoh9.js +0 -4
- package/dist/ayu-mirage-XFwUVZQZ.js +0 -4
- package/dist/bubble.d.ts +0 -2
- package/dist/bubble.js +0 -2
- package/dist/catppuccin-frappe-D20KODDN.js +0 -4
- package/dist/catppuccin-latte-eGLVHIUJ.js +0 -4
- package/dist/catppuccin-macchiato-bQGch4PY.js +0 -4
- package/dist/catppuccin-mocha-Bes8-0Mr.js +0 -4
- package/dist/chat-message.d.ts +0 -2
- package/dist/chat-message.js +0 -2
- package/dist/chat-session.d.ts +0 -2
- package/dist/chat-session.js +0 -2
- package/dist/chat.d.ts +0 -2
- package/dist/chat.js +0 -2
- package/dist/code-block.d.ts +0 -2
- package/dist/code-block.js +0 -3
- package/dist/code-view.d.ts +0 -2
- package/dist/code-view.js +0 -2
- package/dist/comment-layer-CBlxJ8eK.js +0 -1113
- package/dist/comments-ChNJkV1d.d.ts +0 -108
- package/dist/comments-Cq5eewsu.d.ts +0 -537
- package/dist/comments.d.ts +0 -2
- package/dist/comments.js +0 -2
- package/dist/config-Bux_AJzm.d.ts +0 -29
- package/dist/config-bHqE4JOs.js +0 -38
- package/dist/connection-status.d.ts +0 -2
- package/dist/connection-status.js +0 -2
- package/dist/dark-plus-BGuiqa1B.js +0 -4
- package/dist/dracula-0CVA2XY5.js +0 -4
- package/dist/dracula-soft-Dk9bpbVU.js +0 -4
- package/dist/error-diagnostics-B4hMpJRL.js +0 -13
- package/dist/everforest-dark-CRjTbhh5.js +0 -4
- package/dist/everforest-light-CEeYFLn8.js +0 -4
- package/dist/file-diff.d.ts +0 -2
- package/dist/file-diff.js +0 -2
- package/dist/file-tree.d.ts +0 -2
- package/dist/file-tree.js +0 -2
- package/dist/file-view.d.ts +0 -2
- package/dist/file-view.js +0 -2
- package/dist/github-dark-BXgKmOw_.js +0 -4
- package/dist/github-dark-default-DzJQXksd.js +0 -4
- package/dist/github-dark-dimmed-B1pEmGtS.js +0 -4
- package/dist/github-dark-high-contrast-BkHIa6jc.js +0 -4
- package/dist/github-light-BKRlUbaB.js +0 -4
- package/dist/github-light-default-BU3eYkzs.js +0 -4
- package/dist/github-light-high-contrast-B3MumDcI.js +0 -4
- package/dist/gruvbox-dark-hard-B0ecF443.js +0 -4
- package/dist/gruvbox-dark-medium-BQnpC39k.js +0 -4
- package/dist/gruvbox-dark-soft-DFZUgESr.js +0 -4
- package/dist/gruvbox-light-hard-CuB_LOJr.js +0 -4
- package/dist/gruvbox-light-medium-idDHgxjs.js +0 -4
- package/dist/gruvbox-light-soft-CfWH49MY.js +0 -4
- package/dist/horizon-bright-Ba6M8QSV.js +0 -4
- package/dist/horizon-h92C5OlZ.js +0 -4
- package/dist/houston-EQnPegWq.js +0 -4
- package/dist/kanagawa-dragon-DgDvwi3B.js +0 -4
- package/dist/kanagawa-lotus-BgoQro20.js +0 -4
- package/dist/kanagawa-wave-DgXEowHs.js +0 -4
- package/dist/laserwave-IxBH_3yW.js +0 -4
- package/dist/light-plus-S8JBx6is.js +0 -4
- package/dist/markdown-BoLBN0qH.js +0 -197
- package/dist/markdown.d.ts +0 -2
- package/dist/markdown.js +0 -2
- package/dist/marker.d.ts +0 -2
- package/dist/marker.js +0 -2
- package/dist/material-theme-D1f3HBq-.js +0 -4
- package/dist/material-theme-darker-ExzYhT0j.js +0 -4
- package/dist/material-theme-lighter-D6gH9nnA.js +0 -4
- package/dist/material-theme-ocean-D1w5BPAa.js +0 -4
- package/dist/material-theme-palenight-CkqWmVpF.js +0 -4
- package/dist/message-parts.d.ts +0 -2
- package/dist/message-parts.js +0 -2
- package/dist/message.d.ts +0 -2
- package/dist/message.js +0 -2
- package/dist/min-dark-npsJH98j.js +0 -4
- package/dist/min-light-DUk1XsVt.js +0 -4
- package/dist/monokai-CfFRWUNl.js +0 -4
- package/dist/multi-file-diff.d.ts +0 -2
- package/dist/multi-file-diff.js +0 -2
- package/dist/night-owl-BS7V-av_.js +0 -4
- package/dist/night-owl-light-CZtRawYE.js +0 -4
- package/dist/nord-BFh54Nqz.js +0 -4
- package/dist/one-dark-pro-zDovGosB.js +0 -4
- package/dist/one-light-gmHK3iK6.js +0 -4
- package/dist/patch-diff.d.ts +0 -2
- package/dist/patch-diff.js +0 -2
- package/dist/plastic-DtdaCjub.js +0 -4
- package/dist/poimandres-Hdda6aHK.js +0 -4
- package/dist/primitive-rail.d.ts +0 -222
- package/dist/primitive-rail.js +0 -348
- package/dist/prompt-input.d.ts +0 -2
- package/dist/prompt-input.js +0 -2
- package/dist/red-VqZFRByZ.js +0 -4
- package/dist/rose-pine-DiTkEueR.js +0 -4
- package/dist/rose-pine-dawn-tfo5y2X0.js +0 -4
- package/dist/rose-pine-moon-C0gON9XN.js +0 -4
- package/dist/runtime-type-DlCscMfw.js +0 -59
- package/dist/slack-dark-v8P_eXr6.js +0 -4
- package/dist/slack-ochin-D8SyEdKz.js +0 -4
- package/dist/snazzy-light-BtkQkvXb.js +0 -4
- package/dist/solarized-dark-B8nAdMfM.js +0 -4
- package/dist/solarized-light-B-3F1INj.js +0 -4
- package/dist/sync-status.d.ts +0 -2
- package/dist/sync-status.js +0 -2
- package/dist/synthwave-84-DcsXCF_c.js +0 -4
- package/dist/tokyo-night-Bvpqduda.js +0 -4
- package/dist/tool-list.d.ts +0 -2
- package/dist/tool-list.js +0 -2
- package/dist/trace-run.d.ts +0 -2
- package/dist/trace-run.js +0 -2
- package/dist/trace.d.ts +0 -2
- package/dist/trace.js +0 -2
- package/dist/unresolved-file.d.ts +0 -2
- package/dist/unresolved-file.js +0 -2
- package/dist/vesper-CfxmMOy3.js +0 -4
- package/dist/vitesse-black-D9-_1mjV.js +0 -4
- package/dist/vitesse-dark-DlSMLlr9.js +0 -4
- package/dist/vitesse-light-KRWWWztf.js +0 -4
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { Component, PropType, Ref, SlotsType, VNode, VNodeChild } from "vue";
|
|
2
|
+
import { Editor } from "@tiptap/vue-3";
|
|
3
|
+
import { ComarkPlugin } from "comark";
|
|
4
|
+
import { AnyExtension, Extension, JSONContent, Mark, Node, NodeViewRenderer } from "@tiptap/core";
|
|
5
|
+
import { StarterKitOptions } from "@tiptap/starter-kit";
|
|
6
|
+
import { Plugin as Plugin$1, PluginKey } from "@tiptap/pm/state";
|
|
7
|
+
import { DecorationSet } from "@tiptap/pm/view";
|
|
8
|
+
//#region ../../node_modules/.pnpm/comark-ui@0.12.0_@comark+html@0.9.0_katex@0.19.1_shiki@4.5.0__@tiptap+core@3.31.4_@tipt_529d07a13f99d0823ee3fccd15d28268/node_modules/comark-ui/dist/editor-B08qLqhj.d.mts
|
|
9
|
+
//#region src/editor/kit.d.ts
|
|
10
|
+
interface ComarkKitOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Passed to StarterKit. A collaborative editor turns `undoRedo` off, since Yjs keeps its own history. Comark has no
|
|
13
|
+
* underline syntax, so `underline` is always off.
|
|
14
|
+
*/
|
|
15
|
+
starterKit?: Partial<StarterKitOptions>;
|
|
16
|
+
/**
|
|
17
|
+
* Draws block and inline components, such as `componentView()` from `comark-ui/editor/vue`. A node view only draws:
|
|
18
|
+
* the schema and the Markdown stay the same, so a server's codec and its browsers share a room with or without it.
|
|
19
|
+
*/
|
|
20
|
+
componentView?: NodeViewRenderer;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/editor/markdown.d.ts
|
|
24
|
+
/**
|
|
25
|
+
* How the page parses Markdown: the plugins it renders with, and `registerDefaultPlugins: false` when it leaves out
|
|
26
|
+
* Comark's defaults. The editor reads and checks a document the same way, so a bare URL the page shows as text stays
|
|
27
|
+
* text, rather than becoming a link that a save writes as `<url>`.
|
|
28
|
+
*/
|
|
29
|
+
interface PageParser {
|
|
30
|
+
plugins?: readonly ComarkPlugin<any, any>[];
|
|
31
|
+
registerDefaultPlugins?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare module "@tiptap/core" {
|
|
34
|
+
interface Commands<ReturnType> {
|
|
35
|
+
comarkUpload: {
|
|
36
|
+
/** Uploads files at the cursor, as a paste would, such as the ones a file picker returns. */
|
|
37
|
+
uploadFiles: (files: File[]) => ReturnType;
|
|
38
|
+
/** Opens the file picker and uploads the files picked at the cursor, as a "/" menu's Image item would. */
|
|
39
|
+
chooseFiles: () => ReturnType;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region ../../node_modules/.pnpm/comark-ui@0.12.0_@comark+html@0.9.0_katex@0.19.1_shiki@4.5.0__@tiptap+core@3.31.4_@tipt_529d07a13f99d0823ee3fccd15d28268/node_modules/comark-ui/dist/editor-vue.d.mts
|
|
45
|
+
//#region src/editor/component-view.d.ts
|
|
46
|
+
/** One prop a component takes, as the props panel edits it. */
|
|
47
|
+
interface ComponentProp {
|
|
48
|
+
/**
|
|
49
|
+
* `string` (the default), `number`, `boolean`, or `json`, each with its own field. Any other name, such as `image`,
|
|
50
|
+
* reads and writes a string and is the `field` hook's to draw.
|
|
51
|
+
*/
|
|
52
|
+
type?: "string" | "number" | "boolean" | "json" | (string & {});
|
|
53
|
+
label?: string;
|
|
54
|
+
description?: string;
|
|
55
|
+
/** What the component uses when the prop is left out. The field shows it and doesn't write it. */
|
|
56
|
+
default?: unknown;
|
|
57
|
+
/** The values a string takes, drawn as a select. */
|
|
58
|
+
options?: readonly string[];
|
|
59
|
+
}
|
|
60
|
+
/** What the editor shows for one component name. */
|
|
61
|
+
interface ComponentInfo {
|
|
62
|
+
/** Shown instead of the name. The name stays beside it. */
|
|
63
|
+
label?: string;
|
|
64
|
+
/** A class for an icon element, such as UnoCSS's `i-lucide-chart-bar`, or a Vue component. */
|
|
65
|
+
icon?: string | Component;
|
|
66
|
+
/** The props the panel edits with typed fields. Props a document has beyond these show as names and values. */
|
|
67
|
+
props?: Record<string, ComponentProp>;
|
|
68
|
+
}
|
|
69
|
+
/** A field of the props panel, given to `field` so a host can draw its own control, such as a media picker. */
|
|
70
|
+
interface ComponentField {
|
|
71
|
+
/** The component's name, such as `card`. */
|
|
72
|
+
component: string;
|
|
73
|
+
/** The prop's name, such as `icon`. */
|
|
74
|
+
name: string;
|
|
75
|
+
prop: ComponentProp;
|
|
76
|
+
/** The prop's value read as its type, or `undefined` when the document leaves it out. */
|
|
77
|
+
value: unknown;
|
|
78
|
+
/** Sets the prop through a transaction. `undefined` removes it. */
|
|
79
|
+
update(value: unknown): void;
|
|
80
|
+
editable: boolean;
|
|
81
|
+
/** The id the field's label points at. */
|
|
82
|
+
id: string;
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/editor-vue.d.ts
|
|
86
|
+
/**
|
|
87
|
+
* Pass how the page parses Markdown, `plugins` and `registerDefaultPlugins` as given to Comark's parser, so the editor
|
|
88
|
+
* reads a document as readers see it, and opens read-only one a save would change for them.
|
|
89
|
+
*/
|
|
90
|
+
interface UseComarkEditorOptions extends PageParser {
|
|
91
|
+
/** Added after ComarkKit, such as a placeholder. */
|
|
92
|
+
extensions?: AnyExtension[];
|
|
93
|
+
kit?: ComarkKitOptions;
|
|
94
|
+
/**
|
|
95
|
+
* What the component view shows for each component name, with the props it edits as typed fields, or `false` to
|
|
96
|
+
* draw components as bare elements. A `componentView` in `kit` replaces the view.
|
|
97
|
+
*/
|
|
98
|
+
components?: Record<string, ComponentInfo> | false;
|
|
99
|
+
/** Draws a typed prop's field, such as a media picker. Return `undefined` for the view's own field. */
|
|
100
|
+
field?: (field: ComponentField) => VNodeChild | undefined;
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/components/markdown-editor.d.ts
|
|
104
|
+
/** Sends one file and resolves with the URL the document links to. Call `progress` with a fraction from 0 to 1. */
|
|
105
|
+
type MarkdownEditorUpload = (file: File, progress: (fraction: number) => void) => Promise<string>;
|
|
106
|
+
/**
|
|
107
|
+
* Uploads to a route that returns the result of `blob.handleUpload()`, with progress, and resolves with the stored
|
|
108
|
+
* object's URL. The Blob store has to be served (`blob.serve`), so the object has a URL to link.
|
|
109
|
+
*/
|
|
110
|
+
declare function blobUpload(route: string): MarkdownEditorUpload;
|
|
111
|
+
/**
|
|
112
|
+
* A Markdown editor on comark-ui's editor, with a bubble toolbar, a "/" menu, and a drag handle: Nuxt UI's, or the ones
|
|
113
|
+
* given to `createViteHubUI({ components })`, such as `uiSdkComponents`. Bind Markdown with
|
|
114
|
+
* `v-model`, or pass an `editor` the app made, such as a Realtime room's. With `upload`, pasted and dropped files and the
|
|
115
|
+
* "/" menu's Image item upload with a placeholder that shows the percentage; a string is a Blob upload route.
|
|
116
|
+
*/
|
|
117
|
+
declare const MarkdownEditor: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
118
|
+
modelValue: {
|
|
119
|
+
type: StringConstructor;
|
|
120
|
+
default: undefined;
|
|
121
|
+
};
|
|
122
|
+
/** An editor the app made, used instead of one bound to `modelValue`. */
|
|
123
|
+
editor: {
|
|
124
|
+
type: PropType<Editor>;
|
|
125
|
+
default: undefined;
|
|
126
|
+
};
|
|
127
|
+
/** A Blob upload route, such as `/api/uploads`, or a function that uploads one file and resolves with its URL. */
|
|
128
|
+
upload: {
|
|
129
|
+
type: PropType<string | MarkdownEditorUpload>;
|
|
130
|
+
default: undefined;
|
|
131
|
+
};
|
|
132
|
+
/** Which files to take. Images, video, and audio by default. */
|
|
133
|
+
accept: {
|
|
134
|
+
type: PropType<(file: File) => boolean>;
|
|
135
|
+
default: undefined;
|
|
136
|
+
};
|
|
137
|
+
/** Parse plugins the page renders with, so a document only they read opens read-only. */
|
|
138
|
+
plugins: {
|
|
139
|
+
type: PropType<NonNullable<UseComarkEditorOptions["plugins"]>>;
|
|
140
|
+
default: undefined;
|
|
141
|
+
};
|
|
142
|
+
/** Extra Tiptap extensions for the editor bound to `modelValue`. */
|
|
143
|
+
extensions: {
|
|
144
|
+
type: PropType<AnyExtension[]>;
|
|
145
|
+
default: undefined;
|
|
146
|
+
};
|
|
147
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
148
|
+
[key: string]: any;
|
|
149
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
150
|
+
"update:modelValue": (_value: string) => true;
|
|
151
|
+
/** An upload failed; its placeholder is gone. */
|
|
152
|
+
uploadError: (_error: unknown, _file: File) => true;
|
|
153
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
154
|
+
modelValue: {
|
|
155
|
+
type: StringConstructor;
|
|
156
|
+
default: undefined;
|
|
157
|
+
};
|
|
158
|
+
/** An editor the app made, used instead of one bound to `modelValue`. */
|
|
159
|
+
editor: {
|
|
160
|
+
type: PropType<Editor>;
|
|
161
|
+
default: undefined;
|
|
162
|
+
};
|
|
163
|
+
/** A Blob upload route, such as `/api/uploads`, or a function that uploads one file and resolves with its URL. */
|
|
164
|
+
upload: {
|
|
165
|
+
type: PropType<string | MarkdownEditorUpload>;
|
|
166
|
+
default: undefined;
|
|
167
|
+
};
|
|
168
|
+
/** Which files to take. Images, video, and audio by default. */
|
|
169
|
+
accept: {
|
|
170
|
+
type: PropType<(file: File) => boolean>;
|
|
171
|
+
default: undefined;
|
|
172
|
+
};
|
|
173
|
+
/** Parse plugins the page renders with, so a document only they read opens read-only. */
|
|
174
|
+
plugins: {
|
|
175
|
+
type: PropType<NonNullable<UseComarkEditorOptions["plugins"]>>;
|
|
176
|
+
default: undefined;
|
|
177
|
+
};
|
|
178
|
+
/** Extra Tiptap extensions for the editor bound to `modelValue`. */
|
|
179
|
+
extensions: {
|
|
180
|
+
type: PropType<AnyExtension[]>;
|
|
181
|
+
default: undefined;
|
|
182
|
+
};
|
|
183
|
+
}>> & Readonly<{
|
|
184
|
+
"onUpdate:modelValue"?: ((_value: string) => any) | undefined;
|
|
185
|
+
onUploadError?: ((_error: unknown, _file: File) => any) | undefined;
|
|
186
|
+
}>, {
|
|
187
|
+
modelValue: string;
|
|
188
|
+
accept: (file: File) => boolean;
|
|
189
|
+
plugins: readonly import("comark").ComarkPlugin<any, any>[];
|
|
190
|
+
upload: string | MarkdownEditorUpload;
|
|
191
|
+
editor: Editor;
|
|
192
|
+
extensions: AnyExtension[];
|
|
193
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
194
|
+
//#endregion
|
|
195
|
+
export { MarkdownEditorUpload as n, blobUpload as r, MarkdownEditor as t };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { n as MarkdownEditorUpload, r as blobUpload, t as MarkdownEditor } from "./markdown-editor-wQF0yD5o.js";
|
|
2
|
+
import { PropType, VNode } from "vue";
|
|
3
|
+
import { Editor, JSONContent } from "@tiptap/core";
|
|
4
|
+
import { PluginKey } from "@tiptap/pm/state";
|
|
5
|
+
//#region src/editor/handlers.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* What an editor menu item asks for. `kind` names the handler that runs it, and the other fields are its arguments:
|
|
8
|
+
* the mark to toggle, the heading level, or the position of the block that the block menu acts on.
|
|
9
|
+
*/
|
|
10
|
+
interface EditorItem {
|
|
11
|
+
kind?: string;
|
|
12
|
+
mark?: string;
|
|
13
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
14
|
+
pos?: number;
|
|
15
|
+
}
|
|
16
|
+
/** Runs one `kind` of item on an editor. The toolbar, the "/" menu, and the block menu read the same handlers. */
|
|
17
|
+
interface EditorHandler {
|
|
18
|
+
canExecute: (editor: Editor, item: EditorItem) => boolean;
|
|
19
|
+
execute: (editor: Editor, item: EditorItem) => {
|
|
20
|
+
run: () => unknown;
|
|
21
|
+
};
|
|
22
|
+
isActive: (editor: Editor, item: EditorItem) => boolean;
|
|
23
|
+
isDisabled?: (editor: Editor, item: EditorItem) => boolean;
|
|
24
|
+
}
|
|
25
|
+
type EditorHandlers = Record<string, EditorHandler>;
|
|
26
|
+
/**
|
|
27
|
+
* The key that the editor parts read their handlers from, as a `Ref<EditorHandlers>`. It is the string that Nuxt UI's
|
|
28
|
+
* editor components inject, so one `provide()` serves both sets.
|
|
29
|
+
*/
|
|
30
|
+
export declare const editorHandlersKey = "editorHandlers";
|
|
31
|
+
/**
|
|
32
|
+
* The handlers of the item kinds that ViteHub's editors use: `mark` (with `mark`), `heading` (with `level`),
|
|
33
|
+
* `paragraph`, `blockquote`, `codeBlock`, `horizontalRule`, `bulletList`, `orderedList`, and, for the block at `pos`,
|
|
34
|
+
* `duplicate`, `delete`, `moveUp`, `moveDown`, and `suggestion` (opens the "/" menu below it). They match Nuxt UI's
|
|
35
|
+
* `createHandlers()` for these kinds. Spread your own over them for other kinds.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createEditorHandlers(): EditorHandlers;
|
|
38
|
+
/** A menu entry that `mapEditorItems()` reads: an editor item, or a label or separator, with any menu fields. */
|
|
39
|
+
type EditorMenuEntry = EditorItem & {
|
|
40
|
+
type?: "label" | "separator" | "link" | "checkbox";
|
|
41
|
+
children?: EditorMenuEntry[] | EditorMenuEntry[][];
|
|
42
|
+
[field: string]: unknown;
|
|
43
|
+
};
|
|
44
|
+
/** An entry after `mapEditorItems()`: what the editor item says it is, as a dropdown menu entry. */
|
|
45
|
+
type MappedEditorMenuEntry = EditorMenuEntry & {
|
|
46
|
+
active?: boolean;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
onSelect?: () => void;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Turns editor items into dropdown menu entries: each item with a known `kind` gets `active`, `disabled`, and an
|
|
52
|
+
* `onSelect` that runs its handler, as Nuxt UI's `mapEditorItems()` does. Groups and `children` keep their shape.
|
|
53
|
+
*/
|
|
54
|
+
export declare function mapEditorItems(editor: Editor, items: EditorMenuEntry[], handlers?: EditorHandlers): MappedEditorMenuEntry[];
|
|
55
|
+
export declare function mapEditorItems(editor: Editor, items: EditorMenuEntry[][], handlers?: EditorHandlers): MappedEditorMenuEntry[][];
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/ui-sdk/editor.d.ts
|
|
58
|
+
/** A tooltip as Nuxt UI's toolbar items take it: its text, and its keys, such as `["meta", "b"]`. */
|
|
59
|
+
interface EditorToolbarTooltip {
|
|
60
|
+
text?: string;
|
|
61
|
+
kbds?: string[];
|
|
62
|
+
}
|
|
63
|
+
/** A dropdown entry of a toolbar item: an editor item, a label, or a separator. */
|
|
64
|
+
type EditorToolbarMenuEntry = EditorItem & {
|
|
65
|
+
type?: "label" | "separator";
|
|
66
|
+
label?: string;
|
|
67
|
+
icon?: string;
|
|
68
|
+
disabled?: boolean;
|
|
69
|
+
onSelect?: (event: Event) => void;
|
|
70
|
+
};
|
|
71
|
+
/** A toolbar item: an editor item, a button with `onClick`, a dropdown with `items`, or a named slot with `slot`. */
|
|
72
|
+
type EditorToolbarItem = EditorItem & {
|
|
73
|
+
"aria-label"?: string;
|
|
74
|
+
label?: string;
|
|
75
|
+
icon?: string;
|
|
76
|
+
trailingIcon?: string;
|
|
77
|
+
tooltip?: EditorToolbarTooltip;
|
|
78
|
+
slot?: string;
|
|
79
|
+
active?: boolean;
|
|
80
|
+
disabled?: boolean;
|
|
81
|
+
onClick?: ((event: MouseEvent) => void) | Array<(event: MouseEvent) => void>;
|
|
82
|
+
items?: EditorToolbarMenuEntry[] | EditorToolbarMenuEntry[][];
|
|
83
|
+
content?: {
|
|
84
|
+
align?: "start" | "center" | "end";
|
|
85
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
86
|
+
sideOffset?: number;
|
|
87
|
+
};
|
|
88
|
+
ui?: {
|
|
89
|
+
content?: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
/** An entry of the "/" menu: an editor item with a label, or a label or separator between them. */
|
|
93
|
+
type EditorSuggestionMenuItem = EditorItem & {
|
|
94
|
+
type?: "label" | "separator";
|
|
95
|
+
label?: string;
|
|
96
|
+
description?: string;
|
|
97
|
+
icon?: string;
|
|
98
|
+
disabled?: boolean;
|
|
99
|
+
keywords?: string[];
|
|
100
|
+
class?: string;
|
|
101
|
+
};
|
|
102
|
+
/** The block that the handle points at: its JSON and its position in the document. */
|
|
103
|
+
interface EditorDragHandleNode {
|
|
104
|
+
node: JSONContent;
|
|
105
|
+
pos: number;
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
export { type EditorDragHandleNode, type EditorHandler, type EditorHandlers, type EditorItem, type EditorMenuEntry, type EditorSuggestionMenuItem, type EditorToolbarItem, type EditorToolbarMenuEntry, type EditorToolbarTooltip, type MappedEditorMenuEntry, MarkdownEditor, type MarkdownEditorUpload, blobUpload };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { n as blobUpload, t as MarkdownEditor } from "./markdown-editor-CMbNZOdN.js";
|
|
2
|
+
import { n as editorHandlersKey, r as mapEditorItems, t as createEditorHandlers } from "./handlers-DMl-Na3x.js";
|
|
3
|
+
export { MarkdownEditor, blobUpload, createEditorHandlers, editorHandlersKey, mapEditorItems };
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { Component, PropType, Ref } from "vue";
|
|
2
|
+
//#region src/headless/message-scroller.d.ts
|
|
3
|
+
type MessageScrollBehavior = "auto" | "instant" | "smooth";
|
|
4
|
+
type MessageScrollPosition = "start" | "end";
|
|
5
|
+
interface MessageScrollerContext {
|
|
6
|
+
atEnd: Readonly<Ref<boolean>>;
|
|
7
|
+
isScrollable: Readonly<Ref<boolean>>;
|
|
8
|
+
scrollToEnd: (options?: {
|
|
9
|
+
behavior?: MessageScrollBehavior;
|
|
10
|
+
}) => void;
|
|
11
|
+
scrollToMessage: (id: string, options?: {
|
|
12
|
+
behavior?: MessageScrollBehavior;
|
|
13
|
+
block?: ScrollLogicalPosition;
|
|
14
|
+
}) => void;
|
|
15
|
+
viewport: Ref<HTMLElement | null>;
|
|
16
|
+
}
|
|
17
|
+
declare function useMessageScroller(): MessageScrollerContext;
|
|
18
|
+
declare function calculatePrependScrollTop(previousTop: number, previousHeight: number, nextHeight: number): number;
|
|
19
|
+
declare const MessageScroller: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
20
|
+
as: {
|
|
21
|
+
default: string;
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
};
|
|
24
|
+
autoScroll: {
|
|
25
|
+
default: boolean;
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
};
|
|
28
|
+
defaultScrollPosition: {
|
|
29
|
+
default: string;
|
|
30
|
+
type: PropType<MessageScrollPosition>;
|
|
31
|
+
};
|
|
32
|
+
edgeThreshold: {
|
|
33
|
+
default: number;
|
|
34
|
+
type: NumberConstructor;
|
|
35
|
+
};
|
|
36
|
+
previousItemPeek: {
|
|
37
|
+
default: number;
|
|
38
|
+
type: NumberConstructor;
|
|
39
|
+
};
|
|
40
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
43
|
+
as: {
|
|
44
|
+
default: string;
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
};
|
|
47
|
+
autoScroll: {
|
|
48
|
+
default: boolean;
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
};
|
|
51
|
+
defaultScrollPosition: {
|
|
52
|
+
default: string;
|
|
53
|
+
type: PropType<MessageScrollPosition>;
|
|
54
|
+
};
|
|
55
|
+
edgeThreshold: {
|
|
56
|
+
default: number;
|
|
57
|
+
type: NumberConstructor;
|
|
58
|
+
};
|
|
59
|
+
previousItemPeek: {
|
|
60
|
+
default: number;
|
|
61
|
+
type: NumberConstructor;
|
|
62
|
+
};
|
|
63
|
+
}>> & Readonly<{}>, {
|
|
64
|
+
as: string;
|
|
65
|
+
autoScroll: boolean;
|
|
66
|
+
defaultScrollPosition: MessageScrollPosition;
|
|
67
|
+
edgeThreshold: number;
|
|
68
|
+
previousItemPeek: number;
|
|
69
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
70
|
+
declare const MessageScrollerViewport: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
71
|
+
as: {
|
|
72
|
+
default: string;
|
|
73
|
+
type: StringConstructor;
|
|
74
|
+
};
|
|
75
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
76
|
+
[key: string]: any;
|
|
77
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
78
|
+
as: {
|
|
79
|
+
default: string;
|
|
80
|
+
type: StringConstructor;
|
|
81
|
+
};
|
|
82
|
+
}>> & Readonly<{}>, {
|
|
83
|
+
as: string;
|
|
84
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
85
|
+
declare const MessageScrollerContent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
86
|
+
as: {
|
|
87
|
+
default: string;
|
|
88
|
+
type: StringConstructor;
|
|
89
|
+
};
|
|
90
|
+
items: {
|
|
91
|
+
default: () => never[];
|
|
92
|
+
type: PropType<readonly string[]>;
|
|
93
|
+
};
|
|
94
|
+
preserveScrollOnPrepend: {
|
|
95
|
+
default: boolean;
|
|
96
|
+
type: BooleanConstructor;
|
|
97
|
+
};
|
|
98
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
99
|
+
[key: string]: any;
|
|
100
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
101
|
+
as: {
|
|
102
|
+
default: string;
|
|
103
|
+
type: StringConstructor;
|
|
104
|
+
};
|
|
105
|
+
items: {
|
|
106
|
+
default: () => never[];
|
|
107
|
+
type: PropType<readonly string[]>;
|
|
108
|
+
};
|
|
109
|
+
preserveScrollOnPrepend: {
|
|
110
|
+
default: boolean;
|
|
111
|
+
type: BooleanConstructor;
|
|
112
|
+
};
|
|
113
|
+
}>> & Readonly<{}>, {
|
|
114
|
+
as: string;
|
|
115
|
+
items: readonly string[];
|
|
116
|
+
preserveScrollOnPrepend: boolean;
|
|
117
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
118
|
+
declare const MessageScrollerItem: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
119
|
+
as: {
|
|
120
|
+
default: string;
|
|
121
|
+
type: StringConstructor;
|
|
122
|
+
};
|
|
123
|
+
messageId: {
|
|
124
|
+
required: true;
|
|
125
|
+
type: StringConstructor;
|
|
126
|
+
};
|
|
127
|
+
scrollAnchor: {
|
|
128
|
+
default: boolean;
|
|
129
|
+
type: BooleanConstructor;
|
|
130
|
+
};
|
|
131
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
132
|
+
[key: string]: any;
|
|
133
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
134
|
+
as: {
|
|
135
|
+
default: string;
|
|
136
|
+
type: StringConstructor;
|
|
137
|
+
};
|
|
138
|
+
messageId: {
|
|
139
|
+
required: true;
|
|
140
|
+
type: StringConstructor;
|
|
141
|
+
};
|
|
142
|
+
scrollAnchor: {
|
|
143
|
+
default: boolean;
|
|
144
|
+
type: BooleanConstructor;
|
|
145
|
+
};
|
|
146
|
+
}>> & Readonly<{}>, {
|
|
147
|
+
as: string;
|
|
148
|
+
scrollAnchor: boolean;
|
|
149
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
150
|
+
declare const MessageScrollerButton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
151
|
+
as: {
|
|
152
|
+
default: string;
|
|
153
|
+
type: PropType<string | Component>;
|
|
154
|
+
};
|
|
155
|
+
behavior: {
|
|
156
|
+
default: string;
|
|
157
|
+
type: PropType<MessageScrollBehavior>;
|
|
158
|
+
};
|
|
159
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
160
|
+
[key: string]: any;
|
|
161
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
162
|
+
as: {
|
|
163
|
+
default: string;
|
|
164
|
+
type: PropType<string | Component>;
|
|
165
|
+
};
|
|
166
|
+
behavior: {
|
|
167
|
+
default: string;
|
|
168
|
+
type: PropType<MessageScrollBehavior>;
|
|
169
|
+
};
|
|
170
|
+
}>> & Readonly<{}>, {
|
|
171
|
+
as: string | Component;
|
|
172
|
+
behavior: MessageScrollBehavior;
|
|
173
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
174
|
+
//#endregion
|
|
175
|
+
export { MessageScrollerContent as a, MessageScrollerViewport as c, MessageScrollerButton as i, calculatePrependScrollTop as l, MessageScrollPosition as n, MessageScrollerContext as o, MessageScroller as r, MessageScrollerItem as s, MessageScrollBehavior as t, useMessageScroller as u };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineAsyncComponent, getCurrentInstance, inject } from "vue";
|
|
2
|
+
import { injectTooltipProviderContext } from "reka-ui";
|
|
3
|
+
//#region src/internal/nuxt-ui.ts
|
|
4
|
+
const uiComponentsKey = Symbol("ViteHubUIComponents");
|
|
5
|
+
const bundled = {
|
|
6
|
+
UBadge: defineAsyncComponent(() => import("@nuxt/ui/components/Badge.vue")),
|
|
7
|
+
UButton: defineAsyncComponent(() => import("@nuxt/ui/components/Button.vue")),
|
|
8
|
+
UChatReasoning: defineAsyncComponent(() => import("@nuxt/ui/components/ChatReasoning.vue")),
|
|
9
|
+
UChatTool: defineAsyncComponent(() => import("@nuxt/ui/components/ChatTool.vue")),
|
|
10
|
+
UCollapsible: defineAsyncComponent(() => import("@nuxt/ui/components/Collapsible.vue")),
|
|
11
|
+
UDropdownMenu: defineAsyncComponent(() => import("@nuxt/ui/components/DropdownMenu.vue")),
|
|
12
|
+
UEditorDragHandle: defineAsyncComponent(() => import("@nuxt/ui/components/EditorDragHandle.vue")),
|
|
13
|
+
UEditorSuggestionMenu: defineAsyncComponent(() => import("@nuxt/ui/components/EditorSuggestionMenu.vue")),
|
|
14
|
+
UEditorToolbar: defineAsyncComponent(() => import("@nuxt/ui/components/EditorToolbar.vue")),
|
|
15
|
+
UIcon: defineAsyncComponent(() => import("@nuxt/ui/runtime/vue/components/Icon.vue")),
|
|
16
|
+
UInput: defineAsyncComponent(() => import("@nuxt/ui/components/Input.vue")),
|
|
17
|
+
UModal: defineAsyncComponent(() => import("@nuxt/ui/components/Modal.vue")),
|
|
18
|
+
UTabs: defineAsyncComponent(() => import("@nuxt/ui/components/Tabs.vue")),
|
|
19
|
+
UTooltip: defineAsyncComponent(() => import("@nuxt/ui/components/Tooltip.vue"))
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The component that a part renders for `name`: the one given to `createViteHubUI({ components })`, else one that the
|
|
23
|
+
* app registered globally under that name, such as a stand-in of a page without Nuxt UI, else Nuxt UI's own. Call it in
|
|
24
|
+
* `setup()`.
|
|
25
|
+
*/
|
|
26
|
+
function useUIComponent(name) {
|
|
27
|
+
return inject(uiComponentsKey, void 0)?.[name] ?? getCurrentInstance()?.appContext.components[name] ?? bundled[name];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The tooltip that a part renders: the one given to `createViteHubUI({ components })` or registered globally, else
|
|
31
|
+
* Nuxt UI's own inside `UApp`, which provides what it needs and lets the tooltips of a list share their open delay.
|
|
32
|
+
* Outside `UApp` there is none, and the part uses the `title` attribute. Call it in `setup()`.
|
|
33
|
+
*/
|
|
34
|
+
function useTooltipComponent() {
|
|
35
|
+
return inject(uiComponentsKey, void 0)?.UTooltip ?? getCurrentInstance()?.appContext.components.UTooltip ?? (!injectTooltipProviderContext(null) ? void 0 : bundled.UTooltip);
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { useTooltipComponent as n, useUIComponent as r, uiComponentsKey as t };
|
package/dist/nuxt.d.ts
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as ViteHubUIOptions, r as ViteHubUIIconOptions } from "./config-DgxBW013.js";
|
|
2
|
+
//#region ../icons/dist/index.d.ts
|
|
3
|
+
/** Name of an icon in the ViteHub set, such as `kv` for `i-vitehub-kv`. */
|
|
4
|
+
type ViteHubIconName = "agent" | "auth" | "blob" | "browser" | "bundle" | "cache" | "channels" | "choices" | "cli" | "cms" | "codemods" | "comments" | "compare" | "connections" | "console" | "content" | "database" | "development" | "device" | "docs" | "email" | "env" | "forge" | "forms" | "gateways" | "guides" | "hosts" | "i18n" | "kv" | "logs" | "markdown-template" | "mcp" | "presets" | "queue" | "rate-limit" | "realtime" | "reference" | "runtime" | "sandbox" | "schedule" | "shell" | "skills" | "source" | "start" | "sync" | "ui" | "usage" | "web-container" | "webhooks" | "workflow" | "workspace";
|
|
5
|
+
/** The ViteHub icon set in the Iconify JSON format, as `@iconify-json/*` packages export it. */
|
|
6
|
+
interface ViteHubIconSet {
|
|
7
|
+
prefix: "vitehub";
|
|
8
|
+
info: {
|
|
9
|
+
name: string;
|
|
10
|
+
total: number;
|
|
11
|
+
author: {
|
|
12
|
+
name: string;
|
|
13
|
+
url: string;
|
|
14
|
+
};
|
|
15
|
+
license: {
|
|
16
|
+
title: string;
|
|
17
|
+
spdx: string;
|
|
18
|
+
url: string;
|
|
19
|
+
};
|
|
20
|
+
height: number;
|
|
21
|
+
category: string;
|
|
22
|
+
palette: boolean;
|
|
23
|
+
};
|
|
24
|
+
icons: Record<ViteHubIconName, {
|
|
25
|
+
body: string;
|
|
26
|
+
}>;
|
|
27
|
+
width: 24;
|
|
28
|
+
height: 24;
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/icons.d.ts
|
|
32
|
+
export declare const viteHubUIIcons: readonly string[];
|
|
33
|
+
//#endregion
|
|
2
34
|
//#region src/nuxt.d.ts
|
|
3
|
-
export interface ViteHubUINuxtOptions extends ViteHubUIOptions {
|
|
35
|
+
export interface ViteHubUINuxtOptions extends Omit<ViteHubUIOptions, "components" | "icons"> {
|
|
4
36
|
/** Prefix for auto-imported component names, for example `Vh` registers `VhTrace`. Use it when the app has its own `Message` or `Trace`. */
|
|
5
37
|
prefix?: string;
|
|
6
38
|
}
|
|
@@ -8,6 +40,56 @@ export interface ViteHubUINuxtModule {
|
|
|
8
40
|
(inlineOptions: ViteHubUINuxtOptions, nuxt: never): unknown;
|
|
9
41
|
getMeta?: () => Promise<Record<string, unknown>>;
|
|
10
42
|
}
|
|
43
|
+
declare module "@nuxt/schema" {
|
|
44
|
+
interface AppConfigInput {
|
|
45
|
+
/** The icons of the parts that Nuxt UI's `appConfig.ui.icons` has no name for, such as `edit` and `delete`. */
|
|
46
|
+
viteHubUI?: {
|
|
47
|
+
icons?: ViteHubUIIconOptions;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** Vite's `resolve.alias`: a list of entries, or a record of replacements. The declarations do not import Vite, an optional peer. */
|
|
52
|
+
type ViteAliasOptions = readonly {
|
|
53
|
+
find: string | RegExp;
|
|
54
|
+
replacement: string;
|
|
55
|
+
}[] | {
|
|
56
|
+
[find: string]: string;
|
|
57
|
+
};
|
|
58
|
+
/** The parts of a Nuxt instance that `addViteHubUIRuntime()` uses. */
|
|
59
|
+
export interface ViteHubUIRuntimeNuxt {
|
|
60
|
+
options: {
|
|
61
|
+
plugins: Array<string | {
|
|
62
|
+
src: string;
|
|
63
|
+
}>;
|
|
64
|
+
vite: {
|
|
65
|
+
resolve?: {
|
|
66
|
+
alias?: ViteAliasOptions;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
hook: (name: "icon:clientBundleIcons", callback: (icons: Set<string>) => void) => unknown;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Adds what the styled parts need at runtime in a Nuxt app: the plugin that gives them Nuxt UI's Nuxt icon, their
|
|
74
|
+
* icons in the `@nuxt/icon` client bundle, because `@nuxt/icon` does not scan dependencies, and Shiki's WebAssembly as a
|
|
75
|
+
* module the server build can bundle. The module calls it, and so does `vite-hub/nuxt` when the app installed this
|
|
76
|
+
* package. It is safe to call twice.
|
|
77
|
+
*/
|
|
78
|
+
export declare function addViteHubUIRuntime(nuxt: ViteHubUIRuntimeNuxt): void;
|
|
79
|
+
/**
|
|
80
|
+
* Auto-imports the public components in a Nuxt app, with an optional name prefix. The module calls it, and so does
|
|
81
|
+
* `vite-hub/nuxt` when the app installed this package and Nuxt UI. It registers each prefix once per Nuxt instance.
|
|
82
|
+
* Nuxt only bundles a component that a template uses, so an app that renders none pays nothing.
|
|
83
|
+
*/
|
|
84
|
+
export declare function addViteHubUIComponents(nuxt: object, prefix?: string): void;
|
|
85
|
+
export declare const viteHubUIIconDependencies: {
|
|
86
|
+
"@nuxt/icon": {
|
|
87
|
+
optional: boolean;
|
|
88
|
+
defaults: {
|
|
89
|
+
customCollections: ViteHubIconSet[];
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
};
|
|
11
93
|
declare const viteHubUINuxtModule: ViteHubUINuxtModule;
|
|
12
94
|
//#endregion
|
|
13
95
|
export { viteHubUINuxtModule as default };
|