@opentiny/vue-docs 3.28.1 → 3.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/demos/apis/action-menu.js +22 -0
  2. package/demos/apis/alert.js +19 -22
  3. package/demos/apis/button-group.js +15 -0
  4. package/demos/apis/calendar-view.js +5 -5
  5. package/demos/apis/cascader-view.js +5 -5
  6. package/demos/apis/dialog-box.js +39 -38
  7. package/demos/apis/drawer.js +31 -0
  8. package/demos/apis/dropdown.js +39 -1
  9. package/demos/apis/filter-panel.js +21 -1
  10. package/demos/apis/fluent-editor.js +30 -0
  11. package/demos/apis/form.js +11 -0
  12. package/demos/apis/fullscreen.js +10 -11
  13. package/demos/apis/grid.js +131 -16
  14. package/demos/apis/guide.js +14 -0
  15. package/demos/apis/link.js +11 -0
  16. package/demos/apis/message.js +48 -22
  17. package/demos/apis/modal.js +34 -31
  18. package/demos/apis/notify.js +13 -13
  19. package/demos/apis/rate.js +15 -0
  20. package/demos/apis/search-box.js +343 -0
  21. package/demos/apis/select.js +14 -2
  22. package/demos/apis/tag-input.js +182 -0
  23. package/demos/apis/tree.js +23 -23
  24. package/demos/mobile-first/app/button-group/display-mode.vue +31 -0
  25. package/demos/mobile-first/app/button-group/webdoc/button-group.js +13 -0
  26. package/demos/mobile-first/app/calendar-view/webdoc/calendar-view.js +5 -4
  27. package/demos/mobile-first/app/modal/webdoc/modal.js +2 -1
  28. package/demos/pc/app/alert/center.spec.ts +8 -0
  29. package/demos/pc/app/alert/custom-close.spec.ts +39 -9
  30. package/demos/pc/app/alert/icon.spec.ts +18 -7
  31. package/demos/pc/app/alert/show-icon.spec.ts +1 -1
  32. package/demos/pc/app/anchor/webdoc/anchor.js +1 -0
  33. package/demos/pc/app/base-select/copy-multi.spec.ts +1 -1
  34. package/demos/pc/app/button-group/display-mode-composition-api.vue +23 -0
  35. package/demos/pc/app/button-group/display-mode.spec.ts +0 -0
  36. package/demos/pc/app/button-group/display-mode.vue +31 -0
  37. package/demos/pc/app/button-group/sup-composition-api.vue +1 -0
  38. package/demos/pc/app/button-group/sup.vue +1 -0
  39. package/demos/pc/app/button-group/webdoc/button-group.js +14 -0
  40. package/demos/pc/app/calendar-view/calendar-event.spec.ts +1 -1
  41. package/demos/pc/app/calendar-view/custom-day-bg-color.vue +10 -0
  42. package/demos/pc/app/calendar-view/webdoc/calendar-view.js +4 -4
  43. package/demos/pc/app/cascader/filter-mode-composition-api.vue +2 -3
  44. package/demos/pc/app/checkbox/checked-composition-api.vue +3 -3
  45. package/demos/pc/app/checkbox/checked.vue +3 -3
  46. package/demos/pc/app/date-picker/align.spec.ts +10 -13
  47. package/demos/pc/app/date-picker/clear.spec.ts +3 -3
  48. package/demos/pc/app/date-picker/default-value.spec.ts +4 -4
  49. package/demos/pc/app/date-picker/events.spec.ts +2 -2
  50. package/demos/pc/app/date-picker/format.spec.ts +3 -3
  51. package/demos/pc/app/date-picker/now.spec.ts +4 -4
  52. package/demos/pc/app/date-picker/shortcuts.spec.ts +1 -1
  53. package/demos/pc/app/date-picker/slot.spec.ts +5 -5
  54. package/demos/pc/app/dialog-box/basic-usage.spec.ts +5 -5
  55. package/demos/pc/app/dialog-box/form-in-dialog.spec.ts +1 -2
  56. package/demos/pc/app/drawer/basic-usage.spec.ts +4 -3
  57. package/demos/pc/app/drawer/close-on-press-escape.spec.ts +4 -2
  58. package/demos/pc/app/drawer/placement.spec.ts +4 -4
  59. package/demos/pc/app/drawer/show-header.spec.ts +3 -2
  60. package/demos/pc/app/drawer/webdoc/drawer.js +3 -2
  61. package/demos/pc/app/dropdown/show-icon-composition-api.vue +1 -1
  62. package/demos/pc/app/dropdown/show-icon.vue +1 -1
  63. package/demos/pc/app/dropdown/tip-composition-api.vue +5 -2
  64. package/demos/pc/app/dropdown/tip.vue +5 -2
  65. package/demos/pc/app/dropdown/webdoc/dropdown.js +2 -2
  66. package/demos/pc/app/filter-panel/size-composition-api.vue +58 -0
  67. package/demos/pc/app/filter-panel/size.spec.ts +23 -0
  68. package/demos/pc/app/filter-panel/size.vue +68 -0
  69. package/demos/pc/app/filter-panel/webdoc/filter-panel.js +13 -0
  70. package/demos/pc/app/flowchart/basic-usage-composition-api.vue +10 -260
  71. package/demos/pc/app/flowchart/basic-usage.spec.ts +2 -1
  72. package/demos/pc/app/flowchart/basic-usage.vue +4 -249
  73. package/demos/pc/app/flowchart/slots-composition-api.vue +182 -0
  74. package/demos/pc/app/flowchart/slots.spec.ts +24 -0
  75. package/demos/pc/app/flowchart/slots.vue +193 -0
  76. package/demos/pc/app/flowchart/webdoc/flowchart.js +14 -2
  77. package/demos/pc/app/form/basic-usage.spec.ts +6 -4
  78. package/demos/pc/app/form/custom-validation-string-length-composition-api.vue +38 -0
  79. package/demos/pc/app/form/custom-validation-string-length.spec.ts +18 -0
  80. package/demos/pc/app/form/custom-validation-string-length.vue +28 -13
  81. package/demos/pc/app/form/group-form-composition-api.vue +2 -2
  82. package/demos/pc/app/form/group-form.vue +2 -2
  83. package/demos/pc/app/grid/filter/advanced-filter-composition-api.vue +1 -1
  84. package/demos/pc/app/grid/filter/advanced-filter.spec.js +1 -0
  85. package/demos/pc/app/grid/filter/advanced-filter.vue +1 -1
  86. package/demos/pc/app/grid/filter/custom-filter-composition-api.vue +46 -23
  87. package/demos/pc/app/grid/filter/custom-filter.spec.js +1 -1
  88. package/demos/pc/app/grid/filter/custom-filter.vue +47 -24
  89. package/demos/pc/app/grid/filter/default-filter-composition-api.vue +5 -1
  90. package/demos/pc/app/grid/filter/default-filter.spec.ts +1 -0
  91. package/demos/pc/app/grid/filter/default-filter.vue +4 -1
  92. package/demos/pc/app/grid/filter/filter-label-value-composition-api.vue +71 -0
  93. package/demos/pc/app/grid/filter/filter-label-value.spec.ts +27 -0
  94. package/demos/pc/app/grid/filter/filter-label-value.vue +78 -0
  95. package/demos/pc/app/grid/filter/input-filter-custom-component-composition-api.vue +116 -0
  96. package/demos/pc/app/grid/filter/input-filter-custom-component.spec.ts +20 -0
  97. package/demos/pc/app/grid/filter/input-filter-custom-component.vue +126 -0
  98. package/demos/pc/app/grid/filter/layout-order-filter-composition-api.vue +114 -0
  99. package/demos/pc/app/grid/filter/layout-order-filter.spec.ts +31 -0
  100. package/demos/pc/app/grid/filter/layout-order-filter.vue +123 -0
  101. package/demos/pc/app/grid/toolbar/custom-toolbar.spec.js +1 -1
  102. package/demos/pc/app/grid/webdoc/grid-filter.js +89 -40
  103. package/demos/pc/app/guide/show-close-composition-api.vue +77 -0
  104. package/demos/pc/app/guide/show-close.spec.ts +37 -0
  105. package/demos/pc/app/guide/show-close.vue +84 -0
  106. package/demos/pc/app/guide/webdoc/guide.js +12 -0
  107. package/demos/pc/app/icon/advance-icons.js +108 -2
  108. package/demos/pc/app/icon/advance-usage-composition-api.vue +26 -1
  109. package/demos/pc/app/icon/advance-usage.vue +27 -1
  110. package/demos/pc/app/icon/webdoc/icon.js +5 -3
  111. package/demos/pc/app/input/resize.spec.ts +2 -2
  112. package/demos/pc/app/link/custom-icon-composition-api.vue +1 -1
  113. package/demos/pc/app/link/custom-icon.vue +1 -1
  114. package/demos/pc/app/link/target-composition-api.vue +24 -0
  115. package/demos/pc/app/link/target.spec.ts +41 -0
  116. package/demos/pc/app/link/target.vue +30 -0
  117. package/demos/pc/app/link/webdoc/link.js +14 -0
  118. package/demos/pc/app/message/basic-usage-composition-api.vue +48 -0
  119. package/demos/pc/app/message/basic-usage.spec.ts +27 -0
  120. package/demos/pc/app/message/basic-usage.vue +50 -0
  121. package/demos/pc/app/message/message-close-composition-api.vue +25 -0
  122. package/demos/pc/app/message/message-close.spec.ts +9 -0
  123. package/demos/pc/app/message/message-close.vue +32 -0
  124. package/demos/pc/app/message/message-duration-composition-api.vue +25 -0
  125. package/demos/pc/app/message/message-duration.spec.ts +9 -0
  126. package/demos/pc/app/message/message-duration.vue +32 -0
  127. package/demos/pc/app/message/prevent-duplicate-composition-api.vue +25 -0
  128. package/demos/pc/app/message/prevent-duplicate.spec.ts +9 -0
  129. package/demos/pc/app/message/prevent-duplicate.vue +32 -0
  130. package/demos/pc/app/message/webdoc/message.cn.md +7 -0
  131. package/demos/pc/app/message/webdoc/message.en.md +7 -0
  132. package/demos/pc/app/message/webdoc/message.js +56 -0
  133. package/demos/pc/app/modal/basic-usage.spec.ts +3 -3
  134. package/demos/pc/app/modal/modal-footer-composition-api.vue +3 -3
  135. package/demos/pc/app/modal/modal-footer.spec.ts +9 -4
  136. package/demos/pc/app/modal/modal-footer.vue +3 -3
  137. package/demos/pc/app/modal/modal-header.spec.ts +2 -2
  138. package/demos/pc/app/modal/modal-size.spec.ts +2 -2
  139. package/demos/pc/app/modal/status.spec.ts +22 -15
  140. package/demos/pc/app/nav-menu/overflow.spec.ts +1 -1
  141. package/demos/pc/app/popconfirm/custom-class.spec.ts +0 -1
  142. package/demos/pc/app/popconfirm/slot-message.spec.ts +10 -2
  143. package/demos/pc/app/popconfirm/trigger.spec.ts +16 -12
  144. package/demos/pc/app/popover/basic-usage.spec.js +3 -8
  145. package/demos/pc/app/popover/custom-popper.spec.js +2 -2
  146. package/demos/pc/app/popover/delay.spec.js +2 -2
  147. package/demos/pc/app/popover/disabled.spec.js +2 -2
  148. package/demos/pc/app/popover/events.spec.js +1 -1
  149. package/demos/pc/app/popover/ignore-boundaries.spec.js +2 -3
  150. package/demos/pc/app/popover/offset.spec.js +17 -31
  151. package/demos/pc/app/radio/dynamic-disable-composition-api.vue +3 -3
  152. package/demos/pc/app/radio/dynamic-disable.vue +2 -2
  153. package/demos/pc/app/rate/clearable-composition-api.vue +20 -0
  154. package/demos/pc/app/rate/clearable.spec.js +74 -0
  155. package/demos/pc/app/rate/clearable.vue +28 -0
  156. package/demos/pc/app/rate/webdoc/rate.js +12 -0
  157. package/demos/pc/app/search/events.spec.ts +1 -1
  158. package/demos/pc/app/search-box/append-to-body-composition-api.vue +300 -0
  159. package/demos/pc/app/search-box/append-to-body.vue +308 -0
  160. package/demos/pc/app/search-box/auto-match-composition-api.vue +162 -0
  161. package/demos/pc/app/search-box/auto-match.vue +170 -0
  162. package/demos/pc/app/search-box/basic-usage-composition-api.vue +269 -0
  163. package/demos/pc/app/search-box/basic-usage.vue +277 -0
  164. package/demos/pc/app/search-box/custom-panel-composition-api.vue +63 -0
  165. package/demos/pc/app/search-box/custom-panel.vue +72 -0
  166. package/demos/pc/app/search-box/default-field-composition-api.vue +163 -0
  167. package/demos/pc/app/search-box/default-field.vue +171 -0
  168. package/demos/pc/app/search-box/editable-composition-api.vue +311 -0
  169. package/demos/pc/app/search-box/editable.vue +320 -0
  170. package/demos/pc/app/search-box/empty-placeholder-composition-api.vue +162 -0
  171. package/demos/pc/app/search-box/empty-placeholder.vue +170 -0
  172. package/demos/pc/app/search-box/events-composition-api.vue +169 -0
  173. package/demos/pc/app/search-box/events.vue +173 -0
  174. package/demos/pc/app/search-box/group-key-composition-api.vue +257 -0
  175. package/demos/pc/app/search-box/group-key.vue +266 -0
  176. package/demos/pc/app/search-box/help-composition-api.vue +166 -0
  177. package/demos/pc/app/search-box/help.vue +175 -0
  178. package/demos/pc/app/search-box/id-map-key-composition-api.vue +131 -0
  179. package/demos/pc/app/search-box/id-map-key.vue +140 -0
  180. package/demos/pc/app/search-box/item-placeholder-composition-api.vue +119 -0
  181. package/demos/pc/app/search-box/item-placeholder.vue +127 -0
  182. package/demos/pc/app/search-box/max-length-composition-api.vue +29 -0
  183. package/demos/pc/app/search-box/max-length.vue +38 -0
  184. package/demos/pc/app/search-box/max-time-length-composition-api.vue +53 -0
  185. package/demos/pc/app/search-box/max-time-length.vue +62 -0
  186. package/demos/pc/app/search-box/merge-tag-composition-api.vue +59 -0
  187. package/demos/pc/app/search-box/merge-tag.vue +68 -0
  188. package/demos/pc/app/search-box/panel-max-height-composition-api.vue +162 -0
  189. package/demos/pc/app/search-box/panel-max-height.vue +170 -0
  190. package/demos/pc/app/search-box/potential-match-composition-api.vue +193 -0
  191. package/demos/pc/app/search-box/potential-match.vue +201 -0
  192. package/demos/pc/app/search-box/settings-composition-api.vue +163 -0
  193. package/demos/pc/app/search-box/settings.vue +171 -0
  194. package/demos/pc/app/search-box/size-composition-api.vue +162 -0
  195. package/demos/pc/app/search-box/size.vue +170 -0
  196. package/demos/pc/app/search-box/split-input-value-composition-api.vue +162 -0
  197. package/demos/pc/app/search-box/split-input-value.vue +170 -0
  198. package/demos/pc/app/search-box/suffix-icon-composition-api.vue +209 -0
  199. package/demos/pc/app/search-box/suffix-icon.vue +219 -0
  200. package/demos/pc/app/search-box/v-model-composition-api.vue +174 -0
  201. package/demos/pc/app/search-box/v-model.vue +182 -0
  202. package/demos/pc/app/search-box/webdoc/search-box.cn.md +7 -0
  203. package/demos/pc/app/search-box/webdoc/search-box.en.md +7 -0
  204. package/demos/pc/app/search-box/webdoc/search-box.js +257 -0
  205. package/demos/pc/app/select/copy-multi.spec.ts +1 -1
  206. package/demos/pc/app/select-wrapper/copy-multi.spec.ts +2 -1
  207. package/demos/pc/app/tabs/basic-usage.spec.ts +2 -2
  208. package/demos/pc/app/tabs/more-show-all.spec.ts +2 -1
  209. package/demos/pc/app/tabs/tabs-events-close-composition-api.vue +8 -2
  210. package/demos/pc/app/tabs/tabs-events-close.vue +8 -2
  211. package/demos/pc/app/tag/basic-usage.spec.ts +1 -1
  212. package/demos/pc/app/tag/color-border.spec.ts +2 -2
  213. package/demos/pc/app/tag/max-width.spec.ts +1 -1
  214. package/demos/pc/app/tag/size.spec.ts +3 -3
  215. package/demos/pc/app/tag/slot-default.spec.ts +3 -3
  216. package/demos/pc/app/tag-group/basic-usage.spec.js +5 -5
  217. package/demos/pc/app/tag-group/tag-group-effect.spec.js +10 -10
  218. package/demos/pc/app/tag-group/tag-group-event.spec.js +1 -1
  219. package/demos/pc/app/tag-input/basic-usage-composition-api.vue +29 -0
  220. package/demos/pc/app/tag-input/basic-usage.spec.ts +0 -0
  221. package/demos/pc/app/tag-input/basic-usage.vue +38 -0
  222. package/demos/pc/app/tag-input/clearable-tag-composition-api.vue +20 -0
  223. package/demos/pc/app/tag-input/clearable-tag.vue +27 -0
  224. package/demos/pc/app/tag-input/collapsed-tag-composition-api.vue +20 -0
  225. package/demos/pc/app/tag-input/collapsed-tag.vue +28 -0
  226. package/demos/pc/app/tag-input/disabled-readonly-composition-api.vue +20 -0
  227. package/demos/pc/app/tag-input/disabled-readonly.vue +29 -0
  228. package/demos/pc/app/tag-input/draggable-tag-composition-api.vue +12 -0
  229. package/demos/pc/app/tag-input/draggable-tag.spec.ts +0 -0
  230. package/demos/pc/app/tag-input/draggable-tag.vue +20 -0
  231. package/demos/pc/app/tag-input/max-composition-api.vue +20 -0
  232. package/demos/pc/app/tag-input/max.vue +28 -0
  233. package/demos/pc/app/tag-input/prefix-suffix-composition-api.vue +26 -0
  234. package/demos/pc/app/tag-input/prefix-suffix.vue +34 -0
  235. package/demos/pc/app/tag-input/separator-tag-composition-api.vue +20 -0
  236. package/demos/pc/app/tag-input/separator-tag.vue +28 -0
  237. package/demos/pc/app/tag-input/webdoc/tag-input.cn.md +7 -0
  238. package/demos/pc/app/tag-input/webdoc/tag-input.en.md +7 -0
  239. package/demos/pc/app/tag-input/webdoc/tag-input.js +107 -0
  240. package/demos/pc/app/time-picker/basic-usage.spec.ts +5 -4
  241. package/demos/pc/app/time-picker/clearable.spec.ts +5 -4
  242. package/demos/pc/app/time-picker/default-value.spec.ts +2 -2
  243. package/demos/pc/app/time-picker/disabled.spec.ts +4 -3
  244. package/demos/pc/app/time-picker/format.spec.ts +8 -11
  245. package/demos/pc/app/time-picker/is-range.spec.ts +4 -3
  246. package/demos/pc/app/time-picker/name.spec.ts +1 -1
  247. package/demos/pc/app/time-picker/placeholder.spec.ts +3 -3
  248. package/demos/pc/app/time-picker/popper-class.spec.ts +1 -1
  249. package/demos/pc/app/time-picker/size.spec.ts +2 -1
  250. package/demos/pc/app/time-select/basic-usage.spec.ts +1 -1
  251. package/demos/pc/app/time-select/clear-icon.spec.ts +1 -2
  252. package/demos/pc/app/time-select/focus.spec.ts +1 -1
  253. package/demos/pc/app/time-select/picker-options.spec.ts +2 -1
  254. package/demos/pc/app/time-select/range-placeholder.spec.ts +2 -2
  255. package/demos/pc/app/time-select/size-medium.spec.ts +3 -3
  256. package/demos/pc/app/tooltip/delay.spec.js +7 -9
  257. package/demos/pc/app/tooltip/offset.spec.js +0 -2
  258. package/demos/pc/app/tooltip/popper-options.spec.js +2 -1
  259. package/demos/pc/menus.js +6 -4
  260. package/demos/pc/webdoc/changelog-en.md +209 -86
  261. package/demos/pc/webdoc/changelog.md +176 -257
  262. package/demos/pc/webdoc/develop-demo-en.md +13 -13
  263. package/demos/pc/webdoc/import-components.md +1 -1
  264. package/demos/pc/webdoc/introduce.md +2 -0
  265. package/demos/pc/webdoc/skills-en.md +107 -0
  266. package/demos/pc/webdoc/skills.md +107 -0
  267. package/demos/pc/webdoc/theme-en.md +82 -79
  268. package/demos/pc/webdoc/v3.28.0-release-article.md +943 -0
  269. package/demos/saas/menus.js +1 -0
  270. package/package.json +21 -20
  271. package/playground/App.vue +6 -4
  272. package/playground/shims/vue-search-box.mjs +154 -0
  273. package/public/static/css/mobile-dark-theme.css +1 -0
  274. package/src/i18n/index.js +1 -2
  275. package/src/main.js +8 -5
  276. package/src/style.css +5 -0
  277. package/src/views/components-doc/common.vue +0 -25
  278. package/src/views/components-doc/mobile.vue +49 -2
  279. package/vite.config.ts +3 -2
  280. package/vite.extend.ts +65 -0
  281. package/demos/pc/app/grid/webdoc/grid-ai-agent.js +0 -23
  282. package/demos/pc/webdoc/mcp-en.md +0 -101
  283. package/demos/pc/webdoc/mcp.md +0 -101
  284. package/src/components/mcp-docs.vue +0 -33
  285. package/src/composable/useTinyRemoter.ts +0 -176
