diff --git a/src/api/types.ts b/src/api/types.ts
index 682d4e4..5580e08 100644
--- a/src/api/types.ts
+++ b/src/api/types.ts
@@ -106,10 +106,19 @@ export interface LessonIntro {
kind: 'quiz' | 'video';
example: string;
steps: string[];
+ /** شکلهای ثابتِ درس (یک بار ساخته و تأییدشده؛ هیچ تولیدِ زندهای نیست). */
+ figures: LessonFigure[];
videoUrl: string;
durationMinutes: number | null;
}
+export interface LessonFigure {
+ where: 'intro' | 'example' | 'step';
+ /** فقط برای where='step'، از صفر. */
+ index?: number;
+ diagram: DiagramSpec;
+}
+
export interface QuestionOption {
id: string;
value: string;
diff --git a/src/screens/LessonScreen.tsx b/src/screens/LessonScreen.tsx
index 86e72a0..445bc97 100644
--- a/src/screens/LessonScreen.tsx
+++ b/src/screens/LessonScreen.tsx
@@ -9,6 +9,7 @@ import { moodFromServer } from '@/mascots/seyar';
import { ErrorState, LoadingState, PrimaryButton, Screen, ScreenBody, ScreenHeader, Sep } from '@/components/ui';
import { toFa } from '@/lib/format';
import { MathText } from '@/lib/MathText';
+import { Diagram } from '@/diagram';
/** معرفیِ درس، پیش از تمرین. */
export function LessonScreen({ lessonId, nodeId }: { lessonId: number; nodeId?: string }) {
@@ -18,6 +19,10 @@ export function LessonScreen({ lessonId, nodeId }: { lessonId: number; nodeId?:
const ref = findNode(home, nodeId) ?? findNodeOfLesson(home, lessonId);
const color = ref ? unitColor(ref.unitIndex) : '#ED6956';
const data = intro.data;
+ const figs = (where: 'intro' | 'example' | 'step', index?: number) =>
+ (data?.figures ?? [])
+ .filter((f) => f.where === where && (where !== 'step' || f.index === index))
+ .map((f, k) => );
return (
@@ -47,6 +52,7 @@ export function LessonScreen({ lessonId, nodeId }: { lessonId: number; nodeId?:
@@ -58,6 +64,7 @@ export function LessonScreen({ lessonId, nodeId }: { lessonId: number; nodeId?:
)}
@@ -70,7 +77,7 @@ export function LessonScreen({ lessonId, nodeId }: { lessonId: number; nodeId?:
{toFa(i + 1)}
-
+ {figs('step', i)}
))}