@almadar/std 3.2.1 → 3.2.2

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 (262) hide show
  1. package/behaviors/exports/atoms/std-async.orb +41 -24
  2. package/behaviors/exports/atoms/std-browse.orb +12 -5
  3. package/behaviors/exports/atoms/std-cache-aside.orb +256 -42
  4. package/behaviors/exports/atoms/std-circuit-breaker.orb +577 -97
  5. package/behaviors/exports/atoms/std-collision.orb +278 -206
  6. package/behaviors/exports/atoms/std-combat-log.orb +6 -1
  7. package/behaviors/exports/atoms/std-combat.orb +6 -1
  8. package/behaviors/exports/atoms/std-confirmation.orb +212 -7
  9. package/behaviors/exports/atoms/std-dialogue-box.orb +6 -1
  10. package/behaviors/exports/atoms/std-display.orb +166 -21
  11. package/behaviors/exports/atoms/std-drawer.orb +208 -104
  12. package/behaviors/exports/atoms/std-filter.orb +211 -18
  13. package/behaviors/exports/atoms/std-game-audio.orb +6 -1
  14. package/behaviors/exports/atoms/std-game-canvas2d.orb +6 -1
  15. package/behaviors/exports/atoms/std-game-canvas3d.orb +6 -1
  16. package/behaviors/exports/atoms/std-game-hud.orb +6 -1
  17. package/behaviors/exports/atoms/std-game-menu.orb +6 -1
  18. package/behaviors/exports/atoms/std-game-over-screen.orb +6 -1
  19. package/behaviors/exports/atoms/std-gameflow.orb +100 -5
  20. package/behaviors/exports/atoms/std-input.orb +142 -137
  21. package/behaviors/exports/atoms/std-inventory-panel.orb +6 -1
  22. package/behaviors/exports/atoms/std-isometric-canvas.orb +6 -1
  23. package/behaviors/exports/atoms/std-loading.orb +27 -76
  24. package/behaviors/exports/atoms/std-modal.orb +177 -93
  25. package/behaviors/exports/atoms/std-movement.orb +401 -31
  26. package/behaviors/exports/atoms/std-notification.orb +46 -95
  27. package/behaviors/exports/atoms/std-overworld.orb +44 -16
  28. package/behaviors/exports/atoms/std-pagination.orb +26 -89
  29. package/behaviors/exports/atoms/std-physics2d.orb +6 -1
  30. package/behaviors/exports/atoms/std-platformer-canvas.orb +6 -1
  31. package/behaviors/exports/atoms/std-quest.orb +309 -34
  32. package/behaviors/exports/atoms/std-rate-limiter.orb +410 -157
  33. package/behaviors/exports/atoms/std-score-board.orb +6 -1
  34. package/behaviors/exports/atoms/std-score.orb +211 -11
  35. package/behaviors/exports/atoms/std-search.orb +28 -27
  36. package/behaviors/exports/atoms/std-selection.orb +160 -121
  37. package/behaviors/exports/atoms/std-simulation-canvas.orb +6 -1
  38. package/behaviors/exports/atoms/std-sort.orb +134 -24
  39. package/behaviors/exports/atoms/std-sprite.orb +6 -1
  40. package/behaviors/exports/atoms/std-tabs.orb +25 -15
  41. package/behaviors/exports/atoms/std-timer.orb +483 -91
  42. package/behaviors/exports/atoms/std-undo.orb +211 -81
  43. package/behaviors/exports/atoms/std-wizard.orb +31 -34
  44. package/behaviors/exports/molecules/std-builder-game.orb +6 -1
  45. package/behaviors/exports/molecules/std-cart.orb +6 -1
  46. package/behaviors/exports/molecules/std-classifier-game.orb +6 -1
  47. package/behaviors/exports/molecules/std-debugger-game.orb +6 -1
  48. package/behaviors/exports/molecules/std-detail.orb +12 -5
  49. package/behaviors/exports/molecules/std-event-handler-game.orb +6 -1
  50. package/behaviors/exports/molecules/std-geospatial.orb +28 -9
  51. package/behaviors/exports/molecules/std-inventory.orb +28 -9
  52. package/behaviors/exports/molecules/std-list.orb +392 -5
  53. package/behaviors/exports/molecules/std-messaging.orb +12 -5
  54. package/behaviors/exports/molecules/std-negotiator-game.orb +6 -1
  55. package/behaviors/exports/molecules/std-platformer-game.orb +40 -1
  56. package/behaviors/exports/molecules/std-puzzle-game.orb +26 -1
  57. package/behaviors/exports/molecules/std-sequencer-game.orb +6 -1
  58. package/behaviors/exports/molecules/std-simulator-game.orb +6 -1
  59. package/behaviors/exports/molecules/std-turn-based-battle.orb +40 -1
  60. package/behaviors/exports/organisms/std-api-gateway.orb +1145 -403
  61. package/behaviors/exports/organisms/std-arcade-game.orb +94 -4
  62. package/behaviors/exports/organisms/std-booking-system.orb +2165 -1605
  63. package/behaviors/exports/organisms/std-cicd-pipeline.orb +581 -47
  64. package/behaviors/exports/organisms/std-cms.orb +1713 -947
  65. package/behaviors/exports/organisms/std-coding-academy.orb +180 -380
  66. package/behaviors/exports/organisms/std-crm.orb +1669 -1153
  67. package/behaviors/exports/organisms/std-devops-dashboard.orb +1430 -378
  68. package/behaviors/exports/organisms/std-ecommerce.orb +2361 -1601
  69. package/behaviors/exports/organisms/std-finance-tracker.orb +622 -438
  70. package/behaviors/exports/organisms/std-healthcare.orb +1687 -1125
  71. package/behaviors/exports/organisms/std-helpdesk.orb +626 -407
  72. package/behaviors/exports/organisms/std-hr-portal.orb +1309 -714
  73. package/behaviors/exports/organisms/std-iot-dashboard.orb +1247 -335
  74. package/behaviors/exports/organisms/std-lms.orb +658 -362
  75. package/behaviors/exports/organisms/std-platformer-app.orb +56 -8
  76. package/behaviors/exports/organisms/std-project-manager.orb +1697 -1183
  77. package/behaviors/exports/organisms/std-puzzle-app.orb +20 -0
  78. package/behaviors/exports/organisms/std-realtime-chat.orb +552 -28
  79. package/behaviors/exports/organisms/std-rpg-game.orb +397 -56
  80. package/behaviors/exports/organisms/std-social-feed.orb +12 -8
  81. package/behaviors/exports/organisms/std-stem-lab.orb +175 -290
  82. package/behaviors/exports/organisms/std-strategy-game.orb +252 -395
  83. package/behaviors/exports/organisms/std-trading-dashboard.orb +718 -524
  84. package/behaviors/exports/validation-report.json +252 -252
  85. package/behaviors/exports/verify-results.json +13 -0
  86. package/dist/behaviors/exports/atoms/std-async.orb +41 -24
  87. package/dist/behaviors/exports/atoms/std-browse.orb +12 -5
  88. package/dist/behaviors/exports/atoms/std-cache-aside.orb +256 -42
  89. package/dist/behaviors/exports/atoms/std-circuit-breaker.orb +577 -97
  90. package/dist/behaviors/exports/atoms/std-collision.orb +278 -206
  91. package/dist/behaviors/exports/atoms/std-combat-log.orb +6 -1
  92. package/dist/behaviors/exports/atoms/std-combat.orb +6 -1
  93. package/dist/behaviors/exports/atoms/std-confirmation.orb +212 -7
  94. package/dist/behaviors/exports/atoms/std-dialogue-box.orb +6 -1
  95. package/dist/behaviors/exports/atoms/std-display.orb +166 -21
  96. package/dist/behaviors/exports/atoms/std-drawer.orb +208 -104
  97. package/dist/behaviors/exports/atoms/std-filter.orb +211 -18
  98. package/dist/behaviors/exports/atoms/std-game-audio.orb +6 -1
  99. package/dist/behaviors/exports/atoms/std-game-canvas2d.orb +6 -1
  100. package/dist/behaviors/exports/atoms/std-game-canvas3d.orb +6 -1
  101. package/dist/behaviors/exports/atoms/std-game-hud.orb +6 -1
  102. package/dist/behaviors/exports/atoms/std-game-menu.orb +6 -1
  103. package/dist/behaviors/exports/atoms/std-game-over-screen.orb +6 -1
  104. package/dist/behaviors/exports/atoms/std-gameflow.orb +100 -5
  105. package/dist/behaviors/exports/atoms/std-input.orb +142 -137
  106. package/dist/behaviors/exports/atoms/std-inventory-panel.orb +6 -1
  107. package/dist/behaviors/exports/atoms/std-isometric-canvas.orb +6 -1
  108. package/dist/behaviors/exports/atoms/std-loading.orb +27 -76
  109. package/dist/behaviors/exports/atoms/std-modal.orb +177 -93
  110. package/dist/behaviors/exports/atoms/std-movement.orb +401 -31
  111. package/dist/behaviors/exports/atoms/std-notification.orb +46 -95
  112. package/dist/behaviors/exports/atoms/std-overworld.orb +44 -16
  113. package/dist/behaviors/exports/atoms/std-pagination.orb +26 -89
  114. package/dist/behaviors/exports/atoms/std-physics2d.orb +6 -1
  115. package/dist/behaviors/exports/atoms/std-platformer-canvas.orb +6 -1
  116. package/dist/behaviors/exports/atoms/std-quest.orb +309 -34
  117. package/dist/behaviors/exports/atoms/std-rate-limiter.orb +410 -157
  118. package/dist/behaviors/exports/atoms/std-score-board.orb +6 -1
  119. package/dist/behaviors/exports/atoms/std-score.orb +211 -11
  120. package/dist/behaviors/exports/atoms/std-search.orb +28 -27
  121. package/dist/behaviors/exports/atoms/std-selection.orb +160 -121
  122. package/dist/behaviors/exports/atoms/std-simulation-canvas.orb +6 -1
  123. package/dist/behaviors/exports/atoms/std-sort.orb +134 -24
  124. package/dist/behaviors/exports/atoms/std-sprite.orb +6 -1
  125. package/dist/behaviors/exports/atoms/std-tabs.orb +25 -15
  126. package/dist/behaviors/exports/atoms/std-timer.orb +483 -91
  127. package/dist/behaviors/exports/atoms/std-undo.orb +211 -81
  128. package/dist/behaviors/exports/atoms/std-wizard.orb +31 -34
  129. package/dist/behaviors/exports/molecules/std-builder-game.orb +6 -1
  130. package/dist/behaviors/exports/molecules/std-cart.orb +6 -1
  131. package/dist/behaviors/exports/molecules/std-classifier-game.orb +6 -1
  132. package/dist/behaviors/exports/molecules/std-debugger-game.orb +6 -1
  133. package/dist/behaviors/exports/molecules/std-detail.orb +12 -5
  134. package/dist/behaviors/exports/molecules/std-event-handler-game.orb +6 -1
  135. package/dist/behaviors/exports/molecules/std-geospatial.orb +28 -9
  136. package/dist/behaviors/exports/molecules/std-inventory.orb +28 -9
  137. package/dist/behaviors/exports/molecules/std-list.orb +392 -5
  138. package/dist/behaviors/exports/molecules/std-messaging.orb +12 -5
  139. package/dist/behaviors/exports/molecules/std-negotiator-game.orb +6 -1
  140. package/dist/behaviors/exports/molecules/std-platformer-game.orb +40 -1
  141. package/dist/behaviors/exports/molecules/std-puzzle-game.orb +26 -1
  142. package/dist/behaviors/exports/molecules/std-sequencer-game.orb +6 -1
  143. package/dist/behaviors/exports/molecules/std-simulator-game.orb +6 -1
  144. package/dist/behaviors/exports/molecules/std-turn-based-battle.orb +40 -1
  145. package/dist/behaviors/exports/organisms/std-api-gateway.orb +1145 -403
  146. package/dist/behaviors/exports/organisms/std-arcade-game.orb +94 -4
  147. package/dist/behaviors/exports/organisms/std-booking-system.orb +2165 -1605
  148. package/dist/behaviors/exports/organisms/std-cicd-pipeline.orb +581 -47
  149. package/dist/behaviors/exports/organisms/std-cms.orb +1713 -947
  150. package/dist/behaviors/exports/organisms/std-coding-academy.orb +180 -380
  151. package/dist/behaviors/exports/organisms/std-crm.orb +1669 -1153
  152. package/dist/behaviors/exports/organisms/std-devops-dashboard.orb +1430 -378
  153. package/dist/behaviors/exports/organisms/std-ecommerce.orb +2361 -1601
  154. package/dist/behaviors/exports/organisms/std-finance-tracker.orb +622 -438
  155. package/dist/behaviors/exports/organisms/std-healthcare.orb +1687 -1125
  156. package/dist/behaviors/exports/organisms/std-helpdesk.orb +626 -407
  157. package/dist/behaviors/exports/organisms/std-hr-portal.orb +1309 -714
  158. package/dist/behaviors/exports/organisms/std-iot-dashboard.orb +1247 -335
  159. package/dist/behaviors/exports/organisms/std-lms.orb +658 -362
  160. package/dist/behaviors/exports/organisms/std-platformer-app.orb +56 -8
  161. package/dist/behaviors/exports/organisms/std-project-manager.orb +1697 -1183
  162. package/dist/behaviors/exports/organisms/std-puzzle-app.orb +20 -0
  163. package/dist/behaviors/exports/organisms/std-realtime-chat.orb +552 -28
  164. package/dist/behaviors/exports/organisms/std-rpg-game.orb +397 -56
  165. package/dist/behaviors/exports/organisms/std-social-feed.orb +12 -8
  166. package/dist/behaviors/exports/organisms/std-stem-lab.orb +175 -290
  167. package/dist/behaviors/exports/organisms/std-strategy-game.orb +252 -395
  168. package/dist/behaviors/exports/organisms/std-trading-dashboard.orb +718 -524
  169. package/dist/behaviors/exports/validation-report.json +252 -252
  170. package/dist/behaviors/exports/verify-results.json +13 -0
  171. package/dist/behaviors/functions/index.js +715 -593
  172. package/dist/behaviors/functions/index.js.map +1 -1
  173. package/dist/behaviors/index.js +715 -593
  174. package/dist/behaviors/index.js.map +1 -1
  175. package/dist/exports/atoms/std-async.orb +41 -24
  176. package/dist/exports/atoms/std-browse.orb +12 -5
  177. package/dist/exports/atoms/std-cache-aside.orb +256 -42
  178. package/dist/exports/atoms/std-circuit-breaker.orb +577 -97
  179. package/dist/exports/atoms/std-collision.orb +278 -206
  180. package/dist/exports/atoms/std-combat-log.orb +6 -1
  181. package/dist/exports/atoms/std-combat.orb +6 -1
  182. package/dist/exports/atoms/std-confirmation.orb +212 -7
  183. package/dist/exports/atoms/std-dialogue-box.orb +6 -1
  184. package/dist/exports/atoms/std-display.orb +166 -21
  185. package/dist/exports/atoms/std-drawer.orb +208 -104
  186. package/dist/exports/atoms/std-filter.orb +211 -18
  187. package/dist/exports/atoms/std-game-audio.orb +6 -1
  188. package/dist/exports/atoms/std-game-canvas2d.orb +6 -1
  189. package/dist/exports/atoms/std-game-canvas3d.orb +6 -1
  190. package/dist/exports/atoms/std-game-hud.orb +6 -1
  191. package/dist/exports/atoms/std-game-menu.orb +6 -1
  192. package/dist/exports/atoms/std-game-over-screen.orb +6 -1
  193. package/dist/exports/atoms/std-gameflow.orb +100 -5
  194. package/dist/exports/atoms/std-input.orb +142 -137
  195. package/dist/exports/atoms/std-inventory-panel.orb +6 -1
  196. package/dist/exports/atoms/std-isometric-canvas.orb +6 -1
  197. package/dist/exports/atoms/std-loading.orb +27 -76
  198. package/dist/exports/atoms/std-modal.orb +177 -93
  199. package/dist/exports/atoms/std-movement.orb +401 -31
  200. package/dist/exports/atoms/std-notification.orb +46 -95
  201. package/dist/exports/atoms/std-overworld.orb +44 -16
  202. package/dist/exports/atoms/std-pagination.orb +26 -89
  203. package/dist/exports/atoms/std-physics2d.orb +6 -1
  204. package/dist/exports/atoms/std-platformer-canvas.orb +6 -1
  205. package/dist/exports/atoms/std-quest.orb +309 -34
  206. package/dist/exports/atoms/std-rate-limiter.orb +410 -157
  207. package/dist/exports/atoms/std-score-board.orb +6 -1
  208. package/dist/exports/atoms/std-score.orb +211 -11
  209. package/dist/exports/atoms/std-search.orb +28 -27
  210. package/dist/exports/atoms/std-selection.orb +160 -121
  211. package/dist/exports/atoms/std-simulation-canvas.orb +6 -1
  212. package/dist/exports/atoms/std-sort.orb +134 -24
  213. package/dist/exports/atoms/std-sprite.orb +6 -1
  214. package/dist/exports/atoms/std-tabs.orb +25 -15
  215. package/dist/exports/atoms/std-timer.orb +483 -91
  216. package/dist/exports/atoms/std-undo.orb +211 -81
  217. package/dist/exports/atoms/std-wizard.orb +31 -34
  218. package/dist/exports/molecules/std-builder-game.orb +6 -1
  219. package/dist/exports/molecules/std-cart.orb +6 -1
  220. package/dist/exports/molecules/std-classifier-game.orb +6 -1
  221. package/dist/exports/molecules/std-debugger-game.orb +6 -1
  222. package/dist/exports/molecules/std-detail.orb +12 -5
  223. package/dist/exports/molecules/std-event-handler-game.orb +6 -1
  224. package/dist/exports/molecules/std-geospatial.orb +28 -9
  225. package/dist/exports/molecules/std-inventory.orb +28 -9
  226. package/dist/exports/molecules/std-list.orb +392 -5
  227. package/dist/exports/molecules/std-messaging.orb +12 -5
  228. package/dist/exports/molecules/std-negotiator-game.orb +6 -1
  229. package/dist/exports/molecules/std-platformer-game.orb +40 -1
  230. package/dist/exports/molecules/std-puzzle-game.orb +26 -1
  231. package/dist/exports/molecules/std-sequencer-game.orb +6 -1
  232. package/dist/exports/molecules/std-simulator-game.orb +6 -1
  233. package/dist/exports/molecules/std-turn-based-battle.orb +40 -1
  234. package/dist/exports/organisms/std-api-gateway.orb +1145 -403
  235. package/dist/exports/organisms/std-arcade-game.orb +94 -4
  236. package/dist/exports/organisms/std-booking-system.orb +2165 -1605
  237. package/dist/exports/organisms/std-cicd-pipeline.orb +581 -47
  238. package/dist/exports/organisms/std-cms.orb +1713 -947
  239. package/dist/exports/organisms/std-coding-academy.orb +180 -380
  240. package/dist/exports/organisms/std-crm.orb +1669 -1153
  241. package/dist/exports/organisms/std-devops-dashboard.orb +1430 -378
  242. package/dist/exports/organisms/std-ecommerce.orb +2361 -1601
  243. package/dist/exports/organisms/std-finance-tracker.orb +622 -438
  244. package/dist/exports/organisms/std-healthcare.orb +1687 -1125
  245. package/dist/exports/organisms/std-helpdesk.orb +626 -407
  246. package/dist/exports/organisms/std-hr-portal.orb +1309 -714
  247. package/dist/exports/organisms/std-iot-dashboard.orb +1247 -335
  248. package/dist/exports/organisms/std-lms.orb +658 -362
  249. package/dist/exports/organisms/std-platformer-app.orb +56 -8
  250. package/dist/exports/organisms/std-project-manager.orb +1697 -1183
  251. package/dist/exports/organisms/std-puzzle-app.orb +20 -0
  252. package/dist/exports/organisms/std-realtime-chat.orb +552 -28
  253. package/dist/exports/organisms/std-rpg-game.orb +397 -56
  254. package/dist/exports/organisms/std-social-feed.orb +12 -8
  255. package/dist/exports/organisms/std-stem-lab.orb +175 -290
  256. package/dist/exports/organisms/std-strategy-game.orb +252 -395
  257. package/dist/exports/organisms/std-trading-dashboard.orb +718 -524
  258. package/dist/exports/validation-report.json +252 -252
  259. package/dist/exports/verify-results.json +13 -0
  260. package/dist/index.js +715 -593
  261. package/dist/index.js.map +1 -1
  262. package/package.json +1 -1
