@decaf-ts/ui-decorators 0.17.3 → 0.17.5
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/ui-decorators.cjs +1 -1
- package/lib/cjs/graph/constants.cjs +1 -1
- package/lib/cjs/graph/constants.cjs.map +1 -1
- package/lib/cjs/graph/decorators.cjs +41 -3
- package/lib/cjs/graph/decorators.cjs.map +1 -1
- package/lib/cjs/graph/index.cjs +1 -1
- package/lib/cjs/graph/index.cjs.map +1 -1
- package/lib/cjs/graph/overrides/Rendering.cjs +1 -1
- package/lib/cjs/graph/overrides/Rendering.cjs.map +1 -1
- package/lib/cjs/graph/overrides/index.cjs +1 -1
- package/lib/cjs/graph/overrides/index.cjs.map +1 -1
- package/lib/cjs/graph/overrides/overrides.cjs +1 -1
- package/lib/cjs/graph/overrides/overrides.cjs.map +1 -1
- package/lib/cjs/graph/reader.cjs +89 -6
- package/lib/cjs/graph/reader.cjs.map +1 -1
- package/lib/cjs/graph/snapshot.cjs +1 -1
- package/lib/cjs/graph/snapshot.cjs.map +1 -1
- package/lib/cjs/graph/types.cjs +1 -1
- package/lib/cjs/graph/types.cjs.map +1 -1
- package/lib/cjs/index.cjs +4 -4
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/model/Renderable.cjs +1 -1
- package/lib/cjs/model/Renderable.cjs.map +1 -1
- package/lib/cjs/model/decorators.cjs +1 -1
- package/lib/cjs/model/decorators.cjs.map +1 -1
- package/lib/cjs/model/index.cjs +1 -1
- package/lib/cjs/model/index.cjs.map +1 -1
- package/lib/cjs/model/model.cjs +1 -1
- package/lib/cjs/model/model.cjs.map +1 -1
- package/lib/cjs/model/overrides.cjs +1 -1
- package/lib/cjs/model/overrides.cjs.map +1 -1
- package/lib/cjs/overrides/ModelBuilderExtensions.cjs +1 -1
- package/lib/cjs/overrides/ModelBuilderExtensions.cjs.map +1 -1
- package/lib/cjs/overrides/index.cjs +1 -1
- package/lib/cjs/overrides/index.cjs.map +1 -1
- package/lib/cjs/ui/DecafComponent.cjs +1 -1
- package/lib/cjs/ui/DecafComponent.cjs.map +1 -1
- package/lib/cjs/ui/DecafEventHandler.cjs +1 -1
- package/lib/cjs/ui/DecafEventHandler.cjs.map +1 -1
- package/lib/cjs/ui/DecafTranslateService.cjs +1 -1
- package/lib/cjs/ui/DecafTranslateService.cjs.map +1 -1
- package/lib/cjs/ui/Rendering.cjs +1 -1
- package/lib/cjs/ui/Rendering.cjs.map +1 -1
- package/lib/cjs/ui/UIValidator.cjs +1 -1
- package/lib/cjs/ui/UIValidator.cjs.map +1 -1
- package/lib/cjs/ui/constants.cjs +1 -1
- package/lib/cjs/ui/constants.cjs.map +1 -1
- package/lib/cjs/ui/decorators.cjs +1 -1
- package/lib/cjs/ui/decorators.cjs.map +1 -1
- package/lib/cjs/ui/errors.cjs +1 -1
- package/lib/cjs/ui/errors.cjs.map +1 -1
- package/lib/cjs/ui/index.cjs +1 -1
- package/lib/cjs/ui/index.cjs.map +1 -1
- package/lib/cjs/ui/interfaces/IDecafModal.cjs +1 -1
- package/lib/cjs/ui/interfaces/IDecafModal.cjs.map +1 -1
- package/lib/cjs/ui/interfaces/IDecafRouter.cjs +1 -1
- package/lib/cjs/ui/interfaces/IDecafRouter.cjs.map +1 -1
- package/lib/cjs/ui/interfaces/IDecafSpinner.cjs +1 -1
- package/lib/cjs/ui/interfaces/IDecafSpinner.cjs.map +1 -1
- package/lib/cjs/ui/interfaces/IDecafToast.cjs +1 -1
- package/lib/cjs/ui/interfaces/IDecafToast.cjs.map +1 -1
- package/lib/cjs/ui/interfaces/index.cjs +1 -1
- package/lib/cjs/ui/interfaces/index.cjs.map +1 -1
- package/lib/cjs/ui/overrides.cjs +1 -1
- package/lib/cjs/ui/overrides.cjs.map +1 -1
- package/lib/cjs/ui/types.cjs +1 -1
- package/lib/cjs/ui/types.cjs.map +1 -1
- package/lib/cjs/ui/utils.cjs +1 -1
- package/lib/cjs/ui/utils.cjs.map +1 -1
- package/lib/cjs/ui/validator.cjs +1 -1
- package/lib/cjs/ui/validator.cjs.map +1 -1
- package/lib/esm/graph/decorators.js +39 -2
- package/lib/esm/graph/decorators.js.map +1 -1
- package/lib/esm/graph/reader.js +88 -5
- package/lib/esm/graph/reader.js.map +1 -1
- package/lib/esm/index.js +3 -3
- package/lib/types/graph/constants.d.cts +47 -0
- package/lib/types/graph/constants.d.mts +47 -0
- package/lib/types/graph/decorators.d.cts +34 -0
- package/lib/types/graph/decorators.d.mts +34 -0
- package/lib/types/index.d.cts +3 -3
- package/lib/types/index.d.mts +3 -3
- package/lib/types/model/decorators.d.cts +1 -1
- package/lib/types/model/decorators.d.mts +1 -1
- package/lib/types/ui/decorators.d.cts +5 -5
- package/lib/types/ui/decorators.d.mts +5 -5
- package/package.json +1 -1
package/lib/esm/graph/reader.js
CHANGED
|
@@ -69,20 +69,52 @@ export function graphPortMetadataOf(model, property) {
|
|
|
69
69
|
export function graphPortDefinitionOf(model, property) {
|
|
70
70
|
return graphPortDefinitionOfInternal(resolveModel(model), String(property));
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Returns the flattened ports of a Schema-typed `@input` / `@output` property
|
|
74
|
+
* (a "Schema port group"). The Schema's own `@input` / `@output` properties
|
|
75
|
+
* whose direction matches `direction` are spliced into the result UNPREFIXED
|
|
76
|
+
* (no `<schemaProp>.` prefix). The carrier property itself is not a port.
|
|
77
|
+
*
|
|
78
|
+
* Returns `undefined` when the property is not a Schema group (not
|
|
79
|
+
* `graph.schema`, or not Schema-typed), so the caller falls back to the legacy
|
|
80
|
+
* single-port / composite expansion path.
|
|
81
|
+
*/
|
|
82
|
+
function schemaGroupPorts(resolved, propertyKey, direction, visited = new Set()) {
|
|
83
|
+
const graph = graphPortMetadataOf(resolved, propertyKey);
|
|
84
|
+
if (!graph?.schema)
|
|
85
|
+
return undefined;
|
|
86
|
+
const validation = Metadata.validationFor(resolved, propertyKey);
|
|
87
|
+
const nestedModel = resolveNestedModelConstructor(resolved, propertyKey, validation);
|
|
88
|
+
if (!nestedModel)
|
|
89
|
+
return undefined;
|
|
90
|
+
if (visited.has(nestedModel))
|
|
91
|
+
return []; // cycle guard — stop recursing
|
|
92
|
+
const nextVisited = new Set(visited);
|
|
93
|
+
nextVisited.add(resolved);
|
|
94
|
+
nextVisited.add(nestedModel);
|
|
95
|
+
const childPorts = graphPortsOfInternal(nestedModel, nextVisited);
|
|
96
|
+
return childPorts.filter((child) => child.direction === direction);
|
|
97
|
+
}
|
|
72
98
|
function graphPortDefinitionOfInternal(resolved, propertyKey, visited = new Set()) {
|
|
73
99
|
const graph = graphPortMetadataOf(resolved, propertyKey);
|
|
74
100
|
if (!graph)
|
|
75
101
|
return undefined;
|
|
102
|
+
// Schema port group (@input / @output on a Schema-typed property): the
|
|
103
|
+
// carrier is not a port — its Schema's matching-direction ports are spliced
|
|
104
|
+
// into the parent by graphPortsOfInternal. The singular reader returns
|
|
105
|
+
// undefined for the carrier.
|
|
106
|
+
const validation = Metadata.validationFor(resolved, propertyKey);
|
|
107
|
+
const nestedModel = resolveNestedModelConstructor(resolved, propertyKey, validation);
|
|
108
|
+
if (graph.schema && nestedModel)
|
|
109
|
+
return undefined;
|
|
76
110
|
const element = (Model.uiElementOf(resolved, propertyKey) ||
|
|
77
111
|
undefined);
|
|
78
112
|
const uiProp = Model.uiDecorationOf(resolved, propertyKey, UIKeys.PROP);
|
|
79
|
-
const validation = Metadata.validationFor(resolved, propertyKey);
|
|
80
113
|
const designType = Metadata.type(resolved, propertyKey);
|
|
81
114
|
const typeName = asString(validation?.[ValidationKeys.TYPE]?.customTypes?.[0]?.name ??
|
|
82
115
|
element?.props?.type ??
|
|
83
116
|
uiProp?.type ??
|
|
84
117
|
designType?.name);
|
|
85
|
-
const nestedModel = resolveNestedModelConstructor(resolved, propertyKey, validation);
|
|
86
118
|
const shouldExpand = !!graph.expand || (!!nestedModel && !visited.has(nestedModel));
|
|
87
119
|
const children = shouldExpand && nestedModel
|
|
88
120
|
? (() => {
|
|
@@ -117,9 +149,24 @@ export function graphPortsOf(model) {
|
|
|
117
149
|
}
|
|
118
150
|
function graphPortsOfInternal(resolved, visited = new Set()) {
|
|
119
151
|
const properties = Metadata.properties(resolved) || [];
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
152
|
+
const result = [];
|
|
153
|
+
for (const property of properties) {
|
|
154
|
+
const key = String(property);
|
|
155
|
+
const graph = graphPortMetadataOf(resolved, key);
|
|
156
|
+
// Schema port group: splice the Schema's matching-direction ports
|
|
157
|
+
// (unprefixed) instead of emitting the carrier.
|
|
158
|
+
if (graph?.schema) {
|
|
159
|
+
const groupPorts = schemaGroupPorts(resolved, key, graph.direction, visited);
|
|
160
|
+
if (groupPorts) {
|
|
161
|
+
result.push(...groupPorts);
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
const port = graphPortDefinitionOfInternal(resolved, key, visited);
|
|
166
|
+
if (port)
|
|
167
|
+
result.push(port);
|
|
168
|
+
}
|
|
169
|
+
return result;
|
|
123
170
|
}
|
|
124
171
|
export function graphLeafPortsOf(ports) {
|
|
125
172
|
return ports.flatMap((port) => port.children && port.children.length ? graphLeafPortsOf(port.children) : [port]);
|
|
@@ -136,6 +183,7 @@ export function graphDefinitionOf(model) {
|
|
|
136
183
|
const graph = graphNodeMetadataOf(resolved) || {};
|
|
137
184
|
const tag = ui?.tag || resolved.name;
|
|
138
185
|
const ports = graphPortsOf(resolved);
|
|
186
|
+
const portGroups = resolvePortGroups(resolved, graph);
|
|
139
187
|
return {
|
|
140
188
|
name: resolved.name,
|
|
141
189
|
tag,
|
|
@@ -153,8 +201,43 @@ export function graphDefinitionOf(model) {
|
|
|
153
201
|
ui,
|
|
154
202
|
graph,
|
|
155
203
|
ports,
|
|
204
|
+
portGroups,
|
|
156
205
|
};
|
|
157
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Builds the effective `portGroups` list for a node: starts from the declared
|
|
209
|
+
* `GraphNodeMetadata.portGroups` and ensures every Schema-typed `@input` /
|
|
210
|
+
* `@output` property not explicitly listed gets a default
|
|
211
|
+
* `{ property, toggle: "all" }` entry. Non-Schema-typed `@input` / `@output`
|
|
212
|
+
* properties are not groups and are ignored.
|
|
213
|
+
*/
|
|
214
|
+
function resolvePortGroups(resolved, graph) {
|
|
215
|
+
const declared = graph.portGroups || [];
|
|
216
|
+
const declaredByProperty = new Map(declared.map((g) => [g.property, g]));
|
|
217
|
+
const groups = [];
|
|
218
|
+
const properties = Metadata.properties(resolved) || [];
|
|
219
|
+
for (const property of properties) {
|
|
220
|
+
const key = String(property);
|
|
221
|
+
const portMeta = graphPortMetadataOf(resolved, key);
|
|
222
|
+
if (!portMeta?.schema)
|
|
223
|
+
continue;
|
|
224
|
+
const validation = Metadata.validationFor(resolved, key);
|
|
225
|
+
const nestedModel = resolveNestedModelConstructor(resolved, key, validation);
|
|
226
|
+
if (!nestedModel)
|
|
227
|
+
continue; // not Schema-typed — not a group
|
|
228
|
+
const declaredGroup = declaredByProperty.get(key);
|
|
229
|
+
groups.push(declaredGroup
|
|
230
|
+
? { ...declaredGroup, toggle: declaredGroup.toggle ?? "all" }
|
|
231
|
+
: { property: key, toggle: "all" });
|
|
232
|
+
}
|
|
233
|
+
// also keep declared groups that don't correspond to a Schema property
|
|
234
|
+
// (defensive — lets callers carry labels for future groups)
|
|
235
|
+
for (const g of declared) {
|
|
236
|
+
if (!groups.some((x) => x.property === g.property))
|
|
237
|
+
groups.push(g);
|
|
238
|
+
}
|
|
239
|
+
return groups.length ? groups : undefined;
|
|
240
|
+
}
|
|
158
241
|
export function graphWorkflowDefinitionOf(model) {
|
|
159
242
|
const resolved = resolveModel(model);
|
|
160
243
|
const workflow = graphWorkflowMetadataOf(resolved) || {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reader.js","sourceRoot":"","sources":["../../../src/graph/reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,QAAQ,EAAE,MAA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EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,aAAa,CAAC,MAAM,CAAC,CAAC;IAEvE,OAAO;QACL,GAAG,IAAI;QACP,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI;QAChC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ;QAC5C,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK;QACnC,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK;QACnC,MAAM,EAAE,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM;QACtC,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI;QAChC,MAAM,EAAE,QAAQ,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM;QACtC,WAAW,EAAE,QAAQ,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW;QACrD,QAAQ,EAAE,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ;QAC5C,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK;QACnC,MAAM;QACN,OAAO;QACP,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,EAAE;QAC3B,SAAS,EAAE,QAAQ,CAAC,SAAS,IAAI,EAAE;QACnC,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
package/lib/esm/index.js
CHANGED
|
@@ -16,21 +16,21 @@ export * from "./ui/index.js";
|
|
|
16
16
|
* @const VERSION
|
|
17
17
|
* @memberOf module:ui-decorators
|
|
18
18
|
*/
|
|
19
|
-
export const VERSION = "0.17.
|
|
19
|
+
export const VERSION = "0.17.4";
|
|
20
20
|
/**
|
|
21
21
|
* @description Represents the current commit hash of the module build.
|
|
22
22
|
* @summary Stores the current git commit hash for the package. The build replaces
|
|
23
23
|
* the placeholder with the actual commit hash at publish time.
|
|
24
24
|
* @const COMMIT
|
|
25
25
|
*/
|
|
26
|
-
export const COMMIT = "
|
|
26
|
+
export const COMMIT = "b222476";
|
|
27
27
|
/**
|
|
28
28
|
* @description Represents the full version string of the module.
|
|
29
29
|
* @summary Stores the semver version and commit hash for the package.
|
|
30
30
|
* The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
|
|
31
31
|
* @const FULL_VERSION
|
|
32
32
|
*/
|
|
33
|
-
export const FULL_VERSION = "0.17.
|
|
33
|
+
export const FULL_VERSION = "0.17.4-b222476";
|
|
34
34
|
export const PACKAGE_NAME = "@decaf-ts/ui-decorators";
|
|
35
35
|
Metadata.registerLibrary(PACKAGE_NAME, VERSION);
|
|
36
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -31,6 +31,11 @@ export type GraphNodeMetadata = {
|
|
|
31
31
|
width?: number;
|
|
32
32
|
connectionRules?: GraphConnectionRule;
|
|
33
33
|
metadata?: Record<string, unknown>;
|
|
34
|
+
/**
|
|
35
|
+
* Per-group rendering choice for Schema-typed `@input` / `@output` properties
|
|
36
|
+
* (the one-vs-all toggle). See {@link GraphPortGroupMetadata}.
|
|
37
|
+
*/
|
|
38
|
+
portGroups?: GraphPortGroupMetadata[];
|
|
34
39
|
};
|
|
35
40
|
export type GraphWorkflowNodeMetadata = {
|
|
36
41
|
id: string;
|
|
@@ -61,6 +66,41 @@ export type GraphPortMetadata = {
|
|
|
61
66
|
handle?: string;
|
|
62
67
|
expand?: boolean;
|
|
63
68
|
metadata?: Record<string, unknown>;
|
|
69
|
+
/**
|
|
70
|
+
* Marks this port as a "Schema port" declared via `@input` / `@output`.
|
|
71
|
+
*
|
|
72
|
+
* When `true` AND the property type is a Decaf `Model` (a "Schema"), the
|
|
73
|
+
* reader flattens the Schema's own `@input` / `@output` properties into the
|
|
74
|
+
* parent node's port list (unprefixed — no `<schemaProp>.` prefix), instead
|
|
75
|
+
* of producing a composite port with prefixed children. A `@input` Schema
|
|
76
|
+
* contributes only the Schema's `@input` properties; a `@output` Schema
|
|
77
|
+
* contributes only the Schema's `@output` properties. The carrier property
|
|
78
|
+
* itself (e.g. `inputSchema`) is not emitted as a port — it is the group
|
|
79
|
+
* carrier.
|
|
80
|
+
*
|
|
81
|
+
* Set automatically by `@input` / `@output`; NOT set by `@port`, so
|
|
82
|
+
* `@port`-decorated Schema-typed properties keep the legacy composite
|
|
83
|
+
* expansion (prefixed children).
|
|
84
|
+
*/
|
|
85
|
+
schema?: boolean;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Metadata for a Schema port group — the one-vs-all rendering choice for a
|
|
89
|
+
* `@input` / `@output` Schema-typed property.
|
|
90
|
+
*
|
|
91
|
+
* `toggle: "all"` (default) renders each Schema property as its own connectable
|
|
92
|
+
* port on the canvas. `toggle: "single"` renders one grouped port that receives
|
|
93
|
+
* the whole object and maps it to the right place. The per-instance
|
|
94
|
+
* manual-fill (hide a port because its value is supplied via the CRUD field)
|
|
95
|
+
* is NOT carried here — that is the editor's port-toggle state in `node.data`.
|
|
96
|
+
*/
|
|
97
|
+
export type GraphPortGroupMetadata = {
|
|
98
|
+
/** The Schema-typed `@input` / `@output` property name that owns this group. */
|
|
99
|
+
property: string;
|
|
100
|
+
/** Render choice for this group. Defaults to `"all"`. */
|
|
101
|
+
toggle?: "single" | "all";
|
|
102
|
+
/** Optional label for the grouped port when `toggle === "single"`. */
|
|
103
|
+
label?: string;
|
|
64
104
|
};
|
|
65
105
|
export type GraphPortDefinition = {
|
|
66
106
|
property: string;
|
|
@@ -98,6 +138,13 @@ export type GraphNodeDefinition = {
|
|
|
98
138
|
ui?: Record<string, any>;
|
|
99
139
|
graph?: GraphNodeMetadata;
|
|
100
140
|
ports: GraphPortDefinition[];
|
|
141
|
+
/**
|
|
142
|
+
* Per-group rendering choice for Schema-typed `@input` / `@output` properties
|
|
143
|
+
* (the one-vs-all toggle). Derived from {@link GraphNodeMetadata.portGroups};
|
|
144
|
+
* every Schema-typed `@input` / `@output` property not listed defaults to
|
|
145
|
+
* `toggle: "all"`.
|
|
146
|
+
*/
|
|
147
|
+
portGroups?: GraphPortGroupMetadata[];
|
|
101
148
|
};
|
|
102
149
|
export type GraphWorkflowDefinition = GraphNodeDefinition & {
|
|
103
150
|
inputs: GraphPortDefinition[];
|
|
@@ -31,6 +31,11 @@ export type GraphNodeMetadata = {
|
|
|
31
31
|
width?: number;
|
|
32
32
|
connectionRules?: GraphConnectionRule;
|
|
33
33
|
metadata?: Record<string, unknown>;
|
|
34
|
+
/**
|
|
35
|
+
* Per-group rendering choice for Schema-typed `@input` / `@output` properties
|
|
36
|
+
* (the one-vs-all toggle). See {@link GraphPortGroupMetadata}.
|
|
37
|
+
*/
|
|
38
|
+
portGroups?: GraphPortGroupMetadata[];
|
|
34
39
|
};
|
|
35
40
|
export type GraphWorkflowNodeMetadata = {
|
|
36
41
|
id: string;
|
|
@@ -61,6 +66,41 @@ export type GraphPortMetadata = {
|
|
|
61
66
|
handle?: string;
|
|
62
67
|
expand?: boolean;
|
|
63
68
|
metadata?: Record<string, unknown>;
|
|
69
|
+
/**
|
|
70
|
+
* Marks this port as a "Schema port" declared via `@input` / `@output`.
|
|
71
|
+
*
|
|
72
|
+
* When `true` AND the property type is a Decaf `Model` (a "Schema"), the
|
|
73
|
+
* reader flattens the Schema's own `@input` / `@output` properties into the
|
|
74
|
+
* parent node's port list (unprefixed — no `<schemaProp>.` prefix), instead
|
|
75
|
+
* of producing a composite port with prefixed children. A `@input` Schema
|
|
76
|
+
* contributes only the Schema's `@input` properties; a `@output` Schema
|
|
77
|
+
* contributes only the Schema's `@output` properties. The carrier property
|
|
78
|
+
* itself (e.g. `inputSchema`) is not emitted as a port — it is the group
|
|
79
|
+
* carrier.
|
|
80
|
+
*
|
|
81
|
+
* Set automatically by `@input` / `@output`; NOT set by `@port`, so
|
|
82
|
+
* `@port`-decorated Schema-typed properties keep the legacy composite
|
|
83
|
+
* expansion (prefixed children).
|
|
84
|
+
*/
|
|
85
|
+
schema?: boolean;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Metadata for a Schema port group — the one-vs-all rendering choice for a
|
|
89
|
+
* `@input` / `@output` Schema-typed property.
|
|
90
|
+
*
|
|
91
|
+
* `toggle: "all"` (default) renders each Schema property as its own connectable
|
|
92
|
+
* port on the canvas. `toggle: "single"` renders one grouped port that receives
|
|
93
|
+
* the whole object and maps it to the right place. The per-instance
|
|
94
|
+
* manual-fill (hide a port because its value is supplied via the CRUD field)
|
|
95
|
+
* is NOT carried here — that is the editor's port-toggle state in `node.data`.
|
|
96
|
+
*/
|
|
97
|
+
export type GraphPortGroupMetadata = {
|
|
98
|
+
/** The Schema-typed `@input` / `@output` property name that owns this group. */
|
|
99
|
+
property: string;
|
|
100
|
+
/** Render choice for this group. Defaults to `"all"`. */
|
|
101
|
+
toggle?: "single" | "all";
|
|
102
|
+
/** Optional label for the grouped port when `toggle === "single"`. */
|
|
103
|
+
label?: string;
|
|
64
104
|
};
|
|
65
105
|
export type GraphPortDefinition = {
|
|
66
106
|
property: string;
|
|
@@ -98,6 +138,13 @@ export type GraphNodeDefinition = {
|
|
|
98
138
|
ui?: Record<string, any>;
|
|
99
139
|
graph?: GraphNodeMetadata;
|
|
100
140
|
ports: GraphPortDefinition[];
|
|
141
|
+
/**
|
|
142
|
+
* Per-group rendering choice for Schema-typed `@input` / `@output` properties
|
|
143
|
+
* (the one-vs-all toggle). Derived from {@link GraphNodeMetadata.portGroups};
|
|
144
|
+
* every Schema-typed `@input` / `@output` property not listed defaults to
|
|
145
|
+
* `toggle: "all"`.
|
|
146
|
+
*/
|
|
147
|
+
portGroups?: GraphPortGroupMetadata[];
|
|
101
148
|
};
|
|
102
149
|
export type GraphWorkflowDefinition = GraphNodeDefinition & {
|
|
103
150
|
inputs: GraphPortDefinition[];
|
|
@@ -5,3 +5,37 @@ export declare function graph(tag?: string, graph?: GraphWorkflowMetadata, props
|
|
|
5
5
|
export declare function port(direction: PortDirection, graph?: Partial<Omit<GraphPortMetadata, "direction">>): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
6
6
|
export declare function input(graph?: Partial<Omit<GraphPortMetadata, "direction">>): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
7
7
|
export declare function output(graph?: Partial<Omit<GraphPortMetadata, "direction">>): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
8
|
+
/**
|
|
9
|
+
* Options for the `@pinnable()` decorator.
|
|
10
|
+
*/
|
|
11
|
+
export interface GraphPinnableOptions {
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
ttlMs?: number;
|
|
14
|
+
strategy?: "manual" | "automatic" | "disabled";
|
|
15
|
+
includeDependencies?: boolean;
|
|
16
|
+
metadata?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Pinning metadata stored on a node via `@pinnable()`.
|
|
20
|
+
*/
|
|
21
|
+
export interface GraphPinningMetadata {
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
ttlMs?: number;
|
|
24
|
+
strategy: "manual" | "automatic" | "disabled";
|
|
25
|
+
includeDependencies: boolean;
|
|
26
|
+
metadata?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Class decorator that marks a graph node as pinnable.
|
|
30
|
+
*
|
|
31
|
+
* The metadata is stored in the node's `graph.metadata.pinnable` field so the
|
|
32
|
+
* Angular renderer and the core pinning policy can read it.
|
|
33
|
+
*
|
|
34
|
+
* Usage:
|
|
35
|
+
* ```ts
|
|
36
|
+
* @node("ai.expensiveCompletion", { kind: "ai.expensiveCompletion" })
|
|
37
|
+
* @pinnable({ strategy: "manual", includeDependencies: true })
|
|
38
|
+
* export class ExpensiveCompletionNode extends Model { ... }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function pinnable(options?: GraphPinnableOptions): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
@@ -5,3 +5,37 @@ export declare function graph(tag?: string, graph?: GraphWorkflowMetadata, props
|
|
|
5
5
|
export declare function port(direction: PortDirection, graph?: Partial<Omit<GraphPortMetadata, "direction">>): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
6
6
|
export declare function input(graph?: Partial<Omit<GraphPortMetadata, "direction">>): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
7
7
|
export declare function output(graph?: Partial<Omit<GraphPortMetadata, "direction">>): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
8
|
+
/**
|
|
9
|
+
* Options for the `@pinnable()` decorator.
|
|
10
|
+
*/
|
|
11
|
+
export interface GraphPinnableOptions {
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
ttlMs?: number;
|
|
14
|
+
strategy?: "manual" | "automatic" | "disabled";
|
|
15
|
+
includeDependencies?: boolean;
|
|
16
|
+
metadata?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Pinning metadata stored on a node via `@pinnable()`.
|
|
20
|
+
*/
|
|
21
|
+
export interface GraphPinningMetadata {
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
ttlMs?: number;
|
|
24
|
+
strategy: "manual" | "automatic" | "disabled";
|
|
25
|
+
includeDependencies: boolean;
|
|
26
|
+
metadata?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Class decorator that marks a graph node as pinnable.
|
|
30
|
+
*
|
|
31
|
+
* The metadata is stored in the node's `graph.metadata.pinnable` field so the
|
|
32
|
+
* Angular renderer and the core pinning policy can read it.
|
|
33
|
+
*
|
|
34
|
+
* Usage:
|
|
35
|
+
* ```ts
|
|
36
|
+
* @node("ai.expensiveCompletion", { kind: "ai.expensiveCompletion" })
|
|
37
|
+
* @pinnable({ strategy: "manual", includeDependencies: true })
|
|
38
|
+
* export class ExpensiveCompletionNode extends Model { ... }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function pinnable(options?: GraphPinnableOptions): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
package/lib/types/index.d.cts
CHANGED
|
@@ -15,19 +15,19 @@ export * from "./ui/index.d.cts";
|
|
|
15
15
|
* @const VERSION
|
|
16
16
|
* @memberOf module:ui-decorators
|
|
17
17
|
*/
|
|
18
|
-
export declare const VERSION = "0.17.
|
|
18
|
+
export declare const VERSION = "0.17.4";
|
|
19
19
|
/**
|
|
20
20
|
* @description Represents the current commit hash of the module build.
|
|
21
21
|
* @summary Stores the current git commit hash for the package. The build replaces
|
|
22
22
|
* the placeholder with the actual commit hash at publish time.
|
|
23
23
|
* @const COMMIT
|
|
24
24
|
*/
|
|
25
|
-
export declare const COMMIT = "
|
|
25
|
+
export declare const COMMIT = "b222476";
|
|
26
26
|
/**
|
|
27
27
|
* @description Represents the full version string of the module.
|
|
28
28
|
* @summary Stores the semver version and commit hash for the package.
|
|
29
29
|
* The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
|
|
30
30
|
* @const FULL_VERSION
|
|
31
31
|
*/
|
|
32
|
-
export declare const FULL_VERSION = "0.17.
|
|
32
|
+
export declare const FULL_VERSION = "0.17.4-b222476";
|
|
33
33
|
export declare const PACKAGE_NAME = "@decaf-ts/ui-decorators";
|
package/lib/types/index.d.mts
CHANGED
|
@@ -15,19 +15,19 @@ export * from "./ui/index.d.mts";
|
|
|
15
15
|
* @const VERSION
|
|
16
16
|
* @memberOf module:ui-decorators
|
|
17
17
|
*/
|
|
18
|
-
export declare const VERSION = "0.17.
|
|
18
|
+
export declare const VERSION = "0.17.4";
|
|
19
19
|
/**
|
|
20
20
|
* @description Represents the current commit hash of the module build.
|
|
21
21
|
* @summary Stores the current git commit hash for the package. The build replaces
|
|
22
22
|
* the placeholder with the actual commit hash at publish time.
|
|
23
23
|
* @const COMMIT
|
|
24
24
|
*/
|
|
25
|
-
export declare const COMMIT = "
|
|
25
|
+
export declare const COMMIT = "b222476";
|
|
26
26
|
/**
|
|
27
27
|
* @description Represents the full version string of the module.
|
|
28
28
|
* @summary Stores the semver version and commit hash for the package.
|
|
29
29
|
* The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
|
|
30
30
|
* @const FULL_VERSION
|
|
31
31
|
*/
|
|
32
|
-
export declare const FULL_VERSION = "0.17.
|
|
32
|
+
export declare const FULL_VERSION = "0.17.4-b222476";
|
|
33
33
|
export declare const PACKAGE_NAME = "@decaf-ts/ui-decorators";
|
|
@@ -75,7 +75,7 @@ export declare function uimodel(tag?: string, props?: Record<string, any>): (ori
|
|
|
75
75
|
* Model->>RenderingEngine: uses specified engine
|
|
76
76
|
* RenderingEngine->>System: renders with custom engine
|
|
77
77
|
*/
|
|
78
|
-
export declare function renderedBy(engine: string):
|
|
78
|
+
export declare function renderedBy(engine: string): any;
|
|
79
79
|
/**
|
|
80
80
|
* @description Decorator that tags a model as a list item for UI rendering
|
|
81
81
|
* @summary Specifies how a model should be rendered when displayed in a list context
|
|
@@ -75,7 +75,7 @@ export declare function uimodel(tag?: string, props?: Record<string, any>): (ori
|
|
|
75
75
|
* Model->>RenderingEngine: uses specified engine
|
|
76
76
|
* RenderingEngine->>System: renders with custom engine
|
|
77
77
|
*/
|
|
78
|
-
export declare function renderedBy(engine: string):
|
|
78
|
+
export declare function renderedBy(engine: string): any;
|
|
79
79
|
/**
|
|
80
80
|
* @description Decorator that tags a model as a list item for UI rendering
|
|
81
81
|
* @summary Specifies how a model should be rendered when displayed in a list context
|
|
@@ -35,7 +35,7 @@ import { CrudOperationKeys, UIEventHandler, UIEventName, UIFunctionLike, UILayou
|
|
|
35
35
|
* Model->>RenderingEngine: Return hidden operations
|
|
36
36
|
* RenderingEngine->>UI: Render or hide based on current operation
|
|
37
37
|
*/
|
|
38
|
-
export declare function hideOn(...operations: CrudOperationKeys[]): (object: any, propertyKey?: any) =>
|
|
38
|
+
export declare function hideOn(...operations: CrudOperationKeys[]): (object: any, propertyKey?: any) => any;
|
|
39
39
|
/**
|
|
40
40
|
* @description Decorator that sets the order of a UI element
|
|
41
41
|
* @summary Specifies the rendering order for UI components
|
|
@@ -65,7 +65,7 @@ export declare function hideOn(...operations: CrudOperationKeys[]): (object: any
|
|
|
65
65
|
* uiorder->>property: sets order metadata
|
|
66
66
|
* uiorder->>System: returns decorated property
|
|
67
67
|
*/
|
|
68
|
-
export declare function uiorder(order?: number | typeof UIKeys.FIRST | typeof UIKeys.LAST): (object: any, propertyKey?: any) =>
|
|
68
|
+
export declare function uiorder(order?: number | typeof UIKeys.FIRST | typeof UIKeys.LAST): (object: any, propertyKey?: any) => any;
|
|
69
69
|
/**
|
|
70
70
|
* @description Decorator that completely hides a property in all UI operations
|
|
71
71
|
* @summary Makes a property invisible in all CRUD operations
|
|
@@ -101,7 +101,7 @@ export declare function uiorder(order?: number | typeof UIKeys.FIRST | typeof UI
|
|
|
101
101
|
* Model->>RenderingEngine: Return all operations
|
|
102
102
|
* RenderingEngine->>UI: Always hide property
|
|
103
103
|
*/
|
|
104
|
-
export declare function hidden(): (object: any, propertyKey?: any) =>
|
|
104
|
+
export declare function hidden(): (object: any, propertyKey?: any) => any;
|
|
105
105
|
/**
|
|
106
106
|
* @description Decorator that specifies how a property should be rendered as a UI element
|
|
107
107
|
* @summary Maps a model property to a specific UI element with custom properties
|
|
@@ -144,7 +144,7 @@ export declare function hidden(): (object: any, propertyKey?: any) => void;
|
|
|
144
144
|
* Model->>RenderingEngine: Return tag and props
|
|
145
145
|
* RenderingEngine->>UI: Render with specified element
|
|
146
146
|
*/
|
|
147
|
-
export declare function uielement(tag: string | Record<string, any>, props?: Record<string, any>, serialize?: boolean): (original: any, propertyKey?: any) =>
|
|
147
|
+
export declare function uielement(tag: string | Record<string, any>, props?: Record<string, any>, serialize?: boolean): (original: any, propertyKey?: any) => any;
|
|
148
148
|
/**
|
|
149
149
|
* @description Decorator that maps a model property to a UI component property
|
|
150
150
|
* @summary Specifies how a property should be passed to a UI component
|
|
@@ -405,7 +405,7 @@ export declare function uilayoutprop(col?: UILayoutCol, row?: number): (target:
|
|
|
405
405
|
* RenderingEngine->>PaginationController: Group properties by page
|
|
406
406
|
* PaginationController->>UI: Render current page properties
|
|
407
407
|
*/
|
|
408
|
-
export declare function uipageprop(page?: number): (original: any, propertyKey?: any) =>
|
|
408
|
+
export declare function uipageprop(page?: number): (original: any, propertyKey?: any) => any;
|
|
409
409
|
/**
|
|
410
410
|
* A decorator factory that binds a UI event to a specified handler function.
|
|
411
411
|
* This is used to attach event handlers to specific lifecycle events of a `DecafComponent`,
|
|
@@ -35,7 +35,7 @@ import { CrudOperationKeys, UIEventHandler, UIEventName, UIFunctionLike, UILayou
|
|
|
35
35
|
* Model->>RenderingEngine: Return hidden operations
|
|
36
36
|
* RenderingEngine->>UI: Render or hide based on current operation
|
|
37
37
|
*/
|
|
38
|
-
export declare function hideOn(...operations: CrudOperationKeys[]): (object: any, propertyKey?: any) =>
|
|
38
|
+
export declare function hideOn(...operations: CrudOperationKeys[]): (object: any, propertyKey?: any) => any;
|
|
39
39
|
/**
|
|
40
40
|
* @description Decorator that sets the order of a UI element
|
|
41
41
|
* @summary Specifies the rendering order for UI components
|
|
@@ -65,7 +65,7 @@ export declare function hideOn(...operations: CrudOperationKeys[]): (object: any
|
|
|
65
65
|
* uiorder->>property: sets order metadata
|
|
66
66
|
* uiorder->>System: returns decorated property
|
|
67
67
|
*/
|
|
68
|
-
export declare function uiorder(order?: number | typeof UIKeys.FIRST | typeof UIKeys.LAST): (object: any, propertyKey?: any) =>
|
|
68
|
+
export declare function uiorder(order?: number | typeof UIKeys.FIRST | typeof UIKeys.LAST): (object: any, propertyKey?: any) => any;
|
|
69
69
|
/**
|
|
70
70
|
* @description Decorator that completely hides a property in all UI operations
|
|
71
71
|
* @summary Makes a property invisible in all CRUD operations
|
|
@@ -101,7 +101,7 @@ export declare function uiorder(order?: number | typeof UIKeys.FIRST | typeof UI
|
|
|
101
101
|
* Model->>RenderingEngine: Return all operations
|
|
102
102
|
* RenderingEngine->>UI: Always hide property
|
|
103
103
|
*/
|
|
104
|
-
export declare function hidden(): (object: any, propertyKey?: any) =>
|
|
104
|
+
export declare function hidden(): (object: any, propertyKey?: any) => any;
|
|
105
105
|
/**
|
|
106
106
|
* @description Decorator that specifies how a property should be rendered as a UI element
|
|
107
107
|
* @summary Maps a model property to a specific UI element with custom properties
|
|
@@ -144,7 +144,7 @@ export declare function hidden(): (object: any, propertyKey?: any) => void;
|
|
|
144
144
|
* Model->>RenderingEngine: Return tag and props
|
|
145
145
|
* RenderingEngine->>UI: Render with specified element
|
|
146
146
|
*/
|
|
147
|
-
export declare function uielement(tag: string | Record<string, any>, props?: Record<string, any>, serialize?: boolean): (original: any, propertyKey?: any) =>
|
|
147
|
+
export declare function uielement(tag: string | Record<string, any>, props?: Record<string, any>, serialize?: boolean): (original: any, propertyKey?: any) => any;
|
|
148
148
|
/**
|
|
149
149
|
* @description Decorator that maps a model property to a UI component property
|
|
150
150
|
* @summary Specifies how a property should be passed to a UI component
|
|
@@ -405,7 +405,7 @@ export declare function uilayoutprop(col?: UILayoutCol, row?: number): (target:
|
|
|
405
405
|
* RenderingEngine->>PaginationController: Group properties by page
|
|
406
406
|
* PaginationController->>UI: Render current page properties
|
|
407
407
|
*/
|
|
408
|
-
export declare function uipageprop(page?: number): (original: any, propertyKey?: any) =>
|
|
408
|
+
export declare function uipageprop(page?: number): (original: any, propertyKey?: any) => any;
|
|
409
409
|
/**
|
|
410
410
|
* A decorator factory that binds a UI event to a specified handler function.
|
|
411
411
|
* This is used to attach event handlers to specific lifecycle events of a `DecafComponent`,
|