@almadar/ui 6.56.0 → 6.58.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.
Files changed (64) hide show
  1. package/dist/{ArbitraryClassCompiler-DvzdeHxc.d.ts → ArbitraryClassCompiler-tChQ3nVq.d.ts} +15 -1
  2. package/dist/{AwaitingSkeletonContext-DPgW__WV.d.ts → AwaitingSkeletonContext-Bh399p1x.d.ts} +1 -3
  3. package/dist/{Canvas3DHost-DfAhg6EH.d.ts → Canvas3DHost-BTvRPfsr.d.ts} +1 -1
  4. package/dist/{FileTree-DUi7e7Z8.d.ts → FileTree-BSfgp-HH.d.ts} +29 -2
  5. package/dist/{GameAudioProvider-DyBvYP2c.d.ts → GameAudioProvider-kXbonWTv.d.ts} +1 -1
  6. package/dist/Typography-LZTP72Y4.js +5 -0
  7. package/dist/{UISlotRenderer-QTHFT6Z4.js → UISlotRenderer-N5DFYE6K.js} +8 -8
  8. package/dist/avl/index.cjs +4940 -4265
  9. package/dist/avl/index.d.ts +74 -5
  10. package/dist/avl/index.js +68 -711
  11. package/dist/{avl-schema-parser-C0wnAp5x.d.ts → avl-schema-parser-CH1QoZw1.d.ts} +1 -1
  12. package/dist/{chunk-HCSJHRC4.js → chunk-4ZGXIW3B.js} +1 -1
  13. package/dist/{chunk-RNY5LJXJ.js → chunk-723MJUU3.js} +1 -1
  14. package/dist/{chunk-6EV3OEBQ.js → chunk-CHNC4UYE.js} +3 -2
  15. package/dist/{chunk-SGJHVPHC.js → chunk-GZGDBS4S.js} +2 -2
  16. package/dist/{chunk-Y53Q55H5.js → chunk-HA7CJWQX.js} +1123 -1121
  17. package/dist/{chunk-FQM37C56.js → chunk-HB3D3HUJ.js} +129 -79
  18. package/dist/{chunk-XZKGRSIO.js → chunk-I2ZNE5TD.js} +2522 -1188
  19. package/dist/{chunk-JRW33U35.js → chunk-I5QOYW2Z.js} +1 -1
  20. package/dist/{chunk-KQXXO42S.js → chunk-KJGVLXEN.js} +78 -1
  21. package/dist/{chunk-HRCR53OW.js → chunk-LZRW6GXG.js} +18 -3
  22. package/dist/{chunk-2LFBQ4IS.js → chunk-MZIDOJMD.js} +2 -2
  23. package/dist/{chunk-QGH4NAQO.js → chunk-N7JIG57B.js} +9 -4
  24. package/dist/chunk-YYYHH5BA.js +2519 -0
  25. package/dist/{cn-ClXGlIOY.d.ts → cn-DIql5232.d.ts} +152 -24
  26. package/dist/components/index.cjs +6917 -3102
  27. package/dist/components/index.d.ts +54 -101
  28. package/dist/components/index.js +14 -16
  29. package/dist/context/index.cjs +23 -0
  30. package/dist/context/index.d.ts +2 -2
  31. package/dist/context/index.js +20 -1
  32. package/dist/hooks/index.cjs +2544 -7
  33. package/dist/hooks/index.d.ts +4 -1
  34. package/dist/hooks/index.js +7 -6
  35. package/dist/lib/drawable/three/index.cjs +22 -6
  36. package/dist/lib/drawable/three/index.d.ts +4 -4
  37. package/dist/lib/drawable/three/index.js +7 -7
  38. package/dist/lib/index.cjs +18 -3
  39. package/dist/lib/index.d.ts +3 -3
  40. package/dist/lib/index.js +4 -5
  41. package/dist/locales/index.cjs +54 -9
  42. package/dist/locales/index.js +2 -2489
  43. package/dist/{paintDispatch-_6EhJCiL.d.ts → paintDispatch-BN8Vbzgs.d.ts} +1 -1
  44. package/dist/providers/index.cjs +4075 -2415
  45. package/dist/providers/index.d.ts +6 -6
  46. package/dist/providers/index.js +26 -18
  47. package/dist/runtime/index.cjs +4198 -2498
  48. package/dist/runtime/index.d.ts +4 -17
  49. package/dist/runtime/index.js +11 -10
  50. package/dist/ssr/index.cjs +23 -6
  51. package/dist/ssr/index.js +23 -6
  52. package/dist/{useEventBus-JUAH3EFW.js → useEventBus-SWRN475O.js} +1 -1
  53. package/dist/{verificationRegistry-CD7Xb40L.d.ts → verificationRegistry-CK76GUfH.d.ts} +1 -1
  54. package/locales/ar.json +18 -3
  55. package/locales/en.json +18 -3
  56. package/locales/sl.json +18 -3
  57. package/package.json +9 -8
  58. package/tailwind-preset.cjs +3 -0
  59. package/themes/_fonts.css +1 -1
  60. package/themes/_presets.css +1 -0
  61. package/themes/kflow.css +299 -0
  62. package/dist/Typography-7PDT62PG.js +0 -5
  63. package/dist/chunk-F4ZTPKZL.js +0 -284
  64. package/dist/chunk-OKWD7LPO.js +0 -80
