From c103bc02ad73bade9aebdeb46062feeb8b7a54c1 Mon Sep 17 00:00:00 2001 From: a2nr Date: Sat, 2 May 2026 19:45:04 +0700 Subject: [PATCH] feat(flowchart): support interactive embedding in markdown with readonly mode and frontend evaluation --- flowchart/src/App.svelte | 9 +++ flowchart/src/lib/flowchartState.svelte.ts | 1 + .../src/lib/actions/renderFlowchartEmbeds.ts | 71 +++++++++++++++++++ .../src/routes/lesson/[slug]/+page.svelte | 3 + services/lesson_service.py | 41 ++++++++++- 5 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 frontend/src/lib/actions/renderFlowchartEmbeds.ts diff --git a/flowchart/src/App.svelte b/flowchart/src/App.svelte index 2975af8..69cd77c 100644 --- a/flowchart/src/App.svelte +++ b/flowchart/src/App.svelte @@ -18,6 +18,9 @@ if (params.get('iframe') === 'true') { fcState.isIframeMode = true; } + if (params.get('readonly') === 'true') { + fcState.isReadonly = true; + } // Listen to messages from parent window window.addEventListener('message', (event) => { @@ -72,9 +75,14 @@
+ {#if !fcState.isReadonly} + {/if} + + + {#if !fcState.isReadonly}
@@ -89,6 +97,7 @@
+ {/if}