@uigraph/sdk 1.2.13 → 1.2.14
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.cjs +3 -2
- package/dist/index.d.cts +7 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4248,7 +4248,7 @@ function createReactFlowElements(nodes, edges, subgraphs, subgraphLayouts, subgr
|
|
|
4248
4248
|
})
|
|
4249
4249
|
};
|
|
4250
4250
|
}
|
|
4251
|
-
function
|
|
4251
|
+
function layoutFlowchart(nodes, edges, subgraphs, direction) {
|
|
4252
4252
|
debugLog("Starting graph layout with direction:", direction);
|
|
4253
4253
|
debugLog(`Input: ${nodes.length} nodes, ${edges.length} edges, ${subgraphs.length} subgraphs`);
|
|
4254
4254
|
const subgraphLayouts = layoutSubgraphs(nodes, edges, subgraphs, direction);
|
|
@@ -4272,7 +4272,7 @@ function _convertFlowChartToReactFlow() {
|
|
|
4272
4272
|
};
|
|
4273
4273
|
}
|
|
4274
4274
|
debugLog(`Parsed ${nodes.length} nodes, ${edges.length} edges, ${subgraphs.length} subgraphs`);
|
|
4275
|
-
const graphedResult =
|
|
4275
|
+
const graphedResult = layoutFlowchart(nodes, edges, subgraphs, direction);
|
|
4276
4276
|
return {
|
|
4277
4277
|
nodes: graphedResult.nodes.map((node) => _objectSpread2(_objectSpread2({}, node), {}, { data: _objectSpread2(_objectSpread2({}, node.data), {}, { source: "mermaid" }) })),
|
|
4278
4278
|
edges: graphedResult.edges.map((edge) => _objectSpread2(_objectSpread2({}, edge), {}, { data: _objectSpread2(_objectSpread2({}, edge.data), {}, { source: "mermaid" }) }))
|
|
@@ -7577,6 +7577,7 @@ exports.isC4Diagram = isC4Diagram;
|
|
|
7577
7577
|
exports.isC4ReactFlowDiagram = isC4ReactFlowDiagram;
|
|
7578
7578
|
exports.isGeometryEditableNodeType = isGeometryEditableNodeType;
|
|
7579
7579
|
exports.isSequenceDiagram = isSequenceDiagram;
|
|
7580
|
+
exports.layoutFlowchart = layoutFlowchart;
|
|
7580
7581
|
exports.parseC4Diagram = parseC4Diagram;
|
|
7581
7582
|
exports.sanitizeMermaidLabels = sanitizeMermaidLabels;
|
|
7582
7583
|
exports.syncBaseData = syncBaseData;
|
package/dist/index.d.cts
CHANGED
|
@@ -880,6 +880,12 @@ declare const SEQUENCE_LAYOUT: {
|
|
|
880
880
|
readonly BOX_BOTTOM_PADDING: 24;
|
|
881
881
|
};
|
|
882
882
|
//#endregion
|
|
883
|
+
//#region src/mermaid-converter/flow-chart/to-react-flow.d.ts
|
|
884
|
+
declare function layoutFlowchart(nodes: MermaidNode[], edges: MermaidEdge[], subgraphs: SubgraphInfo[], direction: string): {
|
|
885
|
+
nodes: Node[];
|
|
886
|
+
edges: Edge[];
|
|
887
|
+
};
|
|
888
|
+
//#endregion
|
|
883
889
|
//#region src/mermaid-converter/mermaid-sanitizer.d.ts
|
|
884
890
|
declare function sanitizeMermaidLabels(src: string): string;
|
|
885
891
|
//#endregion
|
|
@@ -1005,4 +1011,4 @@ declare function getTheme(themeId: string | undefined): ThemeSpec;
|
|
|
1005
1011
|
* style request to the closest theme instead of inventing colors. */
|
|
1006
1012
|
declare function buildThemeCatalogPromptContext(): string;
|
|
1007
1013
|
//#endregion
|
|
1008
|
-
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, DEFAULT_THEME_ID, DataTypeAST, DefaultValueAST, type DiagramTypeId, DialectIdSchema, DocumentCollectionSchema, DocumentIndexSchema, DynamoAttributeSchema, DynamoEditorSchema, DynamoGsiSchema, EditorSupportedDialectSchema, ForeignKeyConstraintAST, IndexAST, IndexColumnAST, IndexMethodAST, JsonEditorSchema, LinkOrFileValue, MermaidEdge, MermaidNode, MongoCollectionSchema, MongoEditorSchema, MongoIndexFieldSchema, MongoIndexSchema, MongoNestedFieldSchema, NODE_TYPE_REGISTRY, NestedFieldSchema, NoSqlFieldSchema, type NodeStylePatchInput, type NodeTypeSpec, PrimaryKeyConstraintAST, RFComponentField, ReactFlowData, ReferentialActionAST, SEQUENCE_LAYOUT, SHAPE_IDS, STROKE_STYLES, SchemaAST, SchemaDialect, SchemaUIRepresentation, SequenceActivation, SequenceArrowHead, SequenceAutonumber, SequenceBlock, SequenceBlockSection, SequenceBlockType, SequenceBox, SequenceDiagramData, SequenceMessage, SequenceNote, SequenceParticipant, SequenceParticipantLink, SequenceParticipantType, ServerComponentField, ServerComponentFieldInput, type ShapeId, SqlToAstParser, type StrokeStyleId, SubgraphInfo, SubgraphLayout, THEME_REGISTRY, THEME_ROLES, TParsedColumn, TParsedForeignKey, TParsedIndex, TParsedSchema, TParsedTable, TableAST, TableOptionsAST, type ThemeColorPair, type ThemeRole, type ThemeSpec, UniqueConstraintAST, buildMetaData, buildNodeStyleDataPatch, buildThemeCatalogPromptContext, computeDiagramSyncHash, contextSchema, convertC4MermaidToReactFlow, convertC4ToReactFlow, convertDynamoSchemaToAst, convertJsonSchemaToAst, convertMermaidToReactFlow, convertMermaidToReactFlowWithContext, convertMongoSchemaToAst, convertNoSQLToAst, convertReactFlowToC4Mermaid, convertReactFlowToC4UiGraph, convertReactFlowToSequenceMermaid, convertReactFlowToSequenceUiGraph, convertUiGraphToMermaid, estimateSequenceMessageBoxSize, flattenMetaData, generateTableNodeId, generateUUID, getC4ElementColors, getNodeTypeSpec, getTheme, isC4Diagram, isC4ReactFlowDiagram, isGeometryEditableNodeType, isSequenceDiagram, parseC4Diagram, sanitizeMermaidLabels, syncBaseData };
|
|
1014
|
+
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, DEFAULT_THEME_ID, DataTypeAST, DefaultValueAST, type DiagramTypeId, DialectIdSchema, DocumentCollectionSchema, DocumentIndexSchema, DynamoAttributeSchema, DynamoEditorSchema, DynamoGsiSchema, EditorSupportedDialectSchema, ForeignKeyConstraintAST, IndexAST, IndexColumnAST, IndexMethodAST, JsonEditorSchema, LinkOrFileValue, MermaidEdge, MermaidNode, MongoCollectionSchema, MongoEditorSchema, MongoIndexFieldSchema, MongoIndexSchema, MongoNestedFieldSchema, NODE_TYPE_REGISTRY, NestedFieldSchema, NoSqlFieldSchema, type NodeStylePatchInput, type NodeTypeSpec, PrimaryKeyConstraintAST, RFComponentField, ReactFlowData, ReferentialActionAST, SEQUENCE_LAYOUT, SHAPE_IDS, STROKE_STYLES, SchemaAST, SchemaDialect, SchemaUIRepresentation, SequenceActivation, SequenceArrowHead, SequenceAutonumber, SequenceBlock, SequenceBlockSection, SequenceBlockType, SequenceBox, SequenceDiagramData, SequenceMessage, SequenceNote, SequenceParticipant, SequenceParticipantLink, SequenceParticipantType, ServerComponentField, ServerComponentFieldInput, type ShapeId, SqlToAstParser, type StrokeStyleId, SubgraphInfo, SubgraphLayout, THEME_REGISTRY, THEME_ROLES, TParsedColumn, TParsedForeignKey, TParsedIndex, TParsedSchema, TParsedTable, TableAST, TableOptionsAST, type ThemeColorPair, type ThemeRole, type ThemeSpec, UniqueConstraintAST, buildMetaData, buildNodeStyleDataPatch, buildThemeCatalogPromptContext, computeDiagramSyncHash, contextSchema, convertC4MermaidToReactFlow, convertC4ToReactFlow, convertDynamoSchemaToAst, convertJsonSchemaToAst, convertMermaidToReactFlow, convertMermaidToReactFlowWithContext, convertMongoSchemaToAst, convertNoSQLToAst, convertReactFlowToC4Mermaid, convertReactFlowToC4UiGraph, convertReactFlowToSequenceMermaid, convertReactFlowToSequenceUiGraph, convertUiGraphToMermaid, estimateSequenceMessageBoxSize, flattenMetaData, generateTableNodeId, generateUUID, getC4ElementColors, getNodeTypeSpec, getTheme, isC4Diagram, isC4ReactFlowDiagram, isGeometryEditableNodeType, isSequenceDiagram, layoutFlowchart, parseC4Diagram, sanitizeMermaidLabels, syncBaseData };
|
package/dist/index.d.mts
CHANGED
|
@@ -880,6 +880,12 @@ declare const SEQUENCE_LAYOUT: {
|
|
|
880
880
|
readonly BOX_BOTTOM_PADDING: 24;
|
|
881
881
|
};
|
|
882
882
|
//#endregion
|
|
883
|
+
//#region src/mermaid-converter/flow-chart/to-react-flow.d.ts
|
|
884
|
+
declare function layoutFlowchart(nodes: MermaidNode[], edges: MermaidEdge[], subgraphs: SubgraphInfo[], direction: string): {
|
|
885
|
+
nodes: Node[];
|
|
886
|
+
edges: Edge[];
|
|
887
|
+
};
|
|
888
|
+
//#endregion
|
|
883
889
|
//#region src/mermaid-converter/mermaid-sanitizer.d.ts
|
|
884
890
|
declare function sanitizeMermaidLabels(src: string): string;
|
|
885
891
|
//#endregion
|
|
@@ -1005,4 +1011,4 @@ declare function getTheme(themeId: string | undefined): ThemeSpec;
|
|
|
1005
1011
|
* style request to the closest theme instead of inventing colors. */
|
|
1006
1012
|
declare function buildThemeCatalogPromptContext(): string;
|
|
1007
1013
|
//#endregion
|
|
1008
|
-
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, DEFAULT_THEME_ID, DataTypeAST, DefaultValueAST, type DiagramTypeId, DialectIdSchema, DocumentCollectionSchema, DocumentIndexSchema, DynamoAttributeSchema, DynamoEditorSchema, DynamoGsiSchema, EditorSupportedDialectSchema, ForeignKeyConstraintAST, IndexAST, IndexColumnAST, IndexMethodAST, JsonEditorSchema, LinkOrFileValue, MermaidEdge, MermaidNode, MongoCollectionSchema, MongoEditorSchema, MongoIndexFieldSchema, MongoIndexSchema, MongoNestedFieldSchema, NODE_TYPE_REGISTRY, NestedFieldSchema, NoSqlFieldSchema, type NodeStylePatchInput, type NodeTypeSpec, PrimaryKeyConstraintAST, RFComponentField, ReactFlowData, ReferentialActionAST, SEQUENCE_LAYOUT, SHAPE_IDS, STROKE_STYLES, SchemaAST, SchemaDialect, SchemaUIRepresentation, SequenceActivation, SequenceArrowHead, SequenceAutonumber, SequenceBlock, SequenceBlockSection, SequenceBlockType, SequenceBox, SequenceDiagramData, SequenceMessage, SequenceNote, SequenceParticipant, SequenceParticipantLink, SequenceParticipantType, ServerComponentField, ServerComponentFieldInput, type ShapeId, SqlToAstParser, type StrokeStyleId, SubgraphInfo, SubgraphLayout, THEME_REGISTRY, THEME_ROLES, TParsedColumn, TParsedForeignKey, TParsedIndex, TParsedSchema, TParsedTable, TableAST, TableOptionsAST, type ThemeColorPair, type ThemeRole, type ThemeSpec, UniqueConstraintAST, buildMetaData, buildNodeStyleDataPatch, buildThemeCatalogPromptContext, computeDiagramSyncHash, contextSchema, convertC4MermaidToReactFlow, convertC4ToReactFlow, convertDynamoSchemaToAst, convertJsonSchemaToAst, convertMermaidToReactFlow, convertMermaidToReactFlowWithContext, convertMongoSchemaToAst, convertNoSQLToAst, convertReactFlowToC4Mermaid, convertReactFlowToC4UiGraph, convertReactFlowToSequenceMermaid, convertReactFlowToSequenceUiGraph, convertUiGraphToMermaid, estimateSequenceMessageBoxSize, flattenMetaData, generateTableNodeId, generateUUID, getC4ElementColors, getNodeTypeSpec, getTheme, isC4Diagram, isC4ReactFlowDiagram, isGeometryEditableNodeType, isSequenceDiagram, parseC4Diagram, sanitizeMermaidLabels, syncBaseData };
|
|
1014
|
+
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, DEFAULT_THEME_ID, DataTypeAST, DefaultValueAST, type DiagramTypeId, DialectIdSchema, DocumentCollectionSchema, DocumentIndexSchema, DynamoAttributeSchema, DynamoEditorSchema, DynamoGsiSchema, EditorSupportedDialectSchema, ForeignKeyConstraintAST, IndexAST, IndexColumnAST, IndexMethodAST, JsonEditorSchema, LinkOrFileValue, MermaidEdge, MermaidNode, MongoCollectionSchema, MongoEditorSchema, MongoIndexFieldSchema, MongoIndexSchema, MongoNestedFieldSchema, NODE_TYPE_REGISTRY, NestedFieldSchema, NoSqlFieldSchema, type NodeStylePatchInput, type NodeTypeSpec, PrimaryKeyConstraintAST, RFComponentField, ReactFlowData, ReferentialActionAST, SEQUENCE_LAYOUT, SHAPE_IDS, STROKE_STYLES, SchemaAST, SchemaDialect, SchemaUIRepresentation, SequenceActivation, SequenceArrowHead, SequenceAutonumber, SequenceBlock, SequenceBlockSection, SequenceBlockType, SequenceBox, SequenceDiagramData, SequenceMessage, SequenceNote, SequenceParticipant, SequenceParticipantLink, SequenceParticipantType, ServerComponentField, ServerComponentFieldInput, type ShapeId, SqlToAstParser, type StrokeStyleId, SubgraphInfo, SubgraphLayout, THEME_REGISTRY, THEME_ROLES, TParsedColumn, TParsedForeignKey, TParsedIndex, TParsedSchema, TParsedTable, TableAST, TableOptionsAST, type ThemeColorPair, type ThemeRole, type ThemeSpec, UniqueConstraintAST, buildMetaData, buildNodeStyleDataPatch, buildThemeCatalogPromptContext, computeDiagramSyncHash, contextSchema, convertC4MermaidToReactFlow, convertC4ToReactFlow, convertDynamoSchemaToAst, convertJsonSchemaToAst, convertMermaidToReactFlow, convertMermaidToReactFlowWithContext, convertMongoSchemaToAst, convertNoSQLToAst, convertReactFlowToC4Mermaid, convertReactFlowToC4UiGraph, convertReactFlowToSequenceMermaid, convertReactFlowToSequenceUiGraph, convertUiGraphToMermaid, estimateSequenceMessageBoxSize, flattenMetaData, generateTableNodeId, generateUUID, getC4ElementColors, getNodeTypeSpec, getTheme, isC4Diagram, isC4ReactFlowDiagram, isGeometryEditableNodeType, isSequenceDiagram, layoutFlowchart, parseC4Diagram, sanitizeMermaidLabels, syncBaseData };
|
package/dist/index.mjs
CHANGED
|
@@ -4241,7 +4241,7 @@ function createReactFlowElements(nodes, edges, subgraphs, subgraphLayouts, subgr
|
|
|
4241
4241
|
})
|
|
4242
4242
|
};
|
|
4243
4243
|
}
|
|
4244
|
-
function
|
|
4244
|
+
function layoutFlowchart(nodes, edges, subgraphs, direction) {
|
|
4245
4245
|
debugLog("Starting graph layout with direction:", direction);
|
|
4246
4246
|
debugLog(`Input: ${nodes.length} nodes, ${edges.length} edges, ${subgraphs.length} subgraphs`);
|
|
4247
4247
|
const subgraphLayouts = layoutSubgraphs(nodes, edges, subgraphs, direction);
|
|
@@ -4265,7 +4265,7 @@ function _convertFlowChartToReactFlow() {
|
|
|
4265
4265
|
};
|
|
4266
4266
|
}
|
|
4267
4267
|
debugLog(`Parsed ${nodes.length} nodes, ${edges.length} edges, ${subgraphs.length} subgraphs`);
|
|
4268
|
-
const graphedResult =
|
|
4268
|
+
const graphedResult = layoutFlowchart(nodes, edges, subgraphs, direction);
|
|
4269
4269
|
return {
|
|
4270
4270
|
nodes: graphedResult.nodes.map((node) => _objectSpread2(_objectSpread2({}, node), {}, { data: _objectSpread2(_objectSpread2({}, node.data), {}, { source: "mermaid" }) })),
|
|
4271
4271
|
edges: graphedResult.edges.map((edge) => _objectSpread2(_objectSpread2({}, edge), {}, { data: _objectSpread2(_objectSpread2({}, edge.data), {}, { source: "mermaid" }) }))
|
|
@@ -7512,4 +7512,4 @@ function getTheme(themeId) {
|
|
|
7512
7512
|
function buildThemeCatalogPromptContext() {
|
|
7513
7513
|
return Object.values(THEME_REGISTRY).map((t) => `- "${t.id}" (${t.mode}): ${t.description}. Matches requests like: ${t.promptHint}.`).join("\n");
|
|
7514
7514
|
}
|
|
7515
|
-
export { AstToSqlGenerator, AstToUiConverter, BasicDetailsSchema, C4_COLORS, C4_LAYOUT, ComponentInputType, DEFAULT_THEME_ID, DialectIdSchema, DocumentCollectionSchema, DocumentIndexSchema, DynamoAttributeSchema, DynamoEditorSchema, DynamoGsiSchema, EditorSupportedDialectSchema, JsonEditorSchema, MongoCollectionSchema, MongoEditorSchema, MongoIndexFieldSchema, MongoIndexSchema, MongoNestedFieldSchema, NODE_TYPE_REGISTRY, NestedFieldSchema, NoSqlFieldSchema, SEQUENCE_LAYOUT, SHAPE_IDS, STROKE_STYLES, SqlToAstParser, THEME_REGISTRY, THEME_ROLES, buildMetaData, buildNodeStyleDataPatch, buildThemeCatalogPromptContext, computeDiagramSyncHash, contextSchema, convertC4MermaidToReactFlow, convertC4ToReactFlow, convertDynamoSchemaToAst, convertJsonSchemaToAst, convertMermaidToReactFlow, convertMermaidToReactFlowWithContext, convertMongoSchemaToAst, convertNoSQLToAst, convertReactFlowToC4Mermaid, convertReactFlowToC4UiGraph, convertReactFlowToSequenceMermaid, convertReactFlowToSequenceUiGraph, convertUiGraphToMermaid, estimateSequenceMessageBoxSize, flattenMetaData, generateTableNodeId, generateUUID, getC4ElementColors, getNodeTypeSpec, getTheme, isC4Diagram, isC4ReactFlowDiagram, isGeometryEditableNodeType, isSequenceDiagram, parseC4Diagram, sanitizeMermaidLabels, syncBaseData };
|
|
7515
|
+
export { AstToSqlGenerator, AstToUiConverter, BasicDetailsSchema, C4_COLORS, C4_LAYOUT, ComponentInputType, DEFAULT_THEME_ID, DialectIdSchema, DocumentCollectionSchema, DocumentIndexSchema, DynamoAttributeSchema, DynamoEditorSchema, DynamoGsiSchema, EditorSupportedDialectSchema, JsonEditorSchema, MongoCollectionSchema, MongoEditorSchema, MongoIndexFieldSchema, MongoIndexSchema, MongoNestedFieldSchema, NODE_TYPE_REGISTRY, NestedFieldSchema, NoSqlFieldSchema, SEQUENCE_LAYOUT, SHAPE_IDS, STROKE_STYLES, SqlToAstParser, THEME_REGISTRY, THEME_ROLES, buildMetaData, buildNodeStyleDataPatch, buildThemeCatalogPromptContext, computeDiagramSyncHash, contextSchema, convertC4MermaidToReactFlow, convertC4ToReactFlow, convertDynamoSchemaToAst, convertJsonSchemaToAst, convertMermaidToReactFlow, convertMermaidToReactFlowWithContext, convertMongoSchemaToAst, convertNoSQLToAst, convertReactFlowToC4Mermaid, convertReactFlowToC4UiGraph, convertReactFlowToSequenceMermaid, convertReactFlowToSequenceUiGraph, convertUiGraphToMermaid, estimateSequenceMessageBoxSize, flattenMetaData, generateTableNodeId, generateUUID, getC4ElementColors, getNodeTypeSpec, getTheme, isC4Diagram, isC4ReactFlowDiagram, isGeometryEditableNodeType, isSequenceDiagram, layoutFlowchart, parseC4Diagram, sanitizeMermaidLabels, syncBaseData };
|