@kieksme/csp-plugin-chat 0.13.2 → 0.13.4
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 +2 -2
- package/dist/browser.js +98 -72
- package/dist/{chunk-OGWLCI3O.js → chunk-4CHUNIWD.js} +1 -1
- package/dist/server.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ For local provider testing, set `CSP_DEMO=true` and `CSP_CHAT_DEMO=false`: porta
|
|
|
8
8
|
|
|
9
9
|
Langsame lokale Modelle können mit der Runtime-Variable `CSP_CHAT_TIMEOUT_MS` mehr Antwortzeit erhalten (Standard `60000`, Bereich `1000`–`300000` ms).
|
|
10
10
|
|
|
11
|
-
Send a message with Cmd + Enter on macOS, Ctrl + Enter on other systems, or the send button. The hint displays the system-specific shortcut. Plain Enter inserts a line break. A subtle shortcut hint appears
|
|
11
|
+
Send a message with Cmd + Enter on macOS, Ctrl + Enter on other systems, or the send button. The hint displays the system-specific shortcut. Plain Enter inserts a line break. A subtle shortcut hint appears inside the text field at the bottom right; blank messages and shortcuts during an active reply do not send.
|
|
12
12
|
|
|
13
13
|
The input starts with one text row and automatically grows with wrapped text or line breaks. It shrinks when text is removed or sent and adjusts when its width changes.
|
|
14
14
|
|
|
@@ -34,4 +34,4 @@ Long histories follow new messages while the visitor reads at the bottom; scroll
|
|
|
34
34
|
|
|
35
35
|
Both chat modes share a service-chat header and composer. Visitor messages align to the right, assistant and human replies to the left with visible sender labels. Customer theme colours, dark mode and mobile layouts apply throughout. See [chat design](../../docs/chat.md#gestaltung).
|
|
36
36
|
|
|
37
|
-
Dictation uses an icon-only microphone button with the accessible name and tooltip “Nachricht diktieren”. The microphone sits directly beside Send in the composer toolbar.
|
|
37
|
+
Dictation uses an icon-only microphone button with the accessible name and tooltip “Nachricht diktieren”. The microphone sits directly beside Send in the composer toolbar. All composer buttons stay in one row and share a 44 px height. Stop and cancel use accessible icons during recording. The shortcut sits inside the field at the bottom right, with space reserved below editable text. Its privacy notice stays visible underneath.
|
package/dist/browser.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cspPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4CHUNIWD.js";
|
|
4
4
|
|
|
5
5
|
// src/tools.ts
|
|
6
6
|
import {
|
|
@@ -607,8 +607,20 @@ function VoiceInput({
|
|
|
607
607
|
{
|
|
608
608
|
type: "button",
|
|
609
609
|
className: "chat-voice-button",
|
|
610
|
+
"aria-label": "Aufnahme stoppen",
|
|
611
|
+
title: "Aufnahme stoppen",
|
|
610
612
|
onClick: () => recorder.current?.stop(),
|
|
611
|
-
children:
|
|
613
|
+
children: /* @__PURE__ */ jsx2(
|
|
614
|
+
"svg",
|
|
615
|
+
{
|
|
616
|
+
"aria-hidden": "true",
|
|
617
|
+
viewBox: "0 0 24 24",
|
|
618
|
+
width: "16",
|
|
619
|
+
height: "16",
|
|
620
|
+
fill: "currentColor",
|
|
621
|
+
children: /* @__PURE__ */ jsx2("rect", { x: "5", y: "5", width: "14", height: "14", rx: "2" })
|
|
622
|
+
}
|
|
623
|
+
)
|
|
612
624
|
}
|
|
613
625
|
),
|
|
614
626
|
/* @__PURE__ */ jsx2(
|
|
@@ -616,6 +628,8 @@ function VoiceInput({
|
|
|
616
628
|
{
|
|
617
629
|
type: "button",
|
|
618
630
|
className: "chat-voice-cancel",
|
|
631
|
+
"aria-label": "Abbrechen",
|
|
632
|
+
title: "Abbrechen",
|
|
619
633
|
onClick: () => {
|
|
620
634
|
operation.current++;
|
|
621
635
|
cancelled.current = true;
|
|
@@ -625,7 +639,19 @@ function VoiceInput({
|
|
|
625
639
|
release();
|
|
626
640
|
idle();
|
|
627
641
|
},
|
|
628
|
-
children:
|
|
642
|
+
children: /* @__PURE__ */ jsx2(
|
|
643
|
+
"svg",
|
|
644
|
+
{
|
|
645
|
+
"aria-hidden": "true",
|
|
646
|
+
viewBox: "0 0 24 24",
|
|
647
|
+
width: "16",
|
|
648
|
+
height: "16",
|
|
649
|
+
fill: "none",
|
|
650
|
+
stroke: "currentColor",
|
|
651
|
+
strokeWidth: "2",
|
|
652
|
+
children: /* @__PURE__ */ jsx2("path", { d: "m6 6 12 12M18 6 6 18" })
|
|
653
|
+
}
|
|
654
|
+
)
|
|
629
655
|
}
|
|
630
656
|
)
|
|
631
657
|
] });
|
|
@@ -945,37 +971,37 @@ function SupportChat(ctx) {
|
|
|
945
971
|
className: "chat-form flex gap-2.5 items-end",
|
|
946
972
|
children: [
|
|
947
973
|
/* @__PURE__ */ jsx3("label", { htmlFor: "support-chat-input", className: "sr-only", children: "Ihre Nachricht" }),
|
|
948
|
-
/* @__PURE__ */
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
/* @__PURE__ */ jsx3(Shortcut, { id: "support-chat-shortcut" })
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
] })
|
|
974
|
+
/* @__PURE__ */ jsxs3("div", { className: "chat-compose-field", children: [
|
|
975
|
+
/* @__PURE__ */ jsx3(
|
|
976
|
+
"textarea",
|
|
977
|
+
{
|
|
978
|
+
id: "support-chat-input",
|
|
979
|
+
value: input,
|
|
980
|
+
rows: 1,
|
|
981
|
+
maxLength: 4e3,
|
|
982
|
+
disabled: current?.status === "closed",
|
|
983
|
+
className: "flex-1 min-w-0 max-h-[180px] overflow-auto resize-none border border-line rounded-card bg-card p-3",
|
|
984
|
+
onChange: (e) => setInput(e.target.value),
|
|
985
|
+
onKeyDown: (e) => sendShortcut(e, blocked || !input.trim()),
|
|
986
|
+
"aria-keyshortcuts": "Control+Enter Meta+Enter",
|
|
987
|
+
"aria-describedby": "support-chat-shortcut",
|
|
988
|
+
placeholder: "Wie k\xF6nnen wir Ihnen helfen?"
|
|
989
|
+
}
|
|
990
|
+
),
|
|
991
|
+
/* @__PURE__ */ jsx3(Shortcut, { id: "support-chat-shortcut" })
|
|
992
|
+
] }),
|
|
993
|
+
/* @__PURE__ */ jsx3("div", { className: "chat-compose-toolbar", children: /* @__PURE__ */ jsxs3("div", { className: "chat-compose-actions", children: [
|
|
994
|
+
controls,
|
|
995
|
+
/* @__PURE__ */ jsx3(
|
|
996
|
+
"button",
|
|
997
|
+
{
|
|
998
|
+
type: "submit",
|
|
999
|
+
className: "chat-send",
|
|
1000
|
+
disabled: blocked || !input.trim(),
|
|
1001
|
+
children: "Senden"
|
|
1002
|
+
}
|
|
1003
|
+
)
|
|
1004
|
+
] }) })
|
|
979
1005
|
]
|
|
980
1006
|
}
|
|
981
1007
|
),
|
|
@@ -1277,44 +1303,44 @@ function LegacyChat(ctx) {
|
|
|
1277
1303
|
onSubmit: submit,
|
|
1278
1304
|
children: [
|
|
1279
1305
|
/* @__PURE__ */ jsx4("label", { className: "sr-only", htmlFor: "chat-input", children: "Ihre Frage" }),
|
|
1280
|
-
/* @__PURE__ */
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
e
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
/* @__PURE__ */ jsx4(Shortcut, { id: "chat-shortcut" })
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
] })
|
|
1306
|
+
/* @__PURE__ */ jsxs4("div", { className: "chat-compose-field", children: [
|
|
1307
|
+
/* @__PURE__ */ jsx4(
|
|
1308
|
+
"textarea",
|
|
1309
|
+
{
|
|
1310
|
+
id: "chat-input",
|
|
1311
|
+
ref: inputField,
|
|
1312
|
+
rows: 1,
|
|
1313
|
+
autoFocus: true,
|
|
1314
|
+
className: "search bg-card border border-line rounded-card pt-3.5 pb-7 px-4.5 text-ink w-full block max-h-[180px] overflow-auto",
|
|
1315
|
+
value: input,
|
|
1316
|
+
disabled: resolved,
|
|
1317
|
+
maxLength: 4e3,
|
|
1318
|
+
onChange: (e) => setInput(e.target.value),
|
|
1319
|
+
onKeyDown: (e) => sendShortcut(
|
|
1320
|
+
e,
|
|
1321
|
+
busy || voiceBusy || resolved || !input.trim()
|
|
1322
|
+
),
|
|
1323
|
+
"aria-keyshortcuts": "Control+Enter Meta+Enter",
|
|
1324
|
+
"aria-describedby": "chat-shortcut",
|
|
1325
|
+
placeholder: "Ihre Frage an unser Team \u2026",
|
|
1326
|
+
required: true
|
|
1327
|
+
}
|
|
1328
|
+
),
|
|
1329
|
+
/* @__PURE__ */ jsx4(Shortcut, { id: "chat-shortcut" })
|
|
1330
|
+
] }),
|
|
1331
|
+
/* @__PURE__ */ jsx4("div", { className: "chat-compose-toolbar", children: /* @__PURE__ */ jsxs4("div", { className: "chat-compose-actions", children: [
|
|
1332
|
+
controls,
|
|
1333
|
+
/* @__PURE__ */ jsx4(
|
|
1334
|
+
"button",
|
|
1335
|
+
{
|
|
1336
|
+
type: "submit",
|
|
1337
|
+
disabled: busy || voiceBusy || resolved || !input.trim(),
|
|
1338
|
+
className: "chat-send",
|
|
1339
|
+
"aria-label": "Frage senden",
|
|
1340
|
+
children: "Senden"
|
|
1341
|
+
}
|
|
1342
|
+
)
|
|
1343
|
+
] }) })
|
|
1318
1344
|
]
|
|
1319
1345
|
}
|
|
1320
1346
|
),
|
package/dist/server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kieksme/csp-plugin-chat",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@azure/msal-browser": "^5.25.0",
|
|
26
|
-
"@kieksme/csp-sdk": "^0.13.
|
|
26
|
+
"@kieksme/csp-sdk": "^0.13.4",
|
|
27
27
|
"openai": "^6.3.0",
|
|
28
28
|
"zod": "^3.25.76"
|
|
29
29
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"cspPlugin": {
|
|
37
37
|
"id": "chat",
|
|
38
|
-
"sdkVersion": "^0.13.
|
|
38
|
+
"sdkVersion": "^0.13.4",
|
|
39
39
|
"browser": "./browser",
|
|
40
40
|
"server": "./server"
|
|
41
41
|
},
|