@uigraph/sdk 1.2.4 → 1.2.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.
@@ -67,6 +67,7 @@ declare const contextSchema: z$1.ZodObject<{
67
67
  style: z$1.ZodOptional<z$1.ZodObject<{
68
68
  width: z$1.ZodOptional<z$1.ZodNumber>;
69
69
  height: z$1.ZodOptional<z$1.ZodNumber>;
70
+ color: z$1.ZodOptional<z$1.ZodString>;
70
71
  fill: z$1.ZodOptional<z$1.ZodString>;
71
72
  stroke: z$1.ZodOptional<z$1.ZodString>;
72
73
  strokeWidth: z$1.ZodOptional<z$1.ZodNumber>;
@@ -67,6 +67,7 @@ declare const contextSchema: z$1.ZodObject<{
67
67
  style: z$1.ZodOptional<z$1.ZodObject<{
68
68
  width: z$1.ZodOptional<z$1.ZodNumber>;
69
69
  height: z$1.ZodOptional<z$1.ZodNumber>;
70
+ color: z$1.ZodOptional<z$1.ZodString>;
70
71
  fill: z$1.ZodOptional<z$1.ZodString>;
71
72
  stroke: z$1.ZodOptional<z$1.ZodString>;
72
73
  strokeWidth: z$1.ZodOptional<z$1.ZodNumber>;
@@ -46,6 +46,7 @@ const contextSchema = zod.default.object({
46
46
  style: zod.default.object({
47
47
  width: zod.default.number().optional(),
48
48
  height: zod.default.number().optional(),
49
+ color: zod.default.string().optional(),
49
50
  fill: zod.default.string().optional(),
50
51
  stroke: zod.default.string().optional(),
51
52
  strokeWidth: zod.default.number().optional(),
@@ -45,6 +45,7 @@ const contextSchema = z$1.object({
45
45
  style: z$1.object({
46
46
  width: z$1.number().optional(),
47
47
  height: z$1.number().optional(),
48
+ color: z$1.string().optional(),
48
49
  fill: z$1.string().optional(),
49
50
  stroke: z$1.string().optional(),
50
51
  strokeWidth: z$1.number().optional(),
@@ -1,6 +1,102 @@
1
1
  import { t as ComponentInputType } from "./__component-type.CO8FgnQE.mjs";
2
2
  import { Edge, Node } from "@xyflow/react";
3
3
 
4
+ //#region src/types/c4.d.ts
5
+ type C4DiagramType = 'C4Context' | 'C4Container' | 'C4Component' | 'C4Dynamic' | 'C4Deployment';
6
+ type C4ElementKind = 'person' | 'system' | 'container' | 'component' | 'node';
7
+ type C4ElementShape = 'default' | 'db' | 'queue';
8
+ interface C4Element {
9
+ id: string;
10
+ label: string;
11
+ description?: string;
12
+ technology?: string;
13
+ kind: C4ElementKind;
14
+ shape: C4ElementShape;
15
+ isExternal: boolean;
16
+ /** `<<external_system_db>>` tag mermaid prints above the name. */
17
+ stereotype: string;
18
+ parentId?: string;
19
+ sprite?: string;
20
+ tags?: string;
21
+ link?: string;
22
+ /** `$link="uig:<diagramId>"` drill-down target rendered as a sub diagram. */
23
+ subDiagramId?: string;
24
+ }
25
+ type C4BoundaryKind = 'enterprise' | 'system' | 'container' | 'generic' | 'node';
26
+ /** `Node_L` / `Node_R` only differ in how mermaid aligns the node label. */
27
+ type C4NodeType = 'node' | 'nodeL' | 'nodeR';
28
+ interface C4Boundary {
29
+ id: string;
30
+ label: string;
31
+ kind: C4BoundaryKind;
32
+ /** Printed as `[ENTERPRISE]` / `[SYSTEM]` / the verbatim custom type. */
33
+ type: string;
34
+ /** Only `Deployment_Node` and friends carry a description. */
35
+ description?: string;
36
+ /** Set for the deployment-node keywords, absent for plain boundaries. */
37
+ nodeType?: C4NodeType;
38
+ parentId?: string;
39
+ childIds: string[];
40
+ sprite?: string;
41
+ tags?: string;
42
+ link?: string;
43
+ }
44
+ type C4RelDirection = 'default' | 'up' | 'down' | 'left' | 'right' | 'back' | 'bi';
45
+ interface C4Relationship {
46
+ from: string;
47
+ to: string;
48
+ label: string;
49
+ technology?: string;
50
+ description?: string;
51
+ direction: C4RelDirection;
52
+ index: number;
53
+ sprite?: string;
54
+ tags?: string;
55
+ link?: string;
56
+ }
57
+ /** `UpdateElementStyle(id, $bgColor="grey", …)` overrides. */
58
+ interface C4ElementStyle {
59
+ bgColor?: string;
60
+ fontColor?: string;
61
+ borderColor?: string;
62
+ shadowing?: boolean;
63
+ shape?: string;
64
+ sprite?: string;
65
+ techn?: string;
66
+ legendText?: string;
67
+ legendSprite?: string;
68
+ }
69
+ /** `UpdateRelStyle(from, to, $lineColor="blue", …)` overrides. */
70
+ interface C4RelStyle {
71
+ textColor?: string;
72
+ lineColor?: string;
73
+ offsetX?: number;
74
+ offsetY?: number;
75
+ lineWidth?: number;
76
+ lineStyle?: string;
77
+ }
78
+ /** `UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")`. */
79
+ interface C4LayoutConfig {
80
+ c4ShapeInRow: number;
81
+ c4BoundaryInRow: number;
82
+ }
83
+ type C4Direction = 'TB' | 'BT' | 'LR' | 'RL';
84
+ interface C4DiagramData {
85
+ type: C4DiagramType;
86
+ title?: string;
87
+ accTitle?: string;
88
+ accDescription?: string;
89
+ direction?: C4Direction;
90
+ elements: C4Element[];
91
+ boundaries: C4Boundary[];
92
+ relationships: C4Relationship[];
93
+ elementStyles: Record<string, C4ElementStyle>;
94
+ boundaryStyles: Record<string, C4ElementStyle>;
95
+ /** Keyed by `${from}->${to}`. */
96
+ relStyles: Record<string, C4RelStyle>;
97
+ layout: C4LayoutConfig;
98
+ }
99
+ //#endregion
4
100
  //#region src/types/component.d.ts
5
101
  type LinkOrFileValue = {
6
102
  fileId?: string;
@@ -183,6 +279,28 @@ type CustomData = {
183
279
  columns?: string[];
184
280
  rows?: string[][];
185
281
  strokeAnimation?: 'dash';
282
+ c4Kind?: C4ElementKind;
283
+ c4Shape?: C4ElementShape;
284
+ c4BoundaryKind?: C4BoundaryKind;
285
+ c4NodeType?: C4NodeType;
286
+ boundaryType?: string;
287
+ isExternal?: boolean;
288
+ technology?: string;
289
+ description?: string;
290
+ link?: string;
291
+ color?: string;
292
+ fill?: string;
293
+ stroke?: string;
294
+ fontColor?: string;
295
+ backgroundColor?: string;
296
+ borderColor?: string;
297
+ labelColor?: string;
298
+ labelOffsetX?: number;
299
+ labelOffsetY?: number;
300
+ /** Diagram this node drills down into, opened in a new tab. */
301
+ diagramId?: string;
302
+ diagramName?: string;
303
+ thumbnailUrl?: string;
186
304
  };
187
305
  interface ReactFlowData {
188
306
  nodes: Node<CustomData>[];
@@ -195,4 +313,4 @@ interface RFComponentField {
195
313
  data: unknown;
196
314
  }
197
315
  //#endregion
198
- export { ServerComponentFieldInput as C, ServerComponentField as S, SequenceParticipantLink as _, MermaidNode as a, SubgraphLayout as b, SequenceAutonumber as c, SequenceBlockType as d, SequenceBox as f, SequenceParticipant as g, SequenceNote as h, MermaidEdge as i, SequenceBlock as l, SequenceMessage as m, RFComponentField as n, SequenceActivation as o, SequenceDiagramData as p, ReactFlowData as r, SequenceArrowHead as s, CustomData as t, SequenceBlockSection as u, SequenceParticipantType as v, LinkOrFileValue as x, SubgraphInfo as y };
316
+ export { C4ElementKind as A, ServerComponentFieldInput as C, C4DiagramType as D, C4DiagramData as E, C4RelDirection as F, C4RelStyle as I, C4Relationship as L, C4ElementStyle as M, C4LayoutConfig as N, C4Direction as O, C4NodeType as P, ServerComponentField as S, C4BoundaryKind as T, SequenceParticipantLink as _, MermaidNode as a, SubgraphLayout as b, SequenceAutonumber as c, SequenceBlockType as d, SequenceBox as f, SequenceParticipant as g, SequenceNote as h, MermaidEdge as i, C4ElementShape as j, C4Element as k, SequenceBlock as l, SequenceMessage as m, RFComponentField as n, SequenceActivation as o, SequenceDiagramData as p, ReactFlowData as r, SequenceArrowHead as s, CustomData as t, SequenceBlockSection as u, SequenceParticipantType as v, C4Boundary as w, LinkOrFileValue as x, SubgraphInfo as y };
@@ -1,6 +1,102 @@
1
1
  import { t as ComponentInputType } from "./__component-type.tW2Xh7Xk.cjs";
2
2
  import { Edge, Node } from "@xyflow/react";
3
3
 
4
+ //#region src/types/c4.d.ts
5
+ type C4DiagramType = 'C4Context' | 'C4Container' | 'C4Component' | 'C4Dynamic' | 'C4Deployment';
6
+ type C4ElementKind = 'person' | 'system' | 'container' | 'component' | 'node';
7
+ type C4ElementShape = 'default' | 'db' | 'queue';
8
+ interface C4Element {
9
+ id: string;
10
+ label: string;
11
+ description?: string;
12
+ technology?: string;
13
+ kind: C4ElementKind;
14
+ shape: C4ElementShape;
15
+ isExternal: boolean;
16
+ /** `<<external_system_db>>` tag mermaid prints above the name. */
17
+ stereotype: string;
18
+ parentId?: string;
19
+ sprite?: string;
20
+ tags?: string;
21
+ link?: string;
22
+ /** `$link="uig:<diagramId>"` drill-down target rendered as a sub diagram. */
23
+ subDiagramId?: string;
24
+ }
25
+ type C4BoundaryKind = 'enterprise' | 'system' | 'container' | 'generic' | 'node';
26
+ /** `Node_L` / `Node_R` only differ in how mermaid aligns the node label. */
27
+ type C4NodeType = 'node' | 'nodeL' | 'nodeR';
28
+ interface C4Boundary {
29
+ id: string;
30
+ label: string;
31
+ kind: C4BoundaryKind;
32
+ /** Printed as `[ENTERPRISE]` / `[SYSTEM]` / the verbatim custom type. */
33
+ type: string;
34
+ /** Only `Deployment_Node` and friends carry a description. */
35
+ description?: string;
36
+ /** Set for the deployment-node keywords, absent for plain boundaries. */
37
+ nodeType?: C4NodeType;
38
+ parentId?: string;
39
+ childIds: string[];
40
+ sprite?: string;
41
+ tags?: string;
42
+ link?: string;
43
+ }
44
+ type C4RelDirection = 'default' | 'up' | 'down' | 'left' | 'right' | 'back' | 'bi';
45
+ interface C4Relationship {
46
+ from: string;
47
+ to: string;
48
+ label: string;
49
+ technology?: string;
50
+ description?: string;
51
+ direction: C4RelDirection;
52
+ index: number;
53
+ sprite?: string;
54
+ tags?: string;
55
+ link?: string;
56
+ }
57
+ /** `UpdateElementStyle(id, $bgColor="grey", …)` overrides. */
58
+ interface C4ElementStyle {
59
+ bgColor?: string;
60
+ fontColor?: string;
61
+ borderColor?: string;
62
+ shadowing?: boolean;
63
+ shape?: string;
64
+ sprite?: string;
65
+ techn?: string;
66
+ legendText?: string;
67
+ legendSprite?: string;
68
+ }
69
+ /** `UpdateRelStyle(from, to, $lineColor="blue", …)` overrides. */
70
+ interface C4RelStyle {
71
+ textColor?: string;
72
+ lineColor?: string;
73
+ offsetX?: number;
74
+ offsetY?: number;
75
+ lineWidth?: number;
76
+ lineStyle?: string;
77
+ }
78
+ /** `UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")`. */
79
+ interface C4LayoutConfig {
80
+ c4ShapeInRow: number;
81
+ c4BoundaryInRow: number;
82
+ }
83
+ type C4Direction = 'TB' | 'BT' | 'LR' | 'RL';
84
+ interface C4DiagramData {
85
+ type: C4DiagramType;
86
+ title?: string;
87
+ accTitle?: string;
88
+ accDescription?: string;
89
+ direction?: C4Direction;
90
+ elements: C4Element[];
91
+ boundaries: C4Boundary[];
92
+ relationships: C4Relationship[];
93
+ elementStyles: Record<string, C4ElementStyle>;
94
+ boundaryStyles: Record<string, C4ElementStyle>;
95
+ /** Keyed by `${from}->${to}`. */
96
+ relStyles: Record<string, C4RelStyle>;
97
+ layout: C4LayoutConfig;
98
+ }
99
+ //#endregion
4
100
  //#region src/types/component.d.ts
5
101
  type LinkOrFileValue = {
6
102
  fileId?: string;
@@ -183,6 +279,28 @@ type CustomData = {
183
279
  columns?: string[];
184
280
  rows?: string[][];
185
281
  strokeAnimation?: 'dash';
282
+ c4Kind?: C4ElementKind;
283
+ c4Shape?: C4ElementShape;
284
+ c4BoundaryKind?: C4BoundaryKind;
285
+ c4NodeType?: C4NodeType;
286
+ boundaryType?: string;
287
+ isExternal?: boolean;
288
+ technology?: string;
289
+ description?: string;
290
+ link?: string;
291
+ color?: string;
292
+ fill?: string;
293
+ stroke?: string;
294
+ fontColor?: string;
295
+ backgroundColor?: string;
296
+ borderColor?: string;
297
+ labelColor?: string;
298
+ labelOffsetX?: number;
299
+ labelOffsetY?: number;
300
+ /** Diagram this node drills down into, opened in a new tab. */
301
+ diagramId?: string;
302
+ diagramName?: string;
303
+ thumbnailUrl?: string;
186
304
  };
187
305
  interface ReactFlowData {
188
306
  nodes: Node<CustomData>[];
@@ -195,4 +313,4 @@ interface RFComponentField {
195
313
  data: unknown;
196
314
  }
197
315
  //#endregion
198
- export { ServerComponentFieldInput as C, ServerComponentField as S, SequenceParticipantLink as _, MermaidNode as a, SubgraphLayout as b, SequenceAutonumber as c, SequenceBlockType as d, SequenceBox as f, SequenceParticipant as g, SequenceNote as h, MermaidEdge as i, SequenceBlock as l, SequenceMessage as m, RFComponentField as n, SequenceActivation as o, SequenceDiagramData as p, ReactFlowData as r, SequenceArrowHead as s, CustomData as t, SequenceBlockSection as u, SequenceParticipantType as v, LinkOrFileValue as x, SubgraphInfo as y };
316
+ export { C4ElementKind as A, ServerComponentFieldInput as C, C4DiagramType as D, C4DiagramData as E, C4RelDirection as F, C4RelStyle as I, C4Relationship as L, C4ElementStyle as M, C4LayoutConfig as N, C4Direction as O, C4NodeType as P, ServerComponentField as S, C4BoundaryKind as T, SequenceParticipantLink as _, MermaidNode as a, SubgraphLayout as b, SequenceAutonumber as c, SequenceBlockType as d, SequenceBox as f, SequenceParticipant as g, SequenceNote as h, MermaidEdge as i, C4ElementShape as j, C4Element as k, SequenceBlock as l, SequenceMessage as m, RFComponentField as n, SequenceActivation as o, SequenceDiagramData as p, ReactFlowData as r, SequenceArrowHead as s, CustomData as t, SequenceBlockSection as u, SequenceParticipantType as v, C4Boundary as w, LinkOrFileValue as x, SubgraphInfo as y };
@@ -1,4 +1,4 @@
1
- import { S as ServerComponentField } from "./__index.YhKZQgFP.cjs";
1
+ import { S as ServerComponentField } from "./__index.BVDt3Nmx.cjs";
2
2
  import "./__component-type.tW2Xh7Xk.cjs";
3
3
  import { z } from "zod";
4
4
 
@@ -1,4 +1,4 @@
1
- import { S as ServerComponentField } from "./__index.Bvdu5Kox.mjs";
1
+ import { S as ServerComponentField } from "./__index.BQQp_uAt.mjs";
2
2
  import "./__component-type.CO8FgnQE.mjs";
3
3
  import { z } from "zod";
4
4
 
package/dist/headless.cjs CHANGED
@@ -1,3 +1,3 @@
1
1
  require("./__component-type.69UkUMKl.cjs");
2
- const require_headless = require("./__headless.DGmyg-me.cjs");
2
+ const require_headless = require("./__headless.DbTnxFi3.cjs");
3
3
  exports.contextSchema = require_headless.contextSchema;
@@ -1,3 +1,3 @@
1
1
  import "./__component-type.tW2Xh7Xk.cjs";
2
- import { t as contextSchema } from "./__headless.DfSqiw4X.cjs";
2
+ import { t as contextSchema } from "./__headless.D9VUj46t.cjs";
3
3
  export { contextSchema };
@@ -1,3 +1,3 @@
1
1
  import "./__component-type.CO8FgnQE.mjs";
2
- import { t as contextSchema } from "./__headless.BLqB7VsJ.mjs";
2
+ import { t as contextSchema } from "./__headless.CnrU6aAA.mjs";
3
3
  export { contextSchema };
package/dist/headless.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  import "./__component-type.CYmD-KIu.mjs";
2
- import { t as contextSchema } from "./__headless.DpdtlCFx.mjs";
2
+ import { t as contextSchema } from "./__headless.bq_YVz7q.mjs";
3
3
  export { contextSchema };