@@ -1,7 +1,17 @@
1
- import { OrbitalSchema, A11yProps } from '@almadar/core';
1
+ import { OrbitalSchema, A11yProps, EventEmit } from '@almadar/core';
2
2
  import React__default from 'react';
3
3
  import { ClassValue } from 'clsx';
4
4
 
5
+ type AnnotationKind = 'question' | 'note';
6
+ interface ContentAnnotation {
7
+ /** Unique id, echoed in the click event payload */
8
+ id: string;
9
+ /** Exact passage to highlight (first occurrence in the rendered text) */
10
+ text: string;
11
+ /** Highlight colour: `question` or `note` */
12
+ kind: AnnotationKind;
13
+ }
14
+
5
15
  /**
6
16
  * Pure vim-flavored editor motion module. No DOM — `CodeBlock.tsx` drives a
7
17
  * real `<textarea>` selection through this (Almadar Studio V4 §14 plan, P1
@@ -85,7 +95,7 @@ type ContentSegment = {
85
95
  * Splits markdown into segments of plain markdown and fenced code blocks.
86
96
  * JSON/orb code blocks containing orbital schemas are tagged as 'orbital'.
87
97
  */
88
- declare function parseMarkdownWithCodeBlocks$1(content: string | undefined | null): ContentSegment[];
98
+ declare function parseMarkdownWithCodeBlocks(content: string | undefined | null): ContentSegment[];
89
99
  /**
90
100
  * Parse content to extract all segments including quiz tags and code blocks.
91
101
  *
@@ -123,37 +133,72 @@ interface BloomQuizBlockProps extends A11yProps {
123
133
  declare const BloomQuizBlock: React__default.FC<BloomQuizBlockProps>;
124
134
 
125
135
  /**
126
- * Utility for lesson-segment parsing: splits a markdown string into alternating
127
- * markdown and fenced-code-block segments. Exported so SegmentRenderer and
128
- * BloomQuizBlock can reuse without circular imports.
136
+ * CodeRunnerPanel Organism Component
137
+ *
138
+ * Editable code block with Run/Reset buttons and simulated terminal output.
139
+ * Real execution is a future concern; callers supply a simulation function via
140
+ * `onRun`. Emits `UI:RUN_CODE { language, exitCode }` on every run attempt.
141
+ *
142
+ * Event Contract:
143
+ * - Emits: UI:RUN_CODE { language, exitCode, error? }
144
+ * - entityAware: false
129
145
  */
130
- type MarkdownSegment = {
131
- type: 'markdown';
132
- content: string;
133
- };
134
- type CodeSegment = {
135
- type: 'code';
146
+
147
+ interface CodeSimulationOutput {
148
+ stdout: string;
149
+ stderr: string;
150
+ exitCode: number;
151
+ testResults: Array<{
152
+ input: string;
153
+ expectedOutput: string;
154
+ actualOutput: string;
155
+ passed: boolean;
156
+ }>;
157
+ }
158
+ interface CodeRunnerPanelProps extends Omit<React__default.AriaAttributes, keyof A11yProps>, A11yProps {
159
+ /** Initial code content */
160
+ code: string;
161
+ /** Programming language for syntax highlighting */
136
162
  language: string;
137
- content: string;
163
+ /** Whether the panel allows running (false = read-only code block) */
138
164
  runnable?: boolean;
139
- };
140
- type MixedSegment = MarkdownSegment | CodeSegment;
141
- /** Splits markdown content into markdown and fenced-code-block segments. */
142
- declare function parseMarkdownWithCodeBlocks(content: string): MixedSegment[];
165
+ /**
166
+ * Simulate executing the code. Omit to render a read-only block.
167
+ * Real execution is a separate future track — this callback supplies
168
+ * deterministic simulated output for UI feedback.
169
+ */
170
+ onRun?: (code: string) => Promise<CodeSimulationOutput>;
171
+ /** Event name to emit on run (emitted as `UI:<runEvent>`). Defaults to 'RUN_CODE'. */
172
+ runEvent?: string;
173
+ /** Additional CSS classes */
174
+ className?: string;
175
+ }
176
+ declare const CodeRunnerPanel: React__default.FC<CodeRunnerPanelProps>;
143
177
 
