@opentiny/genui-sdk-vue 1.1.2-beta.1 → 1.3.0-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.
- package/dist/ConfigProvider-BaJsiFgd.js +86 -0
- package/dist/SchemaCardRenderer-DzR7P9dr.js +13429 -0
- package/dist/___vite-browser-external_commonjs-proxy-4gYZYw55.js +56 -0
- package/dist/chat.d.ts +2882 -0
- package/dist/chat.js +22 -0
- package/dist/chat.types-B-ImpWnq.js +1753 -0
- package/dist/config-provider.d.ts +54 -0
- package/dist/config-provider.js +5 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +27 -82419
- package/dist/injection-tokens-D8CFCpjy.js +114 -0
- package/dist/renderer.d.ts +2099 -0
- package/dist/renderer.js +5 -0
- package/dist/transform-jsx.d.ts +3 -0
- package/dist/transform-jsx.js +67073 -0
- package/package.json +47 -2
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".tg-config-provider[data-v-e0ab6374]{--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 k, defineComponent as y, provide as m, computed as a, watch as h, onMounted as P, createBlock as I, openBlock as N, unref as u, withCtx as f, createVNode as E, normalizeProps as G, guardReactiveProps as $, renderSlot as b } from "vue";
|
|
3
|
+
import { TinyConfigProvider as x } from "@opentiny/vue";
|
|
4
|
+
import { ThemeProvider as L } from "@opentiny/tiny-robot";
|
|
5
|
+
import R, { tinyOldTheme as z, tinyDarkTheme as A } from "@opentiny/vue-theme/theme-tool";
|
|
6
|
+
import { G as B, u as O, b as Q, _ as U } from "./injection-tokens-D8CFCpjy.js";
|
|
7
|
+
const v = () => typeof window < "u" && window.matchMedia, g = () => v() && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", T = p(g());
|
|
8
|
+
let s = null;
|
|
9
|
+
const D = () => {
|
|
10
|
+
T.value = g();
|
|
11
|
+
}, F = () => {
|
|
12
|
+
v() && !s && (s = window.matchMedia("(prefers-color-scheme: dark)"), s.addEventListener("change", D));
|
|
13
|
+
}, S = () => (F(), {
|
|
14
|
+
theme: k(T)
|
|
15
|
+
}), V = /* @__PURE__ */ y({
|
|
16
|
+
__name: "ConfigProvider",
|
|
17
|
+
props: {
|
|
18
|
+
theme: {},
|
|
19
|
+
id: { default: "tiny-genui-config-provider" },
|
|
20
|
+
locale: { default: "zh_CN" },
|
|
21
|
+
i18n: {}
|
|
22
|
+
},
|
|
23
|
+
setup(_) {
|
|
24
|
+
const e = _, i = O();
|
|
25
|
+
m(B, i);
|
|
26
|
+
const d = (t) => {
|
|
27
|
+
const r = structuredClone(t);
|
|
28
|
+
return r.css = r.css.replaceAll(":host", `#${e.id}`).replaceAll(":root", `#${e.id}`), r;
|
|
29
|
+
}, c = {
|
|
30
|
+
dark: d(A),
|
|
31
|
+
lite: d(z),
|
|
32
|
+
light: { css: " " }
|
|
33
|
+
}, w = new R(), { theme: C } = S(), n = a(() => e.theme === "auto" ? C.value : e.theme), o = a(() => ({
|
|
34
|
+
theme: n.value,
|
|
35
|
+
id: e.id
|
|
36
|
+
}));
|
|
37
|
+
m(Q, o), h(
|
|
38
|
+
() => [e.locale, e.i18n],
|
|
39
|
+
() => {
|
|
40
|
+
i.setLocale(e.locale), e.i18n && i.mergeMessages(e.i18n);
|
|
41
|
+
},
|
|
42
|
+
{ immediate: !0 }
|
|
43
|
+
), h(
|
|
44
|
+
() => n.value,
|
|
45
|
+
(t) => {
|
|
46
|
+
const r = c[t] || c.light;
|
|
47
|
+
w.changeTheme(r);
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
immediate: !0
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
const l = p();
|
|
54
|
+
P(() => {
|
|
55
|
+
var t;
|
|
56
|
+
(t = l.value) == null || t.$el.classList.remove("tiny-config-provider");
|
|
57
|
+
});
|
|
58
|
+
const M = a(() => {
|
|
59
|
+
var r;
|
|
60
|
+
const t = {
|
|
61
|
+
colorMode: n.value === "dark" ? "dark" : "light"
|
|
62
|
+
};
|
|
63
|
+
return (r = o == null ? void 0 : o.value) != null && r.id && (t.targetElement = "#" + o.value.id), t;
|
|
64
|
+
});
|
|
65
|
+
return (t, r) => (N(), I(u(x), {
|
|
66
|
+
ref_key: "providerRef",
|
|
67
|
+
ref: l,
|
|
68
|
+
class: "tg-config-provider",
|
|
69
|
+
id: e.id
|
|
70
|
+
}, {
|
|
71
|
+
default: f(() => [
|
|
72
|
+
E(u(L), G($(M.value)), {
|
|
73
|
+
default: f(() => [
|
|
74
|
+
b(t.$slots, "default", {}, void 0, !0)
|
|
75
|
+
]),
|
|
76
|
+
_: 3
|
|
77
|
+
}, 16)
|
|
78
|
+
]),
|
|
79
|
+
_: 3
|
|
80
|
+
}, 8, ["id"]));
|
|
81
|
+
}
|
|
82
|
+
}), K = /* @__PURE__ */ U(V, [["__scopeId", "data-v-e0ab6374"]]);
|
|
83
|
+
export {
|
|
84
|
+
K as C,
|
|
85
|
+
S as u
|
|
86
|
+
};
|