impact-nova 3.0.0-alpha.7 → 3.0.0-alpha.9
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 +1 -1
- package/dist/components/data/expandable-list-item/sku-picker-chrome.d.ts +4 -0
- package/dist/components/data/expandable-list-item/sku-picker-chrome.js +37 -42
- package/dist/components/data-display/stereo-scatter/index.d.ts +2 -0
- package/dist/components/data-display/stereo-scatter/index.js +10 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-frame.d.ts +41 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-frame.js +178 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-theme.d.ts +14 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-theme.js +29 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-wedges.d.ts +23 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-wedges.js +80 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine.d.ts +120 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine.js +519 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-math.d.ts +64 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-math.js +129 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-model.d.ts +37 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-model.js +71 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-context.d.ts +33 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-context.js +19 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-key.d.ts +4 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-key.js +19 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-legend.d.ts +2 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-legend.js +75 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-scene.d.ts +2 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-scene.js +149 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-toolbar.d.ts +13 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-toolbar.js +93 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-tooltip.d.ts +2 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-tooltip.js +62 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-viewport.d.ts +3 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-viewport.js +41 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.d.ts +12 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.js +107 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.stories-data.d.ts +11 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.types.d.ts +69 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.variants.d.ts +13 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.variants.js +42 -0
- package/dist/components/feedback/tooltip/button-icon-tooltip.d.ts +3 -1
- package/dist/components/feedback/tooltip/button-icon-tooltip.js +22 -19
- package/dist/components/flows/iris-chat/IrisChatComposerVoiceCapture.d.ts +5 -0
- package/dist/components/flows/iris-chat/IrisChatComposerVoiceCapture.js +73 -0
- package/dist/components/flows/iris-chat/IrisChatVoiceWaveform.d.ts +3 -0
- package/dist/components/flows/iris-chat/IrisChatVoiceWaveform.js +25 -0
- package/dist/components/flows/iris-chat/index.d.ts +3 -1
- package/dist/components/flows/iris-chat/index.js +58 -53
- package/dist/components/flows/iris-chat/iris-chat-chrome.d.ts +39 -0
- package/dist/components/flows/iris-chat/iris-chat-chrome.js +325 -0
- package/dist/components/flows/iris-chat/iris-chat-close-animation.d.ts +12 -0
- package/dist/components/flows/iris-chat/iris-chat-close-animation.js +21 -0
- package/dist/components/flows/iris-chat/iris-chat-composer.js +266 -238
- package/dist/components/flows/iris-chat/iris-chat-context.d.ts +13 -0
- package/dist/components/flows/iris-chat/iris-chat-context.js +14 -10
- package/dist/components/flows/iris-chat/iris-chat-copy-feedback.d.ts +4 -0
- package/dist/components/flows/iris-chat/iris-chat-copy-feedback.js +16 -0
- package/dist/components/flows/iris-chat/iris-chat-frame.d.ts +31 -0
- package/dist/components/flows/iris-chat/iris-chat-frame.js +79 -0
- package/dist/components/flows/iris-chat/iris-chat-icons.d.ts +1 -0
- package/dist/components/flows/iris-chat/iris-chat-icons.js +28 -15
- package/dist/components/flows/iris-chat/iris-chat-launch-animation.d.ts +11 -0
- package/dist/components/flows/iris-chat/iris-chat-launch-animation.js +35 -0
- package/dist/components/flows/iris-chat/iris-chat-markdown.js +70 -50
- package/dist/components/flows/iris-chat/iris-chat-menu.js +91 -86
- package/dist/components/flows/iris-chat/iris-chat-speech.d.ts +52 -0
- package/dist/components/flows/iris-chat/iris-chat-speech.js +121 -0
- package/dist/components/flows/iris-chat/iris-chat-thread.d.ts +3 -0
- package/dist/components/flows/iris-chat/iris-chat-thread.js +241 -190
- package/dist/components/flows/iris-chat/iris-chat-window-chrome.d.ts +30 -0
- package/dist/components/flows/iris-chat/iris-chat-window-chrome.js +34 -0
- package/dist/components/flows/iris-chat/iris-chat-window-geometry-context.d.ts +14 -0
- package/dist/components/flows/iris-chat/iris-chat-window-geometry-context.js +15 -0
- package/dist/components/flows/iris-chat/iris-chat-window-geometry.d.ts +12 -0
- package/dist/components/flows/iris-chat/iris-chat-window-geometry.js +113 -0
- package/dist/components/flows/iris-chat/iris-chat-window-handles.d.ts +6 -0
- package/dist/components/flows/iris-chat/iris-chat-window-handles.js +50 -0
- package/dist/components/flows/iris-chat/iris-chat-window-shell.d.ts +8 -0
- package/dist/components/flows/iris-chat/iris-chat-window-shell.js +37 -0
- package/dist/components/flows/iris-chat/iris-chat.d.ts +3 -39
- package/dist/components/flows/iris-chat/iris-chat.js +22 -330
- package/dist/components/flows/iris-chat/iris-chat.types.d.ts +18 -0
- package/dist/components/flows/iris-chat/iris-chat.variants.d.ts +3 -3
- package/dist/components/flows/iris-chat/iris-chat.variants.js +21 -16
- package/dist/components/flows/iris-chat/use-iris-chat-root.d.ts +26 -0
- package/dist/components/flows/iris-chat/use-iris-chat-root.js +140 -0
- package/dist/components/forms/choice-card/choice-card.d.ts +1 -0
- package/dist/components/forms/choice-card/choice-card.js +183 -186
- package/dist/components/layout/header/header.js +1 -0
- package/dist/form-react/Fields/SelectField.js +66 -57
- package/dist/form-react/Fields/VirtualizedListField.js +140 -96
- package/dist/form-react/index.d.ts +1 -1
- package/dist/form-react/types/fields.types.d.ts +27 -0
- package/dist/form-react/types/reactHookForm.types.d.ts +18 -1
- package/dist/i18n/defaultMessages.d.ts +37 -0
- package/dist/i18n/defaultMessages.js +54 -18
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/locales/de.js +36 -0
- package/dist/i18n/locales/es.js +36 -0
- package/dist/i18n/locales/hi.js +36 -0
- package/dist/i18n/locales/kn.js +36 -0
- package/dist/impact-nova-components.css +19 -0
- package/dist/impact-nova.css +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +5 -1
|
@@ -1,297 +1,325 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { ChevronRight as
|
|
4
|
-
import { ButtonIconTooltip as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { DropdownMenu as
|
|
7
|
-
import { useImpactNovaI18n as
|
|
8
|
-
import { useControllableState as
|
|
9
|
-
import { createComponent as
|
|
10
|
-
import { cn as
|
|
11
|
-
import { useIrisChatOptional as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
1
|
+
import { jsxs as s, jsx as t, Fragment as ge } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as C, useState as D, useEffect as Ce } from "react";
|
|
3
|
+
import { ChevronRight as be } from "impact-nova-icons";
|
|
4
|
+
import { ButtonIconTooltip as p } from "../../feedback/tooltip/button-icon-tooltip.js";
|
|
5
|
+
import { Button as f } from "../../primitives/button/button.js";
|
|
6
|
+
import { DropdownMenu as H, DropdownMenuTrigger as J, DropdownMenuContent as Q, DropdownMenuItem as X, DropdownMenuRadioGroup as ye, DropdownMenuRadioItem as ve } from "../../feedback/dropdown-menu/dropdown-menu.js";
|
|
7
|
+
import { useImpactNovaI18n as xe } from "../../../i18n/use-impact-nova-i18n.js";
|
|
8
|
+
import { useControllableState as Y } from "@radix-ui/react-use-controllable-state";
|
|
9
|
+
import { createComponent as we } from "../../../lib/primitives/create-component.js";
|
|
10
|
+
import { cn as Ie } from "../../../lib/utils.js";
|
|
11
|
+
import { useIrisChatOptional as De } from "./iris-chat-context.js";
|
|
12
|
+
import { readIrisChatComposerLayout as ke } from "./iris-chat-window-chrome.js";
|
|
13
|
+
import { IrisChatAddIcon as Z, IrisChatAttachIcon as ze, IrisChatMicIcon as Re, IrisChatStopIcon as Ne, IrisChatSendIcon as Le } from "./iris-chat-icons.js";
|
|
14
|
+
import { IrisChatAttachment as Se } from "./iris-chat-thread.js";
|
|
15
|
+
import { IrisChatComposerVoiceCapture as Fe } from "./IrisChatComposerVoiceCapture.js";
|
|
16
|
+
import { startComposerSpeechRecognition as Ae } from "./iris-chat-speech.js";
|
|
17
|
+
import { irisChatComposerVariants as Ke } from "./iris-chat.variants.js";
|
|
18
|
+
const Me = [
|
|
16
19
|
{ label: "Auto", value: "auto" },
|
|
17
20
|
{ label: "Fast", value: "fast" }
|
|
18
|
-
],
|
|
21
|
+
], Ze = we(
|
|
19
22
|
"IrisChatComposer",
|
|
20
23
|
({
|
|
21
24
|
className: a,
|
|
22
|
-
value:
|
|
23
|
-
defaultValue:
|
|
24
|
-
onValueChange:
|
|
25
|
-
pending:
|
|
26
|
-
placeholder:
|
|
27
|
-
model:
|
|
28
|
-
defaultModel:
|
|
29
|
-
onModelChange:
|
|
30
|
-
models:
|
|
31
|
-
onSend:
|
|
32
|
-
onStop:
|
|
33
|
-
onAddClick:
|
|
34
|
-
onAttachClick:
|
|
35
|
-
onAttach:
|
|
36
|
-
onMicClick:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
25
|
+
value: i,
|
|
26
|
+
defaultValue: ee = "",
|
|
27
|
+
onValueChange: te,
|
|
28
|
+
pending: b = !1,
|
|
29
|
+
placeholder: y,
|
|
30
|
+
model: re,
|
|
31
|
+
defaultModel: ne = "auto",
|
|
32
|
+
onModelChange: ae,
|
|
33
|
+
models: O = Me,
|
|
34
|
+
onSend: ie,
|
|
35
|
+
onStop: T,
|
|
36
|
+
onAddClick: P,
|
|
37
|
+
onAttachClick: $,
|
|
38
|
+
onAttach: se,
|
|
39
|
+
onMicClick: z,
|
|
40
|
+
speechRecognitionLocale: oe,
|
|
41
|
+
onSpeechNotice: B
|
|
42
|
+
}, le) => {
|
|
43
|
+
const { t: r } = xe(), v = De(), c = v ? ke({
|
|
44
|
+
isWindowPlacement: v.isWindowPlacement,
|
|
45
|
+
placement: v.placement,
|
|
46
|
+
frame: v.frame
|
|
47
|
+
}) : "stacked", [ce, R] = Y({
|
|
48
|
+
prop: i,
|
|
49
|
+
defaultProp: ee,
|
|
50
|
+
onChange: te
|
|
51
|
+
}), [N, ue] = Y({
|
|
52
|
+
prop: re,
|
|
53
|
+
defaultProp: ne,
|
|
54
|
+
onChange: ae
|
|
55
|
+
}), _ = C(null), u = C(null), d = C(!1), W = C({}), [x, L] = D(!1), [V, G] = D(
|
|
56
|
+
null
|
|
57
|
+
), [w, S] = D([]), [h, F] = D({});
|
|
58
|
+
W.current = h;
|
|
59
|
+
const l = ce ?? "", q = C(l);
|
|
60
|
+
q.current = l;
|
|
61
|
+
const A = l.trim().length > 0 || w.length > 0, de = (e) => {
|
|
62
|
+
if ((e.kind === "permission" || e.messageKey === "speechNetwork" || e.messageKey === "speechError") && (d.current = !1, L(!1), u.current?.abort(), u.current = null), B) {
|
|
63
|
+
B(e);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
G(e);
|
|
67
|
+
}, he = (e) => {
|
|
68
|
+
const n = _.current;
|
|
69
|
+
n && (n.accept = e, n.value = "", n.click());
|
|
70
|
+
}, K = (e) => {
|
|
52
71
|
if (!e?.length)
|
|
53
72
|
return;
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
for (const
|
|
58
|
-
|
|
59
|
-
return { ...
|
|
73
|
+
const n = Array.from(e);
|
|
74
|
+
se?.(n), S((o) => [...o, ...n]), F((o) => {
|
|
75
|
+
const g = {};
|
|
76
|
+
for (const m of n)
|
|
77
|
+
m.type.startsWith("image/") && (g[k(m)] = URL.createObjectURL(m));
|
|
78
|
+
return { ...o, ...g };
|
|
60
79
|
});
|
|
61
80
|
}, M = (e) => {
|
|
62
|
-
if (
|
|
63
|
-
|
|
81
|
+
if ($) {
|
|
82
|
+
$();
|
|
64
83
|
return;
|
|
65
84
|
}
|
|
66
|
-
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
|
|
85
|
+
he(e);
|
|
86
|
+
}, U = () => {
|
|
87
|
+
d.current = !1, u.current?.stop(), u.current = null, L(!1);
|
|
88
|
+
}, me = () => {
|
|
89
|
+
if (z) {
|
|
90
|
+
z();
|
|
70
91
|
return;
|
|
71
92
|
}
|
|
72
|
-
if (
|
|
73
|
-
|
|
93
|
+
if (x) {
|
|
94
|
+
U();
|
|
74
95
|
return;
|
|
75
96
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
97
|
+
G(null), d.current = !0;
|
|
98
|
+
const e = Ae({
|
|
99
|
+
locale: oe ?? "",
|
|
100
|
+
readBaseText: () => q.current,
|
|
101
|
+
shouldContinueListening: () => d.current,
|
|
102
|
+
onDraftChange: R,
|
|
103
|
+
onListeningChange: L,
|
|
104
|
+
onNotice: de
|
|
105
|
+
});
|
|
106
|
+
e || (d.current = !1), u.current = e;
|
|
84
107
|
};
|
|
85
|
-
|
|
108
|
+
Ce(
|
|
86
109
|
() => () => {
|
|
87
|
-
|
|
110
|
+
d.current = !1, u.current?.stop(), Object.values(W.current).forEach((e) => URL.revokeObjectURL(e));
|
|
88
111
|
},
|
|
89
112
|
[]
|
|
90
113
|
);
|
|
91
|
-
const
|
|
92
|
-
Object.values(
|
|
93
|
-
},
|
|
94
|
-
!
|
|
114
|
+
const pe = () => {
|
|
115
|
+
Object.values(h).forEach((e) => URL.revokeObjectURL(e)), F({}), S([]);
|
|
116
|
+
}, j = () => {
|
|
117
|
+
!A || b || (ie?.(l.trim(), w), pe());
|
|
95
118
|
};
|
|
96
|
-
return /* @__PURE__ */
|
|
119
|
+
return /* @__PURE__ */ s(
|
|
97
120
|
"form",
|
|
98
121
|
{
|
|
99
|
-
ref:
|
|
122
|
+
ref: le,
|
|
100
123
|
"data-component": "iris-chat-composer",
|
|
101
|
-
"data-layout":
|
|
102
|
-
"data-pending":
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
124
|
+
"data-layout": c,
|
|
125
|
+
"data-pending": b ? "" : void 0,
|
|
126
|
+
"data-listening": x ? "" : void 0,
|
|
127
|
+
className: Ie(
|
|
128
|
+
Ke({ layout: c }),
|
|
129
|
+
A && "iris-edge-wash-shell--menu iris-edge-wash-shell--fluid",
|
|
106
130
|
a
|
|
107
131
|
),
|
|
108
132
|
onDragOver: (e) => {
|
|
109
133
|
e.dataTransfer.types.includes("Files") && e.preventDefault();
|
|
110
134
|
},
|
|
111
135
|
onDrop: (e) => {
|
|
112
|
-
e.dataTransfer.files.length && (e.preventDefault(),
|
|
136
|
+
e.dataTransfer.files.length && (e.preventDefault(), K(e.dataTransfer.files));
|
|
113
137
|
},
|
|
114
138
|
onPaste: (e) => {
|
|
115
|
-
const
|
|
116
|
-
|
|
139
|
+
const n = Ue(e.clipboardData);
|
|
140
|
+
n.length && (e.preventDefault(), K(n));
|
|
117
141
|
},
|
|
118
142
|
onKeyDown: (e) => {
|
|
119
|
-
e.key === "Escape"
|
|
143
|
+
if (e.key === "Escape") {
|
|
144
|
+
if (x) {
|
|
145
|
+
e.preventDefault(), U();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
b && (e.preventDefault(), T?.());
|
|
149
|
+
}
|
|
120
150
|
},
|
|
121
151
|
onSubmit: (e) => {
|
|
122
|
-
e.preventDefault(),
|
|
152
|
+
e.preventDefault(), j();
|
|
123
153
|
},
|
|
124
154
|
children: [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
155
|
+
x && !z ? /* @__PURE__ */ t(Fe, { transcript: l, onStop: U }) : /* @__PURE__ */ s(ge, { children: [
|
|
156
|
+
w.length > 0 ? /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", "data-testid": "iris-chat-composer-attachments", children: w.map((e, n) => {
|
|
157
|
+
const o = k(e, n);
|
|
158
|
+
return /* @__PURE__ */ t(
|
|
159
|
+
Se,
|
|
160
|
+
{
|
|
161
|
+
name: e.name,
|
|
162
|
+
kind: e.type.startsWith("image/") ? "image" : "file",
|
|
163
|
+
sizeLabel: e.size < 1024 ? `${e.size} B` : `${Math.round(e.size / 1024)} KB`,
|
|
164
|
+
previewUrl: h[k(e)] ?? h[o],
|
|
165
|
+
onRemove: () => {
|
|
166
|
+
const g = k(e), m = h[g] ?? h[o];
|
|
167
|
+
m && URL.revokeObjectURL(m), F((E) => {
|
|
168
|
+
const I = { ...E };
|
|
169
|
+
return delete I[g], delete I[o], I;
|
|
170
|
+
}), S((E) => E.filter((I, fe) => fe !== n));
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
o
|
|
174
|
+
);
|
|
175
|
+
}) }) : null,
|
|
176
|
+
c === "stacked" || c === "stackedCompact" ? /* @__PURE__ */ t(
|
|
177
|
+
"textarea",
|
|
129
178
|
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
179
|
+
id: "iris-chat-composer-input",
|
|
180
|
+
"data-testid": "iris-chat-composer-input",
|
|
181
|
+
rows: c === "stackedCompact" ? 1 : 2,
|
|
182
|
+
value: l,
|
|
183
|
+
placeholder: y ?? r("irisChat.askAnything"),
|
|
184
|
+
"aria-label": y ?? r("irisChat.askAnything"),
|
|
185
|
+
className: "max-h-24 min-h-8 w-full resize-none bg-transparent text-sm font-medium leading-5 text-content outline-none placeholder:text-content-empty",
|
|
186
|
+
onChange: (e) => R(e.target.value),
|
|
187
|
+
onKeyDown: (e) => {
|
|
188
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), j());
|
|
140
189
|
}
|
|
141
|
-
},
|
|
142
|
-
r
|
|
143
|
-
);
|
|
144
|
-
}) }) : null,
|
|
145
|
-
C === "stacked" ? /* @__PURE__ */ t(
|
|
146
|
-
"textarea",
|
|
147
|
-
{
|
|
148
|
-
id: "iris-chat-composer-input",
|
|
149
|
-
"data-testid": "iris-chat-composer-input",
|
|
150
|
-
rows: 2,
|
|
151
|
-
value: u,
|
|
152
|
-
placeholder: g ?? n("irisChat.askAnything"),
|
|
153
|
-
"aria-label": g ?? n("irisChat.askAnything"),
|
|
154
|
-
className: "w-full resize-none bg-transparent text-sm font-medium leading-5 text-content outline-none placeholder:text-content-empty",
|
|
155
|
-
onChange: (e) => x(e.target.value),
|
|
156
|
-
onKeyDown: (e) => {
|
|
157
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), N());
|
|
158
190
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
onChange: (e) => L(e.target.files)
|
|
172
|
-
}
|
|
173
|
-
),
|
|
174
|
-
O ? /* @__PURE__ */ t(h, { label: n("irisChat.add"), children: /* @__PURE__ */ t(
|
|
175
|
-
p,
|
|
176
|
-
{
|
|
177
|
-
type: "button",
|
|
178
|
-
variant: "ghost",
|
|
179
|
-
size: "icon",
|
|
180
|
-
"aria-label": n("irisChat.add"),
|
|
181
|
-
onClick: O,
|
|
182
|
-
children: /* @__PURE__ */ t(q, {})
|
|
183
|
-
}
|
|
184
|
-
) }) : /* @__PURE__ */ l(P, { children: [
|
|
185
|
-
/* @__PURE__ */ t(h, { label: n("irisChat.add"), children: /* @__PURE__ */ t(_, { asChild: !0, children: /* @__PURE__ */ t(p, { type: "button", variant: "ghost", size: "icon", "aria-label": n("irisChat.add"), children: /* @__PURE__ */ t(q, {}) }) }) }),
|
|
186
|
-
/* @__PURE__ */ l(W, { align: "start", children: [
|
|
187
|
-
/* @__PURE__ */ t(V, { onSelect: () => M("*/*"), children: n("irisChat.attachFile") }),
|
|
188
|
-
/* @__PURE__ */ t(V, { onSelect: () => M("image/*"), children: n("irisChat.attachImage") })
|
|
189
|
-
] })
|
|
190
|
-
] }),
|
|
191
|
-
/* @__PURE__ */ t(h, { label: n("irisChat.attach"), children: /* @__PURE__ */ t(
|
|
192
|
-
p,
|
|
193
|
-
{
|
|
194
|
-
type: "button",
|
|
195
|
-
variant: "ghost",
|
|
196
|
-
size: "icon",
|
|
197
|
-
"aria-label": n("irisChat.attach"),
|
|
198
|
-
onClick: () => M("*/*"),
|
|
199
|
-
children: /* @__PURE__ */ t(ge, {})
|
|
200
|
-
}
|
|
201
|
-
) }),
|
|
202
|
-
C === "inline" ? /* @__PURE__ */ t(
|
|
203
|
-
"input",
|
|
204
|
-
{
|
|
205
|
-
id: "iris-chat-composer-input",
|
|
206
|
-
"data-testid": "iris-chat-composer-input",
|
|
207
|
-
value: u,
|
|
208
|
-
placeholder: g ?? n("irisChat.askAnything"),
|
|
209
|
-
"aria-label": g ?? n("irisChat.askAnything"),
|
|
210
|
-
className: "ms-1 h-8 min-w-0 flex-1 overflow-hidden bg-transparent py-0 text-sm font-medium leading-8 text-content outline-none placeholder:text-content-empty",
|
|
211
|
-
onChange: (e) => x(e.target.value),
|
|
212
|
-
onKeyDown: (e) => {
|
|
213
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), N());
|
|
191
|
+
) : null,
|
|
192
|
+
/* @__PURE__ */ s("div", { className: "flex min-w-0 w-full items-center justify-between gap-1 [&_button[data-size=icon]]:size-8 [&_button[data-size=icon]_svg]:size-4", children: [
|
|
193
|
+
/* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 items-center", children: [
|
|
194
|
+
/* @__PURE__ */ t(
|
|
195
|
+
"input",
|
|
196
|
+
{
|
|
197
|
+
ref: _,
|
|
198
|
+
type: "file",
|
|
199
|
+
hidden: !0,
|
|
200
|
+
multiple: !0,
|
|
201
|
+
"data-testid": "iris-chat-attach-input",
|
|
202
|
+
onChange: (e) => K(e.target.files)
|
|
214
203
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
/* @__PURE__ */ l("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
219
|
-
/* @__PURE__ */ l(P, { children: [
|
|
220
|
-
/* @__PURE__ */ t(_, { asChild: !0, children: /* @__PURE__ */ l(
|
|
221
|
-
"button",
|
|
204
|
+
),
|
|
205
|
+
P ? /* @__PURE__ */ t(p, { label: r("irisChat.add"), children: /* @__PURE__ */ t(
|
|
206
|
+
f,
|
|
222
207
|
{
|
|
223
208
|
type: "button",
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
"aria-label":
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
209
|
+
variant: "ghost",
|
|
210
|
+
size: "icon",
|
|
211
|
+
"aria-label": r("irisChat.add"),
|
|
212
|
+
onClick: P,
|
|
213
|
+
children: /* @__PURE__ */ t(Z, {})
|
|
214
|
+
}
|
|
215
|
+
) }) : /* @__PURE__ */ s(H, { children: [
|
|
216
|
+
/* @__PURE__ */ t(p, { label: r("irisChat.add"), children: /* @__PURE__ */ t(J, { asChild: !0, children: /* @__PURE__ */ t(f, { type: "button", variant: "ghost", size: "icon", "aria-label": r("irisChat.add"), children: /* @__PURE__ */ t(Z, {}) }) }) }),
|
|
217
|
+
/* @__PURE__ */ s(Q, { align: "start", children: [
|
|
218
|
+
/* @__PURE__ */ t(X, { onSelect: () => M("*/*"), children: r("irisChat.attachFile") }),
|
|
219
|
+
/* @__PURE__ */ t(X, { onSelect: () => M("image/*"), children: r("irisChat.attachImage") })
|
|
220
|
+
] })
|
|
221
|
+
] }),
|
|
222
|
+
/* @__PURE__ */ t(p, { label: r("irisChat.attach"), children: /* @__PURE__ */ t(
|
|
223
|
+
f,
|
|
224
|
+
{
|
|
225
|
+
type: "button",
|
|
226
|
+
variant: "ghost",
|
|
227
|
+
size: "icon",
|
|
228
|
+
"aria-label": r("irisChat.attach"),
|
|
229
|
+
onClick: () => M("*/*"),
|
|
230
|
+
children: /* @__PURE__ */ t(ze, {})
|
|
231
231
|
}
|
|
232
232
|
) }),
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
c === "inline" ? /* @__PURE__ */ t(
|
|
234
|
+
"input",
|
|
235
235
|
{
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
id: "iris-chat-composer-input",
|
|
237
|
+
"data-testid": "iris-chat-composer-input",
|
|
238
|
+
value: l,
|
|
239
|
+
placeholder: y ?? r("irisChat.askAnything"),
|
|
240
|
+
"aria-label": y ?? r("irisChat.askAnything"),
|
|
241
|
+
className: "ms-1 h-8 min-w-0 flex-1 overflow-hidden bg-transparent py-0 text-sm font-medium leading-8 text-content outline-none placeholder:text-content-empty",
|
|
242
|
+
onChange: (e) => R(e.target.value),
|
|
243
|
+
onKeyDown: (e) => {
|
|
244
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), j());
|
|
245
|
+
}
|
|
239
246
|
}
|
|
240
|
-
)
|
|
247
|
+
) : null
|
|
241
248
|
] }),
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
|
|
249
|
+
/* @__PURE__ */ s("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
250
|
+
/* @__PURE__ */ s(H, { children: [
|
|
251
|
+
/* @__PURE__ */ t(J, { asChild: !0, children: /* @__PURE__ */ s(
|
|
252
|
+
"button",
|
|
253
|
+
{
|
|
254
|
+
type: "button",
|
|
255
|
+
"data-testid": "iris-chat-model",
|
|
256
|
+
className: "flex h-8 max-w-24 shrink-0 items-center gap-0.5 truncate rounded-lg bg-secondary px-2 text-sm font-medium capitalize leading-none text-content",
|
|
257
|
+
"aria-label": r("irisChat.model"),
|
|
258
|
+
children: [
|
|
259
|
+
O.find((e) => e.value === N)?.label ?? N,
|
|
260
|
+
/* @__PURE__ */ t(be, { size: 16, className: "rotate-90" })
|
|
261
|
+
]
|
|
262
|
+
}
|
|
263
|
+
) }),
|
|
264
|
+
/* @__PURE__ */ t(Q, { align: "end", children: /* @__PURE__ */ t(
|
|
265
|
+
ye,
|
|
266
|
+
{
|
|
267
|
+
value: N,
|
|
268
|
+
onValueChange: ue,
|
|
269
|
+
children: O.map((e) => /* @__PURE__ */ t(ve, { value: e.value, children: e.label }, e.value))
|
|
270
|
+
}
|
|
271
|
+
) })
|
|
272
|
+
] }),
|
|
273
|
+
/* @__PURE__ */ t(p, { label: r("irisChat.mic"), children: /* @__PURE__ */ t(
|
|
274
|
+
f,
|
|
275
|
+
{
|
|
276
|
+
type: "button",
|
|
277
|
+
variant: "ghost",
|
|
278
|
+
size: "icon",
|
|
279
|
+
"aria-label": r("irisChat.mic"),
|
|
280
|
+
onClick: me,
|
|
281
|
+
children: /* @__PURE__ */ t(Re, {})
|
|
282
|
+
}
|
|
283
|
+
) }),
|
|
284
|
+
b ? /* @__PURE__ */ t(p, { label: r("irisChat.stop"), children: /* @__PURE__ */ t(
|
|
285
|
+
f,
|
|
286
|
+
{
|
|
287
|
+
type: "button",
|
|
288
|
+
variant: "default",
|
|
289
|
+
size: "icon",
|
|
290
|
+
"aria-label": r("irisChat.stop"),
|
|
291
|
+
"data-testid": "iris-chat-stop",
|
|
292
|
+
className: "rounded-full",
|
|
293
|
+
onClick: T,
|
|
294
|
+
children: /* @__PURE__ */ t(Ne, { size: 16 })
|
|
295
|
+
}
|
|
296
|
+
) }) : A ? /* @__PURE__ */ t(p, { label: r("irisChat.send"), children: /* @__PURE__ */ t(
|
|
297
|
+
f,
|
|
298
|
+
{
|
|
299
|
+
type: "submit",
|
|
300
|
+
variant: "default",
|
|
301
|
+
size: "icon",
|
|
302
|
+
"aria-label": r("irisChat.send"),
|
|
303
|
+
"data-testid": "iris-chat-send",
|
|
304
|
+
className: "rounded-full",
|
|
305
|
+
children: /* @__PURE__ */ t(Le, { size: 16 })
|
|
306
|
+
}
|
|
307
|
+
) }) : null
|
|
308
|
+
] })
|
|
278
309
|
] })
|
|
279
|
-
] })
|
|
310
|
+
] }),
|
|
311
|
+
V ? /* @__PURE__ */ t("p", { className: "px-1 text-xs text-destructive", role: "alert", children: r(`irisChat.${V.messageKey}`) }) : null
|
|
280
312
|
]
|
|
281
313
|
}
|
|
282
314
|
);
|
|
283
315
|
}
|
|
284
316
|
);
|
|
285
|
-
function
|
|
286
|
-
return `${a.name}:${a.size}:${a.lastModified}:${
|
|
287
|
-
}
|
|
288
|
-
function De(a) {
|
|
289
|
-
return a ? a.files.length ? Array.from(a.files) : Array.from(a.items).filter((s) => s.kind === "file").map((s) => s.getAsFile()).filter((s) => !!s) : [];
|
|
317
|
+
function k(a, i = 0) {
|
|
318
|
+
return `${a.name}:${a.size}:${a.lastModified}:${i}`;
|
|
290
319
|
}
|
|
291
|
-
function
|
|
292
|
-
|
|
293
|
-
return a.SpeechRecognition ?? a.webkitSpeechRecognition;
|
|
320
|
+
function Ue(a) {
|
|
321
|
+
return a ? a.files.length ? Array.from(a.files) : Array.from(a.items).filter((i) => i.kind === "file").map((i) => i.getAsFile()).filter((i) => !!i) : [];
|
|
294
322
|
}
|
|
295
323
|
export {
|
|
296
|
-
|
|
324
|
+
Ze as IrisChatComposer
|
|
297
325
|
};
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
+
import { IrisChatFrame } from './iris-chat-frame';
|
|
1
2
|
import { IrisChatPlacement } from './iris-chat.types';
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
export type IrisChatContextValue = {
|
|
4
5
|
open: boolean;
|
|
5
6
|
setOpen: (open: boolean) => void;
|
|
7
|
+
requestClose: () => void;
|
|
8
|
+
isClosing: boolean;
|
|
9
|
+
registerPanelNode: (node: HTMLDivElement | null) => void;
|
|
10
|
+
isOpening: boolean;
|
|
6
11
|
placement: IrisChatPlacement;
|
|
7
12
|
setPlacement: (placement: IrisChatPlacement) => void;
|
|
13
|
+
frame: IrisChatFrame;
|
|
14
|
+
setFrame: (frame: IrisChatFrame) => void;
|
|
15
|
+
commitFrame: (frame: IrisChatFrame) => void;
|
|
16
|
+
resetFrame: () => void;
|
|
17
|
+
applyCompactFrame: () => void;
|
|
18
|
+
expandFromCompactFrame: () => void;
|
|
19
|
+
isWindowPlacement: boolean;
|
|
8
20
|
};
|
|
9
21
|
export declare function IrisChatProvider({ value, children, }: {
|
|
10
22
|
value: IrisChatContextValue;
|
|
@@ -12,3 +24,4 @@ export declare function IrisChatProvider({ value, children, }: {
|
|
|
12
24
|
}): import("react/jsx-runtime").JSX.Element;
|
|
13
25
|
export declare function useIrisChat(): IrisChatContextValue;
|
|
14
26
|
export declare function useIrisChatOptional(): IrisChatContextValue | null;
|
|
27
|
+
export declare function readIsIrisChatWindowPlacement(placement: IrisChatPlacement): boolean;
|
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
|
-
const
|
|
3
|
+
const n = r.createContext(null);
|
|
4
4
|
function s({
|
|
5
5
|
value: t,
|
|
6
|
-
children:
|
|
6
|
+
children: e
|
|
7
7
|
}) {
|
|
8
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ i(n.Provider, { value: t, children: e });
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
const t = r.useContext(
|
|
10
|
+
function a() {
|
|
11
|
+
const t = r.useContext(n);
|
|
12
12
|
if (!t)
|
|
13
13
|
throw new Error("IrisChat parts must render inside IrisChat.");
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return r.useContext(
|
|
16
|
+
function u() {
|
|
17
|
+
return r.useContext(n);
|
|
18
|
+
}
|
|
19
|
+
function C(t) {
|
|
20
|
+
return t === "float" || t === "minimized";
|
|
18
21
|
}
|
|
19
22
|
export {
|
|
20
23
|
s as IrisChatProvider,
|
|
21
|
-
|
|
22
|
-
a as
|
|
24
|
+
C as readIsIrisChatWindowPlacement,
|
|
25
|
+
a as useIrisChat,
|
|
26
|
+
u as useIrisChatOptional
|
|
23
27
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const IRIS_CHAT_COPY_FEEDBACK_MS = 2000;
|
|
2
|
+
export declare const irisChatActionIconPressClassName = "transition-[transform,color,background-color] duration-150 active:scale-90";
|
|
3
|
+
export declare const irisChatCopySuccessClassName = "text-success bg-success-subtle hover:bg-success-subtle hover:text-success";
|
|
4
|
+
export declare function writeIrisChatClipboardText(text: string): Promise<boolean>;
|