@cosmicdrift/kumiko-renderer-web 0.183.2 → 0.185.0
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 +4 -4
- package/src/__tests__/nav-tree.test.tsx +5 -3
- package/src/index.ts +2 -0
- package/src/layout/nav-tree.tsx +2 -0
- package/src/primitives/__tests__/button.test.tsx +27 -0
- package/src/primitives/__tests__/embedded-list-input.test.tsx +583 -0
- package/src/primitives/embedded-list-input.tsx +694 -0
- package/src/primitives/index.tsx +11 -5
- package/src/widgets/__tests__/infinity-list.test.tsx +238 -1
- package/src/widgets/__tests__/upload-zone.test.tsx +57 -0
- package/src/widgets/index.ts +1 -0
- package/src/widgets/infinity-list.tsx +63 -5
- package/src/widgets/upload-zone.tsx +158 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-renderer-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.185.0",
|
|
4
4
|
"description": "Web-platform bindings for @cosmicdrift/kumiko-renderer. HTML default-primitives, browser history-based navigation, EventSource-backed live events, and a one-call createKumikoApp that mounts the whole stack via react-dom.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"./styles.css": "./src/styles.css"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@cosmicdrift/kumiko-dispatcher-live": "0.
|
|
20
|
-
"@cosmicdrift/kumiko-headless": "0.
|
|
21
|
-
"@cosmicdrift/kumiko-renderer": "0.
|
|
19
|
+
"@cosmicdrift/kumiko-dispatcher-live": "0.185.0",
|
|
20
|
+
"@cosmicdrift/kumiko-headless": "0.185.0",
|
|
21
|
+
"@cosmicdrift/kumiko-renderer": "0.185.0",
|
|
22
22
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
23
23
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
24
24
|
"@radix-ui/react-label": "^2.1.8",
|
|
@@ -241,7 +241,7 @@ describe("NavTree", () => {
|
|
|
241
241
|
expect(container.querySelectorAll("svg").length).toBe(2);
|
|
242
242
|
});
|
|
243
243
|
|
|
244
|
-
test("server, mail, download, rocket lösen auf ein Icon auf (Config-/SMTP-Nav)", () => {
|
|
244
|
+
test("server, mail, download, upload, rocket lösen auf ein Icon auf (Config-/SMTP-Nav)", () => {
|
|
245
245
|
// Config-Settings-Hub leitet Child-Nav-Icons aus dem mask.icon der
|
|
246
246
|
// ConfigKey ab (smtp-host="server", from="mail", subscription="rocket");
|
|
247
247
|
// fehlten sie in NAV_ICONS, rendert das Nav blank statt Icon.
|
|
@@ -253,16 +253,18 @@ describe("NavTree", () => {
|
|
|
253
253
|
{ id: "b", type: "entityList", entity: "x", columns: [] },
|
|
254
254
|
{ id: "c", type: "entityList", entity: "x", columns: [] },
|
|
255
255
|
{ id: "d", type: "entityList", entity: "x", columns: [] },
|
|
256
|
+
{ id: "e", type: "entityList", entity: "x", columns: [] },
|
|
256
257
|
],
|
|
257
258
|
navs: [
|
|
258
259
|
{ id: "a", label: "SMTP", screen: "a", order: 10, icon: "server" },
|
|
259
260
|
{ id: "b", label: "From", screen: "b", order: 20, icon: "mail" },
|
|
260
261
|
{ id: "c", label: "Export", screen: "c", order: 30, icon: "download" },
|
|
261
|
-
{ id: "d", label: "
|
|
262
|
+
{ id: "d", label: "Import", screen: "d", order: 40, icon: "upload" },
|
|
263
|
+
{ id: "e", label: "Billing", screen: "e", order: 50, icon: "rocket" },
|
|
262
264
|
],
|
|
263
265
|
} as FeatureSchema;
|
|
264
266
|
const { container } = render(<NavTree schema={schema} />);
|
|
265
|
-
expect(container.querySelectorAll("svg").length).toBe(
|
|
267
|
+
expect(container.querySelectorAll("svg").length).toBe(5);
|
|
266
268
|
});
|
|
267
269
|
|
|
268
270
|
test("palette, link und share rendern Lucide-Icons (Share-/Branding-Nav)", () => {
|
package/src/index.ts
CHANGED
|
@@ -185,6 +185,7 @@ export type {
|
|
|
185
185
|
TextareaFieldProps,
|
|
186
186
|
TextFieldProps,
|
|
187
187
|
TimeseriesPoint,
|
|
188
|
+
UploadZoneProps,
|
|
188
189
|
} from "./widgets";
|
|
189
190
|
export {
|
|
190
191
|
AiTextArea,
|
|
@@ -223,5 +224,6 @@ export {
|
|
|
223
224
|
TextareaField,
|
|
224
225
|
TextField,
|
|
225
226
|
TimeseriesChart,
|
|
227
|
+
UploadZone,
|
|
226
228
|
useDraft,
|
|
227
229
|
} from "./widgets";
|
package/src/layout/nav-tree.tsx
CHANGED
|
@@ -71,6 +71,7 @@ import {
|
|
|
71
71
|
Table,
|
|
72
72
|
Tag,
|
|
73
73
|
TrendingUp,
|
|
74
|
+
Upload,
|
|
74
75
|
User,
|
|
75
76
|
Users,
|
|
76
77
|
Wallet,
|
|
@@ -152,6 +153,7 @@ const NAV_ICONS: Readonly<Record<string, typeof Folder>> = {
|
|
|
152
153
|
lock: Lock,
|
|
153
154
|
hash: Hash,
|
|
154
155
|
download: Download,
|
|
156
|
+
upload: Upload,
|
|
155
157
|
rocket: Rocket,
|
|
156
158
|
// Was imported but never registered — `icon: "plus"` silently fell back.
|
|
157
159
|
plus: Plus,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { render, screen } from "@testing-library/react";
|
|
3
|
+
import { createRef } from "react";
|
|
4
|
+
import { defaultPrimitives } from "../index";
|
|
5
|
+
|
|
6
|
+
const { Button } = defaultPrimitives;
|
|
7
|
+
|
|
8
|
+
describe("DefaultButton className/ref (fw#1831)", () => {
|
|
9
|
+
test("merged className landet auf dem DOM-Node", () => {
|
|
10
|
+
render(
|
|
11
|
+
<Button className="my-custom-class" testId="btn">
|
|
12
|
+
Save
|
|
13
|
+
</Button>,
|
|
14
|
+
);
|
|
15
|
+
expect(screen.getByTestId("btn").className).toContain("my-custom-class");
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test("ref landet auf dem <button>-Element", () => {
|
|
19
|
+
const ref = createRef<HTMLButtonElement>();
|
|
20
|
+
render(
|
|
21
|
+
<Button ref={ref} testId="btn">
|
|
22
|
+
Save
|
|
23
|
+
</Button>,
|
|
24
|
+
);
|
|
25
|
+
expect(ref.current).toBe(screen.getByTestId("btn"));
|
|
26
|
+
});
|
|
27
|
+
});
|