@almadar/std 16.241.0 → 16.242.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 (109) hide show
  1. package/behaviors/behaviors-registry.json +4650 -535
  2. package/behaviors/lolo/agent/atoms/std-agent-memory.lolo +38 -1
  3. package/behaviors/lolo/agent/atoms/std-agent-session.lolo +1074 -47
  4. package/behaviors/lolo/agent/atoms/std-agent-tool-loop.lolo +8 -7
  5. package/behaviors/lolo/agent/organisms/std-agent-assistant.lolo +56 -37
  6. package/behaviors/lolo/infra/atoms/std-page-open.lolo +59 -0
  7. package/behaviors/lolo/infra/atoms/std-page-search.lolo +134 -0
  8. package/behaviors/lolo/infra/atoms/std-page-treat.lolo +59 -0
  9. package/behaviors/lolo/infra/atoms/std-page-watch.lolo +86 -0
  10. package/behaviors/lolo/ui/core/atoms/std-book-reader.lolo +25 -1
  11. package/behaviors/lolo/ui/core/atoms/std-card-grid.lolo +9 -0
  12. package/behaviors/lolo/ui/core/atoms/std-doc-page.lolo +153 -0
  13. package/behaviors/lolo/ui/learning/atoms/std-learn-arrangement.lolo +124 -92
  14. package/behaviors/lolo/ui/learning/atoms/std-learn-classify.lolo +114 -55
  15. package/behaviors/lolo/ui/learning/atoms/std-learn-compare.lolo +40 -14
  16. package/behaviors/lolo/ui/learning/atoms/std-learn-coupled-sim.lolo +363 -123
  17. package/behaviors/lolo/ui/learning/atoms/std-learn-derivation.lolo +93 -48
  18. package/behaviors/lolo/ui/learning/atoms/std-learn-diagram.lolo +60 -28
  19. package/behaviors/lolo/ui/learning/atoms/std-learn-doser.lolo +193 -96
  20. package/behaviors/lolo/ui/learning/atoms/std-learn-estimate.lolo +75 -32
  21. package/behaviors/lolo/ui/learning/atoms/std-learn-goal-seek.lolo +142 -86
  22. package/behaviors/lolo/ui/learning/atoms/std-learn-grid-sim.lolo +266 -98
  23. package/behaviors/lolo/ui/learning/atoms/std-learn-hotspot.lolo +103 -65
  24. package/behaviors/lolo/ui/learning/atoms/std-learn-live-sim.lolo +223 -109
  25. package/behaviors/lolo/ui/learning/atoms/std-learn-measure.lolo +232 -64
  26. package/behaviors/lolo/ui/learning/atoms/std-learn-param-explorer.lolo +69 -29
  27. package/behaviors/lolo/ui/learning/atoms/std-learn-perturb.lolo +363 -123
  28. package/behaviors/lolo/ui/learning/atoms/std-learn-predict.lolo +73 -41
  29. package/behaviors/lolo/ui/learning/atoms/std-learn-sample-accumulator.lolo +96 -38
  30. package/behaviors/lolo/ui/learning/atoms/std-learn-sandbox.lolo +65 -45
  31. package/behaviors/lolo/ui/learning/atoms/std-learn-scatter-fit.lolo +243 -117
  32. package/behaviors/lolo/ui/learning/atoms/std-learn-scenario.lolo +76 -28
  33. package/behaviors/lolo/ui/learning/atoms/std-learn-sim-3d.lolo +228 -109
  34. package/behaviors/lolo/ui/learning/atoms/std-learn-speed-drill.lolo +95 -44
  35. package/behaviors/lolo/ui/learning/atoms/std-learn-stepper.lolo +199 -125
  36. package/behaviors/lolo/ui/learning/atoms/std-learn-tour-3d.lolo +92 -48
  37. package/behaviors/lolo/ui/learning/atoms/std-learn-trace-player.lolo +239 -78
  38. package/behaviors/lolo/ui/learning/atoms/std-learn-transport.lolo +147 -38
  39. package/behaviors/lolo/ui/learning/atoms/std-learn-tree.lolo +123 -58
  40. package/behaviors/lolo/ui/learning/atoms/ui-algo-graph-canvas.lolo +22 -0
  41. package/behaviors/lolo/ui/learning/atoms/ui-algorithm-canvas.lolo +26 -0
  42. package/behaviors/lolo/ui/learning/atoms/ui-biology-canvas.lolo +26 -0
  43. package/behaviors/lolo/ui/learning/atoms/ui-chemistry-canvas.lolo +27 -1
  44. package/behaviors/lolo/ui/learning/atoms/ui-learning-canvas.lolo +27 -1
  45. package/behaviors/lolo/ui/learning/atoms/ui-math-canvas.lolo +29 -9
  46. package/behaviors/lolo/ui/learning/atoms/ui-physics-canvas.lolo +26 -0
  47. package/behaviors/lolo-behavior-contracts.json +1 -1
  48. package/behaviors/registry/agent/atoms/std-agent-memory.orb +372 -2
  49. package/behaviors/registry/agent/atoms/std-agent-session.orb +4752 -348
  50. package/behaviors/registry/agent/atoms/std-agent-tool-loop.orb +54 -42
  51. package/behaviors/registry/agent/organisms/std-agent-assistant.orb +356 -122
  52. package/behaviors/registry/factory-signatures.json +1 -1
  53. package/behaviors/registry/infra/atoms/std-page-open.orb +435 -0
  54. package/behaviors/registry/infra/atoms/std-page-search.orb +867 -0
  55. package/behaviors/registry/infra/atoms/std-page-treat.orb +494 -0
  56. package/behaviors/registry/infra/atoms/std-page-watch.orb +554 -0
  57. package/behaviors/registry/ui/core/atoms/std-book-reader.orb +119 -0
  58. package/behaviors/registry/ui/core/atoms/std-card-grid.orb +61 -0
  59. package/behaviors/registry/ui/core/atoms/std-doc-page.orb +594 -0
  60. package/behaviors/registry/ui/learning/atoms/std-learn-arrangement.orb +903 -369
  61. package/behaviors/registry/ui/learning/atoms/std-learn-classify.orb +1002 -232
  62. package/behaviors/registry/ui/learning/atoms/std-learn-compare.orb +253 -74
  63. package/behaviors/registry/ui/learning/atoms/std-learn-coupled-sim.orb +3624 -921
  64. package/behaviors/registry/ui/learning/atoms/std-learn-derivation.orb +685 -144
  65. package/behaviors/registry/ui/learning/atoms/std-learn-diagram.orb +404 -52
  66. package/behaviors/registry/ui/learning/atoms/std-learn-doser.orb +1787 -210
  67. package/behaviors/registry/ui/learning/atoms/std-learn-estimate.orb +699 -71
  68. package/behaviors/registry/ui/learning/atoms/std-learn-goal-seek.orb +1102 -578
  69. package/behaviors/registry/ui/learning/atoms/std-learn-grid-sim.orb +2760 -872
  70. package/behaviors/registry/ui/learning/atoms/std-learn-hotspot.orb +689 -152
  71. package/behaviors/registry/ui/learning/atoms/std-learn-live-sim.orb +1431 -633
  72. package/behaviors/registry/ui/learning/atoms/std-learn-measure.orb +2485 -512
  73. package/behaviors/registry/ui/learning/atoms/std-learn-param-explorer.orb +501 -197
  74. package/behaviors/registry/ui/learning/atoms/std-learn-perturb.orb +3642 -928
  75. package/behaviors/registry/ui/learning/atoms/std-learn-predict.orb +705 -125
  76. package/behaviors/registry/ui/learning/atoms/std-learn-sample-accumulator.orb +624 -114
  77. package/behaviors/registry/ui/learning/atoms/std-learn-sandbox.orb +405 -153
  78. package/behaviors/registry/ui/learning/atoms/std-learn-scatter-fit.orb +1911 -611
  79. package/behaviors/registry/ui/learning/atoms/std-learn-scenario.orb +436 -128
  80. package/behaviors/registry/ui/learning/atoms/std-learn-sim-3d.orb +2482 -485
  81. package/behaviors/registry/ui/learning/atoms/std-learn-speed-drill.orb +896 -192
  82. package/behaviors/registry/ui/learning/atoms/std-learn-stepper.orb +2001 -759
  83. package/behaviors/registry/ui/learning/atoms/std-learn-tour-3d.orb +734 -228
  84. package/behaviors/registry/ui/learning/atoms/std-learn-trace-player.orb +2501 -764
  85. package/behaviors/registry/ui/learning/atoms/std-learn-transport.orb +1591 -173
  86. package/behaviors/registry/ui/learning/atoms/std-learn-tree.orb +883 -122
  87. package/behaviors/registry/ui/learning/atoms/ui-algo-graph-canvas.orb +176 -0
  88. package/behaviors/registry/ui/learning/atoms/ui-algorithm-canvas.orb +211 -0
  89. package/behaviors/registry/ui/learning/atoms/ui-biology-canvas.orb +211 -0
  90. package/behaviors/registry/ui/learning/atoms/ui-chemistry-canvas.orb +212 -1
  91. package/behaviors/registry/ui/learning/atoms/ui-learning-canvas.orb +212 -1
  92. package/behaviors/registry/ui/learning/atoms/ui-math-canvas.orb +203 -9
  93. package/behaviors/registry/ui/learning/atoms/ui-physics-canvas.orb +211 -0
  94. package/behaviors/signatures.lolo +325 -655
  95. package/dist/behaviors/exports-reader.js +16092 -9747
  96. package/dist/behaviors/functions/index.d.ts +1052 -136
  97. package/dist/behaviors/functions/index.js +16063 -9745
  98. package/dist/behaviors/index.d.ts +1 -1
  99. package/dist/behaviors/index.js +16093 -9748
  100. package/dist/behaviors/query.js +16092 -9747
  101. package/dist/behaviors-embeddings.hash.json +3 -3
  102. package/dist/behaviors-embeddings.json +45 -25
  103. package/dist/behaviors-registry.json +4650 -535
  104. package/dist/index.d.ts +1 -1
  105. package/dist/index.js +16093 -9748
  106. package/dist/knob-embeddings.hash.json +3 -3
  107. package/dist/knob-embeddings.json +607 -263
  108. package/dist/registry/factory-signatures.json +1 -1
  109. package/package.json +3 -3
@@ -109,6 +109,24 @@
109
109
  "parent": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
110
110
  "renames": []
111
111
  },
112
+ "evt_01M41KXQV2AA7B73GRTXQA57D2": {
113
+ "bakedName": "TOGGLE_RUN",
114
+ "curName": "TOGGLE_RUN",
115
+ "id": "evt_01M41KXQV2AA7B73GRTXQA57D2",
116
+ "kind": "event",
117
+ "owner": "workspace",
118
+ "parent": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
119
+ "renames": []
120
+ },
121
+ "evt_01M41KXQV2T9G9JXBYSWA8RR3G": {
122
+ "bakedName": "SPEED_SET",
123
+ "curName": "SPEED_SET",
124
+ "id": "evt_01M41KXQV2T9G9JXBYSWA8RR3G",
125
+ "kind": "event",
126
+ "owner": "workspace",
127
+ "parent": "trt_01M07580Z0ZBVSWZ4K8C6V4AV1",
128
+ "renames": []
129
+ },
112
130
  "orb_01M07580Z0K57SKR5RVGYKB7XW": {
113
131
  "bakedName": "GridSimOrbital",
114
132
  "curName": "GridSimOrbital",
@@ -177,6 +195,16 @@
177
195
  "name": "running",
178
196
  "type": "boolean"
179
197
  },
198
+ {
199
+ "default": 1.0,
200
+ "name": "speed",
201
+ "type": "number"
202
+ },
203
+ {
204
+ "default": 0.0,
205
+ "name": "elapsedMs",
206
+ "type": "number"
207
+ },
180
208
  {
181
209
  "items": {
182
210
  "properties": {
@@ -261,7 +289,8 @@
261
289
  "type": "boolean"
262
290
  },
263
291
  "backgroundColor": {
264
- "default": "#f8fafc",
292
+ "default": "",
293
+ "description": "Canvas ground override; empty uses the theme's drawing ground.",
265
294
  "label": "Background Color",
266
295
  "tier": "presentation",
267
296
  "type": "string"
@@ -299,7 +328,7 @@
299
328
  "type": "number"
300
329
  },
301
330
  "lowColor": {
302
- "default": "#bfdbfe",
331
+ "default": "muted",
303
332
  "label": "Low Color",
304
333
  "tier": "presentation",
305
334
  "type": "string"
@@ -312,19 +341,19 @@
312
341
  "type": "string"
313
342
  },
314
343
  "midColor": {
315
- "default": "#60a5fa",
344
+ "default": "series-3",
316
345
  "label": "Mid Color",
317
346
  "tier": "presentation",
318
347
  "type": "string"
319
348
  },
320
349
  "offColor": {
321
- "default": "#e2e8f0",
350
+ "default": "fill",
322
351
  "label": "Off Color",
323
352
  "tier": "presentation",
324
353
  "type": "string"
325
354
  },
326
355
  "onColor": {
327
- "default": "#1d4ed8",
356
+ "default": "series-2",
328
357
  "label": "On Color",
329
358
  "tier": "presentation",
330
359
  "type": "string"
@@ -368,6 +397,13 @@
368
397
  "tier": "presentation",
369
398
  "type": "string"
370
399
  },
400
+ "summary": {
401
+ "default": "",
402
+ "description": "One line under the title saying what the learner is looking at (keep it under ~65 characters). Empty shows no line.",
403
+ "label": "Concept",
404
+ "tier": "presentation",
405
+ "type": "string"
406
+ },
371
407
  "taskText": {
372
408
  "default": "Tap cells to seed the world, then Run — or Step one generation at a time to see the rule at work.",
373
409
  "description": "One-sentence statement of what to explore.",
@@ -377,7 +413,7 @@
377
413
  },
378
414
  "title": {
379
415
  "default": "Grid World",
380
- "description": "Title shown above the grid.",
416
+ "description": "The instrument's name, the header's one hero.",
381
417
  "label": "Title",
382
418
  "tier": "presentation",
383
419
  "type": "string"
@@ -441,6 +477,11 @@
441
477
  "resource": "@entity.cells",
442
478
  "site": "tick"
443
479
  },
480
+ {
481
+ "kind": "set",
482
+ "resource": "@entity.elapsedMs",
483
+ "site": "tick"
484
+ },
444
485
  {
445
486
  "kind": "set",
446
487
  "resource": "@entity.generation"
@@ -454,6 +495,10 @@
454
495
  "kind": "set",
455
496
  "resource": "@entity.running"
456
497
  },
498
+ {
499
+ "kind": "set",
500
+ "resource": "@entity.speed"
501
+ },
457
502
  {
458
503
  "kind": "set",
459
504
  "resource": "@entity.title"
@@ -532,8 +577,10 @@
532
577
  "aliveCount",
533
578
  "cellShapes",
534
579
  "cells",
580
+ "elapsedMs",
535
581
  "generation",
536
582
  "running",
583
+ "speed",
537
584
  "title"
538
585
  ],
539
586
  "requires": []
@@ -567,6 +614,26 @@
567
614
  ],
568
615
  "tier": "domain"
569
616
  },
