@opentiny/genui-sdk-vue 1.3.1-alpha.2 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -11
- 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-zsZgFWJw.js → GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-Bdu-r86w.js} +3 -3
- package/dist/{GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-zsZgFWJw.js.map → GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-Bdu-r86w.js.map} +1 -1
- package/dist/{injection-tokens-DDgspg4x.js → GenuiRenderer-C2w3WGQa.js} +3497 -3474
- package/dist/GenuiRenderer-C2w3WGQa.js.map +1 -0
- package/dist/{GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-CMjFQe5i.js → GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-BlhUkAxb.js} +6 -6
- package/dist/GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-BlhUkAxb.js.map +1 -0
- package/dist/chat.d.ts +0 -6
- package/dist/chat.js +15 -17
- package/dist/chat.js.map +1 -1
- package/dist/chat.types-BqZOCKBz.js +1794 -0
- package/dist/chat.types-BqZOCKBz.js.map +1 -0
- package/dist/config-provider.d.ts +12 -24
- package/dist/config-provider.js +2 -2
- package/dist/index.d.ts +19 -169
- package/dist/index.js +31 -37
- package/dist/index.js.map +1 -1
- package/dist/injection-tokens-CuDQs1ne.js +114 -0
- package/dist/injection-tokens-CuDQs1ne.js.map +1 -0
- package/dist/legacy-chat.d.ts +1 -9
- package/dist/legacy-chat.js +3 -3
- package/dist/legacy-renderer.d.ts +3 -1
- package/dist/legacy-renderer.js +2 -2
- package/dist/renderer.d.ts +2 -2
- package/dist/renderer.js +1 -1
- package/dist/transform-jsx.d.ts +3 -2
- package/dist/transform-jsx.js +2 -5
- package/dist/transform-jsx.js.map +1 -1
- package/package.json +5 -12
- package/dist/ConfigProvider-B_1dX_dv.js +0 -131
- package/dist/ConfigProvider-B_1dX_dv.js.map +0 -1
- package/dist/GenuiRenderer-f2_6u1TA.js +0 -141
- package/dist/GenuiRenderer-f2_6u1TA.js.map +0 -1
- package/dist/GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-CMjFQe5i.js.map +0 -1
- package/dist/chat.types-DEDNSs5o.js +0 -1817
- package/dist/chat.types-DEDNSs5o.js.map +0 -1
- package/dist/code-generator.d.ts +0 -139
- package/dist/code-generator.js +0 -6
- package/dist/code-generator.js.map +0 -1
- package/dist/injection-tokens-DDgspg4x.js.map +0 -1
- package/dist/vue-code-generator-CwPQ3GDh.js +0 -573
- package/dist/vue-code-generator-CwPQ3GDh.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/genui-sdk-vue",
|
|
3
|
-
"version": "1.3.1
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "A Vue3 component library for enhanced LLM display and interaction",
|
|
5
5
|
"author": "OpenTiny Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,10 +50,6 @@
|
|
|
50
50
|
"./transform-jsx": {
|
|
51
51
|
"types": "./dist/transform-jsx.d.ts",
|
|
52
52
|
"import": "./dist/transform-jsx.js"
|
|
53
|
-
},
|
|
54
|
-
"./code-generator": {
|
|
55
|
-
"types": "./dist/code-generator.d.ts",
|
|
56
|
-
"import": "./dist/code-generator.js"
|
|
57
53
|
}
|
|
58
54
|
},
|
|
59
55
|
"type": "module",
|
|
@@ -67,13 +63,10 @@
|
|
|
67
63
|
"@opentiny/tiny-robot": "0.3.3",
|
|
68
64
|
"@opentiny/tiny-robot-kit": "0.3.3",
|
|
69
65
|
"@opentiny/tiny-robot-svgs": "0.3.3",
|
|
70
|
-
"@opentiny/vue": "~3.
|
|
71
|
-
"@opentiny/vue-renderless": "~3.
|
|
72
|
-
"@opentiny/vue-icon": "~3.
|
|
73
|
-
"@opentiny/vue-theme": "~3.
|
|
74
|
-
"@vue/compiler-sfc": "^3.5.13",
|
|
75
|
-
"@vue/shared": "^3.5.13",
|
|
76
|
-
"prettier": "^3.5.0",
|
|
66
|
+
"@opentiny/vue": "~3.28.0",
|
|
67
|
+
"@opentiny/vue-renderless": "~3.28.2",
|
|
68
|
+
"@opentiny/vue-icon": "~3.28.0",
|
|
69
|
+
"@opentiny/vue-theme": "~3.28.0",
|
|
77
70
|
"uuid": "^11.1.0",
|
|
78
71
|
"vue": "^3.5.13",
|
|
79
72
|
"@opentiny/tiny-engine-builtin-component": "^2.6.0"
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".tg-config-provider[data-v-7d5e1407]{--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(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
import { ref as P, readonly as L, defineComponent as I, provide as u, computed as m, watch as h, inject as z, h as O, shallowRef as Q, onBeforeUnmount as q, createElementBlock as W, openBlock as D, createVNode as k, unref as C, normalizeProps as H, guardReactiveProps as J, withCtx as E, renderSlot as K } from "vue";
|
|
3
|
-
import { ThemeProvider as X } from "@opentiny/tiny-robot";
|
|
4
|
-
import { G as Y, u as Z, a as V, b as ee, $ as N, _ as te } from "./injection-tokens-DDgspg4x.js";
|
|
5
|
-
const R = () => typeof window < "u" && window.matchMedia, A = () => R() && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", G = P(A());
|
|
6
|
-
let v = null;
|
|
7
|
-
const oe = () => {
|
|
8
|
-
G.value = A();
|
|
9
|
-
}, re = () => {
|
|
10
|
-
R() && !v && (v = window.matchMedia("(prefers-color-scheme: dark)"), v.addEventListener("change", oe));
|
|
11
|
-
}, ne = () => (re(), {
|
|
12
|
-
theme: L(G)
|
|
13
|
-
}), ae = ["id"], ie = /* @__PURE__ */ I({
|
|
14
|
-
__name: "ConfigProvider",
|
|
15
|
-
props: {
|
|
16
|
-
theme: {},
|
|
17
|
-
id: { default: "tiny-genui-config-provider" },
|
|
18
|
-
locale: { default: "zh_CN" },
|
|
19
|
-
i18n: {},
|
|
20
|
-
materials: {},
|
|
21
|
-
notify: {}
|
|
22
|
-
},
|
|
23
|
-
setup(S) {
|
|
24
|
-
const o = S, i = Z();
|
|
25
|
-
u(Y, i);
|
|
26
|
-
const { theme: b } = ne(), x = m(() => {
|
|
27
|
-
var e;
|
|
28
|
-
const t = (e = o.materials) == null ? void 0 : e.themeFactory;
|
|
29
|
-
return t ? Array.isArray(t) ? t : [t] : [];
|
|
30
|
-
}), a = /* @__PURE__ */ new Map();
|
|
31
|
-
function F(t) {
|
|
32
|
-
for (const e of a.keys())
|
|
33
|
-
t.includes(e) || a.delete(e);
|
|
34
|
-
return t.map((e) => {
|
|
35
|
-
let r = a.get(e);
|
|
36
|
-
return r || (r = e(), a.set(e, r)), r;
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
const U = m(() => o.theme || "light"), f = P("light"), $ = m(() => ({
|
|
40
|
-
colorScheme: f.value,
|
|
41
|
-
id: o.id
|
|
42
|
-
}));
|
|
43
|
-
u(V, $);
|
|
44
|
-
const _ = {};
|
|
45
|
-
h(() => o.materials, (t) => {
|
|
46
|
-
Object.assign(_, t);
|
|
47
|
-
}, { immediate: !0 }), u(ee, _);
|
|
48
|
-
const n = z(N, {}), y = {
|
|
49
|
-
...n && typeof n == "object" ? n : {}
|
|
50
|
-
};
|
|
51
|
-
h(
|
|
52
|
-
() => o.notify,
|
|
53
|
-
(t) => {
|
|
54
|
-
y.notify = t ?? (n == null ? void 0 : n.notify);
|
|
55
|
-
},
|
|
56
|
-
{ immediate: !0 }
|
|
57
|
-
), u(N, y), h(
|
|
58
|
-
() => [o.locale, o.i18n],
|
|
59
|
-
() => {
|
|
60
|
-
o.locale && o.locale !== i.locale.value && i.setLocale(o.locale), o.i18n && i.mergeMessages(o.i18n);
|
|
61
|
-
},
|
|
62
|
-
{ immediate: !0 }
|
|
63
|
-
);
|
|
64
|
-
const j = I({
|
|
65
|
-
name: "ThemeRoots",
|
|
66
|
-
props: {
|
|
67
|
-
roots: { type: Array, required: !0 }
|
|
68
|
-
},
|
|
69
|
-
setup(t, { slots: e }) {
|
|
70
|
-
return () => {
|
|
71
|
-
var s;
|
|
72
|
-
const r = ((s = e.default) == null ? void 0 : s.call(e)) ?? [];
|
|
73
|
-
return t.roots.reduceRight(
|
|
74
|
-
(c, d) => O(d, {}, () => c),
|
|
75
|
-
r
|
|
76
|
-
);
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
}), w = Q([]);
|
|
80
|
-
let p = [];
|
|
81
|
-
function M() {
|
|
82
|
-
const t = p;
|
|
83
|
-
p = [], t.forEach((e) => {
|
|
84
|
-
var r;
|
|
85
|
-
return (r = e.dispose) == null ? void 0 : r.call(e);
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
h(
|
|
89
|
-
() => [x.value, U.value, b.value, o.id],
|
|
90
|
-
([t, e, r]) => {
|
|
91
|
-
var T;
|
|
92
|
-
const s = F(t);
|
|
93
|
-
M();
|
|
94
|
-
const c = [], d = [];
|
|
95
|
-
for (const g of s) {
|
|
96
|
-
const l = g.apply(e, { systemColorScheme: r });
|
|
97
|
-
l.root && d.push(l.root), c.push(l), p.push(l);
|
|
98
|
-
}
|
|
99
|
-
w.value = d, f.value = ((T = c.find((g) => g.descriptor.colorScheme)) == null ? void 0 : T.descriptor.colorScheme) ?? (e === "auto" ? r : e === "dark" ? "dark" : "light");
|
|
100
|
-
},
|
|
101
|
-
{ immediate: !0 }
|
|
102
|
-
), q(() => {
|
|
103
|
-
M(), a.clear();
|
|
104
|
-
});
|
|
105
|
-
const B = m(() => ({
|
|
106
|
-
colorMode: f.value,
|
|
107
|
-
targetElement: `#${o.id}`
|
|
108
|
-
}));
|
|
109
|
-
return (t, e) => (D(), W("div", {
|
|
110
|
-
id: o.id,
|
|
111
|
-
class: "tg-config-provider"
|
|
112
|
-
}, [
|
|
113
|
-
k(C(X), H(J(B.value)), {
|
|
114
|
-
default: E(() => [
|
|
115
|
-
k(C(j), { roots: w.value }, {
|
|
116
|
-
default: E(() => [
|
|
117
|
-
K(t.$slots, "default", {}, void 0, !0)
|
|
118
|
-
]),
|
|
119
|
-
_: 3
|
|
120
|
-
}, 8, ["roots"])
|
|
121
|
-
]),
|
|
122
|
-
_: 3
|
|
123
|
-
}, 16)
|
|
124
|
-
], 8, ae));
|
|
125
|
-
}
|
|
126
|
-
}), le = /* @__PURE__ */ te(ie, [["__scopeId", "data-v-7d5e1407"]]);
|
|
127
|
-
export {
|
|
128
|
-
le as C,
|
|
129
|
-
ne as u
|
|
130
|
-
};
|
|
131
|
-
//# sourceMappingURL=ConfigProvider-B_1dX_dv.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigProvider-B_1dX_dv.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 { ThemeProvider } from '@opentiny/tiny-robot';\nimport {\n type IMaterialsTheme,\n type MaterialsThemeFactory,\n type MergedMaterials,\n type IThemeApplyResult,\n type ThemeColorScheme,\n} from '@opentiny/genui-sdk-core';\nimport {\n watch,\n provide,\n inject,\n computed,\n ref,\n shallowRef,\n onBeforeUnmount,\n defineComponent,\n h,\n type Component,\n type PropType,\n type VNode,\n} from 'vue';\nimport { RENDERER_SETTINGS_KEY } from '@opentiny/tiny-schema-renderer';\nimport { I18nMessages, useI18n } from '../chat/i18n';\nimport { GENUI_I18N, GENUI_CONFIG, GENUI_MATERIALS } from './injection-tokens';\nimport { useMediaTheme } from './use-media-theme';\nimport type { NotifyHandler } from './notify.types';\n\nexport type { NotifyHandler };\n\nexport interface ConfigProviderProps {\n theme?: string;\n id?: string;\n locale?: string;\n i18n?: I18nMessages;\n materials?: MergedMaterials;\n notify?: NotifyHandler;\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 { theme: mediaTheme } = useMediaTheme();\n\nconst themeFactories = computed<MaterialsThemeFactory[]>(() => {\n const themeFactory = props.materials?.themeFactory;\n if (!themeFactory) {\n return [];\n }\n return Array.isArray(themeFactory) ? themeFactory : [themeFactory];\n});\n\nconst themeInstances = new Map<MaterialsThemeFactory, IMaterialsTheme>();\n\nfunction resolveThemeInstances(factories: MaterialsThemeFactory[]) {\n for (const key of themeInstances.keys()) {\n if (!factories.includes(key)) {\n themeInstances.delete(key);\n }\n }\n return factories.map((factory) => {\n let instance = themeInstances.get(factory);\n if (!instance) {\n instance = factory();\n themeInstances.set(factory, instance);\n }\n return instance;\n });\n}\n\nconst theme = computed(() => props.theme || 'light');\n\nconst colorScheme = ref<ThemeColorScheme>('light');\n\nconst genuiConfig = computed(() => ({\n colorScheme: colorScheme.value,\n id: props.id,\n}));\n\nprovide(GENUI_CONFIG, genuiConfig);\n\nconst internalMaterials = {};\nwatch(() => props.materials, (newVal) => {\n Object.assign(internalMaterials, newVal);\n}, { immediate: true });\n\nprovide(GENUI_MATERIALS, internalMaterials);\n\nconst parentRendererSettings = inject(RENDERER_SETTINGS_KEY, {}) as Record<string, any>;\nconst rendererSettings = {\n ...(parentRendererSettings && typeof parentRendererSettings === 'object' ? parentRendererSettings : {}),\n};\nwatch(\n () => props.notify,\n (notify) => {\n rendererSettings.notify = notify ?? parentRendererSettings?.notify;\n },\n { immediate: true },\n);\nprovide(RENDERER_SETTINGS_KEY, rendererSettings);\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\nconst ThemeRoots = defineComponent({\n name: 'ThemeRoots',\n props: {\n roots: { type: Array as PropType<Component[]>, required: true },\n },\n setup(props, { slots }) {\n return () => {\n const children = slots.default?.() ?? [];\n return props.roots.reduceRight<VNode | VNode[]>(\n (acc, root) => h(root, {}, () => acc),\n children,\n );\n };\n },\n});\n\nconst themeRoots = shallowRef<Component[]>([]);\n\nlet applied: IThemeApplyResult[] = [];\n\nfunction clearTheme() {\n const pending = applied;\n applied = [];\n pending.forEach((item) => item.dispose?.());\n}\n\nwatch(\n () => [themeFactories.value, theme.value, mediaTheme.value, props.id] as const,\n ([factories, themeValue, systemColorScheme]) => {\n const apis = resolveThemeInstances(factories);\n clearTheme();\n const results: IThemeApplyResult[] = [];\n const roots: Component[] = [];\n\n for (const api of apis) {\n const result = api.apply(themeValue, { systemColorScheme });\n if (result.root) {\n roots.push(result.root as Component);\n }\n results.push(result);\n applied.push(result);\n }\n\n themeRoots.value = roots;\n colorScheme.value =\n results.find((result) => result.descriptor.colorScheme)?.descriptor.colorScheme ??\n (themeValue === 'auto'\n ? systemColorScheme\n : themeValue === 'dark'\n ? 'dark'\n : 'light');\n },\n { immediate: true },\n);\n\nonBeforeUnmount(() => {\n clearTheme();\n themeInstances.clear();\n});\n\nconst robotProviderProps = computed(() => ({\n colorMode: colorScheme.value,\n targetElement: `#${props.id}`,\n}));\n</script>\n\n<template>\n <div :id=\"props.id\" class=\"tg-config-provider\">\n <ThemeProvider v-bind=\"robotProviderProps\">\n <ThemeRoots :roots=\"themeRoots\">\n <slot />\n </ThemeRoots>\n </ThemeProvider>\n </div>\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","mediaTheme","themeFactories","computed","themeFactory","_a","themeInstances","resolveThemeInstances","factories","key","factory","instance","colorScheme","genuiConfig","GENUI_CONFIG","internalMaterials","watch","newVal","GENUI_MATERIALS","parentRendererSettings","inject","RENDERER_SETTINGS_KEY","rendererSettings","notify","ThemeRoots","defineComponent","slots","children","acc","root","h","themeRoots","shallowRef","applied","clearTheme","pending","item","themeValue","systemColorScheme","apis","results","roots","api","result","onBeforeUnmount","robotProviderProps","_createElementBlock","_createVNode","_unref","_renderSlot","_ctx"],"mappings":";;;AAEA,MAAMA,IAAgB,MAAM,OAAO,SAAW,OAAe,OAAO,YAE9DC,IAAgB,MAChBD,OACK,OAAO,WAAW,8BAA8B,EAAE,UAAU,SAE9D,SAGHE,IAAQC,EAAsBF,GAAe;AACnD,IAAIG,IAAoC;AAExC,MAAMC,KAAoB,MAAM;AAC9B,EAAAH,EAAM,QAAQD,EAAA;AAChB,GAE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;;"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.appendChild(document.createTextNode("[data-v-68c3e02f] .tiny-card.tiny-card.tiny-card{width:100%;background-color:var(--content-bg);border-radius:24px}[data-v-68c3e02f] .tiny-card.tiny-card.tiny-card .tiny-card--logo__main{color:var(--text-color)}[data-v-68c3e02f] .tiny-card.tiny-card.tiny-card .tiny-card--logo{max-width:100%}[data-v-68c3e02f] .tiny-row.tiny-row{line-height:2}[data-v-68c3e02f] ol[data-tag=ol],[data-v-68c3e02f] ul[data-tag=ul]{list-style:revert;margin:revert;padding:revert}[data-v-68c3e02f] li[data-tag=li]{margin:revert;padding:revert}[data-v-68c3e02f] *,[data-v-68c3e02f] *:before,[data-v-68c3e02f] *:after{box-sizing:border-box}[data-v-68c3e02f] h1[data-tag=h1],[data-v-68c3e02f] h2[data-tag=h2],[data-v-68c3e02f] h3[data-tag=h3],[data-v-68c3e02f] h4[data-tag=h4],[data-v-68c3e02f] h5[data-tag=h5],[data-v-68c3e02f] h6[data-tag=h6],[data-v-68c3e02f] p[data-tag=p]{font-size:revert;font-weight:revert;color:revert;margin:revert;padding:revert}.schema-render-container[data-v-68c3e02f]{--ti-genui-renderer-text-color: #191919;position:relative;color:var(--ti-genui-renderer-text-color)}.schema-render-container.dark[data-v-68c3e02f]{--ti-genui-renderer-text-color: #f5f5f5}.schema-render-container[data-v-68c3e02f]:has(.loading-warp):after{display:none}[data-v-68c3e02f] .loading-warp.loading-warp,[data-v-68c3e02f] .loading-warp .loading{display:none}")),document.head.appendChild(a)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import { defineComponent as q, onErrorCaptured as G, ref as d, inject as f, watch as m, provide as J, shallowRef as b, computed as k, nextTick as h, createElementBlock as R, openBlock as j, normalizeClass as $, unref as y, renderSlot as g, createVNode as B } from "vue";
|
|
3
|
-
import { b as P, a as T, $ as x, u as U, l as D, _ as O } from "./injection-tokens-DDgspg4x.js";
|
|
4
|
-
import { DeltaPatcher as w, repairJson as z, RepairJsonState as L } from "@opentiny/genui-sdk-core";
|
|
5
|
-
const M = Symbol("schema-card-id"), W = [
|
|
6
|
-
"[componentName=img] > props > src",
|
|
7
|
-
"componentName",
|
|
8
|
-
"style",
|
|
9
|
-
"[componentName=Page] > css",
|
|
10
|
-
"[type=JSFunction]",
|
|
11
|
-
"[type=JSExpression]",
|
|
12
|
-
"[type=JSSlot][value=]",
|
|
13
|
-
"type",
|
|
14
|
-
":empty:object",
|
|
15
|
-
"[componentName] > props > ref"
|
|
16
|
-
], H = /* @__PURE__ */ q({
|
|
17
|
-
__name: "GenuiRenderer",
|
|
18
|
-
props: {
|
|
19
|
-
content: {},
|
|
20
|
-
generating: { type: Boolean },
|
|
21
|
-
isJsonComplete: { type: Boolean, default: !0 },
|
|
22
|
-
customComponents: {},
|
|
23
|
-
customActions: {},
|
|
24
|
-
requiredCompleteFieldSelectors: {},
|
|
25
|
-
id: {},
|
|
26
|
-
state: {}
|
|
27
|
-
},
|
|
28
|
-
setup(E) {
|
|
29
|
-
G((e) => (console.error("GenuiRenderer error:", e), !0));
|
|
30
|
-
const r = E, i = d({}), n = d(null), _ = (e, s) => {
|
|
31
|
-
var t, l;
|
|
32
|
-
if (!((t = r.customActions) != null && t[e])) {
|
|
33
|
-
console.warn(`Action ${e} not found`);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
return (l = r.customActions[e]) == null ? void 0 : l.execute(s, n.value.getContext());
|
|
37
|
-
}, o = f(P, {}), F = f(T, null), v = f(x, {});
|
|
38
|
-
m(() => r.customComponents, (e) => {
|
|
39
|
-
o.components && Object.assign(o.components, e);
|
|
40
|
-
}, { immediate: !0 }), v.materials = o, J(x, v);
|
|
41
|
-
const C = b(null);
|
|
42
|
-
m(
|
|
43
|
-
() => [o == null ? void 0 : o.requiredCompleteFieldSelectors, r.requiredCompleteFieldSelectors],
|
|
44
|
-
() => {
|
|
45
|
-
C.value = new w({
|
|
46
|
-
requiredCompleteFieldSelectors: [
|
|
47
|
-
...W,
|
|
48
|
-
...(o == null ? void 0 : o.requiredCompleteFieldSelectors) || [],
|
|
49
|
-
...r.requiredCompleteFieldSelectors || []
|
|
50
|
-
]
|
|
51
|
-
});
|
|
52
|
-
},
|
|
53
|
-
{ immediate: !0 }
|
|
54
|
-
);
|
|
55
|
-
const { t: A } = U(), I = {
|
|
56
|
-
componentName: "Page",
|
|
57
|
-
children: [
|
|
58
|
-
{
|
|
59
|
-
componentName: "Text",
|
|
60
|
-
props: {
|
|
61
|
-
text: A("renderer.error.displayError"),
|
|
62
|
-
style: "line-height: 40px; color: var(--tv-color-error-text)"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
}, c = d(!1), N = k(() => c.value ? I : i.value);
|
|
67
|
-
let a = null;
|
|
68
|
-
function S() {
|
|
69
|
-
var e, s, t;
|
|
70
|
-
(e = n.value) == null || e.setContext({
|
|
71
|
-
callAction: _
|
|
72
|
-
}), (s = n.value) == null || s.setContext({
|
|
73
|
-
[M]: r.id
|
|
74
|
-
}), (t = n.value) == null || t.setState(r.state || {});
|
|
75
|
-
}
|
|
76
|
-
return m(
|
|
77
|
-
[() => r.content, () => r.isJsonComplete],
|
|
78
|
-
([e, s]) => {
|
|
79
|
-
c.value = !1;
|
|
80
|
-
let t = e, l = !0;
|
|
81
|
-
if (typeof e == "string")
|
|
82
|
-
if (e.trim()) {
|
|
83
|
-
const { value: u, state: p } = z(e);
|
|
84
|
-
if (!u || typeof u != "object") {
|
|
85
|
-
c.value = !0;
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
t = u, l = p === L.SUCCESS;
|
|
89
|
-
} else
|
|
90
|
-
t = {};
|
|
91
|
-
else
|
|
92
|
-
l = s ?? !0;
|
|
93
|
-
if (!l && t && "lifeCycles" in t) {
|
|
94
|
-
const { lifeCycles: u, ...p } = t;
|
|
95
|
-
t = p;
|
|
96
|
-
}
|
|
97
|
-
C.value.patchWithDelta(i.value, t, l), a || (a = h(() => {
|
|
98
|
-
n.value && (S(), a = null);
|
|
99
|
-
}));
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
immediate: !0
|
|
103
|
-
}
|
|
104
|
-
), m(
|
|
105
|
-
() => n.value,
|
|
106
|
-
(e) => {
|
|
107
|
-
e && a && (h(() => S()), a = null);
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
immediate: !0
|
|
111
|
-
}
|
|
112
|
-
), (e, s) => {
|
|
113
|
-
var t;
|
|
114
|
-
return j(), R("div", {
|
|
115
|
-
class: $(["schema-render-container", { dark: ((t = y(F)) == null ? void 0 : t.colorScheme) === "dark" }])
|
|
116
|
-
}, [
|
|
117
|
-
g(e.$slots, "header", {
|
|
118
|
-
schema: i.value,
|
|
119
|
-
isError: c.value,
|
|
120
|
-
isFinished: !r.generating
|
|
121
|
-
}, void 0, !0),
|
|
122
|
-
B(y(D), {
|
|
123
|
-
schema: N.value,
|
|
124
|
-
ref_key: "rendererInstance",
|
|
125
|
-
ref: n
|
|
126
|
-
}, null, 8, ["schema"]),
|
|
127
|
-
g(e.$slots, "footer", {
|
|
128
|
-
schema: i.value,
|
|
129
|
-
isError: c.value,
|
|
130
|
-
isFinished: !r.generating
|
|
131
|
-
}, void 0, !0)
|
|
132
|
-
], 2);
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
}), Y = /* @__PURE__ */ O(H, [["__scopeId", "data-v-68c3e02f"]]);
|
|
136
|
-
export {
|
|
137
|
-
Y as G,
|
|
138
|
-
M as c,
|
|
139
|
-
W as r
|
|
140
|
-
};
|
|
141
|
-
//# sourceMappingURL=GenuiRenderer-f2_6u1TA.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GenuiRenderer-f2_6u1TA.js","sources":["../src/chat/useChat.ts","../src/renderer/config.ts","../src/renderer/GenuiRenderer.vue"],"sourcesContent":["export const cardIdSymbol = Symbol('schema-card-id');\n","export const requiredCompleteFieldSelectors = [\n '[componentName=img] > props > src',\n 'componentName',\n 'style',\n '[componentName=Page] > css',\n '[type=JSFunction]',\n '[type=JSExpression]',\n '[type=JSSlot][value=]',\n 'type',\n ':empty:object',\n '[componentName] > props > ref',\n];\n","<script setup lang=\"ts\">\nimport { ref, watch, computed, inject, nextTick, onErrorCaptured, provide, shallowRef } from 'vue';\n// @ts-ignore\nimport SchemaRenderer, { RENDERER_SETTINGS_KEY } from '@opentiny/tiny-schema-renderer';\nimport { DeltaPatcher, repairJson, RepairJsonState, type IMaterials } from '@opentiny/genui-sdk-core';\nimport { requiredCompleteFieldSelectors as internalRequiredCompleteFieldSelectors } from './config';\nimport { GENUI_CONFIG, GENUI_MATERIALS } from '../config-provider/injection-tokens';\nimport type { IRendererProps } from './renderer.types';\nimport { cardIdSymbol } from '../chat/useChat';\nimport { useI18n } from '../chat/i18n';\n\nonErrorCaptured((error) => {\n console.error('GenuiRenderer error:', error);\n return true;\n});\n\nconst props = withDefaults(defineProps<IRendererProps>(), {\n isJsonComplete: true,\n});\n\nconst schema = ref<any>({});\nconst rendererInstance = ref<SchemaRenderer | null>(null);\n\nconst callAction = (actionName: string, params: any) => {\n if (!props.customActions?.[actionName]) {\n console.warn(`Action ${actionName} not found`);\n return;\n }\n return props.customActions[actionName]?.execute(params, rendererInstance.value.getContext());\n};\n\nconst materials = inject<IMaterials>(GENUI_MATERIALS, {});\nconst genuiConfig = inject(GENUI_CONFIG, null);\nconst customSettings = inject(RENDERER_SETTINGS_KEY, {}) as Record<string, any>;\n\nwatch(() => props.customComponents, (newVal) => {\n // TODO: 1、materials.components更新后,customComponents会丢失 2、旧的customComponents没有被移除\n if (materials.components) {\n Object.assign(materials.components, newVal);\n }\n}, { immediate: true });\n\ncustomSettings.materials = materials;\nprovide(RENDERER_SETTINGS_KEY, customSettings);\n\nconst deltaPatcher = shallowRef(null);\n\nwatch(\n () => [materials?.requiredCompleteFieldSelectors, props.requiredCompleteFieldSelectors],\n () => {\n deltaPatcher.value = new DeltaPatcher({\n requiredCompleteFieldSelectors: [\n ...internalRequiredCompleteFieldSelectors,\n ...(materials?.requiredCompleteFieldSelectors || []),\n ...(props.requiredCompleteFieldSelectors || []),\n ],\n });\n },\n { immediate: true },\n);\n\nconst { t } = useI18n();\n\nconst errorSchema = {\n componentName: 'Page',\n children: [\n {\n componentName: 'Text',\n props: {\n text: t('renderer.error.displayError'),\n style: 'line-height: 40px; color: var(--tv-color-error-text)',\n },\n },\n ],\n};\n\nconst isError = ref(false);\n\nconst displaySchema = computed(() => {\n if (isError.value) {\n return errorSchema;\n }\n return schema.value;\n});\n\nlet updateActionTimer: any | null = null;\n\nfunction updateContextAndState() {\n rendererInstance.value?.setContext({\n callAction,\n });\n rendererInstance.value?.setContext({\n [cardIdSymbol]: props.id,\n });\n rendererInstance.value?.setState(props.state || {});\n}\n\nwatch(\n [() => props.content, () => props.isJsonComplete],\n ([newVal, isJsonComplete]) => {\n isError.value = false;\n let json: any = newVal;\n let isCompleted = true;\n if (typeof newVal === 'string') {\n if (newVal.trim()) {\n const { value, state } = repairJson(newVal);\n if (!value || typeof value !== 'object') {\n isError.value = true;\n return;\n }\n json = value;\n isCompleted = state === RepairJsonState.SUCCESS;\n } else {\n json = {};\n }\n } else {\n isCompleted = isJsonComplete ?? true;\n }\n if (!isCompleted && json && 'lifeCycles' in json) {\n const { lifeCycles, ...rest } = json;\n json = rest;\n }\n deltaPatcher.value.patchWithDelta(schema.value, json, isCompleted); // TODO: 速率限制\n if (!updateActionTimer) {\n updateActionTimer = nextTick(() => {\n if (!rendererInstance.value) return;\n updateContextAndState();\n updateActionTimer = null;\n });\n }\n },\n {\n immediate: true,\n },\n);\n// 异步组件可能在更新context时候并未ready,导致恢复会话的时候context没更新\nwatch(\n () => rendererInstance.value,\n (newVal) => {\n if (newVal && updateActionTimer) {\n nextTick(() => updateContextAndState());\n updateActionTimer = null;\n }\n },\n {\n immediate: true,\n },\n);\n</script>\n\n<template>\n <div class=\"schema-render-container\" :class=\"{ dark: genuiConfig?.colorScheme === 'dark' }\">\n <slot name=\"header\" :schema=\"schema\" :isError=\"isError\" :isFinished=\"!props.generating\"></slot>\n <SchemaRenderer :schema=\"displaySchema\" ref=\"rendererInstance\" />\n <slot name=\"footer\" :schema=\"schema\" :isError=\"isError\" :isFinished=\"!props.generating\"></slot>\n </div>\n</template>\n\n<style scoped>\n@import url('./custom.css');\n\n.schema-render-container {\n --ti-genui-renderer-text-color: #191919;\n position: relative;\n color: var(--ti-genui-renderer-text-color);\n}\n\n.schema-render-container.dark {\n --ti-genui-renderer-text-color: #f5f5f5;\n}\n\n.schema-render-container:has(.loading-warp):after {\n display: none;\n}\n\n:deep(.loading-warp.loading-warp) {\n display: none;\n}\n\n:deep(.loading-warp .loading) {\n display: none;\n}\n</style>\n"],"names":["cardIdSymbol","requiredCompleteFieldSelectors","onErrorCaptured","error","props","__props","schema","ref","rendererInstance","callAction","actionName","params","_a","_b","materials","inject","GENUI_MATERIALS","genuiConfig","GENUI_CONFIG","customSettings","RENDERER_SETTINGS_KEY","watch","newVal","provide","deltaPatcher","shallowRef","DeltaPatcher","internalRequiredCompleteFieldSelectors","t","useI18n","errorSchema","isError","displaySchema","computed","updateActionTimer","updateContextAndState","_c","isJsonComplete","json","isCompleted","value","state","repairJson","RepairJsonState","lifeCycles","rest","nextTick","_createElementBlock","_normalizeClass","_unref","_renderSlot","_ctx","_createVNode","SchemaRenderer"],"mappings":";;;AAAO,MAAMA,IAAe,OAAO,gBAAgB,GCAtCC,IAAiC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;;;;;;;;;;;ACAA,IAAAC,EAAgB,CAACC,OACf,QAAQ,MAAM,wBAAwBA,CAAK,GACpC,GACR;AAED,UAAMC,IAAQC,GAIRC,IAASC,EAAS,EAAE,GACpBC,IAAmBD,EAA2B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Fb;AAAA,MACE,MAAMb,EAAiB;AAAA,MACvB,CAACc,MAAW;AACV,QAAIA,KAAUY,MACZY,EAAS,MAAMX,GAAuB,GACtCD,IAAoB;AAAA,MAExB;AAAA,MACA;AAAA,QACE,WAAW;AAAA,MAAA;AAAA,IACb;;kBAKAa,EAIM,OAAA;AAAA,QAJD,OAAKC,EAAA,CAAC,2BAAyB,EAAA,QAAiBC,IAAAA,EAAAhC,CAAA,MAAAgC,gBAAAA,EAAa,iBAAW,QAAA,CAAA;AAAA,MAAA;QAC3EC,EAA+FC,EAAA,QAAA,UAAA;AAAA,UAA1E,QAAQ7C,EAAA;AAAA,UAAS,SAASyB,EAAA;AAAA,UAAU,YAAU,CAAG3B,EAAM;AAAA,QAAA;QAC5EgD,EAAiEH,EAAAI,CAAA,GAAA;AAAA,UAAhD,QAAQrB,EAAA;AAAA,mBAAmB;AAAA,UAAJ,KAAIxB;AAAA,QAAA;QAC5C0C,EAA+FC,EAAA,QAAA,UAAA;AAAA,UAA1E,QAAQ7C,EAAA;AAAA,UAAS,SAASyB,EAAA;AAAA,UAAU,YAAU,CAAG3B,EAAM;AAAA,QAAA;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-CMjFQe5i.js","sources":["../src/legacy-renderer/GenuiRendererWithMaterials.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { provide } from 'vue';\nimport { materials as defaultMaterials } from '@opentiny/genui-sdk-materials-vue-opentiny-vue/materials';\nimport { GENUI_MATERIALS } from '../config-provider/injection-tokens';\nimport GenuiRenderer from '../renderer/GenuiRenderer.vue';\nimport type { IRendererProps, IRendererSlots } from '../renderer/renderer.types';\n\ndefineProps<IRendererProps>();\ndefineSlots<IRendererSlots>();\nprovide(GENUI_MATERIALS, defaultMaterials);\n</script>\n\n<template>\n <GenuiRenderer v-bind=\"$props\">\n <template v-if=\"$slots.header\" #header=\"slotProps\">\n <slot name=\"header\" v-bind=\"slotProps\" />\n </template>\n <template v-if=\"$slots.footer\" #footer=\"slotProps\">\n <slot name=\"footer\" v-bind=\"slotProps\" />\n </template>\n </GenuiRenderer>\n</template>\n"],"names":["provide","GENUI_MATERIALS","defaultMaterials","_openBlock","_createBlock","GenuiRenderer","$props","_createSlots","$slots","_withCtx","slotProps","_renderSlot","_ctx"],"mappings":";;;;;;;;;;;;;;;;;AASA,WAAAA,EAAQC,GAAiBC,CAAgB,cAIvCC,EAAA,GAAAC,EAOgBC,OAPOC,EAAAA,MAAM,CAAA,GAAAC,EAAA,EAAA,GAAA,KAAA;AAAA,MACXC,EAAAA,OAAO;cAAS;AAAA,QAC9B,IAAAC,EAAA,CADsCC,MAAS;AAAA,UAC/CC,EAAyCC,wBAAbF,CAAS,CAAA,CAAA;AAAA,QAAA;;;MAEvBF,EAAAA,OAAO;cAAS;AAAA,QAC9B,IAAAC,EAAA,CADsCC,MAAS;AAAA,UAC/CC,EAAyCC,wBAAbF,CAAS,CAAA,CAAA;AAAA,QAAA;;;;;;"}
|