@opentiny/tiny-robot 0.4.0-alpha.13 โ 0.4.0-alpha.15
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 +1 -198
- package/dist/action-group/index.js +1 -1
- package/dist/base-popper/index.js +1 -1
- package/dist/bubble/index.js +1 -1
- package/dist/drag-overlay/index.js +1 -1
- package/dist/dropdown-menu/index.js +6 -6
- package/dist/flow-layout-buttons/index.js +1 -1
- package/dist/history/index.js +1 -1
- package/dist/index.d.ts +1164 -2348
- package/dist/index.js +125 -155
- package/dist/index2.js +934 -188
- package/dist/index3.js +285 -266
- package/dist/index4.js +354 -734
- package/dist/index5.js +681 -358
- package/dist/index6.js +141 -919
- package/dist/mcp-add-form/index.js +1 -1
- package/dist/mcp-server-picker/index.js +1 -1
- package/dist/sender/index.js +1400 -3194
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +1 -1
- package/dist/suggestion-popover/index.js +2 -2
- package/dist/useSlotRefs.js +3 -3
- package/dist/utils.js +1 -1
- package/package.json +4 -43
- package/LICENSE +0 -22
- package/README_zh.md +0 -198
- package/dist/index7.js +0 -301
- package/dist/index8.js +0 -161
- package/dist/sender-actions/index.js +0 -13
- package/dist/sender-compat/index.js +0 -229
package/README.md
CHANGED
|
@@ -1,198 +1 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<a href="https://opentiny.design" target="_blank" rel="noopener noreferrer">
|
|
5
|
-
<img alt="OpenTiny Logo" src="logo.svg" height="100" style="max-width:100%;">
|
|
6
|
-
</a>
|
|
7
|
-
</p>
|
|
8
|
-
|
|
9
|
-
[](https://www.npmjs.com/package/@opentiny/tiny-robot)
|
|
10
|
-
[](https://opensource.org/licenses/MIT)
|
|
11
|
-
|
|
12
|
-
**TinyRobot** is an AI component library built for Vue 3, following the OpenTiny Design system. It provides rich AI interaction components to help developers quickly build enterprise-level AI applications.
|
|
13
|
-
|
|
14
|
-
## โจ Features
|
|
15
|
-
|
|
16
|
-
- ๐ค **Rich AI Components**: Comprehensive set of AI interaction components including chat bubbles, message input, conversation management, and more
|
|
17
|
-
- ๐จ **OpenTiny Design**: Follows OpenTiny Design system for consistent UI/UX
|
|
18
|
-
- ๐ **Out of the Box**: Get started in minutes with minimal configuration
|
|
19
|
-
- ๐ฏ **TypeScript Support**: Full TypeScript support with complete type definitions
|
|
20
|
-
- ๐ **Theme Customization**: Flexible theme system supporting multiple themes and custom styles
|
|
21
|
-
- ๐ฆ **Tree Shaking**: Optimized for tree shaking, import only what you need
|
|
22
|
-
- ๐ **Streaming Support**: Built-in support for streaming AI responses
|
|
23
|
-
- ๐พ **Storage Strategy**: Flexible storage strategies (LocalStorage, IndexedDB, custom)
|
|
24
|
-
|
|
25
|
-
English | [็ฎไฝไธญๆ](README_zh.md)
|
|
26
|
-
|
|
27
|
-
[](https://deepwiki.com/opentiny/tiny-robot)
|
|
28
|
-
|
|
29
|
-
## ๐ฆ Packages
|
|
30
|
-
|
|
31
|
-
TinyRobot is a monorepo containing the following packages:
|
|
32
|
-
|
|
33
|
-
| Package | Description | Version |
|
|
34
|
-
| ----------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
35
|
-
| [`@opentiny/tiny-robot`](./packages/components) | Core component library with all AI interaction components | [](https://www.npmjs.com/package/@opentiny/tiny-robot) |
|
|
36
|
-
| [`@opentiny/tiny-robot-kit`](./packages/kit) | Utility functions and AI client tools for model interactions | [](https://www.npmjs.com/package/@opentiny/tiny-robot-kit) |
|
|
37
|
-
| [`@opentiny/tiny-robot-svgs`](./packages/svgs) | SVG icon library with all component icons | [](https://www.npmjs.com/package/@opentiny/tiny-robot-svgs) |
|
|
38
|
-
|
|
39
|
-
## ๐ Quick Start
|
|
40
|
-
|
|
41
|
-
### Prerequisites
|
|
42
|
-
|
|
43
|
-
- Node.js >= 20.13.0
|
|
44
|
-
- Vue >= 3.2.0
|
|
45
|
-
- Package manager: npm, yarn, or pnpm
|
|
46
|
-
|
|
47
|
-
### Installation
|
|
48
|
-
|
|
49
|
-
**Core package** โ `@opentiny/tiny-robot` is the main package.
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
# Using pnpm (recommended)
|
|
53
|
-
pnpm add @opentiny/tiny-robot
|
|
54
|
-
|
|
55
|
-
# Using npm
|
|
56
|
-
npm install @opentiny/tiny-robot
|
|
57
|
-
|
|
58
|
-
# Using yarn
|
|
59
|
-
yarn add @opentiny/tiny-robot
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
**Optional packages**:
|
|
63
|
-
|
|
64
|
-
- `@opentiny/tiny-robot-kit` โ Only needed if you use AI model request or data-processing features. Add it when required:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
pnpm add @opentiny/tiny-robot-kit
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
- `@opentiny/tiny-robot-svgs` โ Optional. Install separately only if you need to use the SVG icon library standalone or with custom icons:
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
pnpm add @opentiny/tiny-robot-svgs
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Basic Usage
|
|
77
|
-
|
|
78
|
-
#### 1. Import Styles
|
|
79
|
-
|
|
80
|
-
In your `main.js` or `main.ts`:
|
|
81
|
-
|
|
82
|
-
```ts
|
|
83
|
-
import { createApp } from 'vue'
|
|
84
|
-
import App from './App.vue'
|
|
85
|
-
import '@opentiny/tiny-robot/dist/style.css'
|
|
86
|
-
|
|
87
|
-
const app = createApp(App)
|
|
88
|
-
app.mount('#app')
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
#### 2. Use Components
|
|
92
|
-
|
|
93
|
-
```vue
|
|
94
|
-
<template>
|
|
95
|
-
<div class="chat-container">
|
|
96
|
-
<tr-bubble role="ai" content="Hello! I'm TinyRobot, an AI component library for Vue 3." placement="start" />
|
|
97
|
-
<tr-bubble role="user" content="That's great! How can I get started?" placement="end" />
|
|
98
|
-
</div>
|
|
99
|
-
</template>
|
|
100
|
-
|
|
101
|
-
<script setup>
|
|
102
|
-
import { TrBubble } from '@opentiny/tiny-robot'
|
|
103
|
-
</script>
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
## ๐ Documentation
|
|
107
|
-
|
|
108
|
-
- ๐ [Full Documentation](https://docs.opentiny.design/tiny-robot/) - Complete API reference and guides
|
|
109
|
-
- ๐ฏ [Quick Start Guide](https://docs.opentiny.design/tiny-robot/guide/quick-start) - Get started in minutes
|
|
110
|
-
- ๐จ [Theme Configuration](https://docs.opentiny.design/tiny-robot/guide/theme-config) - Customize themes
|
|
111
|
-
- ๐ [Update Log](https://docs.opentiny.design/tiny-robot/guide/update-log) - Version history
|
|
112
|
-
- ๐ก [Examples](https://docs.opentiny.design/tiny-robot/examples/assistant) - Complete application examples
|
|
113
|
-
|
|
114
|
-
## ๐๏ธ Project Structure
|
|
115
|
-
|
|
116
|
-
```text
|
|
117
|
-
tiny-robot/
|
|
118
|
-
โโโ packages/
|
|
119
|
-
โ โโโ components/ # Core component library
|
|
120
|
-
โ โ โโโ src/
|
|
121
|
-
โ โ โ โโโ bubble/ # Chat bubble components
|
|
122
|
-
โ โ โ โโโ sender/ # Message input component
|
|
123
|
-
โ โ โ โโโ container/ # Container component
|
|
124
|
-
โ โ โ โโโ history/ # Conversation history
|
|
125
|
-
โ โ โ โโโ attachments/ # File attachments
|
|
126
|
-
โ โ โ โโโ ... # Other components
|
|
127
|
-
โ โ โโโ package.json
|
|
128
|
-
โ โโโ kit/ # Utility functions and AI tools
|
|
129
|
-
โ โ โโโ src/
|
|
130
|
-
โ โ โ โโโ providers/ # AI provider implementations
|
|
131
|
-
โ โ โ โโโ vue/ # Vue composables
|
|
132
|
-
โ โ โ โ โโโ message/ # useMessage composable
|
|
133
|
-
โ โ โ โ โโโ conversation/ # useConversation composable
|
|
134
|
-
โ โ โ โโโ storage/ # Storage utilities
|
|
135
|
-
โ โ โโโ package.json
|
|
136
|
-
โ โโโ svgs/ # SVG icon library
|
|
137
|
-
โ โโโ playground/ # Development playground
|
|
138
|
-
โ โโโ test/ # Test suite
|
|
139
|
-
โโโ docs/ # Documentation site
|
|
140
|
-
โ โโโ src/ # Documentation source
|
|
141
|
-
โ โโโ demos/ # Component demos
|
|
142
|
-
โโโ scripts/ # Build and utility scripts
|
|
143
|
-
โโโ package.json
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
## ๐ ๏ธ Development
|
|
147
|
-
|
|
148
|
-
### Setup
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
# Install dependencies
|
|
152
|
-
pnpm install
|
|
153
|
-
|
|
154
|
-
# Start development server (playground + docs)
|
|
155
|
-
pnpm dev
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Development Workflow
|
|
159
|
-
|
|
160
|
-
1. **Start Development Server**:
|
|
161
|
-
- Run `pnpm dev` in the project root directory
|
|
162
|
-
- This starts both the playground and documentation site
|
|
163
|
-
- After modifying components in `packages/components/src/`, changes will be automatically reflected in the documentation page
|
|
164
|
-
|
|
165
|
-
2. **Documentation**:
|
|
166
|
-
- Documentation source: `docs/src/`
|
|
167
|
-
- Component demos: `docs/demos/`
|
|
168
|
-
|
|
169
|
-
3. **Testing**:
|
|
170
|
-
- Run `pnpm test` to execute tests
|
|
171
|
-
|
|
172
|
-
## ๐ License
|
|
173
|
-
|
|
174
|
-
MIT License - see [LICENSE](./LICENSE) file for details.
|
|
175
|
-
|
|
176
|
-
## ๐ค Contributing
|
|
177
|
-
|
|
178
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
179
|
-
|
|
180
|
-
1. Fork the repository
|
|
181
|
-
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
|
|
182
|
-
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
|
|
183
|
-
4. Push to the branch (`git push origin feature/AmazingFeature`)
|
|
184
|
-
5. Open a Pull Request
|
|
185
|
-
|
|
186
|
-
## ๐ Support
|
|
187
|
-
|
|
188
|
-
- ๐ [Documentation](https://docs.opentiny.design/tiny-robot/)
|
|
189
|
-
- ๐ [Issue Tracker](https://github.com/opentiny/tiny-robot/issues)
|
|
190
|
-
- ๐ฌ [Discussions](https://github.com/opentiny/tiny-robot/discussions)
|
|
191
|
-
|
|
192
|
-
## ๐ Acknowledgments
|
|
193
|
-
|
|
194
|
-
Built with โค๏ธ by the OpenTiny team.
|
|
195
|
-
|
|
196
|
-
---
|
|
197
|
-
|
|
198
|
-
**Note**: This project is part of the [OpenTiny](https://github.com/opentiny) ecosystem.
|
|
1
|
+
# ็ปไปถ
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as $, useSlots as H, computed as i, ref as f, watch as I, nextTick as W, openBlock as o, createElementBlock as _, Fragment as N, renderList as R, createBlock as v, unref as h, withCtx as S, createElementVNode as w, resolveDynamicComponent as G, renderSlot as L, createVNode as x, Transition as j, withDirectives as q, normalizeClass as J, withModifiers as K, createCommentVNode as E, toDisplayString as Q, vShow as U } from "vue";
|
|
2
2
|
import { IconMenu as Y } from "@opentiny/tiny-robot-svgs";
|
|
3
3
|
import { TinyTooltip as M } from "@opentiny/vue";
|
|
4
|
-
import { o as Z,
|
|
4
|
+
import { o as Z, d as ee } from "../index5.js";
|
|
5
5
|
import te from "../icon-button/index.js";
|
|
6
6
|
import { _ as oe } from "../_plugin-vue_export-helper.js";
|
|
7
7
|
const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae = { class: "tr-action-group__dropdown-item-text" }, ce = /* @__PURE__ */ $({
|
package/dist/bubble/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as a, a as b, b as r, c as u, d as l, e as t, f as n, g as B, h as o, i as d, j as i } from "../
|
|
1
|
+
import { B as a, a as b, b as r, c as u, d as l, e as t, f as n, g as B, h as o, i as d, j as i } from "../index2.js";
|
|
2
2
|
export {
|
|
3
3
|
a as Bubble,
|
|
4
4
|
b as BubbleList,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as v, computed as y, openBlock as t, createBlock as u, Transition as F, withCtx as m, createElementBlock as a, normalizeStyle as h, normalizeClass as x, renderSlot as _, createElementVNode as l, toDisplayString as n, Fragment as w, renderList as D, createCommentVNode as B } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { c as M } from "../index5.js";
|
|
3
3
|
import { _ as Z } from "../_plugin-vue_export-helper.js";
|
|
4
4
|
const k = "data:image/svg+xml,%3csvg%20width='80.000000'%20height='80.000000'%20viewBox='0%200%2080%2080'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cdefs/%3e%3crect%20width='80.000000'%20height='80.000000'%20fill='%23FFFFFF'%20fill-opacity='0'/%3e%3cpath%20d='M10%2014L70%2014C72.2%2014%2074%2015.79%2074%2018L74%2063C74%2065.2%2072.2%2067%2070%2067L10%2067C7.79%2067%206%2065.2%206%2063L6%2018C6%2015.79%207.79%2014%2010%2014Z'%20fill='%23FFFFFF'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3cpath%20d='M10%2014L70%2014C72.2%2014%2074%2015.79%2074%2018L74%2063C74%2065.2%2072.2%2067%2070%2067L10%2067C7.79%2067%206%2065.2%206%2063L6%2018C6%2015.79%207.79%2014%2010%2014ZM10%2015L70%2015C71%2015%2071.75%2015.25%2072.25%2015.75C72.75%2016.25%2073%2017%2073%2018L73%2063C73%2064%2072.75%2064.75%2072.25%2065.25C71.75%2065.75%2071%2066%2070%2066L10%2066C9%2066%208.25%2065.75%207.75%2065.25C7.25%2064.75%207%2064%207%2063L7%2018C7%2017%207.25%2016.25%207.75%2015.75C8.25%2015.25%209%2015%2010%2015Z'%20fill='%23808080'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3cpath%20d='M6%2047.27L24.56%2029.06C25.73%2027.91%2027.6%2027.91%2028.77%2029.06L44.52%2044.51C45.69%2045.66%2047.56%2045.66%2048.72%2044.51L56.64%2036.75C57.8%2035.6%2059.67%2035.6%2060.84%2036.75L74%2049.67L74%2062C74%2064.76%2071.76%2067%2069%2067L11%2067C8.23%2067%206%2064.76%206%2062L6%2047.27Z'%20fill='%23F0F0F0'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3cpath%20d=''%20fill='%23808080'%20fill-opacity='0'%20fill-rule='evenodd'/%3e%3cellipse%20cx='40.000000'%20cy='40.000000'%20rx='8.000001'%20ry='8.000002'%20fill='%231476FF'%20fill-opacity='1.000000'/%3e%3cpath%20d='M40%2035.5C40.27%2035.5%2040.5%2035.72%2040.5%2036L40.5%2039.49L44%2039.5C44.27%2039.5%2044.5%2039.72%2044.5%2040C44.5%2040.27%2044.27%2040.5%2044%2040.5L40.5%2040.5L40.5%2044C40.5%2044.27%2040.27%2044.5%2040%2044.5C39.72%2044.5%2039.5%2044.27%2039.5%2044L39.5%2040.5L36%2040.5C35.72%2040.5%2035.5%2040.27%2035.5%2040C35.5%2039.72%2035.72%2039.5%2036%2039.5L39.5%2039.5L39.5%2036C39.5%2035.72%2039.72%2035.5%2040%2035.5Z'%20fill='%23FFFFFF'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3cpath%20d='M10%2014L70%2014C72.2%2014%2074%2015.79%2074%2018L74%2063C74%2065.2%2072.2%2067%2070%2067L10%2067C7.79%2067%206%2065.2%206%2063L6%2018C6%2015.79%207.79%2014%2010%2014Z'%20fill='%23FFFFFF'%20fill-opacity='0'%20fill-rule='evenodd'/%3e%3cpath%20d='M10%2014L70%2014C72.2%2014%2074%2015.79%2074%2018L74%2063C74%2065.2%2072.2%2067%2070%2067L10%2067C7.79%2067%206%2065.2%206%2063L6%2018C6%2015.79%207.79%2014%2010%2014ZM10%2015L70%2015C71%2015%2071.75%2015.25%2072.25%2015.75C72.75%2016.25%2073%2017%2073%2018L73%2063C73%2064%2072.75%2064.75%2072.25%2065.25C71.75%2065.75%2071%2066%2070%2066L10%2066C9%2066%208.25%2065.75%207.75%2065.25C7.25%2064.75%207%2064%207%2063L7%2018C7%2017%207.25%2016.25%207.75%2015.75C8.25%2015.25%209%2015%2010%2015Z'%20fill='%23808080'%20fill-opacity='1.000000'%20fill-rule='evenodd'/%3e%3ccircle%20cx='58.000000'%20cy='27.000000'%20r='5.000000'%20fill='%23DBDBDB'%20fill-opacity='1.000000'/%3e%3c/svg%3e", T = { class: "tr-drag-overlay__content" }, $ = { class: "tr-drag-overlay__text" }, S = { class: "tr-drag-overlay__title" }, E = { class: "tr-drag-overlay__description" }, z = /* @__PURE__ */ v({
|
|
5
5
|
__name: "index",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as k, onUnmounted as T, watch as C, defineComponent as E, useModel as H, computed as p, openBlock as w, createBlock as I, unref as X, withCtx as y, createElementVNode as j, createElementBlock as _, Fragment as D, renderList as L, toDisplayString as Y, renderSlot as O, mergeModels as
|
|
2
|
-
import { w as S,
|
|
3
|
-
import { B as A } from "../
|
|
1
|
+
import { ref as k, onUnmounted as T, watch as C, defineComponent as E, useModel as H, computed as p, openBlock as w, createBlock as I, unref as X, withCtx as y, createElementVNode as j, createElementBlock as _, Fragment as D, renderList as L, toDisplayString as Y, renderSlot as O, mergeModels as b } from "vue";
|
|
2
|
+
import { w as S, b as M, o as $ } from "../index5.js";
|
|
3
|
+
import { B as A } from "../index6.js";
|
|
4
4
|
import { u as F } from "../utils.js";
|
|
5
5
|
import { _ as G } from "../_plugin-vue_export-helper.js";
|
|
6
6
|
const P = (o, t) => o.x >= t.left && o.x <= t.right && o.y >= t.top && o.y <= t.bottom, N = (o, t, g = !1) => {
|
|
@@ -55,7 +55,7 @@ const P = (o, t) => o.x >= t.left && o.x <= t.right && o.y >= t.top && o.y <= t.
|
|
|
55
55
|
), S(
|
|
56
56
|
[V, q],
|
|
57
57
|
([n, i]) => {
|
|
58
|
-
const e =
|
|
58
|
+
const e = M(o), m = M(t), u = e == null ? void 0 : e.getBoundingClientRect(), h = m == null ? void 0 : m.getBoundingClientRect();
|
|
59
59
|
if (u && P({ x: n, y: i }, u)) {
|
|
60
60
|
r.value = "trigger";
|
|
61
61
|
return;
|
|
@@ -74,7 +74,7 @@ const P = (o, t) => o.x >= t.left && o.x <= t.right && o.y >= t.top && o.y <= t.
|
|
|
74
74
|
), f;
|
|
75
75
|
}, J = { class: "tr-dropdown-menu__list" }, K = ["onClick"], Q = /* @__PURE__ */ E({
|
|
76
76
|
__name: "index",
|
|
77
|
-
props: /* @__PURE__ */
|
|
77
|
+
props: /* @__PURE__ */ b({
|
|
78
78
|
appendTo: {},
|
|
79
79
|
items: {},
|
|
80
80
|
show: { type: Boolean },
|
|
@@ -83,7 +83,7 @@ const P = (o, t) => o.x >= t.left && o.x <= t.right && o.y >= t.top && o.y <= t.
|
|
|
83
83
|
show: { type: Boolean, default: !1 },
|
|
84
84
|
showModifiers: {}
|
|
85
85
|
}),
|
|
86
|
-
emits: /* @__PURE__ */
|
|
86
|
+
emits: /* @__PURE__ */ b(["item-click", "click-outside"], ["update:show"]),
|
|
87
87
|
setup(o, { expose: t, emit: g }) {
|
|
88
88
|
const l = o, d = g, f = H(o, "show"), r = p({
|
|
89
89
|
get: () => l.trigger === "manual" ? l.show : f.value,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as q, useModel as G, watch as g, ref as i, computed as E, openBlock as l, createElementBlock as a, Fragment as I, renderList as $, normalizeClass as C, createBlock as x, resolveDynamicComponent as B, toDisplayString as D, createCommentVNode as _, createElementVNode as b, mergeModels as S, nextTick as H } from "vue";
|
|
2
2
|
import { IconArrowDown as X } from "@opentiny/tiny-robot-svgs";
|
|
3
|
-
import {
|
|
3
|
+
import { e as j, o as J } from "../index5.js";
|
|
4
4
|
import { _ as K } from "../_plugin-vue_export-helper.js";
|
|
5
5
|
const P = ["onClick"], Q = {
|
|
6
6
|
key: 0,
|
package/dist/history/index.js
CHANGED