@almadar/std 2.1.1 → 2.4.1

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 (86) hide show
  1. package/dist/behaviors/async.d.ts +12 -7
  2. package/dist/behaviors/async.js +1085 -312
  3. package/dist/behaviors/async.js.map +1 -1
  4. package/dist/behaviors/data-management.d.ts +27 -13
  5. package/dist/behaviors/data-management.js +600 -244
  6. package/dist/behaviors/data-management.js.map +1 -1
  7. package/dist/behaviors/domain/commerce.d.ts +51 -0
  8. package/dist/behaviors/domain/commerce.js +1093 -0
  9. package/dist/behaviors/domain/commerce.js.map +1 -0
  10. package/dist/behaviors/domain/content.d.ts +51 -0
  11. package/dist/behaviors/domain/content.js +1294 -0
  12. package/dist/behaviors/domain/content.js.map +1 -0
  13. package/dist/behaviors/domain/dashboard.d.ts +45 -0
  14. package/dist/behaviors/domain/dashboard.js +783 -0
  15. package/dist/behaviors/domain/dashboard.js.map +1 -0
  16. package/dist/behaviors/domain/education.d.ts +41 -0
  17. package/dist/behaviors/domain/education.js +738 -0
  18. package/dist/behaviors/domain/education.js.map +1 -0
  19. package/dist/behaviors/domain/finance.d.ts +49 -0
  20. package/dist/behaviors/domain/finance.js +660 -0
  21. package/dist/behaviors/domain/finance.js.map +1 -0
  22. package/dist/behaviors/domain/game-2d-platformer.d.ts +50 -0
  23. package/dist/behaviors/domain/game-2d-platformer.js +810 -0
  24. package/dist/behaviors/domain/game-2d-platformer.js.map +1 -0
  25. package/dist/behaviors/domain/game-2d-puzzle.d.ts +42 -0
  26. package/dist/behaviors/domain/game-2d-puzzle.js +622 -0
  27. package/dist/behaviors/domain/game-2d-puzzle.js.map +1 -0
  28. package/dist/behaviors/domain/game-2d-rpg.d.ts +48 -0
  29. package/dist/behaviors/domain/game-2d-rpg.js +860 -0
  30. package/dist/behaviors/domain/game-2d-rpg.js.map +1 -0
  31. package/dist/behaviors/domain/game-2d-strategy.d.ts +48 -0
  32. package/dist/behaviors/domain/game-2d-strategy.js +692 -0
  33. package/dist/behaviors/domain/game-2d-strategy.js.map +1 -0
  34. package/dist/behaviors/domain/geospatial.d.ts +35 -0
  35. package/dist/behaviors/domain/geospatial.js +634 -0
  36. package/dist/behaviors/domain/geospatial.js.map +1 -0
  37. package/dist/behaviors/domain/healthcare.d.ts +36 -0
  38. package/dist/behaviors/domain/healthcare.js +1068 -0
  39. package/dist/behaviors/domain/healthcare.js.map +1 -0
  40. package/dist/behaviors/domain/iot.d.ts +45 -0
  41. package/dist/behaviors/domain/iot.js +589 -0
  42. package/dist/behaviors/domain/iot.js.map +1 -0
  43. package/dist/behaviors/domain/media.d.ts +41 -0
  44. package/dist/behaviors/domain/media.js +771 -0
  45. package/dist/behaviors/domain/media.js.map +1 -0
  46. package/dist/behaviors/domain/scheduling.d.ts +41 -0
  47. package/dist/behaviors/domain/scheduling.js +930 -0
  48. package/dist/behaviors/domain/scheduling.js.map +1 -0
  49. package/dist/behaviors/domain/simulation.d.ts +36 -0
  50. package/dist/behaviors/domain/simulation.js +706 -0
  51. package/dist/behaviors/domain/simulation.js.map +1 -0
  52. package/dist/behaviors/domain/social.d.ts +41 -0
  53. package/dist/behaviors/domain/social.js +840 -0
  54. package/dist/behaviors/domain/social.js.map +1 -0
  55. package/dist/behaviors/domain/workflow.d.ts +41 -0
  56. package/dist/behaviors/domain/workflow.js +879 -0
  57. package/dist/behaviors/domain/workflow.js.map +1 -0
  58. package/dist/behaviors/feedback.d.ts +10 -5
  59. package/dist/behaviors/feedback.js +279 -194
  60. package/dist/behaviors/feedback.js.map +1 -1
  61. package/dist/behaviors/game-core.d.ts +15 -8
  62. package/dist/behaviors/game-core.js +412 -80
  63. package/dist/behaviors/game-core.js.map +1 -1
  64. package/dist/behaviors/game-entity.d.ts +17 -10
  65. package/dist/behaviors/game-entity.js +544 -237
  66. package/dist/behaviors/game-entity.js.map +1 -1
  67. package/dist/behaviors/game-ui.d.ts +16 -8
  68. package/dist/behaviors/game-ui.js +451 -316
  69. package/dist/behaviors/game-ui.js.map +1 -1
  70. package/dist/behaviors/index.d.ts +18 -1
  71. package/dist/behaviors/index.js +18905 -2140
  72. package/dist/behaviors/index.js.map +1 -1
  73. package/dist/behaviors/infrastructure.d.ts +9 -8
  74. package/dist/behaviors/infrastructure.js +597 -169
  75. package/dist/behaviors/infrastructure.js.map +1 -1
  76. package/dist/behaviors/registry.d.ts +11 -11
  77. package/dist/behaviors/registry.js +18904 -2139
  78. package/dist/behaviors/registry.js.map +1 -1
  79. package/dist/behaviors/types.d.ts +19 -2
  80. package/dist/behaviors/types.js.map +1 -1
  81. package/dist/behaviors/ui-interaction.d.ts +20 -14
  82. package/dist/behaviors/ui-interaction.js +928 -518
  83. package/dist/behaviors/ui-interaction.js.map +1 -1
  84. package/dist/index.js +18906 -2141
  85. package/dist/index.js.map +1 -1
  86. package/package.json +1 -1