144
178
  /**
145
- * parseLessonSegments — parses lesson markdown with embedded learning-science
146
- * XML-style tags into a typed Segment array.
179
+ * SegmentRenderer Organism Component
147
180
  *
148
- * Supported tags: <activate>, <connect>, <reflect>, <bloom level="...">,
149
- * <question>/<answer>, <visualize type="..." description="..." />.
181
+ * Renders a parsed array of LessonSegments — markdown, code, quizzes,
182
+ * activation prompts, connections, reflections, Bloom questions.
183
+ * The `visualization` segment type is passed through as a no-op unless the
184
+ * caller provides `onRenderVisualization` (future extensibility hook).
150
185
  *
151
- * Tags may be open (unclosed) — the parser falls back to consuming content
152
- * until the next recognised tag, a section heading (`\n\n#`), or end-of-input.
186
+ * Event Contract:
187
+ * - Delegates to child molecules: UI:{activationSaveEvent|SAVE_ACTIVATION}, UI:{reflectionSaveEvent|SAVE_REFLECTION}, UI:{bloomAnswerEvent|ANSWER_BLOOM}
188
+ * - Emits (selection / highlights): UI:{askEvent} { selectedText }, UI:{noteEvent} { selectedText }, UI:{annotationEvent} { annotationId }
189
+ * - entityAware: false
153
190
  */
154
191
 
155
192
  type InteractiveOrbitalType = 'algorithms' | 'math' | 'physics' | 'biology' | 'chemistry' | 'probability';
