@djangocfg/widget-chat 0.1.1 → 0.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/widget-chat",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "A transport-agnostic chat surface: a pure core, a store, primitives, a composer, and the assembled components a host mounts",
5
5
  "keywords": [
6
6
  "chat",
@@ -50,12 +50,13 @@
50
50
  "scripts": {
51
51
  "check": "tsc --noEmit",
52
52
  "check-types": "tsc --noEmit",
53
+ "lint": "eslint .",
53
54
  "test": "vitest run",
54
55
  "test:watch": "vitest"
55
56
  },
56
57
  "dependencies": {
57
- "@djangocfg/widget-kit": "^0.1.1",
58
- "@djangocfg/widget-media": "^0.1.1",
58
+ "@djangocfg/widget-kit": "^0.1.2",
59
+ "@djangocfg/widget-media": "^0.1.2",
59
60
  "@streamdown/code": "^1.1.1",
60
61
  "@streamdown/math": "^1.0.2",
61
62
  "mdast-util-to-string": "^4.0.0",
@@ -65,17 +66,17 @@
65
66
  "use-stick-to-bottom": "^1.1.6"
66
67
  },
67
68
  "peerDependencies": {
68
- "@djangocfg/i18n": "^2.1.542",
69
- "@djangocfg/ui-core": "^2.1.542",
69
+ "@djangocfg/i18n": "^2.1.543",
70
+ "@djangocfg/ui-core": "^2.1.543",
70
71
  "lucide-react": "^0.545.0",
71
72
  "react": "^19.0.0",
72
73
  "remark-gfm": "^4.0.0",
73
74
  "streamdown": "^2.6.0"
74
75
  },
75
76
  "devDependencies": {
76
- "@djangocfg/i18n": "^2.1.542",
77
- "@djangocfg/typescript-config": "^2.1.542",
78
- "@djangocfg/ui-core": "^2.1.542",
77
+ "@djangocfg/i18n": "^2.1.543",
78
+ "@djangocfg/typescript-config": "^2.1.543",
79
+ "@djangocfg/ui-core": "^2.1.543",
79
80
  "@storybook/react-vite": "^10.5.0",
80
81
  "@types/node": "^25.9.5",
81
82
  "@types/react": "19.2.15",
@@ -16,8 +16,8 @@ import { Field } from "./field";
16
16
  * Separate from `primitives/stories-harness.tsx` rather than a variant of it:
17
17
  * that one auto-sends on mount to produce a transcript, which is the opposite
18
18
  * of what these stories need. Here nothing is sent until someone types, because
19
- * the states worth seeing — a menu tracking the caret, a chip tray, the send
20
- * button flipping to Stop — only exist while a human is mid-input.
19
+ * the states worth seeing — a menu tracking the caret, the send button
20
+ * flipping to Stop — only exist while a human is mid-input.
21
21
  *
22
22
  * Copy is passed in as English literals. This package carries no locales
23
23
  * (`ComposerInput`'s `label` is documented as host copy), so a workbench that
@@ -25,14 +25,6 @@ import { Field } from "./field";
25
25
  */
26
26
 
27
27
  const surface = "relative grid gap-2 rounded-lg border border-border bg-background p-2";
28
- const chips = "flex flex-wrap gap-1";
29
- // A FIXED height (`h-7`), not padding-derived: with `py-1` the height came from
30
- // the content, so a chip carrying a 24px thumbnail grew taller than a plain one
31
- // and the tray went ragged — visible the moment an image and a PDF sat side by
32
- // side. The row now sets the height and the thumbnail (`h-full`) fits itself
33
- // into it. `overflow-hidden` keeps the picture inside the rounded corner.
34
- const chip =
35
- "flex h-7 items-center gap-1 overflow-hidden rounded border border-border bg-muted pl-2 pr-1 text-xs";
36
28
  // `rounded-control` — ui-core's `--radius-control`, the app's one corner for
37
29
  // interactive controls. Matches what `ui/chat.tsx` ships, so the workbench and
38
30
  // the packaged chat cannot drift on geometry.
@@ -72,6 +72,8 @@ export function useVoice(
72
72
  const latest = useRef(effective);
73
73
  latest.current = effective;
74
74
 
75
+ const hasEngine = effective !== undefined;
76
+
75
77
  const session = useMemo(() => {
76
78
  if (effective === undefined) return null;
77
79
  return new VoiceSession({
@@ -91,7 +93,8 @@ export function useVoice(
91
93
  // through the ref — so this is the whole dependency. Keyed on the EFFECTIVE
92
94
  // engine: a host capability arriving late must replace the default, and
93
95
  // keying on `capability` alone would leave the browser engine in place.
94
- }, [effective === undefined]);
96
+ // eslint-disable-next-line react-hooks/exhaustive-deps
97
+ }, [hasEngine]);
95
98
 
96
99
  useEffect(() => () => session?.dispose(), [session]);
97
100
 
@@ -4,7 +4,7 @@ import { MessageQuote } from "./message-quote";
4
4
 
5
5
  import type { ChatMessage } from "../core/parts";
6
6
  import { useChatCopy } from "../i18n";
7
- import { Message as HeadlessMessage, MessageContent as HeadlessMessageContent } from "../primitives";
7
+ import { Message as HeadlessMessage } from "../primitives";
8
8
  import { usePreviousMessageTime } from "../store";
9
9
  import { dayHeadingFor } from "../utils";
10
10
  import { CollapsibleRow } from "./collapsible-row";