@@ -228,7 +228,9 @@
228
228
  }
229
229
  ],
230
230
  "className": "transition-shadow hover:shadow-md cursor-pointer",
231
- "children": [
231
+ "renderItem": [
232
+ "fn",
233
+ "item",
232
234
  {
233
235
  "type": "stack",
234
236
  "direction": "vertical",
@@ -254,13 +256,13 @@
254
256
  {
255
257
  "type": "typography",
256
258
  "variant": "h4",
257
- "content": "@entity.name"
259
+ "content": "@item.name"
258
260
  }
259
261
  ]
260
262
  },
261
263
  {
262
264
  "type": "badge",
263
- "label": "@entity.description"
265
+ "label": "@item.description"
264
266
  }
265
267
  ]
266
268
  },
@@ -268,7 +270,7 @@
268
270
  "type": "typography",
269
271
  "variant": "caption",
270
272
  "color": "muted",
271
- "content": "@entity.price"
273
+ "content": "@item.price"
272
274
  }
273
275
  ]
274
276
  }
@@ -386,143 +388,55 @@
386
388
  "modal",
387
389
  null
388
390
  ],
389
- [
390
- "fetch",
391
- "Product"
392
- ],
393
- [
394
- "notify",
395
- "Product deleted successfully"
396
- ]
397
- ]
398
- },
399
- {
400
- "from": "deleting",
401
- "to": "browsing",
402
- "event": "CANCEL",
403
- "effects": [
404
- [
405
- "render-ui",
406
- "modal",
407
- null
408
- ]
409
- ]
410
- },
411
- {
412
- "from": "deleting",
413
- "to": "browsing",
414
- "event": "CLOSE",
415
- "effects": [
416
- [
417
- "render-ui",
418
- "modal",
419
- null
420
- ]
421
- ]
422
- }
423
- ]
424
- },
425
- "emits": [
426
- {
427
- "event": "ADD_TO_CART",
428
- "payload": [
429
- {
430
- "name": "id",
431
- "type": "string",
432
- "required": true
433
- }
434
- ],
435
- "scope": "external"
436
- }
437
- ]
438
- },
439
- {
440
- "name": "ProductCreate",
441
- "linkedEntity": "Product",
442
- "category": "interaction",
443
- "emits": [
444
- {
445
- "event": "PRODUCT_CREATED"
446
- }
447
- ],
448
- "stateMachine": {
449
- "states": [
450
- {
451
- "name": "closed",
452
- "isInitial": true
453
- },
454
- {
455
- "name": "open"
456
- }
457
- ],
458
- "events": [
459
- {
460
- "key": "INIT",
461
- "name": "Initialize"
462
- },
463
- {
464
- "key": "CREATE",
465
- "name": "Open"
466
- },
467
- {
468
- "key": "CLOSE",
469
- "name": "Close"
470
- },
471
- {
472
- "key": "SAVE",
473
- "name": "Save",
474
- "payload": [
475
- {
476
- "name": "data",
477
- "type": "object",
478
- "required": true
479
- }
480
- ]
481
- }
482
- ],
483
- "transitions": [
484
- {
485
- "from": "closed",
486
- "to": "closed",
487
- "event": "INIT",
488
- "effects": [
489
- [
490
- "fetch",
491
- "Product"
492
- ]
493
- ]
494
- },
495
- {
496
- "from": "closed",
497
- "to": "open",
498
- "event": "CREATE",
499
- "effects": [
500
391
  [
501
392
  "fetch",
502
393
  "Product"
503
394
  ],
504
395
  [
505
396
  "render-ui",
506
- "modal",
397
+ "main",
507
398
  {
508
399
  "type": "stack",
509
400
  "direction": "vertical",
510
- "gap": "md",
401
+ "gap": "lg",
511
402
  "children": [
512
403
  {
513
404
  "type": "stack",
514
405
  "direction": "horizontal",
515
- "gap": "sm",
406
+ "gap": "md",
407
+ "justify": "space-between",
516
408
  "children": [
517
409
  {
518
- "type": "icon",
519
- "name": "plus-circle",
520
- "size": "md"
410
+ "type": "stack",
411
+ "direction": "horizontal",
412
+ "gap": "sm",
413
+ "align": "center",
414
+ "children": [
415
+ {
416
+ "type": "icon",
417
+ "name": "package",
418
+ "size": "lg"
419
+ },
420
+ {
421
+ "type": "typography",
422
+ "content": "Products",
423
+ "variant": "h2"
424
+ }
425
+ ]
521
426
  },
522
427
  {
523
- "type": "typography",
524
- "content": "Create Product",
525
- "variant": "h3"
428
+ "type": "stack",
429
+ "direction": "horizontal",
430
+ "gap": "sm",
431
+ "children": [
432
+ {
433
+ "type": "button",
434
+ "label": "Create Product",
435
+ "event": "CREATE",
436
+ "variant": "primary",
437
+ "icon": "plus"
438
+ }
439
+ ]
526
440
  }
527
441
  ]
528
442
  },
@@ -530,47 +444,93 @@
530
444
  "type": "divider"
531
445
  },
532
446
  {
533
- "type": "form-section",
447
+ "type": "data-grid",
534
448
  "entity": "Product",
535
- "mode": "create",
536
- "submitEvent": "SAVE",
537
- "cancelEvent": "CLOSE",
538
- "fields": [
539
- "name",
540
- "description",
541
- "price",
542
- "category",
543
- "sku",
544
- "inStock"
449
+ "emptyIcon": "inbox",
450
+ "emptyTitle": "No products yet",
451
+ "emptyDescription": "Create your first product to get started.",
452
+ "itemActions": [
453
+ {
454
+ "label": "View",
455
+ "event": "VIEW"
456
+ },
457
+ {
458
+ "label": "Edit",
459
+ "event": "EDIT"
460
+ },
461
+ {
462
+ "label": "Delete",
463
+ "event": "DELETE",
464
+ "variant": "danger"
465
+ }
466
+ ],
467
+ "className": "transition-shadow hover:shadow-md cursor-pointer",
468
+ "renderItem": [
469
+ "fn",
470
+ "item",
471
+ {
472
+ "type": "stack",
473
+ "direction": "vertical",
474
+ "gap": "sm",
475
+ "children": [
476
+ {
477
+ "type": "stack",
478
+ "direction": "horizontal",
479
+ "justify": "space-between",
480
+ "align": "center",
481
+ "children": [
482
+ {
483
+ "type": "stack",
484
+ "direction": "horizontal",
485
+ "gap": "sm",
486
+ "align": "center",
487
+ "children": [
488
+ {
489
+ "type": "icon",
490
+ "name": "package",
491
+ "size": "sm"
492
+ },
493
+ {
494
+ "type": "typography",
495
+ "variant": "h4",
496
+ "content": "@item.name"
497
+ }
498
+ ]
499
+ },
500
+ {
501
+ "type": "badge",
502
+ "label": "@item.description"
503
+ }
504
+ ]
505
+ },
506
+ {
507
+ "type": "typography",
508
+ "variant": "caption",
509
+ "color": "muted",
510
+ "content": "@item.price"
511
+ }
512
+ ]
513
+ }
545
514
  ]
546
515
  }
547
516
  ]
548
517
  }
518
+ ],
519
+ [
520
+ "notify",
521
+ "Product deleted successfully"
549
522
  ]
550
523
  ]
551
524
  },
552
525
  {
553
- "from": "open",
554
- "to": "closed",
555
- "event": "CLOSE",
526
+ "from": "deleting",
527
+ "to": "browsing",
528
+ "event": "CANCEL",
556
529
  "effects": [
557
530
  [
558
531
  "render-ui",
559
532
  "modal",
560
533
  null
561
- ]
562
- ]
563
- },
564
- {
565
- "from": "open",
566
- "to": "closed",
567
- "event": "SAVE",
568
- "effects": [
569
- [
570
- "persist",
571
- "create",
572
- "Product",
573
- "@payload.data"
574
534
  ],
575
535
  [
576
536
  "fetch",
@@ -578,117 +538,49 @@
578
538
  ],
579
539
  [
580
540
  "render-ui",
581
- "modal",
582
- null
583
- ],
584
- [
585
- "emit",
586
- "PRODUCT_CREATED"
587
- ],
588
- [
589
- "notify",
590
- "Product created successfully"
591
- ]
592
- ]
593
- }
594
- ]
595
- }
596
- },
597
- {
598
- "name": "ProductEdit",
599
- "linkedEntity": "Product",
600
- "category": "interaction",
601
- "emits": [
602
- {
603
- "event": "PRODUCT_UPDATED"
604
- }
605
- ],
606
- "stateMachine": {
607
- "states": [
608
- {
609
- "name": "closed",
610
- "isInitial": true
611
- },
612
- {
613
- "name": "open"
614
- }
615
- ],
616
- "events": [
617
- {
618
- "key": "INIT",
619
- "name": "Initialize"
620
- },
621
- {
622
- "key": "EDIT",
623
- "name": "Open",
624
- "payload": [
625
- {
626
- "name": "id",
627
- "type": "string",
628
- "required": true
629
- }
630
- ]
631
- },
632
- {
633
- "key": "CLOSE",
634
- "name": "Close"
635
- },
636
- {
637
- "key": "SAVE",
638
- "name": "Save",
639
- "payload": [
640
- {
641
- "name": "data",
642
- "type": "object",
643
- "required": true
644
- }
645
- ]
646
- }
647
- ],
648
- "transitions": [
649
- {
650
- "from": "closed",
651
- "to": "closed",
652
- "event": "INIT",
653
- "effects": [
654
- [
655
- "fetch",
656
- "Product"
657
- ]
658
- ]
659
- },
660
- {
661
- "from": "closed",
662
- "to": "open",
663
- "event": "EDIT",
664
- "effects": [
665
- [
666
- "fetch",
667
- "Product",
668
- "@payload.id"
669
- ],
670
- [
671
- "render-ui",
672
- "modal",
541
+ "main",
673
542
  {
674
543
  "type": "stack",
675
544
  "direction": "vertical",
676
- "gap": "md",
545
+ "gap": "lg",
677
546
  "children": [
678
547
  {
679
548
  "type": "stack",
680
549
  "direction": "horizontal",
681
- "gap": "sm",
550
+ "gap": "md",
551
+ "justify": "space-between",
682
552
  "children": [
683
553
  {
684
- "type": "icon",
685
- "name": "edit",
686
- "size": "md"
554
+ "type": "stack",
555
+ "direction": "horizontal",
556
+ "gap": "sm",
557
+ "align": "center",
558
+ "children": [
559
+ {
560
+ "type": "icon",
561
+ "name": "package",
562
+ "size": "lg"
563
+ },
564
+ {
565
+ "type": "typography",
566
+ "content": "Products",
567
+ "variant": "h2"
568
+ }
569
+ ]
687
570
  },
688
571
  {
689
- "type": "typography",
690
- "content": "Edit Product",
691
- "variant": "h3"
572
+ "type": "stack",
573
+ "direction": "horizontal",
574
+ "gap": "sm",
575
+ "children": [
576
+ {
577
+ "type": "button",
578
+ "label": "Create Product",
579
+ "event": "CREATE",
580
+ "variant": "primary",
581
+ "icon": "plus"
582
+ }
583
+ ]
692
584
  }
693
585
  ]
694
586
  },
@@ -696,20 +588,74 @@
696
588
  "type": "divider"
697
589
  },
698
590
  {
699
- "type": "form-section",
591
+ "type": "data-grid",
700
592
  "entity": "Product",
701
- "mode": "edit",
702
- "submitEvent": "SAVE",
703
- "cancelEvent": "CLOSE",
704
- "fields": [
705
- "name",
706
- "description",
707
- "price",
708
- "category",
709
- "sku",
710
- "inStock"
593
+ "emptyIcon": "inbox",
594
+ "emptyTitle": "No products yet",
595
+ "emptyDescription": "Create your first product to get started.",
596
+ "itemActions": [
597
+ {
598
+ "label": "View",
599
+ "event": "VIEW"
600
+ },
601
+ {
602
+ "label": "Edit",
603
+ "event": "EDIT"
604
+ },
605
+ {
606
+ "label": "Delete",
607
+ "event": "DELETE",
608
+ "variant": "danger"
609
+ }
711
610
  ],
712
- "entityId": "@entity.id"
611
+ "className": "transition-shadow hover:shadow-md cursor-pointer",
612
+ "renderItem": [
613
+ "fn",
614
+ "item",
615
+ {
616
+ "type": "stack",
617
+ "direction": "vertical",
618
+ "gap": "sm",
619
+ "children": [
620
+ {
621
+ "type": "stack",
622
+ "direction": "horizontal",
623
+ "justify": "space-between",
624
+ "align": "center",
625
+ "children": [
626
+ {
627
+ "type": "stack",
628
+ "direction": "horizontal",
629
+ "gap": "sm",
630
+ "align": "center",
631
+ "children": [
632
+ {
633
+ "type": "icon",
634
+ "name": "package",
635
+ "size": "sm"
636
+ },
637
+ {
638
+ "type": "typography",
639
+ "variant": "h4",
640
+ "content": "@item.name"
641
+ }
642
+ ]
643
+ },
644
+ {
645
+ "type": "badge",
646
+ "label": "@item.description"
647
+ }
648
+ ]
649
+ },
650
+ {
651
+ "type": "typography",
652
+ "variant": "caption",
653
+ "color": "muted",
654
+ "content": "@item.price"
655
+ }
656
+ ]
657
+ }
658
+ ]
713
659
  }
714
660
  ]
715
661
  }
@@ -717,27 +663,14 @@
717
663
  ]
718
664
  },
719
665
  {
720
- "from": "open",
721
- "to": "closed",
666
+ "from": "deleting",
667
+ "to": "browsing",
722
668
  "event": "CLOSE",
723
669
  "effects": [
724
670
  [
725
671
  "render-ui",
726
672
  "modal",
727
673
  null
728
- ]
729
- ]
730
- },
731
- {
732
- "from": "open",
733
- "to": "closed",
734
- "event": "SAVE",
735
- "effects": [
736
- [
737
- "persist",
738
- "update",
739
- "Product",
740
- "@payload.data"
741
674
  ],
742
675
  [
743
676
  "fetch",
@@ -745,55 +678,188 @@
745
678
  ],
746
679
  [
747
680
  "render-ui",
748
- "modal",
749
- null
750
- ],
751
- [
752
- "emit",
753
- "PRODUCT_UPDATED"
754
- ],
755
- [
756
- "notify",
757
- "Product updated successfully"
758
- ]
759
- ]
760
- }
761
- ]
762
- }
763
- },
764
- {
765
- "name": "ProductView",
766
- "linkedEntity": "Product",
767
- "category": "interaction",
768
- "stateMachine": {
769
- "states": [
770
- {
771
- "name": "closed",
772
- "isInitial": true
773
- },
774
- {
775
- "name": "open"
776
- }
777
- ],
778
- "events": [
779
- {
780
- "key": "INIT",
781
- "name": "Initialize"
782
- },
783
- {
784
- "key": "VIEW",
785
- "name": "Open",
786
- "payload": [
787
- {
788
- "name": "id",
789
- "type": "string",
790
- "required": true
791
- }
681
+ "main",
682
+ {
683
+ "type": "stack",
684
+ "direction": "vertical",
685
+ "gap": "lg",
686
+ "children": [
687
+ {
688
+ "type": "stack",
689
+ "direction": "horizontal",
690
+ "gap": "md",
691
+ "justify": "space-between",
692
+ "children": [
693
+ {
694
+ "type": "stack",
695
+ "direction": "horizontal",
696
+ "gap": "sm",
697
+ "align": "center",
698
+ "children": [
699
+ {
700
+ "type": "icon",
701
+ "name": "package",
702
+ "size": "lg"
703
+ },
704
+ {
705
+ "type": "typography",
706
+ "content": "Products",
707
+ "variant": "h2"
708
+ }
709
+ ]
710
+ },
711
+ {
712
+ "type": "stack",
713
+ "direction": "horizontal",
714
+ "gap": "sm",
715
+ "children": [
716
+ {
717
+ "type": "button",
718
+ "label": "Create Product",
719
+ "event": "CREATE",
720
+ "variant": "primary",
721
+ "icon": "plus"
722
+ }
723
+ ]
724
+ }
725
+ ]
726
+ },
727
+ {
728
+ "type": "divider"
729
+ },
730
+ {
731
+ "type": "data-grid",
732
+ "entity": "Product",
733
+ "emptyIcon": "inbox",
734
+ "emptyTitle": "No products yet",
735
+ "emptyDescription": "Create your first product to get started.",
736
+ "itemActions": [
737
+ {
738
+ "label": "View",
739
+ "event": "VIEW"
740
+ },
741
+ {
742
+ "label": "Edit",
743
+ "event": "EDIT"
744
+ },
745
+ {
746
+ "label": "Delete",
747
+ "event": "DELETE",
748
+ "variant": "danger"
749
+ }
750
+ ],
751
+ "className": "transition-shadow hover:shadow-md cursor-pointer",
752
+ "renderItem": [
753
+ "fn",
754
+ "item",
755
+ {
756
+ "type": "stack",
757
+ "direction": "vertical",
758
+ "gap": "sm",
759
+ "children": [
760
+ {
761
+ "type": "stack",
762
+ "direction": "horizontal",
763
+ "justify": "space-between",
764
+ "align": "center",
765
+ "children": [
766
+ {
767
+ "type": "stack",
768
+ "direction": "horizontal",
769
+ "gap": "sm",
770
+ "align": "center",
771
+ "children": [
772
+ {
773
+ "type": "icon",
774
+ "name": "package",
775
+ "size": "sm"
776
+ },
777
+ {
778
+ "type": "typography",
779
+ "variant": "h4",
780
+ "content": "@item.name"
781
+ }
782
+ ]
783
+ },
784
+ {
785
+ "type": "badge",
786
+ "label": "@item.description"
787
+ }
788
+ ]
789
+ },
790
+ {
791
+ "type": "typography",
792
+ "variant": "caption",
793
+ "color": "muted",
794
+ "content": "@item.price"
795
+ }
796
+ ]
797
+ }
798
+ ]
799
+ }
800
+ ]
801
+ }
802
+ ]
792
803
  ]
804
+ }
805
+ ]
806
+ },
807
+ "emits": [
808
+ {
809
+ "event": "ADD_TO_CART",
810
+ "payload": [
811
+ {
812
+ "name": "id",
813
+ "type": "string",
814
+ "required": true
815
+ }
816
+ ],
817
+ "scope": "external"
818
+ }
819
+ ]
820
+ },
821
+ {
822
+ "name": "ProductCreate",
823
+ "linkedEntity": "Product",
824
+ "category": "interaction",
825
+ "emits": [
826
+ {
827
+ "event": "PRODUCT_CREATED"
828
+ }
829
+ ],
830
+ "stateMachine": {
831
+ "states": [
832
+ {
833
+ "name": "closed",
834
+ "isInitial": true
835
+ },
836
+ {
837
+ "name": "open"
838
+ }
839
+ ],
840
+ "events": [
841
+ {
842
+ "key": "INIT",
843
+ "name": "Initialize"
844
+ },
845
+ {
846
+ "key": "CREATE",
847
+ "name": "Open"
793
848
  },
794
849
  {
795
850
  "key": "CLOSE",
796
851
  "name": "Close"
852
+ },
853
+ {
854
+ "key": "SAVE",
855
+ "name": "Save",
856
+ "payload": [
857
+ {
858
+ "name": "data",
859
+ "type": "object",
860
+ "required": true
861
+ }
862
+ ]
797
863
  }
798
864
  ],
799
865
  "transitions": [
@@ -811,12 +877,11 @@
811
877
  {
812
878
  "from": "closed",
813
879
  "to": "open",
814
- "event": "VIEW",
880
+ "event": "CREATE",
815
881
  "effects": [
816
882
  [
817
883
  "fetch",
818
- "Product",
819
- "@payload.id"
884
+ "Product"
820
885
  ],
821
886
  [
822
887
  "render-ui",
@@ -830,17 +895,16 @@
830
895
  "type": "stack",
831
896
  "direction": "horizontal",
832
897
  "gap": "sm",
833
- "align": "center",
834
898
  "children": [
835
899
  {
836
900
  "type": "icon",
837
- "name": "eye",
901
+ "name": "plus-circle",
838
902
  "size": "md"
839
903
  },
840
904
  {
841
905
  "type": "typography",
842
- "variant": "h3",
843
- "content": "@entity.name"
906
+ "content": "Create Product",
907
+ "variant": "h3"
844
908
  }
845
909
  ]
846
910
  },
@@ -848,129 +912,18 @@
848
912
  "type": "divider"
849
913
  },
850
914
  {
851
- "type": "stack",
852
- "direction": "horizontal",
853
- "gap": "md",
854
- "children": [
855
- {
856
- "type": "typography",
857
- "variant": "caption",
858
- "content": "Name"
859
- },
860
- {
861
- "type": "typography",
862
- "variant": "body",
863
- "content": "@entity.name"
864
- }
865
- ]
866
- },
867
- {
868
- "type": "stack",
869
- "direction": "horizontal",
870
- "gap": "md",
871
- "children": [
872
- {
873
- "type": "typography",
874
- "variant": "caption",
875
- "content": "Description"
876
- },
877
- {
878
- "type": "typography",
879
- "variant": "body",
880
- "content": "@entity.description"
881
- }
882
- ]
883
- },
884
- {
885
- "type": "stack",
886
- "direction": "horizontal",
887
- "gap": "md",
888
- "children": [
889
- {
890
- "type": "typography",
891
- "variant": "caption",
892
- "content": "Price"
893
- },
894
- {
895
- "type": "typography",
896
- "variant": "body",
897
- "content": "@entity.price"
898
- }
899
- ]
900
- },
901
- {
902
- "type": "stack",
903
- "direction": "horizontal",
904
- "gap": "md",
905
- "children": [
906
- {
907
- "type": "typography",
908
- "variant": "caption",
909
- "content": "Category"
910
- },
911
- {
912
- "type": "typography",
913
- "variant": "body",
914
- "content": "@entity.category"
915
- }
916
- ]
917
- },
918
- {
919
- "type": "stack",
920
- "direction": "horizontal",
921
- "gap": "md",
922
- "children": [
923
- {
924
- "type": "typography",
925
- "variant": "caption",
926
- "content": "Sku"
927
- },
928
- {
929
- "type": "typography",
930
- "variant": "body",
931
- "content": "@entity.sku"
932
- }
933
- ]
934
- },
935
- {
936
- "type": "stack",
937
- "direction": "horizontal",
938
- "gap": "md",
939
- "children": [
940
- {
941
- "type": "typography",
942
- "variant": "caption",
943
- "content": "InStock"
944
- },
945
- {
946
- "type": "typography",
947
- "variant": "body",
948
- "content": "@entity.inStock"
949
- }
950
- ]
951
- },
952
- {
953
- "type": "divider"
954
- },
955
- {
956
- "type": "stack",
957
- "direction": "horizontal",
958
- "gap": "sm",
959
- "justify": "end",
960
- "children": [
961
- {
962
- "type": "button",
963
- "label": "Edit",
964
- "event": "EDIT",
965
- "variant": "primary",
966
- "icon": "edit"
967
- },
968
- {
969
- "type": "button",
970
- "label": "Close",
971
- "event": "CLOSE",
972
- "variant": "ghost"
973
- }
915
+ "type": "form-section",
916
+ "entity": "Product",
917
+ "mode": "create",
918
+ "submitEvent": "SAVE",
919
+ "cancelEvent": "CLOSE",
920
+ "fields": [
921
+ "name",
922
+ "description",
923
+ "price",
924
+ "category",
925
+ "sku",
926
+ "inStock"
974
927
  ]
975
928
  }
976
929
  ]
@@ -989,80 +942,57 @@
989
942
  null
990
943
  ]
991
944
  ]
945
+ },
946
+ {
947
+ "from": "open",
948
+ "to": "closed",
949
+ "event": "SAVE",
950
+ "effects": [
951
+ [
952
+ "persist",
953
+ "create",
954
+ "Product",
955
+ "@payload.data"
956
+ ],
957
+ [
958
+ "fetch",
959
+ "Product"
960
+ ],
961
+ [
962
+ "render-ui",
963
+ "modal",
964
+ null
965
+ ],
966
+ [
967
+ "emit",
968
+ "PRODUCT_CREATED"
969
+ ],
970
+ [
971
+ "notify",
972
+ "Product created successfully"
973
+ ]
974
+ ]
992
975
  }
993
976
  ]
