@yh-ui/components 0.1.17 → 0.1.21
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 +193 -6
- package/dist/affix/index.d.ts +202 -1
- package/dist/affix/src/affix.vue.d.ts +55 -6
- package/dist/ai-action-group/__tests__/ai-action-group.test.cjs +86 -0
- package/dist/ai-action-group/__tests__/ai-action-group.test.mjs +53 -0
- package/dist/ai-action-group/index.d.ts +110 -1
- package/dist/ai-action-group/src/ai-action-group.vue +8 -8
- package/dist/ai-action-group/src/ai-action-group.vue.d.ts +29 -4
- package/dist/ai-agent-card/__tests__/ai-agent-card.test.cjs +135 -0
- package/dist/ai-agent-card/__tests__/ai-agent-card.test.mjs +69 -0
- package/dist/ai-agent-card/index.d.ts +176 -1
- package/dist/ai-agent-card/src/ai-agent-card.vue +4 -4
- package/dist/ai-agent-card/src/ai-agent-card.vue.d.ts +50 -7
- package/dist/ai-artifacts/index.d.ts +276 -1
- package/dist/ai-artifacts/src/ai-artifacts.cjs +60 -0
- package/dist/ai-artifacts/src/ai-artifacts.css +5 -1
- package/dist/ai-artifacts/src/ai-artifacts.d.ts +99 -18
- package/dist/ai-artifacts/src/ai-artifacts.mjs +60 -0
- package/dist/ai-artifacts/src/ai-artifacts.vue +177 -28
- package/dist/ai-artifacts/src/ai-artifacts.vue.d.ts +149 -36
- package/dist/ai-attachments/__tests__/ai-attachments.ssr.test.cjs +50 -0
- package/dist/ai-attachments/__tests__/ai-attachments.ssr.test.mjs +33 -0
- package/dist/ai-attachments/__tests__/ai-attachments.test.cjs +113 -0
- package/dist/ai-attachments/__tests__/ai-attachments.test.mjs +81 -0
- package/dist/ai-attachments/index.cjs +26 -0
- package/dist/ai-attachments/index.d.ts +363 -0
- package/dist/ai-attachments/index.mjs +5 -0
- package/dist/ai-attachments/src/ai-attachments.cjs +96 -0
- package/dist/ai-attachments/src/ai-attachments.css +685 -0
- package/dist/ai-attachments/src/ai-attachments.d.ts +127 -0
- package/dist/ai-attachments/src/ai-attachments.mjs +90 -0
- package/dist/ai-attachments/src/ai-attachments.vue +1012 -0
- package/dist/ai-attachments/src/ai-attachments.vue.d.ts +218 -0
- package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.cjs +8 -0
- package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.mjs +8 -0
- package/dist/ai-bubble/__tests__/ai-bubble.test.cjs +442 -45
- package/dist/ai-bubble/__tests__/ai-bubble.test.mjs +288 -18
- package/dist/ai-bubble/index.d.ts +442 -1
- package/dist/ai-bubble/src/ai-bubble.cjs +130 -0
- package/dist/ai-bubble/src/ai-bubble.css +104 -0
- package/dist/ai-bubble/src/ai-bubble.d.ts +369 -30
- package/dist/ai-bubble/src/ai-bubble.mjs +172 -0
- package/dist/ai-bubble/src/ai-bubble.vue +1228 -54
- package/dist/ai-bubble/src/ai-bubble.vue.d.ts +235 -72
- package/dist/ai-bubble-list/__tests__/ai-bubble-list.ssr.test.cjs +51 -0
- package/dist/ai-bubble-list/__tests__/ai-bubble-list.ssr.test.mjs +51 -0
- package/dist/ai-bubble-list/__tests__/ai-bubble-list.test.cjs +138 -0
- package/dist/ai-bubble-list/__tests__/ai-bubble-list.test.mjs +112 -0
- package/dist/ai-bubble-list/index.cjs +26 -0
- package/dist/ai-bubble-list/index.d.ts +156 -0
- package/dist/ai-bubble-list/index.mjs +5 -0
- package/dist/ai-bubble-list/src/ai-bubble-list.cjs +57 -0
- package/dist/ai-bubble-list/src/ai-bubble-list.css +490 -0
- package/dist/ai-bubble-list/src/ai-bubble-list.d.ts +58 -0
- package/dist/ai-bubble-list/src/ai-bubble-list.mjs +51 -0
- package/dist/ai-bubble-list/src/ai-bubble-list.vue +594 -0
- package/dist/ai-bubble-list/src/ai-bubble-list.vue.d.ts +93 -0
- package/dist/ai-chat/__tests__/ai-chat.ssr.test.cjs +8 -0
- package/dist/ai-chat/__tests__/ai-chat.ssr.test.mjs +8 -0
- package/dist/ai-chat/__tests__/ai-chat.test.cjs +8 -0
- package/dist/ai-chat/__tests__/ai-chat.test.mjs +8 -0
- package/dist/ai-chat/index.d.ts +164 -1
- package/dist/ai-chat/src/ai-chat.cjs +21 -0
- package/dist/ai-chat/src/ai-chat.css +25 -0
- package/dist/ai-chat/src/ai-chat.d.ts +21 -0
- package/dist/ai-chat/src/ai-chat.mjs +21 -0
- package/dist/ai-chat/src/ai-chat.vue +93 -16
- package/dist/ai-chat/src/ai-chat.vue.d.ts +64 -7
- package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.cjs +9 -0
- package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.mjs +9 -0
- package/dist/ai-code-block/index.d.ts +220 -1
- package/dist/ai-code-block/src/ai-code-block.cjs +17 -1
- package/dist/ai-code-block/src/ai-code-block.css +23 -0
- package/dist/ai-code-block/src/ai-code-block.d.ts +18 -1
- package/dist/ai-code-block/src/ai-code-block.mjs +17 -1
- package/dist/ai-code-block/src/ai-code-block.vue +132 -27
- package/dist/ai-code-block/src/ai-code-block.vue.d.ts +72 -6
- package/dist/ai-code-editor/__tests__/ai-code-editor.ssr.test.cjs +46 -0
- package/dist/ai-code-editor/__tests__/ai-code-editor.ssr.test.mjs +39 -0
- package/dist/ai-code-editor/__tests__/ai-code-editor.test.cjs +90 -0
- package/dist/ai-code-editor/__tests__/ai-code-editor.test.mjs +78 -0
- package/dist/ai-code-editor/index.cjs +26 -0
- package/dist/ai-code-editor/index.d.ts +135 -0
- package/dist/ai-code-editor/index.mjs +5 -0
- package/dist/ai-code-editor/src/ai-code-editor.cjs +100 -0
- package/dist/ai-code-editor/src/ai-code-editor.css +473 -0
- package/dist/ai-code-editor/src/ai-code-editor.d.ts +104 -0
- package/dist/ai-code-editor/src/ai-code-editor.mjs +94 -0
- package/dist/ai-code-editor/src/ai-code-editor.vue +673 -0
- package/dist/ai-code-editor/src/ai-code-editor.vue.d.ts +132 -0
- package/dist/ai-code-runner/__tests__/ai-code-runner.ssr.test.cjs +28 -0
- package/dist/ai-code-runner/__tests__/ai-code-runner.ssr.test.mjs +26 -0
- package/dist/ai-code-runner/__tests__/ai-code-runner.test.cjs +69 -0
- package/dist/ai-code-runner/__tests__/ai-code-runner.test.mjs +66 -0
- package/dist/ai-code-runner/index.cjs +26 -0
- package/dist/ai-code-runner/index.d.ts +70 -0
- package/dist/ai-code-runner/index.mjs +5 -0
- package/dist/ai-code-runner/src/ai-code-runner.cjs +50 -0
- package/dist/ai-code-runner/src/ai-code-runner.css +504 -0
- package/dist/ai-code-runner/src/ai-code-runner.d.ts +55 -0
- package/dist/ai-code-runner/src/ai-code-runner.mjs +44 -0
- package/dist/ai-code-runner/src/ai-code-runner.vue +692 -0
- package/dist/ai-code-runner/src/ai-code-runner.vue.d.ts +67 -0
- package/dist/ai-code-runner/src/webcontainer.cjs +17 -0
- package/dist/ai-code-runner/src/webcontainer.d.ts +4 -0
- package/dist/ai-code-runner/src/webcontainer.mjs +9 -0
- package/dist/ai-conversations/index.d.ts +216 -1
- package/dist/ai-conversations/src/ai-conversations.cjs +29 -0
- package/dist/ai-conversations/src/ai-conversations.css +45 -7
- package/dist/ai-conversations/src/ai-conversations.d.ts +28 -0
- package/dist/ai-conversations/src/ai-conversations.mjs +29 -0
- package/dist/ai-conversations/src/ai-conversations.vue +172 -42
- package/dist/ai-conversations/src/ai-conversations.vue.d.ts +78 -3
- package/dist/ai-editor-sender/index.d.ts +417 -1
- package/dist/ai-editor-sender/src/ai-editor-sender.cjs +92 -1
- package/dist/ai-editor-sender/src/ai-editor-sender.css +96 -0
- package/dist/ai-editor-sender/src/ai-editor-sender.d.ts +144 -29
- package/dist/ai-editor-sender/src/ai-editor-sender.mjs +92 -1
- package/dist/ai-editor-sender/src/ai-editor-sender.vue +309 -3
- package/dist/ai-editor-sender/src/ai-editor-sender.vue.d.ts +221 -50
- package/dist/ai-file-card/__tests__/ai-file-card.ssr.test.cjs +45 -0
- package/dist/ai-file-card/__tests__/ai-file-card.ssr.test.mjs +29 -0
- package/dist/ai-file-card/__tests__/ai-file-card.test.cjs +160 -0
- package/dist/ai-file-card/__tests__/ai-file-card.test.mjs +109 -0
- package/dist/ai-file-card/index.cjs +26 -0
- package/dist/ai-file-card/index.d.ts +231 -0
- package/dist/ai-file-card/index.mjs +5 -0
- package/dist/ai-file-card/src/ai-file-card.cjs +76 -0
- package/dist/ai-file-card/src/ai-file-card.css +757 -0
- package/dist/ai-file-card/src/ai-file-card.d.ts +176 -0
- package/dist/ai-file-card/src/ai-file-card.mjs +70 -0
- package/dist/ai-file-card/src/ai-file-card.vue +1054 -0
- package/dist/ai-file-card/src/ai-file-card.vue.d.ts +135 -0
- package/dist/ai-mention/index.d.ts +368 -14
- package/dist/ai-mention/src/ai-mention.cjs +73 -2
- package/dist/ai-mention/src/ai-mention.css +125 -0
- package/dist/ai-mention/src/ai-mention.d.ts +105 -1
- package/dist/ai-mention/src/ai-mention.mjs +73 -2
- package/dist/ai-mention/src/ai-mention.vue +596 -10
- package/dist/ai-mention/src/ai-mention.vue.d.ts +158 -15
- package/dist/ai-mermaid/__tests__/ai-mermaid.ssr.test.cjs +43 -0
- package/dist/ai-mermaid/__tests__/ai-mermaid.ssr.test.mjs +33 -0
- package/dist/ai-mermaid/__tests__/ai-mermaid.test.cjs +113 -0
- package/dist/ai-mermaid/__tests__/ai-mermaid.test.mjs +92 -0
- package/dist/ai-mermaid/index.cjs +26 -0
- package/dist/ai-mermaid/index.d.ts +228 -0
- package/dist/ai-mermaid/index.mjs +5 -0
- package/dist/ai-mermaid/src/ai-mermaid.cjs +72 -0
- package/dist/ai-mermaid/src/ai-mermaid.css +601 -0
- package/dist/ai-mermaid/src/ai-mermaid.d.ts +113 -0
- package/dist/ai-mermaid/src/ai-mermaid.mjs +66 -0
- package/dist/ai-mermaid/src/ai-mermaid.vue +841 -0
- package/dist/ai-mermaid/src/ai-mermaid.vue.d.ts +133 -0
- package/dist/ai-prompts/index.d.ts +104 -1
- package/dist/ai-prompts/src/ai-prompts.vue.d.ts +27 -6
- package/dist/ai-provider/index.d.ts +139 -1
- package/dist/ai-provider/src/ai-provider.cjs +61 -1
- package/dist/ai-provider/src/ai-provider.d.ts +116 -6
- package/dist/ai-provider/src/ai-provider.mjs +57 -0
- package/dist/ai-provider/src/ai-provider.vue +58 -3
- package/dist/ai-provider/src/ai-provider.vue.d.ts +44 -7
- package/dist/ai-sender/__tests__/ai-sender.test.cjs +118 -2
- package/dist/ai-sender/__tests__/ai-sender.test.mjs +68 -1
- package/dist/ai-sender/index.d.ts +236 -1
- package/dist/ai-sender/src/ai-sender.cjs +5 -1
- package/dist/ai-sender/src/ai-sender.css +38 -0
- package/dist/ai-sender/src/ai-sender.d.ts +4 -0
- package/dist/ai-sender/src/ai-sender.mjs +5 -1
- package/dist/ai-sender/src/ai-sender.vue +86 -2
- package/dist/ai-sender/src/ai-sender.vue.d.ts +77 -15
- package/dist/ai-sources/__tests__/ai-sources.test.cjs +112 -5
- package/dist/ai-sources/__tests__/ai-sources.test.mjs +78 -7
- package/dist/ai-sources/index.d.ts +136 -1
- package/dist/ai-sources/src/ai-sources.css +24 -0
- package/dist/ai-sources/src/ai-sources.d.ts +3 -0
- package/dist/ai-sources/src/ai-sources.vue +88 -21
- package/dist/ai-sources/src/ai-sources.vue.d.ts +38 -5
- package/dist/ai-thinking/index.d.ts +152 -1
- package/dist/ai-thinking/src/ai-thinking.cjs +28 -0
- package/dist/ai-thinking/src/ai-thinking.d.ts +28 -0
- package/dist/ai-thinking/src/ai-thinking.mjs +28 -0
- package/dist/ai-thinking/src/ai-thinking.vue +9 -6
- package/dist/ai-thinking/src/ai-thinking.vue.d.ts +58 -2
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.cjs +6 -1
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.mjs +4 -1
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.cjs +141 -1
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.mjs +104 -1
- package/dist/ai-thought-chain/index.d.ts +286 -1
- package/dist/ai-thought-chain/src/ai-thought-chain.cjs +61 -1
- package/dist/ai-thought-chain/src/ai-thought-chain.css +106 -0
- package/dist/ai-thought-chain/src/ai-thought-chain.d.ts +68 -0
- package/dist/ai-thought-chain/src/ai-thought-chain.mjs +61 -1
- package/dist/ai-thought-chain/src/ai-thought-chain.vue +285 -20
- package/dist/ai-thought-chain/src/ai-thought-chain.vue.d.ts +95 -11
- package/dist/ai-voice-trigger/index.d.ts +155 -1
- package/dist/ai-voice-trigger/src/ai-voice-trigger.vue +2 -2
- package/dist/ai-voice-trigger/src/ai-voice-trigger.vue.d.ts +43 -4
- package/dist/ai-welcome/index.d.ts +131 -1
- package/dist/ai-welcome/src/ai-welcome.vue.d.ts +32 -3
- package/dist/alert/index.d.ts +289 -1
- package/dist/alert/src/alert.vue.d.ts +81 -10
- package/dist/autocomplete/index.d.ts +134 -1
- package/dist/autocomplete/src/autocomplete.vue.d.ts +15 -12
- package/dist/avatar/index.d.ts +9 -6
- package/dist/avatar/src/avatar.d.ts +4 -0
- package/dist/avatar/src/avatar.vue +2 -0
- package/dist/avatar/src/avatar.vue.d.ts +2 -1
- package/dist/back-top/index.d.ts +153 -1
- package/dist/back-top/src/back-top.vue.d.ts +42 -5
- package/dist/badge/index.d.ts +40 -1
- package/dist/badge/src/badge.vue.d.ts +1 -1
- package/dist/breadcrumb/index.d.ts +177 -2
- package/dist/breadcrumb/src/breadcrumb-item.vue.d.ts +1 -1
- package/dist/button/index.d.ts +33 -33
- package/dist/button/src/button.css +11 -6
- package/dist/button/src/button.vue +11 -6
- package/dist/button/src/button.vue.d.ts +6 -6
- package/dist/calendar/index.d.ts +1653 -1
- package/dist/calendar/src/calendar.vue +12 -11
- package/dist/calendar/src/calendar.vue.d.ts +241 -121
- package/dist/card/index.d.ts +44 -1
- package/dist/card/src/card.vue.d.ts +2 -2
- package/dist/carousel/__tests__/carousel.ssr.test.cjs +27 -0
- package/dist/carousel/__tests__/carousel.ssr.test.mjs +27 -0
- package/dist/carousel/__tests__/carousel.test.cjs +115 -0
- package/dist/carousel/__tests__/carousel.test.mjs +98 -0
- package/dist/carousel/index.cjs +43 -0
- package/dist/carousel/index.d.ts +456 -0
- package/dist/carousel/index.mjs +10 -0
- package/dist/carousel/src/carousel-item.cjs +10 -0
- package/dist/carousel/src/carousel-item.d.ts +9 -0
- package/dist/carousel/src/carousel-item.mjs +4 -0
- package/dist/carousel/src/carousel-item.vue +277 -0
- package/dist/{menu/src/menu-item-group.d.vue.ts → carousel/src/carousel-item.vue.d.ts} +4 -12
- package/dist/carousel/src/carousel.cjs +118 -0
- package/dist/carousel/src/carousel.css +705 -0
- package/dist/carousel/src/carousel.d.ts +137 -0
- package/dist/carousel/src/carousel.mjs +112 -0
- package/dist/carousel/src/carousel.vue +1070 -0
- package/dist/carousel/src/carousel.vue.d.ts +235 -0
- package/dist/cascader/index.d.ts +211 -2
- package/dist/cascader/src/cascader-panel.vue.d.ts +3 -3
- package/dist/cascader/src/cascader.vue.d.ts +14 -14
- package/dist/category-nav/__tests__/category-nav.ssr.test.cjs +35 -0
- package/dist/category-nav/__tests__/category-nav.ssr.test.mjs +21 -0
- package/dist/category-nav/__tests__/category-nav.test.cjs +53 -0
- package/dist/category-nav/__tests__/category-nav.test.mjs +33 -0
- package/dist/category-nav/index.cjs +26 -0
- package/dist/category-nav/index.d.ts +225 -0
- package/dist/category-nav/index.mjs +5 -0
- package/dist/category-nav/src/category-nav.cjs +66 -0
- package/dist/category-nav/src/category-nav.css +663 -0
- package/dist/category-nav/src/category-nav.d.ts +86 -0
- package/dist/category-nav/src/category-nav.mjs +60 -0
- package/dist/category-nav/src/category-nav.vue +966 -0
- package/dist/category-nav/src/category-nav.vue.d.ts +137 -0
- package/dist/checkbox/index.d.ts +44 -44
- package/dist/checkbox/src/checkbox-group.vue.d.ts +1 -1
- package/dist/checkbox/src/checkbox.vue.d.ts +2 -2
- package/dist/col/index.d.ts +338 -1
- package/dist/col/src/col.vue.d.ts +4 -4
- package/dist/color-picker/index.d.ts +84 -1
- package/dist/color-picker/src/color-picker.vue.d.ts +45 -4
- package/dist/component.d.ts +56 -1
- package/dist/config-provider/index.d.ts +2 -2
- package/dist/config-provider/src/config-provider.d.ts +2 -2
- package/dist/container/index.d.ts +103 -5
- package/dist/countdown/index.d.ts +419 -1
- package/dist/countdown/src/countdown.vue.d.ts +121 -16
- package/dist/coupon-card/__tests__/coupon-card.ssr.test.cjs +21 -0
- package/dist/coupon-card/__tests__/coupon-card.ssr.test.mjs +18 -0
- package/dist/coupon-card/__tests__/coupon-card.test.cjs +67 -0
- package/dist/coupon-card/__tests__/coupon-card.test.mjs +64 -0
- package/dist/coupon-card/index.cjs +26 -0
- package/dist/coupon-card/index.d.ts +346 -0
- package/dist/coupon-card/index.mjs +5 -0
- package/dist/coupon-card/src/coupon-card.cjs +108 -0
- package/dist/coupon-card/src/coupon-card.css +786 -0
- package/dist/coupon-card/src/coupon-card.d.ts +106 -0
- package/dist/coupon-card/src/coupon-card.mjs +102 -0
- package/dist/coupon-card/src/coupon-card.vue +963 -0
- package/dist/coupon-card/src/coupon-card.vue.d.ts +206 -0
- package/dist/date-picker/index.d.ts +606 -1
- package/dist/date-picker/src/date-picker.vue +3 -1
- package/dist/date-picker/src/date-picker.vue.d.ts +29 -27
- package/dist/date-picker/src/date-table.vue.d.ts +2 -1
- package/dist/descriptions/index.d.ts +492 -2
- package/dist/descriptions/src/description-item.vue.d.ts +5 -5
- package/dist/descriptions/src/descriptions.vue.d.ts +4 -4
- package/dist/dialog/index.d.ts +665 -2
- package/dist/dialog/src/dialog.vue +3 -2
- package/dist/dialog/src/dialog.vue.d.ts +200 -22
- package/dist/divider/index.d.ts +113 -1
- package/dist/divider/src/divider.vue.d.ts +3 -3
- package/dist/drawer/index.d.ts +391 -13
- package/dist/drawer/src/drawer.vue.d.ts +120 -10
- package/dist/dropdown/index.d.ts +627 -3
- package/dist/dropdown/src/dropdown-item.vue.d.ts +2 -2
- package/dist/dropdown/src/dropdown.vue.d.ts +135 -18
- package/dist/empty/index.d.ts +27 -1
- package/dist/env.d.ts +6 -0
- package/dist/filter-bar/__tests__/filter-bar.ssr.test.cjs +29 -0
- package/dist/filter-bar/__tests__/filter-bar.ssr.test.mjs +16 -0
- package/dist/filter-bar/__tests__/filter-bar.test.cjs +51 -0
- package/dist/filter-bar/__tests__/filter-bar.test.mjs +29 -0
- package/dist/filter-bar/index.cjs +26 -0
- package/dist/filter-bar/index.d.ts +287 -0
- package/dist/filter-bar/index.mjs +5 -0
- package/dist/filter-bar/src/filter-bar.cjs +90 -0
- package/dist/filter-bar/src/filter-bar.css +761 -0
- package/dist/filter-bar/src/filter-bar.d.ts +124 -0
- package/dist/filter-bar/src/filter-bar.mjs +81 -0
- package/dist/filter-bar/src/filter-bar.vue +1087 -0
- package/dist/filter-bar/src/filter-bar.vue.d.ts +170 -0
- package/dist/form/index.d.ts +690 -3
- package/dist/form/src/form-item.vue.d.ts +7 -7
- package/dist/form/src/form-schema.vue.d.ts +32 -26
- package/dist/form/src/form.vue.d.ts +3 -3
- package/dist/gantt-chart/__tests__/debug_ssr.test.cjs +51 -0
- package/dist/gantt-chart/__tests__/debug_ssr.test.mjs +37 -0
- package/dist/gantt-chart/__tests__/gantt-chart.ssr.test.cjs +95 -0
- package/dist/gantt-chart/__tests__/gantt-chart.ssr.test.mjs +94 -0
- package/dist/gantt-chart/__tests__/gantt-chart.test.cjs +86 -0
- package/dist/gantt-chart/__tests__/gantt-chart.test.mjs +79 -0
- package/dist/gantt-chart/index.cjs +26 -0
- package/dist/gantt-chart/index.d.ts +115 -0
- package/dist/gantt-chart/index.mjs +5 -0
- package/dist/gantt-chart/src/gantt-chart.cjs +1 -0
- package/dist/gantt-chart/src/gantt-chart.css +853 -0
- package/dist/gantt-chart/src/gantt-chart.d.ts +112 -0
- package/dist/gantt-chart/src/gantt-chart.mjs +0 -0
- package/dist/gantt-chart/src/gantt-chart.vue +1583 -0
- package/dist/gantt-chart/src/gantt-chart.vue.d.ts +51 -0
- package/dist/grid/index.d.ts +67 -2
- package/dist/grid/src/grid-item.vue.d.ts +1 -1
- package/dist/grid/src/grid.vue.d.ts +1 -1
- package/dist/icon/index.d.ts +15 -15
- package/dist/icon/src/icon.vue.d.ts +5 -5
- package/dist/icon/src/icons/index.cjs +39 -2
- package/dist/icon/src/icons/index.d.ts +7 -0
- package/dist/icon/src/icons/index.mjs +44 -1
- package/dist/image/index.d.ts +72 -21
- package/dist/image/src/image-viewer.vue.d.ts +55 -4
- package/dist/image/src/image.vue.d.ts +5 -5
- package/dist/image-magnifier/__tests__/image-magnifier.ssr.test.cjs +54 -0
- package/dist/image-magnifier/__tests__/image-magnifier.ssr.test.mjs +35 -0
- package/dist/image-magnifier/__tests__/image-magnifier.test.cjs +257 -0
- package/dist/image-magnifier/__tests__/image-magnifier.test.mjs +177 -0
- package/dist/image-magnifier/index.cjs +26 -0
- package/dist/image-magnifier/index.d.ts +468 -0
- package/dist/image-magnifier/index.mjs +5 -0
- package/dist/image-magnifier/src/image-magnifier.cjs +142 -0
- package/dist/image-magnifier/src/image-magnifier.css +754 -0
- package/dist/image-magnifier/src/image-magnifier.d.ts +146 -0
- package/dist/image-magnifier/src/image-magnifier.mjs +136 -0
- package/dist/image-magnifier/src/image-magnifier.vue +1134 -0
- package/dist/image-magnifier/src/image-magnifier.vue.d.ts +271 -0
- package/dist/index.cjs +229 -1
- package/dist/index.d.ts +19 -0
- package/dist/index.mjs +59 -1
- package/dist/infinite-scroll/index.d.ts +270 -1
- package/dist/infinite-scroll/src/infinite-scroll.vue.d.ts +71 -6
- package/dist/input/index.d.ts +51 -51
- package/dist/input/src/input.vue.d.ts +16 -16
- package/dist/input-number/index.d.ts +33 -33
- package/dist/input-number/src/input-number.vue.d.ts +9 -9
- package/dist/input-tag/index.d.ts +151 -1
- package/dist/input-tag/src/input-tag.vue.d.ts +22 -22
- package/dist/loading/index.d.ts +1 -1
- package/dist/lucky-draw/__tests__/lucky-draw.ssr.test.cjs +33 -0
- package/dist/lucky-draw/__tests__/lucky-draw.ssr.test.mjs +31 -0
- package/dist/lucky-draw/__tests__/lucky-draw.test.cjs +56 -0
- package/dist/lucky-draw/__tests__/lucky-draw.test.mjs +48 -0
- package/dist/lucky-draw/index.cjs +26 -0
- package/dist/lucky-draw/index.d.ts +209 -0
- package/dist/lucky-draw/index.mjs +5 -0
- package/dist/lucky-draw/src/lucky-draw.cjs +63 -0
- package/dist/lucky-draw/src/lucky-draw.css +683 -0
- package/dist/lucky-draw/src/lucky-draw.d.ts +69 -0
- package/dist/lucky-draw/src/lucky-draw.mjs +57 -0
- package/dist/lucky-draw/src/lucky-draw.vue +865 -0
- package/dist/lucky-draw/src/lucky-draw.vue.d.ts +123 -0
- package/dist/marquee/index.d.ts +305 -1
- package/dist/marquee/src/marquee.vue.d.ts +80 -6
- package/dist/mention/index.d.ts +75 -75
- package/dist/mention/src/mention.vue.d.ts +26 -26
- package/dist/menu/index.d.ts +890 -4
- package/dist/menu/src/menu-item.vue.d.ts +1 -1
- package/dist/menu/src/menu-recursive-item.vue +30 -11
- package/dist/menu/src/menu.cjs +1 -1
- package/dist/menu/src/menu.d.ts +3 -3
- package/dist/menu/src/menu.mjs +1 -1
- package/dist/menu/src/menu.vue +1 -1
- package/dist/menu/src/menu.vue.d.ts +179 -16
- package/dist/menu/src/sub-menu.vue +10 -3
- package/dist/menu/src/sub-menu.vue.d.ts +1 -1
- package/dist/message/index.d.ts +1 -1
- package/dist/message/src/message.vue.d.ts +2 -2
- package/dist/message-box/index.cjs +1 -1
- package/dist/message-box/index.d.ts +1 -1
- package/dist/message-box/index.mjs +1 -1
- package/dist/notification/index.d.ts +1 -1
- package/dist/notification/src/notification.vue.d.ts +2 -2
- package/dist/pagination/index.d.ts +15 -15
- package/dist/pagination/src/pagination.vue.d.ts +5 -5
- package/dist/popconfirm/index.d.ts +433 -1
- package/dist/popconfirm/src/popconfirm.cjs +1 -1
- package/dist/popconfirm/src/popconfirm.d.ts +2 -2
- package/dist/popconfirm/src/popconfirm.mjs +1 -1
- package/dist/popconfirm/src/popconfirm.vue.d.ts +125 -16
- package/dist/popover/index.d.ts +392 -1
- package/dist/popover/src/popover.cjs +1 -1
- package/dist/popover/src/popover.d.ts +2 -2
- package/dist/popover/src/popover.mjs +1 -1
- package/dist/popover/src/popover.vue.d.ts +113 -16
- package/dist/price/__tests__/price.ssr.test.cjs +20 -0
- package/dist/price/__tests__/price.ssr.test.mjs +19 -0
- package/dist/price/__tests__/price.test.cjs +45 -0
- package/dist/price/__tests__/price.test.mjs +42 -0
- package/dist/price/index.cjs +26 -0
- package/dist/price/index.d.ts +369 -0
- package/dist/price/index.mjs +5 -0
- package/dist/price/src/price.cjs +118 -0
- package/dist/price/src/price.css +601 -0
- package/dist/price/src/price.d.ts +114 -0
- package/dist/price/src/price.mjs +112 -0
- package/dist/price/src/price.vue +749 -0
- package/dist/price/src/price.vue.d.ts +223 -0
- package/dist/product-card/__tests__/product-card.ssr.test.cjs +21 -0
- package/dist/product-card/__tests__/product-card.ssr.test.mjs +18 -0
- package/dist/product-card/__tests__/product-card.test.cjs +54 -0
- package/dist/product-card/__tests__/product-card.test.mjs +53 -0
- package/dist/product-card/index.cjs +26 -0
- package/dist/product-card/index.d.ts +563 -0
- package/dist/product-card/index.mjs +5 -0
- package/dist/product-card/src/product-card.cjs +184 -0
- package/dist/product-card/src/product-card.css +856 -0
- package/dist/product-card/src/product-card.d.ts +188 -0
- package/dist/product-card/src/product-card.mjs +178 -0
- package/dist/product-card/src/product-card.vue +1097 -0
- package/dist/product-card/src/product-card.vue.d.ts +333 -0
- package/dist/progress/index.d.ts +321 -1
- package/dist/progress/src/progress.vue.d.ts +9 -9
- package/dist/radio/index.d.ts +147 -3
- package/dist/radio/src/radio-button.vue +19 -5
- package/dist/radio/src/radio-group.vue.d.ts +1 -1
- package/dist/rate/index.d.ts +313 -1
- package/dist/rate/src/rate.vue.d.ts +90 -11
- package/dist/result/index.d.ts +31 -1
- package/dist/row/index.d.ts +98 -1
- package/dist/row/src/row.d.ts +2 -2
- package/dist/row/src/row.vue.d.ts +2 -2
- package/dist/scrollbar/__tests__/scrollbar.ssr.test.cjs +49 -0
- package/dist/scrollbar/__tests__/scrollbar.ssr.test.mjs +54 -0
- package/dist/scrollbar/__tests__/scrollbar.test.cjs +43 -0
- package/dist/scrollbar/__tests__/scrollbar.test.mjs +40 -0
- package/dist/scrollbar/index.cjs +26 -0
- package/dist/scrollbar/index.d.ts +213 -0
- package/dist/scrollbar/index.mjs +5 -0
- package/dist/scrollbar/src/scrollbar.cjs +82 -0
- package/dist/scrollbar/src/scrollbar.css +521 -0
- package/dist/scrollbar/src/scrollbar.d.ts +82 -0
- package/dist/scrollbar/src/scrollbar.mjs +73 -0
- package/dist/scrollbar/src/scrollbar.vue +680 -0
- package/dist/scrollbar/src/scrollbar.vue.d.ts +115 -0
- package/dist/scrollbar/src/thumb.vue +112 -0
- package/dist/scrollbar/src/thumb.vue.d.ts +16 -0
- package/dist/scrollbar/src/util.cjs +42 -0
- package/dist/scrollbar/src/util.d.ts +27 -0
- package/dist/scrollbar/src/util.mjs +35 -0
- package/dist/select/index.d.ts +177 -2
- package/dist/select/src/select.vue.d.ts +18 -18
- package/dist/skeleton/index.d.ts +278 -2
- package/dist/skeleton/src/skeleton-item.vue +12 -1
- package/dist/skeleton/src/skeleton-item.vue.d.ts +2 -2
- package/dist/skeleton/src/skeleton.css +12 -1
- package/dist/skeleton/src/skeleton.vue +12 -1
- package/dist/skeleton/src/skeleton.vue.d.ts +1 -1
- package/dist/sku-selector/__tests__/sku-selector.ssr.test.cjs +32 -0
- package/dist/sku-selector/__tests__/sku-selector.ssr.test.mjs +19 -0
- package/dist/sku-selector/__tests__/sku-selector.test.cjs +64 -0
- package/dist/sku-selector/__tests__/sku-selector.test.mjs +53 -0
- package/dist/sku-selector/index.cjs +26 -0
- package/dist/sku-selector/index.d.ts +228 -0
- package/dist/sku-selector/index.mjs +5 -0
- package/dist/sku-selector/src/sku-selector.cjs +70 -0
- package/dist/sku-selector/src/sku-selector.css +664 -0
- package/dist/sku-selector/src/sku-selector.d.ts +96 -0
- package/dist/sku-selector/src/sku-selector.mjs +64 -0
- package/dist/sku-selector/src/sku-selector.vue +779 -0
- package/dist/sku-selector/src/sku-selector.vue.d.ts +137 -0
- package/dist/slider/index.d.ts +463 -1
- package/dist/slider/src/slider-button.vue.d.ts +4 -4
- package/dist/slider/src/slider.vue.d.ts +133 -13
- package/dist/smart-address/__tests__/smart-address.ssr.test.cjs +28 -0
- package/dist/smart-address/__tests__/smart-address.ssr.test.mjs +25 -0
- package/dist/smart-address/__tests__/smart-address.test.cjs +68 -0
- package/dist/smart-address/__tests__/smart-address.test.mjs +56 -0
- package/dist/smart-address/index.cjs +38 -0
- package/dist/smart-address/index.d.ts +331 -0
- package/dist/smart-address/index.mjs +6 -0
- package/dist/smart-address/src/smart-address.cjs +108 -0
- package/dist/smart-address/src/smart-address.css +616 -0
- package/dist/smart-address/src/smart-address.d.ts +114 -0
- package/dist/smart-address/src/smart-address.mjs +102 -0
- package/dist/smart-address/src/smart-address.vue +966 -0
- package/dist/smart-address/src/smart-address.vue.d.ts +204 -0
- package/dist/smart-address/src/use-address-parser.cjs +137 -0
- package/dist/smart-address/src/use-address-parser.d.ts +28 -0
- package/dist/smart-address/src/use-address-parser.mjs +132 -0
- package/dist/space/index.d.ts +40 -1
- package/dist/space/src/space.vue.d.ts +2 -2
- package/dist/spin/index.d.ts +162 -7
- package/dist/spin/src/spin.vue.d.ts +48 -5
- package/dist/steps/index.d.ts +606 -2
- package/dist/steps/src/step.vue.d.ts +4 -4
- package/dist/steps/src/steps.vue.d.ts +77 -8
- package/dist/submit-bar/__tests__/submit-bar.ssr.test.cjs +21 -0
- package/dist/submit-bar/__tests__/submit-bar.ssr.test.mjs +18 -0
- package/dist/submit-bar/__tests__/submit-bar.test.cjs +50 -0
- package/dist/submit-bar/__tests__/submit-bar.test.mjs +36 -0
- package/dist/submit-bar/index.cjs +26 -0
- package/dist/submit-bar/index.d.ts +297 -0
- package/dist/submit-bar/index.mjs +5 -0
- package/dist/submit-bar/src/submit-bar.cjs +94 -0
- package/dist/submit-bar/src/submit-bar.css +639 -0
- package/dist/submit-bar/src/submit-bar.d.ts +93 -0
- package/dist/submit-bar/src/submit-bar.mjs +88 -0
- package/dist/submit-bar/src/submit-bar.vue +749 -0
- package/dist/submit-bar/src/submit-bar.vue.d.ts +175 -0
- package/dist/switch/index.d.ts +372 -1
- package/dist/switch/src/switch.vue.d.ts +98 -7
- package/dist/table/index.d.ts +1248 -2
- package/dist/table/src/table-column.vue +7 -3
- package/dist/table/src/table-column.vue.d.ts +9 -19
- package/dist/table/src/table.d.ts +3 -3
- package/dist/table/src/table.vue +28 -9
- package/dist/table/src/table.vue.d.ts +346 -34
- package/dist/table/src/use-table-import.cjs +1 -1
- package/dist/table/src/use-table-import.mjs +1 -1
- package/dist/tabs/index.d.ts +583 -2
- package/dist/tabs/src/tab-pane.vue.d.ts +2 -2
- package/dist/tabs/src/tabs.vue.d.ts +98 -8
- package/dist/tag/index.d.ts +86 -1
- package/dist/tag/src/tag.vue.d.ts +8 -8
- package/dist/time-picker/index.d.ts +166 -1
- package/dist/time-picker/src/time-picker.vue.d.ts +19 -19
- package/dist/time-select/index.d.ts +112 -1
- package/dist/time-select/src/time-select.vue.d.ts +12 -12
- package/dist/tooltip/index.d.ts +467 -19
- package/dist/tooltip/src/tooltip.cjs +4 -4
- package/dist/tooltip/src/tooltip.d.ts +5 -5
- package/dist/tooltip/src/tooltip.mjs +4 -4
- package/dist/tooltip/src/tooltip.vue +2 -1
- package/dist/tooltip/src/tooltip.vue.d.ts +146 -21
- package/dist/transfer/src/transfer-panel.vue.d.ts +7 -7
- package/dist/transfer/src/transfer.vue.d.ts +10 -10
- package/dist/tree/index.d.ts +623 -2
- package/dist/tree/src/tree.vue.d.ts +176 -28
- package/dist/tree-select/index.d.ts +435 -1
- package/dist/tree-select/src/tree-select.vue.d.ts +128 -18
- package/dist/typography/index.d.ts +180 -4
- package/dist/typography/src/link.vue.d.ts +1 -1
- package/dist/typography/src/paragraph.vue.d.ts +2 -2
- package/dist/typography/src/text.vue.d.ts +4 -4
- package/dist/typography/src/title.vue.d.ts +3 -3
- package/dist/upload/index.d.ts +391 -1
- package/dist/upload/src/upload.css +0 -441
- package/dist/upload/src/upload.vue +1 -441
- package/dist/upload/src/upload.vue.d.ts +108 -11
- package/dist/waterfall/index.d.ts +57 -1
- package/dist/waterfall/src/waterfall.vue.d.ts +3 -3
- package/dist/watermark/index.d.ts +284 -1
- package/dist/watermark/src/watermark.vue.d.ts +6 -6
- package/package.json +26 -11
- package/dist/__tests__/resolver.test.cjs +0 -56
- package/dist/__tests__/resolver.test.d.ts +0 -1
- package/dist/__tests__/resolver.test.mjs +0 -52
- package/dist/__tests__/utils/ssr.cjs +0 -114
- package/dist/__tests__/utils/ssr.d.ts +0 -29
- package/dist/__tests__/utils/ssr.mjs +0 -119
- package/dist/affix/__tests__/affix.bottom.test.d.ts +0 -1
- package/dist/affix/__tests__/affix.ssr.test.d.ts +0 -1
- package/dist/affix/__tests__/affix.test.d.ts +0 -1
- package/dist/affix/src/affix.d.vue.ts +0 -66
- package/dist/ai-action-group/__tests__/ai-action-group.ssr.test.d.ts +0 -1
- package/dist/ai-action-group/__tests__/ai-action-group.test.d.ts +0 -1
- package/dist/ai-action-group/src/ai-action-group.d.vue.ts +0 -40
- package/dist/ai-agent-card/__tests__/ai-agent-card.ssr.test.d.ts +0 -1
- package/dist/ai-agent-card/__tests__/ai-agent-card.test.d.ts +0 -1
- package/dist/ai-agent-card/src/ai-agent-card.d.vue.ts +0 -62
- package/dist/ai-artifacts/__tests__/ai-artifacts.ssr.test.d.ts +0 -1
- package/dist/ai-artifacts/__tests__/ai-artifacts.test.d.ts +0 -1
- package/dist/ai-artifacts/src/ai-artifacts.d.vue.ts +0 -50
- package/dist/ai-bubble/__tests__/ai-bubble.ssr.test.d.ts +0 -1
- package/dist/ai-bubble/__tests__/ai-bubble.test.d.ts +0 -1
- package/dist/ai-bubble/src/ai-bubble.d.vue.ts +0 -110
- package/dist/ai-chat/__tests__/ai-chat.ssr.test.d.ts +0 -1
- package/dist/ai-chat/__tests__/ai-chat.test.d.ts +0 -1
- package/dist/ai-chat/src/ai-chat.d.vue.ts +0 -43
- package/dist/ai-code-block/__tests__/ai-code-block.ssr.test.d.ts +0 -1
- package/dist/ai-code-block/__tests__/ai-code-block.test.d.ts +0 -1
- package/dist/ai-code-block/src/ai-code-block.d.vue.ts +0 -63
- package/dist/ai-conversations/__tests__/ai-conversations.ssr.test.d.ts +0 -1
- package/dist/ai-conversations/__tests__/ai-conversations.test.d.ts +0 -1
- package/dist/ai-conversations/src/ai-conversations.d.vue.ts +0 -52
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.ssr.test.d.ts +0 -1
- package/dist/ai-editor-sender/__tests__/ai-editor-sender.test.d.ts +0 -1
- package/dist/ai-editor-sender/src/ai-editor-sender.d.vue.ts +0 -70
- package/dist/ai-mention/__tests__/ai-mention.ssr.test.d.ts +0 -1
- package/dist/ai-mention/__tests__/ai-mention.test.d.ts +0 -1
- package/dist/ai-mention/src/ai-mention.d.vue.ts +0 -68
- package/dist/ai-prompts/__tests__/ai-prompts.ssr.test.d.ts +0 -1
- package/dist/ai-prompts/__tests__/ai-prompts.test.d.ts +0 -1
- package/dist/ai-prompts/src/ai-prompts.d.vue.ts +0 -44
- package/dist/ai-provider/__tests__/ai-provider.ssr.test.d.ts +0 -1
- package/dist/ai-provider/__tests__/ai-provider.test.d.ts +0 -1
- package/dist/ai-provider/src/ai-provider.d.vue.ts +0 -48
- package/dist/ai-sender/__tests__/ai-sender.ssr.test.d.ts +0 -1
- package/dist/ai-sender/__tests__/ai-sender.test.d.ts +0 -1
- package/dist/ai-sender/src/ai-sender.d.vue.ts +0 -74
- package/dist/ai-sources/__tests__/ai-sources.ssr.test.d.ts +0 -1
- package/dist/ai-sources/__tests__/ai-sources.test.d.ts +0 -1
- package/dist/ai-sources/src/ai-sources.d.vue.ts +0 -45
- package/dist/ai-thinking/__tests__/ai-thinking.ssr.test.d.ts +0 -1
- package/dist/ai-thinking/__tests__/ai-thinking.test.d.ts +0 -1
- package/dist/ai-thinking/src/ai-thinking.d.vue.ts +0 -33
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.ssr.test.d.ts +0 -1
- package/dist/ai-thought-chain/__tests__/ai-thought-chain.test.d.ts +0 -1
- package/dist/ai-thought-chain/src/ai-thought-chain.d.vue.ts +0 -83
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.ssr.test.d.ts +0 -1
- package/dist/ai-voice-trigger/__tests__/ai-voice-trigger.test.d.ts +0 -1
- package/dist/ai-voice-trigger/src/ai-voice-trigger.d.vue.ts +0 -49
- package/dist/ai-welcome/__tests__/ai-welcome.ssr.test.d.ts +0 -1
- package/dist/ai-welcome/__tests__/ai-welcome.test.d.ts +0 -1
- package/dist/ai-welcome/src/ai-welcome.d.vue.ts +0 -51
- package/dist/alert/__tests__/alert.ssr.test.d.ts +0 -1
- package/dist/alert/__tests__/alert.test.d.ts +0 -1
- package/dist/alert/src/alert.d.vue.ts +0 -106
- package/dist/autocomplete/__tests__/autocomplete.ssr.test.d.ts +0 -1
- package/dist/autocomplete/__tests__/autocomplete.test.d.ts +0 -1
- package/dist/autocomplete/src/autocomplete.d.vue.ts +0 -63
- package/dist/avatar/__tests__/avatar.ssr.test.d.ts +0 -1
- package/dist/avatar/__tests__/avatar.test.d.ts +0 -1
- package/dist/avatar/src/avatar.d.vue.ts +0 -21
- package/dist/back-top/__tests__/back-top.ssr.test.d.ts +0 -1
- package/dist/back-top/__tests__/back-top.test.d.ts +0 -1
- package/dist/back-top/src/back-top.d.vue.ts +0 -54
- package/dist/badge/__tests__/badge.ssr.test.d.ts +0 -1
- package/dist/badge/__tests__/badge.test.d.ts +0 -1
- package/dist/badge/src/badge.d.vue.ts +0 -22
- package/dist/breadcrumb/__tests__/breadcrumb.ssr.test.d.ts +0 -1
- package/dist/breadcrumb/__tests__/breadcrumb.test.d.ts +0 -1
- package/dist/breadcrumb/src/breadcrumb-item.d.vue.ts +0 -42
- package/dist/breadcrumb/src/breadcrumb.d.vue.ts +0 -41
- package/dist/button/__tests__/button.ssr.test.d.ts +0 -1
- package/dist/button/__tests__/button.test.d.ts +0 -1
- package/dist/button/src/button.d.vue.ts +0 -44
- package/dist/calendar/__tests__/calendar.ssr.test.d.ts +0 -1
- package/dist/calendar/__tests__/calendar.test.d.ts +0 -1
- package/dist/calendar/src/calendar.d.vue.ts +0 -551
- package/dist/card/__tests__/card.ssr.test.d.ts +0 -1
- package/dist/card/__tests__/card.test.d.ts +0 -1
- package/dist/card/src/card.d.vue.ts +0 -26
- package/dist/cascader/__tests__/cascader-panel.test.d.ts +0 -1
- package/dist/cascader/__tests__/cascader.ssr.test.d.ts +0 -1
- package/dist/cascader/__tests__/cascader.test.d.ts +0 -1
- package/dist/cascader/src/cascader-panel.d.vue.ts +0 -39
- package/dist/cascader/src/cascader.d.vue.ts +0 -63
- package/dist/checkbox/__tests__/checkbox.ssr.test.d.ts +0 -1
- package/dist/checkbox/__tests__/checkbox.test.d.ts +0 -1
- package/dist/checkbox/src/checkbox-group.d.vue.ts +0 -24
- package/dist/checkbox/src/checkbox.d.vue.ts +0 -32
- package/dist/col/__tests__/col.ssr.test.d.ts +0 -1
- package/dist/col/__tests__/col.test.d.ts +0 -1
- package/dist/col/src/col.d.vue.ts +0 -189
- package/dist/color-picker/__tests__/color-picker.ssr.test.d.ts +0 -1
- package/dist/color-picker/__tests__/color-picker.test.d.ts +0 -1
- package/dist/color-picker/src/alpha-slider.d.vue.ts +0 -10
- package/dist/color-picker/src/color-picker.d.vue.ts +0 -55
- package/dist/color-picker/src/hue-slider.d.vue.ts +0 -9
- package/dist/color-picker/src/sv-panel.d.vue.ts +0 -11
- package/dist/config-provider/__tests__/config-provider.ssr.test.d.ts +0 -1
- package/dist/config-provider/__tests__/config-provider.test.d.ts +0 -1
- package/dist/container/__tests__/container.ssr.test.d.ts +0 -1
- package/dist/container/__tests__/container.test.d.ts +0 -1
- package/dist/container/src/aside.d.vue.ts +0 -15
- package/dist/container/src/container.d.vue.ts +0 -13
- package/dist/container/src/footer.d.vue.ts +0 -15
- package/dist/container/src/header.d.vue.ts +0 -15
- package/dist/container/src/main.d.vue.ts +0 -13
- package/dist/countdown/__tests__/countdown.ssr.test.d.ts +0 -1
- package/dist/countdown/__tests__/countdown.test.d.ts +0 -1
- package/dist/countdown/src/countdown.d.vue.ts +0 -146
- package/dist/date-picker/__tests__/date-picker-extended.test.d.ts +0 -1
- package/dist/date-picker/__tests__/date-picker.ssr.test.d.ts +0 -1
- package/dist/date-picker/__tests__/date-picker.test.d.ts +0 -1
- package/dist/date-picker/src/date-picker.d.vue.ts +0 -372
- package/dist/date-picker/src/date-table.d.vue.ts +0 -37
- package/dist/date-picker/src/month-table.d.vue.ts +0 -19
- package/dist/date-picker/src/quarter-table.d.vue.ts +0 -19
- package/dist/date-picker/src/year-table.d.vue.ts +0 -19
- package/dist/descriptions/__tests__/descriptions.ssr.test.d.ts +0 -1
- package/dist/descriptions/__tests__/descriptions.test.d.ts +0 -1
- package/dist/descriptions/src/description-item.d.vue.ts +0 -99
- package/dist/descriptions/src/descriptions.d.vue.ts +0 -106
- package/dist/dialog/__tests__/dialog.functional.test.d.ts +0 -1
- package/dist/dialog/__tests__/dialog.ssr.test.d.ts +0 -1
- package/dist/dialog/__tests__/dialog.test.d.ts +0 -1
- package/dist/dialog/src/dialog.d.vue.ts +0 -217
- package/dist/divider/__tests__/divider.ssr.test.d.ts +0 -1
- package/dist/divider/__tests__/divider.test.d.ts +0 -1
- package/dist/divider/src/divider.d.vue.ts +0 -69
- package/dist/drawer/__tests__/drawer.ssr.test.d.ts +0 -1
- package/dist/drawer/__tests__/drawer.test.d.ts +0 -1
- package/dist/drawer/src/drawer.d.vue.ts +0 -141
- package/dist/dropdown/__tests__/dropdown.ssr.test.d.ts +0 -1
- package/dist/dropdown/__tests__/dropdown.test.d.ts +0 -1
- package/dist/dropdown/src/dropdown-item.d.vue.ts +0 -78
- package/dist/dropdown/src/dropdown-menu.d.vue.ts +0 -24
- package/dist/dropdown/src/dropdown.d.vue.ts +0 -158
- package/dist/empty/__tests__/empty.ssr.test.d.ts +0 -1
- package/dist/empty/__tests__/empty.test.d.ts +0 -1
- package/dist/empty/src/empty.d.vue.ts +0 -19
- package/dist/form/__tests__/form-schema.test.d.ts +0 -1
- package/dist/form/__tests__/form.ssr.test.d.ts +0 -1
- package/dist/form/__tests__/form.test.d.ts +0 -1
- package/dist/form/src/form-item.d.vue.ts +0 -144
- package/dist/form/src/form-schema.d.vue.ts +0 -116
- package/dist/form/src/form.d.vue.ts +0 -158
- package/dist/grid/__tests__/grid.ssr.test.d.ts +0 -1
- package/dist/grid/__tests__/grid.test.d.ts +0 -1
- package/dist/grid/src/grid-item.d.vue.ts +0 -17
- package/dist/grid/src/grid.d.vue.ts +0 -20
- package/dist/icon/__tests__/icon.ssr.test.d.ts +0 -1
- package/dist/icon/__tests__/icon.test.d.ts +0 -1
- package/dist/icon/src/icon.d.vue.ts +0 -87
- package/dist/image/__tests__/image-viewer.test.d.ts +0 -1
- package/dist/image/__tests__/image.ssr.test.d.ts +0 -1
- package/dist/image/__tests__/image.test.d.ts +0 -1
- package/dist/image/src/image-viewer.d.vue.ts +0 -60
- package/dist/image/src/image.d.vue.ts +0 -178
- package/dist/infinite-scroll/__tests__/infinite-scroll.ssr.test.d.ts +0 -1
- package/dist/infinite-scroll/__tests__/infinite-scroll.test.d.ts +0 -1
- package/dist/infinite-scroll/src/infinite-scroll.d.vue.ts +0 -95
- package/dist/input/__tests__/input-utils.test.d.ts +0 -1
- package/dist/input/__tests__/input.ssr.test.d.ts +0 -1
- package/dist/input/__tests__/input.test.d.ts +0 -1
- package/dist/input/src/input.d.vue.ts +0 -76
- package/dist/input-number/__tests__/input-number.hydration.test.d.ts +0 -1
- package/dist/input-number/__tests__/input-number.ssr.test.d.ts +0 -1
- package/dist/input-number/__tests__/input-number.test.d.ts +0 -1
- package/dist/input-number/src/input-number.d.vue.ts +0 -50
- package/dist/input-tag/__tests__/input-tag.ssr.test.d.ts +0 -1
- package/dist/input-tag/__tests__/input-tag.test.d.ts +0 -1
- package/dist/input-tag/src/input-tag.d.vue.ts +0 -71
- package/dist/loading/__tests__/loading.ssr.test.d.ts +0 -1
- package/dist/loading/__tests__/loading.test.d.ts +0 -1
- package/dist/marquee/__tests__/marquee.ssr.test.d.ts +0 -1
- package/dist/marquee/__tests__/marquee.test.d.ts +0 -1
- package/dist/marquee/src/marquee.d.vue.ts +0 -109
- package/dist/mention/__tests__/mention.ssr.test.d.ts +0 -1
- package/dist/mention/__tests__/mention.test.d.ts +0 -1
- package/dist/mention/src/mention.d.vue.ts +0 -84
- package/dist/menu/__tests__/menu.ssr.test.d.ts +0 -1
- package/dist/menu/__tests__/menu.test.d.ts +0 -1
- package/dist/menu/src/menu-item.d.vue.ts +0 -52
- package/dist/menu/src/menu-recursive-item.d.vue.ts +0 -6
- package/dist/menu/src/menu.d.vue.ts +0 -209
- package/dist/menu/src/sub-menu.d.vue.ts +0 -87
- package/dist/message/__tests__/message.ssr.test.d.ts +0 -1
- package/dist/message/__tests__/message.test.d.ts +0 -1
- package/dist/message/src/message.d.vue.ts +0 -32
- package/dist/message-box/__tests__/message-box.ssr.test.d.ts +0 -1
- package/dist/message-box/__tests__/message-box.test.d.ts +0 -1
- package/dist/message-box/src/message-box.d.vue.ts +0 -17
- package/dist/notification/__tests__/notification.ssr.test.d.ts +0 -1
- package/dist/notification/__tests__/notification.test.d.ts +0 -1
- package/dist/notification/src/notification.d.vue.ts +0 -30
- package/dist/pagination/__tests__/pagination.ssr.test.d.ts +0 -1
- package/dist/pagination/__tests__/pagination.test.d.ts +0 -1
- package/dist/pagination/src/pagination.d.vue.ts +0 -149
- package/dist/popconfirm/__tests__/popconfirm.ssr.test.d.ts +0 -1
- package/dist/popconfirm/__tests__/popconfirm.test.d.ts +0 -1
- package/dist/popconfirm/src/popconfirm.d.vue.ts +0 -148
- package/dist/popover/__tests__/popover.ssr.test.d.ts +0 -1
- package/dist/popover/__tests__/popover.test.d.ts +0 -1
- package/dist/popover/src/popover.d.vue.ts +0 -140
- package/dist/progress/__tests__/progress.ssr.test.d.ts +0 -1
- package/dist/progress/__tests__/progress.test.d.ts +0 -1
- package/dist/progress/src/progress.d.vue.ts +0 -199
- package/dist/radio/__tests__/radio-button.test.d.ts +0 -1
- package/dist/radio/__tests__/radio.ssr.test.d.ts +0 -1
- package/dist/radio/__tests__/radio.test.d.ts +0 -1
- package/dist/radio/src/radio-button.d.vue.ts +0 -25
- package/dist/radio/src/radio-group.d.vue.ts +0 -23
- package/dist/radio/src/radio.d.vue.ts +0 -26
- package/dist/rate/__tests__/rate.ssr.test.d.ts +0 -1
- package/dist/rate/__tests__/rate.test.d.ts +0 -1
- package/dist/rate/src/rate.d.vue.ts +0 -109
- package/dist/result/__tests__/result.ssr.test.d.ts +0 -1
- package/dist/result/__tests__/result.test.d.ts +0 -1
- package/dist/result/src/result.d.vue.ts +0 -23
- package/dist/row/__tests__/row.ssr.test.d.ts +0 -1
- package/dist/row/__tests__/row.test.d.ts +0 -1
- package/dist/row/__tests__/row_ts.test.d.ts +0 -1
- package/dist/row/src/row.d.vue.ts +0 -60
- package/dist/select/__tests__/select.perf.test.d.ts +0 -1
- package/dist/select/__tests__/select.ssr.test.d.ts +0 -1
- package/dist/select/__tests__/select.test.d.ts +0 -1
- package/dist/select/src/option.d.vue.ts +0 -15
- package/dist/select/src/select.d.vue.ts +0 -68
- package/dist/skeleton/__tests__/skeleton.ssr.test.d.ts +0 -1
- package/dist/skeleton/__tests__/skeleton.test.d.ts +0 -1
- package/dist/skeleton/src/skeleton-item.d.vue.ts +0 -83
- package/dist/skeleton/src/skeleton.d.vue.ts +0 -89
- package/dist/slider/__tests__/repro.test.d.ts +0 -1
- package/dist/slider/__tests__/slider.ssr.test.d.ts +0 -1
- package/dist/slider/__tests__/slider.test.d.ts +0 -1
- package/dist/slider/src/slider-button.d.vue.ts +0 -43
- package/dist/slider/src/slider.d.vue.ts +0 -160
- package/dist/space/__tests__/space.ssr.test.d.ts +0 -1
- package/dist/space/__tests__/space.test.d.ts +0 -1
- package/dist/space/src/space.d.vue.ts +0 -22
- package/dist/spin/__tests__/spin.ssr.test.d.ts +0 -1
- package/dist/spin/__tests__/spin.test.d.ts +0 -1
- package/dist/spin/src/spin.d.vue.ts +0 -67
- package/dist/steps/__tests__/steps.ssr.test.d.ts +0 -1
- package/dist/steps/__tests__/steps.test.d.ts +0 -1
- package/dist/steps/src/step.d.vue.ts +0 -105
- package/dist/steps/src/steps.d.vue.ts +0 -94
- package/dist/switch/__tests__/switch.ssr.test.d.ts +0 -1
- package/dist/switch/__tests__/switch.test.d.ts +0 -1
- package/dist/switch/src/switch.d.vue.ts +0 -133
- package/dist/table/__tests__/table-advance.test.d.ts +0 -1
- package/dist/table/__tests__/table-interaction.test.d.ts +0 -1
- package/dist/table/__tests__/table-utils.test.d.ts +0 -1
- package/dist/table/__tests__/table.perf.test.d.ts +0 -1
- package/dist/table/__tests__/table.ssr.test.d.ts +0 -5
- package/dist/table/__tests__/table.test.d.ts +0 -1
- package/dist/table/__tests__/use-column-drag.test.d.ts +0 -1
- package/dist/table/__tests__/use-table-export.test.d.ts +0 -1
- package/dist/table/__tests__/use-table-import.test.d.ts +0 -1
- package/dist/table/__tests__/use-table-print.test.d.ts +0 -1
- package/dist/table/__tests__/use-virtual-scroll.test.d.ts +0 -1
- package/dist/table/src/table-column.d.vue.ts +0 -81
- package/dist/table/src/table.d.vue.ts +0 -493
- package/dist/tabs/__tests__/tabs.ssr.test.d.ts +0 -1
- package/dist/tabs/__tests__/tabs.test.d.ts +0 -1
- package/dist/tabs/src/tab-pane.d.vue.ts +0 -77
- package/dist/tabs/src/tabs.d.vue.ts +0 -110
- package/dist/tag/__tests__/tag.ssr.test.d.ts +0 -1
- package/dist/tag/__tests__/tag.test.d.ts +0 -1
- package/dist/tag/src/tag.d.vue.ts +0 -42
- package/dist/time-picker/__tests__/time-picker.ssr.test.d.ts +0 -1
- package/dist/time-picker/__tests__/time-picker.test.d.ts +0 -1
- package/dist/time-picker/__tests__/time-spinner.test.d.ts +0 -1
- package/dist/time-picker/src/time-picker.d.vue.ts +0 -67
- package/dist/time-picker/src/time-spinner.d.vue.ts +0 -46
- package/dist/time-select/__tests__/time-select.ssr.test.d.ts +0 -1
- package/dist/time-select/__tests__/time-select.test.d.ts +0 -5
- package/dist/time-select/src/time-select.d.vue.ts +0 -51
- package/dist/tooltip/__tests__/tooltip.ssr.test.d.ts +0 -1
- package/dist/tooltip/__tests__/tooltip.test.d.ts +0 -1
- package/dist/tooltip/src/tooltip.d.vue.ts +0 -167
- package/dist/transfer/__tests__/transfer.ssr.test.d.ts +0 -1
- package/dist/transfer/__tests__/transfer.test.d.ts +0 -5
- package/dist/transfer/src/transfer-panel.d.vue.ts +0 -45
- package/dist/transfer/src/transfer.d.vue.ts +0 -68
- package/dist/tree/__tests__/tree.perf.test.d.ts +0 -1
- package/dist/tree/__tests__/tree.ssr.test.d.ts +0 -1
- package/dist/tree/__tests__/tree.test.d.ts +0 -1
- package/dist/tree/src/tree-node.d.vue.ts +0 -18
- package/dist/tree/src/tree.d.vue.ts +0 -228
- package/dist/tree-select/__tests__/tree-select.ssr.test.d.ts +0 -1
- package/dist/tree-select/__tests__/tree-select.test.d.ts +0 -1
- package/dist/tree-select/src/tree-select.d.vue.ts +0 -141
- package/dist/typography/__tests__/typography.ssr.test.d.ts +0 -1
- package/dist/typography/__tests__/typography.test.d.ts +0 -1
- package/dist/typography/src/link.d.vue.ts +0 -21
- package/dist/typography/src/paragraph.d.vue.ts +0 -22
- package/dist/typography/src/text.d.vue.ts +0 -29
- package/dist/typography/src/title.d.vue.ts +0 -26
- package/dist/upload/__tests__/upload.ssr.test.d.ts +0 -1
- package/dist/upload/__tests__/upload.test.d.ts +0 -1
- package/dist/upload/src/upload.d.vue.ts +0 -133
- package/dist/waterfall/__tests__/waterfall.ssr.test.d.ts +0 -1
- package/dist/waterfall/__tests__/waterfall.test.d.ts +0 -1
- package/dist/waterfall/src/waterfall.d.vue.ts +0 -56
- package/dist/watermark/__tests__/watermark.ssr.test.d.ts +0 -1
- package/dist/watermark/__tests__/watermark.test.d.ts +0 -1
- package/dist/watermark/src/watermark.d.vue.ts +0 -167
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useNamespace, useLocale } from "@yh-ui/hooks";
|
|
3
3
|
import { useComponentTheme } from "@yh-ui/theme";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
computed,
|
|
6
|
+
ref,
|
|
7
|
+
onBeforeUnmount,
|
|
8
|
+
watchEffect,
|
|
9
|
+
shallowRef,
|
|
10
|
+
watch,
|
|
11
|
+
onMounted,
|
|
12
|
+
nextTick
|
|
13
|
+
} from "vue";
|
|
14
|
+
import {
|
|
15
|
+
aiBubbleProps
|
|
16
|
+
} from "./ai-bubble";
|
|
6
17
|
import { YhAvatar } from "../../avatar";
|
|
7
18
|
import { YhButton } from "../../button";
|
|
8
19
|
import { YhIcon } from "../../icon";
|
|
20
|
+
import { YhAiThoughtChain } from "../../ai-thought-chain";
|
|
9
21
|
import MarkdownIt from "markdown-it";
|
|
10
22
|
import hljs from "highlight.js";
|
|
11
23
|
import "highlight.js/styles/atom-one-dark.css";
|
|
@@ -43,6 +55,16 @@ const handleAudioToggle = (url) => {
|
|
|
43
55
|
const handleDownload = (url) => {
|
|
44
56
|
window.open(url, "_blank");
|
|
45
57
|
};
|
|
58
|
+
const escapeHtml = (str) => {
|
|
59
|
+
const htmlEntities = {
|
|
60
|
+
"&": "&",
|
|
61
|
+
"<": "<",
|
|
62
|
+
">": ">",
|
|
63
|
+
'"': """,
|
|
64
|
+
"'": "'"
|
|
65
|
+
};
|
|
66
|
+
return str.replace(/[&<>"']/g, (char) => htmlEntities[char]);
|
|
67
|
+
};
|
|
46
68
|
const getFileIcon = (url = "") => {
|
|
47
69
|
const ext = url.split(".").pop()?.toLowerCase() || "";
|
|
48
70
|
switch (ext) {
|
|
@@ -70,21 +92,670 @@ const getFileIcon = (url = "") => {
|
|
|
70
92
|
return "document";
|
|
71
93
|
}
|
|
72
94
|
};
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
95
|
+
const _mermaidContainer = ref(null);
|
|
96
|
+
const mermaidLoading = ref(false);
|
|
97
|
+
const mermaidError = ref(null);
|
|
98
|
+
let mermaidModule = null;
|
|
99
|
+
const initMermaid = async () => {
|
|
100
|
+
if (mermaidModule) return mermaidModule;
|
|
101
|
+
try {
|
|
102
|
+
mermaidModule = await import("mermaid");
|
|
103
|
+
mermaidModule.default.initialize({
|
|
104
|
+
startOnLoad: false,
|
|
105
|
+
theme: "default",
|
|
106
|
+
securityLevel: "loose",
|
|
107
|
+
flowchart: { curve: "basis", padding: 15 },
|
|
108
|
+
sequence: { actorMargin: 50, boxMargin: 10 }
|
|
109
|
+
});
|
|
110
|
+
return mermaidModule;
|
|
111
|
+
} catch (e) {
|
|
112
|
+
console.warn("Mermaid not available:", e);
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const _renderMermaid = async (code) => {
|
|
117
|
+
if (!mermaidModule) {
|
|
118
|
+
await initMermaid();
|
|
119
|
+
}
|
|
120
|
+
if (!mermaidModule) return `<pre class="mermaid-error">${code}</pre>`;
|
|
121
|
+
mermaidLoading.value = true;
|
|
122
|
+
mermaidError.value = null;
|
|
123
|
+
try {
|
|
124
|
+
const id = `mermaid-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
125
|
+
const { svg } = await mermaidModule.default.render(id, code);
|
|
126
|
+
mermaidLoading.value = false;
|
|
127
|
+
return svg;
|
|
128
|
+
} catch (e) {
|
|
129
|
+
mermaidLoading.value = false;
|
|
130
|
+
mermaidError.value = e instanceof Error ? e.message : "Failed to render mermaid diagram";
|
|
131
|
+
return `<pre class="mermaid-error">${code}</pre>`;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const expandedCodeBlocks = ref(/* @__PURE__ */ new Set());
|
|
135
|
+
const copiedCodeBlocks = ref(/* @__PURE__ */ new Set());
|
|
136
|
+
const editingCodeBlock = ref(null);
|
|
137
|
+
const editCodeContent = ref("");
|
|
138
|
+
const runningCodeBlock = ref(null);
|
|
139
|
+
const codeOutput = ref({});
|
|
140
|
+
let webContainerInstance = null;
|
|
141
|
+
const monaco = shallowRef(null);
|
|
142
|
+
const monacoEditor = shallowRef(null);
|
|
143
|
+
const monacoContainer = ref(null);
|
|
144
|
+
const loadMonaco = async () => {
|
|
145
|
+
if (monaco.value) return monaco.value;
|
|
146
|
+
try {
|
|
147
|
+
const m = await import("monaco-editor");
|
|
148
|
+
monaco.value = m;
|
|
149
|
+
return m;
|
|
150
|
+
} catch (e) {
|
|
151
|
+
console.warn("Monaco editor failed to load:", e);
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
const isWebContainerSupported = () => {
|
|
156
|
+
if (typeof window === "undefined") return false;
|
|
157
|
+
const isSecure = window.isSecureContext;
|
|
158
|
+
const hasSharedArrayBuffer = typeof SharedArrayBuffer !== "undefined";
|
|
159
|
+
const isCrossOriginIsolated = window.crossOriginIsolated;
|
|
160
|
+
if (!isSecure || !hasSharedArrayBuffer || !isCrossOriginIsolated) {
|
|
161
|
+
console.warn(
|
|
162
|
+
"[YhAiBubble] WebContainer requires secure context, SharedArrayBuffer and crossOriginIsolated. Falling back to browser runtime."
|
|
163
|
+
);
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
return true;
|
|
167
|
+
};
|
|
168
|
+
const initWebContainer = async () => {
|
|
169
|
+
if (webContainerInstance) return webContainerInstance;
|
|
170
|
+
if (!isWebContainerSupported()) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
const { WebContainer } = await import("@webcontainer/api");
|
|
175
|
+
webContainerInstance = await WebContainer.boot();
|
|
176
|
+
return webContainerInstance;
|
|
177
|
+
} catch (e) {
|
|
178
|
+
console.warn("WebContainer not available, fallback to browser runtime:", e);
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
const getCodeBlockId = (code, lang) => {
|
|
183
|
+
const key = (code || "").slice(0, 50) + (lang || "");
|
|
184
|
+
let hash = 0;
|
|
185
|
+
for (let i = 0; i < key.length; i++) {
|
|
186
|
+
hash = hash * 31 + key.charCodeAt(i) >>> 0;
|
|
187
|
+
}
|
|
188
|
+
return `cb-${hash.toString(16)}`;
|
|
189
|
+
};
|
|
190
|
+
const toggleCodeBlock = (id) => {
|
|
191
|
+
if (expandedCodeBlocks.value.has(id)) {
|
|
192
|
+
expandedCodeBlocks.value.delete(id);
|
|
193
|
+
} else {
|
|
194
|
+
expandedCodeBlocks.value.add(id);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
const copyCode = async (code, id) => {
|
|
198
|
+
try {
|
|
199
|
+
await navigator.clipboard.writeText(code);
|
|
200
|
+
copiedCodeBlocks.value.add(id);
|
|
201
|
+
setTimeout(() => copiedCodeBlocks.value.delete(id), 2e3);
|
|
202
|
+
} catch (e) {
|
|
203
|
+
console.error("Copy failed:", e);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
const _editCode = (code, id) => {
|
|
207
|
+
editingCodeBlock.value = id;
|
|
208
|
+
editCodeContent.value = code;
|
|
209
|
+
};
|
|
210
|
+
const openCodeEditor = async (code, id, lang) => {
|
|
211
|
+
editingCodeBlock.value = id;
|
|
212
|
+
editCodeContent.value = code;
|
|
213
|
+
await nextTick();
|
|
214
|
+
const container = monacoContainer.value;
|
|
215
|
+
const m = await loadMonaco();
|
|
216
|
+
if (!container || !m) return;
|
|
217
|
+
if (monacoEditor.value) {
|
|
218
|
+
monacoEditor.value.dispose();
|
|
219
|
+
monacoEditor.value = null;
|
|
220
|
+
}
|
|
221
|
+
monacoEditor.value = m.editor.create(container, {
|
|
222
|
+
value: code,
|
|
223
|
+
language: lang || "typescript",
|
|
224
|
+
automaticLayout: true,
|
|
225
|
+
minimap: { enabled: false },
|
|
226
|
+
fontSize: 13,
|
|
227
|
+
theme: "vs-dark"
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
const saveEditCode = async (id) => {
|
|
231
|
+
if (monacoEditor.value) {
|
|
232
|
+
editCodeContent.value = monacoEditor.value.getValue();
|
|
233
|
+
}
|
|
234
|
+
try {
|
|
235
|
+
await navigator.clipboard.writeText(editCodeContent.value);
|
|
236
|
+
copiedCodeBlocks.value.add(id);
|
|
237
|
+
setTimeout(() => copiedCodeBlocks.value.delete(id), 2e3);
|
|
238
|
+
} catch (e) {
|
|
239
|
+
console.error("Copy edited code failed:", e);
|
|
240
|
+
}
|
|
241
|
+
editingCodeBlock.value = null;
|
|
242
|
+
editCodeContent.value = "";
|
|
243
|
+
};
|
|
244
|
+
const cancelEditCode = () => {
|
|
245
|
+
editingCodeBlock.value = null;
|
|
246
|
+
editCodeContent.value = "";
|
|
247
|
+
if (monacoEditor.value) {
|
|
248
|
+
monacoEditor.value.dispose();
|
|
249
|
+
monacoEditor.value = null;
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
const runCodeInBrowser = (code, id) => {
|
|
253
|
+
codeOutput.value[id] = [];
|
|
254
|
+
codeOutput.value[id].push("> Running...\n");
|
|
255
|
+
try {
|
|
256
|
+
const logs = [];
|
|
257
|
+
const _customConsole = {
|
|
258
|
+
log: (...args) => logs.push(args.map(String).join(" ")),
|
|
259
|
+
error: (...args) => logs.push("Error: " + args.map(String).join(" ")),
|
|
260
|
+
warn: (...args) => logs.push("Warn: " + args.map(String).join(" "))
|
|
261
|
+
};
|
|
262
|
+
const _originalConsole = { ...console };
|
|
263
|
+
const streamLog = (type, ...args) => {
|
|
264
|
+
const line = args.map(String).join(" ");
|
|
265
|
+
const prefix = type === "error" ? "Error: " : type === "warn" ? "Warn: " : "";
|
|
266
|
+
codeOutput.value[id].push(prefix + line);
|
|
267
|
+
};
|
|
268
|
+
const streamConsole = {
|
|
269
|
+
log: (...args) => streamLog("log", ...args),
|
|
270
|
+
error: (...args) => streamLog("error", ...args),
|
|
271
|
+
warn: (...args) => streamLog("warn", ...args),
|
|
272
|
+
info: (...args) => streamLog("log", ...args),
|
|
273
|
+
debug: (...args) => streamLog("log", ...args)
|
|
274
|
+
};
|
|
275
|
+
const fn = new Function(
|
|
276
|
+
"console",
|
|
277
|
+
`
|
|
278
|
+
return (function() {
|
|
279
|
+
${code}
|
|
280
|
+
})()
|
|
281
|
+
`
|
|
282
|
+
);
|
|
283
|
+
const result = fn(streamConsole);
|
|
284
|
+
if (result !== void 0) {
|
|
285
|
+
codeOutput.value[id].push(`\u2190 ${String(result)}`);
|
|
286
|
+
}
|
|
287
|
+
if (logs.length === 0) {
|
|
288
|
+
codeOutput.value[id].push("\n\u2713 Executed successfully (no output)");
|
|
289
|
+
} else {
|
|
290
|
+
logs.forEach((log, index) => {
|
|
291
|
+
setTimeout(() => {
|
|
292
|
+
if (codeOutput.value[id]) {
|
|
293
|
+
codeOutput.value[id].push(log);
|
|
294
|
+
}
|
|
295
|
+
}, index * 50);
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
} catch (e) {
|
|
299
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
300
|
+
codeOutput.value[id].push(`
|
|
301
|
+
\u2717 Error: ${message}`);
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
const runPythonInBrowser = async (code, id) => {
|
|
305
|
+
codeOutput.value[id].push("> Initializing Pyodide (Python in browser)...");
|
|
306
|
+
try {
|
|
307
|
+
const win = window;
|
|
308
|
+
if (!win.loadPyodide) {
|
|
309
|
+
await import(
|
|
310
|
+
/* @vite-ignore */
|
|
311
|
+
props.pyodideUrl
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
if (!win.loadPyodide) {
|
|
315
|
+
throw new Error("Pyodide failed to load.");
|
|
316
|
+
}
|
|
317
|
+
const pyodide = await win.loadPyodide({
|
|
318
|
+
indexURL: props.pyodideUrl.substring(0, props.pyodideUrl.lastIndexOf("/"))
|
|
319
|
+
});
|
|
320
|
+
codeOutput.value[id].push("> Running Python code...\n");
|
|
321
|
+
pyodide.setStdout({
|
|
322
|
+
batched: (text) => {
|
|
323
|
+
if (codeOutput.value[id]) {
|
|
324
|
+
codeOutput.value[id].push(text);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
const result = await pyodide.runPythonAsync(code);
|
|
329
|
+
if (result !== void 0 && result !== null) {
|
|
330
|
+
codeOutput.value[id].push(`
|
|
331
|
+
Result: ${result}`);
|
|
332
|
+
}
|
|
333
|
+
codeOutput.value[id].push("\n\u2713 Python execution complete");
|
|
334
|
+
} catch (e) {
|
|
335
|
+
const error = e instanceof Error ? e.message : String(e);
|
|
336
|
+
codeOutput.value[id].push(`
|
|
337
|
+
Error: ${error}`);
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
const runPythonRemote = async (code, id) => {
|
|
341
|
+
codeOutput.value[id].push(`> Running Python via remote API: ${props.pythonApiUrl}...`);
|
|
342
|
+
try {
|
|
343
|
+
const response = await fetch(props.pythonApiUrl, {
|
|
344
|
+
method: "POST",
|
|
345
|
+
headers: { "Content-Type": "application/json" },
|
|
346
|
+
body: JSON.stringify({ code, language: "python" })
|
|
347
|
+
});
|
|
348
|
+
const result = await response.json();
|
|
349
|
+
if (result.output) {
|
|
350
|
+
codeOutput.value[id].push(`
|
|
351
|
+
${result.output}`);
|
|
352
|
+
}
|
|
353
|
+
if (result.error) {
|
|
354
|
+
codeOutput.value[id].push(`
|
|
355
|
+
Error: ${result.error}`);
|
|
356
|
+
}
|
|
357
|
+
codeOutput.value[id].push("\n\u2713 Remote Python execution complete");
|
|
358
|
+
} catch (e) {
|
|
359
|
+
const error = e instanceof Error ? e.message : String(e);
|
|
360
|
+
codeOutput.value[id].push(`
|
|
361
|
+
Remote Error: ${error}`);
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
const runCode = async (code, lang, id) => {
|
|
365
|
+
runningCodeBlock.value = id;
|
|
366
|
+
codeOutput.value[id] = [];
|
|
367
|
+
if (props.onRunCode) {
|
|
368
|
+
try {
|
|
369
|
+
codeOutput.value[id].push("> Running...\n");
|
|
370
|
+
const result = await props.onRunCode(code, lang);
|
|
371
|
+
if (result && Symbol.asyncIterator in result) {
|
|
372
|
+
const asyncResult = result;
|
|
373
|
+
for await (const chunk of asyncResult) {
|
|
374
|
+
codeOutput.value[id].push(chunk.output || chunk.error || "");
|
|
375
|
+
}
|
|
376
|
+
} else {
|
|
377
|
+
const finalResult = result;
|
|
378
|
+
codeOutput.value[id] = finalResult.output ? finalResult.output.split("\n") : finalResult.error ? [`Error: ${finalResult.error}`] : [];
|
|
379
|
+
}
|
|
380
|
+
} catch (e) {
|
|
381
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
382
|
+
codeOutput.value[id].push(`Error: ${message}`);
|
|
383
|
+
}
|
|
384
|
+
} else if (lang === "javascript" || lang === "js") {
|
|
385
|
+
const mdOptions = getMarkdownOptions();
|
|
386
|
+
const runtime = mdOptions.codeBlock?.runtime || "browser";
|
|
387
|
+
if (runtime === "webcontainer") {
|
|
388
|
+
try {
|
|
389
|
+
const wc = await initWebContainer();
|
|
390
|
+
if (!wc) {
|
|
391
|
+
runCodeInBrowser(code, id);
|
|
392
|
+
} else {
|
|
393
|
+
codeOutput.value[id].push("> Running in WebContainer...\n");
|
|
394
|
+
await wc.mount({
|
|
395
|
+
"index.js": {
|
|
396
|
+
file: {
|
|
397
|
+
contents: code
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
const process = await wc.spawn("node", ["index.js"]);
|
|
402
|
+
const reader = process.output.getReader();
|
|
403
|
+
const decoder = new TextDecoder();
|
|
404
|
+
while (true) {
|
|
405
|
+
const { done, value } = await reader.read();
|
|
406
|
+
if (done) break;
|
|
407
|
+
const chunk = decoder.decode(value, { stream: true });
|
|
408
|
+
if (chunk) {
|
|
409
|
+
const lines = chunk.split("\n");
|
|
410
|
+
lines.forEach((line, index) => {
|
|
411
|
+
if (line || index < lines.length - 1) {
|
|
412
|
+
setTimeout(() => {
|
|
413
|
+
if (codeOutput.value[id]) {
|
|
414
|
+
codeOutput.value[id].push(line);
|
|
415
|
+
}
|
|
416
|
+
}, index * 30);
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
codeOutput.value[id].push("\n\u2713 WebContainer execution complete");
|
|
422
|
+
}
|
|
423
|
+
} catch (e) {
|
|
424
|
+
console.warn("WebContainer execution failed, fallback to browser runtime:", e);
|
|
425
|
+
codeOutput.value[id].push("\n\u26A0 WebContainer not supported, falling back to browser...");
|
|
426
|
+
runCodeInBrowser(code, id);
|
|
427
|
+
}
|
|
428
|
+
} else {
|
|
429
|
+
runCodeInBrowser(code, id);
|
|
430
|
+
}
|
|
431
|
+
} else if (lang === "python" || lang === "py") {
|
|
432
|
+
if (props.enablePythonRuntime) {
|
|
433
|
+
if (props.pythonRuntime === "remote" && props.pythonApiUrl) {
|
|
434
|
+
runPythonRemote(code, id);
|
|
435
|
+
} else {
|
|
436
|
+
runPythonInBrowser(code, id);
|
|
437
|
+
}
|
|
438
|
+
} else {
|
|
439
|
+
codeOutput.value[id].push(
|
|
440
|
+
'Python runtime is disabled. Please enable "enable-python-runtime" prop.'
|
|
441
|
+
);
|
|
442
|
+
}
|
|
443
|
+
} else {
|
|
444
|
+
codeOutput.value[id].push(`Language "${lang}" execution not supported in browser`);
|
|
445
|
+
}
|
|
446
|
+
const triggerRender = () => {
|
|
447
|
+
if (props.markdown && mdi.value && props.content) {
|
|
448
|
+
parsedContent.value = mdi.value.render(props.content);
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
triggerRender();
|
|
452
|
+
const renderInterval = setInterval(triggerRender, 100);
|
|
453
|
+
setTimeout(() => {
|
|
454
|
+
clearInterval(renderInterval);
|
|
455
|
+
triggerRender();
|
|
456
|
+
runningCodeBlock.value = null;
|
|
457
|
+
}, 5e3);
|
|
458
|
+
};
|
|
459
|
+
const explainCode = async (code, lang) => {
|
|
460
|
+
if (props.onExplainCode) {
|
|
461
|
+
return await props.onExplainCode(code, lang);
|
|
462
|
+
}
|
|
463
|
+
return "";
|
|
464
|
+
};
|
|
465
|
+
const parsedContent = ref(props.content);
|
|
466
|
+
let renderRafId = null;
|
|
467
|
+
let streamTimer = null;
|
|
468
|
+
let streamPosition = 0;
|
|
469
|
+
let streamBuffer = "";
|
|
470
|
+
const streamingCodeBlocks = ref(/* @__PURE__ */ new Set());
|
|
471
|
+
const injectCodeStreamStyles = () => {
|
|
472
|
+
if (typeof document === "undefined") return;
|
|
473
|
+
const styleId = "yh-ai-code-stream-styles";
|
|
474
|
+
if (document.getElementById(styleId)) return;
|
|
475
|
+
const style = document.createElement("style");
|
|
476
|
+
style.id = styleId;
|
|
477
|
+
style.textContent = `
|
|
478
|
+
.code-block-wrapper.streaming .code-block-body code {
|
|
479
|
+
display: block;
|
|
480
|
+
}
|
|
481
|
+
.code-block-wrapper.streaming .code-block-body code .line {
|
|
482
|
+
display: block;
|
|
483
|
+
opacity: 0;
|
|
484
|
+
animation: code-line-fade-in 0.15s ease forwards;
|
|
485
|
+
}
|
|
486
|
+
.code-block-wrapper.streaming .code-block-body code .line:last-child {
|
|
487
|
+
animation: none;
|
|
488
|
+
}
|
|
489
|
+
@keyframes code-line-fade-in {
|
|
490
|
+
from { opacity: 0; transform: translateX(-8px); }
|
|
491
|
+
to { opacity: 1; transform: translateX(0); }
|
|
492
|
+
}
|
|
493
|
+
/* \u5149\u6807\u95EA\u70C1\u6548\u679C */
|
|
494
|
+
.code-block-wrapper.streaming .code-block-body code .line:last-child::after {
|
|
495
|
+
content: '\u258B';
|
|
496
|
+
animation: cursor-blink 0.8s infinite;
|
|
497
|
+
margin-left: 2px;
|
|
498
|
+
color: var(--yh-color-primary, #409eff);
|
|
499
|
+
}
|
|
500
|
+
@keyframes cursor-blink {
|
|
501
|
+
0%, 50% { opacity: 1; }
|
|
502
|
+
51%, 100% { opacity: 0; }
|
|
503
|
+
}
|
|
504
|
+
`;
|
|
505
|
+
document.head.appendChild(style);
|
|
506
|
+
};
|
|
507
|
+
const _markCodeLinesForStreaming = (codeBlockId) => {
|
|
508
|
+
streamingCodeBlocks.value.add(codeBlockId);
|
|
509
|
+
injectCodeStreamStyles();
|
|
510
|
+
};
|
|
511
|
+
watch(
|
|
512
|
+
() => parsedContent.value,
|
|
513
|
+
(_newContent) => {
|
|
514
|
+
if (props.streaming && props.typing) {
|
|
515
|
+
setTimeout(() => {
|
|
516
|
+
const codeBlocks = document.querySelectorAll(".code-block-wrapper");
|
|
517
|
+
codeBlocks.forEach((block) => {
|
|
518
|
+
const id = block.getAttribute("data-id");
|
|
519
|
+
if (id && !streamingCodeBlocks.value.has(id)) {
|
|
520
|
+
const code = block.querySelector("code");
|
|
521
|
+
if (code) {
|
|
522
|
+
const html = code.innerHTML;
|
|
523
|
+
const lines = html.split("\n");
|
|
524
|
+
code.innerHTML = lines.map(
|
|
525
|
+
(line, i) => `<span class="line" style="animation-delay: ${i * 30}ms">${line}</span>`
|
|
526
|
+
).join("\n");
|
|
527
|
+
block.classList.add("streaming");
|
|
528
|
+
streamingCodeBlocks.value.add(id);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
}, 100);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
);
|
|
536
|
+
const _renderLatex = (text) => {
|
|
537
|
+
text = text.replace(/\$\$([\s\S]+?)\$\$/g, (_, math) => {
|
|
538
|
+
return `<div class="latex-block" data-latex="${encodeURIComponent(math.trim())}">${math.trim()}</div>`;
|
|
539
|
+
});
|
|
540
|
+
text = text.replace(/\$([^\$\n]+?)\$/g, (_, math) => {
|
|
541
|
+
return `<span class="latex-inline" data-latex="${encodeURIComponent(math.trim())}">${math.trim()}</span>`;
|
|
542
|
+
});
|
|
543
|
+
return text;
|
|
544
|
+
};
|
|
545
|
+
const _structuredDataRef = ref(null);
|
|
546
|
+
const _renderStructuredData = computed(() => {
|
|
547
|
+
if (!props.structuredData) return null;
|
|
548
|
+
const { type, data, options } = props.structuredData;
|
|
549
|
+
switch (type) {
|
|
550
|
+
case "json":
|
|
551
|
+
return { type: "json", data, options };
|
|
552
|
+
case "table":
|
|
553
|
+
return { type: "table", data, options };
|
|
554
|
+
case "chart":
|
|
555
|
+
return { type: "chart", data, options };
|
|
556
|
+
case "mindmap":
|
|
557
|
+
return { type: "mindmap", data, options };
|
|
558
|
+
case "thought-chain":
|
|
559
|
+
return { type: "thought-chain", data, options };
|
|
560
|
+
default:
|
|
561
|
+
return null;
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
const jsonHtml = computed(() => {
|
|
565
|
+
if (!props.structuredData || props.structuredData.type !== "json") return "";
|
|
566
|
+
try {
|
|
567
|
+
const rawData = props.structuredData.data;
|
|
568
|
+
const jsonString = typeof rawData === "string" ? rawData : JSON.stringify(rawData, null, 2);
|
|
569
|
+
if (hljs.getLanguage("json")) {
|
|
570
|
+
return hljs.highlight(jsonString, {
|
|
571
|
+
language: "json",
|
|
572
|
+
ignoreIllegals: true
|
|
573
|
+
}).value;
|
|
574
|
+
}
|
|
575
|
+
return jsonString;
|
|
576
|
+
} catch (e) {
|
|
577
|
+
console.warn("Failed to render JSON structured data:", e);
|
|
578
|
+
return "";
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
const hoveredCitation = ref(null);
|
|
582
|
+
const citationTooltipStyle = ref({
|
|
583
|
+
top: "0px",
|
|
584
|
+
left: "0px",
|
|
585
|
+
position: "fixed",
|
|
586
|
+
transform: "",
|
|
587
|
+
zIndex: "9999"
|
|
588
|
+
});
|
|
589
|
+
let citationHoverTimer = null;
|
|
590
|
+
const handleCitationHover = (e) => {
|
|
591
|
+
const target = e.target;
|
|
592
|
+
if (target && target.classList && target.classList.contains("yh-ai-citation")) {
|
|
593
|
+
const id = target.getAttribute("data-id");
|
|
594
|
+
const citation = props.citations?.find(
|
|
595
|
+
(c) => String(c.id) === id
|
|
596
|
+
);
|
|
597
|
+
if (citation) {
|
|
598
|
+
if (citationHoverTimer) clearTimeout(citationHoverTimer);
|
|
599
|
+
hoveredCitation.value = citation;
|
|
600
|
+
const rect = target.getBoundingClientRect();
|
|
601
|
+
citationTooltipStyle.value = {
|
|
602
|
+
top: `${rect.top - 10}px`,
|
|
603
|
+
left: `${rect.left + rect.width / 2}px`,
|
|
604
|
+
transform: "translate(-50%, -100%)",
|
|
605
|
+
position: "fixed",
|
|
606
|
+
zIndex: "9999"
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
};
|
|
611
|
+
const handleCitationLeave = (e) => {
|
|
612
|
+
const target = e.target;
|
|
613
|
+
if (target && target.classList && target.classList.contains("yh-ai-citation")) {
|
|
614
|
+
citationHoverTimer = setTimeout(() => {
|
|
615
|
+
hoveredCitation.value = null;
|
|
616
|
+
}, 200);
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
const handleCitationClick = (citation) => {
|
|
620
|
+
if (props.onCitationClick) {
|
|
621
|
+
props.onCitationClick(citation);
|
|
622
|
+
} else if (citation.url) {
|
|
623
|
+
window.open(citation.url, "_blank");
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
const handleTooltipEnter = () => {
|
|
627
|
+
if (citationHoverTimer) clearTimeout(citationHoverTimer);
|
|
628
|
+
};
|
|
629
|
+
const handleTooltipLeave = () => {
|
|
630
|
+
citationHoverTimer = setTimeout(() => {
|
|
631
|
+
hoveredCitation.value = null;
|
|
632
|
+
}, 200);
|
|
633
|
+
};
|
|
634
|
+
const getMarkdownOptions = () => {
|
|
635
|
+
return {
|
|
636
|
+
mermaid: true,
|
|
637
|
+
latex: true,
|
|
638
|
+
filePreview: true,
|
|
76
639
|
linkify: true,
|
|
77
640
|
typographer: true,
|
|
641
|
+
...props.markdownOptions,
|
|
642
|
+
codeBlock: {
|
|
643
|
+
copyable: true,
|
|
644
|
+
languageTag: true,
|
|
645
|
+
lineNumbers: false,
|
|
646
|
+
editable: false,
|
|
647
|
+
runnable: true,
|
|
648
|
+
explainable: true,
|
|
649
|
+
collapsible: true,
|
|
650
|
+
collapseLinesThreshold: 10,
|
|
651
|
+
...props.markdownOptions?.codeBlock || {}
|
|
652
|
+
}
|
|
653
|
+
};
|
|
654
|
+
};
|
|
655
|
+
const getMarkdownInstance = () => {
|
|
656
|
+
const mdOptions = getMarkdownOptions();
|
|
657
|
+
const md = new MarkdownIt({
|
|
658
|
+
html: mdOptions.html ?? false,
|
|
659
|
+
linkify: mdOptions.linkify ?? true,
|
|
660
|
+
typographer: mdOptions.typographer ?? true,
|
|
78
661
|
highlight: function(str, lang) {
|
|
79
|
-
|
|
662
|
+
const codeBlockId = getCodeBlockId(str, lang);
|
|
663
|
+
const codeBlockOptions = mdOptions.codeBlock;
|
|
664
|
+
let result = "";
|
|
665
|
+
const hlLang = lang === "vue" ? "xml" : lang;
|
|
666
|
+
if (hlLang && hljs.getLanguage(hlLang)) {
|
|
80
667
|
try {
|
|
81
|
-
|
|
668
|
+
result = hljs.highlight(str, { language: hlLang, ignoreIllegals: true }).value;
|
|
82
669
|
} catch {
|
|
83
670
|
}
|
|
671
|
+
} else {
|
|
672
|
+
result = md.utils.escapeHtml(str);
|
|
673
|
+
}
|
|
674
|
+
if (codeBlockOptions?.lineNumbers) {
|
|
675
|
+
const lines = result.split("\n");
|
|
676
|
+
const numberedLines = lines.map((line, i) => `<span class="line-number">${i + 1}</span>${line}`).join("\n");
|
|
677
|
+
result = numberedLines;
|
|
678
|
+
}
|
|
679
|
+
const lineCount = str.split("\n").length;
|
|
680
|
+
const shouldCollapse = codeBlockOptions?.collapsible && lineCount > (codeBlockOptions?.collapseLinesThreshold ?? 10);
|
|
681
|
+
const isExpanded = expandedCodeBlocks.value.has(codeBlockId);
|
|
682
|
+
let wrapperStart = `<div class="code-block-wrapper" data-lang="${lang}" data-id="${codeBlockId}">`;
|
|
683
|
+
wrapperStart += `<div class="code-block-header">`;
|
|
684
|
+
if (codeBlockOptions?.languageTag) {
|
|
685
|
+
wrapperStart += `<span class="code-lang">${lang || "text"}</span>`;
|
|
686
|
+
}
|
|
687
|
+
wrapperStart += `<div class="code-actions">`;
|
|
688
|
+
if (codeBlockOptions?.copyable) {
|
|
689
|
+
const copyText = copiedCodeBlocks.value.has(codeBlockId) ? "Copied!" : "Copy";
|
|
690
|
+
wrapperStart += `<button class="code-action-btn copy-btn" data-code="${encodeURIComponent(str)}" data-id="${codeBlockId}">${copyText}</button>`;
|
|
691
|
+
}
|
|
692
|
+
if (codeBlockOptions?.editable) {
|
|
693
|
+
wrapperStart += `<button class="code-action-btn edit-btn" data-id="${codeBlockId}">Edit</button>`;
|
|
694
|
+
}
|
|
695
|
+
const isRunnableLang = ["javascript", "js"].includes(lang) || props.enablePythonRuntime && ["python", "py"].includes(lang);
|
|
696
|
+
if (codeBlockOptions?.runnable && isRunnableLang) {
|
|
697
|
+
wrapperStart += `<button class="code-action-btn run-btn" data-code="${encodeURIComponent(str)}" data-lang="${lang}" data-id="${codeBlockId}">Run</button>`;
|
|
698
|
+
}
|
|
699
|
+
if (codeBlockOptions?.explainable) {
|
|
700
|
+
wrapperStart += `<button class="code-action-btn explain-btn" data-code="${encodeURIComponent(str)}" data-lang="${lang}" data-id="${codeBlockId}">Explain</button>`;
|
|
701
|
+
}
|
|
702
|
+
if (shouldCollapse) {
|
|
703
|
+
wrapperStart += `<button class="code-action-btn collapse-btn" data-id="${codeBlockId}">${isExpanded ? "Collapse" : "Expand"}</button>`;
|
|
704
|
+
}
|
|
705
|
+
wrapperStart += `</div></div>`;
|
|
706
|
+
const _bodyClass = shouldCollapse ? isExpanded ? "code-block-body expanded" : "code-block-body collapsed" : "code-block-body";
|
|
707
|
+
let wrapperEnd = `</div>`;
|
|
708
|
+
if (codeOutput.value[codeBlockId]) {
|
|
709
|
+
const outputLines = codeOutput.value[codeBlockId];
|
|
710
|
+
const outputHtml = Array.isArray(outputLines) ? outputLines.map((line) => {
|
|
711
|
+
if (line.startsWith("> "))
|
|
712
|
+
return `<span class="output-prefix">${escapeHtml(line)}</span>`;
|
|
713
|
+
if (line.startsWith("\u2190 "))
|
|
714
|
+
return `<span class="output-return">${escapeHtml(line)}</span>`;
|
|
715
|
+
if (line.startsWith("\u2713"))
|
|
716
|
+
return `<span class="output-success">${escapeHtml(line)}</span>`;
|
|
717
|
+
if (line.startsWith("\u2717"))
|
|
718
|
+
return `<span class="output-error">${escapeHtml(line)}</span>`;
|
|
719
|
+
if (line.startsWith("\u26A0"))
|
|
720
|
+
return `<span class="output-warning">${escapeHtml(line)}</span>`;
|
|
721
|
+
if (line.startsWith("Error:"))
|
|
722
|
+
return `<span class="output-error">${escapeHtml(line)}</span>`;
|
|
723
|
+
return escapeHtml(line);
|
|
724
|
+
}).join("\n") : escapeHtml(outputLines);
|
|
725
|
+
wrapperEnd += `<div class="code-output"><pre>${outputHtml}</pre></div>`;
|
|
84
726
|
}
|
|
85
|
-
|
|
727
|
+
wrapperEnd += `</div>`;
|
|
728
|
+
return wrapperStart + `<pre class="hljs ${lang || ""}"><code>${result}</code></pre>` + wrapperEnd;
|
|
86
729
|
}
|
|
87
730
|
});
|
|
731
|
+
md.block.ruler.before("code", "mermaid", (state, silent) => {
|
|
732
|
+
const start = state.bMarks[state.line];
|
|
733
|
+
const max = state.eMarks[state.line];
|
|
734
|
+
const line = state.src.slice(start, max);
|
|
735
|
+
if (!line.trim().startsWith("```mermaid")) return false;
|
|
736
|
+
if (!silent) {
|
|
737
|
+
state.line++;
|
|
738
|
+
const lines = [];
|
|
739
|
+
while (state.line < state.lineMax) {
|
|
740
|
+
const lineContent = state.src.slice(state.bMarks[state.line], state.eMarks[state.line]);
|
|
741
|
+
if (lineContent.trim().startsWith("```")) break;
|
|
742
|
+
lines.push(lineContent);
|
|
743
|
+
state.line++;
|
|
744
|
+
}
|
|
745
|
+
let token = state.push("mermaid_open", "div", 1);
|
|
746
|
+
token.attrSet("class", "mermaid-block");
|
|
747
|
+
token = state.push("mermaid_code", "", 0);
|
|
748
|
+
token.content = lines.join("\n");
|
|
749
|
+
token = state.push("mermaid_close", "div", -1);
|
|
750
|
+
}
|
|
751
|
+
return true;
|
|
752
|
+
});
|
|
753
|
+
md.renderer.rules.mermaid_open = () => '<div class="mermaid-block">';
|
|
754
|
+
md.renderer.rules.mermaid_code = (tokens, idx) => {
|
|
755
|
+
const code = tokens[idx].content;
|
|
756
|
+
return `<pre class="mermaid">${md.utils.escapeHtml(code)}</pre>`;
|
|
757
|
+
};
|
|
758
|
+
md.renderer.rules.mermaid_close = () => "</div>";
|
|
88
759
|
md.inline.ruler.after("text", "citation", (state, silent) => {
|
|
89
760
|
const start = state.pos;
|
|
90
761
|
if (state.src.charCodeAt(start) !== 91) return false;
|
|
@@ -117,13 +788,65 @@ onBeforeUnmount(() => {
|
|
|
117
788
|
audioInstance.pause();
|
|
118
789
|
audioInstance = null;
|
|
119
790
|
}
|
|
791
|
+
if (streamTimer) {
|
|
792
|
+
clearInterval(streamTimer);
|
|
793
|
+
streamTimer = null;
|
|
794
|
+
}
|
|
795
|
+
if (monacoEditor.value) {
|
|
796
|
+
monacoEditor.value.dispose();
|
|
797
|
+
monacoEditor.value = null;
|
|
798
|
+
}
|
|
120
799
|
mdi.value = null;
|
|
121
800
|
});
|
|
122
|
-
const
|
|
123
|
-
|
|
801
|
+
const streamRender = (fullContent, mode, speed, interval) => {
|
|
802
|
+
if (!fullContent) {
|
|
803
|
+
parsedContent.value = "";
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
if (streamTimer) {
|
|
807
|
+
clearInterval(streamTimer);
|
|
808
|
+
streamTimer = null;
|
|
809
|
+
}
|
|
810
|
+
streamPosition = 0;
|
|
811
|
+
streamBuffer = "";
|
|
812
|
+
const getChunks = () => {
|
|
813
|
+
if (mode === "paragraph") {
|
|
814
|
+
return fullContent.split(/(?:\r?\n){2,}/);
|
|
815
|
+
} else if (mode === "sentence") {
|
|
816
|
+
return fullContent.split(/(?<=[.!?。!?])\s+/);
|
|
817
|
+
} else {
|
|
818
|
+
const chunks2 = [];
|
|
819
|
+
for (let i = 0; i < fullContent.length; i += speed) {
|
|
820
|
+
chunks2.push(fullContent.slice(i, i + speed));
|
|
821
|
+
}
|
|
822
|
+
return chunks2;
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
const chunks = getChunks();
|
|
826
|
+
streamTimer = setInterval(() => {
|
|
827
|
+
if (streamPosition < chunks.length) {
|
|
828
|
+
streamBuffer += chunks[streamPosition];
|
|
829
|
+
streamPosition++;
|
|
830
|
+
parsedContent.value = props.markdown && mdi.value ? mdi.value.render(streamBuffer) : streamBuffer;
|
|
831
|
+
} else {
|
|
832
|
+
if (streamTimer) {
|
|
833
|
+
clearInterval(streamTimer);
|
|
834
|
+
streamTimer = null;
|
|
835
|
+
}
|
|
836
|
+
parsedContent.value = props.markdown && mdi.value ? mdi.value.render(fullContent) : fullContent;
|
|
837
|
+
if (props.onStreamComplete) {
|
|
838
|
+
props.onStreamComplete();
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}, interval);
|
|
842
|
+
};
|
|
124
843
|
watch(
|
|
125
844
|
() => props.content,
|
|
126
845
|
(newContent) => {
|
|
846
|
+
if (streamTimer) {
|
|
847
|
+
clearInterval(streamTimer);
|
|
848
|
+
streamTimer = null;
|
|
849
|
+
}
|
|
127
850
|
if (!props.markdown || !props.typing) {
|
|
128
851
|
if (renderRafId && typeof cancelAnimationFrame !== "undefined") {
|
|
129
852
|
cancelAnimationFrame(renderRafId);
|
|
@@ -132,6 +855,10 @@ watch(
|
|
|
132
855
|
parsedContent.value = props.markdown && mdi.value ? mdi.value.render(newContent || "") : newContent;
|
|
133
856
|
return;
|
|
134
857
|
}
|
|
858
|
+
if (props.streaming && props.typing) {
|
|
859
|
+
streamRender(newContent, props.streamMode, props.streamSpeed, props.streamInterval);
|
|
860
|
+
return;
|
|
861
|
+
}
|
|
135
862
|
if (typeof requestAnimationFrame === "undefined") {
|
|
136
863
|
parsedContent.value = mdi.value ? mdi.value.render(newContent || "") : newContent;
|
|
137
864
|
return;
|
|
@@ -157,50 +884,33 @@ const classes = computed(() => [
|
|
|
157
884
|
ns.is("loading", props.loading),
|
|
158
885
|
ns.is("typing", props.typing)
|
|
159
886
|
]);
|
|
160
|
-
const
|
|
161
|
-
const citationTooltipStyle = ref({
|
|
162
|
-
top: "0px",
|
|
163
|
-
left: "0px",
|
|
164
|
-
position: "fixed",
|
|
165
|
-
transform: "",
|
|
166
|
-
zIndex: "9999"
|
|
167
|
-
});
|
|
168
|
-
let citationHoverTimer = null;
|
|
169
|
-
const handleCitationHover = (e) => {
|
|
887
|
+
const handleCodeBlockAction = async (e) => {
|
|
170
888
|
const target = e.target;
|
|
171
|
-
if (target
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
889
|
+
if (!target.classList.contains("code-action-btn")) return;
|
|
890
|
+
const code = decodeURIComponent(target.getAttribute("data-code") || "");
|
|
891
|
+
const lang = target.getAttribute("data-lang") || "";
|
|
892
|
+
const id = target.getAttribute("data-id") || "";
|
|
893
|
+
if (target.classList.contains("copy-btn")) {
|
|
894
|
+
await copyCode(code, id);
|
|
895
|
+
} else if (target.classList.contains("edit-btn")) {
|
|
896
|
+
await openCodeEditor(code, id, lang);
|
|
897
|
+
} else if (target.classList.contains("run-btn")) {
|
|
898
|
+
await runCode(code, lang, id);
|
|
899
|
+
} else if (target.classList.contains("explain-btn")) {
|
|
900
|
+
const explanation = await explainCode(code, lang);
|
|
901
|
+
if (explanation) {
|
|
902
|
+
codeOutput.value[id] = explanation.split("\n");
|
|
185
903
|
}
|
|
904
|
+
} else if (target.classList.contains("collapse-btn")) {
|
|
905
|
+
toggleCodeBlock(id);
|
|
186
906
|
}
|
|
187
907
|
};
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
const handleTooltipEnter = () => {
|
|
197
|
-
if (citationHoverTimer) clearTimeout(citationHoverTimer);
|
|
198
|
-
};
|
|
199
|
-
const handleTooltipLeave = () => {
|
|
200
|
-
citationHoverTimer = setTimeout(() => {
|
|
201
|
-
hoveredCitation.value = null;
|
|
202
|
-
}, 200);
|
|
203
|
-
};
|
|
908
|
+
onMounted(() => {
|
|
909
|
+
document.addEventListener("click", handleCodeBlockAction);
|
|
910
|
+
});
|
|
911
|
+
onBeforeUnmount(() => {
|
|
912
|
+
document.removeEventListener("click", handleCodeBlockAction);
|
|
913
|
+
});
|
|
204
914
|
</script>
|
|
205
915
|
|
|
206
916
|
<template>
|
|
@@ -208,7 +918,7 @@ const handleTooltipLeave = () => {
|
|
|
208
918
|
<!-- Avatar -->
|
|
209
919
|
<div :class="ns.e('avatar')" v-if="role !== 'system'">
|
|
210
920
|
<slot name="avatar">
|
|
211
|
-
<YhAvatar v-if="avatar" :src="avatar" />
|
|
921
|
+
<YhAvatar v-if="avatar" :src="avatar" crossorigin="anonymous" />
|
|
212
922
|
<YhAvatar v-else>
|
|
213
923
|
<YhIcon :name="role === 'user' ? 'user' : 'robot'" />
|
|
214
924
|
</YhAvatar>
|
|
@@ -225,7 +935,7 @@ const handleTooltipLeave = () => {
|
|
|
225
935
|
</div>
|
|
226
936
|
|
|
227
937
|
<!-- Body -->
|
|
228
|
-
<div :class="ns.e('body')">
|
|
938
|
+
<div :class="[ns.e('body'), ns.is('typing', loading)]">
|
|
229
939
|
<template v-if="loading && !content">
|
|
230
940
|
<span :class="ns.e('typing-indicator')"> <span></span><span></span><span></span> </span>
|
|
231
941
|
</template>
|
|
@@ -240,7 +950,7 @@ const handleTooltipLeave = () => {
|
|
|
240
950
|
:key="idx"
|
|
241
951
|
:class="ns.e('image-item')"
|
|
242
952
|
>
|
|
243
|
-
<img :src="img.url" :alt="img.title" />
|
|
953
|
+
<img :src="img.url" :alt="img.title" loading="lazy" crossorigin="anonymous" />
|
|
244
954
|
</div>
|
|
245
955
|
</div>
|
|
246
956
|
|
|
@@ -257,6 +967,58 @@ const handleTooltipLeave = () => {
|
|
|
257
967
|
<div v-else :class="ns.e('text')">{{ content }}</div>
|
|
258
968
|
</slot>
|
|
259
969
|
|
|
970
|
+
<!-- Structured Data Display (Below main text) -->
|
|
971
|
+
<div v-if="structuredData" :class="ns.e('structured-data')">
|
|
972
|
+
<!-- JSON pretty view -->
|
|
973
|
+
<!-- eslint-disable vue/no-v-html -->
|
|
974
|
+
<div v-if="structuredData.type === 'json'" :class="[ns.e('json-viewer')]">
|
|
975
|
+
<pre class="hljs json"><code v-html="jsonHtml" /></pre>
|
|
976
|
+
</div>
|
|
977
|
+
<!-- eslint-enable vue/no-v-html -->
|
|
978
|
+
|
|
979
|
+
<!-- Table view -->
|
|
980
|
+
<div v-else-if="structuredData.type === 'table'" :class="[ns.e('table-viewer')]">
|
|
981
|
+
<table>
|
|
982
|
+
<thead>
|
|
983
|
+
<tr
|
|
984
|
+
v-if="structuredData.data && structuredData.data.headers"
|
|
985
|
+
>
|
|
986
|
+
<th
|
|
987
|
+
v-for="h in structuredData.data.headers"
|
|
988
|
+
:key="h"
|
|
989
|
+
>
|
|
990
|
+
{{ h }}
|
|
991
|
+
</th>
|
|
992
|
+
</tr>
|
|
993
|
+
</thead>
|
|
994
|
+
<tbody v-if="structuredData.data && typeof structuredData.data === 'object'">
|
|
995
|
+
<tr
|
|
996
|
+
v-for="(row, idx) in structuredData.data.rows"
|
|
997
|
+
:key="idx"
|
|
998
|
+
>
|
|
999
|
+
<td v-for="(cell, cIdx) in row" :key="cIdx">{{ cell }}</td>
|
|
1000
|
+
</tr>
|
|
1001
|
+
</tbody>
|
|
1002
|
+
</table>
|
|
1003
|
+
</div>
|
|
1004
|
+
|
|
1005
|
+
<!-- Thought chain: delegate to AiThoughtChain for consistent style -->
|
|
1006
|
+
<YhAiThoughtChain
|
|
1007
|
+
v-else-if="structuredData.type === 'thought-chain' && structuredData.data"
|
|
1008
|
+
:items="structuredData.data"
|
|
1009
|
+
:title="content || void 0"
|
|
1010
|
+
status="none"
|
|
1011
|
+
dot-size="small"
|
|
1012
|
+
:auto-collapse="false"
|
|
1013
|
+
line-gradient
|
|
1014
|
+
/>
|
|
1015
|
+
|
|
1016
|
+
<!-- Fallback: raw JSON -->
|
|
1017
|
+
<div v-else :class="[ns.e('chart-viewer')]">
|
|
1018
|
+
<pre>{{ JSON.stringify(structuredData.data, null, 2) }}</pre>
|
|
1019
|
+
</div>
|
|
1020
|
+
</div>
|
|
1021
|
+
|
|
260
1022
|
<!-- Multimodal: Audio/Files (Below text) -->
|
|
261
1023
|
<div
|
|
262
1024
|
v-if="multimodal && multimodal.some(m => m.type !== 'image')"
|
|
@@ -312,7 +1074,7 @@ const handleTooltipLeave = () => {
|
|
|
312
1074
|
<div v-if="citations && citations.length > 0" :class="ns.e('citations')">
|
|
313
1075
|
<div :class="ns.e('citations-title')">
|
|
314
1076
|
<YhIcon name="document" />
|
|
315
|
-
<span>{{ t("ai.bubble.citations")
|
|
1077
|
+
<span>{{ t("ai.bubble.citations") }}</span>
|
|
316
1078
|
<span :class="ns.e('citations-count')">{{ citations.length }}</span>
|
|
317
1079
|
</div>
|
|
318
1080
|
<div :class="ns.e('citations-list')">
|
|
@@ -323,6 +1085,7 @@ const handleTooltipLeave = () => {
|
|
|
323
1085
|
target="_blank"
|
|
324
1086
|
:class="ns.e('citation-item')"
|
|
325
1087
|
:title="cite.title"
|
|
1088
|
+
@click.prevent="handleCitationClick(cite)"
|
|
326
1089
|
>
|
|
327
1090
|
<span :class="ns.e('citation-index')">{{ cite.id || index + 1 }}</span>
|
|
328
1091
|
<span :class="ns.e('citation-text')">{{ cite.title }}</span>
|
|
@@ -356,6 +1119,34 @@ const handleTooltipLeave = () => {
|
|
|
356
1119
|
</div>
|
|
357
1120
|
<div :class="ns.e('citation-tooltip-body')">
|
|
358
1121
|
<h4>{{ hoveredCitation.title }}</h4>
|
|
1122
|
+
<p v-if="hoveredCitation.abstract">{{ hoveredCitation.abstract }}</p>
|
|
1123
|
+
<span v-if="hoveredCitation.publishTime" class="publish-time">{{
|
|
1124
|
+
hoveredCitation.publishTime
|
|
1125
|
+
}}</span>
|
|
1126
|
+
</div>
|
|
1127
|
+
</div>
|
|
1128
|
+
</div>
|
|
1129
|
+
</Transition>
|
|
1130
|
+
</Teleport>
|
|
1131
|
+
|
|
1132
|
+
<!-- Code Edit Modal -->
|
|
1133
|
+
<Teleport to="body">
|
|
1134
|
+
<Transition name="yh-fade-in">
|
|
1135
|
+
<div v-if="editingCodeBlock" class="code-edit-modal-overlay" @click.self="cancelEditCode">
|
|
1136
|
+
<div class="code-edit-modal">
|
|
1137
|
+
<div class="code-edit-header">
|
|
1138
|
+
<h3>Edit Code</h3>
|
|
1139
|
+
<YhButton text @click="cancelEditCode">
|
|
1140
|
+
<YhIcon name="close" />
|
|
1141
|
+
</YhButton>
|
|
1142
|
+
</div>
|
|
1143
|
+
<div class="code-edit-body">
|
|
1144
|
+
<div ref="monacoContainer" class="code-edit-monaco"></div>
|
|
1145
|
+
<textarea v-if="!monaco" v-model="editCodeContent" rows="20"></textarea>
|
|
1146
|
+
</div>
|
|
1147
|
+
<div class="code-edit-footer">
|
|
1148
|
+
<YhButton @click="cancelEditCode">Cancel</YhButton>
|
|
1149
|
+
<YhButton type="primary" @click="saveEditCode(editingCodeBlock)">Save</YhButton>
|
|
359
1150
|
</div>
|
|
360
1151
|
</div>
|
|
361
1152
|
</div>
|
|
@@ -875,6 +1666,41 @@ html.dark {
|
|
|
875
1666
|
padding: 12px 16px;
|
|
876
1667
|
position: relative;
|
|
877
1668
|
border: 1px solid transparent;
|
|
1669
|
+
}
|
|
1670
|
+
.yh-ai-bubble__body.is-typing .yh-ai-bubble__text {
|
|
1671
|
+
position: relative;
|
|
1672
|
+
display: inline-block;
|
|
1673
|
+
}
|
|
1674
|
+
.yh-ai-bubble__body.is-typing .yh-ai-bubble__text::after {
|
|
1675
|
+
content: "▋";
|
|
1676
|
+
margin-left: 2px;
|
|
1677
|
+
color: var(--yh-color-primary);
|
|
1678
|
+
animation: yh-cursor-blink 1s infinite;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
.yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > p:last-child {
|
|
1682
|
+
position: relative;
|
|
1683
|
+
display: inline-block;
|
|
1684
|
+
}
|
|
1685
|
+
.yh-ai-bubble__body.is-typing .yh-ai-bubble__markdown > p:last-child::after {
|
|
1686
|
+
content: "▋";
|
|
1687
|
+
margin-left: 2px;
|
|
1688
|
+
color: var(--yh-color-primary);
|
|
1689
|
+
animation: yh-cursor-blink 1s infinite;
|
|
1690
|
+
}
|
|
1691
|
+
.yh-ai-bubble__body.is-typing::before {
|
|
1692
|
+
content: "";
|
|
1693
|
+
position: absolute;
|
|
1694
|
+
inset: 0;
|
|
1695
|
+
background: linear-gradient(90deg, transparent, rgba(var(--yh-color-primary-rgb), 0.05), transparent);
|
|
1696
|
+
background-size: 200% 100%;
|
|
1697
|
+
animation: yh-ripple-light 2s infinite linear;
|
|
1698
|
+
pointer-events: none;
|
|
1699
|
+
z-index: 5;
|
|
1700
|
+
border-radius: inherit;
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
.yh-ai-bubble__body {
|
|
878
1704
|
/* Theme-specific adjustments for quality */
|
|
879
1705
|
}
|
|
880
1706
|
:html.dark .yh-ai-bubble__body {
|
|
@@ -940,6 +1766,9 @@ html.dark {
|
|
|
940
1766
|
.yh-ai-bubble__markdown p:last-child {
|
|
941
1767
|
margin-bottom: 0;
|
|
942
1768
|
}
|
|
1769
|
+
.yh-ai-bubble__markdown p:last-child {
|
|
1770
|
+
margin-bottom: 0;
|
|
1771
|
+
}
|
|
943
1772
|
.yh-ai-bubble__markdown {
|
|
944
1773
|
/* 学术脚注气泡角标样式 */
|
|
945
1774
|
}
|
|
@@ -978,6 +1807,55 @@ html.dark {
|
|
|
978
1807
|
font-size: 0.9em;
|
|
979
1808
|
}
|
|
980
1809
|
|
|
1810
|
+
.yh-ai-bubble {
|
|
1811
|
+
/* Code Output - 流式输出样式 */
|
|
1812
|
+
}
|
|
1813
|
+
.yh-ai-bubble .code-output {
|
|
1814
|
+
background: #1e1e1e;
|
|
1815
|
+
border-top: 1px solid #3e3e3e;
|
|
1816
|
+
padding: 12px;
|
|
1817
|
+
border-radius: 0 0 8px 8px;
|
|
1818
|
+
margin-top: -8px;
|
|
1819
|
+
font-family: "SF Mono", "Fira Code", Consolas, monospace;
|
|
1820
|
+
font-size: 13px;
|
|
1821
|
+
line-height: 1.6;
|
|
1822
|
+
color: #d4d4d4;
|
|
1823
|
+
max-height: 300px;
|
|
1824
|
+
overflow-y: auto;
|
|
1825
|
+
}
|
|
1826
|
+
.yh-ai-bubble .code-output pre {
|
|
1827
|
+
margin: 0;
|
|
1828
|
+
padding: 0;
|
|
1829
|
+
background: transparent;
|
|
1830
|
+
color: inherit;
|
|
1831
|
+
white-space: pre-wrap;
|
|
1832
|
+
word-break: break-all;
|
|
1833
|
+
}
|
|
1834
|
+
.yh-ai-bubble .code-output .output-prefix {
|
|
1835
|
+
color: #569cd6;
|
|
1836
|
+
display: block;
|
|
1837
|
+
margin-bottom: 4px;
|
|
1838
|
+
}
|
|
1839
|
+
.yh-ai-bubble .code-output .output-return {
|
|
1840
|
+
color: #c586c0;
|
|
1841
|
+
display: block;
|
|
1842
|
+
margin-top: 8px;
|
|
1843
|
+
font-style: italic;
|
|
1844
|
+
}
|
|
1845
|
+
.yh-ai-bubble .code-output .output-success {
|
|
1846
|
+
color: #4ec9b0;
|
|
1847
|
+
display: block;
|
|
1848
|
+
margin-top: 8px;
|
|
1849
|
+
}
|
|
1850
|
+
.yh-ai-bubble .code-output .output-error {
|
|
1851
|
+
color: #f14c4c;
|
|
1852
|
+
display: block;
|
|
1853
|
+
margin-top: 8px;
|
|
1854
|
+
}
|
|
1855
|
+
.yh-ai-bubble .code-output .output-warning {
|
|
1856
|
+
color: #cca700;
|
|
1857
|
+
display: block;
|
|
1858
|
+
}
|
|
981
1859
|
.yh-ai-bubble {
|
|
982
1860
|
/* Multimodal: Image Grid */
|
|
983
1861
|
}
|
|
@@ -1210,6 +2088,7 @@ html.dark {
|
|
|
1210
2088
|
align-items: center;
|
|
1211
2089
|
gap: 8px;
|
|
1212
2090
|
margin-top: 4px;
|
|
2091
|
+
font-size: 12px;
|
|
1213
2092
|
}
|
|
1214
2093
|
|
|
1215
2094
|
@keyframes yh-typing-bounce {
|
|
@@ -1240,6 +2119,22 @@ html.dark {
|
|
|
1240
2119
|
transform: translateY(0) scale(1);
|
|
1241
2120
|
}
|
|
1242
2121
|
}
|
|
2122
|
+
@keyframes yh-cursor-blink {
|
|
2123
|
+
0%, 100% {
|
|
2124
|
+
opacity: 1;
|
|
2125
|
+
}
|
|
2126
|
+
50% {
|
|
2127
|
+
opacity: 0;
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
@keyframes yh-ripple-light {
|
|
2131
|
+
0% {
|
|
2132
|
+
background-position: 200% 0;
|
|
2133
|
+
}
|
|
2134
|
+
100% {
|
|
2135
|
+
background-position: -200% 0;
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
1243
2138
|
/* 引用专属独立悬浮卡片 (Teleported 到 Body) */
|
|
1244
2139
|
.yh-ai-bubble__citation-tooltip-wrapper {
|
|
1245
2140
|
position: fixed;
|
|
@@ -1297,4 +2192,283 @@ html.dark {
|
|
|
1297
2192
|
opacity: 0;
|
|
1298
2193
|
transform: translate(-50%, -85%) scale(0.95) !important;
|
|
1299
2194
|
}
|
|
2195
|
+
|
|
2196
|
+
.code-block-wrapper {
|
|
2197
|
+
margin: 12px 0;
|
|
2198
|
+
border-radius: 8px;
|
|
2199
|
+
overflow: hidden;
|
|
2200
|
+
background: #282c34;
|
|
2201
|
+
}
|
|
2202
|
+
.code-block-wrapper .code-block-header {
|
|
2203
|
+
display: flex;
|
|
2204
|
+
justify-content: space-between;
|
|
2205
|
+
align-items: center;
|
|
2206
|
+
padding: 8px 12px;
|
|
2207
|
+
background: #21252b;
|
|
2208
|
+
}
|
|
2209
|
+
.code-block-wrapper .code-block-header .code-lang {
|
|
2210
|
+
font-size: 12px;
|
|
2211
|
+
color: #abb2bf;
|
|
2212
|
+
text-transform: uppercase;
|
|
2213
|
+
}
|
|
2214
|
+
.code-block-wrapper .code-block-header .code-actions {
|
|
2215
|
+
display: flex;
|
|
2216
|
+
gap: 8px;
|
|
2217
|
+
}
|
|
2218
|
+
.code-block-wrapper .code-block-header .code-actions .code-action-btn {
|
|
2219
|
+
padding: 4px 8px;
|
|
2220
|
+
font-size: 11px;
|
|
2221
|
+
color: #abb2bf;
|
|
2222
|
+
background: transparent;
|
|
2223
|
+
border: 1px solid #3e4451;
|
|
2224
|
+
border-radius: 4px;
|
|
2225
|
+
cursor: pointer;
|
|
2226
|
+
transition: all 0.2s;
|
|
2227
|
+
}
|
|
2228
|
+
.code-block-wrapper .code-block-header .code-actions .code-action-btn:hover {
|
|
2229
|
+
background: #3e4451;
|
|
2230
|
+
color: #fff;
|
|
2231
|
+
}
|
|
2232
|
+
.code-block-wrapper .code-block-header .code-actions .code-action-btn.copy-btn.copied {
|
|
2233
|
+
color: #98c379;
|
|
2234
|
+
border-color: #98c379;
|
|
2235
|
+
}
|
|
2236
|
+
.code-block-wrapper .code-block-header .code-actions .code-action-btn.run-btn.running {
|
|
2237
|
+
color: #61afef;
|
|
2238
|
+
border-color: #61afef;
|
|
2239
|
+
}
|
|
2240
|
+
.code-block-wrapper .code-block-body {
|
|
2241
|
+
padding: 12px;
|
|
2242
|
+
overflow-x: auto;
|
|
2243
|
+
}
|
|
2244
|
+
.code-block-wrapper .code-block-body.collapsed {
|
|
2245
|
+
max-height: 200px;
|
|
2246
|
+
overflow: hidden;
|
|
2247
|
+
position: relative;
|
|
2248
|
+
}
|
|
2249
|
+
.code-block-wrapper .code-block-body.collapsed::after {
|
|
2250
|
+
content: "";
|
|
2251
|
+
position: absolute;
|
|
2252
|
+
bottom: 0;
|
|
2253
|
+
left: 0;
|
|
2254
|
+
right: 0;
|
|
2255
|
+
height: 40px;
|
|
2256
|
+
background: linear-gradient(transparent, #282c34);
|
|
2257
|
+
}
|
|
2258
|
+
.code-block-wrapper .code-block-body pre {
|
|
2259
|
+
margin: 0;
|
|
2260
|
+
font-family: "Fira Code", "Consolas", monospace;
|
|
2261
|
+
font-size: 13px;
|
|
2262
|
+
line-height: 1.5;
|
|
2263
|
+
}
|
|
2264
|
+
.code-block-wrapper .code-block-body code {
|
|
2265
|
+
font-family: inherit;
|
|
2266
|
+
}
|
|
2267
|
+
.code-block-wrapper .code-output {
|
|
2268
|
+
padding: 12px;
|
|
2269
|
+
background: #1e1e1e;
|
|
2270
|
+
border-top: 1px solid #3e4451;
|
|
2271
|
+
}
|
|
2272
|
+
.code-block-wrapper .code-output pre {
|
|
2273
|
+
margin: 0;
|
|
2274
|
+
color: #d4d4d4;
|
|
2275
|
+
font-size: 12px;
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2278
|
+
.mermaid-block {
|
|
2279
|
+
margin: 16px 0;
|
|
2280
|
+
padding: 16px;
|
|
2281
|
+
background: #fafafa;
|
|
2282
|
+
border-radius: 8px;
|
|
2283
|
+
text-align: center;
|
|
2284
|
+
}
|
|
2285
|
+
.mermaid-block .mermaid-rendered svg {
|
|
2286
|
+
max-width: 100%;
|
|
2287
|
+
height: auto;
|
|
2288
|
+
}
|
|
2289
|
+
.mermaid-block .mermaid-error {
|
|
2290
|
+
color: #e74c3c;
|
|
2291
|
+
text-align: left;
|
|
2292
|
+
font-size: 12px;
|
|
2293
|
+
}
|
|
2294
|
+
|
|
2295
|
+
.structured-data {
|
|
2296
|
+
margin: 12px 0;
|
|
2297
|
+
}
|
|
2298
|
+
.structured-data .json-viewer {
|
|
2299
|
+
background: #282c34;
|
|
2300
|
+
border-radius: 8px;
|
|
2301
|
+
padding: 12px;
|
|
2302
|
+
overflow-x: auto;
|
|
2303
|
+
}
|
|
2304
|
+
.structured-data .json-viewer pre {
|
|
2305
|
+
margin: 0;
|
|
2306
|
+
color: #abb2bf;
|
|
2307
|
+
font-size: 13px;
|
|
2308
|
+
font-family: "Fira Code", monospace;
|
|
2309
|
+
}
|
|
2310
|
+
.structured-data .table-viewer {
|
|
2311
|
+
overflow-x: auto;
|
|
2312
|
+
}
|
|
2313
|
+
.structured-data .table-viewer table {
|
|
2314
|
+
width: 100%;
|
|
2315
|
+
border-collapse: collapse;
|
|
2316
|
+
}
|
|
2317
|
+
.structured-data .table-viewer table th,
|
|
2318
|
+
.structured-data .table-viewer table td {
|
|
2319
|
+
padding: 8px 12px;
|
|
2320
|
+
border: 1px solid var(--yh-border-color-light);
|
|
2321
|
+
text-align: left;
|
|
2322
|
+
}
|
|
2323
|
+
.structured-data .table-viewer table th {
|
|
2324
|
+
background: var(--yh-bg-color-page);
|
|
2325
|
+
font-weight: 600;
|
|
2326
|
+
}
|
|
2327
|
+
.structured-data .thought-chain {
|
|
2328
|
+
display: flex;
|
|
2329
|
+
flex-direction: column;
|
|
2330
|
+
gap: 12px;
|
|
2331
|
+
position: relative;
|
|
2332
|
+
padding-left: 8px;
|
|
2333
|
+
}
|
|
2334
|
+
.structured-data .thought-chain .thought-step {
|
|
2335
|
+
display: flex;
|
|
2336
|
+
gap: 12px;
|
|
2337
|
+
position: relative;
|
|
2338
|
+
padding-bottom: 12px;
|
|
2339
|
+
}
|
|
2340
|
+
.structured-data .thought-chain .thought-step:last-child {
|
|
2341
|
+
padding-bottom: 0;
|
|
2342
|
+
}
|
|
2343
|
+
.structured-data .thought-chain .thought-step .thought-index {
|
|
2344
|
+
width: 18px;
|
|
2345
|
+
height: 18px;
|
|
2346
|
+
display: flex;
|
|
2347
|
+
align-items: center;
|
|
2348
|
+
justify-content: center;
|
|
2349
|
+
border-radius: 50%;
|
|
2350
|
+
background: var(--yh-color-primary);
|
|
2351
|
+
color: #fff;
|
|
2352
|
+
font-size: 11px;
|
|
2353
|
+
font-weight: 600;
|
|
2354
|
+
flex-shrink: 0;
|
|
2355
|
+
margin-top: 4px;
|
|
2356
|
+
}
|
|
2357
|
+
.structured-data .thought-chain .thought-step::before {
|
|
2358
|
+
content: "";
|
|
2359
|
+
position: absolute;
|
|
2360
|
+
left: 8px;
|
|
2361
|
+
top: 20px;
|
|
2362
|
+
bottom: 0;
|
|
2363
|
+
width: 2px;
|
|
2364
|
+
background: var(--yh-border-color-lighter);
|
|
2365
|
+
}
|
|
2366
|
+
.structured-data .thought-chain .thought-step:last-child::before {
|
|
2367
|
+
bottom: 18px;
|
|
2368
|
+
}
|
|
2369
|
+
.structured-data .thought-chain .thought-step .thought-content {
|
|
2370
|
+
flex: 1;
|
|
2371
|
+
background: var(--yh-fill-color-light);
|
|
2372
|
+
border-radius: 6px;
|
|
2373
|
+
padding: 8px 10px;
|
|
2374
|
+
}
|
|
2375
|
+
.structured-data .thought-chain .thought-step .thought-content .thought-title {
|
|
2376
|
+
font-weight: 600;
|
|
2377
|
+
margin-bottom: 4px;
|
|
2378
|
+
font-size: 13px;
|
|
2379
|
+
}
|
|
2380
|
+
.structured-data .thought-chain .thought-step .thought-content .thought-text {
|
|
2381
|
+
font-size: 13px;
|
|
2382
|
+
color: var(--yh-text-color-secondary);
|
|
2383
|
+
white-space: pre-wrap;
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2386
|
+
.citation-tooltip-wrapper .citation-tooltip {
|
|
2387
|
+
max-width: 320px;
|
|
2388
|
+
padding: 12px;
|
|
2389
|
+
background: var(--yh-bg-color);
|
|
2390
|
+
border-radius: 8px;
|
|
2391
|
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
|
|
2392
|
+
}
|
|
2393
|
+
.citation-tooltip-wrapper .citation-tooltip .citation-tooltip-header {
|
|
2394
|
+
display: flex;
|
|
2395
|
+
align-items: center;
|
|
2396
|
+
gap: 8px;
|
|
2397
|
+
margin-bottom: 8px;
|
|
2398
|
+
font-size: 12px;
|
|
2399
|
+
color: var(--yh-text-color-secondary);
|
|
2400
|
+
}
|
|
2401
|
+
.citation-tooltip-wrapper .citation-tooltip .citation-tooltip-body h4 {
|
|
2402
|
+
margin: 0 0 8px;
|
|
2403
|
+
font-size: 14px;
|
|
2404
|
+
font-weight: 600;
|
|
2405
|
+
}
|
|
2406
|
+
.citation-tooltip-wrapper .citation-tooltip .citation-tooltip-body p {
|
|
2407
|
+
margin: 0;
|
|
2408
|
+
font-size: 13px;
|
|
2409
|
+
color: var(--yh-text-color-secondary);
|
|
2410
|
+
line-height: 1.5;
|
|
2411
|
+
}
|
|
2412
|
+
.citation-tooltip-wrapper .citation-tooltip .citation-tooltip-body .publish-time {
|
|
2413
|
+
display: block;
|
|
2414
|
+
margin-top: 8px;
|
|
2415
|
+
font-size: 11px;
|
|
2416
|
+
color: var(--yh-text-color-disabled);
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2419
|
+
.code-edit-modal-overlay {
|
|
2420
|
+
position: fixed;
|
|
2421
|
+
top: 0;
|
|
2422
|
+
left: 0;
|
|
2423
|
+
right: 0;
|
|
2424
|
+
bottom: 0;
|
|
2425
|
+
background: rgba(0, 0, 0, 0.5);
|
|
2426
|
+
display: flex;
|
|
2427
|
+
align-items: center;
|
|
2428
|
+
justify-content: center;
|
|
2429
|
+
z-index: 10000;
|
|
2430
|
+
}
|
|
2431
|
+
.code-edit-modal-overlay .code-edit-modal {
|
|
2432
|
+
width: 80%;
|
|
2433
|
+
max-width: 800px;
|
|
2434
|
+
background: var(--yh-bg-color);
|
|
2435
|
+
border-radius: 12px;
|
|
2436
|
+
overflow: hidden;
|
|
2437
|
+
}
|
|
2438
|
+
.code-edit-modal-overlay .code-edit-modal .code-edit-header {
|
|
2439
|
+
display: flex;
|
|
2440
|
+
justify-content: space-between;
|
|
2441
|
+
align-items: center;
|
|
2442
|
+
padding: 16px;
|
|
2443
|
+
border-bottom: 1px solid var(--yh-border-color-light);
|
|
2444
|
+
}
|
|
2445
|
+
.code-edit-modal-overlay .code-edit-modal .code-edit-header h3 {
|
|
2446
|
+
margin: 0;
|
|
2447
|
+
font-size: 16px;
|
|
2448
|
+
}
|
|
2449
|
+
.code-edit-modal-overlay .code-edit-modal .code-edit-body {
|
|
2450
|
+
padding: 16px;
|
|
2451
|
+
}
|
|
2452
|
+
.code-edit-modal-overlay .code-edit-modal .code-edit-body textarea {
|
|
2453
|
+
width: 100%;
|
|
2454
|
+
padding: 12px;
|
|
2455
|
+
font-family: "Fira Code", monospace;
|
|
2456
|
+
font-size: 13px;
|
|
2457
|
+
border: 1px solid var(--yh-border-color);
|
|
2458
|
+
border-radius: 8px;
|
|
2459
|
+
resize: vertical;
|
|
2460
|
+
background: #282c34;
|
|
2461
|
+
color: #abb2bf;
|
|
2462
|
+
}
|
|
2463
|
+
.code-edit-modal-overlay .code-edit-modal .code-edit-body textarea:focus {
|
|
2464
|
+
outline: none;
|
|
2465
|
+
border-color: var(--yh-color-primary);
|
|
2466
|
+
}
|
|
2467
|
+
.code-edit-modal-overlay .code-edit-modal .code-edit-footer {
|
|
2468
|
+
display: flex;
|
|
2469
|
+
justify-content: flex-end;
|
|
2470
|
+
gap: 8px;
|
|
2471
|
+
padding: 16px;
|
|
2472
|
+
border-top: 1px solid var(--yh-border-color-light);
|
|
2473
|
+
}
|
|
1300
2474
|
</style>
|