156
- type LessonSegment = MixedSegment | {
193
+ type LessonSegment = {
194
+ type: 'markdown';
195
+ content: string;
196
+ } | {
197
+ type: 'code';
198
+ language: string;
199
+ content: string;
200
+ runnable?: boolean;
201
+ } | {
157
202
  type: 'quiz';
158
203
  question: string;
159
204
  answer: string;
@@ -176,6 +221,89 @@ type LessonSegment = MixedSegment | {
176
221
  visualizationType: InteractiveOrbitalType;
177
222
  description: string;
178
223
  };
224
+ /**
225
+ * User progress state passed into SegmentRenderer. Declared here (rather than
226
+ * alongside `LessonSegment` in `lib/parseLessonSegments.ts`) so the
227
+ * pattern-sync scanner — which only indexes types under `components/**` —
228
+ * can resolve it to a concrete `.lolo` object shape instead of `json`.
229
+ */
230
+ interface LessonUserProgress {
231
+ activationResponse?: string;
232
+ reflectionNotes?: string[];
233
+ bloomAnswered?: Record<number, boolean>;
234
+ }
235
+ interface SegmentRendererProps extends Omit<React__default.AriaAttributes, keyof A11yProps>, A11yProps {
236
+ /** Parsed lesson segments (see `parseLessonSegments`). Ignored when `lesson` is given. */
237
+ segments?: LessonSegment[];
238
+ /** Raw lesson markdown with learning tags; parsed with `parseLessonSegments` and rendered */
239
+ lesson?: string;
240
+ /** Event emitted when the activation prompt is saved or skipped (as `UI:<activationSaveEvent>`) */
241
+ activationSaveEvent?: EventEmit<{
242
+ response: string;
243
+ }>;
244
+ /** Event emitted when a reflection note is saved (as `UI:<reflectionSaveEvent>`) */
245
+ reflectionSaveEvent?: EventEmit<{
246
+ index: number;
247
+ note: string;
248
+ }>;
249
+ /** Event emitted on the first reveal of a Bloom question (as `UI:<bloomAnswerEvent>`) */
250
+ bloomAnswerEvent?: EventEmit<{
251
+ index: number;
252
+ level: BloomLevel;
253
+ }>;
254
+ /** Event emitted when the reader picks Ask on selected text (as `UI:<askEvent>`) */
255
+ askEvent?: EventEmit<{
256
+ selectedText: string;
257
+ }>;
258
+ /** Event emitted when the reader picks Note on selected text (as `UI:<noteEvent>`) */
259
+ noteEvent?: EventEmit<{
260
+ selectedText: string;
261
+ }>;
262
+ /** Ask action label (default: translated) */
263
+ askLabel?: string;
264
+ /** Note action label (default: translated) */
265
+ noteLabel?: string;
266
+ /**
267
+ * Passages to highlight. Each `text` is matched exactly against the markdown
268
+ * segments, first segment whose source contains it, first occurrence inside one
269
+ * rendered text node (outside code); one that spans formatting is not highlighted.
270
+ */
271
+ annotations?: ContentAnnotation[];
272
+ /** Event emitted when a highlighted passage is clicked (as `UI:<annotationEvent>`) */
273
+ annotationEvent?: EventEmit<{
274
+ annotationId?: string;
275
+ }>;
276
+ /** Additional CSS classes for the root container */
277
+ className?: string;
278
+ /** CSS classes for the outer wrapping div */
279
+ containerClassName?: string;
280
+ /** User progress for restoring activation/reflection state */
281
+ userProgress?: LessonUserProgress;
282
+ /**
283
+ * Simulate executing runnable code blocks. Omit to render runnable blocks
284
+ * as read-only. Real execution is a future track.
285
+ */
286
+ onRunCodeSimulation?: (code: string, language: string) => Promise<CodeSimulationOutput>;
287
+ /**
288
+ * Optional render slot for `visualization` segment types. When not provided,
289
+ * visualization segments are silently skipped. Callers can wire this to any
290
+ * custom component or orbital generator.
291
+ */
292
+ onRenderVisualization?: (type: InteractiveOrbitalType, description: string, index: number) => React__default.ReactNode;
293
+ }
294
+ declare const SegmentRenderer: React__default.FC<SegmentRendererProps>;
295
+
296
+ /**
297
+ * parseLessonSegments — parses lesson markdown with embedded learning-science
298
+ * XML-style tags into a typed Segment array.
299
+ *
300
+ * Supported tags: <activate>, <connect>, <reflect>, <bloom level="...">,
301
+ * <question>/<answer>, <visualize type="..." description="..." />.
302
+ *
303
+ * Tags may be open (unclosed) — the parser falls back to consuming content
304
+ * until the next recognised tag, a section heading (`\n\n#`), or end-of-input.
305
+ */
306
+
179
307
  /** Parse a lesson string into typed segments. Returns `[]` when input is empty. */
180
308
  declare function parseLessonSegments(lesson: string | undefined): LessonSegment[];
181
309
 
@@ -185,4 +313,4 @@ declare function parseLessonSegments(lesson: string | undefined): LessonSegment[
185
313
  */
186
314
  declare function cn(...inputs: ClassValue[]): string;
187
315
 
188
- export { type ApplyOperatorInput as A, type BloomLevel as B, type ContentSegment as C, EDITOR_MOTIONS as E, INDENT_UNIT as I, type LessonSegment as L, type MixedSegment as M, type ApplyOperatorResult as a, EDITOR_OPERATORS as b, type EditorMotion as c, type EditorOperator as d, applyMotion as e, applyOperator as f, cn as g, isEditorOperator as h, isEditorMotion as i, parseLessonSegments as j, parseMarkdownWithCodeBlocks$1 as k, type InteractiveOrbitalType as l, motionRange as m, BloomQuizBlock as n, type BloomQuizBlockProps as o, parseContentSegments as p, parseMarkdownWithCodeBlocks as q };
316
+ export { type ApplyOperatorInput as A, type BloomLevel as B, type ContentSegment as C, EDITOR_MOTIONS as E, INDENT_UNIT as I, type LessonSegment as L, SegmentRenderer as S, type ApplyOperatorResult as a, EDITOR_OPERATORS as b, type EditorMotion as c, type EditorOperator as d, applyMotion as e, applyOperator as f, cn as g, isEditorOperator as h, isEditorMotion as i, parseLessonSegments as j, parseMarkdownWithCodeBlocks as k, type ContentAnnotation as l, motionRange as m, BloomQuizBlock as n, type BloomQuizBlockProps as o, parseContentSegments as p, CodeRunnerPanel as q, type CodeRunnerPanelProps as r, type CodeSimulationOutput as s, type LessonUserProgress as t, type SegmentRendererProps as u };