994
977
  }
995
- }
996
- ],
997
- "pages": [
978
+ },
998
979
  {
999
- "name": "ProductsPage",
1000
- "path": "/products",
1001
- "isInitial": true,
1002
- "traits": [
1003
- {
1004
- "ref": "ProductBrowse"
1005
- },
1006
- {
1007
- "ref": "ProductCreate"
1008
- },
1009
- {
1010
- "ref": "ProductEdit"
1011
- },
980
+ "name": "ProductEdit",
981
+ "linkedEntity": "Product",
982
+ "category": "interaction",
983
+ "emits": [
1012
984
  {
1013
- "ref": "ProductView"
985
+ "event": "PRODUCT_UPDATED"
1014
986
  }
1015
- ]
1016
- }
1017
- ]
1018
- },
1019
- {
1020
- "name": "CartItemOrbital",
1021
- "entity": {
1022
- "name": "CartItem",
1023
- "persistence": "persistent",
1024
- "collection": "cartitems",
1025
- "fields": [
1026
- {
1027
- "name": "id",
1028
- "type": "string",
1029
- "required": true
1030
- },
1031
- {
1032
- "name": "productName",
1033
- "type": "string",
1034
- "required": true
1035
- },
1036
- {
1037
- "name": "quantity",
1038
- "type": "number",
1039
- "required": true,
1040
- "default": 1
1041
- },
1042
- {
1043
- "name": "unitPrice",
1044
- "type": "number",
1045
- "required": true
1046
- },
1047
- {
1048
- "name": "totalPrice",
1049
- "type": "number"
1050
- }
1051
- ]
1052
- },
1053
- "traits": [
1054
- {
1055
- "name": "CartItemCartBrowse",
1056
- "linkedEntity": "CartItem",
1057
- "category": "interaction",
987
+ ],
1058
988
  "stateMachine": {
1059
989
  "states": [
1060
990
  {
1061
- "name": "browsing",
991
+ "name": "closed",
1062
992
  "isInitial": true
1063
993
  },
1064
994
  {
1065
- "name": "checkout"
995
+ "name": "open"
1066
996
  }
1067
997
  ],
1068
998
  "events": [
@@ -1071,91 +1001,76 @@
1071
1001
  "name": "Initialize"
1072
1002
  },
1073
1003
  {
1074
- "key": "ADD_ITEM",
1075
- "name": "Add Item"
1076
- },
1077
- {
1078
- "key": "SAVE",
1079
- "name": "Save",
1004
+ "key": "EDIT",
1005
+ "name": "Open",
1080
1006
  "payload": [
1081
1007
  {
1082
- "name": "data",
1083
- "type": "object",
1008
+ "name": "id",
1009
+ "type": "string",
1084
1010
  "required": true
1085
1011
  }
1086
1012
  ]
1087
1013
  },
1088
1014
  {
1089
- "key": "REMOVE_ITEM",
1090
- "name": "Remove Item",
1015
+ "key": "CLOSE",
1016
+ "name": "Close"
1017
+ },
1018
+ {
1019
+ "key": "SAVE",
1020
+ "name": "Save",
1091
1021
  "payload": [
1092
1022
  {
1093
- "name": "id",
1094
- "type": "string",
1023
+ "name": "data",
1024
+ "type": "object",
1095
1025
  "required": true
1096
1026
  }
1097
1027
  ]
1098
- },
1099
- {
1100
- "key": "PROCEED_CHECKOUT",
1101
- "name": "Proceed to Checkout"
1102
- },
1103
- {
1104
- "key": "BACK_TO_CART",
1105
- "name": "Back to Cart"
1106
- },
1107
- {
1108
- "key": "CONFIRM_ORDER",
1109
- "name": "Confirm Order"
1110
1028
  }
1111
1029
  ],
1112
1030
  "transitions": [
1113
1031
  {
1114
- "from": "browsing",
1115
- "to": "browsing",
1032
+ "from": "closed",
1033
+ "to": "closed",
1116
1034
  "event": "INIT",
1117
1035
  "effects": [
1118
1036
  [
1119
1037
  "fetch",
1120
- "CartItem"
1038
+ "Product"
1039
+ ]
1040
+ ]
1041
+ },
1042
+ {
1043
+ "from": "closed",
1044
+ "to": "open",
1045
+ "event": "EDIT",
1046
+ "effects": [
1047
+ [
1048
+ "fetch",
1049
+ "Product",
1050
+ "@payload.id"
1121
1051
  ],
1122
1052
  [
1123
1053
  "render-ui",
1124
- "main",
1054
+ "modal",
1125
1055
  {
1126
1056
  "type": "stack",
1127
1057
  "direction": "vertical",
1128
- "gap": "lg",
1058
+ "gap": "md",
1129
1059
  "children": [
1130
1060
  {
1131
1061
  "type": "stack",
1132
1062
  "direction": "horizontal",
1133
- "gap": "md",
1134
- "justify": "space-between",
1063
+ "gap": "sm",
1135
1064
  "children": [
1136
1065
  {
1137
- "type": "stack",
1138
- "direction": "horizontal",
1139
- "gap": "md",
1140
- "children": [
1141
- {
1142
- "type": "icon",
1143
- "name": "shopping-cart",
1144
- "size": "lg"
1145
- },
1146
- {
1147
- "type": "typography",
1148
- "content": "Shopping Cart",
1149
- "variant": "h2"
1150
- }
1151
- ]
1066
+ "type": "icon",
1067
+ "name": "edit",
1068
+ "size": "md"
1152
1069
  },
1153
1070
  {
1154
- "type": "button",
1155
- "label": "Add Item",
1156
- "event": "ADD_ITEM",
1157
- "variant": "primary",
1158
- "icon": "plus"
1071
+ "type": "typography",
1072
+ "content": "Edit Product",
1073
+ "variant": "h3"
1159
1074
  }
1160
1075
  ]
1161
1076
  },
@@ -1163,69 +1078,20 @@
1163
1078
  "type": "divider"
1164
1079
  },
1165
1080
  {
1166
- "type": "data-grid",
1167
- "entity": "CartItem",
1168
- "emptyIcon": "inbox",
1169
- "emptyTitle": "Your cart is empty",
1170
- "emptyDescription": "Add items to get started.",
1171
- "itemActions": [
1172
- {
1173
- "label": "Remove",
1174
- "event": "REMOVE_ITEM",
1175
- "variant": "danger"
1176
- }
1081
+ "type": "form-section",
1082
+ "entity": "Product",
1083
+ "mode": "edit",
1084
+ "submitEvent": "SAVE",
1085
+ "cancelEvent": "CLOSE",
1086
+ "fields": [
1087
+ "name",
1088
+ "description",
1089
+ "price",
1090
+ "category",
1091
+ "sku",
1092
+ "inStock"
1177
1093
  ],
1178
- "children": [
1179
- {
1180
- "type": "stack",
1181
- "direction": "vertical",
1182
- "gap": "sm",
1183
- "children": [
1184
- {
1185
- "type": "stack",
1186
- "direction": "horizontal",
1187
- "justify": "space-between",
1188
- "align": "center",
1189
- "children": [
1190
- {
1191
- "type": "stack",
1192
- "direction": "horizontal",
1193
- "gap": "sm",
1194
- "align": "center",
1195
- "children": [
1196
- {
1197
- "type": "icon",
1198
- "name": "shopping-cart",
1199
- "size": "sm"
1200
- },
1201
- {
1202
- "type": "typography",
1203
- "variant": "h4",
1204
- "content": "@entity.productName"
1205
- }
1206
- ]
1207
- },
1208
- {
1209
- "type": "badge",
1210
- "label": "@entity.quantity"
1211
- }
1212
- ]
1213
- },
1214
- {
1215
- "type": "typography",
1216
- "variant": "caption",
1217
- "content": "@entity.unitPrice"
1218
- }
1219
- ]
1220
- }
1221
- ]
1222
- },
1223
- {
1224
- "type": "button",
1225
- "label": "Proceed to Checkout",
1226
- "event": "PROCEED_CHECKOUT",
1227
- "variant": "primary",
1228
- "icon": "arrow-right"
1094
+ "entityId": "@entity.id"
1229
1095
  }
1230
1096
  ]
1231
1097
  }
@@ -1233,68 +1099,130 @@
1233
1099
  ]
1234
1100
  },
1235
1101
  {
1236
- "from": "browsing",
1237
- "to": "browsing",
1238
- "event": "SAVE",
1102
+ "from": "open",
1103
+ "to": "closed",
1104
+ "event": "CLOSE",
1239
1105
  "effects": [
1240
1106
  [
1241
- "fetch",
1242
- "CartItem"
1107
+ "render-ui",
1108
+ "modal",
1109
+ null
1243
1110
  ]
1244
1111
  ]
1245
1112
  },
1246
1113
  {
1247
- "from": "browsing",
1248
- "to": "browsing",
1249
- "event": "REMOVE_ITEM",
1114
+ "from": "open",
1115
+ "to": "closed",
1116
+ "event": "SAVE",
1250
1117
  "effects": [
1251
1118
  [
1252
1119
  "persist",
1253
- "delete",
1254
- "CartItem",
1255
- "@payload.id"
1120
+ "update",
1121
+ "Product",
1122
+ "@payload.data"
1256
1123
  ],
1257
1124
  [
1258
1125
  "fetch",
1259
- "CartItem"
1126
+ "Product"
1127
+ ],
1128
+ [
1129
+ "render-ui",
1130
+ "modal",
1131
+ null
1132
+ ],
1133
+ [
1134
+ "emit",
1135
+ "PRODUCT_UPDATED"
1260
1136
  ],
1261
1137
  [
1262
1138
  "notify",
1263
- "CartItem deleted successfully"
1139
+ "Product updated successfully"
1264
1140
  ]
1265
1141
  ]
1142
+ }
1143
+ ]
1144
+ }
1145
+ },
1146
+ {
1147
+ "name": "ProductView",
1148
+ "linkedEntity": "Product",
1149
+ "category": "interaction",
1150
+ "stateMachine": {
1151
+ "states": [
1152
+ {
1153
+ "name": "closed",
1154
+ "isInitial": true
1266
1155
  },
1267
1156
  {
1268
- "from": "browsing",
1269
- "to": "checkout",
1270
- "event": "PROCEED_CHECKOUT",
1157
+ "name": "open"
1158
+ }
1159
+ ],
1160
+ "events": [
1161
+ {
1162
+ "key": "INIT",
1163
+ "name": "Initialize"
1164
+ },
1165
+ {
1166
+ "key": "VIEW",
1167
+ "name": "Open",
1168
+ "payload": [
1169
+ {
1170
+ "name": "id",
1171
+ "type": "string",
1172
+ "required": true
1173
+ }
1174
+ ]
1175
+ },
1176
+ {
1177
+ "key": "CLOSE",
1178
+ "name": "Close"
1179
+ }
1180
+ ],
1181
+ "transitions": [
1182
+ {
1183
+ "from": "closed",
1184
+ "to": "closed",
1185
+ "event": "INIT",
1271
1186
  "effects": [
1272
1187
  [
1273
1188
  "fetch",
1274
- "CartItem"
1189
+ "Product"
1190
+ ]
1191
+ ]
1192
+ },
1193
+ {
1194
+ "from": "closed",
1195
+ "to": "open",
1196
+ "event": "VIEW",
1197
+ "effects": [
1198
+ [
1199
+ "fetch",
1200
+ "Product",
1201
+ "@payload.id"
1275
1202
  ],
1276
1203
  [
1277
1204
  "render-ui",
1278
- "main",
1205
+ "modal",
1279
1206
  {
1280
1207
  "type": "stack",
1281
1208
  "direction": "vertical",
1282
- "gap": "lg",
1209
+ "gap": "md",
1283
1210
  "children": [
1284
1211
  {
1285
1212
  "type": "stack",
1286
1213
  "direction": "horizontal",
1287
1214
  "gap": "sm",
1215
+ "align": "center",
1288
1216
  "children": [
1289
1217
  {
1290
1218
  "type": "icon",
1291
- "name": "clipboard",
1292
- "size": "lg"
1219
+ "name": "eye",
1220
+ "size": "md"
1293
1221
  },
1294
1222
  {
1295
1223
  "type": "typography",
1296
- "content": "Checkout",
1297
- "variant": "h2"
1224
+ "variant": "h3",
1225
+ "content": "@entity.name"
1298
1226
  }
1299
1227
  ]
1300
1228
  },
@@ -1302,180 +1230,221 @@
1302
1230
  "type": "divider"
1303
1231
  },
1304
1232
  {
1305
- "type": "data-grid",
1306
- "entity": "CartItem",
1307
- "emptyIcon": "inbox",
1308
- "emptyTitle": "Your cart is empty",
1309
- "emptyDescription": "Add items to get started.",
1310
- "itemActions": [
1311
- {
1312
- "label": "Remove",
1313
- "event": "REMOVE_ITEM",
1314
- "variant": "danger"
1315
- }
1316
- ],
1233
+ "type": "stack",
1234
+ "direction": "horizontal",
1235
+ "gap": "md",
1317
1236
  "children": [
1318
1237
  {
1319
- "type": "stack",
1320
- "direction": "vertical",
1321
- "gap": "sm",
1322
- "children": [
1323
- {
1324
- "type": "stack",
1325
- "direction": "horizontal",
1326
- "justify": "space-between",
1327
- "align": "center",
1328
- "children": [
1329
- {
1330
- "type": "stack",
1331
- "direction": "horizontal",
1332
- "gap": "sm",
1333
- "align": "center",
1334
- "children": [
1335
- {
1336
- "type": "icon",
1337
- "name": "shopping-cart",
1338
- "size": "sm"
1339
- },
1340
- {
1341
- "type": "typography",
1342
- "variant": "h4",
1343
- "content": "@entity.productName"
1344
- }
1345
- ]
1346
- },
1347
- {
1348
- "type": "badge",
1349
- "label": "@entity.quantity"
1350
- }
1351
- ]
1352
- },
1353
- {
1354
- "type": "typography",
1355
- "variant": "caption",
1356
- "content": "@entity.unitPrice"
1357
- }
1358
- ]
1238
+ "type": "typography",
1239
+ "variant": "caption",
1240
+ "content": "Name"
1241
+ },
1242
+ {
1243
+ "type": "typography",
1244
+ "variant": "body",
1245
+ "content": "@entity.name"
1359
1246
  }
1360
1247
  ]
1361
1248
  },
1362
1249
  {
1363
1250
  "type": "stack",
1364
1251
  "direction": "horizontal",
1365
- "gap": "sm",
1366
- "justify": "end",
1252
+ "gap": "md",
1367
1253
  "children": [
1368
1254
  {
1369
- "type": "button",
1370
- "label": "Back to Cart",
1371
- "event": "BACK_TO_CART",
1372
- "variant": "ghost",
1373
- "icon": "arrow-left"
1255
+ "type": "typography",
1256
+ "variant": "caption",
1257
+ "content": "Description"
1374
1258
  },
1375
1259
  {
1376
- "type": "button",
1377
- "label": "Confirm Order",
1378
- "event": "CONFIRM_ORDER",
1379
- "variant": "primary",
1380
- "icon": "check"
1260
+ "type": "typography",
1261
+ "variant": "body",
1262
+ "content": "@entity.description"
1381
1263
  }
1382
1264
  ]
1383
- }
1384
- ]
1385
- }
1386
- ]
1387
- ]
1388
- },
1389
- {
1390
- "from": "checkout",
1391
- "to": "browsing",
1392
- "event": "BACK_TO_CART",
1393
- "effects": [
1394
- [
1395
- "fetch",
1396
- "CartItem"
1397
- ]
1398
- ]
1399
- },
1400
- {
1401
- "from": "checkout",
1402
- "to": "browsing",
1403
- "event": "CONFIRM_ORDER",
1404
- "effects": [
1405
- [
1406
- "fetch",
1407
- "CartItem"
1408
- ],
1409
- [
1410
- "render-ui",
1411
- "main",
1412
- {
1413
- "type": "stack",
1414
- "direction": "vertical",
1415
- "gap": "lg",
1416
- "align": "center",
1417
- "children": [
1265
+ },
1418
1266
  {
1419
- "type": "icon",
1420
- "name": "check-circle",
1421
- "size": "lg"
1267
+ "type": "stack",
1268
+ "direction": "horizontal",
1269
+ "gap": "md",
1270
+ "children": [
1271
+ {
1272
+ "type": "typography",
1273
+ "variant": "caption",
1274
+ "content": "Price"
1275
+ },
1276
+ {
1277
+ "type": "typography",
1278
+ "variant": "body",
1279
+ "content": "@entity.price"
1280
+ }
1281
+ ]
1422
1282
  },
1423
1283
  {
1424
- "type": "typography",
1425
- "content": "Order Confirmed",
1426
- "variant": "h2"
1284
+ "type": "stack",
1285
+ "direction": "horizontal",
1286
+ "gap": "md",
1287
+ "children": [
1288
+ {
1289
+ "type": "typography",
1290
+ "variant": "caption",
1291
+ "content": "Category"
1292
+ },
1293
+ {
1294
+ "type": "typography",
1295
+ "variant": "body",
1296
+ "content": "@entity.category"
1297
+ }
1298
+ ]
1427
1299
  },
1428
1300
  {
1429
- "type": "typography",
1430
- "content": "Your order has been placed successfully.",
1431
- "variant": "body"
1301
+ "type": "stack",
1302
+ "direction": "horizontal",
1303
+ "gap": "md",
1304
+ "children": [
1305
+ {
1306
+ "type": "typography",
1307
+ "variant": "caption",
1308
+ "content": "Sku"
1309
+ },
1310
+ {
1311
+ "type": "typography",
1312
+ "variant": "body",
1313
+ "content": "@entity.sku"
1314
+ }
1315
+ ]
1432
1316
  },
1433
1317
  {
1434
- "type": "button",
1435
- "label": "Continue Shopping",
1436
- "event": "INIT",
1437
- "variant": "primary"
1318
+ "type": "stack",
1319
+ "direction": "horizontal",
1320
+ "gap": "md",
1321
+ "children": [
1322
+ {
1323
+ "type": "typography",
1324
+ "variant": "caption",
1325
+ "content": "InStock"
1326
+ },
1327
+ {
1328
+ "type": "typography",
1329
+ "variant": "body",
1330
+ "content": "@entity.inStock"
1331
+ }
1332
+ ]
1333
+ },
1334
+ {
1335
+ "type": "divider"
1336
+ },
1337
+ {
1338
+ "type": "stack",
1339
+ "direction": "horizontal",
1340
+ "gap": "sm",
1341
+ "justify": "end",
1342
+ "children": [
1343
+ {
1344
+ "type": "button",
1345
+ "label": "Edit",
1346
+ "event": "EDIT",
1347
+ "variant": "primary",
1348
+ "icon": "edit"
1349
+ },
1350
+ {
1351
+ "type": "button",
1352
+ "label": "Close",
1353
+ "event": "CLOSE",
1354
+ "variant": "ghost"
1355
+ }
1356
+ ]
1438
1357
  }
1439
1358
  ]
1440
1359
  }
1441
1360
  ]
1442
1361
  ]
1362
+ },
1363
+ {
1364
+ "from": "open",
1365
+ "to": "closed",
1366
+ "event": "CLOSE",
1367
+ "effects": [
1368
+ [
1369
+ "render-ui",
1370
+ "modal",
1371
+ null
1372
+ ]
1373
+ ]
1443
1374
  }
1444
1375
  ]
1445
- },
1446
- "listens": [
1376
+ }
1377
+ }
1378
+ ],
1379
+ "pages": [
1380
+ {
1381
+ "name": "ProductsPage",
1382
+ "path": "/products",
1383
+ "isInitial": true,
1384
+ "traits": [
1447
1385
  {
1448
- "event": "ADD_TO_CART",
1449
- "triggers": "INIT",
1450
- "scope": "external"
1451
- }
1452
- ],
1453
- "emits": [
1386
+ "ref": "ProductBrowse"
1387
+ },
1454
1388
  {
1455
- "event": "CHECKOUT_STARTED",
1456
- "payload": [
1457
- {
1458
- "name": "id",
1459
- "type": "string",
1460
- "required": true
1461
- }
1462
- ],
1463
- "scope": "external"
1389
+ "ref": "ProductCreate"
1390
+ },
1391
+ {
1392
+ "ref": "ProductEdit"
1393
+ },
1394
+ {
1395
+ "ref": "ProductView"
1464
1396
  }
1465
1397
  ]
1466
- },
1398
+ }
1399
+ ]
1400
+ },
1401
+ {
1402
+ "name": "CartItemOrbital",
1403
+ "entity": {
1404
+ "name": "CartItem",
1405
+ "persistence": "persistent",
1406
+ "collection": "cartitems",
1407
+ "fields": [
1408
+ {
1409
+ "name": "id",
1410
+ "type": "string",
1411
+ "required": true
1412
+ },
1413
+ {
1414
+ "name": "productName",
1415
+ "type": "string",
1416
+ "required": true
1417
+ },
1418
+ {
1419
+ "name": "quantity",
1420
+ "type": "number",
1421
+ "required": true,
1422
+ "default": 1
1423
+ },
1424
+ {
1425
+ "name": "unitPrice",
1426
+ "type": "number",
1427
+ "required": true
1428
+ },
1429
+ {
1430
+ "name": "totalPrice",
1431
+ "type": "number"
1432
+ }
1433
+ ]
1434
+ },
1435
+ "traits": [
1467
1436
  {
1468
- "name": "CartItemAddItem",
1437
+ "name": "CartItemCartBrowse",
1469
1438
  "linkedEntity": "CartItem",
1470
1439
  "category": "interaction",
1471
1440
  "stateMachine": {
1472
1441
  "states": [
1473
1442
  {
1474
- "name": "closed",
1443
+ "name": "browsing",
1475
1444
  "isInitial": true
1476
1445
  },
1477
1446
  {
1478
- "name": "open"
1447
+ "name": "checkout"
1479
1448
  }
1480
1449
  ],
1481
1450
  "events": [
@@ -1485,11 +1454,7 @@
1485
1454
  },
1486
1455
  {
1487
1456
  "key": "ADD_ITEM",
1488
- "name": "Open"
1489
- },
1490
- {
1491
- "key": "CLOSE",
1492
- "name": "Close"
1457
+ "name": "Add Item"
1493
1458
  },
1494
1459
  {
1495
1460
  "key": "SAVE",
@@ -1501,24 +1466,36 @@
1501
1466
  "required": true
1502
1467
  }
1503
1468
  ]
1504
- }
1505
- ],
1506
- "transitions": [
1469
+ },
1507
1470
  {
1508
- "from": "closed",
1509
- "to": "closed",
1510
- "event": "INIT",
1511
- "effects": [
1512
- [
1513
- "fetch",
1514
- "CartItem"
1515
- ]
1471
+ "key": "REMOVE_ITEM",
1472
+ "name": "Remove Item",
1473
+ "payload": [
1474
+ {
1475
+ "name": "id",
1476
+ "type": "string",
1477
+ "required": true
1478
+ }
1516
1479
  ]
1517
1480
  },
1518
1481
  {
1519
- "from": "closed",
1520
- "to": "open",
1521
- "event": "ADD_ITEM",
1482
+ "key": "PROCEED_CHECKOUT",
1483
+ "name": "Proceed to Checkout"
1484
+ },
1485
+ {
1486
+ "key": "BACK_TO_CART",
1487
+ "name": "Back to Cart"
1488
+ },
1489
+ {
1490
+ "key": "CONFIRM_ORDER",
1491
+ "name": "Confirm Order"
1492
+ }
1493
+ ],
1494
+ "transitions": [
1495
+ {
1496
+ "from": "browsing",
1497
+ "to": "browsing",
1498
+ "event": "INIT",
1522
1499
  "effects": [
1523
1500
  [
1524
1501
  "fetch",
@@ -1526,26 +1503,41 @@
1526
1503
  ],
1527
1504
  [
1528
1505
  "render-ui",
1529
- "modal",
1506
+ "main",
1530
1507
  {
1531
1508
  "type": "stack",
1532
1509
  "direction": "vertical",
1533
- "gap": "md",
1510
+ "gap": "lg",
1534
1511
  "children": [
1535
1512
  {
1536
1513
  "type": "stack",
1537
1514
  "direction": "horizontal",
1538
- "gap": "sm",
1515
+ "gap": "md",
1516
+ "justify": "space-between",
1539
1517
  "children": [
1540
1518
  {
1541
- "type": "icon",
1542
- "name": "plus-circle",
1543
- "size": "md"
1519
+ "type": "stack",
1520
+ "direction": "horizontal",
1521
+ "gap": "md",
1522
+ "children": [
1523
+ {
1524
+ "type": "icon",
1525
+ "name": "shopping-cart",
1526
+ "size": "lg"
1527
+ },
1528
+ {
1529
+ "type": "typography",
1530
+ "content": "Shopping Cart",
1531
+ "variant": "h2"
1532
+ }
1533
+ ]
1544
1534
  },
1545
1535
  {
1546
- "type": "typography",
1547
- "content": "Add Item",
1548
- "variant": "h3"
1536
+ "type": "button",
1537
+ "label": "Add Item",
1538
+ "event": "ADD_ITEM",
1539
+ "variant": "primary",
1540
+ "icon": "plus"
1549
1541
  }
1550
1542
  ]
1551
1543
  },
@@ -1553,17 +1545,69 @@
1553
1545
  "type": "divider"
1554
1546
  },
1555
1547
  {
1556
- "type": "form-section",
1548
+ "type": "data-grid",
1557
1549
  "entity": "CartItem",
1558
- "mode": "create",
1559
- "submitEvent": "SAVE",
1560
- "cancelEvent": "CLOSE",
1561
- "fields": [
1562
- "productName",
1563
- "quantity",
1564
- "unitPrice",
1565
- "totalPrice"
1550
+ "emptyIcon": "inbox",
1551
+ "emptyTitle": "Your cart is empty",
1552
+ "emptyDescription": "Add items to get started.",
1553
+ "itemActions": [
1554
+ {
1555
+ "label": "Remove",
1556
+ "event": "REMOVE_ITEM",
1557
+ "variant": "danger"
1558
+ }
1559
+ ],
1560
+ "children": [
1561
+ {
1562
+ "type": "stack",
1563
+ "direction": "vertical",
1564
+ "gap": "sm",
1565
+ "children": [
1566
+ {
1567
+ "type": "stack",
1568
+ "direction": "horizontal",
1569
+ "justify": "space-between",
1570
+ "align": "center",
1571
+ "children": [
1572
+ {
1573
+ "type": "stack",
1574
+ "direction": "horizontal",
1575
+ "gap": "sm",
1576
+ "align": "center",
1577
+ "children": [
1578
+ {
1579
+ "type": "icon",
1580
+ "name": "shopping-cart",
1581
+ "size": "sm"
1582
+ },
1583
+ {
1584
+ "type": "typography",
1585
+ "variant": "h4",
1586
+ "content": "@entity.productName"
1587
+ }
1588
+ ]
1589
+ },
1590
+ {
1591
+ "type": "badge",
1592
+ "label": "@entity.quantity"
1593
+ }
1594
+ ]
1595
+ },
1596
+ {
1597
+ "type": "typography",
1598
+ "variant": "caption",
1599
+ "content": "@entity.unitPrice"
1600
+ }
1601
+ ]
1602
+ }
1566
1603
  ]
1604
+ },
1605
+ {
1606
+ "type": "button",
1607
+ "label": "Proceed to Checkout",
1608
+ "event": "PROCEED_CHECKOUT",
1609
+ "variant": "primary",
1610
+ "icon": "arrow-right"
1567
1611
  }
1568
1612
  ]
1569
1613
  }
@@ -1571,173 +1615,45 @@
1571
1615
  ]
1572
1616
  },
1573
1617
  {
1574
- "from": "open",
1575
- "to": "closed",
1576
- "event": "CLOSE",
1618
+ "from": "browsing",
1619
+ "to": "browsing",
1620
+ "event": "SAVE",
1577
1621
  "effects": [
1578
1622
  [
1579
- "render-ui",
1580
- "modal",
1581
- null
1623
+ "fetch",
1624
+ "CartItem"
1582
1625
  ]
1583
1626
  ]
1584
1627
  },
1585
1628
  {
1586
- "from": "open",
1587
- "to": "closed",
1588
- "event": "SAVE",
1629
+ "from": "browsing",
1630
+ "to": "browsing",
1631
+ "event": "REMOVE_ITEM",
1589
1632
  "effects": [
1590
1633
  [
1591
1634
  "persist",
1592
- "create",
1635
+ "delete",
1593
1636
  "CartItem",
1594
- "@payload.data"
1637
+ "@payload.id"
1595
1638
  ],
1596
1639
  [
1597
1640
  "fetch",
1598
1641
  "CartItem"
1599
1642
  ],
1600
- [
1601
- "render-ui",
1602
- "modal",
1603
- null
1604
- ],
1605
1643
  [
1606
1644
  "notify",
1607
- "CartItem created successfully"
1645
+ "CartItem deleted successfully"
1608
1646
  ]
1609
1647
  ]
1610
- }
1611
- ]
1612
- }
1613
- }
1614
- ],
1615
- "pages": [
1616
- {
1617
- "name": "CartPage",
1618
- "path": "/cart",
1619
- "traits": [
1620
- {
1621
- "ref": "CartItemCartBrowse"
1622
- },
1623
- {
1624
- "ref": "CartItemAddItem"
1625
- }
1626
- ]
1627
- }
1628
- ]
1629
- },
1630
- {
1631
- "name": "CheckoutOrbital",
1632
- "entity": {
1633
- "name": "Checkout",
1634
- "persistence": "runtime",
1635
- "fields": [
1636
- {
1637
- "name": "id",
1638
- "type": "string",
1639
- "required": true
1640
- },
1641
- {
1642
- "name": "customerName",
1643
- "type": "string",
1644
- "required": true
1645
- },
1646
- {
1647
- "name": "email",
1648
- "type": "string",
1649
- "required": true
1650
- },
1651
- {
1652
- "name": "shippingAddress",
1653
- "type": "string",
1654
- "required": true
1655
- },
1656
- {
1657
- "name": "paymentMethod",
1658
- "type": "string",
1659
- "required": true
1660
- },
1661
- {
1662
- "name": "orderTotal",
1663
- "type": "number"
1664
- },
1665
- {
1666
- "name": "status",
1667
- "type": "string",
1668
- "default": "pending"
1669
- }
1670
- ]
1671
- },
1672
- "traits": [
1673
- {
1674
- "name": "CheckoutWizard",
1675
- "linkedEntity": "Checkout",
1676
- "category": "interaction",
1677
- "stateMachine": {
1678
- "states": [
1679
- {
1680
- "name": "step1",
1681
- "isInitial": true
1682
- },
1683
- {
1684
- "name": "step2"
1685
- },
1686
- {
1687
- "name": "step3"
1688
- },
1689
- {
1690
- "name": "review"
1691
- },
1692
- {
1693
- "name": "complete"
1694
- }
1695
- ],
1696
- "events": [
1697
- {
1698
- "key": "INIT",
1699
- "name": "Initialize"
1700
- },
1701
- {
1702
- "key": "NEXT",
1703
- "name": "Next Step",
1704
- "payload": [
1705
- {
1706
- "name": "data",
1707
- "type": "object",
1708
- "required": true
1709
- }
1710
- ]
1711
- },
1712
- {
1713
- "key": "PREV",
1714
- "name": "Previous Step"
1715
1648
  },
1716
1649
  {
1717
- "key": "COMPLETE",
1718
- "name": "Complete Wizard",
1719
- "payload": [
1720
- {
1721
- "name": "data",
1722
- "type": "object",
1723
- "required": true
1724
- }
1725
- ]
1726
- },
1727
- {
1728
- "key": "RESTART",
1729
- "name": "Restart Wizard"
1730
- }
1731
- ],
1732
- "transitions": [
1733
- {
1734
- "from": "step1",
1735
- "to": "step1",
1736
- "event": "INIT",
1650
+ "from": "browsing",
1651
+ "to": "checkout",
1652
+ "event": "PROCEED_CHECKOUT",
1737
1653
  "effects": [
1738
1654
  [
1739
1655
  "fetch",
1740
- "Checkout"
1656
+ "CartItem"
1741
1657
  ],
1742
1658
  [
1743
1659
  "render-ui",
@@ -1751,11 +1667,10 @@
1751
1667
  "type": "stack",
1752
1668
  "direction": "horizontal",
1753
1669
  "gap": "sm",
1754
- "align": "center",
1755
1670
  "children": [
1756
1671
  {
1757
1672
  "type": "icon",
1758
- "name": "credit-card",
1673
+ "name": "clipboard",
1759
1674
  "size": "lg"
1760
1675
  },
1761
1676
  {
@@ -1765,124 +1680,67 @@
1765
1680
  }
1766
1681
  ]
1767
1682
  },
1768
- {
1769
- "type": "badge",
1770
- "label": "Step 1 of 3"
1771
- },
1772
- {
1773
- "type": "wizard-progress",
1774
- "steps": [
1775
- "Customer Info",
1776
- "Shipping",
1777
- "Payment"
1778
- ],
1779
- "currentStep": 0
1780
- },
1781
1683
  {
1782
1684
  "type": "divider"
1783
1685
  },
1784
1686
  {
1785
- "type": "typography",
1786
- "content": "Customer Info",
1787
- "variant": "h3"
1788
- },
1789
- {
1790
- "type": "form-section",
1791
- "entity": "Checkout",
1792
- "mode": "create",
1793
- "submitEvent": "NEXT",
1794
- "cancelEvent": "INIT",
1795
- "fields": [
1796
- "customerName",
1797
- "email"
1798
- ]
1799
- },
1800
- {
1801
- "type": "stack",
1802
- "direction": "horizontal",
1803
- "gap": "sm",
1804
- "justify": "end",
1805
- "children": [
1687
+ "type": "data-grid",
1688
+ "entity": "CartItem",
1689
+ "emptyIcon": "inbox",
1690
+ "emptyTitle": "Your cart is empty",
1691
+ "emptyDescription": "Add items to get started.",
1692
+ "itemActions": [
1806
1693
  {
1807
- "type": "button",
1808
- "label": "Next",
1809
- "event": "NEXT",
1810
- "variant": "primary",
1811
- "icon": "arrow-right"
1694
+ "label": "Remove",
1695
+ "event": "REMOVE_ITEM",
1696
+ "variant": "danger"
1812
1697
  }
1813
- ]
1814
- }
1815
- ]
1816
- }
1817
- ]
1818
- ]
1819
- },
1820
- {
1821
- "from": "step1",
1822
- "to": "step2",
1823
- "event": "NEXT",
1824
- "effects": [
1825
- [
1826
- "fetch",
1827
- "Checkout"
1828
- ],
1829
- [
1830
- "render-ui",
1831
- "main",
1832
- {
1833
- "type": "stack",
1834
- "direction": "vertical",
1835
- "gap": "lg",
1836
- "children": [
1837
- {
1838
- "type": "stack",
1839
- "direction": "horizontal",
1840
- "gap": "sm",
1841
- "align": "center",
1698
+ ],
1842
1699
  "children": [
1843
1700
  {
1844
- "type": "icon",
1845
- "name": "credit-card",
1846
- "size": "lg"
1847
- },
1848
- {
1849
- "type": "typography",
1850
- "content": "Checkout",
1851
- "variant": "h2"
1701
+ "type": "stack",
1702
+ "direction": "vertical",
1703
+ "gap": "sm",
1704
+ "children": [
1705
+ {
1706
+ "type": "stack",
1707
+ "direction": "horizontal",
1708
+ "justify": "space-between",
1709
+ "align": "center",
1710
+ "children": [
1711
+ {
1712
+ "type": "stack",
1713
+ "direction": "horizontal",
1714
+ "gap": "sm",
1715
+ "align": "center",
1716
+ "children": [
1717
+ {
1718
+ "type": "icon",
1719
+ "name": "shopping-cart",
1720
+ "size": "sm"
1721
+ },
1722
+ {
1723
+ "type": "typography",
1724
+ "variant": "h4",
1725
+ "content": "@entity.productName"
1726
+ }
1727
+ ]
1728
+ },
1729
+ {
1730
+ "type": "badge",
1731
+ "label": "@entity.quantity"
1732
+ }
1733
+ ]
1734
+ },
1735
+ {
1736
+ "type": "typography",
1737
+ "variant": "caption",
1738
+ "content": "@entity.unitPrice"
1739
+ }
1740
+ ]
1852
1741
  }
1853
1742
  ]
1854
1743
  },
1855
- {
1856
- "type": "badge",
1857
- "label": "Step 2 of 3"
1858
- },
1859
- {
1860
- "type": "wizard-progress",
1861
- "steps": [
1862
- "Customer Info",
1863
- "Shipping",
1864
- "Payment"
1865
- ],
1866
- "currentStep": 1
1867
- },
1868
- {
1869
- "type": "divider"
1870
- },
1871
- {
1872
- "type": "typography",
1873
- "content": "Shipping",
1874
- "variant": "h3"
1875
- },
1876
- {
1877
- "type": "form-section",
1878
- "entity": "Checkout",
1879
- "mode": "create",
1880
- "submitEvent": "NEXT",
1881
- "cancelEvent": "PREV",
1882
- "fields": [
1883
- "shippingAddress"
1884
- ]
1885
- },
1886
1744
  {
1887
1745
  "type": "stack",
1888
1746
  "direction": "horizontal",
@@ -1891,17 +1749,17 @@
1891
1749
  "children": [
1892
1750
  {
1893
1751
  "type": "button",
1894
- "label": "Back",
1895
- "event": "PREV",
1752
+ "label": "Back to Cart",
1753
+ "event": "BACK_TO_CART",
1896
1754
  "variant": "ghost",
1897
1755
  "icon": "arrow-left"
1898
1756
  },
1899
1757
  {
1900
1758
  "type": "button",
1901
- "label": "Next",
1902
- "event": "NEXT",
1759
+ "label": "Confirm Order",
1760
+ "event": "CONFIRM_ORDER",
1903
1761
  "variant": "primary",
1904
- "icon": "arrow-right"
1762
+ "icon": "check"
1905
1763
  }
1906
1764
  ]
1907
1765
  }
@@ -1911,13 +1769,24 @@
1911
1769
  ]
1912
1770
  },
1913
1771
  {
1914
- "from": "step2",
1915
- "to": "step3",
1916
- "event": "NEXT",
1772
+ "from": "checkout",
1773
+ "to": "browsing",
1774
+ "event": "BACK_TO_CART",
1917
1775
  "effects": [
1918
1776
  [
1919
1777
  "fetch",
1920
- "Checkout"
1778
+ "CartItem"
1779
+ ]
1780
+ ]
1781
+ },
1782
+ {
1783
+ "from": "checkout",
1784
+ "to": "browsing",
1785
+ "event": "CONFIRM_ORDER",
1786
+ "effects": [
1787
+ [
1788
+ "fetch",
1789
+ "CartItem"
1921
1790
  ],
1922
1791
  [
1923
1792
  "render-ui",
@@ -1926,275 +1795,156 @@
1926
1795
  "type": "stack",
1927
1796
  "direction": "vertical",
1928
1797
  "gap": "lg",
1798
+ "align": "center",
1929
1799
  "children": [
1930
1800
  {
1931
- "type": "stack",
1932
- "direction": "horizontal",
1933
- "gap": "sm",
1934
- "align": "center",
1935
- "children": [
1936
- {
1937
- "type": "icon",
1938
- "name": "credit-card",
1939
- "size": "lg"
1940
- },
1941
- {
1942
- "type": "typography",
1943
- "content": "Checkout",
1944
- "variant": "h2"
1945
- }
1946
- ]
1947
- },
1948
- {
1949
- "type": "badge",
1950
- "label": "Step 3 of 3"
1951
- },
1952
- {
1953
- "type": "wizard-progress",
1954
- "steps": [
1955
- "Customer Info",
1956
- "Shipping",
1957
- "Payment"
1958
- ],
1959
- "currentStep": 2
1801
+ "type": "icon",
1802
+ "name": "check-circle",
1803
+ "size": "lg"
1960
1804
  },
1961
1805
  {
1962
- "type": "divider"
1806
+ "type": "typography",
1807
+ "content": "Order Confirmed",
1808
+ "variant": "h2"
1963
1809
  },
1964
1810
  {
1965
1811
  "type": "typography",
1966
- "content": "Payment",
1967
- "variant": "h3"
1812
+ "content": "Your order has been placed successfully.",
1813
+ "variant": "body"
1968
1814
  },
1969
1815
  {
1970
- "type": "form-section",
1971
- "entity": "Checkout",
1972
- "mode": "create",
1973
- "submitEvent": "NEXT",
1974
- "cancelEvent": "PREV",
1975
- "fields": [
1976
- "paymentMethod"
1977
- ]
1978
- },
1979
- {
1980
- "type": "stack",
1981
- "direction": "horizontal",
1982
- "gap": "sm",
1983
- "justify": "end",
1984
- "children": [
1985
- {
1986
- "type": "button",
1987
- "label": "Back",
1988
- "event": "PREV",
1989
- "variant": "ghost",
1990
- "icon": "arrow-left"
1991
- },
1992
- {
1993
- "type": "button",
1994
- "label": "Next",
1995
- "event": "NEXT",
1996
- "variant": "primary",
1997
- "icon": "arrow-right"
1998
- }
1999
- ]
1816
+ "type": "button",
1817
+ "label": "Continue Shopping",
1818
+ "event": "INIT",
1819
+ "variant": "primary"
2000
1820
  }
2001
1821
  ]
2002
1822
  }
2003
1823
  ]
2004
1824
  ]
1825
+ }
1826
+ ]
1827
+ },
1828
+ "listens": [
1829
+ {
1830
+ "event": "ADD_TO_CART",
1831
+ "triggers": "INIT",
1832
+ "scope": "external"
1833
+ }
1834
+ ],
1835
+ "emits": [
1836
+ {
1837
+ "event": "CHECKOUT_STARTED",
1838
+ "payload": [
1839
+ {
1840
+ "name": "id",
1841
+ "type": "string",
1842
+ "required": true
1843
+ }
1844
+ ],
1845
+ "scope": "external"
1846
+ }
1847
+ ]
1848
+ },
1849
+ {
1850
+ "name": "CartItemAddItem",
1851
+ "linkedEntity": "CartItem",
1852
+ "category": "interaction",
1853
+ "stateMachine": {
1854
+ "states": [
1855
+ {
1856
+ "name": "closed",
1857
+ "isInitial": true
2005
1858
  },
2006
1859
  {
2007
- "from": "step3",
2008
- "to": "review",
2009
- "event": "NEXT",
1860
+ "name": "open"
1861
+ }
1862
+ ],
1863
+ "events": [
1864
+ {
1865
+ "key": "INIT",
1866
+ "name": "Initialize"
1867
+ },
1868
+ {
1869
+ "key": "ADD_ITEM",
1870
+ "name": "Open"
1871
+ },
1872
+ {
1873
+ "key": "CLOSE",
1874
+ "name": "Close"
1875
+ },
1876
+ {
1877
+ "key": "SAVE",
1878
+ "name": "Save",
1879
+ "payload": [
1880
+ {
1881
+ "name": "data",
1882
+ "type": "object",
1883
+ "required": true
1884
+ }
1885
+ ]
1886
+ }
1887
+ ],
1888
+ "transitions": [
1889
+ {
1890
+ "from": "closed",
1891
+ "to": "closed",
1892
+ "event": "INIT",
2010
1893
  "effects": [
2011
1894
  [
2012
1895
  "fetch",
2013
- "Checkout"
1896
+ "CartItem"
1897
+ ]
1898
+ ]
1899
+ },
1900
+ {
1901
+ "from": "closed",
1902
+ "to": "open",
1903
+ "event": "ADD_ITEM",
1904
+ "effects": [
1905
+ [
1906
+ "fetch",
1907
+ "CartItem"
2014
1908
  ],
2015
1909
  [
2016
1910
  "render-ui",
2017
- "main",
1911
+ "modal",
2018
1912
  {
2019
1913
  "type": "stack",
2020
1914
  "direction": "vertical",
2021
- "gap": "lg",
1915
+ "gap": "md",
2022
1916
  "children": [
2023
1917
  {
2024
1918
  "type": "stack",
2025
1919
  "direction": "horizontal",
2026
1920
  "gap": "sm",
2027
- "align": "center",
2028
1921
  "children": [
2029
1922
  {
2030
1923
  "type": "icon",
2031
- "name": "credit-card",
2032
- "size": "lg"
1924
+ "name": "plus-circle",
1925
+ "size": "md"
2033
1926
  },
2034
1927
  {
2035
1928
  "type": "typography",
2036
- "content": "Checkout",
2037
- "variant": "h2"
1929
+ "content": "Add Item",
1930
+ "variant": "h3"
2038
1931
  }
2039
1932
  ]
2040
1933
  },
2041
- {
2042
- "type": "badge",
2043
- "label": "Review"
2044
- },
2045
- {
2046
- "type": "wizard-progress",
2047
- "steps": [
2048
- "Customer Info",
2049
- "Shipping",
2050
- "Payment"
2051
- ],
2052
- "currentStep": 3
2053
- },
2054
1934
  {
2055
1935
  "type": "divider"
2056
1936
  },
2057
1937
  {
2058
- "type": "data-list",
2059
- "entity": "Checkout",
2060
- "children": [
2061
- {
2062
- "type": "stack",
2063
- "direction": "vertical",
2064
- "gap": "sm",
2065
- "children": [
2066
- {
2067
- "type": "stack",
2068
- "direction": "horizontal",
2069
- "gap": "md",
2070
- "justify": "space-between",
2071
- "children": [
2072
- {
2073
- "type": "typography",
2074
- "variant": "caption",
2075
- "content": "CustomerName"
2076
- },
2077
- {
2078
- "type": "typography",
2079
- "variant": "body",
2080
- "content": "@entity.customerName"
2081
- }
2082
- ]
2083
- },
2084
- {
2085
- "type": "stack",
2086
- "direction": "horizontal",
2087
- "gap": "md",
2088
- "justify": "space-between",
2089
- "children": [
2090
- {
2091
- "type": "typography",
2092
- "variant": "caption",
2093
- "content": "Email"
2094
- },
2095
- {
2096
- "type": "typography",
2097
- "variant": "body",
2098
- "content": "@entity.email"
2099
- }
2100
- ]
2101
- },
2102
- {
2103
- "type": "stack",
2104
- "direction": "horizontal",
2105
- "gap": "md",
2106
- "justify": "space-between",
2107
- "children": [
2108
- {
2109
- "type": "typography",
2110
- "variant": "caption",
2111
- "content": "ShippingAddress"
2112
- },
2113
- {
2114
- "type": "typography",
2115
- "variant": "body",
2116
- "content": "@entity.shippingAddress"
2117
- }
2118
- ]
2119
- },
2120
- {
2121
- "type": "stack",
2122
- "direction": "horizontal",
2123
- "gap": "md",
2124
- "justify": "space-between",
2125
- "children": [
2126
- {
2127
- "type": "typography",
2128
- "variant": "caption",
2129
- "content": "PaymentMethod"
2130
- },
2131
- {
2132
- "type": "typography",
2133
- "variant": "body",
2134
- "content": "@entity.paymentMethod"
2135
- }
2136
- ]
2137
- },
2138
- {
2139
- "type": "stack",
2140
- "direction": "horizontal",
2141
- "gap": "md",
2142
- "justify": "space-between",
2143
- "children": [
2144
- {
2145
- "type": "typography",
2146
- "variant": "caption",
2147
- "content": "OrderTotal"
2148
- },
2149
- {
2150
- "type": "typography",
2151
- "variant": "body",
2152
- "content": "@entity.orderTotal"
2153
- }
2154
- ]
2155
- },
2156
- {
2157
- "type": "stack",
2158
- "direction": "horizontal",
2159
- "gap": "md",
2160
- "justify": "space-between",
2161
- "children": [
2162
- {
2163
- "type": "typography",
2164
- "variant": "caption",
2165
- "content": "Status"
2166
- },
2167
- {
2168
- "type": "typography",
2169
- "variant": "body",
2170
- "content": "@entity.status"
2171
- }
2172
- ]
2173
- }
2174
- ]
2175
- }
2176
- ]
2177
- },
2178
- {
2179
- "type": "stack",
2180
- "direction": "horizontal",
2181
- "gap": "sm",
2182
- "justify": "end",
2183
- "children": [
2184
- {
2185
- "type": "button",
2186
- "label": "Back",
2187
- "event": "PREV",
2188
- "variant": "ghost",
2189
- "icon": "arrow-left"
2190
- },
2191
- {
2192
- "type": "button",
2193
- "label": "Place Order",
2194
- "event": "COMPLETE",
2195
- "variant": "primary",
2196
- "icon": "check"
2197
- }
1938
+ "type": "form-section",
1939
+ "entity": "CartItem",
1940
+ "mode": "create",
1941
+ "submitEvent": "SAVE",
1942
+ "cancelEvent": "CLOSE",
1943
+ "fields": [
1944
+ "productName",
1945
+ "quantity",
1946
+ "unitPrice",
1947
+ "totalPrice"
2198
1948
  ]
2199
1949
  }
2200
1950
  ]
@@ -2203,9 +1953,169 @@
2203
1953
  ]
2204
1954
  },
2205
1955
  {
2206
- "from": "step2",
1956
+ "from": "open",
1957
+ "to": "closed",
1958
+ "event": "CLOSE",
1959
+ "effects": [
1960
+ [
1961
+ "render-ui",
1962
+ "modal",
1963
+ null
1964
+ ]
1965
+ ]
1966
+ },
1967
+ {
1968
+ "from": "open",
1969
+ "to": "closed",
1970
+ "event": "SAVE",
1971
+ "effects": [
1972
+ [
1973
+ "persist",
1974
+ "create",
1975
+ "CartItem",
1976
+ "@payload.data"
1977
+ ],
1978
+ [
1979
+ "fetch",
1980
+ "CartItem"
1981
+ ],
1982
+ [
1983
+ "render-ui",
1984
+ "modal",
1985
+ null
1986
+ ],
1987
+ [
1988
+ "notify",
1989
+ "CartItem created successfully"
1990
+ ]
1991
+ ]
1992
+ }
1993
+ ]
1994
+ }
1995
+ }
1996
+ ],
1997
+ "pages": [
1998
+ {
1999
+ "name": "CartPage",
2000
+ "path": "/cart",
2001
+ "traits": [
2002
+ {
2003
+ "ref": "CartItemCartBrowse"
2004
+ },
2005
+ {
2006
+ "ref": "CartItemAddItem"
2007
+ }
2008
+ ]
2009
+ }
2010
+ ]
2011
+ },
2012
+ {
2013
+ "name": "CheckoutOrbital",
2014
+ "entity": {
2015
+ "name": "Checkout",
2016
+ "persistence": "runtime",
2017
+ "fields": [
2018
+ {
2019
+ "name": "id",
2020
+ "type": "string",
2021
+ "required": true
2022
+ },
2023
+ {
2024
+ "name": "customerName",
2025
+ "type": "string",
2026
+ "required": true
2027
+ },
2028
+ {
2029
+ "name": "email",
2030
+ "type": "string",
2031
+ "required": true
2032
+ },
2033
+ {
2034
+ "name": "shippingAddress",
2035
+ "type": "string",
2036
+ "required": true
2037
+ },
2038
+ {
2039
+ "name": "paymentMethod",
2040
+ "type": "string",
2041
+ "required": true
2042
+ },
2043
+ {
2044
+ "name": "orderTotal",
2045
+ "type": "number"
2046
+ },
2047
+ {
2048
+ "name": "status",
2049
+ "type": "string",
2050
+ "default": "pending"
2051
+ }
2052
+ ]
2053
+ },
2054
+ "traits": [
2055
+ {
2056
+ "name": "CheckoutWizard",
2057
+ "linkedEntity": "Checkout",
2058
+ "category": "interaction",
2059
+ "stateMachine": {
2060
+ "states": [
2061
+ {
2062
+ "name": "step1",
2063
+ "isInitial": true
2064
+ },
2065
+ {
2066
+ "name": "step2"
2067
+ },
2068
+ {
2069
+ "name": "step3"
2070
+ },
2071
+ {
2072
+ "name": "review"
2073
+ },
2074
+ {
2075
+ "name": "complete"
2076
+ }
2077
+ ],
2078
+ "events": [
2079
+ {
2080
+ "key": "INIT",
2081
+ "name": "Initialize"
2082
+ },
2083
+ {
2084
+ "key": "NEXT",
2085
+ "name": "Next Step",
2086
+ "payload": [
2087
+ {
2088
+ "name": "data",
2089
+ "type": "object",
2090
+ "required": true
2091
+ }
2092
+ ]
2093
+ },
2094
+ {
2095
+ "key": "PREV",
2096
+ "name": "Previous Step"
2097
+ },
2098
+ {
2099
+ "key": "COMPLETE",
2100
+ "name": "Complete Wizard",
2101
+ "payload": [
2102
+ {
2103
+ "name": "data",
2104
+ "type": "object",
2105
+ "required": true
2106
+ }
2107
+ ]
2108
+ },
2109
+ {
2110
+ "key": "RESTART",
2111
+ "name": "Restart Wizard"
2112
+ }
2113
+ ],
2114
+ "transitions": [
2115
+ {
2116
+ "from": "step1",
2207
2117
  "to": "step1",
2208
- "event": "PREV",
2118
+ "event": "INIT",
2209
2119
  "effects": [
2210
2120
  [
2211
2121
  "fetch",
@@ -2238,8 +2148,9 @@
2238
2148
  ]
2239
2149
  },
2240
2150
  {
2241
- "type": "badge",
2242
- "label": "Step 1 of 3"
2151
+ "type": "progress-dots",
2152
+ "count": 3,
2153
+ "currentIndex": 0
2243
2154
  },
2244
2155
  {
2245
2156
  "type": "wizard-progress",
@@ -2290,9 +2201,9 @@
2290
2201
  ]
2291
2202
  },
2292
2203
  {
2293
- "from": "step3",
2204
+ "from": "step1",
2294
2205
  "to": "step2",
2295
- "event": "PREV",
2206
+ "event": "NEXT",
2296
2207
  "effects": [
2297
2208
  [
2298
2209
  "fetch",
@@ -2325,8 +2236,9 @@
2325
2236
  ]
2326
2237
  },
2327
2238
  {
2328
- "type": "badge",
2329
- "label": "Step 2 of 3"
2239
+ "type": "progress-dots",
2240
+ "count": 3,
2241
+ "currentIndex": 1
2330
2242
  },
2331
2243
  {
2332
2244
  "type": "wizard-progress",
@@ -2383,9 +2295,9 @@
2383
2295
  ]
2384
2296
  },
2385
2297
  {
2386
- "from": "review",
2298
+ "from": "step2",
2387
2299
  "to": "step3",
2388
- "event": "PREV",
2300
+ "event": "NEXT",
2389
2301
  "effects": [
2390
2302
  [
2391
2303
  "fetch",
@@ -2418,8 +2330,9 @@
2418
2330
  ]
2419
2331
  },
2420
2332
  {
2421
- "type": "badge",
2422
- "label": "Step 3 of 3"
2333
+ "type": "progress-dots",
2334
+ "count": 3,
2335
+ "currentIndex": 2
2423
2336
  },
2424
2337
  {
2425
2338
  "type": "wizard-progress",
@@ -2476,61 +2389,9 @@
2476
2389
  ]
2477
2390
  },
2478
2391
  {
2479
- "from": "review",
2480
- "to": "complete",
2481
- "event": "COMPLETE",
2482
- "effects": [
2483
- [
2484
- "persist",
2485
- "create",
2486
- "Checkout",
2487
- "@payload.data"
2488
- ],
2489
- [
2490
- "notify",
2491
- "success",
2492
- "Checkout created successfully"
2493
- ],
2494
- [
2495
- "render-ui",
2496
- "main",
2497
- {
2498
- "type": "stack",
2499
- "direction": "vertical",
2500
- "gap": "lg",
2501
- "align": "center",
2502
- "children": [
2503
- {
2504
- "type": "icon",
2505
- "name": "check-circle",
2506
- "size": "lg"
2507
- },
2508
- {
2509
- "type": "typography",
2510
- "content": "Order Placed",
2511
- "variant": "h2"
2512
- },
2513
- {
2514
- "type": "typography",
2515
- "content": "Your order has been placed successfully.",
2516
- "variant": "body"
2517
- },
2518
- {
2519
- "type": "button",
2520
- "label": "Start New",
2521
- "event": "RESTART",
2522
- "variant": "primary",
2523
- "icon": "refresh-cw"
2524
- }
2525
- ]
2526
- }
2527
- ]
2528
- ]
2529
- },
2530
- {
2531
- "from": "complete",
2532
- "to": "step1",
2533
- "event": "RESTART",
2392
+ "from": "step3",
2393
+ "to": "review",
2394
+ "event": "NEXT",
2534
2395
  "effects": [
2535
2396
  [
2536
2397
  "fetch",
@@ -2564,7 +2425,195 @@
2564
2425
  },
2565
2426
  {
2566
2427
  "type": "badge",
2567
- "label": "Step 1 of 3"
2428
+ "label": "Review"
2429
+ },
2430
+ {
2431
+ "type": "wizard-progress",
2432
+ "steps": [
2433
+ "Customer Info",
2434
+ "Shipping",
2435
+ "Payment"
2436
+ ],
2437
+ "currentStep": 3
2438
+ },
2439
+ {
2440
+ "type": "divider"
2441
+ },
2442
+ {
2443
+ "type": "data-list",
2444
+ "entity": "Checkout",
2445
+ "renderItem": [
2446
+ "fn",
2447
+ "item",
2448
+ {
2449
+ "type": "stack",
2450
+ "direction": "vertical",
2451
+ "gap": "sm",
2452
+ "children": [
2453
+ {
2454
+ "type": "stack",
2455
+ "direction": "horizontal",
2456
+ "gap": "md",
2457
+ "justify": "space-between",
2458
+ "children": [
2459
+ {
2460
+ "type": "typography",
2461
+ "variant": "caption",
2462
+ "content": "CustomerName"
2463
+ },
2464
+ {
2465
+ "type": "typography",
2466
+ "variant": "body",
2467
+ "content": "@item.customerName"
2468
+ }
2469
+ ]
2470
+ },
2471
+ {
2472
+ "type": "stack",
2473
+ "direction": "horizontal",
2474
+ "gap": "md",
2475
+ "justify": "space-between",
2476
+ "children": [
2477
+ {
2478
+ "type": "typography",
2479
+ "variant": "caption",
2480
+ "content": "Email"
2481
+ },
2482
+ {
2483
+ "type": "typography",
2484
+ "variant": "body",
2485
+ "content": "@item.email"
2486
+ }
2487
+ ]
2488
+ },
2489
+ {
2490
+ "type": "stack",
2491
+ "direction": "horizontal",
2492
+ "gap": "md",
2493
+ "justify": "space-between",
2494
+ "children": [
2495
+ {
2496
+ "type": "typography",
2497
+ "variant": "caption",
2498
+ "content": "ShippingAddress"
2499
+ },
2500
+ {
2501
+ "type": "typography",
2502
+ "variant": "body",
2503
+ "content": "@item.shippingAddress"
2504
+ }
2505
+ ]
2506
+ },
2507
+ {
2508
+ "type": "stack",
2509
+ "direction": "horizontal",
2510
+ "gap": "md",
2511
+ "justify": "space-between",
2512
+ "children": [
2513
+ {
2514
+ "type": "typography",
2515
+ "variant": "caption",
2516
+ "content": "PaymentMethod"
2517
+ },
2518
+ {
2519
+ "type": "typography",
2520
+ "variant": "body",
2521
+ "content": "@item.paymentMethod"
2522
+ }
2523
+ ]
2524
+ },
2525
+ {
2526
+ "type": "stack",
2527
+ "direction": "horizontal",
2528
+ "gap": "md",
2529
+ "justify": "space-between",
2530
+ "children": [
2531
+ {
2532
+ "type": "typography",
2533
+ "variant": "caption",
2534
+ "content": "OrderTotal"
2535
+ },
2536
+ {
2537
+ "type": "typography",
2538
+ "variant": "body",
2539
+ "content": "@item.orderTotal"
2540
+ }
2541
+ ]
2542
+ },
2543
+ {
2544
+ "type": "stack",
2545
+ "direction": "horizontal",
2546
+ "gap": "md",
2547
+ "justify": "space-between",
2548
+ "children": [
2549
+ {
2550
+ "type": "typography",
2551
+ "variant": "caption",
2552
+ "content": "Status"
2553
+ },
2554
+ {
2555
+ "type": "typography",
2556
+ "variant": "body",
2557
+ "content": "@item.status"
2558
+ }
2559
+ ]
2560
+ }
2561
+ ]
2562
+ }
2563
+ ]
2564
+ },
2565
+ {
2566
+ "type": "wizard-navigation",
2567
+ "currentStep": 3,
2568
+ "totalSteps": 4,
2569
+ "showBack": true,
2570
+ "showComplete": true,
2571
+ "showNext": false
2572
+ }
2573
+ ]
2574
+ }
2575
+ ]
2576
+ ]
2577
+ },
2578
+ {
2579
+ "from": "step2",
2580
+ "to": "step1",
2581
+ "event": "PREV",
2582
+ "effects": [
2583
+ [
2584
+ "fetch",
2585
+ "Checkout"
2586
+ ],
2587
+ [
2588
+ "render-ui",
2589
+ "main",
2590
+ {
2591
+ "type": "stack",
2592
+ "direction": "vertical",
2593
+ "gap": "lg",
2594
+ "children": [
2595
+ {
2596
+ "type": "stack",
2597
+ "direction": "horizontal",
2598
+ "gap": "sm",
2599
+ "align": "center",
2600
+ "children": [
2601
+ {
2602
+ "type": "icon",
2603
+ "name": "credit-card",
2604
+ "size": "lg"
2605
+ },
2606
+ {
2607
+ "type": "typography",
2608
+ "content": "Checkout",
2609
+ "variant": "h2"
2610
+ }
2611
+ ]
2612
+ },
2613
+ {
2614
+ "type": "progress-dots",
2615
+ "count": 3,
2616
+ "currentIndex": 0
2568
2617
  },
2569
2618
  {
2570
2619
  "type": "wizard-progress",
@@ -2615,9 +2664,9 @@
2615
2664
  ]
2616
2665
  },
2617
2666
  {
2618
- "from": "complete",
2619
- "to": "step1",
2620
- "event": "INIT",
2667
+ "from": "step3",
2668
+ "to": "step2",
2669
+ "event": "PREV",
2621
2670
  "effects": [
2622
2671
  [
2623
2672
  "fetch",
@@ -2650,8 +2699,9 @@
2650
2699
  ]
2651
2700
  },
2652
2701
  {
2653
- "type": "badge",
2654
- "label": "Step 1 of 3"
2702
+ "type": "progress-dots",
2703
+ "count": 3,
2704
+ "currentIndex": 1
2655
2705
  },
2656
2706
  {
2657
2707
  "type": "wizard-progress",
@@ -2660,14 +2710,14 @@
2660
2710
  "Shipping",
2661
2711
  "Payment"
2662
2712
  ],
2663
- "currentStep": 0
2713
+ "currentStep": 1
2664
2714
  },
2665
2715
  {
2666
2716
  "type": "divider"
2667
2717
  },
2668
2718
  {
2669
2719
  "type": "typography",
2670
- "content": "Customer Info",
2720
+ "content": "Shipping",
2671
2721
  "variant": "h3"
2672
2722
  },
2673
2723
  {
@@ -2675,10 +2725,9 @@
2675
2725
  "entity": "Checkout",
2676
2726
  "mode": "create",
2677
2727
  "submitEvent": "NEXT",
2678
- "cancelEvent": "INIT",
2728
+ "cancelEvent": "PREV",
2679
2729
  "fields": [
2680
- "customerName",
2681
- "email"
2730
+ "shippingAddress"
2682
2731
  ]
2683
2732
  },
2684
2733
  {
@@ -2687,6 +2736,13 @@
2687
2736
  "gap": "sm",
2688
2737
  "justify": "end",
2689
2738
  "children": [
2739
+ {
2740
+ "type": "button",
2741
+ "label": "Back",
2742
+ "event": "PREV",
2743
+ "variant": "ghost",
2744
+ "icon": "arrow-left"
2745
+ },
2690
2746
  {
2691
2747
  "type": "button",
2692
2748
  "label": "Next",
@@ -2700,69 +2756,391 @@
2700
2756
  }
2701
2757
  ]
2702
2758
  ]
2703
- }
2704
- ]
2705
- },
2706
- "listens": [
2707
- {
2708
- "event": "CHECKOUT_STARTED",
2709
- "triggers": "INIT",
2710
- "scope": "external"
2711
- }
2712
- ],
2713
- "emits": [
2714
- {
2715
- "event": "ORDER_PLACED",
2716
- "payload": [
2717
- {
2718
- "name": "id",
2719
- "type": "string",
2720
- "required": true
2721
- }
2722
- ],
2723
- "scope": "external"
2724
- }
2725
- ]
2726
- }
2727
- ],
2728
- "pages": [
2729
- {
2730
- "name": "CheckoutPage",
2731
- "path": "/checkout",
2732
- "traits": [
2733
- {
2734
- "ref": "CheckoutWizard"
2735
- }
2736
- ]
2737
- }
2738
- ]
2739
- },
2740
- {
2741
- "name": "OrderRecordOrbital",
2742
- "entity": {
2743
- "name": "OrderRecord",
2744
- "persistence": "persistent",
2745
- "collection": "orderrecords",
2746
- "fields": [
2747
- {
2748
- "name": "id",
2749
- "type": "string",
2750
- "required": true
2751
- },
2752
- {
2753
- "name": "customerName",
2754
- "type": "string",
2755
- "required": true
2756
- },
2757
- {
2758
- "name": "email",
2759
- "type": "string",
2760
- "required": true
2761
- },
2762
- {
2763
- "name": "shippingAddress",
2764
- "type": "string",
2765
- "required": true
2759
+ },
2760
+ {
2761
+ "from": "review",
2762
+ "to": "step3",
2763
+ "event": "PREV",
2764
+ "effects": [
2765
+ [
2766
+ "fetch",
2767
+ "Checkout"
2768
+ ],
2769
+ [
2770
+ "render-ui",
2771
+ "main",
2772
+ {
2773
+ "type": "stack",
2774
+ "direction": "vertical",
2775
+ "gap": "lg",
2776
+ "children": [
2777
+ {
2778
+ "type": "stack",
2779
+ "direction": "horizontal",
2780
+ "gap": "sm",
2781
+ "align": "center",
2782
+ "children": [
2783
+ {
2784
+ "type": "icon",
2785
+ "name": "credit-card",
2786
+ "size": "lg"
2787
+ },
2788
+ {
2789
+ "type": "typography",
2790
+ "content": "Checkout",
2791
+ "variant": "h2"
2792
+ }
2793
+ ]
2794
+ },
2795
+ {
2796
+ "type": "progress-dots",
2797
+ "count": 3,
2798
+ "currentIndex": 2
2799
+ },
2800
+ {
2801
+ "type": "wizard-progress",
2802
+ "steps": [
2803
+ "Customer Info",
2804
+ "Shipping",
2805
+ "Payment"
2806
+ ],
2807
+ "currentStep": 2
2808
+ },
2809
+ {
2810
+ "type": "divider"
2811
+ },
2812
+ {
2813
+ "type": "typography",
2814
+ "content": "Payment",
2815
+ "variant": "h3"
2816
+ },
2817
+ {
2818
+ "type": "form-section",
2819
+ "entity": "Checkout",
2820
+ "mode": "create",
2821
+ "submitEvent": "NEXT",
2822
+ "cancelEvent": "PREV",
2823
+ "fields": [
2824
+ "paymentMethod"
2825
+ ]
2826
+ },
2827
+ {
2828
+ "type": "stack",
2829
+ "direction": "horizontal",
2830
+ "gap": "sm",
2831
+ "justify": "end",
2832
+ "children": [
2833
+ {
2834
+ "type": "button",
2835
+ "label": "Back",
2836
+ "event": "PREV",
2837
+ "variant": "ghost",
2838
+ "icon": "arrow-left"
2839
+ },
2840
+ {
2841
+ "type": "button",
2842
+ "label": "Next",
2843
+ "event": "NEXT",
2844
+ "variant": "primary",
2845
+ "icon": "arrow-right"
2846
+ }
2847
+ ]
2848
+ }
2849
+ ]
2850
+ }
2851
+ ]
2852
+ ]
2853
+ },
2854
+ {
2855
+ "from": "review",
2856
+ "to": "complete",
2857
+ "event": "COMPLETE",
2858
+ "effects": [
2859
+ [
2860
+ "persist",
2861
+ "create",
2862
+ "Checkout",
2863
+ "@payload.data"
2864
+ ],
2865
+ [
2866
+ "notify",
2867
+ "success",
2868
+ "Checkout created successfully"
2869
+ ],
2870
+ [
2871
+ "render-ui",
2872
+ "main",
2873
+ {
2874
+ "type": "stack",
2875
+ "direction": "vertical",
2876
+ "gap": "lg",
2877
+ "align": "center",
2878
+ "children": [
2879
+ {
2880
+ "type": "icon",
2881
+ "name": "check-circle",
2882
+ "size": "lg"
2883
+ },
2884
+ {
2885
+ "type": "typography",
2886
+ "content": "Order Placed",
2887
+ "variant": "h2"
2888
+ },
2889
+ {
2890
+ "type": "typography",
2891
+ "content": "Your order has been placed successfully.",
2892
+ "variant": "body"
2893
+ },
2894
+ {
2895
+ "type": "button",
2896
+ "label": "Start New",
2897
+ "event": "RESTART",
2898
+ "variant": "primary",
2899
+ "icon": "refresh-cw"
2900
+ }
2901
+ ]
2902
+ }
2903
+ ]
2904
+ ]
2905
+ },
2906
+ {
2907
+ "from": "complete",
2908
+ "to": "step1",
2909
+ "event": "RESTART",
2910
+ "effects": [
2911
+ [
2912
+ "fetch",
2913
+ "Checkout"
2914
+ ],
2915
+ [
2916
+ "render-ui",
2917
+ "main",
2918
+ {
2919
+ "type": "stack",
2920
+ "direction": "vertical",
2921
+ "gap": "lg",
2922
+ "children": [
2923
+ {
2924
+ "type": "stack",
2925
+ "direction": "horizontal",
2926
+ "gap": "sm",
2927
+ "align": "center",
2928
+ "children": [
2929
+ {
2930
+ "type": "icon",
2931
+ "name": "credit-card",
2932
+ "size": "lg"
2933
+ },
2934
+ {
2935
+ "type": "typography",
2936
+ "content": "Checkout",
2937
+ "variant": "h2"
2938
+ }
2939
+ ]
2940
+ },
2941
+ {
2942
+ "type": "progress-dots",
2943
+ "count": 3,
2944
+ "currentIndex": 0
2945
+ },
2946
+ {
2947
+ "type": "wizard-progress",
2948
+ "steps": [
2949
+ "Customer Info",
2950
+ "Shipping",
2951
+ "Payment"
2952
+ ],
2953
+ "currentStep": 0
2954
+ },
2955
+ {
2956
+ "type": "divider"
2957
+ },
2958
+ {
2959
+ "type": "typography",
2960
+ "content": "Customer Info",
2961
+ "variant": "h3"
2962
+ },
2963
+ {
2964
+ "type": "form-section",
2965
+ "entity": "Checkout",
2966
+ "mode": "create",
2967
+ "submitEvent": "NEXT",
2968
+ "cancelEvent": "INIT",
2969
+ "fields": [
2970
+ "customerName",
2971
+ "email"
2972
+ ]
2973
+ },
2974
+ {
2975
+ "type": "stack",
2976
+ "direction": "horizontal",
2977
+ "gap": "sm",
2978
+ "justify": "end",
2979
+ "children": [
2980
+ {
2981
+ "type": "button",
2982
+ "label": "Next",
2983
+ "event": "NEXT",
2984
+ "variant": "primary",
2985
+ "icon": "arrow-right"
2986
+ }
2987
+ ]
2988
+ }
2989
+ ]
2990
+ }
2991
+ ]
2992
+ ]
2993
+ },
2994
+ {
2995
+ "from": "complete",
2996
+ "to": "step1",
2997
+ "event": "INIT",
2998
+ "effects": [
2999
+ [
3000
+ "fetch",
3001
+ "Checkout"
3002
+ ],
3003
+ [
3004
+ "render-ui",
3005
+ "main",
3006
+ {
3007
+ "type": "stack",
3008
+ "direction": "vertical",
3009
+ "gap": "lg",
3010
+ "children": [
3011
+ {
3012
+ "type": "stack",
3013
+ "direction": "horizontal",
3014
+ "gap": "sm",
3015
+ "align": "center",
3016
+ "children": [
3017
+ {
3018
+ "type": "icon",
3019
+ "name": "credit-card",
3020
+ "size": "lg"
3021
+ },
3022
+ {
3023
+ "type": "typography",
3024
+ "content": "Checkout",
3025
+ "variant": "h2"
3026
+ }
3027
+ ]
3028
+ },
3029
+ {
3030
+ "type": "progress-dots",
3031
+ "count": 3,
3032
+ "currentIndex": 0
3033
+ },
3034
+ {
3035
+ "type": "wizard-progress",
3036
+ "steps": [
3037
+ "Customer Info",
3038
+ "Shipping",
3039
+ "Payment"
3040
+ ],
3041
+ "currentStep": 0
3042
+ },
3043
+ {
3044
+ "type": "divider"
3045
+ },
3046
+ {
3047
+ "type": "typography",
3048
+ "content": "Customer Info",
3049
+ "variant": "h3"
3050
+ },
3051
+ {
3052
+ "type": "form-section",
3053
+ "entity": "Checkout",
3054
+ "mode": "create",
3055
+ "submitEvent": "NEXT",
3056
+ "cancelEvent": "INIT",
3057
+ "fields": [
3058
+ "customerName",
3059
+ "email"
3060
+ ]
3061
+ },
3062
+ {
3063
+ "type": "stack",
3064
+ "direction": "horizontal",
3065
+ "gap": "sm",
3066
+ "justify": "end",
3067
+ "children": [
3068
+ {
3069
+ "type": "button",
3070
+ "label": "Next",
3071
+ "event": "NEXT",
3072
+ "variant": "primary",
3073
+ "icon": "arrow-right"
3074
+ }
3075
+ ]
3076
+ }
3077
+ ]
3078
+ }
3079
+ ]
3080
+ ]
3081
+ }
3082
+ ]
3083
+ },
3084
+ "listens": [
3085
+ {
3086
+ "event": "CHECKOUT_STARTED",
3087
+ "triggers": "INIT",
3088
+ "scope": "external"
3089
+ }
3090
+ ],
3091
+ "emits": [
3092
+ {
3093
+ "event": "ORDER_PLACED",
3094
+ "payload": [
3095
+ {
3096
+ "name": "id",
3097
+ "type": "string",
3098
+ "required": true
3099
+ }
3100
+ ],
3101
+ "scope": "external"
3102
+ }
3103
+ ]
3104
+ }
3105
+ ],
3106
+ "pages": [
3107
+ {
3108
+ "name": "CheckoutPage",
3109
+ "path": "/checkout",
3110
+ "traits": [
3111
+ {
3112
+ "ref": "CheckoutWizard"
3113
+ }
3114
+ ]
3115
+ }
3116
+ ]
3117
+ },
3118
+ {
3119
+ "name": "OrderRecordOrbital",
3120
+ "entity": {
3121
+ "name": "OrderRecord",
3122
+ "persistence": "persistent",
3123
+ "collection": "orderrecords",
3124
+ "fields": [
3125
+ {
3126
+ "name": "id",
3127
+ "type": "string",
3128
+ "required": true
3129
+ },
3130
+ {
3131
+ "name": "customerName",
3132
+ "type": "string",
3133
+ "required": true
3134
+ },
3135
+ {
3136
+ "name": "email",
3137
+ "type": "string",
3138
+ "required": true
3139
+ },
3140
+ {
3141
+ "name": "shippingAddress",
3142
+ "type": "string",
3143
+ "required": true
2766
3144
  },
2767
3145
  {
2768
3146
  "name": "paymentMethod",
@@ -2831,68 +3209,449 @@
2831
3209
  ]
2832
3210
  },
2833
3211
  {
2834
- "key": "EDIT",
2835
- "name": "EDIT",
2836
- "payload": [
2837
- {
2838
- "name": "id",
2839
- "type": "string",
2840
- "required": true
2841
- }
3212
+ "key": "EDIT",
3213
+ "name": "EDIT",
3214
+ "payload": [
3215
+ {
3216
+ "name": "id",
3217
+ "type": "string",
3218
+ "required": true
3219
+ }
3220
+ ]
3221
+ },
3222
+ {
3223
+ "key": "DELETE",
3224
+ "name": "DELETE",
3225
+ "payload": [
3226
+ {
3227
+ "name": "id",
3228
+ "type": "string",
3229
+ "required": true
3230
+ }
3231
+ ]
3232
+ },
3233
+ {
3234
+ "key": "ORDER_RECORD_CREATED",
3235
+ "name": "ORDER_RECORD_CREATED",
3236
+ "payload": [
3237
+ {
3238
+ "name": "data",
3239
+ "type": "object",
3240
+ "required": true
3241
+ }
3242
+ ]
3243
+ },
3244
+ {
3245
+ "key": "ORDER_RECORD_UPDATED",
3246
+ "name": "ORDER_RECORD_UPDATED",
3247
+ "payload": [
3248
+ {
3249
+ "name": "data",
3250
+ "type": "object",
3251
+ "required": true
3252
+ }
3253
+ ]
3254
+ },
3255
+ {
3256
+ "key": "CONFIRM_DELETE",
3257
+ "name": "Confirm Delete"
3258
+ },
3259
+ {
3260
+ "key": "CANCEL",
3261
+ "name": "Cancel"
3262
+ },
3263
+ {
3264
+ "key": "CLOSE",
3265
+ "name": "Close"
3266
+ }
3267
+ ],
3268
+ "transitions": [
3269
+ {
3270
+ "from": "browsing",
3271
+ "to": "browsing",
3272
+ "event": "INIT",
3273
+ "effects": [
3274
+ [
3275
+ "fetch",
3276
+ "OrderRecord"
3277
+ ],
3278
+ [
3279
+ "render-ui",
3280
+ "main",
3281
+ {
3282
+ "type": "stack",
3283
+ "direction": "vertical",
3284
+ "gap": "lg",
3285
+ "children": [
3286
+ {
3287
+ "type": "stack",
3288
+ "direction": "horizontal",
3289
+ "gap": "md",
3290
+ "justify": "space-between",
3291
+ "children": [
3292
+ {
3293
+ "type": "stack",
3294
+ "direction": "horizontal",
3295
+ "gap": "sm",
3296
+ "align": "center",
3297
+ "children": [
3298
+ {
3299
+ "type": "icon",
3300
+ "name": "clipboard-list",
3301
+ "size": "lg"
3302
+ },
3303
+ {
3304
+ "type": "typography",
3305
+ "content": "Order History",
3306
+ "variant": "h2"
3307
+ }
3308
+ ]
3309
+ },
3310
+ {
3311
+ "type": "stack",
3312
+ "direction": "horizontal",
3313
+ "gap": "sm",
3314
+ "children": [
3315
+ {
3316
+ "type": "button",
3317
+ "label": "Create OrderRecord",
3318
+ "event": "CREATE",
3319
+ "variant": "primary",
3320
+ "icon": "plus"
3321
+ }
3322
+ ]
3323
+ }
3324
+ ]
3325
+ },
3326
+ {
3327
+ "type": "divider"
3328
+ },
3329
+ {
3330
+ "type": "data-grid",
3331
+ "entity": "OrderRecord",
3332
+ "emptyIcon": "inbox",
3333
+ "emptyTitle": "No orderrecords yet",
3334
+ "emptyDescription": "Create your first orderrecord to get started.",
3335
+ "itemActions": [
3336
+ {
3337
+ "label": "View",
3338
+ "event": "VIEW"
3339
+ },
3340
+ {
3341
+ "label": "Edit",
3342
+ "event": "EDIT"
3343
+ },
3344
+ {
3345
+ "label": "Delete",
3346
+ "event": "DELETE",
3347
+ "variant": "danger"
3348
+ }
3349
+ ],
3350
+ "className": "transition-shadow hover:shadow-md cursor-pointer",
3351
+ "renderItem": [
3352
+ "fn",
3353
+ "item",
3354
+ {
3355
+ "type": "stack",
3356
+ "direction": "vertical",
3357
+ "gap": "sm",
3358
+ "children": [
3359
+ {
3360
+ "type": "stack",
3361
+ "direction": "horizontal",
3362
+ "justify": "space-between",
3363
+ "align": "center",
3364
+ "children": [
3365
+ {
3366
+ "type": "stack",
3367
+ "direction": "horizontal",
3368
+ "gap": "sm",
3369
+ "align": "center",
3370
+ "children": [
3371
+ {
3372
+ "type": "icon",
3373
+ "name": "clipboard-list",
3374
+ "size": "sm"
3375
+ },
3376
+ {
3377
+ "type": "typography",
3378
+ "variant": "h4",
3379
+ "content": "@item.customerName"
3380
+ }
3381
+ ]
3382
+ },
3383
+ {
3384
+ "type": "badge",
3385
+ "label": "@item.email"
3386
+ }
3387
+ ]
3388
+ },
3389
+ {
3390
+ "type": "typography",
3391
+ "variant": "caption",
3392
+ "color": "muted",
3393
+ "content": "@item.shippingAddress"
3394
+ }
3395
+ ]
3396
+ }
3397
+ ]
3398
+ }
3399
+ ]
3400
+ }
3401
+ ]
3402
+ ]
3403
+ },
3404
+ {
3405
+ "from": "browsing",
3406
+ "to": "browsing",
3407
+ "event": "ORDER_RECORD_CREATED",
3408
+ "effects": [
3409
+ [
3410
+ "fetch",
3411
+ "OrderRecord"
3412
+ ]
2842
3413
  ]
2843
3414
  },
2844
3415
  {
2845
- "key": "DELETE",
2846
- "name": "DELETE",
2847
- "payload": [
2848
- {
2849
- "name": "id",
2850
- "type": "string",
2851
- "required": true
2852
- }
3416
+ "from": "browsing",
3417
+ "to": "browsing",
3418
+ "event": "ORDER_RECORD_UPDATED",
3419
+ "effects": [
3420
+ [
3421
+ "fetch",
3422
+ "OrderRecord"
3423
+ ]
2853
3424
  ]
2854
3425
  },
2855
3426
  {
2856
- "key": "ORDER_RECORD_CREATED",
2857
- "name": "ORDER_RECORD_CREATED",
2858
- "payload": [
2859
- {
2860
- "name": "data",
2861
- "type": "object",
2862
- "required": true
2863
- }
3427
+ "from": "browsing",
3428
+ "to": "deleting",
3429
+ "event": "DELETE",
3430
+ "effects": [
3431
+ [
3432
+ "fetch",
3433
+ "OrderRecord",
3434
+ "@payload.id"
3435
+ ],
3436
+ [
3437
+ "render-ui",
3438
+ "modal",
3439
+ {
3440
+ "type": "stack",
3441
+ "direction": "vertical",
3442
+ "gap": "md",
3443
+ "children": [
3444
+ {
3445
+ "type": "stack",
3446
+ "direction": "horizontal",
3447
+ "gap": "sm",
3448
+ "children": [
3449
+ {
3450
+ "type": "icon",
3451
+ "name": "trash-2",
3452
+ "size": "md"
3453
+ },
3454
+ {
3455
+ "type": "typography",
3456
+ "content": "Delete OrderRecord",
3457
+ "variant": "h3"
3458
+ }
3459
+ ]
3460
+ },
3461
+ {
3462
+ "type": "divider"
3463
+ },
3464
+ {
3465
+ "type": "typography",
3466
+ "content": "Are you sure you want to delete this orderrecord?",
3467
+ "variant": "body"
3468
+ },
3469
+ {
3470
+ "type": "stack",
3471
+ "direction": "horizontal",
3472
+ "gap": "sm",
3473
+ "justify": "end",
3474
+ "children": [
3475
+ {
3476
+ "type": "button",
3477
+ "label": "Cancel",
3478
+ "event": "CANCEL",
3479
+ "variant": "ghost"
3480
+ },
3481
+ {
3482
+ "type": "button",
3483
+ "label": "Delete",
3484
+ "event": "CONFIRM_DELETE",
3485
+ "variant": "danger",
3486
+ "icon": "trash"
3487
+ }
3488
+ ]
3489
+ }
3490
+ ]
3491
+ }
3492
+ ]
2864
3493
  ]
2865
3494
  },
2866
3495
  {
2867
- "key": "ORDER_RECORD_UPDATED",
2868
- "name": "ORDER_RECORD_UPDATED",
2869
- "payload": [
2870
- {
2871
- "name": "data",
2872
- "type": "object",
2873
- "required": true
2874
- }
3496
+ "from": "deleting",
3497
+ "to": "browsing",
3498
+ "event": "CONFIRM_DELETE",
3499
+ "effects": [
3500
+ [
3501
+ "persist",
3502
+ "delete",
3503
+ "OrderRecord",
3504
+ "@entity.id"
3505
+ ],
3506
+ [
3507
+ "render-ui",
3508
+ "modal",
3509
+ null
3510
+ ],
3511
+ [
3512
+ "fetch",
3513
+ "OrderRecord"
3514
+ ],
3515
+ [
3516
+ "render-ui",
3517
+ "main",
3518
+ {
3519
+ "type": "stack",
3520
+ "direction": "vertical",
3521
+ "gap": "lg",
3522
+ "children": [
3523
+ {
3524
+ "type": "stack",
3525
+ "direction": "horizontal",
3526
+ "gap": "md",
3527
+ "justify": "space-between",
3528
+ "children": [
3529
+ {
3530
+ "type": "stack",
3531
+ "direction": "horizontal",
3532
+ "gap": "sm",
3533
+ "align": "center",
3534
+ "children": [
3535
+ {
3536
+ "type": "icon",
3537
+ "name": "clipboard-list",
3538
+ "size": "lg"
3539
+ },
3540
+ {
3541
+ "type": "typography",
3542
+ "content": "Order History",
3543
+ "variant": "h2"
3544
+ }
3545
+ ]
3546
+ },
3547
+ {
3548
+ "type": "stack",
3549
+ "direction": "horizontal",
3550
+ "gap": "sm",
3551
+ "children": [
3552
+ {
3553
+ "type": "button",
3554
+ "label": "Create OrderRecord",
3555
+ "event": "CREATE",
3556
+ "variant": "primary",
3557
+ "icon": "plus"
3558
+ }
3559
+ ]
3560
+ }
3561
+ ]
3562
+ },
3563
+ {
3564
+ "type": "divider"
3565
+ },
3566
+ {
3567
+ "type": "data-grid",
3568
+ "entity": "OrderRecord",
3569
+ "emptyIcon": "inbox",
3570
+ "emptyTitle": "No orderrecords yet",
3571
+ "emptyDescription": "Create your first orderrecord to get started.",
3572
+ "itemActions": [
3573
+ {
3574
+ "label": "View",
3575
+ "event": "VIEW"
3576
+ },
3577
+ {
3578
+ "label": "Edit",
3579
+ "event": "EDIT"
3580
+ },
3581
+ {
3582
+ "label": "Delete",
3583
+ "event": "DELETE",
3584
+ "variant": "danger"
3585
+ }
3586
+ ],
3587
+ "className": "transition-shadow hover:shadow-md cursor-pointer",
3588
+ "renderItem": [
3589
+ "fn",
3590
+ "item",
3591
+ {
3592
+ "type": "stack",
3593
+ "direction": "vertical",
3594
+ "gap": "sm",
3595
+ "children": [
3596
+ {
3597
+ "type": "stack",
3598
+ "direction": "horizontal",
3599
+ "justify": "space-between",
3600
+ "align": "center",
3601
+ "children": [
3602
+ {
3603
+ "type": "stack",
3604
+ "direction": "horizontal",
3605
+ "gap": "sm",
3606
+ "align": "center",
3607
+ "children": [
3608
+ {
3609
+ "type": "icon",
3610
+ "name": "clipboard-list",
3611
+ "size": "sm"
3612
+ },
3613
+ {
3614
+ "type": "typography",
3615
+ "variant": "h4",
3616
+ "content": "@item.customerName"
3617
+ }
3618
+ ]
3619
+ },
3620
+ {
3621
+ "type": "badge",
3622
+ "label": "@item.email"
3623
+ }
3624
+ ]
3625
+ },
3626
+ {
3627
+ "type": "typography",
3628
+ "variant": "caption",
3629
+ "color": "muted",
3630
+ "content": "@item.shippingAddress"
3631
+ }
3632
+ ]
3633
+ }
3634
+ ]
3635
+ }
3636
+ ]
3637
+ }
3638
+ ],
3639
+ [
3640
+ "notify",
3641
+ "OrderRecord deleted successfully"
3642
+ ]
2875
3643
  ]
2876
3644
  },
2877
3645
  {
2878
- "key": "CONFIRM_DELETE",
2879
- "name": "Confirm Delete"
2880
- },
2881
- {
2882
- "key": "CANCEL",
2883
- "name": "Cancel"
2884
- },
2885
- {
2886
- "key": "CLOSE",
2887
- "name": "Close"
2888
- }
2889
- ],
2890
- "transitions": [
2891
- {
2892
- "from": "browsing",
3646
+ "from": "deleting",
2893
3647
  "to": "browsing",
2894
- "event": "INIT",
3648
+ "event": "CANCEL",
2895
3649
  "effects": [
3650
+ [
3651
+ "render-ui",
3652
+ "modal",
3653
+ null
3654
+ ],
2896
3655
  [
2897
3656
  "fetch",
2898
3657
  "OrderRecord"
@@ -2970,7 +3729,9 @@
2970
3729
  }
2971
3730
  ],
2972
3731
  "className": "transition-shadow hover:shadow-md cursor-pointer",
2973
- "children": [
3732
+ "renderItem": [
3733
+ "fn",
3734
+ "item",
2974
3735
  {
2975
3736
  "type": "stack",
2976
3737
  "direction": "vertical",
@@ -2996,13 +3757,13 @@
2996
3757
  {
2997
3758
  "type": "typography",
2998
3759
  "variant": "h4",
2999
- "content": "@entity.customerName"
3760
+ "content": "@item.customerName"
3000
3761
  }
3001
3762
  ]
3002
3763
  },
3003
3764
  {
3004
3765
  "type": "badge",
3005
- "label": "@entity.email"
3766
+ "label": "@item.email"
3006
3767
  }
3007
3768
  ]
3008
3769
  },
@@ -3010,7 +3771,7 @@
3010
3771
  "type": "typography",
3011
3772
  "variant": "caption",
3012
3773
  "color": "muted",
3013
- "content": "@entity.shippingAddress"
3774
+ "content": "@item.shippingAddress"
3014
3775
  }
3015
3776
  ]
3016
3777
  }
@@ -3022,59 +3783,64 @@
3022
3783
  ]
3023
3784
  },
3024
3785
  {
3025
- "from": "browsing",
3786
+ "from": "deleting",
3026
3787
  "to": "browsing",
3027
- "event": "ORDER_RECORD_CREATED",
3788
+ "event": "CLOSE",
3028
3789
  "effects": [
3029
3790
  [
3030
- "fetch",
3031
- "OrderRecord"
3032
- ]
3033
- ]
3034
- },
3035
- {
3036
- "from": "browsing",
3037
- "to": "browsing",
3038
- "event": "ORDER_RECORD_UPDATED",
3039
- "effects": [
3791
+ "render-ui",
3792
+ "modal",
3793
+ null
3794
+ ],
3040
3795
  [
3041
3796
  "fetch",
3042
3797
  "OrderRecord"
3043
- ]
3044
- ]
3045
- },
3046
- {
3047
- "from": "browsing",
3048
- "to": "deleting",
3049
- "event": "DELETE",
3050
- "effects": [
3051
- [
3052
- "fetch",
3053
- "OrderRecord",
3054
- "@payload.id"
3055
3798
  ],
3056
3799
  [
3057
3800
  "render-ui",
3058
- "modal",
3801
+ "main",
3059
3802
  {
3060
3803
  "type": "stack",
3061
3804
  "direction": "vertical",
3062
- "gap": "md",
3805
+ "gap": "lg",
3063
3806
  "children": [
3064
3807
  {
3065
3808
  "type": "stack",
3066
3809
  "direction": "horizontal",
3067
- "gap": "sm",
3810
+ "gap": "md",
3811
+ "justify": "space-between",
3068
3812
  "children": [
3069
3813
  {
3070
- "type": "icon",
3071
- "name": "trash-2",
3072
- "size": "md"
3814
+ "type": "stack",
3815
+ "direction": "horizontal",
3816
+ "gap": "sm",
3817
+ "align": "center",
3818
+ "children": [
3819
+ {
3820
+ "type": "icon",
3821
+ "name": "clipboard-list",
3822
+ "size": "lg"
3823
+ },
3824
+ {
3825
+ "type": "typography",
3826
+ "content": "Order History",
3827
+ "variant": "h2"
3828
+ }
3829
+ ]
3073
3830
  },
3074
3831
  {
3075
- "type": "typography",
3076
- "content": "Delete OrderRecord",
3077
- "variant": "h3"
3832
+ "type": "stack",
3833
+ "direction": "horizontal",
3834
+ "gap": "sm",
3835
+ "children": [
3836
+ {
3837
+ "type": "button",
3838
+ "label": "Create OrderRecord",
3839
+ "event": "CREATE",
3840
+ "variant": "primary",
3841
+ "icon": "plus"
3842
+ }
3843
+ ]
3078
3844
  }
3079
3845
  ]
3080
3846
  },
@@ -3082,28 +3848,72 @@
3082
3848
  "type": "divider"
3083
3849
  },
3084
3850
  {
3085
- "type": "typography",
3086
- "content": "Are you sure you want to delete this orderrecord?",
3087
- "variant": "body"
3088
- },
3089
- {
3090
- "type": "stack",
3091
- "direction": "horizontal",
3092
- "gap": "sm",
3093
- "justify": "end",
3094
- "children": [
3851
+ "type": "data-grid",
3852
+ "entity": "OrderRecord",
3853
+ "emptyIcon": "inbox",
3854
+ "emptyTitle": "No orderrecords yet",
3855
+ "emptyDescription": "Create your first orderrecord to get started.",
3856
+ "itemActions": [
3095
3857
  {
3096
- "type": "button",
3097
- "label": "Cancel",
3098
- "event": "CANCEL",
3099
- "variant": "ghost"
3858
+ "label": "View",
3859
+ "event": "VIEW"
3860
+ },
3861
+ {
3862
+ "label": "Edit",
3863
+ "event": "EDIT"
3100
3864
  },
3101
3865
  {
3102
- "type": "button",
3103
3866
  "label": "Delete",
3104
- "event": "CONFIRM_DELETE",
3105
- "variant": "danger",
3106
- "icon": "trash"
3867
+ "event": "DELETE",
3868
+ "variant": "danger"
3869
+ }
3870
+ ],
3871
+ "className": "transition-shadow hover:shadow-md cursor-pointer",
3872
+ "renderItem": [
3873
+ "fn",
3874
+ "item",
3875
+ {
3876
+ "type": "stack",
3877
+ "direction": "vertical",
3878
+ "gap": "sm",
3879
+ "children": [
3880
+ {
3881
+ "type": "stack",
3882
+ "direction": "horizontal",
3883
+ "justify": "space-between",
3884
+ "align": "center",
3885
+ "children": [
3886
+ {
3887
+ "type": "stack",
3888
+ "direction": "horizontal",
3889
+ "gap": "sm",
3890
+ "align": "center",
3891
+ "children": [
3892
+ {
3893
+ "type": "icon",
3894
+ "name": "clipboard-list",
3895
+ "size": "sm"
3896
+ },
3897
+ {
3898
+ "type": "typography",
3899
+ "variant": "h4",
3900
+ "content": "@item.customerName"
3901
+ }
3902
+ ]
3903
+ },
3904
+ {
3905
+ "type": "badge",
3906
+ "label": "@item.email"
3907
+ }
3908
+ ]
3909
+ },
3910
+ {
3911
+ "type": "typography",
3912
+ "variant": "caption",
3913
+ "color": "muted",
3914
+ "content": "@item.shippingAddress"
3915
+ }
3916
+ ]
3107
3917
  }
3108
3918
  ]
3109
3919
  }
@@ -3111,56 +3921,6 @@
3111
3921
  }
3112
3922
  ]
3113
3923
  ]
3114
- },
3115
- {
3116
- "from": "deleting",
3117
- "to": "browsing",
3118
- "event": "CONFIRM_DELETE",
3119
- "effects": [
3120
- [
3121
- "persist",
3122
- "delete",
3123
- "OrderRecord",
3124
- "@entity.id"
3125
- ],
3126
- [
3127
- "render-ui",
3128
- "modal",
3129
- null
3130
- ],
3131
- [
3132
- "fetch",
3133
- "OrderRecord"
3134
- ],
3135
- [
3136
- "notify",
3137
- "OrderRecord deleted successfully"
3138
- ]
3139
- ]
3140
- },
3141
- {
3142
- "from": "deleting",
3143
- "to": "browsing",
3144
- "event": "CANCEL",
3145
- "effects": [
3146
- [
3147
- "render-ui",
3148
- "modal",
3149
- null
3150
- ]
3151
- ]
3152
- },
3153
- {
3154
- "from": "deleting",
3155
- "to": "browsing",
3156
- "event": "CLOSE",
3157
- "effects": [
3158
- [
3159
- "render-ui",
3160
- "modal",
3161
- null
3162
- ]
3163
- ]
3164
3924
  }
3165
3925
  ]
3166
3926
  }