@devframes/json-render 0.7.9 → 0.7.11
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 +1 -1
- package/dist/index.d.mts +2 -4
- package/dist/index.mjs +2 -2
- package/dist/node/index.d.mts +1 -1
- package/dist/node/index.mjs +3 -7
- package/dist/{types-Di-9QrXX.d.mts → types-CC2-FD2H.d.mts} +26 -27
- package/dist/{view-ref-B_nBPfeR.mjs → view-index-BItK4ftT.mjs} +1 -16
- package/package.json +5 -5
package/dist/hub.d.mts
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Catalog, InferComponentProps, Spec, StateModel, StateStore, UIElement } from "./core.mjs";
|
|
2
|
-
import { i as JsonRenderViewRef, n as JsonRenderView, r as
|
|
2
|
+
import { a as JsonRenderViewStateRef, i as JsonRenderViewRef, n as JsonRenderView, r as JsonRenderViewInlineRef, t as DevframeJsonRenderSpec } from "./types-CC2-FD2H.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/prop-schemas.d.ts
|
|
5
5
|
declare const StackPropsSchema: z.ZodObject<{
|
|
@@ -360,10 +360,8 @@ interface JsonRenderIndexEntry {
|
|
|
360
360
|
stateKey: string;
|
|
361
361
|
/** Human-facing label for the view (defaults to `id`). */
|
|
362
362
|
title: string;
|
|
363
|
-
/** Upstream `@json-render/*` version the view was authored against. */
|
|
364
|
-
upstreamVersion: string;
|
|
365
363
|
}
|
|
366
364
|
/** The shape of the view-index shared state: entries keyed by `stateKey`. */
|
|
367
365
|
type JsonRenderIndex = Record<string, JsonRenderIndexEntry>;
|
|
368
366
|
//#endregion
|
|
369
|
-
export { BadgePropsSchema, type BaseComponentName, ButtonPropsSchema, CardPropsSchema, type Catalog, CodeBlockPropsSchema, DataTablePropsSchema, type DevframeJsonRenderSpec, DividerPropsSchema, IconPropsSchema, type InferComponentProps, JSON_RENDER_INDEX_KEY,
|
|
367
|
+
export { BadgePropsSchema, type BaseComponentName, ButtonPropsSchema, CardPropsSchema, type Catalog, CodeBlockPropsSchema, DataTablePropsSchema, type DevframeJsonRenderSpec, DividerPropsSchema, IconPropsSchema, type InferComponentProps, JSON_RENDER_INDEX_KEY, type JsonRenderIndex, type JsonRenderIndexEntry, type JsonRenderView, type JsonRenderViewInlineRef, type JsonRenderViewRef, type JsonRenderViewStateRef, KeyValueTablePropsSchema, ProgressPropsSchema, type Spec, StackPropsSchema, type StateModel, type StateStore, SwitchPropsSchema, TextInputPropsSchema, TextPropsSchema, TreePropsSchema, type UIElement, baseCatalog, baseComponentNames, basePropSchemas, baseSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as basePropSchemas, a as CodeBlockPropsSchema, c as IconPropsSchema, d as StackPropsSchema, f as SwitchPropsSchema, g as baseComponentNames, h as TreePropsSchema, i as CardPropsSchema, l as KeyValueTablePropsSchema, m as TextPropsSchema, n as BadgePropsSchema, o as DataTablePropsSchema, p as TextInputPropsSchema, r as ButtonPropsSchema, s as DividerPropsSchema, t as JSON_RENDER_INDEX_KEY, u as ProgressPropsSchema } from "./view-index-BItK4ftT.mjs";
|
|
2
2
|
import { defineCatalog, defineSchema } from "@json-render/core";
|
|
3
3
|
//#region src/catalog.ts
|
|
4
4
|
/**
|
|
@@ -55,4 +55,4 @@ const baseCatalog = defineCatalog(baseSchema, {
|
|
|
55
55
|
actions: {}
|
|
56
56
|
});
|
|
57
57
|
//#endregion
|
|
58
|
-
export { BadgePropsSchema, ButtonPropsSchema, CardPropsSchema, CodeBlockPropsSchema, DataTablePropsSchema, DividerPropsSchema, IconPropsSchema, JSON_RENDER_INDEX_KEY,
|
|
58
|
+
export { BadgePropsSchema, ButtonPropsSchema, CardPropsSchema, CodeBlockPropsSchema, DataTablePropsSchema, DividerPropsSchema, IconPropsSchema, JSON_RENDER_INDEX_KEY, KeyValueTablePropsSchema, ProgressPropsSchema, StackPropsSchema, SwitchPropsSchema, TextInputPropsSchema, TextPropsSchema, TreePropsSchema, baseCatalog, baseComponentNames, basePropSchemas, baseSchema };
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as JsonRenderView, t as DevframeJsonRenderSpec } from "../types-
|
|
1
|
+
import { n as JsonRenderView, t as DevframeJsonRenderSpec } from "../types-CC2-FD2H.mjs";
|
|
2
2
|
import { Diagnostic } from "nostics";
|
|
3
3
|
import { DevframeNodeContext, DevframeScopedNodeContext } from "devframe/types";
|
|
4
4
|
//#region src/node/create-view.d.ts
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as basePropSchemas, t as JSON_RENDER_INDEX_KEY } from "../view-index-BItK4ftT.mjs";
|
|
2
2
|
import { createSharedState } from "devframe/utils/shared-state";
|
|
3
3
|
import { colors } from "devframe/utils/colors";
|
|
4
4
|
import { defineDiagnostics } from "nostics";
|
|
@@ -132,8 +132,7 @@ function createJsonRenderView(ctx, options) {
|
|
|
132
132
|
id,
|
|
133
133
|
scope,
|
|
134
134
|
stateKey,
|
|
135
|
-
title
|
|
136
|
-
upstreamVersion: JSON_RENDER_UPSTREAM_VERSION
|
|
135
|
+
title
|
|
137
136
|
};
|
|
138
137
|
});
|
|
139
138
|
let disposed = false;
|
|
@@ -143,10 +142,7 @@ function createJsonRenderView(ctx, options) {
|
|
|
143
142
|
return {
|
|
144
143
|
id,
|
|
145
144
|
title,
|
|
146
|
-
ref: {
|
|
147
|
-
stateKey,
|
|
148
|
-
upstreamVersion: JSON_RENDER_UPSTREAM_VERSION
|
|
149
|
-
},
|
|
145
|
+
ref: { stateKey },
|
|
150
146
|
value: () => state.value(),
|
|
151
147
|
update(spec) {
|
|
152
148
|
assertLive();
|
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
import { Spec } from "@json-render/core";
|
|
2
2
|
//#region src/view-ref.d.ts
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* upstream version against a view's {@link JsonRenderViewRef.upstreamVersion}
|
|
9
|
-
* and warns (rather than blocking) on a mismatch.
|
|
10
|
-
*
|
|
11
|
-
* Kept paired with the caret range on `@json-render/core` /
|
|
12
|
-
* `@json-render/vue` in this package's manifest; the committed lockfile is
|
|
13
|
-
* the guard against a breaking upstream upgrade.
|
|
4
|
+
* A view backed by **live shared state**: the client subscribes to `stateKey`
|
|
5
|
+
* for the spec + state and re-renders on every update. This is what a
|
|
6
|
+
* node-authored view ({@link import('./node/create-view').createJsonRenderView})
|
|
7
|
+
* produces.
|
|
14
8
|
*/
|
|
15
|
-
|
|
9
|
+
interface JsonRenderViewStateRef {
|
|
10
|
+
/** Shared-state key the client subscribes to for the live spec + state. */
|
|
11
|
+
stateKey: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A view whose spec is embedded **inline** in the reference. It carries no
|
|
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
|
|
17
|
+
* rendered as-is (static: local state and bindings still work, but there is no
|
|
18
|
+
* server-driven live update stream).
|
|
19
|
+
*/
|
|
20
|
+
interface JsonRenderViewInlineRef {
|
|
21
|
+
/** The full spec, carried in the reference itself. */
|
|
22
|
+
spec: DevframeJsonRenderSpec;
|
|
23
|
+
}
|
|
16
24
|
/**
|
|
17
25
|
* The serializable reference to a JSON-render view that crosses process /
|
|
18
26
|
* static boundaries — e.g. projected onto a hub dock entry. It carries **no
|
|
19
|
-
* functions
|
|
20
|
-
* client subscribes
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* This is the corrected projection contract: the previous hub implementation
|
|
24
|
-
* leaked an accidental `_stateKey` field and a non-serializable renderer
|
|
25
|
-
* handle; a `JsonRenderViewRef` is a plain, fully-serializable object.
|
|
27
|
+
* functions**: either a {@link JsonRenderViewStateRef.stateKey shared-state key}
|
|
28
|
+
* the client subscribes through, or an {@link JsonRenderViewInlineRef.spec
|
|
29
|
+
* inline spec} rendered directly.
|
|
26
30
|
*/
|
|
27
|
-
|
|
28
|
-
/** Shared-state key the client subscribes to for the live spec + state. */
|
|
29
|
-
stateKey: string;
|
|
30
|
-
/** Upstream `@json-render/*` version the view was authored against. */
|
|
31
|
-
upstreamVersion: string;
|
|
32
|
-
}
|
|
31
|
+
type JsonRenderViewRef = JsonRenderViewStateRef | JsonRenderViewInlineRef;
|
|
33
32
|
//#endregion
|
|
34
33
|
//#region src/types.d.ts
|
|
35
34
|
/**
|
|
@@ -53,7 +52,7 @@ interface JsonRenderStatePatch {
|
|
|
53
52
|
/**
|
|
54
53
|
* A JSON-render view handle, returned by `createJsonRenderView`. Owns a
|
|
55
54
|
* server-side shared state carrying the live spec + state, and exposes the
|
|
56
|
-
* serializable {@link
|
|
55
|
+
* serializable {@link JsonRenderViewStateRef} that a hub dock (or any client
|
|
57
56
|
* transport) uses to locate it.
|
|
58
57
|
*/
|
|
59
58
|
interface JsonRenderView {
|
|
@@ -62,7 +61,7 @@ interface JsonRenderView {
|
|
|
62
61
|
/** Human-facing label published in the view index (defaults to `id`). */
|
|
63
62
|
readonly title: string;
|
|
64
63
|
/** The serializable reference clients subscribe through. */
|
|
65
|
-
readonly ref:
|
|
64
|
+
readonly ref: JsonRenderViewStateRef;
|
|
66
65
|
/** Replace the entire spec (a structural change replaces the whole spec). */
|
|
67
66
|
update: (spec: DevframeJsonRenderSpec) => void;
|
|
68
67
|
/**
|
|
@@ -77,4 +76,4 @@ interface JsonRenderView {
|
|
|
77
76
|
dispose: () => void;
|
|
78
77
|
}
|
|
79
78
|
//#endregion
|
|
80
|
-
export { JsonRenderViewRef as i, JsonRenderView as n,
|
|
79
|
+
export { JsonRenderViewStateRef as a, JsonRenderViewRef as i, JsonRenderView as n, JsonRenderViewInlineRef as r, DevframeJsonRenderSpec as t };
|
|
@@ -183,19 +183,4 @@ const baseComponentNames = Object.keys(basePropSchemas);
|
|
|
183
183
|
*/
|
|
184
184
|
const JSON_RENDER_INDEX_KEY = "devframe:json-render:index";
|
|
185
185
|
//#endregion
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* The `@json-render/core` / `@json-render/vue` version this build of
|
|
189
|
-
* `@devframes/json-render` is written and tested against. It is the sole
|
|
190
|
-
* compatibility signal carried across the wire — there is no separate
|
|
191
|
-
* Devframes protocol/catalog version stamp. A renderer compares its own
|
|
192
|
-
* upstream version against a view's {@link JsonRenderViewRef.upstreamVersion}
|
|
193
|
-
* and warns (rather than blocking) on a mismatch.
|
|
194
|
-
*
|
|
195
|
-
* Kept paired with the caret range on `@json-render/core` /
|
|
196
|
-
* `@json-render/vue` in this package's manifest; the committed lockfile is
|
|
197
|
-
* the guard against a breaking upstream upgrade.
|
|
198
|
-
*/
|
|
199
|
-
const JSON_RENDER_UPSTREAM_VERSION = "0.19.0";
|
|
200
|
-
//#endregion
|
|
201
|
-
export { baseComponentNames as _, CardPropsSchema as a, DividerPropsSchema as c, ProgressPropsSchema as d, StackPropsSchema as f, TreePropsSchema as g, TextPropsSchema as h, ButtonPropsSchema as i, IconPropsSchema as l, TextInputPropsSchema as m, JSON_RENDER_INDEX_KEY as n, CodeBlockPropsSchema as o, SwitchPropsSchema as p, BadgePropsSchema as r, DataTablePropsSchema as s, JSON_RENDER_UPSTREAM_VERSION as t, KeyValueTablePropsSchema as u, basePropSchemas as v };
|
|
186
|
+
export { basePropSchemas as _, CodeBlockPropsSchema as a, IconPropsSchema as c, StackPropsSchema as d, SwitchPropsSchema as f, baseComponentNames as g, TreePropsSchema as h, CardPropsSchema as i, KeyValueTablePropsSchema as l, TextPropsSchema as m, BadgePropsSchema as n, DataTablePropsSchema as o, TextInputPropsSchema as p, ButtonPropsSchema as r, DividerPropsSchema as s, JSON_RENDER_INDEX_KEY as t, ProgressPropsSchema as u };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devframes/json-render",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.11",
|
|
5
5
|
"description": "Opt-in, framework-neutral JSON-render protocol layer for devframe — spec/catalog types, base catalog, and the node runtime factory.",
|
|
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
|
-
"
|
|
34
|
-
"
|
|
33
|
+
"@devframes/hub": "0.7.11",
|
|
34
|
+
"devframe": "0.7.11"
|
|
35
35
|
},
|
|
36
36
|
"peerDependenciesMeta": {
|
|
37
37
|
"@devframes/hub": {
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^26.1.1",
|
|
48
48
|
"tsdown": "^0.22.12",
|
|
49
|
-
"@devframes/hub": "0.7.
|
|
50
|
-
"devframe": "0.7.
|
|
49
|
+
"@devframes/hub": "0.7.11",
|
|
50
|
+
"devframe": "0.7.11"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "tsdown",
|