@levo-so/site-runtime 0.3.10 → 0.3.12
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/{KBChatWidget-ByOwQQNg.js → KBChatWidget-CXIsQEgj.js} +378 -379
- package/{PopupBody-BI-MJqmd-DW3qWKam.js → PopupBody-BI-MJqmd-Dy94OeBQ.js} +1 -1
- package/{PopupRenderer-D66Gx63H-BnOmWsyj.js → PopupRenderer-D66Gx63H-DkprAQH7.js} +1 -1
- package/blog-content.d.ts +31 -0
- package/{rich-text.js → blog-content.js} +3 -3
- package/{dist-BdNHqoWi.js → dist-1r8apbDv.js} +56 -51
- package/{dist-Cl_sKk9y.js → dist-B7c9xjWu.js} +1 -1
- package/index.d.ts +167 -10
- package/index.js +628 -531
- package/kbChat-jqrzqmaT.js +173 -0
- package/package.json +6 -6
- package/{pillChrome-_hpGdrBS.js → pillChrome-CEpWGNZB.js} +7 -7
- package/popups.js +1 -1
- package/kbChat-GBcfFoss.js +0 -173
- package/rich-text.d.ts +0 -25
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { C as e, a as t, c as n, f as r, g as i, h as a, l as o, m as s, n as c, o as l, p as u, r as d, t as f, u as p } from "./pillChrome-CEpWGNZB.js";
|
|
3
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect as g, useRef as _, useState as v } from "react";
|
|
5
|
+
import { ArrowUp as y, Sparkles as b } from "lucide-react";
|
|
6
|
+
//#region ../../libraries/ai-chat/src/useActiveAgent.ts
|
|
7
|
+
var x = (t) => e("active_agent", t), S = (e) => {
|
|
8
|
+
let t = x(e);
|
|
9
|
+
if (!t || typeof window > "u") return null;
|
|
10
|
+
try {
|
|
11
|
+
let e = window.sessionStorage.getItem(t);
|
|
12
|
+
if (!e) return null;
|
|
13
|
+
let n = JSON.parse(e);
|
|
14
|
+
return typeof n?.id != "string" || n.id.length === 0 ? null : n;
|
|
15
|
+
} catch {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
}, C = (e, t) => {
|
|
19
|
+
let n = x(e);
|
|
20
|
+
if (!(!n || typeof window > "u")) try {
|
|
21
|
+
t === null ? window.sessionStorage.removeItem(n) : window.sessionStorage.setItem(n, JSON.stringify(t));
|
|
22
|
+
} catch {}
|
|
23
|
+
}, w = ({ url: e, workspaceId: t, headers: n, path: r }) => {
|
|
24
|
+
let [i, a] = v({ status: "loading" });
|
|
25
|
+
g(() => {
|
|
26
|
+
let e = S(t);
|
|
27
|
+
a(e ? {
|
|
28
|
+
status: "ready",
|
|
29
|
+
agent: e
|
|
30
|
+
} : (e) => e.status === "ready" ? { status: "loading" } : e);
|
|
31
|
+
}, [t]);
|
|
32
|
+
let o = _(n);
|
|
33
|
+
return o.current = n, g(() => {
|
|
34
|
+
if (!t || !e) return;
|
|
35
|
+
let n = r ? `${e}${e.includes("?") ? "&" : "?"}path=${encodeURIComponent(r)}` : e, i = new AbortController();
|
|
36
|
+
return (async () => {
|
|
37
|
+
try {
|
|
38
|
+
let e = await fetch(n, {
|
|
39
|
+
method: "GET",
|
|
40
|
+
credentials: "include",
|
|
41
|
+
headers: o.current,
|
|
42
|
+
signal: i.signal
|
|
43
|
+
});
|
|
44
|
+
if (!e.ok) {
|
|
45
|
+
C(t, null), a({ status: "missing" });
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
let r = (await e.json())?.content?.data;
|
|
49
|
+
if (!r || typeof r.id != "string" || r.id.length === 0) {
|
|
50
|
+
C(t, null), a({ status: "missing" });
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
C(t, r), a({
|
|
54
|
+
status: "ready",
|
|
55
|
+
agent: r
|
|
56
|
+
});
|
|
57
|
+
} catch (e) {
|
|
58
|
+
if (e?.name === "AbortError") return;
|
|
59
|
+
console.warn("[levo-kb-chat] active-agent boot failed:", e), a({ status: "error" });
|
|
60
|
+
}
|
|
61
|
+
})(), () => i.abort();
|
|
62
|
+
}, [
|
|
63
|
+
t,
|
|
64
|
+
e,
|
|
65
|
+
r
|
|
66
|
+
]), i;
|
|
67
|
+
}, T = (...e) => e.filter(Boolean).join(" "), E = () => import("./KBChatWidget-CXIsQEgj.js"), D = (e) => {
|
|
68
|
+
let [t, n] = v(null), [r, i] = v(!1), [a, o] = v("");
|
|
69
|
+
return t ? /* @__PURE__ */ m(t, {
|
|
70
|
+
initialOpen: !0,
|
|
71
|
+
initialDraft: a,
|
|
72
|
+
...e
|
|
73
|
+
}) : /* @__PURE__ */ m(k, {
|
|
74
|
+
siteName: e.siteName,
|
|
75
|
+
draft: a,
|
|
76
|
+
loading: r,
|
|
77
|
+
onDraftChange: o,
|
|
78
|
+
onActivate: () => {
|
|
79
|
+
r || t || (i(!0), E().then((e) => n(() => e.KBChatWidget)).catch((e) => {
|
|
80
|
+
i(!1), console.warn("[levo-kb-chat] widget load failed:", e);
|
|
81
|
+
}));
|
|
82
|
+
},
|
|
83
|
+
onPrefetch: () => {
|
|
84
|
+
E().catch(() => {});
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}, O = () => /* @__PURE__ */ m("span", {
|
|
88
|
+
"aria-hidden": !0,
|
|
89
|
+
className: "h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"
|
|
90
|
+
}), k = ({ siteName: e, draft: i, loading: g, onDraftChange: x, onActivate: S, onPrefetch: C }) => {
|
|
91
|
+
let w = _(null), E = _(null), D = a(e), [k, A] = v(!1);
|
|
92
|
+
return /* @__PURE__ */ m("div", {
|
|
93
|
+
onPointerEnter: C,
|
|
94
|
+
className: T("ai-chat-launcher fixed bottom-8 left-1/2 z-[60] -translate-x-1/2", u),
|
|
95
|
+
children: /* @__PURE__ */ m("div", {
|
|
96
|
+
className: T(c, n, "ai-chat-intro-morph"),
|
|
97
|
+
children: /* @__PURE__ */ h("div", {
|
|
98
|
+
ref: E,
|
|
99
|
+
className: T(p, k && "ai-chat-pill-surface--stacked"),
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ m("button", {
|
|
102
|
+
type: "button",
|
|
103
|
+
onClick: S,
|
|
104
|
+
onFocus: C,
|
|
105
|
+
"aria-label": "Open AI chat",
|
|
106
|
+
className: o,
|
|
107
|
+
children: g ? /* @__PURE__ */ m(O, {}) : /* @__PURE__ */ m(b, { className: "h-5 w-5" })
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ h("div", {
|
|
110
|
+
className: d,
|
|
111
|
+
children: [/* @__PURE__ */ m("textarea", {
|
|
112
|
+
ref: w,
|
|
113
|
+
rows: 1,
|
|
114
|
+
autoComplete: "off",
|
|
115
|
+
autoCorrect: "off",
|
|
116
|
+
autoCapitalize: "none",
|
|
117
|
+
inputMode: "text",
|
|
118
|
+
value: i,
|
|
119
|
+
"aria-label": D,
|
|
120
|
+
onFocus: S,
|
|
121
|
+
onChange: (e) => {
|
|
122
|
+
let t = e.currentTarget;
|
|
123
|
+
x(t.value), E.current && A(s(E.current, t));
|
|
124
|
+
},
|
|
125
|
+
className: r
|
|
126
|
+
}), !i && /* @__PURE__ */ m("span", {
|
|
127
|
+
className: T("ai-chat-pill-label pointer-events-none absolute inset-y-0 left-0 flex max-w-full items-center truncate bg-clip-text font-semibold text-[15px] text-transparent", "ai-chat-intro-label"),
|
|
128
|
+
"aria-hidden": !0,
|
|
129
|
+
children: D
|
|
130
|
+
})]
|
|
131
|
+
}),
|
|
132
|
+
/* @__PURE__ */ m("div", {
|
|
133
|
+
className: f,
|
|
134
|
+
children: /* @__PURE__ */ m("button", {
|
|
135
|
+
type: "button",
|
|
136
|
+
onClick: S,
|
|
137
|
+
"aria-label": "Open AI chat",
|
|
138
|
+
className: t,
|
|
139
|
+
style: l,
|
|
140
|
+
children: g ? /* @__PURE__ */ m(O, {}) : /* @__PURE__ */ m(y, { className: "h-5 w-5 stroke-[2.5px]" })
|
|
141
|
+
})
|
|
142
|
+
})
|
|
143
|
+
]
|
|
144
|
+
})
|
|
145
|
+
})
|
|
146
|
+
});
|
|
147
|
+
}, A = "/.levo/public/api/v1/agents/kb-chat/public", j = (e) => e.replace(/\/v1\/agents\/kb-chat\/public\/?$/, ""), M = ({ workspaceId: e, siteName: t, siteLogo: n, siteIcon: r, apiBaseUrl: a = A, authHeaders: o, showBranding: s, siteSlug: c, path: l }) => {
|
|
148
|
+
let u = w({
|
|
149
|
+
url: `${j(a)}/v1/intelligence/site-agent/get-active`,
|
|
150
|
+
workspaceId: e,
|
|
151
|
+
headers: e ? {
|
|
152
|
+
...i(o),
|
|
153
|
+
"Levo-Workspace": e
|
|
154
|
+
} : i(o),
|
|
155
|
+
path: l
|
|
156
|
+
});
|
|
157
|
+
return u.status === "ready" ? /* @__PURE__ */ m("div", {
|
|
158
|
+
"data-ai-chat-root": !0,
|
|
159
|
+
children: /* @__PURE__ */ m(D, {
|
|
160
|
+
workspaceId: e,
|
|
161
|
+
siteName: t,
|
|
162
|
+
siteLogo: n,
|
|
163
|
+
siteIcon: r,
|
|
164
|
+
agentId: u.agent.id,
|
|
165
|
+
apiBaseUrl: a,
|
|
166
|
+
authHeaders: o,
|
|
167
|
+
showBranding: s,
|
|
168
|
+
siteSlug: c
|
|
169
|
+
})
|
|
170
|
+
}) : null;
|
|
171
|
+
};
|
|
172
|
+
//#endregion
|
|
173
|
+
export { M as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levo-so/site-runtime",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
4
4
|
"description": "Runtime for Levo Studio v3 sites — the editor preview inspector, page head metadata, and the Levo data client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"types": "./popups.d.ts",
|
|
22
22
|
"default": "./popups.js"
|
|
23
23
|
},
|
|
24
|
-
"./
|
|
25
|
-
"types": "./
|
|
26
|
-
"default": "./
|
|
24
|
+
"./blog-content": {
|
|
25
|
+
"types": "./blog-content.d.ts",
|
|
26
|
+
"default": "./blog-content.js"
|
|
27
27
|
},
|
|
28
28
|
"./start": {
|
|
29
29
|
"types": "./start.d.ts",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"@stripe/react-stripe-js": "3.1.1",
|
|
86
86
|
"@stripe/stripe-js": "5.5.0",
|
|
87
87
|
"react-razorpay": "3.0.1",
|
|
88
|
-
"@levo-so/core": "0.3.
|
|
89
|
-
"@levo-so/insights": "0.3.
|
|
88
|
+
"@levo-so/core": "0.3.12",
|
|
89
|
+
"@levo-so/insights": "0.3.12"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@base-ui/react": "^1.5.0",
|
|
@@ -38,13 +38,13 @@ var e = "disabled:cursor-not-allowed disabled:opacity-40", t = (e) => {
|
|
|
38
38
|
let t = e.value.length;
|
|
39
39
|
e.setSelectionRange(t, t);
|
|
40
40
|
});
|
|
41
|
-
}, l = "w-72",
|
|
42
|
-
e.classList.remove(
|
|
43
|
-
let n = t.scrollHeight >
|
|
44
|
-
return e.classList.toggle(
|
|
45
|
-
},
|
|
41
|
+
}, l = (e) => typeof e == "function" ? e() : e ?? {}, u = "w-72", d = "ai-chat-pill-gradient relative rounded-[30px] p-[2px] transition-shadow duration-300", f = "shadow-lg shadow-zinc-950/10", p = "shadow-md", m = "ai-chat-pill-surface min-h-14 w-full rounded-[28px] bg-white p-1.5", h = "ai-chat-pill-surface--stacked", g = "ai-chat-pill-input relative min-w-0", _ = "ai-chat-pill-actions flex items-center gap-1.5", v = "ai-chat-pill-spark flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full text-blue-500 transition-[background-color,transform] duration-150 hover:bg-zinc-50 active:scale-95", y = "flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full shadow-sm transition-[transform,box-shadow] duration-150 hover:scale-105 hover:shadow-md active:scale-95", b = "block h-6 max-h-[120px] w-full resize-none overflow-y-auto bg-transparent text-base text-zinc-900 leading-6 placeholder:text-zinc-400 focus:outline-none", x = 24, S = (e, t) => {
|
|
42
|
+
e.classList.remove(h), t.style.height = "auto";
|
|
43
|
+
let n = t.scrollHeight > x + 4;
|
|
44
|
+
return e.classList.toggle(h, n), s(t, 120), n;
|
|
45
|
+
}, C = "ai-chat-pill-label pointer-events-none absolute inset-y-0 left-0 flex max-w-full items-center truncate bg-clip-text font-semibold text-[15px] text-transparent", w = {
|
|
46
46
|
backgroundColor: "var(--color-brand, #0a0a0a)",
|
|
47
47
|
color: "var(--color-brand-foreground, #fff)"
|
|
48
|
-
},
|
|
48
|
+
}, T = (e) => e ? `Ask ${e}` : "Ask AI";
|
|
49
49
|
//#endregion
|
|
50
|
-
export { o as S,
|
|
50
|
+
export { o as C, a as S, e as _, y as a, i as b, f as c, h as d, b as f, l as g, T as h, C as i, v as l, S as m, d as n, w as o, u as p, g as r, p as s, _ as t, m as u, s as v, r as x, c as y };
|
package/popups.js
CHANGED
package/kbChat-GBcfFoss.js
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { S as e, a as t, c as n, f as r, h as i, l as a, m as o, n as s, o as c, p as l, r as u, t as d, u as f } from "./pillChrome-_hpGdrBS.js";
|
|
3
|
-
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
4
|
-
import { useEffect as h, useRef as g, useState as _ } from "react";
|
|
5
|
-
import { ArrowUp as v, Sparkles as y } from "lucide-react";
|
|
6
|
-
//#region ../../libraries/ai-chat/src/useActiveAgent.ts
|
|
7
|
-
var b = (t) => e("active_agent", t), x = (e) => {
|
|
8
|
-
let t = b(e);
|
|
9
|
-
if (!t || typeof window > "u") return null;
|
|
10
|
-
try {
|
|
11
|
-
let e = window.sessionStorage.getItem(t);
|
|
12
|
-
if (!e) return null;
|
|
13
|
-
let n = JSON.parse(e);
|
|
14
|
-
return typeof n?.id != "string" || n.id.length === 0 ? null : n;
|
|
15
|
-
} catch {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
}, S = (e, t) => {
|
|
19
|
-
let n = b(e);
|
|
20
|
-
if (!(!n || typeof window > "u")) try {
|
|
21
|
-
t === null ? window.sessionStorage.removeItem(n) : window.sessionStorage.setItem(n, JSON.stringify(t));
|
|
22
|
-
} catch {}
|
|
23
|
-
}, C = ({ url: e, workspaceId: t, headers: n, path: r }) => {
|
|
24
|
-
let [i, a] = _({ status: "loading" });
|
|
25
|
-
h(() => {
|
|
26
|
-
let e = x(t);
|
|
27
|
-
a(e ? {
|
|
28
|
-
status: "ready",
|
|
29
|
-
agent: e
|
|
30
|
-
} : (e) => e.status === "ready" ? { status: "loading" } : e);
|
|
31
|
-
}, [t]);
|
|
32
|
-
let o = g(n);
|
|
33
|
-
return o.current = n, h(() => {
|
|
34
|
-
if (!t || !e) return;
|
|
35
|
-
let n = r ? `${e}${e.includes("?") ? "&" : "?"}path=${encodeURIComponent(r)}` : e, i = new AbortController();
|
|
36
|
-
return (async () => {
|
|
37
|
-
try {
|
|
38
|
-
let e = await fetch(n, {
|
|
39
|
-
method: "GET",
|
|
40
|
-
credentials: "include",
|
|
41
|
-
headers: o.current,
|
|
42
|
-
signal: i.signal
|
|
43
|
-
});
|
|
44
|
-
if (!e.ok) {
|
|
45
|
-
S(t, null), a({ status: "missing" });
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
let r = (await e.json())?.content?.data;
|
|
49
|
-
if (!r || typeof r.id != "string" || r.id.length === 0) {
|
|
50
|
-
S(t, null), a({ status: "missing" });
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
S(t, r), a({
|
|
54
|
-
status: "ready",
|
|
55
|
-
agent: r
|
|
56
|
-
});
|
|
57
|
-
} catch (e) {
|
|
58
|
-
if (e?.name === "AbortError") return;
|
|
59
|
-
console.warn("[levo-kb-chat] active-agent boot failed:", e), a({ status: "error" });
|
|
60
|
-
}
|
|
61
|
-
})(), () => i.abort();
|
|
62
|
-
}, [
|
|
63
|
-
t,
|
|
64
|
-
e,
|
|
65
|
-
r
|
|
66
|
-
]), i;
|
|
67
|
-
}, w = (...e) => e.filter(Boolean).join(" "), T = () => import("./KBChatWidget-ByOwQQNg.js"), E = (e) => {
|
|
68
|
-
let [t, n] = _(null), [r, i] = _(!1), [a, o] = _("");
|
|
69
|
-
return t ? /* @__PURE__ */ p(t, {
|
|
70
|
-
initialOpen: !0,
|
|
71
|
-
initialDraft: a,
|
|
72
|
-
...e
|
|
73
|
-
}) : /* @__PURE__ */ p(O, {
|
|
74
|
-
siteName: e.siteName,
|
|
75
|
-
draft: a,
|
|
76
|
-
loading: r,
|
|
77
|
-
onDraftChange: o,
|
|
78
|
-
onActivate: () => {
|
|
79
|
-
r || t || (i(!0), T().then((e) => n(() => e.KBChatWidget)).catch((e) => {
|
|
80
|
-
i(!1), console.warn("[levo-kb-chat] widget load failed:", e);
|
|
81
|
-
}));
|
|
82
|
-
},
|
|
83
|
-
onPrefetch: () => {
|
|
84
|
-
T().catch(() => {});
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}, D = () => /* @__PURE__ */ p("span", {
|
|
88
|
-
"aria-hidden": !0,
|
|
89
|
-
className: "h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"
|
|
90
|
-
}), O = ({ siteName: e, draft: h, loading: b, onDraftChange: x, onActivate: S, onPrefetch: C }) => {
|
|
91
|
-
let T = g(null), E = g(null), O = i(e), [k, A] = _(!1);
|
|
92
|
-
return /* @__PURE__ */ p("div", {
|
|
93
|
-
onPointerEnter: C,
|
|
94
|
-
className: w("ai-chat-launcher fixed bottom-8 left-1/2 z-[60] -translate-x-1/2", l),
|
|
95
|
-
children: /* @__PURE__ */ p("div", {
|
|
96
|
-
className: w(s, n, "ai-chat-intro-morph"),
|
|
97
|
-
children: /* @__PURE__ */ m("div", {
|
|
98
|
-
ref: E,
|
|
99
|
-
className: w(f, k && "ai-chat-pill-surface--stacked"),
|
|
100
|
-
children: [
|
|
101
|
-
/* @__PURE__ */ p("button", {
|
|
102
|
-
type: "button",
|
|
103
|
-
onClick: S,
|
|
104
|
-
onFocus: C,
|
|
105
|
-
"aria-label": "Open AI chat",
|
|
106
|
-
className: a,
|
|
107
|
-
children: b ? /* @__PURE__ */ p(D, {}) : /* @__PURE__ */ p(y, { className: "h-5 w-5" })
|
|
108
|
-
}),
|
|
109
|
-
/* @__PURE__ */ m("div", {
|
|
110
|
-
className: u,
|
|
111
|
-
children: [/* @__PURE__ */ p("textarea", {
|
|
112
|
-
ref: T,
|
|
113
|
-
rows: 1,
|
|
114
|
-
autoComplete: "off",
|
|
115
|
-
autoCorrect: "off",
|
|
116
|
-
autoCapitalize: "none",
|
|
117
|
-
inputMode: "text",
|
|
118
|
-
value: h,
|
|
119
|
-
"aria-label": O,
|
|
120
|
-
onFocus: S,
|
|
121
|
-
onChange: (e) => {
|
|
122
|
-
let t = e.currentTarget;
|
|
123
|
-
x(t.value), E.current && A(o(E.current, t));
|
|
124
|
-
},
|
|
125
|
-
className: r
|
|
126
|
-
}), !h && /* @__PURE__ */ p("span", {
|
|
127
|
-
className: w("ai-chat-pill-label pointer-events-none absolute inset-y-0 left-0 flex max-w-full items-center truncate bg-clip-text font-semibold text-[15px] text-transparent", "ai-chat-intro-label"),
|
|
128
|
-
"aria-hidden": !0,
|
|
129
|
-
children: O
|
|
130
|
-
})]
|
|
131
|
-
}),
|
|
132
|
-
/* @__PURE__ */ p("div", {
|
|
133
|
-
className: d,
|
|
134
|
-
children: /* @__PURE__ */ p("button", {
|
|
135
|
-
type: "button",
|
|
136
|
-
onClick: S,
|
|
137
|
-
"aria-label": "Open AI chat",
|
|
138
|
-
className: t,
|
|
139
|
-
style: c,
|
|
140
|
-
children: b ? /* @__PURE__ */ p(D, {}) : /* @__PURE__ */ p(v, { className: "h-5 w-5 stroke-[2.5px]" })
|
|
141
|
-
})
|
|
142
|
-
})
|
|
143
|
-
]
|
|
144
|
-
})
|
|
145
|
-
})
|
|
146
|
-
});
|
|
147
|
-
}, k = "/.levo/public/api/v1/agents/kb-chat/public", A = (e) => e.replace(/\/v1\/agents\/kb-chat\/public\/?$/, ""), j = ({ workspaceId: e, siteName: t, siteLogo: n, siteIcon: r, apiBaseUrl: i = k, authHeaders: a, showBranding: o, siteSlug: s, path: c }) => {
|
|
148
|
-
let l = C({
|
|
149
|
-
url: `${A(i)}/v1/intelligence/site-agent/get-active`,
|
|
150
|
-
workspaceId: e,
|
|
151
|
-
headers: e ? {
|
|
152
|
-
...a,
|
|
153
|
-
"Levo-Workspace": e
|
|
154
|
-
} : a,
|
|
155
|
-
path: c
|
|
156
|
-
});
|
|
157
|
-
return l.status === "ready" ? /* @__PURE__ */ p("div", {
|
|
158
|
-
"data-ai-chat-root": !0,
|
|
159
|
-
children: /* @__PURE__ */ p(E, {
|
|
160
|
-
workspaceId: e,
|
|
161
|
-
siteName: t,
|
|
162
|
-
siteLogo: n,
|
|
163
|
-
siteIcon: r,
|
|
164
|
-
agentId: l.agent.id,
|
|
165
|
-
apiBaseUrl: i,
|
|
166
|
-
authHeaders: a,
|
|
167
|
-
showBranding: o,
|
|
168
|
-
siteSlug: s
|
|
169
|
-
})
|
|
170
|
-
}) : null;
|
|
171
|
-
};
|
|
172
|
-
//#endregion
|
|
173
|
-
export { j as default };
|
package/rich-text.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare interface ILevoRichTextProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "content"> {
|
|
2
|
-
/**
|
|
3
|
-
* A record's rich-text field, exactly as the API returns it — `post.content`, or any
|
|
4
|
-
* collection field of kind `richtext`. Every shape the platform has ever stored is
|
|
5
|
-
* accepted; see {@link LevoRichText}.
|
|
6
|
-
*/
|
|
7
|
-
content: unknown;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Render a rich-text field — a blog post's body, a collection record's long-form field.
|
|
12
|
-
*
|
|
13
|
-
* THE way to put rich text on the page: the value is a ProseMirror document, not a string, so
|
|
14
|
-
* `String(post.content)` prints `[object Object]` and `dangerouslySetInnerHTML` has nothing to
|
|
15
|
-
* insert. This renders the same node set the Levo editor writes and Levo-hosted pages show —
|
|
16
|
-
* headings, lists, code blocks, images, bookmarks, buttons, embedded collections — server-side,
|
|
17
|
-
* so the article is in the SSR HTML where crawlers read it.
|
|
18
|
-
*
|
|
19
|
-
* Typography comes from the shared prose theme in `@levo-so/site-runtime/setup.css` (already
|
|
20
|
-
* loaded by the site shell). Style the wrapper through `className` as usual; content the field
|
|
21
|
-
* doesn't contain renders nothing, so an empty body is an empty region, never a crash.
|
|
22
|
-
*/
|
|
23
|
-
export declare const LevoRichText: React.FC<ILevoRichTextProps>;
|
|
24
|
-
|
|
25
|
-
export { }
|