()
| 637 | } |
| 638 | |
| 639 | function JSONCanvasShare() { |
| 640 | const title = useDocDetails("title", "flowchart.fun"); |
| 641 | |
| 642 | return ( |
| 643 | <div className="grid gap-2"> |
| 644 | <p className="leading-normal"> |
| 645 | <Trans> |
| 646 | JSON Canvas is a JSON representation of your diagram used by{" "} |
| 647 | <a |
| 648 | href="https://obsidian.md/" |
| 649 | target="_blank" |
| 650 | className="text-blue-500 dark:text-blue-300 font-bold" |
| 651 | > |
| 652 | Obsidian |
| 653 | </a>{" "} |
| 654 | Canvas and other applications. |
| 655 | </Trans> |
| 656 | </p> |
| 657 | <Button2 |
| 658 | color="blue" |
| 659 | data-session-activity="Download JSON Canvas" |
| 660 | onClick={() => { |
| 661 | if (!window.__cy) return; |
| 662 | const jsonCanvas = toJSONCanvas(window.__cy); |
| 663 | const blob = new Blob([JSON.stringify(jsonCanvas, null, 2)], { |
| 664 | type: "text/plain;charset=utf-8", |
| 665 | }); |
| 666 | saveAs(blob, `${slugify(title)}.canvas`); |
| 667 | }} |
| 668 | className="w-full text-left text-neutral-500 dark:text-neutral-400 p-2 rounded border border-neutral-300 dark:border-neutral-700" |
| 669 | aria-label="Copy JSON Canvas" |
| 670 | leftIcon={<DownloadSimple size={16} />} |
| 671 | > |
| 672 | Download JSON Canvas |
| 673 | </Button2> |
| 674 | </div> |
| 675 | ); |
| 676 | } |
nothing calls this directly
no test coverage detected