@opentiny/genui-sdk-vue 1.3.0-alpha.1 → 1.3.0-alpha.4
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 +10 -2
- package/dist/ConfigProvider-BzxW9L3f.js +95 -0
- package/dist/ConfigProvider-BzxW9L3f.js.map +1 -0
- package/dist/GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-KMItLlt0.js +49 -0
- package/dist/GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-KMItLlt0.js.map +1 -0
- package/dist/GenuiRenderer-Bo_1qj4M.js +15164 -0
- package/dist/GenuiRenderer-Bo_1qj4M.js.map +1 -0
- package/dist/GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-Bx2pUmHZ.js +39 -0
- package/dist/GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-Bx2pUmHZ.js.map +1 -0
- package/dist/___vite-browser-external_commonjs-proxy-4gYZYw55.js +1 -0
- package/dist/___vite-browser-external_commonjs-proxy-4gYZYw55.js.map +1 -0
- package/dist/chat.d.ts +82 -2410
- package/dist/chat.js +18 -19
- package/dist/chat.js.map +1 -0
- package/dist/chat.types-BDffahIK.js +1792 -0
- package/dist/chat.types-BDffahIK.js.map +1 -0
- package/dist/config-provider.d.ts +9 -0
- package/dist/config-provider.js +6 -1
- package/dist/config-provider.js.map +1 -0
- package/dist/index.d.ts +870 -2438
- package/dist/index.js +32 -26
- package/dist/index.js.map +1 -0
- package/dist/{injection-tokens-D8CFCpjy.js → injection-tokens-CuDQs1ne.js} +49 -49
- package/dist/injection-tokens-CuDQs1ne.js.map +1 -0
- package/dist/legacy-chat.d.ts +1149 -0
- package/dist/legacy-chat.js +23 -0
- package/dist/legacy-chat.js.map +1 -0
- package/dist/legacy-renderer.d.ts +59 -0
- package/dist/legacy-renderer.js +7 -0
- package/dist/legacy-renderer.js.map +1 -0
- package/dist/renderer.d.ts +9 -2032
- package/dist/renderer.js +2 -1
- package/dist/renderer.js.map +1 -0
- package/dist/transform-jsx.d.ts +3 -1
- package/dist/transform-jsx.js +2348 -2369
- package/dist/transform-jsx.js.map +1 -0
- package/package.json +30 -33
- package/dist/ConfigProvider-BaJsiFgd.js +0 -86
- package/dist/SchemaCardRenderer-DzR7P9dr.js +0 -13429
- package/dist/chat.types-B-ImpWnq.js +0 -1753
package/README.md
CHANGED
|
@@ -11,13 +11,20 @@ A Vue 3 component library for enhanced LLM display and interaction. Stream AI-ge
|
|
|
11
11
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
|
+
Install together with core and the Vue materials package (the renderer is bundled in the vue package):
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm add @opentiny/genui-sdk-vue @opentiny/genui-sdk-core @opentiny/genui-sdk-materials-vue-opentiny-vue
|
|
18
|
+
```
|
|
19
|
+
|
|
14
20
|
```vue
|
|
15
21
|
<script setup>
|
|
16
22
|
import { GenuiChat, GenuiConfigProvider } from '@opentiny/genui-sdk-vue';
|
|
23
|
+
import { materials } from '@opentiny/genui-sdk-materials-vue-opentiny-vue/materials';
|
|
17
24
|
</script>
|
|
18
25
|
|
|
19
26
|
<template>
|
|
20
|
-
<GenuiConfigProvider theme="dark">
|
|
27
|
+
<GenuiConfigProvider theme="dark" :materials="materials">
|
|
21
28
|
<GenuiChat
|
|
22
29
|
url="/api/chat"
|
|
23
30
|
model="deepseek-chat"
|
|
@@ -25,6 +32,7 @@ import { GenuiChat, GenuiConfigProvider } from '@opentiny/genui-sdk-vue';
|
|
|
25
32
|
</GenuiConfigProvider>
|
|
26
33
|
</template>
|
|
27
34
|
```
|
|
35
|
+
|
|
28
36
|
## Documentation
|
|
29
37
|
|
|
30
38
|
* [quick-start](https://docs.opentiny.design/genui-sdk/guide/quick-start)
|
|
@@ -34,4 +42,4 @@ import { GenuiChat, GenuiConfigProvider } from '@opentiny/genui-sdk-vue';
|
|
|
34
42
|
|
|
35
43
|
* [GenuiRender](https://docs.opentiny.design/genui-sdk/components/renderer)
|
|
36
44
|
* [GenuiChat](https://docs.opentiny.design/genui-sdk/components/chat)
|
|
37
|
-
* [GenuiConfigProvider](https://docs.opentiny.design/genui-sdk/components/config-provider)
|
|
45
|
+
* [GenuiConfigProvider](https://docs.opentiny.design/genui-sdk/components/config-provider)
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".tg-config-provider[data-v-da2763bd]{--tr-sender-bg-color: var(--tr-container-bg-default);--tr-sender-text-color: var(--tr-text-primary);--tr-sender-action-buttons-icon-color: var(--tr-text-secondary);--tr-sender-action-buttons-send-bg-color: var(--tr-color-primary);height:100%}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
import { ref as v, readonly as y, defineComponent as P, provide as n, computed as s, watch as d, onMounted as I, createBlock as N, openBlock as E, unref as f, withCtx as p, createVNode as G, normalizeProps as b, guardReactiveProps as A, renderSlot as L } from "vue";
|
|
3
|
+
import { TinyConfigProvider as R } from "@opentiny/vue";
|
|
4
|
+
import { ThemeProvider as $ } from "@opentiny/tiny-robot";
|
|
5
|
+
import x, { tinyOldTheme as O, tinyDarkTheme as U } from "@opentiny/vue-theme/theme-tool";
|
|
6
|
+
import { G as z, u as B, a as Q, b as S, _ as j } from "./injection-tokens-CuDQs1ne.js";
|
|
7
|
+
const g = () => typeof window < "u" && window.matchMedia, T = () => g() && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", _ = v(T());
|
|
8
|
+
let c = null;
|
|
9
|
+
const D = () => {
|
|
10
|
+
_.value = T();
|
|
11
|
+
}, F = () => {
|
|
12
|
+
g() && !c && (c = window.matchMedia("(prefers-color-scheme: dark)"), c.addEventListener("change", D));
|
|
13
|
+
}, V = () => (F(), {
|
|
14
|
+
theme: y(_)
|
|
15
|
+
}), W = /* @__PURE__ */ P({
|
|
16
|
+
__name: "ConfigProvider",
|
|
17
|
+
props: {
|
|
18
|
+
theme: {},
|
|
19
|
+
id: { default: "tiny-genui-config-provider" },
|
|
20
|
+
locale: { default: "zh_CN" },
|
|
21
|
+
i18n: {},
|
|
22
|
+
materials: {}
|
|
23
|
+
},
|
|
24
|
+
setup(M) {
|
|
25
|
+
const e = M, a = B();
|
|
26
|
+
n(z, a);
|
|
27
|
+
const l = (t) => {
|
|
28
|
+
const r = structuredClone(t);
|
|
29
|
+
return r.css = r.css.replaceAll(":host", `#${e.id}`).replaceAll(":root", `#${e.id}`), r;
|
|
30
|
+
}, m = {
|
|
31
|
+
dark: l(U),
|
|
32
|
+
lite: l(O),
|
|
33
|
+
light: { css: " " }
|
|
34
|
+
}, w = new x(), { theme: C } = V(), i = s(() => e.theme === "auto" ? C.value : e.theme), o = s(() => ({
|
|
35
|
+
theme: i.value,
|
|
36
|
+
id: e.id
|
|
37
|
+
}));
|
|
38
|
+
n(Q, o);
|
|
39
|
+
const u = {};
|
|
40
|
+
d(() => e.materials, (t) => {
|
|
41
|
+
Object.assign(u, t);
|
|
42
|
+
}, { immediate: !0 }), n(
|
|
43
|
+
S,
|
|
44
|
+
u
|
|
45
|
+
), d(
|
|
46
|
+
() => [e.locale, e.i18n],
|
|
47
|
+
() => {
|
|
48
|
+
e.locale && e.locale !== a.locale.value && a.setLocale(e.locale), e.i18n && a.mergeMessages(e.i18n);
|
|
49
|
+
},
|
|
50
|
+
{ immediate: !0 }
|
|
51
|
+
), d(
|
|
52
|
+
() => i.value,
|
|
53
|
+
(t) => {
|
|
54
|
+
const r = m[t] || m.light;
|
|
55
|
+
w.changeTheme(r);
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
immediate: !0
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
const h = v();
|
|
62
|
+
I(() => {
|
|
63
|
+
var t;
|
|
64
|
+
(t = h.value) == null || t.$el.classList.remove("tiny-config-provider");
|
|
65
|
+
});
|
|
66
|
+
const k = s(() => {
|
|
67
|
+
var r;
|
|
68
|
+
const t = {
|
|
69
|
+
colorMode: i.value === "dark" ? "dark" : "light"
|
|
70
|
+
};
|
|
71
|
+
return (r = o == null ? void 0 : o.value) != null && r.id && (t.targetElement = "#" + o.value.id), t;
|
|
72
|
+
});
|
|
73
|
+
return (t, r) => (E(), N(f(R), {
|
|
74
|
+
ref_key: "providerRef",
|
|
75
|
+
ref: h,
|
|
76
|
+
class: "tg-config-provider",
|
|
77
|
+
id: e.id
|
|
78
|
+
}, {
|
|
79
|
+
default: p(() => [
|
|
80
|
+
G(f($), b(A(k.value)), {
|
|
81
|
+
default: p(() => [
|
|
82
|
+
L(t.$slots, "default", {}, void 0, !0)
|
|
83
|
+
]),
|
|
84
|
+
_: 3
|
|
85
|
+
}, 16)
|
|
86
|
+
]),
|
|
87
|
+
_: 3
|
|
88
|
+
}, 8, ["id"]));
|
|
89
|
+
}
|
|
90
|
+
}), Y = /* @__PURE__ */ j(W, [["__scopeId", "data-v-da2763bd"]]);
|
|
91
|
+
export {
|
|
92
|
+
Y as C,
|
|
93
|
+
V as u
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=ConfigProvider-BzxW9L3f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigProvider-BzxW9L3f.js","sources":["../src/config-provider/use-media-theme.ts","../src/config-provider/ConfigProvider.vue"],"sourcesContent":["import { ref, readonly } from 'vue';\n\nconst hasMediaQuery = () => typeof window !== 'undefined' && window.matchMedia;\n\nconst getMediaTheme = (): 'light' | 'dark' => {\n if (hasMediaQuery()) {\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n }\n return 'light';\n};\n\nconst theme = ref<'light' | 'dark'>(getMediaTheme());\nlet mediaQuery: MediaQueryList | null = null;\n\nconst handleThemeChange = () => {\n theme.value = getMediaTheme();\n};\n\nconst startWatchMediaTheme = () => {\n if (hasMediaQuery() && !mediaQuery) {\n mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');\n mediaQuery.addEventListener('change', handleThemeChange);\n }\n};\n\nexport const useMediaTheme = () => {\n startWatchMediaTheme();\n return {\n theme: readonly(theme),\n }\n}\n","<script setup lang=\"ts\">\nimport { TinyConfigProvider } from '@opentiny/vue';\nimport { ThemeProvider } from '@opentiny/tiny-robot';\nimport ThemeTool, { tinyDarkTheme, tinyOldTheme } from '@opentiny/vue-theme/theme-tool';\nimport { watch, provide, computed, onMounted, ref } from 'vue';\nimport type { IMaterials } from '@opentiny/genui-sdk-core';\nimport { I18nMessages, useI18n } from '../chat/i18n';\nimport { GENUI_I18N, GENUI_CONFIG, GENUI_MATERIALS } from './injection-tokens';\nimport { useMediaTheme } from './use-media-theme';\n\nexport interface ConfigProviderProps {\n theme?: 'light' | 'dark' | 'lite' | 'auto';\n id?: string;\n locale?: string;\n i18n?: I18nMessages;\n materials?: IMaterials;\n}\n\ninterface IRobotProviderProps {\n colorMode: 'dark' | 'light';\n targetElement?: string;\n}\n\nconst props = withDefaults(defineProps<ConfigProviderProps>(), {\n id: 'tiny-genui-config-provider',\n locale: 'zh_CN',\n});\n\nconst i18n = useI18n();\nprovide(GENUI_I18N, i18n);\n\nconst transformTheme = (themeConfig: any) => {\n const newThemeConfig = structuredClone(themeConfig);\n newThemeConfig.css = newThemeConfig.css.replaceAll(':host', `#${props.id}`).replaceAll(':root', `#${props.id}`);\n return newThemeConfig;\n};\n\nconst themeMap: Record<string, any> = {\n dark: transformTheme(tinyDarkTheme),\n lite: transformTheme(tinyOldTheme),\n light: { css: ' ' },\n};\n\nconst themeTool = new ThemeTool();\n\nconst { theme: mediaTheme } = useMediaTheme();\n\nconst actualTheme = computed(() => {\n if (props.theme === 'auto') {\n return mediaTheme.value;\n }\n return props.theme;\n});\n\nconst genuiConfig = computed(() => {\n return {\n theme: actualTheme.value,\n id: props.id,\n };\n});\n\nprovide(GENUI_CONFIG, genuiConfig);\n\nconst internalMaterials = {};\nwatch(() => props.materials, (newVal) => {\n Object.assign(internalMaterials, newVal);\n}, { immediate: true });\n\nprovide(\n GENUI_MATERIALS,\n internalMaterials,\n);\n\nwatch(\n () => [props.locale, props.i18n] as const,\n () => {\n if (props.locale && props.locale !== i18n.locale.value) {\n i18n.setLocale(props.locale);\n }\n props.i18n && i18n.mergeMessages(props.i18n);\n },\n { immediate: true },\n);\n\nwatch(\n () => actualTheme.value,\n (newVal) => {\n const themeConfig = themeMap[newVal] || themeMap.light;\n themeTool.changeTheme(themeConfig);\n },\n {\n immediate: true,\n },\n);\n\nconst providerRef = ref();\nonMounted(() => {\n providerRef.value?.$el.classList.remove('tiny-config-provider');\n});\n\nconst robotProviderProps = computed(() => {\n const providerProps: IRobotProviderProps = {\n colorMode: actualTheme.value === 'dark' ? 'dark' : 'light',\n };\n if (genuiConfig?.value?.id) {\n providerProps.targetElement = '#' + genuiConfig.value.id;\n }\n return providerProps;\n});\n</script>\n\n<template>\n <TinyConfigProvider ref=\"providerRef\" class=\"tg-config-provider\" :id=\"props.id\">\n <ThemeProvider v-bind=\"robotProviderProps\">\n <slot />\n </ThemeProvider>\n </TinyConfigProvider>\n</template>\n\n<style scoped>\n.tg-config-provider {\n --tr-sender-bg-color: var(--tr-container-bg-default);\n --tr-sender-text-color: var(--tr-text-primary);\n --tr-sender-action-buttons-icon-color: var(--tr-text-secondary);\n --tr-sender-action-buttons-send-bg-color: var(--tr-color-primary);\n height: 100%;\n}\n</style>\n"],"names":["hasMediaQuery","getMediaTheme","theme","ref","mediaQuery","handleThemeChange","startWatchMediaTheme","useMediaTheme","readonly","props","__props","i18n","useI18n","provide","GENUI_I18N","transformTheme","themeConfig","newThemeConfig","themeMap","tinyDarkTheme","tinyOldTheme","themeTool","ThemeTool","mediaTheme","actualTheme","computed","genuiConfig","GENUI_CONFIG","internalMaterials","watch","newVal","GENUI_MATERIALS","providerRef","onMounted","_a","robotProviderProps","providerProps","_createBlock","_unref","TinyConfigProvider","_createVNode","_renderSlot","_ctx"],"mappings":";;;;;AAEA,MAAMA,IAAgB,MAAM,OAAO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1
|
+
import { defineComponent as a, ref as i, provide as m, createBlock as c, openBlock as u, mergeProps as l, createSlots as f, renderList as _, withCtx as d, renderSlot as h, normalizeProps as C, guardReactiveProps as g } from "vue";
|
|
2
|
+
import { materials as S } from "@opentiny/genui-sdk-materials-vue-opentiny-vue/materials";
|
|
3
|
+
import { b as y } from "./injection-tokens-CuDQs1ne.js";
|
|
4
|
+
import { G as k } from "./chat.types-BDffahIK.js";
|
|
5
|
+
const b = /* @__PURE__ */ a({
|
|
6
|
+
__name: "GenuiChatWithMaterials",
|
|
7
|
+
props: {
|
|
8
|
+
url: {},
|
|
9
|
+
model: {},
|
|
10
|
+
temperature: {},
|
|
11
|
+
messages: {},
|
|
12
|
+
chatConfig: {},
|
|
13
|
+
requiredCompleteFieldSelectors: {},
|
|
14
|
+
customComponents: {},
|
|
15
|
+
customSnippets: {},
|
|
16
|
+
customExamples: {},
|
|
17
|
+
customActions: {},
|
|
18
|
+
rendererSlots: {},
|
|
19
|
+
thinkComponent: { type: [Object, Function] },
|
|
20
|
+
roles: {},
|
|
21
|
+
features: {},
|
|
22
|
+
customFetch: { type: Function }
|
|
23
|
+
},
|
|
24
|
+
setup(v, { expose: n }) {
|
|
25
|
+
const r = i();
|
|
26
|
+
return m(y, S), n(
|
|
27
|
+
new Proxy({}, {
|
|
28
|
+
get(o, s) {
|
|
29
|
+
const t = r.value, e = t == null ? void 0 : t[s];
|
|
30
|
+
return typeof e == "function" ? e.bind(t) : e;
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
), (o, s) => (u(), c(k, l({
|
|
34
|
+
ref_key: "chatRef",
|
|
35
|
+
ref: r
|
|
36
|
+
}, o.$props), f({ _: 2 }, [
|
|
37
|
+
_(o.$slots, (t, e) => ({
|
|
38
|
+
name: e,
|
|
39
|
+
fn: d((p) => [
|
|
40
|
+
h(o.$slots, e, C(g(p || {})))
|
|
41
|
+
])
|
|
42
|
+
}))
|
|
43
|
+
]), 1040));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
b as _
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-KMItLlt0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-KMItLlt0.js","sources":["../src/legacy-chat/GenuiChatWithMaterials.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { provide, ref } from 'vue';\nimport { materials as defaultMaterials } from '@opentiny/genui-sdk-materials-vue-opentiny-vue/materials';\nimport { GENUI_MATERIALS } from '../config-provider/injection-tokens';\nimport GenuiChat from '../chat/GenuiChat.vue';\nimport type { IChatProps } from '../chat/chat.types';\n\ndefineProps<IChatProps>();\n\nconst chatRef = ref<InstanceType<typeof GenuiChat>>();\n\nprovide(GENUI_MATERIALS, defaultMaterials);\n\ndefineExpose(\n new Proxy({} as InstanceType<typeof GenuiChat>, {\n get(_target, prop) {\n const instance = chatRef.value;\n const value = instance?.[prop as keyof typeof instance];\n return typeof value === 'function' ? value.bind(instance) : value;\n },\n }),\n);\n</script>\n\n<template>\n <GenuiChat ref=\"chatRef\" v-bind=\"$props\">\n <template v-for=\"(_, name) in $slots\" #[name]=\"slotProps\">\n <slot :name=\"name\" v-bind=\"slotProps || {}\" />\n </template>\n </GenuiChat>\n</template>\n"],"names":["chatRef","ref","provide","GENUI_MATERIALS","defaultMaterials","__expose","_target","prop","instance","value","_openBlock","_createBlock","GenuiChat","_mergeProps","$props","_createSlots","$slots","_","name","_withCtx","slotProps","_renderSlot","_ctx","_normalizeProps","_guardReactiveProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AASA,UAAMA,IAAUC,EAAA;AAEhB,WAAAC,EAAQC,GAAiBC,CAAgB,GAEzCC;AAAA,MACE,IAAI,MAAM,CAAA,GAAsC;AAAA,QAC9C,IAAIC,GAASC,GAAM;AACjB,gBAAMC,IAAWR,EAAQ,OACnBS,IAAQD,KAAA,gBAAAA,EAAWD;AACzB,iBAAO,OAAOE,KAAU,aAAaA,EAAM,KAAKD,CAAQ,IAAIC;AAAA,QAC9D;AAAA,MAAA,CACD;AAAA,IAAA,cAKDC,EAAA,GAAAC,EAIYC,GAJZC,EAIY;AAAA,eAJG;AAAA,MAAJ,KAAIb;AAAA,IAAA,GAAkBc,EAAAA,MAAM,GAAAC,EAAA,EAAA,GAAA,KAAA;AAAA,QACPC,EAAAA,QAAM,CAAlBC,GAAGC;;QACnB,IAAAC,EAAA,CAD6CC,MAAS;AAAA,UACtDC,EAA8CC,EAAA,QAAjCJ,GAAIK,EAAAC,EAAUJ,KAAS,CAAA,CAAA,CAAA,CAAA;AAAA,QAAA;;;;;"}
|