@opentiny/genui-sdk-vue 1.3.1-alpha.2 → 1.3.2-alpha.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.
Files changed (44) hide show
  1. package/README.md +2 -11
  2. package/dist/ConfigProvider-BzxW9L3f.js +95 -0
  3. package/dist/ConfigProvider-BzxW9L3f.js.map +1 -0
  4. package/dist/{GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-zsZgFWJw.js → GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-oky3QRk7.js} +3 -3
  5. package/dist/{GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-zsZgFWJw.js.map → GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-oky3QRk7.js.map} +1 -1
  6. package/dist/{injection-tokens-DDgspg4x.js → GenuiRenderer-B22XV3Mr.js} +3269 -3224
  7. package/dist/GenuiRenderer-B22XV3Mr.js.map +1 -0
  8. package/dist/{GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-CMjFQe5i.js → GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-sYP74-5X.js} +6 -6
  9. package/dist/GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-sYP74-5X.js.map +1 -0
  10. package/dist/chat.d.ts +0 -6
  11. package/dist/chat.js +15 -17
  12. package/dist/chat.js.map +1 -1
  13. package/dist/chat.types-CIkLm6Gm.js +1794 -0
  14. package/dist/chat.types-CIkLm6Gm.js.map +1 -0
  15. package/dist/config-provider.d.ts +12 -24
  16. package/dist/config-provider.js +2 -2
  17. package/dist/index.d.ts +33 -170
  18. package/dist/index.js +31 -37
  19. package/dist/index.js.map +1 -1
  20. package/dist/injection-tokens-CuDQs1ne.js +114 -0
  21. package/dist/injection-tokens-CuDQs1ne.js.map +1 -0
  22. package/dist/legacy-chat.d.ts +1 -9
  23. package/dist/legacy-chat.js +3 -3
  24. package/dist/legacy-renderer.d.ts +3 -1
  25. package/dist/legacy-renderer.js +2 -2
  26. package/dist/renderer.d.ts +16 -3
  27. package/dist/renderer.js +1 -1
  28. package/dist/transform-jsx.d.ts +3 -2
  29. package/dist/transform-jsx.js +14019 -14044
  30. package/dist/transform-jsx.js.map +1 -1
  31. package/package.json +5 -12
  32. package/dist/ConfigProvider-B_1dX_dv.js +0 -131
  33. package/dist/ConfigProvider-B_1dX_dv.js.map +0 -1
  34. package/dist/GenuiRenderer-f2_6u1TA.js +0 -141
  35. package/dist/GenuiRenderer-f2_6u1TA.js.map +0 -1
  36. package/dist/GenuiRendererWithMaterials.vue_vue_type_script_setup_true_lang-CMjFQe5i.js.map +0 -1
  37. package/dist/chat.types-DEDNSs5o.js +0 -1817
  38. package/dist/chat.types-DEDNSs5o.js.map +0 -1
  39. package/dist/code-generator.d.ts +0 -139
  40. package/dist/code-generator.js +0 -6
  41. package/dist/code-generator.js.map +0 -1
  42. package/dist/injection-tokens-DDgspg4x.js.map +0 -1
  43. package/dist/vue-code-generator-CwPQ3GDh.js +0 -573
  44. package/dist/vue-code-generator-CwPQ3GDh.js.map +0 -1
package/README.md CHANGED
@@ -33,22 +33,13 @@ import { materials } from '@opentiny/genui-sdk-materials-vue-opentiny-vue/materi
33
33
  </template>
34
34
  ```
35
35
 
36
- Import by feature via subpaths (`/chat`, `/renderer`, `/config-provider`, `/code-generator`) to avoid unused modules:
37
-
38
- ```ts
39
- import { generateCode } from '@opentiny/genui-sdk-vue/code-generator';
40
- ```
41
-
42
36
  ## Documentation
43
37
 
44
38
  * [quick-start](https://docs.opentiny.design/genui-sdk/guide/quick-start)
45
- * [start-with-renderer](https://docs.opentiny.design/genui-sdk/guide/start-with-renderer)
39
+ * [start-with-render](https://docs.opentiny.design/genui-sdk/guide/start-with-renderer)
46
40
 
47
41
  ## API
48
42
 
49
- * [GenuiRenderer](https://docs.opentiny.design/genui-sdk/components/renderer)
43
+ * [GenuiRender](https://docs.opentiny.design/genui-sdk/components/renderer)
50
44
  * [GenuiChat](https://docs.opentiny.design/genui-sdk/components/chat)
51
45
  * [GenuiConfigProvider](https://docs.opentiny.design/genui-sdk/components/config-provider)
52
- * [generateCode](https://docs.opentiny.design/genui-sdk/components/code-generator)
53
- * [Vue OpenTiny Vue materials](https://docs.opentiny.design/genui-sdk/components/materials/vue-opentiny-vue)
54
- * [Vue Element Plus materials](https://docs.opentiny.design/genui-sdk/components/materials/vue-element-plus)
@@ -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,SAAW,OAAe,OAAO,YAE9DC,IAAgB,MAChBD,OACK,OAAO,WAAW,8BAA8B,EAAE,UAAU,SAE9D,SAGHE,IAAQC,EAAsBF,GAAe;AACnD,IAAIG,IAAoC;AAExC,MAAMC,IAAoB,MAAM;AAC9B,EAAAH,EAAM,QAAQD,EAAA;AAChB,GAEMK,IAAuB,MAAM;AACjC,EAAIN,EAAA,KAAmB,CAACI,MACtBA,IAAa,OAAO,WAAW,8BAA8B,GAC7DA,EAAW,iBAAiB,UAAUC,CAAiB;AAE3D,GAEaE,IAAgB,OAC3BD,EAAA,GACO;AAAA,EACL,OAAOE,EAASN,CAAK;AAAA;;;;;;;;;;ACLzB,UAAMO,IAAQC,GAKRC,IAAOC,EAAA;AACb,IAAAC,EAAQC,GAAYH,CAAI;AAExB,UAAMI,IAAiB,CAACC,MAAqB;AAC3C,YAAMC,IAAiB,gBAAgBD,CAAW;AAClD,aAAAC,EAAe,MAAMA,EAAe,IAAI,WAAW,SAAS,IAAIR,EAAM,EAAE,EAAE,EAAE,WAAW,SAAS,IAAIA,EAAM,EAAE,EAAE,GACvGQ;AAAA,IACT,GAEMC,IAAgC;AAAA,MACpC,MAAMH,EAAeI,CAAa;AAAA,MAClC,MAAMJ,EAAeK,CAAY;AAAA,MACjC,OAAO,EAAE,KAAK,IAAA;AAAA,IAAI,GAGdC,IAAY,IAAIC,EAAA,GAEhB,EAAE,OAAOC,EAAA,IAAehB,EAAA,GAExBiB,IAAcC,EAAS,MACvBhB,EAAM,UAAU,SACXc,EAAW,QAEbd,EAAM,KACd,GAEKiB,IAAcD,EAAS,OACpB;AAAA,MACL,OAAOD,EAAY;AAAA,MACnB,IAAIf,EAAM;AAAA,IAAA,EAEb;AAED,IAAAI,EAAQc,GAAcD,CAAW;AAEjC,UAAME,IAAoB,CAAA;AAC1B,IAAAC,EAAM,MAAMpB,EAAM,WAAW,CAACqB,MAAW;AACvC,aAAO,OAAOF,GAAmBE,CAAM;AAAA,IACzC,GAAG,EAAE,WAAW,IAAM,GAEtBjB;AAAA,MACEkB;AAAA,MACAH;AAAA,IAAA,GAGFC;AAAA,MACE,MAAM,CAACpB,EAAM,QAAQA,EAAM,IAAI;AAAA,MAC/B,MAAM;AACJ,QAAIA,EAAM,UAAUA,EAAM,WAAWE,EAAK,OAAO,SAC/CA,EAAK,UAAUF,EAAM,MAAM,GAE7BA,EAAM,QAAQE,EAAK,cAAcF,EAAM,IAAI;AAAA,MAC7C;AAAA,MACA,EAAE,WAAW,GAAA;AAAA,IAAK,GAGpBoB;AAAA,MACE,MAAML,EAAY;AAAA,MAClB,CAACM,MAAW;AACV,cAAMd,IAAcE,EAASY,CAAM,KAAKZ,EAAS;AACjD,QAAAG,EAAU,YAAYL,CAAW;AAAA,MACnC;AAAA,MACA;AAAA,QACE,WAAW;AAAA,MAAA;AAAA,IACb;AAGF,UAAMgB,IAAc7B,EAAA;AACpB,IAAA8B,EAAU,MAAM;;AACd,OAAAC,IAAAF,EAAY,UAAZ,QAAAE,EAAmB,IAAI,UAAU,OAAO;AAAA,IAC1C,CAAC;AAED,UAAMC,IAAqBV,EAAS,MAAM;;AACxC,YAAMW,IAAqC;AAAA,QACzC,WAAWZ,EAAY,UAAU,SAAS,SAAS;AAAA,MAAA;AAErD,cAAIU,IAAAR,KAAA,gBAAAA,EAAa,UAAb,QAAAQ,EAAoB,OACtBE,EAAc,gBAAgB,MAAMV,EAAY,MAAM,KAEjDU;AAAA,IACT,CAAC;2BAICC,EAIqBC,EAAAC,CAAA,GAAA;AAAA,eAJG;AAAA,MAAJ,KAAIP;AAAA,MAAc,OAAM;AAAA,MAAsB,IAAIvB,EAAM;AAAA,IAAA;iBAC1E,MAEgB;AAAA,QAFhB+B,EAEgBF,UAFOH,EAAA,KAAkB,CAAA,GAAA;AAAA,qBACvC,MAAQ;AAAA,YAARM,EAAQC,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,UAAA;;;;;;;;"}
@@ -1,7 +1,7 @@
1
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
2
  import { materials as S } from "@opentiny/genui-sdk-materials-vue-opentiny-vue/materials";
3
- import { b as y } from "./injection-tokens-DDgspg4x.js";
4
- import { G as k } from "./chat.types-DEDNSs5o.js";
3
+ import { b as y } from "./injection-tokens-CuDQs1ne.js";
4
+ import { G as k } from "./chat.types-CIkLm6Gm.js";
5
5
  const b = /* @__PURE__ */ a({
6
6
  __name: "GenuiChatWithMaterials",
7
7
  props: {
@@ -46,4 +46,4 @@ const b = /* @__PURE__ */ a({
46
46
  export {
47
47
  b as _
48
48
  };
49
- //# sourceMappingURL=GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-zsZgFWJw.js.map
49
+ //# sourceMappingURL=GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-oky3QRk7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-zsZgFWJw.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;;;;;"}
1
+ {"version":3,"file":"GenuiChatWithMaterials.vue_vue_type_script_setup_true_lang-oky3QRk7.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;;;;;"}