save preview command when saving graph
This commit is contained in:
		@ -1,5 +1,5 @@
 | 
				
			|||||||
<script>
 | 
					<script>
 | 
				
			||||||
  import { nodes, edges, auto, selectedFilter } from "./stores.js";
 | 
					  import { nodes, edges, auto, selectedFilter, previewCommand } from "./stores.js";
 | 
				
			||||||
  import {
 | 
					  import {
 | 
				
			||||||
    SvelteFlowProvider,
 | 
					    SvelteFlowProvider,
 | 
				
			||||||
    SvelteFlow,
 | 
					    SvelteFlow,
 | 
				
			||||||
@ -35,7 +35,11 @@
 | 
				
			|||||||
  function onKey(e) {
 | 
					  function onKey(e) {
 | 
				
			||||||
    if ((e.ctrlKey || e.metaKey) && e.key === "s") {
 | 
					    if ((e.ctrlKey || e.metaKey) && e.key === "s") {
 | 
				
			||||||
      e.preventDefault();
 | 
					      e.preventDefault();
 | 
				
			||||||
      const out = JSON.stringify({ nodes: $nodes, edges: $edges }, null, 2);
 | 
					      const out = JSON.stringify(
 | 
				
			||||||
 | 
					        { nodes: $nodes, edges: $edges, command: $previewCommand.join(" ") },
 | 
				
			||||||
 | 
					        null,
 | 
				
			||||||
 | 
					        2
 | 
				
			||||||
 | 
					      );
 | 
				
			||||||
      savedData = "data:text/json;charset=utf-8," + encodeURIComponent(out);
 | 
					      savedData = "data:text/json;charset=utf-8," + encodeURIComponent(out);
 | 
				
			||||||
      setTimeout(() => {
 | 
					      setTimeout(() => {
 | 
				
			||||||
        downloadLink.click();
 | 
					        downloadLink.click();
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user