@almadar/ui 5.32.2 → 5.33.0
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/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/index.cjs +657 -4
- package/dist/components/index.js +656 -7
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ActivationBlock Molecule Component
|
|
3
|
+
*
|
|
4
|
+
* Pre-lesson activation prompt. Invites learners to surface prior knowledge
|
|
5
|
+
* before content begins. Emits `UI:SAVE_ACTIVATION { response }`.
|
|
6
|
+
*
|
|
7
|
+
* Event Contract:
|
|
8
|
+
* - Emits: UI:SAVE_ACTIVATION { response }
|
|
9
|
+
* - entityAware: false
|
|
10
|
+
*/
|
|
11
|
+
import React from 'react';
|
|
12
|
+
export interface ActivationBlockProps {
|
|
13
|
+
/** The prior-knowledge question */
|
|
14
|
+
question: string;
|
|
15
|
+
/** Pre-filled response from saved state */
|
|
16
|
+
savedResponse?: string;
|
|
17
|
+
/** Event name emitted on save/skip (as `UI:<saveEvent>`). Defaults to 'SAVE_ACTIVATION'. */
|
|
18
|
+
saveEvent?: string;
|
|
19
|
+
/** Additional CSS classes */
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const ActivationBlock: React.FC<ActivationBlockProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BloomQuizBlock Molecule Component
|
|
3
|
+
*
|
|
4
|
+
* Practice Q&A with Bloom's Taxonomy level badge. Emits `UI:ANSWER_BLOOM { index, level }`.
|
|
5
|
+
*
|
|
6
|
+
* Event Contract:
|
|
7
|
+
* - Emits: UI:ANSWER_BLOOM { index, level }
|
|
8
|
+
* - entityAware: false
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
export type BloomLevel = 'remember' | 'understand' | 'apply' | 'analyze' | 'evaluate' | 'create';
|
|
12
|
+
export interface BloomQuizBlockProps {
|
|
13
|
+
level: BloomLevel;
|
|
14
|
+
question: string;
|
|
15
|
+
answer: string;
|
|
16
|
+
/** Zero-based index (used in the emitted event payload) */
|
|
17
|
+
index?: number;
|
|
18
|
+
/** Whether the learner has already answered */
|
|
19
|
+
isAnswered?: boolean;
|
|
20
|
+
/** Event name emitted on first reveal (as `UI:<answerEvent>`). Defaults to 'ANSWER_BLOOM'. */
|
|
21
|
+
answerEvent?: string;
|
|
22
|
+
/** Additional CSS classes */
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const BloomQuizBlock: React.FC<BloomQuizBlockProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConnectionBlock Molecule Component
|
|
3
|
+
*
|
|
4
|
+
* Surfaces prior-knowledge connections before new content.
|
|
5
|
+
* Renders arbitrary markdown via MarkdownContent.
|
|
6
|
+
*
|
|
7
|
+
* Event Contract:
|
|
8
|
+
* - No events emitted (display-only)
|
|
9
|
+
* - entityAware: false
|
|
10
|
+
*/
|
|
11
|
+
import React from 'react';
|
|
12
|
+
export interface ConnectionBlockProps {
|
|
13
|
+
/** Markdown content summarising what the learner already knows */
|
|
14
|
+
content: string;
|
|
15
|
+
/** Additional CSS classes */
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const ConnectionBlock: React.FC<ConnectionBlockProps>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ReflectionBlock Molecule Component
|
|
3
|
+
*
|
|
4
|
+
* Inline reflection prompt for deep processing. Emits `UI:SAVE_REFLECTION { index, note }`.
|
|
5
|
+
*
|
|
6
|
+
* Event Contract:
|
|
7
|
+
* - Emits: UI:SAVE_REFLECTION { index, note }
|
|
8
|
+
* - entityAware: false
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
export interface ReflectionBlockProps {
|
|
12
|
+
/** The reflection prompt */
|
|
13
|
+
prompt: string;
|
|
14
|
+
/** Zero-based index of this block (used in the emitted event payload) */
|
|
15
|
+
index: number;
|
|
16
|
+
/** Pre-filled note from saved state */
|
|
17
|
+
savedNote?: string;
|
|
18
|
+
/** Event name emitted on save (as `UI:<saveEvent>`). Defaults to 'SAVE_REFLECTION'. */
|
|
19
|
+
saveEvent?: string;
|
|
20
|
+
/** Additional CSS classes */
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const ReflectionBlock: React.FC<ReflectionBlockProps>;
|
|
@@ -125,3 +125,9 @@ export { Chart, type ChartProps, type ChartType, type ChartSeries, } from "./Cha
|
|
|
125
125
|
export { SignaturePad, type SignaturePadProps, } from "./SignaturePad";
|
|
126
126
|
export { DocumentViewer, type DocumentViewerProps, type DocumentType, } from "./DocumentViewer";
|
|
127
127
|
export { GraphCanvas, type GraphCanvasProps, type GraphNode, type GraphEdge, } from "./GraphCanvas";
|
|
128
|
+
export { ActivationBlock, type ActivationBlockProps } from './ActivationBlock';
|
|
129
|
+
export { ReflectionBlock, type ReflectionBlockProps } from './ReflectionBlock';
|
|
130
|
+
export { ConnectionBlock, type ConnectionBlockProps } from './ConnectionBlock';
|
|
131
|
+
export { BloomQuizBlock, type BloomQuizBlockProps, type BloomLevel } from './BloomQuizBlock';
|
|
132
|
+
export { parseLessonSegments, type LessonSegment, type LessonUserProgress } from './parseLessonSegments';
|
|
133
|
+
export { parseMarkdownWithCodeBlocks, type MixedSegment } from './lessonSegmentUtils';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility for lesson-segment parsing: splits a markdown string into alternating
|
|
3
|
+
* markdown and fenced-code-block segments. Exported so SegmentRenderer and
|
|
4
|
+
* BloomQuizBlock can reuse without circular imports.
|
|
5
|
+
*/
|
|
6
|
+
export type MarkdownSegment = {
|
|
7
|
+
type: 'markdown';
|
|
8
|
+
content: string;
|
|
9
|
+
};
|
|
10
|
+
export type CodeSegment = {
|
|
11
|
+
type: 'code';
|
|
12
|
+
language: string;
|
|
13
|
+
content: string;
|
|
14
|
+
runnable?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type MixedSegment = MarkdownSegment | CodeSegment;
|
|
17
|
+
/** Splits markdown content into markdown and fenced-code-block segments. */
|
|
18
|
+
export declare function parseMarkdownWithCodeBlocks(content: string): MixedSegment[];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* parseLessonSegments — parses lesson markdown with embedded learning-science
|
|
3
|
+
* XML-style tags into a typed Segment array.
|
|
4
|
+
*
|
|
5
|
+
* Supported tags: <activate>, <connect>, <reflect>, <bloom level="...">,
|
|
6
|
+
* <question>/<answer>, <visualize type="..." description="..." />.
|
|
7
|
+
*
|
|
8
|
+
* Tags may be open (unclosed) — the parser falls back to consuming content
|
|
9
|
+
* until the next recognised tag, a section heading (`\n\n#`), or end-of-input.
|
|
10
|
+
*/
|
|
11
|
+
import type { BloomLevel } from './BloomQuizBlock';
|
|
12
|
+
import { type MixedSegment } from './lessonSegmentUtils';
|
|
13
|
+
export type LessonSegment = MixedSegment | {
|
|
14
|
+
type: 'quiz';
|
|
15
|
+
question: string;
|
|
16
|
+
answer: string;
|
|
17
|
+
} | {
|
|
18
|
+
type: 'activate';
|
|
19
|
+
question: string;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'connect';
|
|
22
|
+
content: string;
|
|
23
|
+
} | {
|
|
24
|
+
type: 'reflect';
|
|
25
|
+
prompt: string;
|
|
26
|
+
} | {
|
|
27
|
+
type: 'bloom';
|
|
28
|
+
level: BloomLevel;
|
|
29
|
+
question: string;
|
|
30
|
+
answer: string;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'visualization';
|
|
33
|
+
visualizationType: 'chart' | 'simulation';
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
/** User progress state passed into SegmentRenderer. */
|
|
37
|
+
export interface LessonUserProgress {
|
|
38
|
+
activationResponse?: string;
|
|
39
|
+
reflectionNotes?: string[];
|
|
40
|
+
bloomAnswered?: Record<number, boolean>;
|
|
41
|
+
}
|
|
42
|
+
/** Parse a lesson string into typed segments. Returns `[]` when input is empty. */
|
|
43
|
+
export declare function parseLessonSegments(lesson: string | undefined): LessonSegment[];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CodeRunnerPanel Organism Component
|
|
3
|
+
*
|
|
4
|
+
* Editable code block with Run/Reset buttons and simulated terminal output.
|
|
5
|
+
* Real execution is a future concern; callers supply a simulation function via
|
|
6
|
+
* `onRun`. Emits `UI:RUN_CODE { language, exitCode }` on every run attempt.
|
|
7
|
+
*
|
|
8
|
+
* Event Contract:
|
|
9
|
+
* - Emits: UI:RUN_CODE { language, exitCode, error? }
|
|
10
|
+
* - entityAware: false
|
|
11
|
+
*/
|
|
12
|
+
import React from 'react';
|
|
13
|
+
export interface CodeSimulationOutput {
|
|
14
|
+
stdout: string;
|
|
15
|
+
stderr: string;
|
|
16
|
+
exitCode: number;
|
|
17
|
+
testResults: Array<{
|
|
18
|
+
input: string;
|
|
19
|
+
expectedOutput: string;
|
|
20
|
+
actualOutput: string;
|
|
21
|
+
passed: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
export interface CodeRunnerPanelProps {
|
|
25
|
+
/** Initial code content */
|
|
26
|
+
code: string;
|
|
27
|
+
/** Programming language for syntax highlighting */
|
|
28
|
+
language: string;
|
|
29
|
+
/** Whether the panel allows running (false = read-only code block) */
|
|
30
|
+
runnable?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Simulate executing the code. Omit to render a read-only block.
|
|
33
|
+
* Real execution is a separate future track — this callback supplies
|
|
34
|
+
* deterministic simulated output for UI feedback.
|
|
35
|
+
*/
|
|
36
|
+
onRun?: (code: string) => Promise<CodeSimulationOutput>;
|
|
37
|
+
/** Event name to emit on run (emitted as `UI:<runEvent>`). Defaults to 'RUN_CODE'. */
|
|
38
|
+
runEvent?: string;
|
|
39
|
+
/** Additional CSS classes */
|
|
40
|
+
className?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare const CodeRunnerPanel: React.FC<CodeRunnerPanelProps>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SegmentRenderer Organism Component
|
|
3
|
+
*
|
|
4
|
+
* Renders a parsed array of LessonSegments — markdown, code, quizzes,
|
|
5
|
+
* activation prompts, connections, reflections, Bloom questions.
|
|
6
|
+
* The `visualization` segment type is passed through as a no-op unless the
|
|
7
|
+
* caller provides `onRenderVisualization` (future extensibility hook).
|
|
8
|
+
*
|
|
9
|
+
* Event Contract:
|
|
10
|
+
* - Delegates to child molecules: UI:SAVE_ACTIVATION, UI:SAVE_REFLECTION, UI:ANSWER_BLOOM
|
|
11
|
+
* - entityAware: false
|
|
12
|
+
*/
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import { type CodeSimulationOutput } from './CodeRunnerPanel';
|
|
15
|
+
import type { LessonSegment, LessonUserProgress } from '../molecules/parseLessonSegments';
|
|
16
|
+
export type { LessonSegment, LessonUserProgress, CodeSimulationOutput };
|
|
17
|
+
export interface SegmentRendererProps {
|
|
18
|
+
/** Parsed lesson segments (see `parseLessonSegments`) */
|
|
19
|
+
segments: LessonSegment[];
|
|
20
|
+
/** Additional CSS classes for the root container */
|
|
21
|
+
className?: string;
|
|
22
|
+
/** CSS classes for the outer wrapping div */
|
|
23
|
+
containerClassName?: string;
|
|
24
|
+
/** User progress for restoring activation/reflection state */
|
|
25
|
+
userProgress?: LessonUserProgress;
|
|
26
|
+
/**
|
|
27
|
+
* Simulate executing runnable code blocks. Omit to render runnable blocks
|
|
28
|
+
* as read-only. Real execution is a future track.
|
|
29
|
+
*/
|
|
30
|
+
onRunCodeSimulation?: (code: string, language: string) => Promise<CodeSimulationOutput>;
|
|
31
|
+
/**
|
|
32
|
+
* Optional render slot for `visualization` segment types. When not provided,
|
|
33
|
+
* visualization segments are silently skipped. Callers can wire this to any
|
|
34
|
+
* custom component or orbital generator.
|
|
35
|
+
*/
|
|
36
|
+
onRenderVisualization?: (type: 'chart' | 'simulation', description: string, index: number) => React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
export declare const SegmentRenderer: React.FC<SegmentRendererProps>;
|
|
@@ -26,3 +26,5 @@ export { StepFlowOrganism, type StepFlowOrganismProps, } from "../../marketing/o
|
|
|
26
26
|
export { ShowcaseOrganism, type ShowcaseOrganismProps, } from "../../marketing/organisms/ShowcaseOrganism";
|
|
27
27
|
export { TeamOrganism, type TeamOrganismProps, } from "../../marketing/organisms/TeamOrganism";
|
|
28
28
|
export { CaseStudyOrganism, type CaseStudyOrganismProps, } from "../../marketing/organisms/CaseStudyOrganism";
|
|
29
|
+
export { CodeRunnerPanel, type CodeRunnerPanelProps, type CodeSimulationOutput, } from './CodeRunnerPanel';
|
|
30
|
+
export { SegmentRenderer, type SegmentRendererProps, } from './SegmentRenderer';
|