@cosmicdrift/kumiko-headless 0.336.0 → 0.337.1

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.
@@ -127,6 +127,20 @@ export const UNIT_FORMAT_KEYS = [
127
127
  export { escapeHtml, escapeHtmlAttr, escapeXml, isSafeHref, stripControlChars } from "./escape.js";
128
128
  export { html, RawHtml, raw } from "./html-template.js";
129
129
  export { currencyDecimals } from "./money.js";
130
+ // JSON.stringify throws on BigInt and circular values; a cell must degrade to text instead of crashing the screen.
131
+ function stringifyJsonOrString(value, indent) {
132
+ try {
133
+ return JSON.stringify(value, null, indent) ?? String(value);
134
+ }
135
+ catch {
136
+ try {
137
+ return String(value);
138
+ }
139
+ catch {
140
+ return "[unserializable value]";
141
+ }
142
+ }
143
+ }
130
144
  export function applyFormatSpec(spec, value, translate) {
131
145
  const isEmpty = value === null || value === undefined || value === "";
132
146
  // priority renders its emptyLabel for empty values — every other format
@@ -181,7 +195,7 @@ export function applyFormatSpec(spec, value, translate) {
181
195
  return translated === key ? raw : translated;
182
196
  }
183
197
  case "json":
184
- return JSON.stringify(value, null, spec["indent"] ?? 2);
198
+ return stringifyJsonOrString(value, typeof spec["indent"] === "number" ? spec["indent"] : 2);
185
199
  default:
186
200
  if (typeof process !== "undefined" && process.env.NODE_ENV !== "production") {
187
201
  // biome-ignore lint/suspicious/noConsole: dev-only warning
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export type { AssetResolution, AssetResolveContext, AssetResolver, BadgeProps, B
4
4
  export type { BatchResult, Command, Dispatcher, DispatcherError, DispatcherStatus, FieldIssue, PendingFile, PendingWrite, QueryOpts, QueryResult, StreamOpts, WriteOpts, WriteResult, } from "./dispatcher/index.js";
5
5
  export { StreamFrame, type StreamFrameEvent } from "./dispatcher/index.js";
6
6
  export type { FieldConditionPredicate, FieldConditions, FieldConditionValue, FieldState, FormController, FormControllerOptions, FormSnapshot, FormValues, SubmitConfig, SubmitPayloadMode, SubmitResult, } from "./form/index.js";
7
- export { createFormController, I18N_KEY_PARAM, relevantFieldIssues, zodErrorToFieldIssues, } from "./form/index.js";
7
+ export { createFormController, groupIssuesByPath, I18N_KEY_PARAM, relevantFieldIssues, zodErrorToFieldIssues, } from "./form/index.js";
8
8
  export { applyFormatSpec, currencyDecimals, escapeHtml, escapeHtmlAttr, escapeXml, type HtmlValue, html, isSafeHref, RawHtml, raw, stripControlChars, toInstant, } from "./format/index.js";
9
9
  export type { NavDefinition, NavNode, NavRegistrySlice, NavTree, ResolveNavigationOptions, } from "./nav/index.js";
10
10
  export { resolveNavigation } from "./nav/index.js";
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // Parser nutzt wie der Server-Boot-Validator (Cross-Feature-Refs).
3
3
  export { parseRefTarget } from "@cosmicdrift/kumiko-framework/ui-types";
4
4
  export { StreamFrame } from "./dispatcher/index.js";
5
- export { createFormController, I18N_KEY_PARAM, relevantFieldIssues, zodErrorToFieldIssues, } from "./form/index.js";
5
+ export { createFormController, groupIssuesByPath, I18N_KEY_PARAM, relevantFieldIssues, zodErrorToFieldIssues, } from "./form/index.js";
6
6
  export { applyFormatSpec, currencyDecimals, escapeHtml, escapeHtmlAttr, escapeXml, html, isSafeHref, RawHtml, raw, stripControlChars, toInstant, } from "./format/index.js";
7
7
  export { resolveNavigation } from "./nav/index.js";
8
8
  export { createStore, shallowEqual } from "./store/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-headless",
3
- "version": "0.336.0",
3
+ "version": "0.337.1",
4
4
  "description": "Headless UI logic for Kumiko — Dispatcher contract, Form-Controller, View-Model, Nav-Resolver. Plattform- und React-frei; jeder Renderer (renderer, renderer-web, renderer-native, …) komponiert darauf.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -36,7 +36,7 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "@cosmicdrift/kumiko-framework": "0.336.0",
39
+ "@cosmicdrift/kumiko-framework": "0.337.1",
40
40
  "temporal-polyfill": "^0.3.2",
41
41
  "zod": "^4.4.3"
42
42
  },