@uigraph/sdk 1.2.3 → 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.
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- import { C as ServerComponentFieldInput, S as ServerComponentField, _ as SequenceParticipantLink, a as MermaidNode, b as SubgraphLayout, c as SequenceAutonumber, d as SequenceBlockType, f as SequenceBox, g as SequenceParticipant, h as SequenceNote, i as MermaidEdge, l as SequenceBlock, m as SequenceMessage, n as RFComponentField, o as SequenceActivation, p as SequenceDiagramData, r as ReactFlowData, s as SequenceArrowHead, t as CustomData, u as SequenceBlockSection, v as SequenceParticipantType, x as LinkOrFileValue, y as SubgraphInfo } from "./__index.YhKZQgFP.cjs";
1
+ import { A as C4ElementKind, C as ServerComponentFieldInput, D as C4DiagramType, E as C4DiagramData, F as C4RelDirection, I as C4RelStyle, L as C4Relationship, M as C4ElementStyle, N as C4LayoutConfig, O as C4Direction, P as C4NodeType, S as ServerComponentField, T as C4BoundaryKind, _ as SequenceParticipantLink, a as MermaidNode, b as SubgraphLayout, c as SequenceAutonumber, d as SequenceBlockType, f as SequenceBox, g as SequenceParticipant, h as SequenceNote, i as MermaidEdge, j as C4ElementShape, k as C4Element, l as SequenceBlock, m as SequenceMessage, n as RFComponentField, o as SequenceActivation, p as SequenceDiagramData, r as ReactFlowData, s as SequenceArrowHead, t as CustomData, u as SequenceBlockSection, v as SequenceParticipantType, w as C4Boundary, x as LinkOrFileValue, y as SubgraphInfo } from "./__index.BVDt3Nmx.cjs";
2
2
  import { t as ComponentInputType } from "./__component-type.tW2Xh7Xk.cjs";
3
- import { t as contextSchema } from "./__headless.DfSqiw4X.cjs";
3
+ import { t as contextSchema } from "./__headless.D9VUj46t.cjs";
4
4
  import z$1, { z } from "zod";
5
5
  import { Edge, Node } from "@xyflow/react";
6
6
 
@@ -732,9 +732,101 @@ type Options = {
732
732
  };
733
733
  declare function syncBaseData(prev: ReactFlowData, next: ReactFlowData, options?: Options): ReactFlowData;
734
734
  //#endregion
735
+ //#region src/mermaid-converter/c4-parser.d.ts
736
+ declare function isC4Diagram(code: string): boolean;
737
+ declare function parseC4Diagram(code: string): C4DiagramData;
738
+ //#endregion
739
+ //#region src/mermaid-converter/c4-to-react-flow.d.ts
740
+ /** Mirrors mermaid's `c4` config block so imports land at a familiar scale. */
741
+ declare const C4_LAYOUT: {
742
+ WIDTH: number;
743
+ MIN_HEIGHT: number;
744
+ SHAPE_MARGIN: number;
745
+ ROW_MARGIN: number;
746
+ SHAPE_PADDING: number;
747
+ BOUNDARY_HEADER: number;
748
+ BOUNDARY_PADDING: number;
749
+ BOUNDARY_MARGIN: number;
750
+ DIAGRAM_MARGIN_X: number;
751
+ DIAGRAM_MARGIN_Y: number;
752
+ };
753
+ declare const C4_COLORS: {
754
+ person: {
755
+ fill: string;
756
+ stroke: string;
757
+ };
758
+ personExternal: {
759
+ fill: string;
760
+ stroke: string;
761
+ };
762
+ system: {
763
+ fill: string;
764
+ stroke: string;
765
+ };
766
+ systemExternal: {
767
+ fill: string;
768
+ stroke: string;
769
+ };
770
+ container: {
771
+ fill: string;
772
+ stroke: string;
773
+ };
774
+ containerExternal: {
775
+ fill: string;
776
+ stroke: string;
777
+ };
778
+ component: {
779
+ fill: string;
780
+ stroke: string;
781
+ };
782
+ componentExternal: {
783
+ fill: string;
784
+ stroke: string;
785
+ };
786
+ node: {
787
+ fill: string;
788
+ stroke: string;
789
+ };
790
+ nodeExternal: {
791
+ fill: string;
792
+ stroke: string;
793
+ };
794
+ };
795
+ declare function getC4ElementColors(element: C4Element): {
796
+ fill: string;
797
+ stroke: string;
798
+ } | {
799
+ fill: string;
800
+ stroke: string;
801
+ } | {
802
+ fill: string;
803
+ stroke: string;
804
+ } | {
805
+ fill: string;
806
+ stroke: string;
807
+ } | {
808
+ fill: string;
809
+ stroke: string;
810
+ } | {
811
+ fill: string;
812
+ stroke: string;
813
+ } | {
814
+ fill: string;
815
+ stroke: string;
816
+ } | {
817
+ fill: string;
818
+ stroke: string;
819
+ } | {
820
+ fill: string;
821
+ stroke: string;
822
+ } | {
823
+ fill: string;
824
+ stroke: string;
825
+ };
826
+ declare function convertC4ToReactFlow(data: C4DiagramData): ReactFlowData;
827
+ declare function convertC4MermaidToReactFlow(code: string): ReactFlowData;
828
+ //#endregion
735
829
  //#region src/mermaid-converter/constants/layout.d.ts
736
- /** Default lifeline/indicator color, shared with the canvas's own participants. */
737
- declare const SEQUENCE_PARTICIPANT_COLOR = "#E2E8F0";
738
830
  declare const SEQUENCE_LAYOUT: {
739
831
  readonly COLUMN_WIDTH: 360;
740
832
  readonly ROW_HEIGHT: 60;
@@ -767,6 +859,10 @@ declare function sanitizeMermaidLabels(src: string): string;
767
859
  //#region src/mermaid-converter/mermaid-to-react-flow.d.ts
768
860
  declare function convertMermaidToReactFlow(mermaidCode: string): Promise<ReactFlowData>;
769
861
  //#endregion
862
+ //#region src/mermaid-converter/react-flow-to-sequence.d.ts
863
+ declare function isSequenceDiagram(nodes: Node[]): boolean;
864
+ declare function convertReactFlowToSequenceMermaid(nodes: Node[], edges: Edge[]): string;
865
+ //#endregion
770
866
  //#region src/mermaid-converter/sequence-layout.d.ts
771
867
  /**
772
868
  * Sizes a sequence message box from its own label text, targeting a ~2-line
@@ -806,4 +902,4 @@ type UigOutput = {
806
902
  //#region src/uig-converter/index.d.ts
807
903
  declare function convertUiGraphToMermaid(input: UiGraphInput, options?: UiGraphOptions): UigOutput;
808
904
  //#endregion
809
- export { AstToSqlGenerator, AstToUiConverter, BasicDetailsSchema, CheckConstraintAST, ColumnAST, ComponentInputType, ConstraintAST, CustomData, DataTypeAST, DefaultValueAST, DialectIdSchema, DocumentCollectionSchema, DocumentIndexSchema, DynamoAttributeSchema, DynamoEditorSchema, DynamoGsiSchema, EditorSupportedDialectSchema, ForeignKeyConstraintAST, IndexAST, IndexColumnAST, IndexMethodAST, JsonEditorSchema, LinkOrFileValue, MermaidEdge, MermaidNode, MongoCollectionSchema, MongoEditorSchema, MongoIndexFieldSchema, MongoIndexSchema, MongoNestedFieldSchema, NestedFieldSchema, NoSqlFieldSchema, PrimaryKeyConstraintAST, RFComponentField, ReactFlowData, ReferentialActionAST, SEQUENCE_LAYOUT, SEQUENCE_PARTICIPANT_COLOR, SchemaAST, SchemaDialect, SchemaUIRepresentation, SequenceActivation, SequenceArrowHead, SequenceAutonumber, SequenceBlock, SequenceBlockSection, SequenceBlockType, SequenceBox, SequenceDiagramData, SequenceMessage, SequenceNote, SequenceParticipant, SequenceParticipantLink, SequenceParticipantType, ServerComponentField, ServerComponentFieldInput, SqlToAstParser, SubgraphInfo, SubgraphLayout, TParsedColumn, TParsedForeignKey, TParsedIndex, TParsedSchema, TParsedTable, TableAST, TableOptionsAST, UniqueConstraintAST, buildMetaData, contextSchema, convertDynamoSchemaToAst, convertJsonSchemaToAst, convertMermaidToReactFlow, convertMermaidToReactFlowWithContext, convertMongoSchemaToAst, convertNoSQLToAst, convertUiGraphToMermaid, estimateSequenceMessageBoxSize, flattenMetaData, generateTableNodeId, generateUUID, sanitizeMermaidLabels, syncBaseData };
905
+ export { AstToSqlGenerator, AstToUiConverter, BasicDetailsSchema, C4Boundary, C4BoundaryKind, C4DiagramData, C4DiagramType, C4Direction, C4Element, C4ElementKind, C4ElementShape, C4ElementStyle, C4LayoutConfig, C4NodeType, C4RelDirection, C4RelStyle, C4Relationship, C4_COLORS, C4_LAYOUT, CheckConstraintAST, ColumnAST, ComponentInputType, ConstraintAST, CustomData, DataTypeAST, DefaultValueAST, DialectIdSchema, DocumentCollectionSchema, DocumentIndexSchema, DynamoAttributeSchema, DynamoEditorSchema, DynamoGsiSchema, EditorSupportedDialectSchema, ForeignKeyConstraintAST, IndexAST, IndexColumnAST, IndexMethodAST, JsonEditorSchema, LinkOrFileValue, MermaidEdge, MermaidNode, MongoCollectionSchema, MongoEditorSchema, MongoIndexFieldSchema, MongoIndexSchema, MongoNestedFieldSchema, NestedFieldSchema, NoSqlFieldSchema, PrimaryKeyConstraintAST, RFComponentField, ReactFlowData, ReferentialActionAST, SEQUENCE_LAYOUT, SchemaAST, SchemaDialect, SchemaUIRepresentation, SequenceActivation, SequenceArrowHead, SequenceAutonumber, SequenceBlock, SequenceBlockSection, SequenceBlockType, SequenceBox, SequenceDiagramData, SequenceMessage, SequenceNote, SequenceParticipant, SequenceParticipantLink, SequenceParticipantType, ServerComponentField, ServerComponentFieldInput, SqlToAstParser, SubgraphInfo, SubgraphLayout, TParsedColumn, TParsedForeignKey, TParsedIndex, TParsedSchema, TParsedTable, TableAST, TableOptionsAST, UniqueConstraintAST, buildMetaData, contextSchema, convertC4MermaidToReactFlow, convertC4ToReactFlow, convertDynamoSchemaToAst, convertJsonSchemaToAst, convertMermaidToReactFlow, convertMermaidToReactFlowWithContext, convertMongoSchemaToAst, convertNoSQLToAst, convertReactFlowToSequenceMermaid, convertUiGraphToMermaid, estimateSequenceMessageBoxSize, flattenMetaData, generateTableNodeId, generateUUID, getC4ElementColors, isC4Diagram, isSequenceDiagram, parseC4Diagram, sanitizeMermaidLabels, syncBaseData };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { C as ServerComponentFieldInput, S as ServerComponentField, _ as SequenceParticipantLink, a as MermaidNode, b as SubgraphLayout, c as SequenceAutonumber, d as SequenceBlockType, f as SequenceBox, g as SequenceParticipant, h as SequenceNote, i as MermaidEdge, l as SequenceBlock, m as SequenceMessage, n as RFComponentField, o as SequenceActivation, p as SequenceDiagramData, r as ReactFlowData, s as SequenceArrowHead, t as CustomData, u as SequenceBlockSection, v as SequenceParticipantType, x as LinkOrFileValue, y as SubgraphInfo } from "./__index.Bvdu5Kox.mjs";
1
+ import { A as C4ElementKind, C as ServerComponentFieldInput, D as C4DiagramType, E as C4DiagramData, F as C4RelDirection, I as C4RelStyle, L as C4Relationship, M as C4ElementStyle, N as C4LayoutConfig, O as C4Direction, P as C4NodeType, S as ServerComponentField, T as C4BoundaryKind, _ as SequenceParticipantLink, a as MermaidNode, b as SubgraphLayout, c as SequenceAutonumber, d as SequenceBlockType, f as SequenceBox, g as SequenceParticipant, h as SequenceNote, i as MermaidEdge, j as C4ElementShape, k as C4Element, l as SequenceBlock, m as SequenceMessage, n as RFComponentField, o as SequenceActivation, p as SequenceDiagramData, r as ReactFlowData, s as SequenceArrowHead, t as CustomData, u as SequenceBlockSection, v as SequenceParticipantType, w as C4Boundary, x as LinkOrFileValue, y as SubgraphInfo } from "./__index.BQQp_uAt.mjs";
2
2
  import { t as ComponentInputType } from "./__component-type.CO8FgnQE.mjs";
3
- import { t as contextSchema } from "./__headless.BLqB7VsJ.mjs";
3
+ import { t as contextSchema } from "./__headless.CnrU6aAA.mjs";
4
4
  import z$1, { z } from "zod";
5
5
  import { Edge, Node } from "@xyflow/react";
6
6
 
@@ -732,9 +732,101 @@ type Options = {
732
732
  };
733
733
  declare function syncBaseData(prev: ReactFlowData, next: ReactFlowData, options?: Options): ReactFlowData;
734
734
  //#endregion
735
+ //#region src/mermaid-converter/c4-parser.d.ts
736
+ declare function isC4Diagram(code: string): boolean;
737
+ declare function parseC4Diagram(code: string): C4DiagramData;
738
+ //#endregion
739
+ //#region src/mermaid-converter/c4-to-react-flow.d.ts
740
+ /** Mirrors mermaid's `c4` config block so imports land at a familiar scale. */
741
+ declare const C4_LAYOUT: {
742
+ WIDTH: number;
743
+ MIN_HEIGHT: number;
744
+ SHAPE_MARGIN: number;
745
+ ROW_MARGIN: number;
746
+ SHAPE_PADDING: number;
747
+ BOUNDARY_HEADER: number;
748
+ BOUNDARY_PADDING: number;
749
+ BOUNDARY_MARGIN: number;
750
+ DIAGRAM_MARGIN_X: number;
751
+ DIAGRAM_MARGIN_Y: number;
752
+ };
753
+ declare const C4_COLORS: {
754
+ person: {
755
+ fill: string;
756
+ stroke: string;
757
+ };
758
+ personExternal: {
759
+ fill: string;
760
+ stroke: string;
761
+ };
762
+ system: {
763
+ fill: string;
764
+ stroke: string;
765
+ };
766
+ systemExternal: {
767
+ fill: string;
768
+ stroke: string;
769
+ };
770
+ container: {
771
+ fill: string;
772
+ stroke: string;
773
+ };
774
+ containerExternal: {
775
+ fill: string;
776
+ stroke: string;
777
+ };
778
+ component: {
779
+ fill: string;
780
+ stroke: string;
781
+ };
782
+ componentExternal: {
783
+ fill: string;
784
+ stroke: string;
785
+ };
786
+ node: {
787
+ fill: string;
788
+ stroke: string;
789
+ };
790
+ nodeExternal: {
791
+ fill: string;
792
+ stroke: string;
793
+ };
794
+ };
795
+ declare function getC4ElementColors(element: C4Element): {
796
+ fill: string;
797
+ stroke: string;
798
+ } | {
799
+ fill: string;
800
+ stroke: string;
801
+ } | {
802
+ fill: string;
803
+ stroke: string;
804
+ } | {
805
+ fill: string;
806
+ stroke: string;
807
+ } | {
808
+ fill: string;
809
+ stroke: string;
810
+ } | {
811
+ fill: string;
812
+ stroke: string;
813
+ } | {
814
+ fill: string;
815
+ stroke: string;
816
+ } | {
817
+ fill: string;
818
+ stroke: string;
819
+ } | {
820
+ fill: string;
821
+ stroke: string;
822
+ } | {
823
+ fill: string;
824
+ stroke: string;
825
+ };
826
+ declare function convertC4ToReactFlow(data: C4DiagramData): ReactFlowData;
827
+ declare function convertC4MermaidToReactFlow(code: string): ReactFlowData;
828
+ //#endregion
735
829
  //#region src/mermaid-converter/constants/layout.d.ts
736
- /** Default lifeline/indicator color, shared with the canvas's own participants. */
737
- declare const SEQUENCE_PARTICIPANT_COLOR = "#E2E8F0";
738
830
  declare const SEQUENCE_LAYOUT: {
739
831
  readonly COLUMN_WIDTH: 360;
740
832
  readonly ROW_HEIGHT: 60;
@@ -767,6 +859,10 @@ declare function sanitizeMermaidLabels(src: string): string;
767
859
  //#region src/mermaid-converter/mermaid-to-react-flow.d.ts
768
860
  declare function convertMermaidToReactFlow(mermaidCode: string): Promise<ReactFlowData>;
769
861
  //#endregion
862
+ //#region src/mermaid-converter/react-flow-to-sequence.d.ts
863
+ declare function isSequenceDiagram(nodes: Node[]): boolean;
864
+ declare function convertReactFlowToSequenceMermaid(nodes: Node[], edges: Edge[]): string;
865
+ //#endregion
770
866
  //#region src/mermaid-converter/sequence-layout.d.ts
771
867
  /**
772
868
  * Sizes a sequence message box from its own label text, targeting a ~2-line
@@ -806,4 +902,4 @@ type UigOutput = {
806
902
  //#region src/uig-converter/index.d.ts
807
903
  declare function convertUiGraphToMermaid(input: UiGraphInput, options?: UiGraphOptions): UigOutput;
808
904
  //#endregion
809
- export { AstToSqlGenerator, AstToUiConverter, BasicDetailsSchema, CheckConstraintAST, ColumnAST, ComponentInputType, ConstraintAST, CustomData, DataTypeAST, DefaultValueAST, DialectIdSchema, DocumentCollectionSchema, DocumentIndexSchema, DynamoAttributeSchema, DynamoEditorSchema, DynamoGsiSchema, EditorSupportedDialectSchema, ForeignKeyConstraintAST, IndexAST, IndexColumnAST, IndexMethodAST, JsonEditorSchema, LinkOrFileValue, MermaidEdge, MermaidNode, MongoCollectionSchema, MongoEditorSchema, MongoIndexFieldSchema, MongoIndexSchema, MongoNestedFieldSchema, NestedFieldSchema, NoSqlFieldSchema, PrimaryKeyConstraintAST, RFComponentField, ReactFlowData, ReferentialActionAST, SEQUENCE_LAYOUT, SEQUENCE_PARTICIPANT_COLOR, SchemaAST, SchemaDialect, SchemaUIRepresentation, SequenceActivation, SequenceArrowHead, SequenceAutonumber, SequenceBlock, SequenceBlockSection, SequenceBlockType, SequenceBox, SequenceDiagramData, SequenceMessage, SequenceNote, SequenceParticipant, SequenceParticipantLink, SequenceParticipantType, ServerComponentField, ServerComponentFieldInput, SqlToAstParser, SubgraphInfo, SubgraphLayout, TParsedColumn, TParsedForeignKey, TParsedIndex, TParsedSchema, TParsedTable, TableAST, TableOptionsAST, UniqueConstraintAST, buildMetaData, contextSchema, convertDynamoSchemaToAst, convertJsonSchemaToAst, convertMermaidToReactFlow, convertMermaidToReactFlowWithContext, convertMongoSchemaToAst, convertNoSQLToAst, convertUiGraphToMermaid, estimateSequenceMessageBoxSize, flattenMetaData, generateTableNodeId, generateUUID, sanitizeMermaidLabels, syncBaseData };
905
+ export { AstToSqlGenerator, AstToUiConverter, BasicDetailsSchema, C4Boundary, C4BoundaryKind, C4DiagramData, C4DiagramType, C4Direction, C4Element, C4ElementKind, C4ElementShape, C4ElementStyle, C4LayoutConfig, C4NodeType, C4RelDirection, C4RelStyle, C4Relationship, C4_COLORS, C4_LAYOUT, CheckConstraintAST, ColumnAST, ComponentInputType, ConstraintAST, CustomData, DataTypeAST, DefaultValueAST, DialectIdSchema, DocumentCollectionSchema, DocumentIndexSchema, DynamoAttributeSchema, DynamoEditorSchema, DynamoGsiSchema, EditorSupportedDialectSchema, ForeignKeyConstraintAST, IndexAST, IndexColumnAST, IndexMethodAST, JsonEditorSchema, LinkOrFileValue, MermaidEdge, MermaidNode, MongoCollectionSchema, MongoEditorSchema, MongoIndexFieldSchema, MongoIndexSchema, MongoNestedFieldSchema, NestedFieldSchema, NoSqlFieldSchema, PrimaryKeyConstraintAST, RFComponentField, ReactFlowData, ReferentialActionAST, SEQUENCE_LAYOUT, SchemaAST, SchemaDialect, SchemaUIRepresentation, SequenceActivation, SequenceArrowHead, SequenceAutonumber, SequenceBlock, SequenceBlockSection, SequenceBlockType, SequenceBox, SequenceDiagramData, SequenceMessage, SequenceNote, SequenceParticipant, SequenceParticipantLink, SequenceParticipantType, ServerComponentField, ServerComponentFieldInput, SqlToAstParser, SubgraphInfo, SubgraphLayout, TParsedColumn, TParsedForeignKey, TParsedIndex, TParsedSchema, TParsedTable, TableAST, TableOptionsAST, UniqueConstraintAST, buildMetaData, contextSchema, convertC4MermaidToReactFlow, convertC4ToReactFlow, convertDynamoSchemaToAst, convertJsonSchemaToAst, convertMermaidToReactFlow, convertMermaidToReactFlowWithContext, convertMongoSchemaToAst, convertNoSQLToAst, convertReactFlowToSequenceMermaid, convertUiGraphToMermaid, estimateSequenceMessageBoxSize, flattenMetaData, generateTableNodeId, generateUUID, getC4ElementColors, isC4Diagram, isSequenceDiagram, parseC4Diagram, sanitizeMermaidLabels, syncBaseData };