@frontera-sdk/chat-ui 1.50.40
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/LICENSE +202 -0
- package/README.md +348 -0
- package/dist/af-DK_CjRn6-OPBHDTNZ.js +197 -0
- package/dist/agent-picker.d.ts +38 -0
- package/dist/agent-picker.js +8 -0
- package/dist/as-BPtSu6VN-O4ZZEAJG.js +11 -0
- package/dist/be-CrQ0smca-5HIE5K27.js +11 -0
- package/dist/bg-CrQqGwni-3IRVPZQ7.js +11 -0
- package/dist/bn-NCLZcWHi-XOZJFNIB.js +11 -0
- package/dist/ca-SUf6Y2Om-V6F2EBCA.js +38 -0
- package/dist/capture-NO5ZIGP6.js +1652 -0
- package/dist/chat.css +3555 -0
- package/dist/chat.d.ts +161 -0
- package/dist/chat.js +60498 -0
- package/dist/chunk-2KEBRV3W.js +191 -0
- package/dist/chunk-6BPHEBCF.js +639 -0
- package/dist/chunk-6HYPVNVA.js +25 -0
- package/dist/chunk-7ADM3CKD.js +10 -0
- package/dist/chunk-AFVU5VT6.js +5601 -0
- package/dist/chunk-BEJ3HQG4.js +93 -0
- package/dist/chunk-CCVPZVFK.js +28 -0
- package/dist/chunk-DGDHKMDB.js +10 -0
- package/dist/chunk-FXKXDR5K.js +2166 -0
- package/dist/chunk-GTQH7MPF.js +129 -0
- package/dist/chunk-I7SXWUAN.js +1258 -0
- package/dist/chunk-IQRPGFLI.js +234 -0
- package/dist/chunk-IXDM5R55.js +23 -0
- package/dist/chunk-JD6ETTXC.js +178 -0
- package/dist/chunk-OP4MLJDA.js +215 -0
- package/dist/chunk-PQZ2CS26.js +2315 -0
- package/dist/chunk-PR4QN5HX.js +38 -0
- package/dist/chunk-PUIVKDV5.js +271 -0
- package/dist/chunk-QSSFBZAS.js +6914 -0
- package/dist/chunk-RAKKA3WU.js +5896 -0
- package/dist/chunk-RB2Y4NYC.js +681 -0
- package/dist/chunk-VDZH5Z3K.js +72 -0
- package/dist/chunk-WMN6BPPS.js +49 -0
- package/dist/chunk-WO6DJLFE.js +10857 -0
- package/dist/chunk-X5E2DJVO.js +47634 -0
- package/dist/chunk-XJFTVKLW.js +2687 -0
- package/dist/chunk-ZS6PXIZP.js +187 -0
- package/dist/client.d.ts +89 -0
- package/dist/client.js +20 -0
- package/dist/composer.d.ts +23 -0
- package/dist/composer.js +89 -0
- package/dist/cop-C3sk0IUo-CIZA2H43.js +11 -0
- package/dist/credential.d.ts +75 -0
- package/dist/credential.js +3 -0
- package/dist/cs-CmAteokq-HAKEQPB4.js +17 -0
- package/dist/cu-CBUlrW6Y-QTZ6ZLA4.js +32 -0
- package/dist/cy-BBPa6z2x-MX6DGDNW.js +11 -0
- package/dist/da-CCDXfXtG-5YEOHMG3.js +11 -0
- package/dist/de-1901-CWoAOigE-63QFSF2A.js +11 -0
- package/dist/de-1996-BL6awyxG-R2PHKMAB.js +11 -0
- package/dist/de-ch-1901-hVThVHVb-JSDB53OZ.js +11 -0
- package/dist/el-monoton-D3aKqTz2-2V4OOFBB.js +11 -0
- package/dist/el-polyton-ogVWcTzh-3U7NGQMT.js +11 -0
- package/dist/en-gb-B7Al27b_-UKCBQFSU.js +21 -0
- package/dist/es-DcaaHPU_-NOBXSOZK.js +11 -0
- package/dist/esm-MHF25KDL.js +3 -0
- package/dist/et-B_spaleu-5UAYIW62.js +11 -0
- package/dist/eu-Ctv_kq9Z-V5DREOPN.js +11 -0
- package/dist/fi-RW5VB8Yp-YSXBK7LW.js +11 -0
- package/dist/fr-BC2onEz9-7KH5T76G.js +11 -0
- package/dist/frame.d.ts +59 -0
- package/dist/frame.js +111 -0
- package/dist/fur-AC12wySk-4PD2Y72H.js +11 -0
- package/dist/ga-Cn6LkudM-RRAAJT3N.js +58 -0
- package/dist/gl-DZGc-K_G-KYSXXTCY.js +11 -0
- package/dist/grc-DOlGgO8T-2HXBZVJ5.js +11 -0
- package/dist/gu-Bjl0l-cf-4CFSVZHZ.js +11 -0
- package/dist/header.d.ts +78 -0
- package/dist/header.js +18 -0
- package/dist/hi-DsAaTPCC-KMCFBWK7.js +11 -0
- package/dist/hr-DT1SBBes-X2TIX6EI.js +11 -0
- package/dist/hsb-DC_ITc1e-PXLERA7R.js +46 -0
- package/dist/hu-DVk7Y_ka-PJPVU54B.js +11 -0
- package/dist/hy-e995ysyO-MZBRFX52.js +11 -0
- package/dist/ia-Cr4TJH0c-D3O2FHGP.js +22 -0
- package/dist/id-DifDyWg9-MZ2BGHWI.js +58 -0
- package/dist/is-BT8UVRze-CZZCKEFI.js +11 -0
- package/dist/it-Bt_Meacx-T4Y5JYV6.js +11 -0
- package/dist/ka-jyoLzyDE-ES6EXZLW.js +11 -0
- package/dist/kmr-Cfwhwuff-TSW2R2KS.js +11 -0
- package/dist/kn-C6Lov-DP-B4BL47CE.js +11 -0
- package/dist/la-DuvHjUWw-6K7TFU6X.js +11 -0
- package/dist/la-x-classic-yTyAOQEt-YWTKMM2L.js +11 -0
- package/dist/la-x-liturgic-CXeQb4FY-B772L5E7.js +11 -0
- package/dist/lib-3ZKX25RJ.js +4511 -0
- package/dist/lt-BBe8DlDF-4YINVOZR.js +11 -0
- package/dist/lv-Q2BBHnzp-TMVQ3MX2.js +11 -0
- package/dist/message.d.ts +64 -0
- package/dist/message.js +18 -0
- package/dist/ml-2xLVYkVY-NGZLAPIN.js +11 -0
- package/dist/mn-cyrl-lHM4n0oC-DGBYYUT3.js +11 -0
- package/dist/mn-cyrl-x-lmc-3aetruI8-QHJABMOO.js +11 -0
- package/dist/mr-CjWJPVmH-X5UHV65O.js +11 -0
- package/dist/mul-ethi-D_CMSMEq-H7UMQSOQ.js +11 -0
- package/dist/nb-DI8u59ch-J4CAVI4Y.js +122 -0
- package/dist/new-session-Dw7JOgzu.d.ts +141 -0
- package/dist/new-session.d.ts +4 -0
- package/dist/new-session.js +10 -0
- package/dist/nl-BHQJ6Gvn-7BH55RA7.js +52 -0
- package/dist/nn-ntZvarUK-KKNCHHJ4.js +122 -0
- package/dist/no-B8ItS0F3-3ZXIRJ6U.js +120 -0
- package/dist/oauth-callback.d.ts +35 -0
- package/dist/oauth-callback.js +18 -0
- package/dist/oc-P_i3-xLA-XZM6E5YZ.js +11 -0
- package/dist/or-50rxpoq4-5VELAFMJ.js +11 -0
- package/dist/pa-C54UG8eN-WEJPMZ6Z.js +11 -0
- package/dist/parts.d.ts +49 -0
- package/dist/parts.js +106 -0
- package/dist/pdf-cover-thumbnail-inner-4N2Q5AAG.js +36 -0
- package/dist/pdf-deck-view-inner-FZVLAEQR.js +575 -0
- package/dist/pdf-document-view-inner-6DF54JWK.js +585 -0
- package/dist/pdf-viewer-inner-GPES3KG2.js +256 -0
- package/dist/pending-cards.d.ts +26 -0
- package/dist/pending-cards.js +9 -0
- package/dist/pi-B9cgjyG1-GD5ASDDU.js +11 -0
- package/dist/pl-9fg-ESVt-UMX7MCJM.js +32 -0
- package/dist/platform.css +4013 -0
- package/dist/pms-BRGfm5gS-SSE3AUW5.js +11 -0
- package/dist/pt-Cum2_NUC-W35JYVR4.js +11 -0
- package/dist/rm-C0MIK9N4-IWL4YTNT.js +11 -0
- package/dist/ro-0fmdH0HA-46WUTOYH.js +11 -0
- package/dist/ru-v4l-ayaq-BUGK6XCN.js +196 -0
- package/dist/sa-CKY9c_Vq-4KIJOI5Y.js +11 -0
- package/dist/sh-cyrl-BpCRFOmq-DSLQ4UY2.js +128 -0
- package/dist/sh-latn-sRy4Tuaj-UNQOR63V.js +128 -0
- package/dist/sk-_iOeDNrQ-NCTQKH25.js +17 -0
- package/dist/sl-DpiklF-D-6GG5TDVN.js +11 -0
- package/dist/sr-cyrl-Dpzrbd0W-4Q5226YJ.js +142 -0
- package/dist/sv-CFm5y56M-VTWNPZ7I.js +11 -0
- package/dist/ta-BcghgTbD-NRT35DW6.js +11 -0
- package/dist/te-B5Spl2Jk-5VE6CLN4.js +11 -0
- package/dist/th-DWX5iPSo-N5GMOQOP.js +11 -0
- package/dist/theme.d.ts +49 -0
- package/dist/theme.js +3 -0
- package/dist/tk-BMbKB10q-HGWWY5L3.js +11 -0
- package/dist/tr-CIHIuzqc-6ISBNYLV.js +11 -0
- package/dist/types-BDqLaBfH.d.ts +60 -0
- package/dist/uk-Dir3oxLs-YQ3QZRI4.js +11 -0
- package/dist/univer-workbook-BSSUE5TG.css +3555 -0
- package/dist/univer-workbook-N5IIN7CH.js +290849 -0
- package/dist/vega-chart-block-NQADYNWQ.js +2857 -0
- package/dist/zh-latn-pinyin-BdYb-Ey_-RB542AHF.js +11 -0
- package/package.json +137 -0
- package/src/styles.css +996 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from './chunk-ZS6PXIZP.js';
|
|
3
|
+
import { AgentAvatar } from './chunk-FXKXDR5K.js';
|
|
4
|
+
import { ChevronDownMediumIcon } from './chunk-AFVU5VT6.js';
|
|
5
|
+
import { useChatClientOptional } from './chunk-7ADM3CKD.js';
|
|
6
|
+
import { useState, useEffect } from 'react';
|
|
7
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
function useChatAgents(client, supplied) {
|
|
10
|
+
const fromContext = useChatClientOptional();
|
|
11
|
+
const chat = client ?? fromContext;
|
|
12
|
+
const [agents, setAgents] = useState(supplied ?? []);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (supplied || !chat) return;
|
|
15
|
+
let cancelled = false;
|
|
16
|
+
chat.listAgents().then((list) => {
|
|
17
|
+
if (!cancelled) setAgents(Array.isArray(list) ? list : []);
|
|
18
|
+
}).catch(() => {
|
|
19
|
+
});
|
|
20
|
+
return () => {
|
|
21
|
+
cancelled = true;
|
|
22
|
+
};
|
|
23
|
+
}, [chat, supplied]);
|
|
24
|
+
return supplied ?? agents;
|
|
25
|
+
}
|
|
26
|
+
function AgentPicker({ value, onChange, agents: supplied, className }) {
|
|
27
|
+
const agents = useChatAgents(void 0, supplied);
|
|
28
|
+
if (agents.length < 2) return null;
|
|
29
|
+
const active = agents.find((agent) => agent.agentId === value) ?? agents[0];
|
|
30
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
31
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { type: "button", className: `fr-agent-picker${className ? ` ${className}` : ""}`, children: [
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
AgentAvatar,
|
|
34
|
+
{
|
|
35
|
+
name: active.name,
|
|
36
|
+
config: active.avatarConfig,
|
|
37
|
+
seed: active.agentId,
|
|
38
|
+
size: 20,
|
|
39
|
+
className: "rounded-full"
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ jsx("span", { className: "fr-agent-name", children: active.name }),
|
|
43
|
+
/* @__PURE__ */ jsx(ChevronDownMediumIcon, { className: "fr-agent-chevron" })
|
|
44
|
+
] }) }),
|
|
45
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "start", className: "fr-agent-menu", children: agents.map((agent) => /* @__PURE__ */ jsxs(
|
|
46
|
+
DropdownMenuItem,
|
|
47
|
+
{
|
|
48
|
+
onSelect: () => onChange(agent),
|
|
49
|
+
"data-active": agent.agentId === active.agentId || void 0,
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
AgentAvatar,
|
|
53
|
+
{
|
|
54
|
+
name: agent.name,
|
|
55
|
+
config: agent.avatarConfig,
|
|
56
|
+
seed: agent.agentId,
|
|
57
|
+
size: 22,
|
|
58
|
+
className: "rounded-full"
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ jsxs("span", { className: "fr-agent-entry", children: [
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: "fr-agent-entry-name", children: agent.name }),
|
|
63
|
+
agent.description && /* @__PURE__ */ jsx("span", { className: "fr-agent-entry-desc", children: agent.description })
|
|
64
|
+
] })
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
agent.id
|
|
68
|
+
)) })
|
|
69
|
+
] });
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { AgentPicker, useChatAgents };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/vendor/lib/typing-target.ts
|
|
5
|
+
function isTypingTarget(target) {
|
|
6
|
+
const el = target;
|
|
7
|
+
if (!el || typeof el.tagName !== "string") return false;
|
|
8
|
+
return el.tagName === "INPUT" || el.tagName === "TEXTAREA" || el.tagName === "SELECT" || el.isContentEditable === true;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// src/vendor/ui/library/artifact-viewer/components/deck-key-scope.ts
|
|
12
|
+
var ARROW_OWNING_TAGS = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]);
|
|
13
|
+
var ARROW_OWNING_ROLES = /* @__PURE__ */ new Set(["menu", "menuitem", "listbox", "option", "combobox", "tablist", "tab", "slider", "spinbutton", "grid", "gridcell", "tree", "treeitem", "radiogroup", "radio"]);
|
|
14
|
+
function isFullscreenHotkey(e) {
|
|
15
|
+
if (e.key !== "f" && e.key !== "F") return false;
|
|
16
|
+
if (e.metaKey || e.ctrlKey || e.altKey) return false;
|
|
17
|
+
if (isTypingTarget(e.target)) return false;
|
|
18
|
+
if (typeof document !== "undefined" && document.fullscreenElement) return false;
|
|
19
|
+
const active = typeof document === "undefined" ? null : document.activeElement;
|
|
20
|
+
if (active && (isTypingTarget(active) || active.getAttribute("aria-expanded") === "true")) return false;
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
function deckOwnsArrowKeys(deck, hover, target) {
|
|
24
|
+
if (deck && deck.offsetParent === null) return false;
|
|
25
|
+
const el = target;
|
|
26
|
+
if (el && (el.tagName === "TEXTAREA" || el.tagName === "INPUT" || el.isContentEditable)) return false;
|
|
27
|
+
if (hover) return true;
|
|
28
|
+
const active = typeof document === "undefined" ? null : document.activeElement;
|
|
29
|
+
if (!active || active === document.body) return true;
|
|
30
|
+
if (deck?.contains(active)) return true;
|
|
31
|
+
if (ARROW_OWNING_TAGS.has(active.tagName) || active.isContentEditable) return false;
|
|
32
|
+
const role = active.getAttribute("role");
|
|
33
|
+
if (role && ARROW_OWNING_ROLES.has(role)) return false;
|
|
34
|
+
if (active.getAttribute("aria-expanded") === "true") return false;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
function DeckNotesCard({ text, width }) {
|
|
38
|
+
if (!text.trim()) return null;
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
className: "min-h-24 w-full shrink-0 whitespace-pre-wrap rounded-xl border border-border bg-surface p-5 text-sm leading-relaxed text-foreground",
|
|
43
|
+
style: width ? { width, maxWidth: "100%" } : void 0,
|
|
44
|
+
children: text
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { DeckNotesCard, deckOwnsArrowKeys, isFullscreenHotkey };
|