@almadar/std 16.239.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 (167) hide show
  1. package/behaviors/behaviors-registry.json +4814 -553
  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-board.lolo +53 -6
  11. package/behaviors/lolo/ui/core/atoms/std-book-reader.lolo +25 -1
  12. package/behaviors/lolo/ui/core/atoms/std-card-grid.lolo +9 -0
  13. package/behaviors/lolo/ui/core/atoms/std-doc-page.lolo +153 -0
  14. package/behaviors/lolo/ui/core/atoms/std-site-header.lolo +15 -3
  15. package/behaviors/lolo/ui/core/atoms/std-tag-strip.lolo +2 -2
  16. package/behaviors/lolo/ui/core/atoms/std-tag-taxonomy.lolo +7 -7
  17. package/behaviors/lolo/ui/core/atoms/std-version-history.lolo +1 -1
  18. package/behaviors/lolo/ui/core/molecules/ui-header.lolo +5 -0
  19. package/behaviors/lolo/ui/learning/atoms/std-learn-arrangement.lolo +124 -92
  20. package/behaviors/lolo/ui/learning/atoms/std-learn-classify.lolo +114 -55
  21. package/behaviors/lolo/ui/learning/atoms/std-learn-compare.lolo +40 -14
  22. package/behaviors/lolo/ui/learning/atoms/std-learn-coupled-sim.lolo +363 -123
  23. package/behaviors/lolo/ui/learning/atoms/std-learn-derivation.lolo +93 -48
  24. package/behaviors/lolo/ui/learning/atoms/std-learn-diagram.lolo +60 -28
  25. package/behaviors/lolo/ui/learning/atoms/std-learn-doser.lolo +193 -96
  26. package/behaviors/lolo/ui/learning/atoms/std-learn-estimate.lolo +75 -32
  27. package/behaviors/lolo/ui/learning/atoms/std-learn-goal-seek.lolo +142 -86
  28. package/behaviors/lolo/ui/learning/atoms/std-learn-grid-sim.lolo +266 -98
  29. package/behaviors/lolo/ui/learning/atoms/std-learn-hotspot.lolo +103 -65
  30. package/behaviors/lolo/ui/learning/atoms/std-learn-live-sim.lolo +223 -109
  31. package/behaviors/lolo/ui/learning/atoms/std-learn-measure.lolo +232 -64
  32. package/behaviors/lolo/ui/learning/atoms/std-learn-param-explorer.lolo +69 -29
  33. package/behaviors/lolo/ui/learning/atoms/std-learn-perturb.lolo +363 -123
  34. package/behaviors/lolo/ui/learning/atoms/std-learn-predict.lolo +73 -41
  35. package/behaviors/lolo/ui/learning/atoms/std-learn-sample-accumulator.lolo +96 -38
  36. package/behaviors/lolo/ui/learning/atoms/std-learn-sandbox.lolo +65 -45
  37. package/behaviors/lolo/ui/learning/atoms/std-learn-scatter-fit.lolo +243 -117
  38. package/behaviors/lolo/ui/learning/atoms/std-learn-scenario.lolo +76 -28
  39. package/behaviors/lolo/ui/learning/atoms/std-learn-sim-3d.lolo +228 -109
  40. package/behaviors/lolo/ui/learning/atoms/std-learn-speed-drill.lolo +95 -44
  41. package/behaviors/lolo/ui/learning/atoms/std-learn-stepper.lolo +199 -125
  42. package/behaviors/lolo/ui/learning/atoms/std-learn-tour-3d.lolo +92 -48
  43. package/behaviors/lolo/ui/learning/atoms/std-learn-trace-player.lolo +239 -78
  44. package/behaviors/lolo/ui/learning/atoms/std-learn-transport.lolo +147 -38
  45. package/behaviors/lolo/ui/learning/atoms/std-learn-tree.lolo +123 -58
  46. package/behaviors/lolo/ui/learning/atoms/ui-algo-graph-canvas.lolo +22 -0
  47. package/behaviors/lolo/ui/learning/atoms/ui-algorithm-canvas.lolo +26 -0
  48. package/behaviors/lolo/ui/learning/atoms/ui-biology-canvas.lolo +26 -0
  49. package/behaviors/lolo/ui/learning/atoms/ui-chemistry-canvas.lolo +27 -1
  50. package/behaviors/lolo/ui/learning/atoms/ui-learning-canvas.lolo +27 -1
  51. package/behaviors/lolo/ui/learning/atoms/ui-math-canvas.lolo +29 -9
  52. package/behaviors/lolo/ui/learning/atoms/ui-physics-canvas.lolo +26 -0
  53. package/behaviors/lolo-behavior-contracts.json +1 -1
  54. package/behaviors/registry/agent/atoms/std-agent-memory.orb +372 -2
  55. package/behaviors/registry/agent/atoms/std-agent-session.orb +4752 -348
  56. package/behaviors/registry/agent/atoms/std-agent-tool-loop.orb +54 -42
  57. package/behaviors/registry/agent/organisms/std-agent-assistant.orb +356 -122
  58. package/behaviors/registry/factory-signatures.json +1 -1
  59. package/behaviors/registry/infra/atoms/std-page-open.orb +435 -0
  60. package/behaviors/registry/infra/atoms/std-page-search.orb +867 -0
  61. package/behaviors/registry/infra/atoms/std-page-treat.orb +494 -0
  62. package/behaviors/registry/infra/atoms/std-page-watch.orb +554 -0
  63. package/behaviors/registry/ui/core/atoms/std-board.orb +110 -14
  64. package/behaviors/registry/ui/core/atoms/std-book-reader.orb +119 -0
  65. package/behaviors/registry/ui/core/atoms/std-card-grid.orb +61 -0
  66. package/behaviors/registry/ui/core/atoms/std-doc-page.orb +594 -0
  67. package/behaviors/registry/ui/core/atoms/std-site-header.orb +40 -2
  68. package/behaviors/registry/ui/core/atoms/std-tag-strip.orb +2 -0
  69. package/behaviors/registry/ui/core/atoms/std-tag-taxonomy.orb +24 -0
  70. package/behaviors/registry/ui/core/atoms/std-version-history.orb +8 -1
  71. package/behaviors/registry/ui/core/molecules/ui-header.orb +7 -0
  72. package/behaviors/registry/ui/learning/atoms/std-learn-arrangement.orb +903 -369
  73. package/behaviors/registry/ui/learning/atoms/std-learn-classify.orb +1002 -232
  74. package/behaviors/registry/ui/learning/atoms/std-learn-compare.orb +253 -74
  75. package/behaviors/registry/ui/learning/atoms/std-learn-coupled-sim.orb +3624 -921
  76. package/behaviors/registry/ui/learning/atoms/std-learn-derivation.orb +685 -144
  77. package/behaviors/registry/ui/learning/atoms/std-learn-diagram.orb +404 -52
  78. package/behaviors/registry/ui/learning/atoms/std-learn-doser.orb +1787 -210
  79. package/behaviors/registry/ui/learning/atoms/std-learn-estimate.orb +699 -71
  80. package/behaviors/registry/ui/learning/atoms/std-learn-goal-seek.orb +1102 -578
  81. package/behaviors/registry/ui/learning/atoms/std-learn-grid-sim.orb +2760 -872
  82. package/behaviors/registry/ui/learning/atoms/std-learn-hotspot.orb +689 -152
  83. package/behaviors/registry/ui/learning/atoms/std-learn-live-sim.orb +1431 -633
  84. package/behaviors/registry/ui/learning/atoms/std-learn-measure.orb +2485 -512
  85. package/behaviors/registry/ui/learning/atoms/std-learn-param-explorer.orb +501 -197
  86. package/behaviors/registry/ui/learning/atoms/std-learn-perturb.orb +3642 -928
  87. package/behaviors/registry/ui/learning/atoms/std-learn-predict.orb +705 -125
  88. package/behaviors/registry/ui/learning/atoms/std-learn-sample-accumulator.orb +624 -114
  89. package/behaviors/registry/ui/learning/atoms/std-learn-sandbox.orb +405 -153
  90. package/behaviors/registry/ui/learning/atoms/std-learn-scatter-fit.orb +1911 -611
  91. package/behaviors/registry/ui/learning/atoms/std-learn-scenario.orb +436 -128
  92. package/behaviors/registry/ui/learning/atoms/std-learn-sim-3d.orb +2482 -485
  93. package/behaviors/registry/ui/learning/atoms/std-learn-speed-drill.orb +896 -192
  94. package/behaviors/registry/ui/learning/atoms/std-learn-stepper.orb +2001 -759
  95. package/behaviors/registry/ui/learning/atoms/std-learn-tour-3d.orb +734 -228
  96. package/behaviors/registry/ui/learning/atoms/std-learn-trace-player.orb +2501 -764
  97. package/behaviors/registry/ui/learning/atoms/std-learn-transport.orb +1591 -173
  98. package/behaviors/registry/ui/learning/atoms/std-learn-tree.orb +883 -122
  99. package/behaviors/registry/ui/learning/atoms/ui-algo-graph-canvas.orb +176 -0
  100. package/behaviors/registry/ui/learning/atoms/ui-algorithm-canvas.orb +211 -0
  101. package/behaviors/registry/ui/learning/atoms/ui-biology-canvas.orb +211 -0
  102. package/behaviors/registry/ui/learning/atoms/ui-chemistry-canvas.orb +212 -1
  103. package/behaviors/registry/ui/learning/atoms/ui-learning-canvas.orb +212 -1
  104. package/behaviors/registry/ui/learning/atoms/ui-math-canvas.orb +203 -9
  105. package/behaviors/registry/ui/learning/atoms/ui-physics-canvas.orb +211 -0
  106. package/behaviors/signatures.lolo +325 -655
  107. package/canonical-operators.json +35 -1
  108. package/dist/behaviors/exports-reader.js +41980 -35508
  109. package/dist/behaviors/functions/index.d.ts +1063 -140
  110. package/dist/behaviors/functions/index.js +41951 -35506
  111. package/dist/behaviors/index.d.ts +1 -1
  112. package/dist/behaviors/index.js +41981 -35509
  113. package/dist/behaviors/query.js +41980 -35508
  114. package/dist/behaviors-embeddings.hash.json +3 -3
  115. package/dist/behaviors-embeddings.json +47 -27
  116. package/dist/behaviors-registry.json +4814 -553
  117. package/dist/index.d.ts +4 -4
  118. package/dist/index.js +42019 -35509
  119. package/dist/knob-embeddings.hash.json +3 -3
  120. package/dist/knob-embeddings.json +623 -263
  121. package/dist/modules/anim.d.ts +1 -1
  122. package/dist/modules/array.d.ts +1 -1
  123. package/dist/modules/async.d.ts +1 -1
  124. package/dist/modules/behavior.d.ts +1 -1
  125. package/dist/modules/browser.d.ts +1 -1
  126. package/dist/modules/composition.d.ts +1 -1
  127. package/dist/modules/contract.d.ts +1 -1
  128. package/dist/modules/core.d.ts +1 -1
  129. package/dist/modules/core.js +2 -0
  130. package/dist/modules/data.d.ts +1 -1
  131. package/dist/modules/ease.d.ts +1 -1
  132. package/dist/modules/format.d.ts +1 -1
  133. package/dist/modules/geo.d.ts +1 -1
  134. package/dist/modules/graph.d.ts +1 -1
  135. package/dist/modules/grid.d.ts +1 -1
  136. package/dist/modules/i18n.d.ts +17 -0
  137. package/dist/modules/i18n.js +22 -0
  138. package/dist/modules/index.d.ts +2 -1
  139. package/dist/modules/index.js +24 -1
  140. package/dist/modules/integration.d.ts +1 -1
  141. package/dist/modules/json.d.ts +1 -1
  142. package/dist/modules/llm.d.ts +1 -1
  143. package/dist/modules/math.d.ts +1 -1
  144. package/dist/modules/memory.d.ts +1 -1
  145. package/dist/modules/nn.d.ts +1 -1
  146. package/dist/modules/noise.d.ts +1 -1
  147. package/dist/modules/object.d.ts +1 -1
  148. package/dist/modules/os.d.ts +1 -1
  149. package/dist/modules/path.d.ts +1 -1
  150. package/dist/modules/prob.d.ts +1 -1
  151. package/dist/modules/session.d.ts +1 -1
  152. package/dist/modules/str.d.ts +1 -1
  153. package/dist/modules/tensor.d.ts +1 -1
  154. package/dist/modules/time.d.ts +1 -1
  155. package/dist/modules/trace.d.ts +1 -1
  156. package/dist/modules/train.d.ts +1 -1
  157. package/dist/modules/validate.d.ts +1 -1
  158. package/dist/modules/vector.d.ts +1 -1
  159. package/dist/modules/workspace.d.ts +1 -1
  160. package/dist/registry/factory-signatures.json +1 -1
  161. package/dist/registry.d.ts +10 -3
  162. package/dist/registry.js +31 -1
  163. package/dist/{types-DLx38UFZ.d.ts → types-Cdb321uM.d.ts} +9 -3
  164. package/i18n/ar.json +1 -0
  165. package/i18n/en.json +1 -0
  166. package/i18n/sl.json +1 -0
  167. package/package.json +3 -3
@@ -73,6 +73,24 @@
73
73
  "parent": "trt_01M055GQ61JS78ZEMDZ0VQXK05",
74
74
  "renames": []
75
75
  },
