@cosmicdrift/kumiko-renderer-web 0.15.0 → 0.16.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-renderer-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.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>",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { applyTokensToCssVars } from "../tokens";
|
|
3
|
+
|
|
4
|
+
describe("applyTokensToCssVars", () => {
|
|
5
|
+
test("is a documented no-op kept for backward compatibility", () => {
|
|
6
|
+
expect(() => applyTokensToCssVars({} as never)).not.toThrow();
|
|
7
|
+
});
|
|
8
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import {
|
|
3
|
+
clearTargetSearchParams,
|
|
4
|
+
parseTargetFromSearchParams,
|
|
5
|
+
serializeTarget,
|
|
6
|
+
} from "../target-url";
|
|
7
|
+
|
|
8
|
+
describe("serializeTarget / parseTargetFromSearchParams", () => {
|
|
9
|
+
test("round-trips target + string args", () => {
|
|
10
|
+
const updates = serializeTarget(
|
|
11
|
+
{ featureId: "text-content", action: "edit", args: { slug: "imprint", lang: "de" } },
|
|
12
|
+
{},
|
|
13
|
+
);
|
|
14
|
+
const params = Object.fromEntries(
|
|
15
|
+
Object.entries(updates).filter(([, v]) => v !== null) as [string, string][],
|
|
16
|
+
);
|
|
17
|
+
expect(parseTargetFromSearchParams(params)).toEqual({
|
|
18
|
+
featureId: "text-content",
|
|
19
|
+
action: "edit",
|
|
20
|
+
args: { slug: "imprint", lang: "de" },
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test("returns undefined when t param missing", () => {
|
|
25
|
+
expect(parseTargetFromSearchParams({})).toBeUndefined();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe("clearTargetSearchParams", () => {
|
|
30
|
+
test("clears t and all a_* keys", () => {
|
|
31
|
+
expect(clearTargetSearchParams({ t: "x:y", a_slug: "imprint", keep: "1" })).toEqual({
|
|
32
|
+
t: null,
|
|
33
|
+
a_slug: null,
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { cn } from "../cn";
|
|
3
|
+
|
|
4
|
+
describe("cn", () => {
|
|
5
|
+
test("merges conditional classes and resolves tailwind conflicts", () => {
|
|
6
|
+
expect(cn("px-2", false && "hidden", "px-4")).toBe("px-4");
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
test("joins unrelated classes", () => {
|
|
10
|
+
expect(cn("text-sm", "font-bold")).toBe("text-sm font-bold");
|
|
11
|
+
});
|
|
12
|
+
});
|