@cosmicdrift/kumiko-renderer-web 0.176.0 → 0.176.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": "@cosmicdrift/kumiko-renderer-web",
3
- "version": "0.176.0",
3
+ "version": "0.176.2",
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.176.0",
20
- "@cosmicdrift/kumiko-headless": "0.176.0",
21
- "@cosmicdrift/kumiko-renderer": "0.176.0",
19
+ "@cosmicdrift/kumiko-dispatcher-live": "0.176.2",
20
+ "@cosmicdrift/kumiko-headless": "0.176.2",
21
+ "@cosmicdrift/kumiko-renderer": "0.176.2",
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",
@@ -183,6 +183,13 @@ describe("Input kind mapping", () => {
183
183
  expect(document.querySelector("svg[aria-hidden='true']")).toBeNull();
184
184
  });
185
185
 
186
+ test('kind="text" icon="constructor": prototype-chain key → no icon, no padding', () => {
187
+ render(<Input id="i" name="i" kind="text" value="" icon="constructor" onChange={() => {}} />);
188
+ const input = screen.getByRole("textbox");
189
+ expect(input.className).not.toContain("pl-8");
190
+ expect(document.querySelector("svg[aria-hidden='true']")).toBeNull();
191
+ });
192
+
186
193
  test('kind="number" icon="hash": renders prefix icon alongside existing right-align classes', () => {
187
194
  render(<Input id="i" name="i" kind="number" value={0} icon="hash" onChange={() => {}} />);
188
195
  const input = screen.getByRole("spinbutton");
@@ -315,7 +315,8 @@ function NavLeadingIcon({
315
315
  expanded?: boolean;
316
316
  }): ReactNode {
317
317
  const iconKey = expanded && node.icon === "folder" ? "folder-open" : node.icon;
318
- const NavIcon = iconKey !== undefined ? NAV_ICONS[iconKey] : undefined;
318
+ const NavIcon =
319
+ iconKey !== undefined && Object.hasOwn(NAV_ICONS, iconKey) ? NAV_ICONS[iconKey] : undefined;
319
320
  if (NavIcon !== undefined) return <NavIcon aria-hidden="true" className="shrink-0" />;
320
321
  return (
321
322
  <span
@@ -489,7 +490,7 @@ function useNavNodeState(node: NavNode, collapsed: ReadonlySet<string>): NavNode
489
490
  // Action-Icon-Lookup: bekannter NAV_ICONS-Key → Lucide, sonst der rohe
490
491
  // String als Text (Provider-Konvention, kein Boot-Fail bei unknown).
491
492
  function ActionGlyph({ icon }: { readonly icon: string }): ReactNode {
492
- const Icon = NAV_ICONS[icon];
493
+ const Icon = Object.hasOwn(NAV_ICONS, icon) ? NAV_ICONS[icon] : undefined;
493
494
  if (Icon !== undefined) return <Icon aria-hidden className="size-3.5" />;
494
495
  return (
495
496
  <span aria-hidden className="text-xs">
@@ -56,7 +56,10 @@ export function parseIso(v: string): Temporal.PlainDate | undefined {
56
56
  }
57
57
 
58
58
  export function toIso(d: Temporal.PlainDate): string {
59
- return d.toString();
59
+ // calendarName: "never" — a non-ISO PlainDate (e.g. from a future
60
+ // PlainDate.from with a `[u-ca=...]` suffix) would otherwise append the
61
+ // calendar annotation to the wire string.
62
+ return d.toString({ calendarName: "never" });
60
63
  }
61
64
 
62
65
  // Editable, re-parseable display (numeric locale format, e.g. de
@@ -289,7 +289,7 @@ const FIELD_ICONS: Readonly<Record<string, typeof Mail>> = {
289
289
  };
290
290
 
291
291
  function fieldIconFor(icon: string | undefined): (typeof FIELD_ICONS)[string] | undefined {
292
- return icon !== undefined ? FIELD_ICONS[icon] : undefined;
292
+ return icon !== undefined && Object.hasOwn(FIELD_ICONS, icon) ? FIELD_ICONS[icon] : undefined;
293
293
  }
294
294
 
295
295
  // Wraps a text/number input with a left-positioned prefix icon when