@emseepea/create-react-ui-server 0.0.27 → 0.0.28
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.
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@emseepea/feedback": "0.2.10",
|
|
19
19
|
"playwright": "1.62.1",
|
|
20
20
|
"axe-core": "4.13.0",
|
|
21
|
-
"@emseepea/testing": "0.
|
|
21
|
+
"@emseepea/testing": "0.10.0",
|
|
22
22
|
"@types/node": "24.13.3",
|
|
23
23
|
"@types/react": "19.2.18",
|
|
24
24
|
"@types/react-dom": "19.2.5",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"private": true,
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@emseepea/react": "0.
|
|
34
|
+
"@emseepea/react": "0.2.0",
|
|
35
35
|
"@emseepea/server": "0.11.0",
|
|
36
36
|
"@emseepea/tailwind": "0.0.2",
|
|
37
37
|
"react": "19.2.8",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResultCard, useMcpApp } from "@emseepea/react";
|
|
1
|
+
import { ResultCard, useMcpApp, useMcpTheme } from "@emseepea/react";
|
|
2
2
|
import { defineResultView, type ResultView as ResultViewModel } from "@emseepea/server/ui";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { hydrateRoot } from "react-dom/client";
|
|
@@ -16,11 +16,12 @@ interface PlantingPlanResult {
|
|
|
16
16
|
|
|
17
17
|
export function ResultApp() {
|
|
18
18
|
const app = useMcpApp({ name: "Pea planting plan result", version: "1.0.0", parseResult: parsePlantingPlan });
|
|
19
|
+
const theme = useMcpTheme(app.hostContext.theme);
|
|
19
20
|
const [action, setAction] = useState<"idle" | "sending" | "sent" | "error">("idle");
|
|
20
21
|
|
|
21
22
|
useEffect(() => {
|
|
22
|
-
|
|
23
|
-
}, [
|
|
23
|
+
document.documentElement.dataset.emseepeaTheme = theme;
|
|
24
|
+
}, [theme]);
|
|
24
25
|
|
|
25
26
|
const view = resultView(app, action);
|
|
26
27
|
const act = async () => {
|
|
@@ -83,7 +83,7 @@ test("the MCP Apps card completes initialization before rendering a result", asy
|
|
|
83
83
|
protocolVersion: "2026-01-26",
|
|
84
84
|
hostInfo: { name: "test-host", version: "1.0.0" },
|
|
85
85
|
hostCapabilities: {},
|
|
86
|
-
hostContext: {
|
|
86
|
+
hostContext: { displayMode: "inline" },
|
|
87
87
|
} }, "*");
|
|
88
88
|
}
|
|
89
89
|
if (event.data?.method === "ui/notifications/initialized") {
|
|
@@ -104,6 +104,7 @@ test("the MCP Apps card completes initialization before rendering a result", asy
|
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
106
|
const frame = page.frames()[1];
|
|
107
|
+
await page.emulateMedia({ colorScheme: "dark" });
|
|
107
108
|
await frame.setContent(content.text);
|
|
108
109
|
const status = frame.locator("[data-emseepea-part='status']");
|
|
109
110
|
await status.filter({ hasText: "1 sample pea variety matches." }).waitFor();
|
|
@@ -113,6 +114,9 @@ test("the MCP Apps card completes initialization before rendering a result", asy
|
|
|
113
114
|
assert.match(await frame.locator("details li").textContent(), /Highland Snap, climbing snap pea/);
|
|
114
115
|
assert.equal(await frame.locator("button").getAttribute("type"), "button");
|
|
115
116
|
assert.equal(await frame.locator("button").getAttribute("aria-label"), "Ask for growing tips for these varieties");
|
|
117
|
+
assert.equal(await frame.locator("html").getAttribute("data-emseepea-theme"), "dark");
|
|
118
|
+
await page.emulateMedia({ colorScheme: "light" });
|
|
119
|
+
await frame.locator("html[data-emseepea-theme='light']").waitFor();
|
|
116
120
|
await frame.addScriptTag({ path: require.resolve("axe-core/axe.min.js") });
|
|
117
121
|
const accessibility = await frame.evaluate(() => window.axe.run(document));
|
|
118
122
|
assert.deepEqual(accessibility.violations.map(({ id }) => id), []);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emseepea/create-react-ui-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"description": "Create an Em See Pea server with an accessible React form.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@emseepea/feedback": "0.2.10",
|
|
22
|
-
"@emseepea/react": "0.
|
|
22
|
+
"@emseepea/react": "0.2.0",
|
|
23
23
|
"@emseepea/server": "0.11.0",
|
|
24
24
|
"@emseepea/tailwind": "0.0.2",
|
|
25
25
|
"react": "19.2.8",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@emseepea/example-ui-shared": "0.0.0",
|
|
28
28
|
"playwright": "1.62.1",
|
|
29
29
|
"axe-core": "4.13.0",
|
|
30
|
-
"@emseepea/testing": "0.
|
|
30
|
+
"@emseepea/testing": "0.10.0",
|
|
31
31
|
"@types/node": "24.13.3",
|
|
32
32
|
"@types/react": "19.2.18",
|
|
33
33
|
"@types/react-dom": "19.2.5",
|