76
+ "evt_01M41KYRWHNQAV91TFYYX082AQ": {
77
+ "bakedName": "SPEED_SET",
78
+ "curName": "SPEED_SET",
79
+ "id": "evt_01M41KYRWHNQAV91TFYYX082AQ",
80
+ "kind": "event",
81
+ "owner": "workspace",
82
+ "parent": "trt_01M055GQ61JS78ZEMDZ0VQXK05",
83
+ "renames": []
84
+ },
85
+ "evt_01M41KYRWHVGNZB4MRHMTMJY0C": {
86
+ "bakedName": "TOGGLE_RUN",
87
+ "curName": "TOGGLE_RUN",
88
+ "id": "evt_01M41KYRWHVGNZB4MRHMTMJY0C",
89
+ "kind": "event",
90
+ "owner": "workspace",
91
+ "parent": "trt_01M055GQ61JS78ZEMDZ0VQXK05",
92
+ "renames": []
93
+ },
76
94
  "orb_01M055GQ614BBGQKXAACQ604DE": {
77
95
  "bakedName": "LearnTracePlayerOrbital",
78
96
  "curName": "LearnTracePlayerOrbital",
@@ -129,6 +147,16 @@
129
147
  "name": "running",
130
148
  "type": "boolean"
131
149
  },
150
+ {
151
+ "default": 1.0,
152
+ "name": "speed",
153
+ "type": "number"
154
+ },
155
+ {
156
+ "default": 0.0,
157
+ "name": "elapsedMs",
158
+ "type": "number"
159
+ },
132
160
  {
133
161
  "items": {
134
162
  "properties": {
@@ -190,13 +218,14 @@
190
218
  "category": "interaction",
191
219
  "config": {
192
220
  "backgroundColor": {
193
- "default": "#f8fafc",
221
+ "default": "",
222
+ "description": "Canvas ground override; empty uses the theme's drawing ground.",
194
223
  "label": "Background Color",
195
224
  "tier": "presentation",
196
225
  "type": "string"
197
226
  },
198
227
  "baseColor": {
199
- "default": "#3b82f6",
228
+ "default": "series-1",
200
229
  "description": "Color of bars not highlighted in the current frame.",
201
230
  "label": "Base Bar Color",
202
231
  "tier": "presentation",
@@ -343,7 +372,7 @@
343
372
  "type": "number"
344
373
  },
345
374
  "highlightColor": {
346
- "default": "#f59e0b",
375
+ "default": "highlight",
347
376
  "description": "Color of bars whose index appears in the current frame's highlights.",
348
377
  "label": "Highlight Bar Color",
349
378
  "tier": "presentation",
@@ -363,6 +392,13 @@
363
392
  "tier": "presentation",
364
393
  "type": "string"
365
394
  },
395
+ "summary": {
396
+ "default": "",
397
+ "description": "One line under the title saying what the learner is looking at (keep it under ~65 characters). Empty shows no line.",
398
+ "label": "Concept",
399
+ "tier": "presentation",
400
+ "type": "string"
401
+ },
366
402
  "tickMs": {
367
403
  "default": 500.0,
368
404
  "description": "Milliseconds per frame shown in the readout; the autoplay cadence.",
@@ -372,7 +408,7 @@
372
408
  },
373
409
  "title": {
374
410
  "default": "Trace Player",
375
- "description": "Title shown above the instrument.",
411
+ "description": "The instrument's name, the header's one hero.",
376
412
  "label": "Title",
377
413
  "tier": "presentation",
378
414
  "type": "string"
@@ -422,6 +458,11 @@
422
458
  "resource": "@entity.bars",
423
459
  "site": "tick"
424
460
  },
461
+ {
462
+ "kind": "set",
463
+ "resource": "@entity.elapsedMs",
464
+ "site": "tick"
465
+ },
425
466
  {
426
467
  "kind": "set",
427
468
  "resource": "@entity.frameCaption"
@@ -458,6 +499,10 @@
458
499
  "resource": "@entity.running",
459
500
  "site": "tick"
460
501
  },
502
+ {
503
+ "kind": "set",
504
+ "resource": "@entity.speed"
505
+ },
461
506
  {
462
507
  "kind": "set",
463
508
  "resource": "@entity.statusNote"
@@ -514,10 +559,12 @@
514
559
  "provides": [
515
560
  "active",
516
561
  "bars",
562
+ "elapsedMs",
517
563
  "frameCaption",
518
564
  "frameIndex",
519
565
  "frameLabel",
520
566
  "running",
567
+ "speed",
521
568
  "statusNote",
522
569
  "title"
523
570
  ],
@@ -552,6 +599,26 @@
552
599
  ],
553
600
  "tier": "domain"
554
601
  },
602
+ {
603
+ "description": "Learner pressed the Play/Pause toggle — starts or freezes the frame cursor.",
604
+ "id": "evt_01M41KYRWHVGNZB4MRHMTMJY0C",
605
+ "key": "TOGGLE_RUN",
606
+ "name": "Toggle Run",
607
+ "tier": "domain"
608
+ },
609
+ {
610
+ "description": "The learner picked a playback speed; frames advance that many times faster.",
611
+ "id": "evt_01M41KYRWHNQAV91TFYYX082AQ",
612
+ "key": "SPEED_SET",
613
+ "name": "Speed Set",
614
+ "payloadSchema": [
615
+ {
616
+ "name": "speed",
617
+ "type": "number"
618
+ }
619
+ ],
620
+ "tier": "presentation"
621
+ },
555
622
  {
556
623
  "description": "Learner pressed Play — the frame cursor begins advancing on the tick until the last frame is reached or Pause is pressed.",
557
624
  "id": "evt_01M055GQ62B00NKC2P41ZHMYTR",
@@ -716,33 +783,247 @@
716
783
  {
717
784
  "children": [
718
785
  {
719
- "content": "@entity.title",
720
- "type": "typography",
721
- "variant": "h4"
786
+ "align": "start",
787
+ "children": [
788
+ {
789
+ "children": [
790
+ {
791
+ "content": "@entity.title",
792
+ "type": "typography",
793
+ "variant": "h4"
794
+ },
795
+ [
796
+ "if",
797
+ [
798
+ "==",
799
+ "@config.summary",
800
+ ""
801
+ ],
802
+ null,
803
+ {
804
+ "color": "muted",
805
+ "content": "@config.summary",
806
+ "type": "typography",
807
+ "variant": "body2"
808
+ }
809
+ ]
810
+ ],
811
+ "direction": "vertical",
812
+ "gap": "xs",
813
+ "type": "stack"
814
+ },
815
+ {
816
+ "label": "@entity.statusNote",
817
+ "type": "badge",
818
+ "variant": [
819
+ "if",
820
+ [
821
+ "==",
822
+ "@entity.statusNote",
823
+ "Finished"
824
+ ],
825
+ "success",
826
+ [
827
+ "if",
828
+ "@entity.running",
829
+ "primary",
830
+ "neutral"
831
+ ]
832
+ ]
833
+ }
834
+ ],
835
+ "direction": "horizontal",
836
+ "gap": "md",
837
+ "justify": "between",
838
+ "type": "stack"
722
839
  },
723
840
  {
724
- "label": [
725
- "str/concat",
726
- "Frame ",
841
+ "align": "center",
842
+ "children": [
727
843
  [
728
- "str/concat",
729
- "",
730
- [
731
- "+",
732
- "@entity.frameIndex",
733
- 1.0
734
- ]
844
+ "if",
845
+ "@entity.running",
846
+ {
847
+ "action": "TOGGLE_RUN",
848
+ "aria-pressed": "true",
849
+ "icon": "pause",
850
+ "label": "Pause",
851
+ "type": "button",
852
+ "variant": "primary"
853
+ },
854
+ {
855
+ "action": "TOGGLE_RUN",
856
+ "aria-pressed": "false",
857
+ "disabled": [
858
+ "==",
859
+ "@entity.statusNote",
860
+ "Finished"
861
+ ],
862
+ "icon": "play",
863
+ "label": "Play",
864
+ "type": "button",
865
+ "variant": "primary"
866
+ }
735
867
  ],
736
- " of ",
737
- [
738
- "str/concat",
739
- "",
740
- [
741
- "array/len",
742
- "@config.frames"
743
- ]
744
- ]
868
+ {
869
+ "action": "RESTART",
870
+ "icon": "rotate-ccw",
871
+ "label": "Restart",
872
+ "type": "button",
873
+ "variant": "ghost"
874
+ },
875
+ {
876
+ "align": "center",
877
+ "aria-label": "Speed",
878
+ "children": [
879
+ {
880
+ "action": "SPEED_SET",
881
+ "actionPayload": {
882
+ "speed": 0.5
883
+ },
884
+ "aria-pressed": [
885
+ "if",
886
+ [
887
+ "==",
888
+ "@entity.speed",
889
+ 0.5
890
+ ],
891
+ "true",
892
+ "false"
893
+ ],
894
+ "label": "0.5×",
895
+ "size": "sm",
896
+ "type": "button",
897
+ "variant": [
898
+ "if",
899
+ [
900
+ "==",
901
+ "@entity.speed",
902
+ 0.5
903
+ ],
904
+ "secondary",
905
+ "ghost"
906
+ ]
907
+ },
908
+ {
909
+ "action": "SPEED_SET",
910
+ "actionPayload": {
911
+ "speed": 1.0
912
+ },
913
+ "aria-pressed": [
914
+ "if",
915
+ [
916
+ "==",
917
+ "@entity.speed",
918
+ 1.0
919
+ ],
920
+ "true",
921
+ "false"
922
+ ],
923
+ "label": "1×",
924
+ "size": "sm",
925
+ "type": "button",
926
+ "variant": [
927
+ "if",
928
+ [
929
+ "==",
930
+ "@entity.speed",
931
+ 1.0
932
+ ],
933
+ "secondary",
934
+ "ghost"
935
+ ]
936
+ },
937
+ {
938
+ "action": "SPEED_SET",
939
+ "actionPayload": {
940
+ "speed": 2.0
941
+ },
942
+ "aria-pressed": [
943
+ "if",
944
+ [
945
+ "==",
946
+ "@entity.speed",
947
+ 2.0
948
+ ],
949
+ "true",
950
+ "false"
951
+ ],
952
+ "label": "2×",
953
+ "size": "sm",
954
+ "type": "button",
955
+ "variant": [
956
+ "if",
957
+ [
958
+ "==",
959
+ "@entity.speed",
960
+ 2.0
961
+ ],
962
+ "secondary",
963
+ "ghost"
964
+ ]
965
+ },
966
+ {
967
+ "action": "SPEED_SET",
968
+ "actionPayload": {
969
+ "speed": 4.0
970
+ },
971
+ "aria-pressed": [
972
+ "if",
973
+ [
974
+ "==",
975
+ "@entity.speed",
976
+ 4.0
977
+ ],
978
+ "true",
979
+ "false"
980
+ ],
981
+ "label": "4×",
982
+ "size": "sm",
983
+ "type": "button",
984
+ "variant": [
985
+ "if",
986
+ [
987
+ "==",
988
+ "@entity.speed",
989
+ 4.0
990
+ ],
991
+ "secondary",
992
+ "ghost"
993
+ ]
994
+ }
995
+ ],
996
+ "direction": "horizontal",
997
+ "gap": "xs",
998
+ "role": "group",
999
+ "type": "stack"
1000
+ },
1001
+ {
1002
+ "color": "muted",
1003
+ "content": [
1004
+ "str/concat",
1005
+ "Frame ",
1006
+ [
1007
+ "+",
1008
+ "@entity.frameIndex",
1009
+ 1.0
1010
+ ],
1011
+ " of ",
1012
+ [
1013
+ "array/len",
1014
+ "@config.frames"
1015
+ ]
1016
+ ],
1017
+ "type": "typography",
1018
+ "variant": "caption"
1019
+ }
745
1020
  ],
1021
+ "direction": "horizontal",
1022
+ "gap": "sm",
1023
+ "type": "stack",
1024
+ "wrap": true
1025
+ },
1026
+ {
746
1027
  "max": [
747
1028
  "array/len",
748
1029
  "@config.frames"
@@ -759,46 +1040,13 @@
759
1040
  "backgroundColor": "@config.backgroundColor",
760
1041
  "bars": "@entity.bars",
761
1042
  "height": "@config.height",
1043
+ "keyMap": {
1044
+ "KeyR": "RESTART",
1045
+ "Space": "TOGGLE_RUN"
1046
+ },
762
1047
  "type": "algorithm-canvas",
763
1048
  "width": "@config.width"
764
1049
  },
765
- {
766
- "children": [
767
- {
768
- "action": "PLAY",
769
- "disabled": [
770
- "if",
771
- "@entity.running",
772
- true,
773
- false
774
- ],
775
- "label": "Play",
776
- "type": "button",
777
- "variant": "primary"
778
- },
779
- {
780
- "action": "PAUSE",
781
- "disabled": [
782
- "if",
783
- "@entity.running",
784
- false,
785
- true
786
- ],
787
- "label": "Pause",
788
- "type": "button",
789
- "variant": "secondary"
790
- },
791
- {
792
- "action": "RESTART",
793
- "label": "Restart",
794
- "type": "button",
795
- "variant": "ghost"
796
- }
797
- ],
798
- "direction": "horizontal",
799
- "gap": "sm",
800
- "type": "stack"
801
- },
802
1050
  {
803
1051
  "children": [
804
1052
  {
@@ -811,27 +1059,6 @@
811
1059
  "title": "@entity.frameLabel",
812
1060
  "type": "card",
813
1061
  "variant": "bordered"
814
- },
815
- {
816
- "content": [
817
- "str/concat",
818
- "@entity.statusNote",
819
- " · ",
820
- [
821
- "str/concat",
822
- "",
823
- "@config.tickMs"
824
- ],
825
- " ms/frame",
826
- [
827
- "if",
828
- "@config.loop",
829
- " · loops",
830
- ""
831
- ]
832
- ],
833
- "type": "typography",
834
- "variant": "caption"
835
1062
  }
836
1063
  ],
837
1064
  "direction": "vertical",
@@ -854,6 +1081,48 @@
854
1081
  ],
855
1082
  "to": "idle"
856
1083
  },
1084
+ {
1085
+ "effects": [
1086
+ [
1087
+ "set",
1088
+ "@entity.active",
1089
+ false
1090
+ ],
1091
+ [
1092
+ "set",
1093
+ "@entity.running",
1094
+ false
1095
+ ],
1096
+ [
1097
+ "render-ui",
1098
+ "main",
1099
+ null
1100
+ ]
1101
+ ],
1102
+ "event": "MODE_SELECTED",
1103
+ "eventId": "evt_01M055GQ62P0G7TCNBQ7WTTSZD",
1104
+ "from": "idle",
1105
+ "guard": [
1106
+ "and",
1107
+ [
1108
+ "not",
1109
+ [
1110
+ "==",
1111
+ "@config.matchMode",
1112
+ ""
1113
+ ]
1114
+ ],
1115
+ [
1116
+ "not",
1117
+ [
1118
+ "==",
1119
+ "@payload.mode",
1120
+ "@config.matchMode"
1121
+ ]
1122
+ ]
1123
+ ],
1124
+ "to": "idle"
1125
+ },
857
1126
  {
858
1127
  "effects": [
859
1128
  [
@@ -957,33 +1226,247 @@
957
1226
  {
958
1227
  "children": [
959
1228
  {
960
- "content": "@entity.title",
961
- "type": "typography",
962
- "variant": "h4"
1229
+ "align": "start",
1230
+ "children": [
1231
+ {
1232
+ "children": [
1233
+ {
1234
+ "content": "@entity.title",
1235
+ "type": "typography",
1236
+ "variant": "h4"
1237
+ },
1238
+ [
1239
+ "if",
1240
+ [
1241
+ "==",
1242
+ "@config.summary",
1243
+ ""
1244
+ ],
1245
+ null,
1246
+ {
1247
+ "color": "muted",
1248
+ "content": "@config.summary",
1249
+ "type": "typography",
1250
+ "variant": "body2"
1251
+ }
1252
+ ]
1253
+ ],
1254
+ "direction": "vertical",
1255
+ "gap": "xs",
1256
+ "type": "stack"
1257
+ },
1258
+ {
1259
+ "label": "@entity.statusNote",
1260
+ "type": "badge",
1261
+ "variant": [
1262
+ "if",
1263
+ [
1264
+ "==",
1265
+ "@entity.statusNote",
1266
+ "Finished"
1267
+ ],
1268
+ "success",
1269
+ [
1270
+ "if",
1271
+ "@entity.running",
1272
+ "primary",
1273
+ "neutral"
1274
+ ]
1275
+ ]
1276
+ }
1277
+ ],
1278
+ "direction": "horizontal",
1279
+ "gap": "md",
1280
+ "justify": "between",
1281
+ "type": "stack"
963
1282
  },
964
1283
  {
965
- "label": [
966
- "str/concat",
967
- "Frame ",
1284
+ "align": "center",
1285
+ "children": [
968
1286
  [
969
- "str/concat",
970
- "",
971
- [
972
- "+",
973
- "@entity.frameIndex",
974
- 1.0
975
- ]
1287
+ "if",
1288
+ "@entity.running",
1289
+ {
1290
+ "action": "TOGGLE_RUN",
1291
+ "aria-pressed": "true",
1292
+ "icon": "pause",
1293
+ "label": "Pause",
1294
+ "type": "button",
1295
+ "variant": "primary"
1296
+ },
1297
+ {
1298
+ "action": "TOGGLE_RUN",
1299
+ "aria-pressed": "false",
1300
+ "disabled": [
1301
+ "==",
1302
+ "@entity.statusNote",
1303
+ "Finished"
1304
+ ],
1305
+ "icon": "play",
1306
+ "label": "Play",
1307
+ "type": "button",
1308
+ "variant": "primary"
1309
+ }
976
1310
  ],
977
- " of ",
978
- [
979
- "str/concat",
980
- "",
981
- [
982
- "array/len",
983
- "@config.frames"
984
- ]
985
- ]
1311
+ {
1312
+ "action": "RESTART",
1313
+ "icon": "rotate-ccw",
1314
+ "label": "Restart",
1315
+ "type": "button",
1316
+ "variant": "ghost"
1317
+ },
1318
+ {
1319
+ "align": "center",
1320
+ "aria-label": "Speed",
1321
+ "children": [
1322
+ {
1323
+ "action": "SPEED_SET",
1324
+ "actionPayload": {
1325
+ "speed": 0.5
1326
+ },
1327
+ "aria-pressed": [
1328
+ "if",
1329
+ [
1330
+ "==",
1331
+ "@entity.speed",
1332
+ 0.5
1333
+ ],
1334
+ "true",
1335
+ "false"
1336
+ ],
1337
+ "label": "0.5×",
1338
+ "size": "sm",
1339
+ "type": "button",
1340
+ "variant": [
1341
+ "if",
1342
+ [
1343
+ "==",
1344
+ "@entity.speed",
1345
+ 0.5
1346
+ ],
1347
+ "secondary",
1348
+ "ghost"
1349
+ ]
1350
+ },
1351
+ {
1352
+ "action": "SPEED_SET",
1353
+ "actionPayload": {
1354
+ "speed": 1.0
1355
+ },
1356
+ "aria-pressed": [
1357
+ "if",
1358
+ [
1359
+ "==",
1360
+ "@entity.speed",
1361
+ 1.0
1362
+ ],
1363
+ "true",
1364
+ "false"
1365
+ ],
1366
+ "label": "1×",
1367
+ "size": "sm",
1368
+ "type": "button",
1369
+ "variant": [
1370
+ "if",
1371
+ [
1372
+ "==",
1373
+ "@entity.speed",
1374
+ 1.0
1375
+ ],
1376
+ "secondary",
1377
+ "ghost"
1378
+ ]
1379
+ },
1380
+ {
1381
+ "action": "SPEED_SET",
1382
+ "actionPayload": {
1383
+ "speed": 2.0
1384
+ },
1385
+ "aria-pressed": [
1386
+ "if",
1387
+ [
1388
+ "==",
1389
+ "@entity.speed",
1390
+ 2.0
1391
+ ],
1392
+ "true",
1393
+ "false"
1394
+ ],
1395
+ "label": "2×",
1396
+ "size": "sm",
1397
+ "type": "button",
1398
+ "variant": [
1399
+ "if",
1400
+ [
1401
+ "==",
1402
+ "@entity.speed",
1403
+ 2.0
1404
+ ],
1405
+ "secondary",
1406
+ "ghost"
1407
+ ]
1408
+ },
1409
+ {
1410
+ "action": "SPEED_SET",
1411
+ "actionPayload": {
1412
+ "speed": 4.0
1413
+ },
1414
+ "aria-pressed": [
1415
+ "if",
1416
+ [
1417
+ "==",
1418
+ "@entity.speed",
1419
+ 4.0
1420
+ ],
1421
+ "true",
1422
+ "false"
1423
+ ],
1424
+ "label": "4×",
1425
+ "size": "sm",
1426
+ "type": "button",
1427
+ "variant": [
1428
+ "if",
1429
+ [
1430
+ "==",
1431
+ "@entity.speed",
1432
+ 4.0
1433
+ ],
1434
+ "secondary",
1435
+ "ghost"
1436
+ ]
1437
+ }
1438
+ ],
1439
+ "direction": "horizontal",
1440
+ "gap": "xs",
1441
+ "role": "group",
1442
+ "type": "stack"
1443
+ },
1444
+ {
1445
+ "color": "muted",
1446
+ "content": [
1447
+ "str/concat",
1448
+ "Frame ",
1449
+ [
1450
+ "+",
1451
+ "@entity.frameIndex",
1452
+ 1.0
1453
+ ],
1454
+ " of ",
1455
+ [
1456
+ "array/len",
1457
+ "@config.frames"
1458
+ ]
1459
+ ],
1460
+ "type": "typography",
1461
+ "variant": "caption"
1462
+ }
986
1463
  ],
1464
+ "direction": "horizontal",
1465
+ "gap": "sm",
1466
+ "type": "stack",
1467
+ "wrap": true
1468
+ },
1469
+ {
987
1470
  "max": [
988
1471
  "array/len",
989
1472
  "@config.frames"
@@ -1000,46 +1483,13 @@
1000
1483
  "backgroundColor": "@config.backgroundColor",
1001
1484
  "bars": "@entity.bars",
1002
1485
  "height": "@config.height",
1486
+ "keyMap": {
1487
+ "KeyR": "RESTART",
1488
+ "Space": "TOGGLE_RUN"
1489
+ },
1003
1490
  "type": "algorithm-canvas",
1004
1491
  "width": "@config.width"
1005
1492
  },
1006
- {
1007
- "children": [
1008
- {
1009
- "action": "PLAY",
1010
- "disabled": [
1011
- "if",
1012
- "@entity.running",
1013
- true,
1014
- false
1015
- ],
1016
- "label": "Play",
1017
- "type": "button",
1018
- "variant": "primary"
1019
- },
1020
- {
1021
- "action": "PAUSE",
1022
- "disabled": [
1023
- "if",
1024
- "@entity.running",
1025
- false,
1026
- true
1027
- ],
1028
- "label": "Pause",
1029
- "type": "button",
1030
- "variant": "secondary"
1031
- },
1032
- {
1033
- "action": "RESTART",
1034
- "label": "Restart",
1035
- "type": "button",
1036
- "variant": "ghost"
1037
- }
1038
- ],
1039
- "direction": "horizontal",
1040
- "gap": "sm",
1041
- "type": "stack"
1042
- },
1043
1493
  {
1044
1494
  "children": [
1045
1495
  {
@@ -1052,27 +1502,6 @@
1052
1502
  "title": "@entity.frameLabel",
1053
1503
  "type": "card",
1054
1504
  "variant": "bordered"
1055
- },
1056
- {
1057
- "content": [
1058
- "str/concat",
1059
- "@entity.statusNote",
1060
- " · ",
1061
- [
1062
- "str/concat",
1063
- "",
1064
- "@config.tickMs"
1065
- ],
1066
- " ms/frame",
1067
- [
1068
- "if",
1069
- "@config.loop",
1070
- " · loops",
1071
- ""
1072
- ]
1073
- ],
1074
- "type": "typography",
1075
- "variant": "caption"
1076
1505
  }
1077
1506
  ],
1078
1507
  "direction": "vertical",
@@ -1100,12 +1529,20 @@
1100
1529
  [
1101
1530
  "set",
1102
1531
  "@entity.running",
1103
- true
1532
+ [
1533
+ "not",
1534
+ "@entity.running"
1535
+ ]
1104
1536
  ],
1105
1537
  [
1106
1538
  "set",
1107
1539
  "@entity.statusNote",
1108
- "Playing"
1540
+ [
1541
+ "if",
1542
+ "@entity.running",
1543
+ "Playing",
1544
+ "Paused"
1545
+ ]
1109
1546
  ],
1110
1547
  [
1111
1548
  "render-ui",
@@ -1115,33 +1552,247 @@
1115
1552
  {
1116
1553
  "children": [
1117
1554
  {
1118
- "content": "@entity.title",
1119
- "type": "typography",
1120
- "variant": "h4"
1555
+ "align": "start",
1556
+ "children": [
1557
+ {
1558
+ "children": [
1559
+ {
1560
+ "content": "@entity.title",
1561
+ "type": "typography",
1562
+ "variant": "h4"
1563
+ },
1564
+ [
1565
+ "if",
1566
+ [
1567
+ "==",
1568
+ "@config.summary",
1569
+ ""
1570
+ ],
1571
+ null,
1572
+ {
1573
+ "color": "muted",
1574
+ "content": "@config.summary",
1575
+ "type": "typography",
1576
+ "variant": "body2"
1577
+ }
1578
+ ]
1579
+ ],
1580
+ "direction": "vertical",
1581
+ "gap": "xs",
1582
+ "type": "stack"
1583
+ },
1584
+ {
1585
+ "label": "@entity.statusNote",
1586
+ "type": "badge",
1587
+ "variant": [
1588
+ "if",
1589
+ [
1590
+ "==",
1591
+ "@entity.statusNote",
1592
+ "Finished"
1593
+ ],
1594
+ "success",
1595
+ [
1596
+ "if",
1597
+ "@entity.running",
1598
+ "primary",
1599
+ "neutral"
1600
+ ]
1601
+ ]
1602
+ }
1603
+ ],
1604
+ "direction": "horizontal",
1605
+ "gap": "md",
1606
+ "justify": "between",
1607
+ "type": "stack"
1121
1608
  },
1122
1609
  {
1123
- "label": [
1124
- "str/concat",
1125
- "Frame ",
1610
+ "align": "center",
1611
+ "children": [
1126
1612
  [
1127
- "str/concat",
1128
- "",
1129
- [
1130
- "+",
1131
- "@entity.frameIndex",
1132
- 1.0
1133
- ]
1613
+ "if",
1614
+ "@entity.running",
1615
+ {
1616
+ "action": "TOGGLE_RUN",
1617
+ "aria-pressed": "true",
1618
+ "icon": "pause",
1619
+ "label": "Pause",
1620
+ "type": "button",
1621
+ "variant": "primary"
1622
+ },
1623
+ {
1624
+ "action": "TOGGLE_RUN",
1625
+ "aria-pressed": "false",
1626
+ "disabled": [
1627
+ "==",
1628
+ "@entity.statusNote",
1629
+ "Finished"
1630
+ ],
1631
+ "icon": "play",
1632
+ "label": "Play",
1633
+ "type": "button",
1634
+ "variant": "primary"
1635
+ }
1134
1636
  ],
1135
- " of ",
1136
- [
1137
- "str/concat",
1138
- "",
1139
- [
1140
- "array/len",
1141
- "@config.frames"
1142
- ]
1143
- ]
1637
+ {
1638
+ "action": "RESTART",
1639
+ "icon": "rotate-ccw",
1640
+ "label": "Restart",
1641
+ "type": "button",
1642
+ "variant": "ghost"
1643
+ },
1644
+ {
1645
+ "align": "center",
1646
+ "aria-label": "Speed",
1647
+ "children": [
1648
+ {
1649
+ "action": "SPEED_SET",
1650
+ "actionPayload": {
1651
+ "speed": 0.5
1652
+ },
1653
+ "aria-pressed": [
1654
+ "if",
1655
+ [
1656
+ "==",
1657
+ "@entity.speed",
1658
+ 0.5
1659
+ ],
1660
+ "true",
1661
+ "false"
1662
+ ],
1663
+ "label": "0.5×",
1664
+ "size": "sm",
1665
+ "type": "button",
1666
+ "variant": [
1667
+ "if",
1668
+ [
1669
+ "==",
1670
+ "@entity.speed",
1671
+ 0.5
1672
+ ],
1673
+ "secondary",
1674
+ "ghost"
1675
+ ]
1676
+ },
1677
+ {
1678
+ "action": "SPEED_SET",
1679
+ "actionPayload": {
1680
+ "speed": 1.0
1681
+ },
1682
+ "aria-pressed": [
1683
+ "if",
1684
+ [
1685
+ "==",
1686
+ "@entity.speed",
1687
+ 1.0
1688
+ ],
1689
+ "true",
1690
+ "false"
1691
+ ],
1692
+ "label": "1×",
1693
+ "size": "sm",
1694
+ "type": "button",
1695
+ "variant": [
1696
+ "if",
1697
+ [
1698
+ "==",
1699
+ "@entity.speed",
1700
+ 1.0
1701
+ ],
1702
+ "secondary",
1703
+ "ghost"
1704
+ ]
1705
+ },
1706
+ {
1707
+ "action": "SPEED_SET",
1708
+ "actionPayload": {
1709
+ "speed": 2.0
1710
+ },
1711
+ "aria-pressed": [
1712
+ "if",
1713
+ [
1714
+ "==",
1715
+ "@entity.speed",
1716
+ 2.0
1717
+ ],
1718
+ "true",
1719
+ "false"
1720
+ ],
1721
+ "label": "2×",
1722
+ "size": "sm",
1723
+ "type": "button",
1724
+ "variant": [
1725
+ "if",
1726
+ [
1727
+ "==",
1728
+ "@entity.speed",
1729
+ 2.0
1730
+ ],
1731
+ "secondary",
1732
+ "ghost"
1733
+ ]
1734
+ },
1735
+ {
1736
+ "action": "SPEED_SET",
1737
+ "actionPayload": {
1738
+ "speed": 4.0
1739
+ },
1740
+ "aria-pressed": [
1741
+ "if",
1742
+ [
1743
+ "==",
1744
+ "@entity.speed",
1745
+ 4.0
1746
+ ],
1747
+ "true",
1748
+ "false"
1749
+ ],
1750
+ "label": "4×",
1751
+ "size": "sm",
1752
+ "type": "button",
1753
+ "variant": [
1754
+ "if",
1755
+ [
1756
+ "==",
1757
+ "@entity.speed",
1758
+ 4.0
1759
+ ],
1760
+ "secondary",
1761
+ "ghost"
1762
+ ]
1763
+ }
1764
+ ],
1765
+ "direction": "horizontal",
1766
+ "gap": "xs",
1767
+ "role": "group",
1768
+ "type": "stack"
1769
+ },
1770
+ {
1771
+ "color": "muted",
1772
+ "content": [
1773
+ "str/concat",
1774
+ "Frame ",
1775
+ [
1776
+ "+",
1777
+ "@entity.frameIndex",
1778
+ 1.0
1779
+ ],
1780
+ " of ",
1781
+ [
1782
+ "array/len",
1783
+ "@config.frames"
1784
+ ]
1785
+ ],
1786
+ "type": "typography",
1787
+ "variant": "caption"
1788
+ }
1144
1789
  ],
1790
+ "direction": "horizontal",
1791
+ "gap": "sm",
1792
+ "type": "stack",
1793
+ "wrap": true
1794
+ },
1795
+ {
1145
1796
  "max": [
1146
1797
  "array/len",
1147
1798
  "@config.frames"
@@ -1158,46 +1809,13 @@
1158
1809
  "backgroundColor": "@config.backgroundColor",
1159
1810
  "bars": "@entity.bars",
1160
1811
  "height": "@config.height",
1812
+ "keyMap": {
1813
+ "KeyR": "RESTART",
1814
+ "Space": "TOGGLE_RUN"
1815
+ },
1161
1816
  "type": "algorithm-canvas",
1162
1817
  "width": "@config.width"
1163
1818
  },
1164
- {
1165
- "children": [
1166
- {
1167
- "action": "PLAY",
1168
- "disabled": [
1169
- "if",
1170
- "@entity.running",
1171
- true,
1172
- false
1173
- ],
1174
- "label": "Play",
1175
- "type": "button",
1176
- "variant": "primary"
1177
- },
1178
- {
1179
- "action": "PAUSE",
1180
- "disabled": [
1181
- "if",
1182
- "@entity.running",
1183
- false,
1184
- true
1185
- ],
1186
- "label": "Pause",
1187
- "type": "button",
1188
- "variant": "secondary"
1189
- },
1190
- {
1191
- "action": "RESTART",
1192
- "label": "Restart",
1193
- "type": "button",
1194
- "variant": "ghost"
1195
- }
1196
- ],
1197
- "direction": "horizontal",
1198
- "gap": "sm",
1199
- "type": "stack"
1200
- },
1201
1819
  {
1202
1820
  "children": [
1203
1821
  {
@@ -1210,27 +1828,6 @@
1210
1828
  "title": "@entity.frameLabel",
1211
1829
  "type": "card",
1212
1830
  "variant": "bordered"
1213
- },
1214
- {
1215
- "content": [
1216
- "str/concat",
1217
- "@entity.statusNote",
1218
- " · ",
1219
- [
1220
- "str/concat",
1221
- "",
1222
- "@config.tickMs"
1223
- ],
1224
- " ms/frame",
1225
- [
1226
- "if",
1227
- "@config.loop",
1228
- " · loops",
1229
- ""
1230
- ]
1231
- ],
1232
- "type": "typography",
1233
- "variant": "caption"
1234
1831
  }
1235
1832
  ],
1236
1833
  "direction": "vertical",
@@ -1241,18 +1838,10 @@
1241
1838
  "padding": "md",
1242
1839
  "type": "box"
1243
1840
  }
1244
- ],
1245
- [
1246
- "emit",
1247
- "FRAME_ADVANCED",
1248
- {
1249
- "frameIndex": "@entity.frameIndex",
1250
- "frameLabel": "@entity.frameLabel"
1251
- }
1252
1841
  ]
1253
1842
  ],
1254
- "event": "PLAY",
1255
- "eventId": "evt_01M055GQ62B00NKC2P41ZHMYTR",
1843
+ "event": "TOGGLE_RUN",
1844
+ "eventId": "evt_01M41KYRWHVGNZB4MRHMTMJY0C",
1256
1845
  "from": "idle",
1257
1846
  "guard": [
1258
1847
  "==",
@@ -1265,13 +1854,8 @@
1265
1854
  "effects": [
1266
1855
  [
1267
1856
  "set",
1268
- "@entity.running",
1269
- false
1270
- ],
1271
- [
1272
- "set",
1273
- "@entity.statusNote",
1274
- "Paused"
1857
+ "@entity.speed",
1858
+ "@payload.speed"
1275
1859
  ],
1276
1860
  [
1277
1861
  "render-ui",
@@ -1281,33 +1865,247 @@
1281
1865
  {
1282
1866
  "children": [
1283
1867
  {
1284
- "content": "@entity.title",
1285
- "type": "typography",
1286
- "variant": "h4"
1868
+ "align": "start",
1869
+ "children": [
1870
+ {
1871
+ "children": [
1872
+ {
1873
+ "content": "@entity.title",
1874
+ "type": "typography",
1875
+ "variant": "h4"
1876
+ },
1877
+ [
1878
+ "if",
1879
+ [
1880
+ "==",
1881
+ "@config.summary",
1882
+ ""
1883
+ ],
1884
+ null,
1885
+ {
1886
+ "color": "muted",
1887
+ "content": "@config.summary",
1888
+ "type": "typography",
1889
+ "variant": "body2"
1890
+ }
1891
+ ]
1892
+ ],
1893
+ "direction": "vertical",
1894
+ "gap": "xs",
1895
+ "type": "stack"
1896
+ },
1897
+ {
1898
+ "label": "@entity.statusNote",
1899
+ "type": "badge",
1900
+ "variant": [
1901
+ "if",
1902
+ [
1903
+ "==",
1904
+ "@entity.statusNote",
1905
+ "Finished"
1906
+ ],
1907
+ "success",
1908
+ [
1909
+ "if",
1910
+ "@entity.running",
1911
+ "primary",
1912
+ "neutral"
1913
+ ]
1914
+ ]
1915
+ }
1916
+ ],
1917
+ "direction": "horizontal",
1918
+ "gap": "md",
1919
+ "justify": "between",
1920
+ "type": "stack"
1287
1921
  },
1288
1922
  {
1289
- "label": [
1290
- "str/concat",
1291
- "Frame ",
1923
+ "align": "center",
1924
+ "children": [
1292
1925
  [
1293
- "str/concat",
1294
- "",
1295
- [
1296
- "+",
1297
- "@entity.frameIndex",
1298
- 1.0
1299
- ]
1926
+ "if",
1927
+ "@entity.running",
1928
+ {
1929
+ "action": "TOGGLE_RUN",
1930
+ "aria-pressed": "true",
1931
+ "icon": "pause",
1932
+ "label": "Pause",
1933
+ "type": "button",
1934
+ "variant": "primary"
1935
+ },
1936
+ {
1937
+ "action": "TOGGLE_RUN",
1938
+ "aria-pressed": "false",
1939
+ "disabled": [
1940
+ "==",
1941
+ "@entity.statusNote",
1942
+ "Finished"
1943
+ ],
1944
+ "icon": "play",
1945
+ "label": "Play",
1946
+ "type": "button",
1947
+ "variant": "primary"
1948
+ }
1300
1949
  ],
1301
- " of ",
1302
- [
1303
- "str/concat",
1304
- "",
1305
- [
1306
- "array/len",
1307
- "@config.frames"
1308
- ]
1309
- ]
1950
+ {
1951
+ "action": "RESTART",
1952
+ "icon": "rotate-ccw",
1953
+ "label": "Restart",
1954
+ "type": "button",
1955
+ "variant": "ghost"
1956
+ },
1957
+ {
1958
+ "align": "center",
1959
+ "aria-label": "Speed",
1960
+ "children": [
1961
+ {
1962
+ "action": "SPEED_SET",
1963
+ "actionPayload": {
1964
+ "speed": 0.5
1965
+ },
1966
+ "aria-pressed": [
1967
+ "if",
1968
+ [
1969
+ "==",
1970
+ "@entity.speed",
1971
+ 0.5
1972
+ ],
1973
+ "true",
1974
+ "false"
1975
+ ],
1976
+ "label": "0.5×",
1977
+ "size": "sm",
1978
+ "type": "button",
1979
+ "variant": [
1980
+ "if",
1981
+ [
1982
+ "==",
1983
+ "@entity.speed",
1984
+ 0.5
1985
+ ],
1986
+ "secondary",
1987
+ "ghost"
1988
+ ]
1989
+ },
1990
+ {
1991
+ "action": "SPEED_SET",
1992
+ "actionPayload": {
1993
+ "speed": 1.0
1994
+ },
1995
+ "aria-pressed": [
1996
+ "if",
1997
+ [
1998
+ "==",
1999
+ "@entity.speed",
2000
+ 1.0
2001
+ ],
2002
+ "true",
2003
+ "false"
2004
+ ],
2005
+ "label": "1×",
2006
+ "size": "sm",
2007
+ "type": "button",
2008
+ "variant": [
2009
+ "if",
2010
+ [
2011
+ "==",
2012
+ "@entity.speed",
2013
+ 1.0
2014
+ ],
2015
+ "secondary",
2016
+ "ghost"
2017
+ ]
2018
+ },
2019
+ {
2020
+ "action": "SPEED_SET",
2021
+ "actionPayload": {
2022
+ "speed": 2.0
2023
+ },
2024
+ "aria-pressed": [
2025
+ "if",
2026
+ [
2027
+ "==",
2028
+ "@entity.speed",
2029
+ 2.0
2030
+ ],
2031
+ "true",
2032
+ "false"
2033
+ ],
2034
+ "label": "2×",
2035
+ "size": "sm",
2036
+ "type": "button",
2037
+ "variant": [
2038
+ "if",
2039
+ [
2040
+ "==",
2041
+ "@entity.speed",
2042
+ 2.0
2043
+ ],
2044
+ "secondary",
2045
+ "ghost"
2046
+ ]
2047
+ },
2048
+ {
2049
+ "action": "SPEED_SET",
2050
+ "actionPayload": {
2051
+ "speed": 4.0
2052
+ },
2053
+ "aria-pressed": [
2054
+ "if",
2055
+ [
2056
+ "==",
2057
+ "@entity.speed",
2058
+ 4.0
2059
+ ],
2060
+ "true",
2061
+ "false"
2062
+ ],
2063
+ "label": "4×",
2064
+ "size": "sm",
2065
+ "type": "button",
2066
+ "variant": [
2067
+ "if",
2068
+ [
2069
+ "==",
2070
+ "@entity.speed",
2071
+ 4.0
2072
+ ],
2073
+ "secondary",
2074
+ "ghost"
2075
+ ]
2076
+ }
2077
+ ],
2078
+ "direction": "horizontal",
2079
+ "gap": "xs",
2080
+ "role": "group",
2081
+ "type": "stack"
2082
+ },
2083
+ {
2084
+ "color": "muted",
2085
+ "content": [
2086
+ "str/concat",
2087
+ "Frame ",
2088
+ [
2089
+ "+",
2090
+ "@entity.frameIndex",
2091
+ 1.0
2092
+ ],
2093
+ " of ",
2094
+ [
2095
+ "array/len",
2096
+ "@config.frames"
2097
+ ]
2098
+ ],
2099
+ "type": "typography",
2100
+ "variant": "caption"
2101
+ }
1310
2102
  ],
2103
+ "direction": "horizontal",
2104
+ "gap": "sm",
2105
+ "type": "stack",
2106
+ "wrap": true
2107
+ },
2108
+ {
1311
2109
  "max": [
1312
2110
  "array/len",
1313
2111
  "@config.frames"
@@ -1324,46 +2122,13 @@
1324
2122
  "backgroundColor": "@config.backgroundColor",
1325
2123
  "bars": "@entity.bars",
1326
2124
  "height": "@config.height",
2125
+ "keyMap": {
2126
+ "KeyR": "RESTART",
2127
+ "Space": "TOGGLE_RUN"
2128
+ },
1327
2129
  "type": "algorithm-canvas",
1328
2130
  "width": "@config.width"
1329
2131
  },
1330
- {
1331
- "children": [
1332
- {
1333
- "action": "PLAY",
1334
- "disabled": [
1335
- "if",
1336
- "@entity.running",
1337
- true,
1338
- false
1339
- ],
1340
- "label": "Play",
1341
- "type": "button",
1342
- "variant": "primary"
1343
- },
1344
- {
1345
- "action": "PAUSE",
1346
- "disabled": [
1347
- "if",
1348
- "@entity.running",
1349
- false,
1350
- true
1351
- ],
1352
- "label": "Pause",
1353
- "type": "button",
1354
- "variant": "secondary"
1355
- },
1356
- {
1357
- "action": "RESTART",
1358
- "label": "Restart",
1359
- "type": "button",
1360
- "variant": "ghost"
1361
- }
1362
- ],
1363
- "direction": "horizontal",
1364
- "gap": "sm",
1365
- "type": "stack"
1366
- },
1367
2132
  {
1368
2133
  "children": [
1369
2134
  {
@@ -1376,27 +2141,6 @@
1376
2141
  "title": "@entity.frameLabel",
1377
2142
  "type": "card",
1378
2143
  "variant": "bordered"
1379
- },
1380
- {
1381
- "content": [
1382
- "str/concat",
1383
- "@entity.statusNote",
1384
- " · ",
1385
- [
1386
- "str/concat",
1387
- "",
1388
- "@config.tickMs"
1389
- ],
1390
- " ms/frame",
1391
- [
1392
- "if",
1393
- "@config.loop",
1394
- " · loops",
1395
- ""
1396
- ]
1397
- ],
1398
- "type": "typography",
1399
- "variant": "caption"
1400
2144
  }
1401
2145
  ],
1402
2146
  "direction": "vertical",
@@ -1407,18 +2151,10 @@
1407
2151
  "padding": "md",
1408
2152
  "type": "box"
1409
2153
  }
1410
- ],
1411
- [
1412
- "emit",
1413
- "FRAME_ADVANCED",
1414
- {
1415
- "frameIndex": "@entity.frameIndex",
1416
- "frameLabel": "@entity.frameLabel"
1417
- }
1418
2154
  ]
1419
2155
  ],
1420
- "event": "PAUSE",
1421
- "eventId": "evt_01M055GQ62T1PP5X8K4TSKV435",
2156
+ "event": "SPEED_SET",
2157
+ "eventId": "evt_01M41KYRWHNQAV91TFYYX082AQ",
1422
2158
  "from": "idle",
1423
2159
  "guard": [
1424
2160
  "==",
@@ -1429,88 +2165,15 @@
1429
2165
  },
1430
2166
  {
1431
2167
  "effects": [
1432
- [
1433
- "set",
1434
- "@entity.frameIndex",
1435
- 0.0
1436
- ],
1437
2168
  [
1438
2169
  "set",
1439
2170
  "@entity.running",
1440
- false
2171
+ true
1441
2172
  ],
1442
2173
  [
1443
2174
  "set",
1444
2175
  "@entity.statusNote",
1445
- "Paused"
1446
- ],
1447
- [
1448
- "set",
1449
- "@entity.frameLabel",
1450
- [
1451
- "object/get",
1452
- [
1453
- "array/nth",
1454
- "@config.frames",
1455
- "@entity.frameIndex"
1456
- ],
1457
- "label"
1458
- ]
1459
- ],
1460
- [
1461
- "set",
1462
- "@entity.frameCaption",
1463
- [
1464
- "object/get",
1465
- [
1466
- "array/nth",
1467
- "@config.frames",
1468
- "@entity.frameIndex"
1469
- ],
1470
- "caption"
1471
- ]
1472
- ],
1473
- [
1474
- "set",
1475
- "@entity.bars",
1476
- [
1477
- "array/map",
1478
- [
1479
- "object/get",
1480
- [
1481
- "array/nth",
1482
- "@config.frames",
1483
- "@entity.frameIndex"
1484
- ],
1485
- "values"
1486
- ],
1487
- {
1488
- "color": [
1489
- "if",
1490
- [
1491
- "array/includes",
1492
- [
1493
- "object/get",
1494
- [
1495
- "array/nth",
1496
- "@config.frames",
1497
- "@entity.frameIndex"
1498
- ],
1499
- "highlights"
1500
- ],
1501
- "@index"
1502
- ],
1503
- "@config.highlightColor",
1504
- "@config.baseColor"
1505
- ],
1506
- "label": [
1507
- "str/concat",
1508
- "",
1509
- "@item"
1510
- ],
1511
- "value": "@item"
1512
- }
1513
- ]
2176
+ "Playing"
1514
2177
  ],
1515
2178
  [
1516
2179
  "render-ui",
@@ -1520,33 +2183,247 @@
1520
2183
  {
1521
2184
  "children": [
1522
2185
  {
1523
- "content": "@entity.title",
1524
- "type": "typography",
1525
- "variant": "h4"
2186
+ "align": "start",
2187
+ "children": [
2188
+ {
2189
+ "children": [
2190
+ {
2191
+ "content": "@entity.title",
2192
+ "type": "typography",
2193
+ "variant": "h4"
2194
+ },
2195
+ [
2196
+ "if",
2197
+ [
2198
+ "==",
2199
+ "@config.summary",
2200
+ ""
2201
+ ],
2202
+ null,
2203
+ {
2204
+ "color": "muted",
2205
+ "content": "@config.summary",
2206
+ "type": "typography",
2207
+ "variant": "body2"
2208
+ }
2209
+ ]
2210
+ ],
2211
+ "direction": "vertical",
2212
+ "gap": "xs",
2213
+ "type": "stack"
2214
+ },
2215
+ {
2216
+ "label": "@entity.statusNote",
2217
+ "type": "badge",
2218
+ "variant": [
2219
+ "if",
2220
+ [
2221
+ "==",
2222
+ "@entity.statusNote",
2223
+ "Finished"
2224
+ ],
2225
+ "success",
2226
+ [
2227
+ "if",
2228
+ "@entity.running",
2229
+ "primary",
2230
+ "neutral"
2231
+ ]
2232
+ ]
2233
+ }
2234
+ ],
2235
+ "direction": "horizontal",
2236
+ "gap": "md",
2237
+ "justify": "between",
2238
+ "type": "stack"
1526
2239
  },
1527
2240
  {
1528
- "label": [
1529
- "str/concat",
1530
- "Frame ",
2241
+ "align": "center",
2242
+ "children": [
1531
2243
  [
1532
- "str/concat",
1533
- "",
1534
- [
1535
- "+",
1536
- "@entity.frameIndex",
1537
- 1.0
1538
- ]
2244
+ "if",
2245
+ "@entity.running",
2246
+ {
2247
+ "action": "TOGGLE_RUN",
2248
+ "aria-pressed": "true",
2249
+ "icon": "pause",
2250
+ "label": "Pause",
2251
+ "type": "button",
2252
+ "variant": "primary"
2253
+ },
2254
+ {
2255
+ "action": "TOGGLE_RUN",
2256
+ "aria-pressed": "false",
2257
+ "disabled": [
2258
+ "==",
2259
+ "@entity.statusNote",
2260
+ "Finished"
2261
+ ],
2262
+ "icon": "play",
2263
+ "label": "Play",
2264
+ "type": "button",
2265
+ "variant": "primary"
2266
+ }
1539
2267
  ],
1540
- " of ",
1541
- [
1542
- "str/concat",
1543
- "",
1544
- [
1545
- "array/len",
1546
- "@config.frames"
1547
- ]
1548
- ]
2268
+ {
2269
+ "action": "RESTART",
2270
+ "icon": "rotate-ccw",
2271
+ "label": "Restart",
2272
+ "type": "button",
2273
+ "variant": "ghost"
2274
+ },
2275
+ {
2276
+ "align": "center",
2277
+ "aria-label": "Speed",
2278
+ "children": [
2279
+ {
2280
+ "action": "SPEED_SET",
2281
+ "actionPayload": {
2282
+ "speed": 0.5
2283
+ },
2284
+ "aria-pressed": [
2285
+ "if",
2286
+ [
2287
+ "==",
2288
+ "@entity.speed",
2289
+ 0.5
2290
+ ],
2291
+ "true",
2292
+ "false"
2293
+ ],
2294
+ "label": "0.5×",
2295
+ "size": "sm",
2296
+ "type": "button",
2297
+ "variant": [
2298
+ "if",
2299
+ [
2300
+ "==",
2301
+ "@entity.speed",
2302
+ 0.5
2303
+ ],
2304
+ "secondary",
2305
+ "ghost"
2306
+ ]
2307
+ },
2308
+ {
2309
+ "action": "SPEED_SET",
2310
+ "actionPayload": {
2311
+ "speed": 1.0
2312
+ },
2313
+ "aria-pressed": [
2314
+ "if",
2315
+ [
2316
+ "==",
2317
+ "@entity.speed",
2318
+ 1.0
2319
+ ],
2320
+ "true",
2321
+ "false"
2322
+ ],
2323
+ "label": "1×",
2324
+ "size": "sm",
2325
+ "type": "button",
2326
+ "variant": [
2327
+ "if",
2328
+ [
2329
+ "==",
2330
+ "@entity.speed",
2331
+ 1.0
2332
+ ],
2333
+ "secondary",
2334
+ "ghost"
2335
+ ]
2336
+ },
2337
+ {
2338
+ "action": "SPEED_SET",
2339
+ "actionPayload": {
2340
+ "speed": 2.0
2341
+ },
2342
+ "aria-pressed": [
2343
+ "if",
2344
+ [
2345
+ "==",
2346
+ "@entity.speed",
2347
+ 2.0
2348
+ ],
2349
+ "true",
2350
+ "false"
2351
+ ],
2352
+ "label": "2×",
2353
+ "size": "sm",
2354
+ "type": "button",
2355
+ "variant": [
2356
+ "if",
2357
+ [
2358
+ "==",
2359
+ "@entity.speed",
2360
+ 2.0
2361
+ ],
2362
+ "secondary",
2363
+ "ghost"
2364
+ ]
2365
+ },
2366
+ {
2367
+ "action": "SPEED_SET",
2368
+ "actionPayload": {
2369
+ "speed": 4.0
2370
+ },
2371
+ "aria-pressed": [
2372
+ "if",
2373
+ [
2374
+ "==",
2375
+ "@entity.speed",
2376
+ 4.0
2377
+ ],
2378
+ "true",
2379
+ "false"
2380
+ ],
2381
+ "label": "4×",
2382
+ "size": "sm",
2383
+ "type": "button",
2384
+ "variant": [
2385
+ "if",
2386
+ [
2387
+ "==",
2388
+ "@entity.speed",
2389
+ 4.0
2390
+ ],
2391
+ "secondary",
2392
+ "ghost"
2393
+ ]
2394
+ }
2395
+ ],
2396
+ "direction": "horizontal",
2397
+ "gap": "xs",
2398
+ "role": "group",
2399
+ "type": "stack"
2400
+ },
2401
+ {
2402
+ "color": "muted",
2403
+ "content": [
2404
+ "str/concat",
2405
+ "Frame ",
2406
+ [
2407
+ "+",
2408
+ "@entity.frameIndex",
2409
+ 1.0
2410
+ ],
2411
+ " of ",
2412
+ [
2413
+ "array/len",
2414
+ "@config.frames"
2415
+ ]
2416
+ ],
2417
+ "type": "typography",
2418
+ "variant": "caption"
2419
+ }
1549
2420
  ],
2421
+ "direction": "horizontal",
2422
+ "gap": "sm",
2423
+ "type": "stack",
2424
+ "wrap": true
2425
+ },
2426
+ {
1550
2427
  "max": [
1551
2428
  "array/len",
1552
2429
  "@config.frames"
@@ -1563,46 +2440,738 @@
1563
2440
  "backgroundColor": "@config.backgroundColor",
1564
2441
  "bars": "@entity.bars",
1565
2442
  "height": "@config.height",
2443
+ "keyMap": {
2444
+ "KeyR": "RESTART",
2445
+ "Space": "TOGGLE_RUN"
2446
+ },
1566
2447
  "type": "algorithm-canvas",
1567
2448
  "width": "@config.width"
1568
2449
  },
1569
2450
  {
1570
2451
  "children": [
1571
2452
  {
1572
- "action": "PLAY",
1573
- "disabled": [
1574
- "if",
1575
- "@entity.running",
1576
- true,
1577
- false
1578
- ],
1579
- "label": "Play",
1580
- "type": "button",
1581
- "variant": "primary"
1582
- },
2453
+ "content": "@entity.frameCaption",
2454
+ "type": "typography",
2455
+ "variant": "body"
2456
+ }
2457
+ ],
2458
+ "padding": "md",
2459
+ "title": "@entity.frameLabel",
2460
+ "type": "card",
2461
+ "variant": "bordered"
2462
+ }
2463
+ ],
2464
+ "direction": "vertical",
2465
+ "gap": "md",
2466
+ "type": "stack"
2467
+ }
2468
+ ],
2469
+ "padding": "md",
2470
+ "type": "box"
2471
+ }
2472
+ ],
2473
+ [
2474
+ "emit",
2475
+ "FRAME_ADVANCED",
2476
+ {
2477
+ "frameIndex": "@entity.frameIndex",
2478
+ "frameLabel": "@entity.frameLabel"
2479
+ }
2480
+ ]
2481
+ ],
2482
+ "event": "PLAY",
2483
+ "eventId": "evt_01M055GQ62B00NKC2P41ZHMYTR",
2484
+ "from": "idle",
2485
+ "guard": [
2486
+ "==",
2487
+ "@entity.active",
2488
+ true
2489
+ ],
2490
+ "to": "idle"
2491
+ },
2492
+ {
2493
+ "effects": [
2494
+ [
2495
+ "set",
2496
+ "@entity.running",
2497
+ false
2498
+ ],
2499
+ [
2500
+ "set",
2501
+ "@entity.statusNote",
2502
+ "Paused"
2503
+ ],
2504
+ [
2505
+ "render-ui",
2506
+ "main",
2507
+ {
2508
+ "children": [
2509
+ {
2510
+ "children": [
2511
+ {
2512
+ "align": "start",
2513
+ "children": [
1583
2514
  {
1584
- "action": "PAUSE",
1585
- "disabled": [
1586
- "if",
1587
- "@entity.running",
1588
- false,
1589
- true
2515
+ "children": [
2516
+ {
2517
+ "content": "@entity.title",
2518
+ "type": "typography",
2519
+ "variant": "h4"
2520
+ },
2521
+ [
2522
+ "if",
2523
+ [
2524
+ "==",
2525
+ "@config.summary",
2526
+ ""
2527
+ ],
2528
+ null,
2529
+ {
2530
+ "color": "muted",
2531
+ "content": "@config.summary",
2532
+ "type": "typography",
2533
+ "variant": "body2"
2534
+ }
2535
+ ]
1590
2536
  ],
1591
- "label": "Pause",
1592
- "type": "button",
1593
- "variant": "secondary"
2537
+ "direction": "vertical",
2538
+ "gap": "xs",
2539
+ "type": "stack"
1594
2540
  },
2541
+ {
2542
+ "label": "@entity.statusNote",
2543
+ "type": "badge",
2544
+ "variant": [
2545
+ "if",
2546
+ [
2547
+ "==",
2548
+ "@entity.statusNote",
2549
+ "Finished"
2550
+ ],
2551
+ "success",
2552
+ [
2553
+ "if",
2554
+ "@entity.running",
2555
+ "primary",
2556
+ "neutral"
2557
+ ]
2558
+ ]
2559
+ }
2560
+ ],
2561
+ "direction": "horizontal",
2562
+ "gap": "md",
2563
+ "justify": "between",
2564
+ "type": "stack"
2565
+ },
2566
+ {
2567
+ "align": "center",
2568
+ "children": [
2569
+ [
2570
+ "if",
2571
+ "@entity.running",
2572
+ {
2573
+ "action": "TOGGLE_RUN",
2574
+ "aria-pressed": "true",
2575
+ "icon": "pause",
2576
+ "label": "Pause",
2577
+ "type": "button",
2578
+ "variant": "primary"
2579
+ },
2580
+ {
2581
+ "action": "TOGGLE_RUN",
2582
+ "aria-pressed": "false",
2583
+ "disabled": [
2584
+ "==",
2585
+ "@entity.statusNote",
2586
+ "Finished"
2587
+ ],
2588
+ "icon": "play",
2589
+ "label": "Play",
2590
+ "type": "button",
2591
+ "variant": "primary"
2592
+ }
2593
+ ],
1595
2594
  {
1596
2595
  "action": "RESTART",
2596
+ "icon": "rotate-ccw",
1597
2597
  "label": "Restart",
1598
2598
  "type": "button",
1599
2599
  "variant": "ghost"
2600
+ },
2601
+ {
2602
+ "align": "center",
2603
+ "aria-label": "Speed",
2604
+ "children": [
2605
+ {
2606
+ "action": "SPEED_SET",
2607
+ "actionPayload": {
2608
+ "speed": 0.5
2609
+ },
2610
+ "aria-pressed": [
2611
+ "if",
2612
+ [
2613
+ "==",
2614
+ "@entity.speed",
2615
+ 0.5
2616
+ ],
2617
+ "true",
2618
+ "false"
2619
+ ],
2620
+ "label": "0.5×",
2621
+ "size": "sm",
2622
+ "type": "button",
2623
+ "variant": [
2624
+ "if",
2625
+ [
2626
+ "==",
2627
+ "@entity.speed",
2628
+ 0.5
2629
+ ],
2630
+ "secondary",
2631
+ "ghost"
2632
+ ]
2633
+ },
2634
+ {
2635
+ "action": "SPEED_SET",
2636
+ "actionPayload": {
2637
+ "speed": 1.0
2638
+ },
2639
+ "aria-pressed": [
2640
+ "if",
2641
+ [
2642
+ "==",
2643
+ "@entity.speed",
2644
+ 1.0
2645
+ ],
2646
+ "true",
2647
+ "false"
2648
+ ],
2649
+ "label": "1×",
2650
+ "size": "sm",
2651
+ "type": "button",
2652
+ "variant": [
2653
+ "if",
2654
+ [
2655
+ "==",
2656
+ "@entity.speed",
2657
+ 1.0
2658
+ ],
2659
+ "secondary",
2660
+ "ghost"
2661
+ ]
2662
+ },
2663
+ {
2664
+ "action": "SPEED_SET",
2665
+ "actionPayload": {
2666
+ "speed": 2.0
2667
+ },
2668
+ "aria-pressed": [
2669
+ "if",
2670
+ [
2671
+ "==",
2672
+ "@entity.speed",
2673
+ 2.0
2674
+ ],
2675
+ "true",
2676
+ "false"
2677
+ ],
2678
+ "label": "2×",
2679
+ "size": "sm",
2680
+ "type": "button",
2681
+ "variant": [
2682
+ "if",
2683
+ [
2684
+ "==",
2685
+ "@entity.speed",
2686
+ 2.0
2687
+ ],
2688
+ "secondary",
2689
+ "ghost"
2690
+ ]
2691
+ },
2692
+ {
2693
+ "action": "SPEED_SET",
2694
+ "actionPayload": {
2695
+ "speed": 4.0
2696
+ },
2697
+ "aria-pressed": [
2698
+ "if",
2699
+ [
2700
+ "==",
2701
+ "@entity.speed",
2702
+ 4.0
2703
+ ],
2704
+ "true",
2705
+ "false"
2706
+ ],
2707
+ "label": "4×",
2708
+ "size": "sm",
2709
+ "type": "button",
2710
+ "variant": [
2711
+ "if",
2712
+ [
2713
+ "==",
2714
+ "@entity.speed",
2715
+ 4.0
2716
+ ],
2717
+ "secondary",
2718
+ "ghost"
2719
+ ]
2720
+ }
2721
+ ],
2722
+ "direction": "horizontal",
2723
+ "gap": "xs",
2724
+ "role": "group",
2725
+ "type": "stack"
2726
+ },
2727
+ {
2728
+ "color": "muted",
2729
+ "content": [
2730
+ "str/concat",
2731
+ "Frame ",
2732
+ [
2733
+ "+",
2734
+ "@entity.frameIndex",
2735
+ 1.0
2736
+ ],
2737
+ " of ",
2738
+ [
2739
+ "array/len",
2740
+ "@config.frames"
2741
+ ]
2742
+ ],
2743
+ "type": "typography",
2744
+ "variant": "caption"
1600
2745
  }
1601
2746
  ],
1602
2747
  "direction": "horizontal",
1603
2748
  "gap": "sm",
2749
+ "type": "stack",
2750
+ "wrap": true
2751
+ },
2752
+ {
2753
+ "max": [
2754
+ "array/len",
2755
+ "@config.frames"
2756
+ ],
2757
+ "showPercentage": false,
2758
+ "type": "progress-bar",
2759
+ "value": [
2760
+ "+",
2761
+ "@entity.frameIndex",
2762
+ 1.0
2763
+ ]
2764
+ },
2765
+ {
2766
+ "backgroundColor": "@config.backgroundColor",
2767
+ "bars": "@entity.bars",
2768
+ "height": "@config.height",
2769
+ "keyMap": {
2770
+ "KeyR": "RESTART",
2771
+ "Space": "TOGGLE_RUN"
2772
+ },
2773
+ "type": "algorithm-canvas",
2774
+ "width": "@config.width"
2775
+ },
2776
+ {
2777
+ "children": [
2778
+ {
2779
+ "content": "@entity.frameCaption",
2780
+ "type": "typography",
2781
+ "variant": "body"
2782
+ }
2783
+ ],
2784
+ "padding": "md",
2785
+ "title": "@entity.frameLabel",
2786
+ "type": "card",
2787
+ "variant": "bordered"
2788
+ }
2789
+ ],
2790
+ "direction": "vertical",
2791
+ "gap": "md",
2792
+ "type": "stack"
2793
+ }
2794
+ ],
2795
+ "padding": "md",
2796
+ "type": "box"
2797
+ }
2798
+ ],
2799
+ [
2800
+ "emit",
2801
+ "FRAME_ADVANCED",
2802
+ {
2803
+ "frameIndex": "@entity.frameIndex",
2804
+ "frameLabel": "@entity.frameLabel"
2805
+ }
2806
+ ]
2807
+ ],
2808
+ "event": "PAUSE",
2809
+ "eventId": "evt_01M055GQ62T1PP5X8K4TSKV435",
2810
+ "from": "idle",
2811
+ "guard": [
2812
+ "==",
2813
+ "@entity.active",
2814
+ true
2815
+ ],
2816
+ "to": "idle"
2817
+ },
2818
+ {
2819
+ "effects": [
2820
+ [
2821
+ "set",
2822
+ "@entity.frameIndex",
2823
+ 0.0
2824
+ ],
2825
+ [
2826
+ "set",
2827
+ "@entity.running",
2828
+ false
2829
+ ],
2830
+ [
2831
+ "set",
2832
+ "@entity.statusNote",
2833
+ "Paused"
2834
+ ],
2835
+ [
2836
+ "set",
2837
+ "@entity.frameLabel",
2838
+ [
2839
+ "object/get",
2840
+ [
2841
+ "array/nth",
2842
+ "@config.frames",
2843
+ "@entity.frameIndex"
2844
+ ],
2845
+ "label"
2846
+ ]
2847
+ ],
2848
+ [
2849
+ "set",
2850
+ "@entity.frameCaption",
2851
+ [
2852
+ "object/get",
2853
+ [
2854
+ "array/nth",
2855
+ "@config.frames",
2856
+ "@entity.frameIndex"
2857
+ ],
2858
+ "caption"
2859
+ ]
2860
+ ],
2861
+ [
2862
+ "set",
2863
+ "@entity.bars",
2864
+ [
2865
+ "array/map",
2866
+ [
2867
+ "object/get",
2868
+ [
2869
+ "array/nth",
2870
+ "@config.frames",
2871
+ "@entity.frameIndex"
2872
+ ],
2873
+ "values"
2874
+ ],
2875
+ {
2876
+ "color": [
2877
+ "if",
2878
+ [
2879
+ "array/includes",
2880
+ [
2881
+ "object/get",
2882
+ [
2883
+ "array/nth",
2884
+ "@config.frames",
2885
+ "@entity.frameIndex"
2886
+ ],
2887
+ "highlights"
2888
+ ],
2889
+ "@index"
2890
+ ],
2891
+ "@config.highlightColor",
2892
+ "@config.baseColor"
2893
+ ],
2894
+ "label": [
2895
+ "str/concat",
2896
+ "",
2897
+ "@item"
2898
+ ],
2899
+ "value": "@item"
2900
+ }
2901
+ ]
2902
+ ],
2903
+ [
2904
+ "render-ui",
2905
+ "main",
2906
+ {
2907
+ "children": [
2908
+ {
2909
+ "children": [
2910
+ {
2911
+ "align": "start",
2912
+ "children": [
2913
+ {
2914
+ "children": [
2915
+ {
2916
+ "content": "@entity.title",
2917
+ "type": "typography",
2918
+ "variant": "h4"
2919
+ },
2920
+ [
2921
+ "if",
2922
+ [
2923
+ "==",
2924
+ "@config.summary",
2925
+ ""
2926
+ ],
2927
+ null,
2928
+ {
2929
+ "color": "muted",
2930
+ "content": "@config.summary",
2931
+ "type": "typography",
2932
+ "variant": "body2"
2933
+ }
2934
+ ]
2935
+ ],
2936
+ "direction": "vertical",
2937
+ "gap": "xs",
2938
+ "type": "stack"
2939
+ },
2940
+ {
2941
+ "label": "@entity.statusNote",
2942
+ "type": "badge",
2943
+ "variant": [
2944
+ "if",
2945
+ [
2946
+ "==",
2947
+ "@entity.statusNote",
2948
+ "Finished"
2949
+ ],
2950
+ "success",
2951
+ [
2952
+ "if",
2953
+ "@entity.running",
2954
+ "primary",
2955
+ "neutral"
2956
+ ]
2957
+ ]
2958
+ }
2959
+ ],
2960
+ "direction": "horizontal",
2961
+ "gap": "md",
2962
+ "justify": "between",
1604
2963
  "type": "stack"
1605
2964
  },
2965
+ {
2966
+ "align": "center",
2967
+ "children": [
2968
+ [
2969
+ "if",
2970
+ "@entity.running",
2971
+ {
2972
+ "action": "TOGGLE_RUN",
2973
+ "aria-pressed": "true",
2974
+ "icon": "pause",
2975
+ "label": "Pause",
2976
+ "type": "button",
2977
+ "variant": "primary"
2978
+ },
2979
+ {
2980
+ "action": "TOGGLE_RUN",
2981
+ "aria-pressed": "false",
2982
+ "disabled": [
2983
+ "==",
2984
+ "@entity.statusNote",
2985
+ "Finished"
2986
+ ],
2987
+ "icon": "play",
2988
+ "label": "Play",
2989
+ "type": "button",
2990
+ "variant": "primary"
2991
+ }
2992
+ ],
2993
+ {
2994
+ "action": "RESTART",
2995
+ "icon": "rotate-ccw",
2996
+ "label": "Restart",
2997
+ "type": "button",
2998
+ "variant": "ghost"
2999
+ },
3000
+ {
3001
+ "align": "center",
3002
+ "aria-label": "Speed",
3003
+ "children": [
3004
+ {
3005
+ "action": "SPEED_SET",
3006
+ "actionPayload": {
3007
+ "speed": 0.5
3008
+ },
3009
+ "aria-pressed": [
3010
+ "if",
3011
+ [
3012
+ "==",
3013
+ "@entity.speed",
3014
+ 0.5
3015
+ ],
3016
+ "true",
3017
+ "false"
3018
+ ],
3019
+ "label": "0.5×",
3020
+ "size": "sm",
3021
+ "type": "button",
3022
+ "variant": [
3023
+ "if",
3024
+ [
3025
+ "==",
3026
+ "@entity.speed",
3027
+ 0.5
3028
+ ],
3029
+ "secondary",
3030
+ "ghost"
3031
+ ]
3032
+ },
3033
+ {
3034
+ "action": "SPEED_SET",
3035
+ "actionPayload": {
3036
+ "speed": 1.0
3037
+ },
3038
+ "aria-pressed": [
3039
+ "if",
3040
+ [
3041
+ "==",
3042
+ "@entity.speed",
3043
+ 1.0
3044
+ ],
3045
+ "true",
3046
+ "false"
3047
+ ],
3048
+ "label": "1×",
3049
+ "size": "sm",
3050
+ "type": "button",
3051
+ "variant": [
3052
+ "if",
3053
+ [
3054
+ "==",
3055
+ "@entity.speed",
3056
+ 1.0
3057
+ ],
3058
+ "secondary",
3059
+ "ghost"
3060
+ ]
3061
+ },
3062
+ {
3063
+ "action": "SPEED_SET",
3064
+ "actionPayload": {
3065
+ "speed": 2.0
3066
+ },
3067
+ "aria-pressed": [
3068
+ "if",
3069
+ [
3070
+ "==",
3071
+ "@entity.speed",
3072
+ 2.0
3073
+ ],
3074
+ "true",
3075
+ "false"
3076
+ ],
3077
+ "label": "2×",
3078
+ "size": "sm",
3079
+ "type": "button",
3080
+ "variant": [
3081
+ "if",
3082
+ [
3083
+ "==",
3084
+ "@entity.speed",
3085
+ 2.0
3086
+ ],
3087
+ "secondary",
3088
+ "ghost"
3089
+ ]
3090
+ },
3091
+ {
3092
+ "action": "SPEED_SET",
3093
+ "actionPayload": {
3094
+ "speed": 4.0
3095
+ },
3096
+ "aria-pressed": [
3097
+ "if",
3098
+ [
3099
+ "==",
3100
+ "@entity.speed",
3101
+ 4.0
3102
+ ],
3103
+ "true",
3104
+ "false"
3105
+ ],
3106
+ "label": "4×",
3107
+ "size": "sm",
3108
+ "type": "button",
3109
+ "variant": [
3110
+ "if",
3111
+ [
3112
+ "==",
3113
+ "@entity.speed",
3114
+ 4.0
3115
+ ],
3116
+ "secondary",
3117
+ "ghost"
3118
+ ]
3119
+ }
3120
+ ],
3121
+ "direction": "horizontal",
3122
+ "gap": "xs",
3123
+ "role": "group",
3124
+ "type": "stack"
3125
+ },
3126
+ {
3127
+ "color": "muted",
3128
+ "content": [
3129
+ "str/concat",
3130
+ "Frame ",
3131
+ [
3132
+ "+",
3133
+ "@entity.frameIndex",
3134
+ 1.0
3135
+ ],
3136
+ " of ",
3137
+ [
3138
+ "array/len",
3139
+ "@config.frames"
3140
+ ]
3141
+ ],
3142
+ "type": "typography",
3143
+ "variant": "caption"
3144
+ }
3145
+ ],
3146
+ "direction": "horizontal",
3147
+ "gap": "sm",
3148
+ "type": "stack",
3149
+ "wrap": true
3150
+ },
3151
+ {
3152
+ "max": [
3153
+ "array/len",
3154
+ "@config.frames"
3155
+ ],
3156
+ "showPercentage": false,
3157
+ "type": "progress-bar",
3158
+ "value": [
3159
+ "+",
3160
+ "@entity.frameIndex",
3161
+ 1.0
3162
+ ]
3163
+ },
3164
+ {
3165
+ "backgroundColor": "@config.backgroundColor",
3166
+ "bars": "@entity.bars",
3167
+ "height": "@config.height",
3168
+ "keyMap": {
3169
+ "KeyR": "RESTART",
3170
+ "Space": "TOGGLE_RUN"
3171
+ },
3172
+ "type": "algorithm-canvas",
3173
+ "width": "@config.width"
3174
+ },
1606
3175
  {
1607
3176
  "children": [
1608
3177
  {
@@ -1615,27 +3184,6 @@
1615
3184
  "title": "@entity.frameLabel",
1616
3185
  "type": "card",
1617
3186
  "variant": "bordered"
1618
- },
1619
- {
1620
- "content": [
1621
- "str/concat",
1622
- "@entity.statusNote",
1623
- " · ",
1624
- [
1625
- "str/concat",
1626
- "",
1627
- "@config.tickMs"
1628
- ],
1629
- " ms/frame",
1630
- [
1631
- "if",
1632
- "@config.loop",
1633
- " · loops",
1634
- ""
1635
- ]
1636
- ],
1637
- "type": "typography",
1638
- "variant": "caption"
1639
3187
  }
1640
3188
  ],
1641
3189
  "direction": "vertical",
@@ -1673,339 +3221,528 @@
1673
3221
  "effects": [
1674
3222
  [
1675
3223
  "set",
1676
- "@entity.running",
1677
- [
1678
- "if",
1679
- [
1680
- "and",
1681
- [
1682
- ">=",
1683
- "@entity.frameIndex",
1684
- [
1685
- "-",
1686
- [
1687
- "array/len",
1688
- "@config.frames"
1689
- ],
1690
- 1.0
1691
- ]
1692
- ],
1693
- [
1694
- "not",
1695
- "@config.loop"
1696
- ]
1697
- ],
1698
- false,
1699
- "@entity.running"
1700
- ]
1701
- ],
1702
- [
1703
- "set",
1704
- "@entity.frameIndex",
3224
+ "@entity.elapsedMs",
1705
3225
  [
1706
- "if",
1707
- [
1708
- ">=",
1709
- "@entity.frameIndex",
1710
- [
1711
- "-",
1712
- [
1713
- "array/len",
1714
- "@config.frames"
1715
- ],
1716
- 1.0
1717
- ]
1718
- ],
1719
- [
1720
- "if",
1721
- "@config.loop",
1722
- 0.0,
1723
- "@entity.frameIndex"
1724
- ],
1725
- [
1726
- "+",
1727
- "@entity.frameIndex",
1728
- 1.0
1729
- ]
3226
+ "+",
3227
+ "@entity.elapsedMs",
3228
+ 50.0
1730
3229
  ]
1731
3230
  ],
1732
3231
  [
1733
- "set",
1734
- "@entity.frameLabel",
3232
+ "when",
1735
3233
  [
1736
- "object/get",
3234
+ ">=",
1737
3235
  [
1738
- "array/nth",
1739
- "@config.frames",
1740
- "@entity.frameIndex"
3236
+ "*",
3237
+ "@entity.elapsedMs",
3238
+ "@entity.speed"
1741
3239
  ],
1742
- "label"
1743
- ]
1744
- ],
1745
- [
1746
- "set",
1747
- "@entity.frameCaption",
3240
+ "@config.tickMs"
3241
+ ],
1748
3242
  [
1749
- "object/get",
3243
+ "do",
1750
3244
  [
1751
- "array/nth",
1752
- "@config.frames",
1753
- "@entity.frameIndex"
3245
+ "set",
3246
+ "@entity.elapsedMs",
3247
+ 0.0
1754
3248
  ],
1755
- "caption"
1756
- ]
1757
- ],
1758
- [
1759
- "set",
1760
- "@entity.bars",
1761
- [
1762
- "array/map",
1763
3249
  [
1764
- "object/get",
3250
+ "set",
3251
+ "@entity.running",
1765
3252
  [
1766
- "array/nth",
1767
- "@config.frames",
1768
- "@entity.frameIndex"
1769
- ],
1770
- "values"
1771
- ],
1772
- {
1773
- "color": [
1774
3253
  "if",
1775
3254
  [
1776
- "array/includes",
3255
+ "and",
1777
3256
  [
1778
- "object/get",
3257
+ ">=",
3258
+ "@entity.frameIndex",
1779
3259
  [
1780
- "array/nth",
1781
- "@config.frames",
1782
- "@entity.frameIndex"
1783
- ],
1784
- "highlights"
3260
+ "-",
3261
+ [
3262
+ "array/len",
3263
+ "@config.frames"
3264
+ ],
3265
+ 1.0
3266
+ ]
1785
3267
  ],
1786
- "@index"
3268
+ [
3269
+ "not",
3270
+ "@config.loop"
3271
+ ]
1787
3272
  ],
1788
- "@config.highlightColor",
1789
- "@config.baseColor"
1790
- ],
1791
- "label": [
1792
- "str/concat",
1793
- "",
1794
- "@item"
1795
- ],
1796
- "value": "@item"
1797
- }
1798
- ]
1799
- ],
1800
- [
1801
- "set",
1802
- "@entity.statusNote",
1803
- [
1804
- "if",
1805
- "@entity.running",
1806
- "Playing",
3273
+ false,
3274
+ "@entity.running"
3275
+ ]
3276
+ ],
1807
3277
  [
1808
- "if",
3278
+ "set",
3279
+ "@entity.frameIndex",
1809
3280
  [
1810
- ">=",
3281
+ "if",
3282
+ [
3283
+ ">=",
3284
+ "@entity.frameIndex",
3285
+ [
3286
+ "-",
3287
+ [
3288
+ "array/len",
3289
+ "@config.frames"
3290
+ ],
3291
+ 1.0
3292
+ ]
3293
+ ],
3294
+ [
3295
+ "if",
3296
+ "@config.loop",
3297
+ 0.0,
3298
+ "@entity.frameIndex"
3299
+ ],
1811
3300
  [
1812
3301
  "+",
1813
3302
  "@entity.frameIndex",
1814
3303
  1.0
3304
+ ]
3305
+ ]
3306
+ ],
3307
+ [
3308
+ "set",
3309
+ "@entity.frameLabel",
3310
+ [
3311
+ "object/get",
3312
+ [
3313
+ "array/nth",
3314
+ "@config.frames",
3315
+ "@entity.frameIndex"
1815
3316
  ],
3317
+ "label"
3318
+ ]
3319
+ ],
3320
+ [
3321
+ "set",
3322
+ "@entity.frameCaption",
3323
+ [
3324
+ "object/get",
1816
3325
  [
1817
- "array/len",
1818
- "@config.frames"
1819
- ]
1820
- ],
1821
- "Finished",
1822
- "Paused"
1823
- ]
1824
- ]
1825
- ],
1826
- [
1827
- "render-ui",
1828
- "main",
1829
- {
1830
- "children": [
1831
- {
1832
- "children": [
1833
- {
1834
- "content": "@entity.title",
1835
- "type": "typography",
1836
- "variant": "h4"
1837
- },
1838
- {
1839
- "label": [
1840
- "str/concat",
1841
- "Frame ",
3326
+ "array/nth",
3327
+ "@config.frames",
3328
+ "@entity.frameIndex"
3329
+ ],
3330
+ "caption"
3331
+ ]
3332
+ ],
3333
+ [
3334
+ "set",
3335
+ "@entity.bars",
3336
+ [
3337
+ "array/map",
3338
+ [
3339
+ "object/get",
3340
+ [
3341
+ "array/nth",
3342
+ "@config.frames",
3343
+ "@entity.frameIndex"
3344
+ ],
3345
+ "values"
3346
+ ],
3347
+ {
3348
+ "color": [
3349
+ "if",
3350
+ [
3351
+ "array/includes",
1842
3352
  [
1843
- "str/concat",
1844
- "",
3353
+ "object/get",
1845
3354
  [
1846
- "+",
1847
- "@entity.frameIndex",
1848
- 1.0
1849
- ]
3355
+ "array/nth",
3356
+ "@config.frames",
3357
+ "@entity.frameIndex"
3358
+ ],
3359
+ "highlights"
1850
3360
  ],
1851
- " of ",
1852
- [
1853
- "str/concat",
1854
- "",
1855
- [
1856
- "array/len",
1857
- "@config.frames"
1858
- ]
1859
- ]
3361
+ "@index"
1860
3362
  ],
1861
- "max": [
1862
- "array/len",
1863
- "@config.frames"
1864
- ],
1865
- "showPercentage": false,
1866
- "type": "progress-bar",
1867
- "value": [
3363
+ "@config.highlightColor",
3364
+ "@config.baseColor"
3365
+ ],
3366
+ "label": [
3367
+ "str/concat",
3368
+ "",
3369
+ "@item"
3370
+ ],
3371
+ "value": "@item"
3372
+ }
3373
+ ]
3374
+ ],
3375
+ [
3376
+ "set",
3377
+ "@entity.statusNote",
3378
+ [
3379
+ "if",
3380
+ "@entity.running",
3381
+ "Playing",
3382
+ [
3383
+ "if",
3384
+ [
3385
+ ">=",
3386
+ [
1868
3387
  "+",
1869
3388
  "@entity.frameIndex",
1870
3389
  1.0
3390
+ ],
3391
+ [
3392
+ "array/len",
3393
+ "@config.frames"
1871
3394
  ]
1872
- },
1873
- {
1874
- "backgroundColor": "@config.backgroundColor",
1875
- "bars": "@entity.bars",
1876
- "height": "@config.height",
1877
- "type": "algorithm-canvas",
1878
- "width": "@config.width"
1879
- },
3395
+ ],
3396
+ "Finished",
3397
+ "Paused"
3398
+ ]
3399
+ ]
3400
+ ],
3401
+ [
3402
+ "render-ui",
3403
+ "main",
3404
+ {
3405
+ "children": [
1880
3406
  {
1881
3407
  "children": [
1882
3408
  {
1883
- "action": "PLAY",
1884
- "disabled": [
1885
- "if",
1886
- "@entity.running",
1887
- true,
1888
- false
3409
+ "align": "start",
3410
+ "children": [
3411
+ {
3412
+ "children": [
3413
+ {
3414
+ "content": "@entity.title",
3415
+ "type": "typography",
3416
+ "variant": "h4"
3417
+ },
3418
+ [
3419
+ "if",
3420
+ [
3421
+ "==",
3422
+ "@config.summary",
3423
+ ""
3424
+ ],
3425
+ null,
3426
+ {
3427
+ "color": "muted",
3428
+ "content": "@config.summary",
3429
+ "type": "typography",
3430
+ "variant": "body2"
3431
+ }
3432
+ ]
3433
+ ],
3434
+ "direction": "vertical",
3435
+ "gap": "xs",
3436
+ "type": "stack"
3437
+ },
3438
+ {
3439
+ "label": "@entity.statusNote",
3440
+ "type": "badge",
3441
+ "variant": [
3442
+ "if",
3443
+ [
3444
+ "==",
3445
+ "@entity.statusNote",
3446
+ "Finished"
3447
+ ],
3448
+ "success",
3449
+ [
3450
+ "if",
3451
+ "@entity.running",
3452
+ "primary",
3453
+ "neutral"
3454
+ ]
3455
+ ]
3456
+ }
1889
3457
  ],
1890
- "label": "Play",
1891
- "type": "button",
1892
- "variant": "primary"
3458
+ "direction": "horizontal",
3459
+ "gap": "md",
3460
+ "justify": "between",
3461
+ "type": "stack"
1893
3462
  },
1894
3463
  {
1895
- "action": "PAUSE",
1896
- "disabled": [
1897
- "if",
1898
- "@entity.running",
1899
- false,
1900
- true
3464
+ "align": "center",
3465
+ "children": [
3466
+ [
3467
+ "if",
3468
+ "@entity.running",
3469
+ {
3470
+ "action": "TOGGLE_RUN",
3471
+ "aria-pressed": "true",
3472
+ "icon": "pause",
3473
+ "label": "Pause",
3474
+ "type": "button",
3475
+ "variant": "primary"
3476
+ },
3477
+ {
3478
+ "action": "TOGGLE_RUN",
3479
+ "aria-pressed": "false",
3480
+ "disabled": [
3481
+ "==",
3482
+ "@entity.statusNote",
3483
+ "Finished"
3484
+ ],
3485
+ "icon": "play",
3486
+ "label": "Play",
3487
+ "type": "button",
3488
+ "variant": "primary"
3489
+ }
3490
+ ],
3491
+ {
3492
+ "action": "RESTART",
3493
+ "icon": "rotate-ccw",
3494
+ "label": "Restart",
3495
+ "type": "button",
3496
+ "variant": "ghost"
3497
+ },
3498
+ {
3499
+ "align": "center",
3500
+ "aria-label": "Speed",
3501
+ "children": [
3502
+ {
3503
+ "action": "SPEED_SET",
3504
+ "actionPayload": {
3505
+ "speed": 0.5
3506
+ },
3507
+ "aria-pressed": [
3508
+ "if",
3509
+ [
3510
+ "==",
3511
+ "@entity.speed",
3512
+ 0.5
3513
+ ],
3514
+ "true",
3515
+ "false"
3516
+ ],
3517
+ "label": "0.5×",
3518
+ "size": "sm",
3519
+ "type": "button",
3520
+ "variant": [
3521
+ "if",
3522
+ [
3523
+ "==",
3524
+ "@entity.speed",
3525
+ 0.5
3526
+ ],
3527
+ "secondary",
3528
+ "ghost"
3529
+ ]
3530
+ },
3531
+ {
3532
+ "action": "SPEED_SET",
3533
+ "actionPayload": {
3534
+ "speed": 1.0
3535
+ },
3536
+ "aria-pressed": [
3537
+ "if",
3538
+ [
3539
+ "==",
3540
+ "@entity.speed",
3541
+ 1.0
3542
+ ],
3543
+ "true",
3544
+ "false"
3545
+ ],
3546
+ "label": "1×",
3547
+ "size": "sm",
3548
+ "type": "button",
3549
+ "variant": [
3550
+ "if",
3551
+ [
3552
+ "==",
3553
+ "@entity.speed",
3554
+ 1.0
3555
+ ],
3556
+ "secondary",
3557
+ "ghost"
3558
+ ]
3559
+ },
3560
+ {
3561
+ "action": "SPEED_SET",
3562
+ "actionPayload": {
3563
+ "speed": 2.0
3564
+ },
3565
+ "aria-pressed": [
3566
+ "if",
3567
+ [
3568
+ "==",
3569
+ "@entity.speed",
3570
+ 2.0
3571
+ ],
3572
+ "true",
3573
+ "false"
3574
+ ],
3575
+ "label": "2×",
3576
+ "size": "sm",
3577
+ "type": "button",
3578
+ "variant": [
3579
+ "if",
3580
+ [
3581
+ "==",
3582
+ "@entity.speed",
3583
+ 2.0
3584
+ ],
3585
+ "secondary",
3586
+ "ghost"
3587
+ ]
3588
+ },
3589
+ {
3590
+ "action": "SPEED_SET",
3591
+ "actionPayload": {
3592
+ "speed": 4.0
3593
+ },
3594
+ "aria-pressed": [
3595
+ "if",
3596
+ [
3597
+ "==",
3598
+ "@entity.speed",
3599
+ 4.0
3600
+ ],
3601
+ "true",
3602
+ "false"
3603
+ ],
3604
+ "label": "4×",
3605
+ "size": "sm",
3606
+ "type": "button",
3607
+ "variant": [
3608
+ "if",
3609
+ [
3610
+ "==",
3611
+ "@entity.speed",
3612
+ 4.0
3613
+ ],
3614
+ "secondary",
3615
+ "ghost"
3616
+ ]
3617
+ }
3618
+ ],
3619
+ "direction": "horizontal",
3620
+ "gap": "xs",
3621
+ "role": "group",
3622
+ "type": "stack"
3623
+ },
3624
+ {
3625
+ "color": "muted",
3626
+ "content": [
3627
+ "str/concat",
3628
+ "Frame ",
3629
+ [
3630
+ "+",
3631
+ "@entity.frameIndex",
3632
+ 1.0
3633
+ ],
3634
+ " of ",
3635
+ [
3636
+ "array/len",
3637
+ "@config.frames"
3638
+ ]
3639
+ ],
3640
+ "type": "typography",
3641
+ "variant": "caption"
3642
+ }
1901
3643
  ],
1902
- "label": "Pause",
1903
- "type": "button",
1904
- "variant": "secondary"
3644
+ "direction": "horizontal",
3645
+ "gap": "sm",
3646
+ "type": "stack",
3647
+ "wrap": true
1905
3648
  },
1906
3649
  {
1907
- "action": "RESTART",
1908
- "label": "Restart",
1909
- "type": "button",
1910
- "variant": "ghost"
1911
- }
1912
- ],
1913
- "direction": "horizontal",
1914
- "gap": "sm",
1915
- "type": "stack"
1916
- },
1917
- {
1918
- "children": [
3650
+ "max": [
3651
+ "array/len",
3652
+ "@config.frames"
3653
+ ],
3654
+ "showPercentage": false,
3655
+ "type": "progress-bar",
3656
+ "value": [
3657
+ "+",
3658
+ "@entity.frameIndex",
3659
+ 1.0
3660
+ ]
3661
+ },
1919
3662
  {
1920
- "content": "@entity.frameCaption",
1921
- "type": "typography",
1922
- "variant": "body"
3663
+ "backgroundColor": "@config.backgroundColor",
3664
+ "bars": "@entity.bars",
3665
+ "height": "@config.height",
3666
+ "keyMap": {
3667
+ "KeyR": "RESTART",
3668
+ "Space": "TOGGLE_RUN"
3669
+ },
3670
+ "type": "algorithm-canvas",
3671
+ "width": "@config.width"
3672
+ },
3673
+ {
3674
+ "children": [
3675
+ {
3676
+ "content": "@entity.frameCaption",
3677
+ "type": "typography",
3678
+ "variant": "body"
3679
+ }
3680
+ ],
3681
+ "padding": "md",
3682
+ "title": "@entity.frameLabel",
3683
+ "type": "card",
3684
+ "variant": "bordered"
1923
3685
  }
1924
3686
  ],
1925
- "padding": "md",
1926
- "title": "@entity.frameLabel",
1927
- "type": "card",
1928
- "variant": "bordered"
1929
- },
1930
- {
1931
- "content": [
1932
- "str/concat",
1933
- "@entity.statusNote",
1934
- " · ",
1935
- [
1936
- "str/concat",
1937
- "",
1938
- "@config.tickMs"
1939
- ],
1940
- " ms/frame",
1941
- [
1942
- "if",
1943
- "@config.loop",
1944
- " · loops",
1945
- ""
1946
- ]
1947
- ],
1948
- "type": "typography",
1949
- "variant": "caption"
3687
+ "direction": "vertical",
3688
+ "gap": "md",
3689
+ "type": "stack"
1950
3690
  }
1951
3691
  ],
1952
- "direction": "vertical",
1953
- "gap": "md",
1954
- "type": "stack"
3692
+ "padding": "md",
3693
+ "type": "box"
1955
3694
  }
1956
3695
  ],
1957
- "padding": "md",
1958
- "type": "box"
1959
- }
1960
- ],
1961
- [
1962
- "emit",
1963
- "FRAME_ADVANCED",
1964
- {
1965
- "frameIndex": "@entity.frameIndex",
1966
- "frameLabel": "@entity.frameLabel"
1967
- }
1968
- ],
1969
- [
1970
- "if",
1971
- [
1972
- "and",
1973
- [
1974
- "not",
1975
- "@config.loop"
1976
- ],
1977
3696
  [
1978
- "not",
1979
- "@entity.running"
3697
+ "emit",
3698
+ "FRAME_ADVANCED",
3699
+ {
3700
+ "frameIndex": "@entity.frameIndex",
3701
+ "frameLabel": "@entity.frameLabel"
3702
+ }
1980
3703
  ],
1981
3704
  [
1982
- ">=",
3705
+ "if",
1983
3706
  [
1984
- "+",
1985
- "@entity.frameIndex",
1986
- 1.0
3707
+ "and",
3708
+ [
3709
+ "not",
3710
+ "@config.loop"
3711
+ ],
3712
+ [
3713
+ "not",
3714
+ "@entity.running"
3715
+ ],
3716
+ [
3717
+ ">=",
3718
+ [
3719
+ "+",
3720
+ "@entity.frameIndex",
3721
+ 1.0
3722
+ ],
3723
+ [
3724
+ "array/len",
3725
+ "@config.frames"
3726
+ ]
3727
+ ]
1987
3728
  ],
1988
3729
  [
1989
- "array/len",
1990
- "@config.frames"
1991
- ]
3730
+ "emit",
3731
+ "TRACE_DONE",
3732
+ {
3733
+ "totalFrames": [
3734
+ "array/len",
3735
+ "@config.frames"
3736
+ ]
3737
+ }
3738
+ ],
3739
+ null
1992
3740
  ]
1993
- ],
1994
- [
1995
- "emit",
1996
- "TRACE_DONE",
1997
- {
1998
- "totalFrames": [
1999
- "array/len",
2000
- "@config.frames"
2001
- ]
2002
- }
2003
- ],
2004
- null
3741
+ ]
2005
3742
  ]
2006
3743
  ],
2007
3744
  "guard": "@entity.running",
2008
- "interval": 500.0,
3745
+ "interval": 50.0,
2009
3746
  "name": "framePlayerTick"
2010
3747
  }
2011
3748
  ]