617
+ {
618
+ "description": "Learner pressed the Play/Pause toggle — starts or freezes the evolution.",
619
+ "id": "evt_01M41KXQV2AA7B73GRTXQA57D2",
620
+ "key": "TOGGLE_RUN",
621
+ "name": "Toggle Run",
622
+ "tier": "domain"
623
+ },
624
+ {
625
+ "description": "The learner picked a playback speed; generations advance that many times faster.",
626
+ "id": "evt_01M41KXQV2T9G9JXBYSWA8RR3G",
627
+ "key": "SPEED_SET",
628
+ "name": "Speed Set",
629
+ "payloadSchema": [
630
+ {
631
+ "name": "speed",
632
+ "type": "number"
633
+ }
634
+ ],
635
+ "tier": "presentation"
636
+ },
570
637
  {
571
638
  "description": "Learner started the evolution; the grid advances one generation per tick until Pause.",
572
639
  "id": "evt_01M07580Z4AKJB3934MXE7S8SQ",
@@ -897,90 +964,256 @@
897
964
  {
898
965
  "children": [
899
966
  {
900
- "content": "@entity.title",
901
- "type": "typography",
902
- "variant": "h4"
903
- },
904
- {
905
- "content": "@config.taskText",
906
- "type": "typography",
907
- "variant": "body"
908
- },
909
- {
967
+ "align": "start",
910
968
  "children": [
911
969
  {
912
- "action": "RUN",
913
- "disabled": [
914
- "if",
915
- "@entity.running",
916
- true,
917
- false
970
+ "children": [
971
+ {
972
+ "content": "@entity.title",
973
+ "type": "typography",
974
+ "variant": "h4"
975
+ },
976
+ [
977
+ "if",
978
+ [
979
+ "==",
980
+ "@config.summary",
981
+ ""
982
+ ],
983
+ null,
984
+ {
985
+ "color": "muted",
986
+ "content": "@config.summary",
987
+ "type": "typography",
988
+ "variant": "body2"
989
+ }
990
+ ]
918
991
  ],
919
- "label": "Run",
920
- "type": "button",
921
- "variant": "primary"
992
+ "direction": "vertical",
993
+ "gap": "xs",
994
+ "type": "stack"
922
995
  },
923
996
  {
924
- "action": "PAUSE",
925
- "disabled": [
997
+ "label": [
926
998
  "if",
927
999
  "@entity.running",
928
- false,
929
- true
1000
+ "Running",
1001
+ "Paused"
930
1002
  ],
931
- "label": "Pause",
932
- "type": "button",
933
- "variant": "secondary"
934
- },
935
- {
936
- "action": "STEP",
937
- "disabled": [
1003
+ "type": "badge",
1004
+ "variant": [
938
1005
  "if",
939
1006
  "@entity.running",
940
- true,
941
- false
942
- ],
1007
+ "primary",
1008
+ "neutral"
1009
+ ]
1010
+ }
1011
+ ],
1012
+ "direction": "horizontal",
1013
+ "gap": "md",
1014
+ "justify": "between",
1015
+ "type": "stack"
1016
+ },
1017
+ {
1018
+ "align": "center",
1019
+ "children": [
1020
+ [
1021
+ "if",
1022
+ "@entity.running",
1023
+ {
1024
+ "action": "TOGGLE_RUN",
1025
+ "aria-pressed": "true",
1026
+ "icon": "pause",
1027
+ "label": "Pause",
1028
+ "type": "button",
1029
+ "variant": "primary"
1030
+ },
1031
+ {
1032
+ "action": "TOGGLE_RUN",
1033
+ "aria-pressed": "false",
1034
+ "icon": "play",
1035
+ "label": "Play",
1036
+ "type": "button",
1037
+ "variant": "primary"
1038
+ }
1039
+ ],
1040
+ {
1041
+ "action": "STEP",
1042
+ "disabled": "@entity.running",
1043
+ "icon": "step-forward",
943
1044
  "label": "@config.stepLabel",
944
1045
  "type": "button",
945
1046
  "variant": "secondary"
946
1047
  },
947
1048
  {
948
1049
  "action": "RESET",
1050
+ "icon": "rotate-ccw",
949
1051
  "label": "Reset",
950
1052
  "type": "button",
951
1053
  "variant": "ghost"
1054
+ },
1055
+ {
1056
+ "align": "center",
1057
+ "aria-label": "Speed",
1058
+ "children": [
1059
+ {
1060
+ "action": "SPEED_SET",
1061
+ "actionPayload": {
1062
+ "speed": 0.5
1063
+ },
1064
+ "aria-pressed": [
1065
+ "if",
1066
+ [
1067
+ "==",
1068
+ "@entity.speed",
1069
+ 0.5
1070
+ ],
1071
+ "true",
1072
+ "false"
1073
+ ],
1074
+ "label": "0.5×",
1075
+ "size": "sm",
1076
+ "type": "button",
1077
+ "variant": [
1078
+ "if",
1079
+ [
1080
+ "==",
1081
+ "@entity.speed",
1082
+ 0.5
1083
+ ],
1084
+ "secondary",
1085
+ "ghost"
1086
+ ]
1087
+ },
1088
+ {
1089
+ "action": "SPEED_SET",
1090
+ "actionPayload": {
1091
+ "speed": 1.0
1092
+ },
1093
+ "aria-pressed": [
1094
+ "if",
1095
+ [
1096
+ "==",
1097
+ "@entity.speed",
1098
+ 1.0
1099
+ ],
1100
+ "true",
1101
+ "false"
1102
+ ],
1103
+ "label": "1×",
1104
+ "size": "sm",
1105
+ "type": "button",
1106
+ "variant": [
1107
+ "if",
1108
+ [
1109
+ "==",
1110
+ "@entity.speed",
1111
+ 1.0
1112
+ ],
1113
+ "secondary",
1114
+ "ghost"
1115
+ ]
1116
+ },
1117
+ {
1118
+ "action": "SPEED_SET",
1119
+ "actionPayload": {
1120
+ "speed": 2.0
1121
+ },
1122
+ "aria-pressed": [
1123
+ "if",
1124
+ [
1125
+ "==",
1126
+ "@entity.speed",
1127
+ 2.0
1128
+ ],
1129
+ "true",
1130
+ "false"
1131
+ ],
1132
+ "label": "2×",
1133
+ "size": "sm",
1134
+ "type": "button",
1135
+ "variant": [
1136
+ "if",
1137
+ [
1138
+ "==",
1139
+ "@entity.speed",
1140
+ 2.0
1141
+ ],
1142
+ "secondary",
1143
+ "ghost"
1144
+ ]
1145
+ },
1146
+ {
1147
+ "action": "SPEED_SET",
1148
+ "actionPayload": {
1149
+ "speed": 4.0
1150
+ },
1151
+ "aria-pressed": [
1152
+ "if",
1153
+ [
1154
+ "==",
1155
+ "@entity.speed",
1156
+ 4.0
1157
+ ],
1158
+ "true",
1159
+ "false"
1160
+ ],
1161
+ "label": "4×",
1162
+ "size": "sm",
1163
+ "type": "button",
1164
+ "variant": [
1165
+ "if",
1166
+ [
1167
+ "==",
1168
+ "@entity.speed",
1169
+ 4.0
1170
+ ],
1171
+ "secondary",
1172
+ "ghost"
1173
+ ]
1174
+ }
1175
+ ],
1176
+ "direction": "horizontal",
1177
+ "gap": "xs",
1178
+ "role": "group",
1179
+ "type": "stack"
1180
+ },
1181
+ {
1182
+ "color": "muted",
1183
+ "content": [
1184
+ "str/concat",
1185
+ "Generation ",
1186
+ "@entity.generation",
1187
+ " · ",
1188
+ "@entity.aliveCount",
1189
+ " active"
1190
+ ],
1191
+ "type": "typography",
1192
+ "variant": "caption"
952
1193
  }
953
1194
  ],
954
1195
  "direction": "horizontal",
955
1196
  "gap": "sm",
956
- "type": "stack"
1197
+ "type": "stack",
1198
+ "wrap": true
957
1199
  },
958
1200
  {
959
1201
  "animate": false,
960
1202
  "backgroundColor": "@config.backgroundColor",
961
1203
  "height": "@config.height",
962
1204
  "interactive": true,
1205
+ "keyMap": {
1206
+ "ArrowRight": "STEP",
1207
+ "KeyR": "RESET",
1208
+ "Space": "TOGGLE_RUN"
1209
+ },
963
1210
  "onShapeClick": "TAP_CELL",
964
1211
  "shapes": "@entity.cellShapes",
965
1212
  "type": "learning-canvas",
966
1213
  "width": "@config.width"
967
1214
  },
968
1215
  {
969
- "content": [
970
- "str/concat",
971
- "Generation ",
972
- [
973
- "str/concat",
974
- "",
975
- "@entity.generation"
976
- ],
977
- " · active cells: ",
978
- [
979
- "str/concat",
980
- "",
981
- "@entity.aliveCount"
982
- ]
983
- ],
1216
+ "content": "@config.taskText",
984
1217
  "type": "typography",
985
1218
  "variant": "body"
986
1219
  }
@@ -1005,6 +1238,48 @@
1005
1238
  ],
1006
1239
  "to": "idle"
1007
1240
  },
1241
+ {
1242
+ "effects": [
1243
+ [
1244
+ "set",
1245
+ "@entity.active",
1246
+ false
1247
+ ],
1248
+ [
1249
+ "set",
1250
+ "@entity.running",
1251
+ false
1252
+ ],
1253
+ [
1254
+ "render-ui",
1255
+ "main",
1256
+ null
1257
+ ]
1258
+ ],
1259
+ "event": "MODE_SELECTED",
1260
+ "eventId": "evt_01M07580Z4ZBCV8MXBRY5824Z6",
1261
+ "from": "idle",
1262
+ "guard": [
1263
+ "and",
1264
+ [
1265
+ "not",
1266
+ [
1267
+ "==",
1268
+ "@config.matchMode",
1269
+ ""
1270
+ ]
1271
+ ],
1272
+ [
1273
+ "not",
1274
+ [
1275
+ "==",
1276
+ "@payload.mode",
1277
+ "@config.matchMode"
1278
+ ]
1279
+ ]
1280
+ ],
1281
+ "to": "idle"
1282
+ },
1008
1283
  {
1009
1284
  "effects": [
1010
1285
  [
@@ -1210,90 +1485,256 @@
1210
1485
  {
1211
1486
  "children": [
1212
1487
  {
1213
- "content": "@entity.title",
1214
- "type": "typography",
1215
- "variant": "h4"
1216
- },
1217
- {
1218
- "content": "@config.taskText",
1219
- "type": "typography",
1220
- "variant": "body"
1221
- },
1222
- {
1488
+ "align": "start",
1223
1489
  "children": [
1224
1490
  {
1225
- "action": "RUN",
1226
- "disabled": [
1227
- "if",
1228
- "@entity.running",
1229
- true,
1230
- false
1491
+ "children": [
1492
+ {
1493
+ "content": "@entity.title",
1494
+ "type": "typography",
1495
+ "variant": "h4"
1496
+ },
1497
+ [
1498
+ "if",
1499
+ [
1500
+ "==",
1501
+ "@config.summary",
1502
+ ""
1503
+ ],
1504
+ null,
1505
+ {
1506
+ "color": "muted",
1507
+ "content": "@config.summary",
1508
+ "type": "typography",
1509
+ "variant": "body2"
1510
+ }
1511
+ ]
1231
1512
  ],
1232
- "label": "Run",
1233
- "type": "button",
1234
- "variant": "primary"
1513
+ "direction": "vertical",
1514
+ "gap": "xs",
1515
+ "type": "stack"
1235
1516
  },
1236
1517
  {
1237
- "action": "PAUSE",
1238
- "disabled": [
1518
+ "label": [
1239
1519
  "if",
1240
1520
  "@entity.running",
1241
- false,
1242
- true
1521
+ "Running",
1522
+ "Paused"
1243
1523
  ],
1244
- "label": "Pause",
1245
- "type": "button",
1246
- "variant": "secondary"
1247
- },
1248
- {
1249
- "action": "STEP",
1250
- "disabled": [
1524
+ "type": "badge",
1525
+ "variant": [
1251
1526
  "if",
1252
1527
  "@entity.running",
1253
- true,
1254
- false
1255
- ],
1528
+ "primary",
1529
+ "neutral"
1530
+ ]
1531
+ }
1532
+ ],
1533
+ "direction": "horizontal",
1534
+ "gap": "md",
1535
+ "justify": "between",
1536
+ "type": "stack"
1537
+ },
1538
+ {
1539
+ "align": "center",
1540
+ "children": [
1541
+ [
1542
+ "if",
1543
+ "@entity.running",
1544
+ {
1545
+ "action": "TOGGLE_RUN",
1546
+ "aria-pressed": "true",
1547
+ "icon": "pause",
1548
+ "label": "Pause",
1549
+ "type": "button",
1550
+ "variant": "primary"
1551
+ },
1552
+ {
1553
+ "action": "TOGGLE_RUN",
1554
+ "aria-pressed": "false",
1555
+ "icon": "play",
1556
+ "label": "Play",
1557
+ "type": "button",
1558
+ "variant": "primary"
1559
+ }
1560
+ ],
1561
+ {
1562
+ "action": "STEP",
1563
+ "disabled": "@entity.running",
1564
+ "icon": "step-forward",
1256
1565
  "label": "@config.stepLabel",
1257
1566
  "type": "button",
1258
1567
  "variant": "secondary"
1259
1568
  },
1260
1569
  {
1261
1570
  "action": "RESET",
1571
+ "icon": "rotate-ccw",
1262
1572
  "label": "Reset",
1263
1573
  "type": "button",
1264
1574
  "variant": "ghost"
1575
+ },
1576
+ {
1577
+ "align": "center",
1578
+ "aria-label": "Speed",
1579
+ "children": [
1580
+ {
1581
+ "action": "SPEED_SET",
1582
+ "actionPayload": {
1583
+ "speed": 0.5
1584
+ },
1585
+ "aria-pressed": [
1586
+ "if",
1587
+ [
1588
+ "==",
1589
+ "@entity.speed",
1590
+ 0.5
1591
+ ],
1592
+ "true",
1593
+ "false"
1594
+ ],
1595
+ "label": "0.5×",
1596
+ "size": "sm",
1597
+ "type": "button",
1598
+ "variant": [
1599
+ "if",
1600
+ [
1601
+ "==",
1602
+ "@entity.speed",
1603
+ 0.5
1604
+ ],
1605
+ "secondary",
1606
+ "ghost"
1607
+ ]
1608
+ },
1609
+ {
1610
+ "action": "SPEED_SET",
1611
+ "actionPayload": {
1612
+ "speed": 1.0
1613
+ },
1614
+ "aria-pressed": [
1615
+ "if",
1616
+ [
1617
+ "==",
1618
+ "@entity.speed",
1619
+ 1.0
1620
+ ],
1621
+ "true",
1622
+ "false"
1623
+ ],
1624
+ "label": "1×",
1625
+ "size": "sm",
1626
+ "type": "button",
1627
+ "variant": [
1628
+ "if",
1629
+ [
1630
+ "==",
1631
+ "@entity.speed",
1632
+ 1.0
1633
+ ],
1634
+ "secondary",
1635
+ "ghost"
1636
+ ]
1637
+ },
1638
+ {
1639
+ "action": "SPEED_SET",
1640
+ "actionPayload": {
1641
+ "speed": 2.0
1642
+ },
1643
+ "aria-pressed": [
1644
+ "if",
1645
+ [
1646
+ "==",
1647
+ "@entity.speed",
1648
+ 2.0
1649
+ ],
1650
+ "true",
1651
+ "false"
1652
+ ],
1653
+ "label": "2×",
1654
+ "size": "sm",
1655
+ "type": "button",
1656
+ "variant": [
1657
+ "if",
1658
+ [
1659
+ "==",
1660
+ "@entity.speed",
1661
+ 2.0
1662
+ ],
1663
+ "secondary",
1664
+ "ghost"
1665
+ ]
1666
+ },
1667
+ {
1668
+ "action": "SPEED_SET",
1669
+ "actionPayload": {
1670
+ "speed": 4.0
1671
+ },
1672
+ "aria-pressed": [
1673
+ "if",
1674
+ [
1675
+ "==",
1676
+ "@entity.speed",
1677
+ 4.0
1678
+ ],
1679
+ "true",
1680
+ "false"
1681
+ ],
1682
+ "label": "4×",
1683
+ "size": "sm",
1684
+ "type": "button",
1685
+ "variant": [
1686
+ "if",
1687
+ [
1688
+ "==",
1689
+ "@entity.speed",
1690
+ 4.0
1691
+ ],
1692
+ "secondary",
1693
+ "ghost"
1694
+ ]
1695
+ }
1696
+ ],
1697
+ "direction": "horizontal",
1698
+ "gap": "xs",
1699
+ "role": "group",
1700
+ "type": "stack"
1701
+ },
1702
+ {
1703
+ "color": "muted",
1704
+ "content": [
1705
+ "str/concat",
1706
+ "Generation ",
1707
+ "@entity.generation",
1708
+ " · ",
1709
+ "@entity.aliveCount",
1710
+ " active"
1711
+ ],
1712
+ "type": "typography",
1713
+ "variant": "caption"
1265
1714
  }
1266
1715
  ],
1267
1716
  "direction": "horizontal",
1268
1717
  "gap": "sm",
1269
- "type": "stack"
1718
+ "type": "stack",
1719
+ "wrap": true
1270
1720
  },
1271
1721
  {
1272
1722
  "animate": false,
1273
1723
  "backgroundColor": "@config.backgroundColor",
1274
1724
  "height": "@config.height",
1275
1725
  "interactive": true,
1726
+ "keyMap": {
1727
+ "ArrowRight": "STEP",
1728
+ "KeyR": "RESET",
1729
+ "Space": "TOGGLE_RUN"
1730
+ },
1276
1731
  "onShapeClick": "TAP_CELL",
1277
1732
  "shapes": "@entity.cellShapes",
1278
1733
  "type": "learning-canvas",
1279
1734
  "width": "@config.width"
1280
1735
  },
1281
1736
  {
1282
- "content": [
1283
- "str/concat",
1284
- "Generation ",
1285
- [
1286
- "str/concat",
1287
- "",
1288
- "@entity.generation"
1289
- ],
1290
- " · active cells: ",
1291
- [
1292
- "str/concat",
1293
- "",
1294
- "@entity.aliveCount"
1295
- ]
1296
- ],
1737
+ "content": "@config.taskText",
1297
1738
  "type": "typography",
1298
1739
  "variant": "body"
1299
1740
  }
@@ -1323,7 +1764,10 @@
1323
1764
  [
1324
1765
  "set",
1325
1766
  "@entity.running",
1326
- true
1767
+ [
1768
+ "not",
1769
+ "@entity.running"
1770
+ ]
1327
1771
  ],
1328
1772
  [
1329
1773
  "render-ui",
@@ -1333,90 +1777,256 @@
1333
1777
  {
1334
1778
  "children": [
1335
1779
  {
1336
- "content": "@entity.title",
1337
- "type": "typography",
1338
- "variant": "h4"
1339
- },
1340
- {
1341
- "content": "@config.taskText",
1342
- "type": "typography",
1343
- "variant": "body"
1344
- },
1345
- {
1780
+ "align": "start",
1346
1781
  "children": [
1347
1782
  {
1348
- "action": "RUN",
1349
- "disabled": [
1350
- "if",
1351
- "@entity.running",
1352
- true,
1353
- false
1783
+ "children": [
1784
+ {
1785
+ "content": "@entity.title",
1786
+ "type": "typography",
1787
+ "variant": "h4"
1788
+ },
1789
+ [
1790
+ "if",
1791
+ [
1792
+ "==",
1793
+ "@config.summary",
1794
+ ""
1795
+ ],
1796
+ null,
1797
+ {
1798
+ "color": "muted",
1799
+ "content": "@config.summary",
1800
+ "type": "typography",
1801
+ "variant": "body2"
1802
+ }
1803
+ ]
1354
1804
  ],
1355
- "label": "Run",
1356
- "type": "button",
1357
- "variant": "primary"
1805
+ "direction": "vertical",
1806
+ "gap": "xs",
1807
+ "type": "stack"
1358
1808
  },
1359
1809
  {
1360
- "action": "PAUSE",
1361
- "disabled": [
1810
+ "label": [
1362
1811
  "if",
1363
1812
  "@entity.running",
1364
- false,
1365
- true
1813
+ "Running",
1814
+ "Paused"
1366
1815
  ],
1367
- "label": "Pause",
1368
- "type": "button",
1369
- "variant": "secondary"
1370
- },
1371
- {
1372
- "action": "STEP",
1373
- "disabled": [
1816
+ "type": "badge",
1817
+ "variant": [
1374
1818
  "if",
1375
1819
  "@entity.running",
1376
- true,
1377
- false
1378
- ],
1379
- "label": "@config.stepLabel",
1380
- "type": "button",
1381
- "variant": "secondary"
1382
- },
1383
- {
1384
- "action": "RESET",
1820
+ "primary",
1821
+ "neutral"
1822
+ ]
1823
+ }
1824
+ ],
1825
+ "direction": "horizontal",
1826
+ "gap": "md",
1827
+ "justify": "between",
1828
+ "type": "stack"
1829
+ },
1830
+ {
1831
+ "align": "center",
1832
+ "children": [
1833
+ [
1834
+ "if",
1835
+ "@entity.running",
1836
+ {
1837
+ "action": "TOGGLE_RUN",
1838
+ "aria-pressed": "true",
1839
+ "icon": "pause",
1840
+ "label": "Pause",
1841
+ "type": "button",
1842
+ "variant": "primary"
1843
+ },
1844
+ {
1845
+ "action": "TOGGLE_RUN",
1846
+ "aria-pressed": "false",
1847
+ "icon": "play",
1848
+ "label": "Play",
1849
+ "type": "button",
1850
+ "variant": "primary"
1851
+ }
1852
+ ],
1853
+ {
1854
+ "action": "STEP",
1855
+ "disabled": "@entity.running",
1856
+ "icon": "step-forward",
1857
+ "label": "@config.stepLabel",
1858
+ "type": "button",
1859
+ "variant": "secondary"
1860
+ },
1861
+ {
1862
+ "action": "RESET",
1863
+ "icon": "rotate-ccw",
1385
1864
  "label": "Reset",
1386
1865
  "type": "button",
1387
1866
  "variant": "ghost"
1867
+ },
1868
+ {
1869
+ "align": "center",
1870
+ "aria-label": "Speed",
1871
+ "children": [
1872
+ {
1873
+ "action": "SPEED_SET",
1874
+ "actionPayload": {
1875
+ "speed": 0.5
1876
+ },
1877
+ "aria-pressed": [
1878
+ "if",
1879
+ [
1880
+ "==",
1881
+ "@entity.speed",
1882
+ 0.5
1883
+ ],
1884
+ "true",
1885
+ "false"
1886
+ ],
1887
+ "label": "0.5×",
1888
+ "size": "sm",
1889
+ "type": "button",
1890
+ "variant": [
1891
+ "if",
1892
+ [
1893
+ "==",
1894
+ "@entity.speed",
1895
+ 0.5
1896
+ ],
1897
+ "secondary",
1898
+ "ghost"
1899
+ ]
1900
+ },
1901
+ {
1902
+ "action": "SPEED_SET",
1903
+ "actionPayload": {
1904
+ "speed": 1.0
1905
+ },
1906
+ "aria-pressed": [
1907
+ "if",
1908
+ [
1909
+ "==",
1910
+ "@entity.speed",
1911
+ 1.0
1912
+ ],
1913
+ "true",
1914
+ "false"
1915
+ ],
1916
+ "label": "1×",
1917
+ "size": "sm",
1918
+ "type": "button",
1919
+ "variant": [
1920
+ "if",
1921
+ [
1922
+ "==",
1923
+ "@entity.speed",
1924
+ 1.0
1925
+ ],
1926
+ "secondary",
1927
+ "ghost"
1928
+ ]
1929
+ },
1930
+ {
1931
+ "action": "SPEED_SET",
1932
+ "actionPayload": {
1933
+ "speed": 2.0
1934
+ },
1935
+ "aria-pressed": [
1936
+ "if",
1937
+ [
1938
+ "==",
1939
+ "@entity.speed",
1940
+ 2.0
1941
+ ],
1942
+ "true",
1943
+ "false"
1944
+ ],
1945
+ "label": "2×",
1946
+ "size": "sm",
1947
+ "type": "button",
1948
+ "variant": [
1949
+ "if",
1950
+ [
1951
+ "==",
1952
+ "@entity.speed",
1953
+ 2.0
1954
+ ],
1955
+ "secondary",
1956
+ "ghost"
1957
+ ]
1958
+ },
1959
+ {
1960
+ "action": "SPEED_SET",
1961
+ "actionPayload": {
1962
+ "speed": 4.0
1963
+ },
1964
+ "aria-pressed": [
1965
+ "if",
1966
+ [
1967
+ "==",
1968
+ "@entity.speed",
1969
+ 4.0
1970
+ ],
1971
+ "true",
1972
+ "false"
1973
+ ],
1974
+ "label": "4×",
1975
+ "size": "sm",
1976
+ "type": "button",
1977
+ "variant": [
1978
+ "if",
1979
+ [
1980
+ "==",
1981
+ "@entity.speed",
1982
+ 4.0
1983
+ ],
1984
+ "secondary",
1985
+ "ghost"
1986
+ ]
1987
+ }
1988
+ ],
1989
+ "direction": "horizontal",
1990
+ "gap": "xs",
1991
+ "role": "group",
1992
+ "type": "stack"
1993
+ },
1994
+ {
1995
+ "color": "muted",
1996
+ "content": [
1997
+ "str/concat",
1998
+ "Generation ",
1999
+ "@entity.generation",
2000
+ " · ",
2001
+ "@entity.aliveCount",
2002
+ " active"
2003
+ ],
2004
+ "type": "typography",
2005
+ "variant": "caption"
1388
2006
  }
1389
2007
  ],
1390
2008
  "direction": "horizontal",
1391
2009
  "gap": "sm",
1392
- "type": "stack"
2010
+ "type": "stack",
2011
+ "wrap": true
1393
2012
  },
1394
2013
  {
1395
2014
  "animate": false,
1396
2015
  "backgroundColor": "@config.backgroundColor",
1397
2016
  "height": "@config.height",
1398
2017
  "interactive": true,
2018
+ "keyMap": {
2019
+ "ArrowRight": "STEP",
2020
+ "KeyR": "RESET",
2021
+ "Space": "TOGGLE_RUN"
2022
+ },
1399
2023
  "onShapeClick": "TAP_CELL",
1400
2024
  "shapes": "@entity.cellShapes",
1401
2025
  "type": "learning-canvas",
1402
2026
  "width": "@config.width"
1403
2027
  },
1404
2028
  {
1405
- "content": [
1406
- "str/concat",
1407
- "Generation ",
1408
- [
1409
- "str/concat",
1410
- "",
1411
- "@entity.generation"
1412
- ],
1413
- " · active cells: ",
1414
- [
1415
- "str/concat",
1416
- "",
1417
- "@entity.aliveCount"
1418
- ]
1419
- ],
2029
+ "content": "@config.taskText",
1420
2030
  "type": "typography",
1421
2031
  "variant": "body"
1422
2032
  }
@@ -1438,21 +2048,13 @@
1438
2048
  }
1439
2049
  ]
1440
2050
  ],
1441
- "event": "RUN",
1442
- "eventId": "evt_01M07580Z4AKJB3934MXE7S8SQ",
2051
+ "event": "TOGGLE_RUN",
2052
+ "eventId": "evt_01M41KXQV2AA7B73GRTXQA57D2",
1443
2053
  "from": "idle",
1444
2054
  "guard": [
1445
- "and",
1446
- [
1447
- "==",
1448
- "@entity.active",
1449
- true
1450
- ],
1451
- [
1452
- "==",
1453
- "@entity.running",
1454
- false
1455
- ]
2055
+ "==",
2056
+ "@entity.active",
2057
+ true
1456
2058
  ],
1457
2059
  "to": "idle"
1458
2060
  },
@@ -1460,8 +2062,8 @@
1460
2062
  "effects": [
1461
2063
  [
1462
2064
  "set",
1463
- "@entity.running",
1464
- false
2065
+ "@entity.speed",
2066
+ "@payload.speed"
1465
2067
  ],
1466
2068
  [
1467
2069
  "render-ui",
@@ -1471,90 +2073,256 @@
1471
2073
  {
1472
2074
  "children": [
1473
2075
  {
1474
- "content": "@entity.title",
1475
- "type": "typography",
1476
- "variant": "h4"
1477
- },
1478
- {
1479
- "content": "@config.taskText",
1480
- "type": "typography",
1481
- "variant": "body"
1482
- },
1483
- {
2076
+ "align": "start",
1484
2077
  "children": [
1485
2078
  {
1486
- "action": "RUN",
1487
- "disabled": [
1488
- "if",
1489
- "@entity.running",
1490
- true,
1491
- false
2079
+ "children": [
2080
+ {
2081
+ "content": "@entity.title",
2082
+ "type": "typography",
2083
+ "variant": "h4"
2084
+ },
2085
+ [
2086
+ "if",
2087
+ [
2088
+ "==",
2089
+ "@config.summary",
2090
+ ""
2091
+ ],
2092
+ null,
2093
+ {
2094
+ "color": "muted",
2095
+ "content": "@config.summary",
2096
+ "type": "typography",
2097
+ "variant": "body2"
2098
+ }
2099
+ ]
1492
2100
  ],
1493
- "label": "Run",
1494
- "type": "button",
1495
- "variant": "primary"
2101
+ "direction": "vertical",
2102
+ "gap": "xs",
2103
+ "type": "stack"
1496
2104
  },
1497
2105
  {
1498
- "action": "PAUSE",
1499
- "disabled": [
2106
+ "label": [
1500
2107
  "if",
1501
2108
  "@entity.running",
1502
- false,
1503
- true
2109
+ "Running",
2110
+ "Paused"
1504
2111
  ],
1505
- "label": "Pause",
1506
- "type": "button",
1507
- "variant": "secondary"
1508
- },
1509
- {
1510
- "action": "STEP",
1511
- "disabled": [
2112
+ "type": "badge",
2113
+ "variant": [
1512
2114
  "if",
1513
2115
  "@entity.running",
1514
- true,
1515
- false
1516
- ],
2116
+ "primary",
2117
+ "neutral"
2118
+ ]
2119
+ }
2120
+ ],
2121
+ "direction": "horizontal",
2122
+ "gap": "md",
2123
+ "justify": "between",
2124
+ "type": "stack"
2125
+ },
2126
+ {
2127
+ "align": "center",
2128
+ "children": [
2129
+ [
2130
+ "if",
2131
+ "@entity.running",
2132
+ {
2133
+ "action": "TOGGLE_RUN",
2134
+ "aria-pressed": "true",
2135
+ "icon": "pause",
2136
+ "label": "Pause",
2137
+ "type": "button",
2138
+ "variant": "primary"
2139
+ },
2140
+ {
2141
+ "action": "TOGGLE_RUN",
2142
+ "aria-pressed": "false",
2143
+ "icon": "play",
2144
+ "label": "Play",
2145
+ "type": "button",
2146
+ "variant": "primary"
2147
+ }
2148
+ ],
2149
+ {
2150
+ "action": "STEP",
2151
+ "disabled": "@entity.running",
2152
+ "icon": "step-forward",
1517
2153
  "label": "@config.stepLabel",
1518
2154
  "type": "button",
1519
2155
  "variant": "secondary"
1520
2156
  },
1521
2157
  {
1522
2158
  "action": "RESET",
2159
+ "icon": "rotate-ccw",
1523
2160
  "label": "Reset",
1524
2161
  "type": "button",
1525
2162
  "variant": "ghost"
2163
+ },
2164
+ {
2165
+ "align": "center",
2166
+ "aria-label": "Speed",
2167
+ "children": [
2168
+ {
2169
+ "action": "SPEED_SET",
2170
+ "actionPayload": {
2171
+ "speed": 0.5
2172
+ },
2173
+ "aria-pressed": [
2174
+ "if",
2175
+ [
2176
+ "==",
2177
+ "@entity.speed",
2178
+ 0.5
2179
+ ],
2180
+ "true",
2181
+ "false"
2182
+ ],
2183
+ "label": "0.5×",
2184
+ "size": "sm",
2185
+ "type": "button",
2186
+ "variant": [
2187
+ "if",
2188
+ [
2189
+ "==",
2190
+ "@entity.speed",
2191
+ 0.5
2192
+ ],
2193
+ "secondary",
2194
+ "ghost"
2195
+ ]
2196
+ },
2197
+ {
2198
+ "action": "SPEED_SET",
2199
+ "actionPayload": {
2200
+ "speed": 1.0
2201
+ },
2202
+ "aria-pressed": [
2203
+ "if",
2204
+ [
2205
+ "==",
2206
+ "@entity.speed",
2207
+ 1.0
2208
+ ],
2209
+ "true",
2210
+ "false"
2211
+ ],
2212
+ "label": "1×",
2213
+ "size": "sm",
2214
+ "type": "button",
2215
+ "variant": [
2216
+ "if",
2217
+ [
2218
+ "==",
2219
+ "@entity.speed",
2220
+ 1.0
2221
+ ],
2222
+ "secondary",
2223
+ "ghost"
2224
+ ]
2225
+ },
2226
+ {
2227
+ "action": "SPEED_SET",
2228
+ "actionPayload": {
2229
+ "speed": 2.0
2230
+ },
2231
+ "aria-pressed": [
2232
+ "if",
2233
+ [
2234
+ "==",
2235
+ "@entity.speed",
2236
+ 2.0
2237
+ ],
2238
+ "true",
2239
+ "false"
2240
+ ],
2241
+ "label": "2×",
2242
+ "size": "sm",
2243
+ "type": "button",
2244
+ "variant": [
2245
+ "if",
2246
+ [
2247
+ "==",
2248
+ "@entity.speed",
2249
+ 2.0
2250
+ ],
2251
+ "secondary",
2252
+ "ghost"
2253
+ ]
2254
+ },
2255
+ {
2256
+ "action": "SPEED_SET",
2257
+ "actionPayload": {
2258
+ "speed": 4.0
2259
+ },
2260
+ "aria-pressed": [
2261
+ "if",
2262
+ [
2263
+ "==",
2264
+ "@entity.speed",
2265
+ 4.0
2266
+ ],
2267
+ "true",
2268
+ "false"
2269
+ ],
2270
+ "label": "4×",
2271
+ "size": "sm",
2272
+ "type": "button",
2273
+ "variant": [
2274
+ "if",
2275
+ [
2276
+ "==",
2277
+ "@entity.speed",
2278
+ 4.0
2279
+ ],
2280
+ "secondary",
2281
+ "ghost"
2282
+ ]
2283
+ }
2284
+ ],
2285
+ "direction": "horizontal",
2286
+ "gap": "xs",
2287
+ "role": "group",
2288
+ "type": "stack"
2289
+ },
2290
+ {
2291
+ "color": "muted",
2292
+ "content": [
2293
+ "str/concat",
2294
+ "Generation ",
2295
+ "@entity.generation",
2296
+ " · ",
2297
+ "@entity.aliveCount",
2298
+ " active"
2299
+ ],
2300
+ "type": "typography",
2301
+ "variant": "caption"
1526
2302
  }
1527
2303
  ],
1528
2304
  "direction": "horizontal",
1529
2305
  "gap": "sm",
1530
- "type": "stack"
2306
+ "type": "stack",
2307
+ "wrap": true
1531
2308
  },
1532
2309
  {
1533
2310
  "animate": false,
1534
2311
  "backgroundColor": "@config.backgroundColor",
1535
2312
  "height": "@config.height",
1536
2313
  "interactive": true,
2314
+ "keyMap": {
2315
+ "ArrowRight": "STEP",
2316
+ "KeyR": "RESET",
2317
+ "Space": "TOGGLE_RUN"
2318
+ },
1537
2319
  "onShapeClick": "TAP_CELL",
1538
2320
  "shapes": "@entity.cellShapes",
1539
2321
  "type": "learning-canvas",
1540
2322
  "width": "@config.width"
1541
2323
  },
1542
2324
  {
1543
- "content": [
1544
- "str/concat",
1545
- "Generation ",
1546
- [
1547
- "str/concat",
1548
- "",
1549
- "@entity.generation"
1550
- ],
1551
- " · active cells: ",
1552
- [
1553
- "str/concat",
1554
- "",
1555
- "@entity.aliveCount"
1556
- ]
1557
- ],
2325
+ "content": "@config.taskText",
1558
2326
  "type": "typography",
1559
2327
  "variant": "body"
1560
2328
  }
@@ -1567,30 +2335,15 @@
1567
2335
  "padding": "md",
1568
2336
  "type": "box"
1569
2337
  }
1570
- ],
1571
- [
1572
- "emit",
1573
- "RUN_TOGGLED",
1574
- {
1575
- "running": "@entity.running"
1576
- }
1577
2338
  ]
1578
2339
  ],
1579
- "event": "PAUSE",
1580
- "eventId": "evt_01M07580Z4SY527GW89VRZRM77",
2340
+ "event": "SPEED_SET",
2341
+ "eventId": "evt_01M41KXQV2T9G9JXBYSWA8RR3G",
1581
2342
  "from": "idle",
1582
2343
  "guard": [
1583
- "and",
1584
- [
1585
- "==",
1586
- "@entity.active",
1587
- true
1588
- ],
1589
- [
1590
- "==",
1591
- "@entity.running",
1592
- true
1593
- ]
2344
+ "==",
2345
+ "@entity.active",
2346
+ true
1594
2347
  ],
1595
2348
  "to": "idle"
1596
2349
  },
@@ -1598,54 +2351,662 @@
1598
2351
  "effects": [
1599
2352
  [
1600
2353
  "set",
1601
- "@entity.cells",
1602
- [
1603
- "array/map",
1604
- [
1605
- "array/range",
1606
- 0.0,
1607
- [
1608
- "*",
1609
- "@config.rows",
1610
- "@config.cols"
1611
- ]
1612
- ],
1613
- [
1614
- "fn",
1615
- [
1616
- "i"
1617
- ],
1618
- [
1619
- "let",
1620
- [
1621
- [
1622
- "r",
1623
- [
1624
- "math/floor",
2354
+ "@entity.running",
2355
+ true
2356
+ ],
2357
+ [
2358
+ "render-ui",
2359
+ "main",
2360
+ {
2361
+ "children": [
2362
+ {
2363
+ "children": [
2364
+ {
2365
+ "align": "start",
2366
+ "children": [
2367
+ {
2368
+ "children": [
2369
+ {
2370
+ "content": "@entity.title",
2371
+ "type": "typography",
2372
+ "variant": "h4"
2373
+ },
2374
+ [
2375
+ "if",
2376
+ [
2377
+ "==",
2378
+ "@config.summary",
2379
+ ""
2380
+ ],
2381
+ null,
2382
+ {
2383
+ "color": "muted",
2384
+ "content": "@config.summary",
2385
+ "type": "typography",
2386
+ "variant": "body2"
2387
+ }
2388
+ ]
2389
+ ],
2390
+ "direction": "vertical",
2391
+ "gap": "xs",
2392
+ "type": "stack"
2393
+ },
2394
+ {
2395
+ "label": [
2396
+ "if",
2397
+ "@entity.running",
2398
+ "Running",
2399
+ "Paused"
2400
+ ],
2401
+ "type": "badge",
2402
+ "variant": [
2403
+ "if",
2404
+ "@entity.running",
2405
+ "primary",
2406
+ "neutral"
2407
+ ]
2408
+ }
2409
+ ],
2410
+ "direction": "horizontal",
2411
+ "gap": "md",
2412
+ "justify": "between",
2413
+ "type": "stack"
2414
+ },
2415
+ {
2416
+ "align": "center",
2417
+ "children": [
1625
2418
  [
1626
- "/",
1627
- "@i",
1628
- "@config.cols"
1629
- ]
1630
- ]
1631
- ],
1632
- [
1633
- "c",
1634
- [
1635
- "math/mod",
1636
- "@i",
1637
- "@config.cols"
1638
- ]
1639
- ],
1640
- [
1641
- "v",
1642
- [
1643
- "array/nth",
1644
- "@entity.cells",
1645
- "@i"
1646
- ]
1647
- ],
1648
- [
2419
+ "if",
2420
+ "@entity.running",
2421
+ {
2422
+ "action": "TOGGLE_RUN",
2423
+ "aria-pressed": "true",
2424
+ "icon": "pause",
2425
+ "label": "Pause",
2426
+ "type": "button",
2427
+ "variant": "primary"
2428
+ },
2429
+ {
2430
+ "action": "TOGGLE_RUN",
2431
+ "aria-pressed": "false",
2432
+ "icon": "play",
2433
+ "label": "Play",
2434
+ "type": "button",
2435
+ "variant": "primary"
2436
+ }
2437
+ ],
2438
+ {
2439
+ "action": "STEP",
2440
+ "disabled": "@entity.running",
2441
+ "icon": "step-forward",
2442
+ "label": "@config.stepLabel",
2443
+ "type": "button",
2444
+ "variant": "secondary"
2445
+ },
2446
+ {
2447
+ "action": "RESET",
2448
+ "icon": "rotate-ccw",
2449
+ "label": "Reset",
2450
+ "type": "button",
2451
+ "variant": "ghost"
2452
+ },
2453
+ {
2454
+ "align": "center",
2455
+ "aria-label": "Speed",
2456
+ "children": [
2457
+ {
2458
+ "action": "SPEED_SET",
2459
+ "actionPayload": {
2460
+ "speed": 0.5
2461
+ },
2462
+ "aria-pressed": [
2463
+ "if",
2464
+ [
2465
+ "==",
2466
+ "@entity.speed",
2467
+ 0.5
2468
+ ],
2469
+ "true",
2470
+ "false"
2471
+ ],
2472
+ "label": "0.5×",
2473
+ "size": "sm",
2474
+ "type": "button",
2475
+ "variant": [
2476
+ "if",
2477
+ [
2478
+ "==",
2479
+ "@entity.speed",
2480
+ 0.5
2481
+ ],
2482
+ "secondary",
2483
+ "ghost"
2484
+ ]
2485
+ },
2486
+ {
2487
+ "action": "SPEED_SET",
2488
+ "actionPayload": {
2489
+ "speed": 1.0
2490
+ },
2491
+ "aria-pressed": [
2492
+ "if",
2493
+ [
2494
+ "==",
2495
+ "@entity.speed",
2496
+ 1.0
2497
+ ],
2498
+ "true",
2499
+ "false"
2500
+ ],
2501
+ "label": "1×",
2502
+ "size": "sm",
2503
+ "type": "button",
2504
+ "variant": [
2505
+ "if",
2506
+ [
2507
+ "==",
2508
+ "@entity.speed",
2509
+ 1.0
2510
+ ],
2511
+ "secondary",
2512
+ "ghost"
2513
+ ]
2514
+ },
2515
+ {
2516
+ "action": "SPEED_SET",
2517
+ "actionPayload": {
2518
+ "speed": 2.0
2519
+ },
2520
+ "aria-pressed": [
2521
+ "if",
2522
+ [
2523
+ "==",
2524
+ "@entity.speed",
2525
+ 2.0
2526
+ ],
2527
+ "true",
2528
+ "false"
2529
+ ],
2530
+ "label": "2×",
2531
+ "size": "sm",
2532
+ "type": "button",
2533
+ "variant": [
2534
+ "if",
2535
+ [
2536
+ "==",
2537
+ "@entity.speed",
2538
+ 2.0
2539
+ ],
2540
+ "secondary",
2541
+ "ghost"
2542
+ ]
2543
+ },
2544
+ {
2545
+ "action": "SPEED_SET",
2546
+ "actionPayload": {
2547
+ "speed": 4.0
2548
+ },
2549
+ "aria-pressed": [
2550
+ "if",
2551
+ [
2552
+ "==",
2553
+ "@entity.speed",
2554
+ 4.0
2555
+ ],
2556
+ "true",
2557
+ "false"
2558
+ ],
2559
+ "label": "4×",
2560
+ "size": "sm",
2561
+ "type": "button",
2562
+ "variant": [
2563
+ "if",
2564
+ [
2565
+ "==",
2566
+ "@entity.speed",
2567
+ 4.0
2568
+ ],
2569
+ "secondary",
2570
+ "ghost"
2571
+ ]
2572
+ }
2573
+ ],
2574
+ "direction": "horizontal",
2575
+ "gap": "xs",
2576
+ "role": "group",
2577
+ "type": "stack"
2578
+ },
2579
+ {
2580
+ "color": "muted",
2581
+ "content": [
2582
+ "str/concat",
2583
+ "Generation ",
2584
+ "@entity.generation",
2585
+ " · ",
2586
+ "@entity.aliveCount",
2587
+ " active"
2588
+ ],
2589
+ "type": "typography",
2590
+ "variant": "caption"
2591
+ }
2592
+ ],
2593
+ "direction": "horizontal",
2594
+ "gap": "sm",
2595
+ "type": "stack",
2596
+ "wrap": true
2597
+ },
2598
+ {
2599
+ "animate": false,
2600
+ "backgroundColor": "@config.backgroundColor",
2601
+ "height": "@config.height",
2602
+ "interactive": true,
2603
+ "keyMap": {
2604
+ "ArrowRight": "STEP",
2605
+ "KeyR": "RESET",
2606
+ "Space": "TOGGLE_RUN"
2607
+ },
2608
+ "onShapeClick": "TAP_CELL",
2609
+ "shapes": "@entity.cellShapes",
2610
+ "type": "learning-canvas",
2611
+ "width": "@config.width"
2612
+ },
2613
+ {
2614
+ "content": "@config.taskText",
2615
+ "type": "typography",
2616
+ "variant": "body"
2617
+ }
2618
+ ],
2619
+ "direction": "vertical",
2620
+ "gap": "md",
2621
+ "type": "stack"
2622
+ }
2623
+ ],
2624
+ "padding": "md",
2625
+ "type": "box"
2626
+ }
2627
+ ],
2628
+ [
2629
+ "emit",
2630
+ "RUN_TOGGLED",
2631
+ {
2632
+ "running": "@entity.running"
2633
+ }
2634
+ ]
2635
+ ],
2636
+ "event": "RUN",
2637
+ "eventId": "evt_01M07580Z4AKJB3934MXE7S8SQ",
2638
+ "from": "idle",
2639
+ "guard": [
2640
+ "and",
2641
+ [
2642
+ "==",
2643
+ "@entity.active",
2644
+ true
2645
+ ],
2646
+ [
2647
+ "==",
2648
+ "@entity.running",
2649
+ false
2650
+ ]
2651
+ ],
2652
+ "to": "idle"
2653
+ },
2654
+ {
2655
+ "effects": [
2656
+ [
2657
+ "set",
2658
+ "@entity.running",
2659
+ false
2660
+ ],
2661
+ [
2662
+ "render-ui",
2663
+ "main",
2664
+ {
2665
+ "children": [
2666
+ {
2667
+ "children": [
2668
+ {
2669
+ "align": "start",
2670
+ "children": [
2671
+ {
2672
+ "children": [
2673
+ {
2674
+ "content": "@entity.title",
2675
+ "type": "typography",
2676
+ "variant": "h4"
2677
+ },
2678
+ [
2679
+ "if",
2680
+ [
2681
+ "==",
2682
+ "@config.summary",
2683
+ ""
2684
+ ],
2685
+ null,
2686
+ {
2687
+ "color": "muted",
2688
+ "content": "@config.summary",
2689
+ "type": "typography",
2690
+ "variant": "body2"
2691
+ }
2692
+ ]
2693
+ ],
2694
+ "direction": "vertical",
2695
+ "gap": "xs",
2696
+ "type": "stack"
2697
+ },
2698
+ {
2699
+ "label": [
2700
+ "if",
2701
+ "@entity.running",
2702
+ "Running",
2703
+ "Paused"
2704
+ ],
2705
+ "type": "badge",
2706
+ "variant": [
2707
+ "if",
2708
+ "@entity.running",
2709
+ "primary",
2710
+ "neutral"
2711
+ ]
2712
+ }
2713
+ ],
2714
+ "direction": "horizontal",
2715
+ "gap": "md",
2716
+ "justify": "between",
2717
+ "type": "stack"
2718
+ },
2719
+ {
2720
+ "align": "center",
2721
+ "children": [
2722
+ [
2723
+ "if",
2724
+ "@entity.running",
2725
+ {
2726
+ "action": "TOGGLE_RUN",
2727
+ "aria-pressed": "true",
2728
+ "icon": "pause",
2729
+ "label": "Pause",
2730
+ "type": "button",
2731
+ "variant": "primary"
2732
+ },
2733
+ {
2734
+ "action": "TOGGLE_RUN",
2735
+ "aria-pressed": "false",
2736
+ "icon": "play",
2737
+ "label": "Play",
2738
+ "type": "button",
2739
+ "variant": "primary"
2740
+ }
2741
+ ],
2742
+ {
2743
+ "action": "STEP",
2744
+ "disabled": "@entity.running",
2745
+ "icon": "step-forward",
2746
+ "label": "@config.stepLabel",
2747
+ "type": "button",
2748
+ "variant": "secondary"
2749
+ },
2750
+ {
2751
+ "action": "RESET",
2752
+ "icon": "rotate-ccw",
2753
+ "label": "Reset",
2754
+ "type": "button",
2755
+ "variant": "ghost"
2756
+ },
2757
+ {
2758
+ "align": "center",
2759
+ "aria-label": "Speed",
2760
+ "children": [
2761
+ {
2762
+ "action": "SPEED_SET",
2763
+ "actionPayload": {
2764
+ "speed": 0.5
2765
+ },
2766
+ "aria-pressed": [
2767
+ "if",
2768
+ [
2769
+ "==",
2770
+ "@entity.speed",
2771
+ 0.5
2772
+ ],
2773
+ "true",
2774
+ "false"
2775
+ ],
2776
+ "label": "0.5×",
2777
+ "size": "sm",
2778
+ "type": "button",
2779
+ "variant": [
2780
+ "if",
2781
+ [
2782
+ "==",
2783
+ "@entity.speed",
2784
+ 0.5
2785
+ ],
2786
+ "secondary",
2787
+ "ghost"
2788
+ ]
2789
+ },
2790
+ {
2791
+ "action": "SPEED_SET",
2792
+ "actionPayload": {
2793
+ "speed": 1.0
2794
+ },
2795
+ "aria-pressed": [
2796
+ "if",
2797
+ [
2798
+ "==",
2799
+ "@entity.speed",
2800
+ 1.0
2801
+ ],
2802
+ "true",
2803
+ "false"
2804
+ ],
2805
+ "label": "1×",
2806
+ "size": "sm",
2807
+ "type": "button",
2808
+ "variant": [
2809
+ "if",
2810
+ [
2811
+ "==",
2812
+ "@entity.speed",
2813
+ 1.0
2814
+ ],
2815
+ "secondary",
2816
+ "ghost"
2817
+ ]
2818
+ },
2819
+ {
2820
+ "action": "SPEED_SET",
2821
+ "actionPayload": {
2822
+ "speed": 2.0
2823
+ },
2824
+ "aria-pressed": [
2825
+ "if",
2826
+ [
2827
+ "==",
2828
+ "@entity.speed",
2829
+ 2.0
2830
+ ],
2831
+ "true",
2832
+ "false"
2833
+ ],
2834
+ "label": "2×",
2835
+ "size": "sm",
2836
+ "type": "button",
2837
+ "variant": [
2838
+ "if",
2839
+ [
2840
+ "==",
2841
+ "@entity.speed",
2842
+ 2.0
2843
+ ],
2844
+ "secondary",
2845
+ "ghost"
2846
+ ]
2847
+ },
2848
+ {
2849
+ "action": "SPEED_SET",
2850
+ "actionPayload": {
2851
+ "speed": 4.0
2852
+ },
2853
+ "aria-pressed": [
2854
+ "if",
2855
+ [
2856
+ "==",
2857
+ "@entity.speed",
2858
+ 4.0
2859
+ ],
2860
+ "true",
2861
+ "false"
2862
+ ],
2863
+ "label": "4×",
2864
+ "size": "sm",
2865
+ "type": "button",
2866
+ "variant": [
2867
+ "if",
2868
+ [
2869
+ "==",
2870
+ "@entity.speed",
2871
+ 4.0
2872
+ ],
2873
+ "secondary",
2874
+ "ghost"
2875
+ ]
2876
+ }
2877
+ ],
2878
+ "direction": "horizontal",
2879
+ "gap": "xs",
2880
+ "role": "group",
2881
+ "type": "stack"
2882
+ },
2883
+ {
2884
+ "color": "muted",
2885
+ "content": [
2886
+ "str/concat",
2887
+ "Generation ",
2888
+ "@entity.generation",
2889
+ " · ",
2890
+ "@entity.aliveCount",
2891
+ " active"
2892
+ ],
2893
+ "type": "typography",
2894
+ "variant": "caption"
2895
+ }
2896
+ ],
2897
+ "direction": "horizontal",
2898
+ "gap": "sm",
2899
+ "type": "stack",
2900
+ "wrap": true
2901
+ },
2902
+ {
2903
+ "animate": false,
2904
+ "backgroundColor": "@config.backgroundColor",
2905
+ "height": "@config.height",
2906
+ "interactive": true,
2907
+ "keyMap": {
2908
+ "ArrowRight": "STEP",
2909
+ "KeyR": "RESET",
2910
+ "Space": "TOGGLE_RUN"
2911
+ },
2912
+ "onShapeClick": "TAP_CELL",
2913
+ "shapes": "@entity.cellShapes",
2914
+ "type": "learning-canvas",
2915
+ "width": "@config.width"
2916
+ },
2917
+ {
2918
+ "content": "@config.taskText",
2919
+ "type": "typography",
2920
+ "variant": "body"
2921
+ }
2922
+ ],
2923
+ "direction": "vertical",
2924
+ "gap": "md",
2925
+ "type": "stack"
2926
+ }
2927
+ ],
2928
+ "padding": "md",
2929
+ "type": "box"
2930
+ }
2931
+ ],
2932
+ [
2933
+ "emit",
2934
+ "RUN_TOGGLED",
2935
+ {
2936
+ "running": "@entity.running"
2937
+ }
2938
+ ]
2939
+ ],
2940
+ "event": "PAUSE",
2941
+ "eventId": "evt_01M07580Z4SY527GW89VRZRM77",
2942
+ "from": "idle",
2943
+ "guard": [
2944
+ "and",
2945
+ [
2946
+ "==",
2947
+ "@entity.active",
2948
+ true
2949
+ ],
2950
+ [
2951
+ "==",
2952
+ "@entity.running",
2953
+ true
2954
+ ]
2955
+ ],
2956
+ "to": "idle"
2957
+ },
2958
+ {
2959
+ "effects": [
2960
+ [
2961
+ "set",
2962
+ "@entity.cells",
2963
+ [
2964
+ "array/map",
2965
+ [
2966
+ "array/range",
2967
+ 0.0,
2968
+ [
2969
+ "*",
2970
+ "@config.rows",
2971
+ "@config.cols"
2972
+ ]
2973
+ ],
2974
+ [
2975
+ "fn",
2976
+ [
2977
+ "i"
2978
+ ],
2979
+ [
2980
+ "let",
2981
+ [
2982
+ [
2983
+ "r",
2984
+ [
2985
+ "math/floor",
2986
+ [
2987
+ "/",
2988
+ "@i",
2989
+ "@config.cols"
2990
+ ]
2991
+ ]
2992
+ ],
2993
+ [
2994
+ "c",
2995
+ [
2996
+ "math/mod",
2997
+ "@i",
2998
+ "@config.cols"
2999
+ ]
3000
+ ],
3001
+ [
3002
+ "v",
3003
+ [
3004
+ "array/nth",
3005
+ "@entity.cells",
3006
+ "@i"
3007
+ ]
3008
+ ],
3009
+ [
1649
3010
  "up",
1650
3011
  [
1651
3012
  "if",
@@ -2172,90 +3533,256 @@
2172
3533
  {
2173
3534
  "children": [
2174
3535
  {
2175
- "content": "@entity.title",
2176
- "type": "typography",
2177
- "variant": "h4"
2178
- },
2179
- {
2180
- "content": "@config.taskText",
2181
- "type": "typography",
2182
- "variant": "body"
2183
- },
2184
- {
3536
+ "align": "start",
2185
3537
  "children": [
2186
3538
  {
2187
- "action": "RUN",
2188
- "disabled": [
2189
- "if",
2190
- "@entity.running",
2191
- true,
2192
- false
2193
- ],
2194
- "label": "Run",
2195
- "type": "button",
2196
- "variant": "primary"
2197
- },
2198
- {
2199
- "action": "PAUSE",
2200
- "disabled": [
2201
- "if",
2202
- "@entity.running",
2203
- false,
2204
- true
3539
+ "children": [
3540
+ {
3541
+ "content": "@entity.title",
3542
+ "type": "typography",
3543
+ "variant": "h4"
3544
+ },
3545
+ [
3546
+ "if",
3547
+ [
3548
+ "==",
3549
+ "@config.summary",
3550
+ ""
3551
+ ],
3552
+ null,
3553
+ {
3554
+ "color": "muted",
3555
+ "content": "@config.summary",
3556
+ "type": "typography",
3557
+ "variant": "body2"
3558
+ }
3559
+ ]
2205
3560
  ],
2206
- "label": "Pause",
2207
- "type": "button",
2208
- "variant": "secondary"
3561
+ "direction": "vertical",
3562
+ "gap": "xs",
3563
+ "type": "stack"
2209
3564
  },
2210
3565
  {
2211
- "action": "STEP",
2212
- "disabled": [
3566
+ "label": [
2213
3567
  "if",
2214
3568
  "@entity.running",
2215
- true,
2216
- false
3569
+ "Running",
3570
+ "Paused"
2217
3571
  ],
3572
+ "type": "badge",
3573
+ "variant": [
3574
+ "if",
3575
+ "@entity.running",
3576
+ "primary",
3577
+ "neutral"
3578
+ ]
3579
+ }
3580
+ ],
3581
+ "direction": "horizontal",
3582
+ "gap": "md",
3583
+ "justify": "between",
3584
+ "type": "stack"
3585
+ },
3586
+ {
3587
+ "align": "center",
3588
+ "children": [
3589
+ [
3590
+ "if",
3591
+ "@entity.running",
3592
+ {
3593
+ "action": "TOGGLE_RUN",
3594
+ "aria-pressed": "true",
3595
+ "icon": "pause",
3596
+ "label": "Pause",
3597
+ "type": "button",
3598
+ "variant": "primary"
3599
+ },
3600
+ {
3601
+ "action": "TOGGLE_RUN",
3602
+ "aria-pressed": "false",
3603
+ "icon": "play",
3604
+ "label": "Play",
3605
+ "type": "button",
3606
+ "variant": "primary"
3607
+ }
3608
+ ],
3609
+ {
3610
+ "action": "STEP",
3611
+ "disabled": "@entity.running",
3612
+ "icon": "step-forward",
2218
3613
  "label": "@config.stepLabel",
2219
3614
  "type": "button",
2220
3615
  "variant": "secondary"
2221
3616
  },
2222
3617
  {
2223
3618
  "action": "RESET",
3619
+ "icon": "rotate-ccw",
2224
3620
  "label": "Reset",
2225
3621
  "type": "button",
2226
3622
  "variant": "ghost"
3623
+ },
3624
+ {
3625
+ "align": "center",
3626
+ "aria-label": "Speed",
3627
+ "children": [
3628
+ {
3629
+ "action": "SPEED_SET",
3630
+ "actionPayload": {
3631
+ "speed": 0.5
3632
+ },
3633
+ "aria-pressed": [
3634
+ "if",
3635
+ [
3636
+ "==",
3637
+ "@entity.speed",
3638
+ 0.5
3639
+ ],
3640
+ "true",
3641
+ "false"
3642
+ ],
3643
+ "label": "0.5×",
3644
+ "size": "sm",
3645
+ "type": "button",
3646
+ "variant": [
3647
+ "if",
3648
+ [
3649
+ "==",
3650
+ "@entity.speed",
3651
+ 0.5
3652
+ ],
3653
+ "secondary",
3654
+ "ghost"
3655
+ ]
3656
+ },
3657
+ {
3658
+ "action": "SPEED_SET",
3659
+ "actionPayload": {
3660
+ "speed": 1.0
3661
+ },
3662
+ "aria-pressed": [
3663
+ "if",
3664
+ [
3665
+ "==",
3666
+ "@entity.speed",
3667
+ 1.0
3668
+ ],
3669
+ "true",
3670
+ "false"
3671
+ ],
3672
+ "label": "1×",
3673
+ "size": "sm",
3674
+ "type": "button",
3675
+ "variant": [
3676
+ "if",
3677
+ [
3678
+ "==",
3679
+ "@entity.speed",
3680
+ 1.0
3681
+ ],
3682
+ "secondary",
3683
+ "ghost"
3684
+ ]
3685
+ },
3686
+ {
3687
+ "action": "SPEED_SET",
3688
+ "actionPayload": {
3689
+ "speed": 2.0
3690
+ },
3691
+ "aria-pressed": [
3692
+ "if",
3693
+ [
3694
+ "==",
3695
+ "@entity.speed",
3696
+ 2.0
3697
+ ],
3698
+ "true",
3699
+ "false"
3700
+ ],
3701
+ "label": "2×",
3702
+ "size": "sm",
3703
+ "type": "button",
3704
+ "variant": [
3705
+ "if",
3706
+ [
3707
+ "==",
3708
+ "@entity.speed",
3709
+ 2.0
3710
+ ],
3711
+ "secondary",
3712
+ "ghost"
3713
+ ]
3714
+ },
3715
+ {
3716
+ "action": "SPEED_SET",
3717
+ "actionPayload": {
3718
+ "speed": 4.0
3719
+ },
3720
+ "aria-pressed": [
3721
+ "if",
3722
+ [
3723
+ "==",
3724
+ "@entity.speed",
3725
+ 4.0
3726
+ ],
3727
+ "true",
3728
+ "false"
3729
+ ],
3730
+ "label": "4×",
3731
+ "size": "sm",
3732
+ "type": "button",
3733
+ "variant": [
3734
+ "if",
3735
+ [
3736
+ "==",
3737
+ "@entity.speed",
3738
+ 4.0
3739
+ ],
3740
+ "secondary",
3741
+ "ghost"
3742
+ ]
3743
+ }
3744
+ ],
3745
+ "direction": "horizontal",
3746
+ "gap": "xs",
3747
+ "role": "group",
3748
+ "type": "stack"
3749
+ },
3750
+ {
3751
+ "color": "muted",
3752
+ "content": [
3753
+ "str/concat",
3754
+ "Generation ",
3755
+ "@entity.generation",
3756
+ " · ",
3757
+ "@entity.aliveCount",
3758
+ " active"
3759
+ ],
3760
+ "type": "typography",
3761
+ "variant": "caption"
2227
3762
  }
2228
3763
  ],
2229
3764
  "direction": "horizontal",
2230
3765
  "gap": "sm",
2231
- "type": "stack"
3766
+ "type": "stack",
3767
+ "wrap": true
2232
3768
  },
2233
3769
  {
2234
3770
  "animate": false,
2235
3771
  "backgroundColor": "@config.backgroundColor",
2236
3772
  "height": "@config.height",
2237
3773
  "interactive": true,
3774
+ "keyMap": {
3775
+ "ArrowRight": "STEP",
3776
+ "KeyR": "RESET",
3777
+ "Space": "TOGGLE_RUN"
3778
+ },
2238
3779
  "onShapeClick": "TAP_CELL",
2239
3780
  "shapes": "@entity.cellShapes",
2240
3781
  "type": "learning-canvas",
2241
3782
  "width": "@config.width"
2242
3783
  },
2243
3784
  {
2244
- "content": [
2245
- "str/concat",
2246
- "Generation ",
2247
- [
2248
- "str/concat",
2249
- "",
2250
- "@entity.generation"
2251
- ],
2252
- " · active cells: ",
2253
- [
2254
- "str/concat",
2255
- "",
2256
- "@entity.aliveCount"
2257
- ]
2258
- ],
3785
+ "content": "@config.taskText",
2259
3786
  "type": "typography",
2260
3787
  "variant": "body"
2261
3788
  }
@@ -2502,90 +4029,256 @@
2502
4029
  {
2503
4030
  "children": [
2504
4031
  {
2505
- "content": "@entity.title",
2506
- "type": "typography",
2507
- "variant": "h4"
2508
- },
2509
- {
2510
- "content": "@config.taskText",
2511
- "type": "typography",
2512
- "variant": "body"
2513
- },
2514
- {
4032
+ "align": "start",
2515
4033
  "children": [
2516
4034
  {
2517
- "action": "RUN",
2518
- "disabled": [
2519
- "if",
2520
- "@entity.running",
2521
- true,
2522
- false
4035
+ "children": [
4036
+ {
4037
+ "content": "@entity.title",
4038
+ "type": "typography",
4039
+ "variant": "h4"
4040
+ },
4041
+ [
4042
+ "if",
4043
+ [
4044
+ "==",
4045
+ "@config.summary",
4046
+ ""
4047
+ ],
4048
+ null,
4049
+ {
4050
+ "color": "muted",
4051
+ "content": "@config.summary",
4052
+ "type": "typography",
4053
+ "variant": "body2"
4054
+ }
4055
+ ]
2523
4056
  ],
2524
- "label": "Run",
2525
- "type": "button",
2526
- "variant": "primary"
4057
+ "direction": "vertical",
4058
+ "gap": "xs",
4059
+ "type": "stack"
2527
4060
  },
2528
4061
  {
2529
- "action": "PAUSE",
2530
- "disabled": [
4062
+ "label": [
2531
4063
  "if",
2532
4064
  "@entity.running",
2533
- false,
2534
- true
4065
+ "Running",
4066
+ "Paused"
2535
4067
  ],
2536
- "label": "Pause",
2537
- "type": "button",
2538
- "variant": "secondary"
2539
- },
2540
- {
2541
- "action": "STEP",
2542
- "disabled": [
4068
+ "type": "badge",
4069
+ "variant": [
2543
4070
  "if",
2544
4071
  "@entity.running",
2545
- true,
2546
- false
2547
- ],
4072
+ "primary",
4073
+ "neutral"
4074
+ ]
4075
+ }
4076
+ ],
4077
+ "direction": "horizontal",
4078
+ "gap": "md",
4079
+ "justify": "between",
4080
+ "type": "stack"
4081
+ },
4082
+ {
4083
+ "align": "center",
4084
+ "children": [
4085
+ [
4086
+ "if",
4087
+ "@entity.running",
4088
+ {
4089
+ "action": "TOGGLE_RUN",
4090
+ "aria-pressed": "true",
4091
+ "icon": "pause",
4092
+ "label": "Pause",
4093
+ "type": "button",
4094
+ "variant": "primary"
4095
+ },
4096
+ {
4097
+ "action": "TOGGLE_RUN",
4098
+ "aria-pressed": "false",
4099
+ "icon": "play",
4100
+ "label": "Play",
4101
+ "type": "button",
4102
+ "variant": "primary"
4103
+ }
4104
+ ],
4105
+ {
4106
+ "action": "STEP",
4107
+ "disabled": "@entity.running",
4108
+ "icon": "step-forward",
2548
4109
  "label": "@config.stepLabel",
2549
4110
  "type": "button",
2550
4111
  "variant": "secondary"
2551
4112
  },
2552
4113
  {
2553
4114
  "action": "RESET",
4115
+ "icon": "rotate-ccw",
2554
4116
  "label": "Reset",
2555
4117
  "type": "button",
2556
4118
  "variant": "ghost"
4119
+ },
4120
+ {
4121
+ "align": "center",
4122
+ "aria-label": "Speed",
4123
+ "children": [
4124
+ {
4125
+ "action": "SPEED_SET",
4126
+ "actionPayload": {
4127
+ "speed": 0.5
4128
+ },
4129
+ "aria-pressed": [
4130
+ "if",
4131
+ [
4132
+ "==",
4133
+ "@entity.speed",
4134
+ 0.5
4135
+ ],
4136
+ "true",
4137
+ "false"
4138
+ ],
4139
+ "label": "0.5×",
4140
+ "size": "sm",
4141
+ "type": "button",
4142
+ "variant": [
4143
+ "if",
4144
+ [
4145
+ "==",
4146
+ "@entity.speed",
4147
+ 0.5
4148
+ ],
4149
+ "secondary",
4150
+ "ghost"
4151
+ ]
4152
+ },
4153
+ {
4154
+ "action": "SPEED_SET",
4155
+ "actionPayload": {
4156
+ "speed": 1.0
4157
+ },
4158
+ "aria-pressed": [
4159
+ "if",
4160
+ [
4161
+ "==",
4162
+ "@entity.speed",
4163
+ 1.0
4164
+ ],
4165
+ "true",
4166
+ "false"
4167
+ ],
4168
+ "label": "1×",
4169
+ "size": "sm",
4170
+ "type": "button",
4171
+ "variant": [
4172
+ "if",
4173
+ [
4174
+ "==",
4175
+ "@entity.speed",
4176
+ 1.0
4177
+ ],
4178
+ "secondary",
4179
+ "ghost"
4180
+ ]
4181
+ },
4182
+ {
4183
+ "action": "SPEED_SET",
4184
+ "actionPayload": {
4185
+ "speed": 2.0
4186
+ },
4187
+ "aria-pressed": [
4188
+ "if",
4189
+ [
4190
+ "==",
4191
+ "@entity.speed",
4192
+ 2.0
4193
+ ],
4194
+ "true",
4195
+ "false"
4196
+ ],
4197
+ "label": "2×",
4198
+ "size": "sm",
4199
+ "type": "button",
4200
+ "variant": [
4201
+ "if",
4202
+ [
4203
+ "==",
4204
+ "@entity.speed",
4205
+ 2.0
4206
+ ],
4207
+ "secondary",
4208
+ "ghost"
4209
+ ]
4210
+ },
4211
+ {
4212
+ "action": "SPEED_SET",
4213
+ "actionPayload": {
4214
+ "speed": 4.0
4215
+ },
4216
+ "aria-pressed": [
4217
+ "if",
4218
+ [
4219
+ "==",
4220
+ "@entity.speed",
4221
+ 4.0
4222
+ ],
4223
+ "true",
4224
+ "false"
4225
+ ],
4226
+ "label": "4×",
4227
+ "size": "sm",
4228
+ "type": "button",
4229
+ "variant": [
4230
+ "if",
4231
+ [
4232
+ "==",
4233
+ "@entity.speed",
4234
+ 4.0
4235
+ ],
4236
+ "secondary",
4237
+ "ghost"
4238
+ ]
4239
+ }
4240
+ ],
4241
+ "direction": "horizontal",
4242
+ "gap": "xs",
4243
+ "role": "group",
4244
+ "type": "stack"
4245
+ },
4246
+ {
4247
+ "color": "muted",
4248
+ "content": [
4249
+ "str/concat",
4250
+ "Generation ",
4251
+ "@entity.generation",
4252
+ " · ",
4253
+ "@entity.aliveCount",
4254
+ " active"
4255
+ ],
4256
+ "type": "typography",
4257
+ "variant": "caption"
2557
4258
  }
2558
4259
  ],
2559
4260
  "direction": "horizontal",
2560
4261
  "gap": "sm",
2561
- "type": "stack"
4262
+ "type": "stack",
4263
+ "wrap": true
2562
4264
  },
2563
4265
  {
2564
4266
  "animate": false,
2565
4267
  "backgroundColor": "@config.backgroundColor",
2566
4268
  "height": "@config.height",
2567
4269
  "interactive": true,
4270
+ "keyMap": {
4271
+ "ArrowRight": "STEP",
4272
+ "KeyR": "RESET",
4273
+ "Space": "TOGGLE_RUN"
4274
+ },
2568
4275
  "onShapeClick": "TAP_CELL",
2569
4276
  "shapes": "@entity.cellShapes",
2570
4277
  "type": "learning-canvas",
2571
4278
  "width": "@config.width"
2572
4279
  },
2573
4280
  {
2574
- "content": [
2575
- "str/concat",
2576
- "Generation ",
2577
- [
2578
- "str/concat",
2579
- "",
2580
- "@entity.generation"
2581
- ],
2582
- " · active cells: ",
2583
- [
2584
- "str/concat",
2585
- "",
2586
- "@entity.aliveCount"
2587
- ]
2588
- ],
4281
+ "content": "@config.taskText",
2589
4282
  "type": "typography",
2590
4283
  "variant": "body"
2591
4284
  }
@@ -2817,90 +4510,256 @@
2817
4510
  {
2818
4511
  "children": [
2819
4512
  {
2820
- "content": "@entity.title",
2821
- "type": "typography",
2822
- "variant": "h4"
2823
- },
2824
- {
2825
- "content": "@config.taskText",
2826
- "type": "typography",
2827
- "variant": "body"
2828
- },
2829
- {
4513
+ "align": "start",
2830
4514
  "children": [
2831
4515
  {
2832
- "action": "RUN",
2833
- "disabled": [
2834
- "if",
2835
- "@entity.running",
2836
- true,
2837
- false
4516
+ "children": [
4517
+ {
4518
+ "content": "@entity.title",
4519
+ "type": "typography",
4520
+ "variant": "h4"
4521
+ },
4522
+ [
4523
+ "if",
4524
+ [
4525
+ "==",
4526
+ "@config.summary",
4527
+ ""
4528
+ ],
4529
+ null,
4530
+ {
4531
+ "color": "muted",
4532
+ "content": "@config.summary",
4533
+ "type": "typography",
4534
+ "variant": "body2"
4535
+ }
4536
+ ]
2838
4537
  ],
2839
- "label": "Run",
2840
- "type": "button",
2841
- "variant": "primary"
4538
+ "direction": "vertical",
4539
+ "gap": "xs",
4540
+ "type": "stack"
2842
4541
  },
2843
4542
  {
2844
- "action": "PAUSE",
2845
- "disabled": [
4543
+ "label": [
2846
4544
  "if",
2847
4545
  "@entity.running",
2848
- false,
2849
- true
4546
+ "Running",
4547
+ "Paused"
2850
4548
  ],
2851
- "label": "Pause",
2852
- "type": "button",
2853
- "variant": "secondary"
2854
- },
2855
- {
2856
- "action": "STEP",
2857
- "disabled": [
4549
+ "type": "badge",
4550
+ "variant": [
2858
4551
  "if",
2859
4552
  "@entity.running",
2860
- true,
2861
- false
2862
- ],
4553
+ "primary",
4554
+ "neutral"
4555
+ ]
4556
+ }
4557
+ ],
4558
+ "direction": "horizontal",
4559
+ "gap": "md",
4560
+ "justify": "between",
4561
+ "type": "stack"
4562
+ },
4563
+ {
4564
+ "align": "center",
4565
+ "children": [
4566
+ [
4567
+ "if",
4568
+ "@entity.running",
4569
+ {
4570
+ "action": "TOGGLE_RUN",
4571
+ "aria-pressed": "true",
4572
+ "icon": "pause",
4573
+ "label": "Pause",
4574
+ "type": "button",
4575
+ "variant": "primary"
4576
+ },
4577
+ {
4578
+ "action": "TOGGLE_RUN",
4579
+ "aria-pressed": "false",
4580
+ "icon": "play",
4581
+ "label": "Play",
4582
+ "type": "button",
4583
+ "variant": "primary"
4584
+ }
4585
+ ],
4586
+ {
4587
+ "action": "STEP",
4588
+ "disabled": "@entity.running",
4589
+ "icon": "step-forward",
2863
4590
  "label": "@config.stepLabel",
2864
4591
  "type": "button",
2865
4592
  "variant": "secondary"
2866
4593
  },
2867
4594
  {
2868
4595
  "action": "RESET",
4596
+ "icon": "rotate-ccw",
2869
4597
  "label": "Reset",
2870
4598
  "type": "button",
2871
4599
  "variant": "ghost"
4600
+ },
4601
+ {
4602
+ "align": "center",
4603
+ "aria-label": "Speed",
4604
+ "children": [
4605
+ {
4606
+ "action": "SPEED_SET",
4607
+ "actionPayload": {
4608
+ "speed": 0.5
4609
+ },
4610
+ "aria-pressed": [
4611
+ "if",
4612
+ [
4613
+ "==",
4614
+ "@entity.speed",
4615
+ 0.5
4616
+ ],
4617
+ "true",
4618
+ "false"
4619
+ ],
4620
+ "label": "0.5×",
4621
+ "size": "sm",
4622
+ "type": "button",
4623
+ "variant": [
4624
+ "if",
4625
+ [
4626
+ "==",
4627
+ "@entity.speed",
4628
+ 0.5
4629
+ ],
4630
+ "secondary",
4631
+ "ghost"
4632
+ ]
4633
+ },
4634
+ {
4635
+ "action": "SPEED_SET",
4636
+ "actionPayload": {
4637
+ "speed": 1.0
4638
+ },
4639
+ "aria-pressed": [
4640
+ "if",
4641
+ [
4642
+ "==",
4643
+ "@entity.speed",
4644
+ 1.0
4645
+ ],
4646
+ "true",
4647
+ "false"
4648
+ ],
4649
+ "label": "1×",
4650
+ "size": "sm",
4651
+ "type": "button",
4652
+ "variant": [
4653
+ "if",
4654
+ [
4655
+ "==",
4656
+ "@entity.speed",
4657
+ 1.0
4658
+ ],
4659
+ "secondary",
4660
+ "ghost"
4661
+ ]
4662
+ },
4663
+ {
4664
+ "action": "SPEED_SET",
4665
+ "actionPayload": {
4666
+ "speed": 2.0
4667
+ },
4668
+ "aria-pressed": [
4669
+ "if",
4670
+ [
4671
+ "==",
4672
+ "@entity.speed",
4673
+ 2.0
4674
+ ],
4675
+ "true",
4676
+ "false"
4677
+ ],
4678
+ "label": "2×",
4679
+ "size": "sm",
4680
+ "type": "button",
4681
+ "variant": [
4682
+ "if",
4683
+ [
4684
+ "==",
4685
+ "@entity.speed",
4686
+ 2.0
4687
+ ],
4688
+ "secondary",
4689
+ "ghost"
4690
+ ]
4691
+ },
4692
+ {
4693
+ "action": "SPEED_SET",
4694
+ "actionPayload": {
4695
+ "speed": 4.0
4696
+ },
4697
+ "aria-pressed": [
4698
+ "if",
4699
+ [
4700
+ "==",
4701
+ "@entity.speed",
4702
+ 4.0
4703
+ ],
4704
+ "true",
4705
+ "false"
4706
+ ],
4707
+ "label": "4×",
4708
+ "size": "sm",
4709
+ "type": "button",
4710
+ "variant": [
4711
+ "if",
4712
+ [
4713
+ "==",
4714
+ "@entity.speed",
4715
+ 4.0
4716
+ ],
4717
+ "secondary",
4718
+ "ghost"
4719
+ ]
4720
+ }
4721
+ ],
4722
+ "direction": "horizontal",
4723
+ "gap": "xs",
4724
+ "role": "group",
4725
+ "type": "stack"
4726
+ },
4727
+ {
4728
+ "color": "muted",
4729
+ "content": [
4730
+ "str/concat",
4731
+ "Generation ",
4732
+ "@entity.generation",
4733
+ " · ",
4734
+ "@entity.aliveCount",
4735
+ " active"
4736
+ ],
4737
+ "type": "typography",
4738
+ "variant": "caption"
2872
4739
  }
2873
4740
  ],
2874
4741
  "direction": "horizontal",
2875
4742
  "gap": "sm",
2876
- "type": "stack"
4743
+ "type": "stack",
4744
+ "wrap": true
2877
4745
  },
2878
4746
  {
2879
4747
  "animate": false,
2880
4748
  "backgroundColor": "@config.backgroundColor",
2881
4749
  "height": "@config.height",
2882
4750
  "interactive": true,
4751
+ "keyMap": {
4752
+ "ArrowRight": "STEP",
4753
+ "KeyR": "RESET",
4754
+ "Space": "TOGGLE_RUN"
4755
+ },
2883
4756
  "onShapeClick": "TAP_CELL",
2884
4757
  "shapes": "@entity.cellShapes",
2885
4758
  "type": "learning-canvas",
2886
4759
  "width": "@config.width"
2887
4760
  },
2888
4761
  {
2889
- "content": [
2890
- "str/concat",
2891
- "Generation ",
2892
- [
2893
- "str/concat",
2894
- "",
2895
- "@entity.generation"
2896
- ],
2897
- " · active cells: ",
2898
- [
2899
- "str/concat",
2900
- "",
2901
- "@entity.aliveCount"
2902
- ]
2903
- ],
4762
+ "content": "@config.taskText",
2904
4763
  "type": "typography",
2905
4764
  "variant": "body"
2906
4765
  }
@@ -2942,409 +4801,438 @@
2942
4801
  "effects": [
2943
4802
  [
2944
4803
  "set",
2945
- "@entity.cells",
4804
+ "@entity.elapsedMs",
2946
4805
  [
2947
- "array/map",
4806
+ "+",
4807
+ "@entity.elapsedMs",
4808
+ 75.0
4809
+ ]
4810
+ ],
4811
+ [
4812
+ "when",
4813
+ [
4814
+ ">=",
2948
4815
  [
2949
- "array/range",
2950
- 0.0,
2951
- [
2952
- "*",
2953
- "@config.rows",
2954
- "@config.cols"
2955
- ]
4816
+ "*",
4817
+ "@entity.elapsedMs",
4818
+ "@entity.speed"
4819
+ ],
4820
+ 300.0
4821
+ ],
4822
+ [
4823
+ "do",
4824
+ [
4825
+ "set",
4826
+ "@entity.elapsedMs",
4827
+ 0.0
2956
4828
  ],
2957
4829
  [
2958
- "fn",
2959
- [
2960
- "i"
2961
- ],
4830
+ "set",
4831
+ "@entity.cells",
2962
4832
  [
2963
- "let",
4833
+ "array/map",
2964
4834
  [
4835
+ "array/range",
4836
+ 0.0,
2965
4837
  [
2966
- "r",
2967
- [
2968
- "math/floor",
2969
- [
2970
- "/",
2971
- "@i",
2972
- "@config.cols"
2973
- ]
2974
- ]
2975
- ],
2976
- [
2977
- "c",
2978
- [
2979
- "math/mod",
2980
- "@i",
2981
- "@config.cols"
2982
- ]
2983
- ],
2984
- [
2985
- "v",
2986
- [
2987
- "array/nth",
2988
- "@entity.cells",
2989
- "@i"
2990
- ]
2991
- ],
2992
- [
2993
- "up",
2994
- [
2995
- "if",
2996
- [
2997
- ">",
2998
- "@r",
2999
- 0.0
3000
- ],
3001
- [
3002
- "array/nth",
3003
- "@entity.cells",
3004
- [
3005
- "-",
3006
- "@i",
3007
- "@config.cols"
3008
- ]
3009
- ],
3010
- 0.0
3011
- ]
4838
+ "*",
4839
+ "@config.rows",
4840
+ "@config.cols"
4841
+ ]
4842
+ ],
4843
+ [
4844
+ "fn",
4845
+ [
4846
+ "i"
3012
4847
  ],
3013
4848
  [
3014
- "down",
4849
+ "let",
3015
4850
  [
3016
- "if",
3017
4851
  [
3018
- "<",
3019
- "@r",
4852
+ "r",
3020
4853
  [
3021
- "-",
3022
- "@config.rows",
3023
- 1.0
4854
+ "math/floor",
4855
+ [
4856
+ "/",
4857
+ "@i",
4858
+ "@config.cols"
4859
+ ]
3024
4860
  ]
3025
4861
  ],
3026
4862
  [
3027
- "array/nth",
3028
- "@entity.cells",
4863
+ "c",
3029
4864
  [
3030
- "+",
4865
+ "math/mod",
3031
4866
  "@i",
3032
4867
  "@config.cols"
3033
4868
  ]
3034
4869
  ],
3035
- 0.0
3036
- ]
3037
- ],
3038
- [
3039
- "left",
3040
- [
3041
- "if",
3042
- [
3043
- ">",
3044
- "@c",
3045
- 0.0
3046
- ],
3047
- [
3048
- "array/nth",
3049
- "@entity.cells",
3050
- [
3051
- "-",
3052
- "@i",
3053
- 1.0
3054
- ]
3055
- ],
3056
- 0.0
3057
- ]
3058
- ],
3059
- [
3060
- "right",
3061
- [
3062
- "if",
3063
4870
  [
3064
- "<",
3065
- "@c",
4871
+ "v",
3066
4872
  [
3067
- "-",
3068
- "@config.cols",
3069
- 1.0
4873
+ "array/nth",
4874
+ "@entity.cells",
4875
+ "@i"
3070
4876
  ]
3071
4877
  ],
3072
4878
  [
3073
- "array/nth",
3074
- "@entity.cells",
4879
+ "up",
3075
4880
  [
3076
- "+",
3077
- "@i",
3078
- 1.0
4881
+ "if",
4882
+ [
4883
+ ">",
4884
+ "@r",
4885
+ 0.0
4886
+ ],
4887
+ [
4888
+ "array/nth",
4889
+ "@entity.cells",
4890
+ [
4891
+ "-",
4892
+ "@i",
4893
+ "@config.cols"
4894
+ ]
4895
+ ],
4896
+ 0.0
3079
4897
  ]
3080
4898
  ],
3081
- 0.0
3082
- ]
3083
- ],
3084
- [
3085
- "ul",
3086
- [
3087
- "if",
3088
4899
  [
3089
- "and",
4900
+ "down",
3090
4901
  [
3091
- ">",
3092
- "@r",
3093
- 0.0
3094
- ],
3095
- [
3096
- ">",
3097
- "@c",
4902
+ "if",
4903
+ [
4904
+ "<",
4905
+ "@r",
4906
+ [
4907
+ "-",
4908
+ "@config.rows",
4909
+ 1.0
4910
+ ]
4911
+ ],
4912
+ [
4913
+ "array/nth",
4914
+ "@entity.cells",
4915
+ [
4916
+ "+",
4917
+ "@i",
4918
+ "@config.cols"
4919
+ ]
4920
+ ],
3098
4921
  0.0
3099
4922
  ]
3100
4923
  ],
3101
4924
  [
3102
- "array/nth",
3103
- "@entity.cells",
4925
+ "left",
3104
4926
  [
3105
- "-",
4927
+ "if",
3106
4928
  [
3107
- "-",
3108
- "@i",
3109
- "@config.cols"
4929
+ ">",
4930
+ "@c",
4931
+ 0.0
4932
+ ],
4933
+ [
4934
+ "array/nth",
4935
+ "@entity.cells",
4936
+ [
4937
+ "-",
4938
+ "@i",
4939
+ 1.0
4940
+ ]
3110
4941
  ],
3111
- 1.0
4942
+ 0.0
3112
4943
  ]
3113
4944
  ],
3114
- 0.0
3115
- ]
3116
- ],
3117
- [
3118
- "ur",
3119
- [
3120
- "if",
3121
4945
  [
3122
- "and",
3123
- [
3124
- ">",
3125
- "@r",
3126
- 0.0
3127
- ],
4946
+ "right",
3128
4947
  [
3129
- "<",
3130
- "@c",
4948
+ "if",
3131
4949
  [
3132
- "-",
3133
- "@config.cols",
3134
- 1.0
3135
- ]
4950
+ "<",
4951
+ "@c",
4952
+ [
4953
+ "-",
4954
+ "@config.cols",
4955
+ 1.0
4956
+ ]
4957
+ ],
4958
+ [
4959
+ "array/nth",
4960
+ "@entity.cells",
4961
+ [
4962
+ "+",
4963
+ "@i",
4964
+ 1.0
4965
+ ]
4966
+ ],
4967
+ 0.0
3136
4968
  ]
3137
4969
  ],
3138
4970
  [
3139
- "array/nth",
3140
- "@entity.cells",
4971
+ "ul",
3141
4972
  [
3142
- "+",
4973
+ "if",
3143
4974
  [
3144
- "-",
3145
- "@i",
3146
- "@config.cols"
4975
+ "and",
4976
+ [
4977
+ ">",
4978
+ "@r",
4979
+ 0.0
4980
+ ],
4981
+ [
4982
+ ">",
4983
+ "@c",
4984
+ 0.0
4985
+ ]
4986
+ ],
4987
+ [
4988
+ "array/nth",
4989
+ "@entity.cells",
4990
+ [
4991
+ "-",
4992
+ [
4993
+ "-",
4994
+ "@i",
4995
+ "@config.cols"
4996
+ ],
4997
+ 1.0
4998
+ ]
3147
4999
  ],
3148
- 1.0
5000
+ 0.0
3149
5001
  ]
3150
5002
  ],
3151
- 0.0
3152
- ]
3153
- ],
3154
- [
3155
- "dl",
3156
- [
3157
- "if",
3158
5003
  [
3159
- "and",
5004
+ "ur",
3160
5005
  [
3161
- "<",
3162
- "@r",
5006
+ "if",
3163
5007
  [
3164
- "-",
3165
- "@config.rows",
3166
- 1.0
3167
- ]
3168
- ],
3169
- [
3170
- ">",
3171
- "@c",
5008
+ "and",
5009
+ [
5010
+ ">",
5011
+ "@r",
5012
+ 0.0
5013
+ ],
5014
+ [
5015
+ "<",
5016
+ "@c",
5017
+ [
5018
+ "-",
5019
+ "@config.cols",
5020
+ 1.0
5021
+ ]
5022
+ ]
5023
+ ],
5024
+ [
5025
+ "array/nth",
5026
+ "@entity.cells",
5027
+ [
5028
+ "+",
5029
+ [
5030
+ "-",
5031
+ "@i",
5032
+ "@config.cols"
5033
+ ],
5034
+ 1.0
5035
+ ]
5036
+ ],
3172
5037
  0.0
3173
5038
  ]
3174
5039
  ],
3175
5040
  [
3176
- "array/nth",
3177
- "@entity.cells",
5041
+ "dl",
3178
5042
  [
3179
- "-",
5043
+ "if",
3180
5044
  [
3181
- "+",
3182
- "@i",
3183
- "@config.cols"
5045
+ "and",
5046
+ [
5047
+ "<",
5048
+ "@r",
5049
+ [
5050
+ "-",
5051
+ "@config.rows",
5052
+ 1.0
5053
+ ]
5054
+ ],
5055
+ [
5056
+ ">",
5057
+ "@c",
5058
+ 0.0
5059
+ ]
5060
+ ],
5061
+ [
5062
+ "array/nth",
5063
+ "@entity.cells",
5064
+ [
5065
+ "-",
5066
+ [
5067
+ "+",
5068
+ "@i",
5069
+ "@config.cols"
5070
+ ],
5071
+ 1.0
5072
+ ]
3184
5073
  ],
3185
- 1.0
5074
+ 0.0
3186
5075
  ]
3187
5076
  ],
3188
- 0.0
3189
- ]
3190
- ],
3191
- [
3192
- "dr",
3193
- [
3194
- "if",
3195
5077
  [
3196
- "and",
5078
+ "dr",
3197
5079
  [
3198
- "<",
3199
- "@r",
5080
+ "if",
3200
5081
  [
3201
- "-",
3202
- "@config.rows",
3203
- 1.0
3204
- ]
3205
- ],
3206
- [
3207
- "<",
3208
- "@c",
5082
+ "and",
5083
+ [
5084
+ "<",
5085
+ "@r",
5086
+ [
5087
+ "-",
5088
+ "@config.rows",
5089
+ 1.0
5090
+ ]
5091
+ ],
5092
+ [
5093
+ "<",
5094
+ "@c",
5095
+ [
5096
+ "-",
5097
+ "@config.cols",
5098
+ 1.0
5099
+ ]
5100
+ ]
5101
+ ],
3209
5102
  [
3210
- "-",
3211
- "@config.cols",
3212
- 1.0
3213
- ]
5103
+ "array/nth",
5104
+ "@entity.cells",
5105
+ [
5106
+ "+",
5107
+ "@i",
5108
+ "@config.cols",
5109
+ 1.0
5110
+ ]
5111
+ ],
5112
+ 0.0
3214
5113
  ]
3215
5114
  ],
3216
5115
  [
3217
- "array/nth",
3218
- "@entity.cells",
5116
+ "n4",
3219
5117
  [
3220
5118
  "+",
3221
- "@i",
3222
- "@config.cols",
3223
- 1.0
5119
+ "@up",
5120
+ "@down",
5121
+ "@left",
5122
+ "@right"
3224
5123
  ]
3225
5124
  ],
3226
- 0.0
3227
- ]
3228
- ],
3229
- [
3230
- "n4",
3231
- [
3232
- "+",
3233
- "@up",
3234
- "@down",
3235
- "@left",
3236
- "@right"
3237
- ]
3238
- ],
3239
- [
3240
- "n8",
3241
- [
3242
- "+",
3243
- "@n4",
3244
- "@ul",
3245
- "@ur",
3246
- "@dl",
3247
- "@dr"
3248
- ]
3249
- ]
3250
- ],
3251
- [
3252
- "if",
3253
- [
3254
- "==",
3255
- "@config.rule",
3256
- "life"
3257
- ],
3258
- [
3259
- "if",
5125
+ [
5126
+ "n8",
5127
+ [
5128
+ "+",
5129
+ "@n4",
5130
+ "@ul",
5131
+ "@ur",
5132
+ "@dl",
5133
+ "@dr"
5134
+ ]
5135
+ ]
5136
+ ],
3260
5137
  [
3261
5138
  "if",
3262
5139
  [
3263
- ">",
3264
- "@v",
3265
- 0.5
5140
+ "==",
5141
+ "@config.rule",
5142
+ "life"
3266
5143
  ],
3267
5144
  [
3268
5145
  "if",
3269
5146
  [
3270
- "==",
5147
+ "if",
3271
5148
  [
3272
- "math/round",
3273
- "@n8",
3274
- 0.0
5149
+ ">",
5150
+ "@v",
5151
+ 0.5
3275
5152
  ],
3276
- 2.0
3277
- ],
3278
- true,
3279
- [
3280
- "==",
3281
5153
  [
3282
- "math/round",
3283
- "@n8",
3284
- 0.0
5154
+ "if",
5155
+ [
5156
+ "==",
5157
+ [
5158
+ "math/round",
5159
+ "@n8",
5160
+ 0.0
5161
+ ],
5162
+ 2.0
5163
+ ],
5164
+ true,
5165
+ [
5166
+ "==",
5167
+ [
5168
+ "math/round",
5169
+ "@n8",
5170
+ 0.0
5171
+ ],
5172
+ 3.0
5173
+ ]
3285
5174
  ],
3286
- 3.0
3287
- ]
3288
- ],
3289
- [
3290
- "==",
3291
- [
3292
- "math/round",
3293
- "@n8",
3294
- 0.0
5175
+ [
5176
+ "==",
5177
+ [
5178
+ "math/round",
5179
+ "@n8",
5180
+ 0.0
5181
+ ],
5182
+ 3.0
5183
+ ]
3295
5184
  ],
3296
- 3.0
3297
- ]
3298
- ],
3299
- 1.0,
3300
- 0.0
3301
- ],
3302
- [
3303
- "if",
3304
- [
3305
- "==",
3306
- "@config.rule",
3307
- "spread"
3308
- ],
3309
- [
3310
- "if",
5185
+ 1.0,
5186
+ 0.0
5187
+ ],
3311
5188
  [
3312
5189
  "if",
3313
5190
  [
3314
- ">",
3315
- "@v",
3316
- 0.5
5191
+ "==",
5192
+ "@config.rule",
5193
+ "spread"
3317
5194
  ],
3318
- true,
3319
5195
  [
3320
- ">",
3321
- "@n4",
3322
- 0.5
3323
- ]
3324
- ],
3325
- 1.0,
3326
- 0.0
3327
- ],
3328
- [
3329
- "math/max",
3330
- 0.0,
3331
- [
3332
- "*",
3333
- "@config.decay",
5196
+ "if",
5197
+ [
5198
+ "if",
5199
+ [
5200
+ ">",
5201
+ "@v",
5202
+ 0.5
5203
+ ],
5204
+ true,
5205
+ [
5206
+ ">",
5207
+ "@n4",
5208
+ 0.5
5209
+ ]
5210
+ ],
5211
+ 1.0,
5212
+ 0.0
5213
+ ],
3334
5214
  [
3335
- "+",
3336
- "@v",
5215
+ "math/max",
5216
+ 0.0,
3337
5217
  [
3338
5218
  "*",
3339
- "@config.diffuseRate",
5219
+ "@config.decay",
3340
5220
  [
3341
- "-",
5221
+ "+",
5222
+ "@v",
3342
5223
  [
3343
- "/",
3344
- "@n4",
3345
- 4.0
3346
- ],
3347
- "@v"
5224
+ "*",
5225
+ "@config.diffuseRate",
5226
+ [
5227
+ "-",
5228
+ [
5229
+ "/",
5230
+ "@n4",
5231
+ 4.0
5232
+ ],
5233
+ "@v"
5234
+ ]
5235
+ ]
3348
5236
  ]
3349
5237
  ]
3350
5238
  ]
@@ -3353,157 +5241,157 @@
3353
5241
  ]
3354
5242
  ]
3355
5243
  ]
3356
- ]
3357
- ]
3358
- ],
3359
- [
3360
- "set",
3361
- "@entity.generation",
3362
- [
3363
- "+",
3364
- "@entity.generation",
3365
- 1.0
3366
- ]
3367
- ],
3368
- [
3369
- "set",
3370
- "@entity.aliveCount",
3371
- [
3372
- "array/len",
3373
- [
3374
- "array/filter",
3375
- "@entity.cells",
3376
- [
3377
- "fn",
3378
- "v",
3379
- [
3380
- ">",
3381
- "@v",
3382
- 0.05
3383
- ]
3384
- ]
3385
- ]
3386
- ]
3387
- ],
3388
- [
3389
- "set",
3390
- "@entity.cellShapes",
3391
- [
3392
- "array/map",
5244
+ ],
3393
5245
  [
3394
- "array/range",
3395
- 0.0,
5246
+ "set",
5247
+ "@entity.generation",
3396
5248
  [
3397
- "*",
3398
- "@config.rows",
3399
- "@config.cols"
5249
+ "+",
5250
+ "@entity.generation",
5251
+ 1.0
3400
5252
  ]
3401
5253
  ],
3402
5254
  [
3403
- "fn",
5255
+ "set",
5256
+ "@entity.aliveCount",
3404
5257
  [
3405
- "i"
3406
- ],
3407
- [
3408
- "let",
5258
+ "array/len",
3409
5259
  [
5260
+ "array/filter",
5261
+ "@entity.cells",
3410
5262
  [
3411
- "r",
5263
+ "fn",
5264
+ "v",
3412
5265
  [
3413
- "math/floor",
3414
- [
3415
- "/",
3416
- "@i",
3417
- "@config.cols"
3418
- ]
5266
+ ">",
5267
+ "@v",
5268
+ 0.05
3419
5269
  ]
3420
- ],
5270
+ ]
5271
+ ]
5272
+ ]
5273
+ ],
5274
+ [
5275
+ "set",
5276
+ "@entity.cellShapes",
5277
+ [
5278
+ "array/map",
5279
+ [
5280
+ "array/range",
5281
+ 0.0,
3421
5282
  [
3422
- "c",
3423
- [
3424
- "math/mod",
3425
- "@i",
3426
- "@config.cols"
3427
- ]
3428
- ],
5283
+ "*",
5284
+ "@config.rows",
5285
+ "@config.cols"
5286
+ ]
5287
+ ],
5288
+ [
5289
+ "fn",
3429
5290
  [
3430
- "v",
3431
- [
3432
- "array/nth",
3433
- "@entity.cells",
3434
- "@i"
3435
- ]
5291
+ "i"
3436
5292
  ],
3437
5293
  [
3438
- "cellColor",
5294
+ "let",
3439
5295
  [
3440
- "if",
3441
5296
  [
3442
- ">",
3443
- "@v",
3444
- 0.66
5297
+ "r",
5298
+ [
5299
+ "math/floor",
5300
+ [
5301
+ "/",
5302
+ "@i",
5303
+ "@config.cols"
5304
+ ]
5305
+ ]
5306
+ ],
5307
+ [
5308
+ "c",
5309
+ [
5310
+ "math/mod",
5311
+ "@i",
5312
+ "@config.cols"
5313
+ ]
3445
5314
  ],
3446
- "@config.onColor",
3447
5315
  [
3448
- "if",
5316
+ "v",
3449
5317
  [
3450
- ">",
3451
- "@v",
3452
- 0.33
3453
- ],
3454
- "@config.midColor",
5318
+ "array/nth",
5319
+ "@entity.cells",
5320
+ "@i"
5321
+ ]
5322
+ ],
5323
+ [
5324
+ "cellColor",
3455
5325
  [
3456
5326
  "if",
3457
5327
  [
3458
5328
  ">",
3459
5329
  "@v",
3460
- 0.05
5330
+ 0.66
3461
5331
  ],
3462
- "@config.lowColor",
3463
- "@config.offColor"
5332
+ "@config.onColor",
5333
+ [
5334
+ "if",
5335
+ [
5336
+ ">",
5337
+ "@v",
5338
+ 0.33
5339
+ ],
5340
+ "@config.midColor",
5341
+ [
5342
+ "if",
5343
+ [
5344
+ ">",
5345
+ "@v",
5346
+ 0.05
5347
+ ],
5348
+ "@config.lowColor",
5349
+ "@config.offColor"
5350
+ ]
5351
+ ]
3464
5352
  ]
3465
5353
  ]
3466
- ]
3467
- ]
3468
- ],
3469
- {
3470
- "color": "@cellColor",
3471
- "fill": "@cellColor",
3472
- "height": [
3473
- "-",
3474
- "@config.cellSize",
3475
- 2.0
3476
- ],
3477
- "id": [
3478
- "str/concat",
3479
- "cell-",
3480
- "@i"
3481
- ],
3482
- "type": "rect",
3483
- "width": [
3484
- "-",
3485
- "@config.cellSize",
3486
- 2.0
3487
- ],
3488
- "x": [
3489
- "+",
3490
- 10.0,
3491
- [
3492
- "*",
3493
- "@c",
3494
- "@config.cellSize"
3495
- ]
3496
- ],
3497
- "y": [
3498
- "+",
3499
- 10.0,
3500
- [
3501
- "*",
3502
- "@r",
3503
- "@config.cellSize"
3504
- ]
5354
+ ],
5355
+ {
5356
+ "color": "@cellColor",
5357
+ "fill": "@cellColor",
5358
+ "height": [
5359
+ "-",
5360
+ "@config.cellSize",
5361
+ 2.0
5362
+ ],
5363
+ "id": [
5364
+ "str/concat",
5365
+ "cell-",
5366
+ "@i"
5367
+ ],
5368
+ "type": "rect",
5369
+ "width": [
5370
+ "-",
5371
+ "@config.cellSize",
5372
+ 2.0
5373
+ ],
5374
+ "x": [
5375
+ "+",
5376
+ 10.0,
5377
+ [
5378
+ "*",
5379
+ "@c",
5380
+ "@config.cellSize"
5381
+ ]
5382
+ ],
5383
+ "y": [
5384
+ "+",
5385
+ 10.0,
5386
+ [
5387
+ "*",
5388
+ "@r",
5389
+ "@config.cellSize"
5390
+ ]
5391
+ ]
5392
+ }
3505
5393
  ]
3506
- }
5394
+ ]
3507
5395
  ]
3508
5396
  ]
3509
5397
  ]
@@ -3522,7 +5410,7 @@
3522
5410
  true
3523
5411
  ]
3524
5412
  ],
3525
- "interval": 300.0,
5413
+ "interval": 75.0,
3526
5414
  "name": "gridTick"
3527
5415
  }
3528
5416
  ]