@almadar/std 16.243.0 → 16.244.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.
- package/behaviors/behaviors-registry.json +72537 -31220
- package/behaviors/lolo/agent/atoms/std-agent-context.lolo +24 -4
- package/behaviors/lolo/agent/atoms/std-agent-memory.lolo +20 -5
- package/behaviors/lolo/agent/atoms/std-agent-proposal.lolo +550 -0
- package/behaviors/lolo/agent/atoms/std-agent-session.lolo +284 -25
- package/behaviors/lolo/agent/atoms/std-agent-suggestions.lolo +841 -0
- package/behaviors/lolo/agent/atoms/std-agent-tool-loop.lolo +58 -8
- package/behaviors/lolo/agent/organisms/std-agent-assistant.lolo +1 -0
- package/behaviors/lolo/infra/atoms/std-page-treat.lolo +28 -1
- package/behaviors/lolo/ui/avl/atoms/ui-avl-state-machine.lolo +22 -0
- package/behaviors/lolo/ui/avl/atoms/ui-avl-transition-explainer.lolo +175 -0
- package/behaviors/lolo/ui/avl/atoms/ui-module-card.lolo +22 -0
- package/behaviors/lolo/ui/core/atoms/std-app-layout.lolo +23 -4
- package/behaviors/lolo/ui/core/atoms/std-hero.lolo +72 -33
- package/behaviors/lolo/ui/core/molecules/ui-agent-chat-feed.lolo +1 -1
- package/behaviors/lolo/ui/core/molecules/ui-markdown-content.lolo +54 -0
- package/behaviors/lolo/ui/core/molecules/ui-upload-drop-zone.lolo +5 -0
- package/behaviors/lolo/ui/core/organisms/ui-segment-renderer.lolo +127 -3
- package/behaviors/lolo/ui/core/organisms/ui-state-machine-view.lolo +22 -0
- package/behaviors/lolo/ui/core/templates/ui-dashboard-layout.lolo +2 -2
- package/behaviors/lolo/ui/learning/atoms/std-learn-arrangement.lolo +87 -17
- package/behaviors/lolo/ui/learning/atoms/std-learn-classify.lolo +172 -37
- package/behaviors/lolo/ui/learning/atoms/std-learn-coupled-sim.lolo +183 -70
- package/behaviors/lolo/ui/learning/atoms/std-learn-derivation.lolo +78 -13
- package/behaviors/lolo/ui/learning/atoms/std-learn-diagram.lolo +58 -2
- package/behaviors/lolo/ui/learning/atoms/std-learn-doser.lolo +107 -12
- package/behaviors/lolo/ui/learning/atoms/std-learn-estimate.lolo +83 -10
- package/behaviors/lolo/ui/learning/atoms/std-learn-goal-seek.lolo +130 -9
- package/behaviors/lolo/ui/learning/atoms/std-learn-grid-sim.lolo +143 -59
- package/behaviors/lolo/ui/learning/atoms/std-learn-hotspot.lolo +96 -22
- package/behaviors/lolo/ui/learning/atoms/std-learn-live-sim.lolo +66 -5
- package/behaviors/lolo/ui/learning/atoms/std-learn-predict.lolo +84 -6
- package/behaviors/lolo/ui/learning/atoms/std-learn-sandbox.lolo +80 -14
- package/behaviors/lolo/ui/learning/atoms/std-learn-scatter-fit.lolo +99 -5
- package/behaviors/lolo/ui/learning/atoms/std-learn-scenario.lolo +81 -7
- package/behaviors/lolo/ui/learning/atoms/std-learn-speed-drill.lolo +83 -7
- package/behaviors/lolo/ui/learning/atoms/std-learn-stepper.lolo +224 -99
- package/behaviors/lolo/ui/learning/atoms/std-learn-tour-3d.lolo +63 -2
- package/behaviors/lolo/ui/learning/atoms/std-learn-trace-player.lolo +99 -38
- package/behaviors/lolo/ui/learning/atoms/std-learn-transport.lolo +7 -7
- package/behaviors/lolo/ui/learning/atoms/std-learn-tree.lolo +69 -4
- package/behaviors/lolo-behavior-contracts.json +1 -1
- package/behaviors/registry/agent/atoms/std-agent-context.orb +205 -6
- package/behaviors/registry/agent/atoms/std-agent-memory.orb +146 -4
- package/behaviors/registry/agent/atoms/std-agent-proposal.orb +1972 -0
- package/behaviors/registry/agent/atoms/std-agent-session.orb +2021 -597
- package/behaviors/registry/agent/atoms/std-agent-suggestions.orb +5079 -0
- package/behaviors/registry/agent/atoms/std-agent-tool-loop.orb +287 -5
- package/behaviors/registry/agent/organisms/std-agent-assistant.orb +7 -0
- package/behaviors/registry/factory-signatures.json +1 -1
- package/behaviors/registry/infra/atoms/std-page-treat.orb +327 -2
- package/behaviors/registry/ui/avl/atoms/ui-avl-state-machine.orb +134 -0
- package/behaviors/registry/ui/avl/atoms/ui-avl-transition-explainer.orb +678 -0
- package/behaviors/registry/ui/avl/atoms/ui-module-card.orb +122 -0
- package/behaviors/registry/ui/core/atoms/std-app-layout.orb +73 -4
- package/behaviors/registry/ui/core/atoms/std-hero.orb +174 -97
- package/behaviors/registry/ui/core/molecules/ui-markdown-content.orb +204 -1
- package/behaviors/registry/ui/core/molecules/ui-upload-drop-zone.orb +12 -0
- package/behaviors/registry/ui/core/organisms/ui-segment-renderer.orb +683 -30
- package/behaviors/registry/ui/learning/atoms/std-learn-arrangement.orb +748 -21
- package/behaviors/registry/ui/learning/atoms/std-learn-classify.orb +1429 -41
- package/behaviors/registry/ui/learning/atoms/std-learn-coupled-sim.orb +1031 -185
- package/behaviors/registry/ui/learning/atoms/std-learn-derivation.orb +807 -132
- package/behaviors/registry/ui/learning/atoms/std-learn-diagram.orb +553 -6
- package/behaviors/registry/ui/learning/atoms/std-learn-doser.orb +987 -21
- package/behaviors/registry/ui/learning/atoms/std-learn-estimate.orb +582 -16
- package/behaviors/registry/ui/learning/atoms/std-learn-goal-seek.orb +954 -13
- package/behaviors/registry/ui/learning/atoms/std-learn-grid-sim.orb +828 -88
- package/behaviors/registry/ui/learning/atoms/std-learn-hotspot.orb +730 -28
- package/behaviors/registry/ui/learning/atoms/std-learn-live-sim.orb +479 -9
- package/behaviors/registry/ui/learning/atoms/std-learn-predict.orb +797 -46
- package/behaviors/registry/ui/learning/atoms/std-learn-sandbox.orb +757 -58
- package/behaviors/registry/ui/learning/atoms/std-learn-scatter-fit.orb +1176 -164
- package/behaviors/registry/ui/learning/atoms/std-learn-scenario.orb +599 -12
- package/behaviors/registry/ui/learning/atoms/std-learn-speed-drill.orb +832 -150
- package/behaviors/registry/ui/learning/atoms/std-learn-stepper.orb +1561 -127
- package/behaviors/registry/ui/learning/atoms/std-learn-tour-3d.orb +655 -6
- package/behaviors/registry/ui/learning/atoms/std-learn-trace-player.orb +634 -43
- package/behaviors/registry/ui/learning/atoms/std-learn-transport.orb +85 -31
- package/behaviors/registry/ui/learning/atoms/std-learn-tree.orb +425 -9
- package/canonical-operators.json +45 -2
- package/dist/behaviors/exports-reader.js +16667 -7868
- package/dist/behaviors/functions/index.d.ts +711 -32
- package/dist/behaviors/functions/index.js +16651 -7869
- package/dist/behaviors/index.d.ts +1 -1
- package/dist/behaviors/index.js +16668 -7869
- package/dist/behaviors/query.js +16667 -7868
- package/dist/behaviors-embeddings.hash.json +3 -3
- package/dist/behaviors-embeddings.json +77 -53
- package/dist/behaviors-registry.json +72537 -31220
- package/dist/index.d.ts +3 -3
- package/dist/index.js +16101 -7275
- package/dist/knob-embeddings.hash.json +3 -3
- package/dist/knob-embeddings.json +11617 -1225
- package/dist/modules/anim.d.ts +1 -1
- package/dist/modules/array.d.ts +1 -1
- package/dist/modules/async.d.ts +1 -1
- package/dist/modules/behavior.d.ts +1 -1
- package/dist/modules/browser.d.ts +1 -1
- package/dist/modules/composition.d.ts +1 -1
- package/dist/modules/contract.d.ts +1 -1
- package/dist/modules/core.d.ts +1 -1
- package/dist/modules/core.js +29 -2
- package/dist/modules/data.d.ts +1 -1
- package/dist/modules/ease.d.ts +1 -1
- package/dist/modules/format.d.ts +1 -1
- package/dist/modules/geo.d.ts +1 -1
- package/dist/modules/graph.d.ts +1 -1
- package/dist/modules/grid.d.ts +1 -1
- package/dist/modules/i18n.d.ts +1 -1
- package/dist/modules/index.d.ts +1 -1
- package/dist/modules/index.js +29 -2
- package/dist/modules/integration.d.ts +1 -1
- package/dist/modules/json.d.ts +1 -1
- package/dist/modules/llm.d.ts +1 -1
- package/dist/modules/math.d.ts +1 -1
- package/dist/modules/memory.d.ts +1 -1
- package/dist/modules/nn.d.ts +1 -1
- package/dist/modules/noise.d.ts +1 -1
- package/dist/modules/object.d.ts +1 -1
- package/dist/modules/os.d.ts +1 -1
- package/dist/modules/path.d.ts +1 -1
- package/dist/modules/prob.d.ts +1 -1
- package/dist/modules/session.d.ts +1 -1
- package/dist/modules/str.d.ts +1 -1
- package/dist/modules/tensor.d.ts +1 -1
- package/dist/modules/time.d.ts +1 -1
- package/dist/modules/trace.d.ts +1 -1
- package/dist/modules/train.d.ts +1 -1
- package/dist/modules/validate.d.ts +1 -1
- package/dist/modules/vector.d.ts +1 -1
- package/dist/modules/workspace.d.ts +1 -1
- package/dist/registry/factory-signatures.json +1 -1
- package/dist/registry.d.ts +2 -2
- package/dist/registry.js +29 -2
- package/dist/{types-Cdb321uM.d.ts → types-Y-yYWEOX.d.ts} +1 -1
- package/i18n/ar.json +3 -1
- package/i18n/en.json +2 -0
- package/i18n/sl.json +3 -1
- package/package.json +3 -3
|
@@ -47,6 +47,7 @@ orbital LearnArrangementOrbital {
|
|
|
47
47
|
entity LearnArrangementScene [runtime] {
|
|
48
48
|
id : string!
|
|
49
49
|
active : boolean = false
|
|
50
|
+
items : [LearnArrangementItem]
|
|
50
51
|
title : string
|
|
51
52
|
totalItems : number
|
|
52
53
|
placedIds : [string]
|
|
@@ -60,10 +61,11 @@ orbital LearnArrangementOrbital {
|
|
|
60
61
|
initial: idle
|
|
61
62
|
|
|
62
63
|
state idle {
|
|
63
|
-
INIT -> idle when (== @config.matchMode "")
|
|
64
|
+
INIT -> idle when (and (== @config.matchMode "") (== @config.rosterSource "config"))
|
|
65
|
+
(set @entity.items @config.items)
|
|
64
66
|
(set @entity.active true)
|
|
65
67
|
(set @entity.title @config.title)
|
|
66
|
-
(set @entity.totalItems (array/len @
|
|
68
|
+
(set @entity.totalItems (array/len @entity.items))
|
|
67
69
|
(set @entity.placedIds [])
|
|
68
70
|
(set @entity.checked false)
|
|
69
71
|
(set @entity.correctCount 0)
|
|
@@ -73,7 +75,7 @@ orbital LearnArrangementOrbital {
|
|
|
73
75
|
(slotShapes (array/flatten (array/map (array/range @entity.totalItems) (fn i (let (
|
|
74
76
|
(placedId (if (< @i @placedCount) (array/nth @entity.placedIds @i) ""))
|
|
75
77
|
(filled (!= @placedId ""))
|
|
76
|
-
(item (if @filled (array/find @
|
|
78
|
+
(item (if @filled (array/find @entity.items (fn it (== (object/get @it id) @placedId))) null))
|
|
77
79
|
(label (if @filled (object/get @item label) ""))
|
|
78
80
|
(correctForSlot (if @filled (== (object/get @item correctPosition) @i) false))
|
|
79
81
|
(fillColor (if (not @filled) @config.emptySlotColor (if @entity.checked (if @correctForSlot @config.correctColor @config.incorrectColor) @config.pendingColor)))
|
|
@@ -100,7 +102,7 @@ orbital LearnArrangementOrbital {
|
|
|
100
102
|
{ type: badge, label: (if @entity.checked (if (== @entity.correctCount @entity.totalItems) "Correct" (str/concat @entity.correctCount " / " @entity.totalItems " correct")) (str/concat (array/len @entity.placedIds) " / " @entity.totalItems " placed")), variant: (if @entity.checked (if (== @entity.correctCount @entity.totalItems) "success" "error") "neutral") }
|
|
101
103
|
] },
|
|
102
104
|
{ type: math-canvas, width: @config.width, height: @config.height, xMin: 0, xMax: @config.width, yMin: 0, yMax: @config.height, showAxes: false, showGrid: false, gridStep: 1, curves: [], points: [], vectors: [], shapes: @entity.slotShapes, interactive: @config.interactive, animate: @config.animate, keyMap: { Space: CHECK, Backspace: UNDO, KeyR: RETRY } },
|
|
103
|
-
{ type: stack, direction: vertical, gap: sm, children: (array/map (array/filter @
|
|
105
|
+
{ type: stack, direction: vertical, gap: sm, children: (array/map (array/filter @entity.items (fn it (not (array/includes @entity.placedIds (object/get @it id))))) (fn it { type: button, action: PLACE, actionPayload: { itemId: (object/get @it id) }, label: (if (!= (object/get @it hint "") "") (str/concat (object/get @it label) " — " (object/get @it hint "")) (object/get @it label)), variant: secondary, size: lg, disabled: @entity.checked })) },
|
|
104
106
|
{ type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: [
|
|
105
107
|
{ type: button, action: CHECK, label: @config.checkLabel, icon: "check", variant: primary, disabled: (if (>= (array/len @entity.placedIds) @entity.totalItems) false true) },
|
|
106
108
|
{ type: button, action: UNDO, label: @config.undoLabel, icon: "chevron-left", variant: secondary, disabled: (if (> (array/len @entity.placedIds) 0) false true) },
|
|
@@ -116,10 +118,11 @@ orbital LearnArrangementOrbital {
|
|
|
116
118
|
(set @entity.active false)
|
|
117
119
|
(render-ui main null)
|
|
118
120
|
|
|
119
|
-
MODE_SELECTED -> idle when (== ?mode @config.matchMode)
|
|
121
|
+
MODE_SELECTED -> idle when (and (== ?mode @config.matchMode) (== @config.rosterSource "config"))
|
|
122
|
+
(set @entity.items @config.items)
|
|
120
123
|
(set @entity.active true)
|
|
121
124
|
(set @entity.title @config.title)
|
|
122
|
-
(set @entity.totalItems (array/len @
|
|
125
|
+
(set @entity.totalItems (array/len @entity.items))
|
|
123
126
|
(set @entity.placedIds [])
|
|
124
127
|
(set @entity.checked false)
|
|
125
128
|
(set @entity.correctCount 0)
|
|
@@ -129,7 +132,7 @@ orbital LearnArrangementOrbital {
|
|
|
129
132
|
(slotShapes (array/flatten (array/map (array/range @entity.totalItems) (fn i (let (
|
|
130
133
|
(placedId (if (< @i @placedCount) (array/nth @entity.placedIds @i) ""))
|
|
131
134
|
(filled (!= @placedId ""))
|
|
132
|
-
(item (if @filled (array/find @
|
|
135
|
+
(item (if @filled (array/find @entity.items (fn it (== (object/get @it id) @placedId))) null))
|
|
133
136
|
(label (if @filled (object/get @item label) ""))
|
|
134
137
|
(correctForSlot (if @filled (== (object/get @item correctPosition) @i) false))
|
|
135
138
|
(fillColor (if (not @filled) @config.emptySlotColor (if @entity.checked (if @correctForSlot @config.correctColor @config.incorrectColor) @config.pendingColor)))
|
|
@@ -156,7 +159,7 @@ orbital LearnArrangementOrbital {
|
|
|
156
159
|
{ type: badge, label: (if @entity.checked (if (== @entity.correctCount @entity.totalItems) "Correct" (str/concat @entity.correctCount " / " @entity.totalItems " correct")) (str/concat (array/len @entity.placedIds) " / " @entity.totalItems " placed")), variant: (if @entity.checked (if (== @entity.correctCount @entity.totalItems) "success" "error") "neutral") }
|
|
157
160
|
] },
|
|
158
161
|
{ type: math-canvas, width: @config.width, height: @config.height, xMin: 0, xMax: @config.width, yMin: 0, yMax: @config.height, showAxes: false, showGrid: false, gridStep: 1, curves: [], points: [], vectors: [], shapes: @entity.slotShapes, interactive: @config.interactive, animate: @config.animate, keyMap: { Space: CHECK, Backspace: UNDO, KeyR: RETRY } },
|
|
159
|
-
{ type: stack, direction: vertical, gap: sm, children: (array/map (array/filter @
|
|
162
|
+
{ type: stack, direction: vertical, gap: sm, children: (array/map (array/filter @entity.items (fn it (not (array/includes @entity.placedIds (object/get @it id))))) (fn it { type: button, action: PLACE, actionPayload: { itemId: (object/get @it id) }, label: (if (!= (object/get @it hint "") "") (str/concat (object/get @it label) " — " (object/get @it hint "")) (object/get @it label)), variant: secondary, size: lg, disabled: @entity.checked })) },
|
|
160
163
|
{ type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: [
|
|
161
164
|
{ type: button, action: CHECK, label: @config.checkLabel, icon: "check", variant: primary, disabled: (if (>= (array/len @entity.placedIds) @entity.totalItems) false true) },
|
|
162
165
|
{ type: button, action: UNDO, label: @config.undoLabel, icon: "chevron-left", variant: secondary, disabled: (if (> (array/len @entity.placedIds) 0) false true) },
|
|
@@ -168,6 +171,63 @@ orbital LearnArrangementOrbital {
|
|
|
168
171
|
]
|
|
169
172
|
})
|
|
170
173
|
|
|
174
|
+
ROSTER_LOADED -> idle when (and (== @config.rosterSource "event") (and (== ?mode @config.matchMode) (> (array/len ?items) 0)))
|
|
175
|
+
(set @entity.items ?items)
|
|
176
|
+
(set @entity.active true)
|
|
177
|
+
(set @entity.title @config.title)
|
|
178
|
+
(set @entity.totalItems (array/len @entity.items))
|
|
179
|
+
(set @entity.placedIds [])
|
|
180
|
+
(set @entity.checked false)
|
|
181
|
+
(set @entity.correctCount 0)
|
|
182
|
+
(set @entity.verdict "")
|
|
183
|
+
(let (
|
|
184
|
+
(placedCount (array/len @entity.placedIds))
|
|
185
|
+
(slotShapes (array/flatten (array/map (array/range @entity.totalItems) (fn i (let (
|
|
186
|
+
(placedId (if (< @i @placedCount) (array/nth @entity.placedIds @i) ""))
|
|
187
|
+
(filled (!= @placedId ""))
|
|
188
|
+
(item (if @filled (array/find @entity.items (fn it (== (object/get @it id) @placedId))) null))
|
|
189
|
+
(label (if @filled (object/get @item label) ""))
|
|
190
|
+
(correctForSlot (if @filled (== (object/get @item correctPosition) @i) false))
|
|
191
|
+
(fillColor (if (not @filled) @config.emptySlotColor (if @entity.checked (if @correctForSlot @config.correctColor @config.incorrectColor) @config.pendingColor)))
|
|
192
|
+
(bx (+ @config.slotLeft (* @i @config.slotSpacing)))
|
|
193
|
+
)
|
|
194
|
+
[
|
|
195
|
+
{ type: "rect", id: (str/concat "slot-" @i), x: @bx, y: @config.slotY, width: @config.slotWidth, height: @config.slotHeight, tone: @config.slotBorderColor, fillTone: @fillColor, fillStyle: "tint" },
|
|
196
|
+
{ type: "text", id: (str/concat "slot-label-" @i), x: (+ @bx (/ @config.slotWidth 2)), y: (+ @config.slotY (/ @config.slotHeight 2) 5), text: (if @filled @label (str/concat "" (+ @i 1))), textSize: @config.slotFontSize, align: "center", tone: @config.slotTextColor }
|
|
197
|
+
]
|
|
198
|
+
)))))
|
|
199
|
+
)
|
|
200
|
+
(set @entity.slotShapes @slotShapes)
|
|
201
|
+
)
|
|
202
|
+
(render-ui main {
|
|
203
|
+
type: box
|
|
204
|
+
padding: md
|
|
205
|
+
children: [
|
|
206
|
+
{ type: stack, direction: vertical, gap: md, children: [
|
|
207
|
+
{ type: stack, direction: horizontal, justify: between, align: start, gap: md, children: [
|
|
208
|
+
{ type: stack, direction: vertical, gap: xs, children: [
|
|
209
|
+
{ type: typography, variant: h4, content: @entity.title },
|
|
210
|
+
(if (== @config.summary "") null { type: typography, variant: body2, color: muted, content: @config.summary })
|
|
211
|
+
] },
|
|
212
|
+
{ type: badge, label: (if @entity.checked (if (== @entity.correctCount @entity.totalItems) "Correct" (str/concat @entity.correctCount " / " @entity.totalItems " correct")) (str/concat (array/len @entity.placedIds) " / " @entity.totalItems " placed")), variant: (if @entity.checked (if (== @entity.correctCount @entity.totalItems) "success" "error") "neutral") }
|
|
213
|
+
] },
|
|
214
|
+
{ type: math-canvas, width: @config.width, height: @config.height, xMin: 0, xMax: @config.width, yMin: 0, yMax: @config.height, showAxes: false, showGrid: false, gridStep: 1, curves: [], points: [], vectors: [], shapes: @entity.slotShapes, interactive: @config.interactive, animate: @config.animate, keyMap: { Space: CHECK, Backspace: UNDO, KeyR: RETRY } },
|
|
215
|
+
{ type: stack, direction: vertical, gap: sm, children: (array/map (array/filter @entity.items (fn it (not (array/includes @entity.placedIds (object/get @it id))))) (fn it { type: button, action: PLACE, actionPayload: { itemId: (object/get @it id) }, label: (if (!= (object/get @it hint "") "") (str/concat (object/get @it label) " — " (object/get @it hint "")) (object/get @it label)), variant: secondary, size: lg, disabled: @entity.checked })) },
|
|
216
|
+
{ type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: [
|
|
217
|
+
{ type: button, action: CHECK, label: @config.checkLabel, icon: "check", variant: primary, disabled: (if (>= (array/len @entity.placedIds) @entity.totalItems) false true) },
|
|
218
|
+
{ type: button, action: UNDO, label: @config.undoLabel, icon: "chevron-left", variant: secondary, disabled: (if (> (array/len @entity.placedIds) 0) false true) },
|
|
219
|
+
{ type: button, action: RETRY, label: @config.retryLabel, icon: "rotate-ccw", variant: ghost },
|
|
220
|
+
{ type: typography, variant: caption, color: muted, content: (str/concat "Placed " (array/len @entity.placedIds) " of " @entity.totalItems) }
|
|
221
|
+
] },
|
|
222
|
+
{ type: typography, variant: body, content: (if @entity.checked @entity.verdict "Tap items to build the sequence in order, then press Check.") }
|
|
223
|
+
] }
|
|
224
|
+
]
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
ROSTER_LOADED -> idle when (and (== @config.rosterSource "event") (not (== ?mode @config.matchMode)))
|
|
228
|
+
(set @entity.active false)
|
|
229
|
+
(render-ui main null)
|
|
230
|
+
|
|
171
231
|
PLACE -> idle when (and (== @entity.active true) (< (array/len @entity.placedIds) @entity.totalItems))
|
|
172
232
|
(set @entity.placedIds (array/append @entity.placedIds ?itemId))
|
|
173
233
|
(set @entity.checked false)
|
|
@@ -178,7 +238,7 @@ orbital LearnArrangementOrbital {
|
|
|
178
238
|
(slotShapes (array/flatten (array/map (array/range @entity.totalItems) (fn i (let (
|
|
179
239
|
(placedId (if (< @i @placedCount) (array/nth @entity.placedIds @i) ""))
|
|
180
240
|
(filled (!= @placedId ""))
|
|
181
|
-
(item (if @filled (array/find @
|
|
241
|
+
(item (if @filled (array/find @entity.items (fn it (== (object/get @it id) @placedId))) null))
|
|
182
242
|
(label (if @filled (object/get @item label) ""))
|
|
183
243
|
(correctForSlot (if @filled (== (object/get @item correctPosition) @i) false))
|
|
184
244
|
(fillColor (if (not @filled) @config.emptySlotColor (if @entity.checked (if @correctForSlot @config.correctColor @config.incorrectColor) @config.pendingColor)))
|
|
@@ -205,7 +265,7 @@ orbital LearnArrangementOrbital {
|
|
|
205
265
|
{ type: badge, label: (if @entity.checked (if (== @entity.correctCount @entity.totalItems) "Correct" (str/concat @entity.correctCount " / " @entity.totalItems " correct")) (str/concat (array/len @entity.placedIds) " / " @entity.totalItems " placed")), variant: (if @entity.checked (if (== @entity.correctCount @entity.totalItems) "success" "error") "neutral") }
|
|
206
266
|
] },
|
|
207
267
|
{ type: math-canvas, width: @config.width, height: @config.height, xMin: 0, xMax: @config.width, yMin: 0, yMax: @config.height, showAxes: false, showGrid: false, gridStep: 1, curves: [], points: [], vectors: [], shapes: @entity.slotShapes, interactive: @config.interactive, animate: @config.animate, keyMap: { Space: CHECK, Backspace: UNDO, KeyR: RETRY } },
|
|
208
|
-
{ type: stack, direction: vertical, gap: sm, children: (array/map (array/filter @
|
|
268
|
+
{ type: stack, direction: vertical, gap: sm, children: (array/map (array/filter @entity.items (fn it (not (array/includes @entity.placedIds (object/get @it id))))) (fn it { type: button, action: PLACE, actionPayload: { itemId: (object/get @it id) }, label: (if (!= (object/get @it hint "") "") (str/concat (object/get @it label) " — " (object/get @it hint "")) (object/get @it label)), variant: secondary, size: lg, disabled: @entity.checked })) },
|
|
209
269
|
{ type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: [
|
|
210
270
|
{ type: button, action: CHECK, label: @config.checkLabel, icon: "check", variant: primary, disabled: (if (>= (array/len @entity.placedIds) @entity.totalItems) false true) },
|
|
211
271
|
{ type: button, action: UNDO, label: @config.undoLabel, icon: "chevron-left", variant: secondary, disabled: (if (> (array/len @entity.placedIds) 0) false true) },
|
|
@@ -227,7 +287,7 @@ orbital LearnArrangementOrbital {
|
|
|
227
287
|
(slotShapes (array/flatten (array/map (array/range @entity.totalItems) (fn i (let (
|
|
228
288
|
(placedId (if (< @i @placedCount) (array/nth @entity.placedIds @i) ""))
|
|
229
289
|
(filled (!= @placedId ""))
|
|
230
|
-
(item (if @filled (array/find @
|
|
290
|
+
(item (if @filled (array/find @entity.items (fn it (== (object/get @it id) @placedId))) null))
|
|
231
291
|
(label (if @filled (object/get @item label) ""))
|
|
232
292
|
(correctForSlot (if @filled (== (object/get @item correctPosition) @i) false))
|
|
233
293
|
(fillColor (if (not @filled) @config.emptySlotColor (if @entity.checked (if @correctForSlot @config.correctColor @config.incorrectColor) @config.pendingColor)))
|
|
@@ -254,7 +314,7 @@ orbital LearnArrangementOrbital {
|
|
|
254
314
|
{ type: badge, label: (if @entity.checked (if (== @entity.correctCount @entity.totalItems) "Correct" (str/concat @entity.correctCount " / " @entity.totalItems " correct")) (str/concat (array/len @entity.placedIds) " / " @entity.totalItems " placed")), variant: (if @entity.checked (if (== @entity.correctCount @entity.totalItems) "success" "error") "neutral") }
|
|
255
315
|
] },
|
|
256
316
|
{ type: math-canvas, width: @config.width, height: @config.height, xMin: 0, xMax: @config.width, yMin: 0, yMax: @config.height, showAxes: false, showGrid: false, gridStep: 1, curves: [], points: [], vectors: [], shapes: @entity.slotShapes, interactive: @config.interactive, animate: @config.animate, keyMap: { Space: CHECK, Backspace: UNDO, KeyR: RETRY } },
|
|
257
|
-
{ type: stack, direction: vertical, gap: sm, children: (array/map (array/filter @
|
|
317
|
+
{ type: stack, direction: vertical, gap: sm, children: (array/map (array/filter @entity.items (fn it (not (array/includes @entity.placedIds (object/get @it id))))) (fn it { type: button, action: PLACE, actionPayload: { itemId: (object/get @it id) }, label: (if (!= (object/get @it hint "") "") (str/concat (object/get @it label) " — " (object/get @it hint "")) (object/get @it label)), variant: secondary, size: lg, disabled: @entity.checked })) },
|
|
258
318
|
{ type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: [
|
|
259
319
|
{ type: button, action: CHECK, label: @config.checkLabel, icon: "check", variant: primary, disabled: (if (>= (array/len @entity.placedIds) @entity.totalItems) false true) },
|
|
260
320
|
{ type: button, action: UNDO, label: @config.undoLabel, icon: "chevron-left", variant: secondary, disabled: (if (> (array/len @entity.placedIds) 0) false true) },
|
|
@@ -270,7 +330,7 @@ orbital LearnArrangementOrbital {
|
|
|
270
330
|
(let (
|
|
271
331
|
(correctCount (array/reduce (array/range @entity.totalItems) 0 (fn acc i (let (
|
|
272
332
|
(placedId (array/nth @entity.placedIds @i))
|
|
273
|
-
(item (array/find @
|
|
333
|
+
(item (array/find @entity.items (fn it (== (object/get @it id) @placedId))))
|
|
274
334
|
)
|
|
275
335
|
(if (== (object/get @item correctPosition) @i) (+ @acc 1) @acc)))))
|
|
276
336
|
(verdictText (if (== @correctCount @entity.totalItems) "All correct — well done!" (str/concat @correctCount " of " @entity.totalItems " correct — review the highlighted slots.")))
|
|
@@ -286,7 +346,7 @@ orbital LearnArrangementOrbital {
|
|
|
286
346
|
(slotShapes (array/flatten (array/map (array/range @entity.totalItems) (fn i (let (
|
|
287
347
|
(placedId (if (< @i @placedCount) (array/nth @entity.placedIds @i) ""))
|
|
288
348
|
(filled (!= @placedId ""))
|
|
289
|
-
(item (if @filled (array/find @
|
|
349
|
+
(item (if @filled (array/find @entity.items (fn it (== (object/get @it id) @placedId))) null))
|
|
290
350
|
(label (if @filled (object/get @item label) ""))
|
|
291
351
|
(correctForSlot (if @filled (== (object/get @item correctPosition) @i) false))
|
|
292
352
|
(fillColor (if (not @filled) @config.emptySlotColor (if @entity.checked (if @correctForSlot @config.correctColor @config.incorrectColor) @config.pendingColor)))
|
|
@@ -313,7 +373,7 @@ orbital LearnArrangementOrbital {
|
|
|
313
373
|
{ type: badge, label: (if @entity.checked (if (== @entity.correctCount @entity.totalItems) "Correct" (str/concat @entity.correctCount " / " @entity.totalItems " correct")) (str/concat (array/len @entity.placedIds) " / " @entity.totalItems " placed")), variant: (if @entity.checked (if (== @entity.correctCount @entity.totalItems) "success" "error") "neutral") }
|
|
314
374
|
] },
|
|
315
375
|
{ type: math-canvas, width: @config.width, height: @config.height, xMin: 0, xMax: @config.width, yMin: 0, yMax: @config.height, showAxes: false, showGrid: false, gridStep: 1, curves: [], points: [], vectors: [], shapes: @entity.slotShapes, interactive: @config.interactive, animate: @config.animate, keyMap: { Space: CHECK, Backspace: UNDO, KeyR: RETRY } },
|
|
316
|
-
{ type: stack, direction: vertical, gap: sm, children: (array/map (array/filter @
|
|
376
|
+
{ type: stack, direction: vertical, gap: sm, children: (array/map (array/filter @entity.items (fn it (not (array/includes @entity.placedIds (object/get @it id))))) (fn it { type: button, action: PLACE, actionPayload: { itemId: (object/get @it id) }, label: (if (!= (object/get @it hint "") "") (str/concat (object/get @it label) " — " (object/get @it hint "")) (object/get @it label)), variant: secondary, size: lg, disabled: @entity.checked })) },
|
|
317
377
|
{ type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: [
|
|
318
378
|
{ type: button, action: CHECK, label: @config.checkLabel, icon: "check", variant: primary, disabled: (if (>= (array/len @entity.placedIds) @entity.totalItems) false true) },
|
|
319
379
|
{ type: button, action: UNDO, label: @config.undoLabel, icon: "chevron-left", variant: secondary, disabled: (if (> (array/len @entity.placedIds) 0) false true) },
|
|
@@ -337,7 +397,7 @@ orbital LearnArrangementOrbital {
|
|
|
337
397
|
(slotShapes (array/flatten (array/map (array/range @entity.totalItems) (fn i (let (
|
|
338
398
|
(placedId (if (< @i @placedCount) (array/nth @entity.placedIds @i) ""))
|
|
339
399
|
(filled (!= @placedId ""))
|
|
340
|
-
(item (if @filled (array/find @
|
|
400
|
+
(item (if @filled (array/find @entity.items (fn it (== (object/get @it id) @placedId))) null))
|
|
341
401
|
(label (if @filled (object/get @item label) ""))
|
|
342
402
|
(correctForSlot (if @filled (== (object/get @item correctPosition) @i) false))
|
|
343
403
|
(fillColor (if (not @filled) @config.emptySlotColor (if @entity.checked (if @correctForSlot @config.correctColor @config.incorrectColor) @config.pendingColor)))
|
|
@@ -364,7 +424,7 @@ orbital LearnArrangementOrbital {
|
|
|
364
424
|
{ type: badge, label: (if @entity.checked (if (== @entity.correctCount @entity.totalItems) "Correct" (str/concat @entity.correctCount " / " @entity.totalItems " correct")) (str/concat (array/len @entity.placedIds) " / " @entity.totalItems " placed")), variant: (if @entity.checked (if (== @entity.correctCount @entity.totalItems) "success" "error") "neutral") }
|
|
365
425
|
] },
|
|
366
426
|
{ type: math-canvas, width: @config.width, height: @config.height, xMin: 0, xMax: @config.width, yMin: 0, yMax: @config.height, showAxes: false, showGrid: false, gridStep: 1, curves: [], points: [], vectors: [], shapes: @entity.slotShapes, interactive: @config.interactive, animate: @config.animate, keyMap: { Space: CHECK, Backspace: UNDO, KeyR: RETRY } },
|
|
367
|
-
{ type: stack, direction: vertical, gap: sm, children: (array/map (array/filter @
|
|
427
|
+
{ type: stack, direction: vertical, gap: sm, children: (array/map (array/filter @entity.items (fn it (not (array/includes @entity.placedIds (object/get @it id))))) (fn it { type: button, action: PLACE, actionPayload: { itemId: (object/get @it id) }, label: (if (!= (object/get @it hint "") "") (str/concat (object/get @it label) " — " (object/get @it hint "")) (object/get @it label)), variant: secondary, size: lg, disabled: @entity.checked })) },
|
|
368
428
|
{ type: stack, direction: horizontal, align: center, gap: sm, wrap: true, children: [
|
|
369
429
|
{ type: button, action: CHECK, label: @config.checkLabel, icon: "check", variant: primary, disabled: (if (>= (array/len @entity.placedIds) @entity.totalItems) false true) },
|
|
370
430
|
{ type: button, action: UNDO, label: @config.undoLabel, icon: "chevron-left", variant: secondary, disabled: (if (> (array/len @entity.placedIds) 0) false true) },
|
|
@@ -384,6 +444,12 @@ orbital LearnArrangementOrbital {
|
|
|
384
444
|
}
|
|
385
445
|
@description "Lab router broadcast naming the active mode; this instrument renders when the mode equals matchMode, otherwise renders null."
|
|
386
446
|
@tier "domain"
|
|
447
|
+
ROSTER_LOADED {
|
|
448
|
+
mode : string!
|
|
449
|
+
items : [LearnArrangementItem]!
|
|
450
|
+
}
|
|
451
|
+
@description "Runtime content feed, honoured only when rosterSource is event — mode names the instrument it is for (the matchMode it carries, blank when standalone) and items is the roster to order; a matching instrument re-initialises from it exactly as INIT does from config, any other instrument hides."
|
|
452
|
+
@tier "domain"
|
|
387
453
|
PLACE {
|
|
388
454
|
itemId : string
|
|
389
455
|
}
|
|
@@ -454,6 +520,10 @@ orbital LearnArrangementOrbital {
|
|
|
454
520
|
@label "Animate"
|
|
455
521
|
@description "Enable continuous redraw loop."
|
|
456
522
|
@tier "presentation"
|
|
523
|
+
rosterSource : "config" | "event" = "config"
|
|
524
|
+
@label "Roster Source"
|
|
525
|
+
@description "Where the roster comes from: config reads the items knob(s) at INIT; event waits for ROSTER_LOADED and takes the roster from its payload."
|
|
526
|
+
@tier "domain"
|
|
457
527
|
items : [LearnArrangementItem] = [
|
|
458
528
|
{ id: "1", label: "Boil water in a kettle", correctPosition: 0, hint: "What has to happen before anything can be poured?" },
|
|
459
529
|
{ id: "2", label: "Place a tea bag in the cup", correctPosition: 1, hint: "The bag goes in before the water does." },
|