@@ -18,6 +18,7 @@ const noSaasComponents = [
18
18
  'BaseSelect',
19
19
  'FluentEditor',
20
20
  'TreeSelect',
21
+ 'TreeMenu',
21
22
  'GridSelect',
22
23
  'TimeSelect',
23
24
  'Milestone',
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@opentiny/vue-docs",
3
3
  "type": "module",
4
- "version": "3.28.1",
4
+ "version": "3.30.0",
5
5
  "license": "MIT",
6
6
  "dependencies": {
7
7
  "@docsearch/css": "^3.8.0",
8
8
  "@docsearch/js": "^3.8.0",
9
9
  "@docsearch/react": "npm:@docsearch/css",
10
- "@opentiny/tiny-vue-mcp": "^0.0.5",
11
10
  "@opentiny/vue-repl": "^1.1.2",
11
+ "@opentiny/vue-search-box": "~3.28.4",
12
+ "@opentiny/vue-search-box-saas": "~3.28.4",
12
13
  "@opentiny/vue-vite-import": "~1.2.0",
13
14
  "@unocss/reset": "0.38.2",
14
15
  "@vue/repl": "^2.5.5",
@@ -27,24 +28,24 @@
27
28
  "vue-i18n": "~9.14.3",
28
29
  "vue-router": "4.1.5",
29
30
  "zod": "^3.24.4",
30
- "@opentiny/utils": "~3.28.0",
31
- "@opentiny/vue": "~3.28.0",
32
- "@opentiny/vue-common": "~3.28.0",
33
- "@opentiny/vue-design-aurora": "~3.28.0",
34
- "@opentiny/vue-design-saas": "~3.28.0",
35
- "@opentiny/vue-design-smb": "~3.28.0",
36
- "@opentiny/vue-directive": "~3.28.0",
37
- "@opentiny/vue-flowchart": "~3.28.0",
38
- "@opentiny/vue-icon": "~3.28.0",
39
- "@opentiny/vue-hooks": "~3.28.0",
40
- "@opentiny/vue-huicharts": "~3.28.0",
41
- "@opentiny/vue-icon-multicolor": "~3.28.0",
42
- "@opentiny/vue-icon-saas": "~3.28.0",
43
- "@opentiny/vue-locale": "~3.28.0",
44
- "@opentiny/vue-modal": "~3.28.0",
45
- "@opentiny/vue-renderless": "~3.28.0",
46
- "@opentiny/vue-theme-saas": "~3.28.0",
47
- "@opentiny/vue-theme": "~3.28.0"
31
+ "@opentiny/utils": "~3.30.0",
32
+ "@opentiny/vue": "~3.30.0",
33
+ "@opentiny/vue-common": "~3.30.0",
34
+ "@opentiny/vue-design-aurora": "~3.30.0",
35
+ "@opentiny/vue-design-saas": "~3.30.0",
36
+ "@opentiny/vue-design-smb": "~3.30.0",
37
+ "@opentiny/vue-directive": "~3.30.0",
38
+ "@opentiny/vue-flowchart": "~3.30.0",
39
+ "@opentiny/vue-hooks": "~3.30.0",
40
+ "@opentiny/vue-huicharts": "~3.30.0",
41
+ "@opentiny/vue-icon": "~3.30.0",
42
+ "@opentiny/vue-icon-multicolor": "~3.30.0",
43
+ "@opentiny/vue-icon-saas": "~3.30.0",
44
+ "@opentiny/vue-modal": "~3.30.0",
45
+ "@opentiny/vue-locale": "~3.30.0",
46
+ "@opentiny/vue-renderless": "~3.30.0",
47
+ "@opentiny/vue-theme-saas": "~3.30.0",
48
+ "@opentiny/vue-theme": "~3.30.0"
48
49
  },
49
50
  "devDependencies": {
50
51
  "@playwright/test": "~1.49.0",
@@ -15,7 +15,7 @@ import Layout from './icons/Layout.vue'
15
15
  import Reverse from './icons/Reverse.vue'
16
16
  import Vertical from './icons/Vertical.vue'
17
17
 
18
- const VERSION = 'tiny-vue-version-3.28'
18
+ const VERSION = 'tiny-vue-version-3.30'
19
19
  const NOTIFY_KEY = 'tiny-vue-playground-notify'
20
20
  const LAYOUT = 'playground-layout'
21
21
  const LAYOUT_REVERSE = 'playground-layout-reverse'
@@ -26,7 +26,7 @@ const tinyTheme = searchObj.get('theme')
26
26
  const isMobileFirst = tinyMode === 'mobile-first'
27
27
  const isSaas = tinyTheme === 'saas'
28
28
  const isPreview = searchObj.get('openMode') === 'preview'
29
- const versions = ['3.28', '3.27', '3.26']
29
+ const versions = ['3.30', '3.29', '3.28']
30
30
  const manualShow = ref(false)
31
31
 
32
32
  const getVersion = () => {
@@ -90,8 +90,9 @@ const createImportMap = (version) => {
90
90
  'sortablejs': `${cdnHost}/sortablejs${versionDelimiter}1.15.0/${fileDelimiter}modular/sortable.esm.js`
91
91
  }
92
92
  if (['aurora', 'saas', 'smb'].includes(tinyTheme)) {
93
- imports[`@opentiny/vue-design-${tinyTheme}`] =
94
- `${cdnHost}/@opentiny/vue-design-${tinyTheme}${versionDelimiter}${version}/${fileDelimiter}index.js`
93
+ imports[
94
+ `@opentiny/vue-design-${tinyTheme}`
95
+ ] = `${cdnHost}/@opentiny/vue-design-${tinyTheme}${versionDelimiter}${version}/${fileDelimiter}index.js`
95
96
  }
96
97
  if (isSaas) {
97
98
  imports['@opentiny/vue-icon'] = `${getRuntime(version)}tiny-vue-icon-saas.mjs`
@@ -100,6 +101,7 @@ const createImportMap = (version) => {
100
101
  imports['@opentiny/vue-common'] = `${getRuntime(version)}tiny-vue-saas-common.mjs`
101
102
  imports['@opentiny/vue'] = `${getRuntime(version)}tiny-vue-all.mjs`
102
103
  }
104
+ imports['@opentiny/vue-search-box'] = '/playground/shims/vue-search-box.mjs'
103
105
  return { imports }
104
106
  }
105
107
 
@@ -0,0 +1,154 @@
1
+ // 演练场用的 @opentiny/vue-search-box 和 @opentiny/vue-search-box-saas 统一 shim
2
+ // 作用:从 CDN 拉取 JS,移除其中的 CSS import,并手动注入 CSS,避免浏览器将 CSS 当作模块加载导致 MIME 错误
3
+
4
+ // 通过检查 URL 参数来判断是哪个包
5
+ // 由于两个包在 import map 中都映射到同一个文件,我们通过 URL 参数 theme=saas 来判断
6
+ let isSaas = false
7
+ let packageName = '@opentiny/vue-search-box'
8
+ let cssId = 'tiny-search-box-css'
9
+
10
+ // 通过 URL 参数判断是否为 saas 模式
11
+ if (typeof location !== 'undefined') {
12
+ try {
13
+ const searchParams = new URLSearchParams(window.parent.location.search)
14
+ const theme = searchParams.get('theme')
15
+ if (theme === 'saas') {
16
+ isSaas = true
17
+ packageName = '@opentiny/vue-search-box-saas'
18
+ cssId = 'tiny-search-box-saas-css'
19
+ }
20
+ } catch (e) {
21
+ // 忽略错误,使用默认值
22
+ }
23
+ }
24
+
25
+ // 从 localStorage 获取 CDN 和版本,若未配置则使用默认
26
+ const cdnHost =
27
+ typeof localStorage !== 'undefined'
28
+ ? localStorage.getItem('setting-cdn') || 'https://registry.npmmirror.com'
29
+ : 'https://registry.npmmirror.com'
30
+
31
+
32
+ const version = '3.28.4'
33
+ const versionDelimiter = cdnHost.includes('npmmirror') ? '/' : '@'
34
+ const fileDelimiter = cdnHost.includes('npmmirror') ? 'files/' : ''
35
+
36
+ // 构造 CDN 资源地址
37
+ const cdnUrl = `${cdnHost}/${packageName}${versionDelimiter}${version}/${fileDelimiter}index.js`
38
+ const cssUrl = `${cdnHost}/${packageName}${versionDelimiter}${version}/${fileDelimiter}index.css`
39
+
40
+ // 以 <link> 方式手动注入 CSS
41
+ function injectCSS() {
42
+ const doc = typeof document !== 'undefined' ? document : null
43
+ if (!doc) return
44
+
45
+ // 检查是否已经注入过
46
+ const existingLink = doc.querySelector(`link#${cssId}`)
47
+ if (existingLink) {
48
+ return
49
+ }
50
+
51
+ const link = doc.createElement('link')
52
+ link.rel = 'stylesheet'
53
+ link.href = cssUrl
54
+ link.id = cssId
55
+
56
+ // 确保 CSS 加载完成
57
+ if (isSaas) {
58
+ link.onload = () => {
59
+ console.log('Search-box CSS loaded successfully')
60
+ }
61
+ }
62
+ link.onerror = () => {
63
+ console.error(`Failed to load ${packageName} CSS:`, cssUrl)
64
+ }
65
+
66
+ if (doc.head) {
67
+ doc.head.appendChild(link)
68
+ } else {
69
+ // 如果 head 不存在,等待它创建
70
+ const observer = new MutationObserver((mutations, obs) => {
71
+ if (doc.head) {
72
+ doc.head.appendChild(link)
73
+ obs.disconnect()
74
+ }
75
+ })
76
+ observer.observe(doc.documentElement, { childList: true })
77
+ }
78
+ }
79
+
80
+ // 立即注入 CSS(在 iframe 环境下运行)
81
+ // 确保 CSS 被正确导入,即使 document 还未准备好也会在后续注入
82
+ if (typeof document !== 'undefined') {
83
+ // 如果 document 已经准备好,立即注入
84
+ if (document.readyState === 'loading') {
85
+ // 如果还在加载中,等待 DOMContentLoaded
86
+ document.addEventListener('DOMContentLoaded', injectCSS)
87
+ } else {
88
+ // 如果已经加载完成,立即注入
89
+ injectCSS()
90
+ }
91
+ } else {
92
+ // 如果 document 还未准备好,等待 DOMContentLoaded 后再注入
93
+ if (typeof window !== 'undefined' && window.addEventListener) {
94
+ window.addEventListener('DOMContentLoaded', injectCSS)
95
+ }
96
+ }
97
+
98
+ // 拉取并处理 JS 模块
99
+ async function loadModule() {
100
+ try {
101
+ // Fetch the JS file
102
+ const response = await fetch(cdnUrl)
103
+ if (!response.ok) {
104
+ throw new Error(`Failed to fetch: ${response.statusText}`)
105
+ }
106
+
107
+ let jsCode = await response.text()
108
+
109
+ // 去掉 JS 中的 CSS import,避免 MIME 错误
110
+ jsCode = jsCode.replace(/import\s+['"]\.\/index\.css['"];?\s*/g, '')
111
+ jsCode = jsCode.replace(/import\s+['"]\.\/index\.css['"]\s*/g, '')
112
+
113
+ const blob = new Blob([jsCode], { type: 'application/javascript' })
114
+ const moduleUrl = URL.createObjectURL(blob)
115
+
116
+ try {
117
+ const module = await import(moduleUrl)
118
+ URL.revokeObjectURL(moduleUrl)
119
+ return module
120
+ } catch (importError) {
121
+ URL.revokeObjectURL(moduleUrl)
122
+ throw importError
123
+ }
124
+ } catch (error) {
125
+ console.error(`Failed to load ${packageName}:`, error)
126
+ throw error
127
+ }
128
+ }
129
+
130
+ // 加载模块
131
+ const TinySearchBoxModule = await loadModule()
132
+
133
+ // 模块加载完成后,再次确保 CSS 已注入(防止之前注入失败)
134
+ if (typeof document !== 'undefined') {
135
+ // 延迟一点时间确保 DOM 已准备好
136
+ setTimeout(() => {
137
+ injectCSS()
138
+ }, 100)
139
+ }
140
+
141
+ // 提取默认组件并重新导出其他组件
142
+ const {
143
+ default: TinySearchBox,
144
+ TinySearchBoxFirstLevelPanel,
145
+ TinySearchBoxSecondLevelPanel,
146
+ enUS,
147
+ setGlobalApp,
148
+ t,
149
+ zhCN
150
+ } = TinySearchBoxModule
151
+
152
+ export { TinySearchBoxFirstLevelPanel, TinySearchBoxSecondLevelPanel, enUS, setGlobalApp, t, zhCN }
153
+
154
+ export { TinySearchBox as default }
@@ -0,0 +1 @@
1
+ @import "@opentiny/vue-theme/dark-theme-index.css";
package/src/i18n/index.js CHANGED
@@ -5,9 +5,8 @@ import zh from './zh.json'
5
5
  import en from './en.json'
6
6
  import esLA from './es.json'
7
7
  import ptBR from './pt.json'
8
- import { zhCN, enUS } from '@opentiny/tiny-vue-mcp'
9
8
 
10
- const messages = { enUS: { ...en, ...enUS }, zhCN: { ...zh, ...zhCN }, esLA: { ...esLA }, ptBR: { ...ptBR } }
9
+ const messages = { enUS: { ...en }, zhCN: { ...zh }, esLA: { ...esLA }, ptBR: { ...ptBR } }
11
10
 
12
11
  const langMap = new Map([
13
12
  ['zhCN', 'zhCN'],
package/src/main.js CHANGED
@@ -33,11 +33,16 @@ import '@docsearch/css'
33
33
  import { doSearchEverySite } from './tools/docsearch'
34
34
  import { getLocaleMode } from './tools/utils.js'
35
35
  import '@opentiny/vue-theme/dark-theme-index.css'
36
- import { createMcpTools, getTinyVueMcpConfig } from '@opentiny/tiny-vue-mcp'
37
- import { t } from '@opentiny/vue-locale'
38
- import { registerMcpConfig, customDesignConfig } from '@opentiny/vue-common'
36
+
37
+ import { customDesignConfig } from '@opentiny/vue-common'
39
38
  import { twMerge } from 'tailwind-merge'
40
39
 
40
+ // 检测 navigator.webdriver(自动化标记),如果为 true 则说明当前环境是被自动化测试工具(如 Playwright)控制的
41
+ const isOpenPlaywright = navigator.webdriver
42
+
43
+ if (!isOpenPlaywright) {
44
+ import('@opentiny/vue-theme/responsive-index.css')
45
+ }
41
46
  // 适配层集成twMerge能力
42
47
  if (isSaas) {
43
48
  customDesignConfig.twMerge = twMerge
@@ -94,8 +99,6 @@ app.config.globalProperties.tiny_theme = { value: import.meta.env.VITE_TINY_THEM
94
99
  if (isSaas) {
95
100
  import('./tailwind.css')
96
101
  }
97
- // 注册TinyVue组件mcp配置
98
- registerMcpConfig(getTinyVueMcpConfig({ t }), createMcpTools)
99
102
 
100
103
  app.use(router).use(i18n).use(createHead()) // 支持md修改title
101
104
 
package/src/style.css CHANGED
@@ -114,3 +114,8 @@ html.dark {
114
114
  padding: 0 11px;
115
115
  }
116
116
  }
117
+
118
+ /* TinyVue暂时隐藏opentiny.design的公共头部 */
119
+ #header > .opentiny-design-header .nav-center {
120
+ display: none !important;
121
+ }
@@ -74,9 +74,6 @@
74
74
  <!-- 主题变量 -->
75
75
  <design-token :name="state.cmpId" :tokenList="state.tokenList" />
76
76
  </tiny-tab-item>
77
- <tiny-tab-item v-if="mcpInfo.length > 0" title="MCP" name="MCP">
78
- <McpDocs :data="mcpInfo" :name="capName" />
79
- </tiny-tab-item>
80
77
  </tiny-tabs>
81
78
 
82
79
  <slot name="main-right" />
@@ -119,12 +116,9 @@ import ComponentHeader from '../../components/header.vue'
119
116
  import ComponentContributor from '../../components/contributor.vue'
120
117
  import ApiDocs from '../../components/api-docs.vue'
121
118
  import DesignToken from '../../components/design-token.vue'
122
- import McpDocs from '../../components/mcp-docs.vue'
123
119
  import useTasksFinish from '../../composable/useTasksFinish'
124
120
  import list from '@opentiny/vue-theme/token'
125
121
  import { isSaas } from '../../const'
126
- import { getTinyVueMcpConfig } from '@opentiny/tiny-vue-mcp'
127
- import { camelize, capitalize } from '@vue/shared'
128
122
 
129
123
  const props = defineProps({ loadData: {}, appMode: {}, demoKey: {} })
130
124
 
@@ -476,25 +470,6 @@ const handleAnchorClick = (e, data) => {
476
470
  }
477
471
  }
478
472
 
479
- // MCP tab页签的数据
480
- const mcpTools = getTinyVueMcpConfig({ t: null })
481
- const capName = computed(() => capitalize(camelize(state.cmpId || '')))
482
-
483
- const mcpInfo = computed(() => {
484
- const schema = mcpTools.components[capName.value]?.paramsSchema
485
- if (schema) {
486
- return Object.keys(schema).map((name) => {
487
- const item = schema[name]
488
- return {
489
- name,
490
- param: item._def?.innerType?._def?.typeName || '',
491
- desc: item._def?.description || ''
492
- }
493
- })
494
- }
495
- return []
496
- })
497
-
498
473
  defineExpose({ loadPage })
499
474
  </script>
500
475
 
@@ -11,7 +11,7 @@
11
11
  <!-- 移动端展示内容 -->
12
12
  <div class="phone-container">
13
13
  <div class="mobile-iframe-container">
14
- <iframe ref="iframeRef" width="100%" height="100%" :src="iframeUrl" frameborder="0"></iframe>
14
+ <iframe id="iframeDom" ref="iframeRef" width="100%" height="100%" :src="iframeUrl" frameborder="0"></iframe>
15
15
  </div>
16
16
  </div>
17
17
  </div>
@@ -20,7 +20,7 @@
20
20
  </template>
21
21
 
22
22
  <script setup>
23
- import { ref } from 'vue'
23
+ import { ref, onBeforeUnmount } from 'vue'
24
24
  import { router } from '@/router.js'
25
25
  import { fetchDemosFile } from '@/tools'
26
26
  import ComponentDocs from './common.vue'
@@ -60,6 +60,53 @@ const pageInit = (demo) => {
60
60
  const { cmpId } = router.currentRoute.value.params
61
61
  iframeUrl.value = `${mobilePreview}?component=${cmpId}&demo=${demo.codeFiles[0]}`
62
62
  }
63
+
64
+ let observer = new MutationObserver(() => {
65
+ const isDarkMode = document.documentElement.classList.contains('dark')
66
+ if (isDarkMode) {
67
+ onIframeLoad()
68
+ } else {
69
+ try {
70
+ const iframeDocument = iframeRef.value.contentDocument || iframeRef.value.contentWindow.document
71
+ iframeDocument.documentElement.classList.remove('dark')
72
+ const linkElement = iframeDocument.getElementById('theme-style-link')
73
+ if (linkElement) {
74
+ linkElement.remove()
75
+ }
76
+ } catch (error) {
77
+ console.error('无法访问 iframe:', error)
78
+ }
79
+ }
80
+ })
81
+
82
+ observer.observe(document.documentElement, {
83
+ attributes: true,
84
+ attributeFilter: ['class']
85
+ })
86
+
87
+ const onIframeLoad = () => {
88
+ try {
89
+ const iframeDocument = iframeRef.value.contentDocument || iframeRef.value.contentWindow.document
90
+ const htmlElement = iframeDocument.documentElement
91
+
92
+ // 添加 dark 类
93
+ htmlElement.classList.add('dark')
94
+
95
+ const link = iframeDocument.createElement('link')
96
+ link.rel = 'stylesheet'
97
+ link.href = '/public/static/css/mobile-dark-theme.css'
98
+ link.id = 'theme-style-link'
99
+
100
+ iframeDocument.head.appendChild(link)
101
+ } catch (error) {
102
+ console.error('无法访问 iframe:', error)
103
+ }
104
+ }
105
+
106
+ onBeforeUnmount(() => {
107
+ observer?.disconnect()
108
+ observer = null
109
+ })
63
110
  </script>
64
111
 
65
112
  <style scoped lang="less">
package/vite.config.ts CHANGED
@@ -13,7 +13,7 @@ import vue3SvgPlugin from 'vite-svg-loader'
13
13
  import { getAlias, pathFromWorkspaceRoot, getOptimizeDeps } from '../../internals/cli/src/config/vite'
14
14
  import virtualTemplatePlugin from '@opentiny-internal/unplugin-virtual-template/vite'
15
15
  import { visualizer } from 'rollup-plugin-visualizer'
16
- import { delStaticPlugin, viteDocsearchPlugin, modifyViteConfig } from './vite.extend.ts'
16
+ import { delStaticPlugin, viteDocsearchPlugin, modifyViteConfig, fixIconSrcPlugins } from './vite.extend.ts'
17
17
 
18
18
  export default defineConfig((config) => {
19
19
  const env = loadEnv(config.mode, process.cwd() + '/env', '')
@@ -35,6 +35,7 @@ export default defineConfig((config) => {
35
35
  envDir: './env',
36
36
  base: env.VITE_APP_BUILD_BASE_URL || '/tiny-vue/',
37
37
  plugins: [
38
+ ...fixIconSrcPlugins(),
38
39
  virtualTemplatePlugin({ include: ['**/packages/vue/**/src/index.ts'], env }),
39
40
  vue({
40
41
  include: [/\.vue$/, /\.md$/]
@@ -131,7 +132,7 @@ export default defineConfig((config) => {
131
132
  viteConfig.define['process.env'] = {}
132
133
  }
133
134
 
134
- const newViteConfig = modifyViteConfig(viteConfig, env, { plugins: { viteStaticCopy } })
135
+ const newViteConfig = modifyViteConfig(viteConfig, env)
135
136
 
136
137
  newViteConfig.plugins.push(
137
138
  viteStaticCopy({
package/vite.extend.ts CHANGED
@@ -46,6 +46,70 @@ export const viteDocsearchPlugin = (env) => {
46
46
  }
47
47
  }
48
48
 
49
+ // 修复 @opentiny/vue-icon 和 @opentiny/vue-icon-saas 的解析问题
50
+ // 确保图标包指向 index.ts 而不是 src 目录
51
+ // 根据 package.json 的 exports 配置,"./*": "./src/*" 会将某些导入解析为目录
52
+ // 这个插件拦截该导入并重定向到 index.ts
53
+ const createFixIconSrcPlugin = (packageName, packagePath, pluginName) => {
54
+ const currentFileUrl = import.meta.url
55
+ const currentDir = path.dirname(new URL(currentFileUrl).pathname)
56
+ const normalizedDir = process.platform === 'win32' ? currentDir.replace(/^\//, '') : currentDir
57
+ const workspaceRoot = path.resolve(normalizedDir, '../..')
58
+ const iconSrcPath = path.resolve(workspaceRoot, packagePath, 'src')
59
+ const iconIndexPath = path.resolve(workspaceRoot, packagePath, 'index.ts')
60
+
61
+ return {
62
+ name: pluginName,
63
+ enforce: 'pre',
64
+ resolveId(id) {
65
+ // 拦截对包名的导入(不带子路径),确保指向 index.ts
66
+ if (id === packageName) {
67
+ return iconIndexPath
68
+ }
69
+ // 拦截对 @opentiny/vue-icon-saas/src 的导入(模块路径)
70
+ if (id === `${packageName}/src`) {
71
+ return iconIndexPath
72
+ }
73
+ // 拦截文件系统路径中的图标包/src 目录访问
74
+ const normalizedId = id.replace(/\\/g, '/')
75
+ const normalizedSrcPath = iconSrcPath.replace(/\\/g, '/')
76
+ if (normalizedId === normalizedSrcPath) {
77
+ return iconIndexPath
78
+ }
79
+ return null
80
+ },
81
+ load(id) {
82
+ // 如果请求的是图标包/src 目录,返回 index.ts 的内容
83
+ const normalizedId = id.replace(/\\/g, '/')
84
+ const normalizedSrcPath = iconSrcPath.replace(/\\/g, '/')
85
+ if (normalizedId === normalizedSrcPath) {
86
+ if (fs.existsSync(iconIndexPath)) {
87
+ return fs.readFileSync(iconIndexPath, 'utf-8')
88
+ }
89
+ }
90
+ return null
91
+ }
92
+ }
93
+ }
94
+
95
+ // 修复 @opentiny/vue-icon 和 @opentiny/vue-icon-saas 的解析问题
96
+ // 返回包含两个插件的数组,方便在 vite.config.ts 中使用
97
+ export const fixIconSrcPlugins = () => {
98
+ return [
99
+ createFixIconSrcPlugin('@opentiny/vue-icon', 'packages/vue-icon', 'fix-icon-src-plugin'),
100
+ createFixIconSrcPlugin('@opentiny/vue-icon-saas', 'packages/vue-icon-saas', 'fix-icon-saas-src-plugin')
101
+ ]
102
+ }
103
+
104
+ // 保持向后兼容,单独导出(如果需要单独使用)
105
+ export const fixIconSrcPlugin = () => {
106
+ return createFixIconSrcPlugin('@opentiny/vue-icon', 'packages/vue-icon', 'fix-icon-src-plugin')
107
+ }
108
+
109
+ export const fixIconSaasSrcPlugin = () => {
110
+ return createFixIconSrcPlugin('@opentiny/vue-icon-saas', 'packages/vue-icon-saas', 'fix-icon-saas-src-plugin')
111
+ }
112
+
49
113
  // 针对不同主题对配置进行响应修改
50
114
  const themeModifyMap = {
51
115
  saas(viteConfig) {
@@ -66,6 +130,7 @@ const themeModifyMap = {
66
130
  if (!viteConfig.resolve.alias['@opentiny/vue-theme']) {
67
131
  viteConfig.resolve.alias['@opentiny/vue-theme'] = '@opentiny/vue-theme-saas'
68
132
  viteConfig.resolve.alias['@opentiny/vue-icon'] = '@opentiny/vue-icon-saas'
133
+ viteConfig.resolve.alias['@opentiny/vue-search-box'] = '@opentiny/vue-search-box-saas'
69
134
  }
70
135
  return viteConfig
71
136
  }
@@ -1,23 +0,0 @@
1
- export default {
2
- column: '1',
3
- owner: '',
4
- demos: [
5
- {
6
- demoId: 'grid-ai-agent',
7
- name: { 'zh-CN': '表格智能体', 'en-US': 'grid agent' },
8
- desc: {
9
- 'zh-CN': `表格智能体是表格组件面向 AI 领域的应用,提供了一个基于表格数据的智能体交互界面。用户可以通过自然语言与表格进行交互,智能体会根据表格内容和用户输入执行操作。<br>
10
- 目前表格智能体支持的操作包括:<br>
11
- - 查询表格数据:用户可以输入自然语言查询表格中的数据,智能体会解析查询并返回结果,以及根据结果执行后续的操作。<br>
12
- - 滚动到指定行:用户可以通过自然语言指令,将表格滚动到指定位置。<br>
13
- - 选中表格数据:用户可以通过自然语言指令,选中表格数据。<br>
14
- - 选中全部数据:用户可以通过自然语言指令,选中全部数据。<br>
15
-
16
- 通过属性 <code>tiny_mcp_config</code> 可以配置表格的业务意义以及传入<code>server</code>对象,详见示例。`,
17
- 'en-US': ``
18
- },
19
- codeFiles: ['ai-agent/basic-usage.vue']
20
- }
21
- ],
22
- apis: [{ name: 'grid-ai-agent', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
23
- }
@@ -1,101 +0,0 @@
1
- # TinyVue Intelligent Component Access Guide
2
-
3
- TinyVue's intelligent components provide a complete intelligent solution, allowing your application to have AI conversation, voice interaction, and other capabilities. This guide will walk you through how to integrate TinyVue's intelligent components into your project.
4
-
5
- ## Install dependencies
6
-
7
- First, you need to install the following core dependency packages:
8
-
9
- ```bash
10
- npm install @opentiny/tiny-vue-mcp @opentiny/next-vue @opentiny/vue-common @opentiny/vue
11
- ```
12
-
13
- ## Access steps
14
-
15
- ### 1. Initialize MCP Configuration
16
-
17
- Initialize MCP configuration in the application entry file (e.g., `main.js`):
18
-
19
- ```js
20
- import { registerMcpConfig } from '@opentiny/vue-common'
21
- import { createMcpTools, getTinyVueMcpConfig } from '@opentiny/tiny-vue-mcp'
22
-
23
- // Register TinyVue component MCP configuration
24
- registerMcpConfig(getTinyVueMcpConfig(), createMcpTools)
25
- ```
26
-
27
- ### 2. Create NextClient Proxy Client
28
-
29
- Create a NextClient proxy client in `App.vue` to establish real-time communication:
30
-
31
- ```html
32
- <script setup lang="ts">
33
- import { useNextClient } from '@opentiny/next-vue'
34
-
35
- const { sessionId } = useNextClient({
36
- clientInfo: {
37
- name: 'your-app-name', // Application name
38
- version: '1.0.0', // Application version
39
- sessionId: 'your-session-id' // Optional, will be passed in by the backend if not provided; for debugging, you can use crypto.randomUUID() to generate a fixed one
40
- },
41
- proxyOptions: {
42
- url: 'your-sse-url', // SSE service address
43
- token: 'your-token' // Authentication token
44
- }
45
- })
46
- </script>
47
-
48
- <template>
49
- <div>
50
- <h1>NextClient Proxy Client</h1>
51
- <p>Session ID: {{ sessionId }}</p>
52
- </div>
53
- </template>
54
- ```
55
-
56
- ### 3. MCP Component Configuration
57
-
58
- When using
59
-
60
- ```html
61
- <script setup lang="ts">
62
- import { useNextServer } from '@opentiny/next-vue'
63
-
64
- const { server } = useNextServer({
65
- serverInfo: { name: 'your-server-name', version: '1.0.0' }
66
- })
67
- </script>
68
-
69
- <template>
70
- <tiny-grid
71
- :tiny_mcp_config="{
72
- server,
73
- business: {
74
- id: 'your-business-id',
75
- description: 'Business description'
76
- }
77
- }"
78
- >
79
- <!-- Table content -->
80
- </tiny-grid>
81
- </template>
82
- ```
83
-
84
- ## Notes
85
-
86
- 1. Ensure that the server supports SSE (Server-Sent Events) connections
87
- 2. It is recommended to use HTTPS in production environments
88
- 3. CORS needs to be correctly configured to support cross-origin requests
89
-
90
- ## Common issues
91
-
92
- 1. Session connection failed
93
-
94
- - Check if the SSE service address is correct
95
- - Confirm that the network connection is normal
96
- - Verify that the authentication information is valid
97
-
98
- 2. AI conversation response is not available
99
- - Check if the session is established normally
100
- - Confirm that the prompt item configuration is correct
101
- - Check if there are errors in the network request