@kieksme/csp-plugin-chat 0.13.0 → 0.13.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/README.md CHANGED
@@ -33,3 +33,5 @@ The assistant asks one short clarifying question for vague requests (for example
33
33
  Long histories follow new messages while the visitor reads at the bottom; scrolling up preserves the reading position and offers **Neue Nachrichten ↓**. Real OpenAI providers expose editable dictation through the server-only transcription API. With a support transport, **Ich möchte mit einer echten Person sprechen** pauses the bot immediately and queues a persistent, directed support request. See [chat behaviour and APIs](../../docs/chat.md) and [runtime options](../../docs/configuration.md#spracheingabe-und-supportanfragen).
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
+
37
+ Dictation uses an icon-only microphone button with the accessible name and tooltip “Nachricht diktieren”. Its privacy notice stays visible alongside the button, and mobile touch targets remain 44 × 44 px.
package/dist/browser.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  cspPlugin
3
- } from "./chunk-W5TFART7.js";
3
+ } from "./chunk-B7EKNOQK.js";
4
4
 
5
5
  // src/tools.ts
6
6
  import {
@@ -574,67 +574,73 @@ function VoiceInput({
574
574
  }
575
575
  }
576
576
  if (!enabled) return null;
577
- return /* @__PURE__ */ jsxs2("div", { className: "chat-voice", "data-recording": state === "recording", children: [
578
- state === "idle" ? /* @__PURE__ */ jsxs2(
579
- "button",
580
- {
581
- type: "button",
582
- className: "chat-voice-button",
583
- disabled,
584
- onClick: () => void start(),
585
- children: [
586
- /* @__PURE__ */ jsxs2(
587
- "svg",
577
+ return /* @__PURE__ */ jsxs2(
578
+ "div",
579
+ {
580
+ className: "chat-voice",
581
+ "data-state": state,
582
+ "data-recording": state === "recording",
583
+ children: [
584
+ state === "idle" ? /* @__PURE__ */ jsx2(
585
+ "button",
586
+ {
587
+ type: "button",
588
+ className: "chat-voice-button chat-microphone",
589
+ "aria-label": "Nachricht diktieren",
590
+ title: "Nachricht diktieren",
591
+ disabled,
592
+ onClick: () => void start(),
593
+ children: /* @__PURE__ */ jsxs2(
594
+ "svg",
595
+ {
596
+ "aria-hidden": "true",
597
+ viewBox: "0 0 24 24",
598
+ width: "16",
599
+ height: "16",
600
+ fill: "none",
601
+ stroke: "currentColor",
602
+ strokeWidth: "2",
603
+ children: [
604
+ /* @__PURE__ */ jsx2("rect", { x: "9", y: "2", width: "6", height: "12", rx: "3" }),
605
+ /* @__PURE__ */ jsx2("path", { d: "M5 10v2a7 7 0 0 0 14 0v-2M12 19v3M8 22h8" })
606
+ ]
607
+ }
608
+ )
609
+ }
610
+ ) : /* @__PURE__ */ jsxs2(Fragment, { children: [
611
+ /* @__PURE__ */ jsx2("span", { role: "status", className: "chat-voice-status", children: state === "recording" ? "\u25CF Aufnahme l\xE4uft \xB7 maximal 60 Sekunden" : state === "starting" ? "Mikrofon wird gestartet \u2026" : "Sprache wird in Text umgewandelt \u2026" }),
612
+ state === "recording" && /* @__PURE__ */ jsx2(
613
+ "button",
588
614
  {
589
- "aria-hidden": "true",
590
- viewBox: "0 0 24 24",
591
- width: "16",
592
- height: "16",
593
- className: "inline mr-2",
594
- fill: "none",
595
- stroke: "currentColor",
596
- strokeWidth: "2",
597
- children: [
598
- /* @__PURE__ */ jsx2("rect", { x: "9", y: "2", width: "6", height: "12", rx: "3" }),
599
- /* @__PURE__ */ jsx2("path", { d: "M5 10v2a7 7 0 0 0 14 0v-2M12 19v3M8 22h8" })
600
- ]
615
+ type: "button",
616
+ className: "chat-voice-button",
617
+ onClick: () => recorder.current?.stop(),
618
+ children: "Aufnahme stoppen"
601
619
  }
602
620
  ),
603
- "Nachricht diktieren"
604
- ]
605
- }
606
- ) : /* @__PURE__ */ jsxs2(Fragment, { children: [
607
- /* @__PURE__ */ jsx2("span", { role: "status", className: "chat-voice-status", children: state === "recording" ? "\u25CF Aufnahme l\xE4uft \xB7 maximal 60 Sekunden" : state === "starting" ? "Mikrofon wird gestartet \u2026" : "Sprache wird in Text umgewandelt \u2026" }),
608
- state === "recording" && /* @__PURE__ */ jsx2(
609
- "button",
610
- {
611
- type: "button",
612
- className: "chat-voice-button",
613
- onClick: () => recorder.current?.stop(),
614
- children: "Aufnahme stoppen"
615
- }
616
- ),
617
- /* @__PURE__ */ jsx2(
618
- "button",
619
- {
620
- type: "button",
621
- className: "chat-voice-cancel",
622
- onClick: () => {
623
- operation.current++;
624
- cancelled.current = true;
625
- request.current?.abort();
626
- if (recorder.current?.state === "recording")
627
- recorder.current.stop();
628
- release();
629
- idle();
630
- },
631
- children: "Abbrechen"
632
- }
633
- )
634
- ] }),
635
- /* @__PURE__ */ jsx2("p", { className: "chat-voice-notice", children: "Die Aufnahme wird zur Texterkennung an OpenAI gesendet. Pr\xFCfen Sie den Text vor dem Senden." }),
636
- error && /* @__PURE__ */ jsx2("p", { role: "alert", className: "text-danger dark:text-warning mt-2", children: error })
637
- ] });
621
+ /* @__PURE__ */ jsx2(
622
+ "button",
623
+ {
624
+ type: "button",
625
+ className: "chat-voice-cancel",
626
+ onClick: () => {
627
+ operation.current++;
628
+ cancelled.current = true;
629
+ request.current?.abort();
630
+ if (recorder.current?.state === "recording")
631
+ recorder.current.stop();
632
+ release();
633
+ idle();
634
+ },
635
+ children: "Abbrechen"
636
+ }
637
+ )
638
+ ] }),
639
+ /* @__PURE__ */ jsx2("p", { className: "chat-voice-notice", children: "Die Aufnahme wird zur Texterkennung an OpenAI gesendet. Pr\xFCfen Sie den Text vor dem Senden." }),
640
+ error && /* @__PURE__ */ jsx2("p", { role: "alert", className: "text-danger dark:text-warning mt-2", children: error })
641
+ ]
642
+ }
643
+ );
638
644
  }
639
645
 
640
646
  // src/support-chat.tsx
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var cspPlugin = {
3
3
  id: "chat",
4
- sdkVersion: "^0.13.0",
4
+ sdkVersion: "^0.13.1",
5
5
  browser: "./browser",
6
6
  server: "./server"
7
7
  };
package/dist/server.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  cspPlugin
3
- } from "./chunk-W5TFART7.js";
3
+ } from "./chunk-B7EKNOQK.js";
4
4
 
5
5
  // src/server.ts
6
6
  import { z as z2 } from "zod";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kieksme/csp-plugin-chat",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
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.0",
26
+ "@kieksme/csp-sdk": "^0.13.1",
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.0",
38
+ "sdkVersion": "^0.13.1",
39
39
  "browser": "./browser",
40
40
  "server": "./server"
41
41
  },