@decaf-ts/ui-decorators 0.20.6 → 0.20.8

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.
Files changed (108) hide show
  1. package/dist/ui-decorators.cjs +1 -1
  2. package/dist/ui-decorators.cjs.map +1 -1
  3. package/dist/ui-decorators.js +1 -1
  4. package/dist/ui-decorators.js.map +1 -1
  5. package/lib/cjs/dashboard/constants.cjs +11 -0
  6. package/lib/cjs/dashboard/constants.cjs.map +1 -0
  7. package/lib/cjs/dashboard/decorators.cjs +61 -0
  8. package/lib/cjs/dashboard/decorators.cjs.map +1 -0
  9. package/lib/cjs/dashboard/index.cjs +23 -0
  10. package/lib/cjs/dashboard/index.cjs.map +1 -0
  11. package/lib/cjs/dashboard/reader.cjs +67 -0
  12. package/lib/cjs/dashboard/reader.cjs.map +1 -0
  13. package/lib/cjs/dashboard/registry.cjs +45 -0
  14. package/lib/cjs/dashboard/registry.cjs.map +1 -0
  15. package/lib/cjs/dashboard/types.cjs +4 -0
  16. package/lib/cjs/dashboard/types.cjs.map +1 -0
  17. package/lib/cjs/graph/catalog/GraphManifestCompiler.cjs +9 -0
  18. package/lib/cjs/graph/catalog/GraphManifestCompiler.cjs.map +1 -1
  19. package/lib/cjs/graph/constants.cjs +74 -9
  20. package/lib/cjs/graph/constants.cjs.map +1 -1
  21. package/lib/cjs/graph/nodes/flow-control/break.cjs +1 -1
  22. package/lib/cjs/graph/nodes/flow-control/error-boundary.cjs +1 -1
  23. package/lib/cjs/graph/nodes/flow-control/human-approval.cjs +1 -1
  24. package/lib/cjs/graph/nodes/flow-control/parallel.cjs +1 -1
  25. package/lib/cjs/graph/nodes/flow-control/switch.cjs +10 -5
  26. package/lib/cjs/graph/nodes/flow-control/switch.cjs.map +1 -1
  27. package/lib/cjs/graph/nodes/loops/until.cjs +1 -1
  28. package/lib/cjs/graph/nodes/loops/while.cjs +1 -1
  29. package/lib/cjs/graph/nodes/manifests.cjs +15 -11
  30. package/lib/cjs/graph/nodes/manifests.cjs.map +1 -1
  31. package/lib/cjs/graph/nodes/triggers/chat.cjs +1 -1
  32. package/lib/cjs/graph/nodes/triggers/event.cjs +1 -1
  33. package/lib/cjs/graph/nodes/triggers/form.cjs +1 -1
  34. package/lib/cjs/graph/nodes/triggers/schedule.cjs +1 -1
  35. package/lib/cjs/graph/nodes/triggers/webhook.cjs +1 -1
  36. package/lib/cjs/graph/nodes/utility/code.cjs +1 -1
  37. package/lib/cjs/graph/nodes/utility/delay.cjs +1 -1
  38. package/lib/cjs/graph/nodes/utility/log.cjs +1 -1
  39. package/lib/cjs/graph/nodes/utility/map.cjs +1 -1
  40. package/lib/cjs/graph/nodes/utility/return.cjs +1 -1
  41. package/lib/cjs/graph/nodes/utility/utility-log.cjs +1 -1
  42. package/lib/cjs/graph/reader.cjs +3 -0
  43. package/lib/cjs/graph/reader.cjs.map +1 -1
  44. package/lib/cjs/index.cjs +4 -3
  45. package/lib/cjs/index.cjs.map +1 -1
  46. package/lib/esm/dashboard/constants.js +24 -0
  47. package/lib/esm/dashboard/constants.js.map +1 -0
  48. package/lib/esm/dashboard/decorators.js +57 -0
  49. package/lib/esm/dashboard/decorators.js.map +1 -0
  50. package/lib/esm/dashboard/index.js +6 -0
  51. package/lib/esm/dashboard/index.js.map +1 -0
  52. package/lib/esm/dashboard/reader.js +62 -0
  53. package/lib/esm/dashboard/reader.js.map +1 -0
  54. package/lib/esm/dashboard/registry.js +39 -0
  55. package/lib/esm/dashboard/registry.js.map +1 -0
  56. package/lib/esm/dashboard/types.js +9 -0
  57. package/lib/esm/dashboard/types.js.map +1 -0
  58. package/lib/esm/graph/catalog/GraphManifestCompiler.js +9 -0
  59. package/lib/esm/graph/catalog/GraphManifestCompiler.js.map +1 -1
  60. package/lib/esm/graph/catalog/GraphNodeDisplayManifest.js.map +1 -1
  61. package/lib/esm/graph/constants.js +72 -8
  62. package/lib/esm/graph/constants.js.map +1 -1
  63. package/lib/esm/graph/nodes/flow-control/break.js +1 -1
  64. package/lib/esm/graph/nodes/flow-control/error-boundary.js +1 -1
  65. package/lib/esm/graph/nodes/flow-control/human-approval.js +1 -1
  66. package/lib/esm/graph/nodes/flow-control/parallel.js +1 -1
  67. package/lib/esm/graph/nodes/flow-control/switch.js +11 -6
  68. package/lib/esm/graph/nodes/flow-control/switch.js.map +1 -1
  69. package/lib/esm/graph/nodes/loops/until.js +1 -1
  70. package/lib/esm/graph/nodes/loops/while.js +1 -1
  71. package/lib/esm/graph/nodes/manifests.js +15 -11
  72. package/lib/esm/graph/nodes/manifests.js.map +1 -1
  73. package/lib/esm/graph/nodes/triggers/chat.js +1 -1
  74. package/lib/esm/graph/nodes/triggers/event.js +1 -1
  75. package/lib/esm/graph/nodes/triggers/form.js +1 -1
  76. package/lib/esm/graph/nodes/triggers/schedule.js +1 -1
  77. package/lib/esm/graph/nodes/triggers/webhook.js +1 -1
  78. package/lib/esm/graph/nodes/utility/code.js +1 -1
  79. package/lib/esm/graph/nodes/utility/delay.js +1 -1
  80. package/lib/esm/graph/nodes/utility/log.js +1 -1
  81. package/lib/esm/graph/nodes/utility/map.js +1 -1
  82. package/lib/esm/graph/nodes/utility/return.js +1 -1
  83. package/lib/esm/graph/nodes/utility/utility-log.js +1 -1
  84. package/lib/esm/graph/reader.js +3 -0
  85. package/lib/esm/graph/reader.js.map +1 -1
  86. package/lib/esm/index.js +4 -3
  87. package/lib/esm/index.js.map +1 -1
  88. package/lib/types/dashboard/constants.d.cts +22 -0
  89. package/lib/types/dashboard/constants.d.mts +22 -0
  90. package/lib/types/dashboard/decorators.d.cts +34 -0
  91. package/lib/types/dashboard/decorators.d.mts +34 -0
  92. package/lib/types/dashboard/index.d.cts +5 -0
  93. package/lib/types/dashboard/index.d.mts +5 -0
  94. package/lib/types/dashboard/reader.d.cts +30 -0
  95. package/lib/types/dashboard/reader.d.mts +30 -0
  96. package/lib/types/dashboard/registry.d.cts +29 -0
  97. package/lib/types/dashboard/registry.d.mts +29 -0
  98. package/lib/types/dashboard/types.d.cts +67 -0
  99. package/lib/types/dashboard/types.d.mts +67 -0
  100. package/lib/types/graph/catalog/GraphNodeDisplayManifest.d.cts +17 -0
  101. package/lib/types/graph/catalog/GraphNodeDisplayManifest.d.mts +17 -0
  102. package/lib/types/graph/constants.d.cts +101 -6
  103. package/lib/types/graph/constants.d.mts +101 -6
  104. package/lib/types/graph/document/GraphWorkflowUiState.d.cts +8 -0
  105. package/lib/types/graph/document/GraphWorkflowUiState.d.mts +8 -0
  106. package/lib/types/index.d.cts +4 -3
  107. package/lib/types/index.d.mts +4 -3
  108. package/package.json +3 -1
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @module ui-decorators/dashboard/registry
3
+ * @summary Dashboard-selectable component registry.
4
+ * @description Module-level registry that tracks every `@dashcomponent`-
5
+ * decorated constructor. The `@dashcomponent` decorator calls
6
+ * {@link registerDashComponent} as a side-effect; consumers discover all
7
+ * decorated classes via {@link dashComponents}.
8
+ *
9
+ * This follows the same pattern as the `graph` submodule's node registry and
10
+ * the `InjectablesRegistry` in `injectable-decorators` — a private `Set`
11
+ * rather than the `Metadata` internal helpers.
12
+ */
13
+ import type { Constructor } from "@decaf-ts/decoration";
14
+ /**
15
+ * Appends a constructor to the dashboard component registry. Called by the
16
+ * `@dashcomponent` decorator. Idempotent — re-decorating the same class does
17
+ * not duplicate the entry.
18
+ * @param ctor The `@dashcomponent`-decorated constructor.
19
+ */
20
+ export declare function registerDashComponent(ctor: Constructor): void;
21
+ /**
22
+ * Returns all `@dashcomponent`-decorated constructors.
23
+ * @returns A fresh array of constructors (mutable; does not expose the internal set).
24
+ */
25
+ export declare function dashComponents(): Constructor[];
26
+ /**
27
+ * Clears the dashboard component registry. Intended for tests only.
28
+ */
29
+ export declare function resetDashComponentRegistry(): void;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @module ui-decorators/dashboard/types
3
+ * @summary Type definitions for dashboard-selectable components.
4
+ * @description Flavor-neutral types describing the palette metadata attached
5
+ * by `@dashcomponent()` and the resolved definition consumed by a palette
6
+ * service. No Angular or framework imports.
7
+ */
8
+ import type { Constructor } from "@decaf-ts/decoration";
9
+ /**
10
+ * @description Grid footprint of a dashboard component.
11
+ * @summary A component's default footprint on the dashboard grid, expressed
12
+ * in grid units (columns and rows).
13
+ * @typedef DashComponentSize
14
+ * @memberOf module:ui-decorators/dashboard/types
15
+ * @property {number} cols - Number of grid columns occupied.
16
+ * @property {number} rows - Number of grid rows occupied.
17
+ */
18
+ export type DashComponentSize = {
19
+ cols: number;
20
+ rows: number;
21
+ };
22
+ /**
23
+ * @description Palette metadata attached to a dashboard-selectable component.
24
+ * @summary The metadata object stored on a `@dashcomponent`-decorated class.
25
+ * Carries the translation label key, the default grid size, and an optional
26
+ * reference to the configuration model used by the component's own CRUD flow.
27
+ * @typedef DashComponentMetadata
28
+ * @memberOf module:ui-decorators/dashboard/types
29
+ * @property {string} [tag] - Component tag resolved for rendering.
30
+ * @property {string} [label] - Translation label key for the palette.
31
+ * @property {DashComponentSize} [defaultSize] - Default grid footprint.
32
+ * @property {Constructor} [model] - Configuration model constructor reference.
33
+ * @property {Record<string, any>} [props] - Ad-hoc props for the component.
34
+ * @property {Record<string, unknown>} [metadata] - Free-form extension points.
35
+ */
36
+ export type DashComponentMetadata = {
37
+ tag?: string;
38
+ label?: string;
39
+ defaultSize?: DashComponentSize;
40
+ model?: Constructor;
41
+ props?: Record<string, any>;
42
+ metadata?: Record<string, unknown>;
43
+ };
44
+ /**
45
+ * @description Resolved definition of a dashboard-selectable component.
46
+ * @summary The normalized shape a palette or rendering service consumes from
47
+ * the registry. Defaults are applied so consumers never resolve undefined
48
+ * footprint values.
49
+ * @typedef DashComponentDefinition
50
+ * @memberOf module:ui-decorators/dashboard/types
51
+ * @property {string} name - Class name of the decorated component.
52
+ * @property {string} tag - Component tag resolved for rendering.
53
+ * @property {string} [label] - Translation label key for the palette.
54
+ * @property {DashComponentSize} defaultSize - Default grid footprint.
55
+ * @property {Constructor} [model] - Configuration model constructor reference.
56
+ * @property {Record<string, any>} [props] - Ad-hoc props for the component.
57
+ * @property {Record<string, unknown>} [metadata] - Free-form extension points.
58
+ */
59
+ export type DashComponentDefinition = {
60
+ name: string;
61
+ tag: string;
62
+ label?: string;
63
+ defaultSize: DashComponentSize;
64
+ model?: Constructor;
65
+ props?: Record<string, any>;
66
+ metadata?: Record<string, unknown>;
67
+ };
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @module ui-decorators/dashboard/types
3
+ * @summary Type definitions for dashboard-selectable components.
4
+ * @description Flavor-neutral types describing the palette metadata attached
5
+ * by `@dashcomponent()` and the resolved definition consumed by a palette
6
+ * service. No Angular or framework imports.
7
+ */
8
+ import type { Constructor } from "@decaf-ts/decoration";
9
+ /**
10
+ * @description Grid footprint of a dashboard component.
11
+ * @summary A component's default footprint on the dashboard grid, expressed
12
+ * in grid units (columns and rows).
13
+ * @typedef DashComponentSize
14
+ * @memberOf module:ui-decorators/dashboard/types
15
+ * @property {number} cols - Number of grid columns occupied.
16
+ * @property {number} rows - Number of grid rows occupied.
17
+ */
18
+ export type DashComponentSize = {
19
+ cols: number;
20
+ rows: number;
21
+ };
22
+ /**
23
+ * @description Palette metadata attached to a dashboard-selectable component.
24
+ * @summary The metadata object stored on a `@dashcomponent`-decorated class.
25
+ * Carries the translation label key, the default grid size, and an optional
26
+ * reference to the configuration model used by the component's own CRUD flow.
27
+ * @typedef DashComponentMetadata
28
+ * @memberOf module:ui-decorators/dashboard/types
29
+ * @property {string} [tag] - Component tag resolved for rendering.
30
+ * @property {string} [label] - Translation label key for the palette.
31
+ * @property {DashComponentSize} [defaultSize] - Default grid footprint.
32
+ * @property {Constructor} [model] - Configuration model constructor reference.
33
+ * @property {Record<string, any>} [props] - Ad-hoc props for the component.
34
+ * @property {Record<string, unknown>} [metadata] - Free-form extension points.
35
+ */
36
+ export type DashComponentMetadata = {
37
+ tag?: string;
38
+ label?: string;
39
+ defaultSize?: DashComponentSize;
40
+ model?: Constructor;
41
+ props?: Record<string, any>;
42
+ metadata?: Record<string, unknown>;
43
+ };
44
+ /**
45
+ * @description Resolved definition of a dashboard-selectable component.
46
+ * @summary The normalized shape a palette or rendering service consumes from
47
+ * the registry. Defaults are applied so consumers never resolve undefined
48
+ * footprint values.
49
+ * @typedef DashComponentDefinition
50
+ * @memberOf module:ui-decorators/dashboard/types
51
+ * @property {string} name - Class name of the decorated component.
52
+ * @property {string} tag - Component tag resolved for rendering.
53
+ * @property {string} [label] - Translation label key for the palette.
54
+ * @property {DashComponentSize} defaultSize - Default grid footprint.
55
+ * @property {Constructor} [model] - Configuration model constructor reference.
56
+ * @property {Record<string, any>} [props] - Ad-hoc props for the component.
57
+ * @property {Record<string, unknown>} [metadata] - Free-form extension points.
58
+ */
59
+ export type DashComponentDefinition = {
60
+ name: string;
61
+ tag: string;
62
+ label?: string;
63
+ defaultSize: DashComponentSize;
64
+ model?: Constructor;
65
+ props?: Record<string, any>;
66
+ metadata?: Record<string, unknown>;
67
+ };
@@ -1,4 +1,5 @@
1
1
  import type { GraphJsonValue } from "../document/GraphJsonValue.d.cts";