@@ -0,0 +1,738 @@
1
+ // behaviors/domain/education.ts
2
+ var EDUCATION_THEME = {
3
+ name: "education-blue",
4
+ tokens: {
5
+ colors: {
6
+ primary: "#2563eb",
7
+ "primary-hover": "#1d4ed8",
8
+ "primary-foreground": "#ffffff",
9
+ accent: "#3b82f6",
10
+ "accent-foreground": "#ffffff",
11
+ success: "#22c55e",
12
+ warning: "#f59e0b",
13
+ error: "#ef4444"
14
+ }
15
+ }
16
+ };
17
+ var quizBrowsingEffects = [
18
+ ["fetch", "Quiz"],
19
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
20
+ // Header: graduation cap icon + title
21
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
22
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
23
+ { type: "icon", name: "graduation-cap", size: "lg" },
24
+ { type: "typography", variant: "h2", content: "Quizzes" }
25
+ ] }
26
+ ] },
27
+ { type: "divider" },
28
+ // Quiz card list
29
+ {
30
+ type: "data-list",
31
+ entity: "Quiz",
32
+ variant: "card",
33
+ fields: [
34
+ { name: "title", label: "Title", icon: "book-open", variant: "h4" },
35
+ { name: "totalQuestions", label: "Questions", icon: "clipboard", variant: "body" },
36
+ { name: "score", label: "Best Score", icon: "award", variant: "badge" }
37
+ ],
38
+ itemActions: [
39
+ { label: "Start", event: "START", icon: "play" }
40
+ ]
41
+ }
42
+ ] }]
43
+ ];
44
+ var quizTakingEffects = [
45
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
46
+ // Header: brain icon + "Taking Quiz"
47
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
48
+ { type: "icon", name: "brain", size: "lg" },
49
+ { type: "typography", variant: "h2", content: "Taking Quiz" }
50
+ ] },
51
+ { type: "divider" },
52
+ // Wizard progress bar
53
+ {
54
+ type: "wizard-progress",
55
+ currentStep: "@entity.currentQuestion",
56
+ steps: [{ label: "Question 1" }, { label: "Question 2" }, { label: "Question 3" }]
57
+ },
58
+ // Question area
59
+ { type: "stack", direction: "vertical", gap: "md", children: [
60
+ { type: "typography", variant: "h3", content: "Question" },
61
+ { type: "typography", variant: "body", content: "Answer the question below." }
62
+ ] },
63
+ // Progress indicator
64
+ { type: "progress-bar", value: "@entity.currentQuestion", max: "@entity.totalQuestions", label: "Progress" }
65
+ ] }]
66
+ ];
67
+ var progressBrowsingEffects = [
68
+ ["fetch", "LearningProgress"],
69
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
70
+ // Header: book icon + title
71
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
72
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
73
+ { type: "icon", name: "book-open", size: "lg" },
74
+ { type: "typography", variant: "h2", content: "Learning Progress" }
75
+ ] }
76
+ ] },
77
+ { type: "divider" },
78
+ // Summary stats row
79
+ { type: "stack", direction: "horizontal", gap: "md", children: [
80
+ { type: "stats", label: "Courses", icon: "graduation-cap", entity: "LearningProgress" },
81
+ { type: "stats", label: "Completed", icon: "check-circle", entity: "LearningProgress" },
82
+ { type: "stats", label: "In Progress", icon: "clock", entity: "LearningProgress" }
83
+ ] },
84
+ { type: "divider" },
85
+ // Progress card list
86
+ {
87
+ type: "data-list",
88
+ entity: "LearningProgress",
89
+ variant: "card",
90
+ fields: [
91
+ { name: "courseName", label: "Course", icon: "book-open", variant: "h4" },
92
+ { name: "completed", label: "Completed", icon: "check-circle", variant: "body" },
93
+ { name: "total", label: "Total", icon: "clipboard", variant: "body" },
94
+ { name: "percentage", label: "Completion", icon: "award", variant: "badge", format: "percent" }
95
+ ],
96
+ itemActions: [
97
+ { label: "View", event: "VIEW", icon: "eye" }
98
+ ]
99
+ }
100
+ ] }]
101
+ ];
102
+ var gradesBrowsingEffects = [
103
+ ["fetch", "Grade"],
104
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
105
+ // Header: award icon + title
106
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
107
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
108
+ { type: "icon", name: "award", size: "lg" },
109
+ { type: "typography", variant: "h2", content: "Grades" }
110
+ ] }
111
+ ] },
112
+ { type: "divider" },
113
+ // Stats row + chart
114
+ { type: "stack", direction: "horizontal", gap: "md", children: [
115
+ { type: "stats", label: "Students", icon: "users", entity: "Grade" },
116
+ { type: "stats", label: "Avg Score", icon: "bar-chart-2", entity: "Grade" },
117
+ { type: "stats", label: "Submissions", icon: "clipboard", entity: "Grade" }
118
+ ] },
119
+ { type: "line-chart", entity: "Grade" },
120
+ { type: "meter", value: 0, label: "Average Score" },
121
+ { type: "divider" },
122
+ // Grade data grid
123
+ {
124
+ type: "data-grid",
125
+ entity: "Grade",
126
+ columns: [
127
+ { name: "studentName", label: "Student", icon: "users" },
128
+ { name: "assignment", label: "Assignment", icon: "pen-tool" },
129
+ { name: "score", label: "Score", icon: "award", format: "number" },
130
+ { name: "maxScore", label: "Max", icon: "target", format: "number" }
131
+ ],
132
+ itemActions: [
133
+ { label: "Grade", event: "START_GRADING", icon: "pen-tool" }
134
+ ]
135
+ }
136
+ ] }]
137
+ ];
138
+ var curriculumBrowsingEffects = [
139
+ ["fetch", "Course"],
140
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
141
+ // Header: graduation cap + title + search
142
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
143
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
144
+ { type: "icon", name: "graduation-cap", size: "lg" },
145
+ { type: "typography", variant: "h2", content: "Course Catalog" }
146
+ ] },
147
+ { type: "search-input", placeholder: "Search courses...", entity: "Course" }
148
+ ] },
149
+ { type: "divider" },
150
+ // Course card list
151
+ {
152
+ type: "data-list",
153
+ entity: "Course",
154
+ variant: "card",
155
+ fields: [
156
+ { name: "title", label: "Title", icon: "book-open", variant: "h4" },
157
+ { name: "description", label: "Description", icon: "file-text", variant: "body" },
158
+ { name: "modules", label: "Modules", icon: "layers", variant: "body" },
159
+ { name: "duration", label: "Duration", icon: "clock", variant: "caption" },
160
+ { name: "level", label: "Level", icon: "bar-chart-2", variant: "badge" }
161
+ ],
162
+ itemActions: [
163
+ { label: "View", event: "VIEW", icon: "eye" }
164
+ ]
165
+ }
166
+ ] }]
167
+ ];
168
+ var courseDetailEffects = [
169
+ ["fetch", "Course"],
170
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
171
+ // Header with back + enroll buttons
172
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
173
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
174
+ { type: "icon", name: "book-open", size: "lg" },
175
+ { type: "typography", variant: "h2", content: "Course Details" }
176
+ ] },
177
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
178
+ { type: "button", label: "Back", icon: "arrow-left", variant: "secondary", action: "BACK" },
179
+ { type: "button", label: "Enroll", icon: "check-circle", variant: "primary", action: "ENROLL" }
180
+ ] }
181
+ ] },
182
+ { type: "divider" },
183
+ // Course progress
184
+ { type: "progress-bar", value: 0, label: "Course Progress" },
185
+ // Course info fields
186
+ { type: "stack", direction: "vertical", gap: "md", children: [
187
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
188
+ { type: "icon", name: "layers" },
189
+ { type: "typography", variant: "body", content: "Modules" },
190
+ { type: "badge", content: "@entity.modules" }
191
+ ] },
192
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
193
+ { type: "icon", name: "clock" },
194
+ { type: "typography", variant: "body", content: "Duration" },
195
+ { type: "badge", content: "@entity.duration" }
196
+ ] },
197
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
198
+ { type: "icon", name: "bar-chart-2" },
199
+ { type: "typography", variant: "body", content: "Level" },
200
+ { type: "badge", content: "@entity.level" }
201
+ ] }
202
+ ] },
203
+ { type: "divider" },
204
+ { type: "typography", variant: "body", content: "@entity.description" }
205
+ ] }]
206
+ ];
207
+ var QUIZ_BEHAVIOR = {
208
+ name: "std-quiz",
209
+ version: "1.0.0",
210
+ description: "Quiz system with answer submission and scoring",
211
+ orbitals: [
212
+ {
213
+ name: "QuizOrbital",
214
+ theme: EDUCATION_THEME,
215
+ entity: {
216
+ name: "Quiz",
217
+ persistence: "persistent",
218
+ collection: "quizzes",
219
+ fields: [
220
+ { name: "id", type: "string", required: true },
221
+ { name: "title", type: "string", default: "" },
222
+ { name: "questions", type: "number", default: 0 },
223
+ { name: "currentQuestion", type: "number", default: 0 },
224
+ { name: "score", type: "number", default: 0 },
225
+ { name: "totalQuestions", type: "number", default: 0 }
226
+ ]
227
+ },
228
+ traits: [
229
+ {
230
+ name: "QuizControl",
231
+ linkedEntity: "Quiz",
232
+ category: "interaction",
233
+ stateMachine: {
234
+ states: [
235
+ { name: "idle", isInitial: true },
236
+ { name: "taking" },
237
+ { name: "reviewing" },
238
+ { name: "completed" }
239
+ ],
240
+ events: [
241
+ { key: "INIT", name: "Initialize" },
242
+ { key: "START", name: "Start Quiz" },
243
+ { key: "ANSWER", name: "Submit Answer", payloadSchema: [{ name: "correct", type: "boolean", required: true }] },
244
+ { key: "REVIEW", name: "Review Results" },
245
+ { key: "FINISH", name: "Finish Quiz" },
246
+ { key: "RESET", name: "Reset Quiz" }
247
+ ],
248
+ transitions: [
249
+ {
250
+ from: "idle",
251
+ to: "idle",
252
+ event: "INIT",
253
+ effects: [
254
+ ...quizBrowsingEffects
255
+ ]
256
+ },
257
+ {
258
+ from: "idle",
259
+ to: "taking",
260
+ event: "START",
261
+ effects: [
262
+ ["set", "@entity.currentQuestion", 1],
263
+ ["set", "@entity.score", 0],
264
+ ...quizTakingEffects
265
+ ]
266
+ },
267
+ {
268
+ from: "taking",
269
+ to: "taking",
270
+ event: "ANSWER",
271
+ guard: ["<", "@entity.currentQuestion", "@entity.totalQuestions"],
272
+ effects: [
273
+ ["set", "@entity.currentQuestion", ["+", "@entity.currentQuestion", 1]],
274
+ ...quizTakingEffects
275
+ ]
276
+ },
277
+ {
278
+ from: "taking",
279
+ to: "reviewing",
280
+ event: "ANSWER",
281
+ guard: [">=", "@entity.currentQuestion", "@entity.totalQuestions"],
282
+ effects: [
283
+ ["fetch", "Quiz"],
284
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
285
+ // Review header
286
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
287
+ { type: "icon", name: "clipboard", size: "lg" },
288
+ { type: "typography", variant: "h2", content: "Quiz Review" }
289
+ ] },
290
+ { type: "divider" },
291
+ // Score stats
292
+ { type: "stack", direction: "horizontal", gap: "md", children: [
293
+ { type: "stats", label: "Score", icon: "award", entity: "Quiz" },
294
+ { type: "stats", label: "Questions", icon: "clipboard", entity: "Quiz" }
295
+ ] },
296
+ // Score meter
297
+ { type: "meter", value: "@entity.score", label: "Score" },
298
+ // Detail fields
299
+ { type: "stack", direction: "vertical", gap: "sm", children: [
300
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
301
+ { type: "icon", name: "book-open" },
302
+ { type: "typography", variant: "body", content: "@entity.title" }
303
+ ] },
304
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
305
+ { type: "icon", name: "check-circle" },
306
+ { type: "typography", variant: "body", content: "Correct answers:" },
307
+ { type: "badge", content: "@entity.score" }
308
+ ] }
309
+ ] },
310
+ // Action button
311
+ { type: "button", label: "Finish", icon: "check-circle", variant: "primary", action: "FINISH" }
312
+ ] }]
313
+ ]
314
+ },
315
+ {
316
+ from: "reviewing",
317
+ to: "completed",
318
+ event: "FINISH",
319
+ effects: [
320
+ ["fetch", "Quiz"],
321
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
322
+ // Completed header
323
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
324
+ { type: "icon", name: "check-circle", size: "lg" },
325
+ { type: "typography", variant: "h2", content: "Quiz Complete" }
326
+ ] },
327
+ { type: "divider" },
328
+ // Final stats
329
+ { type: "stack", direction: "horizontal", gap: "md", children: [
330
+ { type: "stats", label: "Final Score", icon: "award", entity: "Quiz" },
331
+ { type: "stats", label: "Total Questions", icon: "clipboard", entity: "Quiz" }
332
+ ] },
333
+ // Reset button
334
+ { type: "button", label: "Try Again", icon: "refresh-cw", variant: "secondary", action: "RESET" }
335
+ ] }]
336
+ ]
337
+ },
338
+ {
339
+ from: "completed",
340
+ to: "idle",
341
+ event: "RESET",
342
+ effects: [
343
+ ["set", "@entity.currentQuestion", 0],
344
+ ["set", "@entity.score", 0],
345
+ ...quizBrowsingEffects
346
+ ]
347
+ }
348
+ ]
349
+ }
350
+ }
351
+ ],
352
+ pages: [
353
+ {
354
+ name: "QuizPage",
355
+ path: "/quiz",
356
+ isInitial: true,
357
+ traits: [{ ref: "QuizControl" }]
358
+ }
359
+ ]
360
+ }
361
+ ]
362
+ };
363
+ var PROGRESS_TRACKER_BEHAVIOR = {
364
+ name: "std-progress-tracker",
365
+ version: "1.0.0",
366
+ description: "Learning progress tracking with completion metrics",
367
+ orbitals: [
368
+ {
369
+ name: "ProgressTrackerOrbital",
370
+ theme: EDUCATION_THEME,
371
+ entity: {
372
+ name: "LearningProgress",
373
+ persistence: "persistent",
374
+ collection: "learning_progress",
375
+ fields: [
376
+ { name: "id", type: "string", required: true },
377
+ { name: "courseName", type: "string", default: "" },
378
+ { name: "completed", type: "number", default: 0 },
379
+ { name: "total", type: "number", default: 0 },
380
+ { name: "percentage", type: "number", default: 0 }
381
+ ]
382
+ },
383
+ traits: [
384
+ {
385
+ name: "ProgressControl",
386
+ linkedEntity: "LearningProgress",
387
+ category: "interaction",
388
+ stateMachine: {
389
+ states: [
390
+ { name: "browsing", isInitial: true },
391
+ { name: "viewing" }
392
+ ],
393
+ events: [
394
+ { key: "INIT", name: "Initialize" },
395
+ { key: "VIEW", name: "View Progress", payloadSchema: [{ name: "id", type: "string", required: true }] },
396
+ { key: "BACK", name: "Back to List" }
397
+ ],
398
+ transitions: [
399
+ {
400
+ from: "browsing",
401
+ to: "browsing",
402
+ event: "INIT",
403
+ effects: [
404
+ ...progressBrowsingEffects
405
+ ]
406
+ },
407
+ {
408
+ from: "browsing",
409
+ to: "viewing",
410
+ event: "VIEW",
411
+ effects: [
412
+ ["fetch", "LearningProgress"],
413
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
414
+ // Detail header with back button
415
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
416
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
417
+ { type: "icon", name: "book-open", size: "lg" },
418
+ { type: "typography", variant: "h2", content: "Progress Detail" }
419
+ ] },
420
+ { type: "button", label: "Back", icon: "arrow-left", variant: "secondary", action: "BACK" }
421
+ ] },
422
+ { type: "divider" },
423
+ // Course name
424
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
425
+ { type: "icon", name: "graduation-cap" },
426
+ { type: "typography", variant: "h3", content: "@entity.courseName" }
427
+ ] },
428
+ // Progress visuals
429
+ { type: "progress-bar", value: "@entity.percentage", label: "Progress" },
430
+ { type: "meter", value: "@entity.percentage", label: "Completion" },
431
+ // Detail stats
432
+ { type: "stack", direction: "horizontal", gap: "md", children: [
433
+ { type: "stats", label: "Completed", icon: "check-circle", entity: "LearningProgress" },
434
+ { type: "stats", label: "Remaining", icon: "clock", entity: "LearningProgress" },
435
+ { type: "stats", label: "Percentage", icon: "award", entity: "LearningProgress" }
436
+ ] }
437
+ ] }]
438
+ ]
439
+ },
440
+ {
441
+ from: "viewing",
442
+ to: "browsing",
443
+ event: "BACK",
444
+ effects: [
445
+ ...progressBrowsingEffects
446
+ ]
447
+ }
448
+ ]
449
+ }
450
+ }
451
+ ],
452
+ pages: [
453
+ {
454
+ name: "ProgressPage",
455
+ path: "/progress",
456
+ isInitial: true,
457
+ traits: [{ ref: "ProgressControl" }]
458
+ }
459
+ ]
460
+ }
461
+ ]
462
+ };
463
+ var GRADING_BEHAVIOR = {
464
+ name: "std-grading",
465
+ version: "1.0.0",
466
+ description: "Grading system for student assignments",
467
+ orbitals: [
468
+ {
469
+ name: "GradingOrbital",
470
+ theme: EDUCATION_THEME,
471
+ entity: {
472
+ name: "Grade",
473
+ persistence: "persistent",
474
+ collection: "grades",
475
+ fields: [
476
+ { name: "id", type: "string", required: true },
477
+ { name: "studentName", type: "string", default: "" },
478
+ { name: "assignment", type: "string", default: "" },
479
+ { name: "score", type: "number", default: 0 },
480
+ { name: "maxScore", type: "number", default: 100 },
481
+ { name: "feedback", type: "string", default: "" }
482
+ ]
483
+ },
484
+ traits: [
485
+ {
486
+ name: "GradingControl",
487
+ linkedEntity: "Grade",
488
+ category: "interaction",
489
+ stateMachine: {
490
+ states: [
491
+ { name: "browsing", isInitial: true },
492
+ { name: "grading" },
493
+ { name: "reviewed" }
494
+ ],
495
+ events: [
496
+ { key: "INIT", name: "Initialize" },
497
+ { key: "START_GRADING", name: "Start Grading", payloadSchema: [{ name: "id", type: "string", required: true }] },
498
+ { key: "SUBMIT_GRADE", name: "Submit Grade", payloadSchema: [{ name: "score", type: "number", required: true }, { name: "feedback", type: "string", required: true }] },
499
+ { key: "BACK", name: "Back to List" }
500
+ ],
501
+ transitions: [
502
+ {
503
+ from: "browsing",
504
+ to: "browsing",
505
+ event: "INIT",
506
+ effects: [
507
+ ...gradesBrowsingEffects
508
+ ]
509
+ },
510
+ {
511
+ from: "browsing",
512
+ to: "grading",
513
+ event: "START_GRADING",
514
+ effects: [
515
+ ["fetch", "Grade"],
516
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
517
+ // Grading header with back
518
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
519
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
520
+ { type: "icon", name: "pen-tool", size: "lg" },
521
+ { type: "typography", variant: "h2", content: "Enter Grade" }
522
+ ] },
523
+ { type: "button", label: "Back", icon: "arrow-left", variant: "secondary", action: "BACK" }
524
+ ] },
525
+ { type: "divider" },
526
+ // Student info
527
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
528
+ { type: "icon", name: "users" },
529
+ { type: "typography", variant: "h3", content: "@entity.studentName" },
530
+ { type: "badge", content: "@entity.assignment" }
531
+ ] },
532
+ // Grade form
533
+ { type: "form-section", entity: "Grade" }
534
+ ] }]
535
+ ]
536
+ },
537
+ {
538
+ from: "grading",
539
+ to: "reviewed",
540
+ event: "SUBMIT_GRADE",
541
+ effects: [
542
+ ["fetch", "Grade"],
543
+ ["set", "@entity.score", "@payload.score"],
544
+ ["set", "@entity.feedback", "@payload.feedback"],
545
+ ["render-ui", "main", { type: "stack", direction: "vertical", gap: "lg", children: [
546
+ // Submitted header with back
547
+ { type: "stack", direction: "horizontal", justify: "space-between", children: [
548
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
549
+ { type: "icon", name: "check-circle", size: "lg" },
550
+ { type: "typography", variant: "h2", content: "Grade Submitted" }
551
+ ] },
552
+ { type: "button", label: "Back", icon: "arrow-left", variant: "secondary", action: "BACK" }
553
+ ] },
554
+ { type: "divider" },
555
+ // Result stats
556
+ { type: "stack", direction: "horizontal", gap: "md", children: [
557
+ { type: "stats", label: "Score", icon: "award", entity: "Grade" },
558
+ { type: "stats", label: "Max Score", icon: "target", entity: "Grade" }
559
+ ] },
560
+ // Score meter
561
+ { type: "meter", value: "@entity.score", label: "Score" },
562
+ // Detail fields
563
+ { type: "stack", direction: "vertical", gap: "sm", children: [
564
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
565
+ { type: "icon", name: "users" },
566
+ { type: "typography", variant: "body", content: "@entity.studentName" }
567
+ ] },
568
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
569
+ { type: "icon", name: "pen-tool" },
570
+ { type: "typography", variant: "body", content: "@entity.assignment" }
571
+ ] },
572
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
573
+ { type: "icon", name: "message-square" },
574
+ { type: "typography", variant: "body", content: "@entity.feedback" }
575
+ ] }
576
+ ] }
577
+ ] }]
578
+ ]
579
+ },
580
+ {
581
+ from: "grading",
582
+ to: "browsing",
583
+ event: "BACK",
584
+ effects: [
585
+ ...gradesBrowsingEffects
586
+ ]
587
+ },
588
+ {
589
+ from: "reviewed",
590
+ to: "browsing",
591
+ event: "BACK",
592
+ effects: [
593
+ ...gradesBrowsingEffects
594
+ ]
595
+ }
596
+ ]
597
+ }
598
+ }
599
+ ],
600
+ pages: [
601
+ {
602
+ name: "GradesPage",
603
+ path: "/grades",
604
+ isInitial: true,
605
+ traits: [{ ref: "GradingControl" }]
606
+ }
607
+ ]
608
+ }
609
+ ]
610
+ };
611
+ var CURRICULUM_BEHAVIOR = {
612
+ name: "std-curriculum",
613
+ version: "1.0.0",
614
+ description: "Curriculum browser with course catalog and enrollment",
615
+ orbitals: [
616
+ {
617
+ name: "CurriculumOrbital",
618
+ theme: EDUCATION_THEME,
619
+ entity: {
620
+ name: "Course",
621
+ persistence: "persistent",
622
+ collection: "courses",
623
+ fields: [
624
+ { name: "id", type: "string", required: true },
625
+ { name: "title", type: "string", default: "" },
626
+ { name: "description", type: "string", default: "" },
627
+ { name: "modules", type: "number", default: 0 },
628
+ { name: "duration", type: "string", default: "" },
629
+ { name: "level", type: "string", default: "beginner" }
630
+ ]
631
+ },
632
+ traits: [
633
+ {
634
+ name: "CurriculumControl",
635
+ linkedEntity: "Course",
636
+ category: "interaction",
637
+ stateMachine: {
638
+ states: [
639
+ { name: "browsing", isInitial: true },
640
+ { name: "viewing" },
641
+ { name: "enrolling" }
642
+ ],
643
+ events: [
644
+ { key: "INIT", name: "Initialize" },
645
+ { key: "VIEW", name: "View Course", payloadSchema: [{ name: "id", type: "string", required: true }] },
646
+ { key: "ENROLL", name: "Enroll" },
647
+ { key: "CONFIRM", name: "Confirm Enrollment" },
648
+ { key: "CANCEL", name: "Cancel Enrollment" },
649
+ { key: "BACK", name: "Back to Catalog" }
650
+ ],
651
+ transitions: [
652
+ {
653
+ from: "browsing",
654
+ to: "browsing",
655
+ event: "INIT",
656
+ effects: [
657
+ ...curriculumBrowsingEffects
658
+ ]
659
+ },
660
+ {
661
+ from: "browsing",
662
+ to: "viewing",
663
+ event: "VIEW",
664
+ effects: [
665
+ ...courseDetailEffects
666
+ ]
667
+ },
668
+ {
669
+ from: "viewing",
670
+ to: "enrolling",
671
+ event: "ENROLL",
672
+ effects: [
673
+ ["render-ui", "modal", { type: "stack", direction: "vertical", gap: "md", children: [
674
+ // Enrollment confirmation modal
675
+ { type: "stack", direction: "horizontal", gap: "sm", children: [
676
+ { type: "icon", name: "graduation-cap", size: "lg" },
677
+ { type: "typography", variant: "h3", content: "Enroll in Course" }
678
+ ] },
679
+ { type: "divider" },
680
+ { type: "typography", variant: "body", content: "Are you sure you want to enroll in this course?" },
681
+ { type: "stack", direction: "horizontal", gap: "sm", justify: "end", children: [
682
+ { type: "button", label: "Cancel", icon: "x", variant: "secondary", action: "CANCEL" },
683
+ { type: "button", label: "Confirm", icon: "check-circle", variant: "primary", action: "CONFIRM" }
684
+ ] }
685
+ ] }]
686
+ ]
687
+ },
688
+ {
689
+ from: "enrolling",
690
+ to: "browsing",
691
+ event: "CONFIRM",
692
+ effects: [
693
+ ["render-ui", "modal", null],
694
+ ...curriculumBrowsingEffects
695
+ ]
696
+ },
697
+ {
698
+ from: "enrolling",
699
+ to: "viewing",
700
+ event: "CANCEL",
701
+ effects: [
702
+ ["render-ui", "modal", null],
703
+ ...courseDetailEffects
704
+ ]
705
+ },
706
+ {
707
+ from: "viewing",
708
+ to: "browsing",
709
+ event: "BACK",
710
+ effects: [
711
+ ...curriculumBrowsingEffects
712
+ ]
713
+ }
714
+ ]
715
+ }
716
+ }
717
+ ],
718
+ pages: [
719
+ {
720
+ name: "CurriculumPage",
721
+ path: "/curriculum",
722
+ isInitial: true,
723
+ traits: [{ ref: "CurriculumControl" }]
724
+ }
725
+ ]
726
+ }
727
+ ]
728
+ };
729
+ var EDUCATION_BEHAVIORS = [
730
+ QUIZ_BEHAVIOR,
731
+ PROGRESS_TRACKER_BEHAVIOR,
732
+ GRADING_BEHAVIOR,
733
+ CURRICULUM_BEHAVIOR
734
+ ];
735
+
736
+ export { CURRICULUM_BEHAVIOR, EDUCATION_BEHAVIORS, GRADING_BEHAVIOR, PROGRESS_TRACKER_BEHAVIOR, QUIZ_BEHAVIOR };
737
+ //# sourceMappingURL=education.js.map
738
+ //# sourceMappingURL=education.js.map