@devframes/json-render 0.9.8 → 0.9.10

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/dist/hub.d.mts CHANGED
@@ -1,10 +1,10 @@
1
- import { a as JsonRenderViewRef, r as JsonRenderView } from "./types-P1hZJnNo.mjs";
1
+ import { a as JsonRenderViewRef, r as JsonRenderView } from "./types-ByXkazOp.mjs";
2
2
  import { DockRenderer, DockRendererMountOptions } from "@devframes/hub/client";
3
3
  import { DevframeDockEntryBase } from "@devframes/hub/types";
4
4
  //#region src/hub.d.ts
5
5
  /**
6
6
  * A `json-render` dock entry. Contributed to the hub's **open** dock union
7
- * (`DevframeDockEntryRegistry`) by this opt-in integration — the hub itself
7
+ * (`DevframeDockEntryRegistry`) by this opt-in integration, since the hub itself
8
8
  * hard-codes no json-render variant. Carries only the serializable
9
9
  * {@link JsonRenderViewRef}; no functions cross the wire.
10
10
  */
@@ -19,17 +19,17 @@ declare module '@devframes/hub/types' {
19
19
  }
20
20
  }
21
21
  /**
22
- * The mount options a hub viewer hands a json-render dock renderer — the
22
+ * The mount options a hub viewer hands a json-render dock renderer: the
23
23
  * hub's `DockRendererMountOptions` narrowed to the `'json-render'` entry.
24
- * This protocol package owns the renderer contract so every frontend —
25
- * `@devframes/json-render-ui`, a community renderer, a host page's own —
24
+ * This protocol package owns the renderer contract so every frontend
25
+ * (`@devframes/json-render-ui`, a community renderer, a host page's own)
26
26
  * implements one shared shape instead of re-declaring it.
27
27
  */
28
28
  type JsonRenderDockMountOptions = DockRendererMountOptions<DevframeJsonRenderDockEntry>;
29
29
  /**
30
30
  * The renderer contract for `'json-render'` docks: a hub `DockRenderer`
31
31
  * narrowed to {@link DevframeJsonRenderDockEntry}. Implement it to replace
32
- * the reference frontend — register the implementation locally
32
+ * the reference frontend: register the implementation locally
33
33
  * (`createDevframeClientRuntime({ renderers })`) or ship it as a prebuilt
34
34
  * module registered through the hub's renderer manifest
35
35
  * (`initHub({ renderers })`).
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Catalog, InferComponentProps, Spec, StateModel, StateStore, UIElement } from "./core.mjs";
2
- import { a as JsonRenderViewRef, i as JsonRenderViewInlineRef, n as DevframeJsonRenderSpec, o as JsonRenderViewStateRef, r as JsonRenderView, t as CatalogUIElement } from "./types-P1hZJnNo.mjs";
2
+ import { a as JsonRenderViewRef, i as JsonRenderViewInlineRef, n as DevframeJsonRenderSpec, o as JsonRenderViewStateRef, r as JsonRenderView, t as CatalogUIElement } from "./types-ByXkazOp.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/prop-schemas.d.ts
5
5
  declare const StackPropsSchema: z.ZodObject<{
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as TextPropsSchema, a as CodeBlockPropsSchema, b as basePropSchemas, c as IconPropsSchema, d as ProgressPropsSchema, f as SelectPropsSchema, g as TextInputPropsSchema, h as TabsPropsSchema, i as CardPropsSchema, l as KeyValueTablePropsSchema, m as SwitchPropsSchema, n as BadgePropsSchema, o as DataTablePropsSchema, p as StackPropsSchema, r as ButtonPropsSchema, s as DividerPropsSchema, t as JSON_RENDER_INDEX_KEY, u as LinkPropsSchema, v as TreePropsSchema, y as baseComponentNames } from "./view-index-CJ8aJJLZ.mjs";
1
+ import { _ as TextPropsSchema, a as CodeBlockPropsSchema, b as basePropSchemas, c as IconPropsSchema, d as ProgressPropsSchema, f as SelectPropsSchema, g as TextInputPropsSchema, h as TabsPropsSchema, i as CardPropsSchema, l as KeyValueTablePropsSchema, m as SwitchPropsSchema, n as BadgePropsSchema, o as DataTablePropsSchema, p as StackPropsSchema, r as ButtonPropsSchema, s as DividerPropsSchema, t as JSON_RENDER_INDEX_KEY, u as LinkPropsSchema, v as TreePropsSchema, y as baseComponentNames } from "./view-index-De3Gt127.mjs";
2
2
  import { defineCatalog, defineSchema } from "@json-render/core";
3
3
  //#region src/catalog.ts
4
4
  /**
@@ -28,7 +28,7 @@ const baseSchema = defineSchema((s) => ({
28
28
  const componentDescriptions = {
29
29
  Stack: "Flex row/column container with gap, padding, alignment and justification.",
30
30
  Card: "Bordered container with an optional title and collapsible body.",
31
- Text: "Typographic text — heading, subheading, body, caption or inline code.",
31
+ Text: "Typographic text: heading, subheading, body, caption or inline code.",
32
32
  Badge: "Small status pill with a semantic variant.",
33
33
  Button: "Clickable button with a variant, optional icon and loading state.",
34
34
  Icon: "Renders an icon resolved by name at runtime.",
@@ -1,4 +1,4 @@
1
- import { n as DevframeJsonRenderSpec, r as JsonRenderView } from "../types-P1hZJnNo.mjs";
1
+ import { n as DevframeJsonRenderSpec, r as JsonRenderView } from "../types-ByXkazOp.mjs";
2
2
  import { StandardSchemaV1 } from "@standard-schema/spec";
3
3
  import { DevframeNodeContext, DevframeScopedNodeContext } from "devframe";
4
4
  //#region src/node/create-view.d.ts
@@ -274,6 +274,11 @@ type ExtractSingleReporterOptions<Reporter> = Reporter extends ((diagnostic: Dia
274
274
  type ExtractReportersOptions<Reporters extends readonly any[]> = Reporters extends readonly [infer First, ...infer Rest] ? ExtractSingleReporterOptions<First> & ExtractReportersOptions<Rest> : {};
275
275
  //#endregion
276
276
  //#region src/node/diagnostics.d.ts
277
+ /**
278
+ * `@devframes/json-render` protocol/runtime diagnostics share the `DF`
279
+ * prefix and use the next globally available core codes. Browser-only render
280
+ * failures keep `console.*` in the UI package.
281
+ */
277
282
  declare const diagnostics: Diagnostics<{
278
283
  readonly DF0038: {
279
284
  readonly why: (p: {
@@ -301,7 +306,7 @@ declare const diagnostics: Diagnostics<{
301
306
  id: string;
302
307
  reason: string;
303
308
  }) => string;
304
- readonly fix: "Specs and state travel as strict JSON — remove functions, symbols, class instances, Map/Set, or circular references.";
309
+ readonly fix: "Specs and state travel as strict JSON, so remove functions, symbols, class instances, Map/Set, or circular references.";
305
310
  };
306
311
  readonly DF0073: {
307
312
  readonly why: (p: {
@@ -1,7 +1,12 @@
1
- import { b as basePropSchemas, t as JSON_RENDER_INDEX_KEY } from "../view-index-CJ8aJJLZ.mjs";
1
+ import { b as basePropSchemas, t as JSON_RENDER_INDEX_KEY } from "../view-index-De3Gt127.mjs";
2
2
  import { createSharedState } from "devframe/utils/shared-state";
3
3
  import { defineDiagnostics } from "devframe/utils/nostics";
4
4
  //#region src/node/diagnostics.ts
5
+ /**
6
+ * `@devframes/json-render` protocol/runtime diagnostics share the `DF`
7
+ * prefix and use the next globally available core codes. Browser-only render
8
+ * failures keep `console.*` in the UI package.
9
+ */
5
10
  const diagnostics = defineDiagnostics({
6
11
  docsBase: "https://devfra.me/errors",
7
12
  codes: {
@@ -19,7 +24,7 @@ const diagnostics = defineDiagnostics({
19
24
  },
20
25
  DF0041: {
21
26
  why: (p) => `JSON-render view "${p.id}" spec is not JSON-serializable: ${p.reason}`,
22
- fix: "Specs and state travel as strict JSON — remove functions, symbols, class instances, Map/Set, or circular references."
27
+ fix: "Specs and state travel as strict JSON, so remove functions, symbols, class instances, Map/Set, or circular references."
23
28
  },
24
29
  DF0073: {
25
30
  why: (p) => `JSON-render view "${p.id}" does not match its configured schema: ${p.issues}`,
@@ -13,7 +13,7 @@ interface JsonRenderViewStateRef {
13
13
  /**
14
14
  * A view whose spec is embedded **inline** in the reference. It carries no
15
15
  * shared-state key, so a client can synthesize a view entirely in the browser
16
- * and hand it straight to a renderer — no `sharedState` round-trip. The spec is
16
+ * and hand it straight to a renderer, with no `sharedState` round-trip. The spec is
17
17
  * rendered as-is (static: local state and bindings still work, but there is no
18
18
  * server-driven live update stream).
19
19
  */
@@ -23,7 +23,7 @@ interface JsonRenderViewInlineRef<SpecType extends DevframeJsonRenderSpec = Devf
23
23
  }
24
24
  /**
25
25
  * The serializable reference to a JSON-render view that crosses process /
26
- * static boundaries — e.g. projected onto a hub dock entry. It carries **no
26
+ * static boundaries, e.g. projected onto a hub dock entry. It carries **no
27
27
  * functions**: either a {@link JsonRenderViewStateRef.stateKey shared-state key}
28
28
  * the client subscribes through, or an {@link JsonRenderViewInlineRef.spec
29
29
  * inline spec} rendered directly.
@@ -7,7 +7,7 @@ import { z } from "zod";
7
7
  * `Record<string, unknown>`, so it validates component *names* but not
8
8
  * per-component *props*. These schemas are the one validation Devframes
9
9
  * adds: element props are parsed against the matching schema at both trust
10
- * boundaries — spec ingress (server) and render time (client).
10
+ * boundaries: spec ingress (server) and render time (client).
11
11
  *
12
12
  * Each schema validates the types of the documented props and tolerates
13
13
  * extra keys (upstream directives like `$bindState` resolve to values at
@@ -148,6 +148,7 @@ const TreePropsSchema = z.object({
148
148
  defaultExpanded: bool.optional()
149
149
  });
150
150
  const TabsPropsSchema = z.object({
151
+ /** `children[i]` renders under `tabs[i]`; the two arrays are positional. */
151
152
  tabs: scalar(z.array(z.looseObject({
152
153
  value: z.string(),
153
154
  label: z.string(),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@devframes/json-render",
3
3
  "type": "module",
4
- "version": "0.9.8",
4
+ "version": "0.9.10",
5
5
  "description": "Protocol layer for describing devframe views as JSON that any renderer can display.",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -30,8 +30,8 @@
30
30
  "dist"
31
31
  ],
32
32
  "peerDependencies": {
33
- "@devframes/hub": "0.9.8",
34
- "devframe": "0.9.8"
33
+ "@devframes/hub": "0.9.10",
34
+ "devframe": "0.9.10"
35
35
  },
36
36
  "peerDependenciesMeta": {
37
37
  "@devframes/hub": {
@@ -44,9 +44,9 @@
44
44
  "zod": "^4.5.4"
45
45
  },
46
46
  "devDependencies": {
47
- "@devframes/hub": "0.9.8",
47
+ "@devframes/hub": "0.9.10",
48
48
  "@types/node": "^26.4.0",
49
- "devframe": "0.9.8",
49
+ "devframe": "0.9.10",
50
50
  "tsdown": "^0.22.14"
51
51
  },
52
52
  "scripts": {