@opentiny/genui-sdk-vue 1.2.1 → 1.3.0-alpha.3
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/GenuiRenderer-B9wcUl25.js +15164 -0
- package/dist/GenuiRenderer-B9wcUl25.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-BRLoMarP.js +1792 -0
- package/dist/chat.types-BRLoMarP.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 +89 -2407
- package/dist/index.js +28 -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 +1277 -0
- package/dist/legacy-chat.js +67 -0
- package/dist/legacy-chat.js.map +1 -0
- package/dist/legacy-renderer.d.ts +59 -0
- package/dist/legacy-renderer.js +41 -0
- package/dist/legacy-renderer.js.map +1 -0
- package/dist/renderer.d.ts +6 -2031
- 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 +1 -0
- package/dist/transform-jsx.js.map +1 -0
- package/package.json +30 -33
- package/dist/ConfigProvider-BaJsiFgd.js +0 -86
- package/dist/SchemaCardRenderer-Bjn61C0M.js +0 -13440
- package/dist/chat.types-Cqd67Yp-.js +0 -1753
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineComponent as p, ref as i, provide as c, createBlock as m, openBlock as u, mergeProps as l, createSlots as f, renderList as _, withCtx as d, renderSlot as h, normalizeProps as E, guardReactiveProps as g } from "vue";
|
|
2
|
+
import { materials as C } from "@opentiny/genui-sdk-materials-vue-opentiny-vue/materials";
|
|
3
|
+
import { b as I } from "./injection-tokens-CuDQs1ne.js";
|
|
4
|
+
import { a as k, G as N, c as P, u as R } from "./injection-tokens-CuDQs1ne.js";
|
|
5
|
+
import { G } from "./chat.types-BRLoMarP.js";
|
|
6
|
+
import { D as b, E as L, I as B, M as D, T as $, e as w, s as O, b as W, t as j, u as q, a as z } from "./chat.types-BRLoMarP.js";
|
|
7
|
+
const x = /* @__PURE__ */ p({
|
|
8
|
+
__name: "GenuiChatWithMaterials",
|
|
9
|
+
props: {
|
|
10
|
+
url: {},
|
|
11
|
+
model: {},
|
|
12
|
+
temperature: {},
|
|
13
|
+
messages: {},
|
|
14
|
+
chatConfig: {},
|
|
15
|
+
requiredCompleteFieldSelectors: {},
|
|
16
|
+
customComponents: {},
|
|
17
|
+
customSnippets: {},
|
|
18
|
+
customExamples: {},
|
|
19
|
+
customActions: {},
|
|
20
|
+
rendererSlots: {},
|
|
21
|
+
thinkComponent: { type: [Object, Function] },
|
|
22
|
+
roles: {},
|
|
23
|
+
features: {},
|
|
24
|
+
customFetch: { type: Function }
|
|
25
|
+
},
|
|
26
|
+
setup(S, { expose: a }) {
|
|
27
|
+
const s = i();
|
|
28
|
+
return c(I, C), a(
|
|
29
|
+
new Proxy({}, {
|
|
30
|
+
get(r, o) {
|
|
31
|
+
const t = s.value, e = t == null ? void 0 : t[o];
|
|
32
|
+
return typeof e == "function" ? e.bind(t) : e;
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
), (r, o) => (u(), m(G, l({
|
|
36
|
+
ref_key: "chatRef",
|
|
37
|
+
ref: s
|
|
38
|
+
}, r.$props), f({ _: 2 }, [
|
|
39
|
+
_(r.$slots, (t, e) => ({
|
|
40
|
+
name: e,
|
|
41
|
+
fn: d((n) => [
|
|
42
|
+
h(r.$slots, e, E(g(n || {})))
|
|
43
|
+
])
|
|
44
|
+
}))
|
|
45
|
+
]), 1040));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
export {
|
|
49
|
+
b as DEFAULT_IMAGE_FEATURES,
|
|
50
|
+
L as EventEmitter,
|
|
51
|
+
k as GENUI_CONFIG,
|
|
52
|
+
N as GENUI_I18N,
|
|
53
|
+
I as GENUI_MATERIALS,
|
|
54
|
+
x as GenuiLegacyChat,
|
|
55
|
+
B as IndexedDBStrategy,
|
|
56
|
+
D as MessageManager,
|
|
57
|
+
$ as ThinkTagWrapPattern,
|
|
58
|
+
P as createI18n,
|
|
59
|
+
w as emitter,
|
|
60
|
+
O as scrollEnd,
|
|
61
|
+
W as throttle,
|
|
62
|
+
j as toSlotFunction,
|
|
63
|
+
q as useConversation,
|
|
64
|
+
R as useI18n,
|
|
65
|
+
z as useMessage
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=legacy-chat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-chat.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;;;;;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { CardSchema } from '@opentiny/genui-sdk-core';
|
|
2
|
+
import { Component } from 'vue';
|
|
3
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
4
|
+
import { ComponentProvideOptions } from 'vue';
|
|
5
|
+
import { DefineComponent } from 'vue';
|
|
6
|
+
import { IGenPromptAction } from '@opentiny/genui-sdk-core';
|
|
7
|
+
import { PublicProps } from 'vue';
|
|
8
|
+
import { VNode } from 'vue';
|
|
9
|
+
|
|
10
|
+
declare const __VLS_component: DefineComponent<IRendererProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<IRendererProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
11
|
+
|
|
12
|
+
declare function __VLS_template(): {
|
|
13
|
+
attrs: Partial<{}>;
|
|
14
|
+
slots: Readonly<IRendererSlots> & IRendererSlots;
|
|
15
|
+
refs: {};
|
|
16
|
+
rootEl: HTMLDivElement;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
20
|
+
|
|
21
|
+
declare type __VLS_WithTemplateSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export declare const GenuiLegacyRenderer: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
28
|
+
|
|
29
|
+
export declare interface ICustomAction extends Partial<IGenPromptAction> {
|
|
30
|
+
execute: (params: any, context: Record<string, any>) => any;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export declare interface IRendererProps {
|
|
34
|
+
content: string | {
|
|
35
|
+
[prop: string]: any;
|
|
36
|
+
};
|
|
37
|
+
generating?: boolean;
|
|
38
|
+
isJsonComplete?: boolean;
|
|
39
|
+
customComponents?: Record<string, Component>;
|
|
40
|
+
customActions?: Record<string, ICustomAction>;
|
|
41
|
+
requiredCompleteFieldSelectors?: string[];
|
|
42
|
+
id?: string;
|
|
43
|
+
state?: Record<string, any>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export declare interface IRendererSlots {
|
|
47
|
+
header?: Component<IRendererSlotsProps> | ((props: IRendererSlotsProps) => VNode | VNode[]);
|
|
48
|
+
footer?: Component<IRendererSlotsProps> | ((props: IRendererSlotsProps) => VNode | VNode[]);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export declare interface IRendererSlotsProps {
|
|
52
|
+
schema: CardSchema;
|
|
53
|
+
isError: boolean;
|
|
54
|
+
isFinished: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export declare const requiredCompleteFieldSelectors: string[];
|
|
58
|
+
|
|
59
|
+
export { }
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { defineComponent as a, provide as i, createBlock as p, openBlock as m, normalizeProps as r, guardReactiveProps as t, createSlots as l, withCtx as s, renderSlot as n } from "vue";
|
|
2
|
+
import { materials as d } from "@opentiny/genui-sdk-materials-vue-opentiny-vue/materials";
|
|
3
|
+
import { b as c } from "./injection-tokens-CuDQs1ne.js";
|
|
4
|
+
import { G as f } from "./GenuiRenderer-B9wcUl25.js";
|
|
5
|
+
import { r as g } from "./GenuiRenderer-B9wcUl25.js";
|
|
6
|
+
const S = /* @__PURE__ */ a({
|
|
7
|
+
__name: "GenuiRendererWithMaterials",
|
|
8
|
+
props: {
|
|
9
|
+
content: {},
|
|
10
|
+
generating: { type: Boolean },
|
|
11
|
+
isJsonComplete: { type: Boolean },
|
|
12
|
+
customComponents: {},
|
|
13
|
+
customActions: {},
|
|
14
|
+
requiredCompleteFieldSelectors: {},
|
|
15
|
+
id: {},
|
|
16
|
+
state: {}
|
|
17
|
+
},
|
|
18
|
+
setup(u) {
|
|
19
|
+
return i(c, d), (e, h) => (m(), p(f, r(t(e.$props)), l({ _: 2 }, [
|
|
20
|
+
e.$slots.header ? {
|
|
21
|
+
name: "header",
|
|
22
|
+
fn: s((o) => [
|
|
23
|
+
n(e.$slots, "header", r(t(o)))
|
|
24
|
+
]),
|
|
25
|
+
key: "0"
|
|
26
|
+
} : void 0,
|
|
27
|
+
e.$slots.footer ? {
|
|
28
|
+
name: "footer",
|
|
29
|
+
fn: s((o) => [
|
|
30
|
+
n(e.$slots, "footer", r(t(o)))
|
|
31
|
+
]),
|
|
32
|
+
key: "1"
|
|
33
|
+
} : void 0
|
|
34
|
+
]), 1040));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export {
|
|
38
|
+
S as GenuiLegacyRenderer,
|
|
39
|
+
g as requiredCompleteFieldSelectors
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=legacy-renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-renderer.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;;;;;;"}
|