@almadar/ui 5.32.1 → 5.32.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +10 -3
- package/dist/avl/index.js +10 -3
- package/dist/components/core/atoms/Select.d.ts +8 -3
- package/dist/components/core/molecules/ActivationBlock.d.ts +22 -0
- package/dist/components/core/molecules/BloomQuizBlock.d.ts +25 -0
- package/dist/components/core/molecules/ConnectionBlock.d.ts +18 -0
- package/dist/components/core/molecules/ReflectionBlock.d.ts +23 -0
- package/dist/components/core/molecules/index.d.ts +6 -0
- package/dist/components/core/molecules/lessonSegmentUtils.d.ts +18 -0
- package/dist/components/core/molecules/parseLessonSegments.d.ts +43 -0
- package/dist/components/core/organisms/CodeRunnerPanel.d.ts +42 -0
- package/dist/components/core/organisms/SegmentRenderer.d.ts +38 -0
- package/dist/components/core/organisms/index.d.ts +2 -0
- package/dist/components/game/molecules/GameCanvas3D.d.ts +6 -5
- package/dist/components/game/molecules/three/hooks/useGameCanvas3DEvents.d.ts +9 -9
- package/dist/components/game/molecules/three/index.cjs +46 -11
- package/dist/components/game/molecules/three/index.js +46 -11
- package/dist/components/game/organisms/types/isometric.d.ts +2 -0
- package/dist/components/index.cjs +667 -7
- package/dist/components/index.js +666 -10
- package/dist/providers/index.cjs +10 -3
- package/dist/providers/index.js +10 -3
- package/dist/runtime/index.cjs +10 -3
- package/dist/runtime/index.js +10 -3
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import * as React74 from 'react';
|
|
3
|
-
import React74__default, { useContext, useMemo, useRef, useEffect, useCallback, useState, Suspense, lazy, createContext,
|
|
3
|
+
import React74__default, { useContext, useMemo, useRef, useEffect, useCallback, useState, useLayoutEffect, Suspense, lazy, createContext, useId, useSyncExternalStore } from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
|
|
7
7
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
8
8
|
import * as LucideIcons2 from 'lucide-react';
|
|
9
|
-
import { Loader2, X, List, Printer, ChevronRight, ChevronLeft, CheckCircle, XCircle, Wrench, RotateCcw, Send, Search, ChevronUp, ChevronDown, MoreHorizontal, Bug, Package, Calendar, Pencil, Eye, Image as Image$1, Upload, ZoomIn, ArrowRight, Pause, Play, SkipForward, TrendingUp, TrendingDown, Minus, AlertCircle, Circle, Clock, CheckCircle2,
|
|
9
|
+
import { Loader2, X, Code, FileText, WrapText, Check, Copy, HelpCircle, List, Printer, ChevronRight, ChevronLeft, CheckCircle, XCircle, Wrench, RotateCcw, Send, Lightbulb, PauseCircle, Link2, Search, ChevronUp, ChevronDown, MoreHorizontal, Bug, Package, Calendar, Pencil, Eye, Image as Image$1, Upload, ZoomIn, ArrowRight, Pause, Play, SkipForward, TrendingUp, TrendingDown, Minus, AlertCircle, Circle, Clock, CheckCircle2, Terminal, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, GitBranch, Plus, Trash, ArrowLeft, Menu as Menu$1, AlertTriangle, Trash2, Eraser, ZoomOut, Download, Tag, User, DollarSign, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
|
|
10
10
|
import * as PhosphorIcons from '@phosphor-icons/react';
|
|
11
11
|
import * as TablerIcons from '@tabler/icons-react';
|
|
12
12
|
import * as FaIcons from 'react-icons/fa';
|
|
@@ -2354,6 +2354,13 @@ var init_Textarea = __esm({
|
|
|
2354
2354
|
Textarea.displayName = "Textarea";
|
|
2355
2355
|
}
|
|
2356
2356
|
});
|
|
2357
|
+
function dispatchValueChange(onValueChange, eventBus, value) {
|
|
2358
|
+
if (typeof onValueChange === "string") {
|
|
2359
|
+
eventBus.emit(`UI:${onValueChange}`, { value });
|
|
2360
|
+
} else {
|
|
2361
|
+
onValueChange?.(value);
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2357
2364
|
function flatOptions(opts, groups) {
|
|
2358
2365
|
const flat = opts ?? [];
|
|
2359
2366
|
const grp = (groups ?? []).flatMap((g) => g.options);
|
|
@@ -2377,7 +2384,7 @@ function NativeSelect({
|
|
|
2377
2384
|
} else {
|
|
2378
2385
|
onChange?.(e);
|
|
2379
2386
|
}
|
|
2380
|
-
onValueChange
|
|
2387
|
+
dispatchValueChange(onValueChange, eventBus, e.target.value);
|
|
2381
2388
|
};
|
|
2382
2389
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
2383
2390
|
/* @__PURE__ */ jsxs(
|
|
@@ -2437,7 +2444,7 @@ function RichSelect({
|
|
|
2437
2444
|
if (typeof onChange === "string") {
|
|
2438
2445
|
eventBus.emit(`UI:${onChange}`, { value: next });
|
|
2439
2446
|
}
|
|
2440
|
-
onValueChange
|
|
2447
|
+
dispatchValueChange(onValueChange, eventBus, next);
|
|
2441
2448
|
};
|
|
2442
2449
|
const clear = (e) => {
|
|
2443
2450
|
e.stopPropagation();
|
|
@@ -2445,7 +2452,7 @@ function RichSelect({
|
|
|
2445
2452
|
if (typeof onChange === "string") {
|
|
2446
2453
|
eventBus.emit(`UI:${onChange}`, { value: next });
|
|
2447
2454
|
}
|
|
2448
|
-
onValueChange
|
|
2455
|
+
dispatchValueChange(onValueChange, eventBus, next);
|
|
2449
2456
|
};
|
|
2450
2457
|
useEffect(() => {
|
|
2451
2458
|
const handler = (e) => {
|
|
@@ -28764,7 +28771,7 @@ var init_MapView = __esm({
|
|
|
28764
28771
|
shadowSize: [41, 41]
|
|
28765
28772
|
});
|
|
28766
28773
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
28767
|
-
const { useEffect: useEffect72, useRef: useRef69, useCallback:
|
|
28774
|
+
const { useEffect: useEffect72, useRef: useRef69, useCallback: useCallback115, useState: useState105 } = React74__default;
|
|
28768
28775
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
28769
28776
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
28770
28777
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -28809,8 +28816,8 @@ var init_MapView = __esm({
|
|
|
28809
28816
|
showAttribution = true
|
|
28810
28817
|
}) {
|
|
28811
28818
|
const eventBus = useEventBus2();
|
|
28812
|
-
const [clickedPosition, setClickedPosition] =
|
|
28813
|
-
const handleMapClick =
|
|
28819
|
+
const [clickedPosition, setClickedPosition] = useState105(null);
|
|
28820
|
+
const handleMapClick = useCallback115((lat, lng) => {
|
|
28814
28821
|
if (showClickedPin) {
|
|
28815
28822
|
setClickedPosition({ lat, lng });
|
|
28816
28823
|
}
|
|
@@ -28819,7 +28826,7 @@ var init_MapView = __esm({
|
|
|
28819
28826
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
28820
28827
|
}
|
|
28821
28828
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
28822
|
-
const handleMarkerClick =
|
|
28829
|
+
const handleMarkerClick = useCallback115((marker) => {
|
|
28823
28830
|
onMarkerClick?.(marker);
|
|
28824
28831
|
if (markerClickEvent) {
|
|
28825
28832
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -37522,6 +37529,384 @@ var init_GraphCanvas = __esm({
|
|
|
37522
37529
|
GraphCanvas.displayName = "GraphCanvas";
|
|
37523
37530
|
}
|
|
37524
37531
|
});
|
|
37532
|
+
var ActivationBlock;
|
|
37533
|
+
var init_ActivationBlock = __esm({
|
|
37534
|
+
"components/core/molecules/ActivationBlock.tsx"() {
|
|
37535
|
+
"use client";
|
|
37536
|
+
init_useEventBus();
|
|
37537
|
+
init_cn();
|
|
37538
|
+
ActivationBlock = ({
|
|
37539
|
+
question,
|
|
37540
|
+
savedResponse,
|
|
37541
|
+
saveEvent = "SAVE_ACTIVATION",
|
|
37542
|
+
className
|
|
37543
|
+
}) => {
|
|
37544
|
+
const [response, setResponse] = useState(savedResponse ?? "");
|
|
37545
|
+
const [isExpanded, setIsExpanded] = useState(!savedResponse);
|
|
37546
|
+
const { emit } = useEventBus();
|
|
37547
|
+
const handleSubmit = () => {
|
|
37548
|
+
emit(`UI:${saveEvent}`, { response });
|
|
37549
|
+
setIsExpanded(false);
|
|
37550
|
+
};
|
|
37551
|
+
return /* @__PURE__ */ jsx(
|
|
37552
|
+
"div",
|
|
37553
|
+
{
|
|
37554
|
+
className: cn(
|
|
37555
|
+
"bg-indigo-50 dark:bg-indigo-900/20 border-2 border-indigo-200 dark:border-indigo-800 rounded-lg p-5 mb-6",
|
|
37556
|
+
className
|
|
37557
|
+
),
|
|
37558
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
37559
|
+
/* @__PURE__ */ jsx(Lightbulb, { className: "text-indigo-600 dark:text-indigo-400 flex-shrink-0 mt-1", size: 24 }),
|
|
37560
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
37561
|
+
/* @__PURE__ */ jsx("h4", { className: "font-semibold text-indigo-900 dark:text-indigo-100 mb-2", children: "Before You Begin..." }),
|
|
37562
|
+
/* @__PURE__ */ jsx("p", { className: "text-gray-700 dark:text-gray-300 mb-3 text-sm md:text-base", children: question }),
|
|
37563
|
+
isExpanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37564
|
+
/* @__PURE__ */ jsx(
|
|
37565
|
+
"textarea",
|
|
37566
|
+
{
|
|
37567
|
+
className: "w-full p-3 border border-indigo-300 dark:border-indigo-700 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-indigo-500 focus:border-transparent text-sm",
|
|
37568
|
+
placeholder: "Jot down your thoughts...",
|
|
37569
|
+
value: response,
|
|
37570
|
+
onChange: (e) => setResponse(e.target.value),
|
|
37571
|
+
rows: 3
|
|
37572
|
+
}
|
|
37573
|
+
),
|
|
37574
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-2 mt-3", children: [
|
|
37575
|
+
/* @__PURE__ */ jsx(
|
|
37576
|
+
"button",
|
|
37577
|
+
{
|
|
37578
|
+
onClick: handleSubmit,
|
|
37579
|
+
className: "px-4 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700 text-sm font-medium transition-colors",
|
|
37580
|
+
children: "Continue to Lesson \u2192"
|
|
37581
|
+
}
|
|
37582
|
+
),
|
|
37583
|
+
/* @__PURE__ */ jsx(
|
|
37584
|
+
"button",
|
|
37585
|
+
{
|
|
37586
|
+
onClick: () => {
|
|
37587
|
+
emit(`UI:${saveEvent}`, { response: "" });
|
|
37588
|
+
setIsExpanded(false);
|
|
37589
|
+
},
|
|
37590
|
+
className: "px-4 py-2 text-indigo-600 dark:text-indigo-400 hover:underline text-sm",
|
|
37591
|
+
children: "Skip for now"
|
|
37592
|
+
}
|
|
37593
|
+
)
|
|
37594
|
+
] })
|
|
37595
|
+
] }) : /* @__PURE__ */ jsx(
|
|
37596
|
+
"button",
|
|
37597
|
+
{
|
|
37598
|
+
onClick: () => setIsExpanded(true),
|
|
37599
|
+
className: "text-sm text-indigo-600 dark:text-indigo-400 hover:underline font-medium",
|
|
37600
|
+
children: "\u2713 Answered \xB7 Edit response"
|
|
37601
|
+
}
|
|
37602
|
+
)
|
|
37603
|
+
] })
|
|
37604
|
+
] })
|
|
37605
|
+
}
|
|
37606
|
+
);
|
|
37607
|
+
};
|
|
37608
|
+
ActivationBlock.displayName = "ActivationBlock";
|
|
37609
|
+
}
|
|
37610
|
+
});
|
|
37611
|
+
var ReflectionBlock;
|
|
37612
|
+
var init_ReflectionBlock = __esm({
|
|
37613
|
+
"components/core/molecules/ReflectionBlock.tsx"() {
|
|
37614
|
+
"use client";
|
|
37615
|
+
init_useEventBus();
|
|
37616
|
+
init_cn();
|
|
37617
|
+
ReflectionBlock = ({
|
|
37618
|
+
prompt,
|
|
37619
|
+
index,
|
|
37620
|
+
savedNote,
|
|
37621
|
+
saveEvent = "SAVE_REFLECTION",
|
|
37622
|
+
className
|
|
37623
|
+
}) => {
|
|
37624
|
+
const [note, setNote] = useState(savedNote ?? "");
|
|
37625
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
37626
|
+
const { emit } = useEventBus();
|
|
37627
|
+
const handleSave = () => {
|
|
37628
|
+
emit(`UI:${saveEvent}`, { index, note });
|
|
37629
|
+
setIsExpanded(false);
|
|
37630
|
+
};
|
|
37631
|
+
return /* @__PURE__ */ jsx(
|
|
37632
|
+
"div",
|
|
37633
|
+
{
|
|
37634
|
+
className: cn(
|
|
37635
|
+
"my-6 border-l-4 border-amber-400 bg-amber-50 dark:bg-amber-900/20 rounded-r-lg p-4",
|
|
37636
|
+
className
|
|
37637
|
+
),
|
|
37638
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
37639
|
+
/* @__PURE__ */ jsx(PauseCircle, { className: "text-amber-600 dark:text-amber-400 flex-shrink-0 mt-1", size: 20 }),
|
|
37640
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
37641
|
+
/* @__PURE__ */ jsx("div", { className: "font-medium text-amber-900 dark:text-amber-100 mb-2", children: "Pause & Reflect" }),
|
|
37642
|
+
/* @__PURE__ */ jsx("p", { className: "text-gray-700 dark:text-gray-300 text-sm mb-3", children: prompt }),
|
|
37643
|
+
isExpanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37644
|
+
/* @__PURE__ */ jsx(
|
|
37645
|
+
"textarea",
|
|
37646
|
+
{
|
|
37647
|
+
className: "w-full p-2 border border-amber-300 dark:border-amber-700 rounded text-sm bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-amber-500 focus:border-transparent",
|
|
37648
|
+
placeholder: "Your thoughts...",
|
|
37649
|
+
value: note,
|
|
37650
|
+
onChange: (e) => setNote(e.target.value),
|
|
37651
|
+
rows: 2
|
|
37652
|
+
}
|
|
37653
|
+
),
|
|
37654
|
+
/* @__PURE__ */ jsx(
|
|
37655
|
+
"button",
|
|
37656
|
+
{
|
|
37657
|
+
onClick: handleSave,
|
|
37658
|
+
className: "mt-2 text-sm px-3 py-1 bg-amber-600 text-white rounded hover:bg-amber-700 transition-colors",
|
|
37659
|
+
children: "Save & Continue"
|
|
37660
|
+
}
|
|
37661
|
+
)
|
|
37662
|
+
] }) : /* @__PURE__ */ jsx(
|
|
37663
|
+
"button",
|
|
37664
|
+
{
|
|
37665
|
+
onClick: () => setIsExpanded(true),
|
|
37666
|
+
className: "text-sm text-amber-600 dark:text-amber-400 hover:underline",
|
|
37667
|
+
children: savedNote ? "\u2713 Answered \xB7 Edit" : "Answer this question"
|
|
37668
|
+
}
|
|
37669
|
+
)
|
|
37670
|
+
] })
|
|
37671
|
+
] })
|
|
37672
|
+
}
|
|
37673
|
+
);
|
|
37674
|
+
};
|
|
37675
|
+
ReflectionBlock.displayName = "ReflectionBlock";
|
|
37676
|
+
}
|
|
37677
|
+
});
|
|
37678
|
+
var ConnectionBlock;
|
|
37679
|
+
var init_ConnectionBlock = __esm({
|
|
37680
|
+
"components/core/molecules/ConnectionBlock.tsx"() {
|
|
37681
|
+
"use client";
|
|
37682
|
+
init_MarkdownContent();
|
|
37683
|
+
init_cn();
|
|
37684
|
+
ConnectionBlock = ({ content, className }) => /* @__PURE__ */ jsx(
|
|
37685
|
+
"div",
|
|
37686
|
+
{
|
|
37687
|
+
className: cn(
|
|
37688
|
+
"bg-emerald-50 dark:bg-emerald-900/20 border-l-4 border-emerald-500 rounded-r-lg p-5 mb-6",
|
|
37689
|
+
className
|
|
37690
|
+
),
|
|
37691
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
37692
|
+
/* @__PURE__ */ jsx(Link2, { className: "text-emerald-600 dark:text-emerald-400 flex-shrink-0 mt-1", size: 20 }),
|
|
37693
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
37694
|
+
/* @__PURE__ */ jsx("h4", { className: "font-semibold text-emerald-900 dark:text-emerald-100 mb-2", children: "Building On What You Know" }),
|
|
37695
|
+
/* @__PURE__ */ jsx("div", { className: "prose dark:prose-invert prose-sm max-w-none text-gray-700 dark:text-gray-300", children: /* @__PURE__ */ jsx(MarkdownContent, { content }) })
|
|
37696
|
+
] })
|
|
37697
|
+
] })
|
|
37698
|
+
}
|
|
37699
|
+
);
|
|
37700
|
+
ConnectionBlock.displayName = "ConnectionBlock";
|
|
37701
|
+
}
|
|
37702
|
+
});
|
|
37703
|
+
|
|
37704
|
+
// components/core/molecules/lessonSegmentUtils.ts
|
|
37705
|
+
function parseMarkdownWithCodeBlocks2(content) {
|
|
37706
|
+
const segments = [];
|
|
37707
|
+
const codeBlockRegex = /```([\w-]+)?(?:\s+(run))?\n([\s\S]*?)```/g;
|
|
37708
|
+
let lastIndex = 0;
|
|
37709
|
+
let match;
|
|
37710
|
+
while ((match = codeBlockRegex.exec(content)) !== null) {
|
|
37711
|
+
const before = content.slice(lastIndex, match.index);
|
|
37712
|
+
if (before.trim()) {
|
|
37713
|
+
segments.push({ type: "markdown", content: before });
|
|
37714
|
+
}
|
|
37715
|
+
const rawLanguage = match[1] ?? "text";
|
|
37716
|
+
const runModifier = !!match[2];
|
|
37717
|
+
const suffixRunnable = rawLanguage.endsWith("-runnable");
|
|
37718
|
+
const runnable = runModifier || suffixRunnable;
|
|
37719
|
+
const baseLanguage = suffixRunnable ? rawLanguage.slice(0, -"-runnable".length) || "text" : rawLanguage;
|
|
37720
|
+
segments.push({ type: "code", language: baseLanguage, content: match[3].trim(), runnable });
|
|
37721
|
+
lastIndex = codeBlockRegex.lastIndex;
|
|
37722
|
+
}
|
|
37723
|
+
const remaining = content.slice(lastIndex);
|
|
37724
|
+
if (remaining.trim()) {
|
|
37725
|
+
segments.push({ type: "markdown", content: remaining });
|
|
37726
|
+
}
|
|
37727
|
+
return segments;
|
|
37728
|
+
}
|
|
37729
|
+
var init_lessonSegmentUtils = __esm({
|
|
37730
|
+
"components/core/molecules/lessonSegmentUtils.ts"() {
|
|
37731
|
+
}
|
|
37732
|
+
});
|
|
37733
|
+
var BLOOM_CONFIG, BloomQuizBlock;
|
|
37734
|
+
var init_BloomQuizBlock = __esm({
|
|
37735
|
+
"components/core/molecules/BloomQuizBlock.tsx"() {
|
|
37736
|
+
"use client";
|
|
37737
|
+
init_MarkdownContent();
|
|
37738
|
+
init_CodeBlock();
|
|
37739
|
+
init_lessonSegmentUtils();
|
|
37740
|
+
init_useEventBus();
|
|
37741
|
+
init_cn();
|
|
37742
|
+
BLOOM_CONFIG = {
|
|
37743
|
+
remember: { color: "bg-gray-500", bgColor: "bg-gray-50 dark:bg-gray-900/30", label: "Remember" },
|
|
37744
|
+
understand: { color: "bg-blue-500", bgColor: "bg-blue-50 dark:bg-blue-900/30", label: "Understand" },
|
|
37745
|
+
apply: { color: "bg-green-500", bgColor: "bg-green-50 dark:bg-green-900/30", label: "Apply" },
|
|
37746
|
+
analyze: { color: "bg-yellow-500", bgColor: "bg-yellow-50 dark:bg-yellow-900/30", label: "Analyze" },
|
|
37747
|
+
evaluate: { color: "bg-orange-500", bgColor: "bg-orange-50 dark:bg-orange-900/30", label: "Evaluate" },
|
|
37748
|
+
create: { color: "bg-purple-500", bgColor: "bg-purple-50 dark:bg-purple-900/30", label: "Create" }
|
|
37749
|
+
};
|
|
37750
|
+
BloomQuizBlock = ({
|
|
37751
|
+
level,
|
|
37752
|
+
question,
|
|
37753
|
+
answer,
|
|
37754
|
+
index,
|
|
37755
|
+
isAnswered,
|
|
37756
|
+
answerEvent = "ANSWER_BLOOM",
|
|
37757
|
+
className
|
|
37758
|
+
}) => {
|
|
37759
|
+
const [revealed, setRevealed] = useState(false);
|
|
37760
|
+
const config = BLOOM_CONFIG[level];
|
|
37761
|
+
const { emit } = useEventBus();
|
|
37762
|
+
const questionSegments = useMemo(() => parseMarkdownWithCodeBlocks2(question), [question]);
|
|
37763
|
+
const answerSegments = useMemo(() => parseMarkdownWithCodeBlocks2(answer), [answer]);
|
|
37764
|
+
const handleReveal = () => {
|
|
37765
|
+
if (!revealed) {
|
|
37766
|
+
emit(`UI:${answerEvent}`, { index: index ?? 0, level });
|
|
37767
|
+
}
|
|
37768
|
+
setRevealed(!revealed);
|
|
37769
|
+
};
|
|
37770
|
+
return /* @__PURE__ */ jsxs(
|
|
37771
|
+
"div",
|
|
37772
|
+
{
|
|
37773
|
+
className: cn(
|
|
37774
|
+
"rounded-lg border border-indigo-100 dark:border-indigo-800 p-4 my-4 transition-all",
|
|
37775
|
+
config.bgColor,
|
|
37776
|
+
className
|
|
37777
|
+
),
|
|
37778
|
+
children: [
|
|
37779
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-3", children: [
|
|
37780
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
37781
|
+
index !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-gray-500 dark:text-gray-400 font-medium text-sm", children: [
|
|
37782
|
+
"Question ",
|
|
37783
|
+
index + 1
|
|
37784
|
+
] }),
|
|
37785
|
+
/* @__PURE__ */ jsx("span", { className: cn(config.color, "text-white text-xs px-2 py-1 rounded-full font-medium"), children: config.label })
|
|
37786
|
+
] }),
|
|
37787
|
+
isAnswered && /* @__PURE__ */ jsx(CheckCircle, { className: "text-green-600 dark:text-green-400 flex-shrink-0", size: 20 })
|
|
37788
|
+
] }),
|
|
37789
|
+
/* @__PURE__ */ jsx("div", { className: "font-semibold text-indigo-900 dark:text-indigo-200 mb-3 space-y-2", children: questionSegments.map(
|
|
37790
|
+
(segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `q-md-${idx}`) : /* @__PURE__ */ jsx(
|
|
37791
|
+
CodeBlock,
|
|
37792
|
+
{
|
|
37793
|
+
language: segment.language ?? "text",
|
|
37794
|
+
code: segment.content
|
|
37795
|
+
},
|
|
37796
|
+
`q-code-${idx}`
|
|
37797
|
+
)
|
|
37798
|
+
) }),
|
|
37799
|
+
/* @__PURE__ */ jsx(
|
|
37800
|
+
"button",
|
|
37801
|
+
{
|
|
37802
|
+
type: "button",
|
|
37803
|
+
className: "inline-flex items-center rounded-md bg-indigo-600 dark:bg-indigo-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-indigo-700 dark:hover:bg-indigo-600 transition-colors",
|
|
37804
|
+
onClick: handleReveal,
|
|
37805
|
+
children: revealed ? "Hide Answer" : "Reveal Answer"
|
|
37806
|
+
}
|
|
37807
|
+
),
|
|
37808
|
+
revealed && /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-white/80 dark:bg-gray-800/80 p-3 text-sm text-slate-800 dark:text-gray-200 shadow-sm border border-indigo-100 dark:border-indigo-800 mt-3 space-y-2", children: [
|
|
37809
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs text-gray-600 dark:text-gray-400 mb-1 font-medium uppercase tracking-wide", children: "Answer:" }),
|
|
37810
|
+
answerSegments.map(
|
|
37811
|
+
(segment, idx) => segment.type === "markdown" ? /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `a-md-${idx}`) : /* @__PURE__ */ jsx(
|
|
37812
|
+
CodeBlock,
|
|
37813
|
+
{
|
|
37814
|
+
language: segment.language ?? "text",
|
|
37815
|
+
code: segment.content
|
|
37816
|
+
},
|
|
37817
|
+
`a-code-${idx}`
|
|
37818
|
+
)
|
|
37819
|
+
)
|
|
37820
|
+
] })
|
|
37821
|
+
]
|
|
37822
|
+
}
|
|
37823
|
+
);
|
|
37824
|
+
};
|
|
37825
|
+
BloomQuizBlock.displayName = "BloomQuizBlock";
|
|
37826
|
+
}
|
|
37827
|
+
});
|
|
37828
|
+
|
|
37829
|
+
// components/core/molecules/parseLessonSegments.ts
|
|
37830
|
+
function extractTagContent(content, tagName) {
|
|
37831
|
+
const closedTagRegex = new RegExp(`<${tagName}>([\\s\\S]*?)<\\/${tagName}>`, "i");
|
|
37832
|
+
const closedMatch = content.match(closedTagRegex);
|
|
37833
|
+
if (closedMatch) {
|
|
37834
|
+
return { content: closedMatch[1].trim(), fullMatch: closedMatch[0] };
|
|
37835
|
+
}
|
|
37836
|
+
const unclosedTagRegex = new RegExp(
|
|
37837
|
+
`<${tagName}>([\\s\\S]*?)(?=<(?:activate|connect|reflect|bloom|prq|question|answer|visualize)|\\n\\n#|$)`,
|
|
37838
|
+
"i"
|
|
37839
|
+
);
|
|
37840
|
+
const unclosedMatch = content.match(unclosedTagRegex);
|
|
37841
|
+
if (unclosedMatch) {
|
|
37842
|
+
return { content: unclosedMatch[1].trim(), fullMatch: unclosedMatch[0] };
|
|
37843
|
+
}
|
|
37844
|
+
return null;
|
|
37845
|
+
}
|
|
37846
|
+
function parseLessonSegments(lesson) {
|
|
37847
|
+
if (!lesson) return [];
|
|
37848
|
+
let content = lesson.replace(/<prq>[\s\S]*?<\/prq>/gi, "").trim();
|
|
37849
|
+
const segments = [];
|
|
37850
|
+
const activateResult = extractTagContent(content, "activate");
|
|
37851
|
+
if (activateResult) {
|
|
37852
|
+
segments.push({ type: "activate", question: activateResult.content });
|
|
37853
|
+
content = content.replace(activateResult.fullMatch, "").trim();
|
|
37854
|
+
}
|
|
37855
|
+
const connectResult = extractTagContent(content, "connect");
|
|
37856
|
+
if (connectResult) {
|
|
37857
|
+
segments.push({ type: "connect", content: connectResult.content });
|
|
37858
|
+
content = content.replace(connectResult.fullMatch, "").trim();
|
|
37859
|
+
}
|
|
37860
|
+
const tagRegex = new RegExp(
|
|
37861
|
+
'(?<reflect><reflect>(?<reflectClosed>[\\s\\S]*?)<\\/reflect>)|(?<reflectUnclosed><reflect>(?<reflectOpen>[\\s\\S]*?)(?=<(?:activate|connect|reflect|bloom|prq|question|answer|visualize)|\\n\\n#|$))|(?<bloom><bloom\\s+level="(?<bloomLevel>remember|understand|apply|analyze|evaluate|create)">(?<bloomClosed>[\\s\\S]*?)<\\/bloom>)|(?<bloomUnclosed><bloom\\s+level="(?<bloomLevelUn>remember|understand|apply|analyze|evaluate|create)">(?<bloomOpen>[\\s\\S]*?)(?=<(?:activate|connect|reflect|bloom|prq|question|answer|visualize)|\\n\\n#|$))|(?<quiz><question>(?<quizQuestion>[\\s\\S]*?)<\\/question>\\s*<answer>(?<quizAnswer>[\\s\\S]*?)<\\/answer>)|(?<visualize><visualize\\s+type="(?<vizType>chart|simulation)"\\s+description="(?<vizDesc>[^"]*?)"\\s*\\/?>)',
|
|
37862
|
+
"gi"
|
|
37863
|
+
);
|
|
37864
|
+
let lastIndex = 0;
|
|
37865
|
+
let match;
|
|
37866
|
+
while ((match = tagRegex.exec(content)) !== null) {
|
|
37867
|
+
const before = content.slice(lastIndex, match.index);
|
|
37868
|
+
if (before.trim()) {
|
|
37869
|
+
segments.push(...parseMarkdownWithCodeBlocks2(before));
|
|
37870
|
+
}
|
|
37871
|
+
const g = match.groups ?? {};
|
|
37872
|
+
if (g.reflect || g.reflectUnclosed) {
|
|
37873
|
+
const prompt = (g.reflectClosed ?? g.reflectOpen ?? "").trim();
|
|
37874
|
+
if (prompt) segments.push({ type: "reflect", prompt });
|
|
37875
|
+
} else if (g.bloom || g.bloomUnclosed) {
|
|
37876
|
+
const level = g.bloomLevel ?? g.bloomLevelUn;
|
|
37877
|
+
const bloomContent = g.bloomClosed ?? g.bloomOpen ?? "";
|
|
37878
|
+
if (level && bloomContent) {
|
|
37879
|
+
const qMatch = bloomContent.match(/<question>([\s\S]*?)<\/question>/i);
|
|
37880
|
+
const aMatch = bloomContent.match(/<answer>([\s\S]*?)<\/answer>/i);
|
|
37881
|
+
if (qMatch && aMatch) {
|
|
37882
|
+
segments.push({ type: "bloom", level, question: qMatch[1].trim(), answer: aMatch[1].trim() });
|
|
37883
|
+
} else if (qMatch) {
|
|
37884
|
+
segments.push({ type: "bloom", level, question: qMatch[1].trim(), answer: "(Answer not provided)" });
|
|
37885
|
+
} else {
|
|
37886
|
+
const clean = bloomContent.replace(/^\*\*Question\s*\d*:?\*\*\s*/i, "").replace(/^\*\*Q\d*:?\*\*\s*/i, "").trim();
|
|
37887
|
+
if (clean) segments.push({ type: "bloom", level, question: clean, answer: "(See answers section below)" });
|
|
37888
|
+
}
|
|
37889
|
+
}
|
|
37890
|
+
} else if (g.quiz) {
|
|
37891
|
+
segments.push({ type: "quiz", question: g.quizQuestion.trim(), answer: g.quizAnswer.trim() });
|
|
37892
|
+
} else if (g.visualize) {
|
|
37893
|
+
segments.push({
|
|
37894
|
+
type: "visualization",
|
|
37895
|
+
visualizationType: g.vizType,
|
|
37896
|
+
description: g.vizDesc ?? ""
|
|
37897
|
+
});
|
|
37898
|
+
}
|
|
37899
|
+
lastIndex = tagRegex.lastIndex;
|
|
37900
|
+
}
|
|
37901
|
+
const remaining = content.slice(lastIndex);
|
|
37902
|
+
if (remaining.trim()) segments.push(...parseMarkdownWithCodeBlocks2(remaining));
|
|
37903
|
+
return segments;
|
|
37904
|
+
}
|
|
37905
|
+
var init_parseLessonSegments = __esm({
|
|
37906
|
+
"components/core/molecules/parseLessonSegments.ts"() {
|
|
37907
|
+
init_lessonSegmentUtils();
|
|
37908
|
+
}
|
|
37909
|
+
});
|
|
37525
37910
|
|
|
37526
37911
|
// components/core/molecules/index.ts
|
|
37527
37912
|
var init_molecules2 = __esm({
|
|
@@ -37653,6 +38038,12 @@ var init_molecules2 = __esm({
|
|
|
37653
38038
|
init_SignaturePad();
|
|
37654
38039
|
init_DocumentViewer();
|
|
37655
38040
|
init_GraphCanvas();
|
|
38041
|
+
init_ActivationBlock();
|
|
38042
|
+
init_ReflectionBlock();
|
|
38043
|
+
init_ConnectionBlock();
|
|
38044
|
+
init_BloomQuizBlock();
|
|
38045
|
+
init_parseLessonSegments();
|
|
38046
|
+
init_lessonSegmentUtils();
|
|
37656
38047
|
}
|
|
37657
38048
|
});
|
|
37658
38049
|
|
|
@@ -50036,6 +50427,271 @@ init_ShowcaseOrganism();
|
|
|
50036
50427
|
init_TeamOrganism();
|
|
50037
50428
|
init_CaseStudyOrganism();
|
|
50038
50429
|
|
|
50430
|
+
// components/core/organisms/CodeRunnerPanel.tsx
|
|
50431
|
+
init_Box();
|
|
50432
|
+
init_Button();
|
|
50433
|
+
init_Badge();
|
|
50434
|
+
init_Typography();
|
|
50435
|
+
init_Stack();
|
|
50436
|
+
init_CodeBlock();
|
|
50437
|
+
init_useEventBus();
|
|
50438
|
+
init_cn();
|
|
50439
|
+
var CodeRunnerPanel = ({
|
|
50440
|
+
code: initialCode,
|
|
50441
|
+
language,
|
|
50442
|
+
runnable = true,
|
|
50443
|
+
onRun,
|
|
50444
|
+
runEvent = "RUN_CODE",
|
|
50445
|
+
className
|
|
50446
|
+
}) => {
|
|
50447
|
+
const eventBus = useEventBus();
|
|
50448
|
+
const { t } = useTranslate();
|
|
50449
|
+
const [code, setCode] = useState(initialCode);
|
|
50450
|
+
const [output, setOutput] = useState(null);
|
|
50451
|
+
const [error, setError] = useState(null);
|
|
50452
|
+
const [isRunning, setIsRunning] = useState(false);
|
|
50453
|
+
const handleRun = useCallback(async () => {
|
|
50454
|
+
if (!onRun) return;
|
|
50455
|
+
setIsRunning(true);
|
|
50456
|
+
setError(null);
|
|
50457
|
+
setOutput(null);
|
|
50458
|
+
try {
|
|
50459
|
+
const result = await onRun(code);
|
|
50460
|
+
setOutput(result);
|
|
50461
|
+
eventBus.emit(`UI:${runEvent}`, { language, exitCode: result.exitCode });
|
|
50462
|
+
} catch (err) {
|
|
50463
|
+
const message = err instanceof Error ? err.message : t("common.error");
|
|
50464
|
+
setError(message);
|
|
50465
|
+
eventBus.emit(`UI:${runEvent}`, { language, exitCode: 1, error: message });
|
|
50466
|
+
} finally {
|
|
50467
|
+
setIsRunning(false);
|
|
50468
|
+
}
|
|
50469
|
+
}, [code, language, onRun, runEvent, eventBus, t]);
|
|
50470
|
+
const handleReset = useCallback(() => {
|
|
50471
|
+
setCode(initialCode);
|
|
50472
|
+
setOutput(null);
|
|
50473
|
+
setError(null);
|
|
50474
|
+
}, [initialCode]);
|
|
50475
|
+
if (!runnable || !onRun) {
|
|
50476
|
+
return /* @__PURE__ */ jsx(Box, { className, children: /* @__PURE__ */ jsx(CodeBlock, { language, code }) });
|
|
50477
|
+
}
|
|
50478
|
+
const hasOutput = output !== null || error !== null;
|
|
50479
|
+
return /* @__PURE__ */ jsxs(Box, { className: cn("space-y-3", className), children: [
|
|
50480
|
+
/* @__PURE__ */ jsx(
|
|
50481
|
+
CodeBlock,
|
|
50482
|
+
{
|
|
50483
|
+
language,
|
|
50484
|
+
code,
|
|
50485
|
+
editable: true,
|
|
50486
|
+
onChange: setCode,
|
|
50487
|
+
showLanguageBadge: true,
|
|
50488
|
+
showCopyButton: true
|
|
50489
|
+
}
|
|
50490
|
+
),
|
|
50491
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "sm", justify: "between", children: [
|
|
50492
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "sm", children: [
|
|
50493
|
+
/* @__PURE__ */ jsx(
|
|
50494
|
+
Button,
|
|
50495
|
+
{
|
|
50496
|
+
variant: "primary",
|
|
50497
|
+
size: "sm",
|
|
50498
|
+
onClick: handleRun,
|
|
50499
|
+
disabled: isRunning,
|
|
50500
|
+
className: "min-w-[5rem]",
|
|
50501
|
+
children: isRunning ? /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
50502
|
+
/* @__PURE__ */ jsx(RotateCcw, { size: 16, className: "animate-spin" }),
|
|
50503
|
+
t("common.loading")
|
|
50504
|
+
] }) : /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
50505
|
+
/* @__PURE__ */ jsx(Play, { size: 16 }),
|
|
50506
|
+
"Run"
|
|
50507
|
+
] })
|
|
50508
|
+
}
|
|
50509
|
+
),
|
|
50510
|
+
/* @__PURE__ */ jsx(
|
|
50511
|
+
Button,
|
|
50512
|
+
{
|
|
50513
|
+
variant: "secondary",
|
|
50514
|
+
size: "sm",
|
|
50515
|
+
onClick: handleReset,
|
|
50516
|
+
disabled: isRunning,
|
|
50517
|
+
children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-2", children: [
|
|
50518
|
+
/* @__PURE__ */ jsx(RotateCcw, { size: 16 }),
|
|
50519
|
+
"Reset"
|
|
50520
|
+
] })
|
|
50521
|
+
}
|
|
50522
|
+
)
|
|
50523
|
+
] }),
|
|
50524
|
+
output && /* @__PURE__ */ jsxs(
|
|
50525
|
+
Badge,
|
|
50526
|
+
{
|
|
50527
|
+
variant: output.exitCode === 0 ? "success" : "danger",
|
|
50528
|
+
size: "sm",
|
|
50529
|
+
children: [
|
|
50530
|
+
"Exit ",
|
|
50531
|
+
output.exitCode
|
|
50532
|
+
]
|
|
50533
|
+
}
|
|
50534
|
+
)
|
|
50535
|
+
] }),
|
|
50536
|
+
hasOutput && /* @__PURE__ */ jsxs(Box, { className: "rounded-lg border border-gray-700 bg-[#0d0d0d] overflow-hidden", children: [
|
|
50537
|
+
/* @__PURE__ */ jsxs(
|
|
50538
|
+
HStack,
|
|
50539
|
+
{
|
|
50540
|
+
gap: "sm",
|
|
50541
|
+
align: "center",
|
|
50542
|
+
className: "px-3 py-2 bg-gray-800 border-b border-gray-700",
|
|
50543
|
+
children: [
|
|
50544
|
+
/* @__PURE__ */ jsx(Terminal, { size: 16, className: "text-gray-400" }),
|
|
50545
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-300 font-medium", children: "Output" })
|
|
50546
|
+
]
|
|
50547
|
+
}
|
|
50548
|
+
),
|
|
50549
|
+
/* @__PURE__ */ jsx(VStack, { gap: "none", className: "p-3 font-mono text-sm", children: error ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-400 whitespace-pre-wrap", children: error }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
50550
|
+
output?.stdout ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-200 whitespace-pre-wrap", children: output.stdout }) : null,
|
|
50551
|
+
output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-red-400 whitespace-pre-wrap", children: output.stderr }) : null,
|
|
50552
|
+
!output?.stdout && !output?.stderr ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-gray-500 italic", children: "No output" }) : null,
|
|
50553
|
+
output && output.testResults.length > 0 && /* @__PURE__ */ jsx(Box, { className: "mt-3 pt-3 border-t border-gray-700 space-y-2", children: output.testResults.map((test, index) => /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", className: "text-xs", children: [
|
|
50554
|
+
test.passed ? /* @__PURE__ */ jsx(CheckCircle, { size: 14, className: "text-green-400 mt-0.5" }) : /* @__PURE__ */ jsx(XCircle, { size: 14, className: "text-red-400 mt-0.5" }),
|
|
50555
|
+
/* @__PURE__ */ jsxs(VStack, { gap: "xs", className: "flex-1", children: [
|
|
50556
|
+
/* @__PURE__ */ jsxs(
|
|
50557
|
+
Typography,
|
|
50558
|
+
{
|
|
50559
|
+
variant: "small",
|
|
50560
|
+
className: test.passed ? "text-green-400" : "text-red-400",
|
|
50561
|
+
children: [
|
|
50562
|
+
"Test ",
|
|
50563
|
+
index + 1,
|
|
50564
|
+
": ",
|
|
50565
|
+
test.passed ? "passed" : "failed"
|
|
50566
|
+
]
|
|
50567
|
+
}
|
|
50568
|
+
),
|
|
50569
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
|
|
50570
|
+
"Input: ",
|
|
50571
|
+
test.input
|
|
50572
|
+
] }),
|
|
50573
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
|
|
50574
|
+
"Expected: ",
|
|
50575
|
+
test.expectedOutput
|
|
50576
|
+
] }),
|
|
50577
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-gray-400", children: [
|
|
50578
|
+
"Actual: ",
|
|
50579
|
+
test.actualOutput
|
|
50580
|
+
] })
|
|
50581
|
+
] })
|
|
50582
|
+
] }, index)) })
|
|
50583
|
+
] }) })
|
|
50584
|
+
] })
|
|
50585
|
+
] });
|
|
50586
|
+
};
|
|
50587
|
+
CodeRunnerPanel.displayName = "CodeRunnerPanel";
|
|
50588
|
+
|
|
50589
|
+
// components/core/organisms/SegmentRenderer.tsx
|
|
50590
|
+
init_MarkdownContent();
|
|
50591
|
+
init_CodeBlock();
|
|
50592
|
+
init_QuizBlock();
|
|
50593
|
+
init_ActivationBlock();
|
|
50594
|
+
init_ConnectionBlock();
|
|
50595
|
+
init_ReflectionBlock();
|
|
50596
|
+
init_BloomQuizBlock();
|
|
50597
|
+
init_cn();
|
|
50598
|
+
var SegmentRenderer = ({
|
|
50599
|
+
segments,
|
|
50600
|
+
className,
|
|
50601
|
+
containerClassName,
|
|
50602
|
+
userProgress,
|
|
50603
|
+
onRunCodeSimulation,
|
|
50604
|
+
onRenderVisualization
|
|
50605
|
+
}) => {
|
|
50606
|
+
if (segments.length === 0) return null;
|
|
50607
|
+
let reflectIndex = 0;
|
|
50608
|
+
let bloomIndex = 0;
|
|
50609
|
+
return /* @__PURE__ */ jsx(
|
|
50610
|
+
"div",
|
|
50611
|
+
{
|
|
50612
|
+
className: cn(
|
|
50613
|
+
"border border-gray-200 dark:border-gray-700 rounded-lg p-2 md:p-4 overflow-x-auto space-y-6",
|
|
50614
|
+
containerClassName,
|
|
50615
|
+
className
|
|
50616
|
+
),
|
|
50617
|
+
children: segments.map((segment, index) => {
|
|
50618
|
+
if (segment.type === "markdown") {
|
|
50619
|
+
return /* @__PURE__ */ jsx(MarkdownContent, { content: segment.content }, `md-${index}`);
|
|
50620
|
+
}
|
|
50621
|
+
if (segment.type === "code") {
|
|
50622
|
+
if (segment.runnable && onRunCodeSimulation) {
|
|
50623
|
+
return /* @__PURE__ */ jsx(
|
|
50624
|
+
CodeRunnerPanel,
|
|
50625
|
+
{
|
|
50626
|
+
language: segment.language,
|
|
50627
|
+
code: segment.content,
|
|
50628
|
+
runnable: true,
|
|
50629
|
+
onRun: (code) => onRunCodeSimulation(code, segment.language)
|
|
50630
|
+
},
|
|
50631
|
+
`code-${index}`
|
|
50632
|
+
);
|
|
50633
|
+
}
|
|
50634
|
+
return /* @__PURE__ */ jsx(
|
|
50635
|
+
CodeBlock,
|
|
50636
|
+
{
|
|
50637
|
+
language: segment.language ?? "text",
|
|
50638
|
+
code: segment.content
|
|
50639
|
+
},
|
|
50640
|
+
`code-${index}`
|
|
50641
|
+
);
|
|
50642
|
+
}
|
|
50643
|
+
if (segment.type === "quiz") {
|
|
50644
|
+
return /* @__PURE__ */ jsx(QuizBlock, { question: segment.question, answer: segment.answer }, `quiz-${index}`);
|
|
50645
|
+
}
|
|
50646
|
+
if (segment.type === "activate") {
|
|
50647
|
+
return /* @__PURE__ */ jsx(
|
|
50648
|
+
ActivationBlock,
|
|
50649
|
+
{
|
|
50650
|
+
question: segment.question,
|
|
50651
|
+
savedResponse: userProgress?.activationResponse
|
|
50652
|
+
},
|
|
50653
|
+
`activate-${index}`
|
|
50654
|
+
);
|
|
50655
|
+
}
|
|
50656
|
+
if (segment.type === "connect") {
|
|
50657
|
+
return /* @__PURE__ */ jsx(ConnectionBlock, { content: segment.content }, `connect-${index}`);
|
|
50658
|
+
}
|
|
50659
|
+
if (segment.type === "reflect") {
|
|
50660
|
+
const ri = reflectIndex++;
|
|
50661
|
+
return /* @__PURE__ */ jsx(
|
|
50662
|
+
ReflectionBlock,
|
|
50663
|
+
{
|
|
50664
|
+
prompt: segment.prompt,
|
|
50665
|
+
index: ri,
|
|
50666
|
+
savedNote: userProgress?.reflectionNotes?.[ri]
|
|
50667
|
+
},
|
|
50668
|
+
`reflect-${index}`
|
|
50669
|
+
);
|
|
50670
|
+
}
|
|
50671
|
+
if (segment.type === "bloom") {
|
|
50672
|
+
const bi = bloomIndex++;
|
|
50673
|
+
return /* @__PURE__ */ jsx(
|
|
50674
|
+
BloomQuizBlock,
|
|
50675
|
+
{
|
|
50676
|
+
level: segment.level,
|
|
50677
|
+
question: segment.question,
|
|
50678
|
+
answer: segment.answer,
|
|
50679
|
+
index: bi,
|
|
50680
|
+
isAnswered: userProgress?.bloomAnswered?.[bi]
|
|
50681
|
+
},
|
|
50682
|
+
`bloom-${index}`
|
|
50683
|
+
);
|
|
50684
|
+
}
|
|
50685
|
+
if (segment.type === "visualization") {
|
|
50686
|
+
return onRenderVisualization ? onRenderVisualization(segment.visualizationType, segment.description, index) ?? null : null;
|
|
50687
|
+
}
|
|
50688
|
+
return null;
|
|
50689
|
+
})
|
|
50690
|
+
}
|
|
50691
|
+
);
|
|
50692
|
+
};
|
|
50693
|
+
SegmentRenderer.displayName = "SegmentRenderer";
|
|
50694
|
+
|
|
50039
50695
|
// components/core/templates/index.ts
|
|
50040
50696
|
init_DashboardLayout();
|
|
50041
50697
|
init_AuthLayout();
|
|
@@ -50054,4 +50710,4 @@ init_AboutPageTemplate();
|
|
|
50054
50710
|
// components/index.ts
|
|
50055
50711
|
init_cn();
|
|
50056
50712
|
|
|
50057
|
-
export { ALL_PRESETS, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, ActionPalette, ActionTile, Alert, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AuthLayout, Avatar, Badge, BattleBoard, BattleTemplate, BehaviorView, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, BuilderBoard, Button, ButtonGroup, CTABanner, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, CastleBoard, CastleTemplate, Center, Chart, ChartLegend, Checkbox, ChoiceButton, ClassifierBoard, Coachmark, CodeBlock, CollapsibleSection, CombatLog, ComboCounter, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, Container, ContentRenderer, ContentSection, ControlButton, CounterTemplate, CraftingRecipe, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DIAMOND_TOP_Y, DPad, DamageNumber, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DebuggerBoard, DetailPanel, Dialog, DialogueBox, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, EventHandlerBoard, EventLog, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioContext, GameAudioProvider, GameAudioToggle, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GameShell, GameTemplate, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HealthPanel, HeroOrganism, HeroSection, IDENTITY_BOOK_FIELDS, Icon, IconPicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MatrixQuestion, MediaGallery, Menu, Meter, MiniMap, Modal, ModalSlot, ModuleCard, Navigation, NegotiatorBoard, NodeSlotEditor, NotifyListener, NumberStepper, ObjectRulePanel, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, Pagination, PatternTile, PhysicsManager, PlatformerCanvas, Popover, PositionedCanvas, PowerupSlots, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ReplyTree, ResourceBar, ResourceCounter, RichBlockEditor, RuleEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Section, SectionHeader, Select, SequenceBar, SequencerBoard, ServiceCatalog, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, SimulatorBoard, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateArchitectBoard, StateIndicator, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StatusEffect, StepFlow, StepFlowOrganism, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UncontrolledBattleBoard, UnitCommandBar, UploadDropZone, VStack, VariablePanel, VersionDiff, ViolationAlert, VoteStack, WaypointMarker, WizardContainer, WizardNavigation, WizardProgress, WorldMapBoard, WorldMapTemplate, XPBar, applyTemporaryEffect, calculateAttackTargets, calculateDamage, calculateValidMoves, cn, combatAnimations, combatClasses, combatEffects, createInitialGameState, createUnitAnimationState, drawSprite, generateCombatMessage, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, mapBookData, pendulum, projectileMotion, resolveFieldMap, resolveFrame, resolveSheetDirection, screenToIso, springOscillator, tickAnimationState, toCodeLanguage, transitionAnimation, useAnchorRect, useBattleState, useCamera, useGameAudio, useGameAudioContext, useImageCache, usePhysics2D, useSpriteAnimations };
|
|
50713
|
+
export { ALL_PRESETS, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, ActionPalette, ActionTile, ActivationBlock, Alert, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AuthLayout, Avatar, Badge, BattleBoard, BattleTemplate, BehaviorView, BloomQuizBlock, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, BuilderBoard, Button, ButtonGroup, CTABanner, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, CastleBoard, CastleTemplate, Center, Chart, ChartLegend, Checkbox, ChoiceButton, ClassifierBoard, Coachmark, CodeBlock, CodeRunnerPanel, CollapsibleSection, CombatLog, ComboCounter, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, ConnectionBlock, Container, ContentRenderer, ContentSection, ControlButton, CounterTemplate, CraftingRecipe, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DIAMOND_TOP_Y, DPad, DamageNumber, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DebuggerBoard, DetailPanel, Dialog, DialogueBox, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, EventHandlerBoard, EventLog, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioContext, GameAudioProvider, GameAudioToggle, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GameShell, GameTemplate, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HealthPanel, HeroOrganism, HeroSection, IDENTITY_BOOK_FIELDS, Icon, IconPicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MatrixQuestion, MediaGallery, Menu, Meter, MiniMap, Modal, ModalSlot, ModuleCard, Navigation, NegotiatorBoard, NodeSlotEditor, NotifyListener, NumberStepper, ObjectRulePanel, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, Pagination, PatternTile, PhysicsManager, PlatformerCanvas, Popover, PositionedCanvas, PowerupSlots, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuestTracker, QuizBlock, Radio, RangeSlider, ReflectionBlock, RelationSelect, RepeatableFormSection, ReplyTree, ResourceBar, ResourceCounter, RichBlockEditor, RuleEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Section, SectionHeader, SegmentRenderer, Select, SequenceBar, SequencerBoard, ServiceCatalog, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, SimulatorBoard, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateArchitectBoard, StateIndicator, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StatusEffect, StepFlow, StepFlowOrganism, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UncontrolledBattleBoard, UnitCommandBar, UploadDropZone, VStack, VariablePanel, VersionDiff, ViolationAlert, VoteStack, WaypointMarker, WizardContainer, WizardNavigation, WizardProgress, WorldMapBoard, WorldMapTemplate, XPBar, applyTemporaryEffect, calculateAttackTargets, calculateDamage, calculateValidMoves, cn, combatAnimations, combatClasses, combatEffects, createInitialGameState, createUnitAnimationState, drawSprite, generateCombatMessage, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, mapBookData, parseLessonSegments, parseMarkdownWithCodeBlocks2 as parseMarkdownWithCodeBlocks, pendulum, projectileMotion, resolveFieldMap, resolveFrame, resolveSheetDirection, screenToIso, springOscillator, tickAnimationState, toCodeLanguage, transitionAnimation, useAnchorRect, useBattleState, useCamera, useGameAudio, useGameAudioContext, useImageCache, usePhysics2D, useSpriteAnimations };
|