@decaf-ts/ui-decorators 0.15.0 → 0.16.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.
- package/dist/ui-decorators.cjs +1 -1
- package/dist/ui-decorators.cjs.map +1 -1
- package/dist/ui-decorators.js +1 -1
- package/dist/ui-decorators.js.map +1 -1
- package/lib/cjs/graph/constants.cjs +15 -0
- package/lib/cjs/graph/constants.cjs.map +1 -0
- package/lib/cjs/graph/decorators.cjs +51 -0
- package/lib/cjs/graph/decorators.cjs.map +1 -0
- package/lib/cjs/graph/index.cjs +24 -0
- package/lib/cjs/graph/index.cjs.map +1 -0
- package/lib/cjs/graph/overrides/Rendering.cjs +4 -0
- package/lib/cjs/graph/overrides/Rendering.cjs.map +1 -0
- package/lib/cjs/graph/overrides/index.cjs +20 -0
- package/lib/cjs/graph/overrides/index.cjs.map +1 -0
- package/lib/cjs/graph/overrides/overrides.cjs +12 -0
- package/lib/cjs/graph/overrides/overrides.cjs.map +1 -0
- package/lib/cjs/graph/reader.cjs +107 -0
- package/lib/cjs/graph/reader.cjs.map +1 -0
- package/lib/cjs/graph/types.cjs +7 -0
- package/lib/cjs/graph/types.cjs.map +1 -0
- package/lib/cjs/index.cjs +16 -2
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/esm/graph/constants.js +13 -0
- package/lib/esm/graph/constants.js.map +1 -0
- package/lib/esm/graph/decorators.js +44 -0
- package/lib/esm/graph/decorators.js.map +1 -0
- package/lib/esm/graph/index.js +7 -0
- package/lib/esm/graph/index.js.map +1 -0
- package/lib/esm/graph/overrides/Rendering.js +2 -0
- package/lib/esm/graph/overrides/Rendering.js.map +1 -0
- package/lib/esm/graph/overrides/index.js +3 -0
- package/lib/esm/graph/overrides/index.js.map +1 -0
- package/lib/esm/graph/overrides/overrides.js +9 -0
- package/lib/esm/graph/overrides/overrides.js.map +1 -0
- package/lib/esm/graph/reader.js +99 -0
- package/lib/esm/graph/reader.js.map +1 -0
- package/lib/esm/graph/types.js +2 -0
- package/lib/esm/graph/types.js.map +1 -0
- package/lib/esm/index.js +15 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/types/graph/constants.d.cts +74 -0
- package/lib/types/graph/constants.d.mts +74 -0
- package/lib/types/graph/decorators.d.cts +6 -0
- package/lib/types/graph/decorators.d.mts +6 -0
- package/lib/types/graph/index.d.cts +6 -0
- package/lib/types/graph/index.d.mts +6 -0
- package/lib/types/graph/overrides/Rendering.d.cts +5 -0
- package/lib/types/graph/overrides/Rendering.d.mts +5 -0
- package/lib/types/graph/overrides/index.d.cts +2 -0
- package/lib/types/graph/overrides/index.d.mts +2 -0
- package/lib/types/graph/overrides/overrides.d.cts +1 -0
- package/lib/types/graph/overrides/overrides.d.mts +1 -0
- package/lib/types/graph/reader.d.cts +11 -0
- package/lib/types/graph/reader.d.mts +11 -0
- package/lib/types/graph/types.d.cts +2 -0
- package/lib/types/graph/types.d.mts +2 -0
- package/lib/types/index.d.cts +15 -1
- package/lib/types/index.d.mts +15 -1
- package/package.json +16 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
require("./Rendering.cjs");
|
|
4
|
+
const index_js_1 = require("./../../ui/index.cjs");
|
|
5
|
+
const reader_js_1 = require("./../reader.cjs");
|
|
6
|
+
index_js_1.RenderingEngine.prototype.renderAsNode = function renderAsNode(model, globalProps, ...args) {
|
|
7
|
+
void globalProps;
|
|
8
|
+
void args;
|
|
9
|
+
return (0, reader_js_1.graphDefinitionOf)(model);
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=overrides.js.map
|
|
12
|
+
//# sourceMappingURL=overrides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overrides.js","sourceRoot":"","sources":["overrides.js"],"names":[],"mappings":";;AAAA,0BAAwB;AACxB,kDAAsD;AACtD,8CAAmD;AACnD,0BAAe,CAAC,SAAS,CAAC,YAAY,GAAG,SAAS,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI;IACtF,KAAK,WAAW,CAAC;IACjB,KAAK,IAAI,CAAC;IACV,OAAO,IAAA,6BAAiB,EAAC,KAAK,CAAC,CAAC;AACpC,CAAC,CAAC;AACF,qCAAqC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.graphNodeMetadataOf = graphNodeMetadataOf;
|
|
4
|
+
exports.graphPortMetadataOf = graphPortMetadataOf;
|
|
5
|
+
exports.graphPortDefinitionOf = graphPortDefinitionOf;
|
|
6
|
+
exports.graphPortsOf = graphPortsOf;
|
|
7
|
+
exports.graphDefinitionOf = graphDefinitionOf;
|
|
8
|
+
const decoration_1 = require("@decaf-ts/decoration");
|
|
9
|
+
const decorator_validation_1 = require("@decaf-ts/decorator-validation");
|
|
10
|
+
const decorator_validation_2 = require("@decaf-ts/decorator-validation");
|
|
11
|
+
const constants_js_1 = require("./../ui/constants.cjs");
|
|
12
|
+
const constants_js_2 = require("./constants.cjs");
|
|
13
|
+
require("./../model/overrides.cjs");
|
|
14
|
+
function resolveModel(model) {
|
|
15
|
+
const resolved = decoration_1.Metadata.constr(model);
|
|
16
|
+
if (typeof resolved === "function")
|
|
17
|
+
return resolved;
|
|
18
|
+
const fallback = model.constructor;
|
|
19
|
+
if (typeof fallback === "function")
|
|
20
|
+
return fallback;
|
|
21
|
+
return model;
|
|
22
|
+
}
|
|
23
|
+
function asString(value) {
|
|
24
|
+
if (value === undefined || value === null)
|
|
25
|
+
return undefined;
|
|
26
|
+
return typeof value === "string" ? value : String(value);
|
|
27
|
+
}
|
|
28
|
+
function pickLabel(element, prop, fallback) {
|
|
29
|
+
const elementLabel = asString(element?.props?.label ?? element?.props?.name);
|
|
30
|
+
return (elementLabel ??
|
|
31
|
+
asString(prop?.name) ??
|
|
32
|
+
fallback ??
|
|
33
|
+
"");
|
|
34
|
+
}
|
|
35
|
+
function graphNodeMetadataOf(model) {
|
|
36
|
+
const resolved = resolveModel(model);
|
|
37
|
+
return decoration_1.Metadata.get(resolved, constants_js_2.GraphKeys.NODE);
|
|
38
|
+
}
|
|
39
|
+
function graphPortMetadataOf(model, property) {
|
|
40
|
+
const resolved = resolveModel(model);
|
|
41
|
+
return decoration_1.Metadata.get(resolved, decoration_1.Metadata.key(constants_js_2.GraphKeys.PORT, String(property)));
|
|
42
|
+
}
|
|
43
|
+
function graphPortDefinitionOf(model, property) {
|
|
44
|
+
const resolved = resolveModel(model);
|
|
45
|
+
const propertyKey = String(property);
|
|
46
|
+
const graph = graphPortMetadataOf(resolved, property);
|
|
47
|
+
if (!graph)
|
|
48
|
+
return undefined;
|
|
49
|
+
const element = (decorator_validation_1.Model.uiElementOf(resolved, propertyKey) ||
|
|
50
|
+
undefined);
|
|
51
|
+
const uiProp = decorator_validation_1.Model.uiDecorationOf(resolved, propertyKey, constants_js_1.UIKeys.PROP);
|
|
52
|
+
const validation = decoration_1.Metadata.validationFor(resolved, propertyKey);
|
|
53
|
+
const designType = decoration_1.Metadata.type(resolved, propertyKey);
|
|
54
|
+
const typeName = asString(validation?.[decorator_validation_2.ValidationKeys.TYPE]?.customTypes?.[0]?.name ??
|
|
55
|
+
element?.props?.type ??
|
|
56
|
+
uiProp?.type ??
|
|
57
|
+
designType?.name);
|
|
58
|
+
return {
|
|
59
|
+
property: propertyKey,
|
|
60
|
+
direction: graph.direction,
|
|
61
|
+
name: propertyKey,
|
|
62
|
+
label: pickLabel(element, uiProp, propertyKey),
|
|
63
|
+
type: typeName?.toLowerCase(),
|
|
64
|
+
required: !!validation?.[decorator_validation_2.ValidationKeys.REQUIRED],
|
|
65
|
+
hidden: !!decorator_validation_1.Model.uiIsHidden(resolved, propertyKey),
|
|
66
|
+
designType: designType?.name,
|
|
67
|
+
element,
|
|
68
|
+
prop: uiProp,
|
|
69
|
+
validation,
|
|
70
|
+
graph,
|
|
71
|
+
connectionRules: graph.connectionRules,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function graphPortsOf(model) {
|
|
75
|
+
const resolved = resolveModel(model);
|
|
76
|
+
const properties = decoration_1.Metadata.properties(resolved) || [];
|
|
77
|
+
return properties
|
|
78
|
+
.map((property) => graphPortDefinitionOf(resolved, property))
|
|
79
|
+
.filter((property) => !!property);
|
|
80
|
+
}
|
|
81
|
+
function graphDefinitionOf(model) {
|
|
82
|
+
const resolved = resolveModel(model);
|
|
83
|
+
const ui = decorator_validation_1.Model.uiModelOf(resolved);
|
|
84
|
+
const graph = graphNodeMetadataOf(resolved) || {};
|
|
85
|
+
const tag = ui?.tag || resolved.name;
|
|
86
|
+
const ports = graphPortsOf(resolved);
|
|
87
|
+
return {
|
|
88
|
+
name: resolved.name,
|
|
89
|
+
tag,
|
|
90
|
+
kind: graph.kind || tag,
|
|
91
|
+
category: graph.category,
|
|
92
|
+
color: graph.color,
|
|
93
|
+
group: graph.group,
|
|
94
|
+
height: graph.height,
|
|
95
|
+
icon: graph.icon,
|
|
96
|
+
labels: graph.labels || [],
|
|
97
|
+
maxChildren: graph.maxChildren,
|
|
98
|
+
minWidth: graph.minWidth,
|
|
99
|
+
width: graph.width,
|
|
100
|
+
props: ui?.props,
|
|
101
|
+
ui,
|
|
102
|
+
graph,
|
|
103
|
+
ports,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=reader.js.map
|
|
107
|
+
//# sourceMappingURL=reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reader.js","sourceRoot":"","sources":["reader.js"],"names":[],"mappings":";;AA2BA,kDAGC;AACD,kDAGC;AACD,sDA8BC;AACD,oCAMC;AACD,8CAwBC;AAjGD,qDAAgD;AAChD,yEAAuD;AACvD,yEAAgE;AAChE,uDAA8C;AAC9C,iDAA4C;AAC5C,mCAAiC;AACjC,SAAS,YAAY,CAAC,KAAK;IACvB,MAAM,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QAC1B,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,KAAK,EAAE,EAAE,EAAE,KAAK;QAChB,EAAE;QACF,KAAK;QACL,KAAK;KACR,CAAC;AACN,CAAC;AACD,kCAAkC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PortDirection = void 0;
|
|
4
|
+
var constants_js_1 = require("./constants.cjs");
|
|
5
|
+
Object.defineProperty(exports, "PortDirection", { enumerable: true, get: function () { return constants_js_1.PortDirection; } });
|
|
6
|
+
//# sourceMappingURL=types.js.map
|
|
7
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;AAAA,+CAA+C;AAAtC,6GAAA,aAAa,OAAA;AACtB,iCAAiC"}
|
package/lib/cjs/index.cjs
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.PACKAGE_NAME = exports.VERSION = void 0;
|
|
17
|
+
exports.PACKAGE_NAME = exports.FULL_VERSION = exports.COMMIT = exports.VERSION = void 0;
|
|
18
18
|
/**
|
|
19
19
|
* @description UI decorators module for TypeScript applications
|
|
20
20
|
* @summary A collection of decorators and utilities for building UI components in TypeScript applications.
|
|
@@ -33,7 +33,21 @@ __exportStar(require("./ui/index.cjs"), exports);
|
|
|
33
33
|
* @const VERSION
|
|
34
34
|
* @memberOf module:ui-decorators
|
|
35
35
|
*/
|
|
36
|
-
exports.VERSION = "0.
|
|
36
|
+
exports.VERSION = "0.16.0";
|
|
37
|
+
/**
|
|
38
|
+
* @description Represents the current commit hash of the module build.
|
|
39
|
+
* @summary Stores the current git commit hash for the package. The build replaces
|
|
40
|
+
* the placeholder with the actual commit hash at publish time.
|
|
41
|
+
* @const COMMIT
|
|
42
|
+
*/
|
|
43
|
+
exports.COMMIT = "1388a2e";
|
|
44
|
+
/**
|
|
45
|
+
* @description Represents the full version string of the module.
|
|
46
|
+
* @summary Stores the semver version and commit hash for the package.
|
|
47
|
+
* The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
|
|
48
|
+
* @const FULL_VERSION
|
|
49
|
+
*/
|
|
50
|
+
exports.FULL_VERSION = "0.16.0-1388a2e";
|
|
37
51
|
exports.PACKAGE_NAME = "@decaf-ts/ui-decorators";
|
|
38
52
|
decoration_1.Metadata.registerLibrary(exports.PACKAGE_NAME, exports.VERSION);
|
|
39
53
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,gCAA8B;AAC9B,qDAAgD;AAChD,uDAAqC;AACrC,mDAAiC;AACjC,gDAA8B;AAC9B;;;;;GAKG;AACU,QAAA,OAAO,GAAG,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;GAMG;AACH,gCAA8B;AAC9B,qDAAgD;AAChD,uDAAqC;AACrC,mDAAiC;AACjC,gDAA8B;AAC9B;;;;;GAKG;AACU,QAAA,OAAO,GAAG,aAAa,CAAC;AACrC;;;;;GAKG;AACU,QAAA,MAAM,GAAG,YAAY,CAAC;AACnC;;;;;GAKG;AACU,QAAA,YAAY,GAAG,kBAAkB,CAAC;AAClC,QAAA,YAAY,GAAG,aAAa,CAAC;AAC1C,qBAAQ,CAAC,eAAe,CAAC,oBAAY,EAAE,eAAO,CAAC,CAAC;AAChD,iCAAiC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export var GraphKeys;
|
|
2
|
+
(function (GraphKeys) {
|
|
3
|
+
GraphKeys["GRAPH"] = "graph";
|
|
4
|
+
GraphKeys["NODE"] = "graph.node";
|
|
5
|
+
GraphKeys["EDGE"] = "graph.edge";
|
|
6
|
+
GraphKeys["PORT"] = "graph.port";
|
|
7
|
+
})(GraphKeys || (GraphKeys = {}));
|
|
8
|
+
export var PortDirection;
|
|
9
|
+
(function (PortDirection) {
|
|
10
|
+
PortDirection["INPUT"] = "input";
|
|
11
|
+
PortDirection["OUTPUT"] = "output";
|
|
12
|
+
})(PortDirection || (PortDirection = {}));
|
|
13
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/graph/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,gCAAgC,CAAA;IAChC,gCAAgC,CAAA;IAChC,gCAAgC,CAAA;AAClC,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAED,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { apply, Decoration, Metadata, metadata, propMetadata, } from "@decaf-ts/decoration";
|
|
2
|
+
import { uimodel } from "./../model/decorators.js";
|
|
3
|
+
import { GraphKeys, PortDirection } from "./constants.js";
|
|
4
|
+
export function node(tag, graph, props) {
|
|
5
|
+
function node(tag, graph, props) {
|
|
6
|
+
const meta = {
|
|
7
|
+
kind: graph?.kind || tag,
|
|
8
|
+
...graph,
|
|
9
|
+
};
|
|
10
|
+
return function innerNode(target) {
|
|
11
|
+
return apply(uimodel(tag, props), metadata(GraphKeys.NODE, meta))(target);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
return Decoration.for(GraphKeys.NODE)
|
|
15
|
+
.define({
|
|
16
|
+
decorator: node,
|
|
17
|
+
args: [tag, graph, props],
|
|
18
|
+
})
|
|
19
|
+
.apply();
|
|
20
|
+
}
|
|
21
|
+
export function port(direction, graph) {
|
|
22
|
+
function port(direction, graph) {
|
|
23
|
+
return function innerPort(target, propertyKey) {
|
|
24
|
+
const meta = {
|
|
25
|
+
direction,
|
|
26
|
+
...graph,
|
|
27
|
+
};
|
|
28
|
+
return apply(propMetadata(Metadata.key(GraphKeys.PORT, propertyKey), meta))(target, propertyKey);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return Decoration.for(GraphKeys.PORT)
|
|
32
|
+
.define({
|
|
33
|
+
decorator: port,
|
|
34
|
+
args: [direction, graph],
|
|
35
|
+
})
|
|
36
|
+
.apply();
|
|
37
|
+
}
|
|
38
|
+
export function input(graph) {
|
|
39
|
+
return port(PortDirection.INPUT, graph);
|
|
40
|
+
}
|
|
41
|
+
export function output(graph) {
|
|
42
|
+
return port(PortDirection.OUTPUT, graph);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=decorators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../src/graph/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,iCAA4B;AAC9C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,uBAAoB;AAGvD,MAAM,UAAU,IAAI,CAClB,GAAY,EACZ,KAAyB,EACzB,KAA2B;IAE3B,SAAS,IAAI,CACX,GAAY,EACZ,KAAyB,EAC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CAAC;AAED,MAAM,UAAU,MAAM,CAAC,KAAqD;IAC1E,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/graph/index.ts"],"names":[],"mappings":"AAAA,8BAAqB;AAErB,+BAA4B;AAC5B,gCAA6B;AAC7B,4BAAyB;AACzB,2BAAwB;AACxB,qCAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rendering.js","sourceRoot":"","sources":["../../../../src/graph/overrides/Rendering.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/graph/overrides/index.ts"],"names":[],"mappings":"AAAA,wBAAqB;AAErB,+BAA4B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./Rendering.js";
|
|
2
|
+
import { RenderingEngine } from "./../../ui/index.js";
|
|
3
|
+
import { graphDefinitionOf } from "./../reader.js";
|
|
4
|
+
RenderingEngine.prototype.renderAsNode = function renderAsNode(model, globalProps, ...args) {
|
|
5
|
+
void globalProps;
|
|
6
|
+
void args;
|
|
7
|
+
return graphDefinitionOf(model);
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=overrides.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overrides.js","sourceRoot":"","sources":["../../../../src/graph/overrides/overrides.ts"],"names":[],"mappings":"AAAA,wBAAqB;AACrB,OAAO,EAAwB,eAAe,EAAE,4BAAuB;AAEvE,OAAO,EAAE,iBAAiB,EAAE,uBAAkB;AAE7C,eAAe,CAAC,SAAiB,CAAC,YAAY,GAAG,SAAS,YAAY,CAIrE,KAAQ,EAAE,WAAoC,EAAE,GAAG,IAAW;IAC9D,KAAK,WAAW,CAAC;IACjB,KAAK,IAAI,CAAC;IACV,OAAO,iBAAiB,CAAC,KAAK,CAAiB,CAAC;AAClD,CAAC,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Metadata } from "@decaf-ts/decoration";
|
|
2
|
+
import { Model } from "@decaf-ts/decorator-validation";
|
|
3
|
+
import { ValidationKeys } from "@decaf-ts/decorator-validation";
|
|
4
|
+
import { UIKeys } from "./../ui/constants.js";
|
|
5
|
+
import { GraphKeys, } from "./constants.js";
|
|
6
|
+
import "./../model/overrides.js";
|
|
7
|
+
function resolveModel(model) {
|
|
8
|
+
const resolved = Metadata.constr(model);
|
|
9
|
+
if (typeof resolved === "function")
|
|
10
|
+
return resolved;
|
|
11
|
+
const fallback = model.constructor;
|
|
12
|
+
if (typeof fallback === "function")
|
|
13
|
+
return fallback;
|
|
14
|
+
return model;
|
|
15
|
+
}
|
|
16
|
+
function asString(value) {
|
|
17
|
+
if (value === undefined || value === null)
|
|
18
|
+
return undefined;
|
|
19
|
+
return typeof value === "string" ? value : String(value);
|
|
20
|
+
}
|
|
21
|
+
function pickLabel(element, prop, fallback) {
|
|
22
|
+
const elementLabel = asString(element?.props?.label ?? element?.props?.name);
|
|
23
|
+
return (elementLabel ??
|
|
24
|
+
asString(prop?.name) ??
|
|
25
|
+
fallback ??
|
|
26
|
+
"");
|
|
27
|
+
}
|
|
28
|
+
export function graphNodeMetadataOf(model) {
|
|
29
|
+
const resolved = resolveModel(model);
|
|
30
|
+
return Metadata.get(resolved, GraphKeys.NODE);
|
|
31
|
+
}
|
|
32
|
+
export function graphPortMetadataOf(model, property) {
|
|
33
|
+
const resolved = resolveModel(model);
|
|
34
|
+
return Metadata.get(resolved, Metadata.key(GraphKeys.PORT, String(property)));
|
|
35
|
+
}
|
|
36
|
+
export function graphPortDefinitionOf(model, property) {
|
|
37
|
+
const resolved = resolveModel(model);
|
|
38
|
+
const propertyKey = String(property);
|
|
39
|
+
const graph = graphPortMetadataOf(resolved, property);
|
|
40
|
+
if (!graph)
|
|
41
|
+
return undefined;
|
|
42
|
+
const element = (Model.uiElementOf(resolved, propertyKey) ||
|
|
43
|
+
undefined);
|
|
44
|
+
const uiProp = Model.uiDecorationOf(resolved, propertyKey, UIKeys.PROP);
|
|
45
|
+
const validation = Metadata.validationFor(resolved, propertyKey);
|
|
46
|
+
const designType = Metadata.type(resolved, propertyKey);
|
|
47
|
+
const typeName = asString(validation?.[ValidationKeys.TYPE]?.customTypes?.[0]?.name ??
|
|
48
|
+
element?.props?.type ??
|
|
49
|
+
uiProp?.type ??
|
|
50
|
+
designType?.name);
|
|
51
|
+
return {
|
|
52
|
+
property: propertyKey,
|
|
53
|
+
direction: graph.direction,
|
|
54
|
+
name: propertyKey,
|
|
55
|
+
label: pickLabel(element, uiProp, propertyKey),
|
|
56
|
+
type: typeName?.toLowerCase(),
|
|
57
|
+
required: !!validation?.[ValidationKeys.REQUIRED],
|
|
58
|
+
hidden: !!Model.uiIsHidden(resolved, propertyKey),
|
|
59
|
+
designType: designType?.name,
|
|
60
|
+
element,
|
|
61
|
+
prop: uiProp,
|
|
62
|
+
validation,
|
|
63
|
+
graph,
|
|
64
|
+
connectionRules: graph.connectionRules,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export function graphPortsOf(model) {
|
|
68
|
+
const resolved = resolveModel(model);
|
|
69
|
+
const properties = Metadata.properties(resolved) || [];
|
|
70
|
+
return properties
|
|
71
|
+
.map((property) => graphPortDefinitionOf(resolved, property))
|
|
72
|
+
.filter((property) => !!property);
|
|
73
|
+
}
|
|
74
|
+
export function graphDefinitionOf(model) {
|
|
75
|
+
const resolved = resolveModel(model);
|
|
76
|
+
const ui = Model.uiModelOf(resolved);
|
|
77
|
+
const graph = graphNodeMetadataOf(resolved) || {};
|
|
78
|
+
const tag = ui?.tag || resolved.name;
|
|
79
|
+
const ports = graphPortsOf(resolved);
|
|
80
|
+
return {
|
|
81
|
+
name: resolved.name,
|
|
82
|
+
tag,
|
|
83
|
+
kind: graph.kind || tag,
|
|
84
|
+
category: graph.category,
|
|
85
|
+
color: graph.color,
|
|
86
|
+
group: graph.group,
|
|
87
|
+
height: graph.height,
|
|
88
|
+
icon: graph.icon,
|
|
89
|
+
labels: graph.labels || [],
|
|
90
|
+
maxChildren: graph.maxChildren,
|
|
91
|
+
minWidth: graph.minWidth,
|
|
92
|
+
width: graph.width,
|
|
93
|
+
props: ui?.props,
|
|
94
|
+
ui,
|
|
95
|
+
graph,
|
|
96
|
+
ports,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reader.js","sourceRoot":"","sources":["../../../src/graph/reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,6BAAwB;AACzC,OAAO,EACL,SAAS,GACV,uBAAoB;AAOrB,iCAA4B;AAI5B,SAAS,YAAY,CAAkB,KAAwB;IAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAuB,CAAC,CAAC;IAC1D,IAAI,OAAO,QAAQ,KAAK,UAAU;QAAE,OAAO,QAA0B,CAAC;IACtE,MAAM,QAAQ,GAAI,KAAe,CAAC,WAAW,CAAC;IAC9C,IAAI,OAAO,QAAQ,KAAK,UAAU;QAAE,OAAO,QAA0B,CAAC;IACtE,OAAO,KAAuB,CAAC;AACjC,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5D,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3D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EAAmC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,KAAwB;IAExB,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACrC,MAAM,KAAK,GAAG,mBAAmB,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IAClD,MAAM,GAAG,GAAG,EAAE,EAAE,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC;IACrC,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IAErC,OAAO;QACL,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,GAAG;QACH,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,GAAG;QACvB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,EAAE;QAC1B,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,KAAK,EAAE,EAAE,EAAE,KAAK;QAChB,EAAE;QACF,KAAK;QACL,KAAK;KACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/graph/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,uBAAoB"}
|
package/lib/esm/index.js
CHANGED
|
@@ -16,7 +16,21 @@ export * from "./ui/index.js";
|
|
|
16
16
|
* @const VERSION
|
|
17
17
|
* @memberOf module:ui-decorators
|
|
18
18
|
*/
|
|
19
|
-
export const VERSION = "0.
|
|
19
|
+
export const VERSION = "0.16.0";
|
|
20
|
+
/**
|
|
21
|
+
* @description Represents the current commit hash of the module build.
|
|
22
|
+
* @summary Stores the current git commit hash for the package. The build replaces
|
|
23
|
+
* the placeholder with the actual commit hash at publish time.
|
|
24
|
+
* @const COMMIT
|
|
25
|
+
*/
|
|
26
|
+
export const COMMIT = "1388a2e";
|
|
27
|
+
/**
|
|
28
|
+
* @description Represents the full version string of the module.
|
|
29
|
+
* @summary Stores the semver version and commit hash for the package.
|
|
30
|
+
* The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
|
|
31
|
+
* @const FULL_VERSION
|
|
32
|
+
*/
|
|
33
|
+
export const FULL_VERSION = "0.16.0-1388a2e";
|
|
20
34
|
export const PACKAGE_NAME = "@decaf-ts/ui-decorators";
|
|
21
35
|
Metadata.registerLibrary(PACKAGE_NAME, VERSION);
|
|
22
36
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,8BAAqB;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,qCAA4B;AAC5B,iCAAwB;AACxB,8BAAqB;AAErB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AAErC,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC;AAE1C,QAAQ,CAAC,eAAe,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,8BAAqB;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,qCAA4B;AAC5B,iCAAwB;AACxB,8BAAqB;AAErB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC;AAErC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAG/C,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC;AAE1C,QAAQ,CAAC,eAAe,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export declare enum GraphKeys {
|
|
2
|
+
GRAPH = "graph",
|
|
3
|
+
NODE = "graph.node",
|
|
4
|
+
EDGE = "graph.edge",
|
|
5
|
+
PORT = "graph.port"
|
|
6
|
+
}
|
|
7
|
+
export declare enum PortDirection {
|
|
8
|
+
INPUT = "input",
|
|
9
|
+
OUTPUT = "output"
|
|
10
|
+
}
|
|
11
|
+
export type GraphNodeKind = string;
|
|
12
|
+
export type GraphConnectionRule = {
|
|
13
|
+
allowSelf?: boolean;
|
|
14
|
+
allowMultiple?: boolean;
|
|
15
|
+
allowedKinds?: GraphNodeKind[];
|
|
16
|
+
blockedKinds?: GraphNodeKind[];
|
|
17
|
+
group?: string;
|
|
18
|
+
maxConnections?: number;
|
|
19
|
+
metadata?: Record<string, unknown>;
|
|
20
|
+
};
|
|
21
|
+
export type GraphNodeMetadata = {
|
|
22
|
+
kind?: GraphNodeKind;
|
|
23
|
+
category?: string;
|
|
24
|
+
color?: string;
|
|
25
|
+
group?: string;
|
|
26
|
+
height?: number;
|
|
27
|
+
icon?: string;
|
|
28
|
+
labels?: string[];
|
|
29
|
+
maxChildren?: number;
|
|
30
|
+
minWidth?: number;
|
|
31
|
+
width?: number;
|
|
32
|
+
connectionRules?: GraphConnectionRule;
|
|
33
|
+
metadata?: Record<string, unknown>;
|
|
34
|
+
};
|
|
35
|
+
export type GraphPortMetadata = {
|
|
36
|
+
direction: PortDirection;
|
|
37
|
+
connectionRules?: GraphConnectionRule;
|
|
38
|
+
visible?: boolean;
|
|
39
|
+
handle?: string;
|
|
40
|
+
metadata?: Record<string, unknown>;
|
|
41
|
+
};
|
|
42
|
+
export type GraphPortDefinition = {
|
|
43
|
+
property: string;
|
|
44
|
+
direction: PortDirection;
|
|
45
|
+
name: string;
|
|
46
|
+
label: string;
|
|
47
|
+
type?: string;
|
|
48
|
+
required: boolean;
|
|
49
|
+
hidden: boolean;
|
|
50
|
+
designType?: string;
|
|
51
|
+
element?: Record<string, any>;
|
|
52
|
+
prop?: Record<string, any>;
|
|
53
|
+
validation?: Record<string, any>;
|
|
54
|
+
graph?: GraphPortMetadata;
|
|
55
|
+
connectionRules?: GraphConnectionRule;
|
|
56
|
+
};
|
|
57
|
+
export type GraphNodeDefinition = {
|
|
58
|
+
name: string;
|
|
59
|
+
tag: string;
|
|
60
|
+
kind: GraphNodeKind;
|
|
61
|
+
category?: string;
|
|
62
|
+
color?: string;
|
|
63
|
+
group?: string;
|
|
64
|
+
height?: number;
|
|
65
|
+
icon?: string;
|
|
66
|
+
labels: string[];
|
|
67
|
+
maxChildren?: number;
|
|
68
|
+
minWidth?: number;
|
|
69
|
+
width?: number;
|
|
70
|
+
props?: Record<string, any>;
|
|
71
|
+
ui?: Record<string, any>;
|
|
72
|
+
graph?: GraphNodeMetadata;
|
|
73
|
+
ports: GraphPortDefinition[];
|
|
74
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export declare enum GraphKeys {
|
|
2
|
+
GRAPH = "graph",
|
|
3
|
+
NODE = "graph.node",
|
|
4
|
+
EDGE = "graph.edge",
|
|
5
|
+
PORT = "graph.port"
|
|
6
|
+
}
|
|
7
|
+
export declare enum PortDirection {
|
|
8
|
+
INPUT = "input",
|
|
9
|
+
OUTPUT = "output"
|
|
10
|
+
}
|
|
11
|
+
export type GraphNodeKind = string;
|
|
12
|
+
export type GraphConnectionRule = {
|
|
13
|
+
allowSelf?: boolean;
|
|
14
|
+
allowMultiple?: boolean;
|
|
15
|
+
allowedKinds?: GraphNodeKind[];
|
|
16
|
+
blockedKinds?: GraphNodeKind[];
|
|
17
|
+
group?: string;
|
|
18
|
+
maxConnections?: number;
|
|
19
|
+
metadata?: Record<string, unknown>;
|
|
20
|
+
};
|
|
21
|
+
export type GraphNodeMetadata = {
|
|
22
|
+
kind?: GraphNodeKind;
|
|
23
|
+
category?: string;
|
|
24
|
+
color?: string;
|
|
25
|
+
group?: string;
|
|
26
|
+
height?: number;
|
|
27
|
+
icon?: string;
|
|
28
|
+
labels?: string[];
|
|
29
|
+
maxChildren?: number;
|
|
30
|
+
minWidth?: number;
|
|
31
|
+
width?: number;
|
|
32
|
+
connectionRules?: GraphConnectionRule;
|
|
33
|
+
metadata?: Record<string, unknown>;
|
|
34
|
+
};
|
|
35
|
+
export type GraphPortMetadata = {
|
|
36
|
+
direction: PortDirection;
|
|
37
|
+
connectionRules?: GraphConnectionRule;
|
|
38
|
+
visible?: boolean;
|
|
39
|
+
handle?: string;
|
|
40
|
+
metadata?: Record<string, unknown>;
|
|
41
|
+
};
|
|
42
|
+
export type GraphPortDefinition = {
|
|
43
|
+
property: string;
|
|
44
|
+
direction: PortDirection;
|
|
45
|
+
name: string;
|
|
46
|
+
label: string;
|
|
47
|
+
type?: string;
|
|
48
|
+
required: boolean;
|
|
49
|
+
hidden: boolean;
|
|
50
|
+
designType?: string;
|
|
51
|
+
element?: Record<string, any>;
|
|
52
|
+
prop?: Record<string, any>;
|
|
53
|
+
validation?: Record<string, any>;
|
|
54
|
+
graph?: GraphPortMetadata;
|
|
55
|
+
connectionRules?: GraphConnectionRule;
|
|
56
|
+
};
|
|
57
|
+
export type GraphNodeDefinition = {
|
|
58
|
+
name: string;
|
|
59
|
+
tag: string;
|
|
60
|
+
kind: GraphNodeKind;
|
|
61
|
+
category?: string;
|
|
62
|
+
color?: string;
|
|
63
|
+
group?: string;
|
|
64
|
+
height?: number;
|
|
65
|
+
icon?: string;
|
|
66
|
+
labels: string[];
|
|
67
|
+
maxChildren?: number;
|
|
68
|
+
minWidth?: number;
|
|
69
|
+
width?: number;
|
|
70
|
+
props?: Record<string, any>;
|
|
71
|
+
ui?: Record<string, any>;
|
|
72
|
+
graph?: GraphNodeMetadata;
|
|
73
|
+
ports: GraphPortDefinition[];
|
|
74
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PortDirection } from "./constants.d.cts";
|
|
2
|
+
import type { GraphNodeMetadata, GraphPortMetadata } from "./constants.d.cts";
|
|
3
|
+
export declare function node(tag?: string, graph?: GraphNodeMetadata, props?: Record<string, any>): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
4
|
+
export declare function port(direction: PortDirection, graph?: Partial<Omit<GraphPortMetadata, "direction">>): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
5
|
+
export declare function input(graph?: Partial<Omit<GraphPortMetadata, "direction">>): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
6
|
+
export declare function output(graph?: Partial<Omit<GraphPortMetadata, "direction">>): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PortDirection } from "./constants.d.mts";
|
|
2
|
+
import type { GraphNodeMetadata, GraphPortMetadata } from "./constants.d.mts";
|
|
3
|
+
export declare function node(tag?: string, graph?: GraphNodeMetadata, props?: Record<string, any>): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
4
|
+
export declare function port(direction: PortDirection, graph?: Partial<Omit<GraphPortMetadata, "direction">>): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
5
|
+
export declare function input(graph?: Partial<Omit<GraphPortMetadata, "direction">>): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
6
|
+
export declare function output(graph?: Partial<Omit<GraphPortMetadata, "direction">>): (target: any, propertyKey?: any, descriptor?: TypedPropertyDescriptor<any>) => any;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FieldDefinition } from "../../ui/types.d.cts";
|
|
2
|
+
import type { Model } from "@decaf-ts/decorator-validation";
|
|
3
|
+
export interface RenderingEngine<T = void, R = FieldDefinition<T>> {
|
|
4
|
+
renderAsNode<M extends Model>(model: M, globalProps: Record<string, unknown>, ...args: any[]): R;
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FieldDefinition } from "../../ui/types.d.mts";
|
|
2
|
+
import type { Model } from "@decaf-ts/decorator-validation";
|
|
3
|
+
export interface RenderingEngine<T = void, R = FieldDefinition<T>> {
|
|
4
|
+
renderAsNode<M extends Model>(model: M, globalProps: Record<string, unknown>, ...args: any[]): R;
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./Rendering";
|