2
+ import type { GraphNodeShape, GraphNodeSizeRule } from "../constants.d.cts";
2
3
  import type { GraphIconReference } from "./GraphIconReference.d.cts";
3
4
  export interface GraphNodeDisplayManifest {
4
5
  name: string;
@@ -11,6 +12,22 @@ export interface GraphNodeDisplayManifest {
11
12
  width?: number;
12
13
  minWidth?: number;
13
14
  height?: number;
15
+ /**
16
+ * Node face silhouette (D1, DECAF-50 §4.5). Manifest-authoritative; the
17
+ * projected node renders this shape instead of a template CSS default.
18
+ */
19
+ shape?: GraphNodeShape;
20
+ /**
21
+ * Node corner radius in pixels (D1, DECAF-50 §4.5). Manifest-authoritative;
22
+ * the projected node renders this radius instead of a template CSS default.
23
+ */
24
+ cornerRadius?: number;
25
+ /**
26
+ * Manifest-declared, value-driven display rules (D1, DECAF-50 §4.5) evaluated
27
+ * from node-instance parameters — content growth never comes from hardcoded
28
+ * formulas or direct DOM style writes.
29
+ */
30
+ sizeRules?: GraphNodeSizeRule[];
14
31
  metadata?: Record<string, GraphJsonValue>;
15
32
  }
16
33
  export declare function isGraphNodeDisplayManifest(value: unknown): value is GraphNodeDisplayManifest;
@@ -1,4 +1,5 @@
1
1
  import type { GraphJsonValue } from "../document/GraphJsonValue.d.mts";
2
+ import type { GraphNodeShape, GraphNodeSizeRule } from "../constants.d.mts";
2
3
  import type { GraphIconReference } from "./GraphIconReference.d.mts";
3
4
  export interface GraphNodeDisplayManifest {
4
5
  name: string;
@@ -11,6 +12,22 @@ export interface GraphNodeDisplayManifest {
11
12
  width?: number;
12
13
  minWidth?: number;
13
14
  height?: number;
15
+ /**
16
+ * Node face silhouette (D1, DECAF-50 §4.5). Manifest-authoritative; the
17
+ * projected node renders this shape instead of a template CSS default.
18
+ */
19
+ shape?: GraphNodeShape;
20
+ /**
21
+ * Node corner radius in pixels (D1, DECAF-50 §4.5). Manifest-authoritative;
22
+ * the projected node renders this radius instead of a template CSS default.
23
+ */
24
+ cornerRadius?: number;
25
+ /**
26
+ * Manifest-declared, value-driven display rules (D1, DECAF-50 §4.5) evaluated
27
+ * from node-instance parameters — content growth never comes from hardcoded
28
+ * formulas or direct DOM style writes.
29
+ */
30
+ sizeRules?: GraphNodeSizeRule[];
14
31
  metadata?: Record<string, GraphJsonValue>;
15
32
  }
16
33
  export declare function isGraphNodeDisplayManifest(value: unknown): value is GraphNodeDisplayManifest;
@@ -10,6 +10,28 @@ export declare enum PortDirection {
10
10
  CONNECTION = "connection"
11
11
  }
12
12
  export type GraphNodeKind = string;
13
+ /**
14
+ * Node face silhouette (D1, DECAF-50 §4.5). Manifest-authoritative: the
15
+ * projected node geometry renders this shape and its corner radius instead of a
16
+ * hardcoded template CSS value.
17
+ */
18
+ export type GraphNodeShape = "rounded" | "square" | "pill";
19
+ /**
20
+ * Manifest-declared, value-driven display rule (D1, DECAF-50 §4.5). The manifest
21
+ * `display` metadata is the single authority for node geometry; content-driven
22
+ * growth is expressed here and evaluated from the node instance's parameters —
23
+ * never as a hardcoded per-node formula or a direct DOM style write.
24
+ */
25
+ export type GraphNodeSizeRule = {
26
+ /** Rule kind. Only `parameterCount` is defined: growth tracks an array parameter's length. */
27
+ type: "parameterCount";
28
+ /** Node-instance parameter whose item count drives the growth (e.g. `cases`). */
29
+ parameter: string;
30
+ /** Dimension that grows. */
31
+ dimension: "height" | "width";
32
+ /** Increment added per parameter item. */
33
+ perItem: number;
34
+ };
13
35
  export type GraphConnectionRule = {
14
36
  allowSelf?: boolean;
15
37
  allowMultiple?: boolean;
@@ -30,6 +52,22 @@ export type GraphNodeMetadata = {
30
52
  maxChildren?: number;
31
53
  minWidth?: number;
32
54
  width?: number;
55
+ /**
56
+ * Node face silhouette (D1, DECAF-50 §4.5). Manifest-authoritative;
57
+ * folded into the manifest display fields by the D1 revision.
58
+ */
59
+ shape?: GraphNodeShape;
60
+ /**
61
+ * Node corner radius in pixels (D1, DECAF-50 §4.5). Manifest-authoritative;
62
+ * folded into the manifest display fields by the D1 revision.
63
+ */
64
+ cornerRadius?: number;
65
+ /**
66
+ * Manifest-declared, value-driven display rules (D1, DECAF-50 §4.5). Content
67
+ * growth (e.g. Switch case count) is expressed here and evaluated from the
68
+ * node instance's parameters — never hardcoded per-node formulas.
69
+ */
70
+ sizeRules?: GraphNodeSizeRule[];
33
71
  connectionRules?: GraphConnectionRule;
34
72
  metadata?: Record<string, unknown>;
35
73
  /**
@@ -222,6 +260,21 @@ export type GraphNodeDefinition = {
222
260
  ui?: Record<string, any>;
223
261
  graph?: GraphNodeMetadata;
224
262
  ports: GraphPortDefinition[];
263
+ /**
264
+ * Node face silhouette (D1, DECAF-50 §4.5), copied from
265
+ * {@link GraphNodeMetadata.shape} by `graphDefinitionOf`.
266
+ */
267
+ shape?: GraphNodeShape;
268
+ /**
269
+ * Node corner radius in pixels (D1, DECAF-50 §4.5), copied from
270
+ * {@link GraphNodeMetadata.cornerRadius} by `graphDefinitionOf`.
271
+ */
272
+ cornerRadius?: number;
273
+ /**
274
+ * Manifest-declared, value-driven display rules (D1, DECAF-50 §4.5), copied
275
+ * from {@link GraphNodeMetadata.sizeRules} by `graphDefinitionOf`.
276
+ */
277
+ sizeRules?: GraphNodeSizeRule[];
225
278
  /**
226
279
  * Effective color resolved from the category registry (or the node's
227
280
  * explicit `color` override). Computed by `graphDefinitionOf`.
@@ -262,6 +315,33 @@ export interface GraphCategoryStyle {
262
315
  * color/icon is set on the node.
263
316
  */
264
317
  export declare const GRAPH_DEFAULT_CATEGORY_STYLE: GraphCategoryStyle;
318
+ /**
319
+ * Fallback node size in pixels when a manifest declares no `width`/`height`
320
+ * (D1, DECAF-50 §4.5). The manifest display remains the authority; this value
321
+ * only fills an absent manifest dimension, never overriding a declared one.
322
+ */
323
+ export declare const GRAPH_DEFAULT_NODE_SIZE = 96;
324
+ /**
325
+ * Default node corner radius in pixels (D1, DECAF-50 §4.5) applied only when the
326
+ * manifest declares no `cornerRadius`. Folded into the manifest display fields by
327
+ * the D1 revision; no template CSS pins the radius.
328
+ */
329
+ export declare const GRAPH_DEFAULT_NODE_CORNER_RADIUS = 18;
330
+ /**
331
+ * Evaluates a node definition's manifest-declared, value-driven display rules
332
+ * (D1, DECAF-50 §4.5) against per-parameter item counts. Content growth is
333
+ * driven by the manifest, never by hardcoded per-node formulas: each matching
334
+ * `parameterCount` rule adds `perItem * count` to its dimension. Falls back to the
335
+ * manifest `width`/`height` when no rule applies.
336
+ *
337
+ * @param definition - The manifest definition carrying `width`/`height`/`sizeRules`.
338
+ * @param parameterCounts - Item counts keyed by parameter id (e.g. `cases`).
339
+ * @returns The resolved `{ width, height }` in pixels.
340
+ */
341
+ export declare function graphNodeSizeOf(definition: Pick<GraphNodeDefinition, "width" | "height" | "sizeRules">, parameterCounts?: Record<string, number>): {
342
+ width: number;
343
+ height: number;
344
+ };
265
345
  /**
266
346
  * Registers a category style (color + optional icon) in the global registry.
267
347
  * Call this at module init time (e.g. in the engine's node declarations) to
@@ -273,15 +353,30 @@ export declare function registerGraphCategoryStyle(category: string, style: Grap
273
353
  */
274
354
  export declare function graphCategoryStyleOf(category?: string): GraphCategoryStyle;
275
355
  /**
276
- * Resolves the effective color for a node: explicit `color` overrides the
277
- * category color, which overrides the default.
356
+ * Resolves the effective color for a node (D7/G3-22, DECAF-50 §4.5).
357
+ *
358
+ * The **category base colour is authoritative**: every node of a registered
359
+ * category renders that one base colour, so same-category nodes never diverge.
360
+ * An explicit per-node `color` is an override applied at this single precedence
361
+ * point — it only wins when the category has no registered base style.
362
+ *
363
+ * @param explicitColor - The node's explicit per-node colour override, when any.
364
+ * @param category - The node's display category.
365
+ * @param override - A user-applied per-node colour override; wins over everything.
366
+ * @returns The resolved colour.
278
367
  */
279
- export declare function resolveEffectiveColor(explicitColor?: string, category?: string): string;
368
+ export declare function resolveEffectiveColor(explicitColor?: string, category?: string, override?: string): string;
280
369
  /**
281
- * Resolves the effective icon for a node: explicit `icon` overrides the
282
- * category icon, which overrides the default.
370
+ * Resolves the effective icon for a node (D7/G3-22, DECAF-50 §4.5). The
371
+ * **category base icon is authoritative**; an explicit per-node `icon` is an
372
+ * override applied at this single precedence point.
373
+ *
374
+ * @param explicitIcon - The node's explicit per-node icon override, when any.
375
+ * @param category - The node's display category.
376
+ * @param override - A user-applied per-node icon override; wins over everything.
377
+ * @returns The resolved icon name.
283
378
  */
284
- export declare function resolveEffectiveIcon(explicitIcon?: string, category?: string): string;
379
+ export declare function resolveEffectiveIcon(explicitIcon?: string, category?: string, override?: string): string;
285
380
  import type { GraphRunStatus } from "./types.d.cts";
286
381
  /**
287
382
  * Disabled-node execution semantics (DECAF-50 §4.9).
@@ -10,6 +10,28 @@ export declare enum PortDirection {
10
10
  CONNECTION = "connection"
11
11
  }
12
12
  export type GraphNodeKind = string;
13
+ /**
14
+ * Node face silhouette (D1, DECAF-50 §4.5). Manifest-authoritative: the
15
+ * projected node geometry renders this shape and its corner radius instead of a
16
+ * hardcoded template CSS value.
17
+ */
18
+ export type GraphNodeShape = "rounded" | "square" | "pill";
19
+ /**
20
+ * Manifest-declared, value-driven display rule (D1, DECAF-50 §4.5). The manifest
21
+ * `display` metadata is the single authority for node geometry; content-driven
22
+ * growth is expressed here and evaluated from the node instance's parameters —
23
+ * never as a hardcoded per-node formula or a direct DOM style write.
24
+ */
25
+ export type GraphNodeSizeRule = {
26
+ /** Rule kind. Only `parameterCount` is defined: growth tracks an array parameter's length. */
27
+ type: "parameterCount";
28
+ /** Node-instance parameter whose item count drives the growth (e.g. `cases`). */
29
+ parameter: string;
30
+ /** Dimension that grows. */
31
+ dimension: "height" | "width";
32
+ /** Increment added per parameter item. */
33
+ perItem: number;
34
+ };
13
35
  export type GraphConnectionRule = {
14
36
  allowSelf?: boolean;
15
37
  allowMultiple?: boolean;
@@ -30,6 +52,22 @@ export type GraphNodeMetadata = {
30
52
  maxChildren?: number;
31
53
  minWidth?: number;
32
54
  width?: number;
55
+ /**
56
+ * Node face silhouette (D1, DECAF-50 §4.5). Manifest-authoritative;
57
+ * folded into the manifest display fields by the D1 revision.
58
+ */
59
+ shape?: GraphNodeShape;
60
+ /**
61
+ * Node corner radius in pixels (D1, DECAF-50 §4.5). Manifest-authoritative;
62
+ * folded into the manifest display fields by the D1 revision.
63
+ */
64
+ cornerRadius?: number;
65
+ /**
66
+ * Manifest-declared, value-driven display rules (D1, DECAF-50 §4.5). Content
67
+ * growth (e.g. Switch case count) is expressed here and evaluated from the
68
+ * node instance's parameters — never hardcoded per-node formulas.
69
+ */
70
+ sizeRules?: GraphNodeSizeRule[];
33
71
  connectionRules?: GraphConnectionRule;
34
72
  metadata?: Record<string, unknown>;
35
73
  /**
@@ -222,6 +260,21 @@ export type GraphNodeDefinition = {
222
260
  ui?: Record<string, any>;
223
261
  graph?: GraphNodeMetadata;
224
262
  ports: GraphPortDefinition[];
263
+ /**
264
+ * Node face silhouette (D1, DECAF-50 §4.5), copied from
265
+ * {@link GraphNodeMetadata.shape} by `graphDefinitionOf`.
266
+ */
267
+ shape?: GraphNodeShape;
268
+ /**
269
+ * Node corner radius in pixels (D1, DECAF-50 §4.5), copied from
270
+ * {@link GraphNodeMetadata.cornerRadius} by `graphDefinitionOf`.
271
+ */
272
+ cornerRadius?: number;
273
+ /**
274
+ * Manifest-declared, value-driven display rules (D1, DECAF-50 §4.5), copied
275
+ * from {@link GraphNodeMetadata.sizeRules} by `graphDefinitionOf`.
276
+ */
277
+ sizeRules?: GraphNodeSizeRule[];
225
278
  /**
226
279
  * Effective color resolved from the category registry (or the node's
227
280
  * explicit `color` override). Computed by `graphDefinitionOf`.
@@ -262,6 +315,33 @@ export interface GraphCategoryStyle {
262
315
  * color/icon is set on the node.
263
316
  */
264
317
  export declare const GRAPH_DEFAULT_CATEGORY_STYLE: GraphCategoryStyle;
318
+ /**
319
+ * Fallback node size in pixels when a manifest declares no `width`/`height`
320
+ * (D1, DECAF-50 §4.5). The manifest display remains the authority; this value
321
+ * only fills an absent manifest dimension, never overriding a declared one.
322
+ */
323
+ export declare const GRAPH_DEFAULT_NODE_SIZE = 96;
324
+ /**
325
+ * Default node corner radius in pixels (D1, DECAF-50 §4.5) applied only when the
326
+ * manifest declares no `cornerRadius`. Folded into the manifest display fields by
327
+ * the D1 revision; no template CSS pins the radius.
328
+ */
329
+ export declare const GRAPH_DEFAULT_NODE_CORNER_RADIUS = 18;
330
+ /**
331
+ * Evaluates a node definition's manifest-declared, value-driven display rules
332
+ * (D1, DECAF-50 §4.5) against per-parameter item counts. Content growth is
333
+ * driven by the manifest, never by hardcoded per-node formulas: each matching
334
+ * `parameterCount` rule adds `perItem * count` to its dimension. Falls back to the
335
+ * manifest `width`/`height` when no rule applies.
336
+ *
337
+ * @param definition - The manifest definition carrying `width`/`height`/`sizeRules`.
338
+ * @param parameterCounts - Item counts keyed by parameter id (e.g. `cases`).
339
+ * @returns The resolved `{ width, height }` in pixels.
340
+ */
341
+ export declare function graphNodeSizeOf(definition: Pick<GraphNodeDefinition, "width" | "height" | "sizeRules">, parameterCounts?: Record<string, number>): {
342
+ width: number;
343
+ height: number;
344
+ };
265
345
  /**
266
346
  * Registers a category style (color + optional icon) in the global registry.
267
347
  * Call this at module init time (e.g. in the engine's node declarations) to
@@ -273,15 +353,30 @@ export declare function registerGraphCategoryStyle(category: string, style: Grap
273
353
  */
274
354
  export declare function graphCategoryStyleOf(category?: string): GraphCategoryStyle;
275
355
  /**
276
- * Resolves the effective color for a node: explicit `color` overrides the
277
- * category color, which overrides the default.
356
+ * Resolves the effective color for a node (D7/G3-22, DECAF-50 §4.5).
357
+ *
358
+ * The **category base colour is authoritative**: every node of a registered
359
+ * category renders that one base colour, so same-category nodes never diverge.
360
+ * An explicit per-node `color` is an override applied at this single precedence
361
+ * point — it only wins when the category has no registered base style.
362
+ *
363
+ * @param explicitColor - The node's explicit per-node colour override, when any.
364
+ * @param category - The node's display category.
365
+ * @param override - A user-applied per-node colour override; wins over everything.
366
+ * @returns The resolved colour.
278
367
  */
279
- export declare function resolveEffectiveColor(explicitColor?: string, category?: string): string;
368
+ export declare function resolveEffectiveColor(explicitColor?: string, category?: string, override?: string): string;
280
369
  /**
281
- * Resolves the effective icon for a node: explicit `icon` overrides the
282
- * category icon, which overrides the default.
370
+ * Resolves the effective icon for a node (D7/G3-22, DECAF-50 §4.5). The
371
+ * **category base icon is authoritative**; an explicit per-node `icon` is an
372
+ * override applied at this single precedence point.
373
+ *
374
+ * @param explicitIcon - The node's explicit per-node icon override, when any.
375
+ * @param category - The node's display category.
376
+ * @param override - A user-applied per-node icon override; wins over everything.
377
+ * @returns The resolved icon name.
283
378
  */
284
- export declare function resolveEffectiveIcon(explicitIcon?: string, category?: string): string;
379
+ export declare function resolveEffectiveIcon(explicitIcon?: string, category?: string, override?: string): string;
285
380
  import type { GraphRunStatus } from "./types.d.mts";
286
381
  /**
287
382
  * Disabled-node execution semantics (DECAF-50 §4.9).
@@ -13,6 +13,14 @@ export type GraphNodeUiState = {
13
13
  width?: number;
14
14
  height?: number;
15
15
  };
16
+ /**
17
+ * Explicit user resize flag (D1, DECAF-50 §4.5). Only a genuine user resize
18
+ * sets this; a carried default or template CSS never wins over the manifest
19
+ * display. `ui.size` is honoured by projection only when this is `true`.
20
+ */
21
+ resized?: boolean;
22
+ /** Explicit user per-node colour override (D7, DECAF-50 §4.5), when any. */
23
+ color?: string;
16
24
  expanded?: boolean;
17
25
  selectedTab?: string;
18
26
  };
@@ -13,6 +13,14 @@ export type GraphNodeUiState = {
13
13
  width?: number;
14
14
  height?: number;
15
15
  };
16
+ /**
17
+ * Explicit user resize flag (D1, DECAF-50 §4.5). Only a genuine user resize
18
+ * sets this; a carried default or template CSS never wins over the manifest
19
+ * display. `ui.size` is honoured by projection only when this is `true`.
20
+ */
21
+ resized?: boolean;
22
+ /** Explicit user per-node colour override (D7, DECAF-50 §4.5), when any. */
23
+ color?: string;
16
24
  expanded?: boolean;
17
25
  selectedTab?: string;
18
26
  };
@@ -9,25 +9,26 @@ import "./overrides";
9
9
  export * from "./overrides/index.d.cts";
10
10
  export * from "./model/index.d.cts";
11
11
  export * from "./ui/index.d.cts";
12
+ export * from "./dashboard/index.d.cts";
12
13
  /**
13
14
  * @description Current package version string
14
15
  * @summary Stores the current package version for reference
15
16
  * @const VERSION
16
17
  * @memberOf module:ui-decorators
17
18
  */
18
- export declare const VERSION = "0.20.5";
19
+ export declare const VERSION = "0.20.7";
19
20
  /**
20
21
  * @description Represents the current commit hash of the module build.
21
22
  * @summary Stores the current git commit hash for the package. The build replaces
22
23
  * the placeholder with the actual commit hash at publish time.
23
24
  * @const COMMIT
24
25
  */
25
- export declare const COMMIT = "4e03aa0";
26
+ export declare const COMMIT = "d286514";
26
27
  /**
27
28
  * @description Represents the full version string of the module.
28
29
  * @summary Stores the semver version and commit hash for the package.
29
30
  * The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
30
31
  * @const FULL_VERSION
31
32
  */
32
- export declare const FULL_VERSION = "0.20.5-4e03aa0";
33
+ export declare const FULL_VERSION = "0.20.7-d286514";
33
34
  export declare const PACKAGE_NAME = "@decaf-ts/ui-decorators";
@@ -9,25 +9,26 @@ import "./overrides";
9
9
  export * from "./overrides/index.d.mts";
10
10
  export * from "./model/index.d.mts";
11
11
  export * from "./ui/index.d.mts";
12
+ export * from "./dashboard/index.d.mts";
12
13
  /**
13
14
  * @description Current package version string
14
15
  * @summary Stores the current package version for reference
15
16
  * @const VERSION
16
17
  * @memberOf module:ui-decorators
17
18
  */
18
- export declare const VERSION = "0.20.5";
19
+ export declare const VERSION = "0.20.7";
19
20
  /**
20
21
  * @description Represents the current commit hash of the module build.
21
22
  * @summary Stores the current git commit hash for the package. The build replaces
22
23
  * the placeholder with the actual commit hash at publish time.
23
24
  * @const COMMIT
24
25
  */
25
- export declare const COMMIT = "4e03aa0";
26
+ export declare const COMMIT = "d286514";
26
27
  /**
27
28
  * @description Represents the full version string of the module.
28
29
  * @summary Stores the semver version and commit hash for the package.
29
30
  * The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
30
31
  * @const FULL_VERSION
31
32
  */
32
- export declare const FULL_VERSION = "0.20.5-4e03aa0";
33
+ export declare const FULL_VERSION = "0.20.7-d286514";
33
34
  export declare const PACKAGE_NAME = "@decaf-ts/ui-decorators";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decaf-ts/ui-decorators",
3
- "version": "0.20.6",
3
+ "version": "0.20.8",
4
4
  "description": "Extension of decorator validation to ui elements to allow for web integration",
5
5
  "type": "module",
6
6
  "exports": {
@@ -128,6 +128,8 @@
128
128
  "main": "./lib/cjs/index.cjs",
129
129
  "module": "./lib/esm/index.js",
130
130
  "sideEffects": [
131
+ "./lib/esm/index.js",
132
+ "./lib/cjs/index.cjs",
131
133
  "./lib/esm/overrides/index.js",
132
134
  "./lib/esm/graph/overrides/index.js",
133
135
  "./lib/esm/graph/overrides/overrides.js",