@assistant-ui/react-native 0.1.34 → 0.1.35
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": "@assistant-ui/react-native",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.35",
|
|
4
4
|
"description": "React Native bindings for assistant-ui",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"assistant",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
],
|
|
32
32
|
"sideEffects": false,
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@assistant-ui/core": "^0.3.
|
|
35
|
-
"@assistant-ui/store": "^0.3.
|
|
36
|
-
"@assistant-ui/tap": "^0.9.
|
|
37
|
-
"assistant-stream": "^0.3.
|
|
34
|
+
"@assistant-ui/core": "^0.3.10",
|
|
35
|
+
"@assistant-ui/store": "^0.3.8",
|
|
36
|
+
"@assistant-ui/tap": "^0.9.11",
|
|
37
|
+
"assistant-stream": "^0.3.36",
|
|
38
38
|
"zustand": "^5.0.14"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@types/react": "^19.2.
|
|
52
|
-
"@types/react-dom": "^19.2.
|
|
53
|
-
"jsdom": "^
|
|
51
|
+
"@types/react": "^19.2.18",
|
|
52
|
+
"@types/react-dom": "^19.2.4",
|
|
53
|
+
"jsdom": "^30.0.1",
|
|
54
54
|
"react": "^19.2.8",
|
|
55
55
|
"react-dom": "^19.2.8",
|
|
56
|
-
"react-native": "^0.86.
|
|
56
|
+
"react-native": "^0.86.2",
|
|
57
57
|
"react-native-web": "^0.21.2",
|
|
58
58
|
"vitest": "^4.1.10",
|
|
59
|
-
"@assistant-ui/x-buildutils": "0.0.
|
|
59
|
+
"@assistant-ui/x-buildutils": "0.0.22"
|
|
60
60
|
},
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public",
|
|
@@ -74,11 +74,9 @@ describe("MessageContent", () => {
|
|
|
74
74
|
|
|
75
75
|
it("prefers a provided renderText over the default renderer", async () => {
|
|
76
76
|
h.state.message.content = [{ type: "text", text: "raw" }];
|
|
77
|
-
const renderText = vi.fn(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
),
|
|
81
|
-
);
|
|
77
|
+
const renderText = vi.fn(({ part, index }): ReactElement => (
|
|
78
|
+
<span data-testid={`text-${index}`}>custom:{part.text}</span>
|
|
79
|
+
));
|
|
82
80
|
await mount({ renderText });
|
|
83
81
|
|
|
84
82
|
expect(renderText).toHaveBeenCalledTimes(1);
|
|
@@ -115,18 +113,18 @@ describe("MessageContent", () => {
|
|
|
115
113
|
{ type: "source", sourceType: "url", id: "1", url: "u" },
|
|
116
114
|
{ type: "file", filename: "f" },
|
|
117
115
|
];
|
|
118
|
-
const renderImage = vi.fn(
|
|
119
|
-
|
|
120
|
-
);
|
|
121
|
-
const renderReasoning = vi.fn(
|
|
122
|
-
|
|
123
|
-
);
|
|
124
|
-
const renderSource = vi.fn(
|
|
125
|
-
|
|
126
|
-
);
|
|
127
|
-
const renderFile = vi.fn(
|
|
128
|
-
|
|
129
|
-
);
|
|
116
|
+
const renderImage = vi.fn(({ index }): ReactElement => (
|
|
117
|
+
<span>image-{index}</span>
|
|
118
|
+
));
|
|
119
|
+
const renderReasoning = vi.fn(({ index }): ReactElement => (
|
|
120
|
+
<span>reasoning-{index}</span>
|
|
121
|
+
));
|
|
122
|
+
const renderSource = vi.fn(({ index }): ReactElement => (
|
|
123
|
+
<span>source-{index}</span>
|
|
124
|
+
));
|
|
125
|
+
const renderFile = vi.fn(({ index }): ReactElement => (
|
|
126
|
+
<span>file-{index}</span>
|
|
127
|
+
));
|
|
130
128
|
await mount({ renderImage, renderReasoning, renderSource, renderFile });
|
|
131
129
|
|
|
132
130
|
expect(container.textContent).toBe("image-0reasoning-1source-2file-3");
|
|
@@ -183,13 +181,11 @@ describe("MessageContent", () => {
|
|
|
183
181
|
h.state.message.content = [
|
|
184
182
|
{ type: "tool-call", toolName: "search", toolCallId: "c1" },
|
|
185
183
|
];
|
|
186
|
-
const renderToolCall = vi.fn(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
),
|
|
192
|
-
);
|
|
184
|
+
const renderToolCall = vi.fn(({ part, index }): ReactElement => (
|
|
185
|
+
<span data-testid="fallback">
|
|
186
|
+
fallback:{String(part.toolName)}:{index}
|
|
187
|
+
</span>
|
|
188
|
+
));
|
|
193
189
|
await mount({ renderToolCall });
|
|
194
190
|
|
|
195
191
|
const el = container.querySelector('[data-testid="fallback"]');
|
|
@@ -239,13 +235,11 @@ describe("MessageContent", () => {
|
|
|
239
235
|
|
|
240
236
|
it("falls back to renderData when no renderer is registered", async () => {
|
|
241
237
|
h.state.message.content = [{ type: "data", name: "chart", data: {} }];
|
|
242
|
-
const renderData = vi.fn(
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
),
|
|
248
|
-
);
|
|
238
|
+
const renderData = vi.fn(({ part, index }): ReactElement => (
|
|
239
|
+
<span data-testid="dfallback">
|
|
240
|
+
fallback:{String(part.name)}:{index}
|
|
241
|
+
</span>
|
|
242
|
+
));
|
|
249
243
|
await mount({ renderData });
|
|
250
244
|
|
|
251
245
|
const el = container.querySelector('[data-testid="dfallback"]');
|