File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ import { allowEdges as getAllowEdges } from './utils/connection';
52
52
import { exhaustiveCheck } from './utils/exhaustive-check' ;
53
53
import { calculateScopeBounds , LAYOUT_OPTIONS } from './utils/layout' ;
54
54
import { loadDiagramJson , loadEmpty , loadTemplate } from './utils/load-diagram' ;
55
+ import { exportTemplate } from './utils/export-diagram' ;
56
+ import { NodeManager } from './node-manager' ;
55
57
56
58
const NonCapturingPopoverContainer = ( {
57
59
children,
@@ -631,7 +633,17 @@ function DiagramEditor() {
631
633
color = "primary"
632
634
aria-label = "Save"
633
635
sx = { { position : 'absolute' , right : 64 , bottom : 64 } }
634
- onClick = { ( ) => updateEditorModeAction ( { mode : EditorMode . Normal } ) }
636
+ onClick = { ( ) => {
637
+ const exportedTemplate = exportTemplate (
638
+ new NodeManager ( nodes ) ,
639
+ edges ,
640
+ ) ;
641
+ setTemplates ( ( prev ) => ( {
642
+ ...prev ,
643
+ [ editorMode . templateId ] : exportedTemplate ,
644
+ } ) ) ;
645
+ updateEditorModeAction ( { mode : EditorMode . Normal } ) ;
646
+ } }
635
647
>
636
648
< MaterialSymbol symbol = "check" />
637
649
</ Fab >
You can’t perform that action at this time